commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ggreg...@apache.org
Subject commons-compress git commit: Add final modifier to local variables.
Date Sat, 25 Jun 2016 21:35:08 GMT
Repository: commons-compress
Updated Branches:
  refs/heads/master 4865194d5 -> 77388c82c


Add final modifier to local variables.

Project: http://git-wip-us.apache.org/repos/asf/commons-compress/repo
Commit: http://git-wip-us.apache.org/repos/asf/commons-compress/commit/77388c82
Tree: http://git-wip-us.apache.org/repos/asf/commons-compress/tree/77388c82
Diff: http://git-wip-us.apache.org/repos/asf/commons-compress/diff/77388c82

Branch: refs/heads/master
Commit: 77388c82c0f484ebf11b5f3292f0103514fd00f1
Parents: 4865194
Author: Gary Gregory <ggregory@apache.org>
Authored: Sat Jun 25 14:35:06 2016 -0700
Committer: Gary Gregory <ggregory@apache.org>
Committed: Sat Jun 25 14:35:06 2016 -0700

----------------------------------------------------------------------
 .../snappy/FramedSnappyCompressorInputStream.java         |  2 +-
 .../org/apache/commons/compress/utils/ArchiveUtils.java   |  2 +-
 .../org/apache/commons/compress/ArchiveUtilsTest.java     | 10 +++++-----
 .../commons/compress/archivers/sevenz/SevenZFileTest.java |  2 +-
 .../compress/archivers/zip/ZipArchiveInputStreamTest.java |  4 ++--
 .../snappy/FramedSnappyCompressorInputStreamTest.java     |  2 +-
 6 files changed, 11 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/commons-compress/blob/77388c82/src/main/java/org/apache/commons/compress/compressors/snappy/FramedSnappyCompressorInputStream.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/compress/compressors/snappy/FramedSnappyCompressorInputStream.java
