commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject svn commit: r749856 - in /commons/sandbox/compress/trunk/src: main/java/org/apache/commons/compress/archivers/tar/ main/java/org/apache/commons/compress/archivers/zip/ main/java/org/apache/commons/compress/compressors/bzip2/ test/java/org/apache/common...
Date Wed, 04 Mar 2009 00:24:43 GMT
Author: sebb
Date: Wed Mar  4 00:24:42 2009
New Revision: 749856

URL: http://svn.apache.org/viewvc?rev=749856&view=rev
Log:
Remove unnecessary casts

Modified:
    commons/sandbox/compress/trunk/src/main/java/org/apache/commons/compress/archivers/tar/TarArchiveInputStream.java
    commons/sandbox/compress/trunk/src/main/java/org/apache/commons/compress/archivers/zip/Simple8BitZipEncoding.java
    commons/sandbox/compress/trunk/src/main/java/org/apache/commons/compress/compressors/bzip2/BZip2CompressorOutputStream.java
    commons/sandbox/compress/trunk/src/test/java/org/apache/commons/compress/archivers/zip/ZipArchiveOutputStreamTest.java

Modified: commons/sandbox/compress/trunk/src/main/java/org/apache/commons/compress/archivers/tar/TarArchiveInputStream.java
URL: http://svn.apache.org/viewvc/commons/sandbox/compress/trunk/src/main/java/org/apache/commons/compress/archivers/tar/TarArchiveInputStream.java?rev=749856&r1=749855&r2=749856&view=diff
==============================================================================
--- commons/sandbox/compress/trunk/src/main/java/org/apache/commons/compress/archivers/tar/TarArchiveInputStream.java
(original)
+++ commons/sandbox/compress/trunk/src/main/java/org/apache/commons/compress/archivers/tar/TarArchiveInputStream.java
Wed Mar  4 00:24:42 2009
@@ -286,7 +286,7 @@
      */
     public int read() throws IOException {
         int num = read(oneBuf, 0, 1);
-        return num == -1 ? -1 : ((int) oneBuf[0]) & BYTE_MASK;
+        return num == -1 ? -1 : oneBuf[0] & BYTE_MASK;
     }
 
     /**

Modified: commons/sandbox/compress/trunk/src/main/java/org/apache/commons/compress/archivers/zip/Simple8BitZipEncoding.java
URL: http://svn.apache.org/viewvc/commons/sandbox/compress/trunk/src/main/java/org/apache/commons/compress/archivers/zip/Simple8BitZipEncoding.java?rev=749856&r1=749855&r2=749856&view=diff
==============================================================================
--- commons/sandbox/compress/trunk/src/main/java/org/apache/commons/compress/archivers/zip/Simple8BitZipEncoding.java
(original)
+++ commons/sandbox/compress/trunk/src/main/java/org/apache/commons/compress/archivers/zip/Simple8BitZipEncoding.java
Wed Mar  4 00:24:42 2009
@@ -65,8 +65,8 @@
         }
 
         public String toString() {
-            return "0x" + Integer.toHexString(0xffff & (int) unicode)
-                + "->0x" + Integer.toHexString(0xff & (int) code);
+            return "0x" + Integer.toHexString(0xffff & unicode)
+                + "->0x" + Integer.toHexString(0xff & code);
         }
     }
 
@@ -114,7 +114,7 @@
         }
 
         // byte is signed, so 128 == -128 and 255 == -1
-        return this.highChars[128 + (int) b];
+        return this.highChars[128 + b];
     }
 
     /**

Modified: commons/sandbox/compress/trunk/src/main/java/org/apache/commons/compress/compressors/bzip2/BZip2CompressorOutputStream.java
URL: http://svn.apache.org/viewvc/commons/sandbox/compress/trunk/src/main/java/org/apache/commons/compress/compressors/bzip2/BZip2CompressorOutputStream.java?rev=749856&r1=749855&r2=749856&view=diff
==============================================================================
--- commons/sandbox/compress/trunk/src/main/java/org/apache/commons/compress/compressors/bzip2/BZip2CompressorOutputStream.java
(original)
+++ commons/sandbox/compress/trunk/src/main/java/org/apache/commons/compress/compressors/bzip2/BZip2CompressorOutputStream.java
Wed Mar  4 00:24:42 2009
@@ -1041,7 +1041,7 @@
                     if (unLo > unHi) {
                         break;
                     }
-                    n = ((int) block[zptr[unLo] + d + 1]) - med;
+                    n = block[zptr[unLo] + d + 1] - med;
                     if (n == 0) {
                         int temp = 0;
                         temp = zptr[unLo];
@@ -1060,7 +1060,7 @@
                     if (unLo > unHi) {
                         break;
                     }
-                    n = ((int) block[zptr[unHi] + d + 1]) - med;
+                    n = block[zptr[unHi] + d + 1] - med;
                     if (n == 0) {
                         int temp = 0;
                         temp = zptr[unHi];

Modified: commons/sandbox/compress/trunk/src/test/java/org/apache/commons/compress/archivers/zip/ZipArchiveOutputStreamTest.java
URL: http://svn.apache.org/viewvc/commons/sandbox/compress/trunk/src/test/java/org/apache/commons/compress/archivers/zip/ZipArchiveOutputStreamTest.java?rev=749856&r1=749855&r2=749856&view=diff
==============================================================================
--- commons/sandbox/compress/trunk/src/test/java/org/apache/commons/compress/archivers/zip/ZipArchiveOutputStreamTest.java
(original)
+++ commons/sandbox/compress/trunk/src/test/java/org/apache/commons/compress/archivers/zip/ZipArchiveOutputStreamTest.java
Wed Mar  4 00:24:42 2009
@@ -66,7 +66,7 @@
     }
 
     public void testAdjustToLong() {
-        assertEquals((long) Integer.MAX_VALUE,
+        assertEquals(Integer.MAX_VALUE,
                      ZipArchiveOutputStream.adjustToLong(Integer.MAX_VALUE));
         assertEquals(((long) Integer.MAX_VALUE) + 1,
                      ZipArchiveOutputStream.adjustToLong(Integer.MAX_VALUE + 1));



Mime
View raw message