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 068AC10717 for ; Sat, 26 Oct 2013 14:25:41 +0000 (UTC) Received: (qmail 29832 invoked by uid 500); 26 Oct 2013 14:24:22 -0000 Delivered-To: apmail-commons-commits-archive@commons.apache.org Received: (qmail 29700 invoked by uid 500); 26 Oct 2013 14:24:18 -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 29445 invoked by uid 99); 26 Oct 2013 14:24:13 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 26 Oct 2013 14:24:13 +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; Sat, 26 Oct 2013 14:24:10 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id 114F12388CB9 for ; Sat, 26 Oct 2013 14:22:29 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r884228 [31/50] - in /websites/production/commons/content/proper/commons-compress: ./ cobertura/ Date: Sat, 26 Oct 2013 14:22:17 -0000 To: commits@commons.apache.org From: bodewig@apache.org X-Mailer: svnmailer-1.0.9 Message-Id: <20131026142229.114F12388CB9@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.zip.X7875_NewUnix.html ============================================================================== --- websites/production/commons/content/proper/commons-compress/cobertura/org.apache.commons.compress.archivers.zip.X7875_NewUnix.html (original) +++ websites/production/commons/content/proper/commons-compress/cobertura/org.apache.commons.compress.archivers.zip.X7875_NewUnix.html Sat Oct 26 14:22:15 2013 @@ -111,13 +111,13 @@
  */
 47  
 public class X7875_NewUnix implements ZipExtraField, Cloneable, Serializable {
-  48  1
     private static final ZipShort HEADER_ID = new ZipShort(0x7875);
-  49  1
     private static final BigInteger ONE_THOUSAND = BigInteger.valueOf(1000);
+  48  2
     private static final ZipShort HEADER_ID = new ZipShort(0x7875);
+  49  2
     private static final BigInteger ONE_THOUSAND = BigInteger.valueOf(1000);
 50  
     private static final long serialVersionUID = 1L;
 51  
 
-  52  306
     private int version = 1; // always '1' according to current info-zip spec.
+  52  612
     private int version = 1; // always '1' according to current info-zip spec.
 53  
 
 54   @@ -142,9 +142,9 @@
      * Constructor for X7875_NewUnix.
 64  
      */
-  65  306
     public X7875_NewUnix() {
-  66  306
         reset();
-  67  306
     }
+  65  612
     public X7875_NewUnix() {
+  66  612
         reset();
+  67  612
     }
 68  
 
 69   @@ -159,7 +159,7 @@
      */
 74  
     public ZipShort getHeaderId() {
-  75  602
         return HEADER_ID;
+  75  1204
         return HEADER_ID;
 76  
     }
 77   @@ -180,7 +180,7 @@
      * @return the UID value.
 85  
      */
-  86  47
     public long getUID() { return ZipUtil.bigToLong(uid); }
+  86  94
     public long getUID() { return ZipUtil.bigToLong(uid); }
 87  
 
 88   @@ -199,7 +199,7 @@
      * @return the GID value.
 95  
      */
-  96  47
     public long getGID() { return ZipUtil.bigToLong(gid); }
+  96  94
     public long getGID() { return ZipUtil.bigToLong(gid); }
 97  
 
 98   @@ -214,8 +214,8 @@
      */
 103  
     public void setUID(long l) {
-  104  33
         this.uid = ZipUtil.longToBig(l);
-  105  33
     }
+  104  66
         this.uid = ZipUtil.longToBig(l);
+  105  66
     }
 106  
 
 107   @@ -230,8 +230,8 @@
      */
 112  
     public void setGID(long l) {
-  113  32
         this.gid = ZipUtil.longToBig(l);
-  114  32
     }
+  113  64
         this.gid = ZipUtil.longToBig(l);
