You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by eb...@apache.org on 2008/04/07 17:50:31 UTC

svn commit: r645575 - in /commons/proper/configuration/branches/configuration2_experimental: src/main/java/org/apache/commons/configuration2/plist/ src/test/java/org/apache/commons/configuration2/plist/ src/test/resources/ xdocs/

Author: ebourg
Date: Mon Apr  7 08:50:29 2008
New Revision: 645575

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

Modified:
    commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/plist/XMLPropertyListConfiguration.java
    commons/proper/configuration/branches/configuration2_experimental/src/test/java/org/apache/commons/configuration2/plist/TestXMLPropertyListConfiguration.java
    commons/proper/configuration/branches/configuration2_experimental/src/test/resources/test.plist.xml
    commons/proper/configuration/branches/configuration2_experimental/xdocs/changes.xml

Modified: commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/plist/XMLPropertyListConfiguration.java
URL: http://svn.apache.org/viewvc/commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/plist/XMLPropertyListConfiguration.java?rev=645575&r1=645574&r2=645575&view=diff
==============================================================================
--- commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/plist/XMLPropertyListConfiguration.java (original)
+++ commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/plist/XMLPropertyListConfiguration.java Mon Apr  7 08:50:29 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;
@@ -647,7 +648,7 @@
          */
         public void addIntegerValue(String value)
         {
-            addValue(new Integer(value));
+            addValue(new BigInteger(value));
         }
 
         /**
@@ -657,7 +658,7 @@
          */
         public void addRealValue(String value)
         {
-            addValue(new Double(value));
+            addValue(new BigDecimal(value));
         }
 
         /**

Modified: commons/proper/configuration/branches/configuration2_experimental/src/test/java/org/apache/commons/configuration2/plist/TestXMLPropertyListConfiguration.java
URL: http://svn.apache.org/viewvc/commons/proper/configuration/branches/configuration2_experimental/src/test/java/org/apache/commons/configuration2/plist/TestXMLPropertyListConfiguration.java?rev=645575&r1=645574&r2=645575&view=diff
==============================================================================
--- commons/proper/configuration/branches/configuration2_experimental/src/test/java/org/apache/commons/configuration2/plist/TestXMLPropertyListConfiguration.java (original)
+++ commons/proper/configuration/branches/configuration2_experimental/src/test/java/org/apache/commons/configuration2/plist/TestXMLPropertyListConfiguration.java Mon Apr  7 08:50:29 2008
@@ -27,7 +27,6 @@
 import org.apache.commons.configuration2.ConfigurationAssert;
 import org.apache.commons.configuration2.ConfigurationComparator;
 import org.apache.commons.configuration2.FileConfiguration;
-import org.apache.commons.configuration2.HierarchicalConfiguration;
 import org.apache.commons.configuration2.InMemoryConfiguration;
 import org.apache.commons.configuration2.StrictConfigurationComparator;
 
@@ -58,7 +57,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/branches/configuration2_experimental/src/test/resources/test.plist.xml
URL: http://svn.apache.org/viewvc/commons/proper/configuration/branches/configuration2_experimental/src/test/resources/test.plist.xml?rev=645575&r1=645574&r2=645575&view=diff
==============================================================================
--- commons/proper/configuration/branches/configuration2_experimental/src/test/resources/test.plist.xml (original)
+++ commons/proper/configuration/branches/configuration2_experimental/src/test/resources/test.plist.xml Mon Apr  7 08:50:29 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/branches/configuration2_experimental/xdocs/changes.xml
URL: http://svn.apache.org/viewvc/commons/proper/configuration/branches/configuration2_experimental/xdocs/changes.xml?rev=645575&r1=645574&r2=645575&view=diff
==============================================================================
--- commons/proper/configuration/branches/configuration2_experimental/xdocs/changes.xml (original)
+++ commons/proper/configuration/branches/configuration2_experimental/xdocs/changes.xml Mon Apr  7 08:50:29 2008
@@ -66,6 +66,9 @@
     </release>
 
     <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.
@@ -91,6 +94,17 @@
         Fixed a NullPointerException that could be thrown under certain
         circumstances when saving an XMLConfiguration that was created using
         the constructor that takes a HierarchicalConfiguration.
+      </action>
+      <action dev="ebourg" type="fix" issue="CONFIGURATION-309">
+        Instantiating an XMLPropertyListConfiguration no longer fails
+        if the DTD is missing from the classpath.
+      </action>
+      <action dev="ebourg" type="fix" issue="CONFIGURATION-300">
+        It's now possible to read a configuration file containing
+        a '#' in its name (requires Java 1.4 or above).
+      </action>
+      <action dev="ebourg" type="fix" issue="CONFIGURATION-260">
+        Fixed the date format for XMLPropertyListConfiguration.
       </action>
     </release>