harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lian...@apache.org
Subject svn commit: r504827 - in /harmony/enhanced/classlib/trunk/modules/luni/src: main/java/java/util/GregorianCalendar.java test/java/tests/api/java/util/GregorianCalendarTest.java
Date Thu, 08 Feb 2007 08:56:30 GMT
Author: liangyx
Date: Thu Feb  8 00:56:29 2007
New Revision: 504827

URL: http://svn.apache.org/viewvc?view=rev&rev=504827
Log:
Fix HARMONY-3004([classlib][luni]GregorianCalendar.getActualMaximum(Calendar.DST_OFFSET) always
return 0)

Modified:
    harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/GregorianCalendar.java
    harmony/enhanced/classlib/trunk/modules/luni/src/test/java/tests/api/java/util/GregorianCalendarTest.java

Modified: harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/GregorianCalendar.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/GregorianCalendar.java?view=diff&rev=504827&r1=504826&r2=504827
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/GregorianCalendar.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/GregorianCalendar.java
Thu Feb  8 00:56:29 2007
@@ -913,6 +913,9 @@
                     result--;
                 }
                 break;
+            case DST_OFFSET:
+                result = getMaximum(DST_OFFSET);
+                break;
         }
         time = orgTime;
         return result;

Modified: harmony/enhanced/classlib/trunk/modules/luni/src/test/java/tests/api/java/util/GregorianCalendarTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/tests/api/java/util/GregorianCalendarTest.java?view=diff&rev=504827&r1=504826&r2=504827
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/luni/src/test/java/tests/api/java/util/GregorianCalendarTest.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/luni/src/test/java/tests/api/java/util/GregorianCalendarTest.java
Thu Feb  8 00:56:29 2007
@@ -312,6 +312,18 @@
         gc.setGregorianChange(date);
         gc.setTimeInMillis(Date.parse("Jan 16 00:00:01 GMT 2000"));
         assertEquals(353, gc.getActualMaximum(Calendar.DAY_OF_YEAR)); 
+        
+        //Regression test for HARMONY-3004
+        gc = new GregorianCalendar(1900, 7, 1);
+        String[] ids = TimeZone.getAvailableIDs();
+        for (int i = 0; i < ids.length; i++) {
+            TimeZone tz = TimeZone.getTimeZone(ids[i]);
+            gc.setTimeZone(tz);
+            for (int j = 1900; j < 2000; j++) {
+                gc.set(Calendar.YEAR, j);
+                assertEquals(7200000, gc.getActualMaximum(Calendar.DST_OFFSET));
+            }
+        }
 	}
 
 	/**



Mime
View raw message