duplicate two lines of TarArchiveEntry constructor code rather than hiding an important exception
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/compress/trunk@1302181 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/src/main/java/org/apache/commons/compress/archivers/tar/TarArchiveEntry.java b/src/main/java/org/apache/commons/compress/archivers/tar/TarArchiveEntry.java
index 2ea8a22..19c259c 100644
--- a/src/main/java/org/apache/commons/compress/archivers/tar/TarArchiveEntry.java
+++ b/src/main/java/org/apache/commons/compress/archivers/tar/TarArchiveEntry.java
@@ -309,7 +309,8 @@
* @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 @@
* @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);
}
/**