commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bode...@apache.org
Subject [46/46] commons-compress git commit: Merge branch 'master' into COMPRESS-207
Date Sun, 10 Apr 2016 04:19:02 GMT
Merge branch 'master' into COMPRESS-207

Conflicts:
	src/main/java/org/apache/commons/compress/compressors/bzip2/BZip2CompressorInputStream.java


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

Branch: refs/heads/COMPRESS-207
Commit: ffc026d06b2cafcc77bb426a6a4e7d377afb97aa
Parents: 17501ed 2cc332c
Author: Stefan Bodewig <bodewig@apache.org>
Authored: Sun Apr 10 06:17:28 2016 +0200
Committer: Stefan Bodewig <bodewig@apache.org>
Committed: Sun Apr 10 06:17:28 2016 +0200

----------------------------------------------------------------------
 .gitattributes                                  |  12 +-
 RELEASE-NOTES.txt                               |  74 ++++-
 pom.xml                                         |  19 +-
 src/changes/changes.xml                         |  11 +-
 .../compress/PasswordRequiredException.java     |   2 +-
 .../compress/archivers/ArchiveException.java    |   4 +-
 .../compress/archivers/ArchiveInputStream.java  |  10 +-
 .../compress/archivers/ArchiveOutputStream.java |   8 +-
 .../archivers/ArchiveStreamFactory.java         |  37 +--
 .../commons/compress/archivers/Lister.java      |   6 +-
 .../StreamingNotSupportedException.java         |   2 +-
 .../compress/archivers/ar/ArArchiveEntry.java   |  16 +-
 .../archivers/ar/ArArchiveInputStream.java      |  44 +--
 .../archivers/ar/ArArchiveOutputStream.java     |  10 +-
 .../compress/archivers/arj/ArjArchiveEntry.java |   9 +-
 .../archivers/arj/ArjArchiveInputStream.java    |  24 +-
 .../compress/archivers/arj/LocalFileHeader.java |   2 +-
 .../archivers/cpio/CpioArchiveEntry.java        |  20 +-
 .../archivers/cpio/CpioArchiveInputStream.java  |  44 +--
 .../archivers/cpio/CpioArchiveOutputStream.java |  26 +-
 .../compress/archivers/cpio/CpioUtil.java       |   6 +-
 .../commons/compress/archivers/dump/Dirent.java |   2 +-
 .../archivers/dump/DumpArchiveConstants.java    |  12 +-
 .../archivers/dump/DumpArchiveEntry.java        |  72 ++---
 .../archivers/dump/DumpArchiveException.java    |   6 +-
 .../archivers/dump/DumpArchiveInputStream.java  |  51 ++--
 .../archivers/dump/DumpArchiveSummary.java      |  28 +-
 .../archivers/dump/DumpArchiveUtil.java         |  20 +-
 .../archivers/dump/InvalidFormatException.java  |   2 +-
 .../archivers/dump/TapeInputStream.java         |  32 +-
 ...nsupportedCompressionAlgorithmException.java |   2 +-
 .../compress/archivers/jar/JarArchiveEntry.java |  10 +-
 .../archivers/jar/JarArchiveInputStream.java    |   4 +-
 .../archivers/jar/JarArchiveOutputStream.java   |   2 +-
 .../archivers/sevenz/AES256SHA256Decoder.java   |  27 +-
 .../compress/archivers/sevenz/Archive.java      |   4 +-
 .../BoundedRandomAccessFileInputStream.java     |   5 +-
 .../commons/compress/archivers/sevenz/CLI.java  |  32 +-
 .../compress/archivers/sevenz/CoderBase.java    |  12 +-
 .../compress/archivers/sevenz/Coders.java       |  61 ++--
 .../compress/archivers/sevenz/DeltaDecoder.java |  14 +-
 .../compress/archivers/sevenz/Folder.java       |   6 +-
 .../compress/archivers/sevenz/LZMA2Decoder.java |  32 +-
 .../archivers/sevenz/SevenZArchiveEntry.java    |  69 ++---
 .../compress/archivers/sevenz/SevenZFile.java   | 122 ++++----
 .../compress/archivers/sevenz/SevenZMethod.java |   8 +-
 .../sevenz/SevenZMethodConfiguration.java       |   4 +-
 .../archivers/sevenz/SevenZOutputFile.java      |  49 +--
 .../compress/archivers/tar/TarArchiveEntry.java | 127 ++++----
 .../archivers/tar/TarArchiveInputStream.java    |  90 +++---
 .../archivers/tar/TarArchiveOutputStream.java   | 102 +++----
 .../archivers/tar/TarArchiveSparseEntry.java    |   2 +-
 .../compress/archivers/tar/TarUtils.java        |  63 ++--
 .../zip/AbstractUnicodeExtraField.java          |  26 +-
 .../compress/archivers/zip/AsiExtraField.java   |  47 +--
 .../compress/archivers/zip/BinaryTree.java      |  38 +--
 .../compress/archivers/zip/BitStream.java       |   2 +-
 .../compress/archivers/zip/CircularBuffer.java  |  15 +-
 .../archivers/zip/ExplodingInputStream.java     |  12 +-
 .../compress/archivers/zip/ExtraFieldUtils.java |  66 ++---
 .../archivers/zip/FallbackZipEncoding.java      |  17 +-
 .../archivers/zip/GeneralPurposeBit.java        |  20 +-
 .../compress/archivers/zip/JarMarker.java       |  13 +-
 .../compress/archivers/zip/NioZipEncoding.java  |  19 +-
 .../archivers/zip/PKWareExtraHeader.java        |  37 ++-
 .../zip/ParallelScatterZipCreator.java          |  30 +-
 .../archivers/zip/ScatterStatistics.java        |   2 +-
 .../archivers/zip/ScatterZipOutputStream.java   |  25 +-
 .../archivers/zip/Simple8BitZipEncoding.java    |  48 +--
 .../archivers/zip/StreamCompressor.java         |  47 +--
 .../archivers/zip/UnicodeCommentExtraField.java |   7 +-
 .../archivers/zip/UnicodePathExtraField.java    |   5 +-
 .../zip/UnparseableExtraFieldData.java          |  13 +-
 .../archivers/zip/UnrecognizedExtraField.java   |  23 +-
 .../archivers/zip/UnshrinkingInputStream.java   |   6 +-
 .../zip/UnsupportedZipFeatureException.java     |  12 +-
 .../compress/archivers/zip/X000A_NTFS.java      |  46 +--
 .../archivers/zip/X0014_X509Certificates.java   |   3 +-
 .../zip/X0015_CertificateIdForFile.java         |   5 +-
 .../X0016_CertificateIdForCentralDirectory.java |   5 +-
 .../zip/X0017_StrongEncryptionHeader.java       |  27 +-
 ...0019_EncryptionRecipientCertificateList.java |   3 +-
 .../archivers/zip/X5455_ExtendedTimestamp.java  |  46 +--
 .../compress/archivers/zip/X7875_NewUnix.java   |  41 +--
 .../zip/Zip64ExtendedInformationExtraField.java |  49 +--
 .../archivers/zip/Zip64RequiredException.java   |   4 +-
 .../compress/archivers/zip/ZipArchiveEntry.java | 101 +++----
 .../archivers/zip/ZipArchiveEntryRequest.java   |   4 +-
 .../archivers/zip/ZipArchiveInputStream.java    | 119 ++++----
 .../archivers/zip/ZipArchiveOutputStream.java   | 186 ++++++------
 .../archivers/zip/ZipEightByteInteger.java      |  28 +-
 .../archivers/zip/ZipEncodingHelper.java        |  30 +-
 .../commons/compress/archivers/zip/ZipFile.java | 164 +++++-----
 .../commons/compress/archivers/zip/ZipLong.java |  22 +-
 .../compress/archivers/zip/ZipMethod.java       |   8 +-
 .../compress/archivers/zip/ZipShort.java        |  22 +-
 .../commons/compress/archivers/zip/ZipUtil.java |  91 +++---
 .../apache/commons/compress/changes/Change.java |   4 +-
 .../commons/compress/changes/ChangeSet.java     |  23 +-
 .../compress/changes/ChangeSetPerformer.java    |  48 +--
 .../compress/changes/ChangeSetResults.java      |   8 +-
 .../compressors/CompressorException.java        |   4 +-
 .../compressors/CompressorInputStream.java      |   6 +-
 .../compressors/CompressorStreamFactory.java    |  12 +-
 .../compress/compressors/FileNameUtil.java      |  22 +-
 .../bzip2/BZip2CompressorInputStream.java       | 131 ++++----
 .../bzip2/BZip2CompressorOutputStream.java      |  38 +--
 .../compress/compressors/bzip2/BZip2Utils.java  |   8 +-
 .../compress/compressors/bzip2/BlockSort.java   |  60 ++--
 .../commons/compress/compressors/bzip2/CRC.java |   8 +-
 .../compress/compressors/bzip2/Rand.java        |   2 +-
 .../deflate/DeflateCompressorInputStream.java   |  16 +-
 .../deflate/DeflateCompressorOutputStream.java  |  10 +-
 .../compressors/deflate/DeflateParameters.java  |   4 +-
 .../gzip/GzipCompressorInputStream.java         |  38 +--
 .../gzip/GzipCompressorOutputStream.java        |  24 +-
 .../compressors/gzip/GzipParameters.java        |  10 +-
 .../compress/compressors/gzip/GzipUtils.java    |   8 +-
 .../lzma/LZMACompressorInputStream.java         |  12 +-
 .../compress/compressors/lzma/LZMAUtils.java    |  16 +-
 .../compressors/lzw/LZWInputStream.java         |  28 +-
 .../pack200/Pack200CompressorInputStream.java   |  18 +-
 .../pack200/Pack200CompressorOutputStream.java  |   8 +-
 .../compressors/pack200/Pack200Utils.java       |  14 +-
 .../compressors/pack200/StreamBridge.java       |   2 +-
 .../FramedSnappyCompressorInputStream.java      |  30 +-
 .../compressors/snappy/PureJavaCrc32C.java      |  14 +-
 .../snappy/SnappyCompressorInputStream.java     |  20 +-
 .../compressors/xz/XZCompressorInputStream.java |  16 +-
 .../xz/XZCompressorOutputStream.java            |   8 +-
 .../compress/compressors/xz/XZUtils.java        |  16 +-
 .../compressors/z/ZCompressorInputStream.java   |  16 +-
 .../FileBasedScatterGatherBackingStore.java     |   8 +-
 .../commons/compress/utils/ArchiveUtils.java    |  30 +-
 .../commons/compress/utils/BitInputStream.java  |   1 +
 .../compress/utils/BoundedInputStream.java      |   5 +-
 .../apache/commons/compress/utils/Charsets.java |   4 +-
 .../utils/ChecksumVerifyingInputStream.java     |  13 +-
 .../compress/utils/CountingInputStream.java     |  10 +-
 .../compress/utils/CountingOutputStream.java    |   8 +-
 .../apache/commons/compress/utils/IOUtils.java  |  18 +-
 src/site/site.xml                               |   1 +
 src/site/xdoc/download_compress.xml             |  26 +-
 src/site/xdoc/index.xml                         |  29 +-
 .../commons/compress/AbstractTestCase.java      |  63 ++--
 .../commons/compress/ArchiveReadTest.java       |  22 +-
 .../commons/compress/ArchiveUtilsTest.java      |  14 +-
 .../commons/compress/ChainingTestCase.java      |   4 +-
 .../compress/DetectArchiverTestCase.java        |  10 +-
 .../apache/commons/compress/IOMethodsTest.java  |  52 ++--
 .../commons/compress/archivers/ArTestCase.java  |  34 +--
 .../archivers/ArchiveOutputStreamTest.java      |  32 +-
 .../archivers/ArchiveStreamFactoryTest.java     |  89 +++---
 .../compress/archivers/CpioTestCase.java        |  36 +--
 .../compress/archivers/DumpTestCase.java        |   4 +-
 .../archivers/ExceptionMessageTest.java         |  16 +-
 .../commons/compress/archivers/JarTestCase.java |   4 +-
 .../compress/archivers/LongPathTest.java        |  30 +-
 .../compress/archivers/LongSymLinkTest.java     |  30 +-
 .../compress/archivers/SevenZTestCase.java      |   2 +-
 .../commons/compress/archivers/TarTestCase.java |  46 +--
 .../commons/compress/archivers/ZipTestCase.java | 145 ++++-----
 .../archivers/ar/ArArchiveInputStreamTest.java  |   8 +-
 .../archivers/ar/ArArchiveOutputStreamTest.java |  10 +-
 .../arj/ArjArchiveInputStreamTest.java          |  18 +-
 .../cpio/CpioArchiveInputStreamTest.java        |   8 +-
 .../cpio/CpioArchiveOutputStreamTest.java       |   2 +-
 .../archivers/dump/DumpArchiveEntryTest.java    |   4 +-
 .../dump/DumpArchiveInputStreamTest.java        |  16 +-
 .../jar/JarArchiveOutputStreamTest.java         |   4 +-
 .../archivers/memory/MemoryArchiveEntry.java    |   4 +
 .../memory/MemoryArchiveInputStream.java        |   2 +-
 .../archivers/sevenz/SevenZFileTest.java        |  72 ++---
 .../archivers/sevenz/SevenZNativeHeapTest.java  |  64 ++++
 .../archivers/sevenz/SevenZOutputFileTest.java  |  86 +++---
 .../compress/archivers/tar/BigFilesIT.java      |  12 +-
 .../compress/archivers/tar/SparseFilesTest.java |  10 +-
 .../archivers/tar/TarArchiveEntryTest.java      |  22 +-
 .../tar/TarArchiveInputStreamTest.java          |  75 ++---
 .../tar/TarArchiveOutputStreamTest.java         | 296 +++++++++----------
 .../compress/archivers/tar/TarLister.java       |  10 +-
 .../compress/archivers/tar/TarUtilsTest.java    |  56 ++--
 .../archivers/zip/AsiExtraFieldTest.java        |  10 +-
 .../compress/archivers/zip/BinaryTreeTest.java  |   6 +-
 .../compress/archivers/zip/BitStreamTest.java   |  10 +-
 .../archivers/zip/CircularBufferTest.java       |   6 +-
 .../archivers/zip/EncryptedArchiveTest.java     |  14 +-
 .../archivers/zip/ExplodeSupportTest.java       |  22 +-
 .../archivers/zip/ExtraFieldUtilsTest.java      |  32 +-
 .../archivers/zip/GeneralPurposeBitTest.java    |  18 +-
 .../commons/compress/archivers/zip/Lister.java  |  32 +-
 .../archivers/zip/Maven221MultiVolumeTest.java  |  23 +-
 .../zip/ParallelScatterZipCreatorTest.java      |  53 ++--
 .../compress/archivers/zip/ScatterSample.java   |   9 +-
 .../archivers/zip/ScatterSampleTest.java        |  25 +-
 .../zip/ScatterZipOutputStreamTest.java         |  18 +-
 .../archivers/zip/StreamCompressorTest.java     |  10 +-
 .../archivers/zip/UTF8ZipFilesTest.java         |  76 ++---
 .../compress/archivers/zip/X000A_NTFSTest.java  |   6 +-
 .../zip/X5455_ExtendedTimestampTest.java        |  58 ++--
 .../archivers/zip/X7875_NewUnixTest.java        |  14 +-
 .../Zip64ExtendedInformationExtraFieldTest.java |  54 ++--
 .../compress/archivers/zip/Zip64SupportIT.java  | 285 +++++++++---------
 .../archivers/zip/ZipArchiveEntryTest.java      |  58 ++--
 .../zip/ZipArchiveInputStreamTest.java          |  22 +-
 .../archivers/zip/ZipEightByteIntegerTest.java  |  24 +-
 .../compress/archivers/zip/ZipEncodingTest.java |  16 +-
 .../compress/archivers/zip/ZipFileTest.java     |  58 ++--
 .../compress/archivers/zip/ZipLongTest.java     |  22 +-
 .../compress/archivers/zip/ZipShortTest.java    |  22 +-
 .../compress/archivers/zip/ZipUtilTest.java     |  80 ++---
 .../compress/changes/ChangeSetTestCase.java     | 242 +++++++--------
 .../compress/compressors/BZip2TestCase.java     |   6 +-
 .../compress/compressors/DeflateTestCase.java   |   4 +-
 .../compressors/DetectCompressorTestCase.java   |  28 +-
 .../compressors/FramedSnappyTestCase.java       |  13 +-
 .../compress/compressors/GZipTestCase.java      |  60 ++--
 .../compress/compressors/LZMATestCase.java      |   2 +-
 .../compress/compressors/Pack200TestCase.java   |  22 +-
 .../compress/compressors/XZTestCase.java        |   2 +-
 .../commons/compress/compressors/ZTestCase.java |  11 +-
 .../bzip2/BZip2CompressorInputStreamTest.java   |  14 +-
 .../compressors/bzip2/BlockSortTest.java        |  32 +-
 .../bzip2/PythonTruncatedBzip2Test.java         |  22 +-
 .../DeflateCompressorInputStreamTest.java       |   8 +-
 .../DeflateCompressorOutputStreamTest.java      |   4 +-
 .../deflate/DeflateParametersTest.java          |   6 +-
 .../compressors/lzma/LZMAUtilsTestCase.java     |   2 +-
 .../compressors/pack200/Pack200UtilsTest.java   |   8 +-
 .../FramedSnappyCompressorInputStreamTest.java  |  22 +-
 .../xz/XZCompressorInputStreamTest.java         |   2 +-
 .../compressors/xz/XZUtilsTestCase.java         |   2 +-
 .../compress/utils/BitInputStreamTest.java      |  24 +-
 .../compress/utils/CountingStreamTest.java      |   8 +-
 .../commons/compress/utils/IOUtilsTest.java     |  17 +-
 235 files changed, 3583 insertions(+), 3320 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/commons-compress/blob/ffc026d0/src/main/java/org/apache/commons/compress/compressors/CompressorInputStream.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/commons-compress/blob/ffc026d0/src/main/java/org/apache/commons/compress/compressors/bzip2/BZip2CompressorInputStream.java
