Browse Source

there is no better choice of a non-generic exception

master
Stefan Bodewig 8 years ago
parent
commit
934adc2ee7
4 changed files with 8 additions and 8 deletions
  1. +1
    -1
      src/main/org/apache/tools/ant/util/ReaderInputStream.java
  2. +2
    -2
      src/main/org/apache/tools/tar/TarOutputStream.java
  3. +3
    -3
      src/main/org/apache/tools/zip/ExtraFieldUtils.java
  4. +2
    -2
      src/main/org/apache/tools/zip/ZipEntry.java

+ 1
- 1
src/main/org/apache/tools/ant/util/ReaderInputStream.java View File

@@ -148,7 +148,7 @@ public class ReaderInputStream extends InputStream {
try {
in.mark(limit);
} catch (IOException ioe) {
throw new RuntimeException(ioe.getMessage());
throw new RuntimeException(ioe.getMessage()); //NOSONAR
}
}



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

@@ -586,7 +586,7 @@ public class TarOutputStream extends FilterOutputStream {

private void failForBigNumber(String field, long value, long maxValue, String additionalMsg) {
if (value < 0 || value > maxValue) {
throw new RuntimeException(field + " '" + value
throw new RuntimeException(field + " '" + value //NOSONAR
+ "' is too big ( > "
+ maxValue + " )");
}
@@ -638,7 +638,7 @@ public class TarOutputStream extends FilterOutputStream {
write(0); // NUL terminator
closeEntry();
} else if (longFileMode != LONGFILE_TRUNCATE) {
throw new RuntimeException(fieldName + " '" + name
throw new RuntimeException(fieldName + " '" + name //NOSONAR
+ "' is too long ( > "
+ TarConstants.NAMELEN + " bytes)");
}


+ 3
- 3
src/main/org/apache/tools/zip/ExtraFieldUtils.java View File

@@ -63,11 +63,11 @@ public class ExtraFieldUtils {
ZipExtraField ze = (ZipExtraField) c.newInstance();
implementations.put(ze.getHeaderId(), c);
} catch (ClassCastException cc) {
throw new RuntimeException(c + " doesn\'t implement ZipExtraField");
throw new RuntimeException(c + " doesn\'t implement ZipExtraField"); //NOSONAR
} catch (InstantiationException ie) {
throw new RuntimeException(c + " is not a concrete class");
throw new RuntimeException(c + " is not a concrete class"); //NOSONAR
} catch (IllegalAccessException ie) {
throw new RuntimeException(c + "\'s no-arg constructor is not public");
throw new RuntimeException(c + "\'s no-arg constructor is not public"); //NOSONAR
}
}



+ 2
- 2
src/main/org/apache/tools/zip/ZipEntry.java View File

@@ -517,7 +517,7 @@ public class ZipEntry extends java.util.zip.ZipEntry implements Cloneable {
mergeExtraFields(local, true);
} catch (final ZipException e) {
// actually this is not be possible as of Ant 1.8.1
throw new RuntimeException("Error parsing extra fields for entry: "
throw new RuntimeException("Error parsing extra fields for entry: " //NOSONAR
+ getName() + " - " + e.getMessage(), e);
}
}
@@ -544,7 +544,7 @@ public class ZipEntry extends java.util.zip.ZipEntry implements Cloneable {
ExtraFieldUtils.UnparseableExtraField.READ);
mergeExtraFields(central, false);
} catch (final ZipException e) {
throw new RuntimeException(e.getMessage(), e);
throw new RuntimeException(e.getMessage(), e); //NOSONAR
}
}



Loading…
Cancel
Save