You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ant.apache.org by do...@apache.org on 2002/01/01 10:13:47 UTC
cvs commit: jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/types/optional/depend ClassfileSet.java
donaldp 02/01/01 01:13:47
Modified: proposal/myrmidon/src/java/org/apache/antlib/xml
XMLValidateTask.java
proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs
Checksum.java DependSet.java ExecuteOn.java
Expand.java MatchingTask.java SQLExec.java Tar.java
UpToDate.java Zip.java
proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/file
Copy.java Delete.java Move.java Touch.java
proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/javadoc
Javadoc.java
proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional
Cab.java
proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/ejb
GenericDeploymentTool.java
proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/i18n
Translate.java
proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/ide
VAJImport.java
proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/junit
BatchTest.java XMLResultAggregator.java
proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/metamata
AbstractMetamataTask.java
proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/net
FTP.java MimeMail.java
proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/perforce
P4Add.java
proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/sitraka
CovMerge.java
proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/security
SignJar.java
proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/text
ReplaceRegExp.java
proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/unix
Chmod.java
proposal/myrmidon/src/main/org/apache/tools/ant/types
FileSet.java Path.java PatternSet.java
ZipFileSet.java
proposal/myrmidon/src/main/org/apache/tools/ant/types/optional/depend
ClassfileSet.java
Log:
Started to migrate FileSet away from using Project and for implementing references itself (rather than letting container manage references)
Revision Changes Path
1.8 +2 -2 jakarta-ant/proposal/myrmidon/src/java/org/apache/antlib/xml/XMLValidateTask.java
Index: XMLValidateTask.java
===================================================================
RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/java/org/apache/antlib/xml/XMLValidateTask.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- XMLValidateTask.java 30 Dec 2001 03:33:57 -0000 1.7
+++ XMLValidateTask.java 1 Jan 2002 09:13:45 -0000 1.8
@@ -259,12 +259,12 @@
{
FileSet fs = (FileSet)filesets.get( i );
- DirectoryScanner ds = fs.getDirectoryScanner( getProject() );
+ DirectoryScanner ds = fs.getDirectoryScanner();
String[] files = ds.getIncludedFiles();
for( int j = 0; j < files.length; j++ )
{
- File srcFile = new File( fs.getDir( getProject() ), files[ j ] );
+ File srcFile = new File( fs.getDir(), files[ j ] );
doValidate( srcFile );
fileProcessed++;
}
1.12 +2 -2 jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/Checksum.java
Index: Checksum.java
===================================================================
RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/Checksum.java,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -r1.11 -r1.12
--- Checksum.java 23 Dec 2001 14:21:50 -0000 1.11
+++ Checksum.java 1 Jan 2002 09:13:45 -0000 1.12
@@ -473,11 +473,11 @@
for( int i = 0; i < sizeofFileSet; i++ )
{
FileSet fs = (FileSet)filesets.get( i );
- DirectoryScanner ds = fs.getDirectoryScanner( getProject() );
+ DirectoryScanner ds = fs.getDirectoryScanner();
String[] srcFiles = ds.getIncludedFiles();
for( int j = 0; j < srcFiles.length; j++ )
{
- File src = new File( fs.getDir( getProject() ), srcFiles[ j ] );
+ File src = new File( fs.getDir(), srcFiles[ j ] );
addToIncludeFileMap( src );
}
}
1.8 +5 -5 jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/DependSet.java
Index: DependSet.java
===================================================================
RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/DependSet.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- DependSet.java 23 Dec 2001 14:21:50 -0000 1.7
+++ DependSet.java 1 Jan 2002 09:13:45 -0000 1.8
@@ -59,7 +59,7 @@
*
*
* @author <a href="mailto:cstrong@arielpartners.com">Craeg Strong</a>
- * @version $Revision: 1.7 $ $Date: 2001/12/23 14:21:50 $
+ * @version $Revision: 1.8 $ $Date: 2002/01/01 09:13:45 $
*/
public class DependSet extends MatchingTask
{
@@ -154,13 +154,13 @@
{
FileSet targetFS = (FileSet)enumTargetSets.next();
- DirectoryScanner targetDS = targetFS.getDirectoryScanner( getProject() );
+ DirectoryScanner targetDS = targetFS.getDirectoryScanner();
String[] targetFiles = targetDS.getIncludedFiles();
for( int i = 0; i < targetFiles.length; i++ )
{
- File dest = new File( targetFS.getDir( getProject() ), targetFiles[ i ] );
+ File dest = new File( targetFS.getDir(), targetFiles[ i ] );
allTargets.add( dest );
if( dest.lastModified() > now )
@@ -212,12 +212,12 @@
{
FileSet sourceFS = (FileSet)enumSourceSets.next();
- DirectoryScanner sourceDS = sourceFS.getDirectoryScanner( getProject() );
+ DirectoryScanner sourceDS = sourceFS.getDirectoryScanner();
String[] sourceFiles = sourceDS.getIncludedFiles();
for( int i = 0; upToDate && i < sourceFiles.length; i++ )
{
- File src = new File( sourceFS.getDir( getProject() ), sourceFiles[ i ] );
+ File src = new File( sourceFS.getDir(), sourceFiles[ i ] );
if( src.lastModified() > now )
{
1.18 +2 -2 jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/ExecuteOn.java
Index: ExecuteOn.java
===================================================================
RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/ExecuteOn.java,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -r1.17 -r1.18
--- ExecuteOn.java 30 Dec 2001 00:21:51 -0000 1.17
+++ ExecuteOn.java 1 Jan 2002 09:13:45 -0000 1.18
@@ -385,8 +385,8 @@
for( int i = 0; i < filesets.size(); i++ )
{
FileSet fs = (FileSet)filesets.get( i );
- File base = fs.getDir( getProject() );
- DirectoryScanner ds = fs.getDirectoryScanner( getProject() );
+ File base = fs.getDir();
+ DirectoryScanner ds = fs.getDirectoryScanner();
if( !"dir".equals( type ) )
{
1.13 +2 -2 jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/Expand.java
Index: Expand.java
===================================================================
RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/Expand.java,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -r1.12 -r1.13
--- Expand.java 23 Dec 2001 14:21:50 -0000 1.12
+++ Expand.java 1 Jan 2002 09:13:45 -0000 1.13
@@ -131,8 +131,8 @@
for( int j = 0; j < filesets.size(); j++ )
{
FileSet fs = (FileSet)filesets.get( j );
- DirectoryScanner ds = fs.getDirectoryScanner( getProject() );
- File fromDir = fs.getDir( getProject() );
+ DirectoryScanner ds = fs.getDirectoryScanner();
+ File fromDir = fs.getDir();
String[] files = ds.getIncludedFiles();
for( int i = 0; i < files.length; ++i )
1.8 +1 -1 jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/MatchingTask.java
Index: MatchingTask.java
===================================================================
RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/MatchingTask.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- MatchingTask.java 23 Dec 2001 06:33:35 -0000 1.7
+++ MatchingTask.java 1 Jan 2002 09:13:45 -0000 1.8
@@ -157,7 +157,7 @@
{
fileset.setDir( baseDir );
fileset.setDefaultexcludes( useDefaultExcludes );
- return fileset.getDirectoryScanner( getProject() );
+ return fileset.getDirectoryScanner();
}
}
1.15 +2 -2 jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/SQLExec.java
Index: SQLExec.java
===================================================================
RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/SQLExec.java,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -r1.14 -r1.15
--- SQLExec.java 30 Dec 2001 03:33:58 -0000 1.14
+++ SQLExec.java 1 Jan 2002 09:13:45 -0000 1.15
@@ -407,8 +407,8 @@
for( int i = 0; i < filesets.size(); i++ )
{
FileSet fs = (FileSet)filesets.get( i );
- DirectoryScanner ds = fs.getDirectoryScanner( getProject() );
- File srcDir = fs.getDir( getProject() );
+ DirectoryScanner ds = fs.getDirectoryScanner();
+ File srcDir = fs.getDir();
String[] srcFiles = ds.getIncludedFiles();
1.12 +4 -14 jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/Tar.java
Index: Tar.java
===================================================================
RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/Tar.java,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -r1.11 -r1.12
--- Tar.java 23 Dec 2001 14:21:50 -0000 1.11
+++ Tar.java 1 Jan 2002 09:13:45 -0000 1.12
@@ -129,7 +129,7 @@
}
// add the main fileset to the list of filesets to process.
- TarFileSet mainFileSet = new TarFileSet( fileset );
+ TarFileSet mainFileSet = new TarFileSet( /*fileset*/ );
mainFileSet.setDir( baseDir );
filesets.add( mainFileSet );
}
@@ -154,7 +154,7 @@
for( int i = 0; i < files.length; ++i )
{
- if( tarFile.equals( new File( fs.getDir( getProject() ), files[ i ] ) ) )
+ if( tarFile.equals( new File( fs.getDir(), files[ i ] ) ) )
{
throw new TaskException( "A tar file cannot include itself" );
}
@@ -196,7 +196,7 @@
String[] files = fs.getFiles( getProject() );
for( int i = 0; i < files.length; i++ )
{
- File f = new File( fs.getDir( getProject() ), files[ i ] );
+ File f = new File( fs.getDir(), files[ i ] );
String name = files[ i ].replace( File.separatorChar, '/' );
tarFile( f, tOut, name, fs );
}
@@ -322,16 +322,6 @@
private String userName = "";
private String groupName = "";
- public TarFileSet( FileSet fileset )
- {
- super( fileset );
- }
-
- public TarFileSet()
- {
- super();
- }
-
public void setGroup( String groupName )
{
this.groupName = groupName;
@@ -359,7 +349,7 @@
{
if( files == null )
{
- DirectoryScanner ds = getDirectoryScanner( p );
+ DirectoryScanner ds = getDirectoryScanner();
String[] directories = ds.getIncludedDirectories();
String[] filesPerSe = ds.getIncludedFiles();
files = new String[ directories.length + filesPerSe.length ];
1.13 +2 -2 jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/UpToDate.java
Index: UpToDate.java
===================================================================
RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/UpToDate.java,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -r1.12 -r1.13
--- UpToDate.java 30 Dec 2001 00:21:51 -0000 1.12
+++ UpToDate.java 1 Jan 2002 09:13:45 -0000 1.13
@@ -127,8 +127,8 @@
while( upToDate && enum.hasNext() )
{
FileSet fs = (FileSet)enum.next();
- DirectoryScanner ds = fs.getDirectoryScanner( getProject() );
- upToDate = upToDate && scanDir( fs.getDir( getProject() ),
+ DirectoryScanner ds = fs.getDirectoryScanner();
+ upToDate = upToDate && scanDir( fs.getDir(),
ds.getIncludedFiles() );
}
return upToDate;
1.12 +2 -2 jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/Zip.java
Index: Zip.java
===================================================================
RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/Zip.java,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -r1.11 -r1.12
--- Zip.java 23 Dec 2001 14:21:50 -0000 1.11
+++ Zip.java 1 Jan 2002 09:13:45 -0000 1.12
@@ -264,7 +264,7 @@
for( int i = 0; i < filesets.size(); i++ )
{
FileSet fs = (FileSet)filesets.get( i );
- dss.add( fs.getDirectoryScanner( getProject() ) );
+ dss.add( fs.getDirectoryScanner() );
}
int dssSize = dss.size();
FileScanner[] scanners = new FileScanner[ dssSize ];
@@ -541,7 +541,7 @@
for( int i = 0; i < filesets.size(); i++ )
{
FileSet fs = (FileSet)filesets.get( i );
- DirectoryScanner ds = fs.getDirectoryScanner( getProject() );
+ DirectoryScanner ds = fs.getDirectoryScanner();
String prefix = "";
String fullpath = "";
1.11 +3 -3 jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/file/Copy.java
Index: Copy.java
===================================================================
RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/file/Copy.java,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -r1.10 -r1.11
--- Copy.java 30 Dec 2001 10:46:58 -0000 1.10
+++ Copy.java 1 Jan 2002 09:13:45 -0000 1.11
@@ -229,8 +229,8 @@
for( int i = 0; i < m_filesets.size(); i++ )
{
final FileSet fileSet = (FileSet)m_filesets.get( i );
- final DirectoryScanner scanner = fileSet.getDirectoryScanner( getProject() );
- final File fromDir = fileSet.getDir( getProject() );
+ final DirectoryScanner scanner = fileSet.getDirectoryScanner();
+ final File fromDir = fileSet.getDir();
final String[] srcFiles = scanner.getIncludedFiles();
final String[] srcDirs = scanner.getIncludedDirectories();
@@ -486,7 +486,7 @@
else
{
FileSet fs = (FileSet)m_filesets.get( 0 );
- DirectoryScanner ds = fs.getDirectoryScanner( getProject() );
+ DirectoryScanner ds = fs.getDirectoryScanner();
String[] srcFiles = ds.getIncludedFiles();
if( srcFiles.length > 0 )
1.9 +8 -6 jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/file/Delete.java
Index: Delete.java
===================================================================
RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/file/Delete.java,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- Delete.java 30 Dec 2001 00:06:20 -0000 1.8
+++ Delete.java 1 Jan 2002 09:13:45 -0000 1.9
@@ -44,7 +44,7 @@
*
* @param dir the directory path.
*/
- public void setDir( File dir )
+ public void setDir( final File dir )
{
m_dir = dir;
}
@@ -54,7 +54,7 @@
*
* @param file the file to be deleted
*/
- public void setFile( File file )
+ public void setFile( final File file )
{
m_file = file;
}
@@ -100,14 +100,16 @@
getLogger().info( "Deleting: " + m_file.getAbsolutePath() );
if( !m_file.delete() )
{
- String message = "Unable to delete file " + m_file.getAbsolutePath();
+ final String message = "Unable to delete file " + m_file.getAbsolutePath();
throw new TaskException( message );
}
}
}
else
{
- getLogger().debug( "Could not find file " + m_file.getAbsolutePath() + " to delete." );
+ final String message =
+ "Could not find file " + m_file.getAbsolutePath() + " to delete.";
+ getLogger().debug( message );
}
}
@@ -124,10 +126,10 @@
FileSet fs = (FileSet)filesets.get( i );
try
{
- DirectoryScanner ds = fs.getDirectoryScanner( getProject() );
+ DirectoryScanner ds = fs.getDirectoryScanner();
String[] files = ds.getIncludedFiles();
String[] dirs = ds.getIncludedDirectories();
- removeFiles( fs.getDir( getProject() ), files, dirs );
+ removeFiles( fs.getDir(), files, dirs );
}
catch( TaskException be )
{
1.12 +1 -1 jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/file/Move.java
Index: Move.java
===================================================================
RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/file/Move.java,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -r1.11 -r1.12
--- Move.java 30 Dec 2001 00:30:40 -0000 1.11
+++ Move.java 1 Jan 2002 09:13:45 -0000 1.12
@@ -205,7 +205,7 @@
while( e.hasNext() )
{
FileSet fs = (FileSet)e.next();
- File dir = fs.getDir( getProject() );
+ File dir = fs.getDir();
if( okToDelete( dir ) )
{
1.4 +2 -2 jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/file/Touch.java
Index: Touch.java
===================================================================
RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/file/Touch.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- Touch.java 1 Jan 2002 06:56:49 -0000 1.3
+++ Touch.java 1 Jan 2002 09:13:45 -0000 1.4
@@ -157,8 +157,8 @@
for( int i = 0; i < size; i++ )
{
final FileSet fs = (FileSet)m_filesets.get( i );
- final DirectoryScanner ds = fs.getDirectoryScanner( null );
- final File fromDir = fs.getDir( null );
+ final DirectoryScanner ds = fs.getDirectoryScanner();
+ final File fromDir = fs.getDir();
final String[] srcFiles = ds.getIncludedFiles();
final String[] srcDirs = ds.getIncludedDirectories();
1.8 +1 -1 jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/javadoc/Javadoc.java
Index: Javadoc.java
===================================================================
RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/javadoc/Javadoc.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- Javadoc.java 30 Dec 2001 10:46:58 -0000 1.7
+++ Javadoc.java 1 Jan 2002 09:13:46 -0000 1.8
@@ -1022,7 +1022,7 @@
final File source = resolveFile( list[ j ] );
fs.setDir( source );
- final DirectoryScanner ds = fs.getDirectoryScanner( getProject() );
+ final DirectoryScanner ds = fs.getDirectoryScanner();
final String[] packageDirs = ds.getIncludedDirectories();
for( int i = 0; i < packageDirs.length; i++ )
1.16 +1 -1 jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/Cab.java
Index: Cab.java
===================================================================
RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/Cab.java,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -r1.15 -r1.16
--- Cab.java 23 Dec 2001 14:17:40 -0000 1.15
+++ Cab.java 1 Jan 2002 09:13:46 -0000 1.16
@@ -204,7 +204,7 @@
FileSet fs = (FileSet)filesets.get( i );
if( fs != null )
{
- appendFiles( files, fs.getDirectoryScanner( getProject() ) );
+ appendFiles( files, fs.getDirectoryScanner() );
}
}
}
1.12 +2 -2 jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/ejb/GenericDeploymentTool.java
Index: GenericDeploymentTool.java
===================================================================
RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/ejb/GenericDeploymentTool.java,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -r1.11 -r1.12
--- GenericDeploymentTool.java 30 Dec 2001 03:33:58 -0000 1.11
+++ GenericDeploymentTool.java 1 Jan 2002 09:13:46 -0000 1.12
@@ -559,8 +559,8 @@
for( Iterator i = config.supportFileSets.iterator(); i.hasNext(); )
{
FileSet supportFileSet = (FileSet)i.next();
- File supportBaseDir = supportFileSet.getDir( project );
- DirectoryScanner supportScanner = supportFileSet.getDirectoryScanner( project );
+ File supportBaseDir = supportFileSet.getDir();
+ DirectoryScanner supportScanner = supportFileSet.getDirectoryScanner();
supportScanner.scan();
String[] supportFiles = supportScanner.getIncludedFiles();
for( int j = 0; j < supportFiles.length; ++j )
1.11 +1 -1 jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/i18n/Translate.java
Index: Translate.java
===================================================================
RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/i18n/Translate.java,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -r1.10 -r1.11
--- Translate.java 30 Dec 2001 11:11:21 -0000 1.10
+++ Translate.java 1 Jan 2002 09:13:46 -0000 1.11
@@ -518,7 +518,7 @@
for( int i = 0; i < filesets.size(); i++ )
{
FileSet fs = (FileSet)filesets.get( i );
- DirectoryScanner ds = fs.getDirectoryScanner( getProject() );
+ DirectoryScanner ds = fs.getDirectoryScanner();
String[] srcFiles = ds.getIncludedFiles();
for( int j = 0; j < srcFiles.length; j++ )
{
1.7 +1 -1 jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/ide/VAJImport.java
Index: VAJImport.java
===================================================================
RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/ide/VAJImport.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- VAJImport.java 23 Dec 2001 06:31:56 -0000 1.6
+++ VAJImport.java 1 Jan 2002 09:13:46 -0000 1.7
@@ -224,7 +224,7 @@
*/
protected void importFileset( FileSet fileset )
{
- DirectoryScanner ds = fileset.getDirectoryScanner( this.getProject() );
+ DirectoryScanner ds = fileset.getDirectoryScanner();
if( ds.getIncludedFiles().length == 0 )
{
return;
1.6 +1 -1 jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/junit/BatchTest.java
Index: BatchTest.java
===================================================================
RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/junit/BatchTest.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- BatchTest.java 23 Dec 2001 06:31:58 -0000 1.5
+++ BatchTest.java 1 Jan 2002 09:13:46 -0000 1.6
@@ -127,7 +127,7 @@
for( int j = 0; j < size; j++ )
{
FileSet fs = (FileSet)filesets.get( j );
- DirectoryScanner ds = fs.getDirectoryScanner( project );
+ DirectoryScanner ds = fs.getDirectoryScanner();
ds.scan();
String[] f = ds.getIncludedFiles();
for( int k = 0; k < f.length; k++ )
1.12 +1 -1 jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/junit/XMLResultAggregator.java
Index: XMLResultAggregator.java
===================================================================
RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/junit/XMLResultAggregator.java,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -r1.11 -r1.12
--- XMLResultAggregator.java 30 Dec 2001 03:33:58 -0000 1.11
+++ XMLResultAggregator.java 1 Jan 2002 09:13:46 -0000 1.12
@@ -200,7 +200,7 @@
for( int i = 0; i < size; i++ )
{
FileSet fs = (FileSet)filesets.get( i );
- DirectoryScanner ds = fs.getDirectoryScanner( getProject() );
+ DirectoryScanner ds = fs.getDirectoryScanner();
ds.scan();
String[] f = ds.getIncludedFiles();
for( int j = 0; j < f.length; j++ )
1.14 +1 -1 jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/metamata/AbstractMetamataTask.java
Index: AbstractMetamataTask.java
===================================================================
RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/metamata/AbstractMetamataTask.java,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -r1.13 -r1.14
--- AbstractMetamataTask.java 30 Dec 2001 01:14:59 -0000 1.13
+++ AbstractMetamataTask.java 1 Jan 2002 09:13:46 -0000 1.14
@@ -365,7 +365,7 @@
for( int i = 0; i < fileSets.size(); i++ )
{
FileSet fs = (FileSet)fileSets.get( i );
- DirectoryScanner ds = fs.getDirectoryScanner( getProject() );
+ DirectoryScanner ds = fs.getDirectoryScanner();
ds.scan();
String[] f = ds.getIncludedFiles();
getLogger().debug( i + ") Adding " + f.length + " files from directory " + ds.getBasedir() );
1.11 +2 -2 jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/net/FTP.java
Index: FTP.java
===================================================================
RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/net/FTP.java,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -r1.10 -r1.11
--- FTP.java 30 Dec 2001 09:58:25 -0000 1.10
+++ FTP.java 1 Jan 2002 09:13:46 -0000 1.11
@@ -792,12 +792,12 @@
if( action == SEND_FILES )
{
- ds = fs.getDirectoryScanner( getProject() );
+ ds = fs.getDirectoryScanner();
}
else
{
ds = new FTPDirectoryScanner( ftp );
- fs.setupDirectoryScanner( ds, getProject() );
+ fs.setupDirectoryScanner( ds );
ds.scan();
}
1.10 +1 -1 jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/net/MimeMail.java
Index: MimeMail.java
===================================================================
RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/net/MimeMail.java,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -r1.9 -r1.10
--- MimeMail.java 23 Dec 2001 14:22:47 -0000 1.9
+++ MimeMail.java 1 Jan 2002 09:13:46 -0000 1.10
@@ -307,7 +307,7 @@
FileSet fs = (FileSet)filesets.get( i );
if( fs != null )
{
- DirectoryScanner ds = fs.getDirectoryScanner( getProject() );
+ DirectoryScanner ds = fs.getDirectoryScanner();
String[] dsfiles = ds.getIncludedFiles();
File baseDir = ds.getBasedir();
1.7 +1 -1 jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/perforce/P4Add.java
Index: P4Add.java
===================================================================
RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/perforce/P4Add.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- P4Add.java 23 Dec 2001 14:22:47 -0000 1.6
+++ P4Add.java 1 Jan 2002 09:13:46 -0000 1.7
@@ -123,7 +123,7 @@
for( int i = 0; i < filesets.size(); i++ )
{
FileSet fs = (FileSet)filesets.get( i );
- DirectoryScanner ds = fs.getDirectoryScanner( getProject() );
+ DirectoryScanner ds = fs.getDirectoryScanner();
//File fromDir = fs.getDir(project);
String[] srcFiles = ds.getIncludedFiles();
1.12 +1 -1 jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/sitraka/CovMerge.java
Index: CovMerge.java
===================================================================
RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/sitraka/CovMerge.java,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -r1.11 -r1.12
--- CovMerge.java 30 Dec 2001 10:46:59 -0000 1.11
+++ CovMerge.java 1 Jan 2002 09:13:46 -0000 1.12
@@ -152,7 +152,7 @@
for( int i = 0; i < size; i++ )
{
FileSet fs = (FileSet)filesets.get( i );
- DirectoryScanner ds = fs.getDirectoryScanner( getProject() );
+ DirectoryScanner ds = fs.getDirectoryScanner();
ds.scan();
String[] f = ds.getIncludedFiles();
for( int j = 0; j < f.length; j++ )
1.3 +2 -2 jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/security/SignJar.java
Index: SignJar.java
===================================================================
RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/security/SignJar.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- SignJar.java 1 Jan 2002 08:49:03 -0000 1.2
+++ SignJar.java 1 Jan 2002 09:13:46 -0000 1.3
@@ -151,12 +151,12 @@
for( int i = 0; i < m_filesets.size(); i++ )
{
final FileSet fileSet = (FileSet)m_filesets.get( i );
- final DirectoryScanner scanner = fileSet.getDirectoryScanner( null );
+ final DirectoryScanner scanner = fileSet.getDirectoryScanner();
final String[] jarFiles = scanner.getIncludedFiles();
for( int j = 0; j < jarFiles.length; j++ )
{
final File file =
- new File( fileSet.getDir( null ), jarFiles[ j ] );
+ new File( fileSet.getDir(), jarFiles[ j ] );
doOneJar( file, null );
}
}
1.2 +1 -1 jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/text/ReplaceRegExp.java
Index: ReplaceRegExp.java
===================================================================
RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/text/ReplaceRegExp.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- ReplaceRegExp.java 30 Dec 2001 11:09:45 -0000 1.1
+++ ReplaceRegExp.java 1 Jan 2002 09:13:46 -0000 1.2
@@ -205,7 +205,7 @@
for( int i = 0; i < sz; i++ )
{
FileSet fs = (FileSet)( filesets.get( i ) );
- DirectoryScanner ds = fs.getDirectoryScanner( getProject() );
+ DirectoryScanner ds = fs.getDirectoryScanner();
String files[] = ds.getIncludedFiles();
for( int j = 0; j < files.length; j++ )
1.4 +3 -3 jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/unix/Chmod.java
Index: Chmod.java
===================================================================
RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/unix/Chmod.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- Chmod.java 23 Dec 2001 06:34:24 -0000 1.3
+++ Chmod.java 1 Jan 2002 09:13:46 -0000 1.4
@@ -152,14 +152,14 @@
public void execute()
throws TaskException
{
- if( defaultSetDefined || defaultSet.getDir( getProject() ) == null )
+ if( defaultSetDefined || defaultSet.getDir() == null )
{
super.execute();
}
else if( isValidOs() )
{
// we are chmodding the given directory
- createArg().setValue( defaultSet.getDir( getProject() ).getPath() );
+ createArg().setValue( defaultSet.getDir().getPath() );
Execute execute = prepareExec();
try
{
@@ -191,7 +191,7 @@
throw new TaskException( "Required attribute perm not set in chmod" );
}
- if( defaultSetDefined && defaultSet.getDir( getProject() ) != null )
+ if( defaultSetDefined && defaultSet.getDir() != null )
{
addFileset( defaultSet );
}
1.11 +53 -228 jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/types/FileSet.java
Index: FileSet.java
===================================================================
RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/types/FileSet.java,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -r1.10 -r1.11
--- FileSet.java 30 Dec 2001 00:21:52 -0000 1.10
+++ FileSet.java 1 Jan 2002 09:13:46 -0000 1.11
@@ -9,11 +9,9 @@
import java.io.File;
import java.util.ArrayList;
-import java.util.Stack;
import org.apache.myrmidon.api.TaskException;
import org.apache.tools.ant.DirectoryScanner;
import org.apache.tools.ant.FileScanner;
-import org.apache.tools.ant.Project;
/**
* Moved out of MatchingTask to make it a standalone object that could be
@@ -31,64 +29,36 @@
extends DataType
implements Cloneable
{
- private PatternSet defaultPatterns = new PatternSet();
- private ArrayList additionalPatterns = new ArrayList();
- private boolean useDefaultExcludes = true;
- private boolean isCaseSensitive = true;
-
- private File dir;
+ private PatternSet m_defaultPatterns = new PatternSet();
+ private ArrayList m_additionalPatterns = new ArrayList();
+ private boolean m_useDefaultExcludes = true;
+ private boolean m_isCaseSensitive = true;
+ private File m_dir;
public FileSet()
{
- super();
- }
-
- protected FileSet( FileSet fileset )
- {
- this.dir = fileset.dir;
- this.defaultPatterns = fileset.defaultPatterns;
- this.additionalPatterns = fileset.additionalPatterns;
- this.useDefaultExcludes = fileset.useDefaultExcludes;
- this.isCaseSensitive = fileset.isCaseSensitive;
}
/**
* Sets case sensitivity of the file system
- *
- * @param isCaseSensitive "true"|"on"|"yes" if file system is case
- * sensitive, "false"|"off"|"no" when not.
*/
- public void setCaseSensitive( boolean isCaseSensitive )
+ public void setCaseSensitive( final boolean isCaseSensitive )
{
- this.isCaseSensitive = isCaseSensitive;
+ m_isCaseSensitive = isCaseSensitive;
}
/**
* Sets whether default exclusions should be used or not.
- *
- * @param useDefaultExcludes "true"|"on"|"yes" when default exclusions
- * should be used, "false"|"off"|"no" when they shouldn't be used.
*/
- public void setDefaultexcludes( boolean useDefaultExcludes )
- throws TaskException
+ public void setDefaultexcludes( final boolean useDefaultExcludes )
{
- if( isReference() )
- {
- throw tooManyAttributes();
- }
-
- this.useDefaultExcludes = useDefaultExcludes;
+ m_useDefaultExcludes = useDefaultExcludes;
}
- public void setDir( File dir )
+ public void setDir( final File dir )
throws TaskException
{
- if( isReference() )
- {
- throw tooManyAttributes();
- }
-
- this.dir = dir;
+ m_dir = dir;
}
/**
@@ -97,32 +67,19 @@
*
* @param excludes the string containing the exclude patterns
*/
- public void setExcludes( String excludes )
- throws TaskException
+ public void setExcludes( final String excludes )
{
- if( isReference() )
- {
- throw tooManyAttributes();
- }
-
- defaultPatterns.setExcludes( excludes );
+ m_defaultPatterns.setExcludes( excludes );
}
/**
* Sets the name of the file containing the includes patterns.
*
* @param excl The file to fetch the exclude patterns from.
- * @exception TaskException Description of Exception
*/
- public void setExcludesfile( File excl )
- throws TaskException
+ public void setExcludesfile( final File excl )
{
- if( isReference() )
- {
- throw tooManyAttributes();
- }
-
- defaultPatterns.setExcludesfile( excl );
+ m_defaultPatterns.setExcludesfile( excl );
}
/**
@@ -132,250 +89,118 @@
* @param includes the string containing the include patterns
*/
public void setIncludes( String includes )
- throws TaskException
{
- if( isReference() )
- {
- throw tooManyAttributes();
- }
-
- defaultPatterns.setIncludes( includes );
+ m_defaultPatterns.setIncludes( includes );
}
/**
* Sets the name of the file containing the includes patterns.
*
* @param incl The file to fetch the include patterns from.
- * @exception TaskException Description of Exception
*/
public void setIncludesfile( File incl )
- throws TaskException
{
- if( isReference() )
- {
- throw tooManyAttributes();
- }
-
- defaultPatterns.setIncludesfile( incl );
+ m_defaultPatterns.setIncludesfile( incl );
}
- /**
- * Makes this instance in effect a reference to another PatternSet instance.
- * <p>
- *
- * You must not set another attribute or nest elements inside this element
- * if you make it a reference.</p>
- *
- * @param r The new Refid value
- * @exception TaskException Description of Exception
- */
- public void setRefid( Reference r )
+ public void setupDirectoryScanner( final FileScanner ds )
throws TaskException
{
- if( dir != null || defaultPatterns.hasPatterns() )
+ if( null == ds )
{
- throw tooManyAttributes();
+ final String message = "ds cannot be null";
+ throw new IllegalArgumentException( message );
}
- if( !additionalPatterns.isEmpty() )
- {
- throw noChildrenAllowed();
- }
- super.setRefid( r );
- }
- public void setupDirectoryScanner( FileScanner ds, Project p )
- throws TaskException
- {
- if( ds == null )
- {
- throw new IllegalArgumentException( "ds cannot be null" );
- }
-
- ds.setBasedir( dir );
+ ds.setBasedir( m_dir );
- for( int i = 0; i < additionalPatterns.size(); i++ )
+ final int size = m_additionalPatterns.size();
+ for( int i = 0; i < size; i++ )
{
- Object o = additionalPatterns.get( i );
- defaultPatterns.append( (PatternSet)o, p );
+ final Object o = m_additionalPatterns.get( i );
+ m_defaultPatterns.append( (PatternSet)o );
}
- getLogger().debug( "FileSet: Setup file scanner in dir " + dir + " with " + defaultPatterns );
+ final String message = "FileSet: Setup file scanner in dir " +
+ m_dir + " with " + m_defaultPatterns;
+ getLogger().debug( message );
- ds.setIncludes( defaultPatterns.getIncludePatterns( p ) );
- ds.setExcludes( defaultPatterns.getExcludePatterns( p ) );
- if( useDefaultExcludes )
+ ds.setIncludes( m_defaultPatterns.getIncludePatterns( null ) );
+ ds.setExcludes( m_defaultPatterns.getExcludePatterns( null ) );
+ if( m_useDefaultExcludes )
+ {
ds.addDefaultExcludes();
- ds.setCaseSensitive( isCaseSensitive );
+ }
+ ds.setCaseSensitive( m_isCaseSensitive );
}
- public File getDir( Project p )
- throws TaskException
+ public File getDir()
{
- if( isReference() )
- {
- return getRef( p ).getDir( p );
- }
- return dir;
+ return m_dir;
}
/**
* Returns the directory scanner needed to access the files to process.
- *
- * @param p Description of Parameter
- * @return The DirectoryScanner value
*/
- public DirectoryScanner getDirectoryScanner( Project p )
+ public DirectoryScanner getDirectoryScanner()
throws TaskException
{
- if( isReference() )
- {
- return getRef( p ).getDirectoryScanner( p );
- }
-
- if( dir == null )
+ if( m_dir == null )
{
throw new TaskException( "No directory specified for fileset." );
}
- if( !dir.exists() )
+ if( !m_dir.exists() )
{
- throw new TaskException( dir.getAbsolutePath() + " not found." );
+ throw new TaskException( m_dir.getAbsolutePath() + " not found." );
}
- if( !dir.isDirectory() )
+ if( !m_dir.isDirectory() )
{
- throw new TaskException( dir.getAbsolutePath() + " is not a directory." );
+ throw new TaskException( m_dir.getAbsolutePath() + " is not a directory." );
}
- DirectoryScanner ds = new DirectoryScanner();
- setupDirectoryScanner( ds, p );
- ds.scan();
- return ds;
- }
-
- /**
- * Return a FileSet that has the same basedir and same patternsets as this
- * one.
- *
- * @return Description of the Returned Value
- */
- public Object clone()
- {
- try
- {
- if( isReference() )
- {
- return new FileSet( getRef( getProject() ) );
- }
- else
- {
- return new FileSet( this );
- }
- }
- catch( TaskException e )
- {
- throw new IllegalStateException( e.getMessage() );
- }
+ final DirectoryScanner scanner = new DirectoryScanner();
+ setupDirectoryScanner( scanner );
+ scanner.scan();
+ return scanner;
}
/**
* add a name entry on the exclude list
- *
- * @return Description of the Returned Value
*/
public PatternSet.NameEntry createExclude()
- throws TaskException
{
- if( isReference() )
- {
- throw noChildrenAllowed();
- }
- return defaultPatterns.createExclude();
+ return m_defaultPatterns.createExclude();
}
/**
* add a name entry on the include files list
- *
- * @return Description of the Returned Value
*/
public PatternSet.NameEntry createExcludesFile()
- throws TaskException
{
- if( isReference() )
- {
- throw noChildrenAllowed();
- }
- return defaultPatterns.createExcludesFile();
+ return m_defaultPatterns.createExcludesFile();
}
/**
* add a name entry on the include list
- *
- * @return Description of the Returned Value
*/
public PatternSet.NameEntry createInclude()
- throws TaskException
{
- if( isReference() )
- {
- throw noChildrenAllowed();
- }
- return defaultPatterns.createInclude();
+ return m_defaultPatterns.createInclude();
}
/**
* add a name entry on the include files list
- *
- * @return Description of the Returned Value
*/
public PatternSet.NameEntry createIncludesFile()
- throws TaskException
{
- if( isReference() )
- {
- throw noChildrenAllowed();
- }
- return defaultPatterns.createIncludesFile();
+ return m_defaultPatterns.createIncludesFile();
}
public PatternSet createPatternSet()
- throws TaskException
{
- if( isReference() )
- {
- throw noChildrenAllowed();
- }
- PatternSet patterns = new PatternSet();
- additionalPatterns.add( patterns );
+ final PatternSet patterns = new PatternSet();
+ m_additionalPatterns.add( patterns );
return patterns;
}
-
- /**
- * Performs the check for circular references and returns the referenced
- * FileSet.
- *
- * @param p Description of Parameter
- * @return The Ref value
- */
- protected FileSet getRef( Project p )
- throws TaskException
- {
- if( !checked )
- {
- Stack stk = new Stack();
- stk.push( this );
- dieOnCircularReference( stk, p );
- }
-
- Object o = ref.getReferencedObject( p );
- if( !( o instanceof FileSet ) )
- {
- String msg = ref.getRefId() + " doesn\'t denote a fileset";
- throw new TaskException( msg );
- }
- else
- {
- return (FileSet)o;
- }
- }
-
}
1.12 +2 -2 jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/types/Path.java
Index: Path.java
===================================================================
RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/types/Path.java,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -r1.11 -r1.12
--- Path.java 30 Dec 2001 03:33:58 -0000 1.11
+++ Path.java 1 Jan 2002 09:13:46 -0000 1.12
@@ -588,9 +588,9 @@
else if( o instanceof FileSet )
{
FileSet fs = (FileSet)o;
- DirectoryScanner ds = fs.getDirectoryScanner( getProject() );
+ DirectoryScanner ds = fs.getDirectoryScanner();
String[] s = ds.getIncludedFiles();
- File dir = fs.getDir( getProject() );
+ File dir = fs.getDir();
for( int j = 0; j < s.length; j++ )
{
File f = new File( dir, s[ j ] );
1.8 +37 -165 jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/types/PatternSet.java
Index: PatternSet.java
===================================================================
RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/types/PatternSet.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- PatternSet.java 30 Dec 2001 00:50:33 -0000 1.7
+++ PatternSet.java 1 Jan 2002 09:13:46 -0000 1.8
@@ -13,7 +13,6 @@
import java.io.IOException;
import java.util.ArrayList;
import java.util.Iterator;
-import java.util.Stack;
import java.util.StringTokenizer;
import org.apache.myrmidon.api.TaskException;
import org.apache.tools.ant.Project;
@@ -31,12 +30,13 @@
* @author Jon S. Stevens <a href="mailto:jon@clearink.com">jon@clearink.com</a>
* @author <a href="mailto:stefan.bodewig@epost.de">Stefan Bodewig</a>
*/
-public class PatternSet extends DataType
+public class PatternSet
+ extends DataType
{
- private ArrayList includeList = new ArrayList();
- private ArrayList excludeList = new ArrayList();
- private ArrayList includesFileList = new ArrayList();
- private ArrayList excludesFileList = new ArrayList();
+ private ArrayList m_includeList = new ArrayList();
+ private ArrayList m_excludeList = new ArrayList();
+ private ArrayList m_includesFileList = new ArrayList();
+ private ArrayList m_excludesFileList = new ArrayList();
public PatternSet()
{
@@ -50,12 +50,7 @@
* @param excludes the string containing the exclude patterns
*/
public void setExcludes( String excludes )
- throws TaskException
{
- if( isReference() )
- {
- throw tooManyAttributes();
- }
if( excludes != null && excludes.length() > 0 )
{
StringTokenizer tok = new StringTokenizer( excludes, ", ", false );
@@ -73,12 +68,7 @@
* @exception TaskException Description of Exception
*/
public void setExcludesfile( File excludesFile )
- throws TaskException
{
- if( isReference() )
- {
- throw tooManyAttributes();
- }
createExcludesFile().setName( excludesFile.getAbsolutePath() );
}
@@ -89,12 +79,7 @@
* @param includes the string containing the include patterns
*/
public void setIncludes( String includes )
- throws TaskException
{
- if( isReference() )
- {
- throw tooManyAttributes();
- }
if( includes != null && includes.length() > 0 )
{
StringTokenizer tok = new StringTokenizer( includes, ", ", false );
@@ -112,53 +97,18 @@
* @exception TaskException Description of Exception
*/
public void setIncludesfile( File includesFile )
- throws TaskException
{
- if( isReference() )
- {
- throw tooManyAttributes();
- }
createIncludesFile().setName( includesFile.getAbsolutePath() );
}
/**
- * Makes this instance in effect a reference to another PatternSet instance.
- * <p>
- *
- * You must not set another attribute or nest elements inside this element
- * if you make it a reference.</p>
- *
- * @param r The new Refid value
- * @exception TaskException Description of Exception
- */
- public void setRefid( Reference r )
- throws TaskException
- {
- if( !includeList.isEmpty() || !excludeList.isEmpty() )
- {
- throw tooManyAttributes();
- }
- super.setRefid( r );
- }
-
- /**
* Returns the filtered include patterns.
- *
- * @param p Description of Parameter
- * @return The ExcludePatterns value
*/
public String[] getExcludePatterns( Project p )
throws TaskException
{
- if( isReference() )
- {
- return getRef( p ).getExcludePatterns( p );
- }
- else
- {
- readFiles( p );
- return makeArray( excludeList, p );
- }
+ readFiles( p );
+ return makeArray( m_excludeList );
}
/**
@@ -170,32 +120,17 @@
public String[] getIncludePatterns( Project p )
throws TaskException
{
- if( isReference() )
- {
- return getRef( p ).getIncludePatterns( p );
- }
- else
- {
- readFiles( p );
- return makeArray( includeList, p );
- }
+ readFiles( p );
+ return makeArray( m_includeList );
}
/**
* Adds the patterns of the other instance to this set.
- *
- * @param other Description of Parameter
- * @param p Description of Parameter
*/
- public void append( PatternSet other, Project p )
+ protected void append( PatternSet other )
throws TaskException
{
- if( isReference() )
- {
- throw new TaskException( "Cannot append to a reference" );
- }
-
- String[] incl = other.getIncludePatterns( p );
+ String[] incl = other.getIncludePatterns( null );
if( incl != null )
{
for( int i = 0; i < incl.length; i++ )
@@ -204,7 +139,7 @@
}
}
- String[] excl = other.getExcludePatterns( p );
+ String[] excl = other.getExcludePatterns( null );
if( excl != null )
{
for( int i = 0; i < excl.length; i++ )
@@ -220,13 +155,8 @@
* @return Description of the Returned Value
*/
public NameEntry createExclude()
- throws TaskException
{
- if( isReference() )
- {
- throw noChildrenAllowed();
- }
- return addPatternToList( excludeList );
+ return addPatternToList( m_excludeList );
}
/**
@@ -235,121 +165,66 @@
* @return Description of the Returned Value
*/
public NameEntry createExcludesFile()
- throws TaskException
{
- if( isReference() )
- {
- throw noChildrenAllowed();
- }
- return addPatternToList( excludesFileList );
+ return addPatternToList( m_excludesFileList );
}
/**
* add a name entry on the include list
- *
- * @return Description of the Returned Value
*/
public NameEntry createInclude()
- throws TaskException
{
- if( isReference() )
- {
- throw noChildrenAllowed();
- }
- return addPatternToList( includeList );
+ return addPatternToList( m_includeList );
}
/**
* add a name entry on the include files list
- *
- * @return Description of the Returned Value
*/
public NameEntry createIncludesFile()
- throws TaskException
{
- if( isReference() )
- {
- throw noChildrenAllowed();
- }
- return addPatternToList( includesFileList );
+ return addPatternToList( m_includesFileList );
}
public String toString()
{
- return "patternSet{ includes: " + includeList +
- " excludes: " + excludeList + " }";
+ return "patternSet{ includes: " + m_includeList +
+ " excludes: " + m_excludeList + " }";
}
/**
* helper for FileSet.
- *
- * @return Description of the Returned Value
*/
boolean hasPatterns()
{
- return includesFileList.size() > 0 || excludesFileList.size() > 0
- || includeList.size() > 0 || excludeList.size() > 0;
- }
-
- /**
- * Performs the check for circular references and returns the referenced
- * PatternSet.
- *
- * @param p Description of Parameter
- * @return The Ref value
- */
- private PatternSet getRef( Project p )
- throws TaskException
- {
- if( !checked )
- {
- Stack stk = new Stack();
- stk.push( this );
- dieOnCircularReference( stk, p );
- }
-
- Object o = ref.getReferencedObject( p );
- if( !( o instanceof PatternSet ) )
- {
- String msg = ref.getRefId() + " doesn\'t denote a patternset";
- throw new TaskException( msg );
- }
- else
- {
- return (PatternSet)o;
- }
+ return m_includesFileList.size() > 0 || m_excludesFileList.size() > 0 ||
+ m_includeList.size() > 0 || m_excludeList.size() > 0;
}
/**
* add a name entry to the given list
- *
- * @param list The feature to be added to the PatternToList attribute
- * @return Description of the Returned Value
*/
- private NameEntry addPatternToList( ArrayList list )
+ private NameEntry addPatternToList( final ArrayList list )
{
- NameEntry result = new NameEntry();
+ final NameEntry result = new NameEntry();
list.add( result );
return result;
}
/**
* Convert a vector of NameEntry elements into an array of Strings.
- *
- * @param list Description of Parameter
- * @param p Description of Parameter
- * @return Description of the Returned Value
*/
- private String[] makeArray( ArrayList list, Project p )
+ private String[] makeArray( final ArrayList list )
{
if( list.size() == 0 )
+ {
return null;
+ }
- ArrayList tmpNames = new ArrayList();
+ final ArrayList tmpNames = new ArrayList();
for( Iterator e = list.iterator(); e.hasNext(); )
{
- NameEntry ne = (NameEntry)e.next();
- String pattern = ne.evalName( p );
+ final NameEntry ne = (NameEntry)e.next();
+ final String pattern = ne.evalName( null );
if( pattern != null && pattern.length() > 0 )
{
tmpNames.add( pattern );
@@ -362,15 +237,13 @@
/**
* Read includesfile ot excludesfile if not already done so.
- *
- * @param p Description of Parameter
*/
private void readFiles( Project p )
throws TaskException
{
- if( includesFileList.size() > 0 )
+ if( m_includesFileList.size() > 0 )
{
- Iterator e = includesFileList.iterator();
+ Iterator e = m_includesFileList.iterator();
while( e.hasNext() )
{
NameEntry ne = (NameEntry)e.next();
@@ -382,15 +255,15 @@
throw new TaskException( "Includesfile "
+ inclFile.getAbsolutePath()
+ " not found." );
- readPatterns( inclFile, includeList, p );
+ readPatterns( inclFile, m_includeList, p );
}
}
- includesFileList.clear();
+ m_includesFileList.clear();
}
- if( excludesFileList.size() > 0 )
+ if( m_excludesFileList.size() > 0 )
{
- Iterator e = excludesFileList.iterator();
+ Iterator e = m_excludesFileList.iterator();
while( e.hasNext() )
{
NameEntry ne = (NameEntry)e.next();
@@ -402,10 +275,10 @@
throw new TaskException( "Excludesfile "
+ exclFile.getAbsolutePath()
+ " not found." );
- readPatterns( exclFile, excludeList, p );
+ readPatterns( exclFile, m_excludeList, p );
}
}
- excludesFileList.clear();
+ m_excludesFileList.clear();
}
}
@@ -538,5 +411,4 @@
return true;
}
}
-
}
1.5 +5 -11 jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/types/ZipFileSet.java
Index: ZipFileSet.java
===================================================================
RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/types/ZipFileSet.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- ZipFileSet.java 23 Dec 2001 06:32:48 -0000 1.4
+++ ZipFileSet.java 1 Jan 2002 09:13:46 -0000 1.5
@@ -38,16 +38,14 @@
/**
* Set the directory for the fileset. Prevents both "dir" and "src" from
* being specified.
- *
- * @param dir The new Dir value
- * @exception TaskException Description of Exception
*/
- public void setDir( File dir )
+ public void setDir( final File dir )
throws TaskException
{
if( srcFile != null )
{
- throw new TaskException( "Cannot set both dir and src attributes" );
+ final String message = "Cannot set both dir and src attributes";
+ throw new TaskException( message );
}
else
{
@@ -104,22 +102,18 @@
public DirectoryScanner getDirectoryScanner( Project p )
throws TaskException
{
- if( isReference() )
- {
- return getRef( p ).getDirectoryScanner( p );
- }
if( srcFile != null )
{
ZipScanner zs = new ZipScanner();
zs.setSrc( srcFile );
super.setDir( p.getBaseDir() );
- setupDirectoryScanner( zs, p );
+ setupDirectoryScanner( zs );
zs.init();
return zs;
}
else
{
- return super.getDirectoryScanner( p );
+ return super.getDirectoryScanner();
}
}
1.4 +1 -1 jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/types/optional/depend/ClassfileSet.java
Index: ClassfileSet.java
===================================================================
RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/types/optional/depend/ClassfileSet.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- ClassfileSet.java 23 Dec 2001 06:32:48 -0000 1.3
+++ ClassfileSet.java 1 Jan 2002 09:13:47 -0000 1.4
@@ -47,7 +47,7 @@
public DirectoryScanner getDirectoryScanner( Project p )
{
DependScanner scanner = new DependScanner();
- scanner.setBasedir( getDir( p ) );
+ scanner.setBasedir( getDir() );
scanner.setRootClasses( rootClasses );
scanner.scan();
return scanner;
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>