b/src/main/java/org/apache/commons/compress/compressors/snappy/FramedSnappyCompressorInputStream.java
index 96ac7f9..9c0f1b9 100644
--- a/src/main/java/org/apache/commons/compress/compressors/snappy/FramedSnappyCompressorInputStream.java
+++ b/src/main/java/org/apache/commons/compress/compressors/snappy/FramedSnappyCompressorInputStream.java
@@ -201,7 +201,7 @@ public class FramedSnappyCompressorInputStream extends CompressorInputStream
{
             uncompressedBytesRemaining = readSize() - 4 /* CRC */;
             expectedChecksum = unmask(readCrc());
         } else if (type == COMPRESSED_CHUNK_TYPE) {
-            boolean expectChecksum = dialect.usesChecksumWithCompressedChunks();
+            final boolean expectChecksum = dialect.usesChecksumWithCompressedChunks();
             final long size = readSize() - (expectChecksum ? 4 : 0);
             if (expectChecksum) {
                 expectedChecksum = unmask(readCrc());

http://git-wip-us.apache.org/repos/asf/commons-compress/blob/77388c82/src/main/java/org/apache/commons/compress/utils/ArchiveUtils.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/compress/utils/ArchiveUtils.java b/src/main/java/org/apache/commons/compress/utils/ArchiveUtils.java
index 1a7f975..38a4cf8 100644
--- a/src/main/java/org/apache/commons/compress/utils/ArchiveUtils.java
+++ b/src/main/java/org/apache/commons/compress/utils/ArchiveUtils.java
@@ -283,7 +283,7 @@ public class ArchiveUtils {
         for (int i = 0; i < len; i++) {
             final char c = chars[i];
             if (!Character.isISOControl(c)) {
-                Character.UnicodeBlock block = Character.UnicodeBlock.of(c);
+                final Character.UnicodeBlock block = Character.UnicodeBlock.of(c);
                 if (block != null && block != Character.UnicodeBlock.SPECIALS) {
                     sb.append(c);
                     continue;

http://git-wip-us.apache.org/repos/asf/commons-compress/blob/77388c82/src/test/java/org/apache/commons/compress/ArchiveUtilsTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/compress/ArchiveUtilsTest.java b/src/test/java/org/apache/commons/compress/ArchiveUtilsTest.java
index 875d800..5dc7925 100644
--- a/src/test/java/org/apache/commons/compress/ArchiveUtilsTest.java
+++ b/src/test/java/org/apache/commons/compress/ArchiveUtilsTest.java
@@ -69,12 +69,12 @@ public class ArchiveUtilsTest extends AbstractTestCase {
 
     @Test
     public void sanitizeShortensString() {
-        String input = "012345678901234567890123456789012345678901234567890123456789"
+        final String input = "012345678901234567890123456789012345678901234567890123456789"
             + "012345678901234567890123456789012345678901234567890123456789"
             + "012345678901234567890123456789012345678901234567890123456789"
             + "012345678901234567890123456789012345678901234567890123456789"
             + "012345678901234567890123456789012345678901234567890123456789";
-        String expected = "012345678901234567890123456789012345678901234567890123456789"
+        final String expected = "012345678901234567890123456789012345678901234567890123456789"
             + "012345678901234567890123456789012345678901234567890123456789"
             + "012345678901234567890123456789012345678901234567890123456789"
             + "012345678901234567890123456789012345678901234567890123456789"
@@ -84,14 +84,14 @@ public class ArchiveUtilsTest extends AbstractTestCase {
 
     @Test
     public void sanitizeLeavesShortStringsAlone() {
-        String input = "012345678901234567890123456789012345678901234567890123456789";
+        final String input = "012345678901234567890123456789012345678901234567890123456789";
         assertEquals(input, ArchiveUtils.sanitize(input));
     }
 
     @Test
     public void sanitizeRemovesUnprintableCharacters() {
-        String input = "\b12345678901234567890123456789012345678901234567890123456789";
-        String expected = "?12345678901234567890123456789012345678901234567890123456789";
+        final String input = "\b12345678901234567890123456789012345678901234567890123456789";
+        final String expected = "?12345678901234567890123456789012345678901234567890123456789";
         assertEquals(expected, ArchiveUtils.sanitize(input));
     }
 

http://git-wip-us.apache.org/repos/asf/commons-compress/blob/77388c82/src/test/java/org/apache/commons/compress/archivers/sevenz/SevenZFileTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/compress/archivers/sevenz/SevenZFileTest.java
b/src/test/java/org/apache/commons/compress/archivers/sevenz/SevenZFileTest.java
index 78e3ffb..0b88725 100644
--- a/src/test/java/org/apache/commons/compress/archivers/sevenz/SevenZFileTest.java
+++ b/src/test/java/org/apache/commons/compress/archivers/sevenz/SevenZFileTest.java
@@ -271,7 +271,7 @@ public class SevenZFileTest extends AbstractTestCase {
             SevenZArchiveEntry entry = sevenZFile.getNextEntry();
             while (entry != null) {
                 entries++;
-                int b = sevenZFile.read();
+                final int b = sevenZFile.read();
                 if ("2.txt".equals(entry.getName()) || "5.txt".equals(entry.getName())) {
                     assertEquals(-1, b);
                 } else {

http://git-wip-us.apache.org/repos/asf/commons-compress/blob/77388c82/src/test/java/org/apache/commons/compress/archivers/zip/ZipArchiveInputStreamTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/compress/archivers/zip/ZipArchiveInputStreamTest.java
b/src/test/java/org/apache/commons/compress/archivers/zip/ZipArchiveInputStreamTest.java
index 33d0efc..587daf0 100644
--- a/src/test/java/org/apache/commons/compress/archivers/zip/ZipArchiveInputStreamTest.java
+++ b/src/test/java/org/apache/commons/compress/archivers/zip/ZipArchiveInputStreamTest.java
@@ -187,8 +187,8 @@ public class ZipArchiveInputStreamTest {
                 ze = in.getNextZipEntry();
             }
             fail("expected EOFException");
-        } catch (EOFException ex) {
-            String m = ex.getMessage();
+        } catch (final EOFException ex) {
+            final String m = ex.getMessage();
             assertTrue(m.startsWith("Truncated ZIP entry: ?2016")); // the first character
is not printable
         } finally {
             in.close();

http://git-wip-us.apache.org/repos/asf/commons-compress/blob/77388c82/src/test/java/org/apache/commons/compress/compressors/snappy/FramedSnappyCompressorInputStreamTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/compress/compressors/snappy/FramedSnappyCompressorInputStreamTest.java
b/src/test/java/org/apache/commons/compress/compressors/snappy/FramedSnappyCompressorInputStreamTest.java
index b12ddeb..a1992a0 100644
--- a/src/test/java/org/apache/commons/compress/compressors/snappy/FramedSnappyCompressorInputStreamTest.java
+++ b/src/test/java/org/apache/commons/compress/compressors/snappy/FramedSnappyCompressorInputStreamTest.java
@@ -175,7 +175,7 @@ public final class FramedSnappyCompressorInputStreamTest
     public void readIWAFile() throws Exception {
         final ZipFile zip = new ZipFile(getFile("testNumbersNew.numbers"));
         try {
-            InputStream is = zip.getInputStream(zip.getEntry("Index/Document.iwa"));
+            final InputStream is = zip.getInputStream(zip.getEntry("Index/Document.iwa"));
             try {
                 final FramedSnappyCompressorInputStream in =
                     new FramedSnappyCompressorInputStream(is, FramedSnappyDialect.IWORK_ARCHIVE);


Mime
View raw message