Browse Source

Remove temp variable/method call, some blank lines

git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@277613 13f79535-47bb-0310-9956-ffa450edef68
master
Matthew Jason Benson 20 years ago
parent
commit
bb7647cf3f
1 changed files with 1 additions and 8 deletions
  1. +1
    -8
      src/main/org/apache/tools/ant/taskdefs/ExecuteJava.java

+ 1
- 8
src/main/org/apache/tools/ant/taskdefs/ExecuteJava.java View File

@@ -103,8 +103,6 @@ public class ExecuteJava implements Runnable, TimeoutObserver {
if (sysProperties != null) {
sysProperties.setSystem();
}

final Class[] param = {Class.forName("[Ljava.lang.String;")};
Class target = null;
if (classpath == null) {
target = Class.forName(classname);
@@ -118,18 +116,15 @@ public class ExecuteJava implements Runnable, TimeoutObserver {
loader.forceLoadClass(classname);
target = Class.forName(classname, true, loader);
}
main = target.getMethod("main", param);
main = target.getMethod("main", new Class[] {String[].class});
if (main == null) {
throw new BuildException("Could not find main() method in "
+ classname);
}

if ((main.getModifiers() & Modifier.STATIC) == 0) {
throw new BuildException("main() method in " + classname
+ " is not declared static");
}


if (timeout == null) {
run();
} else {
@@ -161,11 +156,9 @@ public class ExecuteJava implements Runnable, TimeoutObserver {
}
}
}

if (caught != null) {
throw caught;
}

} catch (ClassNotFoundException e) {
throw new BuildException("Could not find " + classname + "."
+ " Make sure you have it in your"


Loading…
Cancel
Save