Browse Source

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
master
Sam Ruby 25 years ago
parent
commit
888d09c107
2 changed files with 6 additions and 4 deletions
  1. +3
    -3
      docs/index.html
  2. +3
    -1
      src/main/org/apache/tools/ant/taskdefs/Java.java

+ 3
- 3
docs/index.html View File

@@ -532,7 +532,7 @@ execution depending on system parameters.</p>
<td valign="top" align="center">Yes</td>
</tr>
<tr>
<td valign="top">class</td>
<td valign="top">classname</td>
<td valign="top">the class to look for in classpath.</td>
<td valign="middle" align="center" rowspan="3">Yes</td>
</tr>
@@ -1211,7 +1211,7 @@ the one that is currently running Ant.</p>
<td align="center" valign="top"><b>Required</b></td>
</tr>
<tr>
<td valign="top">class</td>
<td valign="top">classname</td>
<td valign="top">the Java class to execute.</td>
<td align="center" valign="top">Yes</td>
</tr>
@@ -1854,7 +1854,7 @@ This also holds for properties loaded from a property file.</p>
<td valign="top" align="center">Yes</td>
</tr>
<tr>
<td valign="top">class</td>
<td valign="top">classname</td>
<td valign="top">the class for which to run <code>rmic</code>.</td>
<td valign="top" align="center">Yes</td>
</tr>


+ 3
- 1
src/main/org/apache/tools/ant/taskdefs/Java.java View File

@@ -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()) {


Loading…
Cancel
Save