harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From telli...@apache.org
Subject svn commit: r389475 - in /incubator/harmony/enhanced/classlib/trunk/modules/text/src: main/java/java/text/SimpleDateFormat.java test/java/tests/api/java/text/SimpleDateFormatTest.java
Date Tue, 28 Mar 2006 10:56:31 GMT
Author: tellison
Date: Tue Mar 28 02:56:21 2006
New Revision: 389475

URL: http://svn.apache.org/viewcvs?rev=389475&view=rev
Log:
Fix for HARMONY-209 (java.text.SimpleDateFormat.equals() behavior is not compatible with RI)

Modified:
    incubator/harmony/enhanced/classlib/trunk/modules/text/src/main/java/java/text/SimpleDateFormat.java
    incubator/harmony/enhanced/classlib/trunk/modules/text/src/test/java/tests/api/java/text/SimpleDateFormatTest.java

Modified: incubator/harmony/enhanced/classlib/trunk/modules/text/src/main/java/java/text/SimpleDateFormat.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/text/src/main/java/java/text/SimpleDateFormat.java?rev=389475&r1=389474&r2=389475&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/text/src/main/java/java/text/SimpleDateFormat.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/text/src/main/java/java/text/SimpleDateFormat.java
Tue Mar 28 02:56:21 2006
@@ -306,8 +306,10 @@
 	}
 
 	private void appendNumber(StringBuffer buffer, int count, int value) {
+		int minimumIntegerDigits = numberFormat.getMinimumIntegerDigits();
 		numberFormat.setMinimumIntegerDigits(count);
 		numberFormat.format(new Integer(value), buffer, new FieldPosition(0));
+		numberFormat.setMinimumIntegerDigits(minimumIntegerDigits);
 	}
 
 	/**

Modified: incubator/harmony/enhanced/classlib/trunk/modules/text/src/test/java/tests/api/java/text/SimpleDateFormatTest.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/text/src/test/java/tests/api/java/text/SimpleDateFormatTest.java?rev=389475&r1=389474&r2=389475&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/text/src/test/java/tests/api/java/text/SimpleDateFormatTest.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/text/src/test/java/tests/api/java/text/SimpleDateFormatTest.java
Tue Mar 28 02:56:21 2006
@@ -301,6 +301,12 @@
 		format.format(new Date());
 		assertTrue("not equal after format", format.equals(clone));
 	}
+	
+    public void test_equals_afterFormat() {
+        SimpleDateFormat df = new SimpleDateFormat();
+        df.format(new Date());
+        assertEquals(df, new SimpleDateFormat());
+    }
 
 	/**
 	 * @tests java.text.SimpleDateFormat#formatToCharacterIterator(java.lang.Object)



Mime
View raw message