Browse Source

Remove de-referencing stuff and cleaned up object a little.

git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@270592 13f79535-47bb-0310-9956-ffa450edef68
master
Peter Donald 23 years ago
parent
commit
f6e492ff83
2 changed files with 10 additions and 36 deletions
  1. +5
    -18
      proposal/myrmidon/src/main/org/apache/tools/ant/types/Path.java
  2. +5
    -18
      proposal/myrmidon/src/todo/org/apache/tools/ant/types/Path.java

+ 5
- 18
proposal/myrmidon/src/main/org/apache/tools/ant/types/Path.java View File

@@ -416,7 +416,6 @@ public class Path
* @exception TaskException Description of Exception
*/
public Path createPath()
throws TaskException
{
final Path other = new Path();
elements.add( other );
@@ -443,18 +442,6 @@ public class Path
for( int i = 0; i < elements.size(); i++ )
{
Object o = elements.get( i );
if( o instanceof Reference )
{
Reference r = (Reference)o;
o = r.getReferencedObject( getProject() );
// we only support references to paths right now
if( !( o instanceof Path ) )
{
String msg = r.getRefId() + " doesn\'t denote a path";
throw new TaskException( msg );
}
}

if( o instanceof String )
{
// obtained via append
@@ -465,7 +452,7 @@ public class Path
String[] parts = ( (PathElement)o ).getParts();
if( parts == null )
{
throw new TaskException( "You must either set location or path on <pathelement>" );
throw new NullPointerException( "You must either set location or path on <pathelement>" );
}
for( int j = 0; j < parts.length; j++ )
{
@@ -483,10 +470,10 @@ public class Path
}
else if( o instanceof FileSet )
{
FileSet fs = (FileSet)o;
DirectoryScanner ds = fs.getDirectoryScanner();
String[] s = ds.getIncludedFiles();
File dir = fs.getDir();
final FileSet fs = (FileSet)o;
final DirectoryScanner ds = fs.getDirectoryScanner();
final String[] s = ds.getIncludedFiles();
final File dir = fs.getDir();
for( int j = 0; j < s.length; j++ )
{
File f = new File( dir, s[ j ] );


+ 5
- 18
proposal/myrmidon/src/todo/org/apache/tools/ant/types/Path.java View File

@@ -416,7 +416,6 @@ public class Path
* @exception TaskException Description of Exception
*/
public Path createPath()
throws TaskException
{
final Path other = new Path();
elements.add( other );
@@ -443,18 +442,6 @@ public class Path
for( int i = 0; i < elements.size(); i++ )
{
Object o = elements.get( i );
if( o instanceof Reference )
{
Reference r = (Reference)o;
o = r.getReferencedObject( getProject() );
// we only support references to paths right now
if( !( o instanceof Path ) )
{
String msg = r.getRefId() + " doesn\'t denote a path";
throw new TaskException( msg );
}
}

if( o instanceof String )
{
// obtained via append
@@ -465,7 +452,7 @@ public class Path
String[] parts = ( (PathElement)o ).getParts();
if( parts == null )
{
throw new TaskException( "You must either set location or path on <pathelement>" );
throw new NullPointerException( "You must either set location or path on <pathelement>" );
}
for( int j = 0; j < parts.length; j++ )
{
@@ -483,10 +470,10 @@ public class Path
}
else if( o instanceof FileSet )
{
FileSet fs = (FileSet)o;
DirectoryScanner ds = fs.getDirectoryScanner();
String[] s = ds.getIncludedFiles();
File dir = fs.getDir();
final FileSet fs = (FileSet)o;
final DirectoryScanner ds = fs.getDirectoryScanner();
final String[] s = ds.getIncludedFiles();
final File dir = fs.getDir();
for( int j = 0; j < s.length; j++ )
{
File f = new File( dir, s[ j ] );


Loading…
Cancel
Save