ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From j..@apache.org
Subject svn commit: r526548 - in /ant/core/trunk/src/main/org/apache/tools/ant: filters/ taskdefs/optional/ejb/ taskdefs/optional/net/ types/selectors/ util/
Date Sun, 08 Apr 2007 12:43:37 GMT
Author: jkf
Date: Sun Apr  8 05:43:36 2007
New Revision: 526548

URL: http://svn.apache.org/viewvc?view=rev&rev=526548
Log:
Changes after static code analysis.
new Long...longValue  new Int...intValue -> Long.parseLong(..)
and arraycopy to copy arrays

Modified:
    ant/core/trunk/src/main/org/apache/tools/ant/filters/HeadFilter.java
    ant/core/trunk/src/main/org/apache/tools/ant/filters/TabsToSpaces.java
    ant/core/trunk/src/main/org/apache/tools/ant/filters/TailFilter.java
    ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/ejb/GenericDeploymentTool.java
    ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/net/FTP.java
    ant/core/trunk/src/main/org/apache/tools/ant/types/selectors/DateSelector.java
    ant/core/trunk/src/main/org/apache/tools/ant/types/selectors/SizeSelector.java
    ant/core/trunk/src/main/org/apache/tools/ant/util/DeweyDecimal.java

Modified: ant/core/trunk/src/main/org/apache/tools/ant/filters/HeadFilter.java
URL: http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/filters/HeadFilter.java?view=diff&rev=526548&r1=526547&r2=526548
==============================================================================
--- ant/core/trunk/src/main/org/apache/tools/ant/filters/HeadFilter.java (original)
+++ ant/core/trunk/src/main/org/apache/tools/ant/filters/HeadFilter.java Sun Apr  8 05:43:36
2007
@@ -182,11 +182,11 @@
         if (params != null) {
             for (int i = 0; i < params.length; i++) {
                 if (LINES_KEY.equals(params[i].getName())) {
-                    lines = new Long(params[i].getValue()).longValue();
+                    lines = Long.parseLong(params[i].getValue());
                     continue;
                 }
                 if (SKIP_KEY.equals(params[i].getName())) {
-                    skip = new Long(params[i].getValue()).longValue();
+                    skip = Long.parseLong(params[i].getValue());
                     continue;
                 }
             }

Modified: ant/core/trunk/src/main/org/apache/tools/ant/filters/TabsToSpaces.java
URL: http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/filters/TabsToSpaces.java?view=diff&rev=526548&r1=526547&r2=526548
==============================================================================
--- ant/core/trunk/src/main/org/apache/tools/ant/filters/TabsToSpaces.java (original)
+++ ant/core/trunk/src/main/org/apache/tools/ant/filters/TabsToSpaces.java Sun Apr  8 05:43:36
2007
@@ -144,8 +144,7 @@
             for (int i = 0; i < params.length; i++) {
                 if (params[i] != null) {
                     if (TAB_LENGTH_KEY.equals(params[i].getName())) {
-                        tabLength =
-                            new Integer(params[i].getValue()).intValue();
+                        tabLength = Integer.parseInt(params[i].getValue());
                         break;
                     }
                 }

Modified: ant/core/trunk/src/main/org/apache/tools/ant/filters/TailFilter.java
URL: http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/filters/TailFilter.java?view=diff&rev=526548&r1=526547&r2=526548
==============================================================================
--- ant/core/trunk/src/main/org/apache/tools/ant/filters/TailFilter.java (original)
+++ ant/core/trunk/src/main/org/apache/tools/ant/filters/TailFilter.java Sun Apr  8 05:43:36
2007
@@ -188,11 +188,11 @@
         if (params != null) {
             for (int i = 0; i < params.length; i++) {
                 if (LINES_KEY.equals(params[i].getName())) {
-                    setLines(new Long(params[i].getValue()).longValue());
+                    setLines(Long.parseLong(params[i].getValue()));
                     continue;
                 }
                 if (SKIP_KEY.equals(params[i].getName())) {
-                    skip = new Long(params[i].getValue()).longValue();
+                    skip = Long.parseLong(params[i].getValue());
                     continue;
                 }
             }

Modified: ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/ejb/GenericDeploymentTool.java
URL: http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/ejb/GenericDeploymentTool.java?view=diff&rev=526548&r1=526547&r2=526548
==============================================================================
--- ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/ejb/GenericDeploymentTool.java
(original)
+++ ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/ejb/GenericDeploymentTool.java
Sun Apr  8 05:43:36 2007
@@ -472,7 +472,7 @@
             throw new BuildException(msg, se);
         } catch (IOException ioe) {
             String msg = "IOException while parsing'"
-                + descriptorFileName.toString()
+                + descriptorFileName
                 + "'.  This probably indicates that the descriptor"
                 + " doesn't exist. Details: "
                 + ioe.getMessage();

Modified: ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/net/FTP.java
URL: http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/net/FTP.java?view=diff&rev=526548&r1=526547&r2=526548
==============================================================================
--- ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/net/FTP.java (original)
+++ ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/net/FTP.java Sun Apr  8
05:43:36 2007
@@ -2201,7 +2201,7 @@
         if (dir.indexOf("/") == 0) {
             ftp.changeWorkingDirectory("/");
         }
-        String subdir = new String();
+        String subdir = "";
         StringTokenizer st = new StringTokenizer(dir, "/");
         while (st.hasMoreTokens()) {
             subdir = st.nextToken();

Modified: ant/core/trunk/src/main/org/apache/tools/ant/types/selectors/DateSelector.java
URL: http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/types/selectors/DateSelector.java?view=diff&rev=526548&r1=526547&r2=526548
==============================================================================
--- ant/core/trunk/src/main/org/apache/tools/ant/types/selectors/DateSelector.java (original)
+++ ant/core/trunk/src/main/org/apache/tools/ant/types/selectors/DateSelector.java Sun Apr
 8 05:43:36 2007
@@ -173,8 +173,7 @@
                 String paramname = parameters[i].getName();
                 if (MILLIS_KEY.equalsIgnoreCase(paramname)) {
                     try {
-                        setMillis(new Long(parameters[i].getValue()
-                        ).longValue());
+                        setMillis(Long.parseLong(parameters[i].getValue()));
                     } catch (NumberFormatException nfe) {
                         setError("Invalid millisecond setting "
                                 + parameters[i].getValue());
@@ -185,8 +184,7 @@
                     setCheckdirs(Project.toBoolean(parameters[i].getValue()));
                 } else if (GRANULARITY_KEY.equalsIgnoreCase(paramname)) {
                     try {
-                        setGranularity(new Integer(parameters[i].getValue()
-                        ).intValue());
+                        setGranularity(Integer.parseInt(parameters[i].getValue()));
                     } catch (NumberFormatException nfe) {
                         setError("Invalid granularity setting "
                             + parameters[i].getValue());

Modified: ant/core/trunk/src/main/org/apache/tools/ant/types/selectors/SizeSelector.java
URL: http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/types/selectors/SizeSelector.java?view=diff&rev=526548&r1=526547&r2=526548
==============================================================================
--- ant/core/trunk/src/main/org/apache/tools/ant/types/selectors/SizeSelector.java (original)
+++ ant/core/trunk/src/main/org/apache/tools/ant/types/selectors/SizeSelector.java Sun Apr
 8 05:43:36 2007
@@ -153,8 +153,7 @@
                 String paramname = parameters[i].getName();
                 if (SIZE_KEY.equalsIgnoreCase(paramname)) {
                     try {
-                        setValue(new Long(parameters[i].getValue()
-                        ).longValue());
+                        setValue(Long.parseLong(parameters[i].getValue()));
                     } catch (NumberFormatException nfe) {
                         setError("Invalid size setting "
                                 + parameters[i].getValue());

Modified: ant/core/trunk/src/main/org/apache/tools/ant/util/DeweyDecimal.java
URL: http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/util/DeweyDecimal.java?view=diff&rev=526548&r1=526547&r2=526548
==============================================================================
--- ant/core/trunk/src/main/org/apache/tools/ant/util/DeweyDecimal.java (original)
+++ ant/core/trunk/src/main/org/apache/tools/ant/util/DeweyDecimal.java Sun Apr  8 05:43:36
2007
@@ -18,6 +18,7 @@
 package org.apache.tools.ant.util;
 
 import java.util.StringTokenizer;
+import java.util.Arrays;
 
 /**
  * Utility class to contain version numbers in "Dewey Decimal"
@@ -40,10 +41,7 @@
      */
     public DeweyDecimal(final int[] components) {
         this.components = new int[components.length];
-
-        for (int i = 0; i < components.length; i++) {
-            this.components[i] = components[i];
-        }
+        System.arraycopy(components, 0, this.components, 0, components.length);
     }
 
     /**



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org


Mime
View raw message