diff --git a/src/main/org/apache/tools/ant/taskdefs/ExecTask.java b/src/main/org/apache/tools/ant/taskdefs/ExecTask.java index b057295e9..c9817ceb7 100644 --- a/src/main/org/apache/tools/ant/taskdefs/ExecTask.java +++ b/src/main/org/apache/tools/ant/taskdefs/ExecTask.java @@ -289,6 +289,7 @@ public class ExecTask extends Task { /** * Indicates whether to attempt to resolve the executable to a * file. + * @return the resolveExecutable flag * * @since Ant 1.6 */ diff --git a/src/main/org/apache/tools/ant/taskdefs/ExecuteStreamHandler.java b/src/main/org/apache/tools/ant/taskdefs/ExecuteStreamHandler.java index 04aba96d9..3048aafd4 100644 --- a/src/main/org/apache/tools/ant/taskdefs/ExecuteStreamHandler.java +++ b/src/main/org/apache/tools/ant/taskdefs/ExecuteStreamHandler.java @@ -1,5 +1,5 @@ /* - * Copyright 2000,2002,2004 The Apache Software Foundation + * Copyright 2000,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. @@ -34,6 +34,7 @@ public interface ExecuteStreamHandler { * * @param os output stream to write to the standard input stream of the * subprocess + * @throws IOException on error */ void setProcessInputStream(OutputStream os) throws IOException; @@ -41,6 +42,7 @@ public interface ExecuteStreamHandler { * Install a handler for the error stream of the subprocess. * * @param is input stream to read from the error stream from the subprocess + * @throws IOException on error */ void setProcessErrorStream(InputStream is) throws IOException; @@ -48,11 +50,13 @@ public interface ExecuteStreamHandler { * Install a handler for the output stream of the subprocess. * * @param is input stream to read from the error stream from the subprocess + * @throws IOException on error */ void setProcessOutputStream(InputStream is) throws IOException; /** * Start handling of the streams. + * @throws IOException on error */ void start() throws IOException; diff --git a/src/main/org/apache/tools/ant/taskdefs/ExecuteWatchdog.java b/src/main/org/apache/tools/ant/taskdefs/ExecuteWatchdog.java index 173da911d..ea7676462 100644 --- a/src/main/org/apache/tools/ant/taskdefs/ExecuteWatchdog.java +++ b/src/main/org/apache/tools/ant/taskdefs/ExecuteWatchdog.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2004 The Apache Software Foundation + * Copyright 2000-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. @@ -107,6 +107,7 @@ public class ExecuteWatchdog implements TimeoutObserver { /** * Called after watchdog has finished. + * @param w the watchdog */ public void timeoutOccured(Watchdog w) { try { diff --git a/src/main/org/apache/tools/ant/taskdefs/Expand.java b/src/main/org/apache/tools/ant/taskdefs/Expand.java index 6a99a455c..d5102a298 100644 --- a/src/main/org/apache/tools/ant/taskdefs/Expand.java +++ b/src/main/org/apache/tools/ant/taskdefs/Expand.java @@ -63,7 +63,7 @@ public class Expand extends Task { private String encoding = "UTF8"; /** Error message when more that one mapper is defined */ public static final String ERROR_MULTIPLE_MAPPERS = "Cannot define more than one mapper"; - + private static final FileUtils FILE_UTILS = FileUtils.getFileUtils(); /** diff --git a/src/main/org/apache/tools/ant/taskdefs/Filter.java b/src/main/org/apache/tools/ant/taskdefs/Filter.java index e5e52a10d..016dd9d82 100644 --- a/src/main/org/apache/tools/ant/taskdefs/Filter.java +++ b/src/main/org/apache/tools/ant/taskdefs/Filter.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2004 The Apache Software Foundation + * Copyright 2000-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. @@ -63,6 +63,10 @@ public class Filter extends Task { this.filtersFile = filtersFile; } + /** + * Execute the task. + * @throws BuildException on error + */ public void execute() throws BuildException { boolean isFiltersFromFile = filtersFile != null && token == null && value == null; @@ -84,6 +88,10 @@ public class Filter extends Task { } } + /** + * Read the filters. + * @throws BuildException on error + */ protected void readFilters() throws BuildException { log("Reading filters from " + filtersFile, Project.MSG_VERBOSE); getProject().getGlobalFilterSet().readFiltersFromFile(filtersFile); diff --git a/src/main/org/apache/tools/ant/taskdefs/GUnzip.java b/src/main/org/apache/tools/ant/taskdefs/GUnzip.java index 3ad2945c0..44dbbca98 100644 --- a/src/main/org/apache/tools/ant/taskdefs/GUnzip.java +++ b/src/main/org/apache/tools/ant/taskdefs/GUnzip.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2002,2004 The Apache Software Foundation + * Copyright 2000-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,10 +37,17 @@ public class GUnzip extends Unpack { private static final String DEFAULT_EXTENSION = ".gz"; + /** + * Get the default extension. + * @return the value ".gz" + */ protected String getDefaultExtension() { return DEFAULT_EXTENSION; } + /** + * Implement the gunzipping. + */ protected void extract() { if (source.lastModified() > dest.lastModified()) { log("Expanding " + source.getAbsolutePath() + " to " diff --git a/src/main/org/apache/tools/ant/taskdefs/GenerateKey.java b/src/main/org/apache/tools/ant/taskdefs/GenerateKey.java index 3f312c03b..09e651efe 100644 --- a/src/main/org/apache/tools/ant/taskdefs/GenerateKey.java +++ b/src/main/org/apache/tools/ant/taskdefs/GenerateKey.java @@ -32,30 +32,57 @@ import org.apache.tools.ant.util.JavaEnvUtils; */ public class GenerateKey extends Task { + /** + * A DistinguishedName parameter. + * This is a nested element in a dname nested element. + */ public static class DnameParam { private String name; private String value; + /** + * Set the name attribute. + * @param name a String value + */ public void setName(String name) { this.name = name; } + /** + * Get the name attribute. + * @return the name. + */ public String getName() { return name; } + /** + * Set the value attribute. + * @param value a String value + */ public void setValue(String value) { this.value = value; } + /** + * Get the value attribute. + * @return the value. + */ public String getValue() { return value; } } + /** + * A class corresponding to the dname nested element. + */ public static class DistinguishedName { private Vector params = new Vector(); + /** + * Create a param nested element. + * @return a DnameParam object to be configured. + */ public Object createParam() { DnameParam param = new DnameParam(); params.addElement(param); @@ -63,10 +90,21 @@ public class GenerateKey extends Task { return param; } + /** + * Get the nested parameters. + * @return an enumeration of the nested parameters. + */ public Enumeration getParams() { return params.elements(); } + /** + * Generate a string rep of this distinguished name. + * The format is each of the parameters (name = value) + * separated by ','. + * This is used on the command line. + * @return a string rep of this name + */ public String toString() { final int size = params.size(); final StringBuffer sb = new StringBuffer(); @@ -87,6 +125,13 @@ public class GenerateKey extends Task { return sb.toString(); } + /** + * Encode a name or value. + * The encoded result is the same as the input string + * except that each ',' is replaced by a '\,'. + * @param string the value to be encoded + * @return the encoded value. + */ public String encode(final String string) { int end = string.indexOf(','); @@ -264,6 +309,10 @@ public class GenerateKey extends Task { this.verbose = verbose; } + /** + * Execute the task. + * @throws BuildException on error + */ public void execute() throws BuildException { if (null == alias) { diff --git a/src/main/org/apache/tools/ant/taskdefs/JDBCTask.java b/src/main/org/apache/tools/ant/taskdefs/JDBCTask.java index 4b1050b22..d9cf73b87 100644 --- a/src/main/org/apache/tools/ant/taskdefs/JDBCTask.java +++ b/src/main/org/apache/tools/ant/taskdefs/JDBCTask.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2004 The Apache Software Foundation + * Copyright 2002-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. @@ -151,7 +151,7 @@ public abstract class JDBCTask extends Task { * Caching loaders / driver. This is to avoid * getting an OutOfMemoryError when calling this task * multiple times in a row; default: true - * @param enable + * @param enable a boolean value */ public void setCaching(boolean enable) { caching = enable; @@ -159,6 +159,7 @@ public abstract class JDBCTask extends Task { /** * Add a path to the classpath for loading the driver. + * @return a path to be configured */ public Path createClasspath() { if (this.classpath == null) { @@ -170,6 +171,7 @@ public abstract class JDBCTask extends Task { /** * Set the classpath for loading the driver * using the classpath reference. + * @param r a reference to a classpath */ public void setClasspathRef(Reference r) { createClasspath().setRefid(r); @@ -228,6 +230,8 @@ public abstract class JDBCTask extends Task { /** * Verify we are connected to the correct RDBMS + * @param conn the jdbc connection + * @return true if we are connected to the correct RDBMS */ protected boolean isValidRdbms(Connection conn) { if (rdbms == null && version == null) { @@ -268,10 +272,18 @@ public abstract class JDBCTask extends Task { return true; } + /** + * Get the cache of loaders and drivers. + * @return a hashtable + */ protected static Hashtable getLoaderMap() { return loaderMap; } + /** + * Get the classloader used to create a driver. + * @return the classloader + */ protected AntClassLoader getLoader() { return loader; } @@ -380,6 +392,10 @@ public abstract class JDBCTask extends Task { } + /** + * Set the caching attribute. (!) + * @param value a boolean value + */ public void isCaching(boolean value) { caching = value; }