donaldp 02/04/30 07:20:16
Modified: src/main/org/apache/tools/ant BuildException.java
Project.java
Log:
Renamed msg --> message so that advanced editors can correctly deduce
a variable name that is not abreviated.
Revision Changes Path
1.15 +27 -27
jakarta-ant/src/main/org/apache/tools/ant/BuildException.java
Index: BuildException.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/src/main/org/apache/tools/ant/BuildException.java,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -r1.14 -r1.15
--- BuildException.java 15 Feb 2002 13:59:38 -0000 1.14
+++ BuildException.java 30 Apr 2002 14:20:16 -0000 1.15
@@ -78,37 +78,37 @@
/**
* Constructs an exception with the given descriptive message.
- *
- * @param msg A description of or information about the exception.
+ *
+ * @param message A description of or information about the exception.
* Should not be <code>null</code>.
*/
- public BuildException(String msg) {
- super(msg);
+ public BuildException(String message) {
+ super(message);
}
/**
* Constructs an exception with the given message and exception as
* a root cause.
- *
- * @param msg A description of or information about the exception.
+ *
+ * @param message A description of or information about the exception.
* Should not be <code>null</code> unless a cause is
specified.
* @param cause The exception that might have caused this one.
* May be <code>null</code>.
*/
- public BuildException(String msg, Throwable cause) {
- super(msg);
+ public BuildException(String message, Throwable cause) {
+ super(message);
this.cause = cause;
}
/**
* Constructs an exception with the given message and exception as
* a root cause and a location in a file.
- *
+ *
* @param msg A description of or information about the exception.
* Should not be <code>null</code> unless a cause is
specified.
* @param cause The exception that might have caused this one.
* May be <code>null</code>.
- * @param location The location in the project file where the error
+ * @param location The location in the project file where the error
* occurred. Must not be <code>null</code>.
*/
public BuildException(String msg, Throwable cause, Location location) {
@@ -118,7 +118,7 @@
/**
* Constructs an exception with the given exception as a root cause.
- *
+ *
* @param cause The exception that might have caused this one.
* Should not be <code>null</code>.
*/
@@ -128,26 +128,26 @@
}
/**
- * Constructs an exception with the given descriptive message and a
+ * Constructs an exception with the given descriptive message and a
* location in a file.
- *
- * @param msg A description of or information about the exception.
+ *
+ * @param message A description of or information about the exception.
* Should not be <code>null</code>.
- * @param location The location in the project file where the error
+ * @param location The location in the project file where the error
* occurred. Must not be <code>null</code>.
*/
- public BuildException(String msg, Location location) {
- super(msg);
+ public BuildException(String message, Location location) {
+ super(message);
this.location = location;
}
/**
* Constructs an exception with the given exception as
* a root cause and a location in a file.
- *
+ *
* @param cause The exception that might have caused this one.
* Should not be <code>null</code>.
- * @param location The location in the project file where the error
+ * @param location The location in the project file where the error
* occurred. Must not be <code>null</code>.
*/
public BuildException(Throwable cause, Location location) {
@@ -157,7 +157,7 @@
/**
* Returns the nested exception, if any.
- *
+ *
* @return the nested exception, or <code>null</code> if no
* exception is associated with this one
*/
@@ -167,7 +167,7 @@
/**
* Returns the location of the error and the error message.
- *
+ *
* @return the location of the error and the error message
*/
public String toString() {
@@ -176,7 +176,7 @@
/**
* Sets the file location where the error occurred.
- *
+ *
* @param location The file location where the error occurred.
* Must not be <code>null</code>.
*/
@@ -194,17 +194,17 @@
}
/**
- * Prints the stack trace for this exception and any
+ * Prints the stack trace for this exception and any
* nested exception to <code>System.err</code>.
*/
public void printStackTrace() {
printStackTrace(System.err);
}
-
+
/**
* Prints the stack trace of this exception and any nested
* exception to the specified PrintStream.
- *
+ *
* @param ps The PrintStream to print the stack trace to.
* Must not be <code>null</code>.
*/
@@ -217,11 +217,11 @@
}
}
}
-
+
/**
* Prints the stack trace of this exception and any nested
* exception to the specified PrintWriter.
- *
+ *
* @param pw The PrintWriter to print the stack trace to.
* Must not be <code>null</code>.
*/
1.108 +264 -264 jakarta-ant/src/main/org/apache/tools/ant/Project.java
Index: Project.java
===================================================================
RCS file: /home/cvs/jakarta-ant/src/main/org/apache/tools/ant/Project.java,v
retrieving revision 1.107
retrieving revision 1.108
diff -u -r1.107 -r1.108
--- Project.java 23 Apr 2002 08:15:51 -0000 1.107
+++ Project.java 30 Apr 2002 14:20:16 -0000 1.108
@@ -64,17 +64,17 @@
import java.util.Stack;
import java.lang.reflect.Modifier;
-import org.apache.tools.ant.types.FilterSet;
-import org.apache.tools.ant.types.FilterSetCollection;
-import org.apache.tools.ant.util.FileUtils;
+import org.apache.tools.ant.types.FilterSet;
+import org.apache.tools.ant.types.FilterSetCollection;
+import org.apache.tools.ant.util.FileUtils;
import org.apache.tools.ant.util.JavaEnvUtils;
import org.apache.tools.ant.input.DefaultInputHandler;
import org.apache.tools.ant.input.InputHandler;
/**
* Central representation of an Ant project. This class defines an
- * Ant project with all of its targets, tasks and various other
- * properties. It also provides the mechanism to kick off a build using
+ * Ant project with all of its targets, tasks and various other
+ * properties. It also provides the mechanism to kick off a build using
* a particular target name.
* <p>
* This class also encapsulates methods which allow files to be referred
@@ -83,7 +83,7 @@
*
* @author [EMAIL PROTECTED]
*
- * @version $Revision: 1.107 $
+ * @version $Revision: 1.108 $
*/
public class Project {
@@ -99,43 +99,43 @@
/** Message priority of "debug". */
public static final int MSG_DEBUG = 4;
- /**
+ /**
* Constant for the "visiting" state, used when
* traversing a DFS of target dependencies.
*/
private static final String VISITING = "VISITING";
- /**
+ /**
* Constant for the "visited" state, used when
* traversing a DFS of target dependencies.
*/
private static final String VISITED = "VISITED";
- /**
- * Version constant for Java 1.0
+ /**
+ * Version constant for Java 1.0
*
* @deprecated use org.apache.tools.ant.util.JavaEnvUtils instead
*/
public static final String JAVA_1_0 = JavaEnvUtils.JAVA_1_0;
- /**
- * Version constant for Java 1.1
+ /**
+ * Version constant for Java 1.1
*
* @deprecated use org.apache.tools.ant.util.JavaEnvUtils instead
*/
public static final String JAVA_1_1 = JavaEnvUtils.JAVA_1_1;
/**
- * Version constant for Java 1.2
+ * Version constant for Java 1.2
*
* @deprecated use org.apache.tools.ant.util.JavaEnvUtils instead
*/
public static final String JAVA_1_2 = JavaEnvUtils.JAVA_1_2;
- /**
- * Version constant for Java 1.3
+ /**
+ * Version constant for Java 1.3
*
* @deprecated use org.apache.tools.ant.util.JavaEnvUtils instead
*/
public static final String JAVA_1_3 = JavaEnvUtils.JAVA_1_3;
- /**
- * Version constant for Java 1.4
+ /**
+ * Version constant for Java 1.4
*
* @deprecated use org.apache.tools.ant.util.JavaEnvUtils instead
*/
@@ -153,8 +153,8 @@
/** Project properties map (String to String). */
private Hashtable properties = new Hashtable();
- /**
- * Map of "user" properties (as created in the Ant task, for example).
+ /**
+ * Map of "user" properties (as created in the Ant task, for example).
* Note that these key/value pairs are also always put into the
* project properties, so only the project properties need to be queried.
* Mapping is String to String.
@@ -162,15 +162,15 @@
private Hashtable userProperties = new Hashtable();
/** Map of references within the project (paths etc) (String to Object).
*/
private Hashtable references = new Hashtable();
-
+
/** Name of the project's default target. */
private String defaultTarget;
/** Map from data type names to implementing classes (String to Class).
*/
private Hashtable dataClassDefinitions = new Hashtable();
/** Map from task names to implementing classes (String to Class). */
private Hashtable taskClassDefinitions = new Hashtable();
- /**
- * Map from task names to vectors of created tasks
+ /**
+ * Map from task names to vectors of created tasks
* (String to Vector of Task). This is used to invalidate tasks if
* the task definition changes.
*/
@@ -179,29 +179,29 @@
private Hashtable targets = new Hashtable();
/** Set of global filters. */
private FilterSet globalFilterSet = new FilterSet();
- /**
+ /**
* Wrapper around globalFilterSet. This collection only ever
* contains one FilterSet, but the wrapper is needed in order to
* make it easier to use the FileUtils interface.
*/
- private FilterSetCollection globalFilters
+ private FilterSetCollection globalFilters
= new FilterSetCollection(globalFilterSet);
-
+
/** Project base directory. */
private File baseDir;
/** List of listeners to notify of build events. */
private Vector listeners = new Vector();
- /**
- * The Ant core classloader - may be <code>null</code> if using
+ /**
+ * The Ant core classloader - may be <code>null</code> if using
* parent classloader.
- */
+ */
private ClassLoader coreLoader = null;
- /** Records the latest task to be executed on a thread (Thread to Task).
*/
+ /** Records the latest task to be executed on a thread (Thread to Task).
*/
private Hashtable threadTasks = new Hashtable();
-
+
/**
* Called to handle any input requests.
*/
@@ -231,24 +231,24 @@
fileUtils = FileUtils.newFileUtils();
inputHandler = new DefaultInputHandler();
}
-
+
/**
* Initialises the project.
*
* This involves setting the default task definitions and loading the
* system properties.
- *
+ *
* @exception BuildException if the default task list cannot be loaded
*/
public void init() throws BuildException {
setJavaVersionProperty();
-
+
String defs = "/org/apache/tools/ant/taskdefs/defaults.properties";
try {
Properties props = new Properties();
InputStream in = this.getClass().getResourceAsStream(defs);
- if (in == null) {
+ if (in == null) {
throw new BuildException("Can't load default task list");
}
props.load(in);
@@ -262,11 +262,11 @@
Class taskClass = Class.forName(value);
addTaskDefinition(key, taskClass);
} catch (NoClassDefFoundError ncdfe) {
- log("Could not load a dependent class ("
- + ncdfe.getMessage() + ") for task " + key,
MSG_DEBUG);
+ log("Could not load a dependent class ("
+ + ncdfe.getMessage() + ") for task " + key,
MSG_DEBUG);
} catch (ClassNotFoundException cnfe) {
- log("Could not load class (" + value
- + ") for task " + key, MSG_DEBUG);
+ log("Could not load class (" + value
+ + ") for task " + key, MSG_DEBUG);
}
}
} catch (IOException ioe) {
@@ -278,7 +278,7 @@
try {
Properties props = new Properties();
InputStream in = this.getClass().getResourceAsStream(dataDefs);
- if (in == null) {
+ if (in == null) {
throw new BuildException("Can't load default datatype list");
}
props.load(in);
@@ -304,33 +304,33 @@
setSystemProperties();
}
- /**
+ /**
* Sets the core classloader for the project. If a <code>null</code>
* classloader is specified, the parent classloader should be used.
- *
+ *
* @param coreLoader The classloader to use for the project.
* May be <code>null</code>.
*/
public void setCoreLoader(ClassLoader coreLoader) {
this.coreLoader = coreLoader;
}
-
- /**
+
+ /**
* Returns the core classloader to use for this project.
* This may be <code>null</code>, indicating that
* the parent classloader should be used.
- *
+ *
* @return the core classloader to use for this project.
- *
+ *
*/
public ClassLoader getCoreLoader() {
return coreLoader;
}
-
+
/**
* Adds a build listener to the list. This listener will
* be notified of build events for this project.
- *
+ *
* @param listener The listener to add to the list.
* Must not be <code>null</code>.
*/
@@ -341,7 +341,7 @@
/**
* Removes a build listener from the list. This listener
* will no longer be notified of build events for this project.
- *
+ *
* @param listener The listener to remove from the list.
* Should not be <code>null</code>.
*/
@@ -352,7 +352,7 @@
/**
* Returns a list of build listeners for the project. The returned
* vector is "live" and so should not be modified.
- *
+ *
* @return a list of build listeners for the project
*/
public Vector getBuildListeners() {
@@ -362,56 +362,56 @@
/**
* Writes a message to the log with the default log level
* of MSG_INFO
- * @param msg The text to log. Should not be <code>null</code>.
+ * @param message The text to log. Should not be <code>null</code>.
*/
-
- public void log(String msg) {
- log(msg, MSG_INFO);
+
+ public void log(String message) {
+ log(message, MSG_INFO);
}
/**
* Writes a project level message to the log with the given log level.
- * @param msg The text to log. Should not be <code>null</code>.
+ * @param message The text to log. Should not be <code>null</code>.
* @param msgLevel The priority level to log at.
*/
- public void log(String msg, int msgLevel) {
- fireMessageLogged(this, msg, msgLevel);
+ public void log(String message, int msgLevel) {
+ fireMessageLogged(this, message, msgLevel);
}
/**
* Writes a task level message to the log with the given log level.
* @param task The task to use in the log. Must not be <code>null</code>.
- * @param msg The text to log. Should not be <code>null</code>.
+ * @param message The text to log. Should not be <code>null</code>.
* @param msgLevel The priority level to log at.
*/
- public void log(Task task, String msg, int msgLevel) {
- fireMessageLogged(task, msg, msgLevel);
+ public void log(Task task, String message, int msgLevel) {
+ fireMessageLogged(task, message, msgLevel);
}
-
+
/**
* Writes a target level message to the log with the given log level.
* @param target The target to use in the log.
* Must not be <code>null</code>.
- * @param msg The text to log. Should not be <code>null</code>.
+ * @param message The text to log. Should not be <code>null</code>.
* @param msgLevel The priority level to log at.
*/
- public void log(Target target, String msg, int msgLevel) {
- fireMessageLogged(target, msg, msgLevel);
+ public void log(Target target, String message, int msgLevel) {
+ fireMessageLogged(target, message, msgLevel);
}
/**
* Returns the set of global filters.
- *
+ *
* @return the set of global filters
*/
public FilterSet getGlobalFilterSet() {
return globalFilterSet;
}
-
+
/**
- * Sets a property. Any existing property of the same name
- * is overwritten, unless it is a user property.
- * @param name The name of property to set.
+ * Sets a property. Any existing property of the same name
+ * is overwritten, unless it is a user property.
+ * @param name The name of property to set.
* Must not be <code>null</code>.
* @param value The new value of the property.
* Must not be <code>null</code>.
@@ -424,7 +424,7 @@
}
if (null != properties.get(name)) {
- log("Overriding previous definition of property " + name,
+ log("Overriding previous definition of property " + name,
MSG_VERBOSE);
}
@@ -437,8 +437,8 @@
* Sets a property if no value currently exists. If the property
* exists already, a message is logged and the method returns with
* no other effect.
- *
- * @param name The name of property to set.
+ *
+ * @param name The name of property to set.
* Must not be <code>null</code>.
* @param value The new value of the property.
* Must not be <code>null</code>.
@@ -457,7 +457,7 @@
/**
* Sets a user property, which cannot be overwritten by
* set/unset property calls. Any previous value is overwritten.
- * @param name The name of property to set.
+ * @param name The name of property to set.
* Must not be <code>null</code>.
* @param value The new value of the property.
* Must not be <code>null</code>.
@@ -469,12 +469,12 @@
userProperties.put(name, value);
properties.put(name, value);
}
-
+
/**
* Sets a property unless it is already defined as a user property
* (in which case the method returns silently).
*
- * @param name The name of the property.
+ * @param name The name of the property.
* Must not be <code>null</code>.
* @param value The property value. Must not be <code>null</code>.
*/
@@ -487,7 +487,7 @@
/**
* Returns the value of a property, if it is set.
- *
+ *
* @param name The name of the property.
* May be <code>null</code>, in which case
* the return value is also <code>null</code>.
@@ -508,22 +508,22 @@
*
* @param value The string to be scanned for property references.
* May be <code>null</code>.
- *
+ *
* @return the given string with embedded property names replaced
* by values, or <code>null</code> if the given string is
* <code>null</code>.
- *
- * @exception BuildException if the given value has an unclosed
+ *
+ * @exception BuildException if the given value has an unclosed
* property name, e.g. <code>${xxx</code>
*/
public String replaceProperties(String value)
- throws BuildException {
+ throws BuildException {
return ProjectHelper.replaceProperties(this, value, properties);
}
/**
* Returns the value of a user property, if it is set.
- *
+ *
* @param name The name of the property.
* May be <code>null</code>, in which case
* the return value is also <code>null</code>.
@@ -540,19 +540,19 @@
/**
* Returns a copy of the properties table.
- * @return a hashtable containing all properties
+ * @return a hashtable containing all properties
* (including user properties).
*/
public Hashtable getProperties() {
Hashtable propertiesCopy = new Hashtable();
-
+
Enumeration e = properties.keys();
while (e.hasMoreElements()) {
Object name = e.nextElement();
Object value = properties.get(name);
propertiesCopy.put(name, value);
}
-
+
return propertiesCopy;
}
@@ -562,24 +562,24 @@
*/
public Hashtable getUserProperties() {
Hashtable propertiesCopy = new Hashtable();
-
+
Enumeration e = userProperties.keys();
while (e.hasMoreElements()) {
Object name = e.nextElement();
Object value = properties.get(name);
propertiesCopy.put(name, value);
}
-
+
return propertiesCopy;
}
/**
* Sets the default target of the project.
- *
+ *
* @param defaultTarget The name of the default target for this project.
* May be <code>null</code>, indicating that there
is
* no default target.
- *
+ *
* @deprecated use setDefault
* @see #setDefault(String)
*/
@@ -589,16 +589,16 @@
/**
* Returns the name of the default target of the project.
- * @return name of the default target or
+ * @return name of the default target or
* <code>null</code> if no default has been set.
*/
public String getDefaultTarget() {
return defaultTarget;
}
-
+
/**
* Sets the default target of the project.
- *
+ *
* @param defaultTarget The name of the default target for this project.
* May be <code>null</code>, indicating that there
is
* no default target.
@@ -610,7 +610,7 @@
/**
* Sets the name of the project, also setting the user
* property <code>ant.project.name</code>.
- *
+ *
* @param name The name of the project.
* Must not be <code>null</code>.
*/
@@ -619,44 +619,44 @@
this.name = name;
}
- /**
+ /**
* Returns the project name, if one has been set.
- *
+ *
* @return the project name, or <code>null</code> if it hasn't been set.
*/
public String getName() {
return name;
}
- /**
+ /**
* Sets the project description.
- *
- * @param description The description of the project.
+ *
+ * @param description The description of the project.
* May be <code>null</code>.
*/
public void setDescription(String description) {
this.description = description;
}
- /**
+ /**
* Returns the project description, if one has been set.
- *
- * @return the project description, or <code>null</code> if it hasn't
+ *
+ * @return the project description, or <code>null</code> if it hasn't
* been set.
*/
public String getDescription() {
return description;
}
- /**
+ /**
* Adds a filter to the set of global filters.
- *
+ *
* @param token The token to filter.
* Must not be <code>null</code>.
* @param value The replacement value.
* Must not be <code>null</code>.
* @deprecated Use getGlobalFilterSet().addFilter(token,value)
- *
+ *
* @see #getGlobalFilterSet()
* @see FilterSet#addFilter(String,String)
*/
@@ -664,18 +664,18 @@
if (token == null) {
return;
}
-
+
globalFilterSet.addFilter(new FilterSet.Filter(token, value));
}
- /**
+ /**
* Returns a hashtable of global filters, mapping tokens to values.
- *
- * @return a hashtable of global filters, mapping tokens to values
+ *
+ * @return a hashtable of global filters, mapping tokens to values
* (String to String).
- *
+ *
* @deprecated Use getGlobalFilterSet().getFilterHash()
- *
+ *
* @see #getGlobalFilterSet()
* @see FilterSet#getFilterHash()
*/
@@ -687,10 +687,10 @@
/**
* Sets the base directory for the project, checking that
* the given filename exists and is a directory.
- *
+ *
* @param baseD The project base directory.
* Must not be <code>null</code>.
- *
+ *
* @exception BuildException if the directory if invalid
*/
public void setBasedir(String baseD) throws BuildException {
@@ -700,20 +700,20 @@
/**
* Sets the base directory for the project, checking that
* the given file exists and is a directory.
- *
+ *
* @param baseDir The project base directory.
* Must not be <code>null</code>.
- * @exception BuildException if the specified file doesn't exist or
+ * @exception BuildException if the specified file doesn't exist or
* isn't a directory
*/
public void setBaseDir(File baseDir) throws BuildException {
baseDir = fileUtils.normalize(baseDir.getAbsolutePath());
- if (!baseDir.exists()) {
- throw new BuildException("Basedir " + baseDir.getAbsolutePath()
+ if (!baseDir.exists()) {
+ throw new BuildException("Basedir " + baseDir.getAbsolutePath()
+ " does not exist");
}
- if (!baseDir.isDirectory()) {
- throw new BuildException("Basedir " + baseDir.getAbsolutePath()
+ if (!baseDir.isDirectory()) {
+ throw new BuildException("Basedir " + baseDir.getAbsolutePath()
+ " is not a directory");
}
this.baseDir = baseDir;
@@ -724,7 +724,7 @@
/**
* Returns the base directory of the project as a file object.
- *
+ *
* @return the project base directory, or <code>null</code> if the
* base directory has not been successfully set to a valid value.
*/
@@ -756,7 +756,7 @@
* and operating system name.
*
* @exception BuildException if this Java version is not supported
- *
+ *
* @see org.apache.tools.ant.util.JavaEnvUtils#getJavaVersion
*/
public void setJavaVersionProperty() throws BuildException {
@@ -768,7 +768,7 @@
throw new BuildException("Ant cannot work on Java 1.0");
}
- log("Detected Java version: " + javaVersion + " in: "
+ log("Detected Java version: " + javaVersion + " in: "
+ System.getProperty("java.home"), MSG_VERBOSE);
log("Detected OS: " + System.getProperty("os.name"), MSG_VERBOSE);
@@ -796,29 +796,29 @@
* with a different one results in a warning log message and
* invalidates any tasks which have already been created with the
* old definition.
- *
+ *
* @param taskName The name of the task to add.
* Must not be <code>null</code>.
* @param taskClass The full name of the class implementing the task.
* Must not be <code>null</code>.
- *
- * @exception BuildException if the class is unsuitable for being an Ant
- * task. An error level message is logged
before
+ *
+ * @exception BuildException if the class is unsuitable for being an Ant
+ * task. An error level message is logged
before
* this exception is thrown.
*
* @see #checkTaskClass(Class)
*/
- public void addTaskDefinition(String taskName, Class taskClass)
+ public void addTaskDefinition(String taskName, Class taskClass)
throws BuildException {
Class old = (Class) taskClassDefinitions.get(taskName);
if (null != old) {
if (old.equals(taskClass)) {
- log("Ignoring override for task " + taskName
- + ", it is already defined by the same class.",
+ log("Ignoring override for task " + taskName
+ + ", it is already defined by the same class.",
MSG_VERBOSE);
return;
} else {
- log("Trying to override old definition of task " + taskName,
+ log("Trying to override old definition of task " + taskName,
MSG_WARN);
invalidateCreatedTasks(taskName);
}
@@ -826,19 +826,19 @@
String msg = " +User task: " + taskName + " " +
taskClass.getName();
log(msg, MSG_DEBUG);
- checkTaskClass(taskClass);
+ checkTaskClass(taskClass);
taskClassDefinitions.put(taskName, taskClass);
}
/**
* Checks whether or not a class is suitable for serving as Ant task.
- * Ant task implementation classes must be public, concrete, and have
+ * Ant task implementation classes must be public, concrete, and have
* a no-arg constructor.
- *
- * @param taskClass The class to be checked.
+ *
+ * @param taskClass The class to be checked.
* Must not be <code>null</code>.
*
- * @exception BuildException if the class is unsuitable for being an Ant
+ * @exception BuildException if the class is unsuitable for being an Ant
* task. An error level message is logged
before
* this exception is thrown.
*/
@@ -858,7 +858,7 @@
// don't have to check for public, since
// getConstructor finds public constructors only.
} catch (NoSuchMethodException e) {
- final String message = "No public no-arg constructor in "
+ final String message = "No public no-arg constructor in "
+ taskClass;
log(message, Project.MSG_ERR);
throw new BuildException(message);
@@ -869,24 +869,24 @@
}
/**
- * Returns the current task definition hashtable. The returned hashtable
is
+ * Returns the current task definition hashtable. The returned hashtable
is
* "live" and so should not be modified.
- *
- * @return a map of from task name to implementing class
- * (String to Class).
+ *
+ * @return a map of from task name to implementing class
+ * (String to Class).
*/
public Hashtable getTaskDefinitions() {
return taskClassDefinitions;
}
/**
- * Adds a new datatype definition.
+ * Adds a new datatype definition.
* Attempting to override an existing definition with an
* equivalent one (i.e. with the same classname) results in
* a verbose log message. Attempting to override an existing definition
* with a different one results in a warning log message, but the
* definition is changed.
- *
+ *
* @param typeName The name of the datatype.
* Must not be <code>null</code>.
* @param typeClass The full name of the class implementing the datatype.
@@ -896,28 +896,28 @@
Class old = (Class) dataClassDefinitions.get(typeName);
if (null != old) {
if (old.equals(typeClass)) {
- log("Ignoring override for datatype " + typeName
- + ", it is already defined by the same class.",
+ log("Ignoring override for datatype " + typeName
+ + ", it is already defined by the same class.",
MSG_VERBOSE);
return;
} else {
- log("Trying to override old definition of datatype "
+ log("Trying to override old definition of datatype "
+ typeName, MSG_WARN);
}
}
- String msg = " +User datatype: " + typeName + " "
+ String msg = " +User datatype: " + typeName + " "
+ typeClass.getName();
log(msg, MSG_DEBUG);
dataClassDefinitions.put(typeName, typeClass);
}
/**
- * Returns the current datatype definition hashtable. The returned
+ * Returns the current datatype definition hashtable. The returned
* hashtable is "live" and so should not be modified.
- *
- * @return a map of from datatype name to implementing class
- * (String to Class).
+ *
+ * @return a map of from datatype name to implementing class
+ * (String to Class).
*/
public Hashtable getDataTypeDefinitions() {
return dataClassDefinitions;
@@ -925,12 +925,12 @@
/**
* Adds a <em>new</em> target to the project.
- *
+ *
* @param target The target to be added to the project.
* Must not be <code>null</code>.
- *
+ *
* @exception BuildException if the target already exists in the project
- *
+ *
* @see Project#addOrReplaceTarget
*/
public void addTarget(Target target) throws BuildException {
@@ -948,9 +948,9 @@
* Must not be <code>null</code>.
* @param target The target to be added to the project.
* Must not be <code>null</code>.
- *
+ *
* @exception BuildException if the target already exists in the project
- *
+ *
* @see Project#addOrReplaceTarget
*/
public void addTarget(String targetName, Target target)
@@ -964,7 +964,7 @@
/**
* Adds a target to the project, or replaces one with the same
* name.
- *
+ *
* @param target The target to be added or replaced in the project.
* Must not be <code>null</code>.
*/
@@ -975,7 +975,7 @@
/**
* Adds a target to the project, or replaces one with the same
* name.
- *
+ *
* @param targetName The name to use for the target.
* Must not be <code>null</code>.
* @param target The target to be added or replaced in the project.
@@ -989,9 +989,9 @@
}
/**
- * Returns the hashtable of targets. The returned hashtable
+ * Returns the hashtable of targets. The returned hashtable
* is "live" and so should not be modified.
- * @return a map from name to target (String to Target).
+ * @return a map from name to target (String to Target).
*/
public Hashtable getTargets() {
return targets;
@@ -999,13 +999,13 @@
/**
* Creates a new instance of a task.
- *
+ *
* @param taskType The name of the task to create an instance of.
* Must not be <code>null</code>.
- *
+ *
* @return an instance of the specified task, or <code>null</code> if
* the task name is not recognised.
- *
+ *
* @exception BuildException if the task name is recognised but task
* creation fails.
*/
@@ -1015,7 +1015,7 @@
if (c == null) {
return null;
}
-
+
try {
Object o = c.newInstance();
Task task = null;
@@ -1048,10 +1048,10 @@
/**
* Keeps a record of all tasks that have been created so that they
* can be invalidated if a new task definition overrides the current one.
- *
+ *
* @param type The name of the type of task which has been created.
* Must not be <code>null</code>.
- *
+ *
* @param task The freshly created task instance.
* Must not be <code>null</code>.
*/
@@ -1069,7 +1069,7 @@
/**
* Mark tasks as invalid which no longer are of the correct type
* for a given taskname.
- *
+ *
* @param type The name of the type of task to invalidate.
* Must not be <code>null</code>.
*/
@@ -1090,14 +1090,14 @@
/**
* Creates a new instance of a data type.
- *
+ *
* @param typeName The name of the data type to create an instance of.
* Must not be <code>null</code>.
- *
+ *
* @return an instance of the specified data type, or <code>null</code>
if
* the data type name is not recognised.
- *
- * @exception BuildException if the data type name is recognised but
+ *
+ * @exception BuildException if the data type name is recognised but
* instance creation fails.
*/
public Object createDataType(String typeName) throws BuildException {
@@ -1110,7 +1110,7 @@
try {
java.lang.reflect.Constructor ctor = null;
boolean noArg = false;
- // DataType can have a "no arg" constructor or take a single
+ // DataType can have a "no arg" constructor or take a single
// Project argument.
try {
ctor = c.getConstructor(new Class[0]);
@@ -1145,12 +1145,12 @@
}
/**
- * Execute the specified sequence of targets, and the targets
+ * Execute the specified sequence of targets, and the targets
* they depend on.
- *
+ *
* @param targetNames A vector of target name strings to execute.
* Must not be <code>null</code>.
- *
+ *
* @exception BuildException if the build failed
*/
public void executeTargets(Vector targetNames) throws BuildException {
@@ -1165,7 +1165,7 @@
* Demultiplexes output so that each task receives the appropriate
* messages. If the current thread is not currently executing a task,
* the message is logged directly.
- *
+ *
* @param line Message to handle. Should not be <code>null</code>.
* @param isError Whether the text represents an error
(<code>true</code>)
* or information (<code>false</code>).
@@ -1182,13 +1182,13 @@
}
}
}
-
+
/**
* Executes the specified target and any targets it depends on.
- *
- * @param targetName The name of the target to execute.
+ *
+ * @param targetName The name of the target to execute.
* Must not be <code>null</code>.
- *
+ *
* @exception BuildException if the build failed
*/
public void executeTarget(String targetName) throws BuildException {
@@ -1223,15 +1223,15 @@
* If the specified file name is relative it is resolved
* with respect to the given root directory.
*
- * @param fileName The name of the file to resolve.
+ * @param fileName The name of the file to resolve.
* Must not be <code>null</code>.
- *
- * @param rootDir The directory to resolve relative file names with
+ *
+ * @param rootDir The directory to resolve relative file names with
* respect to. May be <code>null</code>, in which case
* the current directory is used.
*
- * @return the resolved File.
- *
+ * @return the resolved File.
+ *
* @deprecated
*/
public File resolveFile(String fileName, File rootDir) {
@@ -1244,18 +1244,18 @@
* If the specified file name is relative it is resolved
* with respect to the project's base directory.
*
- * @param fileName The name of the file to resolve.
+ * @param fileName The name of the file to resolve.
* Must not be <code>null</code>.
*
- * @return the resolved File.
- *
+ * @return the resolved File.
+ *
*/
public File resolveFile(String fileName) {
return fileUtils.resolveFile(baseDir, fileName);
}
/**
- * Translates a path into its native (platform specific) format.
+ * Translates a path into its native (platform specific) format.
* <p>
* This method uses PathTokenizer to separate the input path
* into its components. This handles DOS style paths in a relatively
@@ -1265,9 +1265,9 @@
* @param toProcess The path to be translated.
* May be <code>null</code>.
*
- * @return the native version of the specified path or
+ * @return the native version of the specified path or
* an empty string if the path is <code>null</code> or empty.
- *
+ *
* @see PathTokenizer
*/
public static String translatePath(String toProcess) {
@@ -1286,7 +1286,7 @@
}
path.append(pathComponent);
}
-
+
return path.toString();
}
@@ -1298,12 +1298,12 @@
* Must not be <code>null</code>.
* @param destFile Name of file to copy to.
* Must not be <code>null</code>.
- *
+ *
* @exception IOException if the copying fails
*
* @deprecated
*/
- public void copyFile(String sourceFile, String destFile)
+ public void copyFile(String sourceFile, String destFile)
throws IOException {
fileUtils.copyFile(sourceFile, destFile);
}
@@ -1318,14 +1318,14 @@
* Must not be <code>null</code>.
* @param filtering Whether or not token filtering should be used during
* the copy.
- *
+ *
* @exception IOException if the copying fails
*
* @deprecated
*/
public void copyFile(String sourceFile, String destFile, boolean
filtering)
throws IOException {
- fileUtils.copyFile(sourceFile, destFile,
+ fileUtils.copyFile(sourceFile, destFile,
filtering ? globalFilters : null);
}
@@ -1340,16 +1340,16 @@
* Must not be <code>null</code>.
* @param filtering Whether or not token filtering should be used during
* the copy.
- * @param overwrite Whether or not the destination file should be
+ * @param overwrite Whether or not the destination file should be
* overwritten if it already exists.
- *
+ *
* @exception IOException if the copying fails
*
* @deprecated
*/
public void copyFile(String sourceFile, String destFile, boolean
filtering,
boolean overwrite) throws IOException {
- fileUtils.copyFile(sourceFile, destFile,
+ fileUtils.copyFile(sourceFile, destFile,
filtering ? globalFilters : null, overwrite);
}
@@ -1366,12 +1366,12 @@
* Must not be <code>null</code>.
* @param filtering Whether or not token filtering should be used during
* the copy.
- * @param overwrite Whether or not the destination file should be
+ * @param overwrite Whether or not the destination file should be
* overwritten if it already exists.
* @param preserveLastModified Whether or not the last modified time of
* the resulting file should be set to that
* of the source file.
- *
+ *
* @exception IOException if the copying fails
*
* @deprecated
@@ -1379,7 +1379,7 @@
public void copyFile(String sourceFile, String destFile, boolean
filtering,
boolean overwrite, boolean preserveLastModified)
throws IOException {
- fileUtils.copyFile(sourceFile, destFile,
+ fileUtils.copyFile(sourceFile, destFile,
filtering ? globalFilters : null, overwrite,
preserveLastModified);
}
@@ -1391,7 +1391,7 @@
* Must not be <code>null</code>.
* @param destFile File to copy to.
* Must not be <code>null</code>.
- *
+ *
* @exception IOException if the copying fails
*
* @deprecated
@@ -1417,7 +1417,7 @@
*/
public void copyFile(File sourceFile, File destFile, boolean filtering)
throws IOException {
- fileUtils.copyFile(sourceFile, destFile,
+ fileUtils.copyFile(sourceFile, destFile,
filtering ? globalFilters : null);
}
@@ -1432,16 +1432,16 @@
* Must not be <code>null</code>.
* @param filtering Whether or not token filtering should be used during
* the copy.
- * @param overwrite Whether or not the destination file should be
+ * @param overwrite Whether or not the destination file should be
* overwritten if it already exists.
- *
+ *
* @exception IOException if the file cannot be copied.
*
* @deprecated
*/
public void copyFile(File sourceFile, File destFile, boolean filtering,
boolean overwrite) throws IOException {
- fileUtils.copyFile(sourceFile, destFile,
+ fileUtils.copyFile(sourceFile, destFile,
filtering ? globalFilters : null, overwrite);
}
@@ -1458,12 +1458,12 @@
* Must not be <code>null</code>.
* @param filtering Whether or not token filtering should be used during
* the copy.
- * @param overwrite Whether or not the destination file should be
+ * @param overwrite Whether or not the destination file should be
* overwritten if it already exists.
* @param preserveLastModified Whether or not the last modified time of
* the resulting file should be set to that
* of the source file.
- *
+ *
* @exception IOException if the file cannot be copied.
*
* @deprecated
@@ -1471,26 +1471,26 @@
public void copyFile(File sourceFile, File destFile, boolean filtering,
boolean overwrite, boolean preserveLastModified)
throws IOException {
- fileUtils.copyFile(sourceFile, destFile,
+ fileUtils.copyFile(sourceFile, destFile,
filtering ? globalFilters : null, overwrite,
preserveLastModified);
}
/**
* Calls File.setLastModified(long time) on Java above 1.1, and logs
* a warning on Java 1.1.
- *
+ *
* @param file The file to set the last modified time on.
* Must not be <code>null</code>.
*
* @param time the required modification time.
- *
+ *
* @deprecated
- *
+ *
* @exception BuildException if the last modified time cannot be set
- * despite running on a platform with a
version
+ * despite running on a platform with a version
* above 1.1.
*/
- public void setFileLastModified(File file, long time)
+ public void setFileLastModified(File file, long time)
throws BuildException {
if (JavaEnvUtils.isJavaVersion(JavaEnvUtils.JAVA_1_1)) {
log("Cannot change the modification time of " + file
@@ -1502,13 +1502,13 @@
}
/**
- * Returns the boolean equivalent of a string, which is considered
- * <code>true</code> if either <code>"on"</code>, <code>"true"</code>,
+ * Returns the boolean equivalent of a string, which is considered
+ * <code>true</code> if either <code>"on"</code>, <code>"true"</code>,
* or <code>"yes"</code> is found, ignoring case.
- *
- * @param s The string to convert to a boolean value.
+ *
+ * @param s The string to convert to a boolean value.
* Must not be <code>null</code>.
- *
+ *
* @return <code>true</code> if the given string is <code>"on"</code>,
* <code>"true"</code> or <code>"yes"</code>, or
* <code>false</code> otherwise.
@@ -1521,8 +1521,8 @@
/**
* Topologically sorts a set of targets.
- *
- * @param root The name of the root target. The sort is created in such
+ *
+ * @param root The name of the root target. The sort is created in such
* a way that the sequence of Targets up to the root
* target is the minimum possible such sequence.
* Must not be <code>null</code>.
@@ -1565,12 +1565,12 @@
/**
* Performs a single step in a recursive depth-first-search traversal of
- * the target dependency tree.
+ * the target dependency tree.
* <p>
- * The current target is first set to the "visiting" state, and pushed
- * onto the "visiting" stack.
+ * The current target is first set to the "visiting" state, and pushed
+ * onto the "visiting" stack.
* <p>
- * An exception is then thrown if any child of the current node is in
the
+ * An exception is then thrown if any child of the current node is in the
* visiting state, as that implies a circular dependency. The exception
* contains details of the cycle, using elements of the "visiting" stack.
* <p>
@@ -1584,22 +1584,22 @@
* <p>
* By the time this method returns, the ordered list contains the
sequence
* of targets up to and including the current target.
- *
- * @param root The current target to inspect.
+ *
+ * @param root The current target to inspect.
* Must not be <code>null</code>.
* @param targets A mapping from names to targets (String to Target).
* Must not be <code>null</code>.
- * @param state A mapping from target names to states
+ * @param state A mapping from target names to states
* (String to String).
* The states in question are "VISITING" and "VISITED".
* Must not be <code>null</code>.
* @param visiting A stack of targets which are currently being visited.
* Must not be <code>null</code>.
- * @param ret The list to add target names to. This will end up
- * containing the complete list of depenencies in
+ * @param ret The list to add target names to. This will end up
+ * containing the complete list of depenencies in
* dependency order.
* Must not be <code>null</code>.
- *
+ *
* @exception BuildException if a non-existent target is specified or if
* a circular dependency is detected.
*/
@@ -1650,12 +1650,12 @@
}
/**
- * Builds an appropriate exception detailing a specified circular
+ * Builds an appropriate exception detailing a specified circular
* dependency.
- *
+ *
* @param end The dependency to stop at. Must not be <code>null</code>.
* @param stk A stack of dependencies. Must not be <code>null</code>.
- *
+ *
* @return a BuildException detailing the specified circular dependency.
*/
private static BuildException makeCircularException(String end, Stack
stk) {
@@ -1672,7 +1672,7 @@
/**
* Adds a reference to the project.
- *
+ *
* @param name The name of the reference. Must not be <code>null</code>.
* @param value The value of the reference. Must not be
<code>null</code>.
*/
@@ -1683,7 +1683,7 @@
return;
}
if (old != null) {
- log("Overriding previous definition of reference to " + name,
+ log("Overriding previous definition of reference to " + name,
MSG_WARN);
}
log("Adding reference: " + name + " -> " + value, MSG_DEBUG);
@@ -1693,7 +1693,7 @@
/**
* Returns a map of the references in the project (String to Object).
* The returned hashtable is "live" and so should not be modified.
- *
+ *
* @return a map of the references in the project (String to Object).
*/
public Hashtable getReferences() {
@@ -1702,10 +1702,10 @@
/**
* Looks up a reference by its key (ID).
- *
- * @param key The key for the desired reference.
+ *
+ * @param key The key for the desired reference.
* Must not be <code>null</code>.
- *
+ *
* @return the reference with the specified ID, or <code>null</code> if
* there is no such reference in the project.
*/
@@ -1718,10 +1718,10 @@
* special handling for instances of tasks and data types.
* <p>
* This is useful for logging purposes.
- *
+ *
* @param element The element to describe.
* Must not be <code>null</code>.
- *
+ *
* @return a description of the element type
*
* @since 1.95, Ant 1.5
@@ -1778,10 +1778,10 @@
}
}
-
+
/**
* Sends a "target started" event to the build listeners for this
project.
- *
+ *
* @param target The target which is starting to build.
* Must not be <code>null</code>.
*/
@@ -1794,9 +1794,9 @@
}
/**
- * Sends a "target finished" event to the build listeners for this
+ * Sends a "target finished" event to the build listeners for this
* project.
- *
+ *
* @param target The target which has finished building.
* Must not be <code>null</code>.
* @param exception an exception indicating a reason for a build
@@ -1811,10 +1811,10 @@
listener.targetFinished(event);
}
}
-
+
/**
* Sends a "task started" event to the build listeners for this project.
- *
+ *
* @param task The target which is starting to execute.
* Must not be <code>null</code>.
*/
@@ -1829,9 +1829,9 @@
}
/**
- * Sends a "task finished" event to the build listeners for this
+ * Sends a "task finished" event to the build listeners for this
* project.
- *
+ *
* @param task The task which has finished executing.
* Must not be <code>null</code>.
* @param exception an exception indicating a reason for a build
@@ -1852,15 +1852,15 @@
/**
* Sends a "message logged" event to the build listeners for this
project.
- *
- * @param event The event to send. This should be built up with the
+ *
+ * @param event The event to send. This should be built up with the
* appropriate task/target/project by the caller, so that
* this method can set the message and priority, then
send
* the event. Must not be <code>null</code>.
* @param message The message to send. Should not be <code>null</code>.
* @param priority The priority of the message.
*/
- private void fireMessageLoggedEvent(BuildEvent event, String message,
+ private void fireMessageLoggedEvent(BuildEvent event, String message,
int priority) {
event.setMessage(message, priority);
for (int i = 0; i < listeners.size(); i++) {
@@ -1870,40 +1870,40 @@
}
/**
- * Sends a "message logged" project level event to the build listeners
for
+ * Sends a "message logged" project level event to the build listeners
for
* this project.
- *
+ *
* @param project The project generating the event.
* Should not be <code>null</code>.
* @param message The message to send. Should not be <code>null</code>.
* @param priority The priority of the message.
*/
- protected void fireMessageLogged(Project project, String message,
+ protected void fireMessageLogged(Project project, String message,
int priority) {
BuildEvent event = new BuildEvent(project);
fireMessageLoggedEvent(event, message, priority);
}
/**
- * Sends a "message logged" target level event to the build listeners
for
+ * Sends a "message logged" target level event to the build listeners for
* this project.
- *
- * @param target The target generating the event.
+ *
+ * @param target The target generating the event.
* Must not be <code>null</code>.
* @param message The message to send. Should not be <code>null</code>.
* @param priority The priority of the message.
*/
- protected void fireMessageLogged(Target target, String message,
+ protected void fireMessageLogged(Target target, String message,
int priority) {
BuildEvent event = new BuildEvent(target);
fireMessageLoggedEvent(event, message, priority);
}
/**
- * Sends a "message logged" task level event to the build listeners for
+ * Sends a "message logged" task level event to the build listeners for
* this project.
- *
- * @param task The task generating the event.
+ *
+ * @param task The task generating the event.
* Must not be <code>null</code>.
* @param message The message to send. Should not be <code>null</code>.
* @param priority The priority of the message.
@@ -1928,17 +1928,17 @@
threadTasks.remove(thread);
}
}
-
+
/**
* Get the current task assopciated with a thread, if any
*
* @param thread the thread for which the task is required.
* @return the task which is currently registered for the given thread or
- * null if no task is registered.
+ * null if no task is registered.
*/
public Task getThreadTask(Thread thread) {
return (Task) threadTasks.get(thread);
}
-
-
+
+
}
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>