+  114  64
     }
 115  
 
 116   @@ -248,13 +248,13 @@
      */
 122  
     public ZipShort getLocalFileDataLength() {
-  123  616
         int uidSize = trimLeadingZeroesForceMinLength(uid.toByteArray()).length;
-  124  616
         int gidSize = trimLeadingZeroesForceMinLength(gid.toByteArray()).length;
+  123  1232
         int uidSize = trimLeadingZeroesForceMinLength(uid.toByteArray()).length;
+  124  1232
         int gidSize = trimLeadingZeroesForceMinLength(gid.toByteArray()).length;
 125  
 
 126  
         // The 3 comes from:  version=1 + uidsize=1 + gidsize=1
-  127  616
         return new ZipShort(3 + uidSize + gidSize);
+  127  1232
         return new ZipShort(3 + uidSize + gidSize);
 128  
     }
 129   @@ -273,7 +273,7 @@
      */
 136  
     public ZipShort getCentralDirectoryLength() {
-  137  8
         return getLocalFileDataLength();  // No different than local version.
+  137  16
         return getLocalFileDataLength();  // No different than local version.
 138  
     }
 139   @@ -292,8 +292,8 @@
      */
 146  
     public byte[] getLocalFileDataData() {
-  147  436
         byte[] uidBytes = uid.toByteArray();
-  148  436
         byte[] gidBytes = gid.toByteArray();
+  147  872
         byte[] uidBytes = uid.toByteArray();
+  148  872
         byte[] gidBytes = gid.toByteArray();
 149  
 
 150   @@ -302,8 +302,8 @@
         // (e.g., so that the sign-bit is set to zero).  We need to remove that
 152  
         // before sending the number over the wire.
-  153  436
         uidBytes = trimLeadingZeroesForceMinLength(uidBytes);
-  154  436
         gidBytes = trimLeadingZeroesForceMinLength(gidBytes);
+  153  872
         uidBytes = trimLeadingZeroesForceMinLength(uidBytes);
+  154  872
         gidBytes = trimLeadingZeroesForceMinLength(gidBytes);
 155  
 
 156   @@ -316,23 +316,23 @@
         //
 160  
         // The 3 comes from:  version=1 + uidsize=1 + gidsize=1
-  161  436
         byte[] data = new byte[3 + uidBytes.length + gidBytes.length];
+  161  872
         byte[] data = new byte[3 + uidBytes.length + gidBytes.length];
 162  
 
 163  
         // reverse() switches byte array from big-endian to little-endian.
-  164  436
         reverse(uidBytes);
-  165  436
         reverse(gidBytes);
+  164  872
         reverse(uidBytes);
+  165  872
         reverse(gidBytes);
 166  
 
-  167  436
         int pos = 0;
-  168  436
         data[pos++] = unsignedIntToSignedByte(version);
-  169  436
         data[pos++] = unsignedIntToSignedByte(uidBytes.length);
-  170  436
         System.arraycopy(uidBytes, 0, data, pos, uidBytes.length);
-  171  436
         pos += uidBytes.length;
-  172  436
         data[pos++] = unsignedIntToSignedByte(gidBytes.length);
-  173  436
         System.arraycopy(gidBytes, 0, data, pos, gidBytes.length);
-  174  436
         return data;
+  167  872
         int pos = 0;
+  168  872
         data[pos++] = unsignedIntToSignedByte(version);
+  169  872
         data[pos++] = unsignedIntToSignedByte(uidBytes.length);
+  170  872
         System.arraycopy(uidBytes, 0, data, pos, uidBytes.length);
+  171  872
         pos += uidBytes.length;
+  172  872
         data[pos++] = unsignedIntToSignedByte(gidBytes.length);
+  173  872
         System.arraycopy(gidBytes, 0, data, pos, gidBytes.length);
+  174  872
         return data;
 175  
     }
 176   @@ -351,7 +351,7 @@
      */
 183  
     public byte[] getCentralDirectoryData() {
-  184  8
         return getLocalFileDataData();
+  184  16
         return getLocalFileDataData();
 185  
     }
 186   @@ -378,20 +378,20 @@
             byte[] data, int offset, int length
 197  
     ) throws ZipException {
-  198  452
         reset();
-  199  452
         this.version = signedByteToUnsignedInt(data[offset++]);
-  200  452
         int uidSize = signedByteToUnsignedInt(data[offset++]);
-  201  452
         byte[] uidBytes = new byte[uidSize];
-  202  452
         System.arraycopy(data, offset, uidBytes, 0, uidSize);
-  203  452
         offset += uidSize;
-  204  452
         this.uid = new BigInteger(1, reverse(uidBytes)); // sign-bit forced positive
+  198  904
         reset();
+  199  904
         this.version = signedByteToUnsignedInt(data[offset++]);
+  200  904
         int uidSize = signedByteToUnsignedInt(data[offset++]);
+  201  904
         byte[] uidBytes = new byte[uidSize];
+  202  904
         System.arraycopy(data, offset, uidBytes, 0, uidSize);
+  203  904
         offset += uidSize;
+  204  904
         this.uid = new BigInteger(1, reverse(uidBytes)); // sign-bit forced positive
 205  
 
-  206  452
         int gidSize = signedByteToUnsignedInt(data[offset++]);
-  207  452
         byte[] gidBytes = new byte[gidSize];
-  208  452
         System.arraycopy(data, offset, gidBytes, 0, gidSize);
-  209  452
         this.gid = new BigInteger(1, reverse(gidBytes)); // sign-bit forced positive
-  210  452
     }
+  206  904
         int gidSize = signedByteToUnsignedInt(data[offset++]);
+  207  904
         byte[] gidBytes = new byte[gidSize];
