PR: 36092 Obtained from: Dave Brosius git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@278510 13f79535-47bb-0310-9956-ffa450edef68master
| @@ -174,7 +174,7 @@ public class Launcher { | |||||
| if (libPaths.size() == 0 && cpString == null) { | if (libPaths.size() == 0 && cpString == null) { | ||||
| newArgs = args; | newArgs = args; | ||||
| } else { | } else { | ||||
| newArgs = (String[]) argList.toArray(new String[0]); | |||||
| newArgs = (String[]) argList.toArray(new String[argList.size()]); | |||||
| } | } | ||||
| List libPathURLs = new ArrayList(); | List libPathURLs = new ArrayList(); | ||||
| @@ -188,7 +188,7 @@ public class Launcher { | |||||
| addPath(libPath, true, libPathURLs); | addPath(libPath, true, libPathURLs); | ||||
| } | } | ||||
| URL[] libJars = (URL[]) libPathURLs.toArray(new URL[0]); | |||||
| URL[] libJars = (URL[]) libPathURLs.toArray(new URL[libPathURLs.size()]); | |||||
| // Now try and find JAVA_HOME | // Now try and find JAVA_HOME | ||||
| File toolsJar = Locator.getToolsJar(); | File toolsJar = Locator.getToolsJar(); | ||||
| @@ -341,7 +341,7 @@ public class PathConvert extends Task { | |||||
| ret.add(mapped[m]); | ret.add(mapped[m]); | ||||
| } | } | ||||
| } | } | ||||
| elems = (String[]) ret.toArray(new String[] {}); | |||||
| elems = (String[]) ret.toArray(new String[ret.size()]); | |||||
| } | } | ||||
| for (int i = 0; i < elems.length; i++) { | for (int i = 0; i < elems.length; i++) { | ||||
| String elem = mapElement(elems[i]); // Apply the path prefix map | String elem = mapElement(elems[i]); // Apply the path prefix map | ||||
| @@ -149,7 +149,7 @@ public class Javah extends Task { | |||||
| ClassArgument arg = (ClassArgument) e.nextElement(); | ClassArgument arg = (ClassArgument) e.nextElement(); | ||||
| al.add(arg.getName()); | al.add(arg.getName()); | ||||
| } | } | ||||
| return (String[]) al.toArray(new String[0]); | |||||
| return (String[]) al.toArray(new String[al.size()]); | |||||
| } | } | ||||
| /** | /** | ||||
| @@ -209,7 +209,7 @@ public final class Extension { | |||||
| } | } | ||||
| } | } | ||||
| return (Extension[]) results.toArray(new Extension[0]); | |||||
| return (Extension[]) results.toArray(new Extension[results.size()]); | |||||
| } | } | ||||
| /** | /** | ||||
| @@ -580,7 +580,7 @@ public final class Extension { | |||||
| getExtension(attributes, results, listKey); | getExtension(attributes, results, listKey); | ||||
| } | } | ||||
| return (Extension[]) results.toArray(new Extension[ 0 ]); | |||||
| return (Extension[]) results.toArray(new Extension[results.size()]); | |||||
| } | } | ||||
| /** | /** | ||||
| @@ -183,7 +183,7 @@ public final class Specification { | |||||
| } | } | ||||
| final ArrayList trimmedResults = removeDuplicates(results); | final ArrayList trimmedResults = removeDuplicates(results); | ||||
| return (Specification[]) trimmedResults.toArray(new Specification[0]); | |||||
| return (Specification[]) trimmedResults.toArray(new Specification[trimmedResults.size()]); | |||||
| } | } | ||||
| /** | /** | ||||