From f6e492ff8312882595e97b9480bfa2301f417e34 Mon Sep 17 00:00:00 2001 From: Peter Donald Date: Sun, 6 Jan 2002 02:31:35 +0000 Subject: [PATCH] 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 --- .../main/org/apache/tools/ant/types/Path.java | 23 ++++--------------- .../todo/org/apache/tools/ant/types/Path.java | 23 ++++--------------- 2 files changed, 10 insertions(+), 36 deletions(-) diff --git a/proposal/myrmidon/src/main/org/apache/tools/ant/types/Path.java b/proposal/myrmidon/src/main/org/apache/tools/ant/types/Path.java index 602bb1150..d655b3bac 100644 --- a/proposal/myrmidon/src/main/org/apache/tools/ant/types/Path.java +++ b/proposal/myrmidon/src/main/org/apache/tools/ant/types/Path.java @@ -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 " ); + throw new NullPointerException( "You must either set location or path on " ); } 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 ] ); diff --git a/proposal/myrmidon/src/todo/org/apache/tools/ant/types/Path.java b/proposal/myrmidon/src/todo/org/apache/tools/ant/types/Path.java index 602bb1150..d655b3bac 100644 --- a/proposal/myrmidon/src/todo/org/apache/tools/ant/types/Path.java +++ b/proposal/myrmidon/src/todo/org/apache/tools/ant/types/Path.java @@ -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 " ); + throw new NullPointerException( "You must either set location or path on " ); } 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 ] );