Add final modifier to method parameters. Project: http://git-wip-us.apache.org/repos/asf/commons-compress/repo Commit: http://git-wip-us.apache.org/repos/asf/commons-compress/commit/478bef36 Tree: http://git-wip-us.apache.org/repos/asf/commons-compress/tree/478bef36 Diff: http://git-wip-us.apache.org/repos/asf/commons-compress/diff/478bef36
Branch: refs/heads/COMPRESS-207 Commit: 478bef366f84544eb4ac89553eeb7d57680fc521 Parents: 9cc0604 Author: ggregory <ggreg...@apache.org> Authored: Sat Apr 9 10:06:38 2016 -0700 Committer: ggregory <ggreg...@apache.org> Committed: Sat Apr 9 10:06:38 2016 -0700 ---------------------------------------------------------------------- .../compress/PasswordRequiredException.java | 2 +- .../compress/archivers/ArchiveException.java | 4 +- .../compress/archivers/ArchiveInputStream.java | 8 +- .../compress/archivers/ArchiveOutputStream.java | 8 +- .../archivers/ArchiveStreamFactory.java | 4 +- .../commons/compress/archivers/Lister.java | 2 +- .../StreamingNotSupportedException.java | 2 +- .../compress/archivers/ar/ArArchiveEntry.java | 10 +- .../archivers/ar/ArArchiveInputStream.java | 26 ++--- .../archivers/ar/ArArchiveOutputStream.java | 6 +- .../archivers/arj/ArjArchiveInputStream.java | 8 +- .../archivers/cpio/CpioArchiveEntry.java | 8 +- .../archivers/cpio/CpioArchiveInputStream.java | 10 +- .../archivers/cpio/CpioArchiveOutputStream.java | 8 +- .../compress/archivers/cpio/CpioUtil.java | 2 +- .../commons/compress/archivers/dump/Dirent.java | 2 +- .../archivers/dump/DumpArchiveConstants.java | 8 +- .../archivers/dump/DumpArchiveEntry.java | 54 +++++----- .../archivers/dump/DumpArchiveException.java | 6 +- .../archivers/dump/DumpArchiveInputStream.java | 12 +-- .../archivers/dump/DumpArchiveSummary.java | 26 ++--- .../archivers/dump/DumpArchiveUtil.java | 14 +-- .../archivers/dump/InvalidFormatException.java | 2 +- .../archivers/dump/TapeInputStream.java | 12 +-- ...nsupportedCompressionAlgorithmException.java | 2 +- .../compress/archivers/jar/JarArchiveEntry.java | 8 +- .../archivers/jar/JarArchiveInputStream.java | 2 +- .../archivers/jar/JarArchiveOutputStream.java | 2 +- .../archivers/sevenz/AES256SHA256Decoder.java | 4 +- .../compress/archivers/sevenz/Archive.java | 4 +- .../BoundedRandomAccessFileInputStream.java | 2 +- .../commons/compress/archivers/sevenz/CLI.java | 12 +-- .../compress/archivers/sevenz/CoderBase.java | 10 +- .../compress/archivers/sevenz/Coders.java | 38 +++---- .../compress/archivers/sevenz/DeltaDecoder.java | 10 +- .../compress/archivers/sevenz/Folder.java | 2 +- .../compress/archivers/sevenz/LZMA2Decoder.java | 16 +-- .../archivers/sevenz/SevenZArchiveEntry.java | 46 ++++----- .../compress/archivers/sevenz/SevenZFile.java | 14 +-- .../compress/archivers/sevenz/SevenZMethod.java | 4 +- .../sevenz/SevenZMethodConfiguration.java | 4 +- .../archivers/sevenz/SevenZOutputFile.java | 12 +-- .../compress/archivers/tar/TarArchiveEntry.java | 80 +++++++-------- .../archivers/tar/TarArchiveInputStream.java | 34 +++---- .../archivers/tar/TarArchiveOutputStream.java | 68 ++++++------- .../archivers/tar/TarArchiveSparseEntry.java | 2 +- .../compress/archivers/tar/TarUtils.java | 34 +++---- .../zip/AbstractUnicodeExtraField.java | 14 +-- .../compress/archivers/zip/AsiExtraField.java | 18 ++-- .../compress/archivers/zip/BinaryTree.java | 8 +- .../compress/archivers/zip/BitStream.java | 2 +- .../compress/archivers/zip/CircularBuffer.java | 6 +- .../archivers/zip/ExplodingInputStream.java | 2 +- .../compress/archivers/zip/ExtraFieldUtils.java | 18 ++-- .../archivers/zip/FallbackZipEncoding.java | 8 +- .../archivers/zip/GeneralPurposeBit.java | 12 +-- .../compress/archivers/zip/JarMarker.java | 6 +- .../compress/archivers/zip/NioZipEncoding.java | 8 +- .../archivers/zip/PKWareExtraHeader.java | 18 ++-- .../zip/ParallelScatterZipCreator.java | 14 +-- .../archivers/zip/ScatterStatistics.java | 2 +- .../archivers/zip/ScatterZipOutputStream.java | 14 +-- .../archivers/zip/Simple8BitZipEncoding.java | 22 ++-- .../archivers/zip/StreamCompressor.java | 34 +++---- .../archivers/zip/UnicodeCommentExtraField.java | 6 +- .../archivers/zip/UnicodePathExtraField.java | 4 +- .../zip/UnparseableExtraFieldData.java | 6 +- .../archivers/zip/UnrecognizedExtraField.java | 12 +-- .../archivers/zip/UnshrinkingInputStream.java | 4 +- .../zip/UnsupportedZipFeatureException.java | 12 +-- .../compress/archivers/zip/X000A_NTFS.java | 22 ++-- .../zip/X0015_CertificateIdForFile.java | 2 +- .../X0016_CertificateIdForCentralDirectory.java | 2 +- .../zip/X0017_StrongEncryptionHeader.java | 8 +- .../archivers/zip/X5455_ExtendedTimestamp.java | 20 ++-- .../compress/archivers/zip/X7875_NewUnix.java | 12 +-- .../zip/Zip64ExtendedInformationExtraField.java | 36 +++---- .../archivers/zip/Zip64RequiredException.java | 4 +- .../compress/archivers/zip/ZipArchiveEntry.java | 54 +++++----- .../archivers/zip/ZipArchiveEntryRequest.java | 4 +- .../archivers/zip/ZipArchiveInputStream.java | 48 ++++----- .../archivers/zip/ZipArchiveOutputStream.java | 102 +++++++++---------- .../archivers/zip/ZipEightByteInteger.java | 22 ++-- .../archivers/zip/ZipEncodingHelper.java | 8 +- .../commons/compress/archivers/zip/ZipFile.java | 56 +++++----- .../commons/compress/archivers/zip/ZipLong.java | 18 ++-- .../compress/archivers/zip/ZipMethod.java | 4 +- .../compress/archivers/zip/ZipShort.java | 16 +-- .../commons/compress/archivers/zip/ZipUtil.java | 42 ++++---- .../apache/commons/compress/changes/Change.java | 4 +- .../commons/compress/changes/ChangeSet.java | 4 +- .../compress/changes/ChangeSetPerformer.java | 18 ++-- .../compress/changes/ChangeSetResults.java | 8 +- .../compressors/CompressorException.java | 4 +- .../compressors/CompressorInputStream.java | 6 +- .../compressors/CompressorStreamFactory.java | 4 +- .../compress/compressors/FileNameUtil.java | 10 +- .../bzip2/BZip2CompressorInputStream.java | 8 +- .../bzip2/BZip2CompressorOutputStream.java | 4 +- .../compress/compressors/bzip2/BZip2Utils.java | 6 +- .../compress/compressors/bzip2/BlockSort.java | 32 +++--- .../commons/compress/compressors/bzip2/CRC.java | 6 +- .../compress/compressors/bzip2/Rand.java | 2 +- .../deflate/DeflateCompressorInputStream.java | 12 +-- .../deflate/DeflateCompressorOutputStream.java | 10 +- .../compressors/deflate/DeflateParameters.java | 4 +- .../gzip/GzipCompressorInputStream.java | 16 +-- .../gzip/GzipCompressorOutputStream.java | 12 +-- .../compressors/gzip/GzipParameters.java | 10 +- .../compress/compressors/gzip/GzipUtils.java | 6 +- .../lzma/LZMACompressorInputStream.java | 8 +- .../compress/compressors/lzma/LZMAUtils.java | 10 +- .../compressors/lzw/LZWInputStream.java | 20 ++-- .../pack200/Pack200CompressorInputStream.java | 10 +- .../pack200/Pack200CompressorOutputStream.java | 6 +- .../compressors/pack200/Pack200Utils.java | 8 +- .../compressors/pack200/StreamBridge.java | 2 +- .../FramedSnappyCompressorInputStream.java | 8 +- .../compressors/snappy/PureJavaCrc32C.java | 4 +- .../snappy/SnappyCompressorInputStream.java | 8 +- .../compressors/xz/XZCompressorInputStream.java | 12 +-- .../xz/XZCompressorOutputStream.java | 8 +- .../compress/compressors/xz/XZUtils.java | 10 +- .../compressors/z/ZCompressorInputStream.java | 6 +- .../FileBasedScatterGatherBackingStore.java | 4 +- .../commons/compress/utils/ArchiveUtils.java | 16 +-- .../compress/utils/BoundedInputStream.java | 2 +- .../apache/commons/compress/utils/Charsets.java | 4 +- .../utils/ChecksumVerifyingInputStream.java | 6 +- .../compress/utils/CountingInputStream.java | 6 +- .../compress/utils/CountingOutputStream.java | 8 +- .../apache/commons/compress/utils/IOUtils.java | 10 +- .../commons/compress/AbstractTestCase.java | 26 ++--- .../commons/compress/ArchiveReadTest.java | 6 +- .../commons/compress/ArchiveUtilsTest.java | 4 +- .../compress/DetectArchiverTestCase.java | 4 +- .../apache/commons/compress/IOMethodsTest.java | 4 +- .../archivers/ArchiveOutputStreamTest.java | 2 +- .../archivers/ArchiveStreamFactoryTest.java | 14 +-- .../compress/archivers/LongPathTest.java | 6 +- .../compress/archivers/LongSymLinkTest.java | 6 +- .../compress/archivers/SevenZTestCase.java | 2 +- .../commons/compress/archivers/ZipTestCase.java | 12 +-- .../archivers/ar/ArArchiveInputStreamTest.java | 2 +- .../archivers/sevenz/SevenZFileTest.java | 6 +- .../archivers/sevenz/SevenZOutputFileTest.java | 28 ++--- .../compress/archivers/tar/BigFilesIT.java | 2 +- .../compress/archivers/tar/SparseFilesTest.java | 2 +- .../archivers/tar/TarArchiveEntryTest.java | 6 +- .../tar/TarArchiveInputStreamTest.java | 4 +- .../tar/TarArchiveOutputStreamTest.java | 10 +- .../compress/archivers/tar/TarLister.java | 4 +- .../compress/archivers/tar/TarUtilsTest.java | 4 +- .../archivers/zip/ExplodeSupportTest.java | 4 +- .../commons/compress/archivers/zip/Lister.java | 10 +- .../zip/ParallelScatterZipCreatorTest.java | 8 +- .../compress/archivers/zip/ScatterSample.java | 4 +- .../archivers/zip/ScatterSampleTest.java | 4 +- .../archivers/zip/UTF8ZipFilesTest.java | 24 ++--- .../zip/X5455_ExtendedTimestampTest.java | 4 +- .../archivers/zip/X7875_NewUnixTest.java | 2 +- .../Zip64ExtendedInformationExtraFieldTest.java | 6 +- .../compress/archivers/zip/Zip64SupportIT.java | 74 +++++++------- .../compress/archivers/zip/ZipEncodingTest.java | 4 +- .../compress/archivers/zip/ZipFileTest.java | 6 +- .../compress/changes/ChangeSetTestCase.java | 4 +- .../compressors/DetectCompressorTestCase.java | 6 +- .../compressors/FramedSnappyTestCase.java | 8 +- .../compress/compressors/GZipTestCase.java | 2 +- .../compress/compressors/LZMATestCase.java | 2 +- .../compress/compressors/Pack200TestCase.java | 4 +- .../commons/compress/compressors/ZTestCase.java | 8 +- .../compressors/bzip2/BlockSortTest.java | 12 +-- .../bzip2/PythonTruncatedBzip2Test.java | 4 +- .../FramedSnappyCompressorInputStreamTest.java | 4 +- .../commons/compress/utils/IOUtilsTest.java | 10 +- 176 files changed, 1057 insertions(+), 1057 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/commons-compress/blob/478bef36/src/main/java/org/apache/commons/compress/PasswordRequiredException.java ---------------------------------------------------------------------- diff --git a/src/main/java/org/apache/commons/compress/PasswordRequiredException.java b/src/main/java/org/apache/commons/compress/PasswordRequiredException.java index 2be6f22..d876b96 100644 --- a/src/main/java/org/apache/commons/compress/PasswordRequiredException.java +++ b/src/main/java/org/apache/commons/compress/PasswordRequiredException.java @@ -34,7 +34,7 @@ public class PasswordRequiredException extends IOException { * @param name name of the archive containing encrypted streams or * the encrypted file. */ - public PasswordRequiredException(String name) { + public PasswordRequiredException(final String name) { super("Cannot read encrypted content from " + name + " without a password."); } } http://git-wip-us.apache.org/repos/asf/commons-compress/blob/478bef36/src/main/java/org/apache/commons/compress/archivers/ArchiveException.java ---------------------------------------------------------------------- diff --git a/src/main/java/org/apache/commons/compress/archivers/ArchiveException.java b/src/main/java/org/apache/commons/compress/archivers/ArchiveException.java index 0c2fce3..4732345 100644 --- a/src/main/java/org/apache/commons/compress/archivers/ArchiveException.java +++ b/src/main/java/org/apache/commons/compress/archivers/ArchiveException.java @@ -33,7 +33,7 @@ public class ArchiveException extends Exception { * @param message * the detail message */ - public ArchiveException(String message) { + public ArchiveException(final String message) { super(message); } @@ -45,7 +45,7 @@ public class ArchiveException extends Exception { * @param cause * the cause */ - public ArchiveException(String message, Exception cause) { + public ArchiveException(final String message, final Exception cause) { super(message); this.initCause(cause); } http://git-wip-us.apache.org/repos/asf/commons-compress/blob/478bef36/src/main/java/org/apache/commons/compress/archivers/ArchiveInputStream.java ---------------------------------------------------------------------- diff --git a/src/main/java/org/apache/commons/compress/archivers/ArchiveInputStream.java b/src/main/java/org/apache/commons/compress/archivers/ArchiveInputStream.java index 4d54c2d..2cd85c7 100644 --- a/src/main/java/org/apache/commons/compress/archivers/ArchiveInputStream.java +++ b/src/main/java/org/apache/commons/compress/archivers/ArchiveInputStream.java @@ -88,7 +88,7 @@ public abstract class ArchiveInputStream extends InputStream { * * @param read the number of bytes read */ - protected void count(int read) { + protected void count(final int read) { count((long) read); } @@ -99,7 +99,7 @@ public abstract class ArchiveInputStream extends InputStream { * @param read the number of bytes read * @since 1.1 */ - protected void count(long read) { + protected void count(final long read) { if (read != -1) { bytesRead = bytesRead + read; } @@ -111,7 +111,7 @@ public abstract class ArchiveInputStream extends InputStream { * @param pushedBack the number of bytes pushed back. * @since 1.1 */ - protected void pushedBackBytes(long pushedBack) { + protected void pushedBackBytes(final long pushedBack) { bytesRead -= pushedBack; } @@ -148,7 +148,7 @@ public abstract class ArchiveInputStream extends InputStream { * * @since 1.1 */ - public boolean canReadEntryData(ArchiveEntry archiveEntry) { + public boolean canReadEntryData(final ArchiveEntry archiveEntry) { return true; } http://git-wip-us.apache.org/repos/asf/commons-compress/blob/478bef36/src/main/java/org/apache/commons/compress/archivers/ArchiveOutputStream.java ---------------------------------------------------------------------- diff --git a/src/main/java/org/apache/commons/compress/archivers/ArchiveOutputStream.java b/src/main/java/org/apache/commons/compress/archivers/ArchiveOutputStream.java index e2d325f..9ca9a83 100644 --- a/src/main/java/org/apache/commons/compress/archivers/ArchiveOutputStream.java +++ b/src/main/java/org/apache/commons/compress/archivers/ArchiveOutputStream.java @@ -104,7 +104,7 @@ public abstract class ArchiveOutputStream extends OutputStream { * @throws IOException on error */ @Override - public void write(int b) throws IOException { + public void write(final int b) throws IOException { oneByte[0] = (byte) (b & BYTE_MASK); write(oneByte, 0, 1); } @@ -115,7 +115,7 @@ public abstract class ArchiveOutputStream extends OutputStream { * * @param written the number of bytes written */ - protected void count(int written) { + protected void count(final int written) { count((long) written); } @@ -126,7 +126,7 @@ public abstract class ArchiveOutputStream extends OutputStream { * @param written the number of bytes written * @since 1.1 */ - protected void count(long written) { + protected void count(final long written) { if (written != -1) { bytesWritten = bytesWritten + written; } @@ -163,7 +163,7 @@ public abstract class ArchiveOutputStream extends OutputStream { * @return This implementation always returns true. * @since 1.1 */ - public boolean canWriteEntryData(ArchiveEntry archiveEntry) { + public boolean canWriteEntryData(final ArchiveEntry archiveEntry) { return true; } } http://git-wip-us.apache.org/repos/asf/commons-compress/blob/478bef36/src/main/java/org/apache/commons/compress/archivers/ArchiveStreamFactory.java ---------------------------------------------------------------------- diff --git a/src/main/java/org/apache/commons/compress/archivers/ArchiveStreamFactory.java b/src/main/java/org/apache/commons/compress/archivers/ArchiveStreamFactory.java index b69cada..d5370c4 100644 --- a/src/main/java/org/apache/commons/compress/archivers/ArchiveStreamFactory.java +++ b/src/main/java/org/apache/commons/compress/archivers/ArchiveStreamFactory.java @@ -143,7 +143,7 @@ public class ArchiveStreamFactory { * * @since 1.10 */ - public ArchiveStreamFactory(String encoding) { + public ArchiveStreamFactory(final String encoding) { super(); this.encoding = encoding; // Also set the original field so can continue to use it. @@ -171,7 +171,7 @@ public class ArchiveStreamFactory { * was used to specify the factory encoding. */ @Deprecated - public void setEntryEncoding(String entryEncoding) { + public void setEntryEncoding(final String entryEncoding) { // Note: this does not detect new ArchiveStreamFactory(null) but that does not set the encoding anyway if (encoding != null) { throw new IllegalStateException("Cannot overide encoding set by the constructor"); http://git-wip-us.apache.org/repos/asf/commons-compress/blob/478bef36/src/main/java/org/apache/commons/compress/archivers/Lister.java ---------------------------------------------------------------------- diff --git a/src/main/java/org/apache/commons/compress/archivers/Lister.java b/src/main/java/org/apache/commons/compress/archivers/Lister.java index f2eaeb9..8de2ac9 100644 --- a/src/main/java/org/apache/commons/compress/archivers/Lister.java +++ b/src/main/java/org/apache/commons/compress/archivers/Lister.java @@ -34,7 +34,7 @@ import java.io.InputStream; public final class Lister { private static final ArchiveStreamFactory factory = new ArchiveStreamFactory(); - public static void main(String[] args) throws Exception { + public static void main(final String[] args) throws Exception { if (args.length == 0) { usage(); return; http://git-wip-us.apache.org/repos/asf/commons-compress/blob/478bef36/src/main/java/org/apache/commons/compress/archivers/StreamingNotSupportedException.java ---------------------------------------------------------------------- diff --git a/src/main/java/org/apache/commons/compress/archivers/StreamingNotSupportedException.java b/src/main/java/org/apache/commons/compress/archivers/StreamingNotSupportedException.java index 6fd11fd..eff0183 100644 --- a/src/main/java/org/apache/commons/compress/archivers/StreamingNotSupportedException.java +++ b/src/main/java/org/apache/commons/compress/archivers/StreamingNotSupportedException.java @@ -34,7 +34,7 @@ public class StreamingNotSupportedException extends ArchiveException { * * @param format the format that has been requested/detected. */ - public StreamingNotSupportedException(String format) { + public StreamingNotSupportedException(final String format) { super("The " + format + " doesn't support streaming."); this.format = format; } http://git-wip-us.apache.org/repos/asf/commons-compress/blob/478bef36/src/main/java/org/apache/commons/compress/archivers/ar/ArArchiveEntry.java ---------------------------------------------------------------------- diff --git a/src/main/java/org/apache/commons/compress/archivers/ar/ArArchiveEntry.java b/src/main/java/org/apache/commons/compress/archivers/ar/ArArchiveEntry.java index 36a8b40..c7d6f8e 100644 --- a/src/main/java/org/apache/commons/compress/archivers/ar/ArArchiveEntry.java +++ b/src/main/java/org/apache/commons/compress/archivers/ar/ArArchiveEntry.java @@ -81,7 +81,7 @@ public class ArArchiveEntry implements ArchiveEntry { * @param name name of the entry * @param length length of the entry in bytes */ - public ArArchiveEntry(String name, long length) { + public ArArchiveEntry(final String name, final long length) { this(name, length, 0, 0, DEFAULT_MODE, System.currentTimeMillis() / 1000); } @@ -96,8 +96,8 @@ public class ArArchiveEntry implements ArchiveEntry { * @param mode file mode * @param lastModified last modified time in seconds since the epoch */ - public ArArchiveEntry(String name, long length, int userId, int groupId, - int mode, long lastModified) { + public ArArchiveEntry(final String name, final long length, final int userId, final int groupId, + final int mode, final long lastModified) { this.name = name; this.length = length; this.userId = userId; @@ -111,7 +111,7 @@ public class ArArchiveEntry implements ArchiveEntry { * @param inputFile the file to create an entry from * @param entryName the name of the entry */ - public ArArchiveEntry(File inputFile, String entryName) { + public ArArchiveEntry(final File inputFile, final String entryName) { // TODO sort out mode this(entryName, inputFile.isFile() ? inputFile.length() : 0, 0, 0, DEFAULT_MODE, inputFile.lastModified() / 1000); @@ -170,7 +170,7 @@ public class ArArchiveEntry implements ArchiveEntry { } @Override - public boolean equals(Object obj) { + public boolean equals(final Object obj) { if (this == obj) { return true; } http://git-wip-us.apache.org/repos/asf/commons-compress/blob/478bef36/src/main/java/org/apache/commons/compress/archivers/ar/ArArchiveInputStream.java ---------------------------------------------------------------------- diff --git a/src/main/java/org/apache/commons/compress/archivers/ar/ArArchiveInputStream.java b/src/main/java/org/apache/commons/compress/archivers/ar/ArArchiveInputStream.java index 6298bc3..665112c 100644 --- a/src/main/java/org/apache/commons/compress/archivers/ar/ArArchiveInputStream.java +++ b/src/main/java/org/apache/commons/compress/archivers/ar/ArArchiveInputStream.java @@ -172,7 +172,7 @@ public class ArArchiveInputStream extends ArchiveInputStream { * @return the extended file name; without trailing "/" if present. * @throws IOException if name not found or buffer not set up */ - private String getExtendedName(int offset) throws IOException{ + private String getExtendedName(final int offset) throws IOException{ if (namebuffer == null) { throw new IOException("Cannot process GNU long filename as no // record was found"); } @@ -186,23 +186,23 @@ public class ArArchiveInputStream extends ArchiveInputStream { } throw new IOException("Failed to read entry: "+offset); } - private long asLong(byte[] input) { + private long asLong(final byte[] input) { return Long.parseLong(ArchiveUtils.toAsciiString(input).trim()); } - private int asInt(byte[] input) { + private int asInt(final byte[] input) { return asInt(input, 10, false); } - private int asInt(byte[] input, boolean treatBlankAsZero) { + private int asInt(final byte[] input, final boolean treatBlankAsZero) { return asInt(input, 10, treatBlankAsZero); } - private int asInt(byte[] input, int base) { + private int asInt(final byte[] input, final int base) { return asInt(input, base, false); } - private int asInt(byte[] input, int base, boolean treatBlankAsZero) { + private int asInt(final byte[] input, final int base, final boolean treatBlankAsZero) { String string = ArchiveUtils.toAsciiString(input).trim(); if (string.length() == 0 && treatBlankAsZero) { return 0; @@ -241,7 +241,7 @@ public class ArArchiveInputStream extends ArchiveInputStream { * @see java.io.InputStream#read(byte[], int, int) */ @Override - public int read(byte[] b, final int off, final int len) throws IOException { + public int read(final byte[] b, final int off, final int len) throws IOException { int toRead = len; if (currentEntry != null) { final long entryEnd = entryOffset + currentEntry.getLength(); @@ -267,7 +267,7 @@ public class ArArchiveInputStream extends ArchiveInputStream { * the number of bytes to check * @return true, if this stream is an Ar archive stream, false otherwise */ - public static boolean matches(byte[] signature, int length) { + public static boolean matches(final byte[] signature, final int length) { // 3c21 7261 6863 0a3e if (length < 8) { @@ -329,7 +329,7 @@ public class ArArchiveInputStream extends ArchiveInputStream { * * @since 1.3 */ - private static boolean isBSDLongName(String name) { + private static boolean isBSDLongName(final String name) { return name != null && name.matches(BSD_LONGNAME_PATTERN); } @@ -341,7 +341,7 @@ public class ArArchiveInputStream extends ArchiveInputStream { * * @since 1.3 */ - private String getBSDLongName(String bsdLongName) throws IOException { + private String getBSDLongName(final String bsdLongName) throws IOException { int nameLen = Integer.parseInt(bsdLongName.substring(BSD_LONGNAME_PREFIX_LEN)); byte[] name = new byte[nameLen]; @@ -371,7 +371,7 @@ public class ArArchiveInputStream extends ArchiveInputStream { * characters. Note that the decimal offsets are number of * characters, not line or string number within the "//" file.</p> */ - private static boolean isGNUStringTable(String name) { + private static boolean isGNUStringTable(final String name) { return GNU_STRING_TABLE_NAME.equals(name); } @@ -380,7 +380,7 @@ public class ArArchiveInputStream extends ArchiveInputStream { * * @see #isGNUStringTable */ - private ArArchiveEntry readGNUStringTable(byte[] length) throws IOException { + private ArArchiveEntry readGNUStringTable(final byte[] length) throws IOException { int bufflen = asInt(length); // Assume length will fit in an int namebuffer = new byte[bufflen]; int read = IOUtils.readFully(this, namebuffer, 0, bufflen); @@ -399,7 +399,7 @@ public class ArArchiveInputStream extends ArchiveInputStream { * * @see #isGNUStringTable */ - private boolean isGNULongName(String name) { + private boolean isGNULongName(final String name) { return name != null && name.matches(GNU_LONGNAME_PATTERN); } } http://git-wip-us.apache.org/repos/asf/commons-compress/blob/478bef36/src/main/java/org/apache/commons/compress/archivers/ar/ArArchiveOutputStream.java ---------------------------------------------------------------------- diff --git a/src/main/java/org/apache/commons/compress/archivers/ar/ArArchiveOutputStream.java b/src/main/java/org/apache/commons/compress/archivers/ar/ArArchiveOutputStream.java index 3a869c4..00583a6 100644 --- a/src/main/java/org/apache/commons/compress/archivers/ar/ArArchiveOutputStream.java +++ b/src/main/java/org/apache/commons/compress/archivers/ar/ArArchiveOutputStream.java @@ -59,7 +59,7 @@ public class ArArchiveOutputStream extends ArchiveOutputStream { * @param longFileMode the mode to use * @since 1.3 */ - public void setLongFileMode(int longFileMode) { + public void setLongFileMode(final int longFileMode) { this.longFileMode = longFileMode; } @@ -195,7 +195,7 @@ public class ArArchiveOutputStream extends ArchiveOutputStream { } @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); entryOffset += len; @@ -214,7 +214,7 @@ public class ArArchiveOutputStream extends ArchiveOutputStream { } @Override - public ArchiveEntry createArchiveEntry(File inputFile, String entryName) + public ArchiveEntry createArchiveEntry(final File inputFile, final String entryName) throws IOException { if(finished) { throw new IOException("Stream has already been finished"); http://git-wip-us.apache.org/repos/asf/commons-compress/blob/478bef36/src/main/java/org/apache/commons/compress/archivers/arj/ArjArchiveInputStream.java ---------------------------------------------------------------------- diff --git a/src/main/java/org/apache/commons/compress/archivers/arj/ArjArchiveInputStream.java b/src/main/java/org/apache/commons/compress/archivers/arj/ArjArchiveInputStream.java index f049299..db72a98 100644 --- a/src/main/java/org/apache/commons/compress/archivers/arj/ArjArchiveInputStream.java +++ b/src/main/java/org/apache/commons/compress/archivers/arj/ArjArchiveInputStream.java @@ -119,7 +119,7 @@ public class ArjArchiveInputStream extends ArchiveInputStream { return new String(buffer.toByteArray()); } - private void readFully(final DataInputStream dataIn, byte[] b) + private void readFully(final DataInputStream dataIn, final byte[] b) throws IOException { dataIn.readFully(b); count(b.length); @@ -266,8 +266,8 @@ public class ArjArchiveInputStream extends ArchiveInputStream { return localFileHeader; } - private void readExtraData(int firstHeaderSize, DataInputStream firstHeader, - LocalFileHeader localFileHeader) throws IOException { + private void readExtraData(final int firstHeaderSize, final DataInputStream firstHeader, + final LocalFileHeader localFileHeader) throws IOException { if (firstHeaderSize >= 33) { localFileHeader.extendedFilePosition = read32(firstHeader); if (firstHeaderSize >= 45) { @@ -335,7 +335,7 @@ public class ArjArchiveInputStream extends ArchiveInputStream { } @Override - public boolean canReadEntryData(ArchiveEntry ae) { + public boolean canReadEntryData(final ArchiveEntry ae) { return ae instanceof ArjArchiveEntry && ((ArjArchiveEntry) ae).getMethod() == LocalFileHeader.Methods.STORED; } http://git-wip-us.apache.org/repos/asf/commons-compress/blob/478bef36/src/main/java/org/apache/commons/compress/archivers/cpio/CpioArchiveEntry.java ---------------------------------------------------------------------- diff --git a/src/main/java/org/apache/commons/compress/archivers/cpio/CpioArchiveEntry.java b/src/main/java/org/apache/commons/compress/archivers/cpio/CpioArchiveEntry.java index 10d40d2..2b0aa7c 100644 --- a/src/main/java/org/apache/commons/compress/archivers/cpio/CpioArchiveEntry.java +++ b/src/main/java/org/apache/commons/compress/archivers/cpio/CpioArchiveEntry.java @@ -309,7 +309,7 @@ public class CpioArchiveEntry implements CpioConstants, ArchiveEntry { * @param entryName * The name of this entry. */ - public CpioArchiveEntry(File inputFile, String entryName) { + public CpioArchiveEntry(final File inputFile, final String entryName) { this(FORMAT_NEW, inputFile, entryName); } @@ -334,8 +334,8 @@ public class CpioArchiveEntry implements CpioConstants, ArchiveEntry { * * @since 1.1 */ - public CpioArchiveEntry(final short format, File inputFile, - String entryName) { + public CpioArchiveEntry(final short format, final File inputFile, + final String entryName) { this(format, entryName, inputFile.isFile() ? inputFile.length() : 0); if (inputFile.isDirectory()){ setMode(C_ISDIR); @@ -877,7 +877,7 @@ public class CpioArchiveEntry implements CpioConstants, ArchiveEntry { * @see java.lang.Object#equals(java.lang.Object) */ @Override - public boolean equals(Object obj) { + public boolean equals(final Object obj) { if (this == obj) { return true; } http://git-wip-us.apache.org/repos/asf/commons-compress/blob/478bef36/src/main/java/org/apache/commons/compress/archivers/cpio/CpioArchiveInputStream.java ---------------------------------------------------------------------- diff --git a/src/main/java/org/apache/commons/compress/archivers/cpio/CpioArchiveInputStream.java b/src/main/java/org/apache/commons/compress/archivers/cpio/CpioArchiveInputStream.java index 6a9ae98..afc91bb 100644 --- a/src/main/java/org/apache/commons/compress/archivers/cpio/CpioArchiveInputStream.java +++ b/src/main/java/org/apache/commons/compress/archivers/cpio/CpioArchiveInputStream.java @@ -119,7 +119,7 @@ public class CpioArchiveInputStream extends ArchiveInputStream implements * the platform's default. * @since 1.6 */ - public CpioArchiveInputStream(final InputStream in, String encoding) { + public CpioArchiveInputStream(final InputStream in, final String encoding) { this(in, BLOCK_SIZE, encoding); } @@ -134,7 +134,7 @@ public class CpioArchiveInputStream extends ArchiveInputStream implements * The block size of the archive. * @since 1.5 */ - public CpioArchiveInputStream(final InputStream in, int blockSize) { + public CpioArchiveInputStream(final InputStream in, final int blockSize) { this(in, blockSize, CharsetNames.US_ASCII); } @@ -150,7 +150,7 @@ public class CpioArchiveInputStream extends ArchiveInputStream implements * the platform's default. * @since 1.6 */ - public CpioArchiveInputStream(final InputStream in, int blockSize, String encoding) { + public CpioArchiveInputStream(final InputStream in, final int blockSize, final String encoding) { this.in = in; this.blockSize = blockSize; this.encoding = encoding; @@ -269,7 +269,7 @@ public class CpioArchiveInputStream extends ArchiveInputStream implements return this.entry; } - private void skip(int bytes) throws IOException{ + private void skip(final int bytes) throws IOException{ // bytes cannot be more than 3 bytes if (bytes > 0) { readFully(FOUR_BYTES_BUF, 0, bytes); @@ -523,7 +523,7 @@ public class CpioArchiveInputStream extends ArchiveInputStream implements * @param length length of data * @return whether the buffer seems to contain CPIO data */ - public static boolean matches(byte[] signature, int length) { + public static boolean matches(final byte[] signature, final int length) { if (length < 6) { return false; } http://git-wip-us.apache.org/repos/asf/commons-compress/blob/478bef36/src/main/java/org/apache/commons/compress/archivers/cpio/CpioArchiveOutputStream.java ---------------------------------------------------------------------- diff --git a/src/main/java/org/apache/commons/compress/archivers/cpio/CpioArchiveOutputStream.java b/src/main/java/org/apache/commons/compress/archivers/cpio/CpioArchiveOutputStream.java index fc829ff..13d4270 100644 --- a/src/main/java/org/apache/commons/compress/archivers/cpio/CpioArchiveOutputStream.java +++ b/src/main/java/org/apache/commons/compress/archivers/cpio/CpioArchiveOutputStream.java @@ -186,7 +186,7 @@ public class CpioArchiveOutputStream extends ArchiveOutputStream implements * the platform's default. * @since 1.6 */ - public CpioArchiveOutputStream(final OutputStream out, String encoding) { + public CpioArchiveOutputStream(final OutputStream out, final String encoding) { this(out, FORMAT_NEW, BLOCK_SIZE, encoding); } @@ -217,7 +217,7 @@ public class CpioArchiveOutputStream extends ArchiveOutputStream implements * @throws ClassCastException if entry is not an instance of CpioArchiveEntry */ @Override - public void putArchiveEntry(ArchiveEntry entry) throws IOException { + public void putArchiveEntry(final ArchiveEntry entry) throws IOException { if(finished) { throw new IOException("Stream has already been finished"); } @@ -491,7 +491,7 @@ public class CpioArchiveOutputStream extends ArchiveOutputStream implements } } - private void pad(int count) throws IOException{ + private void pad(final int count) throws IOException{ if (count > 0){ byte buff[] = new byte[count]; out.write(buff); @@ -551,7 +551,7 @@ public class CpioArchiveOutputStream extends ArchiveOutputStream implements * @see org.apache.commons.compress.archivers.ArchiveOutputStream#createArchiveEntry(java.io.File, java.lang.String) */ @Override - public ArchiveEntry createArchiveEntry(File inputFile, String entryName) + public ArchiveEntry createArchiveEntry(final File inputFile, final String entryName) throws IOException { if(finished) { throw new IOException("Stream has already been finished"); http://git-wip-us.apache.org/repos/asf/commons-compress/blob/478bef36/src/main/java/org/apache/commons/compress/archivers/cpio/CpioUtil.java ---------------------------------------------------------------------- diff --git a/src/main/java/org/apache/commons/compress/archivers/cpio/CpioUtil.java b/src/main/java/org/apache/commons/compress/archivers/cpio/CpioUtil.java index 26b51fc..efc1584 100644 --- a/src/main/java/org/apache/commons/compress/archivers/cpio/CpioUtil.java +++ b/src/main/java/org/apache/commons/compress/archivers/cpio/CpioUtil.java @@ -28,7 +28,7 @@ class CpioUtil { /** * Extracts the file type bits from a mode. */ - static long fileType(long mode) { + static long fileType(final long mode) { return mode & CpioConstants.S_IFMT; } http://git-wip-us.apache.org/repos/asf/commons-compress/blob/478bef36/src/main/java/org/apache/commons/compress/archivers/dump/Dirent.java ---------------------------------------------------------------------- diff --git a/src/main/java/org/apache/commons/compress/archivers/dump/Dirent.java b/src/main/java/org/apache/commons/compress/archivers/dump/Dirent.java index 7979b1d..ff9b53f 100644 --- a/src/main/java/org/apache/commons/compress/archivers/dump/Dirent.java +++ b/src/main/java/org/apache/commons/compress/archivers/dump/Dirent.java @@ -35,7 +35,7 @@ class Dirent { * @param type * @param name */ - Dirent(int ino, int parentIno, int type, String name) { + Dirent(final int ino, final int parentIno, final int type, final String name) { this.ino = ino; this.parentIno = parentIno; this.type = type; http://git-wip-us.apache.org/repos/asf/commons-compress/blob/478bef36/src/main/java/org/apache/commons/compress/archivers/dump/DumpArchiveConstants.java ---------------------------------------------------------------------- diff --git a/src/main/java/org/apache/commons/compress/archivers/dump/DumpArchiveConstants.java b/src/main/java/org/apache/commons/compress/archivers/dump/DumpArchiveConstants.java index 87ca8d9..15738e5 100644 --- a/src/main/java/org/apache/commons/compress/archivers/dump/DumpArchiveConstants.java +++ b/src/main/java/org/apache/commons/compress/archivers/dump/DumpArchiveConstants.java @@ -49,11 +49,11 @@ public final class DumpArchiveConstants { int code; - private SEGMENT_TYPE(int code) { + private SEGMENT_TYPE(final int code) { this.code = code; } - public static SEGMENT_TYPE find(int code) { + public static SEGMENT_TYPE find(final int code) { for (SEGMENT_TYPE t : values()) { if (t.code == code) { return t; @@ -74,11 +74,11 @@ public final class DumpArchiveConstants { int code; - private COMPRESSION_TYPE(int code) { + private COMPRESSION_TYPE(final int code) { this.code = code; } - public static COMPRESSION_TYPE find(int code) { + public static COMPRESSION_TYPE find(final int code) { for (COMPRESSION_TYPE t : values()) { if (t.code == code) { return t; http://git-wip-us.apache.org/repos/asf/commons-compress/blob/478bef36/src/main/java/org/apache/commons/compress/archivers/dump/DumpArchiveEntry.java ---------------------------------------------------------------------- diff --git a/src/main/java/org/apache/commons/compress/archivers/dump/DumpArchiveEntry.java b/src/main/java/org/apache/commons/compress/archivers/dump/DumpArchiveEntry.java index 0a3d546..43fecde 100644 --- a/src/main/java/org/apache/commons/compress/archivers/dump/DumpArchiveEntry.java +++ b/src/main/java/org/apache/commons/compress/archivers/dump/DumpArchiveEntry.java @@ -219,7 +219,7 @@ public class DumpArchiveEntry implements ArchiveEntry { * @param name pathname * @param simpleName actual filename. */ - public DumpArchiveEntry(String name, String simpleName) { + public DumpArchiveEntry(final String name, final String simpleName) { setName(name); this.simpleName = simpleName; } @@ -232,8 +232,8 @@ public class DumpArchiveEntry implements ArchiveEntry { * @param ino the ino * @param type the type */ - protected DumpArchiveEntry(String name, String simpleName, int ino, - TYPE type) { + protected DumpArchiveEntry(final String name, final String simpleName, final int ino, + final TYPE type) { setType(type); setName(name); this.simpleName = simpleName; @@ -253,7 +253,7 @@ public class DumpArchiveEntry implements ArchiveEntry { * Sets the path of the entry. * @param simpleName the simple name */ - protected void setSimpleName(String simpleName) { + protected void setSimpleName(final String simpleName) { this.simpleName = simpleName; } @@ -277,7 +277,7 @@ public class DumpArchiveEntry implements ArchiveEntry { * Set the number of hard links. * @param nlink the number of hard links */ - public void setNlink(int nlink) { + public void setNlink(final int nlink) { this.nlink = nlink; } @@ -293,7 +293,7 @@ public class DumpArchiveEntry implements ArchiveEntry { * Set the file creation time. * @param ctime the creation time */ - public void setCreationTime(Date ctime) { + public void setCreationTime(final Date ctime) { this.ctime = ctime.getTime(); } @@ -309,7 +309,7 @@ public class DumpArchiveEntry implements ArchiveEntry { * Set the generation of the file. * @param generation the generation */ - public void setGeneration(int generation) { + public void setGeneration(final int generation) { this.generation = generation; } @@ -325,7 +325,7 @@ public class DumpArchiveEntry implements ArchiveEntry { * Set whether this file has been deleted. * @param isDeleted whether the file has been deleted */ - public void setDeleted(boolean isDeleted) { + public void setDeleted(final boolean isDeleted) { this.isDeleted = isDeleted; } @@ -341,7 +341,7 @@ public class DumpArchiveEntry implements ArchiveEntry { * Set the offset within the archive. * @param offset the offset */ - public void setOffset(long offset) { + public void setOffset(final long offset) { this.offset = offset; } @@ -357,7 +357,7 @@ public class DumpArchiveEntry implements ArchiveEntry { * Set the tape volume. * @param volume the volume */ - public void setVolume(int volume) { + public void setVolume(final int volume) { this.volume = volume; } @@ -390,7 +390,7 @@ public class DumpArchiveEntry implements ArchiveEntry { * @param idx index of the record to check * @return whether this is a sparse record */ - public boolean isSparseRecord(int idx) { + public boolean isSparseRecord(final int idx) { return (header.getCdata(idx) & 0x01) == 0; } @@ -400,7 +400,7 @@ public class DumpArchiveEntry implements ArchiveEntry { } @Override - public boolean equals(Object o) { + public boolean equals(final Object o) { if (o == this) { return true; } else if (o == null || !o.getClass().equals(getClass())) { @@ -436,7 +436,7 @@ public class DumpArchiveEntry implements ArchiveEntry { * * @param buffer buffer to read content from */ - static DumpArchiveEntry parse(byte[] buffer) { + static DumpArchiveEntry parse(final byte[] buffer) { DumpArchiveEntry entry = new DumpArchiveEntry(); TapeSegmentHeader header = entry.header; @@ -503,7 +503,7 @@ public class DumpArchiveEntry implements ArchiveEntry { /** * Update entry with information from next tape segment header. */ - void update(byte[] buffer) { + void update(final byte[] buffer) { header.volume = DumpArchiveUtil.convert32(buffer, 16); header.count = DumpArchiveUtil.convert32(buffer, 160); @@ -542,7 +542,7 @@ public class DumpArchiveEntry implements ArchiveEntry { return ino; } - void setIno(int ino) { + void setIno(final int ino) { this.ino = ino; } @@ -554,7 +554,7 @@ public class DumpArchiveEntry implements ArchiveEntry { return holes; } - public int getCdata(int idx) { + public int getCdata(final int idx) { return cdata[idx]; } } @@ -663,7 +663,7 @@ public class DumpArchiveEntry implements ArchiveEntry { * Set the type of the entry. * @param type the type */ - public void setType(TYPE type) { + public void setType(final TYPE type) { this.type = type; } @@ -679,7 +679,7 @@ public class DumpArchiveEntry implements ArchiveEntry { * Set the access permissions on the entry. * @param mode the access permissions */ - public void setMode(int mode) { + public void setMode(final int mode) { this.mode = mode & 07777; this.permissions = PERMISSION.find(mode); } @@ -712,7 +712,7 @@ public class DumpArchiveEntry implements ArchiveEntry { * Set the size of the entry. * @param size the size */ - public void setSize(long size) { + public void setSize(final long size) { this.size = size; } @@ -720,7 +720,7 @@ public class DumpArchiveEntry implements ArchiveEntry { * Set the time the file was last modified. * @param mtime the last modified time */ - public void setLastModifiedDate(Date mtime) { + public void setLastModifiedDate(final Date mtime) { this.mtime = mtime.getTime(); } @@ -736,7 +736,7 @@ public class DumpArchiveEntry implements ArchiveEntry { * Set the time the file was last accessed. * @param atime the access time */ - public void setAccessTime(Date atime) { + public void setAccessTime(final Date atime) { this.atime = atime.getTime(); } @@ -752,7 +752,7 @@ public class DumpArchiveEntry implements ArchiveEntry { * Set the user id. * @param uid the user id */ - public void setUserId(int uid) { + public void setUserId(final int uid) { this.uid = uid; } @@ -768,7 +768,7 @@ public class DumpArchiveEntry implements ArchiveEntry { * Set the group id. * @param gid the group id */ - public void setGroupId(int gid) { + public void setGroupId(final int gid) { this.gid = gid; } @@ -785,11 +785,11 @@ public class DumpArchiveEntry implements ArchiveEntry { private int code; - private TYPE(int code) { + private TYPE(final int code) { this.code = code; } - public static TYPE find(int code) { + public static TYPE find(final int code) { TYPE type = UNKNOWN; for (TYPE t : TYPE.values()) { @@ -818,11 +818,11 @@ public class DumpArchiveEntry implements ArchiveEntry { private int code; - private PERMISSION(int code) { + private PERMISSION(final int code) { this.code = code; } - public static Set<PERMISSION> find(int code) { + public static Set<PERMISSION> find(final int code) { Set<PERMISSION> set = new HashSet<PERMISSION>(); for (PERMISSION p : PERMISSION.values()) { http://git-wip-us.apache.org/repos/asf/commons-compress/blob/478bef36/src/main/java/org/apache/commons/compress/archivers/dump/DumpArchiveException.java ---------------------------------------------------------------------- diff --git a/src/main/java/org/apache/commons/compress/archivers/dump/DumpArchiveException.java b/src/main/java/org/apache/commons/compress/archivers/dump/DumpArchiveException.java index 8e6a993..635b1d9 100644 --- a/src/main/java/org/apache/commons/compress/archivers/dump/DumpArchiveException.java +++ b/src/main/java/org/apache/commons/compress/archivers/dump/DumpArchiveException.java @@ -30,15 +30,15 @@ public class DumpArchiveException extends IOException { public DumpArchiveException() { } - public DumpArchiveException(String msg) { + public DumpArchiveException(final String msg) { super(msg); } - public DumpArchiveException(Throwable cause) { + public DumpArchiveException(final Throwable cause) { initCause(cause); } - public DumpArchiveException(String msg, Throwable cause) { + public DumpArchiveException(final String msg, final Throwable cause) { super(msg); initCause(cause); } http://git-wip-us.apache.org/repos/asf/commons-compress/blob/478bef36/src/main/java/org/apache/commons/compress/archivers/dump/DumpArchiveInputStream.java ---------------------------------------------------------------------- diff --git a/src/main/java/org/apache/commons/compress/archivers/dump/DumpArchiveInputStream.java b/src/main/java/org/apache/commons/compress/archivers/dump/DumpArchiveInputStream.java index 1b4ac3f..3083678 100644 --- a/src/main/java/org/apache/commons/compress/archivers/dump/DumpArchiveInputStream.java +++ b/src/main/java/org/apache/commons/compress/archivers/dump/DumpArchiveInputStream.java @@ -86,7 +86,7 @@ public class DumpArchiveInputStream extends ArchiveInputStream { * @param is stream to read from * @throws ArchiveException on error */ - public DumpArchiveInputStream(InputStream is) throws ArchiveException { + public DumpArchiveInputStream(final InputStream is) throws ArchiveException { this(is, null); } @@ -99,7 +99,7 @@ public class DumpArchiveInputStream extends ArchiveInputStream { * @since 1.6 * @throws ArchiveException on error */ - public DumpArchiveInputStream(InputStream is, String encoding) + public DumpArchiveInputStream(final InputStream is, final String encoding) throws ArchiveException { this.raw = new TapeInputStream(is); this.hasHitEOF = false; @@ -139,7 +139,7 @@ public class DumpArchiveInputStream extends ArchiveInputStream { queue = new PriorityQueue<DumpArchiveEntry>(10, new Comparator<DumpArchiveEntry>() { @Override - public int compare(DumpArchiveEntry p, DumpArchiveEntry q) { + public int compare(final DumpArchiveEntry p, final DumpArchiveEntry q) { if (p.getOriginalName() == null || q.getOriginalName() == null) { return Integer.MAX_VALUE; } @@ -412,7 +412,7 @@ public class DumpArchiveInputStream extends ArchiveInputStream { * @param entry * @return full path for specified archive entry, or null if there's a gap. */ - private String getPath(DumpArchiveEntry entry) { + private String getPath(final DumpArchiveEntry entry) { // build the stack of elements. It's possible that we're // still missing an intermediate value and if so we Stack<String> elements = new Stack<String>(); @@ -464,7 +464,7 @@ public class DumpArchiveInputStream extends ArchiveInputStream { * @throws IOException on error */ @Override - public int read(byte[] buf, int off, int len) throws IOException { + public int read(final byte[] buf, int off, int len) throws IOException { int totalRead = 0; if (hasHitEOF || isClosed || entryOffset >= entrySize) { @@ -542,7 +542,7 @@ public class DumpArchiveInputStream extends ArchiveInputStream { * @param length length of data * @return whether the buffer seems to contain dump data */ - public static boolean matches(byte[] buffer, int length) { + public static boolean matches(final byte[] buffer, final int length) { // do we have enough of the header? if (length < 32) { return false; http://git-wip-us.apache.org/repos/asf/commons-compress/blob/478bef36/src/main/java/org/apache/commons/compress/archivers/dump/DumpArchiveSummary.java ---------------------------------------------------------------------- diff --git a/src/main/java/org/apache/commons/compress/archivers/dump/DumpArchiveSummary.java b/src/main/java/org/apache/commons/compress/archivers/dump/DumpArchiveSummary.java index a030e00..6813608 100644 --- a/src/main/java/org/apache/commons/compress/archivers/dump/DumpArchiveSummary.java +++ b/src/main/java/org/apache/commons/compress/archivers/dump/DumpArchiveSummary.java @@ -43,7 +43,7 @@ public class DumpArchiveSummary { private int firstrec; private int ntrec; - DumpArchiveSummary(byte[] buffer, ZipEncoding encoding) throws IOException { + DumpArchiveSummary(final byte[] buffer, final ZipEncoding encoding) throws IOException { dumpDate = 1000L * DumpArchiveUtil.convert32(buffer, 4); previousDumpDate = 1000L * DumpArchiveUtil.convert32(buffer, 8); volume = DumpArchiveUtil.convert32(buffer, 12); @@ -71,7 +71,7 @@ public class DumpArchiveSummary { * Set dump date. * @param dumpDate the dump date */ - public void setDumpDate(Date dumpDate) { + public void setDumpDate(final Date dumpDate) { this.dumpDate = dumpDate.getTime(); } @@ -87,7 +87,7 @@ public class DumpArchiveSummary { * Set previous dump date. * @param previousDumpDate the previous dump dat */ - public void setPreviousDumpDate(Date previousDumpDate) { + public void setPreviousDumpDate(final Date previousDumpDate) { this.previousDumpDate = previousDumpDate.getTime(); } @@ -103,7 +103,7 @@ public class DumpArchiveSummary { * Set volume (tape) number. * @param volume the volume number */ - public void setVolume(int volume) { + public void setVolume(final int volume) { this.volume = volume; } @@ -123,7 +123,7 @@ public class DumpArchiveSummary { * Set level. * @param level the level */ - public void setLevel(int level) { + public void setLevel(final int level) { this.level = level; } @@ -140,7 +140,7 @@ public class DumpArchiveSummary { * Set dump label. * @param label the label */ - public void setLabel(String label) { + public void setLabel(final String label) { this.label = label; } @@ -156,7 +156,7 @@ public class DumpArchiveSummary { * Set the last mountpoint. * @param filesystem the last mountpoint */ - public void setFilesystem(String filesystem) { + public void setFilesystem(final String filesystem) { this.filesys = filesystem; } @@ -172,7 +172,7 @@ public class DumpArchiveSummary { * Set the device name. * @param devname the device name */ - public void setDevname(String devname) { + public void setDevname(final String devname) { this.devname = devname; } @@ -188,7 +188,7 @@ public class DumpArchiveSummary { * Set the hostname. * @param hostname the host name */ - public void setHostname(String hostname) { + public void setHostname(final String hostname) { this.hostname = hostname; } @@ -204,7 +204,7 @@ public class DumpArchiveSummary { * Set the miscellaneous flags. * @param flags flags */ - public void setFlags(int flags) { + public void setFlags(final int flags) { this.flags = flags; } @@ -220,7 +220,7 @@ public class DumpArchiveSummary { * Set the inode of the first record. * @param firstrec the first record */ - public void setFirstRecord(int firstrec) { + public void setFirstRecord(final int firstrec) { this.firstrec = firstrec; } @@ -237,7 +237,7 @@ public class DumpArchiveSummary { * Set the number of records per tape block. * @param ntrec the number of records per tape block */ - public void setNTRec(int ntrec) { + public void setNTRec(final int ntrec) { this.ntrec = ntrec; } @@ -307,7 +307,7 @@ public class DumpArchiveSummary { } @Override - public boolean equals(Object o) { + public boolean equals(final Object o) { if (this == o) { return true; } http://git-wip-us.apache.org/repos/asf/commons-compress/blob/478bef36/src/main/java/org/apache/commons/compress/archivers/dump/DumpArchiveUtil.java ---------------------------------------------------------------------- diff --git a/src/main/java/org/apache/commons/compress/archivers/dump/DumpArchiveUtil.java b/src/main/java/org/apache/commons/compress/archivers/dump/DumpArchiveUtil.java index 5b74944..315064a 100644 --- a/src/main/java/org/apache/commons/compress/archivers/dump/DumpArchiveUtil.java +++ b/src/main/java/org/apache/commons/compress/archivers/dump/DumpArchiveUtil.java @@ -37,7 +37,7 @@ class DumpArchiveUtil { * @param buffer buffer containing tape segment header * @returns checksum */ - public static int calculateChecksum(byte[] buffer) { + public static int calculateChecksum(final byte[] buffer) { int calc = 0; for (int i = 0; i < 256; i++) { @@ -53,7 +53,7 @@ class DumpArchiveUtil { * * @param buffer */ - public static final boolean verify(byte[] buffer) { + public static final boolean verify(final byte[] buffer) { // verify magic. for now only accept NFS_MAGIC. int magic = convert32(buffer, 24); @@ -76,7 +76,7 @@ class DumpArchiveUtil { * * @param buffer */ - public static final int getIno(byte[] buffer) { + public static final int getIno(final byte[] buffer) { return convert32(buffer, 20); } @@ -87,7 +87,7 @@ class DumpArchiveUtil { * @param offset * @return the 8-byte entry as a long */ - public static final long convert64(byte[] buffer, int offset) { + public static final long convert64(final byte[] buffer, final int offset) { long i = 0; i += (((long) buffer[offset + 7]) << 56); i += (((long) buffer[offset + 6] << 48) & 0x00FF000000000000L); @@ -108,7 +108,7 @@ class DumpArchiveUtil { * @param offset * @return the 4-byte entry as an int */ - public static final int convert32(byte[] buffer, int offset) { + public static final int convert32(final byte[] buffer, final int offset) { int i = 0; i = buffer[offset + 3] << 24; i += (buffer[offset + 2] << 16) & 0x00FF0000; @@ -125,7 +125,7 @@ class DumpArchiveUtil { * @param offset * @return the 2-byte entry as an int */ - public static final int convert16(byte[] buffer, int offset) { + public static final int convert16(final byte[] buffer, final int offset) { int i = 0; i += (buffer[offset + 1] << 8) & 0x0000FF00; i += buffer[offset] & 0x000000FF; @@ -136,7 +136,7 @@ class DumpArchiveUtil { /** * Decodes a byte array to a string. */ - static String decode(ZipEncoding encoding, byte[] b, int offset, int len) + static String decode(final ZipEncoding encoding, final byte[] b, final int offset, final int len) throws IOException { byte[] copy = new byte[len]; System.arraycopy(b, offset, copy, 0, len); http://git-wip-us.apache.org/repos/asf/commons-compress/blob/478bef36/src/main/java/org/apache/commons/compress/archivers/dump/InvalidFormatException.java ---------------------------------------------------------------------- diff --git a/src/main/java/org/apache/commons/compress/archivers/dump/InvalidFormatException.java b/src/main/java/org/apache/commons/compress/archivers/dump/InvalidFormatException.java index 2d8a9ac..6169dfe 100644 --- a/src/main/java/org/apache/commons/compress/archivers/dump/InvalidFormatException.java +++ b/src/main/java/org/apache/commons/compress/archivers/dump/InvalidFormatException.java @@ -31,7 +31,7 @@ public class InvalidFormatException extends DumpArchiveException { super("there was an error decoding a tape segment"); } - public InvalidFormatException(long offset) { + public InvalidFormatException(final long offset) { super("there was an error decoding a tape segment header at offset " + offset + "."); this.offset = offset; http://git-wip-us.apache.org/repos/asf/commons-compress/blob/478bef36/src/main/java/org/apache/commons/compress/archivers/dump/TapeInputStream.java ---------------------------------------------------------------------- diff --git a/src/main/java/org/apache/commons/compress/archivers/dump/TapeInputStream.java b/src/main/java/org/apache/commons/compress/archivers/dump/TapeInputStream.java index 3534805..9a0b098 100644 --- a/src/main/java/org/apache/commons/compress/archivers/dump/TapeInputStream.java +++ b/src/main/java/org/apache/commons/compress/archivers/dump/TapeInputStream.java @@ -46,7 +46,7 @@ class TapeInputStream extends FilterInputStream { /** * Constructor */ - public TapeInputStream(InputStream in) { + public TapeInputStream(final InputStream in) { super(in); } @@ -64,7 +64,7 @@ class TapeInputStream extends FilterInputStream { * @throws IOException * there was an error reading additional blocks. */ - public void resetBlockSize(int recsPerBlock, boolean isCompressed) + public void resetBlockSize(final int recsPerBlock, final boolean isCompressed) throws IOException { this.isCompressed = isCompressed; @@ -113,7 +113,7 @@ class TapeInputStream extends FilterInputStream { * record size */ @Override - public int read(byte[] b, int off, int len) throws IOException { + public int read(final byte[] b, int off, final int len) throws IOException { if ((len % recordSize) != 0) { throw new IllegalArgumentException( "all reads must be multiple of record size (" + recordSize + @@ -159,7 +159,7 @@ class TapeInputStream extends FilterInputStream { * record size */ @Override - public long skip(long len) throws IOException { + public long skip(final long len) throws IOException { if ((len % recordSize) != 0) { throw new IllegalArgumentException( "all reads must be multiple of record size (" + recordSize + @@ -254,7 +254,7 @@ class TapeInputStream extends FilterInputStream { * This is an optimization for longer seeks. * @return false if End-Of-File, else true */ - private boolean readBlock(boolean decompress) throws IOException { + private boolean readBlock(final boolean decompress) throws IOException { boolean success = true; if (in == null) { @@ -334,7 +334,7 @@ class TapeInputStream extends FilterInputStream { /** * Read buffer */ - private boolean readFully(byte[] b, int off, int len) + private boolean readFully(final byte[] b, final int off, final int len) throws IOException { int count = IOUtils.readFully(in, b, off, len); if (count < len) { http://git-wip-us.apache.org/repos/asf/commons-compress/blob/478bef36/src/main/java/org/apache/commons/compress/archivers/dump/UnsupportedCompressionAlgorithmException.java ---------------------------------------------------------------------- diff --git a/src/main/java/org/apache/commons/compress/archivers/dump/UnsupportedCompressionAlgorithmException.java b/src/main/java/org/apache/commons/compress/archivers/dump/UnsupportedCompressionAlgorithmException.java index 3160feb..8c60403 100644 --- a/src/main/java/org/apache/commons/compress/archivers/dump/UnsupportedCompressionAlgorithmException.java +++ b/src/main/java/org/apache/commons/compress/archivers/dump/UnsupportedCompressionAlgorithmException.java @@ -31,7 +31,7 @@ public class UnsupportedCompressionAlgorithmException super("this file uses an unsupported compression algorithm."); } - public UnsupportedCompressionAlgorithmException(String alg) { + public UnsupportedCompressionAlgorithmException(final String alg) { super("this file uses an unsupported compression algorithm: " + alg + "."); } http://git-wip-us.apache.org/repos/asf/commons-compress/blob/478bef36/src/main/java/org/apache/commons/compress/archivers/jar/JarArchiveEntry.java ---------------------------------------------------------------------- diff --git a/src/main/java/org/apache/commons/compress/archivers/jar/JarArchiveEntry.java b/src/main/java/org/apache/commons/compress/archivers/jar/JarArchiveEntry.java index d284ad9..5974dce 100644 --- a/src/main/java/org/apache/commons/compress/archivers/jar/JarArchiveEntry.java +++ b/src/main/java/org/apache/commons/compress/archivers/jar/JarArchiveEntry.java @@ -36,19 +36,19 @@ public class JarArchiveEntry extends ZipArchiveEntry { private final Attributes manifestAttributes = null; private final Certificate[] certificates = null; - public JarArchiveEntry(ZipEntry entry) throws ZipException { + public JarArchiveEntry(final ZipEntry entry) throws ZipException { super(entry); } - public JarArchiveEntry(String name) { + public JarArchiveEntry(final String name) { super(name); } - public JarArchiveEntry(ZipArchiveEntry entry) throws ZipException { + public JarArchiveEntry(final ZipArchiveEntry entry) throws ZipException { super(entry); } - public JarArchiveEntry(JarEntry entry) throws ZipException { + public JarArchiveEntry(final JarEntry entry) throws ZipException { super(entry); } http://git-wip-us.apache.org/repos/asf/commons-compress/blob/478bef36/src/main/java/org/apache/commons/compress/archivers/jar/JarArchiveInputStream.java ---------------------------------------------------------------------- diff --git a/src/main/java/org/apache/commons/compress/archivers/jar/JarArchiveInputStream.java b/src/main/java/org/apache/commons/compress/archivers/jar/JarArchiveInputStream.java index 1ebac2f..6ed5249 100644 --- a/src/main/java/org/apache/commons/compress/archivers/jar/JarArchiveInputStream.java +++ b/src/main/java/org/apache/commons/compress/archivers/jar/JarArchiveInputStream.java @@ -72,7 +72,7 @@ public class JarArchiveInputStream extends ZipArchiveInputStream { * the number of bytes to check * @return true, if this stream is a jar archive stream, false otherwise */ - public static boolean matches(byte[] signature, int length ) { + public static boolean matches(final byte[] signature, final int length ) { return ZipArchiveInputStream.matches(signature, length); } } http://git-wip-us.apache.org/repos/asf/commons-compress/blob/478bef36/src/main/java/org/apache/commons/compress/archivers/jar/JarArchiveOutputStream.java ---------------------------------------------------------------------- diff --git a/src/main/java/org/apache/commons/compress/archivers/jar/JarArchiveOutputStream.java b/src/main/java/org/apache/commons/compress/archivers/jar/JarArchiveOutputStream.java index 96d0fbf..8bbe890 100644 --- a/src/main/java/org/apache/commons/compress/archivers/jar/JarArchiveOutputStream.java +++ b/src/main/java/org/apache/commons/compress/archivers/jar/JarArchiveOutputStream.java @@ -55,7 +55,7 @@ public class JarArchiveOutputStream extends ZipArchiveOutputStream { // @throws ClassCastException if entry is not an instance of ZipArchiveEntry @Override - public void putArchiveEntry(ArchiveEntry ze) throws IOException { + public void putArchiveEntry(final ArchiveEntry ze) throws IOException { if (!jarMarkerAdded) { ((ZipArchiveEntry)ze).addAsFirstExtraField(JarMarker.getInstance()); jarMarkerAdded = true; http://git-wip-us.apache.org/repos/asf/commons-compress/blob/478bef36/src/main/java/org/apache/commons/compress/archivers/sevenz/AES256SHA256Decoder.java ---------------------------------------------------------------------- diff --git a/src/main/java/org/apache/commons/compress/archivers/sevenz/AES256SHA256Decoder.java b/src/main/java/org/apache/commons/compress/archivers/sevenz/AES256SHA256Decoder.java index e2ed5c2..f2840db 100644 --- a/src/main/java/org/apache/commons/compress/archivers/sevenz/AES256SHA256Decoder.java +++ b/src/main/java/org/apache/commons/compress/archivers/sevenz/AES256SHA256Decoder.java @@ -31,7 +31,7 @@ import org.apache.commons.compress.PasswordRequiredException; class AES256SHA256Decoder extends CoderBase { @Override - InputStream decode(final String archiveName, final InputStream in, long uncompressedLength, + InputStream decode(final String archiveName, final InputStream in, final long uncompressedLength, final Coder coder, final byte[] passwordBytes) throws IOException { return new InputStream() { private boolean isInitialized = false; @@ -115,7 +115,7 @@ class AES256SHA256Decoder extends CoderBase { } @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 { return init().read(b, off, len); } http://git-wip-us.apache.org/repos/asf/commons-compress/blob/478bef36/src/main/java/org/apache/commons/compress/archivers/sevenz/Archive.java ---------------------------------------------------------------------- diff --git a/src/main/java/org/apache/commons/compress/archivers/sevenz/Archive.java b/src/main/java/org/apache/commons/compress/archivers/sevenz/Archive.java index 132ba70..71288b0 100644 --- a/src/main/java/org/apache/commons/compress/archivers/sevenz/Archive.java +++ b/src/main/java/org/apache/commons/compress/archivers/sevenz/Archive.java @@ -45,11 +45,11 @@ class Archive { + " files and " + streamMap; } - private static String lengthOf(long[] a) { + private static String lengthOf(final long[] a) { return a == null ? "(null)" : String.valueOf(a.length); } - private static String lengthOf(Object[] a) { + private static String lengthOf(final Object[] a) { return a == null ? "(null)" : String.valueOf(a.length); } } http://git-wip-us.apache.org/repos/asf/commons-compress/blob/478bef36/src/main/java/org/apache/commons/compress/archivers/sevenz/BoundedRandomAccessFileInputStream.java ---------------------------------------------------------------------- diff --git a/src/main/java/org/apache/commons/compress/archivers/sevenz/BoundedRandomAccessFileInputStream.java b/src/main/java/org/apache/commons/compress/archivers/sevenz/BoundedRandomAccessFileInputStream.java index 63cf4bb..c6cf743 100644 --- a/src/main/java/org/apache/commons/compress/archivers/sevenz/BoundedRandomAccessFileInputStream.java +++ b/src/main/java/org/apache/commons/compress/archivers/sevenz/BoundedRandomAccessFileInputStream.java @@ -41,7 +41,7 @@ class BoundedRandomAccessFileInputStream 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/archivers/sevenz/CLI.java ---------------------------------------------------------------------- diff --git a/src/main/java/org/apache/commons/compress/archivers/sevenz/CLI.java b/src/main/java/org/apache/commons/compress/archivers/sevenz/CLI.java index 95a9d41..4606f0c 100644 --- a/src/main/java/org/apache/commons/compress/archivers/sevenz/CLI.java +++ b/src/main/java/org/apache/commons/compress/archivers/sevenz/CLI.java @@ -28,7 +28,7 @@ public class CLI { private static enum Mode { LIST("Analysing") { @Override - public void takeAction(SevenZFile archive, SevenZArchiveEntry entry) { + public void takeAction(final SevenZFile archive, final SevenZArchiveEntry entry) { System.out.print(entry.getName()); if (entry.isDirectory()) { System.out.print(" dir"); @@ -48,7 +48,7 @@ public class CLI { } } - private String getContentMethods(SevenZArchiveEntry entry) { + private String getContentMethods(final SevenZArchiveEntry entry) { StringBuilder sb = new StringBuilder(); boolean first = true; for (SevenZMethodConfiguration m : entry.getContentMethods()) { @@ -66,7 +66,7 @@ public class CLI { }, EXTRACT("Extracting") { @Override - public void takeAction(SevenZFile archive, SevenZArchiveEntry entry) + public void takeAction(final SevenZFile archive, final SevenZArchiveEntry entry) throws IOException { File outFile = new File(entry.getName()); if (entry.isDirectory()) { @@ -106,7 +106,7 @@ public class CLI { }; private final String message; - private Mode(String message) { + private Mode(final String message) { this.message = message; } public String getMessage() { @@ -116,7 +116,7 @@ public class CLI { throws IOException; } - public static void main(String[] args) throws Exception { + public static void main(final String[] args) throws Exception { if (args.length == 0) { usage(); return; @@ -142,7 +142,7 @@ public class CLI { System.out.println("Parameters: archive-name [list|extract]"); } - private static Mode grabMode(String[] args) { + private static Mode grabMode(final String[] args) { if (args.length < 2) { return Mode.LIST; } http://git-wip-us.apache.org/repos/asf/commons-compress/blob/478bef36/src/main/java/org/apache/commons/compress/archivers/sevenz/CoderBase.java ---------------------------------------------------------------------- diff --git a/src/main/java/org/apache/commons/compress/archivers/sevenz/CoderBase.java b/src/main/java/org/apache/commons/compress/archivers/sevenz/CoderBase.java index 286cc03..fffef1d 100644 --- a/src/main/java/org/apache/commons/compress/archivers/sevenz/CoderBase.java +++ b/src/main/java/org/apache/commons/compress/archivers/sevenz/CoderBase.java @@ -31,14 +31,14 @@ abstract class CoderBase { /** * @param acceptableOptions types that can be used as options for this codec. */ - protected CoderBase(Class<?>... acceptableOptions) { + protected CoderBase(final Class<?>... acceptableOptions) { this.acceptableOptions = acceptableOptions; } /** * @return whether this method can extract options from the given object. */ - boolean canAcceptOptions(Object opts) { + boolean canAcceptOptions(final Object opts) { for (Class<?> c : acceptableOptions) { if (c.isInstance(opts)) { return true; @@ -50,14 +50,14 @@ abstract class CoderBase { /** * @return property-bytes to write in a Folder block */ - byte[] getOptionsAsProperties(Object options) { + byte[] getOptionsAsProperties(final Object options) { return NONE; } /** * @return configuration options that have been used to create the given InputStream from the given Coder */ - Object getOptionsFromCoder(Coder coder, InputStream in) { + Object getOptionsFromCoder(final Coder coder, final InputStream in) { return null; } @@ -79,7 +79,7 @@ abstract class CoderBase { * If the option represents a number, return its integer * value, otherwise return the given default value. */ - protected static int numberOptionOrDefault(Object options, int defaultValue) { + protected static int numberOptionOrDefault(final Object options, final int defaultValue) { return options instanceof Number ? ((Number) options).intValue() : defaultValue; } } http://git-wip-us.apache.org/repos/asf/commons-compress/blob/478bef36/src/main/java/org/apache/commons/compress/archivers/sevenz/Coders.java ---------------------------------------------------------------------- diff --git a/src/main/java/org/apache/commons/compress/archivers/sevenz/Coders.java b/src/main/java/org/apache/commons/compress/archivers/sevenz/Coders.java index 06802e4..fe9e7dd 100644 --- a/src/main/java/org/apache/commons/compress/archivers/sevenz/Coders.java +++ b/src/main/java/org/apache/commons/compress/archivers/sevenz/Coders.java @@ -63,11 +63,11 @@ class Coders { put(SevenZMethod.DELTA_FILTER, new DeltaDecoder()); }}; - static CoderBase findByMethod(SevenZMethod method) { + static CoderBase findByMethod(final SevenZMethod method) { return CODER_MAP.get(method); } - static InputStream addDecoder(final String archiveName, final InputStream is, long uncompressedLength, + static InputStream addDecoder(final String archiveName, final InputStream is, final long uncompressedLength, final Coder coder, final byte[] password) throws IOException { CoderBase cb = findByMethod(SevenZMethod.byId(coder.decompressionMethodId)); if (cb == null) { @@ -79,7 +79,7 @@ class Coders { } static OutputStream addEncoder(final OutputStream out, final SevenZMethod method, - Object options) throws IOException { + final Object options) throws IOException { CoderBase cb = findByMethod(method); if (cb == null) { throw new IOException("Unsupported compression method " + method); @@ -89,8 +89,8 @@ class Coders { static class CopyDecoder extends CoderBase { @Override - InputStream decode(final String archiveName, final InputStream in, long uncompressedLength, - final Coder coder, byte[] password) throws IOException { + InputStream decode(final String archiveName, final InputStream in, final long uncompressedLength, + final Coder coder, final byte[] password) throws IOException { return in; } @Override @@ -101,8 +101,8 @@ class Coders { static class LZMADecoder extends CoderBase { @Override - InputStream decode(final String archiveName, final InputStream in, long uncompressedLength, - final Coder coder, byte[] password) throws IOException { + InputStream decode(final String archiveName, final InputStream in, final long uncompressedLength, + final Coder coder, final byte[] password) throws IOException { byte propsByte = coder.properties[0]; long dictSize = coder.properties[1]; for (int i = 1; i < 4; i++) { @@ -117,13 +117,13 @@ class Coders { static class BCJDecoder extends CoderBase { private final FilterOptions opts; - BCJDecoder(FilterOptions opts) { + BCJDecoder(final FilterOptions opts) { this.opts = opts; } @Override - InputStream decode(final String archiveName, final InputStream in, long uncompressedLength, - final Coder coder, byte[] password) throws IOException { + InputStream decode(final String archiveName, final InputStream in, final long uncompressedLength, + final Coder coder, final byte[] password) throws IOException { try { return opts.getInputStream(in); } catch (AssertionError e) { @@ -151,7 +151,7 @@ class Coders { } @Override - InputStream decode(final String archiveName, final InputStream in, long uncompressedLength, + InputStream decode(final String archiveName, final InputStream in, final long uncompressedLength, final Coder coder, final byte[] password) throws IOException { final Inflater inflater = new Inflater(true); @@ -164,12 +164,12 @@ class Coders { } @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 { return inflaterInputStream.read(b, off, len); } @Override - public int read(byte[] b) throws IOException { + public int read(final byte[] b) throws IOException { return inflaterInputStream.read(b); } @@ -190,17 +190,17 @@ class Coders { final DeflaterOutputStream deflaterOutputStream = new DeflaterOutputStream(out, deflater); return new OutputStream() { @Override - public void write(int b) throws IOException { + public void write(final int b) throws IOException { deflaterOutputStream.write(b); } @Override - public void write(byte[] b) throws IOException { + public void write(final byte[] b) throws IOException { deflaterOutputStream.write(b); } @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 { deflaterOutputStream.write(b, off, len); } @@ -222,7 +222,7 @@ class Coders { } @Override - InputStream decode(final String archiveName, final InputStream in, long uncompressedLength, + InputStream decode(final String archiveName, final InputStream in, final long uncompressedLength, final Coder coder, final byte[] password) throws IOException { return new BZip2CompressorInputStream(in); @@ -244,7 +244,7 @@ class Coders { private static class DummyByteAddingInputStream extends FilterInputStream { private boolean addDummyByte = true; - private DummyByteAddingInputStream(InputStream in) { + private DummyByteAddingInputStream(final InputStream in) { super(in); } @@ -259,7 +259,7 @@ class Coders { } @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 result = super.read(b, off, len); if (result == -1 && addDummyByte) { addDummyByte = false; http://git-wip-us.apache.org/repos/asf/commons-compress/blob/478bef36/src/main/java/org/apache/commons/compress/archivers/sevenz/DeltaDecoder.java ---------------------------------------------------------------------- diff --git a/src/main/java/org/apache/commons/compress/archivers/sevenz/DeltaDecoder.java b/src/main/java/org/apache/commons/compress/archivers/sevenz/DeltaDecoder.java index e458334..755b3e4 100644 --- a/src/main/java/org/apache/commons/compress/archivers/sevenz/DeltaDecoder.java +++ b/src/main/java/org/apache/commons/compress/archivers/sevenz/DeltaDecoder.java @@ -30,8 +30,8 @@ class DeltaDecoder extends CoderBase { } @Override - InputStream decode(final String archiveName, final InputStream in, long uncompressedLength, - final Coder coder, byte[] password) throws IOException { + InputStream decode(final String archiveName, final InputStream in, final long uncompressedLength, + final Coder coder, final byte[] password) throws IOException { return new DeltaOptions(getOptionsFromCoder(coder)).getInputStream(in); } @@ -46,18 +46,18 @@ class DeltaDecoder extends CoderBase { } @Override - byte[] getOptionsAsProperties(Object options) { + byte[] getOptionsAsProperties(final Object options) { return new byte[] { (byte) (numberOptionOrDefault(options, 1) - 1) }; } @Override - Object getOptionsFromCoder(Coder coder, InputStream in) { + Object getOptionsFromCoder(final Coder coder, final InputStream in) { return getOptionsFromCoder(coder); } - private int getOptionsFromCoder(Coder coder) { + private int getOptionsFromCoder(final Coder coder) { if (coder.properties == null || coder.properties.length == 0) { return 1; } http://git-wip-us.apache.org/repos/asf/commons-compress/blob/478bef36/src/main/java/org/apache/commons/compress/archivers/sevenz/Folder.java ---------------------------------------------------------------------- diff --git a/src/main/java/org/apache/commons/compress/archivers/sevenz/Folder.java b/src/main/java/org/apache/commons/compress/archivers/sevenz/Folder.java index 3aab7f4..3101293 100644 --- a/src/main/java/org/apache/commons/compress/archivers/sevenz/Folder.java +++ b/src/main/java/org/apache/commons/compress/archivers/sevenz/Folder.java @@ -92,7 +92,7 @@ class Folder { return 0; } - long getUnpackSizeForCoder(Coder coder) { + long getUnpackSizeForCoder(final Coder coder) { if (coders != null) { for (int i = 0; i < coders.length; i++) { if (coders[i] == coder) {