summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorStefan Bodewig <bodewig@apache.org>2016-12-22 06:30:25 +0100
committerStefan Bodewig <bodewig@apache.org>2016-12-22 06:30:25 +0100
commit934adc2ee778bd12f9226b6b287dd34294708361 (patch)
treeea42b245cab1fb51e10162b11a4e0bea835af09f /src
parent18877234f21782ea101f0049db2f85907e7f4c68 (diff)
downloadant-934adc2ee778bd12f9226b6b287dd34294708361.tar.gz
there is no better choice of a non-generic exception
Diffstat (limited to 'src')
-rw-r--r--src/main/org/apache/tools/ant/util/ReaderInputStream.java2
-rw-r--r--src/main/org/apache/tools/tar/TarOutputStream.java4
-rw-r--r--src/main/org/apache/tools/zip/ExtraFieldUtils.java6
-rw-r--r--src/main/org/apache/tools/zip/ZipEntry.java4
4 files changed, 8 insertions, 8 deletions
diff --git a/src/main/org/apache/tools/ant/util/ReaderInputStream.java b/src/main/org/apache/tools/ant/util/ReaderInputStream.java
index 620af8d5c..f327b7770 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
}
}
diff --git a/src/main/org/apache/tools/tar/TarOutputStream.java b/src/main/org/apache/tools/tar/TarOutputStream.java
index 032f7254f..cacc68631 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)");
}
diff --git a/src/main/org/apache/tools/zip/ExtraFieldUtils.java b/src/main/org/apache/tools/zip/ExtraFieldUtils.java
index a6c0118ff..8a7355e06 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
}
}
diff --git a/src/main/org/apache/tools/zip/ZipEntry.java b/src/main/org/apache/tools/zip/ZipEntry.java
index 30a8155bd..df3f84059 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
}
}