harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mloe...@apache.org
Subject svn commit: r478839 - in /harmony/enhanced/classlib/trunk/modules/security/src: main/java/common/org/apache/harmony/security/asn1/ASN1GeneralizedTime.java test/impl/java/org/apache/harmony/security/tests/asn1/der/GeneralizedTimeTest.java
Date Fri, 24 Nov 2006 11:46:10 GMT
Author: mloenko
Date: Fri Nov 24 03:46:01 2006
New Revision: 478839

URL: http://svn.apache.org/viewvc?view=rev&rev=478839
Log:
applied patch for HARMONY-2302
[classlib][security] o.a.h.security.asn1.ASN1GeneralizedTime encodes milliseconds incorrectly

Modified:
    harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/org/apache/harmony/security/asn1/ASN1GeneralizedTime.java
    harmony/enhanced/classlib/trunk/modules/security/src/test/impl/java/org/apache/harmony/security/tests/asn1/der/GeneralizedTimeTest.java

Modified: harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/org/apache/harmony/security/asn1/ASN1GeneralizedTime.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/org/apache/harmony/security/asn1/ASN1GeneralizedTime.java?view=diff&rev=478839&r1=478838&r2=478839
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/org/apache/harmony/security/asn1/ASN1GeneralizedTime.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/org/apache/harmony/security/asn1/ASN1GeneralizedTime.java
Fri Nov 24 03:46:01 2006
@@ -96,7 +96,7 @@
     // four digit year, seconds always presented
     // and fractional-secons elements without
     // trailing 0's (must be cut later from content)
-    private final static String GEN_PATTERN = "yyyyMMddHHmmss.S"; //$NON-NLS-1$
+    private final static String GEN_PATTERN = "yyyyMMddHHmmss.SSS"; //$NON-NLS-1$
 
     public void setEncodingContent(BerOutputStream out) {
 

Modified: harmony/enhanced/classlib/trunk/modules/security/src/test/impl/java/org/apache/harmony/security/tests/asn1/der/GeneralizedTimeTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/security/src/test/impl/java/org/apache/harmony/security/tests/asn1/der/GeneralizedTimeTest.java?view=diff&rev=478839&r1=478838&r2=478839
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/security/src/test/impl/java/org/apache/harmony/security/tests/asn1/der/GeneralizedTimeTest.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/security/src/test/impl/java/org/apache/harmony/security/tests/asn1/der/GeneralizedTimeTest.java
Fri Nov 24 03:46:01 2006
@@ -141,6 +141,14 @@
         assertEquals(old_date, new_date);
     }
     
+    public void test_EncodeMilliseconds() throws IOException{
+        //cRegression for HARMONY-2302
+        long old_date = 1164358741071L;
+        long new_date = ((Date) gtime.decode(gtime.encode(new Date(old_date))))
+                .getTime();
+        assertEquals(old_date, new_date);
+    }
+    
     public static void main(String[] args) {
         junit.textui.TestRunner.run(GeneralizedTimeTest.class);
     }



Mime
View raw message