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
The following commit(s) were added to refs/heads/master by this push: new afc4e189 Use Byte cache afc4e189 is described below commit afc4e1898570ad179bfe09c90aca0b7c5a716822 Author: Gary Gregory <garydgreg...@gmail.com> AuthorDate: Sun Jan 8 11:35:30 2023 -0500 Use Byte cache --- .../apache/commons/beanutils2/BeanMapTestCase.java | 2 +- .../BeanPropertyValueChangeConsumerTestCase.java | 2 +- .../BeanPropertyValueEqualsPredicateTestCase.java | 2 +- .../BeanToPropertyValueTransformerTestCase.java | 2 +- .../commons/beanutils2/BeanUtilsBenchCase.java | 2 +- .../commons/beanutils2/BeanUtilsTestCase.java | 30 ++++++++-------- .../commons/beanutils2/DynaBeanUtilsTestCase.java | 24 ++++++------- .../commons/beanutils2/PropertyUtilsBenchCase.java | 2 +- .../apache/commons/beanutils2/TestResultSet.java | 2 +- .../converters/BigDecimalConverterTestCase.java | 2 +- .../converters/ByteConverterTestCase.java | 40 +++++++++++----------- .../converters/DoubleConverterTestCase.java | 2 +- .../converters/FloatConverterTestCase.java | 2 +- .../converters/IntegerConverterTestCase.java | 2 +- .../converters/LongConverterTestCase.java | 2 +- .../converters/NumberConverterTestBase.java | 2 +- .../converters/ShortConverterTestCase.java | 2 +- .../converters/ByteLocaleConverterTestCase.java | 8 ++--- 18 files changed, 65 insertions(+), 65 deletions(-) diff --git a/src/test/java/org/apache/commons/beanutils2/BeanMapTestCase.java b/src/test/java/org/apache/commons/beanutils2/BeanMapTestCase.java index 9c6bd6d6..e7b0116f 100644 --- a/src/test/java/org/apache/commons/beanutils2/BeanMapTestCase.java +++ b/src/test/java/org/apache/commons/beanutils2/BeanMapTestCase.java @@ -376,7 +376,7 @@ public class BeanMapTestCase extends AbstractTestMap { final BeanMap beanMap = new BeanMap(); assertEquals("Boolean.TYPE", Boolean.TRUE, beanMap.getTypeTransformer(Boolean.TYPE).apply("true")); assertEquals("Character.TYPE", new Character('B'), beanMap.getTypeTransformer(Character.TYPE).apply("BCD")); - assertEquals("Byte.TYPE", new Byte((byte)1), beanMap.getTypeTransformer(Byte.TYPE).apply("1")); + assertEquals("Byte.TYPE", Byte.valueOf((byte)1), beanMap.getTypeTransformer(Byte.TYPE).apply("1")); assertEquals("Short.TYPE", new Short((short)2), beanMap.getTypeTransformer(Short.TYPE).apply("2")); assertEquals("Integer.TYPE", Integer.valueOf(3), beanMap.getTypeTransformer(Integer.TYPE).apply("3")); assertEquals("Long.TYPE", Long.valueOf(4), beanMap.getTypeTransformer(Long.TYPE).apply("4")); diff --git a/src/test/java/org/apache/commons/beanutils2/BeanPropertyValueChangeConsumerTestCase.java b/src/test/java/org/apache/commons/beanutils2/BeanPropertyValueChangeConsumerTestCase.java index 71c3e5fd..1e814c31 100644 --- a/src/test/java/org/apache/commons/beanutils2/BeanPropertyValueChangeConsumerTestCase.java +++ b/src/test/java/org/apache/commons/beanutils2/BeanPropertyValueChangeConsumerTestCase.java @@ -30,7 +30,7 @@ public class BeanPropertyValueChangeConsumerTestCase extends TestCase { private static final Float expectedFloatValue = new Float(123.123f); private static final Double expectedDoubleValue = Double.valueOf(567879.12344d); private static final Boolean expectedBooleanValue = Boolean.TRUE; - private static final Byte expectedByteValue = new Byte("12"); + private static final Byte expectedByteValue = Byte.valueOf("12"); /** * Constructor for BeanPropertyValueChangeClosureTest. diff --git a/src/test/java/org/apache/commons/beanutils2/BeanPropertyValueEqualsPredicateTestCase.java b/src/test/java/org/apache/commons/beanutils2/BeanPropertyValueEqualsPredicateTestCase.java index 4b41cf28..04436735 100644 --- a/src/test/java/org/apache/commons/beanutils2/BeanPropertyValueEqualsPredicateTestCase.java +++ b/src/test/java/org/apache/commons/beanutils2/BeanPropertyValueEqualsPredicateTestCase.java @@ -29,7 +29,7 @@ public class BeanPropertyValueEqualsPredicateTestCase extends TestCase { private static final Float expectedFloatValue = new Float(123.123f); private static final Double expectedDoubleValue = Double.valueOf(567879.12344d); private static final Boolean expectedBooleanValue = Boolean.TRUE; - private static final Byte expectedByteValue = new Byte("12"); + private static final Byte expectedByteValue = Byte.valueOf("12"); /** * Constructor for BeanPropertyValueEqualsPredicateTest. diff --git a/src/test/java/org/apache/commons/beanutils2/BeanToPropertyValueTransformerTestCase.java b/src/test/java/org/apache/commons/beanutils2/BeanToPropertyValueTransformerTestCase.java index 11bc848a..31c78271 100644 --- a/src/test/java/org/apache/commons/beanutils2/BeanToPropertyValueTransformerTestCase.java +++ b/src/test/java/org/apache/commons/beanutils2/BeanToPropertyValueTransformerTestCase.java @@ -31,7 +31,7 @@ public class BeanToPropertyValueTransformerTestCase extends TestCase { private static final Float expectedFloatValue = new Float(123.123f); private static final Double expectedDoubleValue = Double.valueOf(567879.12344d); private static final Boolean expectedBooleanValue = Boolean.TRUE; - private static final Byte expectedByteValue = new Byte("12"); + private static final Byte expectedByteValue = Byte.valueOf("12"); /** * Constructor for BeanToPropertyValueTransformerTestCase. diff --git a/src/test/java/org/apache/commons/beanutils2/BeanUtilsBenchCase.java b/src/test/java/org/apache/commons/beanutils2/BeanUtilsBenchCase.java index ed84fc09..4b36bf55 100644 --- a/src/test/java/org/apache/commons/beanutils2/BeanUtilsBenchCase.java +++ b/src/test/java/org/apache/commons/beanutils2/BeanUtilsBenchCase.java @@ -98,7 +98,7 @@ public class BeanUtilsBenchCase extends TestCase { inBean = new BenchBean(); inMap = new HashMap<>(); inMap.put("booleanProperty", new Boolean(inBean.getBooleanProperty())); - inMap.put("byteProperty", new Byte(inBean.getByteProperty())); + inMap.put("byteProperty", Byte.valueOf(inBean.getByteProperty())); inMap.put("doubleProperty", Double.valueOf(inBean.getDoubleProperty())); inMap.put("floatProperty", new Float(inBean.getFloatProperty())); inMap.put("intProperty", Integer.valueOf(inBean.getIntProperty())); diff --git a/src/test/java/org/apache/commons/beanutils2/BeanUtilsTestCase.java b/src/test/java/org/apache/commons/beanutils2/BeanUtilsTestCase.java index e184f9ef..23762f6d 100644 --- a/src/test/java/org/apache/commons/beanutils2/BeanUtilsTestCase.java +++ b/src/test/java/org/apache/commons/beanutils2/BeanUtilsTestCase.java @@ -179,7 +179,7 @@ public class BeanUtilsTestCase extends TestCase { fail("newInstance(): " + e); } orig.set("booleanProperty", Boolean.FALSE); - orig.set("byteProperty", new Byte((byte) 111)); + orig.set("byteProperty", Byte.valueOf((byte) 111)); orig.set("doubleProperty", Double.valueOf(333.33)); orig.set("dupProperty", new String[] { "New 0", "New 1", "New 2" }); @@ -889,7 +889,7 @@ public class BeanUtilsTestCase extends TestCase { */ public void testSetPropertyByte() throws Exception { - BeanUtils.setProperty(bean, "byteProperty", new Byte((byte) 123)); + BeanUtils.setProperty(bean, "byteProperty", Byte.valueOf((byte) 123)); assertEquals((byte) 123, bean.getByteProperty()); /* BeanUtils.setProperty(bean, "byteProperty", new Double((double) 123)); @@ -974,7 +974,7 @@ public class BeanUtilsTestCase extends TestCase { */ public void testSetPropertyDouble() throws Exception { - BeanUtils.setProperty(bean, "doubleProperty", new Byte((byte) 123)); + BeanUtils.setProperty(bean, "doubleProperty", Byte.valueOf((byte) 123)); assertEquals(123, bean.getDoubleProperty(), 0.005); BeanUtils.setProperty(bean, "doubleProperty", Double.valueOf(123)); assertEquals(123, bean.getDoubleProperty(), 0.005); @@ -994,7 +994,7 @@ public class BeanUtilsTestCase extends TestCase { */ public void testSetPropertyFloat() throws Exception { - BeanUtils.setProperty(bean, "floatProperty", new Byte((byte) 123)); + BeanUtils.setProperty(bean, "floatProperty", Byte.valueOf((byte) 123)); assertEquals(123, bean.getFloatProperty(), 0.005); BeanUtils.setProperty(bean, "floatProperty", Double.valueOf(123)); assertEquals(123, bean.getFloatProperty(), 0.005); @@ -1014,7 +1014,7 @@ public class BeanUtilsTestCase extends TestCase { */ public void testSetPropertyInteger() throws Exception { - BeanUtils.setProperty(bean, "longProperty", new Byte((byte) 123)); + BeanUtils.setProperty(bean, "longProperty", Byte.valueOf((byte) 123)); assertEquals(123, bean.getIntProperty()); /* BeanUtils.setProperty(bean, "longProperty", new Double((double) 123)); @@ -1036,7 +1036,7 @@ public class BeanUtilsTestCase extends TestCase { */ public void testSetPropertyLong() throws Exception { - BeanUtils.setProperty(bean, "longProperty", new Byte((byte) 123)); + BeanUtils.setProperty(bean, "longProperty", Byte.valueOf((byte) 123)); assertEquals(123, bean.getLongProperty()); /* BeanUtils.setProperty(bean, "longProperty", new Double((double) 123)); @@ -1069,7 +1069,7 @@ public class BeanUtilsTestCase extends TestCase { */ public void testSetPropertyShort() throws Exception { - BeanUtils.setProperty(bean, "shortProperty", new Byte((byte) 123)); + BeanUtils.setProperty(bean, "shortProperty", Byte.valueOf((byte) 123)); assertEquals((short) 123, bean.getShortProperty()); /* BeanUtils.setProperty(bean, "shortProperty", new Double((double) 123)); @@ -1112,7 +1112,7 @@ public class BeanUtilsTestCase extends TestCase { */ public void testCopyPropertyByte() throws Exception { - BeanUtils.copyProperty(bean, "byteProperty", new Byte((byte) 123)); + BeanUtils.copyProperty(bean, "byteProperty", Byte.valueOf((byte) 123)); assertEquals((byte) 123, bean.getByteProperty()); BeanUtils.copyProperty(bean, "byteProperty", Double.valueOf(123)); assertEquals((byte) 123, bean.getByteProperty()); @@ -1195,7 +1195,7 @@ public class BeanUtilsTestCase extends TestCase { */ public void testCopyPropertyDouble() throws Exception { - BeanUtils.copyProperty(bean, "doubleProperty", new Byte((byte) 123)); + BeanUtils.copyProperty(bean, "doubleProperty", Byte.valueOf((byte) 123)); assertEquals(123, bean.getDoubleProperty(), 0.005); BeanUtils.copyProperty(bean, "doubleProperty", Double.valueOf(123)); assertEquals(123, bean.getDoubleProperty(), 0.005); @@ -1215,7 +1215,7 @@ public class BeanUtilsTestCase extends TestCase { */ public void testCopyPropertyFloat() throws Exception { - BeanUtils.copyProperty(bean, "floatProperty", new Byte((byte) 123)); + BeanUtils.copyProperty(bean, "floatProperty", Byte.valueOf((byte) 123)); assertEquals(123, bean.getFloatProperty(), 0.005); BeanUtils.copyProperty(bean, "floatProperty", Double.valueOf(123)); assertEquals(123, bean.getFloatProperty(), 0.005); @@ -1235,7 +1235,7 @@ public class BeanUtilsTestCase extends TestCase { */ public void testCopyPropertyInteger() throws Exception { - BeanUtils.copyProperty(bean, "longProperty", new Byte((byte) 123)); + BeanUtils.copyProperty(bean, "longProperty", Byte.valueOf((byte) 123)); assertEquals(123, bean.getIntProperty()); BeanUtils.copyProperty(bean, "longProperty", Double.valueOf(123)); assertEquals(123, bean.getIntProperty()); @@ -1255,7 +1255,7 @@ public class BeanUtilsTestCase extends TestCase { */ public void testCopyPropertyLong() throws Exception { - BeanUtils.copyProperty(bean, "longProperty", new Byte((byte) 123)); + BeanUtils.copyProperty(bean, "longProperty", Byte.valueOf((byte) 123)); assertEquals(123, bean.getLongProperty()); BeanUtils.copyProperty(bean, "longProperty", Double.valueOf(123)); assertEquals(123, bean.getLongProperty()); @@ -1275,7 +1275,7 @@ public class BeanUtilsTestCase extends TestCase { */ public void testCopyPropertyShort() throws Exception { - BeanUtils.copyProperty(bean, "shortProperty", new Byte((byte) 123)); + BeanUtils.copyProperty(bean, "shortProperty", Byte.valueOf((byte) 123)); assertEquals((short) 123, bean.getShortProperty()); BeanUtils.copyProperty(bean, "shortProperty", Double.valueOf(123)); assertEquals((short) 123, bean.getShortProperty()); @@ -1308,7 +1308,7 @@ public class BeanUtilsTestCase extends TestCase { checkIntArray(bean.getNested().getIntArray(), intChanged); // Widening conversion required - BeanUtils.copyProperty(bean, "nested.intArray[1]", new Byte((byte) 2)); + BeanUtils.copyProperty(bean, "nested.intArray[1]", Byte.valueOf((byte) 2)); checkIntArray(bean.getIntArray(), origArray); intChanged[1] = 2; checkIntArray(bean.getNested().getIntArray(), intChanged); @@ -1364,7 +1364,7 @@ public class BeanUtilsTestCase extends TestCase { assertEquals(1, bean.getNested().getIntProperty()); // Widening conversion required - BeanUtils.copyProperty(bean, "nested.intProperty", new Byte((byte) 2)); + BeanUtils.copyProperty(bean, "nested.intProperty", Byte.valueOf((byte) 2)); assertNotNull(bean.getNested()); assertEquals(0, bean.getIntProperty()); assertEquals(2, bean.getNested().getIntProperty()); diff --git a/src/test/java/org/apache/commons/beanutils2/DynaBeanUtilsTestCase.java b/src/test/java/org/apache/commons/beanutils2/DynaBeanUtilsTestCase.java index ac5fca75..e4213313 100644 --- a/src/test/java/org/apache/commons/beanutils2/DynaBeanUtilsTestCase.java +++ b/src/test/java/org/apache/commons/beanutils2/DynaBeanUtilsTestCase.java @@ -104,7 +104,7 @@ public class DynaBeanUtilsTestCase extends TestCase { // Initialize the DynaBean's property values (like TestBean) bean.set("booleanProperty", new Boolean(true)); bean.set("booleanSecond", new Boolean(true)); - bean.set("byteProperty", new Byte((byte) 121)); + bean.set("byteProperty", Byte.valueOf((byte) 121)); 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"}; @@ -184,7 +184,7 @@ public class DynaBeanUtilsTestCase extends TestCase { fail("newInstance(): " + e); } orig.set("booleanProperty", Boolean.FALSE); - orig.set("byteProperty", new Byte((byte)111)); + orig.set("byteProperty", Byte.valueOf((byte)111)); 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 }); @@ -261,7 +261,7 @@ public class DynaBeanUtilsTestCase extends TestCase { fail("newInstance(): " + e); } orig.set("booleanProperty", Boolean.FALSE); - orig.set("byteProperty", new Byte((byte)111)); + orig.set("byteProperty", Byte.valueOf((byte)111)); 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 }); @@ -477,7 +477,7 @@ public class DynaBeanUtilsTestCase extends TestCase { Boolean.TRUE, map.get("booleanProperty")); assertEquals("Value of 'byteProperty'", - new Byte((byte) 121), + Byte.valueOf((byte) 121), map.get("byteProperty")); assertEquals("Value of 'doubleProperty'", Double.valueOf(321.0), @@ -929,7 +929,7 @@ public class DynaBeanUtilsTestCase extends TestCase { */ public void testCopyPropertyByte() throws Exception { - BeanUtils.setProperty(bean, "byteProperty", new Byte((byte) 123)); + BeanUtils.setProperty(bean, "byteProperty", Byte.valueOf((byte) 123)); assertEquals((byte) 123, ((Byte) bean.get("byteProperty")).byteValue()); /* BeanUtils.setProperty(bean, "byteProperty", new Double((double) 123)); @@ -951,7 +951,7 @@ public class DynaBeanUtilsTestCase extends TestCase { */ public void testCopyPropertyDouble() throws Exception { - BeanUtils.setProperty(bean, "doubleProperty", new Byte((byte) 123)); + BeanUtils.setProperty(bean, "doubleProperty", Byte.valueOf((byte) 123)); assertEquals(123, ((Double) bean.get("doubleProperty")).doubleValue(), 0.005); BeanUtils.setProperty(bean, "doubleProperty", Double.valueOf(123)); assertEquals(123, ((Double) bean.get("doubleProperty")).doubleValue(), 0.005); @@ -971,7 +971,7 @@ public class DynaBeanUtilsTestCase extends TestCase { */ public void testCopyPropertyFloat() throws Exception { - BeanUtils.setProperty(bean, "floatProperty", new Byte((byte) 123)); + BeanUtils.setProperty(bean, "floatProperty", Byte.valueOf((byte) 123)); assertEquals(123, ((Float) bean.get("floatProperty")).floatValue(), 0.005); BeanUtils.setProperty(bean, "floatProperty", Double.valueOf(123)); assertEquals(123, ((Float) bean.get("floatProperty")).floatValue(), 0.005); @@ -991,7 +991,7 @@ public class DynaBeanUtilsTestCase extends TestCase { */ public void testCopyPropertyInteger() throws Exception { - BeanUtils.setProperty(bean, "longProperty", new Byte((byte) 123)); + BeanUtils.setProperty(bean, "longProperty", Byte.valueOf((byte) 123)); assertEquals(123, ((Integer) bean.get("intProperty")).intValue()); /* BeanUtils.setProperty(bean, "longProperty", new Double((double) 123)); @@ -1013,7 +1013,7 @@ public class DynaBeanUtilsTestCase extends TestCase { */ public void testCopyPropertyLong() throws Exception { - BeanUtils.setProperty(bean, "longProperty", new Byte((byte) 123)); + BeanUtils.setProperty(bean, "longProperty", Byte.valueOf((byte) 123)); assertEquals(123, ((Long) bean.get("longProperty")).longValue()); /* BeanUtils.setProperty(bean, "longProperty", new Double((double) 123)); @@ -1046,7 +1046,7 @@ public class DynaBeanUtilsTestCase extends TestCase { */ public void testCopyPropertyShort() throws Exception { - BeanUtils.setProperty(bean, "shortProperty", new Byte((byte) 123)); + BeanUtils.setProperty(bean, "shortProperty", Byte.valueOf((byte) 123)); assertEquals((short) 123, ((Short) bean.get("shortProperty")).shortValue()); /* BeanUtils.setProperty(bean, "shortProperty", new Double((double) 123)); @@ -1082,7 +1082,7 @@ public class DynaBeanUtilsTestCase extends TestCase { intChanged); // Widening conversion required - BeanUtils.copyProperty(bean, "nested.intArray[1]", new Byte((byte) 2)); + BeanUtils.copyProperty(bean, "nested.intArray[1]", Byte.valueOf((byte) 2)); checkIntArray((int[]) bean.get("intArray"), origArray); intChanged[1] = 2; checkIntArray(((TestBean) bean.get("nested")).getIntArray(), @@ -1140,7 +1140,7 @@ public class DynaBeanUtilsTestCase extends TestCase { assertEquals(1, nested.getIntProperty()); // Widening conversion required - BeanUtils.copyProperty(bean, "nested.intProperty", new Byte((byte) 2)); + BeanUtils.copyProperty(bean, "nested.intProperty", Byte.valueOf((byte) 2)); assertEquals(0, ((Integer) bean.get("intProperty")).intValue()); assertEquals(2, nested.getIntProperty()); diff --git a/src/test/java/org/apache/commons/beanutils2/PropertyUtilsBenchCase.java b/src/test/java/org/apache/commons/beanutils2/PropertyUtilsBenchCase.java index 7a817ff5..08d4cd2f 100644 --- a/src/test/java/org/apache/commons/beanutils2/PropertyUtilsBenchCase.java +++ b/src/test/java/org/apache/commons/beanutils2/PropertyUtilsBenchCase.java @@ -96,7 +96,7 @@ public class PropertyUtilsBenchCase extends TestCase { inBean = new BenchBean(); inMap = new HashMap<>(); inMap.put("booleanProperty", new Boolean(inBean.getBooleanProperty())); - inMap.put("byteProperty", new Byte(inBean.getByteProperty())); + inMap.put("byteProperty", Byte.valueOf(inBean.getByteProperty())); inMap.put("doubleProperty", Double.valueOf(inBean.getDoubleProperty())); inMap.put("floatProperty", new Float(inBean.getFloatProperty())); inMap.put("intProperty", Integer.valueOf(inBean.getIntProperty())); diff --git a/src/test/java/org/apache/commons/beanutils2/TestResultSet.java b/src/test/java/org/apache/commons/beanutils2/TestResultSet.java index 2b90ee32..5126050b 100644 --- a/src/test/java/org/apache/commons/beanutils2/TestResultSet.java +++ b/src/test/java/org/apache/commons/beanutils2/TestResultSet.java @@ -166,7 +166,7 @@ public class TestResultSet implements InvocationHandler { return Boolean.FALSE; } if ("byteProperty".equals(columnName)) { - return new Byte((byte) row); + return Byte.valueOf((byte) row); } if ("dateProperty".equals(columnName)) { return new Date(timestampMillis); 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 10911991..d7d61bcb 100644 --- a/src/test/java/org/apache/commons/beanutils2/converters/BigDecimalConverterTestCase.java +++ b/src/test/java/org/apache/commons/beanutils2/converters/BigDecimalConverterTestCase.java @@ -100,7 +100,7 @@ public class BigDecimalConverterTestCase extends NumberConverterTestBase<BigDeci "0.0", "1.1", "17.2", - new Byte((byte)7), + Byte.valueOf((byte)7), new Short((short)8), Integer.valueOf(9), Long.valueOf(10), 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 fa8a6eed..174bb35f 100644 --- a/src/test/java/org/apache/commons/beanutils2/converters/ByteConverterTestCase.java +++ b/src/test/java/org/apache/commons/beanutils2/converters/ByteConverterTestCase.java @@ -54,10 +54,10 @@ public class ByteConverterTestCase extends NumberConverterTestBase<Byte> { @Override public void setUp() throws Exception { converter = makeConverter(); - numbers[0] = new Byte("-12"); - numbers[1] = new Byte("13"); - numbers[2] = new Byte("-22"); - numbers[3] = new Byte("23"); + numbers[0] = Byte.valueOf("-12"); + numbers[1] = Byte.valueOf("13"); + numbers[2] = Byte.valueOf("-22"); + numbers[3] = Byte.valueOf("23"); } @Override @@ -78,10 +78,10 @@ public class ByteConverterTestCase extends NumberConverterTestBase<Byte> { final Long maxPlusOne = Long.valueOf(max.longValue() + 1); // Minimum - assertEquals("Minimum", new Byte(Byte.MIN_VALUE), converter.convert(clazz, min)); + assertEquals("Minimum", Byte.valueOf(Byte.MIN_VALUE), converter.convert(clazz, min)); // Maximum - assertEquals("Maximum", new Byte(Byte.MAX_VALUE), converter.convert(clazz, max)); + assertEquals("Maximum", Byte.valueOf(Byte.MAX_VALUE), converter.convert(clazz, max)); // Too Small try { @@ -125,7 +125,7 @@ public class ByteConverterTestCase extends NumberConverterTestBase<Byte> { "1", "17", String.valueOf(Byte.MAX_VALUE), - new Byte((byte)7), + Byte.valueOf((byte)7), new Short((short)8), Integer.valueOf(9), Long.valueOf(10), @@ -134,19 +134,19 @@ public class ByteConverterTestCase extends NumberConverterTestBase<Byte> { }; final Byte[] expected = { - new Byte(Byte.MIN_VALUE), - new Byte((byte)-17), - new Byte((byte)-1), - new Byte((byte)0), - new Byte((byte)1), - new Byte((byte)17), - new Byte(Byte.MAX_VALUE), - new Byte((byte)7), - new Byte((byte)8), - new Byte((byte)9), - new Byte((byte)10), - new Byte((byte)11), - new Byte((byte)12) + Byte.valueOf(Byte.MIN_VALUE), + Byte.valueOf((byte)-17), + Byte.valueOf((byte)-1), + Byte.valueOf((byte)0), + Byte.valueOf((byte)1), + Byte.valueOf((byte)17), + Byte.valueOf(Byte.MAX_VALUE), + Byte.valueOf((byte)7), + Byte.valueOf((byte)8), + Byte.valueOf((byte)9), + Byte.valueOf((byte)10), + Byte.valueOf((byte)11), + Byte.valueOf((byte)12) }; for(int i=0;i<expected.length;i++) { 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 4f09a418..7818a910 100644 --- a/src/test/java/org/apache/commons/beanutils2/converters/DoubleConverterTestCase.java +++ b/src/test/java/org/apache/commons/beanutils2/converters/DoubleConverterTestCase.java @@ -90,7 +90,7 @@ public class DoubleConverterTestCase extends NumberConverterTestBase<Double> { "1.1", "17.2", String.valueOf(Double.MAX_VALUE), - new Byte((byte)7), + Byte.valueOf((byte)7), new Short((short)8), Integer.valueOf(9), Long.valueOf(10), 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 afb6b017..459c2b21 100644 --- a/src/test/java/org/apache/commons/beanutils2/converters/FloatConverterTestCase.java +++ b/src/test/java/org/apache/commons/beanutils2/converters/FloatConverterTestCase.java @@ -112,7 +112,7 @@ public class FloatConverterTestCase extends NumberConverterTestBase<Float> { "1.1", "17.2", String.valueOf(Float.MAX_VALUE), - new Byte((byte)7), + Byte.valueOf((byte)7), new Short((short)8), Integer.valueOf(9), Long.valueOf(10), 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 bef765a9..f69235d5 100644 --- a/src/test/java/org/apache/commons/beanutils2/converters/IntegerConverterTestCase.java +++ b/src/test/java/org/apache/commons/beanutils2/converters/IntegerConverterTestCase.java @@ -141,7 +141,7 @@ public class IntegerConverterTestCase extends NumberConverterTestBase<Integer> { "1", "17", String.valueOf(Integer.MAX_VALUE), - new Byte((byte)7), + Byte.valueOf((byte)7), new Short((short)8), Integer.valueOf(9), Long.valueOf(10), 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 7e5b72a4..7c9a0aa7 100644 --- a/src/test/java/org/apache/commons/beanutils2/converters/LongConverterTestCase.java +++ b/src/test/java/org/apache/commons/beanutils2/converters/LongConverterTestCase.java @@ -90,7 +90,7 @@ public class LongConverterTestCase extends NumberConverterTestBase<Long> { "1", "17", String.valueOf(Long.MAX_VALUE), - new Byte((byte)7), + Byte.valueOf((byte)7), new Short((short)8), Integer.valueOf(9), Long.valueOf(10), 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 4a169afb..c42976d5 100644 --- a/src/test/java/org/apache/commons/beanutils2/converters/NumberConverterTestBase.java +++ b/src/test/java/org/apache/commons/beanutils2/converters/NumberConverterTestBase.java @@ -105,7 +105,7 @@ public abstract class NumberConverterTestBase<T extends Number> extends TestCase }; final Object[] number = { - new Byte((byte)7), + Byte.valueOf((byte)7), new Short((short)8), Integer.valueOf(9), Long.valueOf(10), 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 961b74d0..ee745ecf 100644 --- a/src/test/java/org/apache/commons/beanutils2/converters/ShortConverterTestCase.java +++ b/src/test/java/org/apache/commons/beanutils2/converters/ShortConverterTestCase.java @@ -125,7 +125,7 @@ public class ShortConverterTestCase extends NumberConverterTestBase<Short> { "1", "17", String.valueOf(Short.MAX_VALUE), - new Byte((byte)7), + Byte.valueOf((byte)7), new Short((short)8), Integer.valueOf(9), Long.valueOf(10), diff --git a/src/test/java/org/apache/commons/beanutils2/locale/converters/ByteLocaleConverterTestCase.java b/src/test/java/org/apache/commons/beanutils2/locale/converters/ByteLocaleConverterTestCase.java index 95b184b2..e5d7f84d 100644 --- a/src/test/java/org/apache/commons/beanutils2/locale/converters/ByteLocaleConverterTestCase.java +++ b/src/test/java/org/apache/commons/beanutils2/locale/converters/ByteLocaleConverterTestCase.java @@ -50,8 +50,8 @@ public class ByteLocaleConverterTestCase extends BaseLocaleConverterTestCase<Byt expectedDecimalValue = "123.56"; expectedIntegerValue = "123"; - defaultValue = new Byte("99"); - expectedValue = new Byte(expectedIntegerValue); + defaultValue = Byte.valueOf("99"); + expectedValue = Byte.valueOf(expectedIntegerValue); } @@ -87,12 +87,12 @@ public class ByteLocaleConverterTestCase extends BaseLocaleConverterTestCase<Byt // quite happily turning ",123" into "0" // I guess this is one of the limitations of DecimalFormat // ************************************************************************** - convertValueNoPattern(converter, "(B)", defaultIntegerValue, new Byte("0")); + convertValueNoPattern(converter, "(B)", defaultIntegerValue, Byte.valueOf("0")); // ************************************************************************** // Convert with non-localized pattern // ************************************************************************** - convertValueWithPattern(converter, "(B)", "123", defaultIntegerPattern, new Byte("123")); + convertValueWithPattern(converter, "(B)", "123", defaultIntegerPattern, Byte.valueOf("123")); convertValueWithPattern(converter, "(B-2)", localizedIntegerValue, defaultIntegerPattern, defaultValue); // **************************************************************************