commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ebo...@apache.org
Subject svn commit: r1152745 - in /commons/proper/configuration/branches/configuration2_experimental/src: main/java/org/apache/commons/configuration2/ main/java/org/apache/commons/configuration2/converter/ main/java/org/apache/commons/configuration2/plist/ tes...
Date Mon, 01 Aug 2011 11:44:00 GMT
Author: ebourg
Date: Mon Aug  1 11:43:53 2011
New Revision: 1152745

URL: http://svn.apache.org/viewvc?rev=1152745&view=rev
Log:
Removed unnecessary boxing/unboxing

Modified:
    commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/AbstractConfiguration.java
    commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/DatabaseConfiguration.java
    commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/DefaultConfigurationBuilder.java
    commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/converter/ByteConverter.java
    commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/converter/DoubleConverter.java
    commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/converter/FloatConverter.java
    commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/converter/IntegerConverter.java
    commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/converter/LongConverter.java
    commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/converter/ShortConverter.java
    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/InterpolationTestHelper.java
    commons/proper/configuration/branches/configuration2_experimental/src/test/java/org/apache/commons/configuration2/TestBaseNullConfiguration.java
    commons/proper/configuration/branches/configuration2_experimental/src/test/java/org/apache/commons/configuration2/TestPropertyConverter.java
    commons/proper/configuration/branches/configuration2_experimental/src/test/java/org/apache/commons/configuration2/base/TestFlatNodeHandler.java
    commons/proper/configuration/branches/configuration2_experimental/src/test/java/org/apache/commons/configuration2/base/TestFlatNodeSourceAdapter.java
    commons/proper/configuration/branches/configuration2_experimental/src/test/java/org/apache/commons/configuration2/base/TestFlatNodes.java
    commons/proper/configuration/branches/configuration2_experimental/src/test/java/org/apache/commons/configuration2/base/TestMapConfigurationSource.java
    commons/proper/configuration/branches/configuration2_experimental/src/test/java/org/apache/commons/configuration2/beanutils/TestBeanHelper.java
    commons/proper/configuration/branches/configuration2_experimental/src/test/java/org/apache/commons/configuration2/beanutils/TestConfigurationDynaBean.java
    commons/proper/configuration/branches/configuration2_experimental/src/test/java/org/apache/commons/configuration2/combined/TestCombinedConfiguration.java
    commons/proper/configuration/branches/configuration2_experimental/src/test/java/org/apache/commons/configuration2/combined/TestCombinedNode.java
    commons/proper/configuration/branches/configuration2_experimental/src/test/java/org/apache/commons/configuration2/converter/TestDefaultPropertyConverter.java
    commons/proper/configuration/branches/configuration2_experimental/src/test/java/org/apache/commons/configuration2/flat/TestBaseConfiguration.java
    commons/proper/configuration/branches/configuration2_experimental/src/test/java/org/apache/commons/configuration2/flat/TestFlatNodes.java

