commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bode...@apache.org
Subject svn commit: r1302181 - /commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers/tar/TarArchiveEntry.java
Date Sun, 18 Mar 2012 17:46:32 GMT
Author: bodewig
Date: Sun Mar 18 17:46:32 2012
New Revision: 1302181

URL: http://svn.apache.org/viewvc?rev=1302181&view=rev
Log:
duplicate two lines of TarArchiveEntry constructor code rather than hiding an important exception

Modified:
    commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers/tar/TarArchiveEntry.java

Modified: commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers/tar/TarArchiveEntry.java
URL: http://svn.apache.org/viewvc/commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers/tar/TarArchiveEntry.java?rev=1302181&r1=1302180&r2=1302181&view=diff
==============================================================================
--- commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers/tar/TarArchiveEntry.java
(original)
+++ commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers/tar/TarArchiveEntry.java
Sun Mar 18 17:46:32 2012
@@ -309,7 +309,8 @@ public class TarArchiveEntry implements 
      * @throws IllegalArgumentException if any of the numeric fields have an invalid format
      */
     public TarArchiveEntry(byte[] headerBuf) {
-        this(headerBuf, null);
+        this();
+        parseTarHeader(headerBuf);
     }
 
     /**
@@ -321,18 +322,10 @@ public class TarArchiveEntry implements 
      * @since Commons Compress 1.4
      * @throws IllegalArgumentException if any of the numeric fields have an invalid format
      */
-    public TarArchiveEntry(byte[] headerBuf, ZipEncoding encoding) {
+    public TarArchiveEntry(byte[] headerBuf, ZipEncoding encoding)
+        throws IOException {
         this();
-        try {
-            parseTarHeader(headerBuf, encoding);
-        } catch (IOException ex) {
-            try {
-                parseTarHeader(headerBuf, encoding, true);
-            } catch (IOException ex2) {
-                // impossible
-                throw new RuntimeException(ex2);
-            }
-        }
+        parseTarHeader(headerBuf, encoding);
     }
 
     /**



Mime
View raw message