Bugzilla: 22326 git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@275071 13f79535-47bb-0310-9956-ffa450edef68master
| @@ -54,8 +54,6 @@ | |||||
| package org.apache.tools.ant; | package org.apache.tools.ant; | ||||
| import org.apache.tools.ant.util.WeakishReference; | |||||
| import java.util.Enumeration; | import java.util.Enumeration; | ||||
| import java.util.Hashtable; | import java.util.Hashtable; | ||||
| import java.util.HashSet; | import java.util.HashSet; | ||||
| @@ -67,6 +65,7 @@ import java.util.Stack; | |||||
| import java.util.Vector; | import java.util.Vector; | ||||
| import java.io.InputStream; | import java.io.InputStream; | ||||
| import java.io.IOException; | import java.io.IOException; | ||||
| import java.lang.ref.WeakReference; | |||||
| import java.lang.reflect.Modifier; | import java.lang.reflect.Modifier; | ||||
| import org.apache.tools.ant.taskdefs.Typedef; | import org.apache.tools.ant.taskdefs.Typedef; | ||||
| @@ -87,6 +86,7 @@ import org.apache.tools.ant.taskdefs.Typedef; | |||||
| * | * | ||||
| * @author Costin Manolache | * @author Costin Manolache | ||||
| * @author Peter Reilly | * @author Peter Reilly | ||||
| * @author <a href="mailto:martijn@kruithof.xs4all.nl">Martijn Kruithof</a> | |||||
| * @since Ant1.6 | * @since Ant1.6 | ||||
| */ | */ | ||||
| public class ComponentHelper { | public class ComponentHelper { | ||||
| @@ -551,7 +551,7 @@ public class ComponentHelper { | |||||
| v = new Vector(); | v = new Vector(); | ||||
| createdTasks.put(type, v); | createdTasks.put(type, v); | ||||
| } | } | ||||
| v.addElement(WeakishReference.createReference(task)); | |||||
| v.addElement(new WeakReference(task)); | |||||
| } | } | ||||
| } | } | ||||
| @@ -568,8 +568,8 @@ public class ComponentHelper { | |||||
| if (v != null) { | if (v != null) { | ||||
| Enumeration taskEnum = v.elements(); | Enumeration taskEnum = v.elements(); | ||||
| while (taskEnum.hasMoreElements()) { | while (taskEnum.hasMoreElements()) { | ||||
| WeakishReference ref = | |||||
| (WeakishReference) taskEnum.nextElement(); | |||||
| WeakReference ref = | |||||
| (WeakReference) taskEnum.nextElement(); | |||||
| Task t = (Task) ref.get(); | Task t = (Task) ref.get(); | ||||
| //being a weak ref, it may be null by this point | //being a weak ref, it may be null by this point | ||||
| if (t != null) { | if (t != null) { | ||||
| @@ -641,7 +641,7 @@ public class ProjectHelper2 extends ProjectHelper { | |||||
| if (key.equals("default")) { | if (key.equals("default")) { | ||||
| if (value != null && !value.equals("")) { | if (value != null && !value.equals("")) { | ||||
| if (!context.isIgnoringProjectTag()) { | if (!context.isIgnoringProjectTag()) { | ||||
| project.setDefaultTarget(value); | |||||
| project.setDefault(value); | |||||
| } | } | ||||
| } | } | ||||
| } else if (key.equals("name")) { | } else if (key.equals("name")) { | ||||
| @@ -707,8 +707,8 @@ public class ProjectHelper2 extends ProjectHelper { | |||||
| if ((new File(baseDir)).isAbsolute()) { | if ((new File(baseDir)).isAbsolute()) { | ||||
| project.setBasedir(baseDir); | project.setBasedir(baseDir); | ||||
| } else { | } else { | ||||
| project.setBaseDir(project.resolveFile(baseDir, | |||||
| context.getBuildFileParent())); | |||||
| project.setBaseDir(fu.resolveFile( | |||||
| context.getBuildFileParent(), baseDir)); | |||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| @@ -97,6 +97,7 @@ import org.apache.tools.ant.types.selectors.SizeSelector; | |||||
| * @author Stefan Bodewig | * @author Stefan Bodewig | ||||
| * @author Magesh Umasankar | * @author Magesh Umasankar | ||||
| * @author <a href="mailto:bruce@callenish.com">Bruce Atherton</a> | * @author <a href="mailto:bruce@callenish.com">Bruce Atherton</a> | ||||
| * @author <a href="mailto:martijn@kruithof.xs4all.nl">Martijn Kruithof</a> | |||||
| */ | */ | ||||
| public abstract class AbstractFileSet extends DataType implements Cloneable, | public abstract class AbstractFileSet extends DataType implements Cloneable, | ||||
| SelectorContainer { | 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() { | public PatternSet.NameEntry createExcludesFile() { | ||||
| if (isReference()) { | if (isReference()) { | ||||
| @@ -224,8 +225,7 @@ public abstract class AbstractFileSet extends DataType implements Cloneable, | |||||
| if (isReference()) { | if (isReference()) { | ||||
| throw tooManyAttributes(); | throw tooManyAttributes(); | ||||
| } | } | ||||
| FileUtils fileUtils = FileUtils.newFileUtils(); | |||||
| setDir(fileUtils.getParentFile(file)); | |||||
| setDir(file.getParentFile()); | |||||
| PatternSet.NameEntry include = createInclude(); | PatternSet.NameEntry include = createInclude(); | ||||
| include.setName(file.getName()); | 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. | * @param excl The file to fetch the exclude patterns from. | ||||
| */ | */ | ||||
| @@ -58,7 +58,6 @@ import java.util.Enumeration; | |||||
| import java.util.Properties; | import java.util.Properties; | ||||
| import java.util.Vector; | import java.util.Vector; | ||||
| import java.util.List; | import java.util.List; | ||||
| import java.util.ArrayList; | |||||
| import java.util.LinkedList; | import java.util.LinkedList; | ||||
| import java.util.ListIterator; | import java.util.ListIterator; | ||||