jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ste...@apache.org
Subject svn commit: r915777 - in /jackrabbit/trunk: jackrabbit-jcr-commons/src/main/java/org/apache/jackrabbit/util/ISO8601.java jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/ISO8601.java
Date Wed, 24 Feb 2010 13:17:48 GMT
Author: stefan
Date: Wed Feb 24 13:17:47 2010
New Revision: 915777

URL: http://svn.apache.org/viewvc?rev=915777&view=rev
Log:
JCR-2515: ISO8601 uses default DecimalFormat constructor using locale specific digits

Modified:
    jackrabbit/trunk/jackrabbit-jcr-commons/src/main/java/org/apache/jackrabbit/util/ISO8601.java
    jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/ISO8601.java

Modified: jackrabbit/trunk/jackrabbit-jcr-commons/src/main/java/org/apache/jackrabbit/util/ISO8601.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-jcr-commons/src/main/java/org/apache/jackrabbit/util/ISO8601.java?rev=915777&r1=915776&r2=915777&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-jcr-commons/src/main/java/org/apache/jackrabbit/util/ISO8601.java
(original)
+++ jackrabbit/trunk/jackrabbit-jcr-commons/src/main/java/org/apache/jackrabbit/util/ISO8601.java
Wed Feb 24 13:17:47 2010
@@ -304,12 +304,12 @@
             n = -n;
         }
 
-        int exp = 1;
-        while (exp < precision) {
+        for (int exp = precision - 1; exp > 0; exp--) {
             if (n < Math.pow(10, exp)) {
                 buf.append('0');
+            } else {
+                break;
             }
-            exp++;
         }
         buf.append(n);
     }

Modified: jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/ISO8601.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/ISO8601.java?rev=915777&r1=915776&r2=915777&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/ISO8601.java
(original)
+++ jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/ISO8601.java
Wed Feb 24 13:17:47 2010
@@ -304,12 +304,12 @@
             n = -n;
         }
 
-        int exp = 1;
-        while (exp < precision) {
+        for (int exp = precision - 1; exp > 0; exp--) {
             if (n < Math.pow(10, exp)) {
                 buf.append('0');
+            } else {
+                break;
             }
-            exp++;
         }
         buf.append(n);
     }



Mime
View raw message