diff --git a/src/main/org/apache/tools/ant/Main.java b/src/main/org/apache/tools/ant/Main.java index 4626e14d7..b104fd33a 100644 --- a/src/main/org/apache/tools/ant/Main.java +++ b/src/main/org/apache/tools/ant/Main.java @@ -978,10 +978,6 @@ public class Main implements AntMain { project.setInputHandler(handler); } - // TODO: (Jon Skeet) Any reason for writing a message and then using a bare - // RuntimeException rather than just using a BuildException here? Is it - // in case the message could end up being written to no loggers (as the - // loggers could have failed to be created due to this failure)? /** * Creates the default build logger for sending build events to the ant * log. @@ -1003,7 +999,7 @@ public class Main implements AntMain { System.err.println("The specified logger class " + loggerClassname + " could not be used because " + e.getMessage()); - throw new RuntimeException(); + throw e; } } else { logger = new DefaultLogger(); diff --git a/src/main/org/apache/tools/ant/Project.java b/src/main/org/apache/tools/ant/Project.java index f9308cb83..17f2467c3 100644 --- a/src/main/org/apache/tools/ant/Project.java +++ b/src/main/org/apache/tools/ant/Project.java @@ -1430,7 +1430,7 @@ public class Project implements ResourceFactory { "Target '" + curtarget.getName() + "' failed with message '" + thrownException.getMessage() + "'.", MSG_ERR); - thrownException.printStackTrace(System.err); + thrownException.printStackTrace(System.err); //NOSONAR if (buildException == null) { buildException = new BuildException(thrownException); @@ -1836,7 +1836,7 @@ public class Project implements ResourceFactory { if (st == null) { tsort(root[i], targetTable, state, visiting, ret); } else if (st == VISITING) { - throw new RuntimeException("Unexpected node in visiting state: " + throw new BuildException("Unexpected node in visiting state: " + root[i]); } } @@ -1855,7 +1855,7 @@ public class Project implements ResourceFactory { if (st == null) { tsort(curTarget, targetTable, state, visiting, complete); } else if (st == VISITING) { - throw new RuntimeException("Unexpected node in visiting state: " + throw new BuildException("Unexpected node in visiting state: " + curTarget); } } @@ -1941,7 +1941,7 @@ public class Project implements ResourceFactory { } final String p = visiting.pop(); if (root != p) { - throw new RuntimeException("Unexpected internal error: expected to " + throw new BuildException("Unexpected internal error: expected to " + "pop " + root + " but got " + p); } state.put(root, VISITED); diff --git a/src/main/org/apache/tools/ant/ProjectHelperRepository.java b/src/main/org/apache/tools/ant/ProjectHelperRepository.java index 02ad62d85..7fe92c491 100644 --- a/src/main/org/apache/tools/ant/ProjectHelperRepository.java +++ b/src/main/org/apache/tools/ant/ProjectHelperRepository.java @@ -62,7 +62,7 @@ public class ProjectHelperRepository { PROJECTHELPER2_CONSTRUCTOR = ProjectHelper2.class.getConstructor(); } catch (Exception e) { // ProjectHelper2 must be available - throw new RuntimeException(e); + throw new BuildException(e); } } @@ -263,7 +263,7 @@ public class ProjectHelperRepository { return helper; } } - throw new RuntimeException("BUG: at least the ProjectHelper2 should " + throw new BuildException("BUG: at least the ProjectHelper2 should " + "have supported the file " + buildFile); } @@ -286,7 +286,7 @@ public class ProjectHelperRepository { return helper; } } - throw new RuntimeException("BUG: at least the ProjectHelper2 should " + throw new BuildException("BUG: at least the ProjectHelper2 should " + "have supported the file " + antlib); } diff --git a/src/main/org/apache/tools/ant/XmlLogger.java b/src/main/org/apache/tools/ant/XmlLogger.java index a67a260ed..d03067d13 100644 --- a/src/main/org/apache/tools/ant/XmlLogger.java +++ b/src/main/org/apache/tools/ant/XmlLogger.java @@ -264,7 +264,7 @@ public class XmlLogger implements BuildLogger { if (!threadStack.empty()) { TimedElement poppedStack = threadStack.pop(); if (poppedStack != targetElement) { - throw new RuntimeException("Mismatch - popped element = " + poppedStack + throw new RuntimeException("Mismatch - popped element = " + poppedStack //NOSONAR + " finished target element = " + targetElement); } if (!threadStack.empty()) { @@ -316,7 +316,7 @@ public class XmlLogger implements BuildLogger { Task task = event.getTask(); TimedElement taskElement = tasks.get(task); if (taskElement == null) { - throw new RuntimeException("Unknown task " + task + " not in " + tasks); + throw new RuntimeException("Unknown task " + task + " not in " + tasks); //NOSONAR } long totalTime = System.currentTimeMillis() - taskElement.startTime; taskElement.element.setAttribute(TIME_ATTR, DefaultLogger.formatTime(totalTime)); @@ -334,7 +334,7 @@ public class XmlLogger implements BuildLogger { if (!threadStack.empty()) { TimedElement poppedStack = threadStack.pop(); if (poppedStack != taskElement) { - throw new RuntimeException("Mismatch - popped element = " + poppedStack + throw new RuntimeException("Mismatch - popped element = " + poppedStack //NOSONAR + " finished task element = " + taskElement); } } diff --git a/src/main/org/apache/tools/ant/listener/MailLogger.java b/src/main/org/apache/tools/ant/listener/MailLogger.java index 3d5bcd235..45289a1c4 100644 --- a/src/main/org/apache/tools/ant/listener/MailLogger.java +++ b/src/main/org/apache/tools/ant/listener/MailLogger.java @@ -327,7 +327,7 @@ public class MailLogger extends DefaultLogger { * property is not present in properties. */ private String getValue(Hashtable properties, String name, - String defaultValue) throws Exception { + String defaultValue) { String propertyName = "MailLogger." + name; String value = (String) properties.get(propertyName); @@ -336,7 +336,7 @@ public class MailLogger extends DefaultLogger { } if (value == null) { - throw new Exception("Missing required parameter: " + propertyName); + throw new RuntimeException("Missing required parameter: " + propertyName); //NOSONAR } return value; diff --git a/src/main/org/apache/tools/ant/taskdefs/LogOutputStream.java b/src/main/org/apache/tools/ant/taskdefs/LogOutputStream.java index b2c34684d..23bb6bd15 100644 --- a/src/main/org/apache/tools/ant/taskdefs/LogOutputStream.java +++ b/src/main/org/apache/tools/ant/taskdefs/LogOutputStream.java @@ -77,7 +77,7 @@ public class LogOutputStream extends LineOrientedOutputStream { super.processBuffer(); } catch (IOException e) { // impossible since *our* processLine doesn't throw an IOException - throw new RuntimeException("Impossible IOException caught: " + e); + throw new RuntimeException("Impossible IOException caught: " + e); //NOSONAR } } diff --git a/src/main/org/apache/tools/ant/taskdefs/XSLTLiaison.java b/src/main/org/apache/tools/ant/taskdefs/XSLTLiaison.java index 304995c68..5976bce9e 100644 --- a/src/main/org/apache/tools/ant/taskdefs/XSLTLiaison.java +++ b/src/main/org/apache/tools/ant/taskdefs/XSLTLiaison.java @@ -44,7 +44,7 @@ public interface XSLTLiaison { * @throws Exception thrown if any problems happens. * @since Ant 1.4 */ - void setStylesheet(File stylesheet) throws Exception; + void setStylesheet(File stylesheet) throws Exception; //NOSONAR /** * Add a parameter to be set during the XSL transformation. @@ -54,7 +54,7 @@ public interface XSLTLiaison { * @see XSLTLiaison4#addParam(java.lang.String, java.lang.Object) * @since Ant 1.3 */ - void addParam(String name, String expression) throws Exception; + void addParam(String name, String expression) throws Exception; //NOSONAR /** * Perform the transformation of a file into another. @@ -64,6 +64,6 @@ public interface XSLTLiaison { * @see #setStylesheet(File) * @since Ant 1.4 */ - void transform(File infile, File outfile) throws Exception; + void transform(File infile, File outfile) throws Exception; //NOSONAR } //-- XSLTLiaison diff --git a/src/main/org/apache/tools/ant/taskdefs/XSLTProcess.java b/src/main/org/apache/tools/ant/taskdefs/XSLTProcess.java index 75445928a..8fce71eeb 100644 --- a/src/main/org/apache/tools/ant/taskdefs/XSLTProcess.java +++ b/src/main/org/apache/tools/ant/taskdefs/XSLTProcess.java @@ -721,7 +721,7 @@ public class XSLTProcess extends MatchingTask implements XSLTLogger { * @return the requested class. * @exception Exception if the class could not be loaded. */ - private Class loadClass(final String classname) throws Exception { + private Class loadClass(final String classname) throws ClassNotFoundException { setupLoader(); if (loader == null) { return Class.forName(classname); @@ -1380,7 +1380,7 @@ public class XSLTProcess extends MatchingTask implements XSLTLogger { * @since Ant 1.7 */ private void setLiaisonDynamicFileParameters( - final XSLTLiaison liaison, final File inFile) throws Exception { + final XSLTLiaison liaison, final File inFile) throws Exception { //NOSONAR if (fileNameParameter != null) { liaison.addParam(fileNameParameter, inFile.getName()); } diff --git a/src/main/org/apache/tools/ant/taskdefs/optional/TraXLiaison.java b/src/main/org/apache/tools/ant/taskdefs/optional/TraXLiaison.java index 85dd311b8..f2fcd9a1b 100644 --- a/src/main/org/apache/tools/ant/taskdefs/optional/TraXLiaison.java +++ b/src/main/org/apache/tools/ant/taskdefs/optional/TraXLiaison.java @@ -143,7 +143,7 @@ public class TraXLiaison implements XSLTLiaison4, ErrorListener, XSLTLoggerAware * Constructor for TraXLiaison. * @throws Exception never */ - public TraXLiaison() throws Exception { + public TraXLiaison() throws Exception { //NOSONAR } /** @@ -316,7 +316,8 @@ public class TraXLiaison implements XSLTLiaison4, ErrorListener, XSLTLoggerAware * @see #addParam(java.lang.String, java.lang.String) * @see #setOutputProperty(java.lang.String, java.lang.String) */ - private void createTransformer() throws Exception { + private void createTransformer() + throws IOException, ParserConfigurationException, SAXException, TransformerException { if (templates == null) { readTemplates(); } diff --git a/src/main/org/apache/tools/ant/taskdefs/optional/depend/JarFileIterator.java b/src/main/org/apache/tools/ant/taskdefs/optional/depend/JarFileIterator.java index bc315d2e2..c468b952a 100644 --- a/src/main/org/apache/tools/ant/taskdefs/optional/depend/JarFileIterator.java +++ b/src/main/org/apache/tools/ant/taskdefs/optional/depend/JarFileIterator.java @@ -22,6 +22,8 @@ import java.io.InputStream; import java.util.zip.ZipEntry; import java.util.zip.ZipInputStream; +import org.apache.tools.ant.BuildException; + /** * A class file iterator which iterates through the contents of a Java jar * file. @@ -79,7 +81,7 @@ public class JarFileIterator implements ClassFileIterator { text += ": " + message; } - throw new RuntimeException("Problem reading JAR file: " + text); + throw new BuildException("Problem reading JAR file: " + text); } return nextElement; diff --git a/src/main/org/apache/tools/ant/taskdefs/optional/jlink/jlink.java b/src/main/org/apache/tools/ant/taskdefs/optional/jlink/jlink.java index aa193eaf7..5d45cfcc5 100644 --- a/src/main/org/apache/tools/ant/taskdefs/optional/jlink/jlink.java +++ b/src/main/org/apache/tools/ant/taskdefs/optional/jlink/jlink.java @@ -144,7 +144,7 @@ public class jlink { * a rational manner to outfile. * @throws Exception on error. */ - public void link() throws Exception { + public void link() throws Exception { //NOSONAR ZipOutputStream output = new ZipOutputStream(new FileOutputStream(outfile)); if (compression) { diff --git a/src/main/org/apache/tools/ant/taskdefs/optional/junit/JUnitTask.java b/src/main/org/apache/tools/ant/taskdefs/optional/junit/JUnitTask.java index 6a3b3cd14..6a69d2396 100644 --- a/src/main/org/apache/tools/ant/taskdefs/optional/junit/JUnitTask.java +++ b/src/main/org/apache/tools/ant/taskdefs/optional/junit/JUnitTask.java @@ -701,10 +701,10 @@ public class JUnitTask extends Task { /** * Creates a new JUnitRunner and enables fork of a new Java VM. * - * @throws Exception under ??? circumstances + * @throws Exception never * @since Ant 1.2 */ - public JUnitTask() throws Exception { + public JUnitTask() throws Exception { //NOSONAR } /** diff --git a/src/main/org/apache/tools/ant/util/DOMElementWriter.java b/src/main/org/apache/tools/ant/util/DOMElementWriter.java index 14cbaee2b..cafecf03f 100644 --- a/src/main/org/apache/tools/ant/util/DOMElementWriter.java +++ b/src/main/org/apache/tools/ant/util/DOMElementWriter.java @@ -494,7 +494,7 @@ public class DOMElementWriter { try { encodedata(out, value); } catch (IOException ex) { - throw new RuntimeException(ex); + throw new RuntimeException(ex); //NOSONAR } return out.toString(); } diff --git a/src/main/org/apache/tools/ant/util/FileUtils.java b/src/main/org/apache/tools/ant/util/FileUtils.java index 48f5ca65b..0c314b20c 100644 --- a/src/main/org/apache/tools/ant/util/FileUtils.java +++ b/src/main/org/apache/tools/ant/util/FileUtils.java @@ -1591,7 +1591,7 @@ public class FileUtils { * * @since Ant 1.7 */ - public static String getRelativePath(File fromFile, File toFile) throws Exception { + public static String getRelativePath(File fromFile, File toFile) throws Exception { //NOSONAR String fromPath = fromFile.getCanonicalPath(); String toPath = toFile.getCanonicalPath(); 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/ant/util/StringUtils.java b/src/main/org/apache/tools/ant/util/StringUtils.java index db0edd82b..04f1ce8c1 100644 --- a/src/main/org/apache/tools/ant/util/StringUtils.java +++ b/src/main/org/apache/tools/ant/util/StringUtils.java @@ -199,7 +199,7 @@ public final class StringUtils { * @throws Exception if there is a problem. * @since Ant 1.7 */ - public static long parseHumanSizes(String humanSize) throws Exception { + public static long parseHumanSizes(String humanSize) throws Exception { //NOSONAR long factor = 1L; char s = humanSize.charAt(0); switch (s) { diff --git a/src/main/org/apache/tools/ant/util/depend/AbstractAnalyzer.java b/src/main/org/apache/tools/ant/util/depend/AbstractAnalyzer.java index eb5f97ad3..b05ed1f5a 100644 --- a/src/main/org/apache/tools/ant/util/depend/AbstractAnalyzer.java +++ b/src/main/org/apache/tools/ant/util/depend/AbstractAnalyzer.java @@ -22,6 +22,7 @@ import java.util.Enumeration; import java.util.Vector; import java.util.zip.ZipFile; +import org.apache.tools.ant.BuildException; import org.apache.tools.ant.types.Path; import org.apache.tools.ant.util.VectorSet; @@ -80,7 +81,7 @@ public abstract class AbstractAnalyzer implements DependencyAnalyzer { */ public Enumeration getFileDependencies() { if (!supportsFileDependencies()) { - throw new RuntimeException("File dependencies are not supported " + throw new BuildException("File dependencies are not supported " + "by this analyzer"); } if (!determined) { diff --git a/src/main/org/apache/tools/ant/util/optional/JavaxScriptRunner.java b/src/main/org/apache/tools/ant/util/optional/JavaxScriptRunner.java index a24537ac8..7a5cfa4d3 100644 --- a/src/main/org/apache/tools/ant/util/optional/JavaxScriptRunner.java +++ b/src/main/org/apache/tools/ant/util/optional/JavaxScriptRunner.java @@ -126,7 +126,7 @@ public class JavaxScriptRunner extends ScriptRunnerBase { } } - private ReflectWrapper createEngine() throws Exception { + private ReflectWrapper createEngine() { if (engine != null) { return engine; } diff --git a/src/main/org/apache/tools/tar/TarEntry.java b/src/main/org/apache/tools/tar/TarEntry.java index 67990797a..86024ea8a 100644 --- a/src/main/org/apache/tools/tar/TarEntry.java +++ b/src/main/org/apache/tools/tar/TarEntry.java @@ -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); diff --git a/src/main/org/apache/tools/tar/TarInputStream.java b/src/main/org/apache/tools/tar/TarInputStream.java index 964e5c5f5..82c0a0d45 100644 --- a/src/main/org/apache/tools/tar/TarInputStream.java +++ b/src/main/org/apache/tools/tar/TarInputStream.java @@ -276,7 +276,7 @@ public class TarInputStream extends FilterInputStream { while (numToSkip > 0) { long skipped = skip(numToSkip); if (skipped <= 0) { - throw new RuntimeException("failed to skip current tar" + throw new IOException("failed to skip current tar" + " entry"); } numToSkip -= skipped; 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/tar/TarUtils.java b/src/main/org/apache/tools/tar/TarUtils.java index f86154ea3..5fa2e01f0 100644 --- a/src/main/org/apache/tools/tar/TarUtils.java +++ b/src/main/org/apache/tools/tar/TarUtils.java @@ -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 } } } diff --git a/src/main/org/apache/tools/zip/AbstractUnicodeExtraField.java b/src/main/org/apache/tools/zip/AbstractUnicodeExtraField.java index 1014787d4..ab56f46e7 100644 --- a/src/main/org/apache/tools/zip/AbstractUnicodeExtraField.java +++ b/src/main/org/apache/tools/zip/AbstractUnicodeExtraField.java @@ -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); } } diff --git a/src/main/org/apache/tools/zip/AsiExtraField.java b/src/main/org/apache/tools/zip/AsiExtraField.java index d2ca6910d..fb8227d84 100644 --- a/src/main/org/apache/tools/zip/AsiExtraField.java +++ b/src/main/org/apache/tools/zip/AsiExtraField.java @@ -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 } } } 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/GeneralPurposeBit.java b/src/main/org/apache/tools/zip/GeneralPurposeBit.java index 1d2255faa..a1af211bd 100644 --- a/src/main/org/apache/tools/zip/GeneralPurposeBit.java +++ b/src/main/org/apache/tools/zip/GeneralPurposeBit.java @@ -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 } } } 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 } } diff --git a/src/main/org/apache/tools/zip/ZipLong.java b/src/main/org/apache/tools/zip/ZipLong.java index 72af84db8..618082359 100644 --- a/src/main/org/apache/tools/zip/ZipLong.java +++ b/src/main/org/apache/tools/zip/ZipLong.java @@ -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 } } diff --git a/src/main/org/apache/tools/zip/ZipShort.java b/src/main/org/apache/tools/zip/ZipShort.java index e52c570d5..2f5482ff0 100644 --- a/src/main/org/apache/tools/zip/ZipShort.java +++ b/src/main/org/apache/tools/zip/ZipShort.java @@ -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 } }