commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bode...@apache.org
Subject svn commit: r1157471 - in /commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers: tar/TarArchiveInputStream.java zip/ZipArchiveOutputStream.java
Date Sun, 14 Aug 2011 05:42:41 GMT
Author: bodewig
Date: Sun Aug 14 05:42:41 2011
New Revision: 1157471

URL: http://svn.apache.org/viewvc?rev=1157471&view=rev
Log:
formatting only

Modified:
    commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers/tar/TarArchiveInputStream.java
    commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers/zip/ZipArchiveOutputStream.java

Modified: commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers/tar/TarArchiveInputStream.java
URL: http://svn.apache.org/viewvc/commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers/tar/TarArchiveInputStream.java?rev=1157471&r1=1157470&r2=1157471&view=diff
==============================================================================
--- commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers/tar/TarArchiveInputStream.java
(original)
+++ commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers/tar/TarArchiveInputStream.java
Sun Aug 14 05:42:41 2011
@@ -269,40 +269,46 @@ public class TarArchiveInputStream exten
         Map<String, String> headers = new HashMap<String, String>();
         // Format is "length keyword=value\n";
         try {
-        while(true){ // get length
-            int ch;
-            int len=0;
-            int read=0;
-            while((ch = br.read()) != -1){
-                read++;
-                if (ch == ' '){ // End of length string
-                    // Get keyword
-                    StringBuffer sb = new StringBuffer();
-                    while((ch = br.read()) != -1){
-                        read++;
-                        if (ch == '='){ // end of keyword
-                            String keyword = sb.toString();
-                            // Get rest of entry
-                            char[] cbuf = new char[len-read];
-                            int got = br.read(cbuf);
-                            if (got != len-read){
-                                throw new IOException("Failed to read Paxheader. Expected
"+(len-read)+" chars, read "+got);
+            while(true){ // get length
+                int ch;
+                int len = 0;
+                int read = 0;
+                while((ch = br.read()) != -1){
+                    read++;
+                    if (ch == ' '){ // End of length string
+                        // Get keyword
+                        StringBuffer sb = new StringBuffer();
+                        while((ch = br.read()) != -1){
+                            read++;
+                            if (ch == '='){ // end of keyword
+                                String keyword = sb.toString();
+                                // Get rest of entry
+                                char[] cbuf = new char[len-read];
+                                int got = br.read(cbuf);
+                                if (got != len - read){
+                                    throw new IOException("Failed to read "
+                                                          + "Paxheader. Expected "
+                                                          + (len - read)
+                                                          + " chars, read "
+                                                          + got);
+                                }
+                                // Drop trailing NL
+                                String value = new String(cbuf, 0,
+                                                          len - read - 1);
+                                headers.put(keyword, value);
+                                break;
                             }
-                            String value = new String(cbuf, 0 , len-read-1); // Drop trailing
NL
-                            headers.put(keyword, value);
-                            break;
+                            sb.append((char) ch);
                         }
-                        sb.append((char)ch);
+                        break; // Processed single header
                     }
-                    break; // Processed single header
+                    len *= 10;
+                    len += ch - '0';
+                }
+                if (ch == -1){ // EOF
+                    break;
                 }
-                len *= 10;
-                len += ch - '0';
-            }
-            if (ch == -1){ // EOF
-                break;
             }
-        }
         } finally {
             // NO-OP but makes FindBugs happy
             br.close();

Modified: commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers/zip/ZipArchiveOutputStream.java
URL: http://svn.apache.org/viewvc/commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers/zip/ZipArchiveOutputStream.java?rev=1157471&r1=1157470&r2=1157471&view=diff
==============================================================================
--- commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers/zip/ZipArchiveOutputStream.java
(original)
+++ commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers/zip/ZipArchiveOutputStream.java
Sun Aug 14 05:42:41 2011
@@ -1200,8 +1200,8 @@ public class ZipArchiveOutputStream exte
         if (!hasUsedZip64
             && (cdOffset >= ZIP64_MAGIC || cdLength >= ZIP64_MAGIC
                 || entries.size() >= ZIP64_MAGIC_SHORT)) {
-                // actually "will use"
-                hasUsedZip64 = true;
+            // actually "will use"
+            hasUsedZip64 = true;
         }
 
         if (!hasUsedZip64) {



Mime
View raw message