Sync up condition checks with current Ant1 git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@272240 13f79535-47bb-0310-9956-ffa450edef68master
| @@ -90,10 +90,6 @@ | |||
| unless="jdk1.2+" /> | |||
| <exclude name="${optional.package}/metamata/*.java" | |||
| unless="jdk1.2+" /> | |||
| <exclude name="${optional.type.package}/depend/*.java" | |||
| unless="jdk1.2+" /> | |||
| <exclude name="${util.package}/depend/*.java" | |||
| unless="jdk1.2+" /> | |||
| <exclude name="${optional.package}/ejb/EjbJar.java" | |||
| unless="jdk1.2+" /> | |||
| <exclude name="${optional.package}/ejb/*DeploymentTool.java" | |||
| @@ -103,6 +99,9 @@ | |||
| <!-- uses the context classloader --> | |||
| <exclude name="${optional.package}/junit/JUnitClassLoaderTest.java" | |||
| unless="jdk1.2+" /> | |||
| <!-- use various 1.2 methods --> | |||
| <exclude name="${optional.package}/sitraka/**/*.java" | |||
| unless="jdk1.2+" /> | |||
| </patternset> | |||
| <patternset id="needs.jdk1.3+"> | |||
| <exclude name="${ant.package}/taskdefs/TestProcess.java" | |||
| @@ -114,7 +113,7 @@ | |||
| </patternset> | |||
| <!-- classes that should be present in Sun based JVMs, but not in | |||
| Kaffe for example --> | |||
| Kaffe for example --> | |||
| <patternset id="needs.sun.tools"> | |||
| <exclude name="${optional.package}/Native2Ascii.java" | |||
| unless="sun.tools.present" /> | |||
| @@ -136,10 +135,6 @@ | |||
| <patternset id="needs.trax"> | |||
| <exclude name="${optional.package}/TraXLiaison*.java" | |||
| unless="trax.present" /> | |||
| <exclude name="${optional.package}/junit/XMLResultAggregator.java" | |||
| unless="trax.present" /> | |||
| <exclude name="${optional.package}/junit/AggregateTransformer.java" | |||
| unless="trax.present" /> | |||
| <exclude name="${optional.package}/sitraka/**" | |||
| unless="trax.present"/> | |||
| <exclude name="${optional.package}/metamata/MMetrics*" | |||
| @@ -152,12 +147,6 @@ | |||
| unless="xalan.present" /> | |||
| </patternset> | |||
| <patternset id="needs.xalan2"> | |||
| <exclude name="${optional.package}/junit/XMLResultAggregator.java" | |||
| unless="xalan2.present" /> | |||
| <exclude name="${optional.package}/junit/AggregateTransformer.java" | |||
| unless="xalan2.present" /> | |||
| <exclude name="${optional.package}/junit/XalanExecutor.java" | |||
| unless="xalan2.present" /> | |||
| <exclude name="${optional.package}/junit/Xalan2Executor.java" | |||
| unless="xalan2.present" /> | |||
| </patternset> | |||
| @@ -185,6 +174,8 @@ | |||
| unless="bcel.present" /> | |||
| <exclude name="${util.package}/depend/bcel/*.java" | |||
| unless="bcel.present" /> | |||
| <exclude name="${optional.type.package}/depend/ClassFileSetTest.java" | |||
| unless="bcel.present" /> | |||
| </patternset> | |||
| <patternset id="needs.jakarta.log4j"> | |||
| <exclude name="${ant.package}/listener/Log4jListener.java" | |||
| @@ -272,9 +263,13 @@ | |||
| <available property="bsf.present" | |||
| classname="com.ibm.bsf.BSFManager" | |||
| classpathref="classpath" /> | |||
| <available property="netrexx.present" | |||
| classname="netrexx.lang.Rexx" | |||
| classpathref="classpath" /> | |||
| <condition property="netrexx.present"> | |||
| <and> | |||
| <isset property="jdk1.2+"/> | |||
| <available classname="netrexx.lang.Rexx" | |||
| classpathref="classpath"/> | |||
| </and> | |||
| </condition> | |||
| <available property="trax.present" | |||
| classname="javax.xml.transform.Transformer" | |||
| classpathref="classpath" /> | |||
| @@ -323,9 +318,13 @@ | |||
| <available property="jmf.present" | |||
| classname="javax.sound.sampled.Clip" | |||
| classpathref="classpath"/> | |||
| <available property="icontract.present" | |||
| classname="com.reliablesystems.iContract.IContracted" | |||
| classpathref="classpath"/> | |||
| <condition property="icontract.present"> | |||
| <and> | |||
| <isset property="jdk1.2+"/> | |||
| <available classname="com.reliablesystems.iContract.IContracted" | |||
| classpathref="classpath"/> | |||
| </and> | |||
| </condition> | |||
| <available property="jdepend.present" | |||
| classname="jdepend.framework.JDepend" | |||
| classpathref="classpath"/> | |||
| @@ -350,9 +349,13 @@ | |||
| <available property="xerces.present" | |||
| classname="org.apache.xerces.parsers.SAXParser" | |||
| classpathref="classpath" /> | |||
| <available property="bcel.present" | |||
| classname="org.apache.bcel.Constants" | |||
| classpathref="classpath" /> | |||
| <condition property="bcel.present"> | |||
| <and> | |||
| <isset property="jdk1.2+"/> | |||
| <available classname="org.apache.bcel.Constants" | |||
| classpathref="classpath"/> | |||
| </and> | |||
| </condition> | |||
| <available property="sunuue.present" | |||
| classname="sun.misc.UUEncoder" | |||
| classpathref="classpath" /> | |||
| @@ -407,7 +410,8 @@ | |||
| <javac destdir="${bin.dir}/ant1compat" | |||
| srcdir="${bin.dir}/ant1src_copy:${java.dir}/antlibs/ant1compat" | |||
| debug="${debug}"> | |||
| <classpath refid="classpath"/> | |||
| <classpath refid="classpath" /> | |||
| <patternset refid="needs.jdk1.2+" /> | |||
| <patternset refid="needs.jdk1.4+" /> | |||
| @@ -161,7 +161,7 @@ public class AntLibManager { | |||
| throws ExecutionException { | |||
| // check if any already defined | |||
| for (Iterator i = librarySpecs.keySet().iterator(); i.hasNext(); ) { | |||
| for (Iterator i = librarySpecs.keySet().iterator(); i.hasNext();) { | |||
| String libraryId = (String)i.next(); | |||
| if (libraries.containsKey(libraryId)) { | |||
| AntLibrary currentVersion | |||
| @@ -174,7 +174,7 @@ public class AntLibManager { | |||
| CircularDependencyChecker configuring | |||
| = new CircularDependencyChecker("configuring Ant libraries"); | |||
| for (Iterator i = librarySpecs.keySet().iterator(); i.hasNext(); ) { | |||
| for (Iterator i = librarySpecs.keySet().iterator(); i.hasNext();) { | |||
| String libraryId = (String)i.next(); | |||
| if (!libraries.containsKey(libraryId)) { | |||
| configLibrary(initConfig, librarySpecs, libraryId, | |||
| @@ -309,7 +309,7 @@ public class AntLibManager { | |||
| } | |||
| } | |||
| for (Iterator i = urlsList.iterator(); i.hasNext(); ) { | |||
| for (Iterator i = urlsList.iterator(); i.hasNext();) { | |||
| antLibrary.addLibraryURL((URL)i.next()); | |||
| } | |||
| if (extendsId != null) { | |||
| @@ -322,7 +322,7 @@ public class AntLibManager { | |||
| List libPaths = (List)libPathsMap.get(libraryId); | |||
| if (libPaths != null) { | |||
| for (Iterator j = libPaths.iterator(); j.hasNext(); ) { | |||
| for (Iterator j = libPaths.iterator(); j.hasNext();) { | |||
| URL pathURL = (URL)j.next(); | |||
| addLibPath(antLibrary, pathURL); | |||
| } | |||
| @@ -115,7 +115,7 @@ public class BuildEventSupport implements DemuxOutputReceiver { | |||
| */ | |||
| public void fireBuildStarted(ModelElement element) { | |||
| BuildEvent event = new BuildEvent(element, BuildEvent.BUILD_STARTED); | |||
| for (Iterator i = listeners.iterator(); i.hasNext(); ) { | |||
| for (Iterator i = listeners.iterator(); i.hasNext();) { | |||
| BuildListener listener = (BuildListener)i.next(); | |||
| listener.buildStarted(event); | |||
| } | |||
| @@ -131,7 +131,7 @@ public class BuildEventSupport implements DemuxOutputReceiver { | |||
| Throwable cause) { | |||
| BuildEvent event = new BuildEvent(element, BuildEvent.BUILD_FINISHED, | |||
| cause); | |||
| for (Iterator i = listeners.iterator(); i.hasNext(); ) { | |||
| for (Iterator i = listeners.iterator(); i.hasNext();) { | |||
| BuildListener listener = (BuildListener)i.next(); | |||
| listener.buildFinished(event); | |||
| } | |||
| @@ -144,7 +144,7 @@ public class BuildEventSupport implements DemuxOutputReceiver { | |||
| */ | |||
| public void fireTargetStarted(ModelElement element) { | |||
| BuildEvent event = new BuildEvent(element, BuildEvent.TARGET_STARTED); | |||
| for (Iterator i = listeners.iterator(); i.hasNext(); ) { | |||
| for (Iterator i = listeners.iterator(); i.hasNext();) { | |||
| BuildListener listener = (BuildListener)i.next(); | |||
| listener.targetStarted(event); | |||
| } | |||
| @@ -160,7 +160,7 @@ public class BuildEventSupport implements DemuxOutputReceiver { | |||
| Throwable cause) { | |||
| BuildEvent event = new BuildEvent(element, BuildEvent.TARGET_FINISHED, | |||
| cause); | |||
| for (Iterator i = listeners.iterator(); i.hasNext(); ) { | |||
| for (Iterator i = listeners.iterator(); i.hasNext();) { | |||
| BuildListener listener = (BuildListener)i.next(); | |||
| listener.targetFinished(event); | |||
| } | |||
| @@ -176,7 +176,7 @@ public class BuildEventSupport implements DemuxOutputReceiver { | |||
| threadTasks.put(Thread.currentThread(), task); | |||
| } | |||
| BuildEvent event = new BuildEvent(task, BuildEvent.TASK_STARTED); | |||
| for (Iterator i = listeners.iterator(); i.hasNext(); ) { | |||
| for (Iterator i = listeners.iterator(); i.hasNext();) { | |||
| BuildListener listener = (BuildListener)i.next(); | |||
| listener.taskStarted(event); | |||
| } | |||
| @@ -197,7 +197,7 @@ public class BuildEventSupport implements DemuxOutputReceiver { | |||
| } | |||
| BuildEvent event = new BuildEvent(task, BuildEvent.TASK_FINISHED, | |||
| cause); | |||
| for (Iterator i = listeners.iterator(); i.hasNext(); ) { | |||
| for (Iterator i = listeners.iterator(); i.hasNext();) { | |||
| BuildListener listener = (BuildListener)i.next(); | |||
| listener.taskFinished(event); | |||
| } | |||
| @@ -213,7 +213,7 @@ public class BuildEventSupport implements DemuxOutputReceiver { | |||
| public void fireMessageLogged(Object source, | |||
| String message, int priority) { | |||
| BuildEvent event = new BuildEvent(source, message, priority); | |||
| for (Iterator i = listeners.iterator(); i.hasNext(); ) { | |||
| for (Iterator i = listeners.iterator(); i.hasNext();) { | |||
| BuildListener listener = (BuildListener)i.next(); | |||
| listener.messageLogged(event); | |||
| } | |||
| @@ -245,7 +245,7 @@ public class ComponentManager implements ComponentService { | |||
| throw new ExecutionException("Unable to import library " + libraryId | |||
| + " as it has not been loaded"); | |||
| } | |||
| for (Iterator i = library.getDefinitionNames(); i.hasNext(); ) { | |||
| for (Iterator i = library.getDefinitionNames(); i.hasNext();) { | |||
| String defName = (String)i.next(); | |||
| importLibraryDef(library, defName, null); | |||
| } | |||
| @@ -360,7 +360,7 @@ public class ComponentManager implements ComponentService { | |||
| antLibraries = new HashMap(standardLibs); | |||
| // go through the libraries and import all standard ant libraries | |||
| for (Iterator i = antLibraries.keySet().iterator(); i.hasNext(); ) { | |||
| for (Iterator i = antLibraries.keySet().iterator(); i.hasNext();) { | |||
| String libraryId = (String)i.next(); | |||
| if (libraryId.startsWith(Constants.ANT_LIB_PREFIX)) { | |||
| // standard library - import whole library | |||
| @@ -805,7 +805,7 @@ public class ComponentManager implements ComponentService { | |||
| throws ExecutionException { | |||
| Setter setter = getSetter(element.getClass()); | |||
| // start by setting the attributes of this element | |||
| for (Iterator i = model.getAttributeNames(); i.hasNext(); ) { | |||
| for (Iterator i = model.getAttributeNames(); i.hasNext();) { | |||
| String attributeName = (String)i.next(); | |||
| String attributeValue = model.getAttributeValue(attributeName); | |||
| if (!setter.supportsAttribute(attributeName)) { | |||
| @@ -828,7 +828,7 @@ public class ComponentManager implements ComponentService { | |||
| } | |||
| // now do the nested elements | |||
| for (Iterator i = model.getNestedElements(); i.hasNext(); ) { | |||
| for (Iterator i = model.getNestedElements(); i.hasNext();) { | |||
| BuildElement nestedElementModel = (BuildElement)i.next(); | |||
| String nestedElementName = nestedElementModel.getType(); | |||
| ImportInfo info = getDefinition(nestedElementName); | |||
| @@ -901,7 +901,7 @@ public class ComponentManager implements ComponentService { | |||
| try { | |||
| AntLibFactory libFactory = getLibFactory(library); | |||
| ClassLoader converterLoader = library.getClassLoader(); | |||
| for (Iterator i = library.getConverterClassNames(); i.hasNext(); ) { | |||
| for (Iterator i = library.getConverterClassNames(); i.hasNext();) { | |||
| className = (String)i.next(); | |||
| Class converterClass | |||
| = Class.forName(className, true, converterLoader); | |||
| @@ -136,7 +136,7 @@ public class ExecutionManager implements DemuxOutputReceiver { | |||
| librarySpecs.clear(); | |||
| // add any additional libraries. | |||
| for (Iterator i = config.getLibraryLocations(); i.hasNext(); ) { | |||
| for (Iterator i = config.getLibraryLocations(); i.hasNext();) { | |||
| // try file first | |||
| String libLocation = (String)i.next(); | |||
| libManager.loadLibs(librarySpecs, libLocation); | |||
| @@ -168,7 +168,7 @@ public class ExecutionManager implements DemuxOutputReceiver { | |||
| project.validate(); | |||
| mainFrame = new Frame(antLibraries, initConfig, config); | |||
| for (Iterator j = eventSupport.getListeners(); j.hasNext(); ) { | |||
| for (Iterator j = eventSupport.getListeners(); j.hasNext();) { | |||
| BuildListener listener = (BuildListener)j.next(); | |||
| mainFrame.addBuildListener(listener); | |||
| } | |||
| @@ -187,7 +187,7 @@ public class Frame implements DemuxOutputReceiver { | |||
| this.project = project; | |||
| referencedFrames = new HashMap(); | |||
| for (Iterator i = project.getReferencedProjectNames(); i.hasNext(); ) { | |||
| for (Iterator i = project.getReferencedProjectNames(); i.hasNext();) { | |||
| String referenceName = (String)i.next(); | |||
| Project referencedProject | |||
| = project.getReferencedProject(referenceName); | |||
| @@ -507,7 +507,7 @@ public class Frame implements DemuxOutputReceiver { | |||
| * @exception ExecutionException if the frame cannot be created. | |||
| */ | |||
| protected void addProperties(Map properties) throws ExecutionException { | |||
| for (Iterator i = properties.keySet().iterator(); i.hasNext(); ) { | |||
| for (Iterator i = properties.keySet().iterator(); i.hasNext();) { | |||
| String name = (String)i.next(); | |||
| Object value = properties.get(name); | |||
| setDataValue(name, value, false); | |||
| @@ -526,7 +526,7 @@ public class Frame implements DemuxOutputReceiver { | |||
| Frame newFrame | |||
| = new Frame(standardLibs, initConfig, config); | |||
| newFrame.setProject(project); | |||
| for (Iterator j = eventSupport.getListeners(); j.hasNext(); ) { | |||
| for (Iterator j = eventSupport.getListeners(); j.hasNext();) { | |||
| BuildListener listener = (BuildListener)j.next(); | |||
| newFrame.addBuildListener(listener); | |||
| } | |||
| @@ -549,7 +549,7 @@ public class Frame implements DemuxOutputReceiver { | |||
| * @param listener the listener to be added to the frame | |||
| */ | |||
| protected void addBuildListener(BuildListener listener) { | |||
| for (Iterator i = getReferencedFrames(); i.hasNext(); ) { | |||
| for (Iterator i = getReferencedFrames(); i.hasNext();) { | |||
| Frame referencedFrame = (Frame)i.next(); | |||
| referencedFrame.addBuildListener(listener); | |||
| } | |||
| @@ -562,7 +562,7 @@ public class Frame implements DemuxOutputReceiver { | |||
| * @param listener the listener to be removed | |||
| */ | |||
| protected void removeBuildListener(BuildListener listener) { | |||
| for (Iterator i = getReferencedFrames(); i.hasNext(); ) { | |||
| for (Iterator i = getReferencedFrames(); i.hasNext();) { | |||
| Frame subFrame = (Frame)i.next(); | |||
| subFrame.removeBuildListener(listener); | |||
| } | |||
| @@ -588,7 +588,7 @@ public class Frame implements DemuxOutputReceiver { | |||
| executeTarget(defaultTarget); | |||
| } | |||
| } else { | |||
| for (Iterator i = targets.iterator(); i.hasNext(); ) { | |||
| for (Iterator i = targets.iterator(); i.hasNext();) { | |||
| String targetName = (String)i.next(); | |||
| log("Executing target: " + targetName, MessageLevel.MSG_DEBUG); | |||
| executeTarget(targetName); | |||
| @@ -611,7 +611,7 @@ public class Frame implements DemuxOutputReceiver { | |||
| try { | |||
| // firstly build a list of fully qualified target names to execute. | |||
| List dependencyOrder = project.getTargetDependencies(targetName); | |||
| for (Iterator i = dependencyOrder.iterator(); i.hasNext(); ) { | |||
| for (Iterator i = dependencyOrder.iterator(); i.hasNext();) { | |||
| String fullTargetName = (String)i.next(); | |||
| Frame frame = getContainingFrame(fullTargetName); | |||
| String localTargetName = getNameInFrame(fullTargetName); | |||
| @@ -717,7 +717,7 @@ public class Frame implements DemuxOutputReceiver { | |||
| * failed | |||
| */ | |||
| protected void initialize() throws ExecutionException { | |||
| for (Iterator i = getReferencedFrames(); i.hasNext(); ) { | |||
| for (Iterator i = getReferencedFrames(); i.hasNext();) { | |||
| Frame referencedFrame = (Frame)i.next(); | |||
| referencedFrame.initialize(); | |||
| } | |||
| @@ -765,7 +765,7 @@ public class Frame implements DemuxOutputReceiver { | |||
| } | |||
| setDataValue(MagicProperties.BASEDIR, baseDir.getAbsolutePath(), true); | |||
| for (Iterator i = getReferencedFrames(); i.hasNext(); ) { | |||
| for (Iterator i = getReferencedFrames(); i.hasNext();) { | |||
| Frame refFrame = (Frame)i.next(); | |||
| refFrame.determineBaseDirs(); | |||
| } | |||
| @@ -415,7 +415,7 @@ public class Reflector implements Setter { | |||
| if (converters != null) { | |||
| // desparate by now - try top find a converter which handles a super | |||
| // class of this type and which supports subclass instantiation | |||
| for (Iterator i = converters.keySet().iterator(); i.hasNext(); ) { | |||
| for (Iterator i = converters.keySet().iterator(); i.hasNext();) { | |||
| Class converterType = (Class)i.next(); | |||
| if (converterType.isAssignableFrom(type)) { | |||
| // could be a candidate | |||
| @@ -88,7 +88,7 @@ public class BuildElementHandler extends ModelElementHandler { | |||
| = new BuildElement(getLocation(), elementName); | |||
| setModelElement(buildElement); | |||
| for (Iterator i = getAttributes(); i.hasNext(); ) { | |||
| for (Iterator i = getAttributes(); i.hasNext();) { | |||
| String attributeName = (String)i.next(); | |||
| buildElement.addAttribute(attributeName, | |||
| getAttribute(attributeName)); | |||
| @@ -472,7 +472,7 @@ public class Project implements org.apache.ant.common.event.BuildListener { | |||
| public Hashtable getProperties() { | |||
| Map properties = dataService.getAllProperties(); | |||
| Hashtable result = new Hashtable(); | |||
| for (Iterator i = properties.keySet().iterator(); i.hasNext(); ) { | |||
| for (Iterator i = properties.keySet().iterator(); i.hasNext();) { | |||
| String name = (String)i.next(); | |||
| Object value = properties.get(name); | |||
| if (value instanceof String) { | |||
| @@ -500,7 +500,7 @@ public class Project implements org.apache.ant.common.event.BuildListener { | |||
| public Hashtable getReferences() { | |||
| Map properties = dataService.getAllProperties(); | |||
| Hashtable result = new Hashtable(); | |||
| for (Iterator i = properties.keySet().iterator(); i.hasNext(); ) { | |||
| for (Iterator i = properties.keySet().iterator(); i.hasNext();) { | |||
| String name = (String)i.next(); | |||
| Object value = properties.get(name); | |||
| if (!(value instanceof String)) { | |||
| @@ -65,8 +65,6 @@ import org.apache.ant.common.util.ExecutionException; | |||
| public abstract class ProjectComponent { | |||
| /** The project in which the project component operates */ | |||
| protected Project project; | |||
| /** The location within the build file of this project component */ | |||
| protected Location location; | |||
| /** The core context for this component */ | |||
| private AntContext context; | |||
| /** The type of the component bneing created */ | |||
| @@ -82,15 +80,6 @@ public abstract class ProjectComponent { | |||
| this.project = project; | |||
| } | |||
| /** | |||
| * Sets the file location where this task was defined. | |||
| * | |||
| * @param location the new location value | |||
| */ | |||
| public void setLocation(Location location) { | |||
| this.location = location; | |||
| } | |||
| /** | |||
| * Gets the project of the ProjectComponent | |||
| * | |||
| @@ -100,16 +89,6 @@ public abstract class ProjectComponent { | |||
| return project; | |||
| } | |||
| /** | |||
| * Gets the location of the ProjectComponent's associated model element | |||
| * in the build file | |||
| * | |||
| * @return the location of the associated model element | |||
| */ | |||
| public Location getLocation() { | |||
| return location; | |||
| } | |||
| /** | |||
| * Gets the componentType of the ProjectComponent | |||
| * | |||
| @@ -141,17 +120,6 @@ public abstract class ProjectComponent { | |||
| this.context = context; | |||
| this.componentType = componentType; | |||
| org.apache.ant.common.util.Location contextLocation | |||
| = context.getLocation(); | |||
| if (contextLocation | |||
| == org.apache.ant.common.util.Location.UNKNOWN_LOCATION) { | |||
| location = Location.UNKNOWN_LOCATION; | |||
| } else { | |||
| location = new Location(contextLocation.getSource(), | |||
| contextLocation.getLineNumber(), | |||
| contextLocation.getColumnNumber()); | |||
| } | |||
| } | |||
| /** | |||
| @@ -73,6 +73,8 @@ public abstract class Task extends ProjectComponent | |||
| protected String taskType = null; | |||
| /** The description of this task */ | |||
| protected String description = null; | |||
| /** The location within the build file of this project component */ | |||
| protected Location location; | |||
| /** | |||
| * Called by the project to let the task do its work. This method may be | |||
| @@ -142,6 +144,16 @@ public abstract class Task extends ProjectComponent | |||
| return description; | |||
| } | |||
| /** | |||
| * Gets the location of the ProjectComponent's associated model element | |||
| * in the build file | |||
| * | |||
| * @return the location of the associated model element | |||
| */ | |||
| public Location getLocation() { | |||
| return location; | |||
| } | |||
| /** | |||
| * Add a nested task to this Ant1 task. | |||
| @@ -181,6 +193,18 @@ public abstract class Task extends ProjectComponent | |||
| taskType = componentType; | |||
| taskName = componentType; | |||
| org.apache.ant.common.util.Location contextLocation | |||
| = context.getLocation(); | |||
| if (contextLocation | |||
| == org.apache.ant.common.util.Location.UNKNOWN_LOCATION) { | |||
| location = Location.UNKNOWN_LOCATION; | |||
| } else { | |||
| location = new Location(contextLocation.getSource(), | |||
| contextLocation.getLineNumber(), | |||
| contextLocation.getColumnNumber()); | |||
| } | |||
| init(); | |||
| } | |||
| @@ -257,5 +281,15 @@ public abstract class Task extends ProjectComponent | |||
| void setTaskType(String type) { | |||
| this.taskType = type; | |||
| } | |||
| /** | |||
| * Sets the file location where this task was defined. | |||
| * | |||
| * @param location the new location value | |||
| */ | |||
| public void setLocation(Location location) { | |||
| this.location = location; | |||
| } | |||
| } | |||
| @@ -162,7 +162,7 @@ public class Ant extends Task { | |||
| * problem | |||
| */ | |||
| public void execute() throws BuildException { | |||
| for (Iterator i = properties.iterator(); i.hasNext(); ) { | |||
| for (Iterator i = properties.iterator(); i.hasNext();) { | |||
| Property property = (Property)i.next(); | |||
| AntBase.Property newProperty = new AntBase.Property(); | |||
| newProperty.setName(property.getName()); | |||
| @@ -111,7 +111,7 @@ public class CallTarget extends Task { | |||
| /** execute the call */ | |||
| public void execute() { | |||
| for (Iterator i = properties.iterator(); i.hasNext(); ) { | |||
| for (Iterator i = properties.iterator(); i.hasNext();) { | |||
| Property property = (Property)i.next(); | |||
| AntBase.Property newProperty = new AntBase.Property(); | |||
| newProperty.setName(property.getName()); | |||
| @@ -128,7 +128,7 @@ public class ScriptBase extends AbstractTask implements DeferredTask { | |||
| BSFEngine engine = manager.loadScriptingEngine(language); | |||
| engine.exec(scriptName, 0, 0, script); | |||
| for (Iterator i = attributes.keySet().iterator(); i.hasNext(); ) { | |||
| for (Iterator i = attributes.keySet().iterator(); i.hasNext();) { | |||
| String attributeName = (String)i.next(); | |||
| String value = (String)attributes.get(attributeName); | |||
| StringBuffer setter = new StringBuffer(attributeName); | |||
| @@ -101,7 +101,7 @@ public class Sequential extends AbstractTask | |||
| AntContext context = getAntContext(); | |||
| ExecService execService | |||
| = (ExecService)context.getCoreService(ExecService.class); | |||
| for (Iterator i = nestedTasks.iterator(); i.hasNext(); ) { | |||
| for (Iterator i = nestedTasks.iterator(); i.hasNext();) { | |||
| Task nestedTask = (Task)i.next(); | |||
| execService.executeTask(nestedTask); | |||
| } | |||
| @@ -173,7 +173,7 @@ public class BuildHelper { | |||
| args[index++] = "-classpath"; | |||
| args[index++] = path; | |||
| } | |||
| for (Iterator i = javaFiles.iterator(); i.hasNext(); ) { | |||
| for (Iterator i = javaFiles.iterator(); i.hasNext();) { | |||
| args[index++] = ((File)i.next()).getPath(); | |||
| } | |||
| @@ -160,7 +160,7 @@ public class Commandline { | |||
| // Add the default listener | |||
| execManager.addBuildListener(logger); | |||
| for (Iterator i = listeners.iterator(); i.hasNext(); ) { | |||
| for (Iterator i = listeners.iterator(); i.hasNext();) { | |||
| String className = (String)i.next(); | |||
| try { | |||
| BuildListener listener = | |||
| @@ -284,7 +284,7 @@ public class Commandline { | |||
| config.merge(userConfig); | |||
| } | |||
| for (Iterator i = configFiles.iterator(); i.hasNext(); ) { | |||
| for (Iterator i = configFiles.iterator(); i.hasNext();) { | |||
| File configFile = (File)i.next(); | |||
| AntConfig runConfig = getAntConfigFile(configFile); | |||
| config.merge(runConfig); | |||
| @@ -113,7 +113,7 @@ public abstract class ModelElement { | |||
| */ | |||
| public void setAspects(Map aspects) { | |||
| aspectMaps = new HashMap(); | |||
| for (Iterator i = aspects.keySet().iterator(); i.hasNext(); ) { | |||
| for (Iterator i = aspects.keySet().iterator(); i.hasNext();) { | |||
| String aspectName = (String)i.next(); | |||
| int separator = aspectName.indexOf(":"); | |||
| if (separator != -1) { | |||
| @@ -416,7 +416,7 @@ public class Project extends ModelElement { | |||
| targetGlobalName = globalName + REF_DELIMITER + targetName; | |||
| } | |||
| checker.visitNode(targetGlobalName); | |||
| for (Iterator i = target.getDependencies(); i.hasNext(); ) { | |||
| for (Iterator i = target.getDependencies(); i.hasNext();) { | |||
| String dependency = (String)i.next(); | |||
| boolean localTarget = (dependency.indexOf(REF_DELIMITER) == -1); | |||
| Target dependencyTarget | |||
| @@ -459,7 +459,7 @@ public class Project extends ModelElement { | |||
| */ | |||
| protected void validate(String globalName) throws ModelException { | |||
| Set keys = referencedProjects.keySet(); | |||
| for (Iterator i = keys.iterator(); i.hasNext(); ) { | |||
| for (Iterator i = keys.iterator(); i.hasNext();) { | |||
| String refName = (String)i.next(); | |||
| Project referencedProject | |||
| = (Project)referencedProjects.get(refName); | |||
| @@ -481,7 +481,7 @@ public class Project extends ModelElement { | |||
| // dependency order is purely recorded for debug purposes | |||
| List dependencyOrder = new ArrayList(); | |||
| for (Iterator i = getTargets(); i.hasNext(); ) { | |||
| for (Iterator i = getTargets(); i.hasNext();) { | |||
| Target target = (Target)i.next(); | |||
| target.validate(); | |||
| fillinDependencyOrder(globalName, target, dependencyOrder, | |||
| @@ -526,7 +526,7 @@ public class Project extends ModelElement { | |||
| throw new ConfigException("Target " + fullTargetName | |||
| + " does not exist"); | |||
| } | |||
| for (Iterator i = target.getDependencies(); i.hasNext(); ) { | |||
| for (Iterator i = target.getDependencies(); i.hasNext();) { | |||
| String localDependencyName = (String)i.next(); | |||
| String fullDependencyName | |||
| = fullProjectName == null ? localDependencyName | |||
| @@ -186,8 +186,7 @@ public class FileUtils { | |||
| for (int i = 2; i < ca.length; i++) { | |||
| if ((ca[i] != '\\') || | |||
| (ca[i] == '\\' && ca[i - 1] != '\\') | |||
| ) { | |||
| (ca[i] == '\\' && ca[i - 1] != '\\')) { | |||
| sb.append(ca[i]); | |||
| } | |||
| } | |||