Author: jlboudart
Date: Tue Aug 20 08:34:10 2013
New Revision: 1515741
URL: http://svn.apache.org/r1515741
Log:
Use List instead of Vector
Modified:
ant/easyant/core/trunk/src/main/java/org/apache/easyant/core/EasyAntConfiguration.java
ant/easyant/core/trunk/src/main/java/org/apache/easyant/core/EasyAntEngine.java
ant/easyant/core/trunk/src/main/java/org/apache/easyant/core/EasyAntMain.java
ant/easyant/core/trunk/src/main/java/org/apache/easyant/tasks/EasyAntRunner.java
ant/easyant/core/trunk/src/main/java/org/apache/easyant/tasks/SearchModule.java
ant/easyant/core/trunk/src/main/java/org/apache/easyant/tasks/SubModule.java
Modified:
ant/easyant/core/trunk/src/main/java/org/apache/easyant/core/EasyAntConfiguration.java
URL:
http://svn.apache.org/viewvc/ant/easyant/core/trunk/src/main/java/org/apache/easyant/core/EasyAntConfiguration.java?rev=1515741&r1=1515740&r2=1515741&view=diff
==============================================================================
---
ant/easyant/core/trunk/src/main/java/org/apache/easyant/core/EasyAntConfiguration.java
(original)
+++
ant/easyant/core/trunk/src/main/java/org/apache/easyant/core/EasyAntConfiguration.java
Tue Aug 20 08:34:10 2013
@@ -20,7 +20,9 @@ package org.apache.easyant.core;
import java.io.File;
import java.io.PrintStream;
import java.net.URL;
+import java.util.ArrayList;
import java.util.HashSet;
+import java.util.List;
import java.util.Properties;
import java.util.Set;
import java.util.Vector;
@@ -48,12 +50,12 @@ public class EasyAntConfiguration {
private File buildModule; /* null */
/** The build targets. */
- private Vector<String> targets = new Vector<String>(1);
+ private List<String> targets = new ArrayList<String>(1);
/** Set of properties that can be used by tasks. */
private Properties definedProps = new Properties();
/** Names of classes to add as listeners to project. */
- private Vector<String> listeners = new Vector<String>(1);
+ private List<String> listeners = new ArrayList<String>(1);
/** Indicates whether this build is to support interactive input */
private boolean allowInput = true;
@@ -64,9 +66,8 @@ public class EasyAntConfiguration {
private boolean showMemoryDetails = false;
/**
- * The Ant logger class. There may be only one logger. It will have the
- * right to use the 'out' PrintStream. The class must implements the
- * BuildLogger interface.
+ * The Ant logger class. There may be only one logger. It will have the
right to use the 'out' PrintStream. The
+ * class must implements the BuildLogger interface.
*/
private String loggerClassname = null;
@@ -140,7 +141,7 @@ public class EasyAntConfiguration {
public void setEasyantIvySettingsUrl(String easyantIvySettingsUrl) {
this.easyantIvySettingsUrl = easyantIvySettingsUrl;
}
-
+
/**
* Set the url of a ivysettings.xml used by easyant
*
@@ -272,9 +273,8 @@ public class EasyAntConfiguration {
}
/**
- * Get the default logger classname The Ant logger class. There may be only
- * one logger. It will have the right to use the 'out' PrintStream. The
- * class must implements the BuildLogger interface.
+ * Get the default logger classname The Ant logger class. There may be
only one logger. It will have the right to
+ * use the 'out' PrintStream. The class must implements the BuildLogger
interface.
*
* @return a string representing the logger classname
*/
@@ -283,9 +283,8 @@ public class EasyAntConfiguration {
}
/**
- * Set the default logger classname The Ant logger class. There may be only
- * one logger. It will have the right to use the 'out' PrintStream. The
- * class must implements the BuildLogger interface.
+ * Set the default logger classname The Ant logger class. There may be
only one logger. It will have the right to
+ * use the 'out' PrintStream. The class must implements the BuildLogger
interface.
*
* @param loggerClassname
* a string representing the logger classname
@@ -352,11 +351,11 @@ public class EasyAntConfiguration {
this.proxy = proxy;
}
- public Vector<String> getTargets() {
+ public List<String> getTargets() {
return targets;
}
- public void setTargets(Vector<String> targets) {
+ public void setTargets(List<String> targets) {
this.targets = targets;
}
@@ -365,7 +364,7 @@ public class EasyAntConfiguration {
*
* @return a vector of listerners
*/
- public Vector<String> getListeners() {
+ public List<String> getListeners() {
return listeners;
}
@@ -390,7 +389,8 @@ public class EasyAntConfiguration {
/**
* Stream to use for logging.
*
- * @param out stream to use for logging
+ * @param out
+ * stream to use for logging
*/
public void setOut(PrintStream out) {
this.out = out;
@@ -408,7 +408,8 @@ public class EasyAntConfiguration {
/**
* Stream that we are using for logging error messages.
*
- * @param err stream used for error logging
+ * @param err
+ * stream used for error logging
*/
public void setErr(PrintStream err) {
this.err = err;
@@ -442,8 +443,7 @@ public class EasyAntConfiguration {
*/
public boolean addSystemPlugin(PluginDescriptor pluginDescriptor) {
if (pluginDescriptor == null) {
- throw new IllegalArgumentException(
- "pluginDescriptor cannot be null");
+ throw new IllegalArgumentException("pluginDescriptor cannot be
null");
}
return this.systemPlugins.add(pluginDescriptor);
}
Modified:
ant/easyant/core/trunk/src/main/java/org/apache/easyant/core/EasyAntEngine.java
URL:
http://svn.apache.org/viewvc/ant/easyant/core/trunk/src/main/java/org/apache/easyant/core/EasyAntEngine.java?rev=1515741&r1=1515740&r2=1515741&view=diff
==============================================================================
---
ant/easyant/core/trunk/src/main/java/org/apache/easyant/core/EasyAntEngine.java
(original)
+++
ant/easyant/core/trunk/src/main/java/org/apache/easyant/core/EasyAntEngine.java
Tue Aug 20 08:34:10 2013
@@ -28,6 +28,7 @@ import java.net.URL;
import java.net.URLConnection;
import java.util.Enumeration;
import java.util.Properties;
+import java.util.Vector;
import org.apache.easyant.core.ant.ProjectUtils;
import org.apache.easyant.core.ant.listerners.DefaultEasyAntLogger;
@@ -259,7 +260,7 @@ public class EasyAntEngine {
project.addBuildListener(createLogger());
for (int i = 0; i < configuration.getListeners().size(); i++) {
- String className = (String)
configuration.getListeners().elementAt(i);
+ String className = (String) configuration.getListeners().get(i);
BuildListener listener = (BuildListener)
ClasspathUtils.newInstance(className,
EasyAntEngine.class.getClassLoader(), BuildListener.class);
project.setProjectReference(listener);
@@ -610,11 +611,10 @@ public class EasyAntEngine {
// make sure that we have a target to execute
if (configuration.getTargets().size() == 0) {
if (project.getDefaultTarget() != null) {
-
configuration.getTargets().addElement(project.getDefaultTarget());
+
configuration.getTargets().add(project.getDefaultTarget());
}
}
-
- project.executeTargets(configuration.getTargets());
+ project.executeTargets(new Vector(configuration.getTargets()));
} finally {
// put back the original security manager
// The following will never eval to true. (PD)
Modified:
ant/easyant/core/trunk/src/main/java/org/apache/easyant/core/EasyAntMain.java
URL:
http://svn.apache.org/viewvc/ant/easyant/core/trunk/src/main/java/org/apache/easyant/core/EasyAntMain.java?rev=1515741&r1=1515740&r2=1515741&view=diff
==============================================================================
---
ant/easyant/core/trunk/src/main/java/org/apache/easyant/core/EasyAntMain.java
(original)
+++
ant/easyant/core/trunk/src/main/java/org/apache/easyant/core/EasyAntMain.java
Tue Aug 20 08:34:10 2013
@@ -320,7 +320,7 @@ public class EasyAntMain implements AntM
}
if (line.hasOption("listener")) {
-
easyAntConfiguration.getListeners().addElement(line.getOptionValue("listener"));
+
easyAntConfiguration.getListeners().add(line.getOptionValue("listener"));
}
if (line.hasOption("D")) {
easyAntConfiguration.getDefinedProps().putAll(line.getOptionProperties("D"));
@@ -378,7 +378,7 @@ public class EasyAntMain implements AntM
if (line.getArgList().size() > 0) {
for (Iterator<?> iterator = line.getArgList().iterator();
iterator.hasNext();) {
String target = (String) iterator.next();
- easyAntConfiguration.getTargets().addElement(target);
+ easyAntConfiguration.getTargets().add(target);
}
}
Modified:
ant/easyant/core/trunk/src/main/java/org/apache/easyant/tasks/EasyAntRunner.java
URL:
http://svn.apache.org/viewvc/ant/easyant/core/trunk/src/main/java/org/apache/easyant/tasks/EasyAntRunner.java?rev=1515741&r1=1515740&r2=1515741&view=diff
==============================================================================
---
ant/easyant/core/trunk/src/main/java/org/apache/easyant/tasks/EasyAntRunner.java
(original)
+++
ant/easyant/core/trunk/src/main/java/org/apache/easyant/tasks/EasyAntRunner.java
Tue Aug 20 08:34:10 2013
@@ -21,6 +21,7 @@ import java.io.File;
import java.net.URL;
import java.util.HashSet;
import java.util.Set;
+import java.util.Vector;
import org.apache.easyant.core.EasyAntConfiguration;
import org.apache.easyant.core.EasyAntEngine;
@@ -37,11 +38,11 @@ public class EasyAntRunner extends Task
@Override
public void execute() throws BuildException {
EasyAntEngine eaEngine = new EasyAntEngine(getEasyantConfiguration());
- if (fork) {
+ if (fork) {
eaEngine.doBuild();
} else {
eaEngine.initProject(getProject());
-
getProject().executeTargets(getEasyantConfiguration().getTargets());
+ getProject().executeTargets(new
Vector(getEasyantConfiguration().getTargets()));
}
}
@@ -63,27 +64,20 @@ public class EasyAntRunner extends Task
public void setConfigurationFile(String configurationFile) {
File f = new File(configurationFile);
try {
- EasyantConfigurationFactory.getInstance()
- .createConfigurationFromFile(getEasyantConfiguration(),
- f.toURI().toURL());
+
EasyantConfigurationFactory.getInstance().createConfigurationFromFile(getEasyantConfiguration(),
+ f.toURI().toURL());
} catch (Exception e) {
- throw new BuildException(
- "Can't create easyantConfiguration from File "
- + configurationFile, e);
+ throw new BuildException("Can't create easyantConfiguration from
File " + configurationFile, e);
}
}
public void setConfigurationUrl(String configurationUrl) {
try {
URL url = new URL(configurationUrl);
- EasyantConfigurationFactory
- .getInstance()
- .createConfigurationFromFile(getEasyantConfiguration(),
url);
+
EasyantConfigurationFactory.getInstance().createConfigurationFromFile(getEasyantConfiguration(),
url);
} catch (Exception e) {
- throw new BuildException(
- "Can't create easyantConfiguration from URL "
- + configurationUrl, e);
+ throw new BuildException("Can't create easyantConfiguration from
URL " + configurationUrl, e);
}
}
@@ -93,8 +87,7 @@ public class EasyAntRunner extends Task
for (String conf : buildConfs) {
buildConfigurations.add(conf);
}
- getEasyantConfiguration().setActiveBuildConfigurations(
- buildConfigurations);
+
getEasyantConfiguration().setActiveBuildConfigurations(buildConfigurations);
}
public void setModuleIvy(String moduleIvy) {
@@ -111,8 +104,7 @@ public class EasyAntRunner extends Task
return easyantConfiguration;
}
- public void setEasyantConfiguration(
- EasyAntConfiguration easyantConfiguration) {
+ public void setEasyantConfiguration(EasyAntConfiguration
easyantConfiguration) {
this.easyantConfiguration = easyantConfiguration;
}
Modified:
ant/easyant/core/trunk/src/main/java/org/apache/easyant/tasks/SearchModule.java
URL:
http://svn.apache.org/viewvc/ant/easyant/core/trunk/src/main/java/org/apache/easyant/tasks/SearchModule.java?rev=1515741&r1=1515740&r2=1515741&view=diff
==============================================================================
---
ant/easyant/core/trunk/src/main/java/org/apache/easyant/tasks/SearchModule.java
(original)
+++
ant/easyant/core/trunk/src/main/java/org/apache/easyant/tasks/SearchModule.java
Tue Aug 20 08:34:10 2013
@@ -17,6 +17,8 @@
*/
package org.apache.easyant.tasks;
+import java.util.ArrayList;
+import java.util.List;
import java.util.Vector;
import org.apache.easyant.core.EasyAntConstants;
@@ -78,7 +80,7 @@ public class SearchModule extends IvyTas
settings.getMatcher(matcher));
// diplay the list
- Vector<String> choices = new Vector<String>();
+ List<String> choices = new ArrayList<String>();
for (int i = 0; i < mrids.length; i++) {
ResolvedModuleRevision rmr = ivy.findModule(mrids[i]);
if (rmr == null) {
@@ -117,9 +119,9 @@ public class SearchModule extends IvyTas
}
- protected String getInput(String message, String defaultvalue,
Vector<String> choices) {
+ protected String getInput(String message, String defaultvalue,
List<String> choices) {
InputRequest request = null;
- request = new MultipleChoiceInputRequest(message, choices);
+ request = new MultipleChoiceInputRequest(message, new Vector(choices));
request.setDefaultValue(defaultvalue);
InputHandler h = getProject().getInputHandler();
Modified:
ant/easyant/core/trunk/src/main/java/org/apache/easyant/tasks/SubModule.java
URL:
http://svn.apache.org/viewvc/ant/easyant/core/trunk/src/main/java/org/apache/easyant/tasks/SubModule.java?rev=1515741&r1=1515740&r2=1515741&view=diff
==============================================================================
---
ant/easyant/core/trunk/src/main/java/org/apache/easyant/tasks/SubModule.java
(original)
+++
ant/easyant/core/trunk/src/main/java/org/apache/easyant/tasks/SubModule.java
Tue Aug 20 08:34:10 2013
@@ -67,9 +67,9 @@ public class SubModule extends AbstractE
private boolean overwrite = true;
private boolean inheritRefs = false;
- private Vector<Property> properties = new Vector<Property>();
- private Vector<Ant.Reference> references = new Vector<Ant.Reference>();
- private Vector<PropertySet> propertySets = new Vector<PropertySet>();
+ private List<Property> properties = new ArrayList<Property>();
+ private List<Ant.Reference> references = new ArrayList<Ant.Reference>();
+ private List<PropertySet> propertySets = new ArrayList<PropertySet>();
public void execute() throws BuildException {
if (buildpath == null) {
@@ -521,7 +521,7 @@ public class SubModule extends AbstractE
* the property to pass on explicitly to the sub-build.
*/
public void addProperty(Property p) {
- properties.addElement(p);
+ properties.add(p);
}
/**
@@ -531,7 +531,7 @@ public class SubModule extends AbstractE
* the reference to pass on explicitly to the sub-build.
*/
public void addReference(Ant.Reference r) {
- references.addElement(r);
+ references.add(r);
}
/**
@@ -541,7 +541,7 @@ public class SubModule extends AbstractE
* the propertset
*/
public void addPropertyset(PropertySet ps) {
- propertySets.addElement(ps);
+ propertySets.add(ps);
}
/**