bodewig 2002/08/08 23:49:17
Modified: . Tag: ANT_15_BRANCH WHATSNEW
src/main/org/apache/tools/ant/taskdefs Tag: ANT_15_BRANCH
Available.java
Log:
we'd better declare that variable.
Revision Changes Path
No revision
No revision
1.263.2.69 +3 -0 jakarta-ant/WHATSNEW
Index: WHATSNEW
===================================================================
RCS file: /home/cvs/jakarta-ant/WHATSNEW,v
retrieving revision 1.263.2.68
retrieving revision 1.263.2.69
diff -u -r1.263.2.68 -r1.263.2.69
--- WHATSNEW 31 Jul 2002 06:59:49 -0000 1.263.2.68
+++ WHATSNEW 9 Aug 2002 06:49:17 -0000 1.263.2.69
@@ -27,6 +27,9 @@
* Appendix E of Java Development with Ant (Loughran/Hatcher) was
contributed to the docs.
+* <available> will only print deprecration warnings if it is actually
+ used to change the value of a property.
+
Changes from Ant 1.5beta3 to Ant 1.5
====================================
No revision
No revision
1.44.2.5 +13 -14
jakarta-ant/src/main/org/apache/tools/ant/taskdefs/Available.java
Index: Available.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/Available.java,v
retrieving revision 1.44.2.4
retrieving revision 1.44.2.5
diff -u -r1.44.2.4 -r1.44.2.5
--- Available.java 9 Aug 2002 00:52:54 -0000 1.44.2.4
+++ Available.java 9 Aug 2002 06:49:17 -0000 1.44.2.5
@@ -55,11 +55,10 @@
package org.apache.tools.ant.taskdefs;
import java.io.File;
-
-import org.apache.tools.ant.Task;
import org.apache.tools.ant.AntClassLoader;
import org.apache.tools.ant.BuildException;
import org.apache.tools.ant.Project;
+import org.apache.tools.ant.Task;
import org.apache.tools.ant.taskdefs.condition.Condition;
import org.apache.tools.ant.types.EnumeratedAttribute;
import org.apache.tools.ant.types.Path;
@@ -109,7 +108,7 @@
*/
public Path createClasspath() {
if (this.classpath == null) {
- this.classpath = new Path(project);
+ this.classpath = new Path(getProject());
}
return this.classpath.createPath();
}
@@ -141,7 +140,7 @@
*/
public Path createFilepath() {
if (this.filepath == null) {
- this.filepath = new Path(project);
+ this.filepath = new Path(getProject());
}
return this.filepath.createPath();
}
@@ -184,9 +183,9 @@
*
* @param file the name of the file which is required.
*/
- public void setFile(File f) {
+ public void setFile(File file) {
this.file = FileUtils.newFileUtils()
- .removeLeadingPath(getProject().getBaseDir(), f);
+ .removeLeadingPath(getProject().getBaseDir(), file);
}
/**
@@ -240,13 +239,13 @@
public void execute() throws BuildException {
if (property == null) {
throw new BuildException("property attribute is required",
- location);
+ getLocation());
}
isTask = true;
try {
if (eval()) {
- oldvalue=getProject().getProperty(property);
+ String oldvalue = getProject().getProperty(property);
if (null != oldvalue && !oldvalue.equals(value)) {
log("DEPRECATED - <available> used to override an
existing"
+ " property."
@@ -265,25 +264,25 @@
* Evaluate the availability of a resource.
*
* @return boolean is the resource is available.
- * @exception if the condition is not configured correctly
+ * @exception BuildException if the condition is not configured correctly
*/
public boolean eval() throws BuildException {
if (classname == null && file == null && resource == null) {
throw new BuildException("At least one of (classname|file|"
- + "resource) is required", location);
+ + "resource) is required",
getLocation());
}
if (type != null) {
if (file == null) {
throw new BuildException("The type attribute is only valid "
+ "when specifying the file "
- + "attribute.", location);
+ + "attribute.", getLocation());
}
}
if (classpath != null) {
- classpath.setProject(project);
- this.loader = new AntClassLoader(project, classpath);
+ classpath.setProject(getProject());
+ this.loader = new AntClassLoader(getProject(), classpath);
}
String appendix = "";
@@ -345,7 +344,7 @@
*/
private boolean checkFile() {
if (filepath == null) {
- return checkFile(project.resolveFile(file), file);
+ return checkFile(getProject().resolveFile(file), file);
} else {
String[] paths = filepath.list();
for (int i = 0; i < paths.length; ++i) {
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>