You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by ep...@apache.org on 2004/10/18 23:38:45 UTC

cvs commit: jakarta-commons/configuration/src/java/org/apache/commons/configuration AbstractConfiguration.java CompositeConfiguration.java Configuration.java

epugh       2004/10/18 14:38:45

  Modified:    configuration/xdocs changes.xml
               configuration/src/test/org/apache/commons/configuration
                        TestDatabaseConfiguration.java
                        TestBaseConfiguration.java TestEqualBehaviour.java
                        TestCompositeConfiguration.java
                        TestPropertiesConfiguration.java
                        TestSubsetConfiguration.java
                        TestXMLConfiguration.java
                        BaseNonStringProperties.java
                        TestConfigurationConverter.java
                        TestThreesomeConfiguration.java
                        TestBaseNullConfiguration.java
                        TestNullCompositeConfiguration.java
                        NonStringTestHolder.java
               configuration/src/java/org/apache/commons/configuration
                        AbstractConfiguration.java
                        CompositeConfiguration.java Configuration.java
  Log:
  Remove deprecated Vector related methods.
  
  Revision  Changes    Path
  1.63      +3 -0      jakarta-commons/configuration/xdocs/changes.xml
  
  Index: changes.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/configuration/xdocs/changes.xml,v
  retrieving revision 1.62
  retrieving revision 1.63
  diff -u -r1.62 -r1.63
  --- changes.xml	18 Oct 2004 15:45:10 -0000	1.62
  +++ changes.xml	18 Oct 2004 21:38:45 -0000	1.63
  @@ -8,6 +8,9 @@
     <body>
   
       <release version="1.1-dev" date="in CVS">
  +      <action dev="ebourg" type="remove">
  +        Remove deprecated getVector() implementations. 
  +      </action>        
         <action dev="ebourg" type="add" issue="25661">
           File based configurations can now be automatically reloaded when the
           underlying file is modified.
  
  
  
  1.11      +1 -10     jakarta-commons/configuration/src/test/org/apache/commons/configuration/TestDatabaseConfiguration.java
  
  Index: TestDatabaseConfiguration.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/configuration/src/test/org/apache/commons/configuration/TestDatabaseConfiguration.java,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- TestDatabaseConfiguration.java	18 Oct 2004 14:05:23 -0000	1.10
  +++ TestDatabaseConfiguration.java	18 Oct 2004 21:38:45 -0000	1.11
  @@ -20,7 +20,6 @@
   import java.sql.SQLException;
   import java.util.Iterator;
   import java.util.List;
  -import java.util.Vector;
   
   import javax.sql.DataSource;
   
  @@ -28,7 +27,6 @@
   
   import org.apache.commons.configuration.test.HsqlDB;
   import org.apache.commons.dbcp.BasicDataSource;
  -
   import org.dbunit.database.DatabaseConnection;
   import org.dbunit.database.IDatabaseConnection;
   import org.dbunit.dataset.IDataSet;
  @@ -220,13 +218,6 @@
           DatabaseConfiguration config1 = new DatabaseConfiguration(datasource, "configurationList", "key", "value");
           List list = config1.getList("key3");
           assertEquals(3,list.size());
  -    }    
  -    
  -    public void testGetVector()
  -    {
  -        DatabaseConfiguration config1 = new DatabaseConfiguration(datasource, "configurationList", "key", "value");
  -        Vector vector = config1.getVector("key3");
  -        assertEquals(3,vector.size());
       }    
       
       public void testGetKeys()
  
  
  
  1.17      +1 -26     jakarta-commons/configuration/src/test/org/apache/commons/configuration/TestBaseConfiguration.java
  
  Index: TestBaseConfiguration.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/configuration/src/test/org/apache/commons/configuration/TestBaseConfiguration.java,v
  retrieving revision 1.16
  retrieving revision 1.17
  diff -u -r1.16 -r1.17
  --- TestBaseConfiguration.java	18 Oct 2004 10:44:31 -0000	1.16
  +++ TestBaseConfiguration.java	18 Oct 2004 21:38:45 -0000	1.17
  @@ -22,7 +22,6 @@
   import java.util.List;
   import java.util.NoSuchElementException;
   import java.util.Properties;
  -import java.util.Vector;
   
   import junit.framework.TestCase;
   import junitx.framework.ObjectAssert;
  @@ -402,30 +401,6 @@
           /*
            *  now test dan's new fix where we get the first scalar
            *  when we access a list valued property
  -         */
  -        try
  -        {
  -            config.getString("number");
  -        }
  -        catch (NoSuchElementException nsse)
  -        {
  -            fail("Should return a string");
  -        }
  -    }
  -
  -    public void testGetVector()
  -    {
  -        config.addProperty("number", "1");
  -        config.addProperty("number", "2");
  -        Vector vector = config.getVector("number");
  -        assertNotNull("The vector is null", vector);
  -        assertEquals("Vector size", 2, vector.size());
  -        assertTrue("The number 1 is missing from the vector", vector.contains("1"));
  -        assertTrue("The number 2 is missing from the vector", vector.contains("2"));
  -
  -        /*
  -         *  now test dan's new fix where we get the first scalar
  -         *  when we access a vector valued property
            */
           try
           {
  
  
  
  1.6       +1 -19     jakarta-commons/configuration/src/test/org/apache/commons/configuration/TestEqualBehaviour.java
  
  Index: TestEqualBehaviour.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/configuration/src/test/org/apache/commons/configuration/TestEqualBehaviour.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- TestEqualBehaviour.java	16 Aug 2004 22:16:31 -0000	1.5
  +++ TestEqualBehaviour.java	18 Oct 2004 21:38:45 -0000	1.6
  @@ -17,10 +17,8 @@
    */
   
   import java.io.File;
  -
   import java.util.Iterator;
   import java.util.List;
  -import java.util.Vector;
   
   import junit.framework.TestCase;
   
  @@ -111,22 +109,6 @@
           {
               assertEquals(msg + ", String Array: ", s1[i], s2[i]);
           }
  -
  -        Vector vector1 = c1.getVector(key);
  -        Vector vector2 = c2.getVector(key);
  -
  -        assertEquals(msg + ", Size: ", vector1.size(), vector2.size());
  -
  -        Iterator it1 = vector1.iterator();
  -        Iterator it2 = vector2.iterator();
  -
  -        while(it1.hasNext() && it2.hasNext())
  -        {
  -            String val1 = (String) it1.next();
  -            String val2 = (String) it2.next();
  -            assertEquals(msg + ", Vector: ", val1, val2);
  -        }
  -        assertEquals(msg + ", Iterator End: ", it1.hasNext(), it2.hasNext());
       }
   
       /**
  
  
  
  1.15      +2 -63     jakarta-commons/configuration/src/test/org/apache/commons/configuration/TestCompositeConfiguration.java
  
  Index: TestCompositeConfiguration.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/configuration/src/test/org/apache/commons/configuration/TestCompositeConfiguration.java,v
  retrieving revision 1.14
  retrieving revision 1.15
  diff -u -r1.14 -r1.15
  --- TestCompositeConfiguration.java	5 Oct 2004 22:56:58 -0000	1.14
  +++ TestCompositeConfiguration.java	18 Oct 2004 21:38:45 -0000	1.15
  @@ -21,7 +21,6 @@
   import java.util.Iterator;
   import java.util.List;
   import java.util.NoSuchElementException;
  -import java.util.Vector;
   
   import junit.framework.TestCase;
   
  @@ -78,10 +77,7 @@
           cc.addConfiguration(conf1);
           cc.addConfiguration(conf2);
           List l = cc.getList("packages");
  -        assertTrue(l.contains("packagea"));
  -
  -        Vector v = cc.getVector("packages");
  -        assertTrue(v.contains("packagea"));
  +        assertTrue(l.contains("packagea"));       
       }
   
       public void testGetProperty() throws Exception
  @@ -264,10 +260,6 @@
           // we should get 3 packages here
           assertEquals(3, packages.size());
   
  -        Vector vpackages = cc.getVector("packages");
  -        // we should get 3 packages here
  -        assertEquals(3, vpackages.size());
  -
           List defaultList = new ArrayList();
           defaultList.add("1");
           defaultList.add("2");
  @@ -276,13 +268,6 @@
           // we should get 2 packages here
           assertEquals(2, packages.size());
   
  -        Vector defaultVector = new Vector();
  -        defaultVector.add("1");
  -        defaultVector.add("2");
  -
  -        vpackages = cc.getVector("packages.which.dont.exist", defaultVector);
  -        // we should get 2 packages here
  -        assertEquals(2, vpackages.size());
       }
   
       /**
  @@ -332,52 +317,6 @@
           assertTrue("'value1' not found in the list", list.contains("value1"));
           assertTrue("'value2' not found in the list", list.contains("value2"));
           assertTrue("'value5' not found in the list", list.contains("value5"));
  -    }
  -
  -    public void testGetVector()
  -    {
  -        Configuration conf1 = new BaseConfiguration();
  -        conf1.addProperty("array", "value1");
  -        conf1.addProperty("array", "value2");
  -
  -        Configuration conf2 = new BaseConfiguration();
  -        conf2.addProperty("array", "value3");
  -        conf2.addProperty("array", "value4");
  -
  -        cc.addConfiguration(conf1);
  -        cc.addConfiguration(conf2);
  -
  -        // check the composite 'array' property
  -        Vector vector = cc.getVector("array");
  -        assertNotNull("null vector", vector);
  -        assertEquals("vector size", 2, vector.size());
  -        assertTrue("'value1' not found in the vector", vector.contains("value1"));
  -        assertTrue("'value2' not found in the vector", vector.contains("value2"));
  -
  -        // add an element to the vector in the composite configuration
  -        cc.addProperty("array", "value5");
  -
  -        List list = cc.getList("array");
  -
  -        for (Iterator it = list.iterator(); it.hasNext();)
  -        {
  -            Object value = it.next();
  -        }
  -
  -        Vector lVector = cc.getVector("array");
  -
  -        for (Iterator it = lVector.iterator(); it.hasNext();)
  -        {
  -            Object value = it.next();
  -        }
  -
  -        // test the new vector
  -        vector = cc.getVector("array");
  -        assertNotNull("null vector", vector);
  -        assertEquals("vector size", 3, vector.size());
  -        assertTrue("'value1' not found in the vector", vector.contains("value1"));
  -        assertTrue("'value2' not found in the vector", vector.contains("value2"));
  -        assertTrue("'value5' not found in the vector", vector.contains("value5"));
       }
   
       /**
  
  
  
  1.15      +1 -12     jakarta-commons/configuration/src/test/org/apache/commons/configuration/TestPropertiesConfiguration.java
  
  Index: TestPropertiesConfiguration.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/configuration/src/test/org/apache/commons/configuration/TestPropertiesConfiguration.java,v
  retrieving revision 1.14
  retrieving revision 1.15
  diff -u -r1.14 -r1.15
  --- TestPropertiesConfiguration.java	23 Sep 2004 11:47:57 -0000	1.14
  +++ TestPropertiesConfiguration.java	18 Oct 2004 21:38:45 -0000	1.15
  @@ -20,7 +20,6 @@
   import java.util.ArrayList;
   import java.util.Iterator;
   import java.util.List;
  -import java.util.Vector;
   
   import junit.framework.TestCase;
   
  @@ -100,16 +99,6 @@
       public void testList() throws Exception
       {
           List packages = conf.getList("packages");
  -        // we should get 3 packages here
  -        assertEquals(3, packages.size());
  -    }
  -
  -    /**
  -     * Tests <code>Vector</code> parsing.
  -     */
  -    public void testVector() throws Exception
  -    {
  -        Vector packages = conf.getVector("packages");
           // we should get 3 packages here
           assertEquals(3, packages.size());
       }
  
  
  
  1.7       +1 -13     jakarta-commons/configuration/src/test/org/apache/commons/configuration/TestSubsetConfiguration.java
  
  Index: TestSubsetConfiguration.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/configuration/src/test/org/apache/commons/configuration/TestSubsetConfiguration.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- TestSubsetConfiguration.java	5 Oct 2004 21:17:25 -0000	1.6
  +++ TestSubsetConfiguration.java	18 Oct 2004 21:38:45 -0000	1.7
  @@ -20,7 +20,6 @@
   import java.util.Iterator;
   import java.util.List;
   import java.util.NoSuchElementException;
  -import java.util.Vector;
   
   import junit.framework.TestCase;
   
  @@ -126,17 +125,6 @@
           Configuration subset = new SubsetConfiguration(conf, "test", ".");
           List list = subset.getList("abc", new ArrayList());
           assertEquals(3, list.size());
  -    }
  -
  -    public void testGetVector()
  -    {
  -        Configuration conf = new BaseConfiguration();
  -        conf.setProperty("test.abc", "value0,value1");
  -        conf.addProperty("test.abc", "value3");
  -
  -        Configuration subset = new SubsetConfiguration(conf, "test", ".");
  -        Vector vector = subset.getVector("abc", new Vector());
  -        assertEquals(3, vector.size());
       }
   
       public void testGetParent()
  
  
  
  1.15      +1 -25     jakarta-commons/configuration/src/test/org/apache/commons/configuration/TestXMLConfiguration.java
  
  Index: TestXMLConfiguration.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/configuration/src/test/org/apache/commons/configuration/TestXMLConfiguration.java,v
  retrieving revision 1.14
  retrieving revision 1.15
  diff -u -r1.14 -r1.15
  --- TestXMLConfiguration.java	11 Oct 2004 09:26:38 -0000	1.14
  +++ TestXMLConfiguration.java	18 Oct 2004 21:38:45 -0000	1.15
  @@ -20,7 +20,6 @@
   import java.io.IOException;
   import java.util.Iterator;
   import java.util.List;
  -import java.util.Vector;
   
   import junit.framework.TestCase;
   import junitx.framework.ArrayAssert;
  @@ -248,17 +247,6 @@
           assertTrue("test.boolean[@value]", conf.getBoolean("test.boolean[@value]"));
       }
   
  -    public void testAddVectorAttribute()
  -    {
  -        conf.addProperty("element3[@name]", "bar");
  -
  -        Vector vector = conf.getVector("element3[@name]");
  -        assertNotNull("null vector", vector);
  -        assertTrue("'foo' element missing", vector.contains("foo"));
  -        assertTrue("'bar' element missing", vector.contains("bar"));
  -        assertEquals("vector size", 2, vector.size());
  -    }
  -
       public void testAddList()
       {
           conf.addProperty("test.array", "value1");
  @@ -269,18 +257,6 @@
           assertTrue("'value1' element missing", list.contains("value1"));
           assertTrue("'value2' element missing", list.contains("value2"));
           assertEquals("list size", 2, list.size());
  -    }
  -
  -    public void testAddVector()
  -    {
  -        conf.addProperty("test.array", "value1");
  -        conf.addProperty("test.array", "value2");
  -
  -        Vector vector = conf.getVector("test.array");
  -        assertNotNull("null vector", vector);
  -        assertTrue("'value1' element missing", vector.contains("value1"));
  -        assertTrue("'value2' element missing", vector.contains("value2"));
  -        assertEquals("vector size", 2, vector.size());
       }
   
       public void testGetComplexProperty()
  
  
  
  1.7       +1 -13     jakarta-commons/configuration/src/test/org/apache/commons/configuration/BaseNonStringProperties.java
  
  Index: BaseNonStringProperties.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/configuration/src/test/org/apache/commons/configuration/BaseNonStringProperties.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- BaseNonStringProperties.java	16 Aug 2004 22:16:31 -0000	1.6
  +++ BaseNonStringProperties.java	18 Oct 2004 21:38:45 -0000	1.7
  @@ -46,7 +46,6 @@
           boolean booleanValue = conf.getBoolean("test.boolean");
           assertEquals(true, booleanValue);
           assertEquals(2, conf.getList("test.boolean.array").size());
  -        assertEquals(2, conf.getVector("test.boolean.array").size());
       }
   
       public void testByte() throws Exception
  @@ -60,7 +59,6 @@
           byte byteValue = conf.getByte("test.byte");
           assertEquals(testValue, byteValue);
           assertEquals(2, conf.getList("test.byte.array").size());
  -        assertEquals(2, conf.getVector("test.byte.array").size());
       }
   
       public void testDouble() throws Exception
  @@ -79,7 +77,6 @@
           double doubleValue = conf.getDouble("test.double");
           assertEquals(testValue, doubleValue, 0.01);
           assertEquals(2, conf.getList("test.double.array").size());
  -        assertEquals(2, conf.getVector("test.double.array").size());
       }
   
       public void testFloat() throws Exception
  @@ -99,7 +96,6 @@
           float floatValue = conf.getFloat("test.float");
           assertEquals(testValue, floatValue, 0.01);
           assertEquals(2, conf.getList("test.float.array").size());
  -        assertEquals(2, conf.getVector("test.float.array").size());
       }
   
       public void testInteger() throws Exception
  @@ -117,7 +113,6 @@
           int intValue = conf.getInt("test.integer");
           assertEquals(10, intValue);
           assertEquals(2, conf.getList("test.integer.array").size());
  -        assertEquals(2, conf.getVector("test.integer.array").size());
       }
   
       public void testLong() throws Exception
  @@ -133,7 +128,6 @@
           long longValue = conf.getLong("test.long");
           assertEquals(1000000, longValue);
           assertEquals(2, conf.getList("test.long.array").size());
  -        assertEquals(2, conf.getVector("test.long.array").size());
       }
   
       public void testShort() throws Exception
  @@ -150,17 +144,11 @@
           short shortValue = conf.getShort("test.short");
           assertEquals(1, shortValue);
           assertEquals(2, conf.getList("test.short.array").size());
  -        assertEquals(2, conf.getVector("test.short.array").size());
       }
   
       public void testListMissing() throws Exception
       {
           nonStringTestHolder.testListMissing();
  -    }
  -
  -    public void testVectorMissing() throws Exception
  -    {
  -        nonStringTestHolder.testVectorMissing();
       }
   
       public void testSubset() throws Exception
  
  
  
  1.8       +3 -9      jakarta-commons/configuration/src/test/org/apache/commons/configuration/TestConfigurationConverter.java
  
  Index: TestConfigurationConverter.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/configuration/src/test/org/apache/commons/configuration/TestConfigurationConverter.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- TestConfigurationConverter.java	18 Oct 2004 12:32:06 -0000	1.7
  +++ TestConfigurationConverter.java	18 Oct 2004 21:38:45 -0000	1.8
  @@ -17,11 +17,11 @@
   package org.apache.commons.configuration;
   
   import java.util.List;
  -import java.util.Properties;
  -import java.util.Vector;
   import java.util.Map;
  +import java.util.Properties;
   
   import junit.framework.TestCase;
  +
   import org.apache.commons.collections.ExtendedProperties;
   
   /**
  @@ -47,9 +47,6 @@
           List item1 = config.getList("list");
           assertEquals("This returns 'item 1'", "item 1", (String) item1.get(0));
   
  -        Vector item2 = config.getVector("list");
  -        assertEquals("This returns 'item 1'", "item 1", (String) item2.get(0));
  -
           assertEquals("This returns 123", 123, config.getInt("int"));
       }
   
  @@ -65,9 +62,6 @@
           assertEquals("This returns 'teststring'", "teststring", config.getString("string"));
           List item1 = config.getList("list");
           assertEquals("This returns 'item 1'", "item 1", (String) item1.get(0));
  -
  -        Vector item2 = config.getVector("list");
  -        assertEquals("This returns 'item 1'", "item 1", (String) item2.get(0));
   
           assertEquals("This returns 123", 123, config.getInt("int"));
       }
  
  
  
  1.3       +1 -32     jakarta-commons/configuration/src/test/org/apache/commons/configuration/TestThreesomeConfiguration.java
  
  Index: TestThreesomeConfiguration.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/configuration/src/test/org/apache/commons/configuration/TestThreesomeConfiguration.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- TestThreesomeConfiguration.java	22 Sep 2004 17:17:30 -0000	1.2
  +++ TestThreesomeConfiguration.java	18 Oct 2004 21:38:45 -0000	1.3
  @@ -17,7 +17,6 @@
    */
   
   import java.util.List;
  -import java.util.Vector;
   
   import junit.framework.TestCase;
   
  @@ -48,16 +47,6 @@
       }
   
       /**
  -     * Tests <code>Vector</code> parsing.
  -     */
  -    public void testVector1() throws Exception
  -    {
  -        Vector packages = conf.getVector("test.threesome.one");
  -        // we should get 3 packages here
  -        assertEquals(3, packages.size());
  -    }
  -
  -    /**
        * Tests <code>List</code> parsing.
        */
       public void testList2() throws Exception
  @@ -68,31 +57,11 @@
       }
   
       /**
  -     * Tests <code>Vector</code> parsing.
  -     */
  -    public void testVector2() throws Exception
  -    {
  -        Vector packages = conf.getVector("test.threesome.two");
  -        // we should get 3 packages here
  -        assertEquals(3, packages.size());
  -    }
  -
  -    /**
        * Tests <code>List</code> parsing.
        */
       public void testList3() throws Exception
       {
           List packages = conf.getList("test.threesome.three");
  -        // we should get 3 packages here
  -        assertEquals(3, packages.size());
  -    }
  -
  -    /**
  -     * Tests <code>Vector</code> parsing.
  -     */
  -    public void testVector3() throws Exception
  -    {
  -        Vector packages = conf.getVector("test.threesome.three");
           // we should get 3 packages here
           assertEquals(3, packages.size());
       }
  
  
  
  1.2       +1 -26     jakarta-commons/configuration/src/test/org/apache/commons/configuration/TestBaseNullConfiguration.java
  
  Index: TestBaseNullConfiguration.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/configuration/src/test/org/apache/commons/configuration/TestBaseNullConfiguration.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- TestBaseNullConfiguration.java	20 Sep 2004 19:46:26 -0000	1.1
  +++ TestBaseNullConfiguration.java	18 Oct 2004 21:38:45 -0000	1.2
  @@ -22,7 +22,6 @@
   import java.util.List;
   import java.util.NoSuchElementException;
   import java.util.Properties;
  -import java.util.Vector;
   
   import junit.framework.TestCase;
   import junitx.framework.ObjectAssert;
  @@ -333,30 +332,6 @@
   		/*
   		 *  now test dan's new fix where we get the first scalar
   		 *  when we access a list valued property
  -		 */
  -		try
  -		{
  -			config.getString("number");
  -		}
  -		catch (NoSuchElementException nsse)
  -		{
  -			fail("Should return a string");
  -		}
  -	}
  -
  -	public void testGetVector()
  -	{
  -		config.addProperty("number", "1");
  -		config.addProperty("number", "2");
  -		Vector vector = config.getVector("number");
  -		assertNotNull("The vector is null", vector);
  -		assertEquals("Vector size", 2, vector.size());
  -		assertTrue("The number 1 is missing from the vector", vector.contains("1"));
  -		assertTrue("The number 2 is missing from the vector", vector.contains("2"));
  -
  -		/*
  -		 *  now test dan's new fix where we get the first scalar
  -		 *  when we access a vector valued property
   		 */
   		try
   		{
  
  
  
  1.3       +1 -37     jakarta-commons/configuration/src/test/org/apache/commons/configuration/TestNullCompositeConfiguration.java
  
  Index: TestNullCompositeConfiguration.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/configuration/src/test/org/apache/commons/configuration/TestNullCompositeConfiguration.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- TestNullCompositeConfiguration.java	22 Sep 2004 17:17:30 -0000	1.2
  +++ TestNullCompositeConfiguration.java	18 Oct 2004 21:38:45 -0000	1.3
  @@ -20,7 +20,6 @@
   import java.util.ArrayList;
   import java.util.Iterator;
   import java.util.List;
  -import java.util.Vector;
   
   import junit.framework.TestCase;
   
  @@ -77,8 +76,6 @@
           List l = cc.getList("packages");
           assertTrue(l.contains("packagea"));
   
  -        Vector v = cc.getVector("packages");
  -        assertTrue(v.contains("packagea"));
       }
       
       public void testGetProperty() throws Exception
  @@ -256,10 +253,6 @@
           // we should get 3 packages here
           assertEquals(3, packages.size());
   
  -        Vector vpackages = cc.getVector("packages");
  -        // we should get 3 packages here
  -        assertEquals(3, vpackages.size());
  -
           List defaultList = new ArrayList();
           defaultList.add("1");
           defaultList.add("2");
  @@ -268,13 +261,6 @@
           // we should get 2 packages here
           assertEquals(2, packages.size());
   
  -        Vector defaultVector = new Vector();
  -        defaultVector.add("1");
  -        defaultVector.add("2");
  -
  -        vpackages = cc.getVector("packages.which.dont.exist", defaultVector);
  -        // we should get 2 packages here
  -        assertEquals(2, vpackages.size());
       }
   
       /**
  @@ -339,13 +325,6 @@
           cc.addConfiguration(conf1);
           cc.addConfiguration(conf2);
   
  -        // check the composite 'array' property
  -        Vector vector = cc.getVector("array");
  -        assertNotNull("null vector", vector);
  -        assertEquals("vector size", 2, vector.size());
  -        assertTrue("'value1' not found in the vector", vector.contains("value1"));
  -        assertTrue("'value2' not found in the vector", vector.contains("value2"));
  -
           // add an element to the vector in the composite configuration
           cc.addProperty("array", "value5");
   
  @@ -357,21 +336,6 @@
               System.out.println(value.getClass().getName() + " -> " + value);
           }
   
  -        Vector lVector = cc.getVector("array");
  -        
  -        for (Iterator it = lVector.iterator(); it.hasNext(); )
  -        {
  -            Object value = it.next();
  -            System.out.println(value.getClass().getName() + " -> " + value);
  -        }
  -
  -        // test the new vector
  -        vector = cc.getVector("array");
  -        assertNotNull("null vector", vector);
  -        assertEquals("vector size", 3, vector.size());
  -        assertTrue("'value1' not found in the vector", vector.contains("value1"));
  -        assertTrue("'value2' not found in the vector", vector.contains("value2"));
  -        assertTrue("'value5' not found in the vector", vector.contains("value5"));
       }
   
       /**
  
  
  
  1.9       +3 -17     jakarta-commons/configuration/src/test/org/apache/commons/configuration/NonStringTestHolder.java
  
  Index: NonStringTestHolder.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/configuration/src/test/org/apache/commons/configuration/NonStringTestHolder.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- NonStringTestHolder.java	16 Aug 2004 22:16:31 -0000	1.8
  +++ NonStringTestHolder.java	18 Oct 2004 21:38:45 -0000	1.9
  @@ -18,7 +18,6 @@
   
   import java.util.Iterator;
   import java.util.List;
  -import java.util.Vector;
   
   import junit.framework.Assert;
   
  @@ -41,8 +40,7 @@
       {
           boolean booleanValue = configuration.getBoolean("test.boolean");
           Assert.assertEquals(true, booleanValue);
  -        Assert.assertEquals(1, configuration.getList("test.boolean").size());
  -        Assert.assertEquals(1, configuration.getVector("test.boolean").size());
  +        Assert.assertEquals(1, configuration.getList("test.boolean").size());        
       }
   
       public void testBooleanDefaultValue() throws Exception
  @@ -60,7 +58,6 @@
           byte byteValue = configuration.getByte("test.byte");
           Assert.assertEquals(testValue, byteValue);
           Assert.assertEquals(1, configuration.getList("test.byte").size());
  -        Assert.assertEquals(1, configuration.getVector("test.byte").size());
       }
   
       public void testDouble() throws Exception
  @@ -69,7 +66,6 @@
           double doubleValue = configuration.getDouble("test.double");
           Assert.assertEquals(testValue, doubleValue, 0.01);
           Assert.assertEquals(1, configuration.getList("test.double").size());
  -        Assert.assertEquals(1, configuration.getVector("test.double").size());
       }
   
       public void testDoubleDefaultValue() throws Exception
  @@ -85,8 +81,7 @@
           float testValue = (float) 20.25;
           float floatValue = configuration.getFloat("test.float");
           Assert.assertEquals(testValue, floatValue, 0.01);
  -        Assert.assertEquals(1, configuration.getList("test.float").size());
  -        Assert.assertEquals(1, configuration.getVector("test.float").size());
  +        Assert.assertEquals(1, configuration.getList("test.float").size());       
       }
   
       public void testFloatDefaultValue() throws Exception
  @@ -101,7 +96,6 @@
           int intValue = configuration.getInt("test.integer");
           Assert.assertEquals(10, intValue);
           Assert.assertEquals(1, configuration.getList("test.integer").size());
  -        Assert.assertEquals(1, configuration.getVector("test.integer").size());
       }
   
       public void testIntegerDefaultValue() throws Exception
  @@ -115,7 +109,6 @@
           long longValue = configuration.getLong("test.long");
           Assert.assertEquals(1000000, longValue);
           Assert.assertEquals(1, configuration.getList("test.long").size());
  -        Assert.assertEquals(1, configuration.getVector("test.long").size());
       }
       public void testLongDefaultValue() throws Exception
       {
  @@ -128,7 +121,6 @@
           short shortValue = configuration.getShort("test.short");
           Assert.assertEquals(1, shortValue);
           Assert.assertEquals(1, configuration.getList("test.short").size());
  -        Assert.assertEquals(1, configuration.getVector("test.short").size());
       }
   
       public void testShortDefaultValue() throws Exception
  @@ -141,12 +133,6 @@
       {
           List list = configuration.getList("missing.list");
           Assert.assertTrue("'missing.list' is not empty", list.isEmpty());
  -    }
  -
  -    public void testVectorMissing() throws Exception
  -    {
  -        Vector vector = configuration.getVector("missing.list");
  -        Assert.assertTrue("'missing.list' is not empty", vector.isEmpty());
       }
   
       public void testSubset() throws Exception
  
  
  
  1.28      +1 -50     jakarta-commons/configuration/src/java/org/apache/commons/configuration/AbstractConfiguration.java
  
  Index: AbstractConfiguration.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/configuration/src/java/org/apache/commons/configuration/AbstractConfiguration.java,v
  retrieving revision 1.27
  retrieving revision 1.28
  diff -u -r1.27 -r1.28
  --- AbstractConfiguration.java	18 Oct 2004 14:05:22 -0000	1.27
  +++ AbstractConfiguration.java	18 Oct 2004 21:38:45 -0000	1.28
  @@ -25,7 +25,6 @@
   import java.util.NoSuchElementException;
   import java.util.Properties;
   import java.util.StringTokenizer;
  -import java.util.Vector;
   
   import org.apache.commons.collections.Predicate;
   import org.apache.commons.collections.iterators.FilterIterator;
  @@ -974,54 +973,6 @@
                       + value.getClass().getName());
           }
           return list;
  -    }
  -
  -    /**
  -     * {@inheritDoc}
  -     */
  -    public Vector getVector(String key)
  -    {
  -        return getVector(key, new Vector());
  -    }
  -
  -    /**
  -     * {@inheritDoc}
  -     */
  -    public Vector getVector(String key, Vector defaultValue)
  -    {
  -        Object value = getPropertyDirect(key);
  -        Vector vector = null;
  -
  -        if (value instanceof String)
  -        {
  -            vector = new Vector(1);
  -            vector.add(value);
  -        }
  -        else if (value instanceof List)
  -        {
  -            vector = new Vector(((List) value).size());
  -
  -            for (Iterator it = ((List) value).iterator(); it.hasNext(); )
  -            {
  -                Object obj = it.next();
  -                vector.add(obj);
  -            }
  -        }
  -        else if (value == null)
  -        {
  -            vector = defaultValue;
  -        }
  -        else
  -        {
  -            throw new ConversionException(
  -                '\''
  -                    + key
  -                    + "' doesn't map to a Vector object: "
  -                    + value
  -                    + ", a "
  -                    + value.getClass().getName());
  -        }
  -        return vector;
       }
   
       /**
  
  
  
  1.20      +1 -10     jakarta-commons/configuration/src/java/org/apache/commons/configuration/CompositeConfiguration.java
  
  Index: CompositeConfiguration.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/configuration/src/java/org/apache/commons/configuration/CompositeConfiguration.java,v
  retrieving revision 1.19
  retrieving revision 1.20
  diff -u -r1.19 -r1.20
  --- CompositeConfiguration.java	5 Oct 2004 22:56:58 -0000	1.19
  +++ CompositeConfiguration.java	18 Oct 2004 21:38:45 -0000	1.20
  @@ -20,7 +20,6 @@
   import java.util.Iterator;
   import java.util.LinkedList;
   import java.util.List;
  -import java.util.Vector;
   
   /**
    * This Configuration class allows you to add multiple different types of Configuration
  @@ -305,14 +304,6 @@
           }
   
           return list;
  -    }
  -
  -    /**
  -     * {@inheritDoc}
  -     */
  -    public Vector getVector(String key, Vector defaultValue)
  -    {
  -        return new Vector(getList(key, defaultValue));
       }
   
       /**
  
  
  
  1.13      +1 -36     jakarta-commons/configuration/src/java/org/apache/commons/configuration/Configuration.java
  
  Index: Configuration.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/configuration/src/java/org/apache/commons/configuration/Configuration.java,v
  retrieving revision 1.12
  retrieving revision 1.13
  diff -u -r1.12 -r1.13
  --- Configuration.java	18 Oct 2004 14:05:23 -0000	1.12
  +++ Configuration.java	18 Oct 2004 21:38:45 -0000	1.13
  @@ -21,7 +21,6 @@
   import java.util.Iterator;
   import java.util.List;
   import java.util.Properties;
  -import java.util.Vector;
   
   /**
    * Configuration interface.
  @@ -570,38 +569,4 @@
        *         object that is not a List.
        */
       List getList(String key, List defaultValue);
  -
  -    /**
  -     * Get a Vector of strings associated with the given configuration key.
  -     * If the key doesn't map to an existing object an empty Vector is returned.
  -     *
  -     * @param key The configuration key.
  -     * @return The associated Vector.
  -     *
  -     * @deprecated This method is for compatibility with applications that
  -     * use the pre-1.0 versions of commons-configuration. It will be removed
  -     * post 1.0
  -     *
  -     * @throws ConversionException is thrown if the key maps to an
  -     *         object that is not a Vector.
  -     */
  -    Vector getVector(String key);
  -
  -    /**
  -     * Get a Vector of strings associated with the given configuration key.
  -     * If the key doesn't map to an existing object, the default value
  -     * is returned.
  -     *
  -     * @param key The configuration key.
  -     * @param defaultValue The default value.
  -     * @return The associated Vector.
  -     *
  -     * @deprecated This method is for compatibility with applications that
  -     * use the pre-1.0 versions of commons-configuration. It will be removed
  -     * post 1.0
  -     *
  -     * @throws ConversionException is thrown if the key maps to an
  -     *         object that is not a Vector.
  -     */
  -    Vector getVector(String key, Vector defaultValue);
   }
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


