directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pamarce...@apache.org
Subject svn commit: r752832 - in /directory/shared/trunk/ldap/src: main/java/org/apache/directory/shared/ldap/util/GeneralizedTime.java test/java/org/apache/directory/shared/ldap/util/GeneralizedTimeTest.java
Date Thu, 12 Mar 2009 10:54:22 GMT
Author: pamarcelot
Date: Thu Mar 12 10:54:16 2009
New Revision: 752832

URL: http://svn.apache.org/viewvc?rev=752832&view=rev
Log:
Fix for DIRSHARED-29 (GeneralizedTime.toString() generates wrong output when TimeZone has
hours < 10 and minutes > 10).

Modified:
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/util/GeneralizedTime.java
    directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/util/GeneralizedTimeTest.java

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/util/GeneralizedTime.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/util/GeneralizedTime.java?rev=752832&r1=752831&r2=752832&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/util/GeneralizedTime.java
(original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/util/GeneralizedTime.java
Thu Mar 12 10:54:16 2009
@@ -677,7 +677,7 @@
 
             if ( timeZoneFormat == TimeZoneFormat.DIFF_HOUR_MINUTE || timeZoneFormat == TimeZoneFormat.Z
)
             {
-                if ( hour < 10 )
+                if ( minute < 10 )
                 {
                     sb.append( '0' );
                 }

Modified: directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/util/GeneralizedTimeTest.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/util/GeneralizedTimeTest.java?rev=752832&r1=752831&r2=752832&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/util/GeneralizedTimeTest.java
(original)
+++ directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/util/GeneralizedTimeTest.java
Thu Mar 12 10:54:16 2009
@@ -1073,4 +1073,15 @@
         assertFalse( generalizedTime1.equals( null ) );
     }
 
+    /**
+     * Tests DIRSHARED-29 (GeneralizedTime.toString() generates wrong output 
+     * when TimeZone has hours < 10 and minutes > 10).
+     */
+    public void testDIRSHARED29() throws ParseException
+    {
+        String gt = "20090312123456+0130";
+        GeneralizedTime generalizedTime = new GeneralizedTime( gt );
+        String result = generalizedTime.toGeneralizedTime();
+        assertEquals( gt, result );
+    }
 }
\ No newline at end of file



Mime
View raw message