harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ton...@apache.org
Subject svn commit: r593469 - in /harmony/enhanced/classlib/trunk/modules/luni/src: main/java/java/util/ test/api/common/tests/api/java/util/
Date Fri, 09 Nov 2007 10:00:23 GMT
Author: tonywu
Date: Fri Nov  9 02:00:22 2007
New Revision: 593469

URL: http://svn.apache.org/viewvc?rev=593469&view=rev
Log:
fix the regression that we have different locale data for Europe/London, along with some fixes
for other difference against RI

Modified:
    harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/SimpleTimeZone.java
    harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/TimeZone.java
    harmony/enhanced/classlib/trunk/modules/luni/src/test/api/common/tests/api/java/util/GregorianCalendarTest.java
    harmony/enhanced/classlib/trunk/modules/luni/src/test/api/common/tests/api/java/util/SimpleTimeZoneTest.java
    harmony/enhanced/classlib/trunk/modules/luni/src/test/api/common/tests/api/java/util/TimeZoneTest.java

Modified: harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/SimpleTimeZone.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/SimpleTimeZone.java?rev=593469&r1=593468&r2=593469&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/SimpleTimeZone.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/SimpleTimeZone.java
Fri Nov  9 02:00:22 2007
@@ -69,6 +69,10 @@
 
 	private int dstSavings = 3600000;
 
+    private transient com.ibm.icu.util.TimeZone icuTZ;
+    
+    private boolean isSimple;
+
 	/**
 	 * Constructs a new SimpleTimeZone using the specified offset for standard
 	 * time from GMT and the specified time zone ID.
@@ -78,10 +82,15 @@
 	 * @param name
 	 *            the time zone ID
 	 */
-	public SimpleTimeZone(int offset, String name) {
-		setID(name);
-		rawOffset = offset;
-	}
+    public SimpleTimeZone(int offset, String name) {
+        setID(name);
+        rawOffset = offset;
+        icuTZ = com.ibm.icu.util.TimeZone.getTimeZone(name);
+        if (icuTZ instanceof com.ibm.icu.util.SimpleTimeZone) {
+            isSimple = true;
+            icuTZ.setRawOffset(offset);
+        }
+    }
 
 	/**
 	 * Constructs a new SimpleTimeZone using the specified offset for standard
@@ -156,18 +165,27 @@
 	 * @param daylightSavings
 	 *            the daylight savings time difference in milliseconds
 	 */
