You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by gg...@apache.org on 2022/12/30 02:17:35 UTC

[commons-beanutils] branch master updated (0fb0a2a9 -> 69cc060f)

This is an automated email from the ASF dual-hosted git repository.

ggregory pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/commons-beanutils.git


    from 0fb0a2a9 Bump ossf/scorecard-action from 2.0.6 to 2.1.2 (#154)
     new 22adead9 Use Double.valueOf(double)
     new 700925ee Use Double.valueOf(String)
     new 69cc060f Clean up format mess

The 3 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../commons/beanutils2/BasicDynaBeanTestCase.java  |  4 +--
 .../apache/commons/beanutils2/BeanMapTestCase.java |  2 +-
 .../BeanPropertyValueChangeConsumerTestCase.java   |  2 +-
 .../BeanPropertyValueEqualsPredicateTestCase.java  |  2 +-
 .../BeanToPropertyValueTransformerTestCase.java    |  2 +-
 .../commons/beanutils2/BeanUtilsBenchCase.java     |  2 +-
 .../commons/beanutils2/BeanUtilsTestCase.java      | 18 +++++------
 .../commons/beanutils2/DynaBeanUtilsTestCase.java  | 12 ++++----
 .../beanutils2/DynaPropertyUtilsTestCase.java      | 10 +++---
 .../commons/beanutils2/PropertyUtilsBenchCase.java |  2 +-
 .../commons/beanutils2/PropertyUtilsTestCase.java  |  8 ++---
 .../apache/commons/beanutils2/TestResultSet.java   |  2 +-
 .../converters/BigDecimalConverterTestCase.java    |  2 +-
 .../converters/BigIntegerConverterTestCase.java    |  2 +-
 .../converters/ByteConverterTestCase.java          |  2 +-
 .../converters/DoubleConverterTestCase.java        | 36 +++++++++++-----------
 .../converters/FloatConverterTestCase.java         |  6 ++--
 .../converters/IntegerConverterTestCase.java       |  2 +-
 .../converters/LongConverterTestCase.java          |  2 +-
 .../converters/NumberConverterTestBase.java        |  2 +-
 .../converters/ShortConverterTestCase.java         |  2 +-
 .../locale/LocaleBeanificationTestCase.java        | 24 ---------------
 .../converters/DoubleLocaleConverterTestCase.java  |  6 ++--
 23 files changed, 64 insertions(+), 88 deletions(-)


[commons-beanutils] 01/03: Use Double.valueOf(double)

Posted by gg...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

ggregory pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-beanutils.git

commit 22adead9ed8a3fbb958393217caaa2f197ee4714
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Tue Dec 27 09:11:20 2022 -0500

    Use Double.valueOf(double)
---
 .../commons/beanutils2/BasicDynaBeanTestCase.java  |  4 ++--
 .../BeanPropertyValueChangeConsumerTestCase.java   |  2 +-
 .../BeanPropertyValueEqualsPredicateTestCase.java  |  2 +-
 .../BeanToPropertyValueTransformerTestCase.java    |  2 +-
 .../commons/beanutils2/BeanUtilsBenchCase.java     |  2 +-
 .../commons/beanutils2/BeanUtilsTestCase.java      | 18 +++++++-------
 .../commons/beanutils2/DynaBeanUtilsTestCase.java  | 12 +++++-----
 .../beanutils2/DynaPropertyUtilsTestCase.java      | 10 ++++----
 .../commons/beanutils2/PropertyUtilsBenchCase.java |  2 +-
 .../commons/beanutils2/PropertyUtilsTestCase.java  |  8 +++----
 .../apache/commons/beanutils2/TestResultSet.java   |  2 +-
 .../converters/BigIntegerConverterTestCase.java    |  2 +-
 .../converters/ByteConverterTestCase.java          |  2 +-
 .../converters/DoubleConverterTestCase.java        | 28 +++++++++++-----------
 .../converters/FloatConverterTestCase.java         |  6 ++---
 .../converters/IntegerConverterTestCase.java       |  2 +-
 .../converters/LongConverterTestCase.java          |  2 +-
 .../converters/NumberConverterTestBase.java        |  2 +-
 .../converters/ShortConverterTestCase.java         |  2 +-
 19 files changed, 55 insertions(+), 55 deletions(-)

diff --git a/src/test/java/org/apache/commons/beanutils2/BasicDynaBeanTestCase.java b/src/test/java/org/apache/commons/beanutils2/BasicDynaBeanTestCase.java
index e355b50f..a51f0792 100644
--- a/src/test/java/org/apache/commons/beanutils2/BasicDynaBeanTestCase.java
+++ b/src/test/java/org/apache/commons/beanutils2/BasicDynaBeanTestCase.java
@@ -98,7 +98,7 @@ public class BasicDynaBeanTestCase extends TestCase {
         // Initialize the DynaBean's property values (like TestBean)
         bean.set("booleanProperty", new Boolean(true));
         bean.set("booleanSecond", new Boolean(true));
-        bean.set("doubleProperty", new Double(321.0));
+        bean.set("doubleProperty", Double.valueOf(321.0));
         bean.set("floatProperty", new Float((float) 123.0));
         final int[] intArray = { 0, 10, 20, 30, 40 };
         bean.set("intArray", intArray);
@@ -808,7 +808,7 @@ public class BasicDynaBeanTestCase extends TestCase {
             final double oldValue =
                     ((Double) bean.get("doubleProperty")).doubleValue();
             final double newValue = oldValue + 1.0;
-            bean.set("doubleProperty", new Double(newValue));
+            bean.set("doubleProperty", Double.valueOf(newValue));
             assertEquals("Matched new value",
                     newValue,
                     ((Double) bean.get("doubleProperty")).doubleValue(),
diff --git a/src/test/java/org/apache/commons/beanutils2/BeanPropertyValueChangeConsumerTestCase.java b/src/test/java/org/apache/commons/beanutils2/BeanPropertyValueChangeConsumerTestCase.java
index 28d3944d..28d1021f 100644
--- a/src/test/java/org/apache/commons/beanutils2/BeanPropertyValueChangeConsumerTestCase.java
+++ b/src/test/java/org/apache/commons/beanutils2/BeanPropertyValueChangeConsumerTestCase.java
@@ -28,7 +28,7 @@ public class BeanPropertyValueChangeConsumerTestCase extends TestCase {
 
     private static final Integer expectedIntegerValue = new Integer(123);
     private static final Float expectedFloatValue = new Float(123.123f);
-    private static final Double expectedDoubleValue = new Double(567879.12344d);
+    private static final Double expectedDoubleValue = Double.valueOf(567879.12344d);
     private static final Boolean expectedBooleanValue = Boolean.TRUE;
     private static final Byte expectedByteValue = new Byte("12");
 
diff --git a/src/test/java/org/apache/commons/beanutils2/BeanPropertyValueEqualsPredicateTestCase.java b/src/test/java/org/apache/commons/beanutils2/BeanPropertyValueEqualsPredicateTestCase.java
index a1ec5910..ca727d67 100644
--- a/src/test/java/org/apache/commons/beanutils2/BeanPropertyValueEqualsPredicateTestCase.java
+++ b/src/test/java/org/apache/commons/beanutils2/BeanPropertyValueEqualsPredicateTestCase.java
@@ -27,7 +27,7 @@ public class BeanPropertyValueEqualsPredicateTestCase extends TestCase {
 
     private static final Integer expectedIntegerValue = new Integer(123);
     private static final Float expectedFloatValue = new Float(123.123f);
-    private static final Double expectedDoubleValue = new Double(567879.12344d);
+    private static final Double expectedDoubleValue = Double.valueOf(567879.12344d);
     private static final Boolean expectedBooleanValue = Boolean.TRUE;
     private static final Byte expectedByteValue = new Byte("12");
 
diff --git a/src/test/java/org/apache/commons/beanutils2/BeanToPropertyValueTransformerTestCase.java b/src/test/java/org/apache/commons/beanutils2/BeanToPropertyValueTransformerTestCase.java
index bedcf9f1..574c03b9 100644
--- a/src/test/java/org/apache/commons/beanutils2/BeanToPropertyValueTransformerTestCase.java
+++ b/src/test/java/org/apache/commons/beanutils2/BeanToPropertyValueTransformerTestCase.java
@@ -29,7 +29,7 @@ public class BeanToPropertyValueTransformerTestCase extends TestCase {
     private static final Integer expectedIntegerValue = new Integer(123);
     private static final Long expectedLongValue = new Long(123);
     private static final Float expectedFloatValue = new Float(123.123f);
-    private static final Double expectedDoubleValue = new Double(567879.12344d);
+    private static final Double expectedDoubleValue = Double.valueOf(567879.12344d);
     private static final Boolean expectedBooleanValue = Boolean.TRUE;
     private static final Byte expectedByteValue = new Byte("12");
 
diff --git a/src/test/java/org/apache/commons/beanutils2/BeanUtilsBenchCase.java b/src/test/java/org/apache/commons/beanutils2/BeanUtilsBenchCase.java
index c4f98722..6035780b 100644
--- a/src/test/java/org/apache/commons/beanutils2/BeanUtilsBenchCase.java
+++ b/src/test/java/org/apache/commons/beanutils2/BeanUtilsBenchCase.java
@@ -99,7 +99,7 @@ public class BeanUtilsBenchCase extends TestCase {
         inMap = new HashMap<>();
         inMap.put("booleanProperty", new Boolean(inBean.getBooleanProperty()));
         inMap.put("byteProperty", new Byte(inBean.getByteProperty()));
-        inMap.put("doubleProperty", new Double(inBean.getDoubleProperty()));
+        inMap.put("doubleProperty", Double.valueOf(inBean.getDoubleProperty()));
         inMap.put("floatProperty", new Float(inBean.getFloatProperty()));
         inMap.put("intProperty", new Integer(inBean.getIntProperty()));
         inMap.put("longProperty", new Long(inBean.getLongProperty()));
diff --git a/src/test/java/org/apache/commons/beanutils2/BeanUtilsTestCase.java b/src/test/java/org/apache/commons/beanutils2/BeanUtilsTestCase.java
index 69347fc2..ccf66fb9 100644
--- a/src/test/java/org/apache/commons/beanutils2/BeanUtilsTestCase.java
+++ b/src/test/java/org/apache/commons/beanutils2/BeanUtilsTestCase.java
@@ -180,7 +180,7 @@ public class BeanUtilsTestCase extends TestCase {
         }
         orig.set("booleanProperty", Boolean.FALSE);
         orig.set("byteProperty", new Byte((byte) 111));
-        orig.set("doubleProperty", new Double(333.33));
+        orig.set("doubleProperty", Double.valueOf(333.33));
         orig.set("dupProperty",
                  new String[] { "New 0", "New 1", "New 2" });
         orig.set("intArray", new int[] { 100, 200, 300 });
@@ -976,7 +976,7 @@ public class BeanUtilsTestCase extends TestCase {
 
         BeanUtils.setProperty(bean, "doubleProperty", new Byte((byte) 123));
         assertEquals(123, bean.getDoubleProperty(), 0.005);
-        BeanUtils.setProperty(bean, "doubleProperty", new Double(123));
+        BeanUtils.setProperty(bean, "doubleProperty", Double.valueOf(123));
         assertEquals(123, bean.getDoubleProperty(), 0.005);
         BeanUtils.setProperty(bean, "doubleProperty", new Float(123));
         assertEquals(123, bean.getDoubleProperty(), 0.005);
@@ -996,7 +996,7 @@ public class BeanUtilsTestCase extends TestCase {
 
         BeanUtils.setProperty(bean, "floatProperty", new Byte((byte) 123));
         assertEquals(123, bean.getFloatProperty(), 0.005);
-        BeanUtils.setProperty(bean, "floatProperty", new Double(123));
+        BeanUtils.setProperty(bean, "floatProperty", Double.valueOf(123));
         assertEquals(123, bean.getFloatProperty(), 0.005);
         BeanUtils.setProperty(bean, "floatProperty", new Float(123));
         assertEquals(123, bean.getFloatProperty(), 0.005);
@@ -1114,7 +1114,7 @@ public class BeanUtilsTestCase extends TestCase {
 
         BeanUtils.copyProperty(bean, "byteProperty", new Byte((byte) 123));
         assertEquals((byte) 123, bean.getByteProperty());
-        BeanUtils.copyProperty(bean, "byteProperty", new Double(123));
+        BeanUtils.copyProperty(bean, "byteProperty", Double.valueOf(123));
         assertEquals((byte) 123, bean.getByteProperty());
         BeanUtils.copyProperty(bean, "byteProperty", new Float(123));
         assertEquals((byte) 123, bean.getByteProperty());
@@ -1197,7 +1197,7 @@ public class BeanUtilsTestCase extends TestCase {
 
         BeanUtils.copyProperty(bean, "doubleProperty", new Byte((byte) 123));
         assertEquals(123, bean.getDoubleProperty(), 0.005);
-        BeanUtils.copyProperty(bean, "doubleProperty", new Double(123));
+        BeanUtils.copyProperty(bean, "doubleProperty", Double.valueOf(123));
         assertEquals(123, bean.getDoubleProperty(), 0.005);
         BeanUtils.copyProperty(bean, "doubleProperty", new Float(123));
         assertEquals(123, bean.getDoubleProperty(), 0.005);
@@ -1217,7 +1217,7 @@ public class BeanUtilsTestCase extends TestCase {
 
         BeanUtils.copyProperty(bean, "floatProperty", new Byte((byte) 123));
         assertEquals(123, bean.getFloatProperty(), 0.005);
-        BeanUtils.copyProperty(bean, "floatProperty", new Double(123));
+        BeanUtils.copyProperty(bean, "floatProperty", Double.valueOf(123));
         assertEquals(123, bean.getFloatProperty(), 0.005);
         BeanUtils.copyProperty(bean, "floatProperty", new Float(123));
         assertEquals(123, bean.getFloatProperty(), 0.005);
@@ -1237,7 +1237,7 @@ public class BeanUtilsTestCase extends TestCase {
 
         BeanUtils.copyProperty(bean, "longProperty", new Byte((byte) 123));
         assertEquals(123, bean.getIntProperty());
-        BeanUtils.copyProperty(bean, "longProperty", new Double(123));
+        BeanUtils.copyProperty(bean, "longProperty", Double.valueOf(123));
         assertEquals(123, bean.getIntProperty());
         BeanUtils.copyProperty(bean, "longProperty", new Float(123));
         assertEquals(123, bean.getIntProperty());
@@ -1257,7 +1257,7 @@ public class BeanUtilsTestCase extends TestCase {
 
         BeanUtils.copyProperty(bean, "longProperty", new Byte((byte) 123));
         assertEquals(123, bean.getLongProperty());
-        BeanUtils.copyProperty(bean, "longProperty", new Double(123));
+        BeanUtils.copyProperty(bean, "longProperty", Double.valueOf(123));
         assertEquals(123, bean.getLongProperty());
         BeanUtils.copyProperty(bean, "longProperty", new Float(123));
         assertEquals(123, bean.getLongProperty());
@@ -1277,7 +1277,7 @@ public class BeanUtilsTestCase extends TestCase {
 
         BeanUtils.copyProperty(bean, "shortProperty", new Byte((byte) 123));
         assertEquals((short) 123, bean.getShortProperty());
-        BeanUtils.copyProperty(bean, "shortProperty", new Double(123));
+        BeanUtils.copyProperty(bean, "shortProperty", Double.valueOf(123));
         assertEquals((short) 123, bean.getShortProperty());
         BeanUtils.copyProperty(bean, "shortProperty", new Float(123));
         assertEquals((short) 123, bean.getShortProperty());
diff --git a/src/test/java/org/apache/commons/beanutils2/DynaBeanUtilsTestCase.java b/src/test/java/org/apache/commons/beanutils2/DynaBeanUtilsTestCase.java
index 80fc9edc..858b7143 100644
--- a/src/test/java/org/apache/commons/beanutils2/DynaBeanUtilsTestCase.java
+++ b/src/test/java/org/apache/commons/beanutils2/DynaBeanUtilsTestCase.java
@@ -105,7 +105,7 @@ public class DynaBeanUtilsTestCase extends TestCase {
         bean.set("booleanProperty", new Boolean(true));
         bean.set("booleanSecond", new Boolean(true));
         bean.set("byteProperty", new Byte((byte) 121));
-        bean.set("doubleProperty", new Double(321.0));
+        bean.set("doubleProperty", Double.valueOf(321.0));
         bean.set("floatProperty", new Float((float) 123.0));
         final String[] dupProperty = { "Dup 0", "Dup 1", "Dup 2", "Dup 3", "Dup 4"};
         bean.set("dupProperty", dupProperty);
@@ -185,7 +185,7 @@ public class DynaBeanUtilsTestCase extends TestCase {
         }
         orig.set("booleanProperty", Boolean.FALSE);
         orig.set("byteProperty", new Byte((byte)111));
-        orig.set("doubleProperty", new Double(333.33));
+        orig.set("doubleProperty", Double.valueOf(333.33));
         orig.set("dupProperty", new String[] { "New 0", "New 1", "New 2" });
         orig.set("intArray", new int[] { 100, 200, 300 });
         orig.set("intProperty", new Integer(333));
@@ -262,7 +262,7 @@ public class DynaBeanUtilsTestCase extends TestCase {
         }
         orig.set("booleanProperty", Boolean.FALSE);
         orig.set("byteProperty", new Byte((byte)111));
-        orig.set("doubleProperty", new Double(333.33));
+        orig.set("doubleProperty", Double.valueOf(333.33));
         orig.set("dupProperty", new String[] { "New 0", "New 1", "New 2" });
         orig.set("intArray", new int[] { 100, 200, 300 });
         orig.set("intProperty", new Integer(333));
@@ -480,7 +480,7 @@ public class DynaBeanUtilsTestCase extends TestCase {
                      new Byte((byte) 121),
                      map.get("byteProperty"));
         assertEquals("Value of 'doubleProperty'",
-                     new Double(321.0),
+                     Double.valueOf(321.0),
                      map.get("doubleProperty"));
         assertEquals("Value of 'floatProperty'",
                      new Float((float) 123.0),
@@ -953,7 +953,7 @@ public class DynaBeanUtilsTestCase extends TestCase {
 
         BeanUtils.setProperty(bean, "doubleProperty", new Byte((byte) 123));
         assertEquals(123, ((Double) bean.get("doubleProperty")).doubleValue(), 0.005);
-        BeanUtils.setProperty(bean, "doubleProperty", new Double(123));
+        BeanUtils.setProperty(bean, "doubleProperty", Double.valueOf(123));
         assertEquals(123, ((Double) bean.get("doubleProperty")).doubleValue(), 0.005);
         BeanUtils.setProperty(bean, "doubleProperty", new Float(123));
         assertEquals(123, ((Double) bean.get("doubleProperty")).doubleValue(), 0.005);
@@ -973,7 +973,7 @@ public class DynaBeanUtilsTestCase extends TestCase {
 
         BeanUtils.setProperty(bean, "floatProperty", new Byte((byte) 123));
         assertEquals(123, ((Float) bean.get("floatProperty")).floatValue(), 0.005);
-        BeanUtils.setProperty(bean, "floatProperty", new Double(123));
+        BeanUtils.setProperty(bean, "floatProperty", Double.valueOf(123));
         assertEquals(123, ((Float) bean.get("floatProperty")).floatValue(), 0.005);
         BeanUtils.setProperty(bean, "floatProperty", new Float(123));
         assertEquals(123, ((Float) bean.get("floatProperty")).floatValue(), 0.005);
diff --git a/src/test/java/org/apache/commons/beanutils2/DynaPropertyUtilsTestCase.java b/src/test/java/org/apache/commons/beanutils2/DynaPropertyUtilsTestCase.java
index 62e4cf02..be3f342a 100644
--- a/src/test/java/org/apache/commons/beanutils2/DynaPropertyUtilsTestCase.java
+++ b/src/test/java/org/apache/commons/beanutils2/DynaPropertyUtilsTestCase.java
@@ -99,7 +99,7 @@ public class DynaPropertyUtilsTestCase extends TestCase {
         // Initialize the DynaBean's property values (like TestBean)
         bean.set("booleanProperty", new Boolean(true));
         bean.set("booleanSecond", new Boolean(true));
-        bean.set("doubleProperty", new Double(321.0));
+        bean.set("doubleProperty", Double.valueOf(321.0));
         bean.set("floatProperty", new Float((float) 123.0));
         final int[] intArray = { 0, 10, 20, 30, 40 };
         bean.set("intArray", intArray);
@@ -173,7 +173,7 @@ public class DynaPropertyUtilsTestCase extends TestCase {
 
         final Map<String, Object> map = new HashMap<>();
         map.put("booleanProperty", Boolean.FALSE);
-        map.put("doubleProperty", new Double(333.0));
+        map.put("doubleProperty", Double.valueOf(333.0));
         map.put("dupProperty", new String[] { "New 0", "New 1", "New 2" });
         map.put("floatProperty", new Float((float) 222.0));
         map.put("intArray", new int[] { 0, 100, 200 });
@@ -246,7 +246,7 @@ public class DynaPropertyUtilsTestCase extends TestCase {
         assertEquals("Value of 'booleanProperty'",
                      Boolean.TRUE, map.get("booleanProperty"));
         assertEquals("Value of 'doubleProperty'",
-                     new Double(321.0), map.get("doubleProperty"));
+                     Double.valueOf(321.0), map.get("doubleProperty"));
         assertEquals("Value of 'floatProperty'",
                      new Float((float) 123.0), map.get("floatProperty"));
         assertEquals("Value of 'intProperty'",
@@ -2027,7 +2027,7 @@ public class DynaPropertyUtilsTestCase extends TestCase {
             final double newValue = oldValue + 1.0;
             PropertyUtils.setNestedProperty(bean,
                     "nested.doubleProperty",
-                    new Double(newValue));
+                    Double.valueOf(newValue));
             assertEquals("Matched new value",
                     newValue,
                     nested.getDoubleProperty(),
@@ -2310,7 +2310,7 @@ public class DynaPropertyUtilsTestCase extends TestCase {
             final double newValue = oldValue + 1.0;
             PropertyUtils.setSimpleProperty(bean,
                     "doubleProperty",
-                    new Double(newValue));
+                    Double.valueOf(newValue));
             assertEquals("Matched new value",
                     newValue,
                     ((Double) bean.get("doubleProperty")).doubleValue(),
diff --git a/src/test/java/org/apache/commons/beanutils2/PropertyUtilsBenchCase.java b/src/test/java/org/apache/commons/beanutils2/PropertyUtilsBenchCase.java
index da4c5aa2..971bb451 100644
--- a/src/test/java/org/apache/commons/beanutils2/PropertyUtilsBenchCase.java
+++ b/src/test/java/org/apache/commons/beanutils2/PropertyUtilsBenchCase.java
@@ -97,7 +97,7 @@ public class PropertyUtilsBenchCase extends TestCase {
         inMap = new HashMap<>();
         inMap.put("booleanProperty", new Boolean(inBean.getBooleanProperty()));
         inMap.put("byteProperty", new Byte(inBean.getByteProperty()));
-        inMap.put("doubleProperty", new Double(inBean.getDoubleProperty()));
+        inMap.put("doubleProperty", Double.valueOf(inBean.getDoubleProperty()));
         inMap.put("floatProperty", new Float(inBean.getFloatProperty()));
         inMap.put("intProperty", new Integer(inBean.getIntProperty()));
         inMap.put("longProperty", new Long(inBean.getLongProperty()));
diff --git a/src/test/java/org/apache/commons/beanutils2/PropertyUtilsTestCase.java b/src/test/java/org/apache/commons/beanutils2/PropertyUtilsTestCase.java
index 86bde3a5..d3523198 100644
--- a/src/test/java/org/apache/commons/beanutils2/PropertyUtilsTestCase.java
+++ b/src/test/java/org/apache/commons/beanutils2/PropertyUtilsTestCase.java
@@ -236,7 +236,7 @@ public class PropertyUtilsTestCase extends TestCase {
 
         final Map<String, Object> map = new HashMap<>();
         map.put("booleanProperty", Boolean.FALSE);
-        map.put("doubleProperty", new Double(333.0));
+        map.put("doubleProperty", Double.valueOf(333.0));
         map.put("dupProperty", new String[] { "New 0", "New 1", "New 2" });
         map.put("floatProperty", new Float((float) 222.0));
         map.put("intArray", new int[] { 0, 100, 200 });
@@ -307,7 +307,7 @@ public class PropertyUtilsTestCase extends TestCase {
         assertEquals("Value of 'booleanProperty'",
                      Boolean.TRUE, map.get("booleanProperty"));
         assertEquals("Value of 'doubleProperty'",
-                     new Double(321.0), map.get("doubleProperty"));
+                     Double.valueOf(321.0), map.get("doubleProperty"));
         assertEquals("Value of 'floatProperty'",
                      new Float((float) 123.0), map.get("floatProperty"));
         assertEquals("Value of 'intProperty'",
@@ -3269,7 +3269,7 @@ public class PropertyUtilsTestCase extends TestCase {
             final double newValue = oldValue + 1.0;
             PropertyUtils.setNestedProperty(bean,
                     "nested.doubleProperty",
-                    new Double(newValue));
+                    Double.valueOf(newValue));
             assertEquals("Matched new value",
                     newValue,
                     bean.getNested().getDoubleProperty(),
@@ -3552,7 +3552,7 @@ public class PropertyUtilsTestCase extends TestCase {
             final double newValue = oldValue + 1.0;
             PropertyUtils.setSimpleProperty(bean,
                     "doubleProperty",
-                    new Double(newValue));
+                    Double.valueOf(newValue));
             assertEquals("Matched new value",
                     newValue,
                     bean.getDoubleProperty(),
diff --git a/src/test/java/org/apache/commons/beanutils2/TestResultSet.java b/src/test/java/org/apache/commons/beanutils2/TestResultSet.java
index 7447a29b..f4c08bf1 100644
--- a/src/test/java/org/apache/commons/beanutils2/TestResultSet.java
+++ b/src/test/java/org/apache/commons/beanutils2/TestResultSet.java
@@ -172,7 +172,7 @@ public class TestResultSet implements InvocationHandler {
             return new Date(timestampMillis);
         }
         if ("doubleProperty".equals(columnName)) {
-            return new Double(321.0);
+            return Double.valueOf(321.0);
         }
         if ("floatProperty".equals(columnName)) {
             return new Float((float) 123.0);
diff --git a/src/test/java/org/apache/commons/beanutils2/converters/BigIntegerConverterTestCase.java b/src/test/java/org/apache/commons/beanutils2/converters/BigIntegerConverterTestCase.java
index fd654f51..ca25743e 100644
--- a/src/test/java/org/apache/commons/beanutils2/converters/BigIntegerConverterTestCase.java
+++ b/src/test/java/org/apache/commons/beanutils2/converters/BigIntegerConverterTestCase.java
@@ -97,7 +97,7 @@ public class BigIntegerConverterTestCase extends NumberConverterTestBase<BigInte
             new Integer(9),
             new Long(10),
             new Float(11.1),
-            new Double(12.2)
+            Double.valueOf(12.2)
         };
 
         final BigInteger[] expected = {
diff --git a/src/test/java/org/apache/commons/beanutils2/converters/ByteConverterTestCase.java b/src/test/java/org/apache/commons/beanutils2/converters/ByteConverterTestCase.java
index d083e225..847434bb 100644
--- a/src/test/java/org/apache/commons/beanutils2/converters/ByteConverterTestCase.java
+++ b/src/test/java/org/apache/commons/beanutils2/converters/ByteConverterTestCase.java
@@ -130,7 +130,7 @@ public class ByteConverterTestCase extends NumberConverterTestBase<Byte> {
             new Integer(9),
             new Long(10),
             new Float(11.1),
-            new Double(12.2)
+            Double.valueOf(12.2)
         };
 
         final Byte[] expected = {
diff --git a/src/test/java/org/apache/commons/beanutils2/converters/DoubleConverterTestCase.java b/src/test/java/org/apache/commons/beanutils2/converters/DoubleConverterTestCase.java
index 7a0cadbc..710c74b4 100644
--- a/src/test/java/org/apache/commons/beanutils2/converters/DoubleConverterTestCase.java
+++ b/src/test/java/org/apache/commons/beanutils2/converters/DoubleConverterTestCase.java
@@ -95,23 +95,23 @@ public class DoubleConverterTestCase extends NumberConverterTestBase<Double> {
             new Integer(9),
             new Long(10),
             new Float(11.1),
-            new Double(12.2)
+            Double.valueOf(12.2)
         };
 
         final Double[] expected = {
-            new Double(Double.MIN_VALUE),
-            new Double(-17.2),
-            new Double(-1.1),
-            new Double(0.0),
-            new Double(1.1),
-            new Double(17.2),
-            new Double(Double.MAX_VALUE),
-            new Double(7),
-            new Double(8),
-            new Double(9),
-            new Double(10),
-            new Double(11.1),
-            new Double(12.2)
+            Double.valueOf(Double.MIN_VALUE),
+            Double.valueOf(-17.2),
+            Double.valueOf(-1.1),
+            Double.valueOf(0.0),
+            Double.valueOf(1.1),
+            Double.valueOf(17.2),
+            Double.valueOf(Double.MAX_VALUE),
+            Double.valueOf(7),
+            Double.valueOf(8),
+            Double.valueOf(9),
+            Double.valueOf(10),
+            Double.valueOf(11.1),
+            Double.valueOf(12.2)
         };
 
         for(int i=0;i<expected.length;i++) {
diff --git a/src/test/java/org/apache/commons/beanutils2/converters/FloatConverterTestCase.java b/src/test/java/org/apache/commons/beanutils2/converters/FloatConverterTestCase.java
index cb151c80..b28b6605 100644
--- a/src/test/java/org/apache/commons/beanutils2/converters/FloatConverterTestCase.java
+++ b/src/test/java/org/apache/commons/beanutils2/converters/FloatConverterTestCase.java
@@ -72,8 +72,8 @@ public class FloatConverterTestCase extends NumberConverterTestBase<Float> {
         final Converter converter = makeConverter();
         final Class<?> clazz = Float.class;
 
-        final Double max     = new Double(Float.MAX_VALUE);
-        final Double tooBig  = new Double(Double.MAX_VALUE);
+        final Double max     = Double.valueOf(Float.MAX_VALUE);
+        final Double tooBig  = Double.valueOf(Double.MAX_VALUE);
 
         // Maximum
         assertEquals("Maximum", new Float(Float.MAX_VALUE), converter.convert(clazz, max));
@@ -117,7 +117,7 @@ public class FloatConverterTestCase extends NumberConverterTestBase<Float> {
             new Integer(9),
             new Long(10),
             new Float(11.1),
-            new Double(12.2),
+            Double.valueOf(12.2),
         };
 
         final Float[] expected = {
diff --git a/src/test/java/org/apache/commons/beanutils2/converters/IntegerConverterTestCase.java b/src/test/java/org/apache/commons/beanutils2/converters/IntegerConverterTestCase.java
index 19b33dd6..a34ac048 100644
--- a/src/test/java/org/apache/commons/beanutils2/converters/IntegerConverterTestCase.java
+++ b/src/test/java/org/apache/commons/beanutils2/converters/IntegerConverterTestCase.java
@@ -146,7 +146,7 @@ public class IntegerConverterTestCase extends NumberConverterTestBase<Integer> {
             new Integer(9),
             new Long(10),
             new Float(11.1),
-            new Double(12.2)
+            Double.valueOf(12.2)
         };
 
         final Integer[] expected = {
diff --git a/src/test/java/org/apache/commons/beanutils2/converters/LongConverterTestCase.java b/src/test/java/org/apache/commons/beanutils2/converters/LongConverterTestCase.java
index 4156441b..05a737d5 100644
--- a/src/test/java/org/apache/commons/beanutils2/converters/LongConverterTestCase.java
+++ b/src/test/java/org/apache/commons/beanutils2/converters/LongConverterTestCase.java
@@ -95,7 +95,7 @@ public class LongConverterTestCase extends NumberConverterTestBase<Long> {
             new Integer(9),
             new Long(10),
             new Float(11.1),
-            new Double(12.2)
+            Double.valueOf(12.2)
         };
 
         final Long[] expected = {
diff --git a/src/test/java/org/apache/commons/beanutils2/converters/NumberConverterTestBase.java b/src/test/java/org/apache/commons/beanutils2/converters/NumberConverterTestBase.java
index 47584228..3d528143 100644
--- a/src/test/java/org/apache/commons/beanutils2/converters/NumberConverterTestBase.java
+++ b/src/test/java/org/apache/commons/beanutils2/converters/NumberConverterTestBase.java
@@ -110,7 +110,7 @@ public abstract class NumberConverterTestBase<T extends Number> extends TestCase
             new Integer(9),
             new Long(10),
             new Float(11.1),
-            new Double(12.2),
+            Double.valueOf(12.2),
             new BigDecimal("17.2"),
             new BigInteger("33"),
             new Integer[] {new Integer(3), new Integer(2), new Integer(1)}
diff --git a/src/test/java/org/apache/commons/beanutils2/converters/ShortConverterTestCase.java b/src/test/java/org/apache/commons/beanutils2/converters/ShortConverterTestCase.java
index bda80580..e684aac8 100644
--- a/src/test/java/org/apache/commons/beanutils2/converters/ShortConverterTestCase.java
+++ b/src/test/java/org/apache/commons/beanutils2/converters/ShortConverterTestCase.java
@@ -130,7 +130,7 @@ public class ShortConverterTestCase extends NumberConverterTestBase<Short> {
             new Integer(9),
             new Long(10),
             new Float(11.1),
-            new Double(12.2)
+            Double.valueOf(12.2)
         };
 
         final Short[] expected = {


[commons-beanutils] 03/03: Clean up format mess

Posted by gg...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

ggregory pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-beanutils.git

commit 69cc060f5f97658b9fef426ee3df2cafa9b9b64b
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Tue Dec 27 09:21:55 2022 -0500

    Clean up format mess
---
 .../locale/LocaleBeanificationTestCase.java        | 24 ----------------------
 1 file changed, 24 deletions(-)

diff --git a/src/test/java/org/apache/commons/beanutils2/locale/LocaleBeanificationTestCase.java b/src/test/java/org/apache/commons/beanutils2/locale/LocaleBeanificationTestCase.java
index f528474c..91713cb3 100644
--- a/src/test/java/org/apache/commons/beanutils2/locale/LocaleBeanificationTestCase.java
+++ b/src/test/java/org/apache/commons/beanutils2/locale/LocaleBeanificationTestCase.java
@@ -41,22 +41,12 @@ import junit.framework.TestSuite;
  * Test Case for changes made during LocaleBeanutils Beanification.
  * This is basically a cut-and-correct version of the beanutils beanifications tests.
  * </p>
- *
  */
-
 public class LocaleBeanificationTestCase extends TestCase {
 
-
-
     /** Maximum number of iterations before our test fails */
     public static final int MAX_GC_ITERATIONS = 50;
 
-
-
-
-
-
-
     /**
      * Constructs a new instance of this test case.
      *
@@ -66,21 +56,14 @@ public class LocaleBeanificationTestCase extends TestCase {
         super(name);
     }
 
-
-
-
-
     /**
      * Sets up instance variables required by this test case.
      */
     @Override
     public void setUp() {
-
         LocaleConvertUtils.deregister();
-
     }
 
-
     /**
      * Creates the tests included in this test suite.
      */
@@ -88,7 +71,6 @@ public class LocaleBeanificationTestCase extends TestCase {
         return new TestSuite(LocaleBeanificationTestCase.class);
     }
 
-
     /**
      * Tear down instance variables required by this test case.
      */
@@ -97,9 +79,6 @@ public class LocaleBeanificationTestCase extends TestCase {
         // No action required
     }
 
-
-
-
     /** Test of the methodology we'll use for some of the later tests */
     public void testMemoryTestMethodology() throws Exception {
         // test methodology
@@ -213,7 +192,6 @@ public class LocaleBeanificationTestCase extends TestCase {
             }
         }
 
-
         GetBeanUtilsBeanThread thread = new GetBeanUtilsBeanThread();
         final WeakReference<GetBeanUtilsBeanThread> threadWeakReference = new WeakReference<>(thread);
         thread.setContextClassLoader(loader);
@@ -520,8 +498,6 @@ public class LocaleBeanificationTestCase extends TestCase {
         }
     }
 
-    // ---- Auxillary classes
-
     class TestClassLoader extends ClassLoader {
         @Override
         public String toString() {


[commons-beanutils] 02/03: Use Double.valueOf(String)

Posted by gg...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

ggregory pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-beanutils.git

commit 700925ee968c5d6b427d1cd1b5c52d8376a71f19
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Tue Dec 27 09:19:16 2022 -0500

    Use Double.valueOf(String)
---
 src/test/java/org/apache/commons/beanutils2/BeanMapTestCase.java  | 2 +-
 .../beanutils2/converters/BigDecimalConverterTestCase.java        | 2 +-
 .../commons/beanutils2/converters/DoubleConverterTestCase.java    | 8 ++++----
 .../locale/converters/DoubleLocaleConverterTestCase.java          | 6 +++---
 4 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/src/test/java/org/apache/commons/beanutils2/BeanMapTestCase.java b/src/test/java/org/apache/commons/beanutils2/BeanMapTestCase.java
index 54baf090..d91ddbc8 100644
--- a/src/test/java/org/apache/commons/beanutils2/BeanMapTestCase.java
+++ b/src/test/java/org/apache/commons/beanutils2/BeanMapTestCase.java
@@ -381,7 +381,7 @@ public class BeanMapTestCase extends AbstractTestMap {
         assertEquals("Integer.TYPE",   new Integer(3),      beanMap.getTypeTransformer(Integer.TYPE).apply("3"));
         assertEquals("Long.TYPE",      new Long(4),         beanMap.getTypeTransformer(Long.TYPE).apply("4"));
         assertEquals("Float.TYPE",     new Float("5"),      beanMap.getTypeTransformer(Float.TYPE).apply("5"));
-        assertEquals("Double.TYPE",    new Double("6"),     beanMap.getTypeTransformer(Double.TYPE).apply("6"));
+        assertEquals("Double.TYPE",    Double.valueOf("6"),     beanMap.getTypeTransformer(Double.TYPE).apply("6"));
     }
 
     /**
diff --git a/src/test/java/org/apache/commons/beanutils2/converters/BigDecimalConverterTestCase.java b/src/test/java/org/apache/commons/beanutils2/converters/BigDecimalConverterTestCase.java
index 2e4d7e47..61aeba7e 100644
--- a/src/test/java/org/apache/commons/beanutils2/converters/BigDecimalConverterTestCase.java
+++ b/src/test/java/org/apache/commons/beanutils2/converters/BigDecimalConverterTestCase.java
@@ -105,7 +105,7 @@ public class BigDecimalConverterTestCase extends NumberConverterTestBase<BigDeci
             new Integer(9),
             new Long(10),
             new Float("11.1"),
-            new Double("12.2"),
+            Double.valueOf("12.2"),
             new BigDecimal("3200.11"),
             new ExtendingBigDecimal("3200.11")
         };
diff --git a/src/test/java/org/apache/commons/beanutils2/converters/DoubleConverterTestCase.java b/src/test/java/org/apache/commons/beanutils2/converters/DoubleConverterTestCase.java
index 710c74b4..00c08019 100644
--- a/src/test/java/org/apache/commons/beanutils2/converters/DoubleConverterTestCase.java
+++ b/src/test/java/org/apache/commons/beanutils2/converters/DoubleConverterTestCase.java
@@ -54,10 +54,10 @@ public class DoubleConverterTestCase extends NumberConverterTestBase<Double> {
     @Override
     public void setUp() throws Exception {
         converter = makeConverter();
-        numbers[0] = new Double("-12");
-        numbers[1] = new Double("13");
-        numbers[2] = new Double("-22");
-        numbers[3] = new Double("23");
+        numbers[0] = Double.valueOf("-12");
+        numbers[1] = Double.valueOf("13");
+        numbers[2] = Double.valueOf("-22");
+        numbers[3] = Double.valueOf("23");
     }
 
     @Override
diff --git a/src/test/java/org/apache/commons/beanutils2/locale/converters/DoubleLocaleConverterTestCase.java b/src/test/java/org/apache/commons/beanutils2/locale/converters/DoubleLocaleConverterTestCase.java
index 9bd653e8..ecb5d26a 100644
--- a/src/test/java/org/apache/commons/beanutils2/locale/converters/DoubleLocaleConverterTestCase.java
+++ b/src/test/java/org/apache/commons/beanutils2/locale/converters/DoubleLocaleConverterTestCase.java
@@ -40,8 +40,8 @@ public class DoubleLocaleConverterTestCase extends BaseLocaleConverterTestCase<D
 
         super.setUp();
 
-        defaultValue  = new Double("9.99");
-        expectedValue = new Double(expectedDecimalValue);
+        defaultValue  = Double.valueOf("9.99");
+        expectedValue = Double.valueOf(expectedDecimalValue);
 
     }
 
@@ -77,7 +77,7 @@ public class DoubleLocaleConverterTestCase extends BaseLocaleConverterTestCase<D
         // quite happily turning "1,234.56" into "1.234"
         // I guess this is one of the limitations of DecimalFormat
         // **************************************************************************
-        convertValueNoPattern(converter, "(B)", defaultDecimalValue, new Double("1.234"));
+        convertValueNoPattern(converter, "(B)", defaultDecimalValue, Double.valueOf("1.234"));
 
         // **************************************************************************
         // Convert with non-localized pattern - this causes an exception in parse()