donaldp 01/12/15 16:38:31
Modified:
proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/compilers
CompilerAdapter.java CompilerAdapterFactory.java
DefaultCompilerAdapter.java Gcj.java Javac12.java
Javac13.java JavacExternal.java Jikes.java Jvc.java
Kjc.java Sj.java
proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/condition
And.java Condition.java ConditionBase.java
Equals.java Http.java IsSet.java Not.java Or.java
Socket.java
proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/rmic
DefaultRmicAdapter.java KaffeRmic.java
RmicAdapter.java RmicAdapterFactory.java
SunRmic.java WLRmic.java
Log:
BuildException -> TaskException
Removed uneeded imports.
Processed code through style formatter.
Revision Changes Path
1.2 +4 -3
jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/compilers/CompilerAdapter.java
Index: CompilerAdapter.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/compilers/CompilerAdapter.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- CompilerAdapter.java 2001/12/15 12:06:24 1.1
+++ CompilerAdapter.java 2001/12/16 00:38:30 1.2
@@ -6,7 +6,8 @@
* the LICENSE file.
*/
package org.apache.tools.ant.taskdefs.compilers;
-import org.apache.tools.ant.BuildException;
+
+import org.apache.myrmidon.api.TaskException;
import org.apache.tools.ant.taskdefs.Javac;
/**
@@ -36,8 +37,8 @@
* Executes the task.
*
* @return has the compilation been successful
- * @exception BuildException Description of Exception
+ * @exception TaskException Description of Exception
*/
boolean execute()
- throws BuildException;
+ throws TaskException;
}
1.2 +16 -13
jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/compilers/CompilerAdapterFactory.java
Index: CompilerAdapterFactory.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/compilers/CompilerAdapterFactory.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- CompilerAdapterFactory.java 2001/12/15 12:06:24 1.1
+++ CompilerAdapterFactory.java 2001/12/16 00:38:30 1.2
@@ -6,7 +6,8 @@
* the LICENSE file.
*/
package org.apache.tools.ant.taskdefs.compilers;
-import org.apache.tools.ant.BuildException;
+
+import org.apache.myrmidon.api.TaskException;
import org.apache.tools.ant.Project;
import org.apache.tools.ant.Task;
@@ -21,7 +22,9 @@
/**
* This is a singlton -- can't create instances!!
*/
- private CompilerAdapterFactory() { }
+ private CompilerAdapterFactory()
+ {
+ }
/**
* Based on the parameter passed in, this method creates the necessary
@@ -45,11 +48,11 @@
* classname of the compiler's adapter.
* @param task a task to log through.
* @return The Compiler value
- * @throws BuildException if the compiler type could not be resolved
into a
+ * @throws TaskException if the compiler type could not be resolved into
a
* compiler adapter.
*/
public static CompilerAdapter getCompiler( String compilerType, Task
task )
- throws BuildException
+ throws TaskException
{
/*
* If I've done things right, this should be the extent of the
@@ -81,7 +84,7 @@
catch( ClassNotFoundException cnfe )
{
task.log( "Modern compiler is not available - using "
- + "classic compiler", Project.MSG_WARN );
+ + "classic compiler", Project.MSG_WARN );
return new Javac12();
}
return new Javac13();
@@ -113,32 +116,32 @@
*
* @param className The fully qualified classname to be created.
* @return Description of the Returned Value
- * @throws BuildException This is the fit that is thrown if className
isn't
+ * @throws TaskException This is the fit that is thrown if className
isn't
* an instance of CompilerAdapter.
*/
private static CompilerAdapter resolveClassName( String className )
- throws BuildException
+ throws TaskException
{
try
{
Class c = Class.forName( className );
Object o = c.newInstance();
- return ( CompilerAdapter )o;
+ return (CompilerAdapter)o;
}
catch( ClassNotFoundException cnfe )
{
- throw new BuildException( className + " can\'t be found.", cnfe
);
+ throw new TaskException( className + " can\'t be found.", cnfe );
}
catch( ClassCastException cce )
{
- throw new BuildException( className + " isn\'t the classname of "
- + "a compiler adapter.", cce );
+ throw new TaskException( className + " isn\'t the classname of "
+ + "a compiler adapter.", cce );
}
catch( Throwable t )
{
// for all other possibilities
- throw new BuildException( className + " caused an interesting "
- + "exception.", t );
+ throw new TaskException( className + " caused an interesting "
+ + "exception.", t );
}
}
1.3 +19 -18
jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/compilers/DefaultCompilerAdapter.java
Index: DefaultCompilerAdapter.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/compilers/DefaultCompilerAdapter.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- DefaultCompilerAdapter.java 2001/12/15 14:55:57 1.2
+++ DefaultCompilerAdapter.java 2001/12/16 00:38:30 1.3
@@ -6,18 +6,18 @@
* the LICENSE file.
*/
package org.apache.tools.ant.taskdefs.compilers;
+
import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
import java.io.PrintWriter;
-import org.apache.tools.ant.BuildException;
+import org.apache.myrmidon.api.TaskException;
import org.apache.tools.ant.Location;
import org.apache.tools.ant.Project;
import org.apache.tools.ant.taskdefs.Execute;
import org.apache.tools.ant.taskdefs.Javac;
import org.apache.tools.ant.taskdefs.LogStreamHandler;
import org.apache.tools.ant.types.Commandline;
-import org.apache.tools.ant.types.FileSet;
import org.apache.tools.ant.types.Path;
import org.apache.tools.ant.util.FileUtils;
@@ -140,7 +140,7 @@
if( !attributes.isForkedJavac() )
{
attributes.log( "Since fork is false, ignoring
memoryInitialSize setting.",
- Project.MSG_WARN );
+ Project.MSG_WARN );
}
else
{
@@ -153,7 +153,7 @@
if( !attributes.isForkedJavac() )
{
attributes.log( "Since fork is false, ignoring
memoryMaximumSize setting.",
- Project.MSG_WARN );
+ Project.MSG_WARN );
}
else
{
@@ -229,8 +229,8 @@
if( debug )
{
if( useDebugLevel
- && Project.getJavaVersion() != Project.JAVA_1_0
- && Project.getJavaVersion() != Project.JAVA_1_1 )
+ && Project.getJavaVersion() != Project.JAVA_1_0
+ && Project.getJavaVersion() != Project.JAVA_1_1 )
{
String debugLevel = attributes.getDebugLevel();
@@ -271,7 +271,7 @@
else
{
attributes.log( "depend attribute is not supported by the
modern compiler",
- Project.MSG_WARN );
+ Project.MSG_WARN );
}
}
@@ -405,16 +405,16 @@
out = new PrintWriter( new FileWriter( tmpFile ) );
for( int i = firstFileName; i < args.length; i++ )
{
- out.println( args[i] );
+ out.println( args[ i ] );
}
out.flush();
- commandArray = new String[firstFileName + 1];
+ commandArray = new String[ firstFileName + 1 ];
System.arraycopy( args, 0, commandArray, 0,
firstFileName );
- commandArray[firstFileName] = "@" +
tmpFile.getAbsolutePath();
+ commandArray[ firstFileName ] = "@" +
tmpFile.getAbsolutePath();
}
catch( IOException e )
{
- throw new BuildException( "Error creating temporary
file", e );
+ throw new TaskException( "Error creating temporary
file", e );
}
finally
{
@@ -425,7 +425,8 @@
out.close();
}
catch( Throwable t )
- {}
+ {
+ }
}
}
}
@@ -437,8 +438,8 @@
try
{
Execute exe = new Execute( new LogStreamHandler( attributes,
- Project.MSG_INFO,
- Project.MSG_WARN ) );
+
Project.MSG_INFO,
+
Project.MSG_WARN ) );
exe.setAntRun( project );
exe.setWorkingDirectory( project.getBaseDir() );
exe.setCommandline( commandArray );
@@ -447,8 +448,8 @@
}
catch( IOException e )
{
- throw new BuildException( "Error running " + args[0]
- + " compiler", e );
+ throw new TaskException( "Error running " + args[ 0 ]
+ + " compiler", e );
}
}
finally
@@ -469,7 +470,7 @@
protected void logAndAddFilesToCompile( Commandline cmd )
{
attributes.log( "Compilation args: " + cmd.toString(),
- Project.MSG_VERBOSE );
+ Project.MSG_VERBOSE );
StringBuffer niceSourceList = new StringBuffer( "File" );
if( compileList.length != 1 )
@@ -482,7 +483,7 @@
for( int i = 0; i < compileList.length; i++ )
{
- String arg = compileList[i].getAbsolutePath();
+ String arg = compileList[ i ].getAbsolutePath();
cmd.createArgument().setValue( arg );
niceSourceList.append( " " + arg + lSep );
}
1.2 +5 -4
jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/compilers/Gcj.java
Index: Gcj.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/compilers/Gcj.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- Gcj.java 2001/12/15 12:06:24 1.1
+++ Gcj.java 2001/12/16 00:38:30 1.2
@@ -6,7 +6,8 @@
* the LICENSE file.
*/
package org.apache.tools.ant.taskdefs.compilers;
-import org.apache.tools.ant.BuildException;
+
+import org.apache.myrmidon.api.TaskException;
import org.apache.tools.ant.Project;
import org.apache.tools.ant.types.Commandline;
import org.apache.tools.ant.types.Path;
@@ -24,11 +25,11 @@
* Performs a compile using the gcj compiler.
*
* @return Description of the Returned Value
- * @exception BuildException Description of Exception
+ * @exception TaskException Description of Exception
* @author [EMAIL PROTECTED]
*/
public boolean execute()
- throws BuildException
+ throws TaskException
{
Commandline cmd;
attributes.log( "Using gcj compiler", Project.MSG_VERBOSE );
@@ -76,7 +77,7 @@
if( destDir.mkdirs() )
{
- throw new BuildException( "Can't make output directories.
Maybe permission is wrong. " );
+ throw new TaskException( "Can't make output directories.
Maybe permission is wrong. " );
}
;
}
1.3 +11 -10
jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/compilers/Javac12.java
Index: Javac12.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/compilers/Javac12.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- Javac12.java 2001/12/15 14:55:57 1.2
+++ Javac12.java 2001/12/16 00:38:30 1.3
@@ -6,11 +6,12 @@
* the LICENSE file.
*/
package org.apache.tools.ant.taskdefs.compilers;
+
import java.io.IOException;
import java.io.OutputStream;
import java.lang.reflect.Constructor;
import java.lang.reflect.Method;
-import org.apache.tools.ant.BuildException;
+import org.apache.myrmidon.api.TaskException;
import org.apache.tools.ant.Project;
import org.apache.tools.ant.taskdefs.LogOutputStream;
import org.apache.tools.ant.types.Commandline;
@@ -29,7 +30,7 @@
{
public boolean execute()
- throws BuildException
+ throws TaskException
{
attributes.log( "Using classic compiler", Project.MSG_VERBOSE );
Commandline cmd = setupJavacCommand( true );
@@ -45,24 +46,24 @@
// Call the compile() method
Method compile = c.getMethod( "compile", new
Class[]{String[].class} );
- Boolean ok = ( Boolean )compile.invoke( compiler, new
Object[]{cmd.getArguments()} );
+ Boolean ok = (Boolean)compile.invoke( compiler, new
Object[]{cmd.getArguments()} );
return ok.booleanValue();
}
catch( ClassNotFoundException ex )
{
- throw new BuildException( "Cannot use classic compiler, as it is
not available" +
- " A common solution is to set the environment variable" +
- " JAVA_HOME to your jdk directory." );
+ throw new TaskException( "Cannot use classic compiler, as it is
not available" +
+ " A common solution is to set the
environment variable" +
+ " JAVA_HOME to your jdk directory." );
}
catch( Exception ex )
{
- if( ex instanceof BuildException )
+ if( ex instanceof TaskException )
{
- throw ( BuildException )ex;
+ throw (TaskException)ex;
}
else
{
- throw new BuildException( "Error starting classic compiler:
", ex );
+ throw new TaskException( "Error starting classic compiler:
", ex );
}
}
finally
@@ -74,7 +75,7 @@
catch( IOException e )
{
// plain impossible
- throw new BuildException( "Error", e );
+ throw new TaskException( "Error", e );
}
}
}
1.3 +8 -8
jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/compilers/Javac13.java
Index: Javac13.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/compilers/Javac13.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- Javac13.java 2001/12/15 14:55:57 1.2
+++ Javac13.java 2001/12/16 00:38:30 1.3
@@ -6,12 +6,12 @@
* the LICENSE file.
*/
package org.apache.tools.ant.taskdefs.compilers;
+
import java.lang.reflect.Method;
-import org.apache.tools.ant.BuildException;
+import org.apache.myrmidon.api.TaskException;
import org.apache.tools.ant.Project;
import org.apache.tools.ant.types.Commandline;
-
/**
* The implementation of the javac compiler for JDK 1.3 This is primarily a
* cut-and-paste from the original javac task before it was refactored.
@@ -31,7 +31,7 @@
private final static int MODERN_COMPILER_SUCCESS = 0;
public boolean execute()
- throws BuildException
+ throws TaskException
{
attributes.log( "Using modern compiler", Project.MSG_VERBOSE );
Commandline cmd = setupModernJavacCommand();
@@ -42,20 +42,20 @@
Class c = Class.forName( "com.sun.tools.javac.Main" );
Object compiler = c.newInstance();
Method compile = c.getMethod( "compile",
- new Class[]{( new String[]{} ).getClass()} );
- int result = ( ( Integer )compile.invoke
+ new Class[]{( new String[]{}
).getClass()} );
+ int result = ( (Integer)compile.invoke
( compiler, new Object[]{cmd.getArguments()} ) ).intValue();
return ( result == MODERN_COMPILER_SUCCESS );
}
catch( Exception ex )
{
- if( ex instanceof BuildException )
+ if( ex instanceof TaskException )
{
- throw ( BuildException )ex;
+ throw (TaskException)ex;
}
else
{
- throw new BuildException( "Error starting modern compiler",
ex );
+ throw new TaskException( "Error starting modern compiler",
ex );
}
}
}
1.2 +4 -3
jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/compilers/JavacExternal.java
Index: JavacExternal.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/compilers/JavacExternal.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- JavacExternal.java 2001/12/15 12:06:24 1.1
+++ JavacExternal.java 2001/12/16 00:38:30 1.2
@@ -6,7 +6,8 @@
* the LICENSE file.
*/
package org.apache.tools.ant.taskdefs.compilers;
-import org.apache.tools.ant.BuildException;
+
+import org.apache.myrmidon.api.TaskException;
import org.apache.tools.ant.Project;
import org.apache.tools.ant.types.Commandline;
@@ -22,10 +23,10 @@
* Performs a compile using the Javac externally.
*
* @return Description of the Returned Value
- * @exception BuildException Description of Exception
+ * @exception TaskException Description of Exception
*/
public boolean execute()
- throws BuildException
+ throws TaskException
{
attributes.log( "Using external javac compiler", Project.MSG_VERBOSE
);
1.3 +4 -3
jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/compilers/Jikes.java
Index: Jikes.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/compilers/Jikes.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- Jikes.java 2001/12/15 14:55:57 1.2
+++ Jikes.java 2001/12/16 00:38:30 1.3
@@ -6,7 +6,8 @@
* the LICENSE file.
*/
package org.apache.tools.ant.taskdefs.compilers;
-import org.apache.tools.ant.BuildException;
+
+import org.apache.myrmidon.api.TaskException;
import org.apache.tools.ant.Project;
import org.apache.tools.ant.types.Commandline;
import org.apache.tools.ant.types.Path;
@@ -32,11 +33,11 @@
* been successfully tested with jikes >1.10
*
* @return Description of the Returned Value
- * @exception BuildException Description of Exception
+ * @exception TaskException Description of Exception
* @author [EMAIL PROTECTED]
*/
public boolean execute()
- throws BuildException
+ throws TaskException
{
attributes.log( "Using jikes compiler", Project.MSG_VERBOSE );
1.2 +3 -2
jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/compilers/Jvc.java
Index: Jvc.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/compilers/Jvc.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- Jvc.java 2001/12/15 12:06:24 1.1
+++ Jvc.java 2001/12/16 00:38:30 1.2
@@ -6,7 +6,8 @@
* the LICENSE file.
*/
package org.apache.tools.ant.taskdefs.compilers;
-import org.apache.tools.ant.BuildException;
+
+import org.apache.myrmidon.api.TaskException;
import org.apache.tools.ant.Project;
import org.apache.tools.ant.types.Commandline;
import org.apache.tools.ant.types.Path;
@@ -25,7 +26,7 @@
{
public boolean execute()
- throws BuildException
+ throws TaskException
{
attributes.log( "Using jvc compiler", Project.MSG_VERBOSE );
1.3 +12 -11
jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/compilers/Kjc.java
Index: Kjc.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/compilers/Kjc.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- Kjc.java 2001/12/15 14:55:57 1.2
+++ Kjc.java 2001/12/16 00:38:30 1.3
@@ -6,8 +6,9 @@
* the LICENSE file.
*/
package org.apache.tools.ant.taskdefs.compilers;
+
import java.lang.reflect.Method;
-import org.apache.tools.ant.BuildException;
+import org.apache.myrmidon.api.TaskException;
import org.apache.tools.ant.Project;
import org.apache.tools.ant.types.Commandline;
import org.apache.tools.ant.types.Path;
@@ -22,7 +23,7 @@
{
public boolean execute()
- throws BuildException
+ throws TaskException
{
attributes.log( "Using kjc compiler", Project.MSG_VERBOSE );
Commandline cmd = setupKjcCommand();
@@ -33,26 +34,26 @@
// Call the compile() method
Method compile = c.getMethod( "compile",
- new Class[]{String[].class} );
- Boolean ok = ( Boolean )compile.invoke( null,
- new Object[]{cmd.getArguments()} );
+ new Class[]{String[].class} );
+ Boolean ok = (Boolean)compile.invoke( null,
+ new
Object[]{cmd.getArguments()} );
return ok.booleanValue();
}
catch( ClassNotFoundException ex )
{
- throw new BuildException( "Cannot use kjc compiler, as it is not
available" +
- " A common solution is to set the environment variable" +
- " CLASSPATH to your kjc archive (kjc.jar)." );
+ throw new TaskException( "Cannot use kjc compiler, as it is not
available" +
+ " A common solution is to set the
environment variable" +
+ " CLASSPATH to your kjc archive
(kjc.jar)." );
}
catch( Exception ex )
{
- if( ex instanceof BuildException )
+ if( ex instanceof TaskException )
{
- throw ( BuildException )ex;
+ throw (TaskException)ex;
}
else
{
- throw new BuildException( "Error starting kjc compiler: ",
ex );
+ throw new TaskException( "Error starting kjc compiler: ", ex
);
}
}
}
1.2 +4 -3
jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/compilers/Sj.java
Index: Sj.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/compilers/Sj.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- Sj.java 2001/12/15 12:06:24 1.1
+++ Sj.java 2001/12/16 00:38:30 1.2
@@ -6,7 +6,8 @@
* the LICENSE file.
*/
package org.apache.tools.ant.taskdefs.compilers;
-import org.apache.tools.ant.BuildException;
+
+import org.apache.myrmidon.api.TaskException;
import org.apache.tools.ant.Project;
import org.apache.tools.ant.types.Commandline;
@@ -23,11 +24,11 @@
* Performs a compile using the sj compiler from Symantec.
*
* @return Description of the Returned Value
- * @exception BuildException Description of Exception
+ * @exception TaskException Description of Exception
* @author [EMAIL PROTECTED]
*/
public boolean execute()
- throws BuildException
+ throws TaskException
{
attributes.log( "Using symantec java compiler", Project.MSG_VERBOSE
);
1.2 +5 -4
jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/condition/And.java
Index: And.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/condition/And.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- And.java 2001/12/15 12:06:24 1.1
+++ And.java 2001/12/16 00:38:31 1.2
@@ -6,8 +6,9 @@
* the LICENSE file.
*/
package org.apache.tools.ant.taskdefs.condition;
+
import java.util.Enumeration;
-import org.apache.tools.ant.BuildException;
+import org.apache.myrmidon.api.TaskException;
/**
* <and> condition container. <p>
@@ -16,18 +17,18 @@
* false.</p>
*
* @author <a href="mailto:[EMAIL PROTECTED]">Stefan Bodewig</a>
- * @version $Revision: 1.1 $
+ * @version $Revision: 1.2 $
*/
public class And extends ConditionBase implements Condition
{
public boolean eval()
- throws BuildException
+ throws TaskException
{
Enumeration enum = getConditions();
while( enum.hasMoreElements() )
{
- Condition c = ( Condition )enum.nextElement();
+ Condition c = (Condition)enum.nextElement();
if( !c.eval() )
{
return false;
1.2 +2 -2
jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/condition/Condition.java
Index: Condition.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/condition/Condition.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- Condition.java 2001/12/15 12:06:24 1.1
+++ Condition.java 2001/12/16 00:38:31 1.2
@@ -13,7 +13,7 @@
* Interface for conditions to use inside the <condition> task.
*
* @author <a href="mailto:[EMAIL PROTECTED]">Stefan Bodewig</a>
- * @version $Revision: 1.1 $
+ * @version $Revision: 1.2 $
*/
public interface Condition
{
@@ -21,7 +21,7 @@
* Is this condition true?
*
* @return Description of the Returned Value
- * @exception BuildException Description of Exception
+ * @exception TaskException Description of Exception
*/
boolean eval()
throws TaskException;
1.2 +4 -3
jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/condition/ConditionBase.java
Index: ConditionBase.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/condition/ConditionBase.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- ConditionBase.java 2001/12/15 12:06:24 1.1
+++ ConditionBase.java 2001/12/16 00:38:31 1.2
@@ -6,14 +6,15 @@
* the LICENSE file.
*/
package org.apache.tools.ant.taskdefs.condition;
+
import java.util.Enumeration;
import java.util.NoSuchElementException;
import java.util.Vector;
+import org.apache.myrmidon.framework.Os;
import org.apache.tools.ant.ProjectComponent;
import org.apache.tools.ant.taskdefs.Available;
import org.apache.tools.ant.taskdefs.Checksum;
import org.apache.tools.ant.taskdefs.UpToDate;
-import org.apache.myrmidon.framework.Os;
/**
* Baseclass for the <condition> task as well as several conditions -
@@ -21,7 +22,7 @@
* conditions are in sync.
*
* @author <a href="mailto:[EMAIL PROTECTED]">Stefan Bodewig</a>
- * @version $Revision: 1.1 $
+ * @version $Revision: 1.2 $
*/
public abstract class ConditionBase extends ProjectComponent
{
@@ -201,7 +202,7 @@
if( o instanceof ProjectComponent )
{
- ( ( ProjectComponent )o ).setProject( getProject() );
+ ( (ProjectComponent)o ).setProject( getProject() );
}
return o;
}
1.2 +5 -4
jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/condition/Equals.java
Index: Equals.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/condition/Equals.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- Equals.java 2001/12/15 12:06:24 1.1
+++ Equals.java 2001/12/16 00:38:31 1.2
@@ -6,13 +6,14 @@
* the LICENSE file.
*/
package org.apache.tools.ant.taskdefs.condition;
-import org.apache.tools.ant.BuildException;
+import org.apache.myrmidon.api.TaskException;
+
/**
* Simple String comparison condition.
*
* @author <a href="mailto:[EMAIL PROTECTED]">Stefan Bodewig</a>
- * @version $Revision: 1.1 $
+ * @version $Revision: 1.2 $
*/
public class Equals implements Condition
{
@@ -30,11 +31,11 @@
}
public boolean eval()
- throws BuildException
+ throws TaskException
{
if( arg1 == null || arg2 == null )
{
- throw new BuildException( "both arg1 and arg2 are required in
equals" );
+ throw new TaskException( "both arg1 and arg2 are required in
equals" );
}
return arg1.equals( arg2 );
}
1.2 +6 -6
jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/condition/Http.java
Index: Http.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/condition/Http.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- Http.java 2001/12/15 12:06:24 1.1
+++ Http.java 2001/12/16 00:38:31 1.2
@@ -6,12 +6,12 @@
* the LICENSE file.
*/
package org.apache.tools.ant.taskdefs.condition;
-import java.io.IOException;
+
import java.net.HttpURLConnection;
import java.net.MalformedURLException;
import java.net.URL;
import java.net.URLConnection;
-import org.apache.tools.ant.BuildException;
+import org.apache.myrmidon.api.TaskException;
import org.apache.tools.ant.Project;
import org.apache.tools.ant.ProjectComponent;
@@ -31,11 +31,11 @@
}
public boolean eval()
- throws BuildException
+ throws TaskException
{
if( spec == null )
{
- throw new BuildException( "No url specified in HTTP task" );
+ throw new TaskException( "No url specified in HTTP task" );
}
log( "Checking for " + spec, Project.MSG_VERBOSE );
try
@@ -46,7 +46,7 @@
URLConnection conn = url.openConnection();
if( conn instanceof HttpURLConnection )
{
- HttpURLConnection http = ( HttpURLConnection )conn;
+ HttpURLConnection http = (HttpURLConnection)conn;
int code = http.getResponseCode();
log( "Result code for " + spec + " was " + code,
Project.MSG_VERBOSE );
if( code > 0 && code < 500 )
@@ -66,7 +66,7 @@
}
catch( MalformedURLException e )
{
- throw new BuildException( "Badly formed URL: " + spec, e );
+ throw new TaskException( "Badly formed URL: " + spec, e );
}
return true;
}
1.2 +5 -4
jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/condition/IsSet.java
Index: IsSet.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/condition/IsSet.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- IsSet.java 2001/12/15 12:06:24 1.1
+++ IsSet.java 2001/12/16 00:38:31 1.2
@@ -6,14 +6,15 @@
* the LICENSE file.
*/
package org.apache.tools.ant.taskdefs.condition;
-import org.apache.tools.ant.BuildException;
+
+import org.apache.myrmidon.api.TaskException;
import org.apache.tools.ant.ProjectComponent;
/**
* Condition that tests whether a given property has been set.
*
* @author <a href="mailto:[EMAIL PROTECTED]">Stefan Bodewig</a>
- * @version $Revision: 1.1 $
+ * @version $Revision: 1.2 $
*/
public class IsSet extends ProjectComponent implements Condition
{
@@ -25,11 +26,11 @@
}
public boolean eval()
- throws BuildException
+ throws TaskException
{
if( property == null )
{
- throw new BuildException( "No property specified for isset
condition" );
+ throw new TaskException( "No property specified for isset
condition" );
}
return getProject().getProperty( property ) != null;
1.2 +7 -6
jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/condition/Not.java
Index: Not.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/condition/Not.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- Not.java 2001/12/15 12:06:24 1.1
+++ Not.java 2001/12/16 00:38:31 1.2
@@ -6,30 +6,31 @@
* the LICENSE file.
*/
package org.apache.tools.ant.taskdefs.condition;
-import org.apache.tools.ant.BuildException;
+import org.apache.myrmidon.api.TaskException;
+
/**
* <not> condition. Evaluates to true if the single condition nested
into
* it is false and vice versa.
*
* @author <a href="mailto:[EMAIL PROTECTED]">Stefan Bodewig</a>
- * @version $Revision: 1.1 $
+ * @version $Revision: 1.2 $
*/
public class Not extends ConditionBase implements Condition
{
public boolean eval()
- throws BuildException
+ throws TaskException
{
if( countConditions() > 1 )
{
- throw new BuildException( "You must not nest more than one
condition into <not>" );
+ throw new TaskException( "You must not nest more than one
condition into <not>" );
}
if( countConditions() < 1 )
{
- throw new BuildException( "You must nest a condition into <not>"
);
+ throw new TaskException( "You must nest a condition into <not>"
);
}
- return !( ( Condition )getConditions().nextElement() ).eval();
+ return !( (Condition)getConditions().nextElement() ).eval();
}
}
1.2 +5 -4
jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/condition/Or.java
Index: Or.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/condition/Or.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- Or.java 2001/12/15 12:06:24 1.1
+++ Or.java 2001/12/16 00:38:31 1.2
@@ -6,8 +6,9 @@
* the LICENSE file.
*/
package org.apache.tools.ant.taskdefs.condition;
+
import java.util.Enumeration;
-import org.apache.tools.ant.BuildException;
+import org.apache.myrmidon.api.TaskException;
/**
* <or> condition container. <p>
@@ -16,18 +17,18 @@
* true.</p>
*
* @author <a href="mailto:[EMAIL PROTECTED]">Stefan Bodewig</a>
- * @version $Revision: 1.1 $
+ * @version $Revision: 1.2 $
*/
public class Or extends ConditionBase implements Condition
{
public boolean eval()
- throws BuildException
+ throws TaskException
{
Enumeration enum = getConditions();
while( enum.hasMoreElements() )
{
- Condition c = ( Condition )enum.nextElement();
+ Condition c = (Condition)enum.nextElement();
if( c.eval() )
{
return true;
1.2 +5 -4
jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/condition/Socket.java
Index: Socket.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/condition/Socket.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- Socket.java 2001/12/15 12:06:24 1.1
+++ Socket.java 2001/12/16 00:38:31 1.2
@@ -6,8 +6,9 @@
* the LICENSE file.
*/
package org.apache.tools.ant.taskdefs.condition;
+
import java.io.IOException;
-import org.apache.tools.ant.BuildException;
+import org.apache.myrmidon.api.TaskException;
import org.apache.tools.ant.Project;
import org.apache.tools.ant.ProjectComponent;
@@ -33,15 +34,15 @@
}
public boolean eval()
- throws BuildException
+ throws TaskException
{
if( server == null )
{
- throw new BuildException( "No server specified in Socket task" );
+ throw new TaskException( "No server specified in Socket task" );
}
if( port == 0 )
{
- throw new BuildException( "No port specified in Socket task" );
+ throw new TaskException( "No port specified in Socket task" );
}
log( "Checking for listener at " + server + ":" + port,
Project.MSG_VERBOSE );
try
1.2 +34 -26
jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/rmic/DefaultRmicAdapter.java
Index: DefaultRmicAdapter.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/rmic/DefaultRmicAdapter.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- DefaultRmicAdapter.java 2001/12/15 12:06:31 1.1
+++ DefaultRmicAdapter.java 2001/12/16 00:38:31 1.2
@@ -6,13 +6,13 @@
* the LICENSE file.
*/
package org.apache.tools.ant.taskdefs.rmic;
+
import java.io.File;
import java.util.Random;
import java.util.Vector;
import org.apache.tools.ant.Project;
import org.apache.tools.ant.taskdefs.Rmic;
import org.apache.tools.ant.types.Commandline;
-import org.apache.tools.ant.types.FileSet;
import org.apache.tools.ant.types.Path;
import org.apache.tools.ant.util.FileNameMapper;
@@ -35,7 +35,9 @@
private Rmic attributes;
private FileNameMapper mapper;
- public DefaultRmicAdapter() { }
+ public DefaultRmicAdapter()
+ {
+ }
public void setRmic( Rmic attributes )
{
@@ -93,7 +95,7 @@
{
for( int i = 0; i < options.length; i++ )
{
- cmd.createArgument().setValue( options[i] );
+ cmd.createArgument().setValue( options[ i ] );
}
}
@@ -144,7 +146,7 @@
if( attributes.getIiopopts() != null )
{
attributes.log( "IIOP Options: " + attributes.getIiopopts(),
- Project.MSG_INFO );
+ Project.MSG_INFO );
cmd.createArgument().setValue( attributes.getIiopopts() );
}
}
@@ -157,7 +159,7 @@
{
cmd.createArgument().setValue( attributes.getIdlopts() );
attributes.log( "IDL Options: " + attributes.getIdlopts(),
- Project.MSG_INFO );
+ Project.MSG_INFO );
}
}
@@ -237,7 +239,7 @@
Vector compileList = attributes.getCompileList();
attributes.log( "Compilation args: " + cmd.toString(),
- Project.MSG_VERBOSE );
+ Project.MSG_VERBOSE );
StringBuffer niceSourceList = new StringBuffer( "File" );
if( compileList.size() != 1 )
@@ -248,7 +250,7 @@
for( int i = 0; i < compileList.size(); i++ )
{
- String arg = ( String )compileList.elementAt( i );
+ String arg = (String)compileList.elementAt( i );
cmd.createArgument().setValue( arg );
niceSourceList.append( " " + arg );
}
@@ -264,29 +266,35 @@
private class RmicFileNameMapper implements FileNameMapper
{
- RmicFileNameMapper() { }
+ RmicFileNameMapper()
+ {
+ }
/**
* Empty implementation.
*
* @param s The new From value
*/
- public void setFrom( String s ) { }
+ public void setFrom( String s )
+ {
+ }
/**
* Empty implementation.
*
* @param s The new To value
*/
- public void setTo( String s ) { }
+ public void setTo( String s )
+ {
+ }
public String[] mapFileName( String name )
{
if( name == null
- || !name.endsWith( ".class" )
- || name.endsWith( getStubClassSuffix() + ".class" )
- || name.endsWith( getSkelClassSuffix() + ".class" )
- || name.endsWith( getTieClassSuffix() + ".class" ) )
+ || !name.endsWith( ".class" )
+ || name.endsWith( getStubClassSuffix() + ".class" )
+ || name.endsWith( getSkelClassSuffix() + ".class" )
+ || name.endsWith( getTieClassSuffix() + ".class" ) )
{
// Not a .class file or the one we'd generate
return null;
@@ -317,14 +325,14 @@
{
target = new String[]{
base + getStubClassSuffix() + ".class"
- };
+ };
}
else
{
target = new String[]{
base + getStubClassSuffix() + ".class",
base + getSkelClassSuffix() + ".class",
- };
+ };
}
}
else if( !attributes.getIdl() )
@@ -358,8 +366,8 @@
// only stub, no tie
target = new String[]{
dirname + "_" + filename + getStubClassSuffix()
- + ".class"
- };
+ + ".class"
+ };
}
else
{
@@ -386,28 +394,28 @@
target = new String[]{
dirname + "_" + filename + getTieClassSuffix()
- + ".class",
+ + ".class",
iDir + "_" + iName.substring( iIndex )
- + getStubClassSuffix() + ".class"
- };
+ + getStubClassSuffix() + ".class"
+ };
}
}
catch( ClassNotFoundException e )
{
attributes.log( "Unable to verify class " + classname
- + ". It could not be found.",
- Project.MSG_WARN );
+ + ". It could not be found.",
+ Project.MSG_WARN );
}
catch( NoClassDefFoundError e )
{
attributes.log( "Unable to verify class " + classname
- + ". It is not defined.", Project.MSG_WARN );
+ + ". It is not defined.",
Project.MSG_WARN );
}
catch( Throwable t )
{
attributes.log( "Unable to verify class " + classname
- + ". Loading caused Exception: "
- + t.getMessage(), Project.MSG_WARN );
+ + ". Loading caused Exception: "
+ + t.getMessage(), Project.MSG_WARN );
}
}
return target;
1.3 +10 -9
jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/rmic/KaffeRmic.java
Index: KaffeRmic.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/rmic/KaffeRmic.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- KaffeRmic.java 2001/12/15 14:55:59 1.2
+++ KaffeRmic.java 2001/12/16 00:38:31 1.3
@@ -6,9 +6,10 @@
* the LICENSE file.
*/
package org.apache.tools.ant.taskdefs.rmic;
+
import java.lang.reflect.Constructor;
import java.lang.reflect.Method;
-import org.apache.tools.ant.BuildException;
+import org.apache.myrmidon.api.TaskException;
import org.apache.tools.ant.Project;
import org.apache.tools.ant.types.Commandline;
@@ -21,7 +22,7 @@
{
public boolean execute()
- throws BuildException
+ throws TaskException
{
getRmic().log( "Using Kaffe rmic", Project.MSG_VERBOSE );
Commandline cmd = setupRmicCommand();
@@ -34,25 +35,25 @@
Object rmic = cons.newInstance( new Object[]{cmd.getArguments()}
);
Method doRmic = c.getMethod( "run", null );
String str[] = cmd.getArguments();
- Boolean ok = ( Boolean )doRmic.invoke( rmic, null );
+ Boolean ok = (Boolean)doRmic.invoke( rmic, null );
return ok.booleanValue();
}
catch( ClassNotFoundException ex )
{
- throw new BuildException( "Cannot use Kaffe rmic, as it is not
available" +
- " A common solution is to set the environment variable" +
- " JAVA_HOME or CLASSPATH." );
+ throw new TaskException( "Cannot use Kaffe rmic, as it is not
available" +
+ " A common solution is to set the
environment variable" +
+ " JAVA_HOME or CLASSPATH." );
}
catch( Exception ex )
{
- if( ex instanceof BuildException )
+ if( ex instanceof TaskException )
{
- throw ( BuildException )ex;
+ throw (TaskException)ex;
}
else
{
- throw new BuildException( "Error starting Kaffe rmic: ", ex
);
+ throw new TaskException( "Error starting Kaffe rmic: ", ex );
}
}
}
1.2 +4 -3
jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/rmic/RmicAdapter.java
Index: RmicAdapter.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/rmic/RmicAdapter.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- RmicAdapter.java 2001/12/15 12:06:31 1.1
+++ RmicAdapter.java 2001/12/16 00:38:31 1.2
@@ -6,7 +6,8 @@
* the LICENSE file.
*/
package org.apache.tools.ant.taskdefs.rmic;
-import org.apache.tools.ant.BuildException;
+
+import org.apache.myrmidon.api.TaskException;
import org.apache.tools.ant.taskdefs.Rmic;
import org.apache.tools.ant.types.Path;
import org.apache.tools.ant.util.FileNameMapper;
@@ -38,10 +39,10 @@
* Executes the task.
*
* @return has the compilation been successful
- * @exception BuildException Description of Exception
+ * @exception TaskException Description of Exception
*/
boolean execute()
- throws BuildException;
+ throws TaskException;
/**
* Maps source class files to the files generated by this rmic
1.2 +16 -14
jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/rmic/RmicAdapterFactory.java
Index: RmicAdapterFactory.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/rmic/RmicAdapterFactory.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- RmicAdapterFactory.java 2001/12/15 12:06:31 1.1
+++ RmicAdapterFactory.java 2001/12/16 00:38:31 1.2
@@ -6,9 +6,9 @@
* the LICENSE file.
*/
package org.apache.tools.ant.taskdefs.rmic;
-import org.apache.tools.ant.BuildException;
-import org.apache.tools.ant.Task;
+import org.apache.myrmidon.api.TaskException;
+import org.apache.tools.ant.Task;
/**
* Creates the necessary rmic adapter, given basic criteria.
@@ -22,7 +22,9 @@
/**
* This is a singlton -- can't create instances!!
*/
- private RmicAdapterFactory() { }
+ private RmicAdapterFactory()
+ {
+ }
/**
* Based on the parameter passed in, this method creates the necessary
@@ -39,11 +41,11 @@
* classname of the rmic's adapter.
* @param task a task to log through.
* @return The Rmic value
- * @throws BuildException if the rmic type could not be resolved into a
rmic
+ * @throws TaskException if the rmic type could not be resolved into a
rmic
* adapter.
*/
public static RmicAdapter getRmic( String rmicType, Task task )
- throws BuildException
+ throws TaskException
{
if( rmicType == null )
{
@@ -66,7 +68,7 @@
}
catch( ClassNotFoundException cnfk )
{
- throw new BuildException( "Couldn\'t guess rmic
implementation" );
+ throw new TaskException( "Couldn\'t guess rmic
implementation" );
}
}
}
@@ -92,32 +94,32 @@
*
* @param className The fully qualified classname to be created.
* @return Description of the Returned Value
- * @throws BuildException This is the fit that is thrown if className
isn't
+ * @throws TaskException This is the fit that is thrown if className
isn't
* an instance of RmicAdapter.
*/
private static RmicAdapter resolveClassName( String className )
- throws BuildException
+ throws TaskException
{
try
{
Class c = Class.forName( className );
Object o = c.newInstance();
- return ( RmicAdapter )o;
+ return (RmicAdapter)o;
}
catch( ClassNotFoundException cnfe )
{
- throw new BuildException( className + " can\'t be found.", cnfe
);
+ throw new TaskException( className + " can\'t be found.", cnfe );
}
catch( ClassCastException cce )
{
- throw new BuildException( className + " isn\'t the classname of "
- + "a rmic adapter.", cce );
+ throw new TaskException( className + " isn\'t the classname of "
+ + "a rmic adapter.", cce );
}
catch( Throwable t )
{
// for all other possibilities
- throw new BuildException( className + " caused an interesting "
- + "exception.", t );
+ throw new TaskException( className + " caused an interesting "
+ + "exception.", t );
}
}
}
1.3 +14 -13
jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/rmic/SunRmic.java
Index: SunRmic.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/rmic/SunRmic.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- SunRmic.java 2001/12/15 14:55:59 1.2
+++ SunRmic.java 2001/12/16 00:38:31 1.3
@@ -6,11 +6,12 @@
* the LICENSE file.
*/
package org.apache.tools.ant.taskdefs.rmic;
+
import java.io.IOException;
import java.io.OutputStream;
import java.lang.reflect.Constructor;
import java.lang.reflect.Method;
-import org.apache.tools.ant.BuildException;
+import org.apache.myrmidon.api.TaskException;
import org.apache.tools.ant.Project;
import org.apache.tools.ant.taskdefs.LogOutputStream;
import org.apache.tools.ant.types.Commandline;
@@ -24,7 +25,7 @@
{
public boolean execute()
- throws BuildException
+ throws TaskException
{
getRmic().log( "Using SUN rmic compiler", Project.MSG_VERBOSE );
Commandline cmd = setupRmicCommand();
@@ -37,30 +38,30 @@
{
Class c = Class.forName( "sun.rmi.rmic.Main" );
Constructor cons = c.getConstructor( new Class[]
- {OutputStream.class, String.class} );
+ {OutputStream.class, String.class} );
Object rmic = cons.newInstance( new Object[]{logstr, "rmic"} );
Method doRmic = c.getMethod( "compile",
- new Class[]{String[].class} );
- Boolean ok = ( Boolean )doRmic.invoke( rmic,
- ( new Object[]{cmd.getArguments()} ) );
+ new Class[]{String[].class} );
+ Boolean ok = (Boolean)doRmic.invoke( rmic,
+ ( new
Object[]{cmd.getArguments()} ) );
return ok.booleanValue();
}
catch( ClassNotFoundException ex )
{
- throw new BuildException( "Cannot use SUN rmic, as it is not
available" +
- " A common solution is to set the environment variable" +
- " JAVA_HOME or CLASSPATH." );
+ throw new TaskException( "Cannot use SUN rmic, as it is not
available" +
+ " A common solution is to set the
environment variable" +
+ " JAVA_HOME or CLASSPATH." );
}
catch( Exception ex )
{
- if( ex instanceof BuildException )
+ if( ex instanceof TaskException )
{
- throw ( BuildException )ex;
+ throw (TaskException)ex;
}
else
{
- throw new BuildException( "Error starting SUN rmic: ", ex );
+ throw new TaskException( "Error starting SUN rmic: ", ex );
}
}
finally
@@ -71,7 +72,7 @@
}
catch( IOException e )
{
- throw new BuildException( "Error", e );
+ throw new TaskException( "Error", e );
}
}
}
1.3 +10 -9
jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/rmic/WLRmic.java
Index: WLRmic.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/rmic/WLRmic.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- WLRmic.java 2001/12/15 14:55:59 1.2
+++ WLRmic.java 2001/12/16 00:38:31 1.3
@@ -6,8 +6,9 @@
* the LICENSE file.
*/
package org.apache.tools.ant.taskdefs.rmic;
+
import java.lang.reflect.Method;
-import org.apache.tools.ant.BuildException;
+import org.apache.myrmidon.api.TaskException;
import org.apache.tools.ant.Project;
import org.apache.tools.ant.types.Commandline;
@@ -40,7 +41,7 @@
}
public boolean execute()
- throws BuildException
+ throws TaskException
{
getRmic().log( "Using WebLogic rmic", Project.MSG_VERBOSE );
Commandline cmd = setupRmicCommand( new String[]{"-noexit"} );
@@ -50,25 +51,25 @@
// Create an instance of the rmic
Class c = Class.forName( "weblogic.rmic" );
Method doRmic = c.getMethod( "main",
- new Class[]{String[].class} );
+ new Class[]{String[].class} );
doRmic.invoke( null, new Object[]{cmd.getArguments()} );
return true;
}
catch( ClassNotFoundException ex )
{
- throw new BuildException( "Cannot use WebLogic rmic, as it is
not available" +
- " A common solution is to set the environment variable" +
- " CLASSPATH." );
+ throw new TaskException( "Cannot use WebLogic rmic, as it is not
available" +
+ " A common solution is to set the
environment variable" +
+ " CLASSPATH." );
}
catch( Exception ex )
{
- if( ex instanceof BuildException )
+ if( ex instanceof TaskException )
{
- throw ( BuildException )ex;
+ throw (TaskException)ex;
}
else
{
- throw new BuildException( "Error starting WebLogic rmic: ",
ex );
+ throw new TaskException( "Error starting WebLogic rmic: ",
ex );
}
}
}
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>