commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ggreg...@apache.org
Subject svn commit: r1153502 - in /commons/proper/codec/trunk/src/test/org/apache/commons/codec: StringEncoderComparatorTest.java binary/Base32InputStreamTest.java binary/Base64InputStreamTest.java binary/Base64Test.java
Date Wed, 03 Aug 2011 14:26:16 GMT
Author: ggregory
Date: Wed Aug  3 14:26:15 2011
New Revision: 1153502

URL: http://svn.apache.org/viewvc?rev=1153502&view=rev
Log:
Fix FindBugs issues.

Modified:
    commons/proper/codec/trunk/src/test/org/apache/commons/codec/StringEncoderComparatorTest.java
    commons/proper/codec/trunk/src/test/org/apache/commons/codec/binary/Base32InputStreamTest.java
    commons/proper/codec/trunk/src/test/org/apache/commons/codec/binary/Base64InputStreamTest.java
    commons/proper/codec/trunk/src/test/org/apache/commons/codec/binary/Base64Test.java

Modified: commons/proper/codec/trunk/src/test/org/apache/commons/codec/StringEncoderComparatorTest.java
URL: http://svn.apache.org/viewvc/commons/proper/codec/trunk/src/test/org/apache/commons/codec/StringEncoderComparatorTest.java?rev=1153502&r1=1153501&r2=1153502&view=diff
==============================================================================
--- commons/proper/codec/trunk/src/test/org/apache/commons/codec/StringEncoderComparatorTest.java
(original)
+++ commons/proper/codec/trunk/src/test/org/apache/commons/codec/StringEncoderComparatorTest.java
Wed Aug  3 14:26:15 2011
@@ -69,7 +69,7 @@ public class StringEncoderComparatorTest
         StringEncoderComparator sCompare =
             new StringEncoderComparator( new DoubleMetaphone() );
            
-        int compare = sCompare.compare(new Double(3.0), new Long(3));
+        int compare = sCompare.compare(new Double(3.0), Long.valueOf(3));
         assertEquals( "Trying to compare objects that make no sense to the underlying encoder
should return a zero compare code",
                                 0, compare);        
     }

Modified: commons/proper/codec/trunk/src/test/org/apache/commons/codec/binary/Base32InputStreamTest.java
URL: http://svn.apache.org/viewvc/commons/proper/codec/trunk/src/test/org/apache/commons/codec/binary/Base32InputStreamTest.java?rev=1153502&r1=1153501&r2=1153502&view=diff
==============================================================================
--- commons/proper/codec/trunk/src/test/org/apache/commons/codec/binary/Base32InputStreamTest.java
(original)
+++ commons/proper/codec/trunk/src/test/org/apache/commons/codec/binary/Base32InputStreamTest.java
Wed Aug  3 14:26:15 2011
@@ -41,8 +41,12 @@ public class Base32InputStreamTest {
     @Test
     public void testCodec105() throws IOException {
         Base32InputStream in = new Base32InputStream(new Codec105ErrorInputStream(), true,
0, null);
-        for (int i = 0; i < 5; i++) {
-            in.read();
+        try {
+            for (int i = 0; i < 5; i++) {
+                in.read();
+            }
+        } finally {
+            in.close();
         }
     }
 

Modified: commons/proper/codec/trunk/src/test/org/apache/commons/codec/binary/Base64InputStreamTest.java
URL: http://svn.apache.org/viewvc/commons/proper/codec/trunk/src/test/org/apache/commons/codec/binary/Base64InputStreamTest.java?rev=1153502&r1=1153501&r2=1153502&view=diff
==============================================================================
--- commons/proper/codec/trunk/src/test/org/apache/commons/codec/binary/Base64InputStreamTest.java
(original)
+++ commons/proper/codec/trunk/src/test/org/apache/commons/codec/binary/Base64InputStreamTest.java
Wed Aug  3 14:26:15 2011
@@ -51,8 +51,12 @@ public class Base64InputStreamTest {
     @Test
     public void testCodec105() throws IOException {
         Base64InputStream in = new Base64InputStream(new Codec105ErrorInputStream(), true,
0, null);
-        for (int i = 0; i < 5; i++) {
-            in.read();
+        try {
+            for (int i = 0; i < 5; i++) {
+                in.read();
+            }
+        } finally {
+            in.close();
         }
     }
 

Modified: commons/proper/codec/trunk/src/test/org/apache/commons/codec/binary/Base64Test.java
URL: http://svn.apache.org/viewvc/commons/proper/codec/trunk/src/test/org/apache/commons/codec/binary/Base64Test.java?rev=1153502&r1=1153501&r2=1153502&view=diff
==============================================================================
--- commons/proper/codec/trunk/src/test/org/apache/commons/codec/binary/Base64Test.java (original)
+++ commons/proper/codec/trunk/src/test/org/apache/commons/codec/binary/Base64Test.java Wed
Aug  3 14:26:15 2011
@@ -469,7 +469,7 @@ public class Base64Test {
         Base64 b64 = new Base64();
 
         try {
-            b64.decode(new Integer(5));
+            b64.decode(Integer.valueOf(5));
             fail("decode(Object) didn't throw an exception when passed an Integer object");
         } catch (DecoderException e) {
             // ignored



Mime
View raw message