ant-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bode...@apache.org
Subject [3/7] ant git commit: objects created for side effects only
Date Wed, 21 Dec 2016 10:23:49 GMT
objects created for side effects only


Project: http://git-wip-us.apache.org/repos/asf/ant/repo
Commit: http://git-wip-us.apache.org/repos/asf/ant/commit/144fc493
Tree: http://git-wip-us.apache.org/repos/asf/ant/tree/144fc493
Diff: http://git-wip-us.apache.org/repos/asf/ant/diff/144fc493

Branch: refs/heads/master
Commit: 144fc493a9f9ee351424721462de538677821343
Parents: 07ce505
Author: Stefan Bodewig <bodewig@apache.org>
Authored: Wed Dec 21 11:11:40 2016 +0100
Committer: Stefan Bodewig <bodewig@apache.org>
Committed: Wed Dec 21 11:11:40 2016 +0100

----------------------------------------------------------------------
 src/main/org/apache/tools/ant/helper/ProjectHelperImpl.java    | 3 ++-
 src/main/org/apache/tools/ant/taskdefs/Javadoc.java            | 3 ++-
 src/main/org/apache/tools/ant/taskdefs/MacroDef.java           | 4 +++-
 .../org/apache/tools/ant/taskdefs/condition/AntVersion.java    | 6 ++++--
 .../apache/tools/ant/util/depend/bcel/AncestorAnalyzer.java    | 2 +-
 .../org/apache/tools/ant/util/depend/bcel/FullAnalyzer.java    | 2 +-
 6 files changed, 13 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ant/blob/144fc493/src/main/org/apache/tools/ant/helper/ProjectHelperImpl.java
----------------------------------------------------------------------
diff --git a/src/main/org/apache/tools/ant/helper/ProjectHelperImpl.java b/src/main/org/apache/tools/ant/helper/ProjectHelperImpl.java
index f828d29..97c42a0 100644
--- a/src/main/org/apache/tools/ant/helper/ProjectHelperImpl.java
+++ b/src/main/org/apache/tools/ant/helper/ProjectHelperImpl.java
@@ -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 {

http://git-wip-us.apache.org/repos/asf/ant/blob/144fc493/src/main/org/apache/tools/ant/taskdefs/Javadoc.java
----------------------------------------------------------------------
diff --git a/src/main/org/apache/tools/ant/taskdefs/Javadoc.java b/src/main/org/apache/tools/ant/taskdefs/Javadoc.java
index b7fb417..9fd3c8a 100644
--- a/src/main/org/apache/tools/ant/taskdefs/Javadoc.java
+++ b/src/main/org/apache/tools/ant/taskdefs/Javadoc.java
@@ -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

http://git-wip-us.apache.org/repos/asf/ant/blob/144fc493/src/main/org/apache/tools/ant/taskdefs/MacroDef.java
----------------------------------------------------------------------
diff --git a/src/main/org/apache/tools/ant/taskdefs/MacroDef.java b/src/main/org/apache/tools/ant/taskdefs/MacroDef.java
index 63f68c5..95757b6 100644
--- a/src/main/org/apache/tools/ant/taskdefs/MacroDef.java
+++ b/src/main/org/apache/tools/ant/taskdefs/MacroDef.java
@@ -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 =

http://git-wip-us.apache.org/repos/asf/ant/blob/144fc493/src/main/org/apache/tools/ant/taskdefs/condition/AntVersion.java
----------------------------------------------------------------------
diff --git a/src/main/org/apache/tools/ant/taskdefs/condition/AntVersion.java b/src/main/org/apache/tools/ant/taskdefs/condition/AntVersion.java
index aadf5a7..ec21d4b 100644
--- a/src/main/org/apache/tools/ant/taskdefs/condition/AntVersion.java
+++ b/src/main/org/apache/tools/ant/taskdefs/condition/AntVersion.java
@@ -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 : "

http://git-wip-us.apache.org/repos/asf/ant/blob/144fc493/src/main/org/apache/tools/ant/util/depend/bcel/AncestorAnalyzer.java
----------------------------------------------------------------------
diff --git a/src/main/org/apache/tools/ant/util/depend/bcel/AncestorAnalyzer.java b/src/main/org/apache/tools/ant/util/depend/bcel/AncestorAnalyzer.java
index 2bd2a6c..613bc77 100644
--- a/src/main/org/apache/tools/ant/util/depend/bcel/AncestorAnalyzer.java
+++ b/src/main/org/apache/tools/ant/util/depend/bcel/AncestorAnalyzer.java
@@ -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

http://git-wip-us.apache.org/repos/asf/ant/blob/144fc493/src/main/org/apache/tools/ant/util/depend/bcel/FullAnalyzer.java
----------------------------------------------------------------------
diff --git a/src/main/org/apache/tools/ant/util/depend/bcel/FullAnalyzer.java b/src/main/org/apache/tools/ant/util/depend/bcel/FullAnalyzer.java
index f270fd4..3bd6c75 100644
--- a/src/main/org/apache/tools/ant/util/depend/bcel/FullAnalyzer.java
+++ b/src/main/org/apache/tools/ant/util/depend/bcel/FullAnalyzer.java
@@ -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


Mime
View raw message