@@ -84,7 +84,7 @@ public class ArgumentProcessorRegistry { | |||||
} | } | ||||
InputStream systemResource = ClassLoader.getSystemResourceAsStream(SERVICE_ID); | InputStream systemResource = ClassLoader.getSystemResourceAsStream(SERVICE_ID); | ||||
if (systemResource != null) { | |||||
if (systemResource != null) { //NOSONAR | |||||
ArgumentProcessor processor = getProcessorByService(systemResource); | ArgumentProcessor processor = getProcessorByService(systemResource); | ||||
registerArgumentProcessor(processor); | registerArgumentProcessor(processor); | ||||
} | } | ||||
@@ -600,7 +600,8 @@ public class ProjectHelperImpl extends ProjectHelper { | |||||
private static void handleElement(ProjectHelperImpl helperImpl, DocumentHandler parent, | private static void handleElement(ProjectHelperImpl helperImpl, DocumentHandler parent, | ||||
Target target, String elementName, AttributeList attrs) throws SAXParseException { | Target target, String elementName, AttributeList attrs) throws SAXParseException { | ||||
if (elementName.equals("description")) { | if (elementName.equals("description")) { | ||||
new DescriptionHandler(helperImpl, parent); | |||||
// created for side effect | |||||
new DescriptionHandler(helperImpl, parent); //NOSONAR | |||||
} else if (helperImpl.project.getDataTypeDefinitions().get(elementName) != null) { | } else if (helperImpl.project.getDataTypeDefinitions().get(elementName) != null) { | ||||
new DataTypeHandler(helperImpl, parent, target).init(elementName, attrs); | new DataTypeHandler(helperImpl, parent, target).init(elementName, attrs); | ||||
} else { | } else { | ||||
@@ -401,7 +401,7 @@ public class Jar extends Zip { | |||||
*/ | */ | ||||
public void setFilesetmanifest(FilesetManifestConfig config) { | public void setFilesetmanifest(FilesetManifestConfig config) { | ||||
filesetManifestConfig = config; | filesetManifestConfig = config; | ||||
mergeManifestsMain = "merge".equals(config.getValue()); | |||||
mergeManifestsMain = config != null && "merge".equals(config.getValue()); | |||||
if (filesetManifestConfig != null | if (filesetManifestConfig != null | ||||
&& !filesetManifestConfig.getValue().equals("skip")) { | && !filesetManifestConfig.getValue().equals("skip")) { | ||||
@@ -2026,7 +2026,8 @@ public class Javadoc extends Task { | |||||
// is the href a valid URL | // is the href a valid URL | ||||
try { | try { | ||||
final URL base = new URL("file://."); | final URL base = new URL("file://."); | ||||
new URL(base, la.getHref()); | |||||
// created for the side effect of throwing a MalformedURLException | |||||
new URL(base, la.getHref()); //NOSONAR | |||||
link = la.getHref(); | link = la.getHref(); | ||||
} catch (final MalformedURLException mue) { | } catch (final MalformedURLException mue) { | ||||
// ok - just skip | // ok - just skip | ||||
@@ -183,7 +183,9 @@ public class MacroDef extends AntlibDefinition { | |||||
ret.setTaskName("sequential"); | ret.setTaskName("sequential"); | ||||
ret.setNamespace(""); | ret.setNamespace(""); | ||||
ret.setQName("sequential"); | ret.setQName("sequential"); | ||||
new RuntimeConfigurable(ret, "sequential"); | |||||
// stores RuntimeConfigurable as "RuntimeConfigurableWrapper" | |||||
// in ret as side effect | |||||
new RuntimeConfigurable(ret, "sequential"); //NOSONAR | |||||
final int size = nestedSequential.getNested().size(); | final int size = nestedSequential.getNested().size(); | ||||
for (int i = 0; i < size; ++i) { | for (int i = 0; i < size; ++i) { | ||||
UnknownElement e = | UnknownElement e = | ||||
@@ -137,7 +137,7 @@ public class StreamPumper implements Runnable { | |||||
if (autoflush) { | if (autoflush) { | ||||
os.flush(); | os.flush(); | ||||
} | } | ||||
if (finish) { | |||||
if (finish) { //NOSONAR | |||||
break; | break; | ||||
} | } | ||||
} | } | ||||
@@ -831,7 +831,7 @@ public class XSLTProcess extends MatchingTask implements XSLTLogger { | |||||
if (outFileName == null || outFileName.length == 0) { | if (outFileName == null || outFileName.length == 0) { | ||||
log("Skipping " + inFile + " it cannot get mapped to output.", Project.MSG_VERBOSE); | log("Skipping " + inFile + " it cannot get mapped to output.", Project.MSG_VERBOSE); | ||||
return; | return; | ||||
} else if (outFileName == null || outFileName.length > 1) { | |||||
} else if (outFileName.length > 1) { | |||||
log("Skipping " + inFile + " its mapping is ambiguos.", Project.MSG_VERBOSE); | log("Skipping " + inFile + " its mapping is ambiguos.", Project.MSG_VERBOSE); | ||||
return; | return; | ||||
} | } | ||||
@@ -78,7 +78,8 @@ public class AntVersion extends Task implements Condition { | |||||
} | } | ||||
if (atLeast != null) { | if (atLeast != null) { | ||||
try { | try { | ||||
new DeweyDecimal(atLeast); | |||||
// only created for side effect | |||||
new DeweyDecimal(atLeast); //NOSONAR | |||||
} catch (NumberFormatException e) { | } catch (NumberFormatException e) { | ||||
throw new BuildException( | throw new BuildException( | ||||
"The 'atleast' attribute is not a Dewey Decimal eg 1.1.0 : " | "The 'atleast' attribute is not a Dewey Decimal eg 1.1.0 : " | ||||
@@ -86,7 +87,8 @@ public class AntVersion extends Task implements Condition { | |||||
} | } | ||||
} else { | } else { | ||||
try { | try { | ||||
new DeweyDecimal(exactly); | |||||
// only created for side effect | |||||
new DeweyDecimal(exactly); //NOSONAR | |||||
} catch (NumberFormatException e) { | } catch (NumberFormatException e) { | ||||
throw new BuildException( | throw new BuildException( | ||||
"The 'exactly' attribute is not a Dewey Decimal eg 1.1.0 : " | "The 'exactly' attribute is not a Dewey Decimal eg 1.1.0 : " | ||||
@@ -362,7 +362,7 @@ public class RExecTask extends Task { | |||||
} catch (IOException e) { | } catch (IOException e) { | ||||
throw new BuildException("Can't connect to " + server); | throw new BuildException("Can't connect to " + server); | ||||
} | } | ||||
if (userid != null && password != null && command != null | |||||
if (userid != null && password != null && command != null //NOSONAR | |||||
&& rexecTasks.size() == 0) { | && rexecTasks.size() == 0) { | ||||
// simple one-shot execution | // simple one-shot execution | ||||
rexec.rexec(userid, password, command); | rexec.rexec(userid, password, command); | ||||
@@ -107,7 +107,7 @@ public class TelnetTask extends Task { | |||||
throw new BuildException("Can't connect to " + server); | throw new BuildException("Can't connect to " + server); | ||||
} | } | ||||
/** Login if userid and password were specified */ | /** Login if userid and password were specified */ | ||||
if (userid != null && password != null) { | |||||
if (userid != null && password != null) { //NOSONAR | |||||
login(telnet); | login(telnet); | ||||
} | } | ||||
/** Process each sub command */ | /** Process each sub command */ | ||||
@@ -267,7 +267,7 @@ public class Scp extends SSHBase { | |||||
} else { | } else { | ||||
upload(fromUri, toUri); | upload(fromUri, toUri); | ||||
} | } | ||||
} else if (isFromRemote && isToRemote) { | |||||
} else if (isFromRemote && isToRemote) { //NOSONAR | |||||
throw new BuildException( | throw new BuildException( | ||||
"Copying from a remote server to a remote server is not supported."); | "Copying from a remote server to a remote server is not supported."); | ||||
} else { | } else { | ||||
@@ -42,7 +42,7 @@ public class AncestorAnalyzer extends AbstractAnalyzer { | |||||
public AncestorAnalyzer() { | public AncestorAnalyzer() { | ||||
// force BCEL classes to load now | // force BCEL classes to load now | ||||
try { | try { | ||||
new ClassParser("force"); | |||||
new ClassParser("force"); //NOSONAR | |||||
} catch (Exception e) { | } catch (Exception e) { | ||||
// all released versions of BCEL may throw an IOException | // all released versions of BCEL may throw an IOException | ||||
// here, but BCEL's trunk does no longer declare to do so | // here, but BCEL's trunk does no longer declare to do so | ||||
@@ -41,7 +41,7 @@ public class FullAnalyzer extends AbstractAnalyzer { | |||||
public FullAnalyzer() { | public FullAnalyzer() { | ||||
// force BCEL classes to load now | // force BCEL classes to load now | ||||
try { | try { | ||||
new ClassParser("force"); | |||||
new ClassParser("force"); //NOSONAR | |||||
} catch (Exception e) { | } catch (Exception e) { | ||||
// all released versions of BCEL may throw an IOException | // all released versions of BCEL may throw an IOException | ||||
// here, but BCEL's trunk does no longer declare to do so | // here, but BCEL's trunk does no longer declare to do so | ||||