From bfc6ef8295b44eea9ded49c346470c7a7d0c6ee5 Mon Sep 17 00:00:00 2001 From: Peter Donald Date: Thu, 17 Jan 2002 08:04:54 +0000 Subject: [PATCH] =?UTF-8?q?This=20is=20the=20first=20patch=20of=20the=20lo?= =?UTF-8?q?oong=20process=20of=20refactoring=20the=20setX()/createX()=20an?= =?UTF-8?q?d=20setX()/addX()=20method=20pairs=20into=20a=20single=20setX()?= =?UTF-8?q?=20or=20addX()=20method.=20=EF=BF=BDI've=20started=20with=20Pat?= =?UTF-8?q?h,=20to=20get=20rid=20of=20some=20its=20inertia.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Submitted by: "Adam Murdoch" git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@270776 13f79535-47bb-0310-9956-ffa450edef68 --- .../apache/tools/ant/taskdefs/Available.java | 46 ++++----- .../org/apache/tools/ant/taskdefs/Java.java | 18 +--- .../org/apache/tools/ant/taskdefs/Javac.java | 98 +++---------------- .../tools/ant/taskdefs/PathConvert.java | 14 +-- .../apache/tools/ant/taskdefs/Property.java | 17 +--- .../org/apache/tools/ant/taskdefs/Rmic.java | 49 ++-------- .../apache/tools/ant/taskdefs/SQLExec.java | 24 +---- .../optional/ejb/BorlandGenerateClient.java | 2 +- .../ant/taskdefs/optional/jsp/WLJspc.java | 2 +- .../optional/jsp/compilers/JasperC.java | 2 +- .../apache/tools/ant/taskdefs/Available.java | 46 ++++----- .../org/apache/tools/ant/taskdefs/Java.java | 18 +--- .../org/apache/tools/ant/taskdefs/Javac.java | 98 +++---------------- .../tools/ant/taskdefs/PathConvert.java | 14 +-- .../apache/tools/ant/taskdefs/Property.java | 17 +--- .../org/apache/tools/ant/taskdefs/Rmic.java | 49 ++-------- .../apache/tools/ant/taskdefs/SQLExec.java | 24 +---- .../optional/ejb/BorlandGenerateClient.java | 2 +- .../ant/taskdefs/optional/jsp/WLJspc.java | 2 +- .../optional/jsp/compilers/JasperC.java | 2 +- 20 files changed, 118 insertions(+), 426 deletions(-) diff --git a/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/Available.java b/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/Available.java index 251f2be31..c7844055e 100644 --- a/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/Available.java +++ b/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/Available.java @@ -48,10 +48,20 @@ public class Available } } - public void setClasspath( Path classpath ) + /** + * Adds a classpath element. + */ + public void addClasspath( Path classpath ) throws TaskException { - createClasspath().append( classpath ); + if ( m_classpath == null ) + { + m_classpath = classpath; + } + else + { + m_classpath.addPath(classpath); + } } public void setFile( String file ) @@ -59,12 +69,6 @@ public class Available m_file = file; } - public void setFilepath( Path filepath ) - throws TaskException - { - createFilepath().append( filepath ); - } - public void setProperty( String property ) { m_property = property; @@ -85,30 +89,20 @@ public class Available m_value = value; } - public Path createClasspath() + /** + * Adds a file search path element. + */ + public void addFilepath( Path path ) throws TaskException { - if( m_classpath == null ) + if( m_filepath == null ) { - m_classpath = new Path(); + m_filepath = path; } - Path path1 = m_classpath; - final Path path = new Path(); - path1.addPath( path ); - return path; - } - - public Path createFilepath() - throws TaskException - { - if( m_filepath == null ) + else { - m_filepath = new Path(); + m_filepath.addPath( path ); } - Path path1 = m_filepath; - final Path path = new Path(); - path1.addPath( path ); - return path; } public boolean eval() diff --git a/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/Java.java b/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/Java.java index 5895c3003..97c32d008 100644 --- a/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/Java.java +++ b/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/Java.java @@ -45,12 +45,12 @@ public class Java } /** - * Set the classpath to be used for this compilation. + * Add a classpath element. */ - public void setClasspath( final Path classpath ) + public void addClasspath( final Path classpath ) throws TaskException { - createClasspath().append( classpath ); + m_cmdl.createClasspath().addPath( classpath ); } /** @@ -111,18 +111,6 @@ public class Java return m_cmdl.createArgument(); } - /** - * Creates a nested classpath element - */ - public Path createClasspath() - throws TaskException - { - Path path1 = m_cmdl.createClasspath(); - final Path path = new Path(); - path1.addPath( path ); - return path; - } - /** * Creates a nested jvmarg element. */ diff --git a/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/Javac.java b/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/Javac.java index b80cf05d5..53582fad7 100644 --- a/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/Javac.java +++ b/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/Javac.java @@ -88,11 +88,12 @@ public class Javac extends MatchingTask private String target; /** - * Sets the bootclasspath that will be used to compile the classes against. + * Adds an element to the bootclasspath that will be used to compile the + * classes against. * * @param bootclasspath The new Bootclasspath value */ - public void setBootclasspath( Path bootclasspath ) + public void addBootclasspath( Path bootclasspath ) throws TaskException { if( this.bootclasspath == null ) @@ -101,16 +102,16 @@ public class Javac extends MatchingTask } else { - this.bootclasspath.append( bootclasspath ); + this.bootclasspath.addPath( bootclasspath ); } } /** - * Set the classpath to be used for this compilation. + * Adds an element to the classpath to be used for this compilation. * * @param classpath The new Classpath value */ - public void setClasspath( Path classpath ) + public void addClasspath( Path classpath ) throws TaskException { if( compileClasspath == null ) @@ -119,7 +120,7 @@ public class Javac extends MatchingTask } else { - compileClasspath.append( classpath ); + compileClasspath.addPath( classpath ); } } @@ -185,11 +186,12 @@ public class Javac extends MatchingTask } /** - * Sets the extension directories that will be used during the compilation. + * Adds an element to the extension directories that will be used during + * the compilation. * * @param extdirs The new Extdirs value */ - public void setExtdirs( Path extdirs ) + public void addExtdirs( Path extdirs ) throws TaskException { if( this.extdirs == null ) @@ -198,7 +200,7 @@ public class Javac extends MatchingTask } else { - this.extdirs.append( extdirs ); + this.extdirs.addPath( extdirs ); } } @@ -322,11 +324,11 @@ public class Javac extends MatchingTask } /** - * Set the source dirs to find the source Java files. + * Adds an element to the source dirs to find the source Java files. * * @param srcDir The new Srcdir value */ - public void setSrcdir( Path srcDir ) + public void addSrcdir( Path srcDir ) throws TaskException { if( src == null ) @@ -335,7 +337,7 @@ public class Javac extends MatchingTask } else { - src.append( srcDir ); + src.addPath( srcDir ); } } @@ -630,42 +632,6 @@ public class Javac extends MatchingTask "extJavac".equals( getProperty( "build.compiler" ) ); } - /** - * Maybe creates a nested classpath element. - * - * @return Description of the Returned Value - */ - public Path createBootclasspath() - throws TaskException - { - if( bootclasspath == null ) - { - bootclasspath = new Path(); - } - Path path1 = bootclasspath; - final Path path = new Path(); - path1.addPath( path ); - return path; - } - - /** - * Maybe creates a nested classpath element. - * - * @return Description of the Returned Value - */ - public Path createClasspath() - throws TaskException - { - if( compileClasspath == null ) - { - compileClasspath = new Path(); - } - Path path1 = compileClasspath; - final Path path = new Path(); - path1.addPath( path ); - return path; - } - /** * Adds an implementation specific command line argument. * @@ -679,42 +645,6 @@ public class Javac extends MatchingTask return arg; } - /** - * Maybe creates a nested classpath element. - * - * @return Description of the Returned Value - */ - public Path createExtdirs() - throws TaskException - { - if( extdirs == null ) - { - extdirs = new Path(); - } - Path path1 = extdirs; - final Path path = new Path(); - path1.addPath( path ); - return path; - } - - /** - * Create a nested src element for multiple source path support. - * - * @return a nested src element. - */ - public Path createSrc() - throws TaskException - { - if( src == null ) - { - src = new Path(); - } - Path path1 = src; - final Path path = new Path(); - path1.addPath( path ); - return path; - } - /** * Executes the task. * diff --git a/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/PathConvert.java b/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/PathConvert.java index a68fed1b9..335aad0fd 100644 --- a/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/PathConvert.java +++ b/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/PathConvert.java @@ -96,19 +96,19 @@ public class PathConvert extends Task } /** - * Create a nested PATH element + * Adds a PATH element */ - public Path createPath() + public void addPath( Path path ) throws TaskException { if( m_path == null ) { - m_path = new Path(); + m_path = path; + } + else + { + m_path.addPath( path ); } - Path path1 = m_path; - final Path path = new Path(); - path1.addPath( path ); - return path; } public void execute() diff --git a/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/Property.java b/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/Property.java index fae81a76c..58b25550d 100644 --- a/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/Property.java +++ b/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/Property.java @@ -35,7 +35,7 @@ public class Property private String m_resource; private String m_value; - public void setClasspath( Path classpath ) + public void addClasspath( Path classpath ) throws TaskException { if( m_classpath == null ) @@ -44,7 +44,7 @@ public class Property } else { - m_classpath.append( classpath ); + m_classpath.addPath( classpath ); } } @@ -68,19 +68,6 @@ public class Property m_value = value; } - public Path createClasspath() - throws TaskException - { - if( m_classpath == null ) - { - m_classpath = new Path(); - } - Path path1 = m_classpath; - final Path path = new Path(); - path1.addPath( path ); - return path; - } - public void execute() throws TaskException { diff --git a/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/Rmic.java b/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/Rmic.java index c563a662a..6ece54990 100644 --- a/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/Rmic.java +++ b/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/Rmic.java @@ -102,11 +102,11 @@ public class Rmic extends MatchingTask } /** - * Set the classpath to be used for this compilation. + * Add an element to the classpath to be used for this compilation. * * @param classpath The new Classpath value */ - public void setClasspath( Path classpath ) + public void addClasspath( Path classpath ) throws TaskException { if( compileClasspath == null ) @@ -115,7 +115,7 @@ public class Rmic extends MatchingTask } else { - compileClasspath.append( classpath ); + compileClasspath.addPath( classpath ); } } @@ -130,11 +130,12 @@ public class Rmic extends MatchingTask } /** - * Sets the extension directories that will be used during the compilation. + * Adds an element to the extension directories that will be used during + * the compilation. * * @param extdirs The new Extdirs value */ - public void setExtdirs( Path extdirs ) + public void addExtdirs( Path extdirs ) throws TaskException { if( this.extdirs == null ) @@ -143,7 +144,7 @@ public class Rmic extends MatchingTask } else { - this.extdirs.append( extdirs ); + this.extdirs.addPath( extdirs ); } } @@ -459,42 +460,6 @@ public class Rmic extends MatchingTask return false; } - /** - * Creates a nested classpath element. - * - * @return Description of the Returned Value - */ - public Path createClasspath() - throws TaskException - { - if( compileClasspath == null ) - { - compileClasspath = new Path(); - } - Path path1 = compileClasspath; - final Path path = new Path(); - path1.addPath( path ); - return path; - } - - /** - * Maybe creates a nested extdirs element. - * - * @return Description of the Returned Value - */ - public Path createExtdirs() - throws TaskException - { - if( extdirs == null ) - { - extdirs = new Path(); - } - Path path1 = extdirs; - final Path path = new Path(); - path1.addPath( path ); - return path; - } - public void execute() throws TaskException { diff --git a/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/SQLExec.java b/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/SQLExec.java index 28c46503c..80facd8ab 100644 --- a/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/SQLExec.java +++ b/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/SQLExec.java @@ -162,11 +162,11 @@ public class SQLExec } /** - * Set the classpath for loading the driver. + * Adds an element to the classpath for loading the driver. * * @param classpath The new Classpath value */ - public void setClasspath( Path classpath ) + public void addClasspath( Path classpath ) throws TaskException { if( this.classpath == null ) @@ -175,7 +175,7 @@ public class SQLExec } else { - this.classpath.append( classpath ); + this.classpath.addPath( classpath ); } } @@ -345,24 +345,6 @@ public class SQLExec this.sqlCommand += sql; } - /** - * Create the classpath for loading the driver. - * - * @return Description of the Returned Value - */ - public Path createClasspath() - throws TaskException - { - if( this.classpath == null ) - { - this.classpath = new Path(); - } - Path path1 = this.classpath; - final Path path = new Path(); - path1.addPath( path ); - return path; - } - /** * Set the sql command to execute * diff --git a/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/ejb/BorlandGenerateClient.java b/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/ejb/BorlandGenerateClient.java index ace1f1ea0..d3c4bf029 100644 --- a/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/ejb/BorlandGenerateClient.java +++ b/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/ejb/BorlandGenerateClient.java @@ -215,7 +215,7 @@ public class BorlandGenerateClient extends Task //classpath //add at the end of the classpath //the system classpath in order to find the tools.jar file - execTask.setClasspath( classpath.concatSystemClasspath() ); + execTask.addClasspath( classpath.concatSystemClasspath() ); execTask.setFork( true ); execTask.createArg().setValue( "generateclient" ); diff --git a/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/jsp/WLJspc.java b/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/jsp/WLJspc.java index 417f8223e..707bbe227 100644 --- a/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/jsp/WLJspc.java +++ b/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/jsp/WLJspc.java @@ -229,7 +229,7 @@ public class WLJspc extends MatchingTask //helperTask.clearArgs(); helperTask.createArg().setValue( arg ); - helperTask.setClasspath( compileClasspath ); + helperTask.addClasspath( compileClasspath ); if( helperTask.executeJava() != 0 ) { getLogger().warn( files[ i ] + " failed to compile" ); diff --git a/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/jsp/compilers/JasperC.java b/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/jsp/compilers/JasperC.java index 48b8915cf..0eefa5ef1 100644 --- a/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/jsp/compilers/JasperC.java +++ b/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/jsp/compilers/JasperC.java @@ -37,7 +37,7 @@ public class JasperC //FIXME Java java = null;//(Java)( getJspc().getProject() ).createTask( "java" ); if( getJspc().getClasspath() != null ) - java.setClasspath( getJspc().getClasspath() ); + java.addClasspath( getJspc().getClasspath() ); java.setClassname( "org.apache.jasper.JspC" ); String args[] = cmd.getArguments(); for( int i = 0; i < args.length; i++ ) diff --git a/proposal/myrmidon/src/todo/org/apache/tools/ant/taskdefs/Available.java b/proposal/myrmidon/src/todo/org/apache/tools/ant/taskdefs/Available.java index 251f2be31..c7844055e 100644 --- a/proposal/myrmidon/src/todo/org/apache/tools/ant/taskdefs/Available.java +++ b/proposal/myrmidon/src/todo/org/apache/tools/ant/taskdefs/Available.java @@ -48,10 +48,20 @@ public class Available } } - public void setClasspath( Path classpath ) + /** + * Adds a classpath element. + */ + public void addClasspath( Path classpath ) throws TaskException { - createClasspath().append( classpath ); + if ( m_classpath == null ) + { + m_classpath = classpath; + } + else + { + m_classpath.addPath(classpath); + } } public void setFile( String file ) @@ -59,12 +69,6 @@ public class Available m_file = file; } - public void setFilepath( Path filepath ) - throws TaskException - { - createFilepath().append( filepath ); - } - public void setProperty( String property ) { m_property = property; @@ -85,30 +89,20 @@ public class Available m_value = value; } - public Path createClasspath() + /** + * Adds a file search path element. + */ + public void addFilepath( Path path ) throws TaskException { - if( m_classpath == null ) + if( m_filepath == null ) { - m_classpath = new Path(); + m_filepath = path; } - Path path1 = m_classpath; - final Path path = new Path(); - path1.addPath( path ); - return path; - } - - public Path createFilepath() - throws TaskException - { - if( m_filepath == null ) + else { - m_filepath = new Path(); + m_filepath.addPath( path ); } - Path path1 = m_filepath; - final Path path = new Path(); - path1.addPath( path ); - return path; } public boolean eval() diff --git a/proposal/myrmidon/src/todo/org/apache/tools/ant/taskdefs/Java.java b/proposal/myrmidon/src/todo/org/apache/tools/ant/taskdefs/Java.java index 5895c3003..97c32d008 100644 --- a/proposal/myrmidon/src/todo/org/apache/tools/ant/taskdefs/Java.java +++ b/proposal/myrmidon/src/todo/org/apache/tools/ant/taskdefs/Java.java @@ -45,12 +45,12 @@ public class Java } /** - * Set the classpath to be used for this compilation. + * Add a classpath element. */ - public void setClasspath( final Path classpath ) + public void addClasspath( final Path classpath ) throws TaskException { - createClasspath().append( classpath ); + m_cmdl.createClasspath().addPath( classpath ); } /** @@ -111,18 +111,6 @@ public class Java return m_cmdl.createArgument(); } - /** - * Creates a nested classpath element - */ - public Path createClasspath() - throws TaskException - { - Path path1 = m_cmdl.createClasspath(); - final Path path = new Path(); - path1.addPath( path ); - return path; - } - /** * Creates a nested jvmarg element. */ diff --git a/proposal/myrmidon/src/todo/org/apache/tools/ant/taskdefs/Javac.java b/proposal/myrmidon/src/todo/org/apache/tools/ant/taskdefs/Javac.java index b80cf05d5..53582fad7 100644 --- a/proposal/myrmidon/src/todo/org/apache/tools/ant/taskdefs/Javac.java +++ b/proposal/myrmidon/src/todo/org/apache/tools/ant/taskdefs/Javac.java @@ -88,11 +88,12 @@ public class Javac extends MatchingTask private String target; /** - * Sets the bootclasspath that will be used to compile the classes against. + * Adds an element to the bootclasspath that will be used to compile the + * classes against. * * @param bootclasspath The new Bootclasspath value */ - public void setBootclasspath( Path bootclasspath ) + public void addBootclasspath( Path bootclasspath ) throws TaskException { if( this.bootclasspath == null ) @@ -101,16 +102,16 @@ public class Javac extends MatchingTask } else { - this.bootclasspath.append( bootclasspath ); + this.bootclasspath.addPath( bootclasspath ); } } /** - * Set the classpath to be used for this compilation. + * Adds an element to the classpath to be used for this compilation. * * @param classpath The new Classpath value */ - public void setClasspath( Path classpath ) + public void addClasspath( Path classpath ) throws TaskException { if( compileClasspath == null ) @@ -119,7 +120,7 @@ public class Javac extends MatchingTask } else { - compileClasspath.append( classpath ); + compileClasspath.addPath( classpath ); } } @@ -185,11 +186,12 @@ public class Javac extends MatchingTask } /** - * Sets the extension directories that will be used during the compilation. + * Adds an element to the extension directories that will be used during + * the compilation. * * @param extdirs The new Extdirs value */ - public void setExtdirs( Path extdirs ) + public void addExtdirs( Path extdirs ) throws TaskException { if( this.extdirs == null ) @@ -198,7 +200,7 @@ public class Javac extends MatchingTask } else { - this.extdirs.append( extdirs ); + this.extdirs.addPath( extdirs ); } } @@ -322,11 +324,11 @@ public class Javac extends MatchingTask } /** - * Set the source dirs to find the source Java files. + * Adds an element to the source dirs to find the source Java files. * * @param srcDir The new Srcdir value */ - public void setSrcdir( Path srcDir ) + public void addSrcdir( Path srcDir ) throws TaskException { if( src == null ) @@ -335,7 +337,7 @@ public class Javac extends MatchingTask } else { - src.append( srcDir ); + src.addPath( srcDir ); } } @@ -630,42 +632,6 @@ public class Javac extends MatchingTask "extJavac".equals( getProperty( "build.compiler" ) ); } - /** - * Maybe creates a nested classpath element. - * - * @return Description of the Returned Value - */ - public Path createBootclasspath() - throws TaskException - { - if( bootclasspath == null ) - { - bootclasspath = new Path(); - } - Path path1 = bootclasspath; - final Path path = new Path(); - path1.addPath( path ); - return path; - } - - /** - * Maybe creates a nested classpath element. - * - * @return Description of the Returned Value - */ - public Path createClasspath() - throws TaskException - { - if( compileClasspath == null ) - { - compileClasspath = new Path(); - } - Path path1 = compileClasspath; - final Path path = new Path(); - path1.addPath( path ); - return path; - } - /** * Adds an implementation specific command line argument. * @@ -679,42 +645,6 @@ public class Javac extends MatchingTask return arg; } - /** - * Maybe creates a nested classpath element. - * - * @return Description of the Returned Value - */ - public Path createExtdirs() - throws TaskException - { - if( extdirs == null ) - { - extdirs = new Path(); - } - Path path1 = extdirs; - final Path path = new Path(); - path1.addPath( path ); - return path; - } - - /** - * Create a nested src element for multiple source path support. - * - * @return a nested src element. - */ - public Path createSrc() - throws TaskException - { - if( src == null ) - { - src = new Path(); - } - Path path1 = src; - final Path path = new Path(); - path1.addPath( path ); - return path; - } - /** * Executes the task. * diff --git a/proposal/myrmidon/src/todo/org/apache/tools/ant/taskdefs/PathConvert.java b/proposal/myrmidon/src/todo/org/apache/tools/ant/taskdefs/PathConvert.java index a68fed1b9..335aad0fd 100644 --- a/proposal/myrmidon/src/todo/org/apache/tools/ant/taskdefs/PathConvert.java +++ b/proposal/myrmidon/src/todo/org/apache/tools/ant/taskdefs/PathConvert.java @@ -96,19 +96,19 @@ public class PathConvert extends Task } /** - * Create a nested PATH element + * Adds a PATH element */ - public Path createPath() + public void addPath( Path path ) throws TaskException { if( m_path == null ) { - m_path = new Path(); + m_path = path; + } + else + { + m_path.addPath( path ); } - Path path1 = m_path; - final Path path = new Path(); - path1.addPath( path ); - return path; } public void execute() diff --git a/proposal/myrmidon/src/todo/org/apache/tools/ant/taskdefs/Property.java b/proposal/myrmidon/src/todo/org/apache/tools/ant/taskdefs/Property.java index fae81a76c..58b25550d 100644 --- a/proposal/myrmidon/src/todo/org/apache/tools/ant/taskdefs/Property.java +++ b/proposal/myrmidon/src/todo/org/apache/tools/ant/taskdefs/Property.java @@ -35,7 +35,7 @@ public class Property private String m_resource; private String m_value; - public void setClasspath( Path classpath ) + public void addClasspath( Path classpath ) throws TaskException { if( m_classpath == null ) @@ -44,7 +44,7 @@ public class Property } else { - m_classpath.append( classpath ); + m_classpath.addPath( classpath ); } } @@ -68,19 +68,6 @@ public class Property m_value = value; } - public Path createClasspath() - throws TaskException - { - if( m_classpath == null ) - { - m_classpath = new Path(); - } - Path path1 = m_classpath; - final Path path = new Path(); - path1.addPath( path ); - return path; - } - public void execute() throws TaskException { diff --git a/proposal/myrmidon/src/todo/org/apache/tools/ant/taskdefs/Rmic.java b/proposal/myrmidon/src/todo/org/apache/tools/ant/taskdefs/Rmic.java index c563a662a..6ece54990 100644 --- a/proposal/myrmidon/src/todo/org/apache/tools/ant/taskdefs/Rmic.java +++ b/proposal/myrmidon/src/todo/org/apache/tools/ant/taskdefs/Rmic.java @@ -102,11 +102,11 @@ public class Rmic extends MatchingTask } /** - * Set the classpath to be used for this compilation. + * Add an element to the classpath to be used for this compilation. * * @param classpath The new Classpath value */ - public void setClasspath( Path classpath ) + public void addClasspath( Path classpath ) throws TaskException { if( compileClasspath == null ) @@ -115,7 +115,7 @@ public class Rmic extends MatchingTask } else { - compileClasspath.append( classpath ); + compileClasspath.addPath( classpath ); } } @@ -130,11 +130,12 @@ public class Rmic extends MatchingTask } /** - * Sets the extension directories that will be used during the compilation. + * Adds an element to the extension directories that will be used during + * the compilation. * * @param extdirs The new Extdirs value */ - public void setExtdirs( Path extdirs ) + public void addExtdirs( Path extdirs ) throws TaskException { if( this.extdirs == null ) @@ -143,7 +144,7 @@ public class Rmic extends MatchingTask } else { - this.extdirs.append( extdirs ); + this.extdirs.addPath( extdirs ); } } @@ -459,42 +460,6 @@ public class Rmic extends MatchingTask return false; } - /** - * Creates a nested classpath element. - * - * @return Description of the Returned Value - */ - public Path createClasspath() - throws TaskException - { - if( compileClasspath == null ) - { - compileClasspath = new Path(); - } - Path path1 = compileClasspath; - final Path path = new Path(); - path1.addPath( path ); - return path; - } - - /** - * Maybe creates a nested extdirs element. - * - * @return Description of the Returned Value - */ - public Path createExtdirs() - throws TaskException - { - if( extdirs == null ) - { - extdirs = new Path(); - } - Path path1 = extdirs; - final Path path = new Path(); - path1.addPath( path ); - return path; - } - public void execute() throws TaskException { diff --git a/proposal/myrmidon/src/todo/org/apache/tools/ant/taskdefs/SQLExec.java b/proposal/myrmidon/src/todo/org/apache/tools/ant/taskdefs/SQLExec.java index 28c46503c..80facd8ab 100644 --- a/proposal/myrmidon/src/todo/org/apache/tools/ant/taskdefs/SQLExec.java +++ b/proposal/myrmidon/src/todo/org/apache/tools/ant/taskdefs/SQLExec.java @@ -162,11 +162,11 @@ public class SQLExec } /** - * Set the classpath for loading the driver. + * Adds an element to the classpath for loading the driver. * * @param classpath The new Classpath value */ - public void setClasspath( Path classpath ) + public void addClasspath( Path classpath ) throws TaskException { if( this.classpath == null ) @@ -175,7 +175,7 @@ public class SQLExec } else { - this.classpath.append( classpath ); + this.classpath.addPath( classpath ); } } @@ -345,24 +345,6 @@ public class SQLExec this.sqlCommand += sql; } - /** - * Create the classpath for loading the driver. - * - * @return Description of the Returned Value - */ - public Path createClasspath() - throws TaskException - { - if( this.classpath == null ) - { - this.classpath = new Path(); - } - Path path1 = this.classpath; - final Path path = new Path(); - path1.addPath( path ); - return path; - } - /** * Set the sql command to execute * diff --git a/proposal/myrmidon/src/todo/org/apache/tools/ant/taskdefs/optional/ejb/BorlandGenerateClient.java b/proposal/myrmidon/src/todo/org/apache/tools/ant/taskdefs/optional/ejb/BorlandGenerateClient.java index ace1f1ea0..d3c4bf029 100644 --- a/proposal/myrmidon/src/todo/org/apache/tools/ant/taskdefs/optional/ejb/BorlandGenerateClient.java +++ b/proposal/myrmidon/src/todo/org/apache/tools/ant/taskdefs/optional/ejb/BorlandGenerateClient.java @@ -215,7 +215,7 @@ public class BorlandGenerateClient extends Task //classpath //add at the end of the classpath //the system classpath in order to find the tools.jar file - execTask.setClasspath( classpath.concatSystemClasspath() ); + execTask.addClasspath( classpath.concatSystemClasspath() ); execTask.setFork( true ); execTask.createArg().setValue( "generateclient" ); diff --git a/proposal/myrmidon/src/todo/org/apache/tools/ant/taskdefs/optional/jsp/WLJspc.java b/proposal/myrmidon/src/todo/org/apache/tools/ant/taskdefs/optional/jsp/WLJspc.java index 417f8223e..707bbe227 100644 --- a/proposal/myrmidon/src/todo/org/apache/tools/ant/taskdefs/optional/jsp/WLJspc.java +++ b/proposal/myrmidon/src/todo/org/apache/tools/ant/taskdefs/optional/jsp/WLJspc.java @@ -229,7 +229,7 @@ public class WLJspc extends MatchingTask //helperTask.clearArgs(); helperTask.createArg().setValue( arg ); - helperTask.setClasspath( compileClasspath ); + helperTask.addClasspath( compileClasspath ); if( helperTask.executeJava() != 0 ) { getLogger().warn( files[ i ] + " failed to compile" ); diff --git a/proposal/myrmidon/src/todo/org/apache/tools/ant/taskdefs/optional/jsp/compilers/JasperC.java b/proposal/myrmidon/src/todo/org/apache/tools/ant/taskdefs/optional/jsp/compilers/JasperC.java index 48b8915cf..0eefa5ef1 100644 --- a/proposal/myrmidon/src/todo/org/apache/tools/ant/taskdefs/optional/jsp/compilers/JasperC.java +++ b/proposal/myrmidon/src/todo/org/apache/tools/ant/taskdefs/optional/jsp/compilers/JasperC.java @@ -37,7 +37,7 @@ public class JasperC //FIXME Java java = null;//(Java)( getJspc().getProject() ).createTask( "java" ); if( getJspc().getClasspath() != null ) - java.setClasspath( getJspc().getClasspath() ); + java.addClasspath( getJspc().getClasspath() ); java.setClassname( "org.apache.jasper.JspC" ); String args[] = cmd.getArguments(); for( int i = 0; i < args.length; i++ )