Browse Source

objects created for side effects only

master
Stefan Bodewig 8 years ago
parent
commit
144fc493a9
6 changed files with 13 additions and 7 deletions
  1. +2
    -1
      src/main/org/apache/tools/ant/helper/ProjectHelperImpl.java
  2. +2
    -1
      src/main/org/apache/tools/ant/taskdefs/Javadoc.java
  3. +3
    -1
      src/main/org/apache/tools/ant/taskdefs/MacroDef.java
  4. +4
    -2
      src/main/org/apache/tools/ant/taskdefs/condition/AntVersion.java
  5. +1
    -1
      src/main/org/apache/tools/ant/util/depend/bcel/AncestorAnalyzer.java
  6. +1
    -1
      src/main/org/apache/tools/ant/util/depend/bcel/FullAnalyzer.java

+ 2
- 1
src/main/org/apache/tools/ant/helper/ProjectHelperImpl.java View File

@@ -600,7 +600,8 @@ public class ProjectHelperImpl extends ProjectHelper {
private static void handleElement(ProjectHelperImpl helperImpl, DocumentHandler parent,
Target target, String elementName, AttributeList attrs) throws SAXParseException {
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) {
new DataTypeHandler(helperImpl, parent, target).init(elementName, attrs);
} else {


+ 2
- 1
src/main/org/apache/tools/ant/taskdefs/Javadoc.java View File

@@ -2026,7 +2026,8 @@ public class Javadoc extends Task {
// is the href a valid URL
try {
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();
} catch (final MalformedURLException mue) {
// ok - just skip


+ 3
- 1
src/main/org/apache/tools/ant/taskdefs/MacroDef.java View File

@@ -183,7 +183,9 @@ public class MacroDef extends AntlibDefinition {
ret.setTaskName("sequential");
ret.setNamespace("");
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();
for (int i = 0; i < size; ++i) {
UnknownElement e =


+ 4
- 2
src/main/org/apache/tools/ant/taskdefs/condition/AntVersion.java View File

@@ -78,7 +78,8 @@ public class AntVersion extends Task implements Condition {
}
if (atLeast != null) {
try {
new DeweyDecimal(atLeast);
// only created for side effect
new DeweyDecimal(atLeast); //NOSONAR
} catch (NumberFormatException e) {
throw new BuildException(
"The 'atleast' attribute is not a Dewey Decimal eg 1.1.0 : "
@@ -86,7 +87,8 @@ public class AntVersion extends Task implements Condition {
}
} else {
try {
new DeweyDecimal(exactly);
// only created for side effect
new DeweyDecimal(exactly); //NOSONAR
} catch (NumberFormatException e) {
throw new BuildException(
"The 'exactly' attribute is not a Dewey Decimal eg 1.1.0 : "


+ 1
- 1
src/main/org/apache/tools/ant/util/depend/bcel/AncestorAnalyzer.java View File

@@ -42,7 +42,7 @@ public class AncestorAnalyzer extends AbstractAnalyzer {
public AncestorAnalyzer() {
// force BCEL classes to load now
try {
new ClassParser("force");
new ClassParser("force"); //NOSONAR
} catch (Exception e) {
// all released versions of BCEL may throw an IOException
// here, but BCEL's trunk does no longer declare to do so


+ 1
- 1
src/main/org/apache/tools/ant/util/depend/bcel/FullAnalyzer.java View File

@@ -41,7 +41,7 @@ public class FullAnalyzer extends AbstractAnalyzer {
public FullAnalyzer() {
// force BCEL classes to load now
try {
new ClassParser("force");
new ClassParser("force"); //NOSONAR
} catch (Exception e) {
// all released versions of BCEL may throw an IOException
// here, but BCEL's trunk does no longer declare to do so


Loading…
Cancel
Save