Browse Source

making method a little smaller

git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@490781 13f79535-47bb-0310-9956-ffa450edef68
master
Peter Reilly 18 years ago
parent
commit
530826d076
1 changed files with 17 additions and 10 deletions
  1. +17
    -10
      src/main/org/apache/tools/ant/Main.java

+ 17
- 10
src/main/org/apache/tools/ant/Main.java View File

@@ -26,9 +26,11 @@ import java.io.InputStream;
import java.io.PrintStream;
import java.util.Enumeration;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.Map;
import java.util.Properties;
import java.util.Set;
import java.util.Vector;

import org.apache.tools.ant.input.DefaultInputHandler;
@@ -52,6 +54,20 @@ import org.apache.tools.ant.util.ProxySetup;
*/
public class Main implements AntMain {

/**
* A Set of args are are handled by the launcher and should
* not be seen by Main.
*/
private static final Set LAUNCH_COMMANDS = new HashSet();
static {
LAUNCH_COMMANDS.add("-lib");
LAUNCH_COMMANDS.add("-cp");
LAUNCH_COMMANDS.add("-noclasspath");
LAUNCH_COMMANDS.add("--noclasspath");
LAUNCH_COMMANDS.add("-nouserlib");
LAUNCH_COMMANDS.add("-main");
}

/** The default build file name. {@value} */
public static final String DEFAULT_BUILD_FILENAME = "build.xml";

@@ -287,15 +303,6 @@ public class Main implements AntMain {
String searchForThis = null;
PrintStream logTo = null;

//this is the list of lu
HashMap launchCommands = new HashMap();
launchCommands.put("-lib", "");
launchCommands.put("-cp", "");
launchCommands.put("-noclasspath", "");
launchCommands.put("--noclasspath", "");
launchCommands.put("-nouserlib", "");
launchCommands.put("--nouserlib", "");
launchCommands.put("-main", "");
// cycle through given args

for (int i = 0; i < args.length; i++) {
@@ -445,7 +452,7 @@ public class Main implements AntMain {
throw new BuildException(
"Niceness value is out of the range 1-10");
}
} else if (launchCommands.get(arg) != null) {
} else if (LAUNCH_COMMANDS.contains(arg)) {
//catch script/ant mismatch with a meaningful message
//we could ignore it, but there are likely to be other
//version problems, so we stamp down on the configuration now


Loading…
Cancel
Save