git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@270291 13f79535-47bb-0310-9956-ffa450edef68master
| @@ -16,9 +16,10 @@ import java.lang.reflect.InvocationTargetException; | |||
| 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 @@ public class AntClassLoader | |||
| /** | |||
| * 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 @@ public class AntClassLoader | |||
| * 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 @@ public class AntClassLoader | |||
| { | |||
| // 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 class AntClassLoader | |||
| */ | |||
| public void addLoaderPackageRoot( String packageRoot ) | |||
| { | |||
| loaderPackages.addElement( packageRoot + "." ); | |||
| loaderPackages.add( packageRoot + "." ); | |||
| } | |||
| /** | |||
| @@ -423,7 +424,7 @@ public class AntClassLoader | |||
| File pathComponent | |||
| = project != null ? FileUtil.resolveFile( project.getBaseDir(), pathElement ) | |||
| : new File( pathElement ); | |||
| pathComponents.addElement( pathComponent ); | |||
| pathComponents.add( pathComponent ); | |||
| } | |||
| /** | |||
| @@ -434,7 +435,7 @@ public class AntClassLoader | |||
| */ | |||
| public void addSystemPackageRoot( String packageRoot ) | |||
| { | |||
| systemPackages.addElement( packageRoot + "." ); | |||
| systemPackages.add( packageRoot + "." ); | |||
| } | |||
| public void buildFinished( BuildEvent event ) | |||
| @@ -873,9 +874,9 @@ public class AntClassLoader | |||
| // 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 @@ public class AntClassLoader | |||
| } | |||
| } | |||
| 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 @@ public class AntClassLoader | |||
| 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 @@ public class AntClassLoader | |||
| // 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 @@ public class AntClassLoader | |||
| * @see AntClassLoader#findResources(String) | |||
| * @see java.lang.ClassLoader#getResources(String) | |||
| */ | |||
| private class ResourceEnumeration implements Enumeration | |||
| private class ResourceEnumeration | |||
| implements Enumeration | |||
| { | |||
| /** | |||
| @@ -1088,7 +1090,7 @@ public class AntClassLoader | |||
| ( url == null ) ) | |||
| { | |||
| File pathComponent | |||
| = (File)pathComponents.elementAt( pathElementsIndex ); | |||
| = (File)pathComponents.get( pathElementsIndex ); | |||
| url = getResourceURL( pathComponent, this.resourceName ); | |||
| pathElementsIndex++; | |||
| } | |||
| @@ -9,7 +9,7 @@ package org.apache.tools.ant; | |||
| 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 @@ public class DirectoryScanner implements FileScanner | |||
| }; | |||
| /** | |||
| * 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 @@ public class DirectoryScanner implements FileScanner | |||
| * 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 @@ public class DirectoryScanner implements FileScanner | |||
| * 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 @@ public class DirectoryScanner implements FileScanner | |||
| 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 @@ public class DirectoryScanner implements FileScanner | |||
| // 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 @@ public class DirectoryScanner implements FileScanner | |||
| // 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 @@ public class DirectoryScanner implements FileScanner | |||
| // 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 @@ public class DirectoryScanner implements FileScanner | |||
| // 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 @@ public class DirectoryScanner implements FileScanner | |||
| 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 @@ public class DirectoryScanner implements FileScanner | |||
| { | |||
| 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 @@ public class DirectoryScanner implements FileScanner | |||
| for( int i = patIdxStart; i <= patIdxEnd; i++ ) | |||
| { | |||
| if( !patDirs.elementAt( i ).equals( "**" ) ) | |||
| if( !patDirs.get( i ).equals( "**" ) ) | |||
| { | |||
| return false; | |||
| } | |||
| @@ -609,18 +609,18 @@ public class DirectoryScanner implements FileScanner | |||
| 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 @@ public class DirectoryScanner implements FileScanner | |||
| // 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 @@ public class DirectoryScanner implements FileScanner | |||
| 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 @@ public class DirectoryScanner implements FileScanner | |||
| 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 @@ public class DirectoryScanner implements FileScanner | |||
| 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 @@ public class DirectoryScanner implements FileScanner | |||
| 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 @@ public class DirectoryScanner implements FileScanner | |||
| 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 @@ public class DirectoryScanner implements FileScanner | |||
| 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 @@ public class DirectoryScanner implements FileScanner | |||
| 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 @@ public class DirectoryScanner implements FileScanner | |||
| { | |||
| if( !isExcluded( name ) ) | |||
| { | |||
| dirsIncluded.addElement( name ); | |||
| dirsIncluded.add( name ); | |||
| if( fast ) | |||
| { | |||
| scandir( file, name + File.separator, fast ); | |||
| @@ -1083,7 +1083,7 @@ public class DirectoryScanner implements FileScanner | |||
| else | |||
| { | |||
| everythingIncluded = false; | |||
| dirsExcluded.addElement( name ); | |||
| dirsExcluded.add( name ); | |||
| if( fast && couldHoldIncluded( name ) ) | |||
| { | |||
| scandir( file, name + File.separator, fast ); | |||
| @@ -1093,7 +1093,7 @@ public class DirectoryScanner implements FileScanner | |||
| else | |||
| { | |||
| everythingIncluded = false; | |||
| dirsNotIncluded.addElement( name ); | |||
| dirsNotIncluded.add( name ); | |||
| if( fast && couldHoldIncluded( name ) ) | |||
| { | |||
| scandir( file, name + File.separator, fast ); | |||
| @@ -1110,18 +1110,18 @@ public class DirectoryScanner implements FileScanner | |||
| { | |||
| 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 @@ public class DirectoryScanner implements FileScanner | |||
| } | |||
| 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++ ) | |||
| { | |||
| @@ -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 @@ public class Project | |||
| 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 class Project | |||
| public void addBuildListener( BuildListener listener ) | |||
| { | |||
| listeners.addElement( listener ); | |||
| listeners.add( listener ); | |||
| } | |||
| /** | |||
| @@ -357,19 +358,19 @@ public class Project | |||
| 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 @@ public class Project | |||
| * @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 @@ public class Project | |||
| { | |||
| 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 @@ public class Project | |||
| + 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 ) ); | |||
| } | |||
| } | |||
| @@ -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 @@ import org.apache.myrmidon.api.TaskException; | |||
| */ | |||
| 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 @@ public class Target | |||
| this.project = project; | |||
| } | |||
| public Enumeration getDependencies() | |||
| public Iterator getDependencies() | |||
| { | |||
| return dependencies.elements(); | |||
| return dependencies.iterator(); | |||
| } | |||
| public String getDescription() | |||
| @@ -105,30 +105,29 @@ public class Target | |||
| */ | |||
| 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 @@ public class Target | |||
| int index = -1; | |||
| while( ( index = children.indexOf( el ) ) >= 0 ) | |||
| { | |||
| children.setElementAt( o, index ); | |||
| children.set( index, o ); | |||
| } | |||
| } | |||
| } | |||
| @@ -14,8 +14,9 @@ import java.io.IOException; | |||
| 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; | |||
| @@ -193,21 +194,21 @@ public class AntStructure extends Task | |||
| 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 @@ public class AntStructure extends Task | |||
| { | |||
| 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 @@ public class AntStructure extends Task | |||
| 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 @@ public class AntStructure extends Task | |||
| 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 ) | |||
| @@ -17,9 +17,10 @@ import java.security.DigestInputStream; | |||
| 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 @@ public class Checksum extends MatchingTask implements Condition | |||
| */ | |||
| 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 class Checksum extends MatchingTask implements Condition | |||
| */ | |||
| public void addFileset( FileSet set ) | |||
| { | |||
| filesets.addElement( set ); | |||
| filesets.add( set ); | |||
| } | |||
| /** | |||
| @@ -474,7 +475,7 @@ public class Checksum extends MatchingTask implements Condition | |||
| 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++ ) | |||
| @@ -9,8 +9,8 @@ package org.apache.tools.ant.taskdefs; | |||
| 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; | |||
| @@ -65,10 +65,10 @@ import org.apache.tools.ant.types.FileSet; | |||
| 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 class DependSet extends MatchingTask | |||
| */ | |||
| public void addSrcfilelist( FileList fl ) | |||
| { | |||
| sourceFileLists.addElement( fl ); | |||
| sourceFileLists.add( fl ); | |||
| }//-- DependSet | |||
| /** | |||
| @@ -94,7 +94,7 @@ public class DependSet extends MatchingTask | |||
| */ | |||
| public void addSrcfileset( FileSet fs ) | |||
| { | |||
| sourceFileSets.addElement( fs ); | |||
| sourceFileSets.add( fs ); | |||
| } | |||
| /** | |||
| @@ -104,7 +104,7 @@ public class DependSet extends MatchingTask | |||
| */ | |||
| public void addTargetfilelist( FileList fl ) | |||
| { | |||
| targetFileLists.addElement( fl ); | |||
| targetFileLists.add( fl ); | |||
| } | |||
| /** | |||
| @@ -114,7 +114,7 @@ public class DependSet extends MatchingTask | |||
| */ | |||
| public void addTargetfileset( FileSet fs ) | |||
| { | |||
| targetFileSets.addElement( fs ); | |||
| targetFileSets.add( fs ); | |||
| } | |||
| /** | |||
| @@ -149,12 +149,12 @@ public class DependSet extends MatchingTask | |||
| // | |||
| // 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 @@ public class DependSet extends MatchingTask | |||
| { | |||
| File dest = new File( targetFS.getDir( getProject() ), targetFiles[ i ] ); | |||
| allTargets.addElement( dest ); | |||
| allTargets.add( dest ); | |||
| if( dest.lastModified() > now ) | |||
| { | |||
| @@ -176,11 +176,11 @@ public class DependSet extends MatchingTask | |||
| // 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 @@ public class DependSet extends MatchingTask | |||
| } | |||
| else | |||
| { | |||
| allTargets.addElement( dest ); | |||
| allTargets.add( dest ); | |||
| } | |||
| if( dest.lastModified() > now ) | |||
| { | |||
| @@ -210,11 +210,11 @@ public class DependSet extends MatchingTask | |||
| // | |||
| 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 @@ public class DependSet extends MatchingTask | |||
| 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 @@ public class DependSet extends MatchingTask | |||
| // | |||
| 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 @@ public class DependSet extends MatchingTask | |||
| 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 @@ public class DependSet extends MatchingTask | |||
| 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(); | |||
| } | |||
| @@ -10,7 +10,7 @@ package org.apache.tools.ant.taskdefs; | |||
| 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 @@ import org.apache.tools.ant.util.SourceFileScanner; | |||
| 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 class ExecuteOn extends ExecTask | |||
| */ | |||
| public void addFileset( FileSet set ) | |||
| { | |||
| filesets.addElement( set ); | |||
| filesets.add( set ); | |||
| } | |||
| /** | |||
| @@ -171,7 +171,7 @@ public class ExecuteOn extends ExecTask | |||
| 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 @@ public class ExecuteOn extends ExecTask | |||
| } | |||
| if( !addedFiles.contains( name ) ) | |||
| { | |||
| targets.addElement( name ); | |||
| targets.add( name ); | |||
| addedFiles.put( name, name ); | |||
| } | |||
| } | |||
| @@ -202,7 +202,7 @@ public class ExecuteOn extends ExecTask | |||
| } | |||
| } | |||
| 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 @@ public class ExecuteOn extends ExecTask | |||
| 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 @@ public class ExecuteOn extends ExecTask | |||
| 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 @@ public class ExecuteOn extends ExecTask | |||
| ; | |||
| 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 @@ public class ExecuteOn extends ExecTask | |||
| 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 @@ public class ExecuteOn extends ExecTask | |||
| 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 ); | |||
| @@ -14,7 +14,7 @@ import java.io.FileOutputStream; | |||
| 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 @@ import org.apache.tools.ant.types.PatternSet; | |||
| 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 class Expand extends MatchingTask | |||
| */ | |||
| public void addFileset( FileSet set ) | |||
| { | |||
| filesets.addElement( set ); | |||
| filesets.add( set ); | |||
| } | |||
| /** | |||
| @@ -88,7 +88,7 @@ public class Expand extends MatchingTask | |||
| */ | |||
| public void addPatternset( PatternSet set ) | |||
| { | |||
| patternsets.addElement( set ); | |||
| patternsets.add( set ); | |||
| } | |||
| /** | |||
| @@ -131,7 +131,7 @@ public class Expand extends MatchingTask | |||
| { | |||
| 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 @@ public class Expand extends MatchingTask | |||
| 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 ) | |||
| { | |||
| @@ -19,7 +19,7 @@ import java.io.InputStreamReader; | |||
| 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; | |||
| @@ -586,14 +586,14 @@ public class FixCRLF extends MatchingTask | |||
| 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 @@ public class FixCRLF extends MatchingTask | |||
| } | |||
| } | |||
| class OneLiner implements Enumeration | |||
| class OneLiner | |||
| implements Iterator | |||
| { | |||
| private int state = javafiles ? LOOKING : NOTJAVA; | |||
| @@ -883,6 +884,11 @@ public class FixCRLF extends MatchingTask | |||
| } | |||
| } | |||
| public void remove() | |||
| { | |||
| throw new UnsupportedOperationException(); | |||
| } | |||
| public void setState( int state ) | |||
| { | |||
| this.state = state; | |||
| @@ -907,15 +913,15 @@ public class FixCRLF extends MatchingTask | |||
| } | |||
| } | |||
| public boolean hasMoreElements() | |||
| public boolean hasNext() | |||
| { | |||
| return !reachedEof; | |||
| } | |||
| public Object nextElement() | |||
| public Object next() | |||
| throws NoSuchElementException | |||
| { | |||
| if( !hasMoreElements() ) | |||
| if( !hasNext() ) | |||
| { | |||
| throw new NoSuchElementException( "OneLiner" ); | |||
| } | |||
| @@ -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 class GenerateKey | |||
| 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 @@ public class GenerateKey | |||
| } | |||
| 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() ) ); | |||
| @@ -11,7 +11,7 @@ import java.io.BufferedReader; | |||
| 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 class Input extends Task | |||
| 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 ); | |||
| @@ -17,6 +17,7 @@ import java.io.InputStreamReader; | |||
| 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 @@ public class Jar extends Zip | |||
| { | |||
| 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/" ); | |||
| @@ -11,7 +11,7 @@ import java.io.File; | |||
| 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 @@ public class Java extends Task | |||
| * @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 ); | |||
| } | |||
| @@ -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 @@ public class Javac extends MatchingTask | |||
| 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 class Javac extends MatchingTask | |||
| */ | |||
| 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 @@ public class Javac extends MatchingTask | |||
| { | |||
| ImplementationSpecificArgument arg = | |||
| new ImplementationSpecificArgument(); | |||
| implementationSpecificArgs.addElement( arg ); | |||
| implementationSpecificArgs.add( arg ); | |||
| return arg; | |||
| } | |||
| @@ -12,9 +12,9 @@ import java.io.FileWriter; | |||
| 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 @@ public class Javadoc extends Task | |||
| 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 class Javadoc extends Task | |||
| public void addExcludePackage( PackageName pn ) | |||
| { | |||
| excludePackageNames.addElement( pn ); | |||
| excludePackageNames.add( pn ); | |||
| } | |||
| public void addFooter( Html text ) | |||
| @@ -562,13 +562,13 @@ public class Javadoc extends Task | |||
| 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 class Javadoc extends Task | |||
| 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 @@ public class Javadoc extends Task | |||
| 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 @@ public class Javadoc extends Task | |||
| // 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 @@ public class Javadoc extends Task | |||
| // 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 @@ public class Javadoc extends Task | |||
| 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 @@ public class Javadoc extends Task | |||
| } | |||
| } | |||
| 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 @@ public class Javadoc extends Task | |||
| 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 @@ public class Javadoc extends Task | |||
| * @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 @@ public class Javadoc extends Task | |||
| { | |||
| msg.append( "," ); | |||
| } | |||
| msg.append( packages.elementAt( i ) ); | |||
| msg.append( packages.get( i ) ); | |||
| } | |||
| log( msg.toString(), Project.MSG_VERBOSE ); | |||
| @@ -1076,11 +1076,11 @@ public class Javadoc extends Task | |||
| { | |||
| 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 @@ public class Javadoc extends Task | |||
| 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 @@ public class Javadoc extends Task | |||
| 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 @@ public class Javadoc extends Task | |||
| { | |||
| toExecute.createArgument().setValue( pkgDir ); | |||
| } | |||
| addedPackages.addElement( pkgDir ); | |||
| addedPackages.add( pkgDir ); | |||
| } | |||
| } | |||
| } | |||
| @@ -1244,7 +1244,7 @@ public class Javadoc extends Task | |||
| public class DocletInfo | |||
| { | |||
| private Vector params = new Vector(); | |||
| private ArrayList params = new ArrayList(); | |||
| private String name; | |||
| private Path path; | |||
| @@ -1282,9 +1282,9 @@ public class Javadoc extends Task | |||
| return name; | |||
| } | |||
| public Enumeration getParams() | |||
| public Iterator getParams() | |||
| { | |||
| return params.elements(); | |||
| return params.iterator(); | |||
| } | |||
| public Path getPath() | |||
| @@ -1295,7 +1295,7 @@ public class Javadoc extends Task | |||
| public DocletParam createParam() | |||
| { | |||
| DocletParam param = new DocletParam(); | |||
| params.addElement( param ); | |||
| params.add( param ); | |||
| return param; | |||
| } | |||
| @@ -1339,7 +1339,7 @@ public class Javadoc extends Task | |||
| public class GroupArgument | |||
| { | |||
| private Vector packages = new Vector( 3 ); | |||
| private ArrayList packages = new ArrayList( 3 ); | |||
| private Html title; | |||
| public GroupArgument() | |||
| @@ -1374,7 +1374,7 @@ public class Javadoc extends Task | |||
| { | |||
| p.append( ":" ); | |||
| } | |||
| p.append( packages.elementAt( i ).toString() ); | |||
| p.append( packages.get( i ).toString() ); | |||
| } | |||
| return p.toString(); | |||
| } | |||
| @@ -1386,7 +1386,7 @@ public class Javadoc extends Task | |||
| public void addPackage( PackageName pn ) | |||
| { | |||
| packages.addElement( pn ); | |||
| packages.add( pn ); | |||
| } | |||
| public void addTitle( Html text ) | |||
| @@ -18,9 +18,10 @@ import java.io.PrintWriter; | |||
| 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 @@ public class Manifest extends Task | |||
| * | |||
| * @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 class Manifest extends Task | |||
| */ | |||
| 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 @@ public class Manifest extends Task | |||
| 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 @@ public class Manifest extends Task | |||
| return name; | |||
| } | |||
| public Enumeration getWarnings() | |||
| public Iterator getWarnings() | |||
| { | |||
| return warnings.elements(); | |||
| return warnings.iterator(); | |||
| } | |||
| /** | |||
| @@ -733,7 +734,7 @@ public class Manifest extends Task | |||
| } | |||
| 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 @@ public class Manifest extends Task | |||
| 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 @@ public class Manifest extends Task | |||
| 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 @@ public class Manifest extends Task | |||
| 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 @@ public class Manifest extends Task | |||
| } | |||
| // 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 @@ public class Manifest extends Task | |||
| } | |||
| 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 ); | |||
| } | |||
| } | |||
| @@ -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 @@ public class PathConvert extends Task | |||
| 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 @@ public class PathConvert extends Task | |||
| { | |||
| MapEntry entry = new MapEntry(); | |||
| prefixMap.addElement( entry ); | |||
| prefixMap.add( entry ); | |||
| return entry; | |||
| } | |||
| @@ -250,7 +250,7 @@ public class PathConvert extends Task | |||
| 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 | |||
| @@ -11,9 +11,10 @@ import java.io.File; | |||
| 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 @@ public class Property extends Task | |||
| 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 ) | |||
| { | |||
| @@ -11,7 +11,6 @@ import java.io.PrintStream; | |||
| 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 | |||
| @@ -21,7 +21,7 @@ import java.io.OutputStreamWriter; | |||
| 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 @@ public class Replace extends MatchingTask | |||
| 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 class Replace extends MatchingTask | |||
| public Replacefilter createReplacefilter() | |||
| { | |||
| Replacefilter filter = new Replacefilter(); | |||
| replacefilters.addElement( filter ); | |||
| replacefilters.add( filter ); | |||
| return filter; | |||
| } | |||
| @@ -273,7 +273,7 @@ public class Replace extends MatchingTask | |||
| { | |||
| 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 @@ public class Replace extends MatchingTask | |||
| 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 ); | |||
| @@ -10,7 +10,7 @@ package org.apache.tools.ant.taskdefs; | |||
| 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 @@ public class Rmic extends MatchingTask | |||
| 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 @@ public class Rmic extends MatchingTask | |||
| return compileClasspath; | |||
| } | |||
| public Vector getCompileList() | |||
| public ArrayList getCompileList() | |||
| { | |||
| return compileList; | |||
| } | |||
| @@ -323,7 +323,7 @@ public class Rmic extends MatchingTask | |||
| * | |||
| * @return The FileList value | |||
| */ | |||
| public Vector getFileList() | |||
| public ArrayList getFileList() | |||
| { | |||
| return compileList; | |||
| } | |||
| @@ -596,12 +596,12 @@ public class Rmic extends MatchingTask | |||
| 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 @@ public class Rmic extends MatchingTask | |||
| { | |||
| String classname = newFiles[ i ].replace( File.separatorChar, '.' ); | |||
| classname = classname.substring( 0, classname.lastIndexOf( ".class" ) ); | |||
| compileList.addElement( classname ); | |||
| compileList.add( classname ); | |||
| } | |||
| } | |||
| @@ -26,10 +26,10 @@ import java.sql.ResultSetMetaData; | |||
| 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 @@ public class SQLExec extends Task | |||
| private int goodSql = 0, totalSql = 0; | |||
| private Vector filesets = new Vector(); | |||
| private ArrayList filesets = new ArrayList(); | |||
| /** | |||
| * Database connection | |||
| @@ -103,7 +103,7 @@ public class SQLExec extends Task | |||
| /** | |||
| * SQL transactions to perform | |||
| */ | |||
| private Vector transactions = new Vector(); | |||
| private ArrayList transactions = new ArrayList(); | |||
| /** | |||
| * SQL Statement delimiter | |||
| @@ -347,7 +347,7 @@ public class SQLExec extends Task | |||
| */ | |||
| public void addFileset( FileSet set ) | |||
| { | |||
| filesets.addElement( set ); | |||
| filesets.add( set ); | |||
| } | |||
| /** | |||
| @@ -383,7 +383,7 @@ public class SQLExec extends Task | |||
| public Transaction createTransaction() | |||
| { | |||
| Transaction t = new Transaction(); | |||
| transactions.addElement( t ); | |||
| transactions.add( t ); | |||
| return t; | |||
| } | |||
| @@ -409,7 +409,7 @@ public class SQLExec extends Task | |||
| // 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 @@ public class SQLExec extends Task | |||
| } | |||
| // 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 ); | |||
| @@ -12,9 +12,9 @@ import java.io.File; | |||
| 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 @@ public class SendEmail extends Task | |||
| { | |||
| 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 @@ public class SendEmail extends Task | |||
| while( t.hasMoreTokens() ) | |||
| { | |||
| files.addElement( resolveFile( t.nextToken() ) ); | |||
| files.add( resolveFile( t.nextToken() ) ); | |||
| } | |||
| } | |||
| @@ -324,9 +324,9 @@ public class SendEmail extends Task | |||
| { | |||
| 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() ) | |||
| { | |||
| @@ -9,8 +9,9 @@ package org.apache.tools.ant.taskdefs; | |||
| 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 @@ public class SignJar extends Task | |||
| /** | |||
| * 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 class SignJar extends Task | |||
| */ | |||
| public void addFileset( final FileSet set ) | |||
| { | |||
| filesets.addElement( set ); | |||
| filesets.add( set ); | |||
| } | |||
| public void execute() | |||
| @@ -154,7 +155,7 @@ public class SignJar extends Task | |||
| // 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++ ) | |||
| @@ -11,8 +11,8 @@ import java.io.File; | |||
| 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 @@ public class Tar | |||
| } | |||
| } | |||
| 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 class Tar | |||
| public TarFileSet createTarFileSet() | |||
| { | |||
| TarFileSet fileset = new TarFileSet(); | |||
| filesets.addElement( fileset ); | |||
| filesets.add( fileset ); | |||
| return fileset; | |||
| } | |||
| @@ -131,7 +131,7 @@ public class Tar | |||
| // 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 @@ public class Tar | |||
| // 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 @@ public class Tar | |||
| } | |||
| 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++ ) | |||
| { | |||
| @@ -13,7 +13,7 @@ import java.io.IOException; | |||
| 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 @@ import org.apache.tools.ant.types.FileSet; | |||
| 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 class Touch extends Task | |||
| */ | |||
| public void addFileset( FileSet set ) | |||
| { | |||
| filesets.addElement( set ); | |||
| filesets.add( set ); | |||
| } | |||
| /** | |||
| @@ -170,7 +170,7 @@ public class Touch extends Task | |||
| // 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() ); | |||
| @@ -10,13 +10,13 @@ package org.apache.tools.ant.taskdefs; | |||
| 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 @@ import org.apache.tools.ant.types.EnumeratedAttribute; | |||
| 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 class Tstamp extends Task | |||
| public CustomFormat createFormat() | |||
| { | |||
| CustomFormat cts = new CustomFormat( prefix ); | |||
| customFormats.addElement( cts ); | |||
| customFormats.add( cts ); | |||
| return cts; | |||
| } | |||
| @@ -69,10 +69,10 @@ public class Tstamp extends Task | |||
| 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 ); | |||
| } | |||
| @@ -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 @@ import org.apache.tools.ant.util.SourceFileScanner; | |||
| 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 class UpToDate extends MatchingTask implements Condition | |||
| */ | |||
| public void addSrcfiles( FileSet fs ) | |||
| { | |||
| sourceFileSets.addElement( fs ); | |||
| sourceFileSets.add( fs ); | |||
| } | |||
| /** | |||
| @@ -123,11 +123,11 @@ public class UpToDate extends MatchingTask implements Condition | |||
| 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() ); | |||
| @@ -15,9 +15,9 @@ import java.io.FileOutputStream; | |||
| 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 @@ public class Zip extends MatchingTask | |||
| 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 @@ public class Zip extends MatchingTask | |||
| 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 class Zip extends MatchingTask | |||
| */ | |||
| public void addFileset( FileSet set ) | |||
| { | |||
| filesets.addElement( set ); | |||
| filesets.add( set ); | |||
| } | |||
| /** | |||
| @@ -208,7 +207,7 @@ public class Zip extends MatchingTask | |||
| */ | |||
| public void addZipfileset( ZipFileSet set ) | |||
| { | |||
| filesets.addElement( set ); | |||
| filesets.add( set ); | |||
| } | |||
| public void execute() | |||
| @@ -258,19 +257,19 @@ public class Zip extends MatchingTask | |||
| } | |||
| // 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 @@ public class Zip extends MatchingTask | |||
| { | |||
| 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 @@ public class Zip extends MatchingTask | |||
| } | |||
| /** | |||
| * 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 @@ public class Zip extends MatchingTask | |||
| 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 @@ public class Zip extends MatchingTask | |||
| } | |||
| 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 ) | |||
| @@ -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; | |||
| @@ -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; | |||
| @@ -26,7 +27,7 @@ import org.apache.tools.ant.taskdefs.UpToDate; | |||
| */ | |||
| 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 abstract class ConditionBase extends ProjectComponent | |||
| */ | |||
| public void addAnd( And a ) | |||
| { | |||
| conditions.addElement( a ); | |||
| conditions.add( a ); | |||
| } | |||
| /** | |||
| @@ -47,7 +48,7 @@ public abstract class ConditionBase extends ProjectComponent | |||
| */ | |||
| public void addAvailable( Available a ) | |||
| { | |||
| conditions.addElement( a ); | |||
| conditions.add( a ); | |||
| } | |||
| /** | |||
| @@ -58,7 +59,7 @@ public abstract class ConditionBase extends ProjectComponent | |||
| */ | |||
| public void addChecksum( Checksum c ) | |||
| { | |||
| conditions.addElement( c ); | |||
| conditions.add( c ); | |||
| } | |||
| /** | |||
| @@ -69,7 +70,7 @@ public abstract class ConditionBase extends ProjectComponent | |||
| */ | |||
| public void addEquals( Equals e ) | |||
| { | |||
| conditions.addElement( e ); | |||
| conditions.add( e ); | |||
| } | |||
| /** | |||
| @@ -80,7 +81,7 @@ public abstract class ConditionBase extends ProjectComponent | |||
| */ | |||
| public void addHttp( Http h ) | |||
| { | |||
| conditions.addElement( h ); | |||
| conditions.add( h ); | |||
| } | |||
| /** | |||
| @@ -91,7 +92,7 @@ public abstract class ConditionBase extends ProjectComponent | |||
| */ | |||
| public void addIsSet( IsSet i ) | |||
| { | |||
| conditions.addElement( i ); | |||
| conditions.add( i ); | |||
| } | |||
| /** | |||
| @@ -102,7 +103,7 @@ public abstract class ConditionBase extends ProjectComponent | |||
| */ | |||
| public void addNot( Not n ) | |||
| { | |||
| conditions.addElement( n ); | |||
| conditions.add( n ); | |||
| } | |||
| /** | |||
| @@ -113,7 +114,7 @@ public abstract class ConditionBase extends ProjectComponent | |||
| */ | |||
| public void addOr( Or o ) | |||
| { | |||
| conditions.addElement( o ); | |||
| conditions.add( o ); | |||
| } | |||
| /** | |||
| @@ -124,7 +125,7 @@ public abstract class ConditionBase extends ProjectComponent | |||
| */ | |||
| public void addOs( Os o ) | |||
| { | |||
| conditions.addElement( o ); | |||
| conditions.add( o ); | |||
| } | |||
| /** | |||
| @@ -135,7 +136,7 @@ public abstract class ConditionBase extends ProjectComponent | |||
| */ | |||
| public void addSocket( Socket s ) | |||
| { | |||
| conditions.addElement( s ); | |||
| conditions.add( s ); | |||
| } | |||
| /** | |||
| @@ -146,7 +147,7 @@ public abstract class ConditionBase extends ProjectComponent | |||
| */ | |||
| public void addUptodate( UpToDate u ) | |||
| { | |||
| conditions.addElement( u ); | |||
| conditions.add( u ); | |||
| } | |||
| /** | |||
| @@ -193,7 +194,7 @@ public abstract class ConditionBase extends ProjectComponent | |||
| Object o = null; | |||
| try | |||
| { | |||
| o = conditions.elementAt( currentElement++ ); | |||
| o = conditions.get( currentElement++ ); | |||
| } | |||
| catch( ArrayIndexOutOfBoundsException e ) | |||
| { | |||
| @@ -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; | |||
| @@ -13,17 +13,16 @@ import java.io.File; | |||
| 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 @@ public class Execute | |||
| 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 @@ public class Execute | |||
| 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 @@ public class Execute | |||
| * | |||
| * @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 @@ public class Execute | |||
| 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 @@ public class Execute | |||
| // 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 @@ public class Execute | |||
| 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 @@ public class Execute | |||
| 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 ); | |||
| } | |||
| } | |||
| @@ -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 @@ class ProcessDestroyer | |||
| 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 @@ class ProcessDestroyer | |||
| */ | |||
| public boolean add( Process process ) | |||
| { | |||
| processes.addElement( process ); | |||
| processes.add( process ); | |||
| return processes.contains( process ); | |||
| } | |||
| @@ -71,7 +71,7 @@ class ProcessDestroyer | |||
| */ | |||
| public boolean remove( Process process ) | |||
| { | |||
| return processes.removeElement( process ); | |||
| return processes.remove( process ); | |||
| } | |||
| /** | |||
| @@ -81,10 +81,10 @@ class ProcessDestroyer | |||
| { | |||
| synchronized( processes ) | |||
| { | |||
| Enumeration e = processes.elements(); | |||
| while( e.hasMoreElements() ) | |||
| Iterator e = processes.iterator(); | |||
| while( e.hasNext() ) | |||
| { | |||
| ( (Process)e.nextElement() ).destroy(); | |||
| ( (Process)e.next() ).destroy(); | |||
| } | |||
| } | |||
| } | |||
| @@ -10,9 +10,10 @@ package org.apache.tools.ant.taskdefs.file; | |||
| 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 @@ public class Copy | |||
| 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 @@ public class Copy | |||
| 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 class Copy | |||
| */ | |||
| public void addFileset( final FileSet set ) | |||
| { | |||
| m_filesets.addElement( set ); | |||
| m_filesets.add( set ); | |||
| } | |||
| /** | |||
| @@ -183,7 +184,7 @@ public class Copy | |||
| public FilterSet createFilterSet() | |||
| { | |||
| final FilterSet filterSet = new FilterSet(); | |||
| m_filterSets.addElement( filterSet ); | |||
| m_filterSets.add( filterSet ); | |||
| return filterSet; | |||
| } | |||
| @@ -248,7 +249,7 @@ public class Copy | |||
| // 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 @@ public class Copy | |||
| * | |||
| * @return a vector of FilterSet objects | |||
| */ | |||
| protected Vector getFilterSets() | |||
| protected ArrayList getFilterSets() | |||
| { | |||
| return m_filterSets; | |||
| } | |||
| @@ -422,9 +423,9 @@ public class Copy | |||
| 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 @@ public class Copy | |||
| } | |||
| 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 @@ public class Copy | |||
| if( m_file == null ) | |||
| { | |||
| m_file = new File( srcFiles[ 0 ] ); | |||
| m_filesets.removeElementAt( 0 ); | |||
| m_filesets.remove( 0 ); | |||
| } | |||
| else | |||
| { | |||
| @@ -536,7 +537,7 @@ public class Copy | |||
| } | |||
| } | |||
| protected Vector getFilesets() | |||
| protected ArrayList getFilesets() | |||
| { | |||
| return m_filesets; | |||
| } | |||
| @@ -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 @@ public class Delete | |||
| { | |||
| 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 class Delete | |||
| */ | |||
| public void addFileset( FileSet set ) | |||
| { | |||
| filesets.addElement( set ); | |||
| filesets.add( set ); | |||
| } | |||
| /** | |||
| @@ -304,7 +304,7 @@ public class Delete | |||
| // 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() ); | |||
| @@ -9,6 +9,8 @@ package org.apache.tools.ant.taskdefs.file; | |||
| 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 @@ public class Move extends Copy | |||
| { | |||
| 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 @@ public class Move extends Copy | |||
| 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 ) ) | |||
| @@ -12,8 +12,8 @@ import java.io.FileOutputStream; | |||
| 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 @@ import org.apache.tools.ant.types.FileSet; | |||
| 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 class Cab extends MatchingTask | |||
| */ | |||
| public void addFileset( FileSet set ) | |||
| { | |||
| filesets.addElement( set ); | |||
| filesets.add( set ); | |||
| } | |||
| public void execute() | |||
| @@ -108,7 +108,7 @@ public class Cab extends MatchingTask | |||
| checkConfiguration(); | |||
| Vector files = getFileList(); | |||
| ArrayList files = getFileList(); | |||
| // quick exit if the target is up to date | |||
| if( isUpToDate( files ) ) | |||
| @@ -122,11 +122,11 @@ public class Cab extends MatchingTask | |||
| 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 @@ public class Cab extends MatchingTask | |||
| * @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 @@ public class Cab extends MatchingTask | |||
| // 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 @@ public class Cab extends MatchingTask | |||
| * @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 @@ public class Cab extends MatchingTask | |||
| * @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 @@ public class Cab extends MatchingTask | |||
| * @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 @@ public class Cab extends MatchingTask | |||
| for( int i = 0; i < files.size(); i++ ) | |||
| { | |||
| writer.println( files.elementAt( i ).toString() ); | |||
| writer.println( files.get( i ).toString() ); | |||
| } | |||
| writer.close(); | |||
| @@ -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 @@ public class Javah extends Task | |||
| //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 class Javah extends Task | |||
| public ClassArgument createClass() | |||
| { | |||
| ClassArgument ga = new ClassArgument(); | |||
| classes.addElement( ga ); | |||
| classes.add( ga ); | |||
| return ga; | |||
| } | |||
| @@ -306,10 +306,10 @@ public class Javah extends Task | |||
| } | |||
| } | |||
| 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 ); | |||
| @@ -14,10 +14,10 @@ import java.io.FileOutputStream; | |||
| 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 @@ public class ManifestFile extends Task | |||
| 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 class ManifestFile extends Task | |||
| public Entry createEntry() | |||
| { | |||
| Entry entry = new Entry(); | |||
| entries.addElement( entry ); | |||
| entries.add( entry ); | |||
| return entry; | |||
| } | |||
| @@ -128,7 +128,7 @@ public class ManifestFile extends Task | |||
| { | |||
| StringBuffer buffer = new StringBuffer(); | |||
| ListIterator iterator = container.elements(); | |||
| ListIterator iterator = container.iterator(); | |||
| while( iterator.hasNext() ) | |||
| { | |||
| @@ -171,11 +171,11 @@ public class ManifestFile extends Task | |||
| 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 @@ public class ManifestFile extends Task | |||
| } | |||
| 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 @@ public class ManifestFile extends Task | |||
| 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 class ManifestFile extends Task | |||
| } | |||
| } | |||
| public ListIterator elements() | |||
| public ListIterator iterator() | |||
| { | |||
| ListIterator iterator = list.listIterator(); | |||
| return iterator; | |||
| @@ -11,11 +11,11 @@ import java.io.File; | |||
| 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 @@ public class NetRexxC extends MatchingTask | |||
| 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 @@ public class NetRexxC extends MatchingTask | |||
| */ | |||
| 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 @@ public class NetRexxC extends MatchingTask | |||
| 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 @@ public class NetRexxC extends MatchingTask | |||
| // 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 @@ public class NetRexxC extends MatchingTask | |||
| 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 @@ public class NetRexxC extends MatchingTask | |||
| if( !compile || srcFile.lastModified() > classFile.lastModified() ) | |||
| { | |||
| filecopyList.put( srcFile.getAbsolutePath(), destFile.getAbsolutePath() ); | |||
| compileList.addElement( destFile.getAbsolutePath() ); | |||
| compileList.add( destFile.getAbsolutePath() ); | |||
| } | |||
| } | |||
| else | |||
| @@ -22,10 +22,10 @@ import java.text.ParseException; | |||
| 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 @@ public class PropertyFile extends Task | |||
| */ | |||
| private final static String NEWLINE = System.getProperty( "line.separator" ); | |||
| private Vector entries = new Vector(); | |||
| private ArrayList entries = new ArrayList(); | |||
| /* | |||
| * ======================================================================== | |||
| @@ -164,7 +164,7 @@ public class PropertyFile extends Task | |||
| public Entry createEntry() | |||
| { | |||
| Entry e = new Entry(); | |||
| entries.addElement( e ); | |||
| entries.add( e ); | |||
| return e; | |||
| } | |||
| @@ -212,9 +212,9 @@ public class PropertyFile extends Task | |||
| 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 ); | |||
| } | |||
| } | |||
| @@ -15,7 +15,7 @@ import java.io.FileWriter; | |||
| 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 @@ public class ReplaceRegExp extends Task | |||
| 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 @@ public class ReplaceRegExp extends Task | |||
| { | |||
| super(); | |||
| this.file = null; | |||
| this.filesets = new Vector(); | |||
| this.filesets = new ArrayList(); | |||
| this.flags = ""; | |||
| this.byline = false; | |||
| @@ -135,7 +135,7 @@ public class ReplaceRegExp extends Task | |||
| public void addFileset( FileSet set ) | |||
| { | |||
| filesets.addElement( set ); | |||
| filesets.add( set ); | |||
| } | |||
| public RegularExpression createRegularExpression() | |||
| @@ -204,7 +204,7 @@ public class ReplaceRegExp extends Task | |||
| 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(); | |||
| @@ -12,7 +12,7 @@ import com.ibm.bsf.BSFManager; | |||
| 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 @@ public class Script extends Task | |||
| 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 @@ public class Script extends Task | |||
| */ | |||
| 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 ) ); | |||
| @@ -10,7 +10,7 @@ package org.apache.tools.ant.taskdefs.optional.depend; | |||
| 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 @@ public class ClassFile | |||
| * | |||
| * @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 @@ public class ClassFile | |||
| if( !classEntry.getClassName().equals( className ) ) | |||
| { | |||
| classRefs.addElement( ClassFileUtils.convertSlashName( classEntry.getClassName() ) ); | |||
| classRefs.add( ClassFileUtils.convertSlashName( classEntry.getClassName() ) ); | |||
| } | |||
| } | |||
| } | |||
| @@ -15,9 +15,10 @@ import java.io.FileWriter; | |||
| 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 @@ public class Depend extends MatchingTask | |||
| * 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 @@ public class Depend extends MatchingTask | |||
| * @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 @@ public class Depend extends MatchingTask | |||
| 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 @@ public class Depend extends MatchingTask | |||
| 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 @@ public class Depend extends MatchingTask | |||
| { | |||
| // 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 @@ public class Depend extends MatchingTask | |||
| // 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 @@ public class Depend extends MatchingTask | |||
| 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 @@ public class Depend extends MatchingTask | |||
| { | |||
| 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 @@ public class Depend extends MatchingTask | |||
| 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 ) ); | |||
| } | |||
| } | |||
| } | |||
| @@ -10,9 +10,9 @@ package org.apache.tools.ant.taskdefs.optional.depend; | |||
| 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 @@ public class DirectoryIterator implements ClassFileIterator | |||
| * 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 @@ public class DirectoryIterator implements ClassFileIterator | |||
| rootLength = 0; | |||
| } | |||
| Vector filesInRoot = getDirectoryEntries( rootDirectory ); | |||
| ArrayList filesInRoot = getDirectoryEntries( rootDirectory ); | |||
| currentEnum = filesInRoot.elements(); | |||
| currentEnum = filesInRoot.iterator(); | |||
| } | |||
| /** | |||
| @@ -94,15 +94,15 @@ public class DirectoryIterator implements ClassFileIterator | |||
| */ | |||
| 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 @@ public class DirectoryIterator implements ClassFileIterator | |||
| // 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 @@ public class DirectoryIterator implements ClassFileIterator | |||
| javaClass.read( inFileStream ); | |||
| nextElement = javaClass; | |||
| next = javaClass; | |||
| } | |||
| } | |||
| } | |||
| @@ -142,17 +142,17 @@ public class DirectoryIterator implements ClassFileIterator | |||
| } | |||
| else | |||
| { | |||
| currentEnum = (Enumeration)enumStack.pop(); | |||
| currentEnum = (Iterator)enumStack.pop(); | |||
| } | |||
| } | |||
| } | |||
| } | |||
| catch( IOException e ) | |||
| { | |||
| nextElement = null; | |||
| next = null; | |||
| } | |||
| return nextElement; | |||
| return next; | |||
| } | |||
| /** | |||
| @@ -162,9 +162,9 @@ public class DirectoryIterator implements ClassFileIterator | |||
| * @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 @@ public class DirectoryIterator implements ClassFileIterator | |||
| for( int i = 0; i < length; ++i ) | |||
| { | |||
| files.addElement( new File( directory, filesInDir[ i ] ) ); | |||
| files.add( new File( directory, filesInDir[ i ] ) ); | |||
| } | |||
| } | |||
| @@ -33,13 +33,13 @@ public class JarFileIterator implements ClassFileIterator | |||
| 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 @@ public class JarFileIterator implements ClassFileIterator | |||
| javaClass.read( jarStream ); | |||
| nextElement = javaClass; | |||
| next = javaClass; | |||
| } | |||
| else | |||
| { | |||
| @@ -73,7 +73,7 @@ public class JarFileIterator implements ClassFileIterator | |||
| throw new RuntimeException( "Problem reading JAR file: " + text ); | |||
| } | |||
| return nextElement; | |||
| return next; | |||
| } | |||
| private byte[] getEntryBytes( InputStream stream ) | |||
| @@ -9,9 +9,9 @@ package org.apache.tools.ant.taskdefs.optional.depend.constantpool; | |||
| 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 @@ public class ConstantPool | |||
| /** | |||
| * 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 class ConstantPool | |||
| */ | |||
| 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 @@ public class ConstantPool | |||
| 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 @@ public class ConstantPool | |||
| 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 class ConstantPool | |||
| */ | |||
| public ConstantPoolEntry getEntry( int index ) | |||
| { | |||
| return (ConstantPoolEntry)entries.elementAt( index ); | |||
| return (ConstantPoolEntry)entries.get( index ); | |||
| } | |||
| /** | |||
| @@ -136,7 +136,7 @@ public class ConstantPool | |||
| 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 @@ public class ConstantPool | |||
| 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 @@ public class ConstantPool | |||
| 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 @@ public class ConstantPool | |||
| 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 @@ public class ConstantPool | |||
| { | |||
| 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 class ConstantPool | |||
| */ | |||
| 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() ) | |||
| { | |||
| @@ -15,7 +15,7 @@ import java.io.InputStreamReader; | |||
| 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 @@ public class BorlandDeploymentTool extends GenericDeploymentTool implements Exec | |||
| throws TaskException | |||
| { | |||
| //build the home classes list. | |||
| Vector homes = new Vector(); | |||
| ArrayList homes = new ArrayList(); | |||
| Iterator it = files.keySet().iterator(); | |||
| while( it.hasNext() ) | |||
| { | |||
| @@ -13,7 +13,7 @@ import java.io.FileWriter; | |||
| 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 @@ public class EjbcHelper | |||
| 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 ); | |||
| @@ -819,7 +819,7 @@ public class GenericDeploymentTool implements EJBDeploymentTool | |||
| JarOutputStream jarStream = null; | |||
| try | |||
| { | |||
| // clean the addedfiles Vector | |||
| // clean the addedfiles ArrayList | |||
| addedfiles = new ArrayList(); | |||
| /* | |||
| @@ -12,7 +12,7 @@ import java.io.FileInputStream; | |||
| 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 @@ public class WeblogicDeploymentTool extends GenericDeploymentTool | |||
| 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 @@ public class WeblogicDeploymentTool extends GenericDeploymentTool | |||
| 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 @@ public class WeblogicDeploymentTool extends GenericDeploymentTool | |||
| 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 ) ); | |||
| } | |||
| } | |||
| @@ -11,7 +11,7 @@ import java.io.File; | |||
| 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 @@ public class WebsphereDeploymentTool extends GenericDeploymentTool | |||
| //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 @@ public class WebsphereDeploymentTool extends GenericDeploymentTool | |||
| //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() ) | |||
| { | |||
| @@ -17,7 +17,7 @@ import java.io.InputStreamReader; | |||
| 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 @@ import org.apache.tools.ant.types.FileSet; | |||
| 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 class Translate extends MatchingTask | |||
| */ | |||
| public void addFileset( FileSet set ) | |||
| { | |||
| filesets.addElement( set ); | |||
| filesets.add( set ); | |||
| } | |||
| /** | |||
| @@ -517,7 +517,7 @@ public class Translate extends MatchingTask | |||
| { | |||
| 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++ ) | |||
| @@ -37,7 +37,7 @@ import java.awt.event.TextListener; | |||
| 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 @@ public class VAJAntToolGUI extends Frame | |||
| 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 ) | |||
| @@ -10,9 +10,9 @@ package org.apache.tools.ant.taskdefs.optional.ide; | |||
| 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 @@ class VAJBuildInfo implements Runnable | |||
| 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 @@ class VAJBuildInfo implements Runnable | |||
| result.setTarget( tok.nextToken() ); | |||
| while( tok.hasMoreTokens() ) | |||
| { | |||
| result.projectTargets.addElement( tok.nextToken() ); | |||
| result.projectTargets.add( tok.nextToken() ); | |||
| } | |||
| } | |||
| catch( Throwable t ) | |||
| @@ -101,12 +101,12 @@ class VAJBuildInfo implements Runnable | |||
| * @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 @@ class VAJBuildInfo implements Runnable | |||
| * | |||
| * @return The ProjectTargets value | |||
| */ | |||
| public Vector getProjectTargets() | |||
| public ArrayList getProjectTargets() | |||
| { | |||
| return projectTargets; | |||
| } | |||
| @@ -247,10 +247,10 @@ class VAJBuildInfo implements Runnable | |||
| { | |||
| 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 @@ class VAJBuildInfo implements Runnable | |||
| { | |||
| 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(); | |||
| @@ -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 @@ import org.apache.tools.ant.types.FileSet; | |||
| */ | |||
| 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 class VAJImport extends VAJTask | |||
| */ | |||
| public void addFileset( FileSet set ) | |||
| { | |||
| filesets.addElement( set ); | |||
| filesets.add( set ); | |||
| } | |||
| /** | |||
| @@ -211,9 +211,9 @@ public class VAJImport extends VAJTask | |||
| 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() ); | |||
| } | |||
| } | |||
| @@ -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 @@ import java.util.Vector; | |||
| 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 class VAJLoad extends VAJTask | |||
| public VAJProjectDescription createVAJProject() | |||
| { | |||
| VAJProjectDescription d = new VAJProjectDescription(); | |||
| projectDescriptions.addElement( d ); | |||
| projectDescriptions.add( d ); | |||
| return d; | |||
| } | |||
| @@ -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 @@ public class VAJLoadServlet extends VAJToolsServlet | |||
| 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 ); | |||
| @@ -17,8 +17,8 @@ import com.ibm.ivj.util.base.ToolEnv; | |||
| 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 @@ abstract class VAJLocalUtil implements VAJUtil | |||
| } | |||
| 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 @@ abstract class VAJLocalUtil implements VAJUtil | |||
| * | |||
| * @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 @@ abstract class VAJLocalUtil implements VAJUtil | |||
| 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 @@ abstract class VAJLocalUtil implements VAJUtil | |||
| * @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 @@ abstract class VAJLocalUtil implements VAJUtil | |||
| */ | |||
| private void addFilesToImport( | |||
| ImportCodeSpec spec, boolean doImport, | |||
| Vector files, String fileType, | |||
| ArrayList files, String fileType, | |||
| StringBuffer summaryLog ) | |||
| { | |||
| @@ -409,7 +409,7 @@ abstract class VAJLocalUtil implements VAJUtil | |||
| * @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 @@ abstract class VAJLocalUtil implements VAJUtil | |||
| 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 @@ abstract class VAJLocalUtil implements VAJUtil | |||
| /** | |||
| * 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 @@ abstract class VAJLocalUtil implements VAJUtil | |||
| 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 ] ); | |||
| } | |||
| } | |||
| } | |||
| @@ -14,8 +14,8 @@ import java.io.InputStream; | |||
| 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 @@ class VAJRemoteUtil implements VAJUtil | |||
| * | |||
| * @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( ' ', '+' ) | |||
| @@ -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 @@ interface VAJUtil | |||
| * | |||
| * @param projectDescriptions Description of Parameter | |||
| */ | |||
| void loadProjects( Vector projectDescriptions ); | |||
| void loadProjects( ArrayList projectDescriptions ); | |||
| /** | |||
| * Logs a message with the specified log level. | |||
| @@ -11,9 +11,9 @@ import com.ibm.ivj.util.base.IvjException; | |||
| 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 @@ class VAJWorkspaceScanner extends DirectoryScanner | |||
| // 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 @@ class VAJWorkspaceScanner extends DirectoryScanner | |||
| 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 @@ class VAJWorkspaceScanner extends DirectoryScanner | |||
| * | |||
| * @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 @@ class VAJWorkspaceScanner extends DirectoryScanner | |||
| } | |||
| else if( match( projectNamePattern, project.getName() ) ) | |||
| { | |||
| matchingProjects.addElement( project ); | |||
| matchingProjects.add( project ); | |||
| break; | |||
| } | |||
| } | |||
| @@ -146,10 +146,10 @@ class VAJWorkspaceScanner extends DirectoryScanner | |||
| 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 @@ class VAJWorkspaceScanner extends DirectoryScanner | |||
| } | |||
| // 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 @@ class VAJWorkspaceScanner extends DirectoryScanner | |||
| + item.getName().replace( '.', File.separatorChar ); | |||
| if( isIncluded( name ) && !isExcluded( name ) ) | |||
| { | |||
| packagesIncluded.addElement( item ); | |||
| packagesIncluded.add( item ); | |||
| } | |||
| } | |||
| } | |||
| @@ -9,8 +9,9 @@ package org.apache.tools.ant.taskdefs.optional.javacc; | |||
| 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; | |||
| @@ -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; | |||
| @@ -13,8 +13,9 @@ import java.io.FileInputStream; | |||
| 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 @@ public class jlink extends Object | |||
| 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 @@ public class jlink extends Object | |||
| { | |||
| return; | |||
| } | |||
| addfiles.addElement( addfile ); | |||
| addfiles.add( addfile ); | |||
| } | |||
| /** | |||
| @@ -126,7 +127,7 @@ public class jlink extends Object | |||
| { | |||
| return; | |||
| } | |||
| mergefiles.addElement( mergefile ); | |||
| mergefiles.add( mergefile ); | |||
| } | |||
| /** | |||
| @@ -172,10 +173,10 @@ public class jlink extends Object | |||
| { | |||
| 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 @@ public class jlink extends Object | |||
| } | |||
| 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() ) | |||
| { | |||
| @@ -9,7 +9,7 @@ package org.apache.tools.ant.taskdefs.optional.jsp; | |||
| 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; | |||
| @@ -66,7 +66,7 @@ public class JspC extends MatchingTask | |||
| 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 class JspC extends MatchingTask | |||
| /* | |||
| * ------------------------------------------------------------ | |||
| */ | |||
| public Vector getCompileList() | |||
| public ArrayList getCompileList() | |||
| { | |||
| return compileList; | |||
| } | |||
| @@ -430,7 +430,7 @@ public class JspC extends MatchingTask | |||
| */ | |||
| protected void resetFileLists() | |||
| { | |||
| compileList.removeAllElements(); | |||
| compileList.clear(); | |||
| } | |||
| /* | |||
| @@ -482,7 +482,7 @@ public class JspC extends MatchingTask | |||
| " because it is out of date with respect to " | |||
| + javaFile.getPath(), Project.MSG_DEBUG ); | |||
| } | |||
| compileList.addElement( srcFile.getAbsolutePath() ); | |||
| compileList.add( srcFile.getAbsolutePath() ); | |||
| } | |||
| } | |||
| } | |||
| @@ -10,7 +10,7 @@ package org.apache.tools.ant.taskdefs.optional.jsp;//java imports | |||
| 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 @@ public class WLJspc extends MatchingTask | |||
| //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 @@ public class WLJspc extends MatchingTask | |||
| // 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 @@ public class WLJspc extends MatchingTask | |||
| 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 @@ public class WLJspc extends MatchingTask | |||
| 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 ); | |||
| } | |||
| } | |||
| @@ -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 @@ public abstract class DefaultCompilerAdapter | |||
| * @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 @@ public abstract class DefaultCompilerAdapter | |||
| 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 ); | |||
| } | |||
| @@ -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 @@ public abstract class BaseTest | |||
| 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 abstract class BaseTest | |||
| public void addFormatter( FormatterElement elem ) | |||
| { | |||
| formatters.addElement( elem ); | |||
| formatters.add( elem ); | |||
| } | |||
| } | |||
| @@ -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 @@ public final class BatchTest extends BaseTest | |||
| /** | |||
| * 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 @@ public final class BatchTest extends BaseTest | |||
| * @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 final class BatchTest extends BaseTest | |||
| */ | |||
| 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 @@ public final class BatchTest extends BaseTest | |||
| */ | |||
| 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 @@ public final class BatchTest extends BaseTest | |||
| 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 @@ public final class BatchTest extends BaseTest | |||
| 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; | |||
| } | |||
| @@ -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 @@ public final class DOMUtil | |||
| Node child = children.item( i ); | |||
| if( filter.accept( child ) ) | |||
| { | |||
| matches.addElement( child ); | |||
| matches.add( child ); | |||
| } | |||
| if( recurse ) | |||
| { | |||
| @@ -200,7 +200,7 @@ public final class DOMUtil | |||
| 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 @@ public final class DOMUtil | |||
| * | |||
| * @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 @@ public final class DOMUtil | |||
| { | |||
| try | |||
| { | |||
| return (Node)elementAt( i ); | |||
| return (Node)get( i ); | |||
| } | |||
| catch( ArrayIndexOutOfBoundsException e ) | |||
| { | |||
| @@ -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 @@ import java.util.NoSuchElementException; | |||
| * | |||
| * @author <a href="mailto:sbailliez@imediation.com">Stephane Bailliez</a> | |||
| */ | |||
| public final class Enumerations | |||
| public final class Iterators | |||
| { | |||
| private Enumerations() | |||
| private Iterators() | |||
| { | |||
| } | |||
| @@ -29,9 +29,9 @@ public final class Enumerations | |||
| * @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 @@ public final class Enumerations | |||
| * @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 @@ public final class Enumerations | |||
| * | |||
| * @author <a href="mailto:sbailliez@imediation.com">Stephane Bailliez</a> | |||
| */ | |||
| class ArrayEnumeration implements Enumeration | |||
| class ArrayIterator implements Iterator | |||
| { | |||
| /** | |||
| @@ -72,7 +72,7 @@ class ArrayEnumeration implements Enumeration | |||
| * | |||
| * @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 @@ class ArrayEnumeration implements Enumeration | |||
| * @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 @@ class ArrayEnumeration implements Enumeration | |||
| * @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 @@ class ArrayEnumeration implements Enumeration | |||
| /** | |||
| * 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:sbailliez@imediation.com">Stephane Bailliez</a> | |||
| */ | |||
| class CompoundEnumeration implements Enumeration | |||
| class CompoundIterator implements Iterator | |||
| { | |||
| /** | |||
| @@ -147,9 +147,9 @@ class CompoundEnumeration implements Enumeration | |||
| /** | |||
| * enumeration array | |||
| */ | |||
| private Enumeration[] enumArray; | |||
| private Iterator[] enumArray; | |||
| public CompoundEnumeration( Enumeration[] enumarray ) | |||
| public CompoundIterator( Iterator[] enumarray ) | |||
| { | |||
| this.enumArray = enumarray; | |||
| } | |||
| @@ -160,11 +160,11 @@ class CompoundEnumeration implements Enumeration | |||
| * @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 @@ class CompoundEnumeration implements Enumeration | |||
| * @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(); | |||
| } | |||
| @@ -12,11 +12,11 @@ import java.io.FileOutputStream; | |||
| 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 @@ public class JUnitTask extends Task | |||
| { | |||
| 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 class JUnitTask extends Task | |||
| */ | |||
| 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 class JUnitTask extends Task | |||
| */ | |||
| 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 class JUnitTask extends Task | |||
| */ | |||
| 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 class JUnitTask extends Task | |||
| */ | |||
| 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 class JUnitTask extends Task | |||
| */ | |||
| 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 class JUnitTask extends Task | |||
| */ | |||
| 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 class JUnitTask extends Task | |||
| */ | |||
| public void addFormatter( FormatterElement fe ) | |||
| { | |||
| formatters.addElement( fe ); | |||
| formatters.add( fe ); | |||
| } | |||
| /** | |||
| @@ -332,7 +332,7 @@ public class JUnitTask extends Task | |||
| */ | |||
| public void addTest( JUnitTest test ) | |||
| { | |||
| tests.addElement( test ); | |||
| tests.add( test ); | |||
| } | |||
| /** | |||
| @@ -345,7 +345,7 @@ public class JUnitTask extends Task | |||
| public BatchTest createBatchTest() | |||
| { | |||
| BatchTest test = new BatchTest( getProject() ); | |||
| batchTests.addElement( test ); | |||
| batchTests.add( test ); | |||
| return test; | |||
| } | |||
| @@ -388,10 +388,10 @@ public class JUnitTask extends Task | |||
| 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 @@ public class JUnitTask extends Task | |||
| * | |||
| * @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 @@ public class JUnitTask extends Task | |||
| } | |||
| } | |||
| 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 @@ public class JUnitTask extends Task | |||
| 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 @@ public class JUnitTask extends Task | |||
| 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; | |||
| } | |||
| @@ -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 class JUnitTest extends BaseTest | |||
| 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 @@ public class JUnitTest extends BaseTest | |||
| * | |||
| * @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 ) ); | |||
| } | |||
| } | |||
| } | |||
| @@ -17,10 +17,10 @@ import java.io.PrintWriter; | |||
| 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 @@ public class JUnitTestRunner implements TestListener | |||
| "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 @@ public class JUnitTestRunner implements TestListener | |||
| // 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 @@ public class JUnitTestRunner implements TestListener | |||
| 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 @@ public class JUnitTestRunner implements TestListener | |||
| { | |||
| 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 class JUnitTestRunner implements TestListener | |||
| public void addFormatter( JUnitResultFormatter f ) | |||
| { | |||
| formatters.addElement( f ); | |||
| formatters.add( f ); | |||
| } | |||
| /** | |||
| @@ -530,7 +530,7 @@ public class JUnitTestRunner implements TestListener | |||
| 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 @@ public class JUnitTestRunner implements TestListener | |||
| {// 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 @@ public class JUnitTestRunner implements TestListener | |||
| { | |||
| for( int i = 0; i < formatters.size(); i++ ) | |||
| { | |||
| ( (JUnitResultFormatter)formatters.elementAt( i ) ).endTestSuite( junitTest ); | |||
| ( (JUnitResultFormatter)formatters.get( i ) ).endTestSuite( junitTest ); | |||
| } | |||
| } | |||
| @@ -624,7 +624,7 @@ public class JUnitTestRunner implements TestListener | |||
| { | |||
| for( int i = 0; i < formatters.size(); i++ ) | |||
| { | |||
| ( (JUnitResultFormatter)formatters.elementAt( i ) ).startTestSuite( junitTest ); | |||
| ( (JUnitResultFormatter)formatters.get( i ) ).startTestSuite( junitTest ); | |||
| } | |||
| } | |||
| @@ -633,7 +633,7 @@ public class JUnitTestRunner implements TestListener | |||
| for( int i = 0; i < formatters.size(); i++ ) | |||
| { | |||
| JUnitResultFormatter formatter = | |||
| ( (JUnitResultFormatter)formatters.elementAt( i ) ); | |||
| ( (JUnitResultFormatter)formatters.get( i ) ); | |||
| formatter.setSystemOutput( out ); | |||
| formatter.setSystemError( err ); | |||
| @@ -11,7 +11,7 @@ import java.io.IOException; | |||
| 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 @@ public class XMLJUnitResultFormatter implements JUnitResultFormatter, XMLConstan | |||
| 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 ) ); | |||
| @@ -13,8 +13,8 @@ import java.io.IOException; | |||
| 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 @@ public class XMLResultAggregator extends Task implements XMLConstants | |||
| /** | |||
| * 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 class XMLResultAggregator extends Task implements XMLConstants | |||
| */ | |||
| 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 @@ public class XMLResultAggregator extends Task implements XMLConstants | |||
| 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 @@ public class XMLResultAggregator extends Task implements XMLConstants | |||
| */ | |||
| 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 @@ public class XMLResultAggregator extends Task implements XMLConstants | |||
| File file = new File( ds.getBasedir(), pathname ); | |||
| file = FileUtil. | |||
| resolveFile( getProject().getBaseDir(), file.getPath() ); | |||
| v.addElement( file ); | |||
| v.add( file ); | |||
| } | |||
| } | |||
| } | |||
| @@ -11,10 +11,10 @@ import java.io.File; | |||
| 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 @@ public abstract class AbstractMetamataTask extends Task | |||
| /** | |||
| * 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 @@ public abstract class AbstractMetamataTask extends Task | |||
| /** | |||
| * 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 abstract class AbstractMetamataTask extends Task | |||
| */ | |||
| public void addFileSet( FileSet fs ) | |||
| { | |||
| fileSets.addElement( fs ); | |||
| fileSets.add( fs ); | |||
| } | |||
| /** | |||
| @@ -234,7 +234,7 @@ public abstract class AbstractMetamataTask extends Task | |||
| 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 @@ public abstract class AbstractMetamataTask extends Task | |||
| * | |||
| * @return The Options value | |||
| */ | |||
| protected abstract Vector getOptions(); | |||
| protected abstract ArrayList getOptions(); | |||
| /** | |||
| * validate options set | |||
| @@ -330,7 +330,7 @@ public abstract class AbstractMetamataTask extends Task | |||
| } | |||
| } | |||
| protected void generateOptionsFile( File tofile, Vector options ) | |||
| protected void generateOptionsFile( File tofile, ArrayList options ) | |||
| throws TaskException | |||
| { | |||
| FileWriter fw = null; | |||
| @@ -341,7 +341,7 @@ public abstract class AbstractMetamataTask extends Task | |||
| 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 @@ public abstract class AbstractMetamataTask extends Task | |||
| 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(); | |||
| @@ -11,7 +11,7 @@ import java.io.File; | |||
| 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 @@ public class MAudit extends AbstractMetamataTask | |||
| 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 @@ public class MAudit extends AbstractMetamataTask | |||
| // 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; | |||
| } | |||
| @@ -14,9 +14,9 @@ import java.io.InputStreamReader; | |||
| 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 @@ class MAuditStreamHandler implements ExecuteStreamHandler | |||
| // 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 @@ class MAuditStreamHandler implements ExecuteStreamHandler | |||
| 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 @@ class MAuditStreamHandler implements ExecuteStreamHandler | |||
| */ | |||
| 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 @@ class MAuditStreamHandler implements ExecuteStreamHandler | |||
| // 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 | |||
| @@ -11,7 +11,7 @@ import java.io.File; | |||
| 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 @@ public class MMetrics extends AbstractMetamataTask | |||
| 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 @@ public class MMetrics extends AbstractMetamataTask | |||
| // 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; | |||
| } | |||
| @@ -17,9 +17,9 @@ import java.text.DecimalFormat; | |||
| 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 @@ public class MMetricsStreamHandler implements ExecuteStreamHandler | |||
| 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 @@ class MetricsElement | |||
| private int indent; | |||
| private Vector metrics; | |||
| private ArrayList metrics; | |||
| static | |||
| { | |||
| @@ -422,7 +422,7 @@ class MetricsElement | |||
| 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 @@ class MetricsElement | |||
| 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 @@ class MetricsElement | |||
| * 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 @@ class MetricsElement | |||
| // 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 @@ class MetricsElement | |||
| return indent; | |||
| } | |||
| public Enumeration getMetrics() | |||
| public Iterator getMetrics() | |||
| { | |||
| return metrics.elements(); | |||
| return metrics.iterator(); | |||
| } | |||
| public String getName() | |||
| @@ -12,7 +12,7 @@ import java.io.FileWriter; | |||
| 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 @@ public class MParse extends Task | |||
| */ | |||
| 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 @@ public class MParse extends Task | |||
| */ | |||
| 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 ); | |||
| @@ -21,7 +21,7 @@ import java.io.IOException; | |||
| 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 @@ public class FTP | |||
| 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 class FTP | |||
| */ | |||
| public void addFileset( FileSet set ) | |||
| { | |||
| filesets.addElement( set ); | |||
| filesets.add( set ); | |||
| } | |||
| /** | |||
| @@ -547,19 +547,19 @@ public class FTP | |||
| 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 @@ public class FTP | |||
| "could not create directory: " + | |||
| ftp.getReplyString() ); | |||
| } | |||
| dirCache.addElement( dir ); | |||
| dirCache.add( dir ); | |||
| } | |||
| } | |||
| } | |||
| @@ -899,7 +899,7 @@ public class FTP | |||
| // 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 @@ public class FTP | |||
| 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 @@ public class FTP | |||
| { | |||
| if( !isExcluded( name ) ) | |||
| { | |||
| dirsIncluded.addElement( name ); | |||
| dirsIncluded.add( name ); | |||
| if( fast ) | |||
| { | |||
| scandir( name, vpath + name + File.separator, fast ); | |||
| @@ -1034,12 +1034,12 @@ public class FTP | |||
| } | |||
| 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 @@ public class FTP | |||
| { | |||
| if( !isExcluded( name ) ) | |||
| { | |||
| filesIncluded.addElement( name ); | |||
| filesIncluded.add( name ); | |||
| } | |||
| else | |||
| { | |||
| filesExcluded.addElement( name ); | |||
| filesExcluded.add( name ); | |||
| } | |||
| } | |||
| else | |||
| { | |||
| filesNotIncluded.addElement( name ); | |||
| filesNotIncluded.add( name ); | |||
| } | |||
| } | |||
| } | |||
| @@ -11,7 +11,7 @@ import java.io.File; | |||
| 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 @@ public class MimeMail extends Task | |||
| /** | |||
| * 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 class MimeMail extends Task | |||
| */ | |||
| public void addFileset( FileSet set ) | |||
| { | |||
| filesets.addElement( set ); | |||
| filesets.add( set ); | |||
| } | |||
| /** | |||
| @@ -305,7 +305,7 @@ public class MimeMail extends Task | |||
| 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() ); | |||
| @@ -12,8 +12,8 @@ import java.io.IOException; | |||
| 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; | |||
| @@ -55,7 +55,7 @@ public class TelnetTask extends Task | |||
| /** | |||
| * 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 class TelnetTask extends Task | |||
| public TelnetSubTask createRead() | |||
| { | |||
| TelnetSubTask task = (TelnetSubTask)new TelnetRead(); | |||
| telnetTasks.addElement( task ); | |||
| telnetTasks.add( task ); | |||
| return task; | |||
| } | |||
| @@ -151,7 +151,7 @@ public class TelnetTask extends Task | |||
| public TelnetSubTask createWrite() | |||
| { | |||
| TelnetSubTask task = (TelnetSubTask)new TelnetWrite(); | |||
| telnetTasks.addElement( task ); | |||
| telnetTasks.add( task ); | |||
| return task; | |||
| } | |||
| @@ -198,10 +198,10 @@ public class TelnetTask extends Task | |||
| /** | |||
| * 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 ); | |||
| @@ -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 @@ import org.apache.tools.ant.types.FileSet; | |||
| 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 class P4Add extends P4Base | |||
| public void addFileset( FileSet set ) | |||
| { | |||
| filesets.addElement( set ); | |||
| filesets.add( set ); | |||
| } | |||
| public void execute() | |||
| @@ -123,7 +123,7 @@ public class P4Add extends P4Base | |||
| 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); | |||
| @@ -17,9 +17,9 @@ import java.io.FileWriter; | |||
| 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 @@ public class Pvcs extends org.apache.tools.ant.Task | |||
| 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 @@ public class Pvcs extends org.apache.tools.ant.Task | |||
| { | |||
| super(); | |||
| pvcsProject = null; | |||
| pvcsProjects = new Vector(); | |||
| pvcsProjects = new ArrayList(); | |||
| workspace = null; | |||
| repository = null; | |||
| pvcsbin = null; | |||
| @@ -272,9 +272,9 @@ public class Pvcs extends org.apache.tools.ant.Task | |||
| /** | |||
| * 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 class Pvcs extends org.apache.tools.ant.Task | |||
| */ | |||
| public void addPvcsproject( PvcsProject p ) | |||
| { | |||
| pvcsProjects.addElement( p ); | |||
| pvcsProjects.add( p ); | |||
| } | |||
| /** | |||
| @@ -349,10 +349,10 @@ public class Pvcs extends org.apache.tools.ant.Task | |||
| 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 ); | |||
| @@ -12,7 +12,7 @@ import java.io.FileWriter; | |||
| 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 @@ public class CovMerge extends Task | |||
| /** | |||
| * 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 class CovMerge extends Task | |||
| */ | |||
| public void addFileset( FileSet fs ) | |||
| { | |||
| filesets.addElement( fs ); | |||
| filesets.add( fs ); | |||
| } | |||
| /** | |||
| @@ -147,11 +147,11 @@ public class CovMerge extends Task | |||
| 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 @@ public class CovMerge extends Task | |||
| String pathname = f[ j ]; | |||
| File file = new File( ds.getBasedir(), pathname ); | |||
| file = resolveFile( file.getPath() ); | |||
| v.addElement( file ); | |||
| v.add( file ); | |||
| } | |||
| } | |||
| @@ -9,7 +9,7 @@ package org.apache.tools.ant.taskdefs.optional.sitraka; | |||
| 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 @@ public class CovReport extends Task | |||
| 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() ]; | |||
| @@ -14,7 +14,7 @@ import java.io.OutputStream; | |||
| 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 @@ public class Coverage extends Task | |||
| protected int warnLevel = 0; | |||
| protected Vector filesets = new Vector(); | |||
| protected ArrayList filesets = new ArrayList(); | |||
| protected File home; | |||
| @@ -209,7 +209,7 @@ public class Coverage extends Task | |||
| */ | |||
| public void addFileset( FileSet fs ) | |||
| { | |||
| filesets.addElement( fs ); | |||
| filesets.add( fs ); | |||
| } | |||
| /** | |||
| @@ -327,59 +327,59 @@ public class Coverage extends Task | |||
| 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() ]; | |||
| @@ -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 @@ public class Filters | |||
| /** | |||
| * user defined filters | |||
| */ | |||
| protected Vector filters = new Vector(); | |||
| protected ArrayList filters = new ArrayList(); | |||
| public Filters() | |||
| { | |||
| @@ -43,12 +43,12 @@ public class Filters | |||
| 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 @@ public class Filters | |||
| } | |||
| 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( ',' ); | |||
| @@ -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 @@ public class ReportFilters | |||
| /** | |||
| * 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 @@ public class ReportFilters | |||
| 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 class ReportFilters | |||
| 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 @@ public class ReportFilters | |||
| { | |||
| 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 ); | |||
| } | |||
| } | |||
| @@ -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 @@ public class Triggers | |||
| */ | |||
| private final static Hashtable eventMap = new Hashtable( 3 ); | |||
| protected Vector triggers = new Vector(); | |||
| protected ArrayList triggers = new ArrayList(); | |||
| static | |||
| { | |||
| @@ -51,7 +51,7 @@ public class Triggers | |||
| public void addMethod( Method method ) | |||
| { | |||
| triggers.addElement( method ); | |||
| triggers.add( method ); | |||
| } | |||
| // -jp_trigger=ClassName.*():E:S,ClassName.MethodName():X:X | |||
| @@ -61,7 +61,7 @@ public class Triggers | |||
| 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( ',' ); | |||
| @@ -9,10 +9,10 @@ package org.apache.tools.ant.taskdefs.optional.sitraka; | |||
| 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 @@ public class XMLReport | |||
| // 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 @@ public class XMLReport | |||
| 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 @@ public class XMLReport | |||
| 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 @@ public class XMLReport | |||
| Element elem = (Element)child; | |||
| if( "class".equals( elem.getNodeName() ) ) | |||
| { | |||
| v.addElement( elem ); | |||
| v.add( elem ); | |||
| } | |||
| } | |||
| } | |||
| @@ -240,17 +240,17 @@ public class XMLReport | |||
| 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 @@ public class XMLReport | |||
| 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 @@ public class XMLReport | |||
| Element elem = (Element)child; | |||
| if( "package".equals( elem.getNodeName() ) ) | |||
| { | |||
| v.addElement( elem ); | |||
| v.add( elem ); | |||
| } | |||
| } | |||
| } | |||
| @@ -555,7 +555,7 @@ public class XMLReport | |||
| 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 @@ public class XMLReport | |||
| 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 @@ public class XMLReport | |||
| 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; | |||
| @@ -15,11 +15,11 @@ import java.io.FileInputStream; | |||
| 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 class ClassPathLoader | |||
| 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 @@ public class ClassPathLoader | |||
| 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 @@ public class ClassPathLoader | |||
| * @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 @@ public class ClassPathLoader | |||
| * | |||
| * @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 @@ class JarLoader implements ClassPathLoader.FileLoader | |||
| 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 @@ class DirectoryLoader implements ClassPathLoader.FileLoader | |||
| * @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 @@ class DirectoryLoader implements ClassPathLoader.FileLoader | |||
| * @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 @@ class DirectoryLoader implements ClassPathLoader.FileLoader | |||
| 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 @@ class DirectoryLoader implements ClassPathLoader.FileLoader | |||
| ClassFile classFile = new ClassFile( is ); | |||
| is.close(); | |||
| is = null; | |||
| v.addElement( classFile ); | |||
| v.add( classFile ); | |||
| } | |||
| finally | |||
| { | |||
| @@ -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 @@ public class Utils | |||
| { | |||
| 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() ) | |||