Browse Source

some checkstyle changes

git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@469717 13f79535-47bb-0310-9956-ffa450edef68
master
Peter Reilly 18 years ago
parent
commit
0aa2b2528f
18 changed files with 114 additions and 94 deletions
  1. +4
    -0
      src/main/org/apache/tools/ant/AntClassLoader.java
  2. +7
    -6
      src/main/org/apache/tools/ant/AntTypeDefinition.java
  3. +32
    -23
      src/main/org/apache/tools/ant/ComponentHelper.java
  4. +24
    -23
      src/main/org/apache/tools/ant/Diagnostics.java
  5. +10
    -9
      src/main/org/apache/tools/ant/DirectoryScanner.java
  6. +1
    -1
      src/main/org/apache/tools/ant/MagicNames.java
  7. +6
    -6
      src/main/org/apache/tools/ant/Main.java
  8. +5
    -3
      src/main/org/apache/tools/ant/Project.java
  9. +2
    -2
      src/main/org/apache/tools/ant/ProjectComponent.java
  10. +3
    -3
      src/main/org/apache/tools/ant/Task.java
  11. +0
    -1
      src/main/org/apache/tools/ant/UnknownElement.java
  12. +3
    -1
      src/main/org/apache/tools/ant/filters/FixCrLfFilter.java
  13. +1
    -1
      src/main/org/apache/tools/ant/filters/ReplaceTokens.java
  14. +7
    -7
      src/main/org/apache/tools/ant/helper/ProjectHelper2.java
  15. +3
    -3
      src/main/org/apache/tools/ant/helper/ProjectHelperImpl.java
  16. +1
    -0
      src/main/org/apache/tools/ant/input/GreedyInputHandler.java
  17. +2
    -0
      src/main/org/apache/tools/ant/input/InputRequest.java
  18. +3
    -5
      src/main/org/apache/tools/ant/launch/Launcher.java

+ 4
- 0
src/main/org/apache/tools/ant/AntClassLoader.java View File

@@ -1538,6 +1538,10 @@ public class AntClassLoader extends ClassLoader implements SubBuildListener {
}
}

/**
* Returns a <code>String</code> representing this loader.
* @return the path that this classloader has.
*/
public String toString() {
return "AntClassLoader[" + getClasspath() + "]";
}


+ 7
- 6
src/main/org/apache/tools/ant/AntTypeDefinition.java View File

