Skip to content

Commit 6ab7e0c

Browse files
committed
Remove test code that used deprecated constructors for Numbers (calling valueOf) now
1 parent e9f1cd8 commit 6ab7e0c

6 files changed

Lines changed: 10 additions & 10 deletions

File tree

src/test/java/org/apache/commons/codec/StringEncoderAbstractTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ public void testEncodeWithInvalidObject() throws Exception {
7474
boolean exceptionThrown = false;
7575
try {
7676
final StringEncoder encoder = this.getStringEncoder();
77-
encoder.encode(new Float(3.4));
77+
encoder.encode(Float.valueOf(3.4f));
7878
} catch (final Exception e) {
7979
exceptionThrown = true;
8080
}

src/test/java/org/apache/commons/codec/StringEncoderComparatorTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ public void testComparatorWithDoubleMetaphoneAndInvalidInput() throws Exception
6969
final StringEncoderComparator sCompare =
7070
new StringEncoderComparator( new DoubleMetaphone() );
7171

72-
final int compare = sCompare.compare(new Double(3.0), Long.valueOf(3));
72+
final int compare = sCompare.compare(Double.valueOf(3.0d), Long.valueOf(3));
7373
assertEquals( "Trying to compare objects that make no sense to the underlying encoder should return a zero compare code",
7474
0, compare);
7575
}

src/test/java/org/apache/commons/codec/net/BCodecTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ public void testEncodeObjects() throws Exception {
117117
assertEquals("Encoding a null Object should return null", null, result);
118118

119119
try {
120-
final Object dObj = new Double(3.0);
120+
final Object dObj = Double.valueOf(3.0d);
121121
bcodec.encode(dObj);
122122
fail("Trying to url encode a Double object should cause an exception.");
123123
} catch (final EncoderException ee) {
@@ -141,7 +141,7 @@ public void testDecodeObjects() throws Exception {
141141
assertEquals("Decoding a null Object should return null", null, result);
142142

143143
try {
144-
final Object dObj = new Double(3.0);
144+
final Object dObj = Double.valueOf(3.0d);
145145
bcodec.decode(dObj);
146146
fail("Trying to url encode a Double object should cause an exception.");
147147
} catch (final DecoderException ee) {

src/test/java/org/apache/commons/codec/net/QCodecTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ public void testEncodeObjects() throws Exception {
143143
assertEquals( "Encoding a null Object should return null", null, result);
144144

145145
try {
146-
final Object dObj = new Double(3.0);
146+
final Object dObj = Double.valueOf(3.0d);
147147
qcodec.encode( dObj );
148148
fail( "Trying to url encode a Double object should cause an exception.");
149149
} catch (final EncoderException ee) {
@@ -169,7 +169,7 @@ public void testDecodeObjects() throws Exception {
169169
assertEquals( "Decoding a null Object should return null", null, result);
170170

171171
try {
172-
final Object dObj = new Double(3.0);
172+
final Object dObj = Double.valueOf(3.0d);
173173
qcodec.decode( dObj );
174174
fail( "Trying to url encode a Double object should cause an exception.");
175175
} catch (final DecoderException ee) {

src/test/java/org/apache/commons/codec/net/QuotedPrintableCodecTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ public void testEncodeObjects() throws Exception {
201201
assertEquals( "Encoding a null Object should return null", null, result);
202202

203203
try {
204-
final Object dObj = new Double(3.0);
204+
final Object dObj = Double.valueOf(3.0d);
205205
qpcodec.encode( dObj );
206206
fail( "Trying to url encode a Double object should cause an exception.");
207207
} catch (final EncoderException ee) {
@@ -232,7 +232,7 @@ public void testDecodeObjects() throws Exception {
232232
assertEquals( "Decoding a null Object should return null", null, result);
233233

234234
try {
235-
final Object dObj = new Double(3.0);
235+
final Object dObj = Double.valueOf(3.0d);
236236
qpcodec.decode( dObj );
237237
fail( "Trying to url encode a Double object should cause an exception.");
238238
} catch (final DecoderException ee) {

src/test/java/org/apache/commons/codec/net/URLCodecTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,7 @@ public void testEncodeObjects() throws Exception {
237237
assertEquals( "Encoding a null Object should return null", null, result);
238238

239239
try {
240-
final Object dObj = new Double(3.0);
240+
final Object dObj = Double.valueOf(3.0d);
241241
urlCodec.encode( dObj );
242242
fail( "Trying to url encode a Double object should cause an exception.");
243243
} catch (final EncoderException ee) {
@@ -283,7 +283,7 @@ public void testDecodeObjects() throws Exception {
283283
assertEquals( "Decoding a null Object should return null", null, result);
284284

285285
try {
286-
final Object dObj = new Double(3.0);
286+
final Object dObj = Double.valueOf(3.0d);
287287
urlCodec.decode( dObj );
288288
fail( "Trying to url encode a Double object should cause an exception.");
289289
} catch (final DecoderException ee) {

0 commit comments

Comments
 (0)