OSDN Git Service

* java/util/TimeZone.java (getDefaultDisplayName): Don't
authorjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 26 Feb 2007 11:01:55 +0000 (11:01 +0000)
committerjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 26 Feb 2007 11:01:55 +0000 (11:01 +0000)
check if TimeZone is instanceof SimpleTimeZone.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@122330 138bc75d-0d04-0410-961f-82ee72b054a4

libjava/classpath/ChangeLog.gcj
libjava/classpath/java/util/TimeZone.java

index b76844a..0c980f8 100644 (file)
@@ -1,3 +1,8 @@
+2007-02-26  Jakub Jelinek  <jakub@redhat.com>
+
+       * java/util/TimeZone.java (getDefaultDisplayName): Don't
+       check if TimeZone is instanceof SimpleTimeZone.
+
 2007-02-21  Gary Benson  <gbenson@redhat.com>
 
        * java/util/GregorianCalendar.java,
index cede9fc..5329e06 100644 (file)
@@ -1402,14 +1402,7 @@ public abstract class TimeZone implements java.io.Serializable, Cloneable
 
   private String getDefaultDisplayName(boolean dst)
   {
-    int offset = getRawOffset();
-    if (dst && this instanceof SimpleTimeZone)
-      {
-       // ugly, but this is a design failure of the API:
-       // getDisplayName takes a dst parameter even though
-       // TimeZone knows nothing about daylight saving offsets.
-       offset += ((SimpleTimeZone) this).getDSTSavings();
-      }
+    int offset = getRawOffset() + (dst ? getDSTSavings() : 0);
 
     StringBuffer sb = new StringBuffer(9);
     sb.append("GMT");