-	public SimpleTimeZone(int offset, String name, int startMonth,
-			int startDay, int startDayOfWeek, int startTime, int endMonth,
-			int endDay, int endDayOfWeek, int endTime, int daylightSavings) {
-		this(offset, name);
-		if (daylightSavings <= 0) {
-            throw new IllegalArgumentException(Msg.getString("K00e9", daylightSavings));
//$NON-NLS-1$
+    public SimpleTimeZone(int offset, String name, int startMonth,
+            int startDay, int startDayOfWeek, int startTime, int endMonth,
+            int endDay, int endDayOfWeek, int endTime, int daylightSavings) {
+        icuTZ = com.ibm.icu.util.TimeZone.getTimeZone(name);
+        if (icuTZ instanceof com.ibm.icu.util.SimpleTimeZone) {
+            isSimple = true;
+            icuTZ = new com.ibm.icu.util.SimpleTimeZone(offset, name,
+                    startMonth, startDay, startDayOfWeek, startTime, endMonth,
+                    endDay, endDayOfWeek, endTime, daylightSavings);
+        }
+        setID(name);
+        rawOffset = offset;
+        if (daylightSavings <= 0) {
+            throw new IllegalArgumentException(Msg.getString(
+                    "K00e9", daylightSavings)); //$NON-NLS-1$
         }
-		dstSavings = daylightSavings;
+        dstSavings = daylightSavings;
 
-		setStartRule(startMonth, startDay, startDayOfWeek, startTime);
-		setEndRule(endMonth, endDay, endDayOfWeek, endTime);
-	}
+        setStartRule(startMonth, startDay, startDayOfWeek, startTime);
+        setEndRule(endMonth, endDay, endDayOfWeek, endTime);
+    }
 
 	/**
 	 * Constructs a new SimpleTimeZone using the specified offset for standard
@@ -303,132 +321,16 @@
 	 */
 	@Override
     public int getOffset(int era, int year, int month, int day, int dayOfWeek,
-			int time) {
-		if (era != GregorianCalendar.BC && era != GregorianCalendar.AD) {
+            int time) {
+        if (era != GregorianCalendar.BC && era != GregorianCalendar.AD) {
             throw new IllegalArgumentException(Msg.getString("K00ea", era)); //$NON-NLS-1$
         }
-		checkRange(month, dayOfWeek, time);
-		if (month != Calendar.FEBRUARY || day != 29 || !isLeapYear(year)) {
+        checkRange(month, dayOfWeek, time);
+        if (month != Calendar.FEBRUARY || day != 29 || !isLeapYear(year)) {
             checkDay(month, day);
         }
-
-		if (!useDaylightTime() || era != GregorianCalendar.AD
-				|| year < startYear) {
-            return rawOffset;
-        }
-		if (endMonth < startMonth) {
-			if (month > endMonth && month < startMonth) {
-                return rawOffset;
-            }
-		} else {
-			if (month < startMonth || month > endMonth) {
-                return rawOffset;
-            }
-		}
-
-		int ruleDay = 0, daysInMonth, firstDayOfMonth = mod7(dayOfWeek - day);
-		if (month == startMonth) {
-			switch (startMode) {
-			case DOM_MODE:
-				ruleDay = startDay;
-				break;
-			case DOW_IN_MONTH_MODE:
-				if (startDay >= 0) {
-					ruleDay = mod7(startDayOfWeek - firstDayOfMonth) + 1
-							+ (startDay - 1) * 7;
-				} else {
-					daysInMonth = GregorianCalendar.DaysInMonth[startMonth];
-					if (startMonth == Calendar.FEBRUARY && isLeapYear(year)) {
-                        daysInMonth += 1;
-                    }
-					ruleDay = daysInMonth
-							+ 1
-							+ mod7(startDayOfWeek
-									- (firstDayOfMonth + daysInMonth))
-							+ startDay * 7;
-				}
-				break;
-			case DOW_GE_DOM_MODE:
-				ruleDay = startDay
-						+ mod7(startDayOfWeek
-								- (firstDayOfMonth + startDay - 1));
-				break;
-			case DOW_LE_DOM_MODE:
-				ruleDay = startDay
-						+ mod7(startDayOfWeek
-								- (firstDayOfMonth + startDay - 1));
-				if (ruleDay != startDay) {
-                    ruleDay -= 7;
-                }
-				break;
-			}
-			if (ruleDay > day || ruleDay == day && time < startTime) {
-                return rawOffset;
-            }
-		}
-
-		int ruleTime = endTime - dstSavings;
-		int nextMonth = (month + 1) % 12;
-		if (month == endMonth || (ruleTime < 0 && nextMonth == endMonth)) {
-			switch (endMode) {
-			case DOM_MODE:
-				ruleDay = endDay;
-				break;
-			case DOW_IN_MONTH_MODE:
-				if (endDay >= 0) {
-					ruleDay = mod7(endDayOfWeek - firstDayOfMonth) + 1
-							+ (endDay - 1) * 7;
-				} else {
-					daysInMonth = GregorianCalendar.DaysInMonth[endMonth];
-					if (endMonth == Calendar.FEBRUARY && isLeapYear(year)) {
-                        daysInMonth++;
-                    }
-					ruleDay = daysInMonth
-							+ 1
-							+ mod7(endDayOfWeek
-									- (firstDayOfMonth + daysInMonth)) + endDay
-							* 7;
-				}
-				break;
-			case DOW_GE_DOM_MODE:
-				ruleDay = endDay
-						+ mod7(endDayOfWeek - (firstDayOfMonth + endDay - 1));
-				break;
-			case DOW_LE_DOM_MODE:
-				ruleDay = endDay
-						+ mod7(endDayOfWeek - (firstDayOfMonth + endDay - 1));
-				if (ruleDay != endDay) {
-                    ruleDay -= 7;
-                }
-				break;
-			}
-
-			int ruleMonth = endMonth;
-			if (ruleTime < 0) {
-				int changeDays = 1 - (ruleTime / 86400000);
-				ruleTime = (ruleTime % 86400000) + 86400000;
-				ruleDay -= changeDays;
-				if (ruleDay <= 0) {
-					if (--ruleMonth < Calendar.JANUARY) {
-                        ruleMonth = Calendar.DECEMBER;
-                    }
-					ruleDay += GregorianCalendar.DaysInMonth[ruleMonth];
-					if (ruleMonth == Calendar.FEBRUARY && isLeapYear(year)) {
-                        ruleDay++;
-                    }
-				}
-			}
-
-			if (month == ruleMonth) {
-				if (ruleDay < day || ruleDay == day && time >= ruleTime) {
-                    return rawOffset;
-                }
-			} else if (nextMonth != ruleMonth) {
-                return rawOffset;
-            }
-		}
-		return rawOffset + dstSavings;
-	}
+        return icuTZ.getOffset(era, year, month, day, dayOfWeek, time);
+    }
 
 	/**
 	 * Gets the offset from GMT of this SimpleTimeZone for the specified date.
@@ -441,13 +343,7 @@
 	 */
 	@Override
     public int getOffset(long time) {
-		if (!useDaylightTime()) {
-            return rawOffset;
-        }
-		if (daylightSavings == null) {
-            daylightSavings = new GregorianCalendar(this);
-        }
-		return daylightSavings.getOffset(time + rawOffset);
+        return icuTZ.getOffset(time);
 	}
 
 	/**
@@ -520,15 +416,7 @@
 	 */
 	@Override
     public boolean inDaylightTime(Date time) {
-		// check for null pointer
-		long millis = time.getTime();
-		if (!useDaylightTime()) {
-            return false;
-        }
-		if (daylightSavings == null) {
-            daylightSavings = new GregorianCalendar(this);
-        }
-		return daylightSavings.getOffset(millis + rawOffset) != rawOffset;
+		return icuTZ.inDaylightTime(time);
 	}
 
 	private boolean isLeapYear(int year) {
@@ -538,11 +426,6 @@
         return year % 4 == 0;
 	}
 
-	private int mod7(int num1) {
-		int rem = num1 % 7;
-		return (num1 < 0 && rem < 0) ? 7 + rem : rem;
-	}
-
 	/**
 	 * Sets the daylight savings offset in milliseconds for this SimpleTimeZone.
 	 * 
@@ -620,10 +503,13 @@
 	 */
 	public void setEndRule(int month, int dayOfMonth, int time) {
 		endMonth = month;
-		endDay = dayOfMonth;
-		endDayOfWeek = 0; // Initialize this value for hasSameRules()
-		endTime = time;
-		setEndMode();
+        endDay = dayOfMonth;
+        endDayOfWeek = 0; // Initialize this value for hasSameRules()
+        endTime = time;
+        setEndMode();
+        if (isSimple) {
+            ((com.ibm.icu.util.SimpleTimeZone) icuTZ).setEndRule(month, dayOfMonth, time);
+        }
 	}
 
 	/**
@@ -647,6 +533,9 @@
 		endDayOfWeek = dayOfWeek;
 		endTime = time;
 		setEndMode();
+        if (isSimple) {
+            ((com.ibm.icu.util.SimpleTimeZone) icuTZ).setEndRule(month, day, dayOfWeek, time);
+        }
 	}
 
 	/**
@@ -672,6 +561,9 @@
 		endDayOfWeek = -dayOfWeek;
 		endTime = time;
 		setEndMode();
+        if (isSimple) {
+            ((com.ibm.icu.util.SimpleTimeZone) icuTZ).setEndRule(month, day, dayOfWeek, time,
after);
+        }
 	}
 
 	/**
@@ -734,6 +626,9 @@
 		startDayOfWeek = 0; // Initialize this value for hasSameRules()
 		startTime = time;
 		setStartMode();
+        if (isSimple) {
+            ((com.ibm.icu.util.SimpleTimeZone) icuTZ).setStartRule(month, dayOfMonth, time);
+        }
 	}
 
 	/**
@@ -757,6 +652,9 @@
 		startDayOfWeek = dayOfWeek;
 		startTime = time;
 		setStartMode();
+        if (isSimple) {
+            ((com.ibm.icu.util.SimpleTimeZone) icuTZ).setStartRule(month, day, dayOfWeek,
time);
+        }
 	}
 
 	/**
@@ -782,6 +680,9 @@
 		startDayOfWeek = -dayOfWeek;
 		startTime = time;
 		setStartMode();
+        if (isSimple) {
+            ((com.ibm.icu.util.SimpleTimeZone) icuTZ).setStartRule(month, day, dayOfWeek,
time, after);
+        }
 	}
 
 	/**
@@ -837,7 +738,7 @@
 	 */
 	@Override
     public boolean useDaylightTime() {
-		return useDaylight;
+		return icuTZ.useDaylightTime();
 	}
 
 	private static final ObjectStreamField[] serialPersistentFields = {

Modified: harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/TimeZone.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/TimeZone.java?rev=593469&r1=593468&r2=593469&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/TimeZone.java (original)
+++ harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/TimeZone.java Fri
Nov  9 02:00:22 2007
@@ -446,25 +446,7 @@
 	 */
 	public static synchronized void setDefault(TimeZone timezone) {
 		if (timezone != null) {
-            final com.ibm.icu.util.TimeZone icuTZ = com.ibm.icu.util.TimeZone
-                    .getTimeZone(timezone.getID());
-
-            AccessController
-                    .doPrivileged(new PrivilegedAction<java.lang.reflect.Field>() {
-                        public java.lang.reflect.Field run() {
-                            java.lang.reflect.Field field = null;
-                            try {
-                                field = com.ibm.icu.util.TimeZone.class
-                                        .getDeclaredField("defaultZone");
-                                field.setAccessible(true);
-                                field.set("defaultZone", icuTZ);
-                            } catch (Exception e) {
-                                return null;
-                            }
-                            return field;
-                        }
-                    });
-            
+            setICUDefaultTimeZone(timezone);
             Default = timezone;
             return;
 		}
@@ -500,9 +482,31 @@
 			}
 		} else {
 			// if property user.timezone is set in command line (with -D option)
-			Default = getTimeZone(zone);
+		    Default = getTimeZone(zone);
 		}
+		setICUDefaultTimeZone(Default);
 	}
+
+    private static void setICUDefaultTimeZone(TimeZone timezone) {
+        final com.ibm.icu.util.TimeZone icuTZ = com.ibm.icu.util.TimeZone
+                .getTimeZone(timezone.getID());
+
+        AccessController
+                .doPrivileged(new PrivilegedAction<java.lang.reflect.Field>() {
+                    public java.lang.reflect.Field run() {
+                        java.lang.reflect.Field field = null;
+                        try {
+                            field = com.ibm.icu.util.TimeZone.class
+                                    .getDeclaredField("defaultZone");
+                            field.setAccessible(true);
+                            field.set("defaultZone", icuTZ);
+                        } catch (Exception e) {
+                            return null;
+                        }
+                        return field;
+                    }
+                });
+    }
 
 	/**
 	 * Sets the ID of this TimeZone.

Modified: harmony/enhanced/classlib/trunk/modules/luni/src/test/api/common/tests/api/java/util/GregorianCalendarTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/luni/src/test/api/common/tests/api/java/util/GregorianCalendarTest.java?rev=593469&r1=593468&r2=593469&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/luni/src/test/api/common/tests/api/java/util/GregorianCalendarTest.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/luni/src/test/api/common/tests/api/java/util/GregorianCalendarTest.java
Fri Nov  9 02:00:22 2007
@@ -199,23 +199,23 @@
 		gc1 = new GregorianCalendar(TimeZone.getTimeZone("EST"));
 		gc1.set(1999, Calendar.APRIL, 3, 16, 0); // day before DST change
 		gc1.add(Calendar.MILLISECOND, 24 * 60 * 60 * 1000);
-		assertEquals("Wrong time after MILLISECOND change", 17, gc1
+		assertEquals("Wrong time after MILLISECOND change", 16, gc1
 				.get(Calendar.HOUR_OF_DAY));
 		gc1.set(1999, Calendar.APRIL, 3, 16, 0); // day before DST change
 		gc1.add(Calendar.SECOND, 24 * 60 * 60);
-		assertEquals("Wrong time after SECOND change", 17, gc1
+		assertEquals("Wrong time after SECOND change", 16, gc1
 				.get(Calendar.HOUR_OF_DAY));
 		gc1.set(1999, Calendar.APRIL, 3, 16, 0); // day before DST change
 		gc1.add(Calendar.MINUTE, 24 * 60);
-		assertEquals("Wrong time after MINUTE change", 17, gc1
+		assertEquals("Wrong time after MINUTE change", 16, gc1
 				.get(Calendar.HOUR_OF_DAY));
 		gc1.set(1999, Calendar.APRIL, 3, 16, 0); // day before DST change
 		gc1.add(Calendar.HOUR, 24);
-		assertEquals("Wrong time after HOUR change", 17, gc1
+		assertEquals("Wrong time after HOUR change", 16, gc1
 				.get(Calendar.HOUR_OF_DAY));
 		gc1.set(1999, Calendar.APRIL, 3, 16, 0); // day before DST change
 		gc1.add(Calendar.HOUR_OF_DAY, 24);
-		assertEquals("Wrong time after HOUR_OF_DAY change", 17, gc1
+		assertEquals("Wrong time after HOUR_OF_DAY change", 16, gc1
 				.get(Calendar.HOUR_OF_DAY));
 
 		gc1.set(1999, Calendar.APRIL, 3, 16, 0); // day before DST change

Modified: harmony/enhanced/classlib/trunk/modules/luni/src/test/api/common/tests/api/java/util/SimpleTimeZoneTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/luni/src/test/api/common/tests/api/java/util/SimpleTimeZoneTest.java?rev=593469&r1=593468&r2=593469&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/luni/src/test/api/common/tests/api/java/util/SimpleTimeZoneTest.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/luni/src/test/api/common/tests/api/java/util/SimpleTimeZoneTest.java
Fri Nov  9 02:00:22 2007
@@ -189,15 +189,15 @@
 	public void test_getOffsetIIIIII() {
 		// Test for method int java.util.SimpleTimeZone.getOffset(int, int, int,
 		// int, int, int)
-		st1 = (SimpleTimeZone) TimeZone.getTimeZone("EST");
+		TimeZone st1 = TimeZone.getTimeZone("EST");
 		assertTrue("Incorrect offset returned", st1.getOffset(
 				GregorianCalendar.AD, 1998, Calendar.NOVEMBER, 11,
 				Calendar.WEDNESDAY, 0) == -(5 * 60 * 60 * 1000));
 
-		st1 = (SimpleTimeZone) TimeZone.getTimeZone("EST");
-		assertTrue("Incorrect offset returned", st1.getOffset(
-				GregorianCalendar.AD, 1998, Calendar.JUNE, 11,
-				Calendar.THURSDAY, 0) == -(4 * 60 * 60 * 1000));
+        st1 = TimeZone.getTimeZone("EST");
+        assertEquals("Incorrect offset returned", -(5 * 60 * 60 * 1000), st1
+                .getOffset(GregorianCalendar.AD, 1998, Calendar.JUNE, 11,
+                        Calendar.THURSDAY, 0));
 	}
 
 	/**
@@ -251,9 +251,9 @@
 	public void test_inDaylightTimeLjava_util_Date() {
 		// Test for method boolean
 		// java.util.SimpleTimeZone.inDaylightTime(java.util.Date)
-		SimpleTimeZone zone = (SimpleTimeZone) TimeZone.getTimeZone("EST");
+		TimeZone zone = TimeZone.getTimeZone("EST");
 		GregorianCalendar gc = new GregorianCalendar(1998, Calendar.JUNE, 11);
-		assertTrue("Returned incorrect daylight value1", zone.inDaylightTime(gc
+		assertFalse("Returned incorrect daylight value1", zone.inDaylightTime(gc
 				.getTime()));
 		gc = new GregorianCalendar(1998, Calendar.NOVEMBER, 11);
 		assertTrue("Returned incorrect daylight value2", !(zone
@@ -263,20 +263,20 @@
 		assertTrue("Returned incorrect daylight value3", !(zone
 				.inDaylightTime(gc.getTime())));
 		Date date = new Date(gc.getTime().getTime() + 1000);
-		assertTrue("Returned incorrect daylight value4", zone
+		assertFalse("Returned incorrect daylight value4", zone
 				.inDaylightTime(date));
 		gc.set(1999, Calendar.OCTOBER, 31, 1, 0, 0);
 		assertTrue("Returned incorrect daylight value5", !(zone
 				.inDaylightTime(gc.getTime())));
 		date = new Date(gc.getTime().getTime() - 1000);
-		assertTrue("Returned incorrect daylight value6", zone
+		assertFalse("Returned incorrect daylight value6", zone
 				.inDaylightTime(date));
 
 		assertTrue("Returned incorrect daylight value7", !zone
 				.inDaylightTime(new Date(891752400000L + 7200000 - 1)));
-		assertTrue("Returned incorrect daylight value8", zone
+		assertFalse("Returned incorrect daylight value8", zone
 				.inDaylightTime(new Date(891752400000L + 7200000)));
-		assertTrue("Returned incorrect daylight value9", zone
+		assertFalse("Returned incorrect daylight value9", zone
 				.inDaylightTime(new Date(909288000000L + 7200000 - 1)));
 		assertTrue("Returned incorrect daylight value10", !zone
 				.inDaylightTime(new Date(909288000000L + 7200000)));
@@ -329,7 +329,7 @@
 	public void test_setEndRuleIIIIZ() {
 		// Test for method void java.util.SimpleTimeZone.setEndRule(int, int,
 		// int, int, boolean)
-		SimpleTimeZone st = (SimpleTimeZone) TimeZone.getDefault().clone();
+		SimpleTimeZone st = new SimpleTimeZone(1000, "Test_TZ");
 		// Spec indicates that both end and start must be set or result is
 		// undefined
 		st.setStartRule(Calendar.NOVEMBER, 8, Calendar.SUNDAY, 1, false);
@@ -410,7 +410,7 @@
 	public void test_setStartRuleIIIIZ() {
 		// Test for method void java.util.SimpleTimeZone.setStartRule(int, int,
 		// int, int, boolean)
-		SimpleTimeZone st = (SimpleTimeZone) TimeZone.getDefault().clone();
+		SimpleTimeZone st = new SimpleTimeZone(0, "Test"); ;
 		// Spec indicates that both end and start must be set or result is
 		// undefined
 		st.setStartRule(Calendar.NOVEMBER, 1, Calendar.SUNDAY, 1, true);

Modified: harmony/enhanced/classlib/trunk/modules/luni/src/test/api/common/tests/api/java/util/TimeZoneTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/luni/src/test/api/common/tests/api/java/util/TimeZoneTest.java?rev=593469&r1=593468&r2=593469&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/luni/src/test/api/common/tests/api/java/util/TimeZoneTest.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/luni/src/test/api/common/tests/api/java/util/TimeZoneTest.java
Fri Nov  9 02:00:22 2007
@@ -80,7 +80,7 @@
 				.getTimeInMillis();
 		st1 = TimeZone.getTimeZone("EST");
 		assertEquals("T2. Incorrect offset returned",
-                             -(4 * ONE_HOUR), st1.getOffset(time2));
+                             -(5 * ONE_HOUR), st1.getOffset(time2));
 
 		// test on subclass Support_TimeZone, an instance with daylight savings
 		TimeZone tz1 = new Support_TimeZone(-5 * ONE_HOUR, true);



Mime
View raw message