Browse Source

accept "impossible" exceptions

master
Stefan Bodewig 8 years ago
parent
commit
da943ea14a
7 changed files with 11 additions and 10 deletions
  1. +4
    -3
      src/main/org/apache/tools/tar/TarEntry.java
  2. +2
    -2
      src/main/org/apache/tools/tar/TarUtils.java
  3. +1
    -1
      src/main/org/apache/tools/zip/AbstractUnicodeExtraField.java
  4. +1
    -1
      src/main/org/apache/tools/zip/AsiExtraField.java
  5. +1
    -1
      src/main/org/apache/tools/zip/GeneralPurposeBit.java
  6. +1
    -1
      src/main/org/apache/tools/zip/ZipLong.java
  7. +1
    -1
      src/main/org/apache/tools/zip/ZipShort.java

+ 4
- 3
src/main/org/apache/tools/tar/TarEntry.java View File

@@ -846,7 +846,7 @@ public class TarEntry implements TarConstants {
writeEntryHeader(outbuf, TarUtils.FALLBACK_ENCODING, false);
} catch (IOException ex2) {
// impossible
throw new RuntimeException(ex2);
throw new RuntimeException(ex2); //NOSONAR
}
}
}
@@ -932,7 +932,7 @@ public class TarEntry implements TarConstants {
parseTarHeader(header, TarUtils.DEFAULT_ENCODING, true);
} catch (IOException ex2) {
// not really possible
throw new RuntimeException(ex2);
throw new RuntimeException(ex2); //NOSONAR
}
}
}
@@ -1095,7 +1095,8 @@ public class TarEntry implements TarConstants {
try {
buffer1 = expected.getBytes("ASCII");
} catch (UnsupportedEncodingException e) {
throw new RuntimeException(e); // Should not happen
// Should not happen
throw new RuntimeException(e); //NOSONAR
}
return isEqual(buffer1, 0, buffer1.length, buffer, offset, length,
false);


+ 2
- 2
src/main/org/apache/tools/tar/TarUtils.java View File

@@ -265,7 +265,7 @@ public class TarUtils {
return parseName(buffer, offset, length, FALLBACK_ENCODING);
} catch (final IOException ex2) {
// impossible
throw new RuntimeException(ex2);
throw new RuntimeException(ex2); //NOSONAR
}
}
}
@@ -324,7 +324,7 @@ public class TarUtils {
FALLBACK_ENCODING);
} catch (final IOException ex2) {
// impossible
throw new RuntimeException(ex2);
throw new RuntimeException(ex2); //NOSONAR
}
}
}


+ 1
- 1
src/main/org/apache/tools/zip/AbstractUnicodeExtraField.java View File

@@ -54,7 +54,7 @@ public abstract class AbstractUnicodeExtraField implements ZipExtraField {
try {
unicodeName = text.getBytes("UTF-8");
} catch (final UnsupportedEncodingException e) {
throw new RuntimeException("FATAL: UTF-8 encoding not supported.",
throw new RuntimeException("FATAL: UTF-8 encoding not supported.", //NOSONAR
e);
}
}


+ 1
- 1
src/main/org/apache/tools/zip/AsiExtraField.java View File

@@ -346,7 +346,7 @@ public class AsiExtraField implements ZipExtraField, UnixStat, Cloneable {
return cloned;
} catch (CloneNotSupportedException cnfe) {
// impossible
throw new RuntimeException(cnfe);
throw new RuntimeException(cnfe); //NOSONAR
}
}
}

+ 1
- 1
src/main/org/apache/tools/zip/GeneralPurposeBit.java View File

@@ -188,7 +188,7 @@ public final class GeneralPurposeBit implements Cloneable {
return super.clone();
} catch (CloneNotSupportedException ex) {
// impossible
throw new RuntimeException("GeneralPurposeBit is not Cloneable?", ex);
throw new RuntimeException("GeneralPurposeBit is not Cloneable?", ex); //NOSONAR
}
}
}

+ 1
- 1
src/main/org/apache/tools/zip/ZipLong.java View File

@@ -190,7 +190,7 @@ public final class ZipLong implements Cloneable {
return super.clone();
} catch (CloneNotSupportedException cnfe) {
// impossible
throw new RuntimeException(cnfe);
throw new RuntimeException(cnfe); //NOSONAR
}
}



+ 1
- 1
src/main/org/apache/tools/zip/ZipShort.java View File

@@ -155,7 +155,7 @@ public final class ZipShort implements Cloneable {
return super.clone();
} catch (CloneNotSupportedException cnfe) {
// impossible
throw new RuntimeException(cnfe);
throw new RuntimeException(cnfe); //NOSONAR
}
}



Loading…
Cancel
Save