From 0c43380c15fc81165edf01e2cb6152e9b4087288 Mon Sep 17 00:00:00 2001 From: Peter Reilly Date: Wed, 13 Aug 2003 14:06:20 +0000 Subject: [PATCH] remove some deprecated methods and 1.1 holdovers Bugzilla: 22326 git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@275071 13f79535-47bb-0310-9956-ffa450edef68 --- src/main/org/apache/tools/ant/ComponentHelper.java | 10 +++++----- .../org/apache/tools/ant/helper/ProjectHelper2.java | 6 +++--- .../org/apache/tools/ant/types/AbstractFileSet.java | 8 ++++---- .../org/apache/tools/ant/types/CommandlineJava.java | 1 - 4 files changed, 12 insertions(+), 13 deletions(-) diff --git a/src/main/org/apache/tools/ant/ComponentHelper.java b/src/main/org/apache/tools/ant/ComponentHelper.java index fe1fee281..abe5f3482 100644 --- a/src/main/org/apache/tools/ant/ComponentHelper.java +++ b/src/main/org/apache/tools/ant/ComponentHelper.java @@ -54,8 +54,6 @@ package org.apache.tools.ant; -import org.apache.tools.ant.util.WeakishReference; - import java.util.Enumeration; import java.util.Hashtable; import java.util.HashSet; @@ -67,6 +65,7 @@ import java.util.Stack; import java.util.Vector; import java.io.InputStream; import java.io.IOException; +import java.lang.ref.WeakReference; import java.lang.reflect.Modifier; import org.apache.tools.ant.taskdefs.Typedef; @@ -87,6 +86,7 @@ import org.apache.tools.ant.taskdefs.Typedef; * * @author Costin Manolache * @author Peter Reilly + * @author Martijn Kruithof * @since Ant1.6 */ public class ComponentHelper { @@ -551,7 +551,7 @@ public class ComponentHelper { v = new Vector(); createdTasks.put(type, v); } - v.addElement(WeakishReference.createReference(task)); + v.addElement(new WeakReference(task)); } } @@ -568,8 +568,8 @@ public class ComponentHelper { if (v != null) { Enumeration taskEnum = v.elements(); while (taskEnum.hasMoreElements()) { - WeakishReference ref = - (WeakishReference) taskEnum.nextElement(); + WeakReference ref = + (WeakReference) taskEnum.nextElement(); Task t = (Task) ref.get(); //being a weak ref, it may be null by this point if (t != null) { diff --git a/src/main/org/apache/tools/ant/helper/ProjectHelper2.java b/src/main/org/apache/tools/ant/helper/ProjectHelper2.java index 607cdd13e..0efbdd7b4 100644 --- a/src/main/org/apache/tools/ant/helper/ProjectHelper2.java +++ b/src/main/org/apache/tools/ant/helper/ProjectHelper2.java @@ -641,7 +641,7 @@ public class ProjectHelper2 extends ProjectHelper { if (key.equals("default")) { if (value != null && !value.equals("")) { if (!context.isIgnoringProjectTag()) { - project.setDefaultTarget(value); + project.setDefault(value); } } } else if (key.equals("name")) { @@ -707,8 +707,8 @@ public class ProjectHelper2 extends ProjectHelper { if ((new File(baseDir)).isAbsolute()) { project.setBasedir(baseDir); } else { - project.setBaseDir(project.resolveFile(baseDir, - context.getBuildFileParent())); + project.setBaseDir(fu.resolveFile( + context.getBuildFileParent(), baseDir)); } } } diff --git a/src/main/org/apache/tools/ant/types/AbstractFileSet.java b/src/main/org/apache/tools/ant/types/AbstractFileSet.java index bc6646ee0..88ac4987a 100644 --- a/src/main/org/apache/tools/ant/types/AbstractFileSet.java +++ b/src/main/org/apache/tools/ant/types/AbstractFileSet.java @@ -97,6 +97,7 @@ import org.apache.tools.ant.types.selectors.SizeSelector; * @author Stefan Bodewig * @author Magesh Umasankar * @author Bruce Atherton + * @author Martijn Kruithof */ public abstract class AbstractFileSet extends DataType implements Cloneable, SelectorContainer { @@ -208,7 +209,7 @@ public abstract class AbstractFileSet extends DataType implements Cloneable, } /** - * add a name entry on the include files list + * add a name entry on the excludes files list */ public PatternSet.NameEntry createExcludesFile() { if (isReference()) { @@ -224,8 +225,7 @@ public abstract class AbstractFileSet extends DataType implements Cloneable, if (isReference()) { throw tooManyAttributes(); } - FileUtils fileUtils = FileUtils.newFileUtils(); - setDir(fileUtils.getParentFile(file)); + setDir(file.getParentFile()); PatternSet.NameEntry include = createInclude(); include.setName(file.getName()); @@ -277,7 +277,7 @@ public abstract class AbstractFileSet extends DataType implements Cloneable, } /** - * Sets the name of the file containing the includes patterns. + * Sets the name of the file containing the excludes patterns. * * @param excl The file to fetch the exclude patterns from. */ diff --git a/src/main/org/apache/tools/ant/types/CommandlineJava.java b/src/main/org/apache/tools/ant/types/CommandlineJava.java index 0d0276d3f..ad2e0b971 100644 --- a/src/main/org/apache/tools/ant/types/CommandlineJava.java +++ b/src/main/org/apache/tools/ant/types/CommandlineJava.java @@ -58,7 +58,6 @@ import java.util.Enumeration; import java.util.Properties; import java.util.Vector; import java.util.List; -import java.util.ArrayList; import java.util.LinkedList; import java.util.ListIterator;