Modified: commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/AbstractConfiguration.java
URL: http://svn.apache.org/viewvc/commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/AbstractConfiguration.java?rev=1152745&r1=1152744&r2=1152745&view=diff
==============================================================================
--- commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/AbstractConfiguration.java
(original)
+++ commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/AbstractConfiguration.java
Mon Aug  1 11:43:53 2011
@@ -681,7 +681,7 @@ public abstract class AbstractConfigurat
         Boolean b = getBoolean(key, null);
         if (b != null)
         {
-            return b.booleanValue();
+            return b;
         }
         else
         {
@@ -691,7 +691,7 @@ public abstract class AbstractConfigurat
 
     public boolean getBoolean(String key, boolean defaultValue)
     {
-        return getBoolean(key, Boolean.valueOf(defaultValue)).booleanValue();
+        return getBoolean(key, Boolean.valueOf(defaultValue));
     }
 
     /**
@@ -731,7 +731,7 @@ public abstract class AbstractConfigurat
         Byte b = getByte(key, null);
         if (b != null)
         {
-            return b.byteValue();
+            return b;
         }
         else
         {
@@ -741,7 +741,7 @@ public abstract class AbstractConfigurat
 
     public byte getByte(String key, byte defaultValue)
     {
-        return getByte(key, new Byte(defaultValue)).byteValue();
+        return getByte(key, new Byte(defaultValue));
     }
 
     public Byte getByte(String key, Byte defaultValue)
@@ -770,7 +770,7 @@ public abstract class AbstractConfigurat
         Double d = getDouble(key, null);
         if (d != null)
         {
-            return d.doubleValue();
+            return d;
         }
         else
         {
@@ -780,7 +780,7 @@ public abstract class AbstractConfigurat
 
     public double getDouble(String key, double defaultValue)
     {
-        return getDouble(key, new Double(defaultValue)).doubleValue();
+        return getDouble(key, new Double(defaultValue));
     }
 
     public Double getDouble(String key, Double defaultValue)
@@ -809,7 +809,7 @@ public abstract class AbstractConfigurat
         Float f = getFloat(key, null);
         if (f != null)
         {
-            return f.floatValue();
+            return f;
         }
         else
         {
@@ -819,7 +819,7 @@ public abstract class AbstractConfigurat
 
     public float getFloat(String key, float defaultValue)
     {
-        return getFloat(key, new Float(defaultValue)).floatValue();
+        return getFloat(key, new Float(defaultValue));
     }
 
     public Float getFloat(String key, Float defaultValue)
@@ -848,7 +848,7 @@ public abstract class AbstractConfigurat
         Integer i = getInteger(key, null);
         if (i != null)
         {
-            return i.intValue();
+            return i;
         }
         else
         {
@@ -865,7 +865,7 @@ public abstract class AbstractConfigurat
             return defaultValue;
         }
 
-        return i.intValue();
+        return i;
     }
 
     public Integer getInteger(String key, Integer defaultValue)
@@ -894,7 +894,7 @@ public abstract class AbstractConfigurat
         Long l = getLong(key, null);
         if (l != null)
         {
-            return l.longValue();
+            return l;
         }
         else
         {
@@ -904,7 +904,7 @@ public abstract class AbstractConfigurat
 
     public long getLong(String key, long defaultValue)
     {
-        return getLong(key, new Long(defaultValue)).longValue();
+        return getLong(key, new Long(defaultValue));
     }
 
     public Long getLong(String key, Long defaultValue)
@@ -933,7 +933,7 @@ public abstract class AbstractConfigurat
         Short s = getShort(key, null);
         if (s != null)
         {
-            return s.shortValue();
+            return s;
         }
         else
         {
@@ -943,7 +943,7 @@ public abstract class AbstractConfigurat
 
     public short getShort(String key, short defaultValue)
     {
-        return getShort(key, new Short(defaultValue)).shortValue();
+        return getShort(key, new Short(defaultValue));
     }
 
     public Short getShort(String key, Short defaultValue)

Modified: commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/DatabaseConfiguration.java
URL: http://svn.apache.org/viewvc/commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/DatabaseConfiguration.java?rev=1152745&r1=1152744&r2=1152745&view=diff
==============================================================================
--- commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/DatabaseConfiguration.java
(original)
+++ commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/DatabaseConfiguration.java
Mon Aug  1 11:43:53 2011
@@ -359,7 +359,7 @@ public class DatabaseConfiguration exten
         };
 
         Integer count = (Integer) op.execute();
-        return count == null || count.intValue() == 0;
+        return count == null || count == 0;
     }
 
     /**
@@ -389,7 +389,7 @@ public class DatabaseConfiguration exten
         };
 
         Boolean result = (Boolean) op.execute();
-        return result != null && result.booleanValue();
+        return result != null && result;
     }
 
     /**

Modified: commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/DefaultConfigurationBuilder.java
URL: http://svn.apache.org/viewvc/commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/DefaultConfigurationBuilder.java?rev=1152745&r1=1152744&r2=1152745&view=diff
==============================================================================
--- commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/DefaultConfigurationBuilder.java
(original)
+++ commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/DefaultConfigurationBuilder.java
Mon Aug  1 11:43:53 2011
@@ -1156,14 +1156,12 @@ public class DefaultConfigurationBuilder
          */
         public boolean isOptional()
         {
-            Boolean value = this.getConfiguration().getBoolean(ATTR_OPTIONAL_RES,
-                    null);
+            Boolean value = this.getConfiguration().getBoolean(ATTR_OPTIONAL_RES, null);
             if (value == null)
             {
-                value = this.getConfiguration().getBoolean(ATTR_OPTIONAL,
-                        Boolean.FALSE);
+                value = this.getConfiguration().getBoolean(ATTR_OPTIONAL, Boolean.FALSE);
             }
-            return value.booleanValue();
+            return value;
         }
 
         /**

Modified: commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/converter/ByteConverter.java
URL: http://svn.apache.org/viewvc/commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/converter/ByteConverter.java?rev=1152745&r1=1152744&r2=1152745&view=diff
==============================================================================
--- commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/converter/ByteConverter.java
(original)
+++ commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/converter/ByteConverter.java
Mon Aug  1 11:43:53 2011
@@ -44,7 +44,7 @@ class ByteConverter extends NumberConver
         }
         else
         {
-            return new Byte(n.byteValue());
+            return n.byteValue();
         }
     }
 }

Modified: commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/converter/DoubleConverter.java
URL: http://svn.apache.org/viewvc/commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/converter/DoubleConverter.java?rev=1152745&r1=1152744&r2=1152745&view=diff
==============================================================================
--- commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/converter/DoubleConverter.java
(original)
+++ commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/converter/DoubleConverter.java
Mon Aug  1 11:43:53 2011
@@ -44,7 +44,7 @@ class DoubleConverter extends NumberConv
         }
         else
         {
-            return new Double(n.doubleValue());
+            return n.doubleValue();
         }
     }
 }

Modified: commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/converter/FloatConverter.java
URL: http://svn.apache.org/viewvc/commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/converter/FloatConverter.java?rev=1152745&r1=1152744&r2=1152745&view=diff
==============================================================================
--- commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/converter/FloatConverter.java
(original)
+++ commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/converter/FloatConverter.java
Mon Aug  1 11:43:53 2011
@@ -44,7 +44,7 @@ class FloatConverter extends NumberConve
         }
         else
         {
-            return new Float(n.floatValue());
+            return n.floatValue();
         }
     }
 }

Modified: commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/converter/IntegerConverter.java
URL: http://svn.apache.org/viewvc/commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/converter/IntegerConverter.java?rev=1152745&r1=1152744&r2=1152745&view=diff
==============================================================================
--- commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/converter/IntegerConverter.java
(original)
+++ commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/converter/IntegerConverter.java
Mon Aug  1 11:43:53 2011
@@ -44,7 +44,7 @@ class IntegerConverter extends NumberCon
         }
         else
         {
-            return new Integer(n.intValue());
+            return n.intValue();
         }
     }
 }

Modified: commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/converter/LongConverter.java
URL: http://svn.apache.org/viewvc/commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/converter/LongConverter.java?rev=1152745&r1=1152744&r2=1152745&view=diff
==============================================================================
--- commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/converter/LongConverter.java
(original)
+++ commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/converter/LongConverter.java
Mon Aug  1 11:43:53 2011
@@ -44,7 +44,7 @@ class LongConverter extends NumberConver
         }
         else
         {
-            return new Long(n.longValue());
+            return n.longValue();
         }
     }
 }

Modified: commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/converter/ShortConverter.java
URL: http://svn.apache.org/viewvc/commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/converter/ShortConverter.java?rev=1152745&r1=1152744&r2=1152745&view=diff
==============================================================================
--- commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/converter/ShortConverter.java
(original)
+++ commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/converter/ShortConverter.java
Mon Aug  1 11:43:53 2011
@@ -44,7 +44,7 @@ class ShortConverter extends NumberConve
         }
         else
         {
-            return new Short(n.shortValue());
+            return n.shortValue();
         }
     }
 }

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=1152745&r1=1152744&r2=1152745&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 Aug  1 11:43:53 2011
@@ -363,7 +363,7 @@ public class XMLPropertyListConfiguratio
         }
         else if (value instanceof Boolean)
         {
-            if (((Boolean) value).booleanValue())
+            if ((Boolean) value)
             {
                 out.println(padding + "<true/>");
             }

Modified: commons/proper/configuration/branches/configuration2_experimental/src/test/java/org/apache/commons/configuration2/InterpolationTestHelper.java
URL: http://svn.apache.org/viewvc/commons/proper/configuration/branches/configuration2_experimental/src/test/java/org/apache/commons/configuration2/InterpolationTestHelper.java?rev=1152745&r1=1152744&r2=1152745&view=diff
==============================================================================
--- commons/proper/configuration/branches/configuration2_experimental/src/test/java/org/apache/commons/configuration2/InterpolationTestHelper.java
(original)
+++ commons/proper/configuration/branches/configuration2_experimental/src/test/java/org/apache/commons/configuration2/InterpolationTestHelper.java
Mon Aug  1 11:43:53 2011
@@ -120,7 +120,7 @@ public class InterpolationTestHelper
      */
     public static void testInterpolationSubset(Configuration config)
     {
-        config.addProperty("test.a", new Integer(42));
+        config.addProperty("test.a", 42);
         config.addProperty("test.b", "${test.a}");
         Assert.assertEquals("Wrong interpolated value", 42, config
                 .getInt("test.b"));

Modified: commons/proper/configuration/branches/configuration2_experimental/src/test/java/org/apache/commons/configuration2/TestBaseNullConfiguration.java
URL: http://svn.apache.org/viewvc/commons/proper/configuration/branches/configuration2_experimental/src/test/java/org/apache/commons/configuration2/TestBaseNullConfiguration.java?rev=1152745&r1=1152744&r2=1152745&view=diff
==============================================================================
--- commons/proper/configuration/branches/configuration2_experimental/src/test/java/org/apache/commons/configuration2/TestBaseNullConfiguration.java
(original)
+++ commons/proper/configuration/branches/configuration2_experimental/src/test/java/org/apache/commons/configuration2/TestBaseNullConfiguration.java
Mon Aug  1 11:43:53 2011
@@ -170,7 +170,7 @@ public class TestBaseNullConfiguration e
         assertEquals("This returns 1(float)", oneF, config.getFloat("numberF"), 0);
         assertEquals("This returns 1(float)", oneF, config.getFloat("numberF", twoF), 0);
         assertEquals("This returns 2(default float)", twoF, config.getFloat("numberNotInConfig",
twoF), 0);
-        assertEquals("This returns 1(Float)", new Float(oneF), config.getFloat("numberF",
new Float("2")));
+        assertEquals("This returns 1(Float)", oneF, config.getFloat("numberF", new Float("2")));
 
         // missing key without default value
         Throwable t = null;
@@ -202,7 +202,7 @@ public class TestBaseNullConfiguration e
         assertEquals("This returns 1(double)", oneD, config.getDouble("numberD"), 0);
         assertEquals("This returns 1(double)", oneD, config.getDouble("numberD", twoD), 0);
         assertEquals("This returns 2(default double)", twoD, config.getDouble("numberNotInConfig",
twoD), 0);
-        assertEquals("This returns 1(Double)", new Double(oneD), config.getDouble("numberD",
new Double("2")));
+        assertEquals("This returns 1(Double)", oneD, config.getDouble("numberD", new Double("2")));
 
         // missing key without default value
         Throwable t = null;

Modified: commons/proper/configuration/branches/configuration2_experimental/src/test/java/org/apache/commons/configuration2/TestPropertyConverter.java
URL: http://svn.apache.org/viewvc/commons/proper/configuration/branches/configuration2_experimental/src/test/java/org/apache/commons/configuration2/TestPropertyConverter.java?rev=1152745&r1=1152744&r2=1152745&view=diff
==============================================================================
--- commons/proper/configuration/branches/configuration2_experimental/src/test/java/org/apache/commons/configuration2/TestPropertyConverter.java
(original)
+++ commons/proper/configuration/branches/configuration2_experimental/src/test/java/org/apache/commons/configuration2/TestPropertyConverter.java
Mon Aug  1 11:43:53 2011
@@ -123,9 +123,9 @@ public class TestPropertyConverter exten
 
         Iterator<?> it = PropertyConverter.toIterator(array, ',');
 
-        assertEquals("1st element", new Integer(1), it.next());
-        assertEquals("2nd element", new Integer(2), it.next());
-        assertEquals("3rd element", new Integer(3), it.next());
+        assertEquals("1st element", 1, it.next());
+        assertEquals("2nd element", 2, it.next());
+        assertEquals("3rd element", 3, it.next());
     }
 
     /**
@@ -235,8 +235,8 @@ public class TestPropertyConverter exten
      */
     public void testInterpolateObject()
     {
-        assertEquals("Object was not correctly interpolated", new Integer(42),
-                PropertyConverter.interpolate(new Integer(42), new PropertiesConfiguration()));
+        assertEquals("Object was not correctly interpolated", 42,
+                PropertyConverter.interpolate(42, new PropertiesConfiguration()));
     }
 
     /**

Modified: commons/proper/configuration/branches/configuration2_experimental/src/test/java/org/apache/commons/configuration2/base/TestFlatNodeHandler.java
URL: http://svn.apache.org/viewvc/commons/proper/configuration/branches/configuration2_experimental/src/test/java/org/apache/commons/configuration2/base/TestFlatNodeHandler.java?rev=1152745&r1=1152744&r2=1152745&view=diff
==============================================================================
--- commons/proper/configuration/branches/configuration2_experimental/src/test/java/org/apache/commons/configuration2/base/TestFlatNodeHandler.java
(original)
+++ commons/proper/configuration/branches/configuration2_experimental/src/test/java/org/apache/commons/configuration2/base/TestFlatNodeHandler.java
Mon Aug  1 11:43:53 2011
@@ -106,8 +106,7 @@ public class TestFlatNodeHandler
      */
     private void checkUpdate(boolean expected)
     {
-        assertEquals("Wrong value of update flag", expected, internalUpdate
-                .booleanValue());
+        assertEquals("Wrong value of update flag", expected, internalUpdate);
         internalUpdate = null;
     }
 

Modified: commons/proper/configuration/branches/configuration2_experimental/src/test/java/org/apache/commons/configuration2/base/TestFlatNodeSourceAdapter.java
URL: http://svn.apache.org/viewvc/commons/proper/configuration/branches/configuration2_experimental/src/test/java/org/apache/commons/configuration2/base/TestFlatNodeSourceAdapter.java?rev=1152745&r1=1152744&r2=1152745&view=diff
==============================================================================
--- commons/proper/configuration/branches/configuration2_experimental/src/test/java/org/apache/commons/configuration2/base/TestFlatNodeSourceAdapter.java
(original)
+++ commons/proper/configuration/branches/configuration2_experimental/src/test/java/org/apache/commons/configuration2/base/TestFlatNodeSourceAdapter.java
Mon Aug  1 11:43:53 2011
@@ -248,8 +248,7 @@ public class TestFlatNodeSourceAdapter
         assertEquals("Wrong number of values", count, values.size());
         for (int i = 0; i < count; i++)
         {
-            assertEquals("Wrong value at " + i, Integer.valueOf(i), values
-                    .get(i));
+            assertEquals("Wrong value at " + i, i, values.get(i));
         }
     }
 

