From 888d09c10709a969536ebc92d89e6af26f1c9d69 Mon Sep 17 00:00:00 2001 From: Sam Ruby Date: Wed, 29 Mar 2000 17:13:31 +0000 Subject: [PATCH] Allow java classes to be called with no arguments PR: 133 git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@267644 13f79535-47bb-0310-9956-ffa450edef68 --- docs/index.html | 6 +++--- src/main/org/apache/tools/ant/taskdefs/Java.java | 4 +++- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/docs/index.html b/docs/index.html index 888f4cf2b..fd631d840 100644 --- a/docs/index.html +++ b/docs/index.html @@ -532,7 +532,7 @@ execution depending on system parameters.

Yes - class + classname the class to look for in classpath. Yes @@ -1211,7 +1211,7 @@ the one that is currently running Ant.

Required - class + classname the Java class to execute. Yes @@ -1854,7 +1854,7 @@ This also holds for properties loaded from a property file.

Yes - class + classname the class for which to run rmic. Yes diff --git a/src/main/org/apache/tools/ant/taskdefs/Java.java b/src/main/org/apache/tools/ant/taskdefs/Java.java index feba88e2e..4bdcaeba2 100644 --- a/src/main/org/apache/tools/ant/taskdefs/Java.java +++ b/src/main/org/apache/tools/ant/taskdefs/Java.java @@ -80,7 +80,7 @@ public class Java extends Exec { project.log("Calling " + classname, "java", project.MSG_VERBOSE); if (classname == null) { - throw new BuildException("Class name must not be null."); + throw new BuildException("Classname must not be null."); } if (fork) { @@ -187,6 +187,8 @@ public class Java extends Exec { */ protected Vector tokenize(String args) { Vector v = new Vector(); + if (args == null) return v; + StringTokenizer t = new StringTokenizer(args, " "); while (t.hasMoreTokens()) {