----------------------------------------------------------------------
diff --cc src/main/java/org/apache/commons/compress/compressors/bzip2/BZip2CompressorInputStream.java
index 9c36e81,cb697ab..42f3fac
--- a/src/main/java/org/apache/commons/compress/compressors/bzip2/BZip2CompressorInputStream.java
+++ b/src/main/java/org/apache/commons/compress/compressors/bzip2/BZip2CompressorInputStream.java
@@@ -177,10 -174,10 +176,10 @@@ public class BZip2CompressorInputStrea
          int b;
          while (destOffs < hi && ((b = read0()) >= 0)) {
              dest[destOffs++] = (byte) b;
 -            count(1);
          }
  
-         int c = (destOffs == offs) ? -1 : (destOffs - offs);
+         final int c = (destOffs == offs) ? -1 : (destOffs - offs);
 +        count(c);
          return c;
      }
  
@@@ -231,25 -227,17 +230,25 @@@
          }
      }
  
 +    private int read(InputStream in) throws IOException {
 +        int r = in.read();
 +        if (r != -1) {
 +            compressedBytesRead++;
 +        }
 +        return r;
 +    }
 +
-     private boolean init(boolean isFirstStream) throws IOException {
+     private boolean init(final boolean isFirstStream) throws IOException {
          if (null == in) {
              throw new IOException("No InputStream");
          }
  
-         int magic0 = read(this.in);
 -        final int magic0 = this.in.read();
++        final int magic0 = read(this.in);
          if (magic0 == -1 && !isFirstStream) {
              return false;
          }
-         int magic1 = read(this.in);
-         int magic2 = read(this.in);
 -        final int magic1 = this.in.read();
 -        final int magic2 = this.in.read();
++        final int magic1 = read(this.in);
++        final int magic2 = read(this.in);
  
          if (magic0 != 'B' || magic1 != 'Z' || magic2 != 'h') {
              throw new IOException(isFirstStream
@@@ -257,7 -245,7 +256,7 @@@
                      : "Garbage after a valid BZip2 stream");
          }
  
-         int blockSize = read(this.in);
 -        final int blockSize = this.in.read();
++        final int blockSize = read(this.in);
          if ((blockSize < '1') || (blockSize > '9')) {
              throw new IOException("BZip2 block size is invalid");
          }
@@@ -310,25 -298,23 +309,24 @@@
              ) {
              this.currentState = EOF;
              throw new IOException("bad block header");
-         } else {
-              // subtract block start magic bytes from compressedBytesRead
-             fireProgress(currentBlock++, currentStream, compressedBytesRead - 6);
-             this.storedBlockCRC = bsGetInt();
-             this.blockRandomised = bsR(1) == 1;
- 
-             /**
-              * Allocate data here instead in constructor, so we do not allocate
-              * it if the input file is empty.
-              */
-             if (this.data == null) {
-                 this.data = new Data(this.blockSize100k);
-             }
- 
-             getAndMoveToFrontDecode();
+         }
++        // subtract block start magic bytes from compressedBytesRead
++        fireProgress(currentBlock++, currentStream, compressedBytesRead - 6);
+         this.storedBlockCRC = bsGetInt();
+         this.blockRandomised = bsR(1) == 1;
  
-             this.crc.initialiseCRC();
-             this.currentState = START_BLOCK_STATE;
+         /**
+          * Allocate data here instead in constructor, so we do not allocate
+          * it if the input file is empty.
+          */
+         if (this.data == null) {
+             this.data = new Data(this.blockSize100k);
          }
+ 
 -        // currBlockNo++;
+         getAndMoveToFrontDecode();
+ 
+         this.crc.initialiseCRC();
+         this.currentState = START_BLOCK_STATE;
      }
  
      private void endBlock() throws IOException {
@@@ -389,7 -372,7 +387,7 @@@
          if (bsLiveShadow < n) {
              final InputStream inShadow = this.in;
              do {
-                 int thech = read(inShadow);
 -                final int thech = inShadow.read();
++                final int thech = read(inShadow);
  
                  if (thech < 0) {
                      throw new IOException("unexpected end of stream");

http://git-wip-us.apache.org/repos/asf/commons-compress/blob/ffc026d0/src/test/java/org/apache/commons/compress/compressors/BZip2TestCase.java
----------------------------------------------------------------------


Mime
View raw message