conor 01/08/27 06:37:06
Modified: src/main/org/apache/tools/ant/types Tag: ANT_14_BRANCH
CommandlineJava.java
Log:
Fix the calculartion of size so that the same tests are done in
size() as in getCommandLine(). This BADLY needs a refactor because
the size of the command line is subject to too many variations
Revision Changes Path
No revision
No revision
1.16.2.1 +3 -2
jakarta-ant/src/main/org/apache/tools/ant/types/CommandlineJava.java
Index: CommandlineJava.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/src/main/org/apache/tools/ant/types/CommandlineJava.java,v
retrieving revision 1.16
retrieving revision 1.16.2.1
diff -u -r1.16 -r1.16.2.1
--- CommandlineJava.java 2001/08/03 20:47:33 1.16
+++ CommandlineJava.java 2001/08/27 13:37:05 1.16.2.1
@@ -221,7 +221,7 @@
* @return the list of all arguments necessary to run the vm.
*/
public String[] getCommandline() {
- String[] result = new String[size()];
+ String[] result = new String[size()];
int pos = 0;
String[] vmArgs = getActualVMCommand().getCommandline();
// first argument is the java.exe path...
@@ -285,7 +285,8 @@
public int size() {
int size = getActualVMCommand().size() + javaCommand.size() +
sysProperties.size();
// classpath is "-classpath <classpath>" -> 2 args
- if (classpath != null && classpath.size() > 0) {
+ Path fullClasspath = classpath != null ?
classpath.concatSystemClasspath("ignore") : null;
+ if (fullClasspath != null &&
fullClasspath.toString().trim().length() > 0) {
size += 2;
}
// jar execution requires an additional -jar option