Modified: commons/proper/configuration/branches/configuration2_experimental/src/test/java/org/apache/commons/configuration2/base/TestFlatNodes.java
URL: http://svn.apache.org/viewvc/commons/proper/configuration/branches/configuration2_experimental/src/test/java/org/apache/commons/configuration2/base/TestFlatNodes.java?rev=1152745&r1=1152744&r2=1152745&view=diff
==============================================================================
--- commons/proper/configuration/branches/configuration2_experimental/src/test/java/org/apache/commons/configuration2/base/TestFlatNodes.java
(original)
+++ commons/proper/configuration/branches/configuration2_experimental/src/test/java/org/apache/commons/configuration2/base/TestFlatNodes.java
Mon Aug  1 11:43:53 2011
@@ -434,22 +434,18 @@ public class TestFlatNodes
         }
         for (int i = 0; i < count; i++)
         {
-            assertEquals("Wrong value", Integer.valueOf(i), nodes.get(i)
-                    .getValue());
+            assertEquals("Wrong value", i, nodes.get(i).getValue());
         }
         for (int j = count - 1; j > 0; j--)
         {
             parent.removeChild(nodes.get(j));
             List<FlatNode> remainingChildren = parent.getChildren(NAME);
-            assertEquals("Wrong children", nodes.subList(0, j),
-                    remainingChildren);
+            assertEquals("Wrong children", nodes.subList(0, j), remainingChildren);
         }
