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