Author: oheger
Date: Tue Aug 15 13:29:17 2006
New Revision: 431694

URL: http://svn.apache.org/viewvc?rev=431694&view=rev
Log:
Updated DataConfiguration.getDateArray() to make use of the passed in format 
argument; fixes CONFIGURATION-220

Modified:
    jakarta/commons/proper/configuration/trunk/RELEASE-NOTES.txt
    
jakarta/commons/proper/configuration/trunk/src/java/org/apache/commons/configuration/DataConfiguration.java
    
jakarta/commons/proper/configuration/trunk/src/test/org/apache/commons/configuration/TestDataConfiguration.java
    jakarta/commons/proper/configuration/trunk/xdocs/changes.xml

Modified: jakarta/commons/proper/configuration/trunk/RELEASE-NOTES.txt
URL: 
http://svn.apache.org/viewvc/jakarta/commons/proper/configuration/trunk/RELEASE-NOTES.txt?rev=431694&r1=431693&r2=431694&view=diff
==============================================================================
--- jakarta/commons/proper/configuration/trunk/RELEASE-NOTES.txt (original)
+++ jakarta/commons/proper/configuration/trunk/RELEASE-NOTES.txt Tue Aug 15 
13:29:17 2006
@@ -25,6 +25,8 @@
 CHANGES
 =======
 
+- DataConfiguration.getDateArray() used to ignore the format argument.
+  This was fixed. Fixes CONFIGURATION-220.
 - The dependency to servletapi was updated from version 2.3 to version 2.4, but
   version 2.3 will still work. Fixes CONFIGURATION-217.
 - A new class PropertiesConfigurationLayout was introduced whose task is to

Modified: 
jakarta/commons/proper/configuration/trunk/src/java/org/apache/commons/configuration/DataConfiguration.java
URL: 
http://svn.apache.org/viewvc/jakarta/commons/proper/configuration/trunk/src/java/org/apache/commons/configuration/DataConfiguration.java?rev=431694&r1=431693&r2=431694&view=diff
==============================================================================
--- 
jakarta/commons/proper/configuration/trunk/src/java/org/apache/commons/configuration/DataConfiguration.java
 (original)
+++ 
jakarta/commons/proper/configuration/trunk/src/java/org/apache/commons/configuration/DataConfiguration.java
 Tue Aug 15 13:29:17 2006
@@ -1825,7 +1825,7 @@
      */
     public Date[] getDateArray(String key, Date[] defaultValue, String format)
     {
-        List list = getDateList(key);
+        List list = getDateList(key, format);
         if (list.isEmpty())
         {
             return defaultValue;

Modified: 
jakarta/commons/proper/configuration/trunk/src/test/org/apache/commons/configuration/TestDataConfiguration.java
URL: 
http://svn.apache.org/viewvc/jakarta/commons/proper/configuration/trunk/src/test/org/apache/commons/configuration/TestDataConfiguration.java?rev=431694&r1=431693&r2=431694&view=diff
==============================================================================
--- 
jakarta/commons/proper/configuration/trunk/src/test/org/apache/commons/configuration/TestDataConfiguration.java
 (original)
+++ 
jakarta/commons/proper/configuration/trunk/src/test/org/apache/commons/configuration/TestDataConfiguration.java
 Tue Aug 15 13:29:17 2006
@@ -1320,6 +1320,20 @@
         ArrayAssert.assertEquals(new Date[] { }, conf.getDateArray("empty"));
     }
 
+    public void testGetDateArrayWithFormat() throws Exception
+    {
+        DateFormat format = new SimpleDateFormat("MM/dd/yyyy");
+        Date date1 = format.parse("01/01/2004");
+        Date date2 = format.parse("12/31/2004");
+        Date[] expected = new Date[]
+        { date1, date2 };
+
+        conf.addProperty("date.format", "01/01/2004");
+        conf.addProperty("date.format", "12/31/2004");
+        ArrayAssert.assertEquals("Wrong dates with format", expected, conf
+                .getDateArray("date.format", "MM/dd/yyyy"));
+    }
+
     public void testGetDateList() throws Exception
     {
         DateFormat format = new SimpleDateFormat("yyyy-MM-dd");

Modified: jakarta/commons/proper/configuration/trunk/xdocs/changes.xml
URL: 
http://svn.apache.org/viewvc/jakarta/commons/proper/configuration/trunk/xdocs/changes.xml?rev=431694&r1=431693&r2=431694&view=diff
==============================================================================
--- jakarta/commons/proper/configuration/trunk/xdocs/changes.xml (original)
+++ jakarta/commons/proper/configuration/trunk/xdocs/changes.xml Tue Aug 15 
13:29:17 2006
@@ -23,6 +23,10 @@
   <body>
 
     <release version="1.3-rc2" date="in SVN">
+      <action dev="oheger" type="update" issue="CONFIGURATION-220">
+        DataConfiguration.getDateArray() used to ignore the format argument.
+        This was fixed.
+      </action>
       <action dev="oheger" type="update" issue="CONFIGURATION-219">
         PropertiesConfiguration now defines its own clone() method to handle
         the associated PropertiesConfigurationLayout object correctly.



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to