Permalink
Browse files

Tidy up the documentation comments of the Java code with a view to Ja…

…va 8 compliance.
  • Loading branch information...
1 parent d4031f9 commit 759b542c4a39daf1ce47f89f5c520993a102ac4e @russel russel committed Feb 15, 2013
View
22 src/main/groovy/org/codehaus/gant/GantBuilder.java
@@ -32,31 +32,31 @@
import org.apache.tools.ant.Project;
/**
- * This class is a sub-class of <code>AntBuilder</code> to provide extra capabilities. In particular, a
+ * This class is a sub-class of {@code AntBuilder} to provide extra capabilities. In particular, a
* dry-run capability, and things to help support interaction between Gant and the underlying
- * <code>Project</code>.
+ * {@code Project}.
*
- * @author Russel Winder <russel@winder.org.uk>
+ * @author Russel Winder &lt;russel@winder.org.uk&gt;
*/
public class GantBuilder extends AntBuilder {
/**
* Constructor that uses the default project.
*/
public GantBuilder() { }
/**
- * Constructor that specifies which <code>Project</code> to be associated with.
+ * Constructor that specifies which {@code Project} to be associated with.
*
* <p>If execution is from a command line Gant or call from a Groovy script then the class loader for all
- * objects is a single instance of <code>org.codehaus.groovy.tools.RootLoader</code>, which already has
+ * objects is a single instance of {@code org.codehaus.groovy.tools.RootLoader}, which already has
* Ant and Groovy jars in the classpath. If, however, execution is from an Ant execution via the Gant
* Ant Task, then the classloader for the instance is an instance of
- * <code>org.apache.tools.ant.AntClassLoader</code> with Ant and Groovy jars on the classpath BUT the
- * class loader for the <code>Project</code> instance is a simple <code>java.net.URLClassLoader</code>
+ * {@code org.apache.tools.ant.AntClassLoader} with Ant and Groovy jars on the classpath BUT the
+ * class loader for the {@code Project} instance is a simple {@code java.net.URLClassLoader}
* and does not have the necessary jars on the classpath. When using Ant, the Ant jar has been loaded
* before the Groovy aspects of the classpath have been set up. So we must allow for a specialized
- * constructor (this one) taking a preprepared <code>Project</code> to handle this situation.</p>
+ * constructor (this one) taking a preprepared {@code Project} to handle this situation.</p>
*
- * @param project The <code>Project</code> to be associated with.
+ * @param project The {@code Project} to be associated with.
*/
public GantBuilder(final Project project) { super(project); }
/**
@@ -99,9 +99,9 @@ public GantBuilder() { }
return super.invokeMethod(name, arguments);
}
/**
- * Accessor for the logger associated with the <code>Project</code>.
+ * Accessor for the logger associated with the {@code Project}.
*
- * @return The <code>BuildLogger</code>.
+ * @return The {@code BuildLogger}.
*/
public BuildLogger getLogger() {
@SuppressWarnings("unchecked") final List<? extends BuildListener> listeners = getProject().getBuildListeners();
View
36 src/main/groovy/org/codehaus/gant/GantMetaClass.java
@@ -37,19 +37,19 @@
import org.apache.tools.ant.BuildException;
/**
- * This class is the metaclass used for target <code>Closure</code>s, and any enclosed <code>Closures</code>.
+ * This class is the metaclass used for target {@code Closure}s, and any enclosed {@code Closures}.
*
- * <p>This metaclass deals with <code>depends</code> method calls and redirects unknown method calls to the
- * instance of <code>GantBuilder</code>. To process the <code>depends</code> all closures from the
+ * <p>This metaclass deals with {@code depends} method calls and redirects unknown method calls to the
+ * instance of {@code GantBuilder}. To process the {@code depends} all closures from the
* binding called during execution of the Gant specification must be logged so that when a depends happens
* the full closure call history is available.</p>
*
- * @author Russel Winder <russel@winder.org.uk>
+ * @author Russel Winder &lt;russel@winder.org.uk&gt;
*/
public class GantMetaClass extends DelegatingMetaClass {
/**
* The set of all targets that have been called. This is a global variable shared by all instances of
- * <code>GantMetaClass</code>.
+ * {@code GantMetaClass}.
*
* <p>TODO : This code is a long way from thread safe, and so it needs fixing. Should this variable be
* moved to the GantState class, which is the class that holds other bits of the internal shared state?
@@ -68,11 +68,11 @@ public GantMetaClass(final MetaClass metaClass, final GantBinding binding) {
this.binding = binding;
}
/**
- * Execute a <code>Closure</code> only if it hasn't been executed previously. If it is executed, record
- * the execution. Only used for processing a <code>depends</code> call.
+ * Execute a {@code Closure} only if it hasn't been executed previously. If it is executed, record
+ * the execution. Only used for processing a {@code depends} call.
*
- * @param closure The <code>Closure</code> to potentially call.
- * @return the result of the <code>Closure</code> call, or <code>null</code> if the closure was not
+ * @param closure The {@code Closure} to potentially call.
+ * @return the result of the {@code Closure} call, or {@code null} if the closure was not
* called.
*/
private Object processClosure(final Closure<?> closure) {
@@ -83,12 +83,12 @@ private Object processClosure(final Closure<?> closure) {
return null;
}
/**
- * Process the argument to a <code>depends</code> call. If the parameter is a <code>Closure</code> just
- * process it. If it is a <code>String</code> then do a lookup for the <code>Closure</code> in the
+ * Process the argument to a {@code depends} call. If the parameter is a {@code Closure} just
+ * process it. If it is a {@code String} then do a lookup for the {@code Closure} in the
* binding, and if found process it.
*
* @param argument The argument.
- * @return The result of the <code>Closure</code>.
+ * @return The result of the {@code Closure}.
*/
private Object processArgument(final Object argument) {
final Object returnObject;
@@ -107,16 +107,16 @@ private Object processArgument(final Object argument) {
return returnObject;
}
/**
- * Invokes a method on the given object with the given name and arguments. The <code>MetaClass</code>
+ * Invokes a method on the given object with the given name and arguments. The {@code MetaClass}
* will attempt to pick the best method for the given name and arguments. If a method cannot be invoked a
- * <code>MissingMethodException</code> will be thrown.
+ * {@code MissingMethodException} will be thrown.
*
* @see MissingMethodException
* @param object The instance on which the method is invoked.
* @param methodName The name of the method.
* @param arguments The arguments to the method.
- * @return The return value of the method which is <code>null</code> if the return type is
- * <code>void</code>.
+ * @return The return value of the method which is {@code null} if the return type is
+ * {@code void}.
*/
@Override public Object invokeMethod(final Object object, final String methodName, final Object[] arguments) {
Object returnObject = null;
@@ -191,10 +191,10 @@ private Object processArgument(final Object argument) {
* invoked the method on the object. Attempt to establish the method to invoke based on the name and
* arguments provided.
*
- * <p>The <code>isCallToSuper</code> and <code>fromInsideClass</code> help the Groovy runtime perform
+ * <p>The {@code isCallToSuper} and {@code fromInsideClass} help the Groovy runtime perform
* optimizations on the call to go directly to the superclass if necessary.</p>
*
- * @param sender The <code>java.lang.Class</code> instance that invoked the method.
+ * @param sender The {@code java.lang.Class} instance that invoked the method.
* @param receiver The object which the method was invoked on.
* @param methodName The name of the method.
* @param arguments The arguments to the method.
View
8 src/main/groovy/org/codehaus/gant/GantState.java
@@ -23,10 +23,10 @@
* <p>This class was originally needed because parts of Gant are written in Java and parts in Groovy and it
* was not possible to compile them all at the same time. All references to Groovy classes had to be
* avoided in the Java classes so that the Java could be compiled and then the Groovy compiled. This class
- * contains things that should be in the <code>Gant</code> class but could not be. All this is no longer
- * true, so the material could go back into the <code>Gant</code> class.</p>
+ * contains things that should be in the {@code Gant} class but could not be. All this is no longer
+ * true, so the material could go back into the {@code Gant} class.</p>
*
- * @author Russel Winder <russel@winder.org.uk>
+ * @author Russel Winder &lt;russel@winder.org.uk&gt;
*/
public class GantState {
@@ -69,7 +69,7 @@
*/
public static final int DEBUG = Project.MSG_DEBUG;
/**
- * The current state of the verbosity of execution -- default is <code>NORMAL</code>.
+ * The current state of the verbosity of execution -- default is {@code NORMAL}.
*/
public static int verbosity = NORMAL;
/**

0 comments on commit 759b542

Please sign in to comment.