new Long...longValue new Int...intValue -> Long.parseLong(..) and arraycopy to copy arrays git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@526548 13f79535-47bb-0310-9956-ffa450edef68master
@@ -182,11 +182,11 @@ public final class HeadFilter extends BaseParamFilterReader | |||||
if (params != null) { | if (params != null) { | ||||
for (int i = 0; i < params.length; i++) { | for (int i = 0; i < params.length; i++) { | ||||
if (LINES_KEY.equals(params[i].getName())) { | if (LINES_KEY.equals(params[i].getName())) { | ||||
lines = new Long(params[i].getValue()).longValue(); | |||||
lines = Long.parseLong(params[i].getValue()); | |||||
continue; | continue; | ||||
} | } | ||||
if (SKIP_KEY.equals(params[i].getName())) { | if (SKIP_KEY.equals(params[i].getName())) { | ||||
skip = new Long(params[i].getValue()).longValue(); | |||||
skip = Long.parseLong(params[i].getValue()); | |||||
continue; | continue; | ||||
} | } | ||||
} | } | ||||
@@ -144,8 +144,7 @@ public final class TabsToSpaces | |||||
for (int i = 0; i < params.length; i++) { | for (int i = 0; i < params.length; i++) { | ||||
if (params[i] != null) { | if (params[i] != null) { | ||||
if (TAB_LENGTH_KEY.equals(params[i].getName())) { | if (TAB_LENGTH_KEY.equals(params[i].getName())) { | ||||
tabLength = | |||||
new Integer(params[i].getValue()).intValue(); | |||||
tabLength = Integer.parseInt(params[i].getValue()); | |||||
break; | break; | ||||
} | } | ||||
} | } | ||||
@@ -188,11 +188,11 @@ public final class TailFilter extends BaseParamFilterReader | |||||
if (params != null) { | if (params != null) { | ||||
for (int i = 0; i < params.length; i++) { | for (int i = 0; i < params.length; i++) { | ||||
if (LINES_KEY.equals(params[i].getName())) { | if (LINES_KEY.equals(params[i].getName())) { | ||||
setLines(new Long(params[i].getValue()).longValue()); | |||||
setLines(Long.parseLong(params[i].getValue())); | |||||
continue; | continue; | ||||
} | } | ||||
if (SKIP_KEY.equals(params[i].getName())) { | if (SKIP_KEY.equals(params[i].getName())) { | ||||
skip = new Long(params[i].getValue()).longValue(); | |||||
skip = Long.parseLong(params[i].getValue()); | |||||
continue; | continue; | ||||
} | } | ||||
} | } | ||||
@@ -472,7 +472,7 @@ public class GenericDeploymentTool implements EJBDeploymentTool { | |||||
throw new BuildException(msg, se); | throw new BuildException(msg, se); | ||||
} catch (IOException ioe) { | } catch (IOException ioe) { | ||||
String msg = "IOException while parsing'" | String msg = "IOException while parsing'" | ||||
+ descriptorFileName.toString() | |||||
+ descriptorFileName | |||||
+ "'. This probably indicates that the descriptor" | + "'. This probably indicates that the descriptor" | ||||
+ " doesn't exist. Details: " | + " doesn't exist. Details: " | ||||
+ ioe.getMessage(); | + ioe.getMessage(); | ||||
@@ -2201,7 +2201,7 @@ public class FTP | |||||
if (dir.indexOf("/") == 0) { | if (dir.indexOf("/") == 0) { | ||||
ftp.changeWorkingDirectory("/"); | ftp.changeWorkingDirectory("/"); | ||||
} | } | ||||
String subdir = new String(); | |||||
String subdir = ""; | |||||
StringTokenizer st = new StringTokenizer(dir, "/"); | StringTokenizer st = new StringTokenizer(dir, "/"); | ||||
while (st.hasMoreTokens()) { | while (st.hasMoreTokens()) { | ||||
subdir = st.nextToken(); | subdir = st.nextToken(); | ||||
@@ -173,8 +173,7 @@ public class DateSelector extends BaseExtendSelector { | |||||
String paramname = parameters[i].getName(); | String paramname = parameters[i].getName(); | ||||
if (MILLIS_KEY.equalsIgnoreCase(paramname)) { | if (MILLIS_KEY.equalsIgnoreCase(paramname)) { | ||||
try { | try { | ||||
setMillis(new Long(parameters[i].getValue() | |||||
).longValue()); | |||||
setMillis(Long.parseLong(parameters[i].getValue())); | |||||
} catch (NumberFormatException nfe) { | } catch (NumberFormatException nfe) { | ||||
setError("Invalid millisecond setting " | setError("Invalid millisecond setting " | ||||
+ parameters[i].getValue()); | + parameters[i].getValue()); | ||||
@@ -185,8 +184,7 @@ public class DateSelector extends BaseExtendSelector { | |||||
setCheckdirs(Project.toBoolean(parameters[i].getValue())); | setCheckdirs(Project.toBoolean(parameters[i].getValue())); | ||||
} else if (GRANULARITY_KEY.equalsIgnoreCase(paramname)) { | } else if (GRANULARITY_KEY.equalsIgnoreCase(paramname)) { | ||||
try { | try { | ||||
setGranularity(new Integer(parameters[i].getValue() | |||||
).intValue()); | |||||
setGranularity(Integer.parseInt(parameters[i].getValue())); | |||||
} catch (NumberFormatException nfe) { | } catch (NumberFormatException nfe) { | ||||
setError("Invalid granularity setting " | setError("Invalid granularity setting " | ||||
+ parameters[i].getValue()); | + parameters[i].getValue()); | ||||
@@ -153,8 +153,7 @@ public class SizeSelector extends BaseExtendSelector { | |||||
String paramname = parameters[i].getName(); | String paramname = parameters[i].getName(); | ||||
if (SIZE_KEY.equalsIgnoreCase(paramname)) { | if (SIZE_KEY.equalsIgnoreCase(paramname)) { | ||||
try { | try { | ||||
setValue(new Long(parameters[i].getValue() | |||||
).longValue()); | |||||
setValue(Long.parseLong(parameters[i].getValue())); | |||||
} catch (NumberFormatException nfe) { | } catch (NumberFormatException nfe) { | ||||
setError("Invalid size setting " | setError("Invalid size setting " | ||||
+ parameters[i].getValue()); | + parameters[i].getValue()); | ||||
@@ -18,6 +18,7 @@ | |||||
package org.apache.tools.ant.util; | package org.apache.tools.ant.util; | ||||
import java.util.StringTokenizer; | import java.util.StringTokenizer; | ||||
import java.util.Arrays; | |||||
/** | /** | ||||
* Utility class to contain version numbers in "Dewey Decimal" | * Utility class to contain version numbers in "Dewey Decimal" | ||||
@@ -40,10 +41,7 @@ public class DeweyDecimal { | |||||
*/ | */ | ||||
public DeweyDecimal(final int[] components) { | public DeweyDecimal(final int[] components) { | ||||
this.components = new int[components.length]; | 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); | |||||
} | } | ||||
/** | /** | ||||