@@ -163,8 +163,9 @@ public class AntTypeDefinition {
/**
* Try and load a class, with no attempt to catch any fault.
* @return the class that implements this component
* @throws ClassNotFoundException
* @throws NoClassDefFoundError
* @throws ClassNotFoundException if the class cannot be found.
* @throws NoClassDefFoundError if the there is an error
* finding the class.
*/
public Class innerGetTypeClass() throws ClassNotFoundException {
if (clazz != null) {
@@ -284,10 +285,10 @@ public class AntTypeDefinition {
* @param newclass class to create
* @param project
* @return a newly constructed and bound instance.
* @throws NoSuchMethodException
* @throws InstantiationException
* @throws IllegalAccessException
* @throws InvocationTargetException
* @throws NoSuchMethodException no good construtor.
* @throws InstantiationException cannot initialize the object.
* @throws IllegalAccessException cannot access the object.
* @throws InvocationTargetException error in invocation.
*/
public Object innerCreateAndSet(Class newclass, Project project)
throws NoSuchMethodException,


+ 32
- 23
src/main/org/apache/tools/ant/ComponentHelper.java View File

@@ -124,8 +124,8 @@ public class ComponentHelper {
* contrived work here to enable this early.
*/
private static final String ANT_PROPERTY_TASK = "property";
// {tasks, types}
// {tasks, types}
private static Properties[] defaultDefinitions = new Properties[2];


@@ -502,14 +502,17 @@ public class ComponentHelper {
if (c == null || !(Task.class.isAssignableFrom(c))) {
return null;
}
Object _task = createComponent(taskType);
if (_task == null) {
Object obj= createComponent(taskType);
if (obj == null) {
return null;
}
if (!(_task instanceof Task)) {
throw new BuildException("Expected a Task from '" + taskType + "' but got an instance of " + _task.getClass().getName() + " instead");
if (!(obj instanceof Task)) {
throw new BuildException(
"Expected a Task from '" + taskType
+ "' but got an instance of " + obj.getClass().getName()
+ " instead");
}
Task task = (Task) _task;
Task task = (Task) obj;
task.setTaskType(taskType);

// set default value, can be changed by the user
@@ -741,7 +744,7 @@ public class ComponentHelper {
}
return classLoader;
}
/**
* Load default task or type definitions - just the names,
* no class loading.
@@ -846,22 +849,22 @@ public class ComponentHelper {
String home = System.getProperty(Launcher.USER_HOMEDIR);
File libDir = new File(home, Launcher.USER_LIBDIR);
String antHomeLib;
boolean probablyIDE=false;
boolean probablyIDE = false;
String anthome = System.getProperty(MagicNames.ANT_HOME);
if(anthome!=null) {
File antHomeLibDir = new File(anthome,"lib");
antHomeLib=antHomeLibDir.getAbsolutePath();
if (anthome != null) {
File antHomeLibDir = new File(anthome, "lib");
antHomeLib = antHomeLibDir.getAbsolutePath();
} else {
//running under an IDE that doesn't set ANT_HOME
probablyIDE=true;
antHomeLib = "ANT_HOME" +File.separatorChar +"lib";
probablyIDE = true;
antHomeLib = "ANT_HOME" + File.separatorChar + "lib";
}
StringBuffer dirListingText = new StringBuffer();
final String tab = " -";
dirListingText.append(tab);
dirListingText.append(antHomeLib);
dirListingText.append('\n');
if(probablyIDE) {
if (probablyIDE) {
dirListingText.append(tab);
dirListingText.append("the IDE Ant configuration dialogs");
} else {
@@ -873,8 +876,8 @@ public class ComponentHelper {
"a directory added on the command line with the -lib argument");
}

String dirListing=dirListingText.toString();
String dirListing = dirListingText.toString();
//look up the name
AntTypeDefinition def = getDefinition(componentName);
if (def == null) {
@@ -883,7 +886,8 @@ public class ComponentHelper {
out.println("Cause: The name is undefined.");
out.println("Action: Check the spelling.");
out.println("Action: Check that any custom tasks/types have been declared.");
out.println("Action: Check that any <presetdef>/<macrodef> declarations have taken place.");
out.println("Action: Check that any <presetdef>/<macrodef>"
+ " declarations have taken place.");
if (isAntlib) {
out.println();
out.println("This appears to be an antlib declaration. ");
@@ -921,12 +925,16 @@ public class ComponentHelper {
+ ncdfe.getMessage());
if (optional) {
out.println(" It is not enough to have Ant's optional JARs");
out.println(" you need the JAR files that the optional tasks depend upon.");
out.println(" Ant's optional task dependencies are listed in the manual.");
out.println(" you need the JAR files that the"
+ " optional tasks depend upon.");
out.println(" Ant's optional task dependencies are"
+ " listed in the manual.");
} else {
out.println(" This class may be in a separate JAR that is not installed.");
out.println(" This class may be in a separate JAR"
+ " that is not installed.");
}
out.println("Action: Determine what extra JAR files are needed, and place them in one of:");
out.println("Action: Determine what extra JAR files are"
+ " needed, and place them in one of:");
out.println(dirListing);
}
//here we successfully loaded the class or failed.
@@ -960,7 +968,8 @@ public class ComponentHelper {
out.println("Cause: A class needed by class "
+ classname + " cannot be found: ");
out.println(" " + ncdfe.getMessage());
out.println("Action: Determine what extra JAR files are needed, and place them in:");
out.println("Action: Determine what extra JAR files are"
+ " needed, and place them in:");
out.println(dirListing);
}
}


+ 24
- 23
src/main/org/apache/tools/ant/Diagnostics.java View File

@@ -71,7 +71,8 @@ public final class Diagnostics {
* The error text when a security manager blocks access to a property.
* {@value}
*/
protected static final String ERROR_PROPERTY_ACCESS_BLOCKED = "Access to this property blocked by a security manager";
protected static final String ERROR_PROPERTY_ACCESS_BLOCKED
= "Access to this property blocked by a security manager";

/** utility class */
private Diagnostics() {
@@ -239,14 +240,13 @@ public final class Diagnostics {
}

/**
* ignore exceptions. This is to allow future
* ignore exceptions. This is to allow future
* implementations to log at a verbose level
* @param thrown
*/
private static void ignoreThrowable(Throwable thrown) {
}
/**
* get the location of a class. Stolen from axis/webapps/happyaxis.jsp
* @param clazz
@@ -279,7 +279,7 @@ public final class Diagnostics {
ignoreThrowable(e);
out.println("optional tasks : not available");
}
header(out, "ANT PROPERTIES");
doReportAntProperties(out);

@@ -306,10 +306,10 @@ public final class Diagnostics {

header(out, "Locale information");
doReportLocale(out);
header(out, "Proxy information");
doReportProxy(out);
out.println();
}

@@ -344,7 +344,7 @@ public final class Diagnostics {

/**
* Get the value of a system property. If a security manager
* blocks access to a property it fills the result in with an error
* blocks access to a property it fills the result in with an error
* @param key
* @return the system property's value or error text
* @see #ERROR_PROPERTY_ACCESS_BLOCKED
@@ -367,7 +367,8 @@ public final class Diagnostics {
Project p = new Project();
p.initProperties();
out.println(MagicNames.ANT_VERSION + ": " + p.getProperty(MagicNames.ANT_VERSION));
out.println(MagicNames.ANT_JAVA_VERSION + ": " + p.getProperty(MagicNames.ANT_JAVA_VERSION));
out.println(MagicNames.ANT_JAVA_VERSION + ": "
+ p.getProperty(MagicNames.ANT_JAVA_VERSION));
out.println(MagicNames.ANT_LIB + ": " + p.getProperty(MagicNames.ANT_LIB));
out.println(MagicNames.ANT_HOME + ": " + p.getProperty(MagicNames.ANT_HOME));
}
@@ -462,7 +463,7 @@ public final class Diagnostics {
Class.forName(classname);
props.remove(key);
} catch (ClassNotFoundException e) {
out.println(key + " : Not Available "
out.println(key + " : Not Available "
+ "(the implementation class is not present)");
} catch (NoClassDefFoundError e) {
String pkg = e.getMessage().replace('/', '.');
@@ -474,8 +475,8 @@ public final class Diagnostics {
if (props.size() == 0) {
out.println("All defined tasks are available");
} else {
out.println("A task being missing/unavailable should only "
+"matter if you are trying to use it");
out.println("A task being missing/unavailable should only "
+ "matter if you are trying to use it");
}
} catch (IOException e) {
out.println(e.getMessage());
@@ -491,8 +492,8 @@ public final class Diagnostics {
String parserName = getXmlParserName();
String parserLocation = getXMLParserLocation();
printParserInfo(out, "XML Parser", parserName, parserLocation);
printParserInfo(out, "Namespace-aware parser",
getNamespaceParserName(),
printParserInfo(out, "Namespace-aware parser",
getNamespaceParserName(),
getNamespaceParserLocation());
}

@@ -506,8 +507,8 @@ public final class Diagnostics {
if (parserLocation == null) {
parserLocation = "unknown";
}
out.println(parserType +" : " + parserName);
out.println(parserType +" Location: " + parserLocation);
out.println(parserType + " : " + parserName);
out.println(parserType + " Location: " + parserLocation);
}

/**
@@ -566,7 +567,7 @@ public final class Diagnostics {

/**
* Report locale information
* @param out stream to print to
* @param out stream to print to
*/
private static void doReportLocale(PrintStream out) {
//calendar stuff.
@@ -590,9 +591,9 @@ public final class Diagnostics {
* @param out stream to print on
* @param key property name
*/
private static void printProperty(PrintStream out,String key) {
String value= getProperty(key);
if(value!=null) {
private static void printProperty(PrintStream out, String key) {
String value = getProperty(key);
if (value != null) {
out.print(key);
out.print(" = ");
out.print('"');
@@ -603,12 +604,12 @@ public final class Diagnostics {

/**
* Report proxy information
*
*
* @param out stream to print to
* @since Ant1.7
*/
private static void doReportProxy(PrintStream out) {
printProperty(out,ProxySetup.HTTP_PROXY_HOST);
printProperty(out, ProxySetup.HTTP_PROXY_HOST);
printProperty(out, ProxySetup.HTTP_PROXY_PORT);
printProperty(out, ProxySetup.HTTP_PROXY_USERNAME);
printProperty(out, ProxySetup.HTTP_PROXY_PASSWORD);
@@ -632,7 +633,7 @@ public final class Diagnostics {
= "org.apache.tools.ant.util.java15.ProxyDiagnostics";
try {
Class proxyDiagClass = Class.forName(proxyDiagClassname);
Object instance =proxyDiagClass.newInstance();
Object instance = proxyDiagClass.newInstance();
out.println("Java1.5+ proxy settings:");
out.println(instance.toString());
} catch (ClassNotFoundException e) {


+ 10
- 9
src/main/org/apache/tools/ant/DirectoryScanner.java View File

@@ -136,7 +136,7 @@ public class DirectoryScanner
* reasons.</p>
*
* @deprecated since 1.6.x.
* Use the {@link #getDefaultExcludes getDefaultExcludes}
* Use the {@link #getDefaultExcludes getDefaultExcludes}
* method instead.
*/
protected static final String[] DEFAULTEXCLUDES = {
@@ -864,7 +864,7 @@ public class DirectoryScanner
}
}
while (it.hasNext()) {
Map.Entry entry = (Map.Entry)it.next();
Map.Entry entry = (Map.Entry)it.next();
String currentelement = (String) entry.getKey();
if (basedir == null && !FileUtils.isAbsolutePath(currentelement)) {
continue;
@@ -970,6 +970,7 @@ public class DirectoryScanner
try {
slowScanLock.wait();
} catch (InterruptedException e) {
// Empty
}
}
return;
@@ -1014,7 +1015,7 @@ public class DirectoryScanner
}
}
}
/**
* Scan the given directory for files and directories. Found files and
* directories are placed in their respective collections, based on the
@@ -1115,7 +1116,7 @@ public class DirectoryScanner
* @param file included File.
*/
private void accountForIncludedFile(String name, File file) {
processIncluded(name, file, filesIncluded, filesExcluded, filesDeselected);
processIncluded(name, file, filesIncluded, filesExcluded, filesDeselected);
}

/**
@@ -1126,20 +1127,20 @@ public class DirectoryScanner
* @param fast whether to perform fast scans.
*/
private void accountForIncludedDir(String name, File file, boolean fast) {
processIncluded(name, file, dirsIncluded, dirsExcluded, dirsDeselected);
processIncluded(name, file, dirsIncluded, dirsExcluded, dirsDeselected);
if (fast && couldHoldIncluded(name) && !contentsExcluded(name)) {
scandir(file, name + File.separator, fast);
}
}
private void processIncluded(String name, File file, Vector inc, Vector exc, Vector des) {
if (inc.contains(name) || exc.contains(name) || des.contains(name)) { return; }
boolean included = false;
if (isExcluded(name)) {
exc.add(name);
} else if(isSelected(name, file)) {
} else if (isSelected(name, file)) {
included = true;
inc.add(name);
} else {


+ 1
- 1
src/main/org/apache/tools/ant/MagicNames.java View File

@@ -147,7 +147,7 @@ public final class MagicNames {
public static final String BUILD_JAVAC_TARGET = "ant.build.javac.target";

/**
* Name of the magic property that controls classloader reuse
* Name of the magic property that controls classloader reuse
* @since Ant 1.4.
* Value: {@value}
*/


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

@@ -218,7 +218,7 @@ public class Main implements AntMain {
}

/**
* This operation is expected to call {@link System#exit(int)}, which
* This operation is expected to call {@link System#exit(int)}, which
* is what the base version does.
* However, it is possible to do something else.
* @param exitCode code to exit with
@@ -286,8 +286,8 @@ public class Main implements AntMain {
PrintStream logTo = null;

//this is the list of lu
HashMap launchCommands =new HashMap();
launchCommands.put("-lib","");
HashMap launchCommands = new HashMap();
launchCommands.put("-lib", "");
launchCommands.put("-cp", "");
launchCommands.put("-noclasspath", "");
launchCommands.put("--noclasspath", "");
@@ -443,7 +443,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 (launchCommands.get(arg) != null) {
//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
@@ -847,8 +847,8 @@ public class Main implements AntMain {
msg.append(" -nouserlib Run ant without using the jar files from" + lSep
+ " ${user.home}/.ant/lib" + lSep);
msg.append(" -noclasspath Run ant without using CLASSPATH" + lSep);
msg.append(" -noproxy Java 1.5 only: do not use the OS proxies" +
lSep);
msg.append(" -noproxy Java 1.5 only: do not use the OS proxies"
+ lSep);
msg.append(" -main <class> override Ant's normal entry point");
System.out.println(msg.toString());
}


+ 5
- 3
src/main/org/apache/tools/ant/Project.java View File

@@ -181,7 +181,8 @@ public class Project implements ResourceFactory {
private Map/*<Thread,Task>*/ threadTasks = Collections.synchronizedMap(new WeakHashMap());

/** Records the latest task to be executed on a thread group. */
private Map/*<ThreadGroup,Task>*/ threadGroupTasks = Collections.synchronizedMap(new WeakHashMap());
private Map/*<ThreadGroup,Task>*/ threadGroupTasks
= Collections.synchronizedMap(new WeakHashMap());

/**
* Called to handle any input requests.
@@ -736,7 +737,7 @@ public class Project implements ResourceFactory {
* @return a hashtable of global filters, mapping tokens to values
* (String to String).
*
* @deprecated since 1.4.x
* @deprecated since 1.4.x
* Use getGlobalFilterSet().getFilterHash().
*
* @see #getGlobalFilterSet()
@@ -1380,7 +1381,7 @@ public class Project implements ResourceFactory {
*
* @return the native version of the specified path or
* an empty string if the path is <code>null</code> or empty.
*
*
* @deprecated since 1.7
* Use FileUtils.translatePath instead.
*
@@ -2280,6 +2281,7 @@ public class Project implements ResourceFactory {
/**
* Resolve the file relative to the project's basedir and return it as a
* FileResource.
* @param name the name of the file to resolve.
* @since Ant 1.7
*/
public Resource getResource(String name) {


+ 2
- 2
src/main/org/apache/tools/ant/ProjectComponent.java View File

@@ -27,8 +27,8 @@ public abstract class ProjectComponent {

/**
* Project object of this component.
* @deprecated since 1.6.x.
* You should not be directly accessing this variable directly.
* @deprecated since 1.6.x.
* You should not be directly accessing this variable directly.
* You should access project object via the getProject()
* or setProject() accessor/mutators.
*/


+ 3
- 3
src/main/org/apache/tools/ant/Task.java View File

@@ -42,7 +42,7 @@ public abstract class Task extends ProjectComponent {

/**
* Description of this task, if any.
* @deprecated since 1.6.x.
* @deprecated since 1.6.x.
* You should not be accessing this variable directly.
*/
protected String description;
@@ -54,7 +54,7 @@ public abstract class Task extends ProjectComponent {
* isn't terribly descriptive for a task used within
* another task - the outer task code can probably
* provide a better one.
* @deprecated since 1.6.x.
* @deprecated since 1.6.x.
* You should not be accessing this variable directly.
* Please use the {@link #getTaskName()} method.
*/
@@ -63,7 +63,7 @@ public abstract class Task extends ProjectComponent {
/**
* Type of this task.
*
* @deprecated since 1.6.x.
* @deprecated since 1.6.x.
* You should not be accessing this variable directly.
* Please use the {@link #getTaskType()} method.
*/


+ 0
- 1
src/main/org/apache/tools/ant/UnknownElement.java View File

@@ -213,7 +213,6 @@ public class UnknownElement extends Task {

/**
* @see Task#handleInput(byte[], int, int)
*
* @since Ant 1.6
*/
protected int handleInput(byte[] buffer, int offset, int length)


+ 3
- 1
src/main/org/apache/tools/ant/filters/FixCrLfFilter.java View File

@@ -101,6 +101,7 @@ public final class FixCrLfFilter extends BaseParamFilterReader implements Chaina
* @param in
* A Reader object providing the underlying stream. Must not be
* <code>null</code>.
* @throws IOException on error.
*/
public FixCrLfFilter(final Reader in) throws IOException {
super(in);
@@ -372,6 +373,7 @@ public final class FixCrLfFilter extends BaseParamFilterReader implements Chaina
* @param tabLength
* specify the length of tab in spaces. Valid values are between
* 2 and 80 inclusive. The default for this parameter is 8.
* @throws IOException on error.
*/
public void setTablength(int tabLength) throws IOException {
if (tabLength < 2 || tabLength > 80) {
@@ -850,7 +852,7 @@ public final class FixCrLfFilter extends BaseParamFilterReader implements Chaina
private static final AddAsisRemove REMOVE = newInstance("remove");

public String[] getValues() {
return new String[] { "add", "asis", "remove" };
return new String[] {"add", "asis", "remove"};
}

public boolean equals(Object other) {


+ 1
- 1
src/main/org/apache/tools/ant/filters/ReplaceTokens.java View File

@@ -239,7 +239,7 @@ public final class ReplaceTokens
} finally {
FileUtils.close(in);
}
return props;
}



+ 7
- 7
src/main/org/apache/tools/ant/helper/ProjectHelper2.java View File

@@ -259,7 +259,7 @@ public class ProjectHelper2 extends ProjectHelper {
* @param handler new main handler
*/
protected static void setMainHandler(AntHandler handler) {
mainHandler=handler;
mainHandler = handler;
}

/**
@@ -275,7 +275,7 @@ public class ProjectHelper2 extends ProjectHelper {
* @param handler new project handler
*/
protected static void setProjectHandler(AntHandler handler) {
projectHandler=handler;
projectHandler = handler;
}

/**
@@ -291,7 +291,7 @@ public class ProjectHelper2 extends ProjectHelper {
* @param handler new target handler
*/
protected static void setTargetHandler(AntHandler handler) {
targetHandler=handler;
targetHandler = handler;
}

/**
@@ -307,7 +307,7 @@ public class ProjectHelper2 extends ProjectHelper {
* @param handler new element handler
*/
protected static void setElementHandler(AntHandler handler) {
elementHandler=handler;
elementHandler = handler;
}


@@ -479,9 +479,9 @@ public class ProjectHelper2 extends ProjectHelper {
if (!file.isAbsolute()) {
file = FILE_UTILS.resolveFile(context.getBuildFileParent(), path);
context.getProject().log(
"Warning: '" + systemId + "' in " + context.getBuildFile() +
" should be expressed simply as '" + path.replace('\\', '/') +
"' for compliance with other XML tools",
"Warning: '" + systemId + "' in " + context.getBuildFile()
+ " should be expressed simply as '" + path.replace('\\', '/')
+ "' for compliance with other XML tools",
Project.MSG_WARN);
}
context.getProject().log("file=" + file, Project.MSG_DEBUG);


+ 3
- 3
src/main/org/apache/tools/ant/helper/ProjectHelperImpl.java View File

@@ -298,9 +298,9 @@ public class ProjectHelperImpl extends ProjectHelper {
if (!file.isAbsolute()) {
file = FILE_UTILS.resolveFile(helperImpl.buildFileParent, path);
helperImpl.project.log(
"Warning: '" + systemId + "' in " + helperImpl.buildFile +
" should be expressed simply as '" + path.replace('\\', '/') +
"' for compliance with other XML tools",
"Warning: '" + systemId + "' in " + helperImpl.buildFile
+ " should be expressed simply as '" + path.replace('\\', '/')
+ "' for compliance with other XML tools",
Project.MSG_WARN);
}
try {


+ 1
- 0
src/main/org/apache/tools/ant/input/GreedyInputHandler.java View File

@@ -62,6 +62,7 @@ public class GreedyInputHandler extends DefaultInputHandler {
try {
t.join();
} catch (InterruptedException e2) {
// Ignore
}
}
request.setInput(new String(baos.toByteArray()));


+ 2
- 0
src/main/org/apache/tools/ant/input/InputRequest.java View File

@@ -74,6 +74,7 @@ public class InputRequest {

/**
* Gets a configured default value.
* @return the default value.
* @since Ant 1.7.0
*/
public String getDefaultValue() {
@@ -82,6 +83,7 @@ public class InputRequest {

/**
* Configures a default value.
* @param d the value to set.
* @since Ant 1.7.0
*/
public void setDefaultValue(String d) {


+ 3
- 5
src/main/org/apache/tools/ant/launch/Launcher.java View File

@@ -126,7 +126,7 @@ public class Launcher {
private void addPath(String path, boolean getJars, List libPathURLs)
throws MalformedURLException {
StringTokenizer tokenizer = new StringTokenizer(path, File.pathSeparator);
while(tokenizer.hasMoreElements()) {
while (tokenizer.hasMoreElements()) {
String elementName = tokenizer.nextToken();
File element = new File(elementName);
if (elementName.indexOf("%") != -1 && !element.exists()) {
@@ -291,14 +291,14 @@ public class Launcher {
URLClassLoader loader = new URLClassLoader(jars);
Thread.currentThread().setContextClassLoader(loader);
Class mainClass = null;
int exitCode=0;
int exitCode = 0;
try {
mainClass = loader.loadClass(mainClassname);
AntMain main = (AntMain) mainClass.newInstance();
main.startAnt(newArgs, null, null);
} catch (InstantiationException ex) {
System.err.println(
"Incompatible version of "+mainClassname+" detected");
"Incompatible version of " + mainClassname + " detected");
File mainJar = Locator.getClassSource(mainClass);
System.err.println(
"Location of this class " + mainJar);
@@ -308,7 +308,5 @@ public class Launcher {
exitCode = EXIT_CODE_ERROR;
}
return exitCode;
}

}

Loading…
Cancel
Save