Browse Source

This is the first patch of the looong process of refactoring the

setX()/createX() and setX()/addX() method pairs into a single setX() or
addX() method. �I've started with Path, to get rid of some its inertia.

Submitted by: "Adam Murdoch" <adammurdoch_ml@yahoo.com>


git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@270776 13f79535-47bb-0310-9956-ffa450edef68
master
Peter Donald 23 years ago
parent
commit
bfc6ef8295
20 changed files with 118 additions and 426 deletions
  1. +20
    -26
      proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/Available.java
  2. +3
    -15
      proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/Java.java
  3. +14
    -84
      proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/Javac.java
  4. +7
    -7
      proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/PathConvert.java
  5. +2
    -15
      proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/Property.java
  6. +7
    -42
      proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/Rmic.java
  7. +3
    -21
      proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/SQLExec.java
  8. +1
    -1
      proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/ejb/BorlandGenerateClient.java
  9. +1
    -1
      proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/jsp/WLJspc.java
  10. +1
    -1
      proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/jsp/compilers/JasperC.java
  11. +20
    -26
      proposal/myrmidon/src/todo/org/apache/tools/ant/taskdefs/Available.java
  12. +3
    -15
      proposal/myrmidon/src/todo/org/apache/tools/ant/taskdefs/Java.java
  13. +14
    -84
      proposal/myrmidon/src/todo/org/apache/tools/ant/taskdefs/Javac.java
  14. +7
    -7
      proposal/myrmidon/src/todo/org/apache/tools/ant/taskdefs/PathConvert.java
  15. +2
    -15
      proposal/myrmidon/src/todo/org/apache/tools/ant/taskdefs/Property.java
  16. +7
    -42
      proposal/myrmidon/src/todo/org/apache/tools/ant/taskdefs/Rmic.java
  17. +3
    -21
      proposal/myrmidon/src/todo/org/apache/tools/ant/taskdefs/SQLExec.java
  18. +1
    -1
      proposal/myrmidon/src/todo/org/apache/tools/ant/taskdefs/optional/ejb/BorlandGenerateClient.java
  19. +1
    -1
      proposal/myrmidon/src/todo/org/apache/tools/ant/taskdefs/optional/jsp/WLJspc.java
  20. +1
    -1
      proposal/myrmidon/src/todo/org/apache/tools/ant/taskdefs/optional/jsp/compilers/JasperC.java

+ 20
- 26
proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/Available.java View File

@@ -48,10 +48,20 @@ public class Available
} }
} }


public void setClasspath( Path classpath )
/**
* Adds a classpath element.
*/
public void addClasspath( Path classpath )
throws TaskException throws TaskException
{ {
createClasspath().append( classpath );
if ( m_classpath == null )
{
m_classpath = classpath;
}
else
{
m_classpath.addPath(classpath);
}
} }


public void setFile( String file ) public void setFile( String file )
@@ -59,12 +69,6 @@ public class Available
m_file = file; m_file = file;
} }


public void setFilepath( Path filepath )
throws TaskException
{
createFilepath().append( filepath );
}

public void setProperty( String property ) public void setProperty( String property )
{ {
m_property = property; m_property = property;
@@ -85,30 +89,20 @@ public class Available
m_value = value; m_value = value;
} }


public Path createClasspath()
/**
* Adds a file search path element.
*/
public void addFilepath( Path path )
throws TaskException 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() public boolean eval()


+ 3
- 15
proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/Java.java View File

@@ -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 throws TaskException
{ {
createClasspath().append( classpath );
m_cmdl.createClasspath().addPath( classpath );
} }


/** /**
@@ -111,18 +111,6 @@ public class Java
return m_cmdl.createArgument(); 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. * Creates a nested jvmarg element.
*/ */


+ 14
- 84
proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/Javac.java View File

@@ -88,11 +88,12 @@ public class Javac extends MatchingTask
private String target; 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 * @param bootclasspath The new Bootclasspath value
*/ */
public void setBootclasspath( Path bootclasspath )
public void addBootclasspath( Path bootclasspath )
throws TaskException throws TaskException
{ {
if( this.bootclasspath == null ) if( this.bootclasspath == null )
@@ -101,16 +102,16 @@ public class Javac extends MatchingTask
} }
else 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 * @param classpath The new Classpath value
*/ */
public void setClasspath( Path classpath )
public void addClasspath( Path classpath )
throws TaskException throws TaskException
{ {
if( compileClasspath == null ) if( compileClasspath == null )
@@ -119,7 +120,7 @@ public class Javac extends MatchingTask
} }
else 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 * @param extdirs The new Extdirs value
*/ */
public void setExtdirs( Path extdirs )
public void addExtdirs( Path extdirs )
throws TaskException throws TaskException
{ {
if( this.extdirs == null ) if( this.extdirs == null )
@@ -198,7 +200,7 @@ public class Javac extends MatchingTask
} }
else 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 * @param srcDir The new Srcdir value
*/ */
public void setSrcdir( Path srcDir )
public void addSrcdir( Path srcDir )
throws TaskException throws TaskException
{ {
if( src == null ) if( src == null )
@@ -335,7 +337,7 @@ public class Javac extends MatchingTask
} }
else else
{ {
src.append( srcDir );
src.addPath( srcDir );
} }
} }


