http://git-wip-us.apache.org/repos/asf/commons-compress/blob/478bef36/src/main/java/org/apache/commons/compress/compressors/gzip/GzipCompressorInputStream.java ---------------------------------------------------------------------- diff --git a/src/main/java/org/apache/commons/compress/compressors/gzip/GzipCompressorInputStream.java b/src/main/java/org/apache/commons/compress/compressors/gzip/GzipCompressorInputStream.java index a7fa24e..99aabf9 100644 --- a/src/main/java/org/apache/commons/compress/compressors/gzip/GzipCompressorInputStream.java +++ b/src/main/java/org/apache/commons/compress/compressors/gzip/GzipCompressorInputStream.java @@ -95,7 +95,7 @@ public class GzipCompressorInputStream extends CompressorInputStream { * * @throws IOException if the stream could not be created */ - public GzipCompressorInputStream(InputStream inputStream) + public GzipCompressorInputStream(final InputStream inputStream) throws IOException { this(inputStream, false); } @@ -120,8 +120,8 @@ public class GzipCompressorInputStream extends CompressorInputStream { * * @throws IOException if the stream could not be created */ - public GzipCompressorInputStream(InputStream inputStream, - boolean decompressConcatenated) + public GzipCompressorInputStream(final InputStream inputStream, + final boolean decompressConcatenated) throws IOException { // Mark support is strictly needed for concatenated files only, // but it's simpler if it is always available. @@ -145,7 +145,7 @@ public class GzipCompressorInputStream extends CompressorInputStream { return parameters; } - private boolean init(boolean isFirstMember) throws IOException { + private boolean init(final boolean isFirstMember) throws IOException { assert isFirstMember || decompressConcatenated; // Check the magic bytes without a possibility of EOFException. @@ -233,7 +233,7 @@ public class GzipCompressorInputStream extends CompressorInputStream { return true; } - private byte[] readToNull(DataInputStream inData) throws IOException { + private byte[] readToNull(final DataInputStream inData) throws IOException { ByteArrayOutputStream bos = new ByteArrayOutputStream(); int b = 0; while ((b = inData.readUnsignedByte()) != 0x00) { // NOPMD @@ -242,7 +242,7 @@ public class GzipCompressorInputStream extends CompressorInputStream { return bos.toByteArray(); } - private long readLittleEndianInt(DataInputStream inData) throws IOException { + private long readLittleEndianInt(final DataInputStream inData) throws IOException { return inData.readUnsignedByte() | (inData.readUnsignedByte() << 8) | (inData.readUnsignedByte() << 16) @@ -260,7 +260,7 @@ public class GzipCompressorInputStream extends CompressorInputStream { * @since 1.1 */ @Override - public int read(byte[] b, int off, int len) throws IOException { + public int read(final byte[] b, int off, int len) throws IOException { if (endReached) { return -1; } @@ -349,7 +349,7 @@ public class GzipCompressorInputStream extends CompressorInputStream { * * @since 1.1 */ - public static boolean matches(byte[] signature, int length) { + public static boolean matches(final byte[] signature, final int length) { if (length < 2) { return false;
http://git-wip-us.apache.org/repos/asf/commons-compress/blob/478bef36/src/main/java/org/apache/commons/compress/compressors/gzip/GzipCompressorOutputStream.java ---------------------------------------------------------------------- diff --git a/src/main/java/org/apache/commons/compress/compressors/gzip/GzipCompressorOutputStream.java b/src/main/java/org/apache/commons/compress/compressors/gzip/GzipCompressorOutputStream.java index aeae8c0..d1afb5d 100644 --- a/src/main/java/org/apache/commons/compress/compressors/gzip/GzipCompressorOutputStream.java +++ b/src/main/java/org/apache/commons/compress/compressors/gzip/GzipCompressorOutputStream.java @@ -66,7 +66,7 @@ public class GzipCompressorOutputStream extends CompressorOutputStream { * @param out the stream to compress to * @throws IOException if writing fails */ - public GzipCompressorOutputStream(OutputStream out) throws IOException { + public GzipCompressorOutputStream(final OutputStream out) throws IOException { this(out, new GzipParameters()); } @@ -78,14 +78,14 @@ public class GzipCompressorOutputStream extends CompressorOutputStream { * * @since 1.7 */ - public GzipCompressorOutputStream(OutputStream out, GzipParameters parameters) throws IOException { + public GzipCompressorOutputStream(final OutputStream out, final GzipParameters parameters) throws IOException { this.out = out; this.deflater = new Deflater(parameters.getCompressionLevel(), true); writeHeader(parameters); } - private void writeHeader(GzipParameters parameters) throws IOException { + private void writeHeader(final GzipParameters parameters) throws IOException { String filename = parameters.getFilename(); String comment = parameters.getComment(); @@ -131,7 +131,7 @@ public class GzipCompressorOutputStream extends CompressorOutputStream { } @Override - public void write(int b) throws IOException { + public void write(final int b) throws IOException { write(new byte[]{(byte) (b & 0xff)}, 0, 1); } @@ -141,7 +141,7 @@ public class GzipCompressorOutputStream extends CompressorOutputStream { * @since 1.1 */ @Override - public void write(byte[] buffer) throws IOException { + public void write(final byte[] buffer) throws IOException { write(buffer, 0, buffer.length); } @@ -151,7 +151,7 @@ public class GzipCompressorOutputStream extends CompressorOutputStream { * @since 1.1 */ @Override - public void write(byte[] buffer, int offset, int length) throws IOException { + public void write(final byte[] buffer, final int offset, final int length) throws IOException { if (deflater.finished()) { throw new IOException("Cannot write more data, the end of the compressed data stream has been reached"); http://git-wip-us.apache.org/repos/asf/commons-compress/blob/478bef36/src/main/java/org/apache/commons/compress/compressors/gzip/GzipParameters.java ---------------------------------------------------------------------- diff --git a/src/main/java/org/apache/commons/compress/compressors/gzip/GzipParameters.java b/src/main/java/org/apache/commons/compress/compressors/gzip/GzipParameters.java index ef9a1af..ff3b41b 100644 --- a/src/main/java/org/apache/commons/compress/compressors/gzip/GzipParameters.java +++ b/src/main/java/org/apache/commons/compress/compressors/gzip/GzipParameters.java @@ -47,7 +47,7 @@ public class GzipParameters { * @see Deflater#DEFAULT_COMPRESSION * @see Deflater#BEST_COMPRESSION */ - public void setCompressionLevel(int compressionLevel) { + public void setCompressionLevel(final int compressionLevel) { if (compressionLevel < -1 || compressionLevel > 9) { throw new IllegalArgumentException("Invalid gzip compression level: " + compressionLevel); } @@ -63,7 +63,7 @@ public class GzipParameters { * * @param modificationTime the modification time, in milliseconds */ - public void setModificationTime(long modificationTime) { + public void setModificationTime(final long modificationTime) { this.modificationTime = modificationTime; } @@ -76,7 +76,7 @@ public class GzipParameters { * * @param filename the name of the file without the directory path */ - public void setFilename(String filename) { + public void setFilename(final String filename) { this.filename = filename; } @@ -84,7 +84,7 @@ public class GzipParameters { return comment; } - public void setComment(String comment) { + public void setComment(final String comment) { this.comment = comment; } @@ -115,7 +115,7 @@ public class GzipParameters { * * @param operatingSystem the code of the operating system */ - public void setOperatingSystem(int operatingSystem) { + public void setOperatingSystem(final int operatingSystem) { this.operatingSystem = operatingSystem; } } http://git-wip-us.apache.org/repos/asf/commons-compress/blob/478bef36/src/main/java/org/apache/commons/compress/compressors/gzip/GzipUtils.java ---------------------------------------------------------------------- diff --git a/src/main/java/org/apache/commons/compress/compressors/gzip/GzipUtils.java b/src/main/java/org/apache/commons/compress/compressors/gzip/GzipUtils.java index 40be437..154f1cb 100644 --- a/src/main/java/org/apache/commons/compress/compressors/gzip/GzipUtils.java +++ b/src/main/java/org/apache/commons/compress/compressors/gzip/GzipUtils.java @@ -61,7 +61,7 @@ public class GzipUtils { * @return {@code true} if the filename has a common gzip suffix, * {@code false} otherwise */ - public static boolean isCompressedFilename(String filename) { + public static boolean isCompressedFilename(final String filename) { return fileNameUtil.isCompressedFilename(filename); } @@ -78,7 +78,7 @@ public class GzipUtils { * @param filename name of a file * @return name of the corresponding uncompressed file */ - public static String getUncompressedFilename(String filename) { + public static String getUncompressedFilename(final String filename) { return fileNameUtil.getUncompressedFilename(filename); } @@ -93,7 +93,7 @@ public class GzipUtils { * @param filename name of a file * @return name of the corresponding compressed file */ - public static String getCompressedFilename(String filename) { + public static String getCompressedFilename(final String filename) { return fileNameUtil.getCompressedFilename(filename); } http://git-wip-us.apache.org/repos/asf/commons-compress/blob/478bef36/src/main/java/org/apache/commons/compress/compressors/lzma/LZMACompressorInputStream.java ---------------------------------------------------------------------- diff --git a/src/main/java/org/apache/commons/compress/compressors/lzma/LZMACompressorInputStream.java b/src/main/java/org/apache/commons/compress/compressors/lzma/LZMACompressorInputStream.java index f9a8eae..ae23297 100644 --- a/src/main/java/org/apache/commons/compress/compressors/lzma/LZMACompressorInputStream.java +++ b/src/main/java/org/apache/commons/compress/compressors/lzma/LZMACompressorInputStream.java @@ -43,7 +43,7 @@ public class LZMACompressorInputStream extends CompressorInputStream { * by this implementation, or the underlying * <code>inputStream</code> throws an exception */ - public LZMACompressorInputStream(InputStream inputStream) + public LZMACompressorInputStream(final InputStream inputStream) throws IOException { in = new LZMAInputStream(inputStream); } @@ -58,7 +58,7 @@ public class LZMACompressorInputStream extends CompressorInputStream { /** {@inheritDoc} */ @Override - public int read(byte[] buf, int off, int len) throws IOException { + public int read(final byte[] buf, final int off, final int len) throws IOException { int ret = in.read(buf, off, len); count(ret); return ret; @@ -66,7 +66,7 @@ public class LZMACompressorInputStream extends CompressorInputStream { /** {@inheritDoc} */ @Override - public long skip(long n) throws IOException { + public long skip(final long n) throws IOException { return in.skip(n); } @@ -93,7 +93,7 @@ public class LZMACompressorInputStream extends CompressorInputStream { * * @since 1.10 */ - public static boolean matches(byte[] signature, int length) { + public static boolean matches(final byte[] signature, final int length) { if (signature == null || length < 3) { return false; http://git-wip-us.apache.org/repos/asf/commons-compress/blob/478bef36/src/main/java/org/apache/commons/compress/compressors/lzma/LZMAUtils.java ---------------------------------------------------------------------- diff --git a/src/main/java/org/apache/commons/compress/compressors/lzma/LZMAUtils.java b/src/main/java/org/apache/commons/compress/compressors/lzma/LZMAUtils.java index 9d5af20..c1a653a 100644 --- a/src/main/java/org/apache/commons/compress/compressors/lzma/LZMAUtils.java +++ b/src/main/java/org/apache/commons/compress/compressors/lzma/LZMAUtils.java @@ -68,7 +68,7 @@ public class LZMAUtils { * @param length the number of bytes to check * @return true if signature matches the .lzma magic bytes, false otherwise */ - public static boolean matches(byte[] signature, int length) { + public static boolean matches(final byte[] signature, final int length) { if (length < HEADER_MAGIC.length) { return false; } @@ -111,7 +111,7 @@ public class LZMAUtils { * @return {@code true} if the filename has a common lzma suffix, * {@code false} otherwise */ - public static boolean isCompressedFilename(String filename) { + public static boolean isCompressedFilename(final String filename) { return fileNameUtil.isCompressedFilename(filename); } @@ -125,7 +125,7 @@ public class LZMAUtils { * @param filename name of a file * @return name of the corresponding uncompressed file */ - public static String getUncompressedFilename(String filename) { + public static String getUncompressedFilename(final String filename) { return fileNameUtil.getUncompressedFilename(filename); } @@ -136,7 +136,7 @@ public class LZMAUtils { * @param filename name of a file * @return name of the corresponding compressed file */ - public static String getCompressedFilename(String filename) { + public static String getCompressedFilename(final String filename) { return fileNameUtil.getCompressedFilename(filename); } @@ -146,7 +146,7 @@ public class LZMAUtils { * <p>This defaults to {@code false} in an OSGi environment and {@code true} otherwise.</p> * @param doCache whether to cache the result */ - public static void setCacheLZMAAvailablity(boolean doCache) { + public static void setCacheLZMAAvailablity(final boolean doCache) { if (!doCache) { cachedLZMAAvailability = CachedAvailability.DONT_CACHE; } else if (cachedLZMAAvailability == CachedAvailability.DONT_CACHE) { http://git-wip-us.apache.org/repos/asf/commons-compress/blob/478bef36/src/main/java/org/apache/commons/compress/compressors/lzw/LZWInputStream.java ---------------------------------------------------------------------- diff --git a/src/main/java/org/apache/commons/compress/compressors/lzw/LZWInputStream.java b/src/main/java/org/apache/commons/compress/compressors/lzw/LZWInputStream.java index 89988c9..a102695 100644 --- a/src/main/java/org/apache/commons/compress/compressors/lzw/LZWInputStream.java +++ b/src/main/java/org/apache/commons/compress/compressors/lzw/LZWInputStream.java @@ -69,7 +69,7 @@ public abstract class LZWInputStream extends CompressorInputStream { } @Override - public int read(byte[] b, int off, int len) throws IOException { + public int read(final byte[] b, final int off, final int len) throws IOException { int bytesRead = readFromStack(b, off, len); while (len - bytesRead > 0) { int result = decompressNextSymbol(); @@ -107,7 +107,7 @@ public abstract class LZWInputStream extends CompressorInputStream { * Sets the clear code based on the code size. * @param codeSize code size */ - protected void setClearCode(int codeSize) { + protected void setClearCode(final int codeSize) { clearCode = (1 << (codeSize - 1)); } @@ -115,7 +115,7 @@ public abstract class LZWInputStream extends CompressorInputStream { * Initializes the arrays based on the maximum code size. * @param maxCodeSize maximum code size */ - protected void initializeTables(int maxCodeSize) { + protected void initializeTables(final int maxCodeSize) { final int maxTableSize = 1 << maxCodeSize; prefixes = new int[maxTableSize]; characters = new byte[maxTableSize]; @@ -148,7 +148,7 @@ public abstract class LZWInputStream extends CompressorInputStream { * @param maxTableSize the maximum table size * @return the new code */ - protected int addEntry(int previousCode, byte character, int maxTableSize) { + protected int addEntry(final int previousCode, final byte character, final int maxTableSize) { if (tableSize < maxTableSize) { prefixes[tableSize] = previousCode; characters[tableSize] = character; @@ -178,7 +178,7 @@ public abstract class LZWInputStream extends CompressorInputStream { * @return the new location of the output stack * @throws IOException on error */ - protected int expandCodeToOutputStack(int code, boolean addedUnfinishedEntry) + protected int expandCodeToOutputStack(final int code, final boolean addedUnfinishedEntry) throws IOException { for (int entry = code; entry >= 0; entry = prefixes[entry]) { outputStack[--outputStackLocation] = characters[entry]; @@ -191,7 +191,7 @@ public abstract class LZWInputStream extends CompressorInputStream { return outputStackLocation; } - private int readFromStack(byte[] b, int off, int len) { + private int readFromStack(final byte[] b, final int off, final int len) { int remainingInStack = outputStack.length - outputStackLocation; if (remainingInStack > 0) { int maxLength = Math.min(remainingInStack, len); @@ -210,7 +210,7 @@ public abstract class LZWInputStream extends CompressorInputStream { setCodeSize(DEFAULT_CODE_SIZE); } - protected void setCodeSize(int cs) { + protected void setCodeSize(final int cs) { this.codeSize = cs; } @@ -222,11 +222,11 @@ public abstract class LZWInputStream extends CompressorInputStream { this.previousCode = -1; } - protected int getPrefix(int offset) { + protected int getPrefix(final int offset) { return prefixes[offset]; } - protected void setPrefix(int offset, int value) { + protected void setPrefix(final int offset, final int value) { prefixes[offset] = value; } @@ -242,7 +242,7 @@ public abstract class LZWInputStream extends CompressorInputStream { return tableSize; } - protected void setTableSize(int newSize) { + protected void setTableSize(final int newSize) { tableSize = newSize; } http://git-wip-us.apache.org/repos/asf/commons-compress/blob/478bef36/src/main/java/org/apache/commons/compress/compressors/pack200/Pack200CompressorInputStream.java ---------------------------------------------------------------------- diff --git a/src/main/java/org/apache/commons/compress/compressors/pack200/Pack200CompressorInputStream.java b/src/main/java/org/apache/commons/compress/compressors/pack200/Pack200CompressorInputStream.java index d88be88..3e28465 100644 --- a/src/main/java/org/apache/commons/compress/compressors/pack200/Pack200CompressorInputStream.java +++ b/src/main/java/org/apache/commons/compress/compressors/pack200/Pack200CompressorInputStream.java @@ -197,12 +197,12 @@ public class Pack200CompressorInputStream extends CompressorInputStream { } @Override - public int read(byte[] b) throws IOException { + public int read(final byte[] b) throws IOException { return streamBridge.getInput().read(b); } @Override - public int read(byte[] b, int off, int count) throws IOException { + public int read(final byte[] b, final int off, final int count) throws IOException { return streamBridge.getInput().read(b, off, count); } @@ -221,7 +221,7 @@ public class Pack200CompressorInputStream extends CompressorInputStream { } @Override - public void mark(int limit) { + public void mark(final int limit) { try { streamBridge.getInput().mark(limit); } catch (IOException ex) { @@ -235,7 +235,7 @@ public class Pack200CompressorInputStream extends CompressorInputStream { } @Override - public long skip(long count) throws IOException { + public long skip(final long count) throws IOException { return streamBridge.getInput().skip(count); } @@ -266,7 +266,7 @@ public class Pack200CompressorInputStream extends CompressorInputStream { * @return true, if this stream is a pack200 compressed stream, * false otherwise */ - public static boolean matches(byte[] signature, int length) { + public static boolean matches(final byte[] signature, final int length) { if (length < SIG_LENGTH) { return false; } http://git-wip-us.apache.org/repos/asf/commons-compress/blob/478bef36/src/main/java/org/apache/commons/compress/compressors/pack200/Pack200CompressorOutputStream.java ---------------------------------------------------------------------- diff --git a/src/main/java/org/apache/commons/compress/compressors/pack200/Pack200CompressorOutputStream.java b/src/main/java/org/apache/commons/compress/compressors/pack200/Pack200CompressorOutputStream.java index 80da616..87a1d87 100644 --- a/src/main/java/org/apache/commons/compress/compressors/pack200/Pack200CompressorOutputStream.java +++ b/src/main/java/org/apache/commons/compress/compressors/pack200/Pack200CompressorOutputStream.java @@ -99,17 +99,17 @@ public class Pack200CompressorOutputStream extends CompressorOutputStream { } @Override - public void write(int b) throws IOException { + public void write(final int b) throws IOException { streamBridge.write(b); } @Override - public void write(byte[] b) throws IOException { + public void write(final byte[] b) throws IOException { streamBridge.write(b); } @Override - public void write(byte[] b, int from, int length) throws IOException { + public void write(final byte[] b, final int from, final int length) throws IOException { streamBridge.write(b, from, length); } http://git-wip-us.apache.org/repos/asf/commons-compress/blob/478bef36/src/main/java/org/apache/commons/compress/compressors/pack200/Pack200Utils.java ---------------------------------------------------------------------- diff --git a/src/main/java/org/apache/commons/compress/compressors/pack200/Pack200Utils.java b/src/main/java/org/apache/commons/compress/compressors/pack200/Pack200Utils.java index b76c75b..4659f42 100644 --- a/src/main/java/org/apache/commons/compress/compressors/pack200/Pack200Utils.java +++ b/src/main/java/org/apache/commons/compress/compressors/pack200/Pack200Utils.java @@ -55,7 +55,7 @@ public class Pack200Utils { * @param jar the JAR archive to normalize * @throws IOException if reading or writing fails */ - public static void normalize(File jar) + public static void normalize(final File jar) throws IOException { normalize(jar, jar, null); } @@ -76,7 +76,7 @@ public class Pack200Utils { * method will implicitly set the segment limit to -1. * @throws IOException if reading or writing fails */ - public static void normalize(File jar, Map<String, String> props) + public static void normalize(final File jar, final Map<String, String> props) throws IOException { normalize(jar, jar, props); } @@ -101,7 +101,7 @@ public class Pack200Utils { * @param to the normalized archive * @throws IOException if reading or writing fails */ - public static void normalize(File from, File to) + public static void normalize(final File from, final File to) throws IOException { normalize(from, to, null); } @@ -125,7 +125,7 @@ public class Pack200Utils { * method will implicitly set the segment limit to -1. * @throws IOException if reading or writing fails */ - public static void normalize(File from, File to, Map<String, String> props) + public static void normalize(final File from, final File to, Map<String, String> props) throws IOException { if (props == null) { props = new HashMap<String, String>(); http://git-wip-us.apache.org/repos/asf/commons-compress/blob/478bef36/src/main/java/org/apache/commons/compress/compressors/pack200/StreamBridge.java ---------------------------------------------------------------------- diff --git a/src/main/java/org/apache/commons/compress/compressors/pack200/StreamBridge.java b/src/main/java/org/apache/commons/compress/compressors/pack200/StreamBridge.java index 293e0bb..980cb7e 100644 --- a/src/main/java/org/apache/commons/compress/compressors/pack200/StreamBridge.java +++ b/src/main/java/org/apache/commons/compress/compressors/pack200/StreamBridge.java @@ -35,7 +35,7 @@ abstract class StreamBridge extends FilterOutputStream { private InputStream input; private final Object INPUT_LOCK = new Object(); - protected StreamBridge(OutputStream out) { + protected StreamBridge(final OutputStream out) { super(out); } http://git-wip-us.apache.org/repos/asf/commons-compress/blob/478bef36/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 8d245d4..3d51c9c 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 @@ -75,7 +75,7 @@ public class FramedSnappyCompressorInputStream extends CompressorInputStream { * @param in the InputStream from which to read the compressed data * @throws IOException if reading fails */ - public FramedSnappyCompressorInputStream(InputStream in) throws IOException { + public FramedSnappyCompressorInputStream(final InputStream in) throws IOException { this.in = new PushbackInputStream(in, 1); readStreamIdentifier(); } @@ -98,7 +98,7 @@ public class FramedSnappyCompressorInputStream extends CompressorInputStream { /** {@inheritDoc} */ @Override - public int read(byte[] b, int off, int len) throws IOException { + public int read(final byte[] b, final int off, final int len) throws IOException { int read = readOnce(b, off, len); if (read == -1) { readNextBlock(); @@ -129,7 +129,7 @@ public class FramedSnappyCompressorInputStream extends CompressorInputStream { * read from the current chunk (which may be -1 if the end of the * chunk is reached). */ - private int readOnce(byte[] b, int off, int len) throws IOException { + private int readOnce(final byte[] b, final int off, final int len) throws IOException { int read = -1; if (inUncompressedChunk) { int amount = Math.min(uncompressedBytesRemaining, len); @@ -273,7 +273,7 @@ public class FramedSnappyCompressorInputStream extends CompressorInputStream { * @param length the number of bytes to check * @return true if this is a .sz stream, false otherwise */ - public static boolean matches(byte[] signature, int length) { + public static boolean matches(final byte[] signature, final int length) { if (length < SZ_SIGNATURE.length) { return false; http://git-wip-us.apache.org/repos/asf/commons-compress/blob/478bef36/src/main/java/org/apache/commons/compress/compressors/snappy/PureJavaCrc32C.java ---------------------------------------------------------------------- diff --git a/src/main/java/org/apache/commons/compress/compressors/snappy/PureJavaCrc32C.java b/src/main/java/org/apache/commons/compress/compressors/snappy/PureJavaCrc32C.java index 506d86c..d01353c 100644 --- a/src/main/java/org/apache/commons/compress/compressors/snappy/PureJavaCrc32C.java +++ b/src/main/java/org/apache/commons/compress/compressors/snappy/PureJavaCrc32C.java @@ -54,7 +54,7 @@ public void reset() { } @Override -public void update(byte[] b, int off, int len) { +public void update(final byte[] b, int off, int len) { int localCrc = crc; while(len > 7) { @@ -95,7 +95,7 @@ public void update(byte[] b, int off, int len) { } @Override -final public void update(int b) { +final public void update(final int b) { crc = (crc >>> 8) ^ T[T8_0_start + ((crc ^ b) & 0xff)]; } http://git-wip-us.apache.org/repos/asf/commons-compress/blob/478bef36/src/main/java/org/apache/commons/compress/compressors/snappy/SnappyCompressorInputStream.java ---------------------------------------------------------------------- diff --git a/src/main/java/org/apache/commons/compress/compressors/snappy/SnappyCompressorInputStream.java b/src/main/java/org/apache/commons/compress/compressors/snappy/SnappyCompressorInputStream.java index 92e1cbc..fae3a42 100644 --- a/src/main/java/org/apache/commons/compress/compressors/snappy/SnappyCompressorInputStream.java +++ b/src/main/java/org/apache/commons/compress/compressors/snappy/SnappyCompressorInputStream.java @@ -125,7 +125,7 @@ public class SnappyCompressorInputStream extends CompressorInputStream { * {@inheritDoc} */ @Override - public int read(byte[] b, int off, int len) throws IOException { + public int read(final byte[] b, final int off, final int len) throws IOException { if (endReached) { return -1; } @@ -152,7 +152,7 @@ public class SnappyCompressorInputStream extends CompressorInputStream { * * @param len the number of uncompressed bytes to read */ - private void fill(int len) throws IOException { + private void fill(final int len) throws IOException { if (uncompressedBytesRemaining == 0) { endReached = true; } @@ -265,7 +265,7 @@ public class SnappyCompressorInputStream extends CompressorInputStream { * or 63 for 1-4 bytes, respectively. The literal itself follows * after the length. */ - private int readLiteralLength(int b) throws IOException { + private int readLiteralLength(final int b) throws IOException { int length; switch (b >> 2) { case 60: @@ -336,7 +336,7 @@ public class SnappyCompressorInputStream extends CompressorInputStream { * buffer * @return True if the decompressed data should be flushed */ - private boolean expandCopy(final long off, int length) throws IOException { + private boolean expandCopy(final long off, final int length) throws IOException { if (off > blockSize) { throw new IOException("Offset is larger than block size"); } http://git-wip-us.apache.org/repos/asf/commons-compress/blob/478bef36/src/main/java/org/apache/commons/compress/compressors/xz/XZCompressorInputStream.java ---------------------------------------------------------------------- diff --git a/src/main/java/org/apache/commons/compress/compressors/xz/XZCompressorInputStream.java b/src/main/java/org/apache/commons/compress/compressors/xz/XZCompressorInputStream.java index c6e4e9e..24fee7b 100644 --- a/src/main/java/org/apache/commons/compress/compressors/xz/XZCompressorInputStream.java +++ b/src/main/java/org/apache/commons/compress/compressors/xz/XZCompressorInputStream.java @@ -40,7 +40,7 @@ public class XZCompressorInputStream extends CompressorInputStream { * @param length the number of bytes to check * @return true if signature matches the .xz magic bytes, false otherwise */ - public static boolean matches(byte[] signature, int length) { + public static boolean matches(final byte[] signature, final int length) { if (length < XZ.HEADER_MAGIC.length) { return false; } @@ -67,7 +67,7 @@ public class XZCompressorInputStream extends CompressorInputStream { * by this implementation, or the underlying * <code>inputStream</code> throws an exception */ - public XZCompressorInputStream(InputStream inputStream) + public XZCompressorInputStream(final InputStream inputStream) throws IOException { this(inputStream, false); } @@ -89,8 +89,8 @@ public class XZCompressorInputStream extends CompressorInputStream { * by this implementation, or the underlying * <code>inputStream</code> throws an exception */ - public XZCompressorInputStream(InputStream inputStream, - boolean decompressConcatenated) + public XZCompressorInputStream(final InputStream inputStream, + final boolean decompressConcatenated) throws IOException { if (decompressConcatenated) { in = new XZInputStream(inputStream); @@ -107,14 +107,14 @@ public class XZCompressorInputStream extends CompressorInputStream { } @Override - public int read(byte[] buf, int off, int len) throws IOException { + public int read(final byte[] buf, final int off, final int len) throws IOException { int ret = in.read(buf, off, len); count(ret); return ret; } @Override - public long skip(long n) throws IOException { + public long skip(final long n) throws IOException { return in.skip(n); } http://git-wip-us.apache.org/repos/asf/commons-compress/blob/478bef36/src/main/java/org/apache/commons/compress/compressors/xz/XZCompressorOutputStream.java ---------------------------------------------------------------------- diff --git a/src/main/java/org/apache/commons/compress/compressors/xz/XZCompressorOutputStream.java b/src/main/java/org/apache/commons/compress/compressors/xz/XZCompressorOutputStream.java index 23cda28..6e9b70e 100644 --- a/src/main/java/org/apache/commons/compress/compressors/xz/XZCompressorOutputStream.java +++ b/src/main/java/org/apache/commons/compress/compressors/xz/XZCompressorOutputStream.java @@ -38,7 +38,7 @@ public class XZCompressorOutputStream extends CompressorOutputStream { * @param outputStream the stream to wrap * @throws IOException on error */ - public XZCompressorOutputStream(OutputStream outputStream) + public XZCompressorOutputStream(final OutputStream outputStream) throws IOException { out = new XZOutputStream(outputStream, new LZMA2Options()); } @@ -59,18 +59,18 @@ public class XZCompressorOutputStream extends CompressorOutputStream { * @param preset the preset * @throws IOException on error */ - public XZCompressorOutputStream(OutputStream outputStream, int preset) + public XZCompressorOutputStream(final OutputStream outputStream, final int preset) throws IOException { out = new XZOutputStream(outputStream, new LZMA2Options(preset)); } @Override - public void write(int b) throws IOException { + public void write(final int b) throws IOException { out.write(b); } @Override - public void write(byte[] buf, int off, int len) throws IOException { + public void write(final byte[] buf, final int off, final int len) throws IOException { out.write(buf, off, len); } http://git-wip-us.apache.org/repos/asf/commons-compress/blob/478bef36/src/main/java/org/apache/commons/compress/compressors/xz/XZUtils.java ---------------------------------------------------------------------- diff --git a/src/main/java/org/apache/commons/compress/compressors/xz/XZUtils.java b/src/main/java/org/apache/commons/compress/compressors/xz/XZUtils.java index d1742d9..db71b17 100644 --- a/src/main/java/org/apache/commons/compress/compressors/xz/XZUtils.java +++ b/src/main/java/org/apache/commons/compress/compressors/xz/XZUtils.java @@ -77,7 +77,7 @@ public class XZUtils { * @return true if signature matches the .xz magic bytes, false otherwise * @since 1.9 */ - public static boolean matches(byte[] signature, int length) { + public static boolean matches(final byte[] signature, final int length) { if (length < HEADER_MAGIC.length) { return false; } @@ -120,7 +120,7 @@ public class XZUtils { * @return {@code true} if the filename has a common xz suffix, * {@code false} otherwise */ - public static boolean isCompressedFilename(String filename) { + public static boolean isCompressedFilename(final String filename) { return fileNameUtil.isCompressedFilename(filename); } @@ -137,7 +137,7 @@ public class XZUtils { * @param filename name of a file * @return name of the corresponding uncompressed file */ - public static String getUncompressedFilename(String filename) { + public static String getUncompressedFilename(final String filename) { return fileNameUtil.getUncompressedFilename(filename); } @@ -152,7 +152,7 @@ public class XZUtils { * @param filename name of a file * @return name of the corresponding compressed file */ - public static String getCompressedFilename(String filename) { + public static String getCompressedFilename(final String filename) { return fileNameUtil.getCompressedFilename(filename); } @@ -163,7 +163,7 @@ public class XZUtils { * @param doCache whether to cache the result * @since 1.9 */ - public static void setCacheXZAvailablity(boolean doCache) { + public static void setCacheXZAvailablity(final boolean doCache) { if (!doCache) { cachedXZAvailability = CachedAvailability.DONT_CACHE; } else if (cachedXZAvailability == CachedAvailability.DONT_CACHE) { http://git-wip-us.apache.org/repos/asf/commons-compress/blob/478bef36/src/main/java/org/apache/commons/compress/compressors/z/ZCompressorInputStream.java ---------------------------------------------------------------------- diff --git a/src/main/java/org/apache/commons/compress/compressors/z/ZCompressorInputStream.java b/src/main/java/org/apache/commons/compress/compressors/z/ZCompressorInputStream.java index e21df06..a7b028e 100644 --- a/src/main/java/org/apache/commons/compress/compressors/z/ZCompressorInputStream.java +++ b/src/main/java/org/apache/commons/compress/compressors/z/ZCompressorInputStream.java @@ -38,7 +38,7 @@ public class ZCompressorInputStream extends LZWInputStream { private final int maxCodeSize; private long totalCodesRead = 0; - public ZCompressorInputStream(InputStream inputStream) throws IOException { + public ZCompressorInputStream(final InputStream inputStream) throws IOException { super(inputStream, ByteOrder.LITTLE_ENDIAN); int firstByte = (int) in.readBits(8); int secondByte = (int) in.readBits(8); @@ -96,7 +96,7 @@ public class ZCompressorInputStream extends LZWInputStream { * change or disappear without warning.</strong></p> */ @Override - protected int addEntry(int previousCode, byte character) throws IOException { + protected int addEntry(final int previousCode, final byte character) throws IOException { final int maxTableSize = 1 << getCodeSize(); int r = addEntry(previousCode, character, maxTableSize); if (getTableSize() == maxTableSize && getCodeSize() < maxCodeSize) { @@ -159,7 +159,7 @@ public class ZCompressorInputStream extends LZWInputStream { * * @since 1.9 */ - public static boolean matches(byte[] signature, int length) { + public static boolean matches(final byte[] signature, final int length) { return length > 3 && signature[0] == MAGIC_1 && signature[1] == (byte) MAGIC_2; } http://git-wip-us.apache.org/repos/asf/commons-compress/blob/478bef36/src/main/java/org/apache/commons/compress/parallel/FileBasedScatterGatherBackingStore.java ---------------------------------------------------------------------- diff --git a/src/main/java/org/apache/commons/compress/parallel/FileBasedScatterGatherBackingStore.java b/src/main/java/org/apache/commons/compress/parallel/FileBasedScatterGatherBackingStore.java index b8225a3..1a26d3d 100644 --- a/src/main/java/org/apache/commons/compress/parallel/FileBasedScatterGatherBackingStore.java +++ b/src/main/java/org/apache/commons/compress/parallel/FileBasedScatterGatherBackingStore.java @@ -34,7 +34,7 @@ public class FileBasedScatterGatherBackingStore implements ScatterGatherBackingS private final FileOutputStream os; private boolean closed; - public FileBasedScatterGatherBackingStore(File target) throws FileNotFoundException { + public FileBasedScatterGatherBackingStore(final File target) throws FileNotFoundException { this.target = target; os = new FileOutputStream(target); } @@ -54,7 +54,7 @@ public class FileBasedScatterGatherBackingStore implements ScatterGatherBackingS } @Override - public void writeOut(byte[] data, int offset, int length) throws IOException { + public void writeOut(final byte[] data, final int offset, final int length) throws IOException { os.write(data, offset, length); } http://git-wip-us.apache.org/repos/asf/commons-compress/blob/478bef36/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 8fee98c..8798274 100644 --- a/src/main/java/org/apache/commons/compress/utils/ArchiveUtils.java +++ b/src/main/java/org/apache/commons/compress/utils/ArchiveUtils.java @@ -43,7 +43,7 @@ public class ArchiveUtils { * @param entry the entry * @return the representation of the entry */ - public static String toString(ArchiveEntry entry){ + public static String toString(final ArchiveEntry entry){ StringBuilder sb = new StringBuilder(); sb.append(entry.isDirectory()? 'd' : '-');// c.f. "ls -l" output String size = Long.toString(entry.getSize()); @@ -67,7 +67,7 @@ public class ArchiveUtils { * @return {@code true} if buffer is the same as the expected string */ public static boolean matchAsciiBuffer( - String expected, byte[] buffer, int offset, int length){ + final String expected, final byte[] buffer, final int offset, final int length){ byte[] buffer1; try { buffer1 = expected.getBytes(CharsetNames.US_ASCII); @@ -84,7 +84,7 @@ public class ArchiveUtils { * @param buffer the buffer * @return {@code true} if buffer is the same as the expected string */ - public static boolean matchAsciiBuffer(String expected, byte[] buffer){ + public static boolean matchAsciiBuffer(final String expected, final byte[] buffer){ return matchAsciiBuffer(expected, buffer, 0, buffer.length); } @@ -95,7 +95,7 @@ public class ArchiveUtils { * @param inputString string to convert * @return the bytes */ - public static byte[] toAsciiBytes(String inputString){ + public static byte[] toAsciiBytes(final String inputString){ try { return inputString.getBytes(CharsetNames.US_ASCII); } catch (UnsupportedEncodingException e) { @@ -125,7 +125,7 @@ public class ArchiveUtils { * @param length length of array * @return the bytes, interpreted as an Ascii string */ - public static String toAsciiString(final byte[] inputBytes, int offset, int length){ + public static String toAsciiString(final byte[] inputBytes, final int offset, final int length){ try { return new String(inputBytes, offset, length, CharsetNames.US_ASCII); } catch (UnsupportedEncodingException e) { @@ -148,7 +148,7 @@ public class ArchiveUtils { public static boolean isEqual( final byte[] buffer1, final int offset1, final int length1, final byte[] buffer2, final int offset2, final int length2, - boolean ignoreTrailingNulls){ + final boolean ignoreTrailingNulls){ int minLen=length1 < length2 ? length1 : length2; for (int i=0; i < minLen; i++){ if (buffer1[offset1+i] != buffer2[offset2+i]){ @@ -213,7 +213,7 @@ public class ArchiveUtils { * @param ignoreTrailingNulls whether to ignore tariling nulls * @return {@code true} if buffer1 and buffer2 have same contents */ - public static boolean isEqual(final byte[] buffer1, final byte[] buffer2, boolean ignoreTrailingNulls){ + public static boolean isEqual(final byte[] buffer1, final byte[] buffer2, final boolean ignoreTrailingNulls){ return isEqual(buffer1, 0, buffer1.length, buffer2, 0, buffer2.length, ignoreTrailingNulls); } @@ -243,7 +243,7 @@ public class ArchiveUtils { * The number of characters to check (not the size of the array) * @return true if the first N bytes are zero */ - public static boolean isArrayZero(byte[] a, int size) { + public static boolean isArrayZero(final byte[] a, final int size) { for (int i = 0; i < size; i++) { if (a[i] != 0) { return false; http://git-wip-us.apache.org/repos/asf/commons-compress/blob/478bef36/src/main/java/org/apache/commons/compress/utils/BoundedInputStream.java ---------------------------------------------------------------------- diff --git a/src/main/java/org/apache/commons/compress/utils/BoundedInputStream.java b/src/main/java/org/apache/commons/compress/utils/BoundedInputStream.java index 5b35667..978f09e 100644 --- a/src/main/java/org/apache/commons/compress/utils/BoundedInputStream.java +++ b/src/main/java/org/apache/commons/compress/utils/BoundedInputStream.java @@ -50,7 +50,7 @@ public class BoundedInputStream extends InputStream { } @Override - public int read(byte[] b, int off, int len) throws IOException { + public int read(final byte[] b, final int off, final int len) throws IOException { if (bytesRemaining == 0) { return -1; } http://git-wip-us.apache.org/repos/asf/commons-compress/blob/478bef36/src/main/java/org/apache/commons/compress/utils/Charsets.java ---------------------------------------------------------------------- diff --git a/src/main/java/org/apache/commons/compress/utils/Charsets.java b/src/main/java/org/apache/commons/compress/utils/Charsets.java index 8c1559e..5808a64 100644 --- a/src/main/java/org/apache/commons/compress/utils/Charsets.java +++ b/src/main/java/org/apache/commons/compress/utils/Charsets.java @@ -68,7 +68,7 @@ public class Charsets { * A charset or null. * @return the given Charset or the default Charset if the given Charset is null */ - public static Charset toCharset(Charset charset) { + public static Charset toCharset(final Charset charset) { return charset == null ? Charset.defaultCharset() : charset; } @@ -83,7 +83,7 @@ public class Charsets { * @throws java.nio.charset.IllegalCharsetNameException * If the given charset name is illegal */ - public static Charset toCharset(String charset) { + public static Charset toCharset(final String charset) { return charset == null ? Charset.defaultCharset() : Charset.forName(charset); } http://git-wip-us.apache.org/repos/asf/commons-compress/blob/478bef36/src/main/java/org/apache/commons/compress/utils/ChecksumVerifyingInputStream.java ---------------------------------------------------------------------- diff --git a/src/main/java/org/apache/commons/compress/utils/ChecksumVerifyingInputStream.java b/src/main/java/org/apache/commons/compress/utils/ChecksumVerifyingInputStream.java index 856e448..eb8619f 100644 --- a/src/main/java/org/apache/commons/compress/utils/ChecksumVerifyingInputStream.java +++ b/src/main/java/org/apache/commons/compress/utils/ChecksumVerifyingInputStream.java @@ -70,7 +70,7 @@ public class ChecksumVerifyingInputStream extends InputStream { * value */ @Override - public int read(byte[] b) throws IOException { + public int read(final byte[] b) throws IOException { return read(b, 0, b.length); } @@ -81,7 +81,7 @@ public class ChecksumVerifyingInputStream extends InputStream { * value */ @Override - public int read(byte[] b, int off, int len) throws IOException { + public int read(final byte[] b, final int off, final int len) throws IOException { int ret = in.read(b, off, len); if (ret >= 0) { checksum.update(b, off, ret); @@ -94,7 +94,7 @@ public class ChecksumVerifyingInputStream extends InputStream { } @Override - public long skip(long n) throws IOException { + public long skip(final long n) throws IOException { // Can't really skip, we have to hash everything to verify the checksum if (read() >= 0) { return 1; http://git-wip-us.apache.org/repos/asf/commons-compress/blob/478bef36/src/main/java/org/apache/commons/compress/utils/CountingInputStream.java ---------------------------------------------------------------------- diff --git a/src/main/java/org/apache/commons/compress/utils/CountingInputStream.java b/src/main/java/org/apache/commons/compress/utils/CountingInputStream.java index ab26d2d..c4905fa 100644 --- a/src/main/java/org/apache/commons/compress/utils/CountingInputStream.java +++ b/src/main/java/org/apache/commons/compress/utils/CountingInputStream.java @@ -43,11 +43,11 @@ public class CountingInputStream extends FilterInputStream { return r; } @Override - public int read(byte[] b) throws IOException { + public int read(final byte[] b) throws IOException { return read(b, 0, b.length); } @Override - public int read(byte[] b, int off, int len) throws IOException { + public int read(final byte[] b, final int off, final int len) throws IOException { int r = in.read(b, off, len); if (r >= 0) { count(r); @@ -60,7 +60,7 @@ public class CountingInputStream extends FilterInputStream { * * @param read the number of bytes read */ - protected final void count(long read) { + protected final void count(final long read) { if (read != -1) { bytesRead += read; } http://git-wip-us.apache.org/repos/asf/commons-compress/blob/478bef36/src/main/java/org/apache/commons/compress/utils/CountingOutputStream.java ---------------------------------------------------------------------- diff --git a/src/main/java/org/apache/commons/compress/utils/CountingOutputStream.java b/src/main/java/org/apache/commons/compress/utils/CountingOutputStream.java index 3e62fde..e91de89 100644 --- a/src/main/java/org/apache/commons/compress/utils/CountingOutputStream.java +++ b/src/main/java/org/apache/commons/compress/utils/CountingOutputStream.java @@ -35,16 +35,16 @@ public class CountingOutputStream extends FilterOutputStream { } @Override - public void write(int b) throws IOException { + public void write(final int b) throws IOException { out.write(b); count(1); } @Override - public void write(byte[] b) throws IOException { + public void write(final byte[] b) throws IOException { write(b, 0, b.length); } @Override - public void write(byte[] b, int off, int len) throws IOException { + public void write(final byte[] b, final int off, final int len) throws IOException { out.write(b, off, len); count(len); } @@ -55,7 +55,7 @@ public class CountingOutputStream extends FilterOutputStream { * * @param written the number of bytes written */ - protected void count(long written) { + protected void count(final long written) { if (written != -1) { bytesWritten += written; } http://git-wip-us.apache.org/repos/asf/commons-compress/blob/478bef36/src/main/java/org/apache/commons/compress/utils/IOUtils.java ---------------------------------------------------------------------- diff --git a/src/main/java/org/apache/commons/compress/utils/IOUtils.java b/src/main/java/org/apache/commons/compress/utils/IOUtils.java index 940d29d..ee9989b 100644 --- a/src/main/java/org/apache/commons/compress/utils/IOUtils.java +++ b/src/main/java/org/apache/commons/compress/utils/IOUtils.java @@ -70,7 +70,7 @@ public final class IOUtils { * @throws IOException * if an error occurs */ - public static long copy(final InputStream input, final OutputStream output, int buffersize) throws IOException { + public static long copy(final InputStream input, final OutputStream output, final int buffersize) throws IOException { final byte[] buffer = new byte[buffersize]; int n = 0; long count=0; @@ -97,7 +97,7 @@ public final class IOUtils { * @return the number of bytes actually skipped * @throws IOException on error */ - public static long skip(InputStream input, long numToSkip) throws IOException { + public static long skip(final InputStream input, long numToSkip) throws IOException { long available = numToSkip; while (numToSkip > 0) { long skipped = input.skip(numToSkip); @@ -130,7 +130,7 @@ public final class IOUtils { * @return the number of bytes actually read * @throws IOException on error */ - public static int readFully(InputStream input, byte[] b) throws IOException { + public static int readFully(final InputStream input, final byte[] b) throws IOException { return readFully(input, b, 0, b.length); } @@ -150,7 +150,7 @@ public final class IOUtils { * @throws IOException * if an I/O error has occurred */ - public static int readFully(InputStream input, byte[] b, int offset, int len) + public static int readFully(final InputStream input, final byte[] b, final int offset, final int len) throws IOException { if (len < 0 || offset < 0 || len + offset > b.length) { throw new IndexOutOfBoundsException(); @@ -195,7 +195,7 @@ public final class IOUtils { * @param c Closeable to close, can be null * @since 1.7 */ - public static void closeQuietly(Closeable c) { + public static void closeQuietly(final Closeable c) { if (c != null) { try { c.close(); http://git-wip-us.apache.org/repos/asf/commons-compress/blob/478bef36/src/test/java/org/apache/commons/compress/AbstractTestCase.java ---------------------------------------------------------------------- diff --git a/src/test/java/org/apache/commons/compress/AbstractTestCase.java b/src/test/java/org/apache/commons/compress/AbstractTestCase.java index a17d03e..fda713d 100644 --- a/src/test/java/org/apache/commons/compress/AbstractTestCase.java +++ b/src/test/java/org/apache/commons/compress/AbstractTestCase.java @@ -60,14 +60,14 @@ public abstract class AbstractTestCase { archive = null; } - public static File mkdir(String name) throws IOException { + public static File mkdir(final String name) throws IOException { File f = File.createTempFile(name, ""); f.delete(); f.mkdir(); return f; } - public static File getFile(String path) throws IOException { + public static File getFile(final String path) throws IOException { URL url = AbstractTestCase.class.getClassLoader().getResource(path); if (url == null) { throw new FileNotFoundException("couldn't find " + path); @@ -95,7 +95,7 @@ public abstract class AbstractTestCase { } } - public static void rmdir(File f) { + public static void rmdir(final File f) { String[] s = f.list(); if (s != null) { for (String element : s) { @@ -126,7 +126,7 @@ public abstract class AbstractTestCase { * @return whether deletion was successful * @since Stolen from FileUtils in Ant 1.8.0 */ - public static boolean tryHardToDelete(File f) { + public static boolean tryHardToDelete(final File f) { if (f != null && f.exists() && !f.delete()) { if (ON_WINDOWS) { System.gc(); @@ -165,7 +165,7 @@ public abstract class AbstractTestCase { * @throws Exception * in case something goes wrong */ - protected File createArchive(String archivename) throws Exception { + protected File createArchive(final String archivename) throws Exception { ArchiveOutputStream out = null; OutputStream stream = null; try { @@ -212,7 +212,7 @@ public abstract class AbstractTestCase { * @throws IOException * @throws FileNotFoundException */ - private void addArchiveEntry(ArchiveOutputStream out, String filename, final File infile) + private void addArchiveEntry(final ArchiveOutputStream out, final String filename, final File infile) throws IOException, FileNotFoundException { ArchiveEntry entry = out.createArchiveEntry(infile, filename); out.putArchiveEntry(entry); @@ -227,7 +227,7 @@ public abstract class AbstractTestCase { * @return the archive File * @throws Exception */ - protected File createEmptyArchive(String archivename) throws Exception { + protected File createEmptyArchive(final String archivename) throws Exception { ArchiveOutputStream out = null; OutputStream stream = null; archiveList = new ArrayList<String>(); @@ -254,7 +254,7 @@ public abstract class AbstractTestCase { * @return the archive File * @throws Exception */ - protected File createSingleEntryArchive(String archivename) throws Exception { + protected File createSingleEntryArchive(final String archivename) throws Exception { ArchiveOutputStream out = null; OutputStream stream = null; archiveList = new ArrayList<String>(); @@ -285,7 +285,7 @@ public abstract class AbstractTestCase { * a list with expected string filenames * @throws Exception */ - protected void checkArchiveContent(File archive, List<String> expected) + protected void checkArchiveContent(final File archive, final List<String> expected) throws Exception { final InputStream is = new FileInputStream(archive); try { @@ -304,7 +304,7 @@ public abstract class AbstractTestCase { * @param expected list of expected entries or {@code null} if no check of names desired * @throws Exception */ - protected void checkArchiveContent(ArchiveInputStream in, List<String> expected) + protected void checkArchiveContent(final ArchiveInputStream in, final List<String> expected) throws Exception { checkArchiveContent(in, expected, true); } @@ -318,7 +318,7 @@ public abstract class AbstractTestCase { * @return returns the created result file if cleanUp = false, or null otherwise * @throws Exception */ - protected File checkArchiveContent(ArchiveInputStream in, List<String> expected, boolean cleanUp) + protected File checkArchiveContent(final ArchiveInputStream in, final List<String> expected, final boolean cleanUp) throws Exception { File result = mkdir("dir-result"); result.deleteOnExit(); @@ -374,7 +374,7 @@ public abstract class AbstractTestCase { * @param entry * @return returns the entry name */ - protected String getExpectedString(ArchiveEntry entry) { + protected String getExpectedString(final ArchiveEntry entry) { return entry.getName(); } @@ -402,7 +402,7 @@ public abstract class AbstractTestCase { return tmpDir; } - protected void closeQuietly(Closeable closeable){ + protected void closeQuietly(final Closeable closeable){ if (closeable != null) { try { closeable.close(); http://git-wip-us.apache.org/repos/asf/commons-compress/blob/478bef36/src/test/java/org/apache/commons/compress/ArchiveReadTest.java ---------------------------------------------------------------------- diff --git a/src/test/java/org/apache/commons/compress/ArchiveReadTest.java b/src/test/java/org/apache/commons/compress/ArchiveReadTest.java index 4cd72d0..f9c3ce2 100644 --- a/src/test/java/org/apache/commons/compress/ArchiveReadTest.java +++ b/src/test/java/org/apache/commons/compress/ArchiveReadTest.java @@ -53,7 +53,7 @@ public class ArchiveReadTest extends AbstractTestCase { private final File file; - public ArchiveReadTest(String file){ + public ArchiveReadTest(final String file){ this.file = new File(ARCDIR, file); } @@ -78,7 +78,7 @@ public class ArchiveReadTest extends AbstractTestCase { Collection<Object[]> params = new ArrayList<Object[]>(); for (String f : ARCDIR.list(new FilenameFilter() { @Override - public boolean accept(File dir, String name) { + public boolean accept(final File dir, final String name) { return !name.endsWith(".txt"); } })) @@ -90,7 +90,7 @@ public class ArchiveReadTest extends AbstractTestCase { // files.txt contains size and filename @Override - protected String getExpectedString(ArchiveEntry entry) { + protected String getExpectedString(final ArchiveEntry entry) { return entry.getSize() + " " + entry.getName(); } http://git-wip-us.apache.org/repos/asf/commons-compress/blob/478bef36/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 113b287..7eb3318 100644 --- a/src/test/java/org/apache/commons/compress/ArchiveUtilsTest.java +++ b/src/test/java/org/apache/commons/compress/ArchiveUtilsTest.java @@ -67,11 +67,11 @@ public class ArchiveUtilsTest extends AbstractTestCase { asciiToByteAndBackFail("\u8025"); } - private void asciiToByteAndBackOK(String inputString) { + private void asciiToByteAndBackOK(final String inputString) { assertEquals(inputString, ArchiveUtils.toAsciiString(ArchiveUtils.toAsciiBytes(inputString))); } - private void asciiToByteAndBackFail(String inputString) { + private void asciiToByteAndBackFail(final String inputString) { assertFalse(inputString.equals(ArchiveUtils.toAsciiString(ArchiveUtils.toAsciiBytes(inputString)))); } } http://git-wip-us.apache.org/repos/asf/commons-compress/blob/478bef36/src/test/java/org/apache/commons/compress/DetectArchiverTestCase.java ---------------------------------------------------------------------- diff --git a/src/test/java/org/apache/commons/compress/DetectArchiverTestCase.java b/src/test/java/org/apache/commons/compress/DetectArchiverTestCase.java index 8e1e7bf..68d12b6 100644 --- a/src/test/java/org/apache/commons/compress/DetectArchiverTestCase.java +++ b/src/test/java/org/apache/commons/compress/DetectArchiverTestCase.java @@ -96,7 +96,7 @@ public final class DetectArchiverTestCase extends AbstractTestCase { } - private ArchiveInputStream getStreamFor(String resource) + private ArchiveInputStream getStreamFor(final String resource) throws ArchiveException, IOException { return factory.createArchiveInputStream( new BufferedInputStream(new FileInputStream( @@ -129,7 +129,7 @@ public final class DetectArchiverTestCase extends AbstractTestCase { checkEmptyArchive("zip"); } - private void checkEmptyArchive(String type) throws Exception{ + private void checkEmptyArchive(final String type) throws Exception{ File ar = createEmptyArchive(type); // will be deleted by tearDown() ar.deleteOnExit(); // Just in case file cannot be deleted ArchiveInputStream ais = null; http://git-wip-us.apache.org/repos/asf/commons-compress/blob/478bef36/src/test/java/org/apache/commons/compress/IOMethodsTest.java ---------------------------------------------------------------------- diff --git a/src/test/java/org/apache/commons/compress/IOMethodsTest.java b/src/test/java/org/apache/commons/compress/IOMethodsTest.java index 2ba67a1..b962392 100644 --- a/src/test/java/org/apache/commons/compress/IOMethodsTest.java +++ b/src/test/java/org/apache/commons/compress/IOMethodsTest.java @@ -108,7 +108,7 @@ public class IOMethodsTest extends AbstractTestCase { compareReads("zip"); } - private void compareWrites(String archiverName, ArchiveEntry entry) throws Exception { + private void compareWrites(final String archiverName, final ArchiveEntry entry) throws Exception { OutputStream out1 = new ByteArrayOutputStream(); OutputStream out2 = new ByteArrayOutputStream(); OutputStream out3 = new ByteArrayOutputStream(); @@ -139,7 +139,7 @@ public class IOMethodsTest extends AbstractTestCase { assertEquals("out1!=out3",out1.toString(),out3.toString()); } - private void compareReads(String archiverName) throws Exception { + private void compareReads(final String archiverName) throws Exception { OutputStream out1 = new ByteArrayOutputStream(); OutputStream out2 = new ByteArrayOutputStream(); OutputStream out3 = new ByteArrayOutputStream(); http://git-wip-us.apache.org/repos/asf/commons-compress/blob/478bef36/src/test/java/org/apache/commons/compress/archivers/ArchiveOutputStreamTest.java ---------------------------------------------------------------------- diff --git a/src/test/java/org/apache/commons/compress/archivers/ArchiveOutputStreamTest.java b/src/test/java/org/apache/commons/compress/archivers/ArchiveOutputStreamTest.java index 451d70d..a1c0243 100644 --- a/src/test/java/org/apache/commons/compress/archivers/ArchiveOutputStreamTest.java +++ b/src/test/java/org/apache/commons/compress/archivers/ArchiveOutputStreamTest.java @@ -134,7 +134,7 @@ public class ArchiveOutputStreamTest extends AbstractTestCase { doCallSequence("Zip"); } - private void doCallSequence(String archiveType) throws Exception { + private void doCallSequence(final String archiveType) throws Exception { OutputStream out1 = new ByteArrayOutputStream(); File dummy = getFile("test1.xml"); // need a real file http://git-wip-us.apache.org/repos/asf/commons-compress/blob/478bef36/src/test/java/org/apache/commons/compress/archivers/ArchiveStreamFactoryTest.java ---------------------------------------------------------------------- diff --git a/src/test/java/org/apache/commons/compress/archivers/ArchiveStreamFactoryTest.java b/src/test/java/org/apache/commons/compress/archivers/ArchiveStreamFactoryTest.java index 338df54..ec1ead4 100644 --- a/src/test/java/org/apache/commons/compress/archivers/ArchiveStreamFactoryTest.java +++ b/src/test/java/org/apache/commons/compress/archivers/ArchiveStreamFactoryTest.java @@ -195,7 +195,7 @@ public class ArchiveStreamFactoryTest { final String fieldName; final String type; final boolean hasOutputStream; - TestData(String testFile, String type, boolean hasOut, String expectedEncoding, ArchiveStreamFactory fac, String fieldName) { + TestData(final String testFile, final String type, final boolean hasOut, final String expectedEncoding, final ArchiveStreamFactory fac, final String fieldName) { this.testFile = testFile; this.expectedEncoding = expectedEncoding; this.fac = fac; @@ -206,7 +206,7 @@ public class ArchiveStreamFactoryTest { } @SuppressWarnings("deprecation") // test of deprecated method - static ArchiveStreamFactory getFactory(String entryEncoding) { + static ArchiveStreamFactory getFactory(final String entryEncoding) { ArchiveStreamFactory fac = new ArchiveStreamFactory(); fac.setEntryEncoding(entryEncoding); return fac; @@ -342,14 +342,14 @@ public class ArchiveStreamFactoryTest { } // equals allowing null - private static boolean eq(String exp, String act) { + private static boolean eq(final String exp, final String act) { if (exp == null) { return act == null; } return exp.equals(act); } - private static String getField(Object instance, String name) { + private static String getField(final Object instance, final String name) { Class<?> cls = instance.getClass(); Field fld; try { @@ -383,14 +383,14 @@ public class ArchiveStreamFactoryTest { } } - private ArchiveInputStream getInputStreamFor(String resource, ArchiveStreamFactory factory) + private ArchiveInputStream getInputStreamFor(final String resource, final ArchiveStreamFactory factory) throws IOException, ArchiveException { return factory.createArchiveInputStream( new BufferedInputStream(new FileInputStream( getFile(resource)))); } - private ArchiveInputStream getInputStreamFor(String type, String resource, ArchiveStreamFactory factory) + private ArchiveInputStream getInputStreamFor(final String type, final String resource, final ArchiveStreamFactory factory) throws IOException, ArchiveException { return factory.createArchiveInputStream( type, @@ -398,7 +398,7 @@ public class ArchiveStreamFactoryTest { getFile(resource)))); } - private ArchiveOutputStream getOutputStreamFor(String type, ArchiveStreamFactory factory) + private ArchiveOutputStream getOutputStreamFor(final String type, final ArchiveStreamFactory factory) throws IOException, ArchiveException { return factory.createArchiveOutputStream(type, new ByteArrayOutputStream()); } http://git-wip-us.apache.org/repos/asf/commons-compress/blob/478bef36/src/test/java/org/apache/commons/compress/archivers/LongPathTest.java ---------------------------------------------------------------------- diff --git a/src/test/java/org/apache/commons/compress/archivers/LongPathTest.java b/src/test/java/org/apache/commons/compress/archivers/LongPathTest.java index 212cfb1..b7807dc 100644 --- a/src/test/java/org/apache/commons/compress/archivers/LongPathTest.java +++ b/src/test/java/org/apache/commons/compress/archivers/LongPathTest.java @@ -60,7 +60,7 @@ public class LongPathTest extends AbstractTestCase { private final File file; - public LongPathTest(String file){ + public LongPathTest(final String file){ this.file = new File(ARCDIR, file); } @@ -84,7 +84,7 @@ public class LongPathTest extends AbstractTestCase { Collection<Object[]> params = new ArrayList<Object[]>(); for (String f : ARCDIR.list(new FilenameFilter() { @Override - public boolean accept(File dir, String name) { + public boolean accept(final File dir, final String name) { return !name.endsWith(".txt"); } })) @@ -95,7 +95,7 @@ public class LongPathTest extends AbstractTestCase { } @Override - protected String getExpectedString(ArchiveEntry entry) { + protected String getExpectedString(final ArchiveEntry entry) { if (entry instanceof TarArchiveEntry) { TarArchiveEntry tarEntry = (TarArchiveEntry) entry; if (tarEntry.isSymbolicLink()) { http://git-wip-us.apache.org/repos/asf/commons-compress/blob/478bef36/src/test/java/org/apache/commons/compress/archivers/LongSymLinkTest.java ---------------------------------------------------------------------- diff --git a/src/test/java/org/apache/commons/compress/archivers/LongSymLinkTest.java b/src/test/java/org/apache/commons/compress/archivers/LongSymLinkTest.java index 61bfdea..e1612db 100644 --- a/src/test/java/org/apache/commons/compress/archivers/LongSymLinkTest.java +++ b/src/test/java/org/apache/commons/compress/archivers/LongSymLinkTest.java @@ -60,7 +60,7 @@ public class LongSymLinkTest extends AbstractTestCase { private final File file; - public LongSymLinkTest(String file){ + public LongSymLinkTest(final String file){ this.file = new File(ARCDIR, file); } @@ -84,7 +84,7 @@ public class LongSymLinkTest extends AbstractTestCase { Collection<Object[]> params = new ArrayList<Object[]>(); for (String f : ARCDIR.list(new FilenameFilter() { @Override - public boolean accept(File dir, String name) { + public boolean accept(final File dir, final String name) { return !name.endsWith(".txt"); } })) @@ -96,7 +96,7 @@ public class LongSymLinkTest extends AbstractTestCase { @Override - protected String getExpectedString(ArchiveEntry entry) { + protected String getExpectedString(final ArchiveEntry entry) { if (entry instanceof TarArchiveEntry) { TarArchiveEntry tarEntry = (TarArchiveEntry) entry; if (tarEntry.isSymbolicLink()) { http://git-wip-us.apache.org/repos/asf/commons-compress/blob/478bef36/src/test/java/org/apache/commons/compress/archivers/SevenZTestCase.java ---------------------------------------------------------------------- diff --git a/src/test/java/org/apache/commons/compress/archivers/SevenZTestCase.java b/src/test/java/org/apache/commons/compress/archivers/SevenZTestCase.java index 16bedc1..505be6b 100644 --- a/src/test/java/org/apache/commons/compress/archivers/SevenZTestCase.java +++ b/src/test/java/org/apache/commons/compress/archivers/SevenZTestCase.java @@ -52,7 +52,7 @@ public class SevenZTestCase extends AbstractTestCase { testSevenZArchiveCreation(SevenZMethod.DEFLATE); } - private void testSevenZArchiveCreation(SevenZMethod method) throws Exception { + private void testSevenZArchiveCreation(final SevenZMethod method) throws Exception { final File output = new File(dir, "bla.7z"); final File file1 = getFile("test1.xml"); final File file2 = getFile("test2.xml"); http://git-wip-us.apache.org/repos/asf/commons-compress/blob/478bef36/src/test/java/org/apache/commons/compress/archivers/ZipTestCase.java ---------------------------------------------------------------------- diff --git a/src/test/java/org/apache/commons/compress/archivers/ZipTestCase.java b/src/test/java/org/apache/commons/compress/archivers/ZipTestCase.java index 4c952fb..b87b291 100644 --- a/src/test/java/org/apache/commons/compress/archivers/ZipTestCase.java +++ b/src/test/java/org/apache/commons/compress/archivers/ZipTestCase.java @@ -314,7 +314,7 @@ public final class ZipTestCase extends AbstractTestCase { String second_payload = "AAAAAAAAAAAA"; ZipArchiveEntryPredicate allFilesPredicate = new ZipArchiveEntryPredicate() { @Override - public boolean test(ZipArchiveEntry zipArchiveEntry) { + public boolean test(final ZipArchiveEntry zipArchiveEntry) { return true; } }; @@ -397,7 +397,7 @@ public final class ZipTestCase extends AbstractTestCase { zf1.close(); } - private File createReferenceFile(File directory, Zip64Mode zipMode, String prefix) throws IOException { + private File createReferenceFile(final File directory, final Zip64Mode zipMode, final String prefix) throws IOException { File reference = File.createTempFile(prefix, ".zip", directory); ZipArchiveOutputStream zos = new ZipArchiveOutputStream(reference); zos.setUseZip64(zipMode); @@ -407,18 +407,18 @@ public final class ZipTestCase extends AbstractTestCase { return reference; } - private ZipArchiveOutputStream createFirstEntry(ZipArchiveOutputStream zos) throws IOException { + private ZipArchiveOutputStream createFirstEntry(final ZipArchiveOutputStream zos) throws IOException { createArchiveEntry(first_payload, zos, "file1.txt"); return zos; } - private ZipArchiveOutputStream createSecondEntry(ZipArchiveOutputStream zos) throws IOException { + private ZipArchiveOutputStream createSecondEntry(final ZipArchiveOutputStream zos) throws IOException { createArchiveEntry(second_payload, zos, "file2.txt"); return zos; } - private void assertSameFileContents(File expectedFile, File actualFile) throws IOException { + private void assertSameFileContents(final File expectedFile, final File actualFile) throws IOException { int size = (int) Math.max(expectedFile.length(), actualFile.length()); ZipFile expected = new ZipFile(expectedFile); ZipFile actual = new ZipFile(actualFile); @@ -456,7 +456,7 @@ public final class ZipTestCase extends AbstractTestCase { } - private void createArchiveEntry(String payload, ZipArchiveOutputStream zos, String name) + private void createArchiveEntry(final String payload, final ZipArchiveOutputStream zos, final String name) throws IOException { ZipArchiveEntry in = new ZipArchiveEntry(name); zos.putArchiveEntry(in); http://git-wip-us.apache.org/repos/asf/commons-compress/blob/478bef36/src/test/java/org/apache/commons/compress/archivers/ar/ArArchiveInputStreamTest.java ---------------------------------------------------------------------- diff --git a/src/test/java/org/apache/commons/compress/archivers/ar/ArArchiveInputStreamTest.java b/src/test/java/org/apache/commons/compress/archivers/ar/ArArchiveInputStreamTest.java index d62d3a0..2f6625e 100644 --- a/src/test/java/org/apache/commons/compress/archivers/ar/ArArchiveInputStreamTest.java +++ b/src/test/java/org/apache/commons/compress/archivers/ar/ArArchiveInputStreamTest.java @@ -40,7 +40,7 @@ public class ArArchiveInputStreamTest extends AbstractTestCase { checkLongNameEntry("longfile_bsd.ar"); } - private void checkLongNameEntry(String archive) throws Exception { + private void checkLongNameEntry(final String archive) throws Exception { FileInputStream fis = new FileInputStream(getFile(archive)); ArArchiveInputStream s = null; try { http://git-wip-us.apache.org/repos/asf/commons-compress/blob/478bef36/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 7ed4f11..53320d8 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 @@ -92,7 +92,7 @@ public class SevenZFileTest extends AbstractTestCase { } } - private byte[] readFully(SevenZFile archive) throws IOException { + private byte[] readFully(final SevenZFile archive) throws IOException { byte [] buf = new byte [1024]; ByteArrayOutputStream baos = new ByteArrayOutputStream(); for (int len = 0; (len = archive.read(buf)) > 0;) { @@ -139,7 +139,7 @@ public class SevenZFileTest extends AbstractTestCase { } } - private void test7zUnarchive(File f, SevenZMethod m) throws Exception { + private void test7zUnarchive(final File f, final SevenZMethod m) throws Exception { test7zUnarchive(f, m, null); } @@ -260,7 +260,7 @@ public class SevenZFileTest extends AbstractTestCase { } } - private void test7zUnarchive(File f, SevenZMethod m, byte[] password) throws Exception { + private void test7zUnarchive(final File f, final SevenZMethod m, final byte[] password) throws Exception { SevenZFile sevenZFile = new SevenZFile(f, password); try { SevenZArchiveEntry entry = sevenZFile.getNextEntry(); http://git-wip-us.apache.org/repos/asf/commons-compress/blob/478bef36/src/test/java/org/apache/commons/compress/archivers/sevenz/SevenZOutputFileTest.java ---------------------------------------------------------------------- diff --git a/src/test/java/org/apache/commons/compress/archivers/sevenz/SevenZOutputFileTest.java b/src/test/java/org/apache/commons/compress/archivers/sevenz/SevenZOutputFileTest.java index 9400e7a..3da4b2c 100644 --- a/src/test/java/org/apache/commons/compress/archivers/sevenz/SevenZOutputFileTest.java +++ b/src/test/java/org/apache/commons/compress/archivers/sevenz/SevenZOutputFileTest.java @@ -369,7 +369,7 @@ public class SevenZOutputFileTest extends AbstractTestCase { } } - private void testCompress252(int numberOfFiles, int numberOfNonEmptyFiles) + private void testCompress252(final int numberOfFiles, final int numberOfNonEmptyFiles) throws Exception { int nonEmptyModulus = numberOfNonEmptyFiles != 0 ? numberOfFiles / numberOfNonEmptyFiles @@ -389,7 +389,7 @@ public class SevenZOutputFileTest extends AbstractTestCase { verifyCompress252(output, numberOfFiles, numberOfNonEmptyFiles); } - private void verifyCompress252(File output, int numberOfFiles, int numberOfNonEmptyFiles) + private void verifyCompress252(final File output, final int numberOfFiles, final int numberOfNonEmptyFiles) throws Exception { SevenZFile archive = new SevenZFile(output); int filesFound = 0; @@ -410,25 +410,25 @@ public class SevenZOutputFileTest extends AbstractTestCase { assertEquals(numberOfNonEmptyFiles, nonEmptyFilesFound); } - private void addDir(SevenZOutputFile archive) throws Exception { + private void addDir(final SevenZOutputFile archive) throws Exception { SevenZArchiveEntry entry = archive.createArchiveEntry(dir, "foo/"); archive.putArchiveEntry(entry); archive.closeArchiveEntry(); } - private void verifyDir(SevenZFile archive) throws Exception { + private void verifyDir(final SevenZFile archive) throws Exception { SevenZArchiveEntry entry = archive.getNextEntry(); assertNotNull(entry); assertEquals("foo/", entry.getName()); assertTrue(entry.isDirectory()); } - private void addFile(SevenZOutputFile archive, int index, boolean nonEmpty) + private void addFile(final SevenZOutputFile archive, final int index, final boolean nonEmpty) throws Exception { addFile(archive, index, nonEmpty, null); } - private void addFile(SevenZOutputFile archive, int index, boolean nonEmpty, Iterable<SevenZMethodConfiguration> methods) + private void addFile(final SevenZOutputFile archive, final int index, final boolean nonEmpty, final Iterable<SevenZMethodConfiguration> methods) throws Exception { SevenZArchiveEntry entry = new SevenZArchiveEntry(); entry.setName("foo/" + index + ".txt"); @@ -438,12 +438,12 @@ public class SevenZOutputFileTest extends AbstractTestCase { archive.closeArchiveEntry(); } - private Boolean verifyFile(SevenZFile archive, int index) throws Exception { + private Boolean verifyFile(final SevenZFile archive, final int index) throws Exception { return verifyFile(archive, index, null); } - private Boolean verifyFile(SevenZFile archive, int index, - Iterable<SevenZMethodConfiguration> methods) throws Exception { + private Boolean verifyFile(final SevenZFile archive, final int index, + final Iterable<SevenZMethodConfiguration> methods) throws Exception { SevenZArchiveEntry entry = archive.getNextEntry(); if (entry == null) { return null; @@ -462,14 +462,14 @@ public class SevenZOutputFileTest extends AbstractTestCase { return Boolean.TRUE; } - private void testRoundTrip(SevenZMethod method) throws Exception { + private void testRoundTrip(final SevenZMethod method) throws Exception { output = new File(dir, method + "-roundtrip.7z"); ArrayList<SevenZMethodConfiguration> methods = new ArrayList<SevenZMethodConfiguration>(); methods.add(new SevenZMethodConfiguration(method)); createAndReadBack(output, methods); } - private void testFilterRoundTrip(SevenZMethodConfiguration method) throws Exception { + private void testFilterRoundTrip(final SevenZMethodConfiguration method) throws Exception { output = new File(dir, method.getMethod() + "-roundtrip.7z"); ArrayList<SevenZMethodConfiguration> methods = new ArrayList<SevenZMethodConfiguration>(); methods.add(method); @@ -477,7 +477,7 @@ public class SevenZOutputFileTest extends AbstractTestCase { createAndReadBack(output, methods); } - private void createAndReadBack(File output, Iterable<SevenZMethodConfiguration> methods) throws Exception { + private void createAndReadBack(final File output, final Iterable<SevenZMethodConfiguration> methods) throws Exception { SevenZOutputFile outArchive = new SevenZOutputFile(output); outArchive.setContentMethods(methods); try { @@ -494,8 +494,8 @@ public class SevenZOutputFileTest extends AbstractTestCase { } } - private static void assertContentMethodsEquals(Iterable<? extends SevenZMethodConfiguration> expected, - Iterable<? extends SevenZMethodConfiguration> actual) { + private static void assertContentMethodsEquals(final Iterable<? extends SevenZMethodConfiguration> expected, + final Iterable<? extends SevenZMethodConfiguration> actual) { assertNotNull(actual); Iterator<? extends SevenZMethodConfiguration> expectedIter = expected.iterator(); Iterator<? extends SevenZMethodConfiguration> actualIter = actual.iterator(); http://git-wip-us.apache.org/repos/asf/commons-compress/blob/478bef36/src/test/java/org/apache/commons/compress/archivers/tar/BigFilesIT.java ---------------------------------------------------------------------- diff --git a/src/test/java/org/apache/commons/compress/archivers/tar/BigFilesIT.java b/src/test/java/org/apache/commons/compress/archivers/tar/BigFilesIT.java index b7faf79..e676062 100644 --- a/src/test/java/org/apache/commons/compress/archivers/tar/BigFilesIT.java +++ b/src/test/java/org/apache/commons/compress/archivers/tar/BigFilesIT.java @@ -68,7 +68,7 @@ public class BigFilesIT { } } - private void readFileBiggerThan8GByte(String name) throws Exception { + private void readFileBiggerThan8GByte(final String name) throws Exception { InputStream in = null; GzipCompressorInputStream gzin = null; TarArchiveInputStream tin = null; http://git-wip-us.apache.org/repos/asf/commons-compress/blob/478bef36/src/test/java/org/apache/commons/compress/archivers/tar/SparseFilesTest.java ---------------------------------------------------------------------- diff --git a/src/test/java/org/apache/commons/compress/archivers/tar/SparseFilesTest.java b/src/test/java/org/apache/commons/compress/archivers/tar/SparseFilesTest.java index ad22750..ea70495 100644 --- a/src/test/java/org/apache/commons/compress/archivers/tar/SparseFilesTest.java +++ b/src/test/java/org/apache/commons/compress/archivers/tar/SparseFilesTest.java @@ -63,7 +63,7 @@ public class SparseFilesTest { } } - private void assertPaxGNUEntry(TarArchiveInputStream tin, String suffix) throws Throwable { + private void assertPaxGNUEntry(final TarArchiveInputStream tin, final String suffix) throws Throwable { TarArchiveEntry ae = tin.getNextTarEntry(); assertEquals("sparsefile-" + suffix, ae.getName()); assertTrue(ae.isGNUSparse());