RE: cvs commit: jakarta-commons/configuration/src/java/org/apache/commons/configuration AbstractConfiguration.java CompositeConfiguration.java Configuration.java

Posted by Eric Pugh <ep...@upstate.com>.
Unfortunantly, it only works when I can slip the change in without anyone
knowing...

ERic

> -----Original Message-----
> From: Henning P. Schmiedehausen [mailto:hps@intermeta.de]
> Sent: Tuesday, October 19, 2004 12:31 AM
> To: commons-dev@jakarta.apache.org
> Subject: Re: cvs commit:
> jakarta-commons/configuration/src/java/org/apache/commons/configuration
> AbstractConfiguration.java CompositeConfiguration.java
> Configuration.java
>
>
> epugh@apache.org writes:
>
> >  +      <action dev="ebourg" type="remove">
>
> Hehe, so they will blame Emmanuel when everything breaks.
> Clever move. ;-)
>
> 	Regards
> 		Henning
>
> --
> Dipl.-Inf. (Univ.) Henning P. Schmiedehausen          INTERMETA GmbH
> hps@intermeta.de        +49 9131 50 654 0   http://www.intermeta.de/
>
> RedHat Certified Engineer -- Jakarta Turbine Development  -- hero for hire
>    Linux, Java, perl, Solaris -- Consulting, Training, Development
>
> "Fighting for one's political stand is an honorable action, but re-
>  fusing to acknowledge that there might be weaknesses in one's
>  position - in order to identify them so that they can be remedied -
>  is a large enough problem with the Open Source movement that it
>  deserves to be on this list of the top five problems."
>                        -- Michelle Levesque, "Fundamental Issues with
>                                     Open Source Software Development"
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-dev-help@jakarta.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Re: cvs commit: jakarta-commons/configuration/src/java/org/apache/commons/configuration AbstractConfiguration.java CompositeConfiguration.java Configuration.java

Posted by "Henning P. Schmiedehausen" <hp...@intermeta.de>.
epugh@apache.org writes:

>  +      <action dev="ebourg" type="remove">

Hehe, so they will blame Emmanuel when everything breaks. 
Clever move. ;-)

	Regards
		Henning

-- 
Dipl.-Inf. (Univ.) Henning P. Schmiedehausen          INTERMETA GmbH
hps@intermeta.de        +49 9131 50 654 0   http://www.intermeta.de/

RedHat Certified Engineer -- Jakarta Turbine Development  -- hero for hire
   Linux, Java, perl, Solaris -- Consulting, Training, Development

"Fighting for one's political stand is an honorable action, but re-
 fusing to acknowledge that there might be weaknesses in one's
 position - in order to identify them so that they can be remedied -
 is a large enough problem with the Open Source movement that it
 deserves to be on this list of the top five problems."
                       -- Michelle Levesque, "Fundamental Issues with
                                    Open Source Software Development"

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org