harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From smish...@apache.org
Subject svn commit: r407526 - in /incubator/harmony/enhanced/classlib/trunk/modules/luni/src: main/java/java/util/Calendar.java test/java/tests/api/java/util/CalendarTest.java
Date Thu, 18 May 2006 11:17:01 GMT
Author: smishura
Date: Thu May 18 04:17:01 2006
New Revision: 407526

URL: http://svn.apache.org/viewvc?rev=407526&view=rev
Log:
Apply updated patch for HARMONY-475 (java.util.Calendar.clone() does not deep clone the time
zone)

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

Modified: incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/Calendar.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/Calendar.java?rev=407526&r1=407525&r2=407526&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/Calendar.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/Calendar.java
Thu May 18 04:17:01 2006
@@ -222,6 +222,7 @@
 			Calendar clone = (Calendar) super.clone();
 			clone.fields = (int[]) fields.clone();
 			clone.isSet = (boolean[]) isSet.clone();
+			clone.zone = (TimeZone) zone.clone();
 			return clone;
 		} catch (CloneNotSupportedException e) {
 			return null;

Modified: incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/tests/api/java/util/CalendarTest.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/tests/api/java/util/CalendarTest.java?rev=407526&r1=407525&r2=407526&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/tests/api/java/util/CalendarTest.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/tests/api/java/util/CalendarTest.java
Thu May 18 04:17:01 2006
@@ -419,6 +419,19 @@
         assertEquals(-1, cal.compareTo(anotherCal));
     }
 
+    /**
+     * @tests java.util.Calendar#clone()
+     */
+    public void test_clone() {
+        // Regression for HARMONY-475
+        Calendar cal = Calendar.getInstance();
+        cal.set(2006, 5, 6, 11, 35);
+        Calendar anotherCal = (Calendar) cal.clone();
+        // should be deep clone
+        assertNotSame("getTimeZone", cal.getTimeZone(), anotherCal
+                .getTimeZone());
+    }
+
 	protected void setUp() {
 		defaultLocale = Locale.getDefault();
 		Locale.setDefault(Locale.US);



Mime
View raw message