+  208  904
         System.arraycopy(data, offset, gidBytes, 0, gidSize);
+  209  904
         this.gid = new BigInteger(1, reverse(gidBytes)); // sign-bit forced positive
+  210  904
     }
 211  
 
 212   @@ -408,9 +408,9 @@
             byte[] buffer, int offset, int length
 218  
     ) throws ZipException {
-  219  134
         reset();
-  220  134
         parseFromLocalFileData(buffer, offset, length);
-  221  134
     }
+  219  268
         reset();
+  220  268
         parseFromLocalFileData(buffer, offset, length);
+  221  268
     }
 222  
 
 223   @@ -425,9 +425,9 @@
     private void reset() {
 228  
         // Typical UID/GID of the first non-root user created on a unix system.
-  229  892
         uid = ONE_THOUSAND;
-  230  892
         gid = ONE_THOUSAND;
-  231  892
     }
+  229  1784
         uid = ONE_THOUSAND;
+  230  1784
         gid = ONE_THOUSAND;
+  231  1784
     }
 232  
 
 233   @@ -448,7 +448,7 @@
     @Override
 241  
     public String toString() {
-  242  1
         return "0x7875 Zip Extra Field: UID=" + uid + " GID=" + gid;
+  242  2
         return "0x7875 Zip Extra Field: UID=" + uid + " GID=" + gid;
 243  
     }
 244   @@ -457,7 +457,7 @@
     @Override
 246  
     public Object clone() throws CloneNotSupportedException {
-  247  1
         return super.clone();
+  247  2
         return super.clone();
 248  
     }
 249   @@ -466,14 +466,14 @@
     @Override
 251  
     public boolean equals(Object o) {
-  252  3
         if (o instanceof X7875_NewUnix) {
-  253  2
             X7875_NewUnix xf = (X7875_NewUnix) o;
+  252  6
         if (o instanceof X7875_NewUnix) {
+  253  4
             X7875_NewUnix xf = (X7875_NewUnix) o;
 254  
             // We assume uid and gid can never be null.
-  255  2
             return version == xf.version && uid.equals(xf.uid) && gid.equals(xf.gid);
+  255  4
             return version == xf.version && uid.equals(xf.uid) && gid.equals(xf.gid);
 256  
         }
-  257  1
         return false;
+  257  2
         return false;
 258  
     }
 259   @@ -482,16 +482,16 @@
     @Override
 261  
     public int hashCode() {
-  262  2
         int hc = (-1234567 * version);
+  262  4
         int hc = (-1234567 * version);
 263  
         // Since most UID's and GID's are below 65,536, this is (hopefully!)
 264  
         // a nice way to make sure typical UID and GID values impact the hash
 265  
         // as much as possible.
-  266  2
         hc ^= Integer.rotateLeft(uid.hashCode(), 16);
-  267  2
         hc ^= gid.hashCode();
-  268  2
         return hc;
+  266  4
         hc ^= Integer.rotateLeft(uid.hashCode(), 16);
+  267  4
         hc ^= gid.hashCode();
+  268  4
         return hc;
 269  
     }
 270   @@ -516,16 +516,16 @@
      */
 280  
     static byte[] trimLeadingZeroesForceMinLength(byte[] array) {
-  281  2116
         if (array == null) {
-  282  1
             return array;
+  281  4232
         if (array == null) {
+  282  2
             return array;
 283  
         }
 284  
 
-  285  2115
         int pos = 0;
-  286  2272
         for (byte b : array) {
-  287  2224
             if (b == 0) {
-  288  157
                 pos++;
+  285  4230
         int pos = 0;
+  286  4544
         for (byte b : array) {
+  287  4448
             if (b == 0) {
+  288  314
                 pos++;
 289  
             } else {
 290   @@ -610,19 +610,19 @@
 
 330  
         */
-  331  2115
         final int MIN_LENGTH = 1;
+  331  4230
         final int MIN_LENGTH = 1;
 332  
 
-  333  2115
         byte[] trimmedArray = new byte[Math.max(MIN_LENGTH, array.length - pos)];
-  334  2115
         int startPos = trimmedArray.length - (array.length - pos);
-  335  2115
         System.arraycopy(array, pos, trimmedArray, startPos, trimmedArray.length - startPos);
-  336  2115
         return trimmedArray;
+  333  4230
         byte[] trimmedArray = new byte[Math.max(MIN_LENGTH, array.length - pos)];
+  334  4230
         int startPos = trimmedArray.length - (array.length - pos);
+  335  4230
         System.arraycopy(array, pos, trimmedArray, startPos, trimmedArray.length - startPos);
+  336  4230
         return trimmedArray;
 337  
     }
 338  
 }
- + \ No newline at end of file