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:36 UTC
[commons-beanutils] 01/03: Use Double.valueOf(double)
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 = {