commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bode...@apache.org
Subject [39/46] commons-compress git commit: Add final modifier to local variables.
Date Sun, 10 Apr 2016 04:18:55 GMT
http://git-wip-us.apache.org/repos/asf/commons-compress/blob/3f2c760a/src/test/java/org/apache/commons/compress/archivers/tar/TarArchiveInputStreamTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/compress/archivers/tar/TarArchiveInputStreamTest.java b/src/test/java/org/apache/commons/compress/archivers/tar/TarArchiveInputStreamTest.java
index 1289c21..84f2e1d 100644
--- a/src/test/java/org/apache/commons/compress/archivers/tar/TarArchiveInputStreamTest.java
+++ b/src/test/java/org/apache/commons/compress/archivers/tar/TarArchiveInputStreamTest.java
@@ -49,7 +49,7 @@ public class TarArchiveInputStreamTest {
     public void readSimplePaxHeader() throws Exception {
         final InputStream is = new ByteArrayInputStream(new byte[1]);
         final TarArchiveInputStream tais = new TarArchiveInputStream(is);
-        Map<String, String> headers = tais
+        final Map<String, String> headers = tais
             .parsePaxHeaders(new ByteArrayInputStream("30 atime=1321711775.972059463\n"
                                                       .getBytes(CharsetNames.UTF_8)));
         assertEquals(1, headers.size());
@@ -61,7 +61,7 @@ public class TarArchiveInputStreamTest {
     public void secondEntryWinsWhenPaxHeaderContainsDuplicateKey() throws Exception {
         final InputStream is = new ByteArrayInputStream(new byte[1]);
         final TarArchiveInputStream tais = new TarArchiveInputStream(is);
-        Map<String, String> headers = tais
+        final Map<String, String> headers = tais
             .parsePaxHeaders(new ByteArrayInputStream("11 foo=bar\n11 foo=baz\n"
                                                       .getBytes(CharsetNames.UTF_8)));
         assertEquals(1, headers.size());
@@ -73,7 +73,7 @@ public class TarArchiveInputStreamTest {
     public void paxHeaderEntryWithEmptyValueRemovesKey() throws Exception {
         final InputStream is = new ByteArrayInputStream(new byte[1]);
         final TarArchiveInputStream tais = new TarArchiveInputStream(is);
-        Map<String, String> headers = tais
+        final Map<String, String> headers = tais
             .parsePaxHeaders(new ByteArrayInputStream("11 foo=bar\n7 foo=\n"
                                                       .getBytes(CharsetNames.UTF_8)));
         assertEquals(0, headers.size());
@@ -84,7 +84,7 @@ public class TarArchiveInputStreamTest {
     public void readPaxHeaderWithEmbeddedNewline() throws Exception {
         final InputStream is = new ByteArrayInputStream(new byte[1]);
         final TarArchiveInputStream tais = new TarArchiveInputStream(is);
-        Map<String, String> headers = tais
+        final Map<String, String> headers = tais
             .parsePaxHeaders(new ByteArrayInputStream("28 comment=line1\nline2\nand3\n"
                                                       .getBytes(CharsetNames.UTF_8)));
         assertEquals(1, headers.size());
@@ -94,12 +94,12 @@ public class TarArchiveInputStreamTest {
 
     @Test
     public void readNonAsciiPaxHeader() throws Exception {
-        String ae = "\u00e4";
-        String line = "11 path="+ ae + "\n";
+        final String ae = "\u00e4";
+        final String line = "11 path="+ ae + "\n";
         assertEquals(11, line.getBytes(CharsetNames.UTF_8).length);
         final InputStream is = new ByteArrayInputStream(new byte[1]);
         final TarArchiveInputStream tais = new TarArchiveInputStream(is);
-        Map<String, String> headers = tais
+        final Map<String, String> headers = tais
             .parsePaxHeaders(new ByteArrayInputStream(line.getBytes(CharsetNames.UTF_8)));
         assertEquals(1, headers.size());
         assertEquals(ae, headers.get("path"));
@@ -139,9 +139,9 @@ public class TarArchiveInputStreamTest {
         TarArchiveInputStream in = null;
         try {
             in = new TarArchiveInputStream(new FileInputStream(getFile(archive)));
-            TarArchiveEntry tae = in.getNextTarEntry();
+            final TarArchiveEntry tae = in.getNextTarEntry();
             assertEquals("foo", tae.getName());
-            Calendar cal = Calendar.getInstance(TimeZone.getTimeZone("GMT"));
+            final Calendar cal = Calendar.getInstance(TimeZone.getTimeZone("GMT"));
             cal.set(1969, 11, 31, 23, 59, 59);
             cal.set(Calendar.MILLISECOND, 0);
             assertEquals(cal.getTime(), tae.getLastModifiedDate());
@@ -155,13 +155,13 @@ public class TarArchiveInputStreamTest {
 
     @Test
     public void testCompress197() throws Exception {
-        TarArchiveInputStream tar = getTestStream("/COMPRESS-197.tar");
+        final TarArchiveInputStream tar = getTestStream("/COMPRESS-197.tar");
         try {
             TarArchiveEntry entry = tar.getNextTarEntry();
             while (entry != null) {
                 entry = tar.getNextTarEntry();
             }
-        } catch (IOException e) {
+        } catch (final IOException e) {
             fail("COMPRESS-197: " + e.getMessage());
         } finally {
             tar.close();
@@ -171,12 +171,12 @@ public class TarArchiveInputStreamTest {
     @Test
     public void shouldUseSpecifiedEncodingWhenReadingGNULongNames()
         throws Exception {
-        ByteArrayOutputStream bos = new ByteArrayOutputStream();
-        String encoding = CharsetNames.UTF_16;
-        String name = "1234567890123456789012345678901234567890123456789"
+        final ByteArrayOutputStream bos = new ByteArrayOutputStream();
+        final String encoding = CharsetNames.UTF_16;
+        final String name = "1234567890123456789012345678901234567890123456789"
             + "01234567890123456789012345678901234567890123456789"
             + "01234567890\u00e4";
-        TarArchiveOutputStream tos =
+        final TarArchiveOutputStream tos =
             new TarArchiveOutputStream(bos, encoding);
         tos.setLongFileMode(TarArchiveOutputStream.LONGFILE_GNU);
         TarArchiveEntry t = new TarArchiveEntry(name);
@@ -185,9 +185,9 @@ public class TarArchiveInputStreamTest {
         tos.write(30);
         tos.closeArchiveEntry();
         tos.close();
-        byte[] data = bos.toByteArray();
-        ByteArrayInputStream bis = new ByteArrayInputStream(data);
-        TarArchiveInputStream tis =
+        final byte[] data = bos.toByteArray();
+        final ByteArrayInputStream bis = new ByteArrayInputStream(data);
+        final TarArchiveInputStream tis =
             new TarArchiveInputStream(bis, encoding);
         t = tis.getNextTarEntry();
         assertEquals(name, t.getName());
@@ -196,16 +196,16 @@ public class TarArchiveInputStreamTest {
 
     @Test
     public void shouldConsumeArchiveCompletely() throws Exception {
-        InputStream is = TarArchiveInputStreamTest.class
+        final InputStream is = TarArchiveInputStreamTest.class
             .getResourceAsStream("/archive_with_trailer.tar");
-        TarArchiveInputStream tar = new TarArchiveInputStream(is);
+        final TarArchiveInputStream tar = new TarArchiveInputStream(is);
         while (tar.getNextTarEntry() != null) {
             // just consume the archive
         }
-        byte[] expected = new byte[] {
+        final byte[] expected = new byte[] {
             'H', 'e', 'l', 'l', 'o', ',', ' ', 'w', 'o', 'r', 'l', 'd', '!', '\n'
         };
-        byte[] actual = new byte[expected.length];
+        final byte[] actual = new byte[expected.length];
         is.read(actual);
         assertArrayEquals(expected, actual);
         tar.close();
@@ -213,11 +213,11 @@ public class TarArchiveInputStreamTest {
 
     @Test
     public void readsArchiveCompletely_COMPRESS245() throws Exception {
-        InputStream is = TarArchiveInputStreamTest.class
+        final InputStream is = TarArchiveInputStreamTest.class
             .getResourceAsStream("/COMPRESS-245.tar.gz");
         try {
-            InputStream gin = new GZIPInputStream(is);
-            TarArchiveInputStream tar = new TarArchiveInputStream(gin);
+            final InputStream gin = new GZIPInputStream(is);
+            final TarArchiveInputStream tar = new TarArchiveInputStream(gin);
             int count = 0;
             TarArchiveEntry entry = tar.getNextTarEntry();
             while (entry != null) {
@@ -226,7 +226,7 @@ public class TarArchiveInputStreamTest {
             }
             assertEquals(31, count);
             tar.close();
-        } catch (IOException e) {
+        } catch (final IOException e) {
             fail("COMPRESS-245: " + e.getMessage());
         } finally {
             is.close();
@@ -235,8 +235,8 @@ public class TarArchiveInputStreamTest {
 
     @Test(expected = IOException.class)
     public void shouldThrowAnExceptionOnTruncatedEntries() throws Exception {
-        File dir = mkdir("COMPRESS-279");
-        TarArchiveInputStream is = getTestStream("/COMPRESS-279.tar");
+        final File dir = mkdir("COMPRESS-279");
+        final TarArchiveInputStream is = getTestStream("/COMPRESS-279.tar");
         FileOutputStream out = null;
         try {
             TarArchiveEntry entry = is.getNextTarEntry();
@@ -260,8 +260,8 @@ public class TarArchiveInputStreamTest {
 
     @Test
     public void shouldReadBigGid() throws Exception {
-        ByteArrayOutputStream bos = new ByteArrayOutputStream();
-        TarArchiveOutputStream tos = new TarArchiveOutputStream(bos);
+        final ByteArrayOutputStream bos = new ByteArrayOutputStream();
+        final TarArchiveOutputStream tos = new TarArchiveOutputStream(bos);
         tos.setBigNumberMode(TarArchiveOutputStream.BIGNUMBER_POSIX);
         TarArchiveEntry t = new TarArchiveEntry("name");
         t.setGroupId(4294967294l);
@@ -270,9 +270,9 @@ public class TarArchiveInputStreamTest {
         tos.write(30);
         tos.closeArchiveEntry();
         tos.close();
-        byte[] data = bos.toByteArray();
-        ByteArrayInputStream bis = new ByteArrayInputStream(data);
-        TarArchiveInputStream tis =
+        final byte[] data = bos.toByteArray();
+        final ByteArrayInputStream bis = new ByteArrayInputStream(data);
+        final TarArchiveInputStream tis =
             new TarArchiveInputStream(bis);
         t = tis.getNextTarEntry();
         assertEquals(4294967294l, t.getLongGroupId());
@@ -284,9 +284,9 @@ public class TarArchiveInputStreamTest {
      */
     @Test
     public void shouldReadGNULongNameEntryWithWrongName() throws Exception {
-        TarArchiveInputStream is = getTestStream("/COMPRESS-324.tar");
+        final TarArchiveInputStream is = getTestStream("/COMPRESS-324.tar");
         try {
-            TarArchiveEntry entry = is.getNextTarEntry();
+            final TarArchiveEntry entry = is.getNextTarEntry();
             assertEquals("1234567890123456789012345678901234567890123456789012345678901234567890"
                          + "1234567890123456789012345678901234567890123456789012345678901234567890"
                          + "1234567890123456789012345678901234567890123456789012345678901234567890"

http://git-wip-us.apache.org/repos/asf/commons-compress/blob/3f2c760a/src/test/java/org/apache/commons/compress/archivers/tar/TarArchiveOutputStreamTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/compress/archivers/tar/TarArchiveOutputStreamTest.java b/src/test/java/org/apache/commons/compress/archivers/tar/TarArchiveOutputStreamTest.java
index 3996bf4..3465835 100644
--- a/src/test/java/org/apache/commons/compress/archivers/tar/TarArchiveOutputStreamTest.java
+++ b/src/test/java/org/apache/commons/compress/archivers/tar/TarArchiveOutputStreamTest.java
@@ -46,19 +46,19 @@ public class TarArchiveOutputStreamTest extends AbstractTestCase {
 
     @Test
     public void testCount() throws Exception {
-        File f = File.createTempFile("commons-compress-tarcount", ".tar");
+        final File f = File.createTempFile("commons-compress-tarcount", ".tar");
         f.deleteOnExit();
-        FileOutputStream fos = new FileOutputStream(f);
+        final FileOutputStream fos = new FileOutputStream(f);
 
-        ArchiveOutputStream tarOut = new ArchiveStreamFactory()
+        final ArchiveOutputStream tarOut = new ArchiveStreamFactory()
             .createArchiveOutputStream(ArchiveStreamFactory.TAR, fos);
 
-        File file1 = getFile("test1.xml");
-        TarArchiveEntry sEntry = new TarArchiveEntry(file1, file1.getName());
+        final File file1 = getFile("test1.xml");
+        final TarArchiveEntry sEntry = new TarArchiveEntry(file1, file1.getName());
         tarOut.putArchiveEntry(sEntry);
 
-        FileInputStream in = new FileInputStream(file1);
-        byte[] buf = new byte[8192];
+        final FileInputStream in = new FileInputStream(file1);
+        final byte[] buf = new byte[8192];
 
         int read = 0;
         while ((read = in.read(buf)) > 0) {
@@ -74,7 +74,7 @@ public class TarArchiveOutputStreamTest extends AbstractTestCase {
 
     @Test
     public void testMaxFileSizeError() throws Exception {
-        TarArchiveEntry t = new TarArchiveEntry("foo");
+        final TarArchiveEntry t = new TarArchiveEntry("foo");
         t.setSize(077777777777L);
         TarArchiveOutputStream tos =
             new TarArchiveOutputStream(new ByteArrayOutputStream());
@@ -84,29 +84,29 @@ public class TarArchiveOutputStreamTest extends AbstractTestCase {
         try {
             tos.putArchiveEntry(t);
             fail("Should have generated RuntimeException");
-        } catch (RuntimeException expected) {
+        } catch (final RuntimeException expected) {
         }
     }
 
     @Test
     public void testBigNumberStarMode() throws Exception {
-        TarArchiveEntry t = new TarArchiveEntry("foo");
+        final TarArchiveEntry t = new TarArchiveEntry("foo");
         t.setSize(0100000000000L);
-        ByteArrayOutputStream bos = new ByteArrayOutputStream();
-        TarArchiveOutputStream tos = new TarArchiveOutputStream(bos);
+        final ByteArrayOutputStream bos = new ByteArrayOutputStream();
+        final TarArchiveOutputStream tos = new TarArchiveOutputStream(bos);
         tos.setBigNumberMode(TarArchiveOutputStream.BIGNUMBER_STAR);
         tos.putArchiveEntry(t);
         // make sure header is written to byte array
         tos.write(new byte[10 * 1024]);
-        byte[] data = bos.toByteArray();
+        final byte[] data = bos.toByteArray();
         assertEquals(0x80,
                      data[TarConstants.NAMELEN
                         + TarConstants.MODELEN
                         + TarConstants.UIDLEN
                         + TarConstants.GIDLEN] & 0x80);
-        TarArchiveInputStream tin =
+        final TarArchiveInputStream tin =
             new TarArchiveInputStream(new ByteArrayInputStream(data));
-        TarArchiveEntry e = tin.getNextTarEntry();
+        final TarArchiveEntry e = tin.getNextTarEntry();
         assertEquals(0100000000000L, e.getSize());
         tin.close();
         // generates IOE because of unclosed entries.
@@ -116,15 +116,15 @@ public class TarArchiveOutputStreamTest extends AbstractTestCase {
 
     @Test
     public void testBigNumberPosixMode() throws Exception {
-        TarArchiveEntry t = new TarArchiveEntry("foo");
+        final TarArchiveEntry t = new TarArchiveEntry("foo");
         t.setSize(0100000000000L);
-        ByteArrayOutputStream bos = new ByteArrayOutputStream();
-        TarArchiveOutputStream tos = new TarArchiveOutputStream(bos);
+        final ByteArrayOutputStream bos = new ByteArrayOutputStream();
+        final TarArchiveOutputStream tos = new TarArchiveOutputStream(bos);
         tos.setBigNumberMode(TarArchiveOutputStream.BIGNUMBER_POSIX);
         tos.putArchiveEntry(t);
         // make sure header is written to byte array
         tos.write(new byte[10 * 1024]);
-        byte[] data = bos.toByteArray();
+        final byte[] data = bos.toByteArray();
         assertEquals("00000000000 ",
                      new String(data,
                                 1024 + TarConstants.NAMELEN
@@ -132,9 +132,9 @@ public class TarArchiveOutputStreamTest extends AbstractTestCase {
                                 + TarConstants.UIDLEN
                                 + TarConstants.GIDLEN, 12,
                                 CharsetNames.UTF_8));
-        TarArchiveInputStream tin =
+        final TarArchiveInputStream tin =
             new TarArchiveInputStream(new ByteArrayInputStream(data));
-        TarArchiveEntry e = tin.getNextTarEntry();
+        final TarArchiveEntry e = tin.getNextTarEntry();
         assertEquals(0100000000000L, e.getSize());
         tin.close();
         // generates IOE because of unclosed entries.
@@ -144,9 +144,9 @@ public class TarArchiveOutputStreamTest extends AbstractTestCase {
 
     @Test
     public void testWriteSimplePaxHeaders() throws Exception {
-        Map<String, String> m = new HashMap<String, String>();
+        final Map<String, String> m = new HashMap<String, String>();
         m.put("a", "b");
-        byte[] data = writePaxHeader(m);
+        final byte[] data = writePaxHeader(m);
         assertEquals("00000000006 ",
                      new String(data, TarConstants.NAMELEN
                                 + TarConstants.MODELEN
@@ -158,12 +158,12 @@ public class TarArchiveOutputStreamTest extends AbstractTestCase {
 
     @Test
     public void testPaxHeadersWithLength99() throws Exception {
-        Map<String, String> m = new HashMap<String, String>();
+        final Map<String, String> m = new HashMap<String, String>();
         m.put("a",
               "0123456789012345678901234567890123456789"
               + "01234567890123456789012345678901234567890123456789"
               + "012");
-        byte[] data = writePaxHeader(m);
+        final byte[] data = writePaxHeader(m);
         assertEquals("00000000143 ",
                      new String(data, TarConstants.NAMELEN
                                 + TarConstants.MODELEN
@@ -177,12 +177,12 @@ public class TarArchiveOutputStreamTest extends AbstractTestCase {
 
     @Test
     public void testPaxHeadersWithLength101() throws Exception {
-        Map<String, String> m = new HashMap<String, String>();
+        final Map<String, String> m = new HashMap<String, String>();
         m.put("a",
               "0123456789012345678901234567890123456789"
               + "01234567890123456789012345678901234567890123456789"
               + "0123");
-        byte[] data = writePaxHeader(m);
+        final byte[] data = writePaxHeader(m);
         assertEquals("00000000145 ",
                      new String(data, TarConstants.NAMELEN
                                 + TarConstants.MODELEN
@@ -195,12 +195,12 @@ public class TarArchiveOutputStreamTest extends AbstractTestCase {
     }
 
     private byte[] writePaxHeader(final Map<String, String> m) throws Exception {
-        ByteArrayOutputStream bos = new ByteArrayOutputStream();
-        TarArchiveOutputStream tos = new TarArchiveOutputStream(bos, "ASCII");
+        final ByteArrayOutputStream bos = new ByteArrayOutputStream();
+        final TarArchiveOutputStream tos = new TarArchiveOutputStream(bos, "ASCII");
         tos.writePaxHeaders(new TarArchiveEntry("x"), "foo", m);
 
         // add a dummy entry so data gets written
-        TarArchiveEntry t = new TarArchiveEntry("foo");
+        final TarArchiveEntry t = new TarArchiveEntry("foo");
         t.setSize(10 * 1024);
         tos.putArchiveEntry(t);
         tos.write(new byte[10 * 1024]);
@@ -212,24 +212,24 @@ public class TarArchiveOutputStreamTest extends AbstractTestCase {
 
     @Test
     public void testWriteLongFileNamePosixMode() throws Exception {
-        String n = "01234567890123456789012345678901234567890123456789"
+        final String n = "01234567890123456789012345678901234567890123456789"
             + "01234567890123456789012345678901234567890123456789"
             + "01234567890123456789012345678901234567890123456789";
-        TarArchiveEntry t =
+        final TarArchiveEntry t =
             new TarArchiveEntry(n);
         t.setSize(10 * 1024);
-        ByteArrayOutputStream bos = new ByteArrayOutputStream();
-        TarArchiveOutputStream tos = new TarArchiveOutputStream(bos, "ASCII");
+        final ByteArrayOutputStream bos = new ByteArrayOutputStream();
+        final TarArchiveOutputStream tos = new TarArchiveOutputStream(bos, "ASCII");
         tos.setLongFileMode(TarArchiveOutputStream.LONGFILE_POSIX);
         tos.putArchiveEntry(t);
         tos.write(new byte[10 * 1024]);
         tos.closeArchiveEntry();
-        byte[] data = bos.toByteArray();
+        final byte[] data = bos.toByteArray();
         assertEquals("160 path=" + n + "\n",
                      new String(data, 512, 160, CharsetNames.UTF_8));
-        TarArchiveInputStream tin =
+        final TarArchiveInputStream tin =
             new TarArchiveInputStream(new ByteArrayInputStream(data));
-        TarArchiveEntry e = tin.getNextTarEntry();
+        final TarArchiveEntry e = tin.getNextTarEntry();
         assertEquals(n, e.getName());
         tin.close();
         tos.close();
@@ -237,26 +237,26 @@ public class TarArchiveOutputStreamTest extends AbstractTestCase {
 
     @Test
     public void testOldEntryStarMode() throws Exception {
-        TarArchiveEntry t = new TarArchiveEntry("foo");
+        final TarArchiveEntry t = new TarArchiveEntry("foo");
         t.setSize(Integer.MAX_VALUE);
         t.setModTime(-1000);
-        ByteArrayOutputStream bos = new ByteArrayOutputStream();
-        TarArchiveOutputStream tos = new TarArchiveOutputStream(bos);
+        final ByteArrayOutputStream bos = new ByteArrayOutputStream();
+        final TarArchiveOutputStream tos = new TarArchiveOutputStream(bos);
         tos.setBigNumberMode(TarArchiveOutputStream.BIGNUMBER_STAR);
         tos.putArchiveEntry(t);
         // make sure header is written to byte array
         tos.write(new byte[10 * 1024]);
-        byte[] data = bos.toByteArray();
+        final byte[] data = bos.toByteArray();
         assertEquals((byte) 0xff,
                      data[TarConstants.NAMELEN
                           + TarConstants.MODELEN
                           + TarConstants.UIDLEN
                           + TarConstants.GIDLEN
                           + TarConstants.SIZELEN]);
-        TarArchiveInputStream tin =
+        final TarArchiveInputStream tin =
             new TarArchiveInputStream(new ByteArrayInputStream(data));
-        TarArchiveEntry e = tin.getNextTarEntry();
-        Calendar cal = Calendar.getInstance(TimeZone.getTimeZone("GMT"));
+        final TarArchiveEntry e = tin.getNextTarEntry();
+        final Calendar cal = Calendar.getInstance(TimeZone.getTimeZone("GMT"));
         cal.set(1969, 11, 31, 23, 59, 59);
         cal.set(Calendar.MILLISECOND, 0);
         assertEquals(cal.getTime(), e.getLastModifiedDate());
@@ -268,16 +268,16 @@ public class TarArchiveOutputStreamTest extends AbstractTestCase {
 
     @Test
     public void testOldEntryPosixMode() throws Exception {
-        TarArchiveEntry t = new TarArchiveEntry("foo");
+        final TarArchiveEntry t = new TarArchiveEntry("foo");
         t.setSize(Integer.MAX_VALUE);
         t.setModTime(-1000);
-        ByteArrayOutputStream bos = new ByteArrayOutputStream();
-        TarArchiveOutputStream tos = new TarArchiveOutputStream(bos);
+        final ByteArrayOutputStream bos = new ByteArrayOutputStream();
+        final TarArchiveOutputStream tos = new TarArchiveOutputStream(bos);
         tos.setBigNumberMode(TarArchiveOutputStream.BIGNUMBER_POSIX);
         tos.putArchiveEntry(t);
         // make sure header is written to byte array
         tos.write(new byte[10 * 1024]);
-        byte[] data = bos.toByteArray();
+        final byte[] data = bos.toByteArray();
         assertEquals("00000000000 ",
                      new String(data,
                                 1024 + TarConstants.NAMELEN
@@ -286,10 +286,10 @@ public class TarArchiveOutputStreamTest extends AbstractTestCase {
                                 + TarConstants.GIDLEN
                                 + TarConstants.SIZELEN, 12,
                                 CharsetNames.UTF_8));
-        TarArchiveInputStream tin =
+        final TarArchiveInputStream tin =
             new TarArchiveInputStream(new ByteArrayInputStream(data));
-        TarArchiveEntry e = tin.getNextTarEntry();
-        Calendar cal = Calendar.getInstance(TimeZone.getTimeZone("GMT"));
+        final TarArchiveEntry e = tin.getNextTarEntry();
+        final Calendar cal = Calendar.getInstance(TimeZone.getTimeZone("GMT"));
         cal.set(1969, 11, 31, 23, 59, 59);
         cal.set(Calendar.MILLISECOND, 0);
         assertEquals(cal.getTime(), e.getLastModifiedDate());
@@ -301,60 +301,60 @@ public class TarArchiveOutputStreamTest extends AbstractTestCase {
 
     @Test
     public void testOldEntryError() throws Exception {
-        TarArchiveEntry t = new TarArchiveEntry("foo");
+        final TarArchiveEntry t = new TarArchiveEntry("foo");
         t.setSize(Integer.MAX_VALUE);
         t.setModTime(-1000);
-        TarArchiveOutputStream tos =
+        final TarArchiveOutputStream tos =
             new TarArchiveOutputStream(new ByteArrayOutputStream());
         try {
             tos.putArchiveEntry(t);
             fail("Should have generated RuntimeException");
-        } catch (RuntimeException expected) {
+        } catch (final RuntimeException expected) {
         }
         tos.close();
     }
 
     @Test
     public void testWriteNonAsciiPathNamePaxHeader() throws Exception {
-        String n = "\u00e4";
-        TarArchiveEntry t = new TarArchiveEntry(n);
+        final String n = "\u00e4";
+        final TarArchiveEntry t = new TarArchiveEntry(n);
         t.setSize(10 * 1024);
-        ByteArrayOutputStream bos = new ByteArrayOutputStream();
-        TarArchiveOutputStream tos = new TarArchiveOutputStream(bos);
+        final ByteArrayOutputStream bos = new ByteArrayOutputStream();
+        final TarArchiveOutputStream tos = new TarArchiveOutputStream(bos);
         tos.setAddPaxHeadersForNonAsciiNames(true);
         tos.putArchiveEntry(t);
         tos.write(new byte[10 * 1024]);
         tos.closeArchiveEntry();
         tos.close();
-        byte[] data = bos.toByteArray();
+        final byte[] data = bos.toByteArray();
         assertEquals("11 path=" + n + "\n",
                      new String(data, 512, 11, CharsetNames.UTF_8));
-        TarArchiveInputStream tin =
+        final TarArchiveInputStream tin =
             new TarArchiveInputStream(new ByteArrayInputStream(data));
-        TarArchiveEntry e = tin.getNextTarEntry();
+        final TarArchiveEntry e = tin.getNextTarEntry();
         assertEquals(n, e.getName());
         tin.close();
     }
 
     @Test
     public void testWriteNonAsciiLinkPathNamePaxHeader() throws Exception {
-        String n = "\u00e4";
-        TarArchiveEntry t = new TarArchiveEntry("a", TarConstants.LF_LINK);
+        final String n = "\u00e4";
+        final TarArchiveEntry t = new TarArchiveEntry("a", TarConstants.LF_LINK);
         t.setSize(10 * 1024);
         t.setLinkName(n);
-        ByteArrayOutputStream bos = new ByteArrayOutputStream();
-        TarArchiveOutputStream tos = new TarArchiveOutputStream(bos);
+        final ByteArrayOutputStream bos = new ByteArrayOutputStream();
+        final TarArchiveOutputStream tos = new TarArchiveOutputStream(bos);
         tos.setAddPaxHeadersForNonAsciiNames(true);
         tos.putArchiveEntry(t);
         tos.write(new byte[10 * 1024]);
         tos.closeArchiveEntry();
         tos.close();
-        byte[] data = bos.toByteArray();
+        final byte[] data = bos.toByteArray();
         assertEquals("15 linkpath=" + n + "\n",
                      new String(data, 512, 15, CharsetNames.UTF_8));
-        TarArchiveInputStream tin =
+        final TarArchiveInputStream tin =
             new TarArchiveInputStream(new ByteArrayInputStream(data));
-        TarArchiveEntry e = tin.getNextTarEntry();
+        final TarArchiveEntry e = tin.getNextTarEntry();
         assertEquals(n, e.getLinkName());
         tin.close();
     }
@@ -376,63 +376,63 @@ public class TarArchiveOutputStreamTest extends AbstractTestCase {
     }
 
     private void testRoundtripWith67CharFileName(final int mode) throws Exception {
-        String n = "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"
+        final String n = "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"
             + "AAAAAAA";
         assertEquals(67, n.length());
-        TarArchiveEntry t = new TarArchiveEntry(n);
+        final TarArchiveEntry t = new TarArchiveEntry(n);
         t.setSize(10 * 1024);
-        ByteArrayOutputStream bos = new ByteArrayOutputStream();
-        TarArchiveOutputStream tos = new TarArchiveOutputStream(bos, "ASCII");
+        final ByteArrayOutputStream bos = new ByteArrayOutputStream();
+        final TarArchiveOutputStream tos = new TarArchiveOutputStream(bos, "ASCII");
         tos.setLongFileMode(mode);
         tos.putArchiveEntry(t);
         tos.write(new byte[10 * 1024]);
         tos.closeArchiveEntry();
         tos.close();
-        byte[] data = bos.toByteArray();
-        TarArchiveInputStream tin =
+        final byte[] data = bos.toByteArray();
+        final TarArchiveInputStream tin =
             new TarArchiveInputStream(new ByteArrayInputStream(data));
-        TarArchiveEntry e = tin.getNextTarEntry();
+        final TarArchiveEntry e = tin.getNextTarEntry();
         assertEquals(n, e.getName());
         tin.close();
     }
 
     @Test
     public void testWriteLongDirectoryNameErrorMode() throws Exception {
-        String n = "01234567890123456789012345678901234567890123456789"
+        final String n = "01234567890123456789012345678901234567890123456789"
                 + "01234567890123456789012345678901234567890123456789"
                 + "01234567890123456789012345678901234567890123456789/";
 
         try {
-            TarArchiveEntry t = new TarArchiveEntry(n);
-            ByteArrayOutputStream bos = new ByteArrayOutputStream();
-            TarArchiveOutputStream tos = new TarArchiveOutputStream(bos, "ASCII");
+            final TarArchiveEntry t = new TarArchiveEntry(n);
+            final ByteArrayOutputStream bos = new ByteArrayOutputStream();
+            final TarArchiveOutputStream tos = new TarArchiveOutputStream(bos, "ASCII");
             tos.setLongFileMode(TarArchiveOutputStream.LONGFILE_ERROR);
             tos.putArchiveEntry(t);
             tos.closeArchiveEntry();
             tos.close();
 
             fail("Truncated name didn't throw an exception");
-        } catch (RuntimeException e) {
+        } catch (final RuntimeException e) {
             // expected
         }
     }
 
     @Test
     public void testWriteLongDirectoryNameTruncateMode() throws Exception {
-        String n = "01234567890123456789012345678901234567890123456789"
+        final String n = "01234567890123456789012345678901234567890123456789"
             + "01234567890123456789012345678901234567890123456789"
             + "01234567890123456789012345678901234567890123456789/";
-        TarArchiveEntry t = new TarArchiveEntry(n);
-        ByteArrayOutputStream bos = new ByteArrayOutputStream();
-        TarArchiveOutputStream tos = new TarArchiveOutputStream(bos, "ASCII");
+        final TarArchiveEntry t = new TarArchiveEntry(n);
+        final ByteArrayOutputStream bos = new ByteArrayOutputStream();
+        final TarArchiveOutputStream tos = new TarArchiveOutputStream(bos, "ASCII");
         tos.setLongFileMode(TarArchiveOutputStream.LONGFILE_TRUNCATE);
         tos.putArchiveEntry(t);
         tos.closeArchiveEntry();
         tos.close();
-        byte[] data = bos.toByteArray();
-        TarArchiveInputStream tin =
+        final byte[] data = bos.toByteArray();
+        final TarArchiveInputStream tin =
             new TarArchiveInputStream(new ByteArrayInputStream(data));
-        TarArchiveEntry e = tin.getNextTarEntry();
+        final TarArchiveEntry e = tin.getNextTarEntry();
         assertEquals("Entry name", n.substring(0, TarConstants.NAMELEN) + "/", e.getName());
         assertTrue("The entry is not a directory", e.isDirectory());
         tin.close();
@@ -455,20 +455,20 @@ public class TarArchiveOutputStreamTest extends AbstractTestCase {
     }
 
     private void testWriteLongDirectoryName(final int mode) throws Exception {
-        String n = "01234567890123456789012345678901234567890123456789"
+        final String n = "01234567890123456789012345678901234567890123456789"
             + "01234567890123456789012345678901234567890123456789"
             + "01234567890123456789012345678901234567890123456789/";
-        TarArchiveEntry t = new TarArchiveEntry(n);
-        ByteArrayOutputStream bos = new ByteArrayOutputStream();
-        TarArchiveOutputStream tos = new TarArchiveOutputStream(bos, "ASCII");
+        final TarArchiveEntry t = new TarArchiveEntry(n);
+        final ByteArrayOutputStream bos = new ByteArrayOutputStream();
+        final TarArchiveOutputStream tos = new TarArchiveOutputStream(bos, "ASCII");
         tos.setLongFileMode(mode);
         tos.putArchiveEntry(t);
         tos.closeArchiveEntry();
         tos.close();
-        byte[] data = bos.toByteArray();
-        TarArchiveInputStream tin =
+        final byte[] data = bos.toByteArray();
+        final TarArchiveInputStream tin =
             new TarArchiveInputStream(new ByteArrayInputStream(data));
-        TarArchiveEntry e = tin.getNextTarEntry();
+        final TarArchiveEntry e = tin.getNextTarEntry();
         assertEquals(n, e.getName());
         assertTrue(e.isDirectory());
         tin.close();
@@ -479,18 +479,18 @@ public class TarArchiveOutputStreamTest extends AbstractTestCase {
      */
     @Test
     public void testWriteNonAsciiDirectoryNamePosixMode() throws Exception {
-        String n = "f\u00f6\u00f6/";
-        TarArchiveEntry t = new TarArchiveEntry(n);
-        ByteArrayOutputStream bos = new ByteArrayOutputStream();
-        TarArchiveOutputStream tos = new TarArchiveOutputStream(bos);
+        final String n = "f\u00f6\u00f6/";
+        final TarArchiveEntry t = new TarArchiveEntry(n);
+        final ByteArrayOutputStream bos = new ByteArrayOutputStream();
+        final TarArchiveOutputStream tos = new TarArchiveOutputStream(bos);
         tos.setAddPaxHeadersForNonAsciiNames(true);
         tos.putArchiveEntry(t);
         tos.closeArchiveEntry();
         tos.close();
-        byte[] data = bos.toByteArray();
-        TarArchiveInputStream tin =
+        final byte[] data = bos.toByteArray();
+        final TarArchiveInputStream tin =
             new TarArchiveInputStream(new ByteArrayInputStream(data));
-        TarArchiveEntry e = tin.getNextTarEntry();
+        final TarArchiveEntry e = tin.getNextTarEntry();
         assertEquals(n, e.getName());
         assertTrue(e.isDirectory());
         tin.close();
@@ -501,18 +501,18 @@ public class TarArchiveOutputStreamTest extends AbstractTestCase {
      */
     @Test
     public void testWriteNonAsciiNameWithUnfortunateNamePosixMode() throws Exception {
-        String n = "f\u00f6\u00f6\u00dc";
-        TarArchiveEntry t = new TarArchiveEntry(n);
-        ByteArrayOutputStream bos = new ByteArrayOutputStream();
-        TarArchiveOutputStream tos = new TarArchiveOutputStream(bos);
+        final String n = "f\u00f6\u00f6\u00dc";
+        final TarArchiveEntry t = new TarArchiveEntry(n);
+        final ByteArrayOutputStream bos = new ByteArrayOutputStream();
+        final TarArchiveOutputStream tos = new TarArchiveOutputStream(bos);
         tos.setAddPaxHeadersForNonAsciiNames(true);
         tos.putArchiveEntry(t);
         tos.closeArchiveEntry();
         tos.close();
-        byte[] data = bos.toByteArray();
-        TarArchiveInputStream tin =
+        final byte[] data = bos.toByteArray();
+        final TarArchiveInputStream tin =
             new TarArchiveInputStream(new ByteArrayInputStream(data));
-        TarArchiveEntry e = tin.getNextTarEntry();
+        final TarArchiveEntry e = tin.getNextTarEntry();
         assertEquals(n, e.getName());
         assertFalse(e.isDirectory());
         tin.close();
@@ -523,44 +523,44 @@ public class TarArchiveOutputStreamTest extends AbstractTestCase {
      */
     @Test
     public void testWriteLongLinkNameErrorMode() throws Exception {
-        String linkname = "01234567890123456789012345678901234567890123456789"
+        final String linkname = "01234567890123456789012345678901234567890123456789"
                 + "01234567890123456789012345678901234567890123456789"
                 + "01234567890123456789012345678901234567890123456789/test";
-        TarArchiveEntry entry = new TarArchiveEntry("test", TarConstants.LF_SYMLINK);
+        final TarArchiveEntry entry = new TarArchiveEntry("test", TarConstants.LF_SYMLINK);
         entry.setLinkName(linkname);
 
         try {
-            ByteArrayOutputStream bos = new ByteArrayOutputStream();
-            TarArchiveOutputStream tos = new TarArchiveOutputStream(bos, "ASCII");
+            final ByteArrayOutputStream bos = new ByteArrayOutputStream();
+            final TarArchiveOutputStream tos = new TarArchiveOutputStream(bos, "ASCII");
             tos.setLongFileMode(TarArchiveOutputStream.LONGFILE_ERROR);
             tos.putArchiveEntry(entry);
             tos.closeArchiveEntry();
             tos.close();
 
             fail("Truncated link name didn't throw an exception");
-        } catch (RuntimeException e) {
+        } catch (final RuntimeException e) {
             // expected
         }
     }
 
     @Test
     public void testWriteLongLinkNameTruncateMode() throws Exception {
-        String linkname = "01234567890123456789012345678901234567890123456789"
+        final String linkname = "01234567890123456789012345678901234567890123456789"
             + "01234567890123456789012345678901234567890123456789"
             + "01234567890123456789012345678901234567890123456789/";
-        TarArchiveEntry entry = new TarArchiveEntry("test" , TarConstants.LF_SYMLINK);
+        final TarArchiveEntry entry = new TarArchiveEntry("test" , TarConstants.LF_SYMLINK);
         entry.setLinkName(linkname);
 
-        ByteArrayOutputStream bos = new ByteArrayOutputStream();
-        TarArchiveOutputStream tos = new TarArchiveOutputStream(bos, "ASCII");
+        final ByteArrayOutputStream bos = new ByteArrayOutputStream();
+        final TarArchiveOutputStream tos = new TarArchiveOutputStream(bos, "ASCII");
         tos.setLongFileMode(TarArchiveOutputStream.LONGFILE_TRUNCATE);
         tos.putArchiveEntry(entry);
         tos.closeArchiveEntry();
         tos.close();
 
-        byte[] data = bos.toByteArray();
-        TarArchiveInputStream tin = new TarArchiveInputStream(new ByteArrayInputStream(data));
-        TarArchiveEntry e = tin.getNextTarEntry();
+        final byte[] data = bos.toByteArray();
+        final TarArchiveInputStream tin = new TarArchiveInputStream(new ByteArrayInputStream(data));
+        final TarArchiveEntry e = tin.getNextTarEntry();
         assertEquals("Link name", linkname.substring(0, TarConstants.NAMELEN), e.getLinkName());
         tin.close();
     }
@@ -585,22 +585,22 @@ public class TarArchiveOutputStreamTest extends AbstractTestCase {
      * @see "https://issues.apache.org/jira/browse/COMPRESS-237"
      */
     private void testWriteLongLinkName(final int mode) throws Exception {
-        String linkname = "01234567890123456789012345678901234567890123456789"
+        final String linkname = "01234567890123456789012345678901234567890123456789"
             + "01234567890123456789012345678901234567890123456789"
             + "01234567890123456789012345678901234567890123456789/test";
-        TarArchiveEntry entry = new TarArchiveEntry("test", TarConstants.LF_SYMLINK);
+        final TarArchiveEntry entry = new TarArchiveEntry("test", TarConstants.LF_SYMLINK);
         entry.setLinkName(linkname);
 
-        ByteArrayOutputStream bos = new ByteArrayOutputStream();
-        TarArchiveOutputStream tos = new TarArchiveOutputStream(bos, "ASCII");
+        final ByteArrayOutputStream bos = new ByteArrayOutputStream();
+        final TarArchiveOutputStream tos = new TarArchiveOutputStream(bos, "ASCII");
         tos.setLongFileMode(mode);
         tos.putArchiveEntry(entry);
         tos.closeArchiveEntry();
         tos.close();
 
-        byte[] data = bos.toByteArray();
-        TarArchiveInputStream tin = new TarArchiveInputStream(new ByteArrayInputStream(data));
-        TarArchiveEntry e = tin.getNextTarEntry();
+        final byte[] data = bos.toByteArray();
+        final TarArchiveInputStream tin = new TarArchiveInputStream(new ByteArrayInputStream(data));
+        final TarArchiveEntry e = tin.getNextTarEntry();
         assertEquals("Entry name", "test", e.getName());
         assertEquals("Link name", linkname, e.getLinkName());
         assertTrue("The entry is not a symbolic link", e.isSymbolicLink());
@@ -609,14 +609,14 @@ public class TarArchiveOutputStreamTest extends AbstractTestCase {
 
     @Test
     public void testPadsOutputToFullBlockLength() throws Exception {
-        File f = File.createTempFile("commons-compress-padding", ".tar");
+        final File f = File.createTempFile("commons-compress-padding", ".tar");
         f.deleteOnExit();
-        FileOutputStream fos = new FileOutputStream(f);
-        TarArchiveOutputStream tos = new TarArchiveOutputStream(fos);
-        File file1 = getFile("test1.xml");
-        TarArchiveEntry sEntry = new TarArchiveEntry(file1, file1.getName());
+        final FileOutputStream fos = new FileOutputStream(f);
+        final TarArchiveOutputStream tos = new TarArchiveOutputStream(fos);
+        final File file1 = getFile("test1.xml");
+        final TarArchiveEntry sEntry = new TarArchiveEntry(file1, file1.getName());
         tos.putArchiveEntry(sEntry);
-        FileInputStream in = new FileInputStream(file1);
+        final FileInputStream in = new FileInputStream(file1);
         IOUtils.copy(in, tos);
         in.close();
         tos.closeArchiveEntry();
@@ -636,27 +636,27 @@ public class TarArchiveOutputStreamTest extends AbstractTestCase {
     @Test
     public void testLongNameMd5Hash() throws Exception {
         final String longFileName = "a/considerably/longer/file/name/which/forces/use/of/the/long/link/header/which/appears/to/always/use/the/current/time/as/modification/date";
-        String fname = longFileName;
+        final String fname = longFileName;
         final Date modificationDate = new Date();
 
-        byte[] archive1 = createTarArchiveContainingOneDirectory(fname, modificationDate);
-        byte[] digest1 = MessageDigest.getInstance("MD5").digest(archive1);
+        final byte[] archive1 = createTarArchiveContainingOneDirectory(fname, modificationDate);
+        final byte[] digest1 = MessageDigest.getInstance("MD5").digest(archive1);
 
         // let a second elapse otherwise the modification dates will be equal
         Thread.sleep(1000L);
 
         // now recreate exactly the same tar file
-        byte[] archive2 = createTarArchiveContainingOneDirectory(fname, modificationDate);
+        final byte[] archive2 = createTarArchiveContainingOneDirectory(fname, modificationDate);
         // and I would expect the MD5 hash to be the same, but for long names it isn't
-        byte[] digest2 = MessageDigest.getInstance("MD5").digest(archive2);
+        final byte[] digest2 = MessageDigest.getInstance("MD5").digest(archive2);
 
         Assert.assertArrayEquals(digest1, digest2);
 
         // do I still have the correct modification date?
         // let a second elapse so we don't get the current time
         Thread.sleep(1000);
-        TarArchiveInputStream tarIn = new TarArchiveInputStream(new ByteArrayInputStream(archive2));
-        ArchiveEntry nextEntry = tarIn.getNextEntry();
+        final TarArchiveInputStream tarIn = new TarArchiveInputStream(new ByteArrayInputStream(archive2));
+        final ArchiveEntry nextEntry = tarIn.getNextEntry();
         assertEquals(longFileName, nextEntry.getName());
         // tar archive stores modification time to second granularity only (floored)
         assertEquals(modificationDate.getTime() / 1000, nextEntry.getLastModifiedDate().getTime() / 1000);
@@ -664,10 +664,10 @@ public class TarArchiveOutputStreamTest extends AbstractTestCase {
     }
 
     private static byte[] createTarArchiveContainingOneDirectory(final String fname, final Date modificationDate) throws IOException {
-        ByteArrayOutputStream baos = new ByteArrayOutputStream();
-        TarArchiveOutputStream tarOut = new TarArchiveOutputStream(baos, 1024);
+        final ByteArrayOutputStream baos = new ByteArrayOutputStream();
+        final TarArchiveOutputStream tarOut = new TarArchiveOutputStream(baos, 1024);
         tarOut.setLongFileMode(TarArchiveOutputStream.LONGFILE_GNU);
-        TarArchiveEntry tarEntry = new TarArchiveEntry("d");
+        final TarArchiveEntry tarEntry = new TarArchiveEntry("d");
         tarEntry.setModTime(modificationDate);
         tarEntry.setMode(TarArchiveEntry.DEFAULT_DIR_MODE);
         tarEntry.setModTime(modificationDate.getTime());

http://git-wip-us.apache.org/repos/asf/commons-compress/blob/3f2c760a/src/test/java/org/apache/commons/compress/archivers/tar/TarLister.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/compress/archivers/tar/TarLister.java b/src/test/java/org/apache/commons/compress/archivers/tar/TarLister.java
index 590e5c3..71c9641 100644
--- a/src/test/java/org/apache/commons/compress/archivers/tar/TarLister.java
+++ b/src/test/java/org/apache/commons/compress/archivers/tar/TarLister.java
@@ -39,11 +39,11 @@ public final class TarLister {
             return;
         }
         System.out.println("Analysing " + args[0]);
-        File f = new File(args[0]);
+        final File f = new File(args[0]);
         if (!f.isFile()) {
             System.err.println(f + " doesn't exist or is a directory");
         }
-        InputStream fis = new BufferedInputStream(new FileInputStream(f));
+        final InputStream fis = new BufferedInputStream(new FileInputStream(f));
         TarArchiveInputStream ais;
         if (args.length > 1) {
             ais = new TarArchiveInputStream(fis, args[1]);
@@ -64,7 +64,7 @@ public final class TarLister {
     }
 
     private static void log(final TarArchiveEntry ae) {
-        StringBuilder sb = new StringBuilder(Integer.toOctalString(ae.getMode()))
+        final StringBuilder sb = new StringBuilder(Integer.toOctalString(ae.getMode()))
             .append(" ");
         String name = ae.getUserName();
         if (name != null && name.length() > 0) {

http://git-wip-us.apache.org/repos/asf/commons-compress/blob/3f2c760a/src/test/java/org/apache/commons/compress/archivers/tar/TarUtilsTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/compress/archivers/tar/TarUtilsTest.java b/src/test/java/org/apache/commons/compress/archivers/tar/TarUtilsTest.java
index e0649ac..a4ef25b 100644
--- a/src/test/java/org/apache/commons/compress/archivers/tar/TarUtilsTest.java
+++ b/src/test/java/org/apache/commons/compress/archivers/tar/TarUtilsTest.java
@@ -34,7 +34,7 @@ public class TarUtilsTest {
     @Test
     public void testName(){
         byte [] buff = new byte[20];
-        String sb1 = "abcdefghijklmnopqrstuvwxyz";
+        final String sb1 = "abcdefghijklmnopqrstuvwxyz";
         int off = TarUtils.formatNameBytes(sb1, buff, 1, buff.length-1);
         assertEquals(off, 20);
         String sb2 = TarUtils.parseName(buff, 1, 10);
@@ -82,36 +82,36 @@ public class TarUtilsTest {
         try {
             TarUtils.parseOctal(buffer,0, buffer.length);
             fail("Expected IllegalArgumentException - should be at least 2 bytes long");
-        } catch (IllegalArgumentException expected) {
+        } catch (final IllegalArgumentException expected) {
         }
         buffer=new byte[]{0}; // 1-byte array
         try {
             TarUtils.parseOctal(buffer,0, buffer.length);
             fail("Expected IllegalArgumentException - should be at least 2 bytes long");
-        } catch (IllegalArgumentException expected) {
+        } catch (final IllegalArgumentException expected) {
         }
         buffer = "abcdef ".getBytes(CharsetNames.UTF_8); // Invalid input
         try {
             TarUtils.parseOctal(buffer,0, buffer.length);
             fail("Expected IllegalArgumentException");
-        } catch (IllegalArgumentException expected) {
+        } catch (final IllegalArgumentException expected) {
         }
         buffer = " 0 07 ".getBytes(CharsetNames.UTF_8); // Invalid - embedded space
         try {
             TarUtils.parseOctal(buffer,0, buffer.length);
             fail("Expected IllegalArgumentException - embedded space");
-        } catch (IllegalArgumentException expected) {
+        } catch (final IllegalArgumentException expected) {
         }
         buffer = " 0\00007 ".getBytes(CharsetNames.UTF_8); // Invalid - embedded NUL
         try {
             TarUtils.parseOctal(buffer,0, buffer.length);
             fail("Expected IllegalArgumentException - embedded NUL");
-        } catch (IllegalArgumentException expected) {
+        } catch (final IllegalArgumentException expected) {
         }
     }
 
     private void checkRoundTripOctal(final long value, final int bufsize) {
-        byte [] buffer = new byte[bufsize];
+        final byte [] buffer = new byte[bufsize];
         long parseValue;
         TarUtils.formatLongOctalBytes(value, buffer, 0, buffer.length);
         parseValue = TarUtils.parseOctal(buffer,0, buffer.length);
@@ -136,7 +136,7 @@ public class TarUtilsTest {
     }
 
     private void checkRoundTripOctalOrBinary(final long value, final int bufsize) {
-        byte [] buffer = new byte[bufsize];
+        final byte [] buffer = new byte[bufsize];
         long parseValue;
         TarUtils.formatLongOctalOrBinaryBytes(value, buffer, 0, buffer.length);
         parseValue = TarUtils.parseOctalOrBinary(buffer,0, buffer.length);
@@ -166,7 +166,7 @@ public class TarUtilsTest {
     // Check correct trailing bytes are generated
     @Test
     public void testTrailers() {
-        byte [] buffer = new byte[12];
+        final byte [] buffer = new byte[12];
         TarUtils.formatLongOctalBytes(123, buffer, 0, buffer.length);
         assertEquals(' ', buffer[buffer.length-1]);
         assertEquals('3', buffer[buffer.length-2]); // end of number
@@ -182,20 +182,20 @@ public class TarUtilsTest {
 
     @Test
     public void testNegative() throws Exception {
-        byte [] buffer = new byte[22];
+        final byte [] buffer = new byte[22];
         TarUtils.formatUnsignedOctalString(-1, buffer, 0, buffer.length);
         assertEquals("1777777777777777777777", new String(buffer, CharsetNames.UTF_8));
     }
 
     @Test
     public void testOverflow() throws Exception {
-        byte [] buffer = new byte[8-1]; // a lot of the numbers have 8-byte buffers (nul term)
+        final byte [] buffer = new byte[8-1]; // a lot of the numbers have 8-byte buffers (nul term)
         TarUtils.formatUnsignedOctalString(07777777L, buffer, 0, buffer.length);
         assertEquals("7777777", new String(buffer, CharsetNames.UTF_8));
         try {
             TarUtils.formatUnsignedOctalString(017777777L, buffer, 0, buffer.length);
             fail("Should have cause IllegalArgumentException");
-        } catch (IllegalArgumentException expected) {
+        } catch (final IllegalArgumentException expected) {
         }
     }
 
@@ -210,22 +210,22 @@ public class TarUtilsTest {
     @Test
     public void testRoundEncoding() throws Exception {
         // COMPRESS-114
-        ZipEncoding enc = ZipEncodingHelper.getZipEncoding(CharsetNames.ISO_8859_1);
-        String s = "0302-0601-3\u00b1\u00b1\u00b1F06\u00b1W220\u00b1ZB\u00b1LALALA\u00b1\u00b1\u00b1\u00b1\u00b1\u00b1\u00b1\u00b1\u00b1\u00b1CAN\u00b1\u00b1DC\u00b1\u00b1\u00b104\u00b1060302\u00b1MOE.model";
-        byte buff[] = new byte[100];
-        int len = TarUtils.formatNameBytes(s, buff, 0, buff.length, enc);
+        final ZipEncoding enc = ZipEncodingHelper.getZipEncoding(CharsetNames.ISO_8859_1);
+        final String s = "0302-0601-3\u00b1\u00b1\u00b1F06\u00b1W220\u00b1ZB\u00b1LALALA\u00b1\u00b1\u00b1\u00b1\u00b1\u00b1\u00b1\u00b1\u00b1\u00b1CAN\u00b1\u00b1DC\u00b1\u00b1\u00b104\u00b1060302\u00b1MOE.model";
+        final byte buff[] = new byte[100];
+        final int len = TarUtils.formatNameBytes(s, buff, 0, buff.length, enc);
         assertEquals(s, TarUtils.parseName(buff, 0, len, enc));
     }
 
     private void checkName(final String string) {
-        byte buff[] = new byte[100];
-        int len = TarUtils.formatNameBytes(string, buff, 0, buff.length);
+        final byte buff[] = new byte[100];
+        final int len = TarUtils.formatNameBytes(string, buff, 0, buff.length);
         assertEquals(string, TarUtils.parseName(buff, 0, len));
     }
 
     @Test
     public void testReadNegativeBinary8Byte() {
-        byte[] b = new byte[] {
+        final byte[] b = new byte[] {
             (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff,
             (byte) 0xff, (byte) 0xff, (byte) 0xf1, (byte) 0xef,
         };
@@ -234,7 +234,7 @@ public class TarUtilsTest {
 
     @Test
     public void testReadNegativeBinary12Byte() {
-        byte[] b = new byte[] {
+        final byte[] b = new byte[] {
             (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff,
             (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff,
             (byte) 0xff, (byte) 0xff, (byte) 0xf1, (byte) 0xef,
@@ -245,7 +245,7 @@ public class TarUtilsTest {
 
     @Test
     public void testWriteNegativeBinary8Byte() {
-        byte[] b = new byte[] {
+        final byte[] b = new byte[] {
             (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff,
             (byte) 0xff, (byte) 0xff, (byte) 0xf1, (byte) 0xef,
         };
@@ -255,7 +255,7 @@ public class TarUtilsTest {
     // https://issues.apache.org/jira/browse/COMPRESS-191
     @Test
     public void testVerifyHeaderCheckSum() {
-        byte[] valid = { // from bla.tar
+        final byte[] valid = { // from bla.tar
                 116, 101, 115, 116, 49, 46, 120, 109, 108, 0, 0, 0, 0, 0, 0,
                 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
                 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
@@ -285,7 +285,7 @@ public class TarUtilsTest {
                 0, 0, 0, 0 };
         assertTrue(TarUtils.verifyCheckSum(valid));
 
-        byte[] compress117 = { // from COMPRESS-117
+        final byte[] compress117 = { // from COMPRESS-117
             (byte) 0x37, (byte) 0x7a, (byte) 0x43, (byte) 0x2e, (byte) 0x74, (byte) 0x78, (byte) 0x74, (byte) 0x00,
             0, 0, 0, 0, 0, 0, 0, 0,
             0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
@@ -326,7 +326,7 @@ public class TarUtilsTest {
         };
         assertTrue(TarUtils.verifyCheckSum(compress117));
 
-        byte[] invalid = { // from the testAIFF.aif file in Tika
+        final byte[] invalid = { // from the testAIFF.aif file in Tika
                 70, 79, 82, 77, 0, 0, 15, 46, 65, 73, 70, 70, 67, 79, 77, 77,
                 0, 0, 0, 18, 0, 2, 0, 0, 3, -64, 0, 16, 64, 14, -84, 68, 0, 0,
                 0, 0, 0, 0, 83, 83, 78, 68, 0, 0, 15, 8, 0, 0, 0, 0, 0, 0, 0,
@@ -360,8 +360,8 @@ public class TarUtilsTest {
 
     @Test
     public void testParseOctalCompress330() throws Exception{
-        long expected = 0100000;
-        byte [] buffer = new byte[] {
+        final long expected = 0100000;
+        final byte [] buffer = new byte[] {
             32, 32, 32, 32, 32, 49, 48, 48, 48, 48, 48, 32
         };
         assertEquals(expected, TarUtils.parseOctalOrBinary(buffer, 0, buffer.length));

http://git-wip-us.apache.org/repos/asf/commons-compress/blob/3f2c760a/src/test/java/org/apache/commons/compress/archivers/zip/AsiExtraFieldTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/compress/archivers/zip/AsiExtraFieldTest.java b/src/test/java/org/apache/commons/compress/archivers/zip/AsiExtraFieldTest.java
index d4c14ec..bd17cea 100644
--- a/src/test/java/org/apache/commons/compress/archivers/zip/AsiExtraFieldTest.java
+++ b/src/test/java/org/apache/commons/compress/archivers/zip/AsiExtraFieldTest.java
@@ -33,7 +33,7 @@ public class AsiExtraFieldTest implements UnixStat {
      */    
     @Test
     public void testModes() {
-        AsiExtraField a = new AsiExtraField();
+        final AsiExtraField a = new AsiExtraField();
         a.setMode(0123);
         assertEquals("plain file", 0100123, a.getMode());
         a.setDirectory(true);
@@ -47,7 +47,7 @@ public class AsiExtraFieldTest implements UnixStat {
      */
     @Test
     public void testContent() {
-        AsiExtraField a = new AsiExtraField();
+        final AsiExtraField a = new AsiExtraField();
         a.setMode(0123);
         a.setUserId(5);
         a.setGroupId(6);
@@ -135,7 +135,7 @@ public class AsiExtraFieldTest implements UnixStat {
         try {
             a.parseFromLocalFileData(data, 0, data.length);
             fail("should raise bad CRC exception");
-        } catch (Exception e) {
+        } catch (final Exception e) {
             assertEquals("bad CRC checksum 0 instead of ebf018e",
                          e.getMessage());
         }
@@ -143,13 +143,13 @@ public class AsiExtraFieldTest implements UnixStat {
 
     @Test
     public void testClone() {
-        AsiExtraField s1 = new AsiExtraField();
+        final AsiExtraField s1 = new AsiExtraField();
         s1.setUserId(42);
         s1.setGroupId(12);
         s1.setLinkedFile("foo");
         s1.setMode(0644);
         s1.setDirectory(true);
-        AsiExtraField s2 = (AsiExtraField) s1.clone();
+        final AsiExtraField s2 = (AsiExtraField) s1.clone();
         assertNotSame(s1, s2);
         assertEquals(s1.getUserId(), s2.getUserId());
         assertEquals(s1.getGroupId(), s2.getGroupId());

http://git-wip-us.apache.org/repos/asf/commons-compress/blob/3f2c760a/src/test/java/org/apache/commons/compress/archivers/zip/BinaryTreeTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/compress/archivers/zip/BinaryTreeTest.java b/src/test/java/org/apache/commons/compress/archivers/zip/BinaryTreeTest.java
index de0e488..930df01 100644
--- a/src/test/java/org/apache/commons/compress/archivers/zip/BinaryTreeTest.java
+++ b/src/test/java/org/apache/commons/compress/archivers/zip/BinaryTreeTest.java
@@ -31,13 +31,13 @@ public class BinaryTreeTest {
 
     @Test
     public void testDecode() throws IOException {
-        InputStream in = new ByteArrayInputStream(new byte[] { 0x02, 0x42, 0x01, 0x13 });
+        final InputStream in = new ByteArrayInputStream(new byte[] { 0x02, 0x42, 0x01, 0x13 });
         
-        BinaryTree tree = BinaryTree.decode(in, 8);
+        final BinaryTree tree = BinaryTree.decode(in, 8);
         
         assertNotNull(tree);
         
-        BitStream stream = new BitStream(new ByteArrayInputStream(new byte[] { (byte) 0x8D, (byte) 0xC5, (byte) 0x11, 0x00 }));
+        final BitStream stream = new BitStream(new ByteArrayInputStream(new byte[] { (byte) 0x8D, (byte) 0xC5, (byte) 0x11, 0x00 }));
         assertEquals(0, tree.read(stream));
         assertEquals(1, tree.read(stream));
         assertEquals(2, tree.read(stream));

http://git-wip-us.apache.org/repos/asf/commons-compress/blob/3f2c760a/src/test/java/org/apache/commons/compress/archivers/zip/BitStreamTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/compress/archivers/zip/BitStreamTest.java b/src/test/java/org/apache/commons/compress/archivers/zip/BitStreamTest.java
index 5bc182c..a0525fa 100644
--- a/src/test/java/org/apache/commons/compress/archivers/zip/BitStreamTest.java
+++ b/src/test/java/org/apache/commons/compress/archivers/zip/BitStreamTest.java
@@ -29,7 +29,7 @@ public class BitStreamTest {
 
     @Test
     public void testEmptyStream() throws Exception {
-        BitStream stream = new BitStream(new ByteArrayInputStream(new byte[0]));
+        final BitStream stream = new BitStream(new ByteArrayInputStream(new byte[0]));
         assertEquals("next bit", -1, stream.nextBit());
         assertEquals("next bit", -1, stream.nextBit());
         assertEquals("next bit", -1, stream.nextBit());
@@ -38,7 +38,7 @@ public class BitStreamTest {
 
     @Test
     public void testStream() throws Exception {
-        BitStream stream = new BitStream(new ByteArrayInputStream(new byte[] { (byte) 0xEA, 0x03 }));
+        final BitStream stream = new BitStream(new ByteArrayInputStream(new byte[] { (byte) 0xEA, 0x03 }));
 
         assertEquals("bit 0", 0, stream.nextBit());
         assertEquals("bit 1", 1, stream.nextBit());
@@ -64,7 +64,7 @@ public class BitStreamTest {
 
     @Test
     public void testNextByteFromEmptyStream() throws Exception {
-        BitStream stream = new BitStream(new ByteArrayInputStream(new byte[0]));
+        final BitStream stream = new BitStream(new ByteArrayInputStream(new byte[0]));
         assertEquals("next byte", -1, stream.nextByte());
         assertEquals("next byte", -1, stream.nextByte());
         stream.close();
@@ -72,7 +72,7 @@ public class BitStreamTest {
 
     @Test
     public void testReadAlignedBytes() throws Exception {
-        BitStream stream = new BitStream(new ByteArrayInputStream(new byte[] { (byte) 0xEA, 0x35 }));
+        final BitStream stream = new BitStream(new ByteArrayInputStream(new byte[] { (byte) 0xEA, 0x35 }));
         assertEquals("next byte", 0xEA, stream.nextByte());
         assertEquals("next byte", 0x35, stream.nextByte());
         assertEquals("next byte", -1, stream.nextByte());
@@ -81,7 +81,7 @@ public class BitStreamTest {
 
     @Test
     public void testNextByte() throws Exception {
-        BitStream stream = new BitStream(new ByteArrayInputStream(new byte[] { (byte) 0xEA, 0x35 }));
+        final BitStream stream = new BitStream(new ByteArrayInputStream(new byte[] { (byte) 0xEA, 0x35 }));
         assertEquals("bit 0", 0, stream.nextBit());
         assertEquals("bit 1", 1, stream.nextBit());
         assertEquals("bit 2", 0, stream.nextBit());

http://git-wip-us.apache.org/repos/asf/commons-compress/blob/3f2c760a/src/test/java/org/apache/commons/compress/archivers/zip/CircularBufferTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/compress/archivers/zip/CircularBufferTest.java b/src/test/java/org/apache/commons/compress/archivers/zip/CircularBufferTest.java
index cf5e1c8..442d5e6 100644
--- a/src/test/java/org/apache/commons/compress/archivers/zip/CircularBufferTest.java
+++ b/src/test/java/org/apache/commons/compress/archivers/zip/CircularBufferTest.java
@@ -27,8 +27,8 @@ public class CircularBufferTest {
 
     @Test
     public void testPutAndGet() throws Exception {
-        int size = 16;
-        CircularBuffer buffer = new CircularBuffer(size);
+        final int size = 16;
+        final CircularBuffer buffer = new CircularBuffer(size);
         for (int i = 0; i < size / 2; i++) {
             buffer.put(i);
         }
@@ -45,7 +45,7 @@ public class CircularBufferTest {
 
     @Test
     public void testCopy() throws Exception {
-        CircularBuffer buffer = new CircularBuffer(16);
+        final CircularBuffer buffer = new CircularBuffer(16);
         
         buffer.put(1);
         buffer.put(2);

http://git-wip-us.apache.org/repos/asf/commons-compress/blob/3f2c760a/src/test/java/org/apache/commons/compress/archivers/zip/EncryptedArchiveTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/compress/archivers/zip/EncryptedArchiveTest.java b/src/test/java/org/apache/commons/compress/archivers/zip/EncryptedArchiveTest.java
index cd88db0..8c04c52 100644
--- a/src/test/java/org/apache/commons/compress/archivers/zip/EncryptedArchiveTest.java
+++ b/src/test/java/org/apache/commons/compress/archivers/zip/EncryptedArchiveTest.java
@@ -32,18 +32,18 @@ public class EncryptedArchiveTest {
     @Test
     public void testReadPasswordEncryptedEntryViaZipFile()
         throws IOException {
-        File file = getFile("password-encrypted.zip");
+        final File file = getFile("password-encrypted.zip");
         ZipFile zf = null;
         try {
             zf = new ZipFile(file);
-            ZipArchiveEntry zae = zf.getEntry("LICENSE.txt");
+            final ZipArchiveEntry zae = zf.getEntry("LICENSE.txt");
             assertTrue(zae.getGeneralPurposeBit().usesEncryption());
             assertFalse(zae.getGeneralPurposeBit().usesStrongEncryption());
             assertFalse(zf.canReadEntryData(zae));
             try {
                 zf.getInputStream(zae);
                 fail("expected an exception");
-            } catch (UnsupportedZipFeatureException ex) {
+            } catch (final UnsupportedZipFeatureException ex) {
                 assertSame(UnsupportedZipFeatureException.Feature.ENCRYPTION,
                            ex.getFeature());
             }
@@ -55,20 +55,20 @@ public class EncryptedArchiveTest {
     @Test
     public void testReadPasswordEncryptedEntryViaStream()
         throws IOException {
-        File file = getFile("password-encrypted.zip");
+        final File file = getFile("password-encrypted.zip");
         ZipArchiveInputStream zin = null;
         try {
             zin = new ZipArchiveInputStream(new FileInputStream(file));
-            ZipArchiveEntry zae = zin.getNextZipEntry();
+            final ZipArchiveEntry zae = zin.getNextZipEntry();
             assertEquals("LICENSE.txt", zae.getName());
             assertTrue(zae.getGeneralPurposeBit().usesEncryption());
             assertFalse(zae.getGeneralPurposeBit().usesStrongEncryption());
             assertFalse(zin.canReadEntryData(zae));
             try {
-                byte[] buf = new byte[1024];
+                final byte[] buf = new byte[1024];
                 zin.read(buf, 0, buf.length);
                 fail("expected an exception");
-            } catch (UnsupportedZipFeatureException ex) {
+            } catch (final UnsupportedZipFeatureException ex) {
                 assertSame(UnsupportedZipFeatureException.Feature.ENCRYPTION,
                            ex.getFeature());
             }

http://git-wip-us.apache.org/repos/asf/commons-compress/blob/3f2c760a/src/test/java/org/apache/commons/compress/archivers/zip/ExplodeSupportTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/compress/archivers/zip/ExplodeSupportTest.java b/src/test/java/org/apache/commons/compress/archivers/zip/ExplodeSupportTest.java
index 3e21be2..5716fd7 100644
--- a/src/test/java/org/apache/commons/compress/archivers/zip/ExplodeSupportTest.java
+++ b/src/test/java/org/apache/commons/compress/archivers/zip/ExplodeSupportTest.java
@@ -35,14 +35,14 @@ import org.junit.Test;
 public class ExplodeSupportTest {
 
     private void testArchiveWithImplodeCompression(final String filename, final String entryName) throws IOException {
-        ZipFile zip = new ZipFile(new File(filename));
-        ZipArchiveEntry entry = zip.getEntries().nextElement();
+        final ZipFile zip = new ZipFile(new File(filename));
+        final ZipArchiveEntry entry = zip.getEntries().nextElement();
         assertEquals("entry name", entryName, entry.getName());
         assertTrue("entry can't be read", zip.canReadEntryData(entry));
         assertEquals("method", ZipMethod.IMPLODING.getCode(), entry.getMethod());
 
-        ByteArrayOutputStream bout = new ByteArrayOutputStream();
-        CheckedOutputStream out = new CheckedOutputStream(bout, new CRC32());
+        final ByteArrayOutputStream bout = new ByteArrayOutputStream();
+        final CheckedOutputStream out = new CheckedOutputStream(bout, new CRC32());
         IOUtils.copy(zip.getInputStream(entry), out);
 
         out.flush();
@@ -67,16 +67,16 @@ public class ExplodeSupportTest {
     }
 
     private void testZipStreamWithImplodeCompression(final String filename, final String entryName) throws IOException {
-        ZipArchiveInputStream zin = new ZipArchiveInputStream(new FileInputStream(new File(filename)));
-        ZipArchiveEntry entry = zin.getNextZipEntry();
+        final ZipArchiveInputStream zin = new ZipArchiveInputStream(new FileInputStream(new File(filename)));
+        final ZipArchiveEntry entry = zin.getNextZipEntry();
         assertEquals("entry name", entryName, entry.getName());
         assertTrue("entry can't be read", zin.canReadEntryData(entry));
         assertEquals("method", ZipMethod.IMPLODING.getCode(), entry.getMethod());
 
-        InputStream bio = new BoundedInputStream(zin, entry.getSize());
+        final InputStream bio = new BoundedInputStream(zin, entry.getSize());
         
-        ByteArrayOutputStream bout = new ByteArrayOutputStream();
-        CheckedOutputStream out = new CheckedOutputStream(bout, new CRC32());
+        final ByteArrayOutputStream bout = new ByteArrayOutputStream();
+        final CheckedOutputStream out = new CheckedOutputStream(bout, new CRC32());
         IOUtils.copy(bio, out);
 
         out.flush();

http://git-wip-us.apache.org/repos/asf/commons-compress/blob/3f2c760a/src/test/java/org/apache/commons/compress/archivers/zip/ExtraFieldUtilsTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/compress/archivers/zip/ExtraFieldUtilsTest.java b/src/test/java/org/apache/commons/compress/archivers/zip/ExtraFieldUtilsTest.java
index 0573fa4..afa122e 100644
--- a/src/test/java/org/apache/commons/compress/archivers/zip/ExtraFieldUtilsTest.java
+++ b/src/test/java/org/apache/commons/compress/archivers/zip/ExtraFieldUtilsTest.java
@@ -53,7 +53,7 @@ public class ExtraFieldUtilsTest implements UnixStat {
         dummy.setCentralDirectoryData(new byte[] {0});
 
         aLocal = a.getLocalFileDataData();
-        byte[] dummyLocal = dummy.getLocalFileDataData();
+        final byte[] dummyLocal = dummy.getLocalFileDataData();
         data = new byte[4 + aLocal.length + 4 + dummyLocal.length];
         System.arraycopy(a.getHeaderId().getBytes(), 0, data, 0, 2);
         System.arraycopy(a.getLocalFileDataLength().getBytes(), 0, data, 2, 2);
@@ -72,7 +72,7 @@ public class ExtraFieldUtilsTest implements UnixStat {
      */
     @Test
     public void testParse() throws Exception {
-        ZipExtraField[] ze = ExtraFieldUtils.parse(data);
+        final ZipExtraField[] ze = ExtraFieldUtils.parse(data);
         assertEquals("number of fields", 2, ze.length);
         assertTrue("type field 1", ze[0] instanceof AsiExtraField);
         assertEquals("mode field 1", 040755,
@@ -81,12 +81,12 @@ public class ExtraFieldUtilsTest implements UnixStat {
         assertEquals("data length field 2", 1,
                      ze[1].getLocalFileDataLength().getValue());
 
-        byte[] data2 = new byte[data.length-1];
+        final byte[] data2 = new byte[data.length-1];
         System.arraycopy(data, 0, data2, 0, data2.length);
         try {
             ExtraFieldUtils.parse(data2);
             fail("data should be invalid");
-        } catch (Exception e) {
+        } catch (final Exception e) {
             assertEquals("message",
                          "bad extra field starting at "+(4 + aLocal.length)
                          + ".  Block length of 1 bytes exceeds remaining data of 0 bytes.",
@@ -107,7 +107,7 @@ public class ExtraFieldUtilsTest implements UnixStat {
         assertEquals("data length field 2", 1,
                      ze[1].getLocalFileDataLength().getValue());
 
-        byte[] data2 = new byte[data.length-1];
+        final byte[] data2 = new byte[data.length-1];
         System.arraycopy(data, 0, data2, 0, data2.length);
         ze = ExtraFieldUtils.parse(data2, true,
                                    ExtraFieldUtils.UnparseableExtraField.READ);
@@ -138,7 +138,7 @@ public class ExtraFieldUtilsTest implements UnixStat {
         assertEquals("data length field 2", 1,
                      ze[1].getLocalFileDataLength().getValue());
 
-        byte[] data2 = new byte[data.length-1];
+        final byte[] data2 = new byte[data.length-1];
         System.arraycopy(data, 0, data2, 0, data2.length);
         ze = ExtraFieldUtils.parse(data2, true,
                                    ExtraFieldUtils.UnparseableExtraField.SKIP);
@@ -153,15 +153,15 @@ public class ExtraFieldUtilsTest implements UnixStat {
      */
     @Test
     public void testMerge() {
-        byte[] local =
+        final byte[] local =
             ExtraFieldUtils.mergeLocalFileDataData(new ZipExtraField[] {a, dummy});
         assertEquals("local length", data.length, local.length);
         for (int i=0; i<local.length; i++) {
             assertEquals("local byte "+i, data[i], local[i]);
         }
 
-        byte[] dummyCentral = dummy.getCentralDirectoryData();
-        byte[] data2 = new byte[4 + aLocal.length + 4 + dummyCentral.length];
+        final byte[] dummyCentral = dummy.getCentralDirectoryData();
+        final byte[] data2 = new byte[4 + aLocal.length + 4 + dummyCentral.length];
         System.arraycopy(data, 0, data2, 0, 4 + aLocal.length + 2);
         System.arraycopy(dummy.getCentralDirectoryLength().getBytes(), 0,
                          data2, 4+aLocal.length+2, 2);
@@ -169,7 +169,7 @@ public class ExtraFieldUtilsTest implements UnixStat {
                          4+aLocal.length+4, dummyCentral.length);
 
 
-        byte[] central =
+        final byte[] central =
             ExtraFieldUtils.mergeCentralDirectoryData(new ZipExtraField[] {a, dummy});
         assertEquals("central length", data2.length, central.length);
         for (int i=0; i<central.length; i++) {
@@ -180,24 +180,24 @@ public class ExtraFieldUtilsTest implements UnixStat {
 
     @Test
     public void testMergeWithUnparseableData() throws Exception {
-        ZipExtraField d = new UnparseableExtraFieldData();
-        byte[] b = UNRECOGNIZED_HEADER.getBytes();
+        final ZipExtraField d = new UnparseableExtraFieldData();
+        final byte[] b = UNRECOGNIZED_HEADER.getBytes();
         d.parseFromLocalFileData(new byte[] {b[0], b[1], 1, 0}, 0, 4);
-        byte[] local =
+        final byte[] local =
             ExtraFieldUtils.mergeLocalFileDataData(new ZipExtraField[] {a, d});
         assertEquals("local length", data.length - 1, local.length);
         for (int i = 0; i < local.length; i++) {
             assertEquals("local byte " + i, data[i], local[i]);
         }
 
-        byte[] dCentral = d.getCentralDirectoryData();
-        byte[] data2 = new byte[4 + aLocal.length + dCentral.length];
+        final byte[] dCentral = d.getCentralDirectoryData();
+        final byte[] data2 = new byte[4 + aLocal.length + dCentral.length];
         System.arraycopy(data, 0, data2, 0, 4 + aLocal.length + 2);
         System.arraycopy(dCentral, 0, data2,
                          4 + aLocal.length, dCentral.length);
 
 
-        byte[] central =
+        final byte[] central =
             ExtraFieldUtils.mergeCentralDirectoryData(new ZipExtraField[] {a, d});
         assertEquals("central length", data2.length, central.length);
         for (int i = 0; i < central.length; i++) {

http://git-wip-us.apache.org/repos/asf/commons-compress/blob/3f2c760a/src/test/java/org/apache/commons/compress/archivers/zip/GeneralPurposeBitTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/compress/archivers/zip/GeneralPurposeBitTest.java b/src/test/java/org/apache/commons/compress/archivers/zip/GeneralPurposeBitTest.java
index 4d62ff0..4fc119a 100644
--- a/src/test/java/org/apache/commons/compress/archivers/zip/GeneralPurposeBitTest.java
+++ b/src/test/java/org/apache/commons/compress/archivers/zip/GeneralPurposeBitTest.java
@@ -33,7 +33,7 @@ public class GeneralPurposeBitTest {
         assertFalse(new GeneralPurposeBit().usesUTF8ForNames());
         assertFalse(new GeneralPurposeBit().usesEncryption());
         assertFalse(new GeneralPurposeBit().usesStrongEncryption());
-        byte[] b = new byte[2];
+        final byte[] b = new byte[2];
         assertTrue(Arrays.equals(b, new GeneralPurposeBit().encode()));
     }
 
@@ -63,27 +63,27 @@ public class GeneralPurposeBitTest {
 
     @Test
     public void testDataDescriptor() {
-        byte[] flags = new byte[] {(byte) 8, (byte) 0};
+        final byte[] flags = new byte[] {(byte) 8, (byte) 0};
         assertTrue(GeneralPurposeBit.parse(flags, 0).usesDataDescriptor());
-        GeneralPurposeBit b = new GeneralPurposeBit();
+        final GeneralPurposeBit b = new GeneralPurposeBit();
         b.useDataDescriptor(true);
         assertTrue(Arrays.equals(flags, b.encode()));
     }
 
     @Test
     public void testLanguageEncodingFlag() {
-        byte[] flags = new byte[] {(byte) 0, (byte) 8};
+        final byte[] flags = new byte[] {(byte) 0, (byte) 8};
         assertTrue(GeneralPurposeBit.parse(flags, 0).usesUTF8ForNames());
-        GeneralPurposeBit b = new GeneralPurposeBit();
+        final GeneralPurposeBit b = new GeneralPurposeBit();
         b.useUTF8ForNames(true);
         assertTrue(Arrays.equals(flags, b.encode()));
     }
 
     @Test
     public void testEncryption() {
-        byte[] flags = new byte[] {(byte) 1, (byte) 0};
+        final byte[] flags = new byte[] {(byte) 1, (byte) 0};
         assertTrue(GeneralPurposeBit.parse(flags, 0).usesEncryption());
-        GeneralPurposeBit b = new GeneralPurposeBit();
+        final GeneralPurposeBit b = new GeneralPurposeBit();
         b.useEncryption(true);
         assertTrue(Arrays.equals(flags, b.encode()));
     }
@@ -92,7 +92,7 @@ public class GeneralPurposeBitTest {
     public void testStrongEncryption() {
         byte[] flags = new byte[] {(byte) 65, (byte) 0};
         assertTrue(GeneralPurposeBit.parse(flags, 0).usesStrongEncryption());
-        GeneralPurposeBit b = new GeneralPurposeBit();
+        final GeneralPurposeBit b = new GeneralPurposeBit();
         b.useStrongEncryption(true);
         assertTrue(b.usesEncryption());
         assertTrue(Arrays.equals(flags, b.encode()));
@@ -103,7 +103,7 @@ public class GeneralPurposeBitTest {
 
     @Test
     public void testClone() {
-        GeneralPurposeBit b = new GeneralPurposeBit();
+        final GeneralPurposeBit b = new GeneralPurposeBit();
         b.useStrongEncryption(true);
         b.useUTF8ForNames(true);
         assertEquals(b, b.clone());

http://git-wip-us.apache.org/repos/asf/commons-compress/blob/3f2c760a/src/test/java/org/apache/commons/compress/archivers/zip/Lister.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/compress/archivers/zip/Lister.java b/src/test/java/org/apache/commons/compress/archivers/zip/Lister.java
index 3e792af..6638648 100644
--- a/src/test/java/org/apache/commons/compress/archivers/zip/Lister.java
+++ b/src/test/java/org/apache/commons/compress/archivers/zip/Lister.java
@@ -47,23 +47,23 @@ public final class Lister {
     }
 
     public static void main(final String[] args) throws IOException {
-        CommandLine cl = parse(args);
-        File f = new File(cl.archive);
+        final CommandLine cl = parse(args);
+        final File f = new File(cl.archive);
         if (!f.isFile()) {
             System.err.println(f + " doesn't exists or is a directory");
             usage();
         }
         if (cl.useStream) {
-            BufferedInputStream fs =
+            final BufferedInputStream fs =
                 new BufferedInputStream(new FileInputStream(f));
             try {
-                ZipArchiveInputStream zs =
+                final ZipArchiveInputStream zs =
                     new ZipArchiveInputStream(fs, cl.encoding, true,
                                               cl.allowStoredEntriesWithDataDescriptor);
                 for (ArchiveEntry entry = zs.getNextEntry();
                      entry != null;
                      entry = zs.getNextEntry()) {
-                    ZipArchiveEntry ze = (ZipArchiveEntry) entry;
+                    final ZipArchiveEntry ze = (ZipArchiveEntry) entry;
                     list(ze);
                     if (cl.dir != null) {
                         extract(cl.dir, ze, zs);
@@ -73,14 +73,14 @@ public final class Lister {
                 fs.close();
             }
         } else {
-            ZipFile zf = new ZipFile(f, cl.encoding);
+            final ZipFile zf = new ZipFile(f, cl.encoding);
             try {
-                for (Enumeration<ZipArchiveEntry> entries = zf.getEntries();
+                for (final Enumeration<ZipArchiveEntry> entries = zf.getEntries();
                      entries.hasMoreElements(); ) {
-                    ZipArchiveEntry ze = entries.nextElement();
+                    final ZipArchiveEntry ze = entries.nextElement();
                     list(ze);
                     if (cl.dir != null) {
-                        InputStream is = zf.getInputStream(ze);
+                        final InputStream is = zf.getInputStream(ze);
                         try {
                             extract(cl.dir, ze, is);
                         } finally {
@@ -100,7 +100,7 @@ public final class Lister {
 
     private static void extract(final String dir, final ZipArchiveEntry entry,
                                 final InputStream is) throws IOException {
-        File f = new File(dir, entry.getName());
+        final File f = new File(dir, entry.getName());
         if (!f.getParentFile().exists()) {
             f.getParentFile().mkdirs();
         }
@@ -116,7 +116,7 @@ public final class Lister {
     }
 
     private static CommandLine parse(final String[] args) {
-        CommandLine cl = new CommandLine();
+        final CommandLine cl = new CommandLine();
         boolean error = false;
         for (int i = 0; i < args.length; i++) {
             if (args[i].equals("-enc")) {

http://git-wip-us.apache.org/repos/asf/commons-compress/blob/3f2c760a/src/test/java/org/apache/commons/compress/archivers/zip/Maven221MultiVolumeTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/compress/archivers/zip/Maven221MultiVolumeTest.java b/src/test/java/org/apache/commons/compress/archivers/zip/Maven221MultiVolumeTest.java
index 3b3f78b..eec6c8e 100644
--- a/src/test/java/org/apache/commons/compress/archivers/zip/Maven221MultiVolumeTest.java
+++ b/src/test/java/org/apache/commons/compress/archivers/zip/Maven221MultiVolumeTest.java
@@ -68,7 +68,7 @@ public class Maven221MultiVolumeTest {
     @Test
     public void testRead7ZipMultiVolumeArchiveForStream() throws IOException {
 
-        FileInputStream archive =
+        final FileInputStream archive =
             new FileInputStream(getFile("apache-maven-2.2.1.zip.001"));
         ZipArchiveInputStream zi = null;
         try {
@@ -76,14 +76,14 @@ public class Maven221MultiVolumeTest {
 
             // these are the entries that are supposed to be processed
             // correctly without any problems
-            for (String element : ENTRIES) {
+            for (final String element : ENTRIES) {
                 assertEquals(element, zi.getNextEntry().getName());
             }
 
             // this is the last entry that is truncated
-            ArchiveEntry lastEntry = zi.getNextEntry();
+            final ArchiveEntry lastEntry = zi.getNextEntry();
             assertEquals(LAST_ENTRY_NAME, lastEntry.getName());
-            byte [] buffer = new byte [4096];
+            final byte [] buffer = new byte [4096];
 
             // before the fix, we'd get 0 bytes on this read and all
             // subsequent reads thus a client application might enter
@@ -92,7 +92,7 @@ public class Maven221MultiVolumeTest {
             try {
                 while (zi.read(buffer) > 0) { }
                 fail("shouldn't be able to read from truncated entry");
-            } catch (IOException e) {
+            } catch (final IOException e) {
                 assertEquals("Truncated ZIP file", e.getMessage());
             }
 
@@ -102,7 +102,7 @@ public class Maven221MultiVolumeTest {
                 zi.getNextEntry();
                 fail("shouldn't be able to read another entry from truncated"
                      + " file");
-            } catch (IOException e) {
+            } catch (final IOException e) {
                 // this is to be expected
             }
         } finally {
@@ -114,7 +114,7 @@ public class Maven221MultiVolumeTest {
 
     @Test(expected=IOException.class)
     public void testRead7ZipMultiVolumeArchiveForFile() throws IOException {
-        File file = getFile("apache-maven-2.2.1.zip.001");
+        final File file = getFile("apache-maven-2.2.1.zip.001");
         new ZipFile(file);
     }
 }


Mime
View raw message