donaldp 01/12/21 06:21:25
Modified: proposal/myrmidon/src/main/org/apache/tools/ant
AntClassLoader.java DirectoryScanner.java
Project.java Target.java
proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs
AntStructure.java Checksum.java DependSet.java
ExecuteOn.java Expand.java FixCRLF.java
GenerateKey.java Input.java Jar.java Java.java
Javac.java Javadoc.java Manifest.java
PathConvert.java Property.java RecorderEntry.java
Replace.java Rmic.java SQLExec.java SendEmail.java
SignJar.java Tar.java Touch.java Tstamp.java
UpToDate.java Zip.java
proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/condition
And.java ConditionBase.java Or.java
proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/exec
Execute.java ProcessDestroyer.java
proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/file
Copy.java Delete.java Move.java
proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional
Cab.java Javah.java ManifestFile.java NetRexxC.java
PropertyFile.java ReplaceRegExp.java Script.java
proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/depend
ClassFile.java Depend.java DirectoryIterator.java
JarFileIterator.java
proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/depend/constantpool
ConstantPool.java
proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/ejb
BorlandDeploymentTool.java EjbcHelper.java
GenericDeploymentTool.java
WeblogicDeploymentTool.java
WebsphereDeploymentTool.java
proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/i18n
Translate.java
proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/ide
VAJAntToolGUI.java VAJBuildInfo.java VAJImport.java
VAJLoad.java VAJLoadServlet.java VAJLocalUtil.java
VAJRemoteUtil.java VAJUtil.java
VAJWorkspaceScanner.java
proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/javacc
JJTree.java JavaCC.java
proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/jlink
jlink.java
proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/jsp
JspC.java WLJspc.java
proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/jsp/compilers
DefaultCompilerAdapter.java
proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/junit
BaseTest.java BatchTest.java DOMUtil.java
Enumerations.java JUnitTask.java JUnitTest.java
JUnitTestRunner.java XMLJUnitResultFormatter.java
XMLResultAggregator.java
proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/metamata
AbstractMetamataTask.java MAudit.java
MAuditStreamHandler.java MMetrics.java
MMetricsStreamHandler.java MParse.java
proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/net
FTP.java MimeMail.java TelnetTask.java
proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/perforce
P4Add.java
proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/pvcs
Pvcs.java
proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/sitraka
CovMerge.java CovReport.java Coverage.java
Filters.java ReportFilters.java Triggers.java
XMLReport.java
proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/sitraka/bytecode
ClassPathLoader.java Utils.java
proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/sound
SoundTask.java
proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/rmic
DefaultRmicAdapter.java
proposal/myrmidon/src/main/org/apache/tools/ant/types
Commandline.java CommandlineJava.java
Environment.java FileList.java FileSet.java
FilterSet.java FilterSetCollection.java Path.java
PatternSet.java
proposal/myrmidon/src/main/org/apache/tools/ant/util
FileUtils.java RegexpPatternMapper.java
SourceFileScanner.java
proposal/myrmidon/src/main/org/apache/tools/ant/util/regexp
JakartaOroMatcher.java JakartaRegexpMatcher.java
JakartaRegexpRegexp.java Jdk14RegexpMatcher.java
RegexpMatcher.java
proposal/myrmidon/src/main/org/apache/tools/mail
MailMessage.java
proposal/myrmidon/src/main/org/apache/tools/zip
ExtraFieldUtils.java ZipEntry.java
ZipOutputStream.java
Log:
Move to using Java2 collections API
Revision Changes Path
1.8 +22 -20
jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/AntClassLoader.java
Index: AntClassLoader.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/AntClassLoader.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- AntClassLoader.java 2001/12/17 10:47:18 1.7
+++ AntClassLoader.java 2001/12/21 14:21:19 1.8
@@ -16,9 +16,10 @@
import java.lang.reflect.Method;
import java.net.MalformedURLException;
import java.net.URL;
-import java.util.Enumeration;
+import java.util.Iterator;
import java.util.Hashtable;
-import java.util.Vector;
+import java.util.ArrayList;
+import java.util.Enumeration;
import java.util.zip.ZipEntry;
import java.util.zip.ZipFile;
import org.apache.avalon.excalibur.io.FileUtil;
@@ -52,7 +53,7 @@
/**
* The components of the classpath that the classloader searches for
classes
*/
- Vector pathComponents = new Vector();
+ ArrayList pathComponents = new ArrayList();
/**
* Indicates whether the parent class loader should be consulted before
@@ -65,14 +66,14 @@
* loader regardless of whether the parent class loader is being searched
* first or not.
*/
- private Vector systemPackages = new Vector();
+ private ArrayList systemPackages = new ArrayList();
/**
* These are the package roots that are to be loaded by this class loader
* regardless of whether the parent class loader is being searched first
or
* not.
*/
- private Vector loaderPackages = new Vector();
+ private ArrayList loaderPackages = new ArrayList();
/**
* This flag indicates that the classloader will ignore the base
classloader
@@ -308,9 +309,9 @@
{
// try and load from this loader if the parent either didn't find
// it or wasn't consulted.
- for( Enumeration e = pathComponents.elements();
e.hasMoreElements() && url == null; )
+ for( Iterator e = pathComponents.iterator(); e.hasNext() && url
== null; )
{
- File pathComponent = (File)e.nextElement();
+ File pathComponent = (File)e.next();
url = getResourceURL( pathComponent, name );
if( url != null )
{
@@ -408,7 +409,7 @@
*/
public void addLoaderPackageRoot( String packageRoot )
{
- loaderPackages.addElement( packageRoot + "." );
+ loaderPackages.add( packageRoot + "." );
}
/**
@@ -423,7 +424,7 @@
File pathComponent
= project != null ? FileUtil.resolveFile( project.getBaseDir(),
pathElement )
: new File( pathElement );
- pathComponents.addElement( pathComponent );
+ pathComponents.add( pathComponent );
}
/**
@@ -434,7 +435,7 @@
*/
public void addSystemPackageRoot( String packageRoot )
{
- systemPackages.addElement( packageRoot + "." );
+ systemPackages.add( packageRoot + "." );
}
public void buildFinished( BuildEvent event )
@@ -873,9 +874,9 @@
// designated to use a specific loader first (this one or the parent
one)
boolean useParentFirst = parentFirst;
- for( Enumeration e = systemPackages.elements(); e.hasMoreElements();
)
+ for( Iterator e = systemPackages.iterator(); e.hasNext(); )
{
- String packageName = (String)e.nextElement();
+ String packageName = (String)e.next();
if( resourceName.startsWith( packageName ) )
{
useParentFirst = true;
@@ -883,9 +884,9 @@
}
}
- for( Enumeration e = loaderPackages.elements(); e.hasMoreElements();
)
+ for( Iterator e = loaderPackages.iterator(); e.hasNext(); )
{
- String packageName = (String)e.nextElement();
+ String packageName = (String)e.next();
if( resourceName.startsWith( packageName ) )
{
useParentFirst = false;
@@ -933,9 +934,9 @@
String classFilename = getClassFilename( name );
try
{
- for( Enumeration e = pathComponents.elements();
e.hasMoreElements(); )
+ for( Iterator e = pathComponents.iterator(); e.hasNext(); )
{
- File pathComponent = (File)e.nextElement();
+ File pathComponent = (File)e.next();
try
{
stream = getResourceStream( pathComponent, classFilename
);
@@ -1000,9 +1001,9 @@
// class we want.
InputStream stream = null;
- for( Enumeration e = pathComponents.elements(); e.hasMoreElements()
&& stream == null; )
+ for( Iterator e = pathComponents.iterator(); e.hasNext() && stream
== null; )
{
- File pathComponent = (File)e.nextElement();
+ File pathComponent = (File)e.next();
stream = getResourceStream( pathComponent, name );
}
return stream;
@@ -1018,7 +1019,8 @@
* @see AntClassLoader#findResources(String)
* @see java.lang.ClassLoader#getResources(String)
*/
- private class ResourceEnumeration implements Enumeration
+ private class ResourceEnumeration
+ implements Enumeration
{
/**
@@ -1088,7 +1090,7 @@
( url == null ) )
{
File pathComponent
- = (File)pathComponents.elementAt( pathElementsIndex );
+ = (File)pathComponents.get( pathElementsIndex );
url = getResourceURL( pathComponent, this.resourceName );
pathElementsIndex++;
}
1.3 +51 -51
jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/DirectoryScanner.java
Index: DirectoryScanner.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/DirectoryScanner.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- DirectoryScanner.java 2001/12/15 14:55:53 1.2
+++ DirectoryScanner.java 2001/12/21 14:21:19 1.3
@@ -9,7 +9,7 @@
import java.io.File;
import java.util.StringTokenizer;
-import java.util.Vector;
+import java.util.ArrayList;
import org.apache.myrmidon.api.TaskException;
/**
@@ -110,7 +110,7 @@
};
/**
- * Have the Vectors holding our results been built by a slow scan?
+ * Have the ArrayLists holding our results been built by a slow scan?
*/
protected boolean haveSlowResults = false;
@@ -133,18 +133,18 @@
* The files that where found and matched at least one includes, and also
* matched at least one excludes.
*/
- protected Vector dirsExcluded;
+ protected ArrayList dirsExcluded;
/**
* The directories that where found and matched at least one includes,
and
* matched no excludes.
*/
- protected Vector dirsIncluded;
+ protected ArrayList dirsIncluded;
/**
* The directories that where found and did not match any includes.
*/
- protected Vector dirsNotIncluded;
+ protected ArrayList dirsNotIncluded;
/**
* The patterns for the files that should be excluded.
@@ -155,18 +155,18 @@
* The files that where found and matched at least one includes, and also
* matched at least one excludes.
*/
- protected Vector filesExcluded;
+ protected ArrayList filesExcluded;
/**
* The files that where found and matched at least one includes, and
matched
* no excludes.
*/
- protected Vector filesIncluded;
+ protected ArrayList filesIncluded;
/**
* The files that where found and did not match any includes.
*/
- protected Vector filesNotIncluded;
+ protected ArrayList filesNotIncluded;
/**
* The patterns for the files that should be included.
@@ -424,18 +424,18 @@
return false;
}
- Vector patDirs = new Vector();
+ ArrayList patDirs = new ArrayList();
StringTokenizer st = new StringTokenizer( pattern, File.separator );
while( st.hasMoreTokens() )
{
- patDirs.addElement( st.nextToken() );
+ patDirs.add( st.nextToken() );
}
- Vector strDirs = new Vector();
+ ArrayList strDirs = new ArrayList();
st = new StringTokenizer( str, File.separator );
while( st.hasMoreTokens() )
{
- strDirs.addElement( st.nextToken() );
+ strDirs.add( st.nextToken() );
}
int patIdxStart = 0;
@@ -446,12 +446,12 @@
// up to first '**'
while( patIdxStart <= patIdxEnd && strIdxStart <= strIdxEnd )
{
- String patDir = (String)patDirs.elementAt( patIdxStart );
+ String patDir = (String)patDirs.get( patIdxStart );
if( patDir.equals( "**" ) )
{
break;
}
- if( !match( patDir, (String)strDirs.elementAt( strIdxStart ),
isCaseSensitive ) )
+ if( !match( patDir, (String)strDirs.get( strIdxStart ),
isCaseSensitive ) )
{
return false;
}
@@ -463,7 +463,7 @@
// String is exhausted
for( int i = patIdxStart; i <= patIdxEnd; i++ )
{
- if( !patDirs.elementAt( i ).equals( "**" ) )
+ if( !patDirs.get( i ).equals( "**" ) )
{
return false;
}
@@ -482,12 +482,12 @@
// up to last '**'
while( patIdxStart <= patIdxEnd && strIdxStart <= strIdxEnd )
{
- String patDir = (String)patDirs.elementAt( patIdxEnd );
+ String patDir = (String)patDirs.get( patIdxEnd );
if( patDir.equals( "**" ) )
{
break;
}
- if( !match( patDir, (String)strDirs.elementAt( strIdxEnd ),
isCaseSensitive ) )
+ if( !match( patDir, (String)strDirs.get( strIdxEnd ),
isCaseSensitive ) )
{
return false;
}
@@ -499,7 +499,7 @@
// String is exhausted
for( int i = patIdxStart; i <= patIdxEnd; i++ )
{
- if( !patDirs.elementAt( i ).equals( "**" ) )
+ if( !patDirs.get( i ).equals( "**" ) )
{
return false;
}
@@ -512,7 +512,7 @@
int patIdxTmp = -1;
for( int i = patIdxStart + 1; i <= patIdxEnd; i++ )
{
- if( patDirs.elementAt( i ).equals( "**" ) )
+ if( patDirs.get( i ).equals( "**" ) )
{
patIdxTmp = i;
break;
@@ -534,8 +534,8 @@
{
for( int j = 0; j < patLength; j++ )
{
- String subPat = (String)patDirs.elementAt( patIdxStart +
j + 1 );
- String subStr = (String)strDirs.elementAt( strIdxStart +
i + j );
+ String subPat = (String)patDirs.get( patIdxStart + j + 1
);
+ String subStr = (String)strDirs.get( strIdxStart + i + j
);
if( !match( subPat, subStr, isCaseSensitive ) )
{
continue strLoop;
@@ -557,7 +557,7 @@
for( int i = patIdxStart; i <= patIdxEnd; i++ )
{
- if( !patDirs.elementAt( i ).equals( "**" ) )
+ if( !patDirs.get( i ).equals( "**" ) )
{
return false;
}
@@ -609,18 +609,18 @@
return false;
}
- Vector patDirs = new Vector();
+ ArrayList patDirs = new ArrayList();
StringTokenizer st = new StringTokenizer( pattern, File.separator );
while( st.hasMoreTokens() )
{
- patDirs.addElement( st.nextToken() );
+ patDirs.add( st.nextToken() );
}
- Vector strDirs = new Vector();
+ ArrayList strDirs = new ArrayList();
st = new StringTokenizer( str, File.separator );
while( st.hasMoreTokens() )
{
- strDirs.addElement( st.nextToken() );
+ strDirs.add( st.nextToken() );
}
int patIdxStart = 0;
@@ -631,12 +631,12 @@
// up to first '**'
while( patIdxStart <= patIdxEnd && strIdxStart <= strIdxEnd )
{
- String patDir = (String)patDirs.elementAt( patIdxStart );
+ String patDir = (String)patDirs.get( patIdxStart );
if( patDir.equals( "**" ) )
{
break;
}
- if( !match( patDir, (String)strDirs.elementAt( strIdxStart ),
isCaseSensitive ) )
+ if( !match( patDir, (String)strDirs.get( strIdxStart ),
isCaseSensitive ) )
{
return false;
}
@@ -783,7 +783,7 @@
String[] directories = new String[ count ];
for( int i = 0; i < count; i++ )
{
- directories[ i ] = (String)dirsExcluded.elementAt( i );
+ directories[ i ] = (String)dirsExcluded.get( i );
}
return directories;
}
@@ -803,7 +803,7 @@
String[] files = new String[ count ];
for( int i = 0; i < count; i++ )
{
- files[ i ] = (String)filesExcluded.elementAt( i );
+ files[ i ] = (String)filesExcluded.get( i );
}
return files;
}
@@ -821,7 +821,7 @@
String[] directories = new String[ count ];
for( int i = 0; i < count; i++ )
{
- directories[ i ] = (String)dirsIncluded.elementAt( i );
+ directories[ i ] = (String)dirsIncluded.get( i );
}
return directories;
}
@@ -839,7 +839,7 @@
String[] files = new String[ count ];
for( int i = 0; i < count; i++ )
{
- files[ i ] = (String)filesIncluded.elementAt( i );
+ files[ i ] = (String)filesIncluded.get( i );
}
return files;
}
@@ -858,7 +858,7 @@
String[] directories = new String[ count ];
for( int i = 0; i < count; i++ )
{
- directories[ i ] = (String)dirsNotIncluded.elementAt( i );
+ directories[ i ] = (String)dirsNotIncluded.get( i );
}
return directories;
}
@@ -877,7 +877,7 @@
String[] files = new String[ count ];
for( int i = 0; i < count; i++ )
{
- files[ i ] = (String)filesNotIncluded.elementAt( i );
+ files[ i ] = (String)filesNotIncluded.get( i );
}
return files;
}
@@ -947,27 +947,27 @@
excludes = new String[ 0 ];
}
- filesIncluded = new Vector();
- filesNotIncluded = new Vector();
- filesExcluded = new Vector();
- dirsIncluded = new Vector();
- dirsNotIncluded = new Vector();
- dirsExcluded = new Vector();
+ filesIncluded = new ArrayList();
+ filesNotIncluded = new ArrayList();
+ filesExcluded = new ArrayList();
+ dirsIncluded = new ArrayList();
+ dirsNotIncluded = new ArrayList();
+ dirsExcluded = new ArrayList();
if( isIncluded( "" ) )
{
if( !isExcluded( "" ) )
{
- dirsIncluded.addElement( "" );
+ dirsIncluded.add( "" );
}
else
{
- dirsExcluded.addElement( "" );
+ dirsExcluded.add( "" );
}
}
else
{
- dirsNotIncluded.addElement( "" );
+ dirsNotIncluded.add( "" );
}
scandir( basedir, "", true );
}
@@ -1074,7 +1074,7 @@
{
if( !isExcluded( name ) )
{
- dirsIncluded.addElement( name );
+ dirsIncluded.add( name );
if( fast )
{
scandir( file, name + File.separator, fast );
@@ -1083,7 +1083,7 @@
else
{
everythingIncluded = false;
- dirsExcluded.addElement( name );
+ dirsExcluded.add( name );
if( fast && couldHoldIncluded( name ) )
{
scandir( file, name + File.separator, fast );
@@ -1093,7 +1093,7 @@
else
{
everythingIncluded = false;
- dirsNotIncluded.addElement( name );
+ dirsNotIncluded.add( name );
if( fast && couldHoldIncluded( name ) )
{
scandir( file, name + File.separator, fast );
@@ -1110,18 +1110,18 @@
{
if( !isExcluded( name ) )
{
- filesIncluded.addElement( name );
+ filesIncluded.add( name );
}
else
{
everythingIncluded = false;
- filesExcluded.addElement( name );
+ filesExcluded.add( name );
}
}
else
{
everythingIncluded = false;
- filesNotIncluded.addElement( name );
+ filesNotIncluded.add( name );
}
}
}
@@ -1141,10 +1141,10 @@
}
String[] excl = new String[ dirsExcluded.size() ];
- dirsExcluded.copyInto( excl );
+ excl = (String[])dirsExcluded.toArray( excl );
String[] notIncl = new String[ dirsNotIncluded.size() ];
- dirsNotIncluded.copyInto( notIncl );
+ notIncl = (String[])dirsNotIncluded.toArray( notIncl );
for( int i = 0; i < excl.length; i++ )
{
1.11 +19 -18
jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/Project.java
Index: Project.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/Project.java,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -r1.10 -r1.11
--- Project.java 2001/12/17 10:47:18 1.10
+++ Project.java 2001/12/21 14:21:19 1.11
@@ -8,9 +8,10 @@
package org.apache.tools.ant;
import java.io.File;
-import java.util.Enumeration;
+import java.util.Iterator;
import java.util.Hashtable;
-import java.util.Vector;
+import java.util.ArrayList;
+import java.util.Enumeration;
import org.apache.myrmidon.api.TaskException;
import org.apache.tools.ant.types.FilterSet;
import org.apache.tools.ant.types.FilterSetCollection;
@@ -60,7 +61,7 @@
private FilterSet globalFilterSet = new FilterSet();
private FilterSetCollection globalFilters = new FilterSetCollection(
globalFilterSet );
- private Vector listeners = new Vector();
+ private ArrayList listeners = new ArrayList();
/**
* The Ant core classloader - may be null if using system loader
@@ -278,7 +279,7 @@
public void addBuildListener( BuildListener listener )
{
- listeners.addElement( listener );
+ listeners.add( listener );
}
/**
@@ -357,19 +358,19 @@
return null;
}
- Vector fragments = new Vector();
- Vector propertyRefs = new Vector();
+ ArrayList fragments = new ArrayList();
+ ArrayList propertyRefs = new ArrayList();
parsePropertyString( value, fragments, propertyRefs );
StringBuffer sb = new StringBuffer();
- Enumeration i = fragments.elements();
- Enumeration j = propertyRefs.elements();
- while( i.hasMoreElements() )
+ Iterator i = fragments.iterator();
+ Iterator j = propertyRefs.iterator();
+ while( i.hasNext() )
{
- String fragment = (String)i.nextElement();
+ String fragment = (String)i.next();
if( fragment == null )
{
- String propertyName = (String)j.nextElement();
+ String propertyName = (String)j.next();
if( !keys.containsKey( propertyName ) )
{
project.log( "Property ${" + propertyName + "} has not
been set", Project.MSG_VERBOSE );
@@ -394,7 +395,7 @@
* @param propertyRefs Description of Parameter
* @exception TaskException Description of Exception
*/
- private void parsePropertyString( String value, Vector fragments, Vector
propertyRefs )
+ private void parsePropertyString( String value, ArrayList fragments,
ArrayList propertyRefs )
throws TaskException
{
int prev = 0;
@@ -403,17 +404,17 @@
{
if( pos > 0 )
{
- fragments.addElement( value.substring( prev, pos ) );
+ fragments.add( value.substring( prev, pos ) );
}
if( pos == ( value.length() - 1 ) )
{
- fragments.addElement( "$" );
+ fragments.add( "$" );
prev = pos + 1;
}
else if( value.charAt( pos + 1 ) != '{' )
{
- fragments.addElement( value.substring( pos + 1, pos + 2 ) );
+ fragments.add( value.substring( pos + 1, pos + 2 ) );
prev = pos + 2;
}
else
@@ -425,15 +426,15 @@
+ value );
}
String propertyName = value.substring( pos + 2, endName );
- fragments.addElement( null );
- propertyRefs.addElement( propertyName );
+ fragments.add( null );
+ propertyRefs.add( propertyName );
prev = endName + 1;
}
}
if( prev < value.length() )
{
- fragments.addElement( value.substring( prev ) );
+ fragments.add( value.substring( prev ) );
}
}
1.8 +16 -17
jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/Target.java
Index: Target.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/Target.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- Target.java 2001/12/16 05:34:29 1.7
+++ Target.java 2001/12/21 14:21:19 1.8
@@ -7,9 +7,9 @@
*/
package org.apache.tools.ant;
-import java.util.Enumeration;
+import java.util.Iterator;
import java.util.StringTokenizer;
-import java.util.Vector;
+import java.util.ArrayList;
import org.apache.myrmidon.api.TaskException;
/**
@@ -19,8 +19,8 @@
*/
public class Target
{
- private Vector dependencies = new Vector( 2 );
- private Vector children = new Vector( 5 );
+ private ArrayList dependencies = new ArrayList( 2 );
+ private ArrayList children = new ArrayList( 5 );
private String description = null;
private String name;
@@ -78,9 +78,9 @@
this.project = project;
}
- public Enumeration getDependencies()
+ public Iterator getDependencies()
{
- return dependencies.elements();
+ return dependencies.iterator();
}
public String getDescription()
@@ -105,30 +105,29 @@
*/
public Task[] getTasks()
{
- Vector tasks = new Vector( children.size() );
- Enumeration enum = children.elements();
- while( enum.hasMoreElements() )
+ ArrayList tasks = new ArrayList( children.size() );
+ Iterator enum = children.iterator();
+ while( enum.hasNext() )
{
- Object o = enum.nextElement();
+ Object o = enum.next();
if( o instanceof Task )
{
- tasks.addElement( o );
+ tasks.add( o );
}
}
- Task[] retval = new Task[ tasks.size() ];
- tasks.copyInto( retval );
- return retval;
+ final Task[] retval = new Task[ tasks.size() ];
+ return (Task[])tasks.toArray( retval );
}
public void addDependency( String dependency )
{
- dependencies.addElement( dependency );
+ dependencies.add( dependency );
}
public void addTask( Task task )
{
- children.addElement( task );
+ children.add( task );
}
void replaceChild( Task el, Object o )
@@ -136,7 +135,7 @@
int index = -1;
while( ( index = children.indexOf( el ) ) >= 0 )
{
- children.setElementAt( o, index );
+ children.set( index, o );
}
}
}
1.6 +14 -13
jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/AntStructure.java
Index: AntStructure.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/AntStructure.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- AntStructure.java 2001/12/21 13:34:15 1.5
+++ AntStructure.java 2001/12/21 14:21:19 1.6
@@ -14,8 +14,9 @@
import java.io.OutputStreamWriter;
import java.io.PrintWriter;
import java.io.UnsupportedEncodingException;
-import java.util.Enumeration;
+import java.util.Iterator;
import java.util.Hashtable;
+import java.util.Enumeration;
import org.apache.myrmidon.api.TaskException;
import org.apache.tools.ant.Task;
@@ -23,7 +24,7 @@
* Creates a partial DTD for Ant from the currently known tasks.
*
* @author <a href="mailto:[EMAIL PROTECTED]">Stefan Bodewig</a>
- * @version $Revision: 1.5 $
+ * @version $Revision: 1.6 $
*/
public class AntStructure extends Task
@@ -193,21 +194,21 @@
return;
}
- Vector v = new Vector();
+ ArrayList v = new ArrayList();
if( ih.supportsCharacters() )
{
- v.addElement( "#PCDATA" );
+ v.add( "#PCDATA" );
}
if( TaskContainer.class.isAssignableFrom( element ) )
{
- v.addElement( TASKS );
+ v.add( TASKS );
}
- Enumeration enum = ih.getNestedElements();
- while( enum.hasMoreElements() )
+ Iterator enum = ih.getNestedElements();
+ while( enum.hasNext() )
{
- v.addElement( (String)enum.nextElement() );
+ v.add( (String)enum.next() );
}
if( v.isEmpty() )
@@ -223,10 +224,10 @@
{
sb.append( " | " );
}
- sb.append( v.elementAt( i ) );
+ sb.append( v.get( i ) );
}
sb.append( ")" );
- if( v.size() > 1 || !v.elementAt( 0 ).equals( "#PCDATA" ) )
+ if( v.size() > 1 || !v.get( 0 ).equals( "#PCDATA" ) )
{
sb.append( "*" );
}
@@ -239,9 +240,9 @@
sb.append( lSep ).append( " id ID #IMPLIED" );
enum = ih.getAttributes();
- while( enum.hasMoreElements() )
+ while( enum.hasNext() )
{
- String attrName = (String)enum.nextElement();
+ String attrName = (String)enum.next();
if( "id".equals( attrName ) )
continue;
@@ -303,7 +304,7 @@
for( int i = 0; i < v.size(); i++ )
{
- String nestedName = (String)v.elementAt( i );
+ String nestedName = (String)v.get( i );
if( !"#PCDATA".equals( nestedName ) &&
!TASKS.equals( nestedName ) &&
!TYPES.equals( nestedName )
1.8 +7 -6
jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/Checksum.java
Index: Checksum.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/Checksum.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- Checksum.java 2001/12/21 13:34:15 1.7
+++ Checksum.java 2001/12/21 14:21:19 1.8
@@ -17,9 +17,10 @@
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import java.security.NoSuchProviderException;
-import java.util.Enumeration;
+import java.util.Iterator;
import java.util.Hashtable;
-import java.util.Vector;
+import java.util.ArrayList;
+import java.util.Enumeration;
import org.apache.myrmidon.api.TaskException;
import org.apache.tools.ant.DirectoryScanner;
import org.apache.tools.ant.Project;
@@ -47,9 +48,9 @@
*/
private String provider = null;
/**
- * Vector to hold source file sets.
+ * ArrayList to hold source file sets.
*/
- private Vector filesets = new Vector();
+ private ArrayList filesets = new ArrayList();
/**
* Stores SourceFile, DestFile pairs and SourceFile, Property String
pairs.
*/
@@ -160,7 +161,7 @@
*/
public void addFileset( FileSet set )
{
- filesets.addElement( set );
+ filesets.add( set );
}
/**
@@ -474,7 +475,7 @@
int sizeofFileSet = filesets.size();
for( int i = 0; i < sizeofFileSet; i++ )
{
- FileSet fs = (FileSet)filesets.elementAt( i );
+ FileSet fs = (FileSet)filesets.get( i );
DirectoryScanner ds = fs.getDirectoryScanner( getProject() );
String[] srcFiles = ds.getIncludedFiles();
for( int j = 0; j < srcFiles.length; j++ )
1.4 +34 -34
jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/DependSet.java
Index: DependSet.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/DependSet.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- DependSet.java 2001/12/21 13:34:15 1.3
+++ DependSet.java 2001/12/21 14:21:19 1.4
@@ -9,8 +9,8 @@
import java.io.File;
import java.util.Date;
-import java.util.Enumeration;
-import java.util.Vector;
+import java.util.Iterator;
+import java.util.ArrayList;
import org.apache.myrmidon.api.TaskException;
import org.apache.myrmidon.framework.Os;
import org.apache.tools.ant.DirectoryScanner;
@@ -60,15 +60,15 @@
*
*
* @author <a href="mailto:[EMAIL PROTECTED]">Craeg Strong</a>
- * @version $Revision: 1.3 $ $Date: 2001/12/21 13:34:15 $
+ * @version $Revision: 1.4 $ $Date: 2001/12/21 14:21:19 $
*/
public class DependSet extends MatchingTask
{
- private Vector sourceFileSets = new Vector();
- private Vector sourceFileLists = new Vector();
- private Vector targetFileSets = new Vector();
- private Vector targetFileLists = new Vector();
+ private ArrayList sourceFileSets = new ArrayList();
+ private ArrayList sourceFileLists = new ArrayList();
+ private ArrayList targetFileSets = new ArrayList();
+ private ArrayList targetFileLists = new ArrayList();
/**
* Creates a new DependSet Task.
@@ -84,7 +84,7 @@
*/
public void addSrcfilelist( FileList fl )
{
- sourceFileLists.addElement( fl );
+ sourceFileLists.add( fl );
}//-- DependSet
/**
@@ -94,7 +94,7 @@
*/
public void addSrcfileset( FileSet fs )
{
- sourceFileSets.addElement( fs );
+ sourceFileSets.add( fs );
}
/**
@@ -104,7 +104,7 @@
*/
public void addTargetfilelist( FileList fl )
{
- targetFileLists.addElement( fl );
+ targetFileLists.add( fl );
}
/**
@@ -114,7 +114,7 @@
*/
public void addTargetfileset( FileSet fs )
{
- targetFileSets.addElement( fs );
+ targetFileSets.add( fs );
}
/**
@@ -149,12 +149,12 @@
//
// Grab all the target files specified via filesets
//
- Vector allTargets = new Vector();
- Enumeration enumTargetSets = targetFileSets.elements();
- while( enumTargetSets.hasMoreElements() )
+ ArrayList allTargets = new ArrayList();
+ Iterator enumTargetSets = targetFileSets.iterator();
+ while( enumTargetSets.hasNext() )
{
- FileSet targetFS = (FileSet)enumTargetSets.nextElement();
+ FileSet targetFS = (FileSet)enumTargetSets.next();
DirectoryScanner targetDS = targetFS.getDirectoryScanner(
getProject() );
String[] targetFiles = targetDS.getIncludedFiles();
@@ -162,7 +162,7 @@
{
File dest = new File( targetFS.getDir( getProject() ),
targetFiles[ i ] );
- allTargets.addElement( dest );
+ allTargets.add( dest );
if( dest.lastModified() > now )
{
@@ -176,11 +176,11 @@
// Grab all the target files specified via filelists
//
boolean upToDate = true;
- Enumeration enumTargetLists = targetFileLists.elements();
- while( enumTargetLists.hasMoreElements() )
+ Iterator enumTargetLists = targetFileLists.iterator();
+ while( enumTargetLists.hasNext() )
{
- FileList targetFL = (FileList)enumTargetLists.nextElement();
+ FileList targetFL = (FileList)enumTargetLists.next();
String[] targetFiles = targetFL.getFiles( getProject() );
for( int i = 0; i < targetFiles.length; i++ )
@@ -195,7 +195,7 @@
}
else
{
- allTargets.addElement( dest );
+ allTargets.add( dest );
}
if( dest.lastModified() > now )
{
@@ -210,11 +210,11 @@
//
if( upToDate )
{
- Enumeration enumSourceSets = sourceFileSets.elements();
- while( upToDate && enumSourceSets.hasMoreElements() )
+ Iterator enumSourceSets = sourceFileSets.iterator();
+ while( upToDate && enumSourceSets.hasNext() )
{
- FileSet sourceFS = (FileSet)enumSourceSets.nextElement();
+ FileSet sourceFS = (FileSet)enumSourceSets.next();
DirectoryScanner sourceDS = sourceFS.getDirectoryScanner(
getProject() );
String[] sourceFiles = sourceDS.getIncludedFiles();
@@ -228,11 +228,11 @@
Project.MSG_WARN );
}
- Enumeration enumTargets = allTargets.elements();
- while( upToDate && enumTargets.hasMoreElements() )
+ Iterator enumTargets = allTargets.iterator();
+ while( upToDate && enumTargets.hasNext() )
{
- File dest = (File)enumTargets.nextElement();
+ File dest = (File)enumTargets.next();
if( src.lastModified() > dest.lastModified() )
{
log( dest.getPath() + " is out of date with
respect to " +
@@ -250,11 +250,11 @@
//
if( upToDate )
{
- Enumeration enumSourceLists = sourceFileLists.elements();
- while( upToDate && enumSourceLists.hasMoreElements() )
+ Iterator enumSourceLists = sourceFileLists.iterator();
+ while( upToDate && enumSourceLists.hasNext() )
{
- FileList sourceFL = (FileList)enumSourceLists.nextElement();
+ FileList sourceFL = (FileList)enumSourceLists.next();
String[] sourceFiles = sourceFL.getFiles( getProject() );
int i = 0;
@@ -275,11 +275,11 @@
break;
}
- Enumeration enumTargets = allTargets.elements();
- while( upToDate && enumTargets.hasMoreElements() )
+ Iterator enumTargets = allTargets.iterator();
+ while( upToDate && enumTargets.hasNext() )
{
- File dest = (File)enumTargets.nextElement();
+ File dest = (File)enumTargets.next();
if( src.lastModified() > dest.lastModified() )
{
@@ -296,9 +296,9 @@
if( !upToDate )
{
log( "Deleting all target files. ", Project.MSG_VERBOSE );
- for( Enumeration e = allTargets.elements(); e.hasMoreElements();
)
+ for( Iterator e = allTargets.iterator(); e.hasNext(); )
{
- File fileToRemove = (File)e.nextElement();
+ File fileToRemove = (File)e.next();
log( "Deleting file " + fileToRemove.getAbsolutePath(),
Project.MSG_VERBOSE );
fileToRemove.delete();
}
1.11 +18 -18
jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/ExecuteOn.java
Index: ExecuteOn.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/ExecuteOn.java,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -r1.10 -r1.11
--- ExecuteOn.java 2001/12/21 13:34:15 1.10
+++ ExecuteOn.java 2001/12/21 14:21:19 1.11
@@ -10,7 +10,7 @@
import java.io.File;
import java.io.IOException;
import java.util.Hashtable;
-import java.util.Vector;
+import java.util.ArrayList;
import org.apache.myrmidon.api.TaskException;
import org.apache.tools.ant.DirectoryScanner;
import org.apache.tools.ant.Project;
@@ -32,7 +32,7 @@
public class ExecuteOn extends ExecTask
{
- protected Vector filesets = new Vector();
+ protected ArrayList filesets = new ArrayList();
private boolean relative = false;
private boolean parallel = false;
protected String type = "file";
@@ -106,7 +106,7 @@
*/
public void addFileset( FileSet set )
{
- filesets.addElement( set );
+ filesets.add( set );
}
/**
@@ -171,7 +171,7 @@
protected String[] getCommandline( String[] srcFiles, File[] baseDirs )
throws TaskException
{
- Vector targets = new Vector();
+ ArrayList targets = new ArrayList();
if( targetFilePos != null )
{
Hashtable addedFiles = new Hashtable();
@@ -194,7 +194,7 @@
}
if( !addedFiles.contains( name ) )
{
- targets.addElement( name );
+ targets.add( name );
addedFiles.put( name, name );
}
}
@@ -202,7 +202,7 @@
}
}
String[] targetFiles = new String[ targets.size() ];
- targets.copyInto( targetFiles );
+ targetFiles = (String[])targets.toArray( targetFiles );
String[] orig = cmdl.getCommandline();
String[] result = new String[ orig.length + srcFiles.length +
targetFiles.length ];
@@ -380,11 +380,11 @@
try
{
- Vector fileNames = new Vector();
- Vector baseDirs = new Vector();
+ ArrayList fileNames = new ArrayList();
+ ArrayList baseDirs = new ArrayList();
for( int i = 0; i < filesets.size(); i++ )
{
- FileSet fs = (FileSet)filesets.elementAt( i );
+ FileSet fs = (FileSet)filesets.get( i );
File base = fs.getDir( getProject() );
DirectoryScanner ds = fs.getDirectoryScanner( getProject() );
@@ -393,8 +393,8 @@
String[] s = getFiles( base, ds );
for( int j = 0; j < s.length; j++ )
{
- fileNames.addElement( s[ j ] );
- baseDirs.addElement( base );
+ fileNames.add( s[ j ] );
+ baseDirs.add( base );
}
}
@@ -404,8 +404,8 @@
;
for( int j = 0; j < s.length; j++ )
{
- fileNames.addElement( s[ j ] );
- baseDirs.addElement( base );
+ fileNames.add( s[ j ] );
+ baseDirs.add( base );
}
}
@@ -419,7 +419,7 @@
if( !parallel )
{
String[] s = new String[ fileNames.size() ];
- fileNames.copyInto( s );
+ s = (String[])fileNames.toArray( s );
for( int j = 0; j < s.length; j++ )
{
String[] command = getCommandline( s[ j ], base );
@@ -428,17 +428,17 @@
exe.setCommandline( command );
runExecute( exe );
}
- fileNames.removeAllElements();
- baseDirs.removeAllElements();
+ fileNames.clear();
+ baseDirs.clear();
}
}
if( parallel && ( fileNames.size() > 0 || !skipEmpty ) )
{
String[] s = new String[ fileNames.size() ];
- fileNames.copyInto( s );
+ s = (String[])fileNames.toArray( s );
File[] b = new File[ baseDirs.size() ];
- baseDirs.copyInto( b );
+ b = (File[])baseDirs.toArray( b );
String[] command = getCommandline( s, b );
log( "Executing " + Commandline.toString( command ),
Project.MSG_VERBOSE );
1.9 +7 -7
jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/Expand.java
Index: Expand.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/Expand.java,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- Expand.java 2001/12/21 13:34:15 1.8
+++ Expand.java 2001/12/21 14:21:19 1.9
@@ -14,7 +14,7 @@
import java.io.IOException;
import java.io.InputStream;
import java.util.Date;
-import java.util.Vector;
+import java.util.ArrayList;
import java.util.zip.ZipEntry;
import java.util.zip.ZipInputStream;
import org.apache.avalon.excalibur.io.FileUtil;
@@ -34,8 +34,8 @@
public class Expand extends MatchingTask
{// req
private boolean overwrite = true;
- private Vector patternsets = new Vector();
- private Vector filesets = new Vector();
+ private ArrayList patternsets = new ArrayList();
+ private ArrayList filesets = new ArrayList();
private File dest;//req
private File source;
@@ -78,7 +78,7 @@
*/
public void addFileset( FileSet set )
{
- filesets.addElement( set );
+ filesets.add( set );
}
/**
@@ -88,7 +88,7 @@
*/
public void addPatternset( PatternSet set )
{
- patternsets.addElement( set );
+ patternsets.add( set );
}
/**
@@ -131,7 +131,7 @@
{
for( int j = 0; j < filesets.size(); j++ )
{
- FileSet fs = (FileSet)filesets.elementAt( j );
+ FileSet fs = (FileSet)filesets.get( j );
DirectoryScanner ds = fs.getDirectoryScanner( getProject() );
File fromDir = fs.getDir( getProject() );
@@ -200,7 +200,7 @@
boolean included = false;
for( int v = 0; v < patternsets.size(); v++ )
{
- PatternSet p = (PatternSet)patternsets.elementAt( v );
+ PatternSet p = (PatternSet)patternsets.get( v );
String[] incls = p.getIncludePatterns( getProject() );
if( incls != null )
{
1.8 +14 -8
jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/FixCRLF.java
Index: FixCRLF.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/FixCRLF.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- FixCRLF.java 2001/12/21 13:29:09 1.7
+++ FixCRLF.java 2001/12/21 14:21:19 1.8
@@ -19,7 +19,7 @@
import java.io.OutputStreamWriter;
import java.io.Reader;
import java.io.Writer;
-import java.util.Enumeration;
+import java.util.Iterator;
import java.util.NoSuchElementException;
import org.apache.myrmidon.api.TaskException;
import org.apache.tools.ant.DirectoryScanner;
@@ -66,7 +66,7 @@
*
* @author Sam Ruby <a href="mailto:[EMAIL PROTECTED]">[EMAIL PROTECTED]</a>
* @author <a href="mailto:[EMAIL PROTECTED]">Peter B. West</a>
- * @version $Revision: 1.7 $ $Name: $
+ * @version $Revision: 1.8 $ $Name: $
*/
public class FixCRLF extends MatchingTask
@@ -586,14 +586,14 @@
throw new TaskException( "Error", e );
}
- while( lines.hasMoreElements() )
+ while( lines.hasNext() )
{
// In-line states
int endComment;
try
{
- line = (OneLiner.BufferLine)lines.nextElement();
+ line = (OneLiner.BufferLine)lines.next();
}
catch( NoSuchElementException e )
{
@@ -856,7 +856,8 @@
}
}
- class OneLiner implements Enumeration
+ class OneLiner
+ implements Iterator
{
private int state = javafiles ? LOOKING : NOTJAVA;
@@ -883,6 +884,11 @@
}
}
+ public void remove()
+ {
+ throw new UnsupportedOperationException();
+ }
+
public void setState( int state )
{
this.state = state;
@@ -907,15 +913,15 @@
}
}
- public boolean hasMoreElements()
+ public boolean hasNext()
{
return !reachedEof;
}
- public Object nextElement()
+ public Object next()
throws NoSuchElementException
{
- if( !hasMoreElements() )
+ if( !hasNext() )
{
throw new NoSuchElementException( "OneLiner" );
}
1.10 +7 -7
jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/GenerateKey.java
Index: GenerateKey.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/GenerateKey.java,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -r1.9 -r1.10
--- GenerateKey.java 2001/12/21 13:34:15 1.9
+++ GenerateKey.java 2001/12/21 14:21:19 1.10
@@ -7,8 +7,8 @@
*/
package org.apache.tools.ant.taskdefs;
-import java.util.Enumeration;
-import java.util.Vector;
+import java.util.Iterator;
+import java.util.ArrayList;
import org.apache.myrmidon.api.TaskException;
import org.apache.tools.ant.Project;
import org.apache.tools.ant.Task;
@@ -246,19 +246,19 @@
public static class DistinguishedName
{
- private Vector params = new Vector();
+ private ArrayList params = new ArrayList();
private String name;
private String path;
- public Enumeration getParams()
+ public Iterator getParams()
{
- return params.elements();
+ return params.iterator();
}
public Object createParam()
{
DnameParam param = new DnameParam();
- params.addElement( param );
+ params.add( param );
return param;
}
@@ -301,7 +301,7 @@
}
firstPass = false;
- final DnameParam param = (DnameParam)params.elementAt( i );
+ final DnameParam param = (DnameParam)params.get( i );
sb.append( encode( param.getName() ) );
sb.append( '=' );
sb.append( encode( param.getValue() ) );
1.6 +4 -4
jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/Input.java
Index: Input.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/Input.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- Input.java 2001/12/21 13:34:15 1.5
+++ Input.java 2001/12/21 14:21:19 1.6
@@ -11,7 +11,7 @@
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.StringTokenizer;
-import java.util.Vector;
+import java.util.ArrayList;
import org.apache.myrmidon.api.TaskException;
import org.apache.tools.ant.Project;
import org.apache.tools.ant.Task;
@@ -100,14 +100,14 @@
public void execute()
throws TaskException
{
- Vector accept = null;
+ ArrayList accept = null;
if( validargs != null )
{
- accept = new Vector();
+ accept = new ArrayList();
StringTokenizer stok = new StringTokenizer( validargs, ",",
false );
while( stok.hasMoreTokens() )
{
- accept.addElement( stok.nextToken() );
+ accept.add( stok.nextToken() );
}
}
log( message, Project.MSG_WARN );
1.5 +3 -2
jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/Jar.java
Index: Jar.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/Jar.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- Jar.java 2001/12/16 01:31:38 1.4
+++ Jar.java 2001/12/21 14:21:19 1.5
@@ -17,6 +17,7 @@
import java.io.OutputStreamWriter;
import java.io.PrintWriter;
import java.io.Reader;
+import java.util.Iterator;
import java.util.Enumeration;
import org.apache.myrmidon.api.TaskException;
import org.apache.tools.ant.FileScanner;
@@ -242,9 +243,9 @@
{
execManifest.merge( manifest );
}
- for( Enumeration e = execManifest.getWarnings();
e.hasMoreElements(); )
+ for( Iterator e = execManifest.getWarnings(); e.hasNext(); )
{
- log( "Manifest warning: " + (String)e.nextElement(),
Project.MSG_WARN );
+ log( "Manifest warning: " + (String)e.next(),
Project.MSG_WARN );
}
zipDir( null, zOut, "META-INF/" );
1.8 +3 -3
jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/Java.java
Index: Java.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/Java.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- Java.java 2001/12/21 13:34:15 1.7
+++ Java.java 2001/12/21 14:21:19 1.8
@@ -11,7 +11,7 @@
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.PrintStream;
-import java.util.Vector;
+import java.util.ArrayList;
import org.apache.myrmidon.api.TaskException;
import org.apache.tools.ant.Project;
import org.apache.tools.ant.Task;
@@ -308,14 +308,14 @@
* @param args Description of Parameter
* @exception TaskException Description of Exception
*/
- protected void run( String classname, Vector args )
+ protected void run( String classname, ArrayList args )
throws TaskException
{
CommandlineJava cmdj = new CommandlineJava();
cmdj.setClassname( classname );
for( int i = 0; i < args.size(); i++ )
{
- cmdj.createArgument().setValue( (String)args.elementAt( i ) );
+ cmdj.createArgument().setValue( (String)args.get( i ) );
}
run( cmdj );
}
1.9 +11 -12
jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/Javac.java
Index: Javac.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/Javac.java,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- Javac.java 2001/12/21 13:34:15 1.8
+++ Javac.java 2001/12/21 14:21:19 1.9
@@ -8,8 +8,8 @@
package org.apache.tools.ant.taskdefs;
import java.io.File;
-import java.util.Enumeration;
-import java.util.Vector;
+import java.util.Iterator;
+import java.util.ArrayList;
import org.apache.myrmidon.api.TaskException;
import org.apache.myrmidon.framework.Os;
import org.apache.tools.ant.DirectoryScanner;
@@ -70,7 +70,7 @@
private String fork = "false";
private String forkedExecutable = null;
private boolean nowarn = false;
- private Vector implementationSpecificArgs = new Vector();
+ private ArrayList implementationSpecificArgs = new ArrayList();
protected boolean failOnError = true;
protected File[] compileList = new File[ 0 ];
@@ -410,21 +410,20 @@
*/
public String[] getCurrentCompilerArgs()
{
- Vector args = new Vector();
- for( Enumeration enum = implementationSpecificArgs.elements();
- enum.hasMoreElements();
+ ArrayList args = new ArrayList();
+ for( Iterator enum = implementationSpecificArgs.iterator();
+ enum.hasNext();
)
{
String[] curr =
- ( (ImplementationSpecificArgument)enum.nextElement()
).getParts();
+ ( (ImplementationSpecificArgument)enum.next() ).getParts();
for( int i = 0; i < curr.length; i++ )
{
- args.addElement( curr[ i ] );
+ args.add( curr[ i ] );
}
}
- String[] res = new String[ args.size() ];
- args.copyInto( res );
- return res;
+ final String[] res = new String[ args.size() ];
+ return (String[])args.toArray( res );
}
/**
@@ -688,7 +687,7 @@
{
ImplementationSpecificArgument arg =
new ImplementationSpecificArgument();
- implementationSpecificArgs.addElement( arg );
+ implementationSpecificArgs.add( arg );
return arg;
}
1.10 +50 -50
jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/Javadoc.java
Index: Javadoc.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/Javadoc.java,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -r1.9 -r1.10
--- Javadoc.java 2001/12/21 13:34:15 1.9
+++ Javadoc.java 2001/12/21 14:21:19 1.10
@@ -12,9 +12,9 @@
import java.io.FilenameFilter;
import java.io.IOException;
import java.io.PrintWriter;
-import java.util.Enumeration;
+import java.util.Iterator;
import java.util.StringTokenizer;
-import java.util.Vector;
+import java.util.ArrayList;
import org.apache.myrmidon.api.TaskException;
import org.apache.myrmidon.framework.Os;
import org.apache.tools.ant.DirectoryScanner;
@@ -74,19 +74,19 @@
private boolean failOnError = false;
private Path sourcePath = null;
private File destDir = null;
- private Vector sourceFiles = new Vector();
- private Vector packageNames = new Vector( 5 );
- private Vector excludePackageNames = new Vector( 1 );
+ private ArrayList sourceFiles = new ArrayList();
+ private ArrayList packageNames = new ArrayList( 5 );
+ private ArrayList excludePackageNames = new ArrayList( 1 );
private boolean author = true;
private boolean version = true;
private DocletInfo doclet = null;
private Path classpath = null;
private Path bootclasspath = null;
private String group = null;
- private Vector compileList = new Vector( 10 );
+ private ArrayList compileList = new ArrayList( 10 );
private String packageList = null;
- private Vector links = new Vector( 2 );
- private Vector groups = new Vector( 2 );
+ private ArrayList links = new ArrayList( 2 );
+ private ArrayList groups = new ArrayList( 2 );
private boolean useDefaultExcludes = true;
private Html doctitle = null;
private Html header = null;
@@ -541,7 +541,7 @@
public void addExcludePackage( PackageName pn )
{
- excludePackageNames.addElement( pn );
+ excludePackageNames.add( pn );
}
public void addFooter( Html text )
@@ -562,13 +562,13 @@
public void addPackage( PackageName pn )
{
- packageNames.addElement( pn );
+ packageNames.add( pn );
}
public void addSource( SourceFile sf )
throws TaskException
{
- sourceFiles.addElement( sf );
+ sourceFiles.add( sf );
}
public Path createBootclasspath()
@@ -600,14 +600,14 @@
public GroupArgument createGroup()
{
GroupArgument ga = new GroupArgument();
- groups.addElement( ga );
+ groups.add( ga );
return ga;
}
public LinkArgument createLink()
{
LinkArgument la = new LinkArgument();
- links.addElement( la );
+ links.add( la );
return la;
}
@@ -711,9 +711,9 @@
toExecute.createArgument().setValue( "-docletpath" );
toExecute.createArgument().setPath( doclet.getPath()
);
}
- for( Enumeration e = doclet.getParams();
e.hasMoreElements(); )
+ for( Iterator e = doclet.getParams(); e.hasNext(); )
{
- DocletParam param = (DocletParam)e.nextElement();
+ DocletParam param = (DocletParam)e.next();
if( param.getName() == null )
{
throw new TaskException( "Doclet parameters must
have a name" );
@@ -736,9 +736,9 @@
// add the links arguments
if( links.size() != 0 )
{
- for( Enumeration e = links.elements(); e.hasMoreElements(); )
+ for( Iterator e = links.iterator(); e.hasNext(); )
{
- LinkArgument la = (LinkArgument)e.nextElement();
+ LinkArgument la = (LinkArgument)e.next();
if( la.getHref() == null )
{
@@ -806,9 +806,9 @@
// add the group arguments
if( groups.size() != 0 )
{
- for( Enumeration e = groups.elements(); e.hasMoreElements();
)
+ for( Iterator e = groups.iterator(); e.hasNext(); )
{
- GroupArgument ga = (GroupArgument)e.nextElement();
+ GroupArgument ga = (GroupArgument)e.next();
String title = ga.getTitle();
String packages = ga.getPackages();
if( title == null || packages == null )
@@ -826,15 +826,15 @@
tmpList = null;
if( packageNames.size() > 0 )
{
- Vector packages = new Vector();
- Enumeration enum = packageNames.elements();
- while( enum.hasMoreElements() )
+ ArrayList packages = new ArrayList();
+ Iterator enum = packageNames.iterator();
+ while( enum.hasNext() )
{
- PackageName pn = (PackageName)enum.nextElement();
+ PackageName pn = (PackageName)enum.next();
String name = pn.getName().trim();
if( name.endsWith( ".*" ) )
{
- packages.addElement( name );
+ packages.add( name );
}
else
{
@@ -842,14 +842,14 @@
}
}
- Vector excludePackages = new Vector();
+ ArrayList excludePackages = new ArrayList();
if( excludePackageNames.size() > 0 )
{
- enum = excludePackageNames.elements();
- while( enum.hasMoreElements() )
+ enum = excludePackageNames.iterator();
+ while( enum.hasNext() )
{
- PackageName pn = (PackageName)enum.nextElement();
- excludePackages.addElement( pn.getName().trim() );
+ PackageName pn = (PackageName)enum.next();
+ excludePackages.add( pn.getName().trim() );
}
}
if( packages.size() > 0 )
@@ -878,10 +878,10 @@
true )
);
}
- Enumeration enum = sourceFiles.elements();
- while( enum.hasMoreElements() )
+ Iterator enum = sourceFiles.iterator();
+ while( enum.hasNext() )
{
- SourceFile sf = (SourceFile)enum.nextElement();
+ SourceFile sf = (SourceFile)enum.next();
String sourceFileName = sf.getFile().getAbsolutePath();
if( useExternalFile )
{
@@ -1053,7 +1053,7 @@
* @param excludePackages Description of Parameter
*/
private void evaluatePackages( Commandline toExecute, Path sourcePath,
- Vector packages, Vector excludePackages )
+ ArrayList packages, ArrayList
excludePackages )
throws TaskException
{
log( "Source path = " + sourcePath.toString(), Project.MSG_VERBOSE );
@@ -1064,7 +1064,7 @@
{
msg.append( "," );
}
- msg.append( packages.elementAt( i ) );
+ msg.append( packages.get( i ) );
}
log( msg.toString(), Project.MSG_VERBOSE );
@@ -1076,11 +1076,11 @@
{
msg.append( "," );
}
- msg.append( excludePackages.elementAt( i ) );
+ msg.append( excludePackages.get( i ) );
}
log( msg.toString(), Project.MSG_VERBOSE );
- Vector addedPackages = new Vector();
+ ArrayList addedPackages = new ArrayList();
String[] list = sourcePath.list();
if( list == null )
@@ -1089,10 +1089,10 @@
FileSet fs = new FileSet();
fs.setDefaultexcludes( useDefaultExcludes );
- Enumeration e = packages.elements();
- while( e.hasMoreElements() )
+ Iterator e = packages.iterator();
+ while( e.hasNext() )
{
- String pkg = (String)e.nextElement();
+ String pkg = (String)e.next();
pkg = pkg.replace( '.', '/' );
if( pkg.endsWith( "*" ) )
{
@@ -1102,10 +1102,10 @@
fs.createInclude().setName( pkg );
}// while
- e = excludePackages.elements();
- while( e.hasMoreElements() )
+ e = excludePackages.iterator();
+ while( e.hasNext() )
{
- String pkg = (String)e.nextElement();
+ String pkg = (String)e.next();
pkg = pkg.replace( '.', '/' );
if( pkg.endsWith( "*" ) )
{
@@ -1162,7 +1162,7 @@
{
toExecute.createArgument().setValue( pkgDir
);
}
- addedPackages.addElement( pkgDir );
+ addedPackages.add( pkgDir );
}
}
}
@@ -1244,7 +1244,7 @@
public class DocletInfo
{
- private Vector params = new Vector();
+ private ArrayList params = new ArrayList();
private String name;
private Path path;
@@ -1282,9 +1282,9 @@
return name;
}
- public Enumeration getParams()
+ public Iterator getParams()
{
- return params.elements();
+ return params.iterator();
}
public Path getPath()
@@ -1295,7 +1295,7 @@
public DocletParam createParam()
{
DocletParam param = new DocletParam();
- params.addElement( param );
+ params.add( param );
return param;
}
@@ -1339,7 +1339,7 @@
public class GroupArgument
{
- private Vector packages = new Vector( 3 );
+ private ArrayList packages = new ArrayList( 3 );
private Html title;
public GroupArgument()
@@ -1374,7 +1374,7 @@
{
p.append( ":" );
}
- p.append( packages.elementAt( i ).toString() );
+ p.append( packages.get( i ).toString() );
}
return p.toString();
}
@@ -1386,7 +1386,7 @@
public void addPackage( PackageName pn )
{
- packages.addElement( pn );
+ packages.add( pn );
}
public void addTitle( Html text )
1.7 +29 -28
jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/Manifest.java
Index: Manifest.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/Manifest.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- Manifest.java 2001/12/16 02:05:41 1.6
+++ Manifest.java 2001/12/21 14:21:19 1.7
@@ -18,9 +18,10 @@
import java.io.Reader;
import java.io.StringWriter;
import java.io.UnsupportedEncodingException;
-import java.util.Enumeration;
+import java.util.Iterator;
import java.util.Hashtable;
-import java.util.Vector;
+import java.util.ArrayList;
+import java.util.Enumeration;
import org.apache.myrmidon.api.TaskException;
import org.apache.tools.ant.Task;
import org.apache.tools.ant.types.EnumeratedAttribute;
@@ -216,26 +217,26 @@
*
* @return an enumeration of warning strings
*/
- public Enumeration getWarnings()
+ public Iterator getWarnings()
{
- Vector warnings = new Vector();
+ ArrayList warnings = new ArrayList();
- for( Enumeration e2 = mainSection.getWarnings();
e2.hasMoreElements(); )
+ for( Iterator e2 = mainSection.getWarnings(); e2.hasNext(); )
{
- warnings.addElement( e2.nextElement() );
+ warnings.add( e2.next() );
}
// create a vector and add in the warnings for all the sections
for( Enumeration e = sections.elements(); e.hasMoreElements(); )
{
Section section = (Section)e.nextElement();
- for( Enumeration e2 = section.getWarnings();
e2.hasMoreElements(); )
+ for( Iterator e2 = section.getWarnings(); e2.hasNext(); )
{
- warnings.addElement( e2.nextElement() );
+ warnings.add( e2.next() );
}
}
- return warnings.elements();
+ return warnings.iterator();
}
public void addConfiguredAttribute( Attribute attribute )
@@ -648,7 +649,7 @@
*/
public static class Section
{
- private Vector warnings = new Vector();
+ private ArrayList warnings = new ArrayList();
/**
* The section's name if any. The main section in a manifest is
unnamed.
@@ -691,9 +692,9 @@
else
{
String value = "";
- for( Enumeration e = ( (Vector)attribute ).elements();
e.hasMoreElements(); )
+ for( Iterator e = ( (ArrayList)attribute ).iterator();
e.hasNext(); )
{
- Attribute classpathAttribute =
(Attribute)e.nextElement();
+ Attribute classpathAttribute = (Attribute)e.next();
value += classpathAttribute.getValue() + " ";
}
return value.trim();
@@ -710,9 +711,9 @@
return name;
}
- public Enumeration getWarnings()
+ public Iterator getWarnings()
{
- return warnings.elements();
+ return warnings.iterator();
}
/**
@@ -733,7 +734,7 @@
}
if( attribute.getName().equalsIgnoreCase( ATTRIBUTE_NAME ) )
{
- warnings.addElement( "\"" + ATTRIBUTE_NAME + "\" attributes
should not occur in the " +
+ warnings.add( "\"" + ATTRIBUTE_NAME + "\" attributes should
not occur in the " +
"main section and must be the first
element in all " +
"other sections: \"" +
attribute.getName() + ": " + attribute.getValue() + "\"" );
return attribute.getValue();
@@ -741,7 +742,7 @@
if( attribute.getName().toLowerCase().startsWith(
ATTRIBUTE_FROM.toLowerCase() ) )
{
- warnings.addElement( "Manifest attributes should not start
with \"" +
+ warnings.add( "Manifest attributes should not start with \""
+
ATTRIBUTE_FROM + "\" in \"" +
attribute.getName() + ": " + attribute.getValue() + "\"" );
}
else
@@ -750,13 +751,13 @@
String attributeName = attribute.getName().toLowerCase();
if( attributeName.equals( ATTRIBUTE_CLASSPATH ) )
{
- Vector classpathAttrs = (Vector)attributes.get(
attributeName );
+ ArrayList classpathAttrs = (ArrayList)attributes.get(
attributeName );
if( classpathAttrs == null )
{
- classpathAttrs = new Vector();
+ classpathAttrs = new ArrayList();
attributes.put( attributeName, classpathAttrs );
}
- classpathAttrs.addElement( attribute );
+ classpathAttrs.add( attribute );
}
else if( attributes.containsKey( attributeName ) )
{
@@ -830,11 +831,11 @@
attributes.containsKey( attributeName ) )
{
// classpath entries are vetors which are merged
- Vector classpathAttrs = (Vector)section.attributes.get(
attributeName );
- Vector ourClasspathAttrs = (Vector)attributes.get(
attributeName );
- for( Enumeration e2 = classpathAttrs.elements();
e2.hasMoreElements(); )
+ ArrayList classpathAttrs =
(ArrayList)section.attributes.get( attributeName );
+ ArrayList ourClasspathAttrs = (ArrayList)attributes.get(
attributeName );
+ for( Iterator e2 = classpathAttrs.iterator();
e2.hasNext(); )
{
- ourClasspathAttrs.addElement( e2.nextElement() );
+ ourClasspathAttrs.add( e2.next() );
}
}
else
@@ -845,9 +846,9 @@
}
// add in the warnings
- for( Enumeration e = section.warnings.elements();
e.hasMoreElements(); )
+ for( Iterator e = section.warnings.iterator(); e.hasNext(); )
{
- warnings.addElement( e.nextElement() );
+ warnings.add( e.next() );
}
}
@@ -939,10 +940,10 @@
}
else
{
- Vector attrList = (Vector)object;
- for( Enumeration e2 = attrList.elements();
e2.hasMoreElements(); )
+ ArrayList attrList = (ArrayList)object;
+ for( Iterator e2 = attrList.iterator(); e2.hasNext(); )
{
- Attribute attribute = (Attribute)e2.nextElement();
+ Attribute attribute = (Attribute)e2.next();
attribute.write( writer );
}
}
1.5 +4 -4
jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/PathConvert.java
Index: PathConvert.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/PathConvert.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- PathConvert.java 2001/12/16 06:40:16 1.4
+++ PathConvert.java 2001/12/21 14:21:19 1.5
@@ -8,7 +8,7 @@
package org.apache.tools.ant.taskdefs;
import java.io.File;
-import java.util.Vector;
+import java.util.ArrayList;
import org.apache.myrmidon.api.TaskException;
import org.apache.tools.ant.Project;
import org.apache.tools.ant.Task;
@@ -36,7 +36,7 @@
private boolean targetWindows = false;// Set when targetOS is set
private boolean onWindows = false;// Set if we're running on windows
private String property = null;// The property to receive the results
- private Vector prefixMap = new Vector();// Path prefix map
+ private ArrayList prefixMap = new ArrayList();// Path prefix map
private String pathSep = null;// User override on path sep char
private String dirSep = null;
@@ -130,7 +130,7 @@
{
MapEntry entry = new MapEntry();
- prefixMap.addElement( entry );
+ prefixMap.add( entry );
return entry;
}
@@ -250,7 +250,7 @@
for( int i = 0; i < size; i++ )
{
- MapEntry entry = (MapEntry)prefixMap.elementAt( i );
+ MapEntry entry = (MapEntry)prefixMap.get( i );
String newElem = entry.apply( elem );
// Note I'm using "!=" to see if we got a new object back
from
1.13 +6 -5
jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/Property.java
Index: Property.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/Property.java,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -r1.12 -r1.13
--- Property.java 2001/12/21 13:34:15 1.12
+++ Property.java 2001/12/21 14:21:19 1.13
@@ -11,9 +11,10 @@
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
-import java.util.Enumeration;
+import java.util.Iterator;
import java.util.Properties;
-import java.util.Vector;
+import java.util.ArrayList;
+import java.util.Enumeration;
import org.apache.myrmidon.api.TaskException;
import org.apache.tools.ant.AntClassLoader;
import org.apache.tools.ant.Project;
@@ -213,10 +214,10 @@
if( !prefix.endsWith( "." ) )
prefix += ".";
log( "Loading Environment " + prefix, Project.MSG_VERBOSE );
- Vector osEnv = Execute.getProcEnvironment();
- for( Enumeration e = osEnv.elements(); e.hasMoreElements(); )
+ ArrayList osEnv = Execute.getProcEnvironment();
+ for( Iterator e = osEnv.iterator(); e.hasNext(); )
{
- String entry = (String)e.nextElement();
+ String entry = (String)e.next();
int pos = entry.indexOf( '=' );
if( pos == -1 )
{
1.5 +0 -1
jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/RecorderEntry.java
Index: RecorderEntry.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/RecorderEntry.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- RecorderEntry.java 2001/12/21 13:27:09 1.4
+++ RecorderEntry.java 2001/12/21 14:21:19 1.5
@@ -11,7 +11,6 @@
import org.apache.tools.ant.BuildEvent;
import org.apache.tools.ant.BuildLogger;
import org.apache.tools.ant.Project;
-import org.apache.tools.ant.util.StringUtils;
/**
* This is a class that represents a recorder. This is the listener to the
build
1.6 +5 -5
jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/Replace.java
Index: Replace.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/Replace.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- Replace.java 2001/12/17 10:47:18 1.5
+++ Replace.java 2001/12/21 14:21:19 1.6
@@ -21,7 +21,7 @@
import java.io.Reader;
import java.io.Writer;
import java.util.Properties;
-import java.util.Vector;
+import java.util.ArrayList;
import org.apache.myrmidon.api.TaskException;
import org.apache.tools.ant.DirectoryScanner;
import org.apache.tools.ant.Project;
@@ -45,7 +45,7 @@
private File propertyFile = null;
private Properties properties = null;
- private Vector replacefilters = new Vector();
+ private ArrayList replacefilters = new ArrayList();
private File dir = null;
private boolean summary = false;
@@ -184,7 +184,7 @@
public Replacefilter createReplacefilter()
{
Replacefilter filter = new Replacefilter();
- replacefilters.addElement( filter );
+ replacefilters.add( filter );
return filter;
}
@@ -273,7 +273,7 @@
{
for( int i = 0; i < replacefilters.size(); i++ )
{
- Replacefilter element = (Replacefilter)replacefilters.elementAt(
i );
+ Replacefilter element = (Replacefilter)replacefilters.get( i );
element.validate();
}
}
@@ -424,7 +424,7 @@
for( int i = 0; i < replacefilters.size(); i++ )
{
- Replacefilter filter = (Replacefilter)replacefilters.elementAt(
i );
+ Replacefilter filter = (Replacefilter)replacefilters.get( i );
//for each found token, replace with value
log( "Replacing in " + filename + ": " + filter.getToken() + "
--> " + filter.getReplaceValue(), Project.MSG_VERBOSE );
1.13 +7 -7
jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/Rmic.java
Index: Rmic.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/Rmic.java,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -r1.12 -r1.13
--- Rmic.java 2001/12/21 13:34:15 1.12
+++ Rmic.java 2001/12/21 14:21:19 1.13
@@ -10,7 +10,7 @@
import java.io.File;
import java.io.IOException;
import java.rmi.Remote;
-import java.util.Vector;
+import java.util.ArrayList;
import org.apache.avalon.excalibur.io.FileUtil;
import org.apache.myrmidon.api.TaskException;
import org.apache.tools.ant.AntClassLoader;
@@ -73,7 +73,7 @@
private boolean includeAntRuntime = true;
private boolean includeJavaRuntime = false;
- private Vector compileList = new Vector();
+ private ArrayList compileList = new ArrayList();
private ClassLoader loader = null;
@@ -293,7 +293,7 @@
return compileClasspath;
}
- public Vector getCompileList()
+ public ArrayList getCompileList()
{
return compileList;
}
@@ -323,7 +323,7 @@
*
* @return The FileList value
*/
- public Vector getFileList()
+ public ArrayList getFileList()
{
return compileList;
}
@@ -596,12 +596,12 @@
for( int j = 0; j < fileCount; j++ )
{
moveGeneratedFile( baseDir, sourceBase,
- (String)compileList.elementAt( j ),
+ (String)compileList.get( j ),
adapter );
}
}
}
- compileList.removeAllElements();
+ compileList.clear();
}
/**
@@ -639,7 +639,7 @@
{
String classname = newFiles[ i ].replace( File.separatorChar,
'.' );
classname = classname.substring( 0, classname.lastIndexOf(
".class" ) );
- compileList.addElement( classname );
+ compileList.add( classname );
}
}
1.8 +10 -10
jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/SQLExec.java
Index: SQLExec.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/SQLExec.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- SQLExec.java 2001/12/21 13:34:15 1.7
+++ SQLExec.java 2001/12/21 14:21:19 1.8
@@ -26,10 +26,10 @@
import java.sql.SQLException;
import java.sql.SQLWarning;
import java.sql.Statement;
-import java.util.Enumeration;
+import java.util.Iterator;
import java.util.Properties;
import java.util.StringTokenizer;
-import java.util.Vector;
+import java.util.ArrayList;
import org.apache.myrmidon.api.TaskException;
import org.apache.tools.ant.AntClassLoader;
import org.apache.tools.ant.DirectoryScanner;
@@ -53,7 +53,7 @@
private int goodSql = 0, totalSql = 0;
- private Vector filesets = new Vector();
+ private ArrayList filesets = new ArrayList();
/**
* Database connection
@@ -103,7 +103,7 @@
/**
* SQL transactions to perform
*/
- private Vector transactions = new Vector();
+ private ArrayList transactions = new ArrayList();
/**
* SQL Statement delimiter
@@ -347,7 +347,7 @@
*/
public void addFileset( FileSet set )
{
- filesets.addElement( set );
+ filesets.add( set );
}
/**
@@ -383,7 +383,7 @@
public Transaction createTransaction()
{
Transaction t = new Transaction();
- transactions.addElement( t );
+ transactions.add( t );
return t;
}
@@ -409,7 +409,7 @@
// deal with the filesets
for( int i = 0; i < filesets.size(); i++ )
{
- FileSet fs = (FileSet)filesets.elementAt( i );
+ FileSet fs = (FileSet)filesets.get( i );
DirectoryScanner ds = fs.getDirectoryScanner( getProject() );
File srcDir = fs.getDir( getProject() );
@@ -513,11 +513,11 @@
}
// Process all transactions
- for( Enumeration e = transactions.elements();
- e.hasMoreElements(); )
+ for( Iterator e = transactions.iterator();
+ e.hasNext(); )
{
- ( (Transaction)e.nextElement() ).runTransaction( out );
+ ( (Transaction)e.next() ).runTransaction( out );
if( !autocommit )
{
log( "Commiting transaction", Project.MSG_VERBOSE );
1.5 +6 -6
jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/SendEmail.java
Index: SendEmail.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/SendEmail.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- SendEmail.java 2001/12/16 05:44:55 1.4
+++ SendEmail.java 2001/12/21 14:21:19 1.5
@@ -12,9 +12,9 @@
import java.io.FileInputStream;
import java.io.IOException;
import java.io.PrintStream;
-import java.util.Enumeration;
+import java.util.Iterator;
import java.util.StringTokenizer;
-import java.util.Vector;
+import java.util.ArrayList;
import org.apache.myrmidon.api.TaskException;
import org.apache.tools.ant.Project;
import org.apache.tools.ant.Task;
@@ -163,7 +163,7 @@
{
private String mailhost = "localhost";
private int mailport = MailMessage.DEFAULT_PORT;
- private Vector files = new Vector();
+ private ArrayList files = new ArrayList();
/**
* failure flag
*/
@@ -204,7 +204,7 @@
while( t.hasMoreTokens() )
{
- files.addElement( resolveFile( t.nextToken() ) );
+ files.add( resolveFile( t.nextToken() ) );
}
}
@@ -324,9 +324,9 @@
{
PrintStream out = mailMessage.getPrintStream();
- for( Enumeration e = files.elements(); e.hasMoreElements(); )
+ for( Iterator e = files.iterator(); e.hasNext(); )
{
- File file = (File)e.nextElement();
+ File file = (File)e.next();
if( file.exists() && file.canRead() )
{
1.7 +5 -4
jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/SignJar.java
Index: SignJar.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/SignJar.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- SignJar.java 2001/12/21 13:34:15 1.6
+++ SignJar.java 2001/12/21 14:21:19 1.7
@@ -9,8 +9,9 @@
import java.io.File;
import java.io.IOException;
+import java.util.Iterator;
+import java.util.ArrayList;
import java.util.Enumeration;
-import java.util.Vector;
import java.util.zip.ZipEntry;
import java.util.zip.ZipFile;
import org.apache.myrmidon.api.TaskException;
@@ -34,7 +35,7 @@
/**
* the filesets of the jars to sign
*/
- protected Vector filesets = new Vector();
+ protected ArrayList filesets = new ArrayList();
/**
* The alias of signer.
@@ -132,7 +133,7 @@
*/
public void addFileset( final FileSet set )
{
- filesets.addElement( set );
+ filesets.add( set );
}
public void execute()
@@ -154,7 +155,7 @@
// deal with the filesets
for( int i = 0; i < filesets.size(); i++ )
{
- FileSet fs = (FileSet)filesets.elementAt( i );
+ FileSet fs = (FileSet)filesets.get( i );
DirectoryScanner ds = fs.getDirectoryScanner( getProject() );
String[] jarFiles = ds.getIncludedFiles();
for( int j = 0; j < jarFiles.length; j++ )
1.8 +10 -10
jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/Tar.java
Index: Tar.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/Tar.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- Tar.java 2001/12/21 13:34:15 1.7
+++ Tar.java 2001/12/21 14:21:19 1.8
@@ -11,8 +11,8 @@
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
-import java.util.Enumeration;
-import java.util.Vector;
+import java.util.Iterator;
+import java.util.ArrayList;
import org.apache.myrmidon.api.TaskException;
import org.apache.tools.ant.DirectoryScanner;
import org.apache.tools.ant.Project;
@@ -50,8 +50,8 @@
}
}
- Vector filesets = new Vector();
- Vector fileSetFiles = new Vector();
+ ArrayList filesets = new ArrayList();
+ ArrayList fileSetFiles = new ArrayList();
/**
* Indicates whether the user has been warned about long files already.
@@ -99,7 +99,7 @@
public TarFileSet createTarFileSet()
{
TarFileSet fileset = new TarFileSet();
- filesets.addElement( fileset );
+ filesets.add( fileset );
return fileset;
}
@@ -131,7 +131,7 @@
// add the main fileset to the list of filesets to process.
TarFileSet mainFileSet = new TarFileSet( fileset );
mainFileSet.setDir( baseDir );
- filesets.addElement( mainFileSet );
+ filesets.add( mainFileSet );
}
if( filesets.size() == 0 )
@@ -142,9 +142,9 @@
// check if tr is out of date with respect to each
// fileset
boolean upToDate = true;
- for( Enumeration e = filesets.elements(); e.hasMoreElements(); )
+ for( Iterator e = filesets.iterator(); e.hasNext(); )
{
- TarFileSet fs = (TarFileSet)e.nextElement();
+ TarFileSet fs = (TarFileSet)e.next();
String[] files = fs.getFiles( getProject() );
if( !archiveIsUpToDate( files ) )
@@ -191,9 +191,9 @@
}
longWarningGiven = false;
- for( Enumeration e = filesets.elements(); e.hasMoreElements(); )
+ for( Iterator e = filesets.iterator(); e.hasNext(); )
{
- TarFileSet fs = (TarFileSet)e.nextElement();
+ TarFileSet fs = (TarFileSet)e.next();
String[] files = fs.getFiles( getProject() );
for( int i = 0; i < files.length; i++ )
{
1.7 +4 -4
jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/Touch.java
Index: Touch.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/Touch.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- Touch.java 2001/12/21 13:34:15 1.6
+++ Touch.java 2001/12/21 14:21:19 1.7
@@ -13,7 +13,7 @@
import java.text.DateFormat;
import java.text.ParseException;
import java.util.Locale;
-import java.util.Vector;
+import java.util.ArrayList;
import org.apache.myrmidon.api.TaskException;
import org.apache.tools.ant.DirectoryScanner;
import org.apache.tools.ant.Project;
@@ -34,7 +34,7 @@
public class Touch extends Task
{// required
private long millis = -1;
- private Vector filesets = new Vector();
+ private ArrayList filesets = new ArrayList();
private String dateTime;
private File file;
@@ -77,7 +77,7 @@
*/
public void addFileset( FileSet set )
{
- filesets.addElement( set );
+ filesets.add( set );
}
/**
@@ -170,7 +170,7 @@
// deal with the filesets
for( int i = 0; i < filesets.size(); i++ )
{
- FileSet fs = (FileSet)filesets.elementAt( i );
+ FileSet fs = (FileSet)filesets.get( i );
DirectoryScanner ds = fs.getDirectoryScanner( getProject() );
File fromDir = fs.getDir( getProject() );
1.9 +7 -7
jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/Tstamp.java
Index: Tstamp.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/Tstamp.java,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- Tstamp.java 2001/12/21 13:34:15 1.8
+++ Tstamp.java 2001/12/21 14:21:19 1.9
@@ -10,13 +10,13 @@
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;
-import java.util.Enumeration;
+import java.util.Iterator;
import java.util.Hashtable;
import java.util.Locale;
import java.util.NoSuchElementException;
import java.util.StringTokenizer;
import java.util.TimeZone;
-import java.util.Vector;
+import java.util.ArrayList;
import org.apache.myrmidon.api.TaskException;
import org.apache.tools.ant.Project;
import org.apache.tools.ant.Task;
@@ -34,7 +34,7 @@
public class Tstamp extends Task
{
- private Vector customFormats = new Vector();
+ private ArrayList customFormats = new ArrayList();
private String prefix = "";
public void setPrefix( String prefix )
@@ -49,7 +49,7 @@
public CustomFormat createFormat()
{
CustomFormat cts = new CustomFormat( prefix );
- customFormats.addElement( cts );
+ customFormats.add( cts );
return cts;
}
@@ -69,10 +69,10 @@
SimpleDateFormat today = new SimpleDateFormat( "MMMM d yyyy",
Locale.US );
setProperty( prefix + "TODAY", today.format( d ) );
- Enumeration i = customFormats.elements();
- while( i.hasMoreElements() )
+ Iterator i = customFormats.iterator();
+ while( i.hasNext() )
{
- CustomFormat cts = (CustomFormat)i.nextElement();
+ CustomFormat cts = (CustomFormat)i.next();
cts.execute( getProject(), d );
}
1.8 +7 -7
jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/UpToDate.java
Index: UpToDate.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/UpToDate.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- UpToDate.java 2001/12/21 13:34:15 1.7
+++ UpToDate.java 2001/12/21 14:21:19 1.8
@@ -8,8 +8,8 @@
package org.apache.tools.ant.taskdefs;
import java.io.File;
-import java.util.Enumeration;
-import java.util.Vector;
+import java.util.Iterator;
+import java.util.ArrayList;
import org.apache.myrmidon.api.TaskException;
import org.apache.tools.ant.DirectoryScanner;
import org.apache.tools.ant.Project;
@@ -33,7 +33,7 @@
public class UpToDate extends MatchingTask implements Condition
{
- private Vector sourceFileSets = new Vector();
+ private ArrayList sourceFileSets = new ArrayList();
protected Mapper mapperElement = null;
@@ -81,7 +81,7 @@
*/
public void addSrcfiles( FileSet fs )
{
- sourceFileSets.addElement( fs );
+ sourceFileSets.add( fs );
}
/**
@@ -123,11 +123,11 @@
if( _targetFile != null && !_targetFile.exists() )
return false;
- Enumeration enum = sourceFileSets.elements();
+ Iterator enum = sourceFileSets.iterator();
boolean upToDate = true;
- while( upToDate && enum.hasMoreElements() )
+ while( upToDate && enum.hasNext() )
{
- FileSet fs = (FileSet)enum.nextElement();
+ FileSet fs = (FileSet)enum.next();
DirectoryScanner ds = fs.getDirectoryScanner( getProject() );
upToDate = upToDate && scanDir( fs.getDir( getProject() ),
ds.getIncludedFiles() );
1.9 +24 -25
jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/Zip.java
Index: Zip.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/Zip.java,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- Zip.java 2001/12/21 13:34:15 1.8
+++ Zip.java 2001/12/21 14:21:19 1.9
@@ -15,9 +15,9 @@
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
+import java.util.ArrayList;
import java.util.Hashtable;
import java.util.Stack;
-import java.util.Vector;
import java.util.zip.CRC32;
import java.util.zip.ZipInputStream;
import org.apache.myrmidon.api.TaskException;
@@ -50,9 +50,9 @@
private boolean doFilesonly = false;
protected String archiveType = "zip";
protected String emptyBehavior = "skip";
- private Vector filesets = new Vector();
+ private ArrayList filesets = new ArrayList();
protected Hashtable addedDirs = new Hashtable();
- private Vector addedFiles = new Vector();
+ private ArrayList addedFiles = new ArrayList();
protected File zipFile;
@@ -87,16 +87,15 @@
protected static File[] grabFiles( FileScanner[] scanners,
String[][] fileNames )
{
- Vector files = new Vector();
+ ArrayList files = new ArrayList();
for( int i = 0; i < fileNames.length; i++ )
{
File thisBaseDir = scanners[ i ].getBasedir();
for( int j = 0; j < fileNames[ i ].length; j++ )
- files.addElement( new File( thisBaseDir, fileNames[ i ][ j ]
) );
+ files.add( new File( thisBaseDir, fileNames[ i ][ j ] ) );
}
- File[] toret = new File[ files.size() ];
- files.copyInto( toret );
- return toret;
+ final File[] toret = new File[ files.size() ];
+ return (File[])files.toArray( toret );
}
/**
@@ -197,7 +196,7 @@
*/
public void addFileset( FileSet set )
{
- filesets.addElement( set );
+ filesets.add( set );
}
/**
@@ -208,7 +207,7 @@
*/
public void addZipfileset( ZipFileSet set )
{
- filesets.addElement( set );
+ filesets.add( set );
}
public void execute()
@@ -258,19 +257,19 @@
}
// Create the scanners to pass to isUpToDate().
- Vector dss = new Vector();
+ ArrayList dss = new ArrayList();
if( baseDir != null )
{
- dss.addElement( getDirectoryScanner( baseDir ) );
+ dss.add( getDirectoryScanner( baseDir ) );
}
for( int i = 0; i < filesets.size(); i++ )
{
- FileSet fs = (FileSet)filesets.elementAt( i );
- dss.addElement( fs.getDirectoryScanner( getProject() ) );
+ FileSet fs = (FileSet)filesets.get( i );
+ dss.add( fs.getDirectoryScanner( getProject() ) );
}
int dssSize = dss.size();
FileScanner[] scanners = new FileScanner[ dssSize ];
- dss.copyInto( scanners );
+ scanners = (FileScanner[])dss.toArray( scanners );
// quick exit if the target is up to date
// can also handle empty archives
@@ -321,11 +320,11 @@
{
exclusionPattern.append( "," );
}
- exclusionPattern.append(
(String)addedFiles.elementAt( i ) );
+ exclusionPattern.append( (String)addedFiles.get( i )
);
}
oldFiles.setExcludes( exclusionPattern.toString() );
- Vector tmp = new Vector();
- tmp.addElement( oldFiles );
+ ArrayList tmp = new ArrayList();
+ tmp.add( oldFiles );
addFiles( tmp, zOut );
}
finalizeZipOutputStream( zOut );
@@ -527,20 +526,20 @@
}
/**
- * Iterate over the given Vector of (zip)filesets and add all files to
the
+ * Iterate over the given ArrayList of (zip)filesets and add all files
to the
* ZipOutputStream using the given prefix or fullpath.
*
* @param filesets The feature to be added to the Files attribute
* @param zOut The feature to be added to the Files attribute
* @exception IOException Description of Exception
*/
- protected void addFiles( Vector filesets, ZipOutputStream zOut )
+ protected void addFiles( ArrayList filesets, ZipOutputStream zOut )
throws IOException, TaskException
{
- // Add each fileset in the Vector.
+ // Add each fileset in the ArrayList.
for( int i = 0; i < filesets.size(); i++ )
{
- FileSet fs = (FileSet)filesets.elementAt( i );
+ FileSet fs = (FileSet)filesets.get( i );
DirectoryScanner ds = fs.getDirectoryScanner( getProject() );
String prefix = "";
@@ -686,8 +685,8 @@
protected void cleanUp()
{
addedDirs = new Hashtable();
- addedFiles = new Vector();
- filesets = new Vector();
+ addedFiles = new ArrayList();
+ filesets = new ArrayList();
zipFile = null;
baseDir = null;
doCompress = true;
@@ -844,7 +843,7 @@
}
count = in.read( buffer, 0, buffer.length );
} while( count != -1 );
- addedFiles.addElement( vPath );
+ addedFiles.add( vPath );
}
protected void zipFile( File file, ZipOutputStream zOut, String vPath )
1.3 +2 -1
jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/condition/And.java
Index: And.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/condition/And.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- And.java 2001/12/16 00:38:31 1.2
+++ And.java 2001/12/21 14:21:20 1.3
@@ -7,6 +7,7 @@
*/
package org.apache.tools.ant.taskdefs.condition;
+import java.util.Iterator;
import java.util.Enumeration;
import org.apache.myrmidon.api.TaskException;
@@ -17,7 +18,7 @@
* false.</p>
*
* @author <a href="mailto:[EMAIL PROTECTED]">Stefan Bodewig</a>
- * @version $Revision: 1.2 $
+ * @version $Revision: 1.3 $
*/
public class And extends ConditionBase implements Condition
{
1.3 +17 -16
jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/condition/ConditionBase.java
Index: ConditionBase.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/condition/ConditionBase.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- ConditionBase.java 2001/12/16 00:38:31 1.2
+++ ConditionBase.java 2001/12/21 14:21:20 1.3
@@ -7,9 +7,10 @@
*/
package org.apache.tools.ant.taskdefs.condition;
-import java.util.Enumeration;
+import java.util.Iterator;
import java.util.NoSuchElementException;
-import java.util.Vector;
+import java.util.ArrayList;
+import java.util.Enumeration;
import org.apache.myrmidon.framework.Os;
import org.apache.tools.ant.ProjectComponent;
import org.apache.tools.ant.taskdefs.Available;
@@ -22,11 +23,11 @@
* conditions are in sync.
*
* @author <a href="mailto:[EMAIL PROTECTED]">Stefan Bodewig</a>
- * @version $Revision: 1.2 $
+ * @version $Revision: 1.3 $
*/
public abstract class ConditionBase extends ProjectComponent
{
- private Vector conditions = new Vector();
+ private ArrayList conditions = new ArrayList();
/**
* Add an <and> condition "container".
@@ -36,7 +37,7 @@
*/
public void addAnd( And a )
{
- conditions.addElement( a );
+ conditions.add( a );
}
/**
@@ -47,7 +48,7 @@
*/
public void addAvailable( Available a )
{
- conditions.addElement( a );
+ conditions.add( a );
}
/**
@@ -58,7 +59,7 @@
*/
public void addChecksum( Checksum c )
{
- conditions.addElement( c );
+ conditions.add( c );
}
/**
@@ -69,7 +70,7 @@
*/
public void addEquals( Equals e )
{
- conditions.addElement( e );
+ conditions.add( e );
}
/**
@@ -80,7 +81,7 @@
*/
public void addHttp( Http h )
{
- conditions.addElement( h );
+ conditions.add( h );
}
/**
@@ -91,7 +92,7 @@
*/
public void addIsSet( IsSet i )
{
- conditions.addElement( i );
+ conditions.add( i );
}
/**
@@ -102,7 +103,7 @@
*/
public void addNot( Not n )
{
- conditions.addElement( n );
+ conditions.add( n );
}
/**
@@ -113,7 +114,7 @@
*/
public void addOr( Or o )
{
- conditions.addElement( o );
+ conditions.add( o );
}
/**
@@ -124,7 +125,7 @@
*/
public void addOs( Os o )
{
- conditions.addElement( o );
+ conditions.add( o );
}
/**
@@ -135,7 +136,7 @@
*/
public void addSocket( Socket s )
{
- conditions.addElement( s );
+ conditions.add( s );
}
/**
@@ -146,7 +147,7 @@
*/
public void addUptodate( UpToDate u )
{
- conditions.addElement( u );
+ conditions.add( u );
}
/**
@@ -193,7 +194,7 @@
Object o = null;
try
{
- o = conditions.elementAt( currentElement++ );
+ o = conditions.get( currentElement++ );
}
catch( ArrayIndexOutOfBoundsException e )
{
1.3 +2 -1
jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/condition/Or.java
Index: Or.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/condition/Or.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- Or.java 2001/12/16 00:38:31 1.2
+++ Or.java 2001/12/21 14:21:20 1.3
@@ -7,6 +7,7 @@
*/
package org.apache.tools.ant.taskdefs.condition;
+import java.util.Iterator;
import java.util.Enumeration;
import org.apache.myrmidon.api.TaskException;
@@ -17,7 +18,7 @@
* true.</p>
*
* @author <a href="mailto:[EMAIL PROTECTED]">Stefan Bodewig</a>
- * @version $Revision: 1.2 $
+ * @version $Revision: 1.3 $
*/
public class Or extends ConditionBase implements Condition
{
1.6 +18 -20
jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/exec/Execute.java
Index: Execute.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/exec/Execute.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- Execute.java 2001/12/21 13:21:21 1.5
+++ Execute.java 2001/12/21 14:21:20 1.6
@@ -13,17 +13,16 @@
import java.io.IOException;
import java.io.StringReader;
import java.util.Locale;
-import java.util.Vector;
+import java.util.ArrayList;
import org.apache.myrmidon.api.TaskException;
import org.apache.myrmidon.framework.Os;
import org.apache.myrmidon.framework.exec.CommandLauncher;
+import org.apache.myrmidon.framework.exec.ExecMetaData;
import org.apache.myrmidon.framework.exec.launchers.DefaultCommandLauncher;
import org.apache.myrmidon.framework.exec.launchers.MacCommandLauncher;
-import org.apache.myrmidon.framework.exec.launchers.WinNTCommandLauncher;
-import org.apache.myrmidon.framework.exec.launchers.ScriptCommandLauncher;
import org.apache.myrmidon.framework.exec.launchers.PerlCommandLauncher;
-import org.apache.myrmidon.framework.exec.ExecMetaData;
-import org.apache.myrmidon.framework.exec.launchers.ExecUtil;
+import org.apache.myrmidon.framework.exec.launchers.ScriptCommandLauncher;
+import org.apache.myrmidon.framework.exec.launchers.WinNTCommandLauncher;
import org.apache.tools.ant.Project;
import org.apache.tools.ant.Task;
import org.apache.tools.ant.types.Commandline;
@@ -43,7 +42,7 @@
protected static String c_antWorkingDirectory = System.getProperty(
"user.dir" );
private static CommandLauncher c_launcher;
private static CommandLauncher c_shellLauncher;
- private static Vector c_procEnvironment;
+ private static ArrayList c_procEnvironment;
/**
* Used to destroy processes when the VM exits.
@@ -103,7 +102,7 @@
c_shellLauncher = new ScriptCommandLauncher(
"bin/antRun.bat" );
}
}
- else if( (new Os( "netware" )).eval() )
+ else if( ( new Os( "netware" ) ).eval() )
{
// NetWare. Need to determine which JDK we're running in
c_shellLauncher = new PerlCommandLauncher( "bin/antRun.pl" );
@@ -159,13 +158,13 @@
*
* @return The ProcEnvironment value
*/
- public static synchronized Vector getProcEnvironment()
+ public static synchronized ArrayList getProcEnvironment()
throws TaskException
{
if( c_procEnvironment != null )
return c_procEnvironment;
- c_procEnvironment = new Vector();
+ c_procEnvironment = new ArrayList();
try
{
ByteArrayOutputStream out = new ByteArrayOutputStream();
@@ -184,7 +183,7 @@
String var = null;
String line;
String lineSep = System.getProperty( "line.separator" );
- while( (line = in.readLine()) != null )
+ while( ( line = in.readLine() ) != null )
{
if( line.indexOf( '=' ) == -1 )
{
@@ -204,13 +203,13 @@
// New env var...append the previous one if we have it.
if( var != null )
{
- c_procEnvironment.addElement( var );
+ c_procEnvironment.add( var );
}
var = line;
}
}
// Since we "look ahead" before adding, there's one last env var.
- c_procEnvironment.addElement( var );
+ c_procEnvironment.add( var );
}
catch( IOException exc )
{
@@ -494,7 +493,7 @@
private String[] patchEnvironment()
throws TaskException
{
- Vector osEnv = (Vector)getProcEnvironment().clone();
+ ArrayList osEnv = (ArrayList)getProcEnvironment().clone();
for( int i = 0; i < m_environment.length; i++ )
{
int pos = m_environment[ i ].indexOf( '=' );
@@ -503,17 +502,16 @@
int size = osEnv.size();
for( int j = 0; j < size; j++ )
{
- if( ((String)osEnv.elementAt( j )).startsWith( key ) )
+ if( ( (String)osEnv.get( j ) ).startsWith( key ) )
{
- osEnv.removeElementAt( j );
+ osEnv.remove( j );
break;
}
}
- osEnv.addElement( m_environment[ i ] );
+ osEnv.add( m_environment[ i ] );
}
- String[] result = new String[ osEnv.size() ];
- osEnv.copyInto( result );
- return result;
- }
+ final String[] result = new String[ osEnv.size() ];
+ return (String[])osEnv.toArray( result );
+ }
}
1.2 +8 -8
jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/exec/ProcessDestroyer.java
Index: ProcessDestroyer.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/exec/ProcessDestroyer.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- ProcessDestroyer.java 2001/12/17 09:49:30 1.1
+++ ProcessDestroyer.java 2001/12/21 14:21:20 1.2
@@ -8,8 +8,8 @@
package org.apache.tools.ant.taskdefs.exec;
import java.lang.reflect.Method;
-import java.util.Enumeration;
-import java.util.Vector;
+import java.util.Iterator;
+import java.util.ArrayList;
/**
* Destroys all registered <code>Process</code>es when the VM exits.
@@ -20,7 +20,7 @@
extends Thread
{
- private Vector processes = new Vector();
+ private ArrayList processes = new ArrayList();
/**
* Constructs a <code>ProcessDestroyer</code> and registers it as a
shutdown
@@ -57,7 +57,7 @@
*/
public boolean add( Process process )
{
- processes.addElement( process );
+ processes.add( process );
return processes.contains( process );
}
@@ -71,7 +71,7 @@
*/
public boolean remove( Process process )
{
- return processes.removeElement( process );
+ return processes.remove( process );
}
/**
@@ -81,10 +81,10 @@
{
synchronized( processes )
{
- Enumeration e = processes.elements();
- while( e.hasMoreElements() )
+ Iterator e = processes.iterator();
+ while( e.hasNext() )
{
- ( (Process)e.nextElement() ).destroy();
+ ( (Process)e.next() ).destroy();
}
}
}
1.5 +14 -13
jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/file/Copy.java
Index: Copy.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/file/Copy.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- Copy.java 2001/12/21 13:34:16 1.4
+++ Copy.java 2001/12/21 14:21:20 1.5
@@ -10,9 +10,10 @@
import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
-import java.util.Enumeration;
+import java.util.Iterator;
import java.util.Hashtable;
-import java.util.Vector;
+import java.util.ArrayList;
+import java.util.Enumeration;
import org.apache.avalon.excalibur.io.FileUtil;
import org.apache.myrmidon.api.TaskException;
import org.apache.tools.ant.DirectoryScanner;
@@ -49,7 +50,7 @@
private File m_file;// the source file
private File m_destFile;// the destination file
private File m_destDir;// the destination directory
- private Vector m_filesets = new Vector();
+ private ArrayList m_filesets = new ArrayList();
private boolean m_filtering;
private boolean m_preserveLastModified;
@@ -63,7 +64,7 @@
private Hashtable m_completeDirMap = new Hashtable();
private Mapper m_mapperElement;
- private Vector m_filterSets = new Vector();
+ private ArrayList m_filterSets = new ArrayList();
/**
* Sets a single source file to copy.
@@ -172,7 +173,7 @@
*/
public void addFileset( final FileSet set )
{
- m_filesets.addElement( set );
+ m_filesets.add( set );
}
/**
@@ -183,7 +184,7 @@
public FilterSet createFilterSet()
{
final FilterSet filterSet = new FilterSet();
- m_filterSets.addElement( filterSet );
+ m_filterSets.add( filterSet );
return filterSet;
}
@@ -248,7 +249,7 @@
// deal with the filesets
for( int i = 0; i < m_filesets.size(); i++ )
{
- final FileSet fileSet = (FileSet)m_filesets.elementAt( i );
+ final FileSet fileSet = (FileSet)m_filesets.get( i );
final DirectoryScanner scanner = fileSet.getDirectoryScanner(
getProject() );
final File fromDir = fileSet.getDir( getProject() );
@@ -280,7 +281,7 @@
*
* @return a vector of FilterSet objects
*/
- protected Vector getFilterSets()
+ protected ArrayList getFilterSets()
{
return m_filterSets;
}
@@ -422,9 +423,9 @@
executionFilters.addFilterSet( getProject().getGlobalFilterSet()
);
}
- for( final Enumeration filterEnum = m_filterSets.elements();
filterEnum.hasMoreElements(); )
+ for( final Iterator filterEnum = m_filterSets.iterator();
filterEnum.hasNext(); )
{
- executionFilters.addFilterSet(
(FilterSet)filterEnum.nextElement() );
+ executionFilters.addFilterSet( (FilterSet)filterEnum.next() );
}
return executionFilters;
}
@@ -505,7 +506,7 @@
}
else
{
- FileSet fs = (FileSet)m_filesets.elementAt( 0 );
+ FileSet fs = (FileSet)m_filesets.get( 0 );
DirectoryScanner ds = fs.getDirectoryScanner( getProject() );
String[] srcFiles = ds.getIncludedFiles();
@@ -514,7 +515,7 @@
if( m_file == null )
{
m_file = new File( srcFiles[ 0 ] );
- m_filesets.removeElementAt( 0 );
+ m_filesets.remove( 0 );
}
else
{
@@ -536,7 +537,7 @@
}
}
- protected Vector getFilesets()
+ protected ArrayList getFilesets()
{
return m_filesets;
}
1.4 +4 -4
jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/file/Delete.java
Index: Delete.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/file/Delete.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- Delete.java 2001/12/21 13:34:16 1.3
+++ Delete.java 2001/12/21 14:21:20 1.4
@@ -8,7 +8,7 @@
package org.apache.tools.ant.taskdefs.file;
import java.io.File;
-import java.util.Vector;
+import java.util.ArrayList;
import org.apache.myrmidon.api.TaskException;
import org.apache.tools.ant.DirectoryScanner;
import org.apache.tools.ant.Project;
@@ -38,7 +38,7 @@
{
protected File file = null;
protected File dir = null;
- protected Vector filesets = new Vector();
+ protected ArrayList filesets = new ArrayList();
protected boolean usedMatchingTask = false;
protected boolean includeEmpty = false;// by default, remove matching
empty dirs
@@ -192,7 +192,7 @@
*/
public void addFileset( FileSet set )
{
- filesets.addElement( set );
+ filesets.add( set );
}
/**
@@ -304,7 +304,7 @@
// delete the files in the filesets
for( int i = 0; i < filesets.size(); i++ )
{
- FileSet fs = (FileSet)filesets.elementAt( i );
+ FileSet fs = (FileSet)filesets.get( i );
try
{
DirectoryScanner ds = fs.getDirectoryScanner( getProject() );
1.5 +7 -5
jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/file/Move.java
Index: Move.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/file/Move.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- Move.java 2001/12/21 13:34:16 1.4
+++ Move.java 2001/12/21 14:21:20 1.5
@@ -9,6 +9,8 @@
import java.io.File;
import java.io.IOException;
+import java.util.Iterator;
+import java.util.Iterator;
import java.util.Enumeration;
import org.apache.avalon.excalibur.io.FileUtil;
import org.apache.myrmidon.api.TaskException;
@@ -153,9 +155,9 @@
{
executionFilters.addFilterSet(
getProject().getGlobalFilterSet() );
}
- for( Enumeration filterEnum =
getFilterSets().elements(); filterEnum.hasMoreElements(); )
+ for( Iterator filterEnum =
getFilterSets().iterator(); filterEnum.hasNext(); )
{
- executionFilters.addFilterSet(
(FilterSet)filterEnum.nextElement() );
+ executionFilters.addFilterSet(
(FilterSet)filterEnum.next() );
}
if( isForceOverwrite() )
@@ -211,10 +213,10 @@
if( getFilesets().size() > 0 )
{
- Enumeration e = getFilesets().elements();
- while( e.hasMoreElements() )
+ Iterator e = getFilesets().iterator();
+ while( e.hasNext() )
{
- FileSet fs = (FileSet)e.nextElement();
+ FileSet fs = (FileSet)e.next();
File dir = fs.getDir( getProject() );
if( okToDelete( dir ) )
1.11 +17 -17
jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/Cab.java
Index: Cab.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/Cab.java,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -r1.10 -r1.11
--- Cab.java 2001/12/21 13:34:16 1.10
+++ Cab.java 2001/12/21 14:21:20 1.11
@@ -12,8 +12,8 @@
import java.io.IOException;
import java.io.OutputStream;
import java.io.PrintWriter;
-import java.util.Enumeration;
-import java.util.Vector;
+import java.util.Iterator;
+import java.util.ArrayList;
import org.apache.myrmidon.api.TaskException;
import org.apache.myrmidon.framework.Os;
import org.apache.tools.ant.DirectoryScanner;
@@ -31,7 +31,7 @@
public class Cab extends MatchingTask
{
- private Vector filesets = new Vector();
+ private ArrayList filesets = new ArrayList();
private boolean doCompress = true;
private boolean doVerbose = false;
@@ -99,7 +99,7 @@
*/
public void addFileset( FileSet set )
{
- filesets.addElement( set );
+ filesets.add( set );
}
public void execute()
@@ -108,7 +108,7 @@
checkConfiguration();
- Vector files = getFileList();
+ ArrayList files = getFileList();
// quick exit if the target is up to date
if( isUpToDate( files ) )
@@ -122,11 +122,11 @@
StringBuffer sb = new StringBuffer();
- Enumeration fileEnum = files.elements();
+ Iterator fileEnum = files.iterator();
- while( fileEnum.hasMoreElements() )
+ while( fileEnum.hasNext() )
{
- sb.append( fileEnum.nextElement() ).append( "\n" );
+ sb.append( fileEnum.next() ).append( "\n" );
}
sb.append( "\n" ).append( cabFile.getAbsolutePath() ).append(
"\n" );
@@ -188,10 +188,10 @@
* @return The FileList value
* @exception TaskException Description of Exception
*/
- protected Vector getFileList()
+ protected ArrayList getFileList()
throws TaskException
{
- Vector files = new Vector();
+ ArrayList files = new ArrayList();
if( filesets.size() == 0 )
{
@@ -203,7 +203,7 @@
// get files from filesets
for( int i = 0; i < filesets.size(); i++ )
{
- FileSet fs = (FileSet)filesets.elementAt( i );
+ FileSet fs = (FileSet)filesets.get( i );
if( fs != null )
{
appendFiles( files, fs.getDirectoryScanner( getProject()
) );
@@ -220,12 +220,12 @@
* @param files Description of Parameter
* @return true if the cab file is newer than its dependents.
*/
- protected boolean isUpToDate( Vector files )
+ protected boolean isUpToDate( ArrayList files )
{
boolean upToDate = true;
for( int i = 0; i < files.size() && upToDate; i++ )
{
- String file = files.elementAt( i ).toString();
+ String file = files.get( i ).toString();
if( new File( baseDir, file ).lastModified() >
cabFile.lastModified() )
upToDate = false;
@@ -239,13 +239,13 @@
* @param files Description of Parameter
* @param ds Description of Parameter
*/
- protected void appendFiles( Vector files, DirectoryScanner ds )
+ protected void appendFiles( ArrayList files, DirectoryScanner ds )
{
String[] dsfiles = ds.getIncludedFiles();
for( int i = 0; i < dsfiles.length; i++ )
{
- files.addElement( dsfiles[ i ] );
+ files.add( dsfiles[ i ] );
}
}
@@ -321,7 +321,7 @@
* @return Description of the Returned Value
* @exception IOException Description of Exception
*/
- protected File createListFile( Vector files )
+ protected File createListFile( ArrayList files )
throws IOException
{
File listFile = File.createTempFile( "ant", "", getBaseDirectory() );
@@ -330,7 +330,7 @@
for( int i = 0; i < files.size(); i++ )
{
- writer.println( files.elementAt( i ).toString() );
+ writer.println( files.get( i ).toString() );
}
writer.close();
1.6 +7 -7
jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/Javah.java
Index: Javah.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/Javah.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- Javah.java 2001/12/21 13:34:17 1.5
+++ Javah.java 2001/12/21 14:21:20 1.6
@@ -8,9 +8,9 @@
package org.apache.tools.ant.taskdefs.optional;
import java.io.File;
-import java.util.Enumeration;
+import java.util.Iterator;
import java.util.StringTokenizer;
-import java.util.Vector;
+import java.util.ArrayList;
import org.apache.myrmidon.api.TaskException;
import org.apache.tools.ant.Project;
import org.apache.tools.ant.Task;
@@ -59,7 +59,7 @@
//private Path extdirs;
private static String lSep = System.getProperty( "line.separator" );
- private Vector classes = new Vector( 2 );
+ private ArrayList classes = new ArrayList( 2 );
private Path classpath = null;
private File outputFile = null;
private boolean verbose = false;
@@ -214,7 +214,7 @@
public ClassArgument createClass()
{
ClassArgument ga = new ClassArgument();
- classes.addElement( ga );
+ classes.add( ga );
return ga;
}
@@ -306,10 +306,10 @@
}
}
- Enumeration enum = classes.elements();
- while( enum.hasMoreElements() )
+ Iterator enum = classes.iterator();
+ while( enum.hasNext() )
{
- ClassArgument arg = (ClassArgument)enum.nextElement();
+ ClassArgument arg = (ClassArgument)enum.next();
String aClass = arg.getName();
cmd.createArgument().setValue( aClass );
niceClassList.append( " " + aClass + lSep );
1.5 +14 -14
jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/ManifestFile.java
Index: ManifestFile.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/ManifestFile.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- ManifestFile.java 2001/12/16 05:44:55 1.4
+++ ManifestFile.java 2001/12/21 14:21:20 1.5
@@ -14,10 +14,10 @@
import java.io.IOException;
import java.util.ArrayList;
import java.util.Comparator;
-import java.util.Enumeration;
+import java.util.Iterator;
import java.util.ListIterator;
import java.util.StringTokenizer;
-import java.util.Vector;
+import java.util.ArrayList;
import org.apache.myrmidon.api.TaskException;
import org.apache.tools.ant.Task;
@@ -41,13 +41,13 @@
private final static String REPLACEALL_ = "replaceAll";
private EntryContainer container;
private String currentMethod;
- private Vector entries;
+ private ArrayList entries;
private File manifestFile;
public ManifestFile()
{
- entries = new Vector();
+ entries = new ArrayList();
container = new EntryContainer();
}
@@ -79,7 +79,7 @@
public Entry createEntry()
{
Entry entry = new Entry();
- entries.addElement( entry );
+ entries.add( entry );
return entry;
}
@@ -128,7 +128,7 @@
{
StringBuffer buffer = new StringBuffer();
- ListIterator iterator = container.elements();
+ ListIterator iterator = container.iterator();
while( iterator.hasNext() )
{
@@ -171,11 +171,11 @@
private void executeOperation()
throws TaskException
{
- Enumeration enum = entries.elements();
+ Iterator enum = entries.iterator();
- while( enum.hasMoreElements() )
+ while( enum.hasNext() )
{
- Entry entry = (Entry)enum.nextElement();
+ Entry entry = (Entry)enum.next();
entry.addTo( container );
}
}
@@ -209,9 +209,9 @@
}
fis.close();
StringTokenizer lineTokens = getLineTokens( buffer );
- while( lineTokens.hasMoreElements() )
+ while( lineTokens.hasNext() )
{
- String currentLine =
(String)lineTokens.nextElement();
+ String currentLine = (String)lineTokens.next();
addLine( currentLine );
}
}
@@ -352,8 +352,8 @@
private void split()
{
StringTokenizer st = new StringTokenizer( value,
ManifestFile.keyValueSeparator );
- key = (String)st.nextElement();
- val = (String)st.nextElement();
+ key = (String)st.next();
+ val = (String)st.next();
}
}
@@ -384,7 +384,7 @@
}
}
- public ListIterator elements()
+ public ListIterator iterator()
{
ListIterator iterator = list.listIterator();
return iterator;
1.6 +38 -38
jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/NetRexxC.java
Index: NetRexxC.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/NetRexxC.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- NetRexxC.java 2001/12/17 10:47:19 1.5
+++ NetRexxC.java 2001/12/21 14:21:20 1.6
@@ -11,11 +11,11 @@
import java.io.IOException;
import java.io.PrintWriter;
import java.io.StringWriter;
-import java.util.Enumeration;
+import java.util.Iterator;
import java.util.Hashtable;
import java.util.Properties;
import java.util.StringTokenizer;
-import java.util.Vector;
+import java.util.ArrayList;
import netrexx.lang.Rexx;
import org.apache.avalon.excalibur.io.FileUtil;
import org.apache.myrmidon.api.TaskException;
@@ -84,7 +84,7 @@
private String verbose = "verbose3";
// other implementation variables
- private Vector compileList = new Vector();
+ private ArrayList compileList = new ArrayList();
private Hashtable filecopyList = new Hashtable();
private String oldClasspath = System.getProperty( "java.class.path" );
@@ -539,33 +539,33 @@
*/
private String[] getCompileOptionsAsArray()
{
- Vector options = new Vector();
- options.addElement( binary ? "-binary" : "-nobinary" );
- options.addElement( comments ? "-comments" : "-nocomments" );
- options.addElement( compile ? "-compile" : "-nocompile" );
- options.addElement( compact ? "-compact" : "-nocompact" );
- options.addElement( console ? "-console" : "-noconsole" );
- options.addElement( crossref ? "-crossref" : "-nocrossref" );
- options.addElement( decimal ? "-decimal" : "-nodecimal" );
- options.addElement( diag ? "-diag" : "-nodiag" );
- options.addElement( explicit ? "-explicit" : "-noexplicit" );
- options.addElement( format ? "-format" : "-noformat" );
- options.addElement( keep ? "-keep" : "-nokeep" );
- options.addElement( logo ? "-logo" : "-nologo" );
- options.addElement( replace ? "-replace" : "-noreplace" );
- options.addElement( savelog ? "-savelog" : "-nosavelog" );
- options.addElement( sourcedir ? "-sourcedir" : "-nosourcedir" );
- options.addElement( strictargs ? "-strictargs" : "-nostrictargs" );
- options.addElement( strictassign ? "-strictassign" :
"-nostrictassign" );
- options.addElement( strictcase ? "-strictcase" : "-nostrictcase" );
- options.addElement( strictimport ? "-strictimport" :
"-nostrictimport" );
- options.addElement( strictprops ? "-strictprops" : "-nostrictprops"
);
- options.addElement( strictsignal ? "-strictsignal" :
"-nostrictsignal" );
- options.addElement( symbols ? "-symbols" : "-nosymbols" );
- options.addElement( time ? "-time" : "-notime" );
- options.addElement( "-" + trace );
- options.addElement( utf8 ? "-utf8" : "-noutf8" );
- options.addElement( "-" + verbose );
+ ArrayList options = new ArrayList();
+ options.add( binary ? "-binary" : "-nobinary" );
+ options.add( comments ? "-comments" : "-nocomments" );
+ options.add( compile ? "-compile" : "-nocompile" );
+ options.add( compact ? "-compact" : "-nocompact" );
+ options.add( console ? "-console" : "-noconsole" );
+ options.add( crossref ? "-crossref" : "-nocrossref" );
+ options.add( decimal ? "-decimal" : "-nodecimal" );
+ options.add( diag ? "-diag" : "-nodiag" );
+ options.add( explicit ? "-explicit" : "-noexplicit" );
+ options.add( format ? "-format" : "-noformat" );
+ options.add( keep ? "-keep" : "-nokeep" );
+ options.add( logo ? "-logo" : "-nologo" );
+ options.add( replace ? "-replace" : "-noreplace" );
+ options.add( savelog ? "-savelog" : "-nosavelog" );
+ options.add( sourcedir ? "-sourcedir" : "-nosourcedir" );
+ options.add( strictargs ? "-strictargs" : "-nostrictargs" );
+ options.add( strictassign ? "-strictassign" : "-nostrictassign" );
+ options.add( strictcase ? "-strictcase" : "-nostrictcase" );
+ options.add( strictimport ? "-strictimport" : "-nostrictimport" );
+ options.add( strictprops ? "-strictprops" : "-nostrictprops" );
+ options.add( strictsignal ? "-strictsignal" : "-nostrictsignal" );
+ options.add( symbols ? "-symbols" : "-nosymbols" );
+ options.add( time ? "-time" : "-notime" );
+ options.add( "-" + trace );
+ options.add( utf8 ? "-utf8" : "-noutf8" );
+ options.add( "-" + verbose );
String[] results = new String[ options.size() ];
options.copyInto( results );
return results;
@@ -613,10 +613,10 @@
getLogger().info( "Copying " + filecopyList.size() + " file"
+ ( filecopyList.size() == 1 ? "" : "s" )
+ " to " + destDir.getAbsolutePath() );
- Enumeration enum = filecopyList.keys();
- while( enum.hasMoreElements() )
+ Iterator enum = filecopyList.keys();
+ while( enum.hasNext() )
{
- String fromFile = (String)enum.nextElement();
+ String fromFile = (String)enum.next();
String toFile = (String)filecopyList.get( fromFile );
try
{
@@ -649,11 +649,11 @@
// comes from the compile options, the other from the compileList
String[] compileOptionsArray = getCompileOptionsAsArray();
String[] fileListArray = new String[ compileList.size() ];
- Enumeration e = compileList.elements();
+ Iterator e = compileList.iterator();
int j = 0;
- while( e.hasMoreElements() )
+ while( e.hasNext() )
{
- fileListArray[ j ] = (String)e.nextElement();
+ fileListArray[ j ] = (String)e.next();
j++;
}
// create a single array of arguments for the compiler
@@ -682,7 +682,7 @@
for( int i = 0; i < compileList.size(); i++ )
{
niceSourceList.append( " " );
- niceSourceList.append( compileList.elementAt( i ).toString() );
+ niceSourceList.append( compileList.get( i ).toString() );
niceSourceList.append( eol );
}
@@ -752,7 +752,7 @@
if( !compile || srcFile.lastModified() >
classFile.lastModified() )
{
filecopyList.put( srcFile.getAbsolutePath(),
destFile.getAbsolutePath() );
- compileList.addElement( destFile.getAbsolutePath() );
+ compileList.add( destFile.getAbsolutePath() );
}
}
else
1.5 +6 -6
jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/PropertyFile.java
Index: PropertyFile.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/PropertyFile.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- PropertyFile.java 2001/12/16 05:44:55 1.4
+++ PropertyFile.java 2001/12/21 14:21:20 1.5
@@ -22,10 +22,10 @@
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;
-import java.util.Enumeration;
+import java.util.Iterator;
import java.util.GregorianCalendar;
import java.util.Properties;
-import java.util.Vector;
+import java.util.ArrayList;
import org.apache.myrmidon.api.TaskException;
import org.apache.tools.ant.Task;
import org.apache.tools.ant.types.EnumeratedAttribute;
@@ -138,7 +138,7 @@
*/
private final static String NEWLINE = System.getProperty(
"line.separator" );
- private Vector entries = new Vector();
+ private ArrayList entries = new ArrayList();
/*
*
========================================================================
@@ -164,7 +164,7 @@
public Entry createEntry()
{
Entry e = new Entry();
- entries.addElement( e );
+ entries.add( e );
return e;
}
@@ -212,9 +212,9 @@
private void executeOperation()
throws TaskException
{
- for( Enumeration e = entries.elements(); e.hasMoreElements(); )
+ for( Iterator e = entries.iterator(); e.hasNext(); )
{
- Entry entry = (Entry)e.nextElement();
+ Entry entry = (Entry)e.next();
entry.executeOn( m_properties );
}
}
1.6 +5 -5
jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/ReplaceRegExp.java
Index: ReplaceRegExp.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/ReplaceRegExp.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- ReplaceRegExp.java 2001/12/21 13:34:17 1.5
+++ ReplaceRegExp.java 2001/12/21 14:21:20 1.6
@@ -15,7 +15,7 @@
import java.io.IOException;
import java.io.LineNumberReader;
import java.io.PrintWriter;
-import java.util.Vector;
+import java.util.ArrayList;
import org.apache.myrmidon.api.TaskException;
import org.apache.tools.ant.DirectoryScanner;
import org.apache.tools.ant.Project;
@@ -75,7 +75,7 @@
private boolean byline;
private File file;
- private Vector filesets;
+ private ArrayList filesets;
private String flags;// Keep jdk 1.1 compliant so others can use this
private RegularExpression regex;
private Substitution subs;
@@ -87,7 +87,7 @@
{
super();
this.file = null;
- this.filesets = new Vector();
+ this.filesets = new ArrayList();
this.flags = "";
this.byline = false;
@@ -135,7 +135,7 @@
public void addFileset( FileSet set )
{
- filesets.addElement( set );
+ filesets.add( set );
}
public RegularExpression createRegularExpression()
@@ -204,7 +204,7 @@
int sz = filesets.size();
for( int i = 0; i < sz; i++ )
{
- FileSet fs = (FileSet)( filesets.elementAt( i ) );
+ FileSet fs = (FileSet)( filesets.get( i ) );
DirectoryScanner ds = fs.getDirectoryScanner( getProject() );
String files[] = ds.getIncludedFiles();
1.7 +5 -5
jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/Script.java
Index: Script.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/Script.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- Script.java 2001/12/21 13:34:17 1.6
+++ Script.java 2001/12/21 14:21:20 1.7
@@ -12,7 +12,7 @@
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
-import java.util.Enumeration;
+import java.util.Iterator;
import java.util.Hashtable;
import org.apache.myrmidon.api.TaskException;
import org.apache.tools.ant.Task;
@@ -95,9 +95,9 @@
BSFManager manager = new BSFManager();
- for( Enumeration e = beans.keys(); e.hasMoreElements(); )
+ for( Iterator e = beans.keys(); e.hasNext(); )
{
- String key = (String)e.nextElement();
+ String key = (String)e.next();
Object value = beans.get( key );
manager.declareBean( key, value, value.getClass() );
}
@@ -131,9 +131,9 @@
*/
private void addBeans( Hashtable dictionary )
{
- for( Enumeration e = dictionary.keys(); e.hasMoreElements(); )
+ for( Iterator e = dictionary.keys(); e.hasNext(); )
{
- String key = (String)e.nextElement();
+ String key = (String)e.next();
boolean isValid = key.length() > 0 &&
Character.isJavaIdentifierStart( key.charAt( 0 ) );
1.3 +4 -4
jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/depend/ClassFile.java
Index: ClassFile.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/depend/ClassFile.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- ClassFile.java 2001/12/16 00:37:19 1.2
+++ ClassFile.java 2001/12/21 14:21:21 1.3
@@ -10,7 +10,7 @@
import java.io.DataInputStream;
import java.io.IOException;
import java.io.InputStream;
-import java.util.Vector;
+import java.util.ArrayList;
import
org.apache.tools.ant.taskdefs.optional.depend.constantpool.ClassCPInfo;
import
org.apache.tools.ant.taskdefs.optional.depend.constantpool.ConstantPool;
import
org.apache.tools.ant.taskdefs.optional.depend.constantpool.ConstantPoolEntry;
@@ -46,10 +46,10 @@
*
* @return The ClassRefs value
*/
- public Vector getClassRefs()
+ public ArrayList getClassRefs()
{
- Vector classRefs = new Vector();
+ ArrayList classRefs = new ArrayList();
for( int i = 0; i < constantPool.size(); ++i )
{
@@ -61,7 +61,7 @@
if( !classEntry.getClassName().equals( className ) )
{
- classRefs.addElement( ClassFileUtils.convertSlashName(
classEntry.getClassName() ) );
+ classRefs.add( ClassFileUtils.convertSlashName(
classEntry.getClassName() ) );
}
}
}
1.7 +20 -19
jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/depend/Depend.java
Index: Depend.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/depend/Depend.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- Depend.java 2001/12/21 13:34:17 1.6
+++ Depend.java 2001/12/21 14:21:21 1.7
@@ -15,9 +15,10 @@
import java.io.IOException;
import java.io.PrintWriter;
import java.net.URL;
+import java.util.ArrayList;
import java.util.Enumeration;
import java.util.Hashtable;
-import java.util.Vector;
+import java.util.Iterator;
import org.apache.myrmidon.api.TaskException;
import org.apache.tools.ant.AntClassLoader;
import org.apache.tools.ant.DirectoryScanner;
@@ -361,13 +362,13 @@
* where classes can be found.
* @return a vector containing the classes to analyse.
*/
- private Vector getClassFiles( Path classLocations )
+ private ArrayList getClassFiles( Path classLocations )
throws TaskException
{
// break the classLocations into its components.
String[] classLocationsList = classLocations.list();
- Vector classFileList = new Vector();
+ ArrayList classFileList = new ArrayList();
for( int i = 0; i < classLocationsList.length; ++i )
{
@@ -389,7 +390,7 @@
* @param dir The feature to be added to the ClassFiles attribute
* @param root The feature to be added to the ClassFiles attribute
*/
- private void addClassFiles( Vector classFileList, File dir, File root )
+ private void addClassFiles( ArrayList classFileList, File dir, File root
)
{
String[] filesInDir = dir.list();
@@ -411,7 +412,7 @@
info.relativeName = file.getPath().substring(
root.getPath().length() + 1,
file.getPath().length() - 6 );
info.className = ClassFileUtils.convertSlashName(
info.relativeName );
- classFileList.addElement( info );
+ classFileList.add( info );
}
}
}
@@ -515,13 +516,13 @@
depCacheFileExists = depCacheFile.exists();
depCacheFileLastModified = depCacheFile.lastModified();
}
- for( Enumeration e = getClassFiles( destPath ).elements();
e.hasMoreElements(); )
+ for( Iterator e = getClassFiles( destPath ).iterator(); e.hasNext();
)
{
- ClassFileInfo info = (ClassFileInfo)e.nextElement();
+ ClassFileInfo info = (ClassFileInfo)e.next();
log( "Adding class info for " + info.className,
Project.MSG_DEBUG );
classFileInfoMap.put( info.className, info );
- Vector dependencyList = null;
+ ArrayList dependencyList = null;
if( cache != null )
{
@@ -530,7 +531,7 @@
{
// depFile exists and is newer than the class file
// need to get dependency list from the map.
- dependencyList = (Vector)dependencyMap.get(
info.className );
+ dependencyList = (ArrayList)dependencyMap.get(
info.className );
}
}
@@ -563,9 +564,9 @@
// This class depends on each class in the dependency list. For
each
// one of those, add this class into their affected classes list
- for( Enumeration depEnum = dependencyList.elements();
depEnum.hasMoreElements(); )
+ for( Iterator depEnum = dependencyList.iterator();
depEnum.hasNext(); )
{
- String dependentClass = (String)depEnum.nextElement();
+ String dependentClass = (String)depEnum.next();
Hashtable affectedClasses = (Hashtable)affectedClassMap.get(
dependentClass );
if( affectedClasses == null )
@@ -590,12 +591,12 @@
for( Enumeration e = dependencyMap.keys(); e.hasMoreElements(); )
{
String className = (String)e.nextElement();
- Vector dependencyList = (Vector)dependencyMap.get( className
);
+ ArrayList dependencyList = (ArrayList)dependencyMap.get(
className );
Hashtable dependencies = new Hashtable();
classpathDependencies.put( className, dependencies );
- for( Enumeration e2 = dependencyList.elements();
e2.hasMoreElements(); )
+ for( Iterator e2 = dependencyList.iterator(); e2.hasNext(); )
{
- String dependency = (String)e2.nextElement();
+ String dependency = (String)e2.next();
Object classpathFileObject = classpathFileCache.get(
dependency );
if( classpathFileObject == null )
{
@@ -666,20 +667,20 @@
{
in = new BufferedReader( new FileReader( depFile ) );
String line = null;
- Vector dependencyList = null;
+ ArrayList dependencyList = null;
String className = null;
int prependLength = CLASSNAME_PREPEND.length();
while( ( line = in.readLine() ) != null )
{
if( line.startsWith( CLASSNAME_PREPEND ) )
{
- dependencyList = new Vector();
+ dependencyList = new ArrayList();
className = line.substring( prependLength );
dependencyMap.put( className, dependencyList );
}
else
{
- dependencyList.addElement( line );
+ dependencyList.add( line );
}
}
}
@@ -720,11 +721,11 @@
pw.println( CLASSNAME_PREPEND + className );
- Vector dependencyList = (Vector)dependencyMap.get(
className );
+ ArrayList dependencyList = (ArrayList)dependencyMap.get(
className );
int size = dependencyList.size();
for( int x = 0; x < size; x++ )
{
- pw.println( dependencyList.elementAt( x ) );
+ pw.println( dependencyList.get( x ) );
}
}
}
1.3 +18 -18
jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/depend/DirectoryIterator.java
Index: DirectoryIterator.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/depend/DirectoryIterator.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- DirectoryIterator.java 2001/12/16 00:37:19 1.2
+++ DirectoryIterator.java 2001/12/21 14:21:21 1.3
@@ -10,9 +10,9 @@
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
-import java.util.Enumeration;
+import java.util.Iterator;
import java.util.Stack;
-import java.util.Vector;
+import java.util.ArrayList;
/**
* An iterator which iterates through the contents of a java directory. The
@@ -36,7 +36,7 @@
* new iterator over the sub directory becomes the current directory.
This
* implements a depth first traversal of the directory namespace.
*/
- private Enumeration currentEnum;
+ private Iterator currentEnum;
/**
* This is a stack of current iterators supporting the depth first
traversal
@@ -74,9 +74,9 @@
rootLength = 0;
}
- Vector filesInRoot = getDirectoryEntries( rootDirectory );
+ ArrayList filesInRoot = getDirectoryEntries( rootDirectory );
- currentEnum = filesInRoot.elements();
+ currentEnum = filesInRoot.iterator();
}
/**
@@ -94,15 +94,15 @@
*/
public ClassFile getNextClassFile()
{
- ClassFile nextElement = null;
+ ClassFile next = null;
try
{
- while( nextElement == null )
+ while( next == null )
{
- if( currentEnum.hasMoreElements() )
+ if( currentEnum.hasNext() )
{
- File element = (File)currentEnum.nextElement();
+ File element = (File)currentEnum.next();
if( element.isDirectory() )
{
@@ -111,9 +111,9 @@
// iterate through this directory.
enumStack.push( currentEnum );
- Vector files = getDirectoryEntries( element );
+ ArrayList files = getDirectoryEntries( element );
- currentEnum = files.elements();
+ currentEnum = files.iterator();
}
else
{
@@ -129,7 +129,7 @@
javaClass.read( inFileStream );
- nextElement = javaClass;
+ next = javaClass;
}
}
}
@@ -142,17 +142,17 @@
}
else
{
- currentEnum = (Enumeration)enumStack.pop();
+ currentEnum = (Iterator)enumStack.pop();
}
}
}
}
catch( IOException e )
{
- nextElement = null;
+ next = null;
}
- return nextElement;
+ return next;
}
/**
@@ -162,9 +162,9 @@
* @param directory the directory to be scanned.
* @return a vector containing File objects for each entry in the
directory.
*/
- private Vector getDirectoryEntries( File directory )
+ private ArrayList getDirectoryEntries( File directory )
{
- Vector files = new Vector();
+ ArrayList files = new ArrayList();
// File[] filesInDir = directory.listFiles();
String[] filesInDir = directory.list();
@@ -175,7 +175,7 @@
for( int i = 0; i < length; ++i )
{
- files.addElement( new File( directory, filesInDir[ i ] ) );
+ files.add( new File( directory, filesInDir[ i ] ) );
}
}
1.3 +4 -4
jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/depend/JarFileIterator.java
Index: JarFileIterator.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/depend/JarFileIterator.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- JarFileIterator.java 2001/12/16 00:37:19 1.2
+++ JarFileIterator.java 2001/12/21 14:21:21 1.3
@@ -33,13 +33,13 @@
public ClassFile getNextClassFile()
{
ZipEntry jarEntry;
- ClassFile nextElement = null;
+ ClassFile next = null;
try
{
jarEntry = jarStream.getNextEntry();
- while( nextElement == null && jarEntry != null )
+ while( next == null && jarEntry != null )
{
String entryName = jarEntry.getName();
@@ -51,7 +51,7 @@
javaClass.read( jarStream );
- nextElement = javaClass;
+ next = javaClass;
}
else
{
@@ -73,7 +73,7 @@
throw new RuntimeException( "Problem reading JAR file: " + text
);
}
- return nextElement;
+ return next;
}
private byte[] getEntryBytes( InputStream stream )
1.3 +16 -16
jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/depend/constantpool/ConstantPool.java
Index: ConstantPool.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/depend/constantpool/ConstantPool.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- ConstantPool.java 2001/12/16 00:37:19 1.2
+++ ConstantPool.java 2001/12/21 14:21:21 1.3
@@ -9,9 +9,9 @@
import java.io.DataInputStream;
import java.io.IOException;
-import java.util.Enumeration;
+import java.util.Iterator;
import java.util.Hashtable;
-import java.util.Vector;
+import java.util.ArrayList;
/**
* The constant pool of a Java class. The constant pool is a collection of
@@ -28,7 +28,7 @@
/**
* The entries in the constant pool.
*/
- private Vector entries;
+ private ArrayList entries;
/**
* A Hashtable of UTF8 entries - used to get constant pool indexes of the
@@ -41,11 +41,11 @@
*/
public ConstantPool()
{
- entries = new Vector();
+ entries = new ArrayList();
// The zero index is never present in the constant pool itself so
// we add a null entry for it
- entries.addElement( null );
+ entries.add( null );
utf8Indexes = new Hashtable();
}
@@ -64,7 +64,7 @@
for( int i = 0; i < entries.size() && index == -1; ++i )
{
- Object element = entries.elementAt( i );
+ Object element = entries.get( i );
if( element instanceof ClassCPInfo )
{
@@ -93,7 +93,7 @@
for( int i = 0; i < entries.size() && index == -1; ++i )
{
- Object element = entries.elementAt( i );
+ Object element = entries.get( i );
if( element instanceof ConstantCPInfo )
{
@@ -117,7 +117,7 @@
*/
public ConstantPoolEntry getEntry( int index )
{
- return (ConstantPoolEntry)entries.elementAt( index );
+ return (ConstantPoolEntry)entries.get( index );
}
/**
@@ -136,7 +136,7 @@
for( int i = 0; i < entries.size() && index == -1; ++i )
{
- Object element = entries.elementAt( i );
+ Object element = entries.get( i );
if( element instanceof FieldRefCPInfo )
{
@@ -171,7 +171,7 @@
for( int i = 0; i < entries.size() && index == -1; ++i )
{
- Object element = entries.elementAt( i );
+ Object element = entries.get( i );
if( element instanceof InterfaceMethodRefCPInfo )
{
@@ -205,7 +205,7 @@
for( int i = 0; i < entries.size() && index == -1; ++i )
{
- Object element = entries.elementAt( i );
+ Object element = entries.get( i );
if( element instanceof MethodRefCPInfo )
{
@@ -236,7 +236,7 @@
for( int i = 0; i < entries.size() && index == -1; ++i )
{
- Object element = entries.elementAt( i );
+ Object element = entries.get( i );
if( element instanceof NameAndTypeCPInfo )
{
@@ -282,14 +282,14 @@
{
int index = entries.size();
- entries.addElement( entry );
+ entries.add( entry );
int numSlots = entry.getNumEntries();
// add null entries for any additional slots required.
for( int j = 0; j < numSlots - 1; ++j )
{
- entries.addElement( null );
+ entries.add( null );
}
if( entry instanceof Utf8CPInfo )
@@ -331,9 +331,9 @@
*/
public void resolve()
{
- for( Enumeration i = entries.elements(); i.hasMoreElements(); )
+ for( Iterator i = entries.iterator(); i.hasNext(); )
{
- ConstantPoolEntry poolInfo = (ConstantPoolEntry)i.nextElement();
+ ConstantPoolEntry poolInfo = (ConstantPoolEntry)i.next();
if( poolInfo != null && !poolInfo.isResolved() )
{
1.8 +2 -2
jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/ejb/BorlandDeploymentTool.java
Index: BorlandDeploymentTool.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/ejb/BorlandDeploymentTool.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- BorlandDeploymentTool.java 2001/12/17 09:50:12 1.7
+++ BorlandDeploymentTool.java 2001/12/21 14:21:21 1.8
@@ -15,7 +15,7 @@
import java.io.OutputStream;
import java.util.Hashtable;
import java.util.Iterator;
-import java.util.Vector;
+import java.util.ArrayList;
import org.apache.myrmidon.api.TaskException;
import org.apache.tools.ant.Project;
import org.apache.tools.ant.taskdefs.exec.Execute;
@@ -303,7 +303,7 @@
throws TaskException
{
//build the home classes list.
- Vector homes = new Vector();
+ ArrayList homes = new ArrayList();
Iterator it = files.keySet().iterator();
while( it.hasNext() )
{
1.3 +7 -7
jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/ejb/EjbcHelper.java
Index: EjbcHelper.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/ejb/EjbcHelper.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- EjbcHelper.java 2001/12/16 00:37:02 1.2
+++ EjbcHelper.java 2001/12/21 14:21:21 1.3
@@ -13,7 +13,7 @@
import java.io.IOException;
import java.io.ObjectInputStream;
import java.io.PrintWriter;
-import java.util.Vector;
+import java.util.ArrayList;
import javax.ejb.deployment.DeploymentDescriptor;
import javax.ejb.deployment.EntityDescriptor;
@@ -100,18 +100,18 @@
private String[] getCommandLine( boolean debug, File descriptorFile )
{
- Vector v = new Vector();
+ ArrayList v = new ArrayList();
if( !debug )
{
- v.addElement( "-noexit" );
+ v.add( "-noexit" );
}
if( keepGenerated )
{
- v.addElement( "-keepgenerated" );
+ v.add( "-keepgenerated" );
}
- v.addElement( "-d" );
- v.addElement( generatedFilesDirectory.getPath() );
- v.addElement( descriptorFile.getPath() );
+ v.add( "-d" );
+ v.add( generatedFilesDirectory.getPath() );
+ v.add( descriptorFile.getPath() );
String[] args = new String[ v.size() ];
v.copyInto( args );
1.7 +1 -1
jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/ejb/GenericDeploymentTool.java
Index: GenericDeploymentTool.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/ejb/GenericDeploymentTool.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- GenericDeploymentTool.java 2001/12/16 04:43:51 1.6
+++ GenericDeploymentTool.java 2001/12/21 14:21:21 1.7
@@ -819,7 +819,7 @@
JarOutputStream jarStream = null;
try
{
- // clean the addedfiles Vector
+ // clean the addedfiles ArrayList
addedfiles = new ArrayList();
/*
1.7 +12 -12
jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/ejb/WeblogicDeploymentTool.java
Index: WeblogicDeploymentTool.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/ejb/WeblogicDeploymentTool.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- WeblogicDeploymentTool.java 2001/12/17 10:47:19 1.6
+++ WeblogicDeploymentTool.java 2001/12/21 14:21:21 1.7
@@ -12,7 +12,7 @@
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
-import java.util.Enumeration;
+import java.util.Iterator;
import java.util.Hashtable;
import java.util.Iterator;
import java.util.jar.JarEntry;
@@ -423,23 +423,23 @@
Hashtable replaceEntries = new Hashtable();
//get the list of generic jar entries
- for( Enumeration e = genericJar.entries();
e.hasMoreElements(); )
+ for( Iterator e = genericJar.entries(); e.hasNext(); )
{
- JarEntry je = (JarEntry)e.nextElement();
+ JarEntry je = (JarEntry)e.next();
genericEntries.put( je.getName().replace( '\\', '/' ),
je );
}
//get the list of weblogic jar entries
- for( Enumeration e = wlJar.entries(); e.hasMoreElements(); )
+ for( Iterator e = wlJar.entries(); e.hasNext(); )
{
- JarEntry je = (JarEntry)e.nextElement();
+ JarEntry je = (JarEntry)e.next();
wlEntries.put( je.getName(), je );
}
//Cycle Through generic and make sure its in weblogic
ClassLoader genericLoader = getClassLoaderFromJar(
genericJarFile );
- for( Enumeration e = genericEntries.keys();
e.hasMoreElements(); )
+ for( Iterator e = genericEntries.keys(); e.hasNext(); )
{
- String filepath = (String)e.nextElement();
+ String filepath = (String)e.next();
if( wlEntries.containsKey( filepath ) )
{// File name/path match
@@ -504,12 +504,12 @@
newJarStream.setLevel( 0 );
//Copy files from old weblogic jar
- for( Enumeration e = wlEntries.elements();
e.hasMoreElements(); )
+ for( Iterator e = wlEntries.iterator(); e.hasNext(); )
{
byte[] buffer = new byte[ 1024 ];
int bytesRead;
InputStream is;
- JarEntry je = (JarEntry)e.nextElement();
+ JarEntry je = (JarEntry)e.next();
if( je.getCompressedSize() == -1 ||
je.getCompressedSize() == je.getSize() )
{
@@ -668,10 +668,10 @@
handler );
Hashtable ht = handler.getFiles();
- Enumeration e = ht.keys();
- while( e.hasMoreElements() )
+ Iterator e = ht.keys();
+ while( e.hasNext() )
{
- String key = (String)e.nextElement();
+ String key = (String)e.next();
ejbFiles.put( key, ht.get( key ) );
}
}
1.5 +9 -9
jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/ejb/WebsphereDeploymentTool.java
Index: WebsphereDeploymentTool.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/ejb/WebsphereDeploymentTool.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- WebsphereDeploymentTool.java 2001/12/16 04:12:39 1.4
+++ WebsphereDeploymentTool.java 2001/12/21 14:21:21 1.5
@@ -11,7 +11,7 @@
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
-import java.util.Enumeration;
+import java.util.Iterator;
import java.util.Hashtable;
import java.util.Iterator;
import java.util.jar.JarEntry;
@@ -564,27 +564,27 @@
//get the list of generic jar entries
- for( Enumeration e = genericJar.entries();
e.hasMoreElements(); )
+ for( Iterator e = genericJar.entries(); e.hasNext(); )
{
- JarEntry je = (JarEntry)e.nextElement();
+ JarEntry je = (JarEntry)e.next();
genericEntries.put( je.getName().replace( '\\', '/' ),
je );
}
//get the list of websphere jar entries
- for( Enumeration e = wasJar.entries(); e.hasMoreElements(); )
+ for( Iterator e = wasJar.entries(); e.hasNext(); )
{
- JarEntry je = (JarEntry)e.nextElement();
+ JarEntry je = (JarEntry)e.next();
wasEntries.put( je.getName(), je );
}
//Cycle Through generic and make sure its in websphere
ClassLoader genericLoader = getClassLoaderFromJar(
genericJarFile );
- for( Enumeration e = genericEntries.keys();
e.hasMoreElements(); )
+ for( Iterator e = genericEntries.keys(); e.hasNext(); )
{
- String filepath = (String)e.nextElement();
+ String filepath = (String)e.next();
if( wasEntries.containsKey( filepath ) )
{// File name/path match
// Check files see if same
@@ -653,12 +653,12 @@
//Copy files from old websphere jar
- for( Enumeration e = wasEntries.elements();
e.hasMoreElements(); )
+ for( Iterator e = wasEntries.iterator(); e.hasNext(); )
{
byte[] buffer = new byte[ 1024 ];
int bytesRead;
InputStream is;
- JarEntry je = (JarEntry)e.nextElement();
+ JarEntry je = (JarEntry)e.next();
if( je.getCompressedSize() == -1 ||
je.getCompressedSize() == je.getSize() )
{
1.6 +5 -5
jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/i18n/Translate.java
Index: Translate.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/i18n/Translate.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- Translate.java 2001/12/21 13:34:17 1.5
+++ Translate.java 2001/12/21 14:21:21 1.6
@@ -17,7 +17,7 @@
import java.io.OutputStreamWriter;
import java.util.Hashtable;
import java.util.Locale;
-import java.util.Vector;
+import java.util.ArrayList;
import org.apache.avalon.excalibur.io.FileUtil;
import org.apache.myrmidon.api.TaskException;
import org.apache.tools.ant.DirectoryScanner;
@@ -33,9 +33,9 @@
public class Translate extends MatchingTask
{
/**
- * Vector to hold source file sets.
+ * ArrayList to hold source file sets.
*/
- private Vector filesets = new Vector();
+ private ArrayList filesets = new ArrayList();
/**
* Holds key value pairs loaded from resource bundle file
*/
@@ -224,7 +224,7 @@
*/
public void addFileset( FileSet set )
{
- filesets.addElement( set );
+ filesets.add( set );
}
/**
@@ -517,7 +517,7 @@
{
for( int i = 0; i < filesets.size(); i++ )
{
- FileSet fs = (FileSet)filesets.elementAt( i );
+ FileSet fs = (FileSet)filesets.get( i );
DirectoryScanner ds = fs.getDirectoryScanner( getProject() );
String[] srcFiles = ds.getIncludedFiles();
for( int j = 0; j < srcFiles.length; j++ )
1.5 +3 -3
jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/ide/VAJAntToolGUI.java
Index: VAJAntToolGUI.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/ide/VAJAntToolGUI.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- VAJAntToolGUI.java 2001/12/21 13:28:30 1.4
+++ VAJAntToolGUI.java 2001/12/21 14:21:21 1.5
@@ -37,7 +37,7 @@
import java.awt.event.WindowEvent;
import java.awt.event.WindowListener;
import java.beans.PropertyChangeListener;
-import java.util.Vector;
+import java.util.ArrayList;
import org.apache.myrmidon.api.TaskException;
import org.apache.tools.ant.BuildEvent;
import org.apache.tools.ant.BuildListener;
@@ -1384,10 +1384,10 @@
private void fillList()
{
getTargetList().removeAll();
- Vector targets = getBuildInfo().getProjectTargets();
+ ArrayList targets = getBuildInfo().getProjectTargets();
for( int i = 0; i < targets.size(); i++ )
{
- getTargetList().add( targets.elementAt( i ).toString() );
+ getTargetList().add( targets.get( i ).toString() );
}
getTargetList().select( iBuildInfo.getProjectTargets().indexOf(
iBuildInfo.getTarget() ) );
if( getTargetList().getSelectedIndex() >= 0 )
1.4 +14 -14
jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/ide/VAJBuildInfo.java
Index: VAJBuildInfo.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/ide/VAJBuildInfo.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- VAJBuildInfo.java 2001/12/16 04:22:37 1.3
+++ VAJBuildInfo.java 2001/12/21 14:21:21 1.4
@@ -10,9 +10,9 @@
import java.beans.PropertyChangeListener;
import java.beans.PropertyChangeSupport;
import java.io.File;
-import java.util.Enumeration;
+import java.util.Iterator;
import java.util.StringTokenizer;
-import java.util.Vector;
+import java.util.ArrayList;
import org.apache.myrmidon.api.TaskException;
import org.apache.tools.ant.BuildEvent;
import org.apache.tools.ant.BuildListener;
@@ -40,7 +40,7 @@
private String buildFileName = "";
// main targets found in the build file
- private Vector projectTargets = new Vector();
+ private ArrayList projectTargets = new ArrayList();
// target selected for execution
private java.lang.String target = "";
@@ -82,7 +82,7 @@
result.setTarget( tok.nextToken() );
while( tok.hasMoreTokens() )
{
- result.projectTargets.addElement( tok.nextToken() );
+ result.projectTargets.add( tok.nextToken() );
}
}
catch( Throwable t )
@@ -101,12 +101,12 @@
* @param name Description of Parameter
* @return Description of the Returned Value
*/
- private static int findTargetPosition( Vector names, String name )
+ private static int findTargetPosition( ArrayList names, String name )
{
int res = names.size();
for( int i = 0; i < names.size() && res == names.size(); i++ )
{
- if( name.compareTo( (String)names.elementAt( i ) ) < 0 )
+ if( name.compareTo( (String)names.get( i ) ) < 0 )
{
res = i;
}
@@ -190,7 +190,7 @@
*
* @return The ProjectTargets value
*/
- public Vector getProjectTargets()
+ public ArrayList getProjectTargets()
{
return projectTargets;
}
@@ -247,10 +247,10 @@
{
String result = getOutputMessageLevel() + "|" + getBuildFileName()
+ "|" + getTarget();
- for( Enumeration e = getProjectTargets().elements();
- e.hasMoreElements(); )
+ for( Iterator e = getProjectTargets().iterator();
+ e.hasNext(); )
{
- result = result + "|" + e.nextElement();
+ result = result + "|" + e.next();
}
return result;
@@ -362,11 +362,11 @@
{
project = new Project();
initProject();
- projectTargets.removeAllElements();
- Enumeration ptargets = project.getTargets().elements();
- while( ptargets.hasMoreElements() )
+ projectTargets.clear();
+ Iterator ptargets = project.getTargets().iterator();
+ while( ptargets.hasNext() )
{
- Target currentTarget = (Target)ptargets.nextElement();
+ Target currentTarget = (Target)ptargets.next();
if( currentTarget.getDescription() != null )
{
String targetName = currentTarget.getName();
1.4 +6 -6
jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/ide/VAJImport.java
Index: VAJImport.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/ide/VAJImport.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- VAJImport.java 2001/12/21 13:34:17 1.3
+++ VAJImport.java 2001/12/21 14:21:21 1.4
@@ -8,8 +8,8 @@
package org.apache.tools.ant.taskdefs.optional.ide;
import java.lang.reflect.Field;
-import java.util.Enumeration;
-import java.util.Vector;
+import java.util.Iterator;
+import java.util.ArrayList;
import org.apache.myrmidon.api.TaskException;
import org.apache.tools.ant.DirectoryScanner;
import org.apache.tools.ant.types.FileSet;
@@ -125,7 +125,7 @@
*/
public class VAJImport extends VAJTask
{
- protected Vector filesets = new Vector();
+ protected ArrayList filesets = new ArrayList();
protected boolean importSources = true;
protected boolean importResources = true;
protected boolean importClasses = false;
@@ -190,7 +190,7 @@
*/
public void addFileset( FileSet set )
{
- filesets.addElement( set );
+ filesets.add( set );
}
/**
@@ -211,9 +211,9 @@
throw new TaskException( "The VisualAge for Java Project name is
required!" );
}
- for( Enumeration e = filesets.elements(); e.hasMoreElements(); )
+ for( Iterator e = filesets.iterator(); e.hasNext(); )
{
- importFileset( (FileSet)e.nextElement() );
+ importFileset( (FileSet)e.next() );
}
}
1.3 +3 -3
jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/ide/VAJLoad.java
Index: VAJLoad.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/ide/VAJLoad.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- VAJLoad.java 2001/12/16 00:36:41 1.2
+++ VAJLoad.java 2001/12/21 14:21:21 1.3
@@ -7,7 +7,7 @@
*/
package org.apache.tools.ant.taskdefs.optional.ide;
-import java.util.Vector;
+import java.util.ArrayList;
/**
* Load specific project versions into the Visual Age for Java workspace.
Each
@@ -21,7 +21,7 @@
public class VAJLoad extends VAJTask
{
- Vector projectDescriptions = new Vector();
+ ArrayList projectDescriptions = new ArrayList();
/**
* Add a project description entry on the project list.
@@ -31,7 +31,7 @@
public VAJProjectDescription createVAJProject()
{
VAJProjectDescription d = new VAJProjectDescription();
- projectDescriptions.addElement( d );
+ projectDescriptions.add( d );
return d;
}
1.3 +3 -3
jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/ide/VAJLoadServlet.java
Index: VAJLoadServlet.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/ide/VAJLoadServlet.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- VAJLoadServlet.java 2001/12/16 00:36:41 1.2
+++ VAJLoadServlet.java 2001/12/21 14:21:21 1.3
@@ -7,7 +7,7 @@
*/
package org.apache.tools.ant.taskdefs.optional.ide;
-import java.util.Vector;
+import java.util.ArrayList;
/**
* A Remote Access to Tools Servlet to load a Project from the Repository
into
@@ -70,13 +70,13 @@
String[] projectNames = getParamValues( PROJECT_NAME_PARAM );
String[] versionNames = getParamValues( VERSION_PARAM );
- Vector projectDescriptions = new Vector( projectNames.length );
+ ArrayList projectDescriptions = new ArrayList( projectNames.length );
for( int i = 0; i < projectNames.length && i < versionNames.length;
i++ )
{
VAJProjectDescription desc = new VAJProjectDescription();
desc.setName( projectNames[ i ] );
desc.setVersion( versionNames[ i ] );
- projectDescriptions.addElement( desc );
+ projectDescriptions.add( desc );
}
util.loadProjects( projectDescriptions );
1.4 +32 -32
jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/ide/VAJLocalUtil.java
Index: VAJLocalUtil.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/ide/VAJLocalUtil.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- VAJLocalUtil.java 2001/12/16 00:36:41 1.3
+++ VAJLocalUtil.java 2001/12/21 14:21:21 1.4
@@ -17,8 +17,8 @@
import com.ibm.ivj.util.base.Type;
import com.ibm.ivj.util.base.Workspace;
import java.io.File;
-import java.util.Enumeration;
-import java.util.Vector;
+import java.util.Iterator;
+import java.util.ArrayList;
import org.apache.myrmidon.api.TaskException;
import org.apache.tools.ant.DirectoryScanner;
@@ -230,9 +230,9 @@
}
ds.scan();
- Vector classes = new Vector();
- Vector sources = new Vector();
- Vector resources = new Vector();
+ ArrayList classes = new ArrayList();
+ ArrayList sources = new ArrayList();
+ ArrayList resources = new ArrayList();
scanForImport( srcDir, ds.getIncludedFiles(), classes, sources,
resources );
@@ -284,14 +284,14 @@
*
* @param projectDescriptions Description of Parameter
*/
- public void loadProjects( Vector projectDescriptions )
+ public void loadProjects( ArrayList projectDescriptions )
{
- Vector expandedDescs = getExpandedDescriptions( projectDescriptions
);
+ ArrayList expandedDescs = getExpandedDescriptions(
projectDescriptions );
// output warnings for projects not found
- for( Enumeration e = projectDescriptions.elements();
e.hasMoreElements(); )
+ for( Iterator e = projectDescriptions.iterator(); e.hasNext(); )
{
- VAJProjectDescription d = (VAJProjectDescription)e.nextElement();
+ VAJProjectDescription d = (VAJProjectDescription)e.next();
if( !d.projectFound() )
{
log( "No Projects match the name " + d.getName(), MSG_WARN );
@@ -301,10 +301,10 @@
log( "Loading " + expandedDescs.size()
+ " project(s) into workspace", MSG_INFO );
- for( Enumeration e = expandedDescs.elements();
- e.hasMoreElements(); )
+ for( Iterator e = expandedDescs.iterator();
+ e.hasNext(); )
{
- VAJProjectDescription d = (VAJProjectDescription)e.nextElement();
+ VAJProjectDescription d = (VAJProjectDescription)e.next();
ProjectEdition pe = findProjectEdition( d.getName(),
d.getVersion() );
try
@@ -328,24 +328,24 @@
* @param projectDescs Description of Parameter
* @return The ExpandedDescriptions value
*/
- private Vector getExpandedDescriptions( Vector projectDescs )
+ private ArrayList getExpandedDescriptions( ArrayList projectDescs )
{
- Vector expandedDescs = new Vector( projectDescs.size() );
+ ArrayList expandedDescs = new ArrayList( projectDescs.size() );
try
{
String[] projectNames =
getWorkspace().getRepository().getProjectNames();
for( int i = 0; i < projectNames.length; i++ )
{
- for( Enumeration e = projectDescs.elements();
- e.hasMoreElements(); )
+ for( Iterator e = projectDescs.iterator();
+ e.hasNext(); )
{
- VAJProjectDescription d =
(VAJProjectDescription)e.nextElement();
+ VAJProjectDescription d =
(VAJProjectDescription)e.next();
String pattern = d.getName();
if( VAJWorkspaceScanner.match( pattern, projectNames[ i
] ) )
{
d.setProjectFound();
- expandedDescs.addElement( new VAJProjectDescription(
+ expandedDescs.add( new VAJProjectDescription(
projectNames[ i ], d.getVersion() ) );
break;
}
@@ -371,7 +371,7 @@
*/
private void addFilesToImport(
ImportCodeSpec spec, boolean doImport,
- Vector files, String fileType,
+ ArrayList files, String fileType,
StringBuffer summaryLog )
{
@@ -409,7 +409,7 @@
* @param pattern Description of Parameter
* @return Description of the Returned Value
*/
- private Vector findMatchingProjects( String pattern )
+ private ArrayList findMatchingProjects( String pattern )
{
String[] projectNames;
try
@@ -421,12 +421,12 @@
throw createTaskException( "VA Exception occured: ", e );
}
- Vector matchingProjects = new Vector();
+ ArrayList matchingProjects = new ArrayList();
for( int i = 0; i < projectNames.length; i++ )
{
if( VAJWorkspaceScanner.match( pattern, projectNames[ i ] ) )
{
- matchingProjects.addElement( projectNames[ i ] );
+ matchingProjects.add( projectNames[ i ] );
}
}
@@ -478,15 +478,15 @@
/**
* Logs a list of file names to the message log
*
- * @param fileNames java.util.Vector file names to be logged
+ * @param fileNames java.util.ArrayList file names to be logged
* @param fileType Description of Parameter
*/
- private void logFiles( Vector fileNames, String fileType )
+ private void logFiles( ArrayList fileNames, String fileType )
{
log( fileType + " files found for import:", MSG_VERBOSE );
- for( Enumeration e = fileNames.elements(); e.hasMoreElements(); )
+ for( Iterator e = fileNames.iterator(); e.hasNext(); )
{
- log( " " + e.nextElement(), MSG_VERBOSE );
+ log( " " + e.next(), MSG_VERBOSE );
}
}
@@ -502,25 +502,25 @@
private void scanForImport(
File dir,
String[] files,
- Vector classes,
- Vector sources,
- Vector resources )
+ ArrayList classes,
+ ArrayList sources,
+ ArrayList resources )
{
for( int i = 0; i < files.length; i++ )
{
String file = ( new File( dir, files[ i ] ) ).getAbsolutePath();
if( file.endsWith( ".java" ) || file.endsWith( ".JAVA" ) )
{
- sources.addElement( file );
+ sources.add( file );
}
else if( file.endsWith( ".class" ) || file.endsWith( ".CLASS" ) )
{
- classes.addElement( file );
+ classes.add( file );
}
else
{
// for resources VA expects the path relative to the
resource path
- resources.addElement( files[ i ] );
+ resources.add( files[ i ] );
}
}
}
1.4 +5 -5
jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/ide/VAJRemoteUtil.java
Index: VAJRemoteUtil.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/ide/VAJRemoteUtil.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- VAJRemoteUtil.java 2001/12/16 00:36:41 1.3
+++ VAJRemoteUtil.java 2001/12/21 14:21:21 1.4
@@ -14,8 +14,8 @@
import java.io.InputStreamReader;
import java.net.HttpURLConnection;
import java.net.URL;
-import java.util.Enumeration;
-import java.util.Vector;
+import java.util.Iterator;
+import java.util.ArrayList;
import org.apache.myrmidon.api.TaskException;
import org.apache.tools.ant.Task;
@@ -115,15 +115,15 @@
*
* @param projectDescriptions Description of Parameter
*/
- public void loadProjects( Vector projectDescriptions )
+ public void loadProjects( ArrayList projectDescriptions )
{
try
{
String request = "http://" + remoteServer + "/servlet/vajload?";
String delimiter = "";
- for( Enumeration e = projectDescriptions.elements();
e.hasMoreElements(); )
+ for( Iterator e = projectDescriptions.iterator(); e.hasNext(); )
{
- VAJProjectDescription pd =
(VAJProjectDescription)e.nextElement();
+ VAJProjectDescription pd = (VAJProjectDescription)e.next();
request = request
+ delimiter + VAJLoadServlet.PROJECT_NAME_PARAM
+ "=" + pd.getName().replace( ' ', '+' )
1.3 +2 -2
jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/ide/VAJUtil.java
Index: VAJUtil.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/ide/VAJUtil.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- VAJUtil.java 2001/12/16 00:36:41 1.2
+++ VAJUtil.java 2001/12/21 14:21:21 1.3
@@ -8,7 +8,7 @@
package org.apache.tools.ant.taskdefs.optional.ide;
import java.io.File;
-import java.util.Vector;
+import java.util.ArrayList;
/**
* Helper interface for VAJ tasks. Encapsulates the interface to the VAJ tool
@@ -68,7 +68,7 @@
*
* @param projectDescriptions Description of Parameter
*/
- void loadProjects( Vector projectDescriptions );
+ void loadProjects( ArrayList projectDescriptions );
/**
* Logs a message with the specified log level.
1.3 +13 -13
jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/ide/VAJWorkspaceScanner.java
Index: VAJWorkspaceScanner.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/ide/VAJWorkspaceScanner.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- VAJWorkspaceScanner.java 2001/12/16 00:36:41 1.2
+++ VAJWorkspaceScanner.java 2001/12/21 14:21:21 1.3
@@ -11,9 +11,9 @@
import com.ibm.ivj.util.base.Package;
import com.ibm.ivj.util.base.Project;
import java.io.File;
-import java.util.Enumeration;
+import java.util.Iterator;
import java.util.StringTokenizer;
-import java.util.Vector;
+import java.util.ArrayList;
import org.apache.tools.ant.DirectoryScanner;
/**
@@ -55,7 +55,7 @@
// The packages that where found and matched at least
// one includes, and matched no excludes.
- private Vector packagesIncluded = new Vector();
+ private ArrayList packagesIncluded = new ArrayList();
/**
* Matches a string against a pattern. The pattern contains two special
@@ -84,7 +84,7 @@
Package[] packages = new Package[ count ];
for( int i = 0; i < count; i++ )
{
- packages[ i ] = (Package)packagesIncluded.elementAt( i );
+ packages[ i ] = (Package)packagesIncluded.get( i );
}
return packages;
}
@@ -115,11 +115,11 @@
*
* @return the projects
*/
- public Vector findMatchingProjects()
+ public ArrayList findMatchingProjects()
{
Project[] projects = VAJLocalUtil.getWorkspace().getProjects();
- Vector matchingProjects = new Vector();
+ ArrayList matchingProjects = new ArrayList();
boolean allProjectsMatch = false;
for( int i = 0; i < projects.length; i++ )
@@ -138,7 +138,7 @@
}
else if( match( projectNamePattern, project.getName() ) )
{
- matchingProjects.addElement( project );
+ matchingProjects.add( project );
break;
}
}
@@ -146,10 +146,10 @@
if( allProjectsMatch )
{
- matchingProjects = new Vector();
+ matchingProjects = new ArrayList();
for( int i = 0; i < projects.length; i++ )
{
- matchingProjects.addElement( projects[ i ] );
+ matchingProjects.add( projects[ i ] );
}
}
@@ -174,10 +174,10 @@
}
// only scan projects which are included in at least one include
pattern
- Vector matchingProjects = findMatchingProjects();
- for( Enumeration e = matchingProjects.elements();
e.hasMoreElements(); )
+ ArrayList matchingProjects = findMatchingProjects();
+ for( Iterator e = matchingProjects.iterator(); e.hasNext(); )
{
- Project project = (Project)e.nextElement();
+ Project project = (Project)e.next();
scanProject( project );
}
}
@@ -207,7 +207,7 @@
+ item.getName().replace( '.', File.separatorChar );
if( isIncluded( name ) && !isExcluded( name ) )
{
- packagesIncluded.addElement( item );
+ packagesIncluded.add( item );
}
}
}
1.7 +2 -1
jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/javacc/JJTree.java
Index: JJTree.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/javacc/JJTree.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- JJTree.java 2001/12/21 13:34:17 1.6
+++ JJTree.java 2001/12/21 14:21:21 1.7
@@ -9,8 +9,9 @@
import java.io.File;
import java.io.IOException;
-import java.util.Enumeration;
+import java.util.Iterator;
import java.util.Hashtable;
+import java.util.Enumeration;
import org.apache.myrmidon.api.TaskException;
import org.apache.tools.ant.Project;
import org.apache.tools.ant.Task;
1.5 +2 -1
jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/javacc/JavaCC.java
Index: JavaCC.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/javacc/JavaCC.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- JavaCC.java 2001/12/21 13:34:17 1.4
+++ JavaCC.java 2001/12/21 14:21:21 1.5
@@ -8,8 +8,9 @@
package org.apache.tools.ant.taskdefs.optional.javacc;
import java.io.File;
-import java.util.Enumeration;
+import java.util.Iterator;
import java.util.Hashtable;
+import java.util.Enumeration;
import org.apache.myrmidon.api.TaskException;
import org.apache.tools.ant.Project;
import org.apache.tools.ant.Task;
1.3 +13 -12
jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/jlink/jlink.java
Index: jlink.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/jlink/jlink.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- jlink.java 2001/12/16 00:36:15 1.2
+++ jlink.java 2001/12/21 14:21:22 1.3
@@ -13,8 +13,9 @@
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
+import java.util.Iterator;
+import java.util.ArrayList;
import java.util.Enumeration;
-import java.util.Vector;
import java.util.zip.CRC32;
import java.util.zip.Deflater;
import java.util.zip.ZipEntry;
@@ -27,9 +28,9 @@
private String outfile = null;
- private Vector mergefiles = new Vector( 10 );
+ private ArrayList mergefiles = new ArrayList( 10 );
- private Vector addfiles = new Vector( 10 );
+ private ArrayList addfiles = new ArrayList( 10 );
private boolean compression = false;
@@ -95,7 +96,7 @@
{
return;
}
- addfiles.addElement( addfile );
+ addfiles.add( addfile );
}
/**
@@ -126,7 +127,7 @@
{
return;
}
- mergefiles.addElement( mergefile );
+ mergefiles.add( mergefile );
}
/**
@@ -172,10 +173,10 @@
{
output.setMethod( ZipOutputStream.STORED );
}
- Enumeration merges = mergefiles.elements();
- while( merges.hasMoreElements() )
+ Iterator merges = mergefiles.iterator();
+ while( merges.hasNext() )
{
- String path = (String)merges.nextElement();
+ String path = (String)merges.next();
File f = new File( path );
if( f.getName().endsWith( ".jar" ) || f.getName().endsWith(
".zip" ) )
{
@@ -184,15 +185,15 @@
}
else
{
- //Add this file to the addfiles Vector and add it
+ //Add this file to the addfiles ArrayList and add it
//later at the top level of the output file.
addAddFile( path );
}
}
- Enumeration adds = addfiles.elements();
- while( adds.hasMoreElements() )
+ Iterator adds = addfiles.iterator();
+ while( adds.hasNext() )
{
- String name = (String)adds.nextElement();
+ String name = (String)adds.next();
File f = new File( name );
if( f.isDirectory() )
{
1.7 +6 -6
jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/jsp/JspC.java
Index: JspC.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/jsp/JspC.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- JspC.java 2001/12/21 13:34:18 1.6
+++ JspC.java 2001/12/21 14:21:22 1.7
@@ -9,7 +9,7 @@
import java.io.File;
import java.util.Date;
-import java.util.Vector;
+import java.util.ArrayList;
import org.apache.myrmidon.api.TaskException;
import org.apache.tools.ant.DirectoryScanner;
import org.apache.tools.ant.Project;
@@ -58,7 +58,7 @@
* </a>
* @author <a href="mailto:[EMAIL PROTECTED]">Stefan Bodewig</a>
* @author <a href="mailto:[EMAIL PROTECTED]">J D Glanville</a>
- * @version $Revision: 1.6 $ $Date: 2001/12/21 13:34:18 $
+ * @version $Revision: 1.7 $ $Date: 2001/12/21 14:21:22 $
*/
public class JspC extends MatchingTask
{
@@ -66,7 +66,7 @@
private final static String FAIL_MSG
= "Compile failed, messages should have been provided.";
private int verbose = 0;
- protected Vector compileList = new Vector();
+ protected ArrayList compileList = new ArrayList();
protected boolean failOnError = true;
/*
* ------------------------------------------------------------
@@ -245,7 +245,7 @@
/*
* ------------------------------------------------------------
*/
- public Vector getCompileList()
+ public ArrayList getCompileList()
{
return compileList;
}
@@ -430,7 +430,7 @@
*/
protected void resetFileLists()
{
- compileList.removeAllElements();
+ compileList.clear();
}
/*
@@ -482,7 +482,7 @@
" because it is out of date with respect to "
+ javaFile.getPath(), Project.MSG_DEBUG );
}
- compileList.addElement( srcFile.getAbsolutePath() );
+ compileList.add( srcFile.getAbsolutePath() );
}
}
}
1.9 +5 -5
jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/jsp/WLJspc.java
Index: WLJspc.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/jsp/WLJspc.java,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- WLJspc.java 2001/12/21 13:34:18 1.8
+++ WLJspc.java 2001/12/21 14:21:22 1.9
@@ -10,7 +10,7 @@
import java.io.File;
import java.util.Date;
import java.util.StringTokenizer;
-import java.util.Vector;
+import java.util.ArrayList;
import org.apache.myrmidon.api.TaskException;
import org.apache.tools.ant.DirectoryScanner;
import org.apache.tools.ant.Project;
@@ -58,7 +58,7 @@
//private String compilerPath; //fully qualified name for the compiler
executable
private String pathToPackage = "";
- private Vector filesToDo = new Vector();//package under which resultant
classes will reside
+ private ArrayList filesToDo = new ArrayList();//package under which
resultant classes will reside
private Path compileClasspath;
//TODO Test on other versions of weblogic
//TODO add more attributes to the task, to take care of all jspc options
@@ -205,7 +205,7 @@
// All this to get package according to weblogic standards
// Can be written better... this is too hacky!
// Careful.. similar code in scanDir , but slightly different!!
- jspFile = new File( (String)filesToDo.elementAt( i ) );
+ jspFile = new File( (String)filesToDo.get( i ) );
args[ j ] = "-package";
parents = jspFile.getParent();
if( ( parents != null ) && ( !( "" ).equals( parents ) ) )
@@ -218,7 +218,7 @@
args[ j + 1 ] = destinationPackage;
}
- args[ j + 2 ] = sourceDirectory + File.separator +
(String)filesToDo.elementAt( i );
+ args[ j + 2 ] = sourceDirectory + File.separator +
(String)filesToDo.get( i );
arg = "";
for( int x = 0; x < 12; x++ )
@@ -301,7 +301,7 @@
if( srcFile.lastModified() > classFile.lastModified() )
{
//log("Files are" + srcFile.getAbsolutePath()+" "
+classFile.getAbsolutePath());
- filesToDo.addElement( files[ i ] );
+ filesToDo.add( files[ i ] );
log( "Recompiling File " + files[ i ], Project.MSG_VERBOSE );
}
}
1.3 +6 -6
jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/jsp/compilers/DefaultCompilerAdapter.java
Index: DefaultCompilerAdapter.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/jsp/compilers/DefaultCompilerAdapter.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- DefaultCompilerAdapter.java 2001/12/16 00:36:07 1.2
+++ DefaultCompilerAdapter.java 2001/12/21 14:21:22 1.3
@@ -7,8 +7,8 @@
*/
package org.apache.tools.ant.taskdefs.optional.jsp.compilers;
-import java.util.Enumeration;
-import java.util.Vector;
+import java.util.Iterator;
+import java.util.ArrayList;
import org.apache.tools.ant.Project;
import org.apache.tools.ant.taskdefs.optional.jsp.JspC;
import org.apache.tools.ant.types.Commandline;
@@ -53,7 +53,7 @@
* @param cmd Description of Parameter
*/
protected void logAndAddFilesToCompile( JspC jspc,
- Vector compileList,
+ ArrayList compileList,
Commandline cmd )
{
jspc.log( "Compilation args: " + cmd.toString(), Project.MSG_VERBOSE
);
@@ -67,10 +67,10 @@
niceSourceList.append( lSep );
- Enumeration enum = compileList.elements();
- while( enum.hasMoreElements() )
+ Iterator enum = compileList.iterator();
+ while( enum.hasNext() )
{
- String arg = (String)enum.nextElement();
+ String arg = (String)enum.next();
cmd.createArgument().setValue( arg );
niceSourceList.append( " " + arg + lSep );
}
1.3 +3 -3
jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/junit/BaseTest.java
Index: BaseTest.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/junit/BaseTest.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- BaseTest.java 2001/12/16 00:36:00 1.2
+++ BaseTest.java 2001/12/21 14:21:22 1.3
@@ -8,7 +8,7 @@
package org.apache.tools.ant.taskdefs.optional.junit;
import java.io.File;
-import java.util.Vector;
+import java.util.ArrayList;
/**
* Baseclass for BatchTest and JUnitTest.
@@ -24,7 +24,7 @@
protected boolean fork = false;
protected String ifProperty = null;
protected String unlessProperty = null;
- protected Vector formatters = new Vector();
+ protected ArrayList formatters = new ArrayList();
/**
* destination directory
*/
@@ -128,6 +128,6 @@
public void addFormatter( FormatterElement elem )
{
- formatters.addElement( elem );
+ formatters.add( elem );
}
}
1.3 +16 -16
jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/junit/BatchTest.java
Index: BatchTest.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/junit/BatchTest.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- BatchTest.java 2001/12/16 00:36:00 1.2
+++ BatchTest.java 2001/12/21 14:21:22 1.3
@@ -8,8 +8,8 @@
package org.apache.tools.ant.taskdefs.optional.junit;
import java.io.File;
-import java.util.Enumeration;
-import java.util.Vector;
+import java.util.Iterator;
+import java.util.ArrayList;
import org.apache.tools.ant.DirectoryScanner;
import org.apache.tools.ant.Project;
import org.apache.tools.ant.types.FileSet;
@@ -36,7 +36,7 @@
/**
* the list of filesets containing the testcase filename rules
*/
- private Vector filesets = new Vector();
+ private ArrayList filesets = new ArrayList();
/**
* the reference to the project
@@ -73,10 +73,10 @@
* @return an enumeration of all elements of this batchtest that are a
<tt>
* JUnitTest</tt> instance.
*/
- public final Enumeration elements()
+ public final Iterator iterator()
{
JUnitTest[] tests = createAllJUnitTest();
- return Enumerations.fromArray( tests );
+ return Iterators.fromArray( tests );
}
/**
@@ -88,23 +88,23 @@
*/
public void addFileSet( FileSet fs )
{
- filesets.addElement( fs );
+ filesets.add( fs );
}
/**
* Convenient method to merge the <tt>JUnitTest</tt> s of this batchtest
to
- * a <tt>Vector</tt> .
+ * a <tt>ArrayList</tt> .
*
* @param v the vector to which should be added all individual tests of
this
* batch test.
*/
- final void addTestsTo( Vector v )
+ final void addTestsTo( ArrayList v )
{
JUnitTest[] tests = createAllJUnitTest();
v.ensureCapacity( v.size() + tests.length );
for( int i = 0; i < tests.length; i++ )
{
- v.addElement( tests[ i ] );
+ v.add( tests[ i ] );
}
}
@@ -122,11 +122,11 @@
*/
private String[] getFilenames()
{
- Vector v = new Vector();
+ ArrayList v = new ArrayList();
final int size = this.filesets.size();
for( int j = 0; j < size; j++ )
{
- FileSet fs = (FileSet)filesets.elementAt( j );
+ FileSet fs = (FileSet)filesets.get( j );
DirectoryScanner ds = fs.getDirectoryScanner( project );
ds.scan();
String[] f = ds.getIncludedFiles();
@@ -135,11 +135,11 @@
String pathname = f[ k ];
if( pathname.endsWith( ".java" ) )
{
- v.addElement( pathname.substring( 0, pathname.length() -
".java".length() ) );
+ v.add( pathname.substring( 0, pathname.length() -
".java".length() ) );
}
else if( pathname.endsWith( ".class" ) )
{
- v.addElement( pathname.substring( 0, pathname.length() -
".class".length() ) );
+ v.add( pathname.substring( 0, pathname.length() -
".class".length() ) );
}
}
}
@@ -188,10 +188,10 @@
test.setTodir( this.destDir );
test.setFailureProperty( failureProperty );
test.setErrorProperty( errorProperty );
- Enumeration list = this.formatters.elements();
- while( list.hasMoreElements() )
+ Iterator list = this.formatters.iterator();
+ while( list.hasNext() )
{
- test.addFormatter( (FormatterElement)list.nextElement() );
+ test.addFormatter( (FormatterElement)list.next() );
}
return test;
}
1.3 +5 -5
jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/junit/DOMUtil.java
Index: DOMUtil.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/junit/DOMUtil.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- DOMUtil.java 2001/12/16 00:36:00 1.2
+++ DOMUtil.java 2001/12/21 14:21:22 1.3
@@ -7,7 +7,7 @@
*/
package org.apache.tools.ant.taskdefs.optional.junit;
-import java.util.Vector;
+import java.util.ArrayList;
import org.w3c.dom.Attr;
import org.w3c.dom.CDATASection;
import org.w3c.dom.Comment;
@@ -192,7 +192,7 @@
Node child = children.item( i );
if( filter.accept( child ) )
{
- matches.addElement( child );
+ matches.add( child );
}
if( recurse )
{
@@ -200,7 +200,7 @@
final int reclength = matches.getLength();
for( int j = 0; j < reclength; j++ )
{
- matches.addElement( recmatches.item( i ) );
+ matches.add( recmatches.item( i ) );
}
}
}
@@ -229,7 +229,7 @@
*
* @author RT
*/
- public static class NodeListImpl extends Vector implements NodeList
+ public static class NodeListImpl extends ArrayList implements NodeList
{
public int getLength()
{
@@ -240,7 +240,7 @@
{
try
{
- return (Node)elementAt( i );
+ return (Node)get( i );
}
catch( ArrayIndexOutOfBoundsException e )
{
1.3 +30 -30
jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/junit/Enumerations.java
Index: Enumerations.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/junit/Enumerations.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- Enumerations.java 2001/12/16 00:36:00 1.2
+++ Enumerations.java 2001/12/21 14:21:22 1.3
@@ -7,7 +7,7 @@
*/
package org.apache.tools.ant.taskdefs.optional.junit;
-import java.util.Enumeration;
+import java.util.Iterator;
import java.util.NoSuchElementException;
/**
@@ -16,10 +16,10 @@
*
* @author <a href="mailto:[EMAIL PROTECTED]">Stephane Bailliez</a>
*/
-public final class Enumerations
+public final class Iterators
{
- private Enumerations()
+ private Iterators()
{
}
@@ -29,9 +29,9 @@
* @param array the array of object to enumerate.
* @return the enumeration over the array of objects.
*/
- public static Enumeration fromArray( Object[] array )
+ public static Iterator fromArray( Object[] array )
{
- return new ArrayEnumeration( array );
+ return new ArrayIterator( array );
}
/**
@@ -42,9 +42,9 @@
* @param enums the array of enumerations.
* @return the enumeration over the array of enumerations.
*/
- public static Enumeration fromCompound( Enumeration[] enums )
+ public static Iterator fromCompound( Iterator[] enums )
{
- return new CompoundEnumeration( enums );
+ return new CompoundIterator( enums );
}
}
@@ -54,7 +54,7 @@
*
* @author <a href="mailto:[EMAIL PROTECTED]">Stephane Bailliez</a>
*/
-class ArrayEnumeration implements Enumeration
+class ArrayIterator implements Iterator
{
/**
@@ -72,7 +72,7 @@
*
* @param array the array of object to enumerate.
*/
- public ArrayEnumeration( Object[] array )
+ public ArrayIterator( Object[] array )
{
this.array = array;
this.pos = 0;
@@ -84,7 +84,7 @@
* @return <code>true</code> if and only if this enumeration object
contains
* at least one more element to provide; <code>false</code>
otherwise.
*/
- public boolean hasMoreElements()
+ public boolean hasNext()
{
return ( pos < array.length );
}
@@ -96,10 +96,10 @@
* @return the next element of this enumeration.
* @throws NoSuchElementException if no more elements exist.
*/
- public Object nextElement()
+ public Object next()
throws NoSuchElementException
{
- if( hasMoreElements() )
+ if( hasNext() )
{
Object o = array[ pos ];
pos++;
@@ -111,32 +111,32 @@
/**
* Convenient enumeration over an array of enumeration. For example: <pre>
- * Enumeration e1 = v1.elements();
- * while (e1.hasMoreElements()){
+ * Iterator e1 = v1.iterator();
+ * while (e1.hasNext()){
* // do something
* }
- * Enumeration e2 = v2.elements();
- * while (e2.hasMoreElements()){
+ * Iterator e2 = v2.iterator();
+ * while (e2.hasNext()){
* // do the same thing
* }
* </pre> can be written as: <pre>
- * Enumeration[] enums = { v1.elements(), v2.elements() };
- * Enumeration e = Enumerations.fromCompound(enums);
- * while (e.hasMoreElements()){
+ * Iterator[] enums = { v1.iterator(), v2.iterator() };
+ * Iterator e = Iterators.fromCompound(enums);
+ * while (e.hasNext()){
* // do something
* }
* </pre> Note that the enumeration will skip null elements in the array. The
* following is thus possible: <pre>
- * Enumeration[] enums = { v1.elements(), null, v2.elements() }; // a null
enumeration in the array
- * Enumeration e = Enumerations.fromCompound(enums);
- * while (e.hasMoreElements()){
+ * Iterator[] enums = { v1.iterator(), null, v2.iterator() }; // a null
enumeration in the array
+ * Iterator e = Iterators.fromCompound(enums);
+ * while (e.hasNext()){
* // do something
* }
* </pre>
*
* @author <a href="mailto:[EMAIL PROTECTED]">Stephane Bailliez</a>
*/
-class CompoundEnumeration implements Enumeration
+class CompoundIterator implements Iterator
{
/**
@@ -147,9 +147,9 @@
/**
* enumeration array
*/
- private Enumeration[] enumArray;
+ private Iterator[] enumArray;
- public CompoundEnumeration( Enumeration[] enumarray )
+ public CompoundIterator( Iterator[] enumarray )
{
this.enumArray = enumarray;
}
@@ -160,11 +160,11 @@
* @return <code>true</code> if and only if this enumeration object
contains
* at least one more element to provide; <code>false</code>
otherwise.
*/
- public boolean hasMoreElements()
+ public boolean hasNext()
{
while( index < enumArray.length )
{
- if( enumArray[ index ] != null && enumArray[ index
].hasMoreElements() )
+ if( enumArray[ index ] != null && enumArray[ index ].hasNext() )
{
return true;
}
@@ -180,12 +180,12 @@
* @return the next element of this enumeration.
* @throws NoSuchElementException if no more elements exist.
*/
- public Object nextElement()
+ public Object next()
throws NoSuchElementException
{
- if( hasMoreElements() )
+ if( hasNext() )
{
- return enumArray[ index ].nextElement();
+ return enumArray[ index ].next();
}
throw new NoSuchElementException();
}
1.9 +44 -44
jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/junit/JUnitTask.java
Index: JUnitTask.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/junit/JUnitTask.java,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- JUnitTask.java 2001/12/21 13:34:18 1.8
+++ JUnitTask.java 2001/12/21 14:21:22 1.9
@@ -12,11 +12,11 @@
import java.io.IOException;
import java.io.OutputStream;
import java.net.URL;
-import java.util.Enumeration;
+import java.util.Iterator;
import java.util.Hashtable;
import java.util.Properties;
import java.util.Random;
-import java.util.Vector;
+import java.util.ArrayList;
import org.apache.myrmidon.api.TaskException;
import org.apache.tools.ant.AntClassLoader;
import org.apache.tools.ant.Project;
@@ -104,9 +104,9 @@
{
private CommandlineJava commandline = new CommandlineJava();
- private Vector tests = new Vector();
- private Vector batchTests = new Vector();
- private Vector formatters = new Vector();
+ private ArrayList tests = new ArrayList();
+ private ArrayList batchTests = new ArrayList();
+ private ArrayList formatters = new ArrayList();
private File dir = null;
private Integer timeout = null;
@@ -147,10 +147,10 @@
*/
public void setErrorProperty( String propertyName )
{
- Enumeration enum = allTests();
- while( enum.hasMoreElements() )
+ Iterator enum = allTests();
+ while( enum.hasNext() )
{
- BaseTest test = (BaseTest)enum.nextElement();
+ BaseTest test = (BaseTest)enum.next();
test.setErrorProperty( propertyName );
}
}
@@ -165,10 +165,10 @@
*/
public void setFailureProperty( String propertyName )
{
- Enumeration enum = allTests();
- while( enum.hasMoreElements() )
+ Iterator enum = allTests();
+ while( enum.hasNext() )
{
- BaseTest test = (BaseTest)enum.nextElement();
+ BaseTest test = (BaseTest)enum.next();
test.setFailureProperty( propertyName );
}
}
@@ -184,10 +184,10 @@
*/
public void setFiltertrace( boolean value )
{
- Enumeration enum = allTests();
- while( enum.hasMoreElements() )
+ Iterator enum = allTests();
+ while( enum.hasNext() )
{
- BaseTest test = (BaseTest)enum.nextElement();
+ BaseTest test = (BaseTest)enum.next();
test.setFiltertrace( value );
}
}
@@ -204,10 +204,10 @@
*/
public void setFork( boolean value )
{
- Enumeration enum = allTests();
- while( enum.hasMoreElements() )
+ Iterator enum = allTests();
+ while( enum.hasNext() )
{
- BaseTest test = (BaseTest)enum.nextElement();
+ BaseTest test = (BaseTest)enum.next();
test.setFork( value );
}
}
@@ -221,10 +221,10 @@
*/
public void setHaltonerror( boolean value )
{
- Enumeration enum = allTests();
- while( enum.hasMoreElements() )
+ Iterator enum = allTests();
+ while( enum.hasNext() )
{
- BaseTest test = (BaseTest)enum.nextElement();
+ BaseTest test = (BaseTest)enum.next();
test.setHaltonerror( value );
}
}
@@ -238,10 +238,10 @@
*/
public void setHaltonfailure( boolean value )
{
- Enumeration enum = allTests();
- while( enum.hasMoreElements() )
+ Iterator enum = allTests();
+ while( enum.hasNext() )
{
- BaseTest test = (BaseTest)enum.nextElement();
+ BaseTest test = (BaseTest)enum.next();
test.setHaltonfailure( value );
}
}
@@ -310,7 +310,7 @@
*/
public void addFormatter( FormatterElement fe )
{
- formatters.addElement( fe );
+ formatters.add( fe );
}
/**
@@ -332,7 +332,7 @@
*/
public void addTest( JUnitTest test )
{
- tests.addElement( test );
+ tests.add( test );
}
/**
@@ -345,7 +345,7 @@
public BatchTest createBatchTest()
{
BatchTest test = new BatchTest( getProject() );
- batchTests.addElement( test );
+ batchTests.add( test );
return test;
}
@@ -388,10 +388,10 @@
addClasspathEntry( "/org/apache/tools/ant/Task.class" );
addClasspathEntry(
"/org/apache/tools/ant/taskdefs/optional/junit/JUnitTestRunner.class" );
- Enumeration list = getIndividualTests();
- while( list.hasMoreElements() )
+ Iterator list = getIndividualTests();
+ while( list.hasNext() )
{
- JUnitTest test = (JUnitTest)list.nextElement();
+ JUnitTest test = (JUnitTest)list.next();
if( test.shouldRun( getProject() ) )
{
execute( test );
@@ -415,16 +415,16 @@
*
* @return The IndividualTests value
*/
- protected Enumeration getIndividualTests()
+ protected Iterator getIndividualTests()
{
- Enumeration[] enums = new Enumeration[ batchTests.size() + 1 ];
+ Iterator[] enums = new Iterator[ batchTests.size() + 1 ];
for( int i = 0; i < batchTests.size(); i++ )
{
- BatchTest batchtest = (BatchTest)batchTests.elementAt( i );
- enums[ i ] = batchtest.elements();
+ BatchTest batchtest = (BatchTest)batchTests.get( i );
+ enums[ i ] = batchtest.iterator();
}
- enums[ enums.length - 1 ] = tests.elements();
- return Enumerations.fromCompound( enums );
+ enums[ enums.length - 1 ] = tests.iterator();
+ return Iterators.fromCompound( enums );
}
/**
@@ -490,10 +490,10 @@
}
}
- protected Enumeration allTests()
+ protected Iterator allTests()
{
- Enumeration[] enums = {tests.elements(), batchTests.elements()};
- return Enumerations.fromCompound( enums );
+ Iterator[] enums = {tests.iterator(), batchTests.iterator()};
+ return Iterators.fromCompound( enums );
}
/**
@@ -657,9 +657,9 @@
cmd.createArgument().setValue( "propsfile=" +
propsFile.getAbsolutePath() );
Hashtable p = getProject().getProperties();
Properties props = new Properties();
- for( Enumeration enum = p.keys(); enum.hasMoreElements(); )
+ for( Iterator enum = p.keys(); enum.hasNext(); )
{
- Object key = enum.nextElement();
+ Object key = enum.next();
props.put( key, p.get( key ) );
}
try
@@ -778,10 +778,10 @@
private FormatterElement[] mergeFormatters( JUnitTest test )
{
- Vector feVector = (Vector)formatters.clone();
- test.addFormattersTo( feVector );
- FormatterElement[] feArray = new FormatterElement[ feVector.size() ];
- feVector.copyInto( feArray );
+ ArrayList feArrayList = (ArrayList)formatters.clone();
+ test.addFormattersTo( feArrayList );
+ FormatterElement[] feArray = new FormatterElement[
feArrayList.size() ];
+ feArrayList.copyInto( feArray );
return feArray;
}
1.3 +6 -6
jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/junit/JUnitTest.java
Index: JUnitTest.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/junit/JUnitTest.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- JUnitTest.java 2001/12/16 00:36:00 1.2
+++ JUnitTest.java 2001/12/21 14:21:22 1.3
@@ -7,10 +7,10 @@
*/
package org.apache.tools.ant.taskdefs.optional.junit;
-import java.util.Enumeration;
+import java.util.Iterator;
import java.util.Hashtable;
import java.util.Properties;
-import java.util.Vector;
+import java.util.ArrayList;
import org.apache.tools.ant.Project;
/**
@@ -96,9 +96,9 @@
public void setProperties( Hashtable p )
{
props = new Properties();
- for( Enumeration enum = p.keys(); enum.hasMoreElements(); )
+ for( Iterator enum = p.keys(); enum.hasNext(); )
{
- Object key = enum.nextElement();
+ Object key = enum.next();
props.put( key, p.get( key ) );
}
}
@@ -180,12 +180,12 @@
*
* @param v The feature to be added to the FormattersTo attribute
*/
- void addFormattersTo( Vector v )
+ void addFormattersTo( ArrayList v )
{
final int count = formatters.size();
for( int i = 0; i < count; i++ )
{
- v.addElement( formatters.elementAt( i ) );
+ v.add( formatters.get( i ) );
}
}
}
1.4 +14 -14
jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/junit/JUnitTestRunner.java
Index: JUnitTestRunner.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/junit/JUnitTestRunner.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- JUnitTestRunner.java 2001/12/21 13:28:31 1.3
+++ JUnitTestRunner.java 2001/12/21 14:21:22 1.4
@@ -17,10 +17,10 @@
import java.io.StringReader;
import java.io.StringWriter;
import java.lang.reflect.Method;
-import java.util.Enumeration;
+import java.util.Iterator;
import java.util.Hashtable;
import java.util.Properties;
-import java.util.Vector;
+import java.util.ArrayList;
import junit.framework.AssertionFailedError;
import junit.framework.Test;
import junit.framework.TestListener;
@@ -85,12 +85,12 @@
"org.apache.tools.ant."
};
- private static Vector fromCmdLine = new Vector();
+ private static ArrayList fromCmdLine = new ArrayList();
/**
* Holds the registered formatters.
*/
- private Vector formatters = new Vector();
+ private ArrayList formatters = new ArrayList();
/**
* Do we stop on errors.
@@ -395,9 +395,9 @@
// Add/overlay system properties on the properties from the Ant
project
Hashtable p = System.getProperties();
- for( Enumeration enum = p.keys(); enum.hasMoreElements(); )
+ for( Iterator enum = p.keys(); enum.hasNext(); )
{
- Object key = enum.nextElement();
+ Object key = enum.next();
props.put( key, p.get( key ) );
}
t.setProperties( props );
@@ -430,7 +430,7 @@
fe.setClassname( line.substring( 0, pos ) );
fe.setOutfile( new File( line.substring( pos + 1 ) ) );
}
- fromCmdLine.addElement( fe.createFormatter() );
+ fromCmdLine.add( fe.createFormatter() );
}
private static boolean filterLine( String line )
@@ -449,7 +449,7 @@
{
for( int i = 0; i < fromCmdLine.size(); i++ )
{
- runner.addFormatter(
(JUnitResultFormatter)fromCmdLine.elementAt( i ) );
+ runner.addFormatter( (JUnitResultFormatter)fromCmdLine.get( i )
);
}
}
@@ -510,7 +510,7 @@
public void addFormatter( JUnitResultFormatter f )
{
- formatters.addElement( f );
+ formatters.add( f );
}
/**
@@ -530,7 +530,7 @@
res.addListener( this );
for( int i = 0; i < formatters.size(); i++ )
{
- res.addListener( (TestListener)formatters.elementAt( i ) );
+ res.addListener( (TestListener)formatters.get( i ) );
}
long start = System.currentTimeMillis();
@@ -540,7 +540,7 @@
{// had an exception in the constructor
for( int i = 0; i < formatters.size(); i++ )
{
- ( (TestListener)formatters.elementAt( i ) ).addError( null,
+ ( (TestListener)formatters.get( i ) ).addError( null,
exception );
}
junitTest.setCounts( 1, 0, 1 );
@@ -616,7 +616,7 @@
{
for( int i = 0; i < formatters.size(); i++ )
{
- ( (JUnitResultFormatter)formatters.elementAt( i )
).endTestSuite( junitTest );
+ ( (JUnitResultFormatter)formatters.get( i ) ).endTestSuite(
junitTest );
}
}
@@ -624,7 +624,7 @@
{
for( int i = 0; i < formatters.size(); i++ )
{
- ( (JUnitResultFormatter)formatters.elementAt( i )
).startTestSuite( junitTest );
+ ( (JUnitResultFormatter)formatters.get( i ) ).startTestSuite(
junitTest );
}
}
@@ -633,7 +633,7 @@
for( int i = 0; i < formatters.size(); i++ )
{
JUnitResultFormatter formatter =
- ( (JUnitResultFormatter)formatters.elementAt( i ) );
+ ( (JUnitResultFormatter)formatters.get( i ) );
formatter.setSystemOutput( out );
formatter.setSystemError( err );
1.3 +4 -4
jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/junit/XMLJUnitResultFormatter.java
Index: XMLJUnitResultFormatter.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/junit/XMLJUnitResultFormatter.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- XMLJUnitResultFormatter.java 2001/12/16 00:36:00 1.2
+++ XMLJUnitResultFormatter.java 2001/12/21 14:21:22 1.3
@@ -11,7 +11,7 @@
import java.io.OutputStream;
import java.io.OutputStreamWriter;
import java.io.Writer;
-import java.util.Enumeration;
+import java.util.Iterator;
import java.util.Hashtable;
import java.util.Properties;
import javax.xml.parsers.DocumentBuilder;
@@ -224,10 +224,10 @@
Properties props = suite.getProperties();
if( props != null )
{
- Enumeration e = props.propertyNames();
- while( e.hasMoreElements() )
+ Iterator e = props.propertyNames();
+ while( e.hasNext() )
{
- String name = (String)e.nextElement();
+ String name = (String)e.next();
Element propElement = doc.createElement( PROPERTY );
propElement.setAttribute( ATTR_NAME, name );
propElement.setAttribute( ATTR_VALUE, props.getProperty(
name ) );
1.7 +12 -12
jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/junit/XMLResultAggregator.java
Index: XMLResultAggregator.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/junit/XMLResultAggregator.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- XMLResultAggregator.java 2001/12/21 13:34:18 1.6
+++ XMLResultAggregator.java 2001/12/21 14:21:22 1.7
@@ -13,8 +13,8 @@
import java.io.OutputStream;
import java.io.OutputStreamWriter;
import java.io.PrintWriter;
-import java.util.Enumeration;
-import java.util.Vector;
+import java.util.Iterator;
+import java.util.ArrayList;
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import org.apache.avalon.excalibur.io.FileUtil;
@@ -62,9 +62,9 @@
/**
* the list of all filesets, that should contains the xml to aggregate
*/
- protected Vector filesets = new Vector();
+ protected ArrayList filesets = new ArrayList();
- protected Vector transformers = new Vector();
+ protected ArrayList transformers = new ArrayList();
/**
* the directory to write the file to
@@ -129,13 +129,13 @@
*/
public void addFileSet( FileSet fs )
{
- filesets.addElement( fs );
+ filesets.add( fs );
}
public AggregateTransformer createReport()
{
AggregateTransformer transformer = new AggregateTransformer( this );
- transformers.addElement( transformer );
+ transformers.add( transformer );
return transformer;
}
@@ -161,11 +161,11 @@
throw new TaskException( "Unable to write test aggregate to '" +
destFile + "'", e );
}
// apply transformation
- Enumeration enum = transformers.elements();
- while( enum.hasMoreElements() )
+ Iterator enum = transformers.iterator();
+ while( enum.hasNext() )
{
AggregateTransformer transformer =
- (AggregateTransformer)enum.nextElement();
+ (AggregateTransformer)enum.next();
transformer.setXmlDocument( rootElement.getOwnerDocument() );
transformer.transform();
}
@@ -197,11 +197,11 @@
*/
protected File[] getFiles()
{
- Vector v = new Vector();
+ ArrayList v = new ArrayList();
final int size = filesets.size();
for( int i = 0; i < size; i++ )
{
- FileSet fs = (FileSet)filesets.elementAt( i );
+ FileSet fs = (FileSet)filesets.get( i );
DirectoryScanner ds = fs.getDirectoryScanner( getProject() );
ds.scan();
String[] f = ds.getIncludedFiles();
@@ -213,7 +213,7 @@
File file = new File( ds.getBasedir(), pathname );
file = FileUtil.
resolveFile( getProject().getBaseDir(),
file.getPath() );
- v.addElement( file );
+ v.add( file );
}
}
}
1.6 +14 -14
jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/metamata/AbstractMetamataTask.java
Index: AbstractMetamataTask.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/metamata/AbstractMetamataTask.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- AbstractMetamataTask.java 2001/12/21 13:34:18 1.5
+++ AbstractMetamataTask.java 2001/12/21 14:21:22 1.6
@@ -11,10 +11,10 @@
import java.io.FileWriter;
import java.io.IOException;
import java.io.PrintWriter;
-import java.util.Enumeration;
+import java.util.Iterator;
import java.util.Hashtable;
import java.util.Random;
-import java.util.Vector;
+import java.util.ArrayList;
import org.apache.myrmidon.api.TaskException;
import org.apache.tools.ant.DirectoryScanner;
import org.apache.tools.ant.Project;
@@ -65,7 +65,7 @@
/**
* the set of files to be audited
*/
- protected Vector fileSets = new Vector();
+ protected ArrayList fileSets = new ArrayList();
/**
* the options file where are stored the command line options
@@ -94,14 +94,14 @@
/**
* convenient method for JDK 1.1. Will copy all elements from src to dest
*
- * @param dest The feature to be added to the AllVector attribute
- * @param files The feature to be added to the AllVector attribute
+ * @param dest The feature to be added to the AllArrayList attribute
+ * @param files The feature to be added to the AllArrayList attribute
*/
- protected final static void addAllVector( Vector dest, Enumeration files
)
+ protected final static void addAllArrayList( ArrayList dest, Iterator
files )
{
- while( files.hasMoreElements() )
+ while( files.hasNext() )
{
- dest.addElement( files.nextElement() );
+ dest.add( files.next() );
}
}
@@ -147,7 +147,7 @@
*/
public void addFileSet( FileSet fs )
{
- fileSets.addElement( fs );
+ fileSets.add( fs );
}
/**
@@ -234,7 +234,7 @@
log( includedFiles.size() + " files added for audit",
Project.MSG_VERBOSE );
// write all the options to a temp file and use it ro run the process
- Vector options = getOptions();
+ ArrayList options = getOptions();
optionsFile = createTmpFile();
generateOptionsFile( optionsFile, options );
Commandline.Argument args = cmdl.createArgument();
@@ -262,7 +262,7 @@
*
* @return The Options value
*/
- protected abstract Vector getOptions();
+ protected abstract ArrayList getOptions();
/**
* validate options set
@@ -330,7 +330,7 @@
}
}
- protected void generateOptionsFile( File tofile, Vector options )
+ protected void generateOptionsFile( File tofile, ArrayList options )
throws TaskException
{
FileWriter fw = null;
@@ -341,7 +341,7 @@
final int size = options.size();
for( int i = 0; i < size; i++ )
{
- pw.println( options.elementAt( i ) );
+ pw.println( options.get( i ) );
}
pw.flush();
}
@@ -373,7 +373,7 @@
Hashtable files = new Hashtable();
for( int i = 0; i < fileSets.size(); i++ )
{
- FileSet fs = (FileSet)fileSets.elementAt( i );
+ FileSet fs = (FileSet)fileSets.get( i );
DirectoryScanner ds = fs.getDirectoryScanner( getProject() );
ds.scan();
String[] f = ds.getIncludedFiles();
1.6 +14 -14
jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/metamata/MAudit.java
Index: MAudit.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/metamata/MAudit.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- MAudit.java 2001/12/21 13:34:18 1.5
+++ MAudit.java 2001/12/21 14:21:22 1.6
@@ -11,7 +11,7 @@
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStream;
-import java.util.Vector;
+import java.util.ArrayList;
import org.apache.myrmidon.api.TaskException;
import org.apache.tools.ant.Project;
import org.apache.tools.ant.taskdefs.exec.ExecuteStreamHandler;
@@ -140,9 +140,9 @@
return searchPath;
}
- protected Vector getOptions()
+ protected ArrayList getOptions()
{
- Vector options = new Vector( 512 );
+ ArrayList options = new ArrayList( 512 );
// there is a bug in Metamata 2.0 build 37. The sourcepath argument
does
// not work. So we will use the sourcepath prepended to classpath.
(order
// is important since Metamata looks at .class and .java)
@@ -156,37 +156,37 @@
// don't forget to modify the pattern if you change the options
reporting
if( classPath != null )
{
- options.addElement( "-classpath" );
- options.addElement( classPath.toString() );
+ options.add( "-classpath" );
+ options.add( classPath.toString() );
}
// suppress copyright msg when running, we will let it so that this
// will be the only output to the console if in xml mode
- // options.addElement("-quiet");
+ // options.add("-quiet");
if( fix )
{
- options.addElement( "-fix" );
+ options.add( "-fix" );
}
- options.addElement( "-fullpath" );
+ options.add( "-fullpath" );
// generate .maudit files much more detailed than the report
// I don't like it very much, I think it could be interesting
// to get all .maudit files and include them in the XML.
if( list )
{
- options.addElement( "-list" );
+ options.add( "-list" );
}
if( sourcePath != null )
{
- options.addElement( "-sourcepath" );
- options.addElement( sourcePath.toString() );
+ options.add( "-sourcepath" );
+ options.add( sourcePath.toString() );
}
if( unused )
{
- options.addElement( "-unused" );
- options.addElement( searchPath.toString() );
+ options.add( "-unused" );
+ options.add( searchPath.toString() );
}
- addAllVector( options, includedFiles.keys() );
+ addAllArrayList( options, includedFiles.keys() );
return options;
}
1.5 +13 -13
jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/metamata/MAuditStreamHandler.java
Index: MAuditStreamHandler.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/metamata/MAuditStreamHandler.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- MAuditStreamHandler.java 2001/12/17 09:50:12 1.4
+++ MAuditStreamHandler.java 2001/12/21 14:21:22 1.5
@@ -14,9 +14,9 @@
import java.io.OutputStream;
import java.io.OutputStreamWriter;
import java.io.Writer;
-import java.util.Enumeration;
+import java.util.Iterator;
import java.util.Hashtable;
-import java.util.Vector;
+import java.util.ArrayList;
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import org.apache.tools.ant.Project;
@@ -145,15 +145,15 @@
// this is the only code that could be needed to be overrided
Document doc = getDocumentBuilder().newDocument();
Element rootElement = doc.createElement( "classes" );
- Enumeration keys = auditedFiles.keys();
+ Iterator keys = auditedFiles.keys();
Hashtable filemapping = task.getFileMapping();
rootElement.setAttribute( "audited", String.valueOf(
filemapping.size() ) );
rootElement.setAttribute( "reported", String.valueOf(
auditedFiles.size() ) );
int errors = 0;
- while( keys.hasMoreElements() )
+ while( keys.hasNext() )
{
- String filepath = (String)keys.nextElement();
- Vector v = (Vector)auditedFiles.get( filepath );
+ String filepath = (String)keys.next();
+ ArrayList v = (ArrayList)auditedFiles.get( filepath );
String fullclassname = (String)filemapping.get( filepath );
if( fullclassname == null )
{
@@ -170,7 +170,7 @@
errors += v.size();
for( int i = 0; i < v.size(); i++ )
{
- MAudit.Violation violation = (MAudit.Violation)v.elementAt(
i );
+ MAudit.Violation violation = (MAudit.Violation)v.get( i );
Element error = doc.createElement( "violation" );
error.setAttribute( "line", String.valueOf( violation.line )
);
error.setAttribute( "message", violation.error );
@@ -223,11 +223,11 @@
*/
protected void addViolationEntry( String file, MAudit.Violation entry )
{
- Vector violations = (Vector)auditedFiles.get( file );
+ ArrayList violations = (ArrayList)auditedFiles.get( file );
// if there is no decl for this file yet, create it.
if( violations == null )
{
- violations = new Vector();
+ violations = new ArrayList();
auditedFiles.put( file, violations );
}
violations.add( entry );
@@ -253,12 +253,12 @@
// There will obviouslly be a problem if the message is on several
lines...
protected void processLine( String line )
{
- Vector matches = matcher.getGroups( line );
+ ArrayList matches = matcher.getGroups( line );
if( matches != null )
{
- String file = (String)matches.elementAt( 1 );
- int lineNum = Integer.parseInt( (String)matches.elementAt( 2 ) );
- String msg = (String)matches.elementAt( 3 );
+ String file = (String)matches.get( 1 );
+ int lineNum = Integer.parseInt( (String)matches.get( 2 ) );
+ String msg = (String)matches.get( 3 );
addViolationEntry( file, MAudit.createViolation( lineNum, msg )
);
}
else
1.5 +15 -15
jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/metamata/MMetrics.java
Index: MMetrics.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/metamata/MMetrics.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- MMetrics.java 2001/12/21 13:34:18 1.4
+++ MMetrics.java 2001/12/21 14:21:22 1.5
@@ -11,7 +11,7 @@
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
-import java.util.Vector;
+import java.util.ArrayList;
import org.apache.myrmidon.api.TaskException;
import org.apache.tools.ant.Project;
import org.apache.tools.ant.taskdefs.exec.ExecuteStreamHandler;
@@ -118,9 +118,9 @@
return path;
}
- protected Vector getOptions()
+ protected ArrayList getOptions()
{
- Vector options = new Vector( 512 );
+ ArrayList options = new ArrayList( 512 );
// there is a bug in Metamata 2.0 build 37. The sourcepath argument
does
// not work. So we will use the sourcepath prepended to classpath.
(order
// is important since Metamata looks at .class and .java)
@@ -134,34 +134,34 @@
// don't forget to modify the pattern if you change the options
reporting
if( classPath != null )
{
- options.addElement( "-classpath" );
- options.addElement( classPath );
+ options.add( "-classpath" );
+ options.add( classPath );
}
- options.addElement( "-output" );
- options.addElement( tmpFile.toString() );
+ options.add( "-output" );
+ options.add( tmpFile.toString() );
- options.addElement( "-" + granularity );
+ options.add( "-" + granularity );
// display the metamata copyright
- // options.addElement( "-quiet");
- options.addElement( "-format" );
+ // options.add( "-quiet");
+ options.add( "-format" );
// need this because that's what the handler is using, it's
// way easier to process than any other separator
- options.addElement( "tab" );
+ options.add( "tab" );
// specify a / as the indent character, used by the handler.
- options.addElement( "-i" );
- options.addElement( "/" );
+ options.add( "-i" );
+ options.add( "/" );
// directories
String[] dirs = path.list();
for( int i = 0; i < dirs.length; i++ )
{
- options.addElement( dirs[ i ] );
+ options.add( dirs[ i ] );
}
// files next.
- addAllVector( options, includedFiles.keys() );
+ addAllArrayList( options, includedFiles.keys() );
return options;
}
1.4 +14 -14
jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/metamata/MMetricsStreamHandler.java
Index: MMetricsStreamHandler.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/metamata/MMetricsStreamHandler.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- MMetricsStreamHandler.java 2001/12/17 09:50:12 1.3
+++ MMetricsStreamHandler.java 2001/12/21 14:21:22 1.4
@@ -17,9 +17,9 @@
import java.text.NumberFormat;
import java.text.ParseException;
import java.util.EmptyStackException;
-import java.util.Enumeration;
+import java.util.Iterator;
import java.util.Stack;
-import java.util.Vector;
+import java.util.ArrayList;
import javax.xml.transform.OutputKeys;
import javax.xml.transform.Transformer;
import javax.xml.transform.TransformerFactory;
@@ -270,10 +270,10 @@
int i = 0;
String name = ATTRIBUTES[ i++ ];
impl.addAttribute( "", name, name, "CDATA", elem.getName() );
- Enumeration metrics = elem.getMetrics();
- for( ; metrics.hasMoreElements(); i++ )
+ Iterator metrics = elem.getMetrics();
+ for( ; metrics.hasNext(); i++ )
{
- String value = (String)metrics.nextElement();
+ String value = (String)metrics.next();
if( value.length() > 0 )
{
name = ATTRIBUTES[ i ];
@@ -408,7 +408,7 @@
private int indent;
- private Vector metrics;
+ private ArrayList metrics;
static
{
@@ -422,7 +422,7 @@
NEUTRAL_NF.setMaximumFractionDigits( 1 );
}
- MetricsElement( int indent, String construct, Vector metrics )
+ MetricsElement( int indent, String construct, ArrayList metrics )
{
this.indent = indent;
this.construct = construct;
@@ -432,7 +432,7 @@
public static MetricsElement parse( String line )
throws ParseException
{
- final Vector metrics = new Vector();
+ final ArrayList metrics = new ArrayList();
int pos;
// i'm using indexOf since I need to know if there are empty strings
@@ -447,10 +447,10 @@
* token = NEUTRAL_NF.format(num.doubleValue()); // and format
with a neutral NF
* }
*/
- metrics.addElement( token );
+ metrics.add( token );
line = line.substring( pos + 1 );
}
- metrics.addElement( line );
+ metrics.add( line );
// there should be exactly 14 tokens (1 name + 13 metrics), if not,
there is a problem !
if( metrics.size() != 14 )
@@ -462,8 +462,8 @@
// construct name, we'll need all this to figure out what type of
// construct it is since we lost all semantics :(
// (#indent[/]*)(#construct.*)
- String name = (String)metrics.elementAt( 0 );
- metrics.removeElementAt( 0 );
+ String name = (String)metrics.get( 0 );
+ metrics.remove( 0 );
int indent = 0;
pos = name.lastIndexOf( '/' );
if( pos != -1 )
@@ -479,9 +479,9 @@
return indent;
}
- public Enumeration getMetrics()
+ public Iterator getMetrics()
{
- return metrics.elements();
+ return metrics.iterator();
}
public String getName()
1.8 +13 -13
jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/metamata/MParse.java
Index: MParse.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/metamata/MParse.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- MParse.java 2001/12/21 13:34:18 1.7
+++ MParse.java 2001/12/21 14:21:22 1.8
@@ -12,7 +12,7 @@
import java.io.IOException;
import java.io.PrintWriter;
import java.util.Random;
-import java.util.Vector;
+import java.util.ArrayList;
import org.apache.myrmidon.api.TaskException;
import org.apache.tools.ant.Project;
import org.apache.tools.ant.Task;
@@ -238,9 +238,9 @@
*/
protected File[] getMetamataLibs()
{
- Vector files = new Vector();
- files.addElement( new File( metahome, "lib/metamata.jar" ) );
- files.addElement( new File( metahome, "bin/lib/JavaCC.zip" ) );
+ ArrayList files = new ArrayList();
+ files.add( new File( metahome, "lib/metamata.jar" ) );
+ files.add( new File( metahome, "bin/lib/JavaCC.zip" ) );
File[] array = new File[ files.size() ];
files.copyInto( array );
@@ -254,30 +254,30 @@
*/
protected String[] getOptions()
{
- Vector options = new Vector();
+ ArrayList options = new ArrayList();
if( verbose )
{
- options.addElement( "-verbose" );
+ options.add( "-verbose" );
}
if( debugscanner )
{
- options.addElement( "-ds" );
+ options.add( "-ds" );
}
if( debugparser )
{
- options.addElement( "-dp" );
+ options.add( "-dp" );
}
if( classpath != null )
{
- options.addElement( "-classpath" );
- options.addElement( classpath.toString() );
+ options.add( "-classpath" );
+ options.add( classpath.toString() );
}
if( sourcepath != null )
{
- options.addElement( "-sourcepath" );
- options.addElement( sourcepath.toString() );
+ options.add( "-sourcepath" );
+ options.add( sourcepath.toString() );
}
- options.addElement( target.getAbsolutePath() );
+ options.add( target.getAbsolutePath() );
String[] array = new String[ options.size() ];
options.copyInto( array );
1.6 +21 -21
jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/net/FTP.java
Index: FTP.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/net/FTP.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- FTP.java 2001/12/21 13:34:18 1.5
+++ FTP.java 2001/12/21 14:21:22 1.6
@@ -21,7 +21,7 @@
import java.io.InputStream;
import java.io.OutputStream;
import java.util.Locale;
-import java.util.Vector;
+import java.util.ArrayList;
import org.apache.myrmidon.api.TaskException;
import org.apache.tools.ant.DirectoryScanner;
import org.apache.tools.ant.FileScanner;
@@ -81,8 +81,8 @@
private boolean verbose = false;
private boolean newerOnly = false;
private int action = SEND_FILES;
- private Vector filesets = new Vector();
- private Vector dirCache = new Vector();
+ private ArrayList filesets = new ArrayList();
+ private ArrayList dirCache = new ArrayList();
private int transferred = 0;
private String remoteFileSep = "/";
private int port = 21;
@@ -270,7 +270,7 @@
*/
public void addFileset( FileSet set )
{
- filesets.addElement( set );
+ filesets.add( set );
}
/**
@@ -547,19 +547,19 @@
protected void createParents( FTPClient ftp, String filename )
throws IOException, TaskException
{
- Vector parents = new Vector();
+ ArrayList parents = new ArrayList();
File dir = new File( filename );
String dirname;
while( ( dirname = dir.getParent() ) != null )
{
dir = new File( dirname );
- parents.addElement( dir );
+ parents.add( dir );
}
for( int i = parents.size() - 1; i >= 0; i-- )
{
- dir = (File)parents.elementAt( i );
+ dir = (File)parents.get( i );
if( !dirCache.contains( dir ) )
{
log( "creating remote directory " + resolveFile(
dir.getPath() ),
@@ -577,7 +577,7 @@
"could not create directory: " +
ftp.getReplyString() );
}
- dirCache.addElement( dir );
+ dirCache.add( dir );
}
}
}
@@ -899,7 +899,7 @@
// get files from filesets
for( int i = 0; i < filesets.size(); i++ )
{
- FileSet fs = (FileSet)filesets.elementAt( i );
+ FileSet fs = (FileSet)filesets.get( i );
if( fs != null )
{
transferFiles( ftp, fs );
@@ -979,12 +979,12 @@
excludes = new String[ 0 ];
}
- filesIncluded = new Vector();
- filesNotIncluded = new Vector();
- filesExcluded = new Vector();
- dirsIncluded = new Vector();
- dirsNotIncluded = new Vector();
- dirsExcluded = new Vector();
+ filesIncluded = new ArrayList();
+ filesNotIncluded = new ArrayList();
+ filesExcluded = new ArrayList();
+ dirsIncluded = new ArrayList();
+ dirsNotIncluded = new ArrayList();
+ dirsExcluded = new ArrayList();
try
{
@@ -1026,7 +1026,7 @@
{
if( !isExcluded( name ) )
{
- dirsIncluded.addElement( name );
+ dirsIncluded.add( name );
if( fast )
{
scandir( name, vpath + name +
File.separator, fast );
@@ -1034,12 +1034,12 @@
}
else
{
- dirsExcluded.addElement( name );
+ dirsExcluded.add( name );
}
}
else
{
- dirsNotIncluded.addElement( name );
+ dirsNotIncluded.add( name );
if( fast && couldHoldIncluded( name ) )
{
scandir( name, vpath + name +
File.separator, fast );
@@ -1059,16 +1059,16 @@
{
if( !isExcluded( name ) )
{
- filesIncluded.addElement( name );
+ filesIncluded.add( name );
}
else
{
- filesExcluded.addElement( name );
+ filesExcluded.add( name );
}
}
else
{
- filesNotIncluded.addElement( name );
+ filesNotIncluded.add( name );
}
}
}
1.6 +4 -4
jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/net/MimeMail.java
Index: MimeMail.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/net/MimeMail.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- MimeMail.java 2001/12/21 13:34:18 1.5
+++ MimeMail.java 2001/12/21 14:21:22 1.6
@@ -11,7 +11,7 @@
import java.io.FileInputStream;
import java.io.IOException;
import java.util.Properties;
-import java.util.Vector;
+import java.util.ArrayList;
import javax.activation.DataHandler;
import javax.activation.FileDataSource;
import javax.mail.Message;
@@ -91,7 +91,7 @@
/**
* file list
*/
- private Vector filesets = new Vector();
+ private ArrayList filesets = new ArrayList();
/**
* type of the text message, plaintext by default but text/html or
text/xml
@@ -235,7 +235,7 @@
*/
public void addFileset( FileSet set )
{
- filesets.addElement( set );
+ filesets.add( set );
}
/**
@@ -305,7 +305,7 @@
for( int i = 0; i < filesets.size(); i++ )
{
- FileSet fs = (FileSet)filesets.elementAt( i );
+ FileSet fs = (FileSet)filesets.get( i );
if( fs != null )
{
DirectoryScanner ds = fs.getDirectoryScanner( getProject() );
1.4 +9 -9
jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/net/TelnetTask.java
Index: TelnetTask.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/net/TelnetTask.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- TelnetTask.java 2001/12/16 00:35:13 1.3
+++ TelnetTask.java 2001/12/21 14:21:22 1.4
@@ -12,8 +12,8 @@
import java.io.InputStream;
import java.io.OutputStream;
import java.util.Calendar;
-import java.util.Enumeration;
-import java.util.Vector;
+import java.util.Iterator;
+import java.util.ArrayList;
import org.apache.myrmidon.api.TaskException;
import org.apache.tools.ant.Project;
import org.apache.tools.ant.Task;
@@ -22,7 +22,7 @@
* Class to provide automated telnet protocol support for the Ant build tool
*
* @author <a href="mailto:[EMAIL PROTECTED]">[EMAIL PROTECTED]</a>
- * @version $Revision: 1.3 $
+ * @version $Revision: 1.4 $
*/
public class TelnetTask extends Task
@@ -55,7 +55,7 @@
/**
* The list of read/write commands for this session
*/
- private Vector telnetTasks = new Vector();
+ private ArrayList telnetTasks = new ArrayList();
/**
* If true, adds a CR to beginning of login script
@@ -138,7 +138,7 @@
public TelnetSubTask createRead()
{
TelnetSubTask task = (TelnetSubTask)new TelnetRead();
- telnetTasks.addElement( task );
+ telnetTasks.add( task );
return task;
}
@@ -151,7 +151,7 @@
public TelnetSubTask createWrite()
{
TelnetSubTask task = (TelnetSubTask)new TelnetWrite();
- telnetTasks.addElement( task );
+ telnetTasks.add( task );
return task;
}
@@ -198,10 +198,10 @@
/**
* Process each sub command
*/
- Enumeration tasksToRun = telnetTasks.elements();
- while( tasksToRun != null && tasksToRun.hasMoreElements() )
+ Iterator tasksToRun = telnetTasks.iterator();
+ while( tasksToRun != null && tasksToRun.hasNext() )
{
- TelnetSubTask task = (TelnetSubTask)tasksToRun.nextElement();
+ TelnetSubTask task = (TelnetSubTask)tasksToRun.next();
if( task instanceof TelnetRead && defaultTimeout != null )
( (TelnetRead)task ).setDefaultTimeout( defaultTimeout );
task.execute( telnet );
1.4 +4 -4
jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/perforce/P4Add.java
Index: P4Add.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/perforce/P4Add.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- P4Add.java 2001/12/21 13:34:18 1.3
+++ P4Add.java 2001/12/21 14:21:23 1.4
@@ -8,7 +8,7 @@
package org.apache.tools.ant.taskdefs.optional.perforce;
import java.io.File;
-import java.util.Vector;
+import java.util.ArrayList;
import org.apache.myrmidon.api.TaskException;
import org.apache.tools.ant.DirectoryScanner;
import org.apache.tools.ant.Project;
@@ -81,7 +81,7 @@
public class P4Add extends P4Base
{
private String addCmd = "";
- private Vector filesets = new Vector();
+ private ArrayList filesets = new ArrayList();
private int m_cmdLength = 450;
private int m_changelist;
@@ -105,7 +105,7 @@
public void addFileset( FileSet set )
{
- filesets.addElement( set );
+ filesets.add( set );
}
public void execute()
@@ -123,7 +123,7 @@
for( int i = 0; i < filesets.size(); i++ )
{
- FileSet fs = (FileSet)filesets.elementAt( i );
+ FileSet fs = (FileSet)filesets.get( i );
DirectoryScanner ds = fs.getDirectoryScanner( getProject() );
//File fromDir = fs.getDir(project);
1.7 +10 -10
jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/pvcs/Pvcs.java
Index: Pvcs.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/pvcs/Pvcs.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- Pvcs.java 2001/12/17 09:50:13 1.6
+++ Pvcs.java 2001/12/21 14:21:23 1.7
@@ -17,9 +17,9 @@
import java.io.IOException;
import java.text.MessageFormat;
import java.text.ParseException;
-import java.util.Enumeration;
+import java.util.Iterator;
import java.util.Random;
-import java.util.Vector;
+import java.util.ArrayList;
import org.apache.myrmidon.api.TaskException;
import org.apache.tools.ant.Project;
import org.apache.tools.ant.taskdefs.exec.Execute;
@@ -69,7 +69,7 @@
private String lineStart;
private String promotiongroup;
private String pvcsProject;
- private Vector pvcsProjects;
+ private ArrayList pvcsProjects;
private String pvcsbin;
private String repository;
private boolean updateOnly;
@@ -82,7 +82,7 @@
{
super();
pvcsProject = null;
- pvcsProjects = new Vector();
+ pvcsProjects = new ArrayList();
workspace = null;
repository = null;
pvcsbin = null;
@@ -272,9 +272,9 @@
/**
* Get name of the project in the PVCS repository
*
- * @return Vector
+ * @return ArrayList
*/
- public Vector getPvcsprojects()
+ public ArrayList getPvcsprojects()
{
return pvcsProjects;
}
@@ -311,7 +311,7 @@
*/
public void addPvcsproject( PvcsProject p )
{
- pvcsProjects.addElement( p );
+ pvcsProjects.add( p );
}
/**
@@ -349,10 +349,10 @@
commandLine.createArgument().setValue( getPvcsproject() );
if( !getPvcsprojects().isEmpty() )
{
- Enumeration e = getPvcsprojects().elements();
- while( e.hasMoreElements() )
+ Iterator e = getPvcsprojects().iterator();
+ while( e.hasNext() )
{
- String projectName = ( (PvcsProject)e.nextElement()
).getName();
+ String projectName = ( (PvcsProject)e.next() ).getName();
if( projectName == null || ( projectName.trim() ).equals( ""
) )
throw new TaskException( "name is a required attribute
of pvcsproject" );
commandLine.createArgument().setValue( projectName );
1.5 +6 -6
jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/sitraka/CovMerge.java
Index: CovMerge.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/sitraka/CovMerge.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- CovMerge.java 2001/12/17 09:50:13 1.4
+++ CovMerge.java 2001/12/21 14:21:23 1.5
@@ -12,7 +12,7 @@
import java.io.IOException;
import java.io.PrintWriter;
import java.util.Random;
-import java.util.Vector;
+import java.util.ArrayList;
import org.apache.myrmidon.api.TaskException;
import org.apache.tools.ant.DirectoryScanner;
import org.apache.tools.ant.Project;
@@ -43,7 +43,7 @@
/**
* the filesets that will get all snapshots to merge
*/
- private Vector filesets = new Vector();
+ private ArrayList filesets = new ArrayList();
private boolean verbose;
@@ -91,7 +91,7 @@
*/
public void addFileset( FileSet fs )
{
- filesets.addElement( fs );
+ filesets.add( fs );
}
/**
@@ -147,11 +147,11 @@
protected File[] getSnapshots()
throws TaskException
{
- Vector v = new Vector();
+ ArrayList v = new ArrayList();
final int size = filesets.size();
for( int i = 0; i < size; i++ )
{
- FileSet fs = (FileSet)filesets.elementAt( i );
+ FileSet fs = (FileSet)filesets.get( i );
DirectoryScanner ds = fs.getDirectoryScanner( getProject() );
ds.scan();
String[] f = ds.getIncludedFiles();
@@ -160,7 +160,7 @@
String pathname = f[ j ];
File file = new File( ds.getBasedir(), pathname );
file = resolveFile( file.getPath() );
- v.addElement( file );
+ v.add( file );
}
}
1.8 +10 -10
jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/sitraka/CovReport.java
Index: CovReport.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/sitraka/CovReport.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- CovReport.java 2001/12/21 13:34:19 1.7
+++ CovReport.java 2001/12/21 14:21:23 1.8
@@ -9,7 +9,7 @@
import java.io.File;
import java.io.IOException;
-import java.util.Vector;
+import java.util.ArrayList;
import javax.xml.transform.OutputKeys;
import javax.xml.transform.Result;
import javax.xml.transform.Source;
@@ -268,36 +268,36 @@
protected String[] getParameters()
throws TaskException
{
- Vector v = new Vector();
+ ArrayList v = new ArrayList();
if( format != null )
{
- v.addElement( "-format=" + format );
+ v.add( "-format=" + format );
}
if( type != null )
{
- v.addElement( "-type=" + type );
+ v.add( "-type=" + type );
}
if( percent != null )
{
- v.addElement( "-percent=" + percent );
+ v.add( "-percent=" + percent );
}
if( filters != null )
{
- v.addElement( "-filters=" + filters );
+ v.add( "-filters=" + filters );
}
- v.addElement( "-output=" + resolveFile( tofile.getPath() ) );
- v.addElement( "-snapshot=" + resolveFile( snapshot.getPath() ) );
+ v.add( "-output=" + resolveFile( tofile.getPath() ) );
+ v.add( "-snapshot=" + resolveFile( snapshot.getPath() ) );
// as a default -sourcepath use . in JProbe, so use project .
if( sourcePath == null )
{
sourcePath = new Path( getProject() );
sourcePath.createPath().setLocation( getBaseDirectory() );
}
- v.addElement( "-sourcepath=" + sourcePath );
+ v.add( "-sourcepath=" + sourcePath );
if( "verydetailed".equalsIgnoreCase( format ) &&
"xml".equalsIgnoreCase( type ) )
{
- v.addElement( "-inc_src_text=" + ( includeSource ? "on" : "off"
) );
+ v.add( "-inc_src_text=" + ( includeSource ? "on" : "off" ) );
}
String[] params = new String[ v.size() ];
1.6 +22 -22
jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/sitraka/Coverage.java
Index: Coverage.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/sitraka/Coverage.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- Coverage.java 2001/12/21 13:34:19 1.5
+++ Coverage.java 2001/12/21 14:21:23 1.6
@@ -14,7 +14,7 @@
import java.io.PrintWriter;
import java.io.StringWriter;
import java.util.Random;
-import java.util.Vector;
+import java.util.ArrayList;
import org.apache.myrmidon.api.TaskException;
import org.apache.tools.ant.Project;
import org.apache.tools.ant.Task;
@@ -63,7 +63,7 @@
protected int warnLevel = 0;
- protected Vector filesets = new Vector();
+ protected ArrayList filesets = new ArrayList();
protected File home;
@@ -209,7 +209,7 @@
*/
public void addFileset( FileSet fs )
{
- filesets.addElement( fs );
+ filesets.add( fs );
}
/**
@@ -327,59 +327,59 @@
protected String[] getParameters()
throws TaskException
{
- Vector params = new Vector();
- params.addElement( "-jp_function=" + function );
+ ArrayList params = new ArrayList();
+ params.add( "-jp_function=" + function );
if( vm != null )
{
- params.addElement( "-jp_vm=" + vm );
+ params.add( "-jp_vm=" + vm );
}
if( javaExe != null )
{
- params.addElement( "-jp_java_exe=" + resolveFile(
javaExe.getPath() ) );
+ params.add( "-jp_java_exe=" + resolveFile( javaExe.getPath() ) );
}
- params.addElement( "-jp_working_dir=" + workingDir.getPath() );
- params.addElement( "-jp_snapshot_dir=" + snapshotDir.getPath() );
- params.addElement( "-jp_record_from_start=" + recordFromStart );
- params.addElement( "-jp_warn=" + warnLevel );
+ params.add( "-jp_working_dir=" + workingDir.getPath() );
+ params.add( "-jp_snapshot_dir=" + snapshotDir.getPath() );
+ params.add( "-jp_record_from_start=" + recordFromStart );
+ params.add( "-jp_warn=" + warnLevel );
if( seedName != null )
{
- params.addElement( "-jp_output_file=" + seedName );
+ params.add( "-jp_output_file=" + seedName );
}
- params.addElement( "-jp_filter=" + filters.toString() );
+ params.add( "-jp_filter=" + filters.toString() );
if( triggers != null )
{
- params.addElement( "-jp_trigger=" + triggers.toString() );
+ params.add( "-jp_trigger=" + triggers.toString() );
}
if( finalSnapshot != null )
{
- params.addElement( "-jp_final_snapshot=" + finalSnapshot );
+ params.add( "-jp_final_snapshot=" + finalSnapshot );
}
- params.addElement( "-jp_exit_prompt=" + exitPrompt );
- //params.addElement("-jp_append=" + append);
- params.addElement( "-jp_track_natives=" + trackNatives );
+ params.add( "-jp_exit_prompt=" + exitPrompt );
+ //params.add("-jp_append=" + append);
+ params.add( "-jp_track_natives=" + trackNatives );
//.... now the jvm
// arguments
String[] vmargs = cmdlJava.getVmCommand().getArguments();
for( int i = 0; i < vmargs.length; i++ )
{
- params.addElement( vmargs[ i ] );
+ params.add( vmargs[ i ] );
}
// classpath
Path classpath = cmdlJava.getClasspath();
if( classpath != null && classpath.size() > 0 )
{
- params.addElement( "-classpath " + classpath.toString() );
+ params.add( "-classpath " + classpath.toString() );
}
// classname (runner or standalone)
if( cmdlJava.getClassname() != null )
{
- params.addElement( cmdlJava.getClassname() );
+ params.add( cmdlJava.getClassname() );
}
// arguments for classname
String[] args = cmdlJava.getJavaCommand().getArguments();
for( int i = 0; i < args.length; i++ )
{
- params.addElement( args[ i ] );
+ params.add( args[ i ] );
}
String[] array = new String[ params.size() ];
1.3 +5 -5
jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/sitraka/Filters.java
Index: Filters.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/sitraka/Filters.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- Filters.java 2001/12/16 00:34:34 1.2
+++ Filters.java 2001/12/21 14:21:23 1.3
@@ -7,7 +7,7 @@
*/
package org.apache.tools.ant.taskdefs.optional.sitraka;
-import java.util.Vector;
+import java.util.ArrayList;
/**
* Filters information from coverage, somewhat similar to a <tt>FileSet</tt>
.
@@ -30,7 +30,7 @@
/**
* user defined filters
*/
- protected Vector filters = new Vector();
+ protected ArrayList filters = new ArrayList();
public Filters()
{
@@ -43,12 +43,12 @@
public void addExclude( Exclude excl )
{
- filters.addElement( excl );
+ filters.add( excl );
}
public void addInclude( Include incl )
{
- filters.addElement( incl );
+ filters.add( incl );
}
public String toString()
@@ -65,7 +65,7 @@
}
for( int i = 0; i < size; i++ )
{
- buf.append( filters.elementAt( i ).toString() );
+ buf.append( filters.get( i ).toString() );
if( i < size - 1 )
{
buf.append( ',' );
1.3 +10 -10
jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/sitraka/ReportFilters.java
Index: ReportFilters.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/sitraka/ReportFilters.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- ReportFilters.java 2001/12/16 00:34:34 1.2
+++ ReportFilters.java 2001/12/21 14:21:23 1.3
@@ -7,7 +7,7 @@
*/
package org.apache.tools.ant.taskdefs.optional.sitraka;
-import java.util.Vector;
+import java.util.ArrayList;
import org.apache.tools.ant.util.regexp.RegexpMatcher;
import org.apache.tools.ant.util.regexp.RegexpMatcherFactory;
@@ -22,12 +22,12 @@
/**
* user defined filters
*/
- protected Vector filters = new Vector();
+ protected ArrayList filters = new ArrayList();
/**
* cached matcher for each filter
*/
- protected Vector matchers = null;
+ protected ArrayList matchers = null;
public ReportFilters()
{
@@ -54,8 +54,8 @@
final int size = filters.size();
for( int i = 0; i < size; i++ )
{
- FilterElement filter = (FilterElement)filters.elementAt( i );
- RegexpMatcher matcher = (RegexpMatcher)matchers.elementAt( i );
+ FilterElement filter = (FilterElement)filters.get( i );
+ RegexpMatcher matcher = (RegexpMatcher)matchers.get( i );
if( filter instanceof Include )
{
result = result || matcher.matches( methodname );
@@ -75,12 +75,12 @@
public void addExclude( Exclude excl )
{
- filters.addElement( excl );
+ filters.add( excl );
}
public void addInclude( Include incl )
{
- filters.addElement( incl );
+ filters.add( incl );
}
public int size()
@@ -95,14 +95,14 @@
{
RegexpMatcherFactory factory = new RegexpMatcherFactory();
final int size = filters.size();
- matchers = new Vector();
+ matchers = new ArrayList();
for( int i = 0; i < size; i++ )
{
- FilterElement filter = (FilterElement)filters.elementAt( i );
+ FilterElement filter = (FilterElement)filters.get( i );
RegexpMatcher matcher = factory.newRegexpMatcher();
String pattern = filter.getAsPattern();
matcher.setPattern( pattern );
- matchers.addElement( matcher );
+ matchers.add( matcher );
}
}
1.3 +4 -4
jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/sitraka/Triggers.java
Index: Triggers.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/sitraka/Triggers.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- Triggers.java 2001/12/16 00:34:34 1.2
+++ Triggers.java 2001/12/21 14:21:23 1.3
@@ -8,7 +8,7 @@
package org.apache.tools.ant.taskdefs.optional.sitraka;
import java.util.Hashtable;
-import java.util.Vector;
+import java.util.ArrayList;
import org.apache.myrmidon.api.TaskException;
/**
@@ -30,7 +30,7 @@
*/
private final static Hashtable eventMap = new Hashtable( 3 );
- protected Vector triggers = new Vector();
+ protected ArrayList triggers = new ArrayList();
static
{
@@ -51,7 +51,7 @@
public void addMethod( Method method )
{
- triggers.addElement( method );
+ triggers.add( method );
}
// -jp_trigger=ClassName.*():E:S,ClassName.MethodName():X:X
@@ -61,7 +61,7 @@
final int size = triggers.size();
for( int i = 0; i < size; i++ )
{
- buf.append( triggers.elementAt( i ).toString() );
+ buf.append( triggers.get( i ).toString() );
if( i < size - 1 )
{
buf.append( ',' );
1.3 +20 -20
jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/sitraka/XMLReport.java
Index: XMLReport.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/sitraka/XMLReport.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- XMLReport.java 2001/12/16 00:34:34 1.2
+++ XMLReport.java 2001/12/21 14:21:23 1.3
@@ -9,10 +9,10 @@
import java.io.File;
import java.io.FileInputStream;
-import java.util.Enumeration;
+import java.util.Iterator;
import java.util.Hashtable;
import java.util.NoSuchElementException;
-import java.util.Vector;
+import java.util.ArrayList;
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import org.apache.tools.ant.Project;
@@ -148,10 +148,10 @@
// Iterate over the classpath to identify reference classes
classFiles = new Hashtable();
ClassPathLoader cpl = new ClassPathLoader( classPath );
- Enumeration enum = cpl.loaders();
- while( enum.hasMoreElements() )
+ Iterator enum = cpl.loaders();
+ while( enum.hasNext() )
{
- ClassPathLoader.FileLoader fl =
(ClassPathLoader.FileLoader)enum.nextElement();
+ ClassPathLoader.FileLoader fl =
(ClassPathLoader.FileLoader)enum.next();
ClassFile[] classes = fl.getClasses();
log( "Processing " + classes.length + " classes in " +
fl.getFile() );
// process all classes
@@ -176,10 +176,10 @@
createNodeMaps();
// Make sure each class from the reference path ends up in the report
- Enumeration classes = classFiles.elements();
- while( classes.hasMoreElements() )
+ Iterator classes = classFiles.iterator();
+ while( classes.hasNext() )
{
- ClassFile cf = (ClassFile)classes.nextElement();
+ ClassFile cf = (ClassFile)classes.next();
serializeClass( cf );
}
// update the document with the stats
@@ -201,7 +201,7 @@
protected Element[] getClasses( Element pkg )
{
- Vector v = new Vector();
+ ArrayList v = new ArrayList();
NodeList children = pkg.getChildNodes();
int len = children.getLength();
for( int i = 0; i < len; i++ )
@@ -212,7 +212,7 @@
Element elem = (Element)child;
if( "class".equals( elem.getNodeName() ) )
{
- v.addElement( elem );
+ v.add( elem );
}
}
}
@@ -240,17 +240,17 @@
throw new NoSuchElementException( "Could not find 'cov.data' element
in parent '" + parent.getNodeName() + "'" );
}
- protected Vector getFilteredMethods( ClassFile classFile )
+ protected ArrayList getFilteredMethods( ClassFile classFile )
{
MethodInfo[] methodlist = classFile.getMethods();
- Vector methods = new Vector( methodlist.length );
+ ArrayList methods = new ArrayList( methodlist.length );
for( int i = 0; i < methodlist.length; i++ )
{
MethodInfo method = methodlist[ i ];
String signature = getMethodSignature( classFile, method );
if( filters.accept( signature ) )
{
- methods.addElement( method );
+ methods.add( method );
log( "keeping " + signature );
}
else
@@ -335,7 +335,7 @@
protected Element[] getPackages( Element snapshot )
{
- Vector v = new Vector();
+ ArrayList v = new ArrayList();
NodeList children = snapshot.getChildNodes();
int len = children.getLength();
for( int i = 0; i < len; i++ )
@@ -346,7 +346,7 @@
Element elem = (Element)child;
if( "package".equals( elem.getNodeName() ) )
{
- v.addElement( elem );
+ v.add( elem );
}
}
}
@@ -555,7 +555,7 @@
return;
}
- Vector methods = getFilteredMethods( classFile );
+ ArrayList methods = getFilteredMethods( classFile );
// no need to process, there are no methods to add for this class.
if( methods.size() == 0 )
{
@@ -582,7 +582,7 @@
for( int i = 0; i < methods.size(); i++ )
{
// create the method element
- MethodInfo method = (MethodInfo)methods.elementAt( i );
+ MethodInfo method = (MethodInfo)methods.get( i );
if( Utils.isAbstract( method.getAccessFlags() ) )
{
continue;// no need to report abstract methods
@@ -615,10 +615,10 @@
int total_lines = 0;
// use the map for access, all nodes should be there
- Enumeration enum = pkgMap.elements();
- while( enum.hasMoreElements() )
+ Iterator enum = pkgMap.iterator();
+ while( enum.hasNext() )
{
- Element pkgElem = (Element)enum.nextElement();
+ Element pkgElem = (Element)enum.next();
String pkgname = pkgElem.getAttribute( "name" );
Element[] classes = getClasses( pkgElem );
int pkg_calls = 0;
1.3 +25 -25
jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/sitraka/bytecode/ClassPathLoader.java
Index: ClassPathLoader.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/sitraka/bytecode/ClassPathLoader.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- ClassPathLoader.java 2001/12/16 00:34:35 1.2
+++ ClassPathLoader.java 2001/12/21 14:21:23 1.3
@@ -15,11 +15,11 @@
import java.io.FilenameFilter;
import java.io.IOException;
import java.io.InputStream;
-import java.util.Enumeration;
+import java.util.Iterator;
import java.util.Hashtable;
import java.util.NoSuchElementException;
import java.util.StringTokenizer;
-import java.util.Vector;
+import java.util.ArrayList;
import java.util.zip.ZipEntry;
import java.util.zip.ZipFile;
@@ -47,11 +47,11 @@
public ClassPathLoader( String classPath )
{
StringTokenizer st = new StringTokenizer( classPath,
File.pathSeparator );
- Vector entries = new Vector();
+ ArrayList entries = new ArrayList();
while( st.hasMoreTokens() )
{
File file = new File( st.nextToken() );
- entries.addElement( file );
+ entries.add( file );
}
files = new File[ entries.size() ];
entries.copyInto( files );
@@ -122,10 +122,10 @@
throws IOException
{
Hashtable map = new Hashtable();
- Enumeration enum = loaders();
- while( enum.hasMoreElements() )
+ Iterator enum = loaders();
+ while( enum.hasNext() )
{
- FileLoader loader = (FileLoader)enum.nextElement();
+ FileLoader loader = (FileLoader)enum.next();
System.out.println( "Processing " + loader.getFile() );
long t0 = System.currentTimeMillis();
ClassFile[] classes = loader.getClasses();
@@ -149,9 +149,9 @@
* @return the set of <tt>FileLoader</tt> loaders matching the given
* classpath.
*/
- public Enumeration loaders()
+ public Iterator loaders()
{
- return new LoaderEnumeration();
+ return new LoaderIterator();
}
/**
@@ -183,16 +183,16 @@
*
* @author RT
*/
- protected class LoaderEnumeration implements Enumeration
+ protected class LoaderIterator implements Iterator
{
protected int index = 0;
- public boolean hasMoreElements()
+ public boolean hasNext()
{
return index < files.length;
}
- public Object nextElement()
+ public Object next()
{
if( index >= files.length )
{
@@ -270,17 +270,17 @@
throws IOException
{
ZipFile zipFile = new ZipFile( file );
- Vector v = new Vector();
- Enumeration entries = zipFile.entries();
- while( entries.hasMoreElements() )
+ ArrayList v = new ArrayList();
+ Iterator entries = zipFile.entries();
+ while( entries.hasNext() )
{
- ZipEntry entry = (ZipEntry)entries.nextElement();
+ ZipEntry entry = (ZipEntry)entries.next();
if( entry.getName().endsWith( ".class" ) )
{
InputStream is = ClassPathLoader.getCachedStream(
zipFile.getInputStream( entry ) );
ClassFile classFile = new ClassFile( is );
is.close();
- v.addElement( classFile );
+ v.add( classFile );
}
}
ClassFile[] classes = new ClassFile[ v.size() ];
@@ -321,13 +321,13 @@
* @return the list of <tt>File</tt> objects that applies to the given
* filter.
*/
- public static Vector listFiles( File directory, FilenameFilter filter,
boolean recurse )
+ public static ArrayList listFiles( File directory, FilenameFilter
filter, boolean recurse )
{
if( !directory.isDirectory() )
{
throw new IllegalArgumentException( directory + " is not a
directory" );
}
- Vector list = new Vector();
+ ArrayList list = new ArrayList();
listFilesTo( list, directory, filter, recurse );
return list;
}
@@ -342,12 +342,12 @@
* @param recurse tells whether or not the listing is recursive.
* @return the list instance that was passed as the <tt>list</tt>
argument.
*/
- private static Vector listFilesTo( Vector list, File directory,
FilenameFilter filter, boolean recurse )
+ private static ArrayList listFilesTo( ArrayList list, File directory,
FilenameFilter filter, boolean recurse )
{
String[] files = directory.list( filter );
for( int i = 0; i < files.length; i++ )
{
- list.addElement( new File( directory, files[ i ] ) );
+ list.add( new File( directory, files[ i ] ) );
}
files = null;// we don't need it anymore
if( recurse )
@@ -364,11 +364,11 @@
public ClassFile[] getClasses()
throws IOException
{
- Vector v = new Vector();
- Vector files = listFiles( directory, new ClassFilter(), true );
+ ArrayList v = new ArrayList();
+ ArrayList files = listFiles( directory, new ClassFilter(), true );
for( int i = 0; i < files.size(); i++ )
{
- File file = (File)files.elementAt( i );
+ File file = (File)files.get( i );
InputStream is = null;
try
{
@@ -376,7 +376,7 @@
ClassFile classFile = new ClassFile( is );
is.close();
is = null;
- v.addElement( classFile );
+ v.add( classFile );
}
finally
{
1.3 +2 -2
jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/sitraka/bytecode/Utils.java
Index: Utils.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/sitraka/bytecode/Utils.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- Utils.java 2001/12/16 00:34:35 1.2
+++ Utils.java 2001/12/21 14:21:23 1.3
@@ -7,7 +7,7 @@
*/
package org.apache.tools.ant.taskdefs.optional.sitraka.bytecode;
-import java.util.Vector;
+import java.util.ArrayList;
import
org.apache.tools.ant.taskdefs.optional.depend.constantpool.ConstantPool;
import org.apache.tools.ant.taskdefs.optional.depend.constantpool.Utf8CPInfo;
@@ -221,7 +221,7 @@
{
throw new IllegalArgumentException( "Method descriptor should
start with a '('" );
}
- Vector params = new Vector();
+ ArrayList params = new ArrayList();
StringBuffer param = new StringBuffer();
i++;
while( ( i = descriptor2java( descriptor, i, param ) ) <
descriptor.length() )
1.5 +5 -5
jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/sound/SoundTask.java
Index: SoundTask.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/sound/SoundTask.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- SoundTask.java 2001/12/16 05:51:13 1.4
+++ SoundTask.java 2001/12/21 14:21:23 1.5
@@ -9,7 +9,7 @@
import java.io.File;
import java.util.Random;
-import java.util.Vector;
+import java.util.ArrayList;
import org.apache.myrmidon.api.TaskException;
import org.apache.tools.ant.Project;
import org.apache.tools.ant.Task;
@@ -25,7 +25,7 @@
* in xml and have Ant play them back
*
* @author Nick Pellow
- * @version $Revision: 1.4 $, $Date: 2001/12/16 05:51:13 $
+ * @version $Revision: 1.5 $, $Date: 2001/12/21 14:21:23 $
*/
public class SoundTask extends Task
@@ -154,13 +154,13 @@
{
// get the list of files in the dir
String[] entries = source.list();
- Vector files = new Vector();
+ ArrayList files = new ArrayList();
for( int i = 0; i < entries.length; i++ )
{
File f = new File( source, entries[ i ] );
if( f.isFile() )
{
- files.addElement( f );
+ files.add( f );
}
}
if( files.size() < 1 )
@@ -172,7 +172,7 @@
Random rn = new Random();
int x = rn.nextInt( numfiles );
// set the source to the file at that location
- this.source = (File)files.elementAt( x );
+ this.source = (File)files.get( x );
}
}
else
1.4 +3 -3
jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/rmic/DefaultRmicAdapter.java
Index: DefaultRmicAdapter.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/rmic/DefaultRmicAdapter.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- DefaultRmicAdapter.java 2001/12/16 02:05:43 1.3
+++ DefaultRmicAdapter.java 2001/12/21 14:21:23 1.4
@@ -9,7 +9,7 @@
import java.io.File;
import java.util.Random;
-import java.util.Vector;
+import java.util.ArrayList;
import org.apache.myrmidon.api.TaskException;
import org.apache.tools.ant.Project;
import org.apache.tools.ant.taskdefs.Rmic;
@@ -241,7 +241,7 @@
*/
protected void logAndAddFilesToCompile( Commandline cmd )
{
- Vector compileList = attributes.getCompileList();
+ ArrayList compileList = attributes.getCompileList();
attributes.log( "Compilation args: " + cmd.toString(),
Project.MSG_VERBOSE );
@@ -255,7 +255,7 @@
for( int i = 0; i < compileList.size(); i++ )
{
- String arg = (String)compileList.elementAt( i );
+ String arg = (String)compileList.get( i );
cmd.createArgument().setValue( arg );
niceSourceList.append( " " + arg );
}
1.4 +32 -34
jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/types/Commandline.java
Index: Commandline.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/types/Commandline.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- Commandline.java 2001/12/16 00:38:47 1.3
+++ Commandline.java 2001/12/21 14:21:23 1.4
@@ -9,7 +9,7 @@
import java.io.File;
import java.util.StringTokenizer;
-import java.util.Vector;
+import java.util.ArrayList;
import org.apache.myrmidon.api.TaskException;
/**
@@ -32,12 +32,12 @@
* @author [EMAIL PROTECTED]
* @author <a href="mailto:[EMAIL PROTECTED]">Stefan Bodewig</a>
*/
-public class Commandline implements Cloneable
+public class Commandline
+ implements Cloneable
{
+ private ArrayList m_arguments = new ArrayList();
+ private String m_executable;
- private Vector arguments = new Vector();
- private String executable = null;
-
public Commandline( String to_process )
throws TaskException
{
@@ -134,7 +134,7 @@
final int inDoubleQuote = 2;
int state = normal;
StringTokenizer tok = new StringTokenizer( to_process, "\"\' ", true
);
- Vector v = new Vector();
+ ArrayList v = new ArrayList();
StringBuffer current = new StringBuffer();
while( tok.hasMoreTokens() )
@@ -175,7 +175,7 @@
{
if( current.length() != 0 )
{
- v.addElement( current.toString() );
+ v.add( current.toString() );
current.setLength( 0 );
}
}
@@ -189,7 +189,7 @@
if( current.length() != 0 )
{
- v.addElement( current.toString() );
+ v.add( current.toString() );
}
if( state == inQuote || state == inDoubleQuote )
@@ -197,9 +197,8 @@
throw new TaskException( "unbalanced quotes in " + to_process );
}
- String[] args = new String[ v.size() ];
- v.copyInto( args );
- return args;
+ final String[] args = new String[ v.size() ];
+ return (String[])v.toArray( args );
}
/**
@@ -211,7 +210,7 @@
{
if( executable == null || executable.length() == 0 )
return;
- this.executable = executable.replace( '/', File.separatorChar )
+ this.m_executable = executable.replace( '/', File.separatorChar )
.replace( '\\', File.separatorChar );
}
@@ -223,20 +222,19 @@
*/
public String[] getArguments()
{
- Vector result = new Vector( arguments.size() * 2 );
- for( int i = 0; i < arguments.size(); i++ )
+ ArrayList result = new ArrayList( m_arguments.size() * 2 );
+ for( int i = 0; i < m_arguments.size(); i++ )
{
- Argument arg = (Argument)arguments.elementAt( i );
+ Argument arg = (Argument)m_arguments.get( i );
String[] s = arg.getParts();
for( int j = 0; j < s.length; j++ )
{
- result.addElement( s[ j ] );
+ result.add( s[ j ] );
}
}
- String[] res = new String[ result.size() ];
- result.copyInto( res );
- return res;
+ final String[] res = new String[ result.size() ];
+ return (String[])result.toArray( res );
}
/**
@@ -247,17 +245,17 @@
public String[] getCommandline()
{
final String[] args = getArguments();
- if( executable == null )
+ if( m_executable == null )
return args;
final String[] result = new String[ args.length + 1 ];
- result[ 0 ] = executable;
+ result[ 0 ] = m_executable;
System.arraycopy( args, 0, result, 1, args.length );
return result;
}
public String getExecutable()
{
- return executable;
+ return m_executable;
}
public void addArguments( String[] line )
@@ -273,8 +271,8 @@
*/
public void clear()
{
- executable = null;
- arguments.removeAllElements();
+ m_executable = null;
+ m_arguments.clear();
}
/**
@@ -283,15 +281,15 @@
*/
public void clearArgs()
{
- arguments.removeAllElements();
+ m_arguments.clear();
}
public Object clone()
{
- Commandline c = new Commandline();
- c.setExecutable( executable );
- c.addArguments( getArguments() );
- return c;
+ final Commandline commandline = new Commandline();
+ commandline.setExecutable( m_executable );
+ commandline.addArguments( getArguments() );
+ return commandline;
}
/**
@@ -302,8 +300,8 @@
*/
public Argument createArgument()
{
- Argument argument = new Argument();
- arguments.addElement( argument );
+ final Argument argument = new Argument();
+ m_arguments.add( argument );
return argument;
}
@@ -317,7 +315,7 @@
*/
public Marker createMarker()
{
- return new Marker( arguments.size() );
+ return new Marker( m_arguments.size() );
}
public int size()
@@ -425,10 +423,10 @@
{
if( realPos == -1 )
{
- realPos = ( executable == null ? 0 : 1 );
+ realPos = ( m_executable == null ? 0 : 1 );
for( int i = 0; i < position; i++ )
{
- Argument arg = (Argument)arguments.elementAt( i );
+ Argument arg = (Argument)m_arguments.get( i );
realPos += arg.getParts().length;
}
}
1.3 +5 -5
jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/types/CommandlineJava.java
Index: CommandlineJava.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/types/CommandlineJava.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- CommandlineJava.java 2001/12/16 00:38:47 1.2
+++ CommandlineJava.java 2001/12/21 14:21:23 1.3
@@ -7,9 +7,9 @@
*/
package org.apache.tools.ant.types;
-import java.util.Enumeration;
+import java.util.Iterator;
import java.util.Properties;
-import java.util.Vector;
+import java.util.ArrayList;
import org.apache.myrmidon.api.TaskException;
import org.apache.myrmidon.framework.Os;
import org.apache.tools.ant.Project;
@@ -338,9 +338,9 @@
{
Properties p = new Properties( sys = System.getProperties()
);
- for( Enumeration e = variables.elements();
e.hasMoreElements(); )
+ for( Iterator e = variables.iterator(); e.hasNext(); )
{
- Environment.Variable v =
(Environment.Variable)e.nextElement();
+ Environment.Variable v = (Environment.Variable)e.next();
p.put( v.getKey(), v.getValue() );
}
System.setProperties( p );
@@ -371,7 +371,7 @@
try
{
SysProperties c = (SysProperties)super.clone();
- c.variables = (Vector)variables.clone();
+ c.variables = (ArrayList)variables.clone();
return c;
}
catch( CloneNotSupportedException e )
1.4 +5 -5
jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/types/Environment.java
Index: Environment.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/types/Environment.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- Environment.java 2001/12/19 11:52:18 1.3
+++ Environment.java 2001/12/21 14:21:23 1.4
@@ -7,7 +7,7 @@
*/
package org.apache.tools.ant.types;
-import java.util.Vector;
+import java.util.ArrayList;
import org.apache.myrmidon.api.TaskException;
/**
@@ -17,11 +17,11 @@
*/
public class Environment
{
- protected Vector variables;
+ protected ArrayList variables;
public Environment()
{
- variables = new Vector();
+ variables = new ArrayList();
}
public String[] getVariables()
@@ -34,14 +34,14 @@
String[] result = new String[ variables.size() ];
for( int i = 0; i < result.length; i++ )
{
- result[ i ] = ( (Variable)variables.elementAt( i )
).getContent();
+ result[ i ] = ( (Variable)variables.get( i ) ).getContent();
}
return result;
}
public void addVariable( Variable var )
{
- variables.addElement( var );
+ variables.add( var );
}
public static class Variable
1.4 +6 -7
jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/types/FileList.java
Index: FileList.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/types/FileList.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- FileList.java 2001/12/16 01:01:20 1.3
+++ FileList.java 2001/12/21 14:21:23 1.4
@@ -10,7 +10,7 @@
import java.io.File;
import java.util.Stack;
import java.util.StringTokenizer;
-import java.util.Vector;
+import java.util.ArrayList;
import org.apache.myrmidon.api.TaskException;
import org.apache.tools.ant.Project;
@@ -21,12 +21,12 @@
* a matched file if it currently exists in the file system.
*
* @author <a href="mailto:[EMAIL PROTECTED]">Craeg Strong</a>
- * @version $Revision: 1.3 $ $Date: 2001/12/16 01:01:20 $
+ * @version $Revision: 1.4 $ $Date: 2001/12/21 14:21:23 $
*/
public class FileList extends DataType
{
- private Vector filenames = new Vector();
+ private ArrayList filenames = new ArrayList();
private File dir;
public FileList()
@@ -63,7 +63,7 @@
StringTokenizer tok = new StringTokenizer( filenames, ",
\t\n\r\f", false );
while( tok.hasMoreTokens() )
{
- this.filenames.addElement( tok.nextToken() );
+ this.filenames.add( tok.nextToken() );
}
}
}
@@ -122,9 +122,8 @@
throw new TaskException( "No files specified for filelist." );
}
- String result[] = new String[ filenames.size() ];
- filenames.copyInto( result );
- return result;
+ final String result[] = new String[ filenames.size() ];
+ return (String[])filenames.toArray( result );
}
/**
1.6 +4 -4
jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/types/FileSet.java
Index: FileSet.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/types/FileSet.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- FileSet.java 2001/12/16 01:31:39 1.5
+++ FileSet.java 2001/12/21 14:21:23 1.6
@@ -9,7 +9,7 @@
import java.io.File;
import java.util.Stack;
-import java.util.Vector;
+import java.util.ArrayList;
import org.apache.myrmidon.api.TaskException;
import org.apache.tools.ant.DirectoryScanner;
import org.apache.tools.ant.FileScanner;
@@ -31,7 +31,7 @@
{
private PatternSet defaultPatterns = new PatternSet();
- private Vector additionalPatterns = new Vector();
+ private ArrayList additionalPatterns = new ArrayList();
private boolean useDefaultExcludes = true;
private boolean isCaseSensitive = true;
@@ -195,7 +195,7 @@
for( int i = 0; i < additionalPatterns.size(); i++ )
{
- Object o = additionalPatterns.elementAt( i );
+ Object o = additionalPatterns.get( i );
defaultPatterns.append( (PatternSet)o, p );
}
@@ -346,7 +346,7 @@
throw noChildrenAllowed();
}
PatternSet patterns = new PatternSet();
- additionalPatterns.addElement( patterns );
+ additionalPatterns.add( patterns );
return patterns;
}
1.4 +14 -13
jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/types/FilterSet.java
Index: FilterSet.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/types/FilterSet.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- FilterSet.java 2001/12/16 00:38:47 1.3
+++ FilterSet.java 2001/12/21 14:21:23 1.4
@@ -10,10 +10,11 @@
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
-import java.util.Enumeration;
+import java.util.Iterator;
import java.util.Hashtable;
import java.util.Properties;
-import java.util.Vector;
+import java.util.ArrayList;
+import java.util.Enumeration;
import org.apache.myrmidon.api.TaskException;
import org.apache.tools.ant.Project;
@@ -43,7 +44,7 @@
/**
* List of ordered filters and filter files.
*/
- private Vector filters = new Vector();
+ private ArrayList filters = new ArrayList();
public FilterSet()
{
@@ -58,7 +59,7 @@
throws TaskException
{
super();
- this.filters = (Vector)filterset.getFilters().clone();
+ this.filters = (ArrayList)filterset.getFilters().clone();
}
/**
@@ -146,9 +147,9 @@
{
int filterSize = getFilters().size();
Hashtable filterHash = new Hashtable( filterSize );
- for( Enumeration e = getFilters().elements(); e.hasMoreElements(); )
+ for( Iterator e = getFilters().iterator(); e.hasNext(); )
{
- Filter filter = (Filter)e.nextElement();
+ Filter filter = (Filter)e.next();
filterHash.put( filter.getToken(), filter.getValue() );
}
return filterHash;
@@ -166,7 +167,7 @@
{
throw noChildrenAllowed();
}
- filters.addElement( filter );
+ filters.add( filter );
}
/**
@@ -182,7 +183,7 @@
{
throw noChildrenAllowed();
}
- filters.addElement( new Filter( token, value ) );
+ filters.add( new Filter( token, value ) );
}
/**
@@ -197,9 +198,9 @@
{
throw noChildrenAllowed();
}
- for( Enumeration e = filterSet.getFilters().elements();
e.hasMoreElements(); )
+ for( Iterator e = filterSet.getFilters().iterator(); e.hasNext(); )
{
- filters.addElement( (Filter)e.nextElement() );
+ filters.add( (Filter)e.next() );
}
}
@@ -274,12 +275,12 @@
props.load( in );
Enumeration enum = props.propertyNames();
- Vector filters = getFilters();
+ ArrayList filters = getFilters();
while( enum.hasMoreElements() )
{
String strPropName = (String)enum.nextElement();
String strValue = props.getProperty( strPropName );
- filters.addElement( new Filter( strPropName, strValue )
);
+ filters.add( new Filter( strPropName, strValue ) );
}
}
catch( Exception e )
@@ -368,7 +369,7 @@
}
}
- protected Vector getFilters()
+ protected ArrayList getFilters()
throws TaskException
{
if( isReference() )
1.3 +8 -8
jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/types/FilterSetCollection.java
Index: FilterSetCollection.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/types/FilterSetCollection.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- FilterSetCollection.java 2001/12/15 14:55:59 1.2
+++ FilterSetCollection.java 2001/12/21 14:21:23 1.3
@@ -9,8 +9,8 @@
// java util classes
-import java.util.Enumeration;
-import java.util.Vector;
+import java.util.Iterator;
+import java.util.ArrayList;
import org.apache.myrmidon.api.TaskException;
// ant classes
@@ -24,7 +24,7 @@
public class FilterSetCollection
{
- private Vector filterSets = new Vector();
+ private ArrayList filterSets = new ArrayList();
public FilterSetCollection()
{
@@ -37,7 +37,7 @@
public void addFilterSet( FilterSet filterSet )
{
- filterSets.addElement( filterSet );
+ filterSets.add( filterSet );
}
/**
@@ -48,9 +48,9 @@
public boolean hasFilters()
throws TaskException
{
- for( Enumeration e = filterSets.elements(); e.hasMoreElements(); )
+ for( Iterator e = filterSets.iterator(); e.hasNext(); )
{
- FilterSet filterSet = (FilterSet)e.nextElement();
+ FilterSet filterSet = (FilterSet)e.next();
if( filterSet.hasFilters() )
{
return true;
@@ -70,9 +70,9 @@
throws TaskException
{
String replacedLine = line;
- for( Enumeration e = filterSets.elements(); e.hasMoreElements(); )
+ for( Iterator e = filterSets.iterator(); e.hasNext(); )
{
- FilterSet filterSet = (FilterSet)e.nextElement();
+ FilterSet filterSet = (FilterSet)e.next();
replacedLine = filterSet.replaceTokens( replacedLine );
}
return replacedLine;
1.5 +23 -24
jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/types/Path.java
Index: Path.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/types/Path.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- Path.java 2001/12/17 10:47:19 1.4
+++ Path.java 2001/12/21 14:21:23 1.5
@@ -8,10 +8,10 @@
package org.apache.tools.ant.types;
import java.io.File;
-import java.util.Enumeration;
+import java.util.Iterator;
import java.util.Locale;
import java.util.Stack;
-import java.util.Vector;
+import java.util.ArrayList;
import org.apache.avalon.excalibur.io.FileUtil;
import org.apache.myrmidon.api.TaskException;
import org.apache.tools.ant.DirectoryScanner;
@@ -56,7 +56,7 @@
{
public final static Path systemClasspath = createSystemClasspath();
- private Vector elements;
+ private ArrayList elements;
private static Path createSystemClasspath()
{
@@ -87,7 +87,7 @@
public Path( Project project )
{
setProject( project );
- elements = new Vector();
+ elements = new ArrayList();
}
/**
@@ -120,7 +120,7 @@
*/
public static String[] translatePath( Project project, String source )
{
- final Vector result = new Vector();
+ final ArrayList result = new ArrayList();
if( source == null )
return new String[ 0 ];
@@ -143,11 +143,11 @@
{
translateFileSep( element, i );
}
- result.addElement( element.toString() );
+ result.add( element.toString() );
}
- String[] res = new String[ result.size() ];
- result.copyInto( res );
- return res;
+
+ final String[] res = new String[ result.size() ];
+ return (String[])result.toArray( res );
}
/**
@@ -169,16 +169,16 @@
}
/**
- * Adds a String to the Vector if it isn't already included.
+ * Adds a String to the ArrayList if it isn't already included.
*
* @param v The feature to be added to the UnlessPresent attribute
* @param s The feature to be added to the UnlessPresent attribute
*/
- private static void addUnlessPresent( Vector v, String s )
+ private static void addUnlessPresent( ArrayList v, String s )
{
if( v.indexOf( s ) == -1 )
{
- v.addElement( s );
+ v.add( s );
}
}
@@ -251,7 +251,7 @@
{
throw tooManyAttributes();
}
- elements.addElement( r );
+ elements.add( r );
super.setRefid( r );
}
@@ -334,7 +334,7 @@
{
throw noChildrenAllowed();
}
- elements.addElement( fs );
+ elements.add( fs );
checked = false;
}
@@ -414,7 +414,7 @@
{
if( elements.indexOf( l[ i ] ) == -1 )
{
- elements.addElement( l[ i ] );
+ elements.add( l[ i ] );
}
}
}
@@ -523,7 +523,7 @@
throw noChildrenAllowed();
}
Path p = new Path( getProject() );
- elements.addElement( p );
+ elements.add( p );
checked = false;
return p;
}
@@ -542,7 +542,7 @@
throw noChildrenAllowed();
}
PathElement pe = new PathElement();
- elements.addElement( pe );
+ elements.add( pe );
return pe;
}
@@ -562,10 +562,10 @@
dieOnCircularReference( stk, getProject() );
}
- Vector result = new Vector( 2 * elements.size() );
+ ArrayList result = new ArrayList( 2 * elements.size() );
for( int i = 0; i < elements.size(); i++ )
{
- Object o = elements.elementAt( i );
+ Object o = elements.get( i );
if( o instanceof Reference )
{
Reference r = (Reference)o;
@@ -623,8 +623,7 @@
}
}
String[] res = new String[ result.size() ];
- result.copyInto( res );
- return res;
+ return (String[])result.toArray( res );
}
/**
@@ -687,10 +686,10 @@
return;
}
- Enumeration enum = elements.elements();
- while( enum.hasMoreElements() )
+ Iterator enum = elements.iterator();
+ while( enum.hasNext() )
{
- Object o = enum.nextElement();
+ Object o = enum.next();
if( o instanceof Reference )
{
o = ( (Reference)o ).getReferencedObject( p );
1.4 +24 -25
jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/types/PatternSet.java
Index: PatternSet.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/types/PatternSet.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- PatternSet.java 2001/12/15 15:20:24 1.3
+++ PatternSet.java 2001/12/21 14:21:23 1.4
@@ -11,10 +11,10 @@
import java.io.File;
import java.io.FileReader;
import java.io.IOException;
-import java.util.Enumeration;
+import java.util.Iterator;
import java.util.Stack;
import java.util.StringTokenizer;
-import java.util.Vector;
+import java.util.ArrayList;
import org.apache.myrmidon.api.TaskException;
import org.apache.tools.ant.Project;
@@ -33,10 +33,10 @@
*/
public class PatternSet extends DataType
{
- private Vector includeList = new Vector();
- private Vector excludeList = new Vector();
- private Vector includesFileList = new Vector();
- private Vector excludesFileList = new Vector();
+ private ArrayList includeList = new ArrayList();
+ private ArrayList excludeList = new ArrayList();
+ private ArrayList includesFileList = new ArrayList();
+ private ArrayList excludesFileList = new ArrayList();
public PatternSet()
{
@@ -326,10 +326,10 @@
* @param list The feature to be added to the PatternToList attribute
* @return Description of the Returned Value
*/
- private NameEntry addPatternToList( Vector list )
+ private NameEntry addPatternToList( ArrayList list )
{
NameEntry result = new NameEntry();
- list.addElement( result );
+ list.add( result );
return result;
}
@@ -340,25 +340,24 @@
* @param p Description of Parameter
* @return Description of the Returned Value
*/
- private String[] makeArray( Vector list, Project p )
+ private String[] makeArray( ArrayList list, Project p )
{
if( list.size() == 0 )
return null;
- Vector tmpNames = new Vector();
- for( Enumeration e = list.elements(); e.hasMoreElements(); )
+ ArrayList tmpNames = new ArrayList();
+ for( Iterator e = list.iterator(); e.hasNext(); )
{
- NameEntry ne = (NameEntry)e.nextElement();
+ NameEntry ne = (NameEntry)e.next();
String pattern = ne.evalName( p );
if( pattern != null && pattern.length() > 0 )
{
- tmpNames.addElement( pattern );
+ tmpNames.add( pattern );
}
}
- String result[] = new String[ tmpNames.size() ];
- tmpNames.copyInto( result );
- return result;
+ final String[] result = new String[ tmpNames.size() ];
+ return (String[]) tmpNames.toArray( result );
}
/**
@@ -371,10 +370,10 @@
{
if( includesFileList.size() > 0 )
{
- Enumeration e = includesFileList.elements();
- while( e.hasMoreElements() )
+ Iterator e = includesFileList.iterator();
+ while( e.hasNext() )
{
- NameEntry ne = (NameEntry)e.nextElement();
+ NameEntry ne = (NameEntry)e.next();
String fileName = ne.evalName( p );
if( fileName != null )
{
@@ -386,15 +385,15 @@
readPatterns( inclFile, includeList, p );
}
}
- includesFileList.removeAllElements();
+ includesFileList.clear();
}
if( excludesFileList.size() > 0 )
{
- Enumeration e = excludesFileList.elements();
- while( e.hasMoreElements() )
+ Iterator e = excludesFileList.iterator();
+ while( e.hasNext() )
{
- NameEntry ne = (NameEntry)e.nextElement();
+ NameEntry ne = (NameEntry)e.next();
String fileName = ne.evalName( p );
if( fileName != null )
{
@@ -406,7 +405,7 @@
readPatterns( exclFile, excludeList, p );
}
}
- excludesFileList.removeAllElements();
+ excludesFileList.clear();
}
}
@@ -419,7 +418,7 @@
* @param p Description of Parameter
* @exception TaskException Description of Exception
*/
- private void readPatterns( File patternfile, Vector patternlist, Project
p )
+ private void readPatterns( File patternfile, ArrayList patternlist,
Project p )
throws TaskException
{
1.8 +2 -2
jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/util/FileUtils.java
Index: FileUtils.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/util/FileUtils.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- FileUtils.java 2001/12/21 13:29:10 1.7
+++ FileUtils.java 2001/12/21 14:21:24 1.8
@@ -30,7 +30,7 @@
* @author [EMAIL PROTECTED]
* @author <a href="mailto:[EMAIL PROTECTED]">Conor MacNeill</a>
* @author <a href="mailto:[EMAIL PROTECTED]">Stefan Bodewig</a>
- * @version $Revision: 1.7 $
+ * @version $Revision: 1.8 $
*/
public class FileUtils
@@ -320,7 +320,7 @@
// already contains one
sb.append( File.separatorChar );
}
- sb.append( s.elementAt( i ) );
+ sb.append( s.get( i ) );
}
path = sb.toString();
1.4 +3 -3
jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/util/RegexpPatternMapper.java
Index: RegexpPatternMapper.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/util/RegexpPatternMapper.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- RegexpPatternMapper.java 2001/12/16 02:05:43 1.3
+++ RegexpPatternMapper.java 2001/12/21 14:21:24 1.4
@@ -7,7 +7,7 @@
*/
package org.apache.tools.ant.util;
-import java.util.Vector;
+import java.util.ArrayList;
import org.apache.myrmidon.api.TaskException;
import org.apache.tools.ant.util.regexp.RegexpMatcher;
import org.apache.tools.ant.util.regexp.RegexpMatcherFactory;
@@ -88,7 +88,7 @@
protected String replaceReferences( String source )
throws TaskException
{
- Vector v = reg.getGroups( source );
+ ArrayList v = reg.getGroups( source );
result.setLength( 0 );
for( int i = 0; i < to.length; i++ )
@@ -100,7 +100,7 @@
int value = Character.digit( to[ i ], 10 );
if( value > -1 )
{
- result.append( (String)v.elementAt( value ) );
+ result.append( (String)v.get( value ) );
}
else
{
1.5 +6 -7
jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/util/SourceFileScanner.java
Index: SourceFileScanner.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/util/SourceFileScanner.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- SourceFileScanner.java 2001/12/17 10:47:20 1.4
+++ SourceFileScanner.java 2001/12/21 14:21:24 1.5
@@ -8,7 +8,7 @@
package org.apache.tools.ant.util;
import java.io.File;
-import java.util.Vector;
+import java.util.ArrayList;
import org.apache.myrmidon.api.TaskException;
import org.apache.myrmidon.framework.Os;
import org.apache.tools.ant.Project;
@@ -70,7 +70,7 @@
now += 2000;
}
- Vector v = new Vector();
+ ArrayList v = new ArrayList();
for( int i = 0; i < files.length; i++ )
{
@@ -100,14 +100,14 @@
{
m_task.log( files[ i ] + " added as " +
dest.getAbsolutePath() + " doesn\'t exist.",
Project.MSG_VERBOSE );
- v.addElement( files[ i ] );
+ v.add( files[ i ] );
added = true;
}
else if( src.lastModified() > dest.lastModified() )
{
m_task.log( files[ i ] + " added as " +
dest.getAbsolutePath() + " is outdated.",
Project.MSG_VERBOSE );
- v.addElement( files[ i ] );
+ v.add( files[ i ] );
added = true;
}
else
@@ -128,9 +128,8 @@
}
}
- String[] result = new String[ v.size() ];
- v.copyInto( result );
- return result;
+ final String[] result = new String[ v.size() ];
+ return (String[])v.toArray( result );
}
/**
1.4 +7 -7
jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/util/regexp/JakartaOroMatcher.java
Index: JakartaOroMatcher.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/util/regexp/JakartaOroMatcher.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- JakartaOroMatcher.java 2001/12/16 00:39:05 1.3
+++ JakartaOroMatcher.java 2001/12/21 14:21:24 1.4
@@ -7,7 +7,7 @@
*/
package org.apache.tools.ant.util.regexp;
-import java.util.Vector;
+import java.util.ArrayList;
import org.apache.myrmidon.api.TaskException;
import org.apache.oro.text.regex.MatchResult;
import org.apache.oro.text.regex.Pattern;
@@ -42,7 +42,7 @@
}
/**
- * Returns a Vector of matched groups found in the argument. <p>
+ * Returns a ArrayList of matched groups found in the argument. <p>
*
* Group 0 will be the full match, the rest are the parenthesized
* subexpressions</p> .
@@ -51,14 +51,14 @@
* @return The Groups value
* @exception TaskException Description of Exception
*/
- public Vector getGroups( String argument )
+ public ArrayList getGroups( String argument )
throws TaskException
{
return getGroups( argument, MATCH_DEFAULT );
}
/**
- * Returns a Vector of matched groups found in the argument. <p>
+ * Returns a ArrayList of matched groups found in the argument. <p>
*
* Group 0 will be the full match, the rest are the parenthesized
* subexpressions</p> .
@@ -68,19 +68,19 @@
* @return The Groups value
* @exception TaskException Description of Exception
*/
- public Vector getGroups( String input, int options )
+ public ArrayList getGroups( String input, int options )
throws TaskException
{
if( !matches( input, options ) )
{
return null;
}
- Vector v = new Vector();
+ ArrayList v = new ArrayList();
MatchResult mr = matcher.getMatch();
int cnt = mr.groups();
for( int i = 0; i < cnt; i++ )
{
- v.addElement( mr.group( i ) );
+ v.add( mr.group( i ) );
}
return v;
}
1.3 +6 -6
jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/util/regexp/JakartaRegexpMatcher.java
Index: JakartaRegexpMatcher.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/util/regexp/JakartaRegexpMatcher.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- JakartaRegexpMatcher.java 2001/12/16 00:39:05 1.2
+++ JakartaRegexpMatcher.java 2001/12/21 14:21:24 1.3
@@ -7,7 +7,7 @@
*/
package org.apache.tools.ant.util.regexp;
-import java.util.Vector;
+import java.util.ArrayList;
import org.apache.myrmidon.api.TaskException;
import org.apache.regexp.RE;
import org.apache.regexp.RESyntaxException;
@@ -35,7 +35,7 @@
}
/**
- * Returns a Vector of matched groups found in the argument. <p>
+ * Returns a ArrayList of matched groups found in the argument. <p>
*
* Group 0 will be the full match, the rest are the parenthesized
* subexpressions</p> .
@@ -44,13 +44,13 @@
* @return The Groups value
* @exception TaskException Description of Exception
*/
- public Vector getGroups( String argument )
+ public ArrayList getGroups( String argument )
throws TaskException
{
return getGroups( argument, MATCH_DEFAULT );
}
- public Vector getGroups( String input, int options )
+ public ArrayList getGroups( String input, int options )
throws TaskException
{
RE reg = getCompiledPattern( options );
@@ -58,11 +58,11 @@
{
return null;
}
- Vector v = new Vector();
+ ArrayList v = new ArrayList();
int cnt = reg.getParenCount();
for( int i = 0; i < cnt; i++ )
{
- v.addElement( reg.getParen( i ) );
+ v.add( reg.getParen( i ) );
}
return v;
}
1.3 +3 -3
jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/util/regexp/JakartaRegexpRegexp.java
Index: JakartaRegexpRegexp.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/util/regexp/JakartaRegexpRegexp.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- JakartaRegexpRegexp.java 2001/12/16 00:39:05 1.2
+++ JakartaRegexpRegexp.java 2001/12/21 14:21:24 1.3
@@ -7,7 +7,7 @@
*/
package org.apache.tools.ant.util.regexp;
-import java.util.Vector;
+import java.util.ArrayList;
import org.apache.myrmidon.api.TaskException;
import org.apache.regexp.RE;
@@ -28,7 +28,7 @@
public String substitute( String input, String argument, int options )
throws TaskException
{
- Vector v = getGroups( input, options );
+ ArrayList v = getGroups( input, options );
// replace \1 with the corresponding group
StringBuffer result = new StringBuffer();
@@ -43,7 +43,7 @@
int value = Character.digit( c, 10 );
if( value > -1 )
{
- result.append( (String)v.elementAt( value ) );
+ result.append( (String)v.get( value ) );
}
else
{
1.4 +7 -7
jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/util/regexp/Jdk14RegexpMatcher.java
Index: Jdk14RegexpMatcher.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/util/regexp/Jdk14RegexpMatcher.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- Jdk14RegexpMatcher.java 2001/12/16 00:39:05 1.3
+++ Jdk14RegexpMatcher.java 2001/12/21 14:21:24 1.4
@@ -7,7 +7,7 @@
*/
package org.apache.tools.ant.util.regexp;
-import java.util.Vector;
+import java.util.ArrayList;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import java.util.regex.PatternSyntaxException;
@@ -40,7 +40,7 @@
}
/**
- * Returns a Vector of matched groups found in the argument. <p>
+ * Returns a ArrayList of matched groups found in the argument. <p>
*
* Group 0 will be the full match, the rest are the parenthesized
* subexpressions</p> .
@@ -49,14 +49,14 @@
* @return The Groups value
* @exception TaskException Description of Exception
*/
- public Vector getGroups( String argument )
+ public ArrayList getGroups( String argument )
throws TaskException
{
return getGroups( argument, MATCH_DEFAULT );
}
/**
- * Returns a Vector of matched groups found in the argument. <p>
+ * Returns a ArrayList of matched groups found in the argument. <p>
*
* Group 0 will be the full match, the rest are the parenthesized
* subexpressions</p> .
@@ -66,7 +66,7 @@
* @return The Groups value
* @exception TaskException Description of Exception
*/
- public Vector getGroups( String input, int options )
+ public ArrayList getGroups( String input, int options )
throws TaskException
{
Pattern p = getCompiledPattern( options );
@@ -75,11 +75,11 @@
{
return null;
}
- Vector v = new Vector();
+ ArrayList v = new ArrayList();
int cnt = matcher.groupCount();
for( int i = 0; i <= cnt; i++ )
{
- v.addElement( matcher.group( i ) );
+ v.add( matcher.group( i ) );
}
return v;
}
1.3 +4 -4
jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/util/regexp/RegexpMatcher.java
Index: RegexpMatcher.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/util/regexp/RegexpMatcher.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- RegexpMatcher.java 2001/12/16 00:39:05 1.2
+++ RegexpMatcher.java 2001/12/21 14:21:24 1.3
@@ -7,7 +7,7 @@
*/
package org.apache.tools.ant.util.regexp;
-import java.util.Vector;
+import java.util.ArrayList;
import org.apache.myrmidon.api.TaskException;
/**
@@ -69,7 +69,7 @@
throws TaskException;
/**
- * Returns a Vector of matched groups found in the argument. <p>
+ * Returns a ArrayList of matched groups found in the argument. <p>
*
* Group 0 will be the full match, the rest are the parenthesized
* subexpressions</p> .
@@ -78,7 +78,7 @@
* @return The Groups value
* @exception TaskException Description of Exception
*/
- Vector getGroups( String argument )
+ ArrayList getGroups( String argument )
throws TaskException;
/**
@@ -103,7 +103,7 @@
* @return The Groups value
* @exception TaskException Description of Exception
*/
- Vector getGroups( String input, int options )
+ ArrayList getGroups( String input, int options )
throws TaskException;
}
1.2 +17 -16
jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/mail/MailMessage.java
Index: MailMessage.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/mail/MailMessage.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- MailMessage.java 2001/12/15 12:06:33 1.1
+++ MailMessage.java 2001/12/21 14:21:24 1.2
@@ -12,9 +12,10 @@
import java.io.PrintStream;
import java.net.InetAddress;
import java.net.Socket;
-import java.util.Enumeration;
+import java.util.Iterator;
import java.util.Hashtable;
-import java.util.Vector;
+import java.util.ArrayList;
+import java.util.Enumeration;
/**
* A class to help send SMTP email. This class is an improvement on the
@@ -41,9 +42,9 @@
* msg.setSubject("Test subject");
* PrintStream out = msg.getPrintStream();
*
- * Enumeration enum = req.getParameterNames();
- * while (enum.hasMoreElements()) {
- * String name = (String)enum.nextElement();
+ * Iterator enum = req.getParameterNames();
+ * while (enum.hasNext()) {
+ * String name = (String)enum.next();
* String value = req.getParameter(name);
* out.println(name + " = " + value);
* }
@@ -87,7 +88,7 @@
/**
* list of email addresses to cc to
*/
- private Vector cc;
+ private ArrayList cc;
/**
* sender email address
@@ -113,7 +114,7 @@
/**
* list of email addresses to send to
*/
- private Vector to;
+ private ArrayList to;
/**
* Constructs a new MailMessage to send an email. Use localhost as the
mail
@@ -138,8 +139,8 @@
throws IOException
{
this.host = host;
- to = new Vector();
- cc = new Vector();
+ to = new ArrayList();
+ cc = new ArrayList();
headers = new Hashtable();
setHeader( "X-Mailer", "org.apache.tools.mail.MailMessage
(jakarta.apache.org)" );
connect();
@@ -270,7 +271,7 @@
throws IOException
{
sendRcpt( cc );
- this.cc.addElement( cc );
+ this.cc.add( cc );
}
/**
@@ -312,7 +313,7 @@
throws IOException
{
sendRcpt( to );
- this.to.addElement( to );
+ this.to.add( to );
}
void setCcHeader()
@@ -451,14 +452,14 @@
send( "RCPT TO: " + "<" + sanitizeAddress( rcpt ) + ">", ok );
}
- String vectorToList( Vector v )
+ String vectorToList( ArrayList v )
{
StringBuffer buf = new StringBuffer();
- Enumeration e = v.elements();
- while( e.hasMoreElements() )
+ Iterator e = v.iterator();
+ while( e.hasNext() )
{
- buf.append( e.nextElement() );
- if( e.hasMoreElements() )
+ buf.append( e.next() );
+ if( e.hasNext() )
{
buf.append( ", " );
}
1.2 +25 -25
jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/zip/ExtraFieldUtils.java
Index: ExtraFieldUtils.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/zip/ExtraFieldUtils.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- ExtraFieldUtils.java 2001/12/15 12:06:33 1.1
+++ ExtraFieldUtils.java 2001/12/21 14:21:24 1.2
@@ -6,15 +6,16 @@
* the LICENSE file.
*/
package org.apache.tools.zip;
+
+import java.util.ArrayList;
import java.util.Hashtable;
-import java.util.Vector;
import java.util.zip.ZipException;
/**
* ZipExtraField related methods
*
* @author <a href="[EMAIL PROTECTED]">Stefan Bodewig</a>
- * @version $Revision: 1.1 $
+ * @version $Revision: 1.2 $
*/
public class ExtraFieldUtils
{
@@ -45,10 +46,10 @@
public static ZipExtraField createExtraField( ZipShort headerId )
throws InstantiationException, IllegalAccessException
{
- Class c = ( Class )implementations.get( headerId );
+ Class c = (Class)implementations.get( headerId );
if( c != null )
{
- return ( ZipExtraField )c.newInstance();
+ return (ZipExtraField)c.newInstance();
}
UnrecognizedExtraField u = new UnrecognizedExtraField();
u.setHeaderId( headerId );
@@ -67,17 +68,17 @@
int sum = 4 * data.length;
for( int i = 0; i < data.length; i++ )
{
- sum += data[i].getCentralDirectoryLength().getValue();
+ sum += data[ i ].getCentralDirectoryLength().getValue();
}
- byte[] result = new byte[sum];
+ byte[] result = new byte[ sum ];
int start = 0;
for( int i = 0; i < data.length; i++ )
{
- System.arraycopy( data[i].getHeaderId().getBytes(),
- 0, result, start, 2 );
- System.arraycopy( data[i].getCentralDirectoryLength().getBytes(),
- 0, result, start + 2, 2 );
- byte[] local = data[i].getCentralDirectoryData();
+ System.arraycopy( data[ i ].getHeaderId().getBytes(),
+ 0, result, start, 2 );
+ System.arraycopy( data[ i
].getCentralDirectoryLength().getBytes(),
+ 0, result, start + 2, 2 );
+ byte[] local = data[ i ].getCentralDirectoryData();
System.arraycopy( local, 0, result, start + 4, local.length );
start += ( local.length + 4 );
}
@@ -96,17 +97,17 @@
int sum = 4 * data.length;
for( int i = 0; i < data.length; i++ )
{
- sum += data[i].getLocalFileDataLength().getValue();
+ sum += data[ i ].getLocalFileDataLength().getValue();
}
- byte[] result = new byte[sum];
+ byte[] result = new byte[ sum ];
int start = 0;
for( int i = 0; i < data.length; i++ )
{
- System.arraycopy( data[i].getHeaderId().getBytes(),
- 0, result, start, 2 );
- System.arraycopy( data[i].getLocalFileDataLength().getBytes(),
- 0, result, start + 2, 2 );
- byte[] local = data[i].getLocalFileDataData();
+ System.arraycopy( data[ i ].getHeaderId().getBytes(),
+ 0, result, start, 2 );
+ System.arraycopy( data[ i ].getLocalFileDataLength().getBytes(),
+ 0, result, start + 2, 2 );
+ byte[] local = data[ i ].getLocalFileDataData();
System.arraycopy( local, 0, result, start + 4, local.length );
start += ( local.length + 4 );
}
@@ -124,7 +125,7 @@
public static ZipExtraField[] parse( byte[] data )
throws ZipException
{
- Vector v = new Vector();
+ ArrayList v = new ArrayList();
int start = 0;
while( start <= data.length - 4 )
{
@@ -138,7 +139,7 @@
{
ZipExtraField ze = createExtraField( headerId );
ze.parseFromLocalFileData( data, start + 4, length );
- v.addElement( ze );
+ v.add( ze );
}
catch( InstantiationException ie )
{
@@ -155,9 +156,8 @@
throw new ZipException( "data starting at " + start + " is in
unknown format" );
}
- ZipExtraField[] result = new ZipExtraField[v.size()];
- v.copyInto( result );
- return result;
+ final ZipExtraField[] result = new ZipExtraField[ v.size() ];
+ return (ZipExtraField[])v.toArray( result );
}
/**
@@ -173,13 +173,13 @@
{
try
{
- ZipExtraField ze = ( ZipExtraField )c.newInstance();
+ ZipExtraField ze = (ZipExtraField)c.newInstance();
implementations.put( ze.getHeaderId(), c );
}
catch( ClassCastException cc )
{
throw new RuntimeException( c +
- " doesn\'t implement ZipExtraField" );
+ " doesn\'t implement ZipExtraField"
);
}
catch( InstantiationException ie )
{
@@ -188,7 +188,7 @@
catch( IllegalAccessException ie )
{
throw new RuntimeException( c +
- "\'s no-arg constructor is not public" );
+ "\'s no-arg constructor is not
public" );
}
}
}
1.2 +12 -13
jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/zip/ZipEntry.java
Index: ZipEntry.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/zip/ZipEntry.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- ZipEntry.java 2001/12/15 12:06:33 1.1
+++ ZipEntry.java 2001/12/21 14:21:24 1.2
@@ -8,7 +8,7 @@
package org.apache.tools.zip;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
-import java.util.Vector;
+import java.util.ArrayList;
import java.util.zip.ZipException;
/**
@@ -16,7 +16,7 @@
* the internal and external file attributes.
*
* @author <a href="[EMAIL PROTECTED]">Stefan Bodewig</a>
- * @version $Revision: 1.1 $
+ * @version $Revision: 1.2 $
*/
public class ZipEntry extends java.util.zip.ZipEntry
{
@@ -42,7 +42,7 @@
private int internalAttributes = 0;
private long externalAttributes = 0;
- private Vector extraFields = new Vector();
+ private ArrayList extraFields = new ArrayList();
/**
* Helper for JDK 1.1 <-> 1.2 incompatibility.
@@ -252,10 +252,10 @@
*/
public void setExtraFields( ZipExtraField[] fields )
{
- extraFields.removeAllElements();
+ extraFields.clear();
for( int i = 0; i < fields.length; i++ )
{
- extraFields.addElement( fields[i] );
+ extraFields.add( fields[i] );
}
setExtra();
}
@@ -317,9 +317,8 @@
*/
public ZipExtraField[] getExtraFields()
{
- ZipExtraField[] result = new ZipExtraField[extraFields.size()];
- extraFields.copyInto( result );
- return result;
+ final ZipExtraField[] result = new ZipExtraField[ extraFields.size()
];
+ return (ZipExtraField[])extraFields.toArray( result );
}
/**
@@ -358,15 +357,15 @@
boolean done = false;
for( int i = 0; !done && i < extraFields.size(); i++ )
{
- if( ( ( ZipExtraField )extraFields.elementAt( i )
).getHeaderId().equals( type ) )
+ if( ( ( ZipExtraField )extraFields.get( i )
).getHeaderId().equals( type ) )
{
- extraFields.setElementAt( ze, i );
+ extraFields.set( i, ze );
done = true;
}
}
if( !done )
{
- extraFields.addElement( ze );
+ extraFields.add( ze );
}
setExtra();
}
@@ -406,9 +405,9 @@
boolean done = false;
for( int i = 0; !done && i < extraFields.size(); i++ )
{
- if( ( ( ZipExtraField )extraFields.elementAt( i )
).getHeaderId().equals( type ) )
+ if( ( ( ZipExtraField )extraFields.get( i )
).getHeaderId().equals( type ) )
{
- extraFields.removeElementAt( i );
+ extraFields.remove( i );
done = true;
}
}
1.2 +6 -6
jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/zip/ZipOutputStream.java
Index: ZipOutputStream.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/zip/ZipOutputStream.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- ZipOutputStream.java 2001/12/15 12:06:33 1.1
+++ ZipOutputStream.java 2001/12/21 14:21:24 1.2
@@ -11,7 +11,7 @@
import java.io.UnsupportedEncodingException;
import java.util.Date;
import java.util.Hashtable;
-import java.util.Vector;
+import java.util.ArrayList;
import java.util.zip.CRC32;
import java.util.zip.Deflater;
import java.util.zip.DeflaterOutputStream;
@@ -30,7 +30,7 @@
* #putNextEntry putNextEntry} will be called.</p>
*
* @author <a href="[EMAIL PROTECTED]">Stefan Bodewig</a>
- * @version $Revision: 1.1 $
+ * @version $Revision: 1.2 $
*/
public class ZipOutputStream extends DeflaterOutputStream
{
@@ -124,7 +124,7 @@
*
* @since 1.1
*/
- private Vector entries = new Vector();
+ private ArrayList entries = new ArrayList();
/**
* CRC instance to avoid parsing DEFLATED data twice.
@@ -372,12 +372,12 @@
cdOffset = new ZipLong( written );
for( int i = 0; i < entries.size(); i++ )
{
- writeCentralFileHeader( ( ZipEntry )entries.elementAt( i ) );
+ writeCentralFileHeader( ( ZipEntry )entries.get( i ) );
}
cdLength = new ZipLong( written - cdOffset.getValue() );
writeCentralDirectoryEnd();
offsets.clear();
- entries.removeAllElements();
+ entries.clear();
}
/**
@@ -393,7 +393,7 @@
closeEntry();
entry = ze;
- entries.addElement( entry );
+ entries.add( entry );
if( entry.getMethod() == -1 )
{// not specified
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>