there is no better choice of a non-generic exception
Project: http://git-wip-us.apache.org/repos/asf/ant/repo Commit: http://git-wip-us.apache.org/repos/asf/ant/commit/934adc2e Tree: http://git-wip-us.apache.org/repos/asf/ant/tree/934adc2e Diff: http://git-wip-us.apache.org/repos/asf/ant/diff/934adc2e Branch: refs/heads/1.9.x Commit: 934adc2ee778bd12f9226b6b287dd34294708361 Parents: 1887723 Author: Stefan Bodewig <[email protected]> Authored: Thu Dec 22 06:30:25 2016 +0100 Committer: Stefan Bodewig <[email protected]> Committed: Thu Dec 22 06:30:25 2016 +0100 ---------------------------------------------------------------------- src/main/org/apache/tools/ant/util/ReaderInputStream.java | 2 +- src/main/org/apache/tools/tar/TarOutputStream.java | 4 ++-- src/main/org/apache/tools/zip/ExtraFieldUtils.java | 6 +++--- src/main/org/apache/tools/zip/ZipEntry.java | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ant/blob/934adc2e/src/main/org/apache/tools/ant/util/ReaderInputStream.java ---------------------------------------------------------------------- diff --git a/src/main/org/apache/tools/ant/util/ReaderInputStream.java b/src/main/org/apache/tools/ant/util/ReaderInputStream.java index 620af8d..f327b77 100644 --- a/src/main/org/apache/tools/ant/util/ReaderInputStream.java +++ b/src/main/org/apache/tools/ant/util/ReaderInputStream.java @@ -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 } } http://git-wip-us.apache.org/repos/asf/ant/blob/934adc2e/src/main/org/apache/tools/tar/TarOutputStream.java ---------------------------------------------------------------------- diff --git a/src/main/org/apache/tools/tar/TarOutputStream.java b/src/main/org/apache/tools/tar/TarOutputStream.java index 032f725..cacc686 100644 --- a/src/main/org/apache/tools/tar/TarOutputStream.java +++ b/src/main/org/apache/tools/tar/TarOutputStream.java @@ -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)"); } http://git-wip-us.apache.org/repos/asf/ant/blob/934adc2e/src/main/org/apache/tools/zip/ExtraFieldUtils.java ---------------------------------------------------------------------- diff --git a/src/main/org/apache/tools/zip/ExtraFieldUtils.java b/src/main/org/apache/tools/zip/ExtraFieldUtils.java index a6c0118..8a7355e 100644 --- a/src/main/org/apache/tools/zip/ExtraFieldUtils.java +++ b/src/main/org/apache/tools/zip/ExtraFieldUtils.java @@ -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 } } http://git-wip-us.apache.org/repos/asf/ant/blob/934adc2e/src/main/org/apache/tools/zip/ZipEntry.java ---------------------------------------------------------------------- diff --git a/src/main/org/apache/tools/zip/ZipEntry.java b/src/main/org/apache/tools/zip/ZipEntry.java index 30a8155..df3f840 100644 --- a/src/main/org/apache/tools/zip/ZipEntry.java +++ b/src/main/org/apache/tools/zip/ZipEntry.java @@ -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 } }