-        assertEquals("Wrong remaining value", Integer.valueOf(0), config
-                .getProperty(NAME));
+        assertEquals("Wrong remaining value", 0, config.getProperty(NAME));
         parent.removeChild(nodes.get(0));
         assertFalse("Property still found", config.containsKey(NAME));
-        assertEquals("Wrong number of children", 0, parent
-                .getChildrenCount(NAME));
+        assertEquals("Wrong number of children", 0, parent.getChildrenCount(NAME));
     }
 
     /**

Modified: commons/proper/configuration/branches/configuration2_experimental/src/test/java/org/apache/commons/configuration2/base/TestMapConfigurationSource.java
URL: http://svn.apache.org/viewvc/commons/proper/configuration/branches/configuration2_experimental/src/test/java/org/apache/commons/configuration2/base/TestMapConfigurationSource.java?rev=1152745&r1=1152744&r2=1152745&view=diff
==============================================================================
--- commons/proper/configuration/branches/configuration2_experimental/src/test/java/org/apache/commons/configuration2/base/TestMapConfigurationSource.java
(original)
+++ commons/proper/configuration/branches/configuration2_experimental/src/test/java/org/apache/commons/configuration2/base/TestMapConfigurationSource.java
Mon Aug  1 11:43:53 2011
@@ -113,8 +113,7 @@ public class TestMapConfigurationSource 
         assertSame("Wrong map as store", map, src.getStore());
         for (int i = 0; i < COUNT; i++)
         {
-            assertEquals("Wrong property value", Integer.valueOf(i), src
-                    .getProperty(KEY + i));
+            assertEquals("Wrong property value", i, src.getProperty(KEY + i));
         }
     }
 

Modified: commons/proper/configuration/branches/configuration2_experimental/src/test/java/org/apache/commons/configuration2/beanutils/TestBeanHelper.java
URL: http://svn.apache.org/viewvc/commons/proper/configuration/branches/configuration2_experimental/src/test/java/org/apache/commons/configuration2/beanutils/TestBeanHelper.java?rev=1152745&r1=1152744&r2=1152745&view=diff
==============================================================================
--- commons/proper/configuration/branches/configuration2_experimental/src/test/java/org/apache/commons/configuration2/beanutils/TestBeanHelper.java
(original)
+++ commons/proper/configuration/branches/configuration2_experimental/src/test/java/org/apache/commons/configuration2/beanutils/TestBeanHelper.java
Mon Aug  1 11:43:53 2011
@@ -368,7 +368,7 @@ public class TestBeanHelper extends Test
      */
     public void testCreateBeanWithParameter()
     {
-        Object param = new Integer(42);
+        Object param = 42;
         TestBeanFactory factory = new TestBeanFactory();
         BeanHelper.registerBeanFactory(TEST_FACTORY, factory);
         TestBeanDeclaration data = setUpBeanDeclaration();
@@ -393,7 +393,7 @@ public class TestBeanHelper extends Test
         TestBeanDeclaration buddyData = new TestBeanDeclaration();
         Map properties2 = new HashMap();
         properties2.put("stringValue", "Another test string");
-        properties2.put("intValue", new Integer(100));
+        properties2.put("intValue", 100);
         buddyData.setBeanProperties(properties2);
         buddyData.setBeanClassName(TestBean.class.getName());
         if (BeanHelper.getDefaultBeanFactory() == null)

Modified: commons/proper/configuration/branches/configuration2_experimental/src/test/java/org/apache/commons/configuration2/beanutils/TestConfigurationDynaBean.java
URL: http://svn.apache.org/viewvc/commons/proper/configuration/branches/configuration2_experimental/src/test/java/org/apache/commons/configuration2/beanutils/TestConfigurationDynaBean.java?rev=1152745&r1=1152744&r2=1152745&view=diff
==============================================================================
--- commons/proper/configuration/branches/configuration2_experimental/src/test/java/org/apache/commons/configuration2/beanutils/TestConfigurationDynaBean.java
(original)
+++ commons/proper/configuration/branches/configuration2_experimental/src/test/java/org/apache/commons/configuration2/beanutils/TestConfigurationDynaBean.java
Mon Aug  1 11:43:53 2011
@@ -71,18 +71,18 @@ public class TestConfigurationDynaBean e
     private Object[] values = {
             Boolean.TRUE,
             Boolean.TRUE,
-            new Double(Double.MAX_VALUE),
-            new Float(Float.MAX_VALUE),
-            new Integer(Integer.MAX_VALUE),
-            new Long(Long.MAX_VALUE),
+            Double.MAX_VALUE,
+            Float.MAX_VALUE,
+            Integer.MAX_VALUE,
+            Long.MAX_VALUE,
             "First Value",
             "Second Value",
             "Third Value",
-            new Integer(Integer.MAX_VALUE),
-            new Short(Short.MAX_VALUE),
+            Integer.MAX_VALUE,
+            Short.MAX_VALUE,
             "This is a string",
-            new Byte(Byte.MAX_VALUE),
-            new Character(Character.MAX_VALUE)
+            Byte.MAX_VALUE,
+            Character.MAX_VALUE
     };
 
     private int[] intArray = {0, 10, 20, 30, 40};
@@ -111,7 +111,7 @@ public class TestConfigurationDynaBean e
 
         for (int a = 0; a < intArray.length; a++)
         {
-            configuration.addProperty("intIndexed", new Integer(intArray[a]));
+            configuration.addProperty("intIndexed", intArray[a]);
         }
 
         for (int a = 0; a < stringArray.length; a++)
@@ -400,7 +400,7 @@ public class TestConfigurationDynaBean e
         Object value = bean.get("booleanProperty");
         assertNotNull("Got a value", value);
         ObjectAssert.assertInstanceOf("Got correct type", Boolean.class, value);
-        assertTrue("Got correct value", ((Boolean) value).booleanValue());
+        assertTrue("Got correct value", (Boolean) value);
     }
 
     /**
@@ -411,7 +411,7 @@ public class TestConfigurationDynaBean e
         Object value = bean.get("doubleProperty");
         assertNotNull("Got a value", value);
         ObjectAssert.assertInstanceOf("Got correct type", Double.class, value);
-        assertEquals("Got correct value", ((Double) value).doubleValue(), Double.MAX_VALUE,
0.005);
+        assertEquals("Got correct value", (Double) value, Double.MAX_VALUE, 0.005);
     }
 
     /**
@@ -499,7 +499,7 @@ public class TestConfigurationDynaBean e
     {
         try
         {
-            bean.set("intArray", -1, new Integer(0));
+            bean.set("intArray", -1, 0);
         }
         catch (IndexOutOfBoundsException e)
         {
@@ -518,7 +518,7 @@ public class TestConfigurationDynaBean e
      */
     public void testSetIndexedValues()
     {
-        bean.set("intArray", 0, new Integer(1));
+        bean.set("intArray", 0, 1);
         Object value = bean.get("intArray", 0);
 
         assertNotNull("Returned new value 0", value);
@@ -526,7 +526,7 @@ public class TestConfigurationDynaBean e
         assertEquals("Returned correct new value 0", 1, ((Integer) value).intValue());
 
 
-        bean.set("intIndexed", 1, new Integer(11));
+        bean.set("intIndexed", 1, 11);
         value = bean.get("intIndexed", 1);
 
         assertNotNull("Returned new value 1", value);
@@ -593,10 +593,10 @@ public class TestConfigurationDynaBean e
      */
     public void testSetSimpleBoolean()
     {
-        boolean oldValue = ((Boolean) bean.get("booleanProperty")).booleanValue();
+        boolean oldValue = (Boolean) bean.get("booleanProperty");
         boolean newValue = !oldValue;
-        bean.set("booleanProperty", new Boolean(newValue));
-        assertTrue("Matched new value", newValue == ((Boolean) bean.get("booleanProperty")).booleanValue());
+        bean.set("booleanProperty", newValue);
+        assertTrue("Matched new value", newValue == (Boolean) bean.get("booleanProperty"));
     }
 
     /**
@@ -604,10 +604,10 @@ public class TestConfigurationDynaBean e
      */
     public void testSetSimpleDouble()
     {
-        double oldValue = ((Double) bean.get("doubleProperty")).doubleValue();
+        double oldValue = (Double) bean.get("doubleProperty");
         double newValue = oldValue + 1.0;
-        bean.set("doubleProperty", new Double(newValue));
-        assertEquals("Matched new value", newValue, ((Double) bean.get("doubleProperty")).doubleValue(),
0.005);
+        bean.set("doubleProperty", newValue);
+        assertEquals("Matched new value", newValue, (Double) bean.get("doubleProperty"),
0.005);
     }
 
     /**
@@ -615,9 +615,9 @@ public class TestConfigurationDynaBean e
      */
     public void testSetSimpleFloat()
     {
-        float oldValue = ((Float) bean.get("floatProperty")).floatValue();
+        float oldValue = (Float) bean.get("floatProperty");
         float newValue = oldValue + (float) 1.0;
-        bean.set("floatProperty", new Float(newValue));
+        bean.set("floatProperty", newValue);
         assertEquals("Matched new value", newValue, ((Float) bean.get("floatProperty")).floatValue(),
0.005f);
     }
 
@@ -626,9 +626,9 @@ public class TestConfigurationDynaBean e
      */
     public void testSetSimpleInt()
     {
-        int oldValue = ((Integer) bean.get("intProperty")).intValue();
+        int oldValue = (Integer) bean.get("intProperty");
         int newValue = oldValue + 1;
-        bean.set("intProperty", new Integer(newValue));
+        bean.set("intProperty", newValue);
         assertEquals("Matched new value", newValue, ((Integer) bean.get("intProperty")).intValue());
     }
 
@@ -637,9 +637,9 @@ public class TestConfigurationDynaBean e
      */
     public void testSetSimpleLong()
     {
-        long oldValue = ((Long) bean.get("longProperty")).longValue();
+        long oldValue = (Long) bean.get("longProperty");
         long newValue = oldValue + 1;
-        bean.set("longProperty", new Long(newValue));
+        bean.set("longProperty", newValue);
         assertEquals("Matched new value", newValue, ((Long) bean.get("longProperty")).longValue());
     }
 
@@ -648,9 +648,9 @@ public class TestConfigurationDynaBean e
      */
     public void testSetSimpleShort()
     {
-        short oldValue = ((Short) bean.get("shortProperty")).shortValue();
+        short oldValue = (Short) bean.get("shortProperty");
         short newValue = (short) (oldValue + 1);
-        bean.set("shortProperty", new Short(newValue));
+        bean.set("shortProperty", newValue);
         assertEquals("Matched new value", newValue, ((Short) bean.get("shortProperty")).shortValue());
     }
 

Modified: commons/proper/configuration/branches/configuration2_experimental/src/test/java/org/apache/commons/configuration2/combined/TestCombinedConfiguration.java
URL: http://svn.apache.org/viewvc/commons/proper/configuration/branches/configuration2_experimental/src/test/java/org/apache/commons/configuration2/combined/TestCombinedConfiguration.java?rev=1152745&r1=1152744&r2=1152745&view=diff
==============================================================================
--- commons/proper/configuration/branches/configuration2_experimental/src/test/java/org/apache/commons/configuration2/combined/TestCombinedConfiguration.java
(original)
+++ commons/proper/configuration/branches/configuration2_experimental/src/test/java/org/apache/commons/configuration2/combined/TestCombinedConfiguration.java
Mon Aug  1 11:43:53 2011
@@ -930,7 +930,7 @@ public class TestCombinedConfiguration e
             throws IOException
     {
         return writeFile(name, MessageFormat.format(content, new Object[] {
-            new Integer(value)
+                value
         }));
     }
 

Modified: commons/proper/configuration/branches/configuration2_experimental/src/test/java/org/apache/commons/configuration2/combined/TestCombinedNode.java
URL: http://svn.apache.org/viewvc/commons/proper/configuration/branches/configuration2_experimental/src/test/java/org/apache/commons/configuration2/combined/TestCombinedNode.java?rev=1152745&r1=1152744&r2=1152745&view=diff
==============================================================================
--- commons/proper/configuration/branches/configuration2_experimental/src/test/java/org/apache/commons/configuration2/combined/TestCombinedNode.java
(original)
+++ commons/proper/configuration/branches/configuration2_experimental/src/test/java/org/apache/commons/configuration2/combined/TestCombinedNode.java
Mon Aug  1 11:43:53 2011
@@ -69,7 +69,7 @@ public class TestCombinedNode extends Te
         {
             for (int j = 1; j <= i; j++)
             {
-                node.addChild(CHILD_NAME + i, Integer.valueOf(j));
+                node.addChild(CHILD_NAME + i, j);
             }
         }
     }
