diff --git a/src/main/org/apache/tools/ant/taskdefs/compilers/CompilerAdapter.java b/src/main/org/apache/tools/ant/taskdefs/compilers/CompilerAdapter.java index 5ca74395b..dd4e9b50a 100644 --- a/src/main/org/apache/tools/ant/taskdefs/compilers/CompilerAdapter.java +++ b/src/main/org/apache/tools/ant/taskdefs/compilers/CompilerAdapter.java @@ -1,5 +1,5 @@ /* - * Copyright 2001-2004 The Apache Software Foundation + * Copyright 2001-2005 The Apache Software Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -37,6 +37,7 @@ public interface CompilerAdapter { /** * Sets the compiler attributes, which are stored in the Javac task. + * @param attributes the compiler attributes */ void setJavac(Javac attributes); @@ -44,6 +45,7 @@ public interface CompilerAdapter { * Executes the task. * * @return has the compilation been successful + * @throws BuildException on error */ boolean execute() throws BuildException; } diff --git a/src/main/org/apache/tools/ant/taskdefs/compilers/CompilerAdapterFactory.java b/src/main/org/apache/tools/ant/taskdefs/compilers/CompilerAdapterFactory.java index 282c26ef2..37397180a 100644 --- a/src/main/org/apache/tools/ant/taskdefs/compilers/CompilerAdapterFactory.java +++ b/src/main/org/apache/tools/ant/taskdefs/compilers/CompilerAdapterFactory.java @@ -27,7 +27,7 @@ import org.apache.tools.ant.util.JavaEnvUtils; * * @since Ant 1.3 */ -public class CompilerAdapterFactory { +public final class CompilerAdapterFactory { private static final String MODERN_COMPILER = "com.sun.tools.javac.Main"; /** This is a singleton -- can't create instances!! */ @@ -55,6 +55,7 @@ public class CompilerAdapterFactory { * @param compilerType either the name of the desired compiler, or the * full classname of the compiler's adapter. * @param task a task to log through. + * @return the compiler adapter * @throws BuildException if the compiler type could not be resolved into * a compiler adapter. */ @@ -145,6 +146,7 @@ public class CompilerAdapterFactory { return true; } } catch (ClassNotFoundException cnfe2) { + // Ignore Exception } } return false; diff --git a/src/main/org/apache/tools/ant/taskdefs/compilers/Gcj.java b/src/main/org/apache/tools/ant/taskdefs/compilers/Gcj.java index 5616427be..78bec4e6a 100644 --- a/src/main/org/apache/tools/ant/taskdefs/compilers/Gcj.java +++ b/src/main/org/apache/tools/ant/taskdefs/compilers/Gcj.java @@ -33,6 +33,8 @@ public class Gcj extends DefaultCompilerAdapter { /** * Performs a compile using the gcj compiler. + * @return true if the compilation succeeded + * @throws BuildException on error */ public boolean execute() throws BuildException { Commandline cmd; @@ -46,6 +48,10 @@ public class Gcj extends DefaultCompilerAdapter { executeExternalCompile(cmd.getCommandline(), firstFileName) == 0; } + /** + * Set up the gcj commandline. + * @return the command line + */ protected Commandline setupGCJCommand() { Commandline cmd = new Commandline(); Path classpath = new Path(project); @@ -113,7 +119,7 @@ public class Gcj extends DefaultCompilerAdapter { /** * Whether any of the arguments given via <compilerarg> * implies that compilation to native code is requested. - * + * @return true if compilation to native code is requested * @since Ant 1.6.2 */ public boolean isNativeBuild() { diff --git a/src/main/org/apache/tools/ant/taskdefs/compilers/Javac12.java b/src/main/org/apache/tools/ant/taskdefs/compilers/Javac12.java index 58540e4bd..d34348840 100644 --- a/src/main/org/apache/tools/ant/taskdefs/compilers/Javac12.java +++ b/src/main/org/apache/tools/ant/taskdefs/compilers/Javac12.java @@ -1,5 +1,5 @@ /* - * Copyright 2001-2002,2004 The Apache Software Foundation + * Copyright 2001-2002,2004-2005 The Apache Software Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -37,7 +37,7 @@ public class Javac12 extends DefaultCompilerAdapter { /** * Run the compilation. - * + * @return true if the compiler ran with a zero exit result (ok) * @exception BuildException if the compilation has problems. */ public boolean execute() throws BuildException { diff --git a/src/main/org/apache/tools/ant/taskdefs/compilers/Javac13.java b/src/main/org/apache/tools/ant/taskdefs/compilers/Javac13.java index f911d12cd..f674d4dae 100644 --- a/src/main/org/apache/tools/ant/taskdefs/compilers/Javac13.java +++ b/src/main/org/apache/tools/ant/taskdefs/compilers/Javac13.java @@ -1,5 +1,5 @@ /* - * Copyright 2001-2002,2004 The Apache Software Foundation + * Copyright 2001-2002,2004-2005 The Apache Software Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -39,7 +39,7 @@ public class Javac13 extends DefaultCompilerAdapter { /** * Run the compilation. - * + * @return true if the compiler ran with a zero exit result (ok) * @exception BuildException if the compilation has problems. */ public boolean execute() throws BuildException { diff --git a/src/main/org/apache/tools/ant/taskdefs/compilers/JavacExternal.java b/src/main/org/apache/tools/ant/taskdefs/compilers/JavacExternal.java index 6c6bb0f73..9fcd30948 100644 --- a/src/main/org/apache/tools/ant/taskdefs/compilers/JavacExternal.java +++ b/src/main/org/apache/tools/ant/taskdefs/compilers/JavacExternal.java @@ -36,6 +36,8 @@ public class JavacExternal extends DefaultCompilerAdapter { /** * Performs a compile using the Javac externally. + * @return true if the compilation succeeded + * @throws BuildException on error */ public boolean execute() throws BuildException { attributes.log("Using external javac compiler", Project.MSG_VERBOSE); diff --git a/src/main/org/apache/tools/ant/taskdefs/compilers/Jikes.java b/src/main/org/apache/tools/ant/taskdefs/compilers/Jikes.java index 2a04fadbc..1f233d066 100644 --- a/src/main/org/apache/tools/ant/taskdefs/compilers/Jikes.java +++ b/src/main/org/apache/tools/ant/taskdefs/compilers/Jikes.java @@ -39,7 +39,9 @@ public class Jikes extends DefaultCompilerAdapter { * there is no option in jikes and I don't understand * what they should do. * - * It has been successfully tested with jikes >1.10 + * It has been successfully tested with jikes >1.10. + * @return true if the compilation succeeded + * @throws BuildException on error */ public boolean execute() throws BuildException { attributes.log("Using jikes compiler", Project.MSG_VERBOSE); @@ -88,7 +90,7 @@ public class Jikes extends DefaultCompilerAdapter { String exec = getJavac().getExecutable(); cmd.setExecutable(exec == null ? "jikes" : exec); - if (deprecation == true) { + if (deprecation) { cmd.createArgument().setValue("-deprecation"); } diff --git a/src/main/org/apache/tools/ant/taskdefs/compilers/Jvc.java b/src/main/org/apache/tools/ant/taskdefs/compilers/Jvc.java index b9fc4bb99..8f96b7447 100644 --- a/src/main/org/apache/tools/ant/taskdefs/compilers/Jvc.java +++ b/src/main/org/apache/tools/ant/taskdefs/compilers/Jvc.java @@ -1,5 +1,5 @@ /* - * Copyright 2001-2004 The Apache Software Foundation + * Copyright 2001-2005 The Apache Software Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -33,7 +33,7 @@ public class Jvc extends DefaultCompilerAdapter { /** * Run the compilation. - * + * @return true if the compiler ran with a zero exit result (ok) * @exception BuildException if the compilation has problems. */ public boolean execute() throws BuildException { diff --git a/src/main/org/apache/tools/ant/taskdefs/compilers/Kjc.java b/src/main/org/apache/tools/ant/taskdefs/compilers/Kjc.java index a99949408..cb0a3033e 100644 --- a/src/main/org/apache/tools/ant/taskdefs/compilers/Kjc.java +++ b/src/main/org/apache/tools/ant/taskdefs/compilers/Kjc.java @@ -34,7 +34,7 @@ public class Kjc extends DefaultCompilerAdapter { /** * Run the compilation. - * + * @return true if the compilation succeeded * @exception BuildException if the compilation has problems. */ public boolean execute() throws BuildException { @@ -48,6 +48,7 @@ public class Kjc extends DefaultCompilerAdapter { /** * setup kjc command arguments. + * @return the command line */ protected Commandline setupKjcCommand() { Commandline cmd = new Commandline(); @@ -55,7 +56,7 @@ public class Kjc extends DefaultCompilerAdapter { // generate classpath, because kjc doesn't support sourcepath. Path classpath = getCompileClasspath(); - if (deprecation == true) { + if (deprecation) { cmd.createArgument().setValue("-deprecation"); } diff --git a/src/main/org/apache/tools/ant/taskdefs/compilers/Sj.java b/src/main/org/apache/tools/ant/taskdefs/compilers/Sj.java index ee9994ebd..d2c6516df 100644 --- a/src/main/org/apache/tools/ant/taskdefs/compilers/Sj.java +++ b/src/main/org/apache/tools/ant/taskdefs/compilers/Sj.java @@ -31,6 +31,8 @@ public class Sj extends DefaultCompilerAdapter { /** * Performs a compile using the sj compiler from Symantec. + * @return true if the compilation succeeded + * @throws BuildException on error */ public boolean execute() throws BuildException { attributes.log("Using symantec java compiler", Project.MSG_VERBOSE);