commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ebo...@apache.org
Subject svn commit: r645568 - in /commons/proper/configuration/trunk: conf/ src/java/org/apache/commons/configuration/plist/ src/test/org/apache/commons/configuration/plist/ xdocs/
Date Mon, 07 Apr 2008 15:37:46 GMT
Author: ebourg
Date: Mon Apr  7 08:37:45 2008
New Revision: 645568

URL: http://svn.apache.org/viewvc?rev=645568&view=rev
Log:
XMLPropertyListConfiguration now parses integer values as BigIntegers and real values as BigDecimals
(CONFIGURATION-320)

Modified:
    commons/proper/configuration/trunk/conf/test.plist.xml
    commons/proper/configuration/trunk/src/java/org/apache/commons/configuration/plist/XMLPropertyListConfiguration.java
    commons/proper/configuration/trunk/src/test/org/apache/commons/configuration/plist/TestXMLPropertyListConfiguration.java
    commons/proper/configuration/trunk/xdocs/changes.xml

Modified: commons/proper/configuration/trunk/conf/test.plist.xml
URL: http://svn.apache.org/viewvc/commons/proper/configuration/trunk/conf/test.plist.xml?rev=645568&r1=645567&r2=645568&view=diff
==============================================================================
--- commons/proper/configuration/trunk/conf/test.plist.xml (original)
+++ commons/proper/configuration/trunk/conf/test.plist.xml Mon Apr  7 08:37:45 2008
@@ -7,7 +7,7 @@
         <string>value1</string>
 
         <key>integer</key>
-        <integer>12345</integer>
+        <integer>12345678900</integer>
 
         <key>real</key>
         <real>-123.45E-1</real>

Modified: commons/proper/configuration/trunk/src/java/org/apache/commons/configuration/plist/XMLPropertyListConfiguration.java
URL: http://svn.apache.org/viewvc/commons/proper/configuration/trunk/src/java/org/apache/commons/configuration/plist/XMLPropertyListConfiguration.java?rev=645568&r1=645567&r2=645568&view=diff
==============================================================================
--- commons/proper/configuration/trunk/src/java/org/apache/commons/configuration/plist/XMLPropertyListConfiguration.java
(original)
+++ commons/proper/configuration/trunk/src/java/org/apache/commons/configuration/plist/XMLPropertyListConfiguration.java
Mon Apr  7 08:37:45 2008
@@ -22,6 +22,7 @@
 import java.io.Reader;
 import java.io.Writer;
 import java.math.BigDecimal;
+import java.math.BigInteger;
 import java.net.URL;
 import java.text.DateFormat;
 import java.text.ParseException;
@@ -651,7 +652,7 @@
          */
         public void addIntegerValue(String value)
         {
-            addValue(new Integer(value));
+            addValue(new BigInteger(value));
         }
 
         /**
@@ -661,7 +662,7 @@
          */
         public void addRealValue(String value)
         {
-            addValue(new Double(value));
+            addValue(new BigDecimal(value));
         }
 
         /**

Modified: commons/proper/configuration/trunk/src/test/org/apache/commons/configuration/plist/TestXMLPropertyListConfiguration.java
URL: http://svn.apache.org/viewvc/commons/proper/configuration/trunk/src/test/org/apache/commons/configuration/plist/TestXMLPropertyListConfiguration.java?rev=645568&r1=645567&r2=645568&view=diff
==============================================================================
--- commons/proper/configuration/trunk/src/test/org/apache/commons/configuration/plist/TestXMLPropertyListConfiguration.java
(original)
+++ commons/proper/configuration/trunk/src/test/org/apache/commons/configuration/plist/TestXMLPropertyListConfiguration.java
Mon Apr  7 08:37:45 2008
@@ -52,7 +52,7 @@
 
     public void testInteger() throws Exception
     {
-        assertEquals("'integer' property", 12345, config.getInt("integer"));
+        assertEquals("'integer' property", 12345678900L, config.getLong("integer"));
     }
 
     public void testReal() throws Exception

Modified: commons/proper/configuration/trunk/xdocs/changes.xml
URL: http://svn.apache.org/viewvc/commons/proper/configuration/trunk/xdocs/changes.xml?rev=645568&r1=645567&r2=645568&view=diff
==============================================================================
--- commons/proper/configuration/trunk/xdocs/changes.xml (original)
+++ commons/proper/configuration/trunk/xdocs/changes.xml Mon Apr  7 08:37:45 2008
@@ -23,6 +23,9 @@
 
   <body>
     <release version="1.6" date="in SVN" description="">
+      <action dev="ebourg" type="fix" issue="CONFIGURATION-320">
+        XMLPropertyListConfiguration is no longer limited to 32 bits integers.
+      </action>
       <action dev="oheger" type="fix" issue="CONFIGURATION-318">
         When an XMLConfiguration is created using the copy constructor, the name
         of the root element is now preserved.



Mime
View raw message