@@ -121,8 +121,7 @@ public class TestCombinedNode extends Te
         {
             for (int j = 1; j <= i; j++, idx++)
             {
-                assertEquals("Wrong child at " + idx, Integer.valueOf(j),
-                        children.get(idx));
+                assertEquals("Wrong child at " + idx, j, children.get(idx));
             }
         }
     }
@@ -153,8 +152,7 @@ public class TestCombinedNode extends Te
             assertEquals("Wrong number of children", i, children.size());
             for (int j = 0; j < i; j++)
             {
-                assertEquals("Wrong child at " + j, Integer.valueOf(j + 1),
-                        children.get(j));
+                assertEquals("Wrong child at " + j, j + 1, children.get(j));
             }
         }
     }
@@ -165,7 +163,7 @@ public class TestCombinedNode extends Te
     public void testRemoveChild()
     {
         initChildren();
-        Object child = Integer.valueOf(CHILD_COUNT);
+        Object child = CHILD_COUNT;
         node.removeChild(child);
         for (Object o : node.getChildren())
         {
@@ -225,8 +223,7 @@ public class TestCombinedNode extends Te
         assertEquals("Wrong number of values", CHILD_COUNT, values.size());
         for (int i = 0; i < CHILD_COUNT; i++)
         {
-            assertEquals("Wrong value at " + i, Integer.valueOf(i), values
-                    .get(i));
+            assertEquals("Wrong value at " + i, i, values.get(i));
         }
     }
 
@@ -236,8 +233,7 @@ public class TestCombinedNode extends Te
     public void testSetAttributeValue()
     {
         node.setAttribute(ATTR_NAME, "test");
-        assertEquals("Wrong attribute value", "test", node
-                .getAttribute(ATTR_NAME));
+        assertEquals("Wrong attribute value", "test", node.getAttribute(ATTR_NAME));
     }
 
     /**
@@ -330,8 +326,7 @@ public class TestCombinedNode extends Te
         for (int i = 0; i < CHILD_COUNT; i++)
         {
             assertEquals("Wrong attribute at " + i, attrs.get(i), attrs2.get(i));
-            assertEquals("Wrong attribute value at " + i, Integer.valueOf(i),
-                    node.getAttribute(attrs2.get(i)));
+            assertEquals("Wrong attribute value at " + i, i, node.getAttribute(attrs2.get(i)));
         }
         EasyMock.verify(handler);
     }
@@ -358,8 +353,7 @@ public class TestCombinedNode extends Te
         assertEquals("Wrong number of children", CHILD_COUNT, children2.size());
         for (int i = 0; i < CHILD_COUNT; i++)
         {
-            assertEquals("Wrong child at " + i, Integer.valueOf(i), children2
-                    .get(i));
+            assertEquals("Wrong child at " + i, i, children2.get(i));
         }
         EasyMock.verify(handler);
     }

Modified: commons/proper/configuration/branches/configuration2_experimental/src/test/java/org/apache/commons/configuration2/converter/TestDefaultPropertyConverter.java
URL: http://svn.apache.org/viewvc/commons/proper/configuration/branches/configuration2_experimental/src/test/java/org/apache/commons/configuration2/converter/TestDefaultPropertyConverter.java?rev=1152745&r1=1152744&r2=1152745&view=diff
==============================================================================
--- commons/proper/configuration/branches/configuration2_experimental/src/test/java/org/apache/commons/configuration2/converter/TestDefaultPropertyConverter.java
(original)
+++ commons/proper/configuration/branches/configuration2_experimental/src/test/java/org/apache/commons/configuration2/converter/TestDefaultPropertyConverter.java
Mon Aug  1 11:43:53 2011
@@ -44,7 +44,7 @@ public class TestDefaultPropertyConverte
      */
     public void testToNumberDirect()
     {
-        Integer i = new Integer(42);
+        Integer i = 42;
         assertSame("Wrong integer", i, converter.convert(Integer.class, i));
         BigDecimal d = new BigDecimal("3.1415");
         assertSame("Wrong BigDecimal", d, converter.convert(Number.class, d));
@@ -129,14 +129,14 @@ public class TestDefaultPropertyConverte
 
     public void testToEnumFromNumber()
     {
-        assertEquals(ENUM_OBJECT, converter.convert(ENUM_CLASS, new Integer(2)));
+        assertEquals(ENUM_OBJECT, converter.convert(ENUM_CLASS, 2));
     }
 
     public void testToEnumFromInvalidNumber()
     {
         try
         {
-            converter.convert(ENUM_CLASS, new Integer(-1));
+            converter.convert(ENUM_CLASS, -1);
             fail("Could convert invalid number!");
         }
         catch (ConversionException e)

Modified: commons/proper/configuration/branches/configuration2_experimental/src/test/java/org/apache/commons/configuration2/flat/TestBaseConfiguration.java
URL: http://svn.apache.org/viewvc/commons/proper/configuration/branches/configuration2_experimental/src/test/java/org/apache/commons/configuration2/flat/TestBaseConfiguration.java?rev=1152745&r1=1152744&r2=1152745&view=diff
==============================================================================
--- commons/proper/configuration/branches/configuration2_experimental/src/test/java/org/apache/commons/configuration2/flat/TestBaseConfiguration.java
(original)
+++ commons/proper/configuration/branches/configuration2_experimental/src/test/java/org/apache/commons/configuration2/flat/TestBaseConfiguration.java
Mon Aug  1 11:43:53 2011
@@ -202,7 +202,7 @@ public class TestBaseConfiguration exten
         assertEquals("This returns 1(float)", oneF, config.getFloat("numberF"), 0);
         assertEquals("This returns 1(float)", oneF, config.getFloat("numberF", twoF), 0);
         assertEquals("This returns 2(default float)", twoF, config.getFloat("numberNotInConfig",
twoF), 0);
-        assertEquals("This returns 1(Float)", new Float(oneF), config.getFloat("numberF",
new Float("2")));
+        assertEquals("This returns 1(Float)", oneF, config.getFloat("numberF", new Float("2")));
 
         // missing key without default value
         Throwable t = null;
@@ -240,7 +240,7 @@ public class TestBaseConfiguration exten
         assertEquals("This returns 1(double)", oneD, config.getDouble("numberD"), 0);
         assertEquals("This returns 1(double)", oneD, config.getDouble("numberD", twoD), 0);
         assertEquals("This returns 2(default double)", twoD, config.getDouble("numberNotInConfig",
twoD), 0);
-        assertEquals("This returns 1(Double)", new Double(oneD), config.getDouble("numberD",
new Double("2")));
+        assertEquals("This returns 1(Double)", oneD, config.getDouble("numberD", new Double("2")));
 
         // missing key without default value
         Throwable t = null;

Modified: commons/proper/configuration/branches/configuration2_experimental/src/test/java/org/apache/commons/configuration2/flat/TestFlatNodes.java
URL: http://svn.apache.org/viewvc/commons/proper/configuration/branches/configuration2_experimental/src/test/java/org/apache/commons/configuration2/flat/TestFlatNodes.java?rev=1152745&r1=1152744&r2=1152745&view=diff
==============================================================================
--- commons/proper/configuration/branches/configuration2_experimental/src/test/java/org/apache/commons/configuration2/flat/TestFlatNodes.java
(original)
+++ commons/proper/configuration/branches/configuration2_experimental/src/test/java/org/apache/commons/configuration2/flat/TestFlatNodes.java
Mon Aug  1 11:43:53 2011
@@ -465,22 +465,18 @@ public class TestFlatNodes
         }
         for (int i = 0; i < count; i++)
         {
-            assertEquals("Wrong value", Integer.valueOf(i), nodes.get(i)
-                    .getValue());
+            assertEquals("Wrong value", i, nodes.get(i).getValue());
         }
         for (int j = count - 1; j > 0; j--)
         {
             parent.removeChild(nodes.get(j));
             List<FlatNode> remainingChildren = parent.getChildren(NAME);
-            assertEquals("Wrong children", nodes.subList(0, j),
-                    remainingChildren);
+            assertEquals("Wrong children", nodes.subList(0, j), remainingChildren);
         }
-        assertEquals("Wrong remaining value", Integer.valueOf(0), config
-                .getProperty(NAME));
+        assertEquals("Wrong remaining value", 0, config.getProperty(NAME));
         parent.removeChild(nodes.get(0));
         assertFalse("Property still found", config.containsKey(NAME));
-        assertEquals("Wrong number of children", 0, parent
-                .getChildrenCount(NAME));
+        assertEquals("Wrong number of children", 0, parent.getChildrenCount(NAME));
     }
 
     /**



Mime
View raw message