@@ -630,42 +632,6 @@ public class Javac extends MatchingTask
"extJavac".equals( getProperty( "build.compiler" ) ); "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. * Adds an implementation specific command line argument.
* *
@@ -679,42 +645,6 @@ public class Javac extends MatchingTask
return arg; 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. * Executes the task.
* *


+ 7
- 7
proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/PathConvert.java View File

@@ -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 throws TaskException
{ {
if( m_path == null ) 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() public void execute()


+ 2
- 15
proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/Property.java View File

@@ -35,7 +35,7 @@ public class Property
private String m_resource; private String m_resource;
private String m_value; private String m_value;


public void setClasspath( Path classpath )
public void addClasspath( Path classpath )
throws TaskException throws TaskException
{ {
if( m_classpath == null ) if( m_classpath == null )
@@ -44,7 +44,7 @@ public class Property
} }
else else
{ {
m_classpath.append( classpath );
m_classpath.addPath( classpath );
} }
} }


@@ -68,19 +68,6 @@ public class Property
m_value = value; 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() public void execute()
throws TaskException throws TaskException
{ {


+ 7
- 42
proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/Rmic.java View File

@@ -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 * @param classpath The new Classpath value
*/ */
public void setClasspath( Path classpath )
public void addClasspath( Path classpath )
throws TaskException throws TaskException
{ {
if( compileClasspath == null ) if( compileClasspath == null )
@@ -115,7 +115,7 @@ public class Rmic extends MatchingTask
} }
else 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 * @param extdirs The new Extdirs value
*/ */
public void setExtdirs( Path extdirs )
public void addExtdirs( Path extdirs )
throws TaskException throws TaskException
{ {
if( this.extdirs == null ) if( this.extdirs == null )
@@ -143,7 +144,7 @@ public class Rmic extends MatchingTask
} }
else else
{ {
this.extdirs.append( extdirs );
this.extdirs.addPath( extdirs );
} }
} }


@@ -459,42 +460,6 @@ public class Rmic extends MatchingTask
return false; 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() public void execute()
throws TaskException throws TaskException
{ {


+ 3
- 21
proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/SQLExec.java View File

@@ -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 * @param classpath The new Classpath value
*/ */
public void setClasspath( Path classpath )
public void addClasspath( Path classpath )
throws TaskException throws TaskException
{ {
if( this.classpath == null ) if( this.classpath == null )
@@ -175,7 +175,7 @@ public class SQLExec
} }
else else
{ {
this.classpath.append( classpath );
this.classpath.addPath( classpath );
} }
} }


@@ -345,24 +345,6 @@ public class SQLExec
this.sqlCommand += sql; 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 * Set the sql command to execute
* *


+ 1
- 1
proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/ejb/BorlandGenerateClient.java View File

@@ -215,7 +215,7 @@ public class BorlandGenerateClient extends Task
//classpath //classpath
//add at the end of the classpath //add at the end of the classpath
//the system classpath in order to find the tools.jar file //the system classpath in order to find the tools.jar file
execTask.setClasspath( classpath.concatSystemClasspath() );
execTask.addClasspath( classpath.concatSystemClasspath() );


execTask.setFork( true ); execTask.setFork( true );
execTask.createArg().setValue( "generateclient" ); execTask.createArg().setValue( "generateclient" );


+ 1
- 1
proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/jsp/WLJspc.java View File

@@ -229,7 +229,7 @@ public class WLJspc extends MatchingTask


//helperTask.clearArgs(); //helperTask.clearArgs();
helperTask.createArg().setValue( arg ); helperTask.createArg().setValue( arg );
helperTask.setClasspath( compileClasspath );
helperTask.addClasspath( compileClasspath );
if( helperTask.executeJava() != 0 ) if( helperTask.executeJava() != 0 )
{ {
getLogger().warn( files[ i ] + " failed to compile" ); getLogger().warn( files[ i ] + " failed to compile" );


+ 1
- 1
proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/jsp/compilers/JasperC.java View File

@@ -37,7 +37,7 @@ public class JasperC
//FIXME //FIXME
Java java = null;//(Java)( getJspc().getProject() ).createTask( "java" ); Java java = null;//(Java)( getJspc().getProject() ).createTask( "java" );
if( getJspc().getClasspath() != null ) if( getJspc().getClasspath() != null )
java.setClasspath( getJspc().getClasspath() );
java.addClasspath( getJspc().getClasspath() );
java.setClassname( "org.apache.jasper.JspC" ); java.setClassname( "org.apache.jasper.JspC" );
String args[] = cmd.getArguments(); String args[] = cmd.getArguments();
for( int i = 0; i < args.length; i++ ) for( int i = 0; i < args.length; i++ )


+ 20
- 26
proposal/myrmidon/src/todo/org/apache/tools/ant/taskdefs/Available.java View File

@@ -48,10 +48,20 @@ public class Available
} }
} }


public void setClasspath( Path classpath )
/**
* Adds a classpath element.
*/
public void addClasspath( Path classpath )
throws TaskException throws TaskException
{ {
createClasspath().append( classpath );
if ( m_classpath == null )
{
m_classpath = classpath;
}
else
{
m_classpath.addPath(classpath);
}
} }


public void setFile( String file ) public void setFile( String file )
@@ -59,12 +69,6 @@ public class Available
m_file = file; m_file = file;
} }


public void setFilepath( Path filepath )
throws TaskException
{
createFilepath().append( filepath );
}

public void setProperty( String property ) public void setProperty( String property )
{ {
m_property = property; m_property = property;
@@ -85,30 +89,20 @@ public class Available
m_value = value; m_value = value;
} }


public Path createClasspath()
/**
* Adds a file search path element.
*/
public void addFilepath( Path path )
throws TaskException 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() public boolean eval()


+ 3
- 15
proposal/myrmidon/src/todo/org/apache/tools/ant/taskdefs/Java.java View File

@@ -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 throws TaskException
{ {
createClasspath().append( classpath );
m_cmdl.createClasspath().addPath( classpath );
} }


/** /**
@@ -111,18 +111,6 @@ public class Java
return m_cmdl.createArgument(); 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. * Creates a nested jvmarg element.
*/ */


+ 14
- 84
proposal/myrmidon/src/todo/org/apache/tools/ant/taskdefs/Javac.java View File

@@ -88,11 +88,12 @@ public class Javac extends MatchingTask
private String target; 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 * @param bootclasspath The new Bootclasspath value
*/ */
public void setBootclasspath( Path bootclasspath )
public void addBootclasspath( Path bootclasspath )
throws TaskException throws TaskException
{ {
if( this.bootclasspath == null ) if( this.bootclasspath == null )
@@ -101,16 +102,16 @@ public class Javac extends MatchingTask
} }
else 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 * @param classpath The new Classpath value
*/ */
public void setClasspath( Path classpath )
public void addClasspath( Path classpath )
throws TaskException throws TaskException
{ {
if( compileClasspath == null ) if( compileClasspath == null )
@@ -119,7 +120,7 @@ public class Javac extends MatchingTask
} }
else 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 * @param extdirs The new Extdirs value
*/ */
public void setExtdirs( Path extdirs )
public void addExtdirs( Path extdirs )
throws TaskException throws TaskException
{ {
if( this.extdirs == null ) if( this.extdirs == null )
@@ -198,7 +200,7 @@ public class Javac extends MatchingTask
} }
else 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 * @param srcDir The new Srcdir value
*/ */
public void setSrcdir( Path srcDir )
public void addSrcdir( Path srcDir )
throws TaskException throws TaskException
{ {
if( src == null ) if( src == null )
@@ -335,7 +337,7 @@ public class Javac extends MatchingTask
} }
else else
{ {
src.append( srcDir );
src.addPath( srcDir );
} }
} }


@@ -630,42 +632,6 @@ public class Javac extends MatchingTask
"extJavac".equals( getProperty( "build.compiler" ) ); "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. * Adds an implementation specific command line argument.
* *
@@ -679,42 +645,6 @@ public class Javac extends MatchingTask
return arg; 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. * Executes the task.
* *


+ 7
- 7
proposal/myrmidon/src/todo/org/apache/tools/ant/taskdefs/PathConvert.java View File

@@ -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 throws TaskException
{ {
if( m_path == null ) 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() public void execute()


+ 2
- 15
proposal/myrmidon/src/todo/org/apache/tools/ant/taskdefs/Property.java View File

@@ -35,7 +35,7 @@ public class Property
private String m_resource; private String m_resource;
private String m_value; private String m_value;


public void setClasspath( Path classpath )
public void addClasspath( Path classpath )
throws TaskException throws TaskException
{ {
if( m_classpath == null ) if( m_classpath == null )
@@ -44,7 +44,7 @@ public class Property
} }
else else
{ {
m_classpath.append( classpath );
m_classpath.addPath( classpath );
} }
} }


@@ -68,19 +68,6 @@ public class Property
m_value = value; 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() public void execute()
throws TaskException throws TaskException
{ {


+ 7
- 42
proposal/myrmidon/src/todo/org/apache/tools/ant/taskdefs/Rmic.java View File

@@ -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 * @param classpath The new Classpath value
*/ */
public void setClasspath( Path classpath )
public void addClasspath( Path classpath )
throws TaskException throws TaskException
{ {
if( compileClasspath == null ) if( compileClasspath == null )
@@ -115,7 +115,7 @@ public class Rmic extends MatchingTask
} }
else 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 * @param extdirs The new Extdirs value
*/ */
public void setExtdirs( Path extdirs )
public void addExtdirs( Path extdirs )
throws TaskException throws TaskException
{ {
if( this.extdirs == null ) if( this.extdirs == null )
@@ -143,7 +144,7 @@ public class Rmic extends MatchingTask
} }
else else
{ {
this.extdirs.append( extdirs );
this.extdirs.addPath( extdirs );
} }
} }


@@ -459,42 +460,6 @@ public class Rmic extends MatchingTask
return false; 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() public void execute()
throws TaskException throws TaskException
{ {


+ 3
- 21
proposal/myrmidon/src/todo/org/apache/tools/ant/taskdefs/SQLExec.java View File

@@ -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 * @param classpath The new Classpath value
*/ */
public void setClasspath( Path classpath )
public void addClasspath( Path classpath )
throws TaskException throws TaskException
{ {
if( this.classpath == null ) if( this.classpath == null )
@@ -175,7 +175,7 @@ public class SQLExec
} }
else else
{ {
this.classpath.append( classpath );
this.classpath.addPath( classpath );
} }
} }


@@ -345,24 +345,6 @@ public class SQLExec
this.sqlCommand += sql; 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 * Set the sql command to execute
* *


+ 1
- 1
proposal/myrmidon/src/todo/org/apache/tools/ant/taskdefs/optional/ejb/BorlandGenerateClient.java View File

@@ -215,7 +215,7 @@ public class BorlandGenerateClient extends Task
//classpath //classpath
//add at the end of the classpath //add at the end of the classpath
//the system classpath in order to find the tools.jar file //the system classpath in order to find the tools.jar file
execTask.setClasspath( classpath.concatSystemClasspath() );
execTask.addClasspath( classpath.concatSystemClasspath() );


execTask.setFork( true ); execTask.setFork( true );
execTask.createArg().setValue( "generateclient" ); execTask.createArg().setValue( "generateclient" );


+ 1
- 1
proposal/myrmidon/src/todo/org/apache/tools/ant/taskdefs/optional/jsp/WLJspc.java View File

@@ -229,7 +229,7 @@ public class WLJspc extends MatchingTask


//helperTask.clearArgs(); //helperTask.clearArgs();
helperTask.createArg().setValue( arg ); helperTask.createArg().setValue( arg );
helperTask.setClasspath( compileClasspath );
helperTask.addClasspath( compileClasspath );
if( helperTask.executeJava() != 0 ) if( helperTask.executeJava() != 0 )
{ {
getLogger().warn( files[ i ] + " failed to compile" ); getLogger().warn( files[ i ] + " failed to compile" );


+ 1
- 1
proposal/myrmidon/src/todo/org/apache/tools/ant/taskdefs/optional/jsp/compilers/JasperC.java View File

@@ -37,7 +37,7 @@ public class JasperC
//FIXME //FIXME
Java java = null;//(Java)( getJspc().getProject() ).createTask( "java" ); Java java = null;//(Java)( getJspc().getProject() ).createTask( "java" );
if( getJspc().getClasspath() != null ) if( getJspc().getClasspath() != null )
java.setClasspath( getJspc().getClasspath() );
java.addClasspath( getJspc().getClasspath() );
java.setClassname( "org.apache.jasper.JspC" ); java.setClassname( "org.apache.jasper.JspC" );
String args[] = cmd.getArguments(); String args[] = cmd.getArguments();
for( int i = 0; i < args.length; i++ ) for( int i = 0; i < args.length; i++ )


Loading…
Cancel
Save