This is the mail archive of the java-patches@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Patch: FYI: PR 7786 fix


I'm checking this in.

This is the suggested fix from PR 7786.

Tom

Index: ChangeLog
from  Jesse Rosenstock  <jmr@ugcs.caltech.edu>
	* java/util/TimeZone.java (getDSTSavings): New method.
	Fixes PR libgcj/7786.

2002-09-25  Jesse Rosenstock  <jmr@ugcs.caltech.edu>

Index: java/util/TimeZone.java
===================================================================
RCS file: /cvs/gcc/gcc/libjava/java/util/TimeZone.java,v
retrieving revision 1.14
diff -u -r1.14 TimeZone.java
--- java/util/TimeZone.java 13 May 2002 20:10:36 -0000 1.14
+++ java/util/TimeZone.java 25 Sep 2002 21:09:32 -0000
@@ -961,6 +961,22 @@
   public abstract boolean inDaylightTime(Date date);
 
   /**
+   * Gets the daylight savings offset.  This is a positive offset in
+   * milliseconds with respect to standard time.  Typically this
+   * is one hour, but for some time zones this may be half an our.
+   * <p>The default implementation returns 3600000 milliseconds
+   * (one hour) if the time zone uses daylight savings time
+   * (as specified by {@link #useDaylightTime()}), otherwise
+   * it returns 0.
+   * @return the daylight savings offset in milliseconds.
+   * @since 1.4
+   */
+  public int getDSTSavings ()
+  {
+    return useDaylightTime () ? 3600000 : 0;
+  }
+
+  /**
    * Gets the TimeZone for the given ID.
    * @param ID the time zone identifier.
    * @return The time zone for the identifier or GMT, if no such time


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]