harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From py...@apache.org
Subject svn commit: r438032 - in /incubator/harmony/enhanced/classlib/trunk/modules/luni/src: main/java/java/util/SimpleTimeZone.java test/java/tests/api/java/util/SimpleTimeZoneTest.java
Date Tue, 29 Aug 2006 09:37:09 GMT
Author: pyang
Date: Tue Aug 29 02:37:08 2006
New Revision: 438032

URL: http://svn.apache.org/viewvc?rev=438032&view=rev
Log:
Patch applied for HARMONY-1241 ([classlib][util] unexpected IllegalArgumentException for java.util.SimpleTimeZone(13
params))

Modified:
    incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/SimpleTimeZone.java
    incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/tests/api/java/util/SimpleTimeZoneTest.java

Modified: incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/SimpleTimeZone.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/SimpleTimeZone.java?rev=438032&r1=438031&r2=438032&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/SimpleTimeZone.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/SimpleTimeZone.java
Tue Aug 29 02:37:08 2006
@@ -211,17 +211,7 @@
 
 		this(offset, name, startMonth, startDay, startDayOfWeek, startTime,
 				endMonth, endDay, endDayOfWeek, endTime, daylightSavings);
-
-		if (startTimeMode > 4 || startTimeMode < 1) {
-			throw new IllegalArgumentException(org.apache.harmony.luni.util.Msg.getString(
-					"K00e9", startTimeMode)); //$NON-NLS-1$
-		}
 		startMode = startTimeMode;
-
-		if (endTimeMode > 4 || endTimeMode < 1) {
-			throw new IllegalArgumentException(org.apache.harmony.luni.util.Msg.getString(
-					"K00e9", endTimeMode)); //$NON-NLS-1$
-		}
 		endMode = endTimeMode;
 	}
 

Modified: incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/tests/api/java/util/SimpleTimeZoneTest.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/tests/api/java/util/SimpleTimeZoneTest.java?rev=438032&r1=438031&r2=438032&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/tests/api/java/util/SimpleTimeZoneTest.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/tests/api/java/util/SimpleTimeZoneTest.java
Tue Aug 29 02:37:08 2006
@@ -93,6 +93,37 @@
 		// Test for method java.util.SimpleTimeZone(int, java.lang.String, int,
 		// int, int, int, int, int, int, int, int, int, int)
 		// TODO : Implement test
+		//Regression for HARMONY-1241
+		assertNotNull(new SimpleTimeZone(
+                TimeZone.LONG,
+                "Europe/Paris",
+                SimpleTimeZone.STANDARD_TIME,
+                SimpleTimeZone.STANDARD_TIME,
+                SimpleTimeZone.UTC_TIME,
+                SimpleTimeZone.WALL_TIME,
+                SimpleTimeZone.WALL_TIME,
+                TimeZone.SHORT,
+                SimpleTimeZone.STANDARD_TIME,
+                TimeZone.LONG,
+                SimpleTimeZone.UTC_TIME,
+                SimpleTimeZone.STANDARD_TIME,
+                TimeZone.LONG));
+        //seems RI doesn't check the startTimeMode and endTimeMode at all
+        //this behavior is contradicts with spec
+        assertNotNull(new SimpleTimeZone(
+                TimeZone.LONG,
+                "Europe/Paris",
+                SimpleTimeZone.STANDARD_TIME,
+                SimpleTimeZone.STANDARD_TIME,
+                SimpleTimeZone.UTC_TIME,
+                SimpleTimeZone.WALL_TIME,
+                Integer.MAX_VALUE,
+                TimeZone.SHORT,
+                SimpleTimeZone.STANDARD_TIME,
+                TimeZone.LONG,
+                SimpleTimeZone.UTC_TIME,
+                Integer.MIN_VALUE,
+                TimeZone.LONG));
 	}
 
 	/**



Mime
View raw message