Return-Path: X-Original-To: apmail-commons-commits-archive@minotaur.apache.org Delivered-To: apmail-commons-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id BD489116D6 for ; Sun, 31 Aug 2014 19:29:51 +0000 (UTC) Received: (qmail 85509 invoked by uid 500); 31 Aug 2014 19:29:51 -0000 Delivered-To: apmail-commons-commits-archive@commons.apache.org Received: (qmail 85429 invoked by uid 500); 31 Aug 2014 19:29:51 -0000 Mailing-List: contact commits-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@commons.apache.org Delivered-To: mailing list commits@commons.apache.org Received: (qmail 85420 invoked by uid 99); 31 Aug 2014 19:29:51 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 31 Aug 2014 19:29:51 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 31 Aug 2014 19:29:18 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id 7C1412388C27 for ; Sun, 31 Aug 2014 19:28:20 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r920865 [23/45] - in /websites/production/commons/content/proper/commons-compress: ./ apidocs/ apidocs/org/apache/commons/compress/archivers/ apidocs/org/apache/commons/compress/archivers/ar/ apidocs/org/apache/commons/compress/archivers/ar... Date: Sun, 31 Aug 2014 19:27:54 -0000 To: commits@commons.apache.org From: bodewig@apache.org X-Mailer: svnmailer-1.0.9 Message-Id: <20140831192820.7C1412388C27@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Modified: websites/production/commons/content/proper/commons-compress/cobertura/org.apache.commons.compress.archivers.sevenz.SevenZFile.html ============================================================================== --- websites/production/commons/content/proper/commons-compress/cobertura/org.apache.commons.compress.archivers.sevenz.SevenZFile.html (original) +++ websites/production/commons/content/proper/commons-compress/cobertura/org.apache.commons.compress.archivers.sevenz.SevenZFile.html Sun Aug 31 19:27:46 2014 @@ -12,7 +12,7 @@
 
- +
Classes in this File Line Coverage Branch Coverage Complexity
SevenZFile
88%
447/503
76%
224/291
8.192
SevenZFile
85%
447/523
73%
224/305
8.296
 
@@ -421,7 +421,7 @@  245  
         
 246  42
         if (nid != NID.kEnd) {
-  247  0
             throw new IOException("Badly terminated header");
+  247  0
             throw new IOException("Badly terminated header, found " + nid);
 248  
         }
 249  42
     }
@@ -466,950 +466,998 @@  277  0
                 throw new IOException("Multi input/output stream coders are not yet supported");
 278  
             }
-  279  7
             inputStreamStack = Coders.addDecoder(inputStreamStack, coder, password);
-  280  6
         }
-  281  4
         if (folder.hasCrc) {
-  282  4
             inputStreamStack = new CRC32VerifyingInputStream(inputStreamStack,
-  283   -
                     folder.getUnpackSize(), folder.crc);
+  279  7
             inputStreamStack = Coders.addDecoder(inputStreamStack, folder.getUnpackSizeForCoder(coder),
+  280   +
                     coder, password);
+  281  6
         }
+  282  4
         if (folder.hasCrc) {
+  283  4
             inputStreamStack = new CRC32VerifyingInputStream(inputStreamStack,
 284   +
                     folder.getUnpackSize(), folder.crc);
+  285  
         }
-  285  4
         final byte[] nextHeader = new byte[(int)folder.getUnpackSize()];
-  286  4
         final DataInputStream nextHeaderInputStream = new DataInputStream(inputStreamStack);
-  287   +  286  4
         final byte[] nextHeader = new byte[(int)folder.getUnpackSize()];
+  287  4
         final DataInputStream nextHeaderInputStream = new DataInputStream(inputStreamStack);
+  288  
         try {
-  288  4
             nextHeaderInputStream.readFully(nextHeader);
-  289   +  289  4
             nextHeaderInputStream.readFully(nextHeader);
+  290  
         } finally {
-  290  4
             nextHeaderInputStream.close();
-  291  4
         }
-  292  4
         return new DataInputStream(new ByteArrayInputStream(nextHeader));
-  293   -
     }
+  291  4
             nextHeaderInputStream.close();
+  292  4
         }
+  293  4
         return new DataInputStream(new ByteArrayInputStream(nextHeader));
 294   -
     
+
     }
 295   +
     
+  296  
     private void readStreamsInfo(final DataInput header, final Archive archive) throws IOException {
-  296  46
         int nid = header.readUnsignedByte();
-  297   +  297  46
         int nid = header.readUnsignedByte();
+  298  
         
-  298  46
         if (nid == NID.kPackInfo) {
-  299  40
             readPackInfo(header, archive);
-  300  40
             nid = header.readUnsignedByte();
-  301   -
         }
+  299  46
         if (nid == NID.kPackInfo) {
+  300  40
             readPackInfo(header, archive);
+  301  40
             nid = header.readUnsignedByte();
 302   +
         }
+  303  
         
-  303  46
         if (nid == NID.kUnpackInfo) {
-  304  40
             readUnpackInfo(header, archive);
-  305  40
             nid = header.readUnsignedByte();
-  306   -
         } else {
+  304  46
         if (nid == NID.kUnpackInfo) {
+  305  40
             readUnpackInfo(header, archive);
+  306  40
             nid = header.readUnsignedByte();
 307   +
         } else {
+  308  
             // archive without unpack/coders info
-  308  6
             archive.folders = new Folder[0];
-  309   -
         }
+  309  6
             archive.folders = new Folder[0];
 310   -
         
-  311  46
         if (nid == NID.kSubStreamsInfo) {
-  312  41
             readSubStreamsInfo(header, archive);
-  313  41
             nid = header.readUnsignedByte();
-  314  
         }
+  311   +
         
+  312  46
         if (nid == NID.kSubStreamsInfo) {
+  313  41
             readSubStreamsInfo(header, archive);
+  314  41
             nid = header.readUnsignedByte();
 315   +
         }
+  316  
         
-  316  46
         if (nid != NID.kEnd) {
-  317  0
             throw new IOException("Badly terminated StreamsInfo");
-  318   +  317  46
         if (nid != NID.kEnd) {
+  318  0
             throw new IOException("Badly terminated StreamsInfo");
+  319  
         }
-  319  46
     }
-  320   -
     
+  320  46
     }
 321   +
     
+  322  
     private void readPackInfo(final DataInput header, final Archive archive) throws IOException {
-  322  40
         archive.packPos = readUint64(header);
-  323  40
         final long numPackStreams = readUint64(header);
-  324  40
         int nid = header.readUnsignedByte();
-  325  40
         if (nid == NID.kSize) {
-  326  40
             archive.packSizes = new long[(int)numPackStreams];
-  327  96
             for (int i = 0; i < archive.packSizes.length; i++) {
-  328  56
                 archive.packSizes[i] = readUint64(header);
-  329   +  323  40
         archive.packPos = readUint64(header);
+  324  40
         final long numPackStreams = readUint64(header);
+  325  40
         int nid = header.readUnsignedByte();
+  326  40
         if (nid == NID.kSize) {
+  327  40
             archive.packSizes = new long[(int)numPackStreams];
+  328  96
             for (int i = 0; i < archive.packSizes.length; i++) {
+  329  56
                 archive.packSizes[i] = readUint64(header);
+  330  
             }
-  330  40
             nid = header.readUnsignedByte();
-  331   -
         }
+  331  40
             nid = header.readUnsignedByte();
 332   +
         }
+  333  
         
-  333  40
         if (nid == NID.kCRC) {
-  334  29
             archive.packCrcsDefined = readAllOrBits(header, (int)numPackStreams);
-  335  29
             archive.packCrcs = new long[(int)numPackStreams];
-  336  74
             for (int i = 0; i < (int)numPackStreams; i++) {
-  337  45
                 if (archive.packCrcsDefined.get(i)) {
-  338  45
                     archive.packCrcs[i] = 0xffffFFFFL & Integer.reverseBytes(header.readInt());
-  339   -
                 }
+  334  40
         if (nid == NID.kCRC) {
+  335  29
             archive.packCrcsDefined = readAllOrBits(header, (int)numPackStreams);
+  336  29
             archive.packCrcs = new long[(int)numPackStreams];
+  337  74
             for (int i = 0; i < (int)numPackStreams; i++) {
+  338  45
                 if (archive.packCrcsDefined.get(i)) {
+  339  45
                     archive.packCrcs[i] = 0xffffFFFFL & Integer.reverseBytes(header.readInt());
 340   -
             }
+
                 }
 341   +
             }
+  342  
             
-  342  29
             nid = header.readUnsignedByte();
-  343   -
         }
+  343  29
             nid = header.readUnsignedByte();
 344   +
         }
+  345  
         
-  345  40
         if (nid != NID.kEnd) {
-  346  0
             throw new IOException("Badly terminated PackInfo (" + nid + ")");
-  347   +  346  40
         if (nid != NID.kEnd) {
+  347  0
             throw new IOException("Badly terminated PackInfo (" + nid + ")");
+  348  
         }
-  348  40
     }
-  349   -
     
+  349  40
     }
 350   +
     
+  351  
     private void readUnpackInfo(final DataInput header, final Archive archive) throws IOException {
-  351  40
         int nid = header.readUnsignedByte();
-  352  40
         if (nid != NID.kFolder) {
-  353  0
             throw new IOException("Expected kFolder, got " + nid);
-  354   -
         }
-  355  40
         final long numFolders = readUint64(header);
-  356  40
         final Folder[] folders = new Folder[(int)numFolders];
-  357  40
         archive.folders = folders;
-  358  40
         final int external = header.readUnsignedByte();
-  359  40
         if (external != 0) {
-  360  0
             throw new IOException("External unsupported");
-  361   +  352  40
         int nid = header.readUnsignedByte();
+  353  40
         if (nid != NID.kFolder) {
+  354  0
             throw new IOException("Expected kFolder, got " + nid);
+  355   +
         }
+  356  40
         final long numFolders = readUint64(header);
+  357  40
         final Folder[] folders = new Folder[(int)numFolders];
+  358  40
         archive.folders = folders;
+  359  40
         final int external = header.readUnsignedByte();
+  360  40
         if (external != 0) {
+  361  0
             throw new IOException("External unsupported");
+  362  
         } else {
-  362  96
             for (int i = 0; i < (int)numFolders; i++) {
-  363  56
                 folders[i] = readFolder(header);
-  364   -
             }
+  363  96
             for (int i = 0; i < (int)numFolders; i++) {
+  364  56
                 folders[i] = readFolder(header);
 365   -
         }
+
             }
 366   +
         }
+  367  
         
-  367  40
         nid = header.readUnsignedByte();
-  368  40
         if (nid != NID.kCodersUnpackSize) {
-  369  0
             throw new IOException("Expected kCodersUnpackSize, got " + nid);
-  370   -
         }
-  371  96
         for (final Folder folder : folders) {
-  372  56
             folder.unpackSizes = new long[(int)folder.totalOutputStreams];
-  373  126
             for (int i = 0; i < folder.totalOutputStreams; i++) {
-  374  70
                 folder.unpackSizes[i] = readUint64(header);
-  375   -
             }
+  368  40
         nid = header.readUnsignedByte();
+  369  40
         if (nid != NID.kCodersUnpackSize) {
+  370  0
             throw new IOException("Expected kCodersUnpackSize, got " + nid);
+  371   +
         }
+  372  96
         for (final Folder folder : folders) {
+  373  56
             folder.unpackSizes = new long[(int)folder.totalOutputStreams];
+  374  126
             for (int i = 0; i < folder.totalOutputStreams; i++) {
+  375  70
                 folder.unpackSizes[i] = readUint64(header);
 376   -
         }
+
             }
 377   +
         }
+  378  
         
-  378  40
         nid = header.readUnsignedByte();
-  379  40
         if (nid == NID.kCRC) {
-  380  34
             final BitSet crcsDefined = readAllOrBits(header, (int)numFolders);
-  381  84
             for (int i = 0; i < (int)numFolders; i++) {
-  382  50
                 if (crcsDefined.get(i)) {
-  383  50
                     folders[i].hasCrc = true;
-  384  50
                     folders[i].crc = 0xffffFFFFL & Integer.reverseBytes(header.readInt());
-  385   +  379  40
         nid = header.readUnsignedByte();
+  380  40
         if (nid == NID.kCRC) {
+  381  34
             final BitSet crcsDefined = readAllOrBits(header, (int)numFolders);
+  382  84
             for (int i = 0; i < (int)numFolders; i++) {
+  383  50
                 if (crcsDefined.get(i)) {
+  384  50
                     folders[i].hasCrc = true;
+  385  50
                     folders[i].crc = 0xffffFFFFL & Integer.reverseBytes(header.readInt());
+  386  
                 } else {
-  386  0
                     folders[i].hasCrc = false;
-  387   -
                 }
+  387  0
                     folders[i].hasCrc = false;
 388   -
             }
+
                 }
 389   +
             }
+  390  
             
-  390  34
             nid = header.readUnsignedByte();
-  391   -
         }
+  391  34
             nid = header.readUnsignedByte();
 392   +
         }
+  393  
         
-  393  40
         if (nid != NID.kEnd) {
-  394  0
             throw new IOException("Badly terminated UnpackInfo");
-  395   +  394  40
         if (nid != NID.kEnd) {
+  395  0
             throw new IOException("Badly terminated UnpackInfo");
+  396  
         }
-  396  40
     }
-  397   -
     
+  397  40
     }
 398   +
     
+  399  
     private void readSubStreamsInfo(final DataInput header, final Archive archive) throws IOException {
-  399  92
         for (final Folder folder : archive.folders) {
-  400  51
             folder.numUnpackSubStreams = 1;
-  401   -
         }
-  402  41
         int totalUnpackStreams = archive.folders.length;
-  403   -
         
-  404  41
         int nid = header.readUnsignedByte();
-  405  41
         if (nid == NID.kNumUnpackStream) {
-  406  4
             totalUnpackStreams = 0;
-  407  8
             for (final Folder folder : archive.folders) {
-  408  4
                 final long numStreams = readUint64(header);
-  409  4
                 folder.numUnpackSubStreams = (int)numStreams;
-  410  4
                 totalUnpackStreams += numStreams;
-  411   +  400  92
         for (final Folder folder : archive.folders) {
+  401  51
             folder.numUnpackSubStreams = 1;
+  402   +
         }
+  403  41
         int totalUnpackStreams = archive.folders.length;
+  404   +
         
+  405  41
         int nid = header.readUnsignedByte();
+  406  41
         if (nid == NID.kNumUnpackStream) {
+  407  4
             totalUnpackStreams = 0;
+  408  8
             for (final Folder folder : archive.folders) {
+  409  4
                 final long numStreams = readUint64(header);
+  410  4
                 folder.numUnpackSubStreams = (int)numStreams;
+  411  4
                 totalUnpackStreams += numStreams;
+  412  
             }
-  412  4
             nid = header.readUnsignedByte();
-  413   -
         }
+  413  4
             nid = header.readUnsignedByte();
 414   +
         }
+  415  
         
-  415  41
         final SubStreamsInfo subStreamsInfo = new SubStreamsInfo();
-  416  41
         subStreamsInfo.unpackSizes = new long[totalUnpackStreams];
-  417  41
         subStreamsInfo.hasCrc = new BitSet(totalUnpackStreams);
-  418  41
         subStreamsInfo.crcs = new long[totalUnpackStreams];
-  419   -
         
-  420  41
         int nextUnpackStream = 0;
-  421  92
         for (final Folder folder : archive.folders) {
-  422  51
             if (folder.numUnpackSubStreams == 0) {
-  423  0
                 continue;
-  424   -
             }
-  425  51
             long sum = 0;
-  426  51
             if (nid == NID.kSize) {
-  427  392
                 for (int i = 0; i < folder.numUnpackSubStreams - 1; i++) {
-  428  388
                     final long size = readUint64(header);
-  429  388
                     subStreamsInfo.unpackSizes[nextUnpackStream++] = size;
-  430  388
                     sum += size;
-  431   -
                 }
+  416  41
         final SubStreamsInfo subStreamsInfo = new SubStreamsInfo();
+  417  41
         subStreamsInfo.unpackSizes = new long[totalUnpackStreams];
+  418  41
         subStreamsInfo.hasCrc = new BitSet(totalUnpackStreams);
+  419  41
         subStreamsInfo.crcs = new long[totalUnpackStreams];
+  420   +
         
+  421  41
         int nextUnpackStream = 0;
+  422  92
         for (final Folder folder : archive.folders) {
+  423  51
             if (folder.numUnpackSubStreams == 0) {
+  424  0
                 continue;
+  425   +
             }
+  426  51
             long sum = 0;
+  427  51
             if (nid == NID.kSize) {
+  428  392
                 for (int i = 0; i < folder.numUnpackSubStreams - 1; i++) {
+  429  388
                     final long size = readUint64(header);
+  430  388
                     subStreamsInfo.unpackSizes[nextUnpackStream++] = size;
+  431  388
                     sum += size;
 432   +
                 }
+  433  
             }
-  433  51
             subStreamsInfo.unpackSizes[nextUnpackStream++] = folder.getUnpackSize() - sum;
-  434   -
         }
-  435  41
         if (nid == NID.kSize) {
-  436  4
             nid = header.readUnsignedByte();
-  437   +  434  51
             subStreamsInfo.unpackSizes[nextUnpackStream++] = folder.getUnpackSize() - sum;
+  435  
         }
+  436  41
         if (nid == NID.kSize) {
+  437  4
             nid = header.readUnsignedByte();
 438   +
         }
+  439  
         
-  439  41
         int numDigests = 0;
-  440  92
         for (final Folder folder : archive.folders) {
-  441  51
             if (folder.numUnpackSubStreams != 1 || !folder.hasCrc) {
-  442  6
                 numDigests += folder.numUnpackSubStreams;
-  443   -
             }
+  440  41
         int numDigests = 0;
+  441  92
         for (final Folder folder : archive.folders) {
+  442  51
             if (folder.numUnpackSubStreams != 1 || !folder.hasCrc) {
+  443  6
                 numDigests += folder.numUnpackSubStreams;
 444   -
         }
+
             }
 445   +
         }
+  446  
         
-  446  41
         if (nid == NID.kCRC) {
-  447  6
             final BitSet hasMissingCrc = readAllOrBits(header, numDigests);
-  448  6
             final long[] missingCrcs = new long[numDigests];
-  449  400
             for (int i = 0; i < numDigests; i++) {
-  450  394
                 if (hasMissingCrc.get(i)) {
-  451  394
                     missingCrcs[i] = 0xffffFFFFL & Integer.reverseBytes(header.readInt());
-  452   -
                 }
+  447  41
         if (nid == NID.kCRC) {
+  448  6
             final BitSet hasMissingCrc = readAllOrBits(header, numDigests);
+  449  6
             final long[] missingCrcs = new long[numDigests];
+  450  400
             for (int i = 0; i < numDigests; i++) {
+  451  394
                 if (hasMissingCrc.get(i)) {
+  452  394
                     missingCrcs[i] = 0xffffFFFFL & Integer.reverseBytes(header.readInt());
 453   +
                 }
+  454  
             }
-  454  6
             int nextCrc = 0;
-  455  6
             int nextMissingCrc = 0;
-  456  12
             for (final Folder folder: archive.folders) {
-  457  6
                 if (folder.numUnpackSubStreams == 1 && folder.hasCrc) {
-  458  0
                     subStreamsInfo.hasCrc.set(nextCrc, true);
-  459  0
                     subStreamsInfo.crcs[nextCrc] = folder.crc;
-  460  0
                     ++nextCrc;
-  461   +  455  6
             int nextCrc = 0;
+  456  6
             int nextMissingCrc = 0;
+  457  12
             for (final Folder folder: archive.folders) {
+  458  6
                 if (folder.numUnpackSubStreams == 1 && folder.hasCrc) {
+  459  0
                     subStreamsInfo.hasCrc.set(nextCrc, true);
+  460  0
                     subStreamsInfo.crcs[nextCrc] = folder.crc;
+  461  0
                     ++nextCrc;
+  462  
                 } else {
-  462  400
                     for (int i = 0; i < folder.numUnpackSubStreams; i++) {
-  463  394
                         subStreamsInfo.hasCrc.set(nextCrc, hasMissingCrc.get(nextMissingCrc));
-  464  394
                         subStreamsInfo.crcs[nextCrc] = missingCrcs[nextMissingCrc];
-  465  394
                         ++nextCrc;
-  466  394
                         ++nextMissingCrc;
-  467   -
                     }
+  463  400
                     for (int i = 0; i < folder.numUnpackSubStreams; i++) {
+  464  394
                         subStreamsInfo.hasCrc.set(nextCrc, hasMissingCrc.get(nextMissingCrc));
+  465  394
                         subStreamsInfo.crcs[nextCrc] = missingCrcs[nextMissingCrc];
+  466  394
                         ++nextCrc;
+  467  394
                         ++nextMissingCrc;
 468   -
                 }
+
                     }
 469   -
             }
+
                 }
 470   +
             }
+  471  
             
-  471  6
             nid = header.readUnsignedByte();
-  472   -
         }
+  472  6
             nid = header.readUnsignedByte();
 473   -
         
-  474  41
         if (nid != NID.kEnd) {
-  475  0
             throw new IOException("Badly terminated SubStreamsInfo");
-  476  
         }
+  474   +
         
+  475  41
         if (nid != NID.kEnd) {
[... 1212 lines stripped ...]