git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@470587 13f79535-47bb-0310-9956-ffa450edef68master
@@ -61,7 +61,7 @@ public class Echo extends Task { | |||||
Writer out = null; | Writer out = null; | ||||
try { | try { | ||||
String filename = file.getAbsolutePath(); | String filename = file.getAbsolutePath(); | ||||
if(encoding == null || encoding.length() == 0) { | |||||
if (encoding == null || encoding.length() == 0) { | |||||
out = new FileWriter(filename, append); | out = new FileWriter(filename, append); | ||||
} else { | } else { | ||||
out = new BufferedWriter( | out = new BufferedWriter( | ||||
@@ -87,7 +87,7 @@ public class GUnzip extends Unpack { | |||||
* support non-file resources needs to override this method. We | * support non-file resources needs to override this method. We | ||||
* need to do so for backwards compatibility reasons since we | * need to do so for backwards compatibility reasons since we | ||||
* can't expect subclasses to support resources.</p> | * can't expect subclasses to support resources.</p> | ||||
* | |||||
* @return true if this task supports non file resources. | |||||
* @since Ant 1.7 | * @since Ant 1.7 | ||||
*/ | */ | ||||
protected boolean supportsNonFileResources() { | protected boolean supportsNonFileResources() { | ||||
@@ -127,7 +127,7 @@ public class Recorder extends Task implements SubBuildListener { | |||||
/** | /** | ||||
* Sets the level to which this recorder entry should log to. | * Sets the level to which this recorder entry should log to. | ||||
* | |||||
* @param level the level to set. | |||||
* @see VerbosityLevelChoices | * @see VerbosityLevelChoices | ||||
*/ | */ | ||||
public void setLoglevel(VerbosityLevelChoices level) { | public void setLoglevel(VerbosityLevelChoices level) { | ||||
@@ -224,7 +224,7 @@ public class Recorder extends Task implements SubBuildListener { | |||||
/** | /** | ||||
* Empty implementation required by SubBuildListener interface. | * Empty implementation required by SubBuildListener interface. | ||||
* | |||||
* @param event ignored. | |||||
* @since Ant 1.7 | * @since Ant 1.7 | ||||
*/ | */ | ||||
public void buildStarted(BuildEvent event) { | public void buildStarted(BuildEvent event) { | ||||
@@ -232,7 +232,7 @@ public class Recorder extends Task implements SubBuildListener { | |||||
/** | /** | ||||
* Empty implementation required by SubBuildListener interface. | * Empty implementation required by SubBuildListener interface. | ||||
* | |||||
* @param event ignored. | |||||
* @since Ant 1.7 | * @since Ant 1.7 | ||||
*/ | */ | ||||
public void subBuildStarted(BuildEvent event) { | public void subBuildStarted(BuildEvent event) { | ||||
@@ -240,7 +240,7 @@ public class Recorder extends Task implements SubBuildListener { | |||||
/** | /** | ||||
* Empty implementation required by SubBuildListener interface. | * Empty implementation required by SubBuildListener interface. | ||||
* | |||||
* @param event ignored. | |||||
* @since Ant 1.7 | * @since Ant 1.7 | ||||
*/ | */ | ||||
public void targetStarted(BuildEvent event) { | public void targetStarted(BuildEvent event) { | ||||
@@ -248,7 +248,7 @@ public class Recorder extends Task implements SubBuildListener { | |||||
/** | /** | ||||
* Empty implementation required by SubBuildListener interface. | * Empty implementation required by SubBuildListener interface. | ||||
* | |||||
* @param event ignored. | |||||
* @since Ant 1.7 | * @since Ant 1.7 | ||||
*/ | */ | ||||
public void targetFinished(BuildEvent event) { | public void targetFinished(BuildEvent event) { | ||||
@@ -256,7 +256,7 @@ public class Recorder extends Task implements SubBuildListener { | |||||
/** | /** | ||||
* Empty implementation required by SubBuildListener interface. | * Empty implementation required by SubBuildListener interface. | ||||
* | |||||
* @param event ignored. | |||||
* @since Ant 1.7 | * @since Ant 1.7 | ||||
*/ | */ | ||||
public void taskStarted(BuildEvent event) { | public void taskStarted(BuildEvent event) { | ||||
@@ -264,7 +264,7 @@ public class Recorder extends Task implements SubBuildListener { | |||||
/** | /** | ||||
* Empty implementation required by SubBuildListener interface. | * Empty implementation required by SubBuildListener interface. | ||||
* | |||||
* @param event ignored. | |||||
* @since Ant 1.7 | * @since Ant 1.7 | ||||
*/ | */ | ||||
public void taskFinished(BuildEvent event) { | public void taskFinished(BuildEvent event) { | ||||
@@ -272,7 +272,7 @@ public class Recorder extends Task implements SubBuildListener { | |||||
/** | /** | ||||
* Empty implementation required by SubBuildListener interface. | * Empty implementation required by SubBuildListener interface. | ||||
* | |||||
* @param event ignored. | |||||
* @since Ant 1.7 | * @since Ant 1.7 | ||||
*/ | */ | ||||
public void messageLogged(BuildEvent event) { | public void messageLogged(BuildEvent event) { | ||||
@@ -280,7 +280,7 @@ public class Recorder extends Task implements SubBuildListener { | |||||
/** | /** | ||||
* Cleans recorder registry. | * Cleans recorder registry. | ||||
* | |||||
* @param event ignored. | |||||
* @since Ant 1.7 | * @since Ant 1.7 | ||||
*/ | */ | ||||
public void buildFinished(BuildEvent event) { | public void buildFinished(BuildEvent event) { | ||||
@@ -290,7 +290,7 @@ public class Recorder extends Task implements SubBuildListener { | |||||
/** | /** | ||||
* Cleans recorder registry, if this is the subbuild the task has | * Cleans recorder registry, if this is the subbuild the task has | ||||
* been created in. | * been created in. | ||||
* | |||||
* @param event ignored. | |||||
* @since Ant 1.7 | * @since Ant 1.7 | ||||
*/ | */ | ||||
public void subBuildFinished(BuildEvent event) { | public void subBuildFinished(BuildEvent event) { | ||||
@@ -352,7 +352,7 @@ public class Replace extends MatchingTask { | |||||
void close() throws IOException { | void close() throws IOException { | ||||
reader.close(); | reader.close(); | ||||
} | } | ||||
/** | /** | ||||
* Closes file but doesn't throw exception | * Closes file but doesn't throw exception | ||||
*/ | */ | ||||
@@ -426,7 +426,7 @@ public class Replace extends MatchingTask { | |||||
void close() throws IOException { | void close() throws IOException { | ||||
writer.close(); | writer.close(); | ||||
} | } | ||||
/** | /** | ||||
* Closes file but doesn't throw exception | * Closes file but doesn't throw exception | ||||
*/ | */ | ||||
@@ -150,7 +150,7 @@ public class SQLExec extends JDBCTask { | |||||
* Print SQL stats (rows affected) | * Print SQL stats (rows affected) | ||||
*/ | */ | ||||
private boolean showtrailers = true; | private boolean showtrailers = true; | ||||
/** | /** | ||||
* Results Output file. | * Results Output file. | ||||
*/ | */ | ||||
@@ -204,7 +204,7 @@ public class SQLExec extends JDBCTask { | |||||
/** | /** | ||||
* Enable property expansion inside nested text | * Enable property expansion inside nested text | ||||
* | * | ||||
* @param expandProperties | |||||
* @param expandProperties if true expand properties. | |||||
* @since Ant 1.7 | * @since Ant 1.7 | ||||
*/ | */ | ||||
public void setExpandProperties(boolean expandProperties) { | public void setExpandProperties(boolean expandProperties) { | ||||
@@ -323,7 +323,7 @@ public class SQLExec extends JDBCTask { | |||||
public void setShowtrailers(boolean showtrailers) { | public void setShowtrailers(boolean showtrailers) { | ||||
this.showtrailers = showtrailers; | this.showtrailers = showtrailers; | ||||
} | } | ||||
/** | /** | ||||
* Set the output file; | * Set the output file; | ||||
* optional, defaults to the Ant log. | * optional, defaults to the Ant log. | ||||
@@ -673,7 +673,7 @@ public class SQLExec extends JDBCTask { | |||||
} | } | ||||
/* | /* | ||||
* Closes an unused connection after an error and doesn't rethrow | |||||
* Closes an unused connection after an error and doesn't rethrow | |||||
* a possible SQLException | * a possible SQLException | ||||
* @since Ant 1.7 | * @since Ant 1.7 | ||||
*/ | */ | ||||
@@ -686,7 +686,7 @@ public class SQLExec extends JDBCTask { | |||||
} | } | ||||
} | } | ||||
} | } | ||||
/** | /** | ||||
* The action a task should perform on an error, | * The action a task should perform on an error, | ||||
* one of "continue", "stop" and "abort" | * one of "continue", "stop" and "abort" | ||||
@@ -715,7 +715,7 @@ public class SQLExec extends JDBCTask { | |||||
public void setSrc(File src) { | public void setSrc(File src) { | ||||
//there are places (in this file, and perhaps elsewhere, where it is assumed | //there are places (in this file, and perhaps elsewhere, where it is assumed | ||||
//that null is an acceptable parameter. | //that null is an acceptable parameter. | ||||
if(src!=null) { | |||||
if (src!=null) { | |||||
setSrcResource(new FileResource(src)); | setSrcResource(new FileResource(src)); | ||||
} | } | ||||
} | } | ||||
@@ -747,6 +747,7 @@ public class SQLExec extends JDBCTask { | |||||
/** | /** | ||||
* Set the source resource. | * Set the source resource. | ||||
* @param a the source resource collection. | |||||
* @since Ant 1.7 | * @since Ant 1.7 | ||||
*/ | */ | ||||
public void addConfigured(ResourceCollection a) { | public void addConfigured(ResourceCollection a) { | ||||
@@ -112,7 +112,8 @@ public class SignJar extends AbstractJarSignerTask { | |||||
/** | /** | ||||
* error string for unit test verification {@value} | * error string for unit test verification {@value} | ||||
*/ | */ | ||||
public static final String ERROR_SIGNEDJAR_AND_PATHS = "You cannot specify the signed JAR when using paths or filesets"; | |||||
public static final String ERROR_SIGNEDJAR_AND_PATHS | |||||
= "You cannot specify the signed JAR when using paths or filesets"; | |||||
/** | /** | ||||
* error string for unit test verification: {@value} | * error string for unit test verification: {@value} | ||||
*/ | */ | ||||
@@ -120,7 +121,8 @@ public class SignJar extends AbstractJarSignerTask { | |||||
/** | /** | ||||
* error string for unit test verification: {@value} | * error string for unit test verification: {@value} | ||||
*/ | */ | ||||
public static final String ERROR_MAPPER_WITHOUT_DEST = "The destDir attribute is required if a mapper is set"; | |||||
public static final String ERROR_MAPPER_WITHOUT_DEST | |||||
= "The destDir attribute is required if a mapper is set"; | |||||
/** | /** | ||||
* error string for unit test verification: {@value} | * error string for unit test verification: {@value} | ||||
*/ | */ | ||||
@@ -192,7 +194,7 @@ public class SignJar extends AbstractJarSignerTask { | |||||
* add a mapper to determine file naming policy. Only used with toDir | * add a mapper to determine file naming policy. Only used with toDir | ||||
* processing. | * processing. | ||||
* | * | ||||
* @param newMapper | |||||
* @param newMapper the mapper to add. | |||||
* @since Ant 1.7 | * @since Ant 1.7 | ||||
*/ | */ | ||||
public void add(FileNameMapper newMapper) { | public void add(FileNameMapper newMapper) { | ||||
@@ -222,7 +224,7 @@ public class SignJar extends AbstractJarSignerTask { | |||||
/** | /** | ||||
* | * | ||||
* @param tsaurl | |||||
* @param tsaurl the tsa url. | |||||
* @since Ant 1.7 | * @since Ant 1.7 | ||||
*/ | */ | ||||
public void setTsaurl(String tsaurl) { | public void setTsaurl(String tsaurl) { | ||||
@@ -240,7 +242,7 @@ public class SignJar extends AbstractJarSignerTask { | |||||
/** | /** | ||||
* set the alias in the keystore of the TSA to use; | * set the alias in the keystore of the TSA to use; | ||||
* @param tsacert | |||||
* @param tsacert the cert alias. | |||||
*/ | */ | ||||
public void setTsacert(String tsacert) { | public void setTsacert(String tsacert) { | ||||
this.tsacert = tsacert; | this.tsacert = tsacert; | ||||
@@ -394,11 +396,11 @@ public class SignJar extends AbstractJarSignerTask { | |||||
//alias is required for signing | //alias is required for signing | ||||
addValue(cmd, alias); | addValue(cmd, alias); | ||||
log("Signing JAR: " + | |||||
jarSource.getAbsolutePath() | |||||
+" to " + | |||||
targetFile.getAbsolutePath() | |||||
+ " as " + alias); | |||||
log("Signing JAR: " | |||||
+ jarSource.getAbsolutePath() | |||||
+ " to " | |||||
+ targetFile.getAbsolutePath() | |||||
+ " as " + alias); | |||||
cmd.execute(); | cmd.execute(); | ||||
@@ -412,10 +414,10 @@ public class SignJar extends AbstractJarSignerTask { | |||||
* If the tsa parameters are set, this passes them to the command. | * If the tsa parameters are set, this passes them to the command. | ||||
* There is no validation of java version, as third party JDKs | * There is no validation of java version, as third party JDKs | ||||
* may implement this on earlier/later jarsigner implementations. | * may implement this on earlier/later jarsigner implementations. | ||||
* @param cmd | |||||
* @param cmd the exec task. | |||||
*/ | */ | ||||
private void addTimestampAuthorityCommands(final ExecTask cmd) { | private void addTimestampAuthorityCommands(final ExecTask cmd) { | ||||
if(tsaurl!=null) { | |||||
if (tsaurl != null) { | |||||
addValue(cmd, "-tsa"); | addValue(cmd, "-tsa"); | ||||
addValue(cmd, tsaurl); | addValue(cmd, tsaurl); | ||||
} | } | ||||
@@ -81,8 +81,6 @@ public class SubAnt | |||||
/** the targets to call on the new project */ | /** the targets to call on the new project */ | ||||
private Vector/*<TargetElement>*/ targets = new Vector(); | private Vector/*<TargetElement>*/ targets = new Vector(); | ||||
/** | /** | ||||
* Pass output sent to System.out to the new project. | * Pass output sent to System.out to the new project. | ||||
@@ -282,11 +280,11 @@ public class SubAnt | |||||
ant = createAntTask(directory); | ant = createAntTask(directory); | ||||
String antfilename = file.getAbsolutePath(); | String antfilename = file.getAbsolutePath(); | ||||
ant.setAntfile(antfilename); | ant.setAntfile(antfilename); | ||||
for (int i=0; i<targets.size(); i++) { | |||||
TargetElement targetElement = (TargetElement)targets.get(i); | |||||
for (int i = 0; i < targets.size(); i++) { | |||||
TargetElement targetElement = (TargetElement) targets.get(i); | |||||
ant.addConfiguredTarget(targetElement); | ant.addConfiguredTarget(targetElement); | ||||
} | } | ||||
try { | try { | ||||
ant.execute(); | ant.execute(); | ||||
} catch (BuildException e) { | } catch (BuildException e) { | ||||
@@ -367,7 +365,7 @@ public class SubAnt | |||||
} | } | ||||
targets.add(t); | targets.add(t); | ||||
} | } | ||||
/** | /** | ||||
* Enable/ disable verbose log messages showing when each sub-build path is entered/ exited. | * Enable/ disable verbose log messages showing when each sub-build path is entered/ exited. | ||||
* The default value is "false". | * The default value is "false". | ||||
@@ -606,4 +604,4 @@ public class SubAnt | |||||
} | } | ||||
} | } | ||||
} // END class SubAnt | |||||
} // END class SubAnt |
@@ -415,6 +415,7 @@ public class Sync extends Task { | |||||
/** | /** | ||||
* Yes, we can. | * Yes, we can. | ||||
* @return true always. | |||||
* @since Ant 1.7 | * @since Ant 1.7 | ||||
*/ | */ | ||||
protected boolean supportsNonFileResources() { | protected boolean supportsNonFileResources() { | ||||
@@ -133,7 +133,7 @@ public class Tar extends MatchingTask { | |||||
/** | /** | ||||
* Set is the name/location of where to create the tar file. | * Set is the name/location of where to create the tar file. | ||||
* @param tarFile the location of the tar file. | * @param tarFile the location of the tar file. | ||||
* @deprecated since 1.5.x. | |||||
* @deprecated since 1.5.x. | |||||
* For consistency with other tasks, please use setDestFile(). | * For consistency with other tasks, please use setDestFile(). | ||||
*/ | */ | ||||
public void setTarfile(File tarFile) { | public void setTarfile(File tarFile) { | ||||
@@ -426,8 +426,9 @@ public class Tar extends MatchingTask { | |||||
if (!r.isDirectory()) { | if (!r.isDirectory()) { | ||||
if (r.size() > TarConstants.MAXSIZE) { | if (r.size() > TarConstants.MAXSIZE) { | ||||
throw new BuildException("Resource: " + r + " larger than " + | |||||
TarConstants.MAXSIZE + " bytes."); | |||||
throw new BuildException( | |||||
"Resource: " + r + " larger than " | |||||
+ TarConstants.MAXSIZE + " bytes."); | |||||
} | } | ||||
te.setSize(r.getSize()); | te.setSize(r.getSize()); | ||||
// override permissions if set explicitly | // override permissions if set explicitly | ||||
@@ -480,7 +481,7 @@ public class Tar extends MatchingTask { | |||||
* Is the archive up to date in relationship to a list of files. | * Is the archive up to date in relationship to a list of files. | ||||
* @param files the files to check | * @param files the files to check | ||||
* @return true if the archive is up to date. | * @return true if the archive is up to date. | ||||
* @deprecated since 1.5.x. | |||||
* @deprecated since 1.5.x. | |||||
* use the two-arg version instead. | * use the two-arg version instead. | ||||
*/ | */ | ||||
protected boolean archiveIsUpToDate(String[] files) { | protected boolean archiveIsUpToDate(String[] files) { | ||||
@@ -521,7 +522,7 @@ public class Tar extends MatchingTask { | |||||
* support non-file resources needs to override this method. We | * support non-file resources needs to override this method. We | ||||
* need to do so for backwards compatibility reasons since we | * need to do so for backwards compatibility reasons since we | ||||
* can't expect subclasses to support resources.</p> | * can't expect subclasses to support resources.</p> | ||||
* | |||||
* @return true for this task. | |||||
* @since Ant 1.7 | * @since Ant 1.7 | ||||
*/ | */ | ||||
protected boolean supportsNonFileResources() { | protected boolean supportsNonFileResources() { | ||||
@@ -619,6 +620,7 @@ public class Tar extends MatchingTask { | |||||
* | * | ||||
* @param rc the collection containing resources to add | * @param rc the collection containing resources to add | ||||
* @param tOut stream writing to the archive. | * @param tOut stream writing to the archive. | ||||
* @throws IOException on error. | |||||
* @since Ant 1.7 | * @since Ant 1.7 | ||||
*/ | */ | ||||
protected void tar(ResourceCollection rc, TarOutputStream tOut) | protected void tar(ResourceCollection rc, TarOutputStream tOut) | ||||
@@ -666,6 +668,7 @@ public class Tar extends MatchingTask { | |||||
/** | /** | ||||
* whether the given resource collection is a (subclass of) | * whether the given resource collection is a (subclass of) | ||||
* FileSet that only contains file system resources. | * FileSet that only contains file system resources. | ||||
* @return true if the collection is a fileset. | |||||
* @since Ant 1.7 | * @since Ant 1.7 | ||||
*/ | */ | ||||
protected static final boolean isFileFileSet(ResourceCollection rc) { | protected static final boolean isFileFileSet(ResourceCollection rc) { | ||||
@@ -675,7 +678,7 @@ public class Tar extends MatchingTask { | |||||
/** | /** | ||||
* Grabs all included files and directors from the FileSet and | * Grabs all included files and directors from the FileSet and | ||||
* returns them as an array of (relative) file names. | * returns them as an array of (relative) file names. | ||||
* | |||||
* @return a list of the filenames. | |||||
* @since Ant 1.7 | * @since Ant 1.7 | ||||
*/ | */ | ||||
protected static final String[] getFileNames(FileSet fs) { | protected static final String[] getFileNames(FileSet fs) { | ||||
@@ -695,6 +698,7 @@ public class Tar extends MatchingTask { | |||||
* it already is a TarFileSet). | * it already is a TarFileSet). | ||||
* | * | ||||
* @param archiveFileSet fileset to copy attributes from, may be null | * @param archiveFileSet fileset to copy attributes from, may be null | ||||
* @return a new TarFileSet. | |||||
* @since Ant 1.7 | * @since Ant 1.7 | ||||
*/ | */ | ||||
protected TarFileSet asTarFileSet(ArchiveFileSet archiveFileSet) { | protected TarFileSet asTarFileSet(ArchiveFileSet archiveFileSet) { | ||||
@@ -715,9 +719,9 @@ public class Tar extends MatchingTask { | |||||
tfs.integerSetDirMode(archiveFileSet | tfs.integerSetDirMode(archiveFileSet | ||||
.getDirMode(getProject())); | .getDirMode(getProject())); | ||||
} | } | ||||
if (archiveFileSet instanceof | |||||
org.apache.tools.ant.types.TarFileSet) { | |||||
if (archiveFileSet | |||||
instanceof org.apache.tools.ant.types.TarFileSet) { | |||||
org.apache.tools.ant.types.TarFileSet t = | org.apache.tools.ant.types.TarFileSet t = | ||||
(org.apache.tools.ant.types.TarFileSet) archiveFileSet; | (org.apache.tools.ant.types.TarFileSet) archiveFileSet; | ||||
if (t.hasUserNameBeenSet()) { | if (t.hasUserNameBeenSet()) { | ||||
@@ -209,7 +209,7 @@ public class Touch extends Task { | |||||
/** | /** | ||||
* Add a collection of resources to touch. | * Add a collection of resources to touch. | ||||
* | |||||
* @param rc the collection to add. | |||||
* @since Ant 1.7 | * @since Ant 1.7 | ||||
*/ | */ | ||||
public void add(ResourceCollection rc) { | public void add(ResourceCollection rc) { | ||||
@@ -144,7 +144,7 @@ public class Tstamp extends Task { | |||||
/** | /** | ||||
* The date/time pattern to be used. The values are as | * The date/time pattern to be used. The values are as | ||||
* defined by the Java SimpleDateFormat class. | * defined by the Java SimpleDateFormat class. | ||||
* @param pattern | |||||
* @param pattern the pattern to use. | |||||
* @see java.text.SimpleDateFormat | * @see java.text.SimpleDateFormat | ||||
*/ | */ | ||||
public void setPattern(String pattern) { | public void setPattern(String pattern) { | ||||
@@ -157,7 +157,7 @@ public class Tstamp extends Task { | |||||
* either variant or variant and country may be omitted. | * either variant or variant and country may be omitted. | ||||
* For more information please refer to documentation | * For more information please refer to documentation | ||||
* for the java.util.Locale class. | * for the java.util.Locale class. | ||||
* @param locale | |||||
* @param locale the locale to use. | |||||
* @see java.util.Locale | * @see java.util.Locale | ||||
*/ | */ | ||||
public void setLocale(String locale) { | public void setLocale(String locale) { | ||||
@@ -39,7 +39,7 @@ public abstract class Unpack extends Task { | |||||
protected Resource srcResource; | protected Resource srcResource; | ||||
/** | /** | ||||
* @deprecated since 1.5.x. | |||||
* @deprecated since 1.5.x. | |||||
* setSrc(String) is deprecated and is replaced with | * setSrc(String) is deprecated and is replaced with | ||||
* setSrc(File) to make Ant's Introspection | * setSrc(File) to make Ant's Introspection | ||||
* mechanism do the work and also to encapsulate operations on | * mechanism do the work and also to encapsulate operations on | ||||
@@ -54,7 +54,7 @@ public abstract class Unpack extends Task { | |||||
} | } | ||||
/** | /** | ||||
* @deprecated since 1.5.x. | |||||
* @deprecated since 1.5.x. | |||||
* setDest(String) is deprecated and is replaced with | * setDest(String) is deprecated and is replaced with | ||||
* setDest(File) to make Ant's Introspection | * setDest(File) to make Ant's Introspection | ||||
* mechanism do the work and also to encapsulate operations on | * mechanism do the work and also to encapsulate operations on | ||||
@@ -176,7 +176,7 @@ public abstract class Unpack extends Task { | |||||
* Whether this task can deal with non-file resources. | * Whether this task can deal with non-file resources. | ||||
* | * | ||||
* <p>This implementation returns false.</p> | * <p>This implementation returns false.</p> | ||||
* | |||||
* @return false for this task. | |||||
* @since Ant 1.7 | * @since Ant 1.7 | ||||
*/ | */ | ||||
protected boolean supportsNonFileResources() { | protected boolean supportsNonFileResources() { | ||||
@@ -131,7 +131,7 @@ public class Untar extends Expand { | |||||
throws IOException { | throws IOException { | ||||
TarInputStream tis = null; | TarInputStream tis = null; | ||||
try { | try { | ||||
tis = | |||||
tis = | |||||
new TarInputStream(compression.decompress(name, | new TarInputStream(compression.decompress(name, | ||||
new BufferedInputStream(stream))); | new BufferedInputStream(stream))); | ||||
log("Expanding: " + name + " into " + dir, Project.MSG_INFO); | log("Expanding: " + name + " into " + dir, Project.MSG_INFO); | ||||
@@ -112,6 +112,7 @@ public class UpToDate extends Task implements Condition { | |||||
/** | /** | ||||
* Nested resource collections as sources. | * Nested resource collections as sources. | ||||
* @return the source resources to configure. | |||||
* @since Ant 1.7 | * @since Ant 1.7 | ||||
*/ | */ | ||||
public Union createSrcResources() { | public Union createSrcResources() { | ||||
@@ -207,10 +208,9 @@ public class UpToDate extends Task implements Condition { | |||||
if (upToDate) { | if (upToDate) { | ||||
Resource[] r = sourceResources.listResources(); | Resource[] r = sourceResources.listResources(); | ||||
upToDate = upToDate && | |||||
(ResourceUtils.selectOutOfDateSources(this, r, getMapper(), | |||||
getProject()).length | |||||
== 0); | |||||
upToDate = upToDate | |||||
&& (ResourceUtils.selectOutOfDateSources( | |||||
this, r, getMapper(), getProject()).length == 0); | |||||
} | } | ||||
return upToDate; | return upToDate; | ||||
@@ -53,13 +53,13 @@ public class VerifyJar extends AbstractJarSignerTask { | |||||
/** | /** | ||||
* certification flag | * certification flag | ||||
*/ | */ | ||||
private boolean certificates=false; | |||||
private boolean certificates = false; | |||||
private BufferingOutputFilter outputCache = new BufferingOutputFilter(); | private BufferingOutputFilter outputCache = new BufferingOutputFilter(); | ||||
public static final String ERROR_NO_VERIFY = "Failed to verify "; | public static final String ERROR_NO_VERIFY = "Failed to verify "; | ||||
/** | /** | ||||
* Ask for certificate information to be printed | * Ask for certificate information to be printed | ||||
* @param certificates | |||||
* @param certificates if true print certificates. | |||||
*/ | */ | ||||
public void setCertificates(boolean certificates) { | public void setCertificates(boolean certificates) { | ||||
this.certificates = certificates; | this.certificates = certificates; | ||||
@@ -67,7 +67,7 @@ public class VerifyJar extends AbstractJarSignerTask { | |||||
/** | /** | ||||
* verify our jar files | * verify our jar files | ||||
* @throws BuildException | |||||
* @throws BuildException on error. | |||||
*/ | */ | ||||
public void execute() throws BuildException { | public void execute() throws BuildException { | ||||
//validation logic | //validation logic | ||||
@@ -101,12 +101,12 @@ public class VerifyJar extends AbstractJarSignerTask { | |||||
/** | /** | ||||
* verify a JAR. | * verify a JAR. | ||||
* @param jar | |||||
* @param jar the jar to verify. | |||||
* @throws BuildException if the file could not be verified | * @throws BuildException if the file could not be verified | ||||
*/ | */ | ||||
private void verifyOneJar(File jar) { | private void verifyOneJar(File jar) { | ||||
if(!jar.exists()) { | |||||
throw new BuildException(ERROR_NO_FILE+jar); | |||||
if (!jar.exists()) { | |||||
throw new BuildException(ERROR_NO_FILE + jar); | |||||
} | } | ||||
final ExecTask cmd = createJarSigner(); | final ExecTask cmd = createJarSigner(); | ||||
@@ -116,15 +116,14 @@ public class VerifyJar extends AbstractJarSignerTask { | |||||
//verify special operations | //verify special operations | ||||
addValue(cmd, "-verify"); | addValue(cmd, "-verify"); | ||||
if(certificates) { | |||||
if (certificates) { | |||||
addValue(cmd, "-certs"); | addValue(cmd, "-certs"); | ||||
} | } | ||||
//JAR is required | //JAR is required | ||||
addValue(cmd, jar.getPath()); | addValue(cmd, jar.getPath()); | ||||
log("Verifying JAR: " + | |||||
jar.getAbsolutePath()); | |||||
log("Verifying JAR: " + jar.getAbsolutePath()); | |||||
outputCache.clear(); | outputCache.clear(); | ||||
BuildException ex = null; | BuildException ex = null; | ||||
try { | try { | ||||
@@ -165,7 +164,7 @@ public class VerifyJar extends AbstractJarSignerTask { | |||||
} | } | ||||
public void clear() { | public void clear() { | ||||
if(buffer!=null) { | |||||
if (buffer != null) { | |||||
buffer.clear(); | buffer.clear(); | ||||
} | } | ||||
} | } | ||||
@@ -178,17 +177,17 @@ public class VerifyJar extends AbstractJarSignerTask { | |||||
private Reader next; | private Reader next; | ||||
private StringBuffer buffer=new StringBuffer(); | |||||
private StringBuffer buffer = new StringBuffer(); | |||||
public BufferingOutputFilterReader(Reader next) { | public BufferingOutputFilterReader(Reader next) { | ||||
this.next = next; | this.next = next; | ||||
} | } | ||||
public int read(char cbuf[], int off, int len) throws IOException { | |||||
public int read(char[] cbuf, int off, int len) throws IOException { | |||||
//hand down | //hand down | ||||
int result=next.read(cbuf,off,len); | |||||
int result = next.read(cbuf, off, len); | |||||
//cache | //cache | ||||
buffer.append(cbuf,off,len); | |||||
buffer.append(cbuf, off, len); | |||||
//return | //return | ||||
return result; | return result; | ||||
} | } | ||||
@@ -202,7 +201,7 @@ public class VerifyJar extends AbstractJarSignerTask { | |||||
} | } | ||||
public void clear() { | public void clear() { | ||||
buffer=new StringBuffer(); | |||||
buffer = new StringBuffer(); | |||||
} | } | ||||
} | } | ||||
} | } |
@@ -155,7 +155,7 @@ public class WaitFor extends ConditionBase { | |||||
* @since Ant1.7 | * @since Ant1.7 | ||||
*/ | */ | ||||
protected void processSuccess() { | protected void processSuccess() { | ||||
log(getTaskName()+": condition was met", Project.MSG_VERBOSE); | |||||
log(getTaskName() + ": condition was met", Project.MSG_VERBOSE); | |||||
} | } | ||||
/** | /** | ||||
@@ -166,7 +166,7 @@ public class WaitFor extends ConditionBase { | |||||
* @since Ant1.7 | * @since Ant1.7 | ||||
*/ | */ | ||||
protected void processTimeout() { | protected void processTimeout() { | ||||
log(getTaskName() +": timeout", Project.MSG_VERBOSE); | |||||
log(getTaskName() + ": timeout", Project.MSG_VERBOSE); | |||||
if (timeoutProperty != null) { | if (timeoutProperty != null) { | ||||
getProject().setNewProperty(timeoutProperty, "true"); | getProject().setNewProperty(timeoutProperty, "true"); | ||||
} | } | ||||
@@ -55,7 +55,7 @@ public class War extends Jar { | |||||
/** | /** | ||||
* flag set if the descriptor is added | * flag set if the descriptor is added | ||||
*/ | */ | ||||
private boolean needxmlfile=true; | |||||
private boolean needxmlfile = true; | |||||
private File addedWebXmlFile; | private File addedWebXmlFile; | ||||
private static final FileUtils FILE_UTILS = FileUtils.getFileUtils(); | private static final FileUtils FILE_UTILS = FileUtils.getFileUtils(); | ||||
@@ -189,16 +189,16 @@ public class War extends Jar { | |||||
//check to see if we warn or not | //check to see if we warn or not | ||||
if (!FILE_UTILS.fileNameEquals(addedWebXmlFile, file)) { | if (!FILE_UTILS.fileNameEquals(addedWebXmlFile, file)) { | ||||
log("Warning: selected " + archiveType | log("Warning: selected " + archiveType | ||||
+" files include a second " +XML_DESCRIPTOR_PATH | |||||
+ " files include a second " + XML_DESCRIPTOR_PATH | |||||
+ " which will be ignored.\n" | + " which will be ignored.\n" | ||||
+ "The duplicate entry is at " +file +'\n' | |||||
+ "The duplicate entry is at " + file + '\n' | |||||
+ "The file that will be used is " | + "The file that will be used is " | ||||
+ addedWebXmlFile, | + addedWebXmlFile, | ||||
Project.MSG_WARN); | Project.MSG_WARN); | ||||
} | } | ||||
} else { | } else { | ||||
//no added file, yet | //no added file, yet | ||||
addedWebXmlFile=file; | |||||
addedWebXmlFile = file; | |||||
//there is no web.xml file, so add it | //there is no web.xml file, so add it | ||||
addFile = true; | addFile = true; | ||||
//and remember that we did | //and remember that we did | ||||
@@ -216,9 +216,9 @@ public class War extends Jar { | |||||
* gets executed. | * gets executed. | ||||
*/ | */ | ||||
protected void cleanUp() { | protected void cleanUp() { | ||||
if(addedWebXmlFile==null && needxmlfile && !isInUpdateMode()) { | |||||
if (addedWebXmlFile == null && needxmlfile && !isInUpdateMode()) { | |||||
throw new BuildException("No WEB-INF/web.xml file was added.\n" | throw new BuildException("No WEB-INF/web.xml file was added.\n" | ||||
+"If this is your intent, set needxml='false' "); | |||||
+ "If this is your intent, set needxml='false' "); | |||||
} | } | ||||
addedWebXmlFile = null; | addedWebXmlFile = null; | ||||
super.cleanUp(); | super.cleanUp(); | ||||
@@ -1058,7 +1058,9 @@ public class XSLTProcess extends MatchingTask implements XSLTLogger { | |||||
File file = new File(fileName); | File file = new File(fileName); | ||||
// Give always a slash as file separator, so the stylesheet could be sure about that | // Give always a slash as file separator, so the stylesheet could be sure about that | ||||
// Use '.' so a dir+"/"+name would not result in an absolute path | // Use '.' so a dir+"/"+name would not result in an absolute path | ||||
liaison.addParam(fileDirParameter, (file.getParent()!=null) ? file.getParent().replace('\\','/') : "." ); | |||||
liaison.addParam( | |||||
fileDirParameter, | |||||
(file.getParent()!=null) ? file.getParent().replace('\\','/') : "." ); | |||||
} | } | ||||
} | } | ||||
@@ -282,14 +282,14 @@ public class XmlProperty extends org.apache.tools.ant.Task { | |||||
if (sxe.getException() != null) { | if (sxe.getException() != null) { | ||||
x = sxe.getException(); | x = sxe.getException(); | ||||
} | } | ||||
throw new BuildException("Failed to load "+src,x); | |||||
throw new BuildException("Failed to load " + src, x); | |||||
} catch (ParserConfigurationException pce) { | } catch (ParserConfigurationException pce) { | ||||
// Parser with specified options can't be built | // Parser with specified options can't be built | ||||
throw new BuildException(pce); | throw new BuildException(pce); | ||||
} catch (IOException ioe) { | } catch (IOException ioe) { | ||||
// I/O error | // I/O error | ||||
throw new BuildException("Failed to load " + src,ioe); | |||||
throw new BuildException("Failed to load " + src, ioe); | |||||
} | } | ||||
} | } | ||||
@@ -766,7 +766,7 @@ public class XmlProperty extends org.apache.tools.ant.Task { | |||||
*/ | */ | ||||
private File resolveFile(String fileName) { | private File resolveFile(String fileName) { | ||||
if (rootDirectory == null) { | if (rootDirectory == null) { | ||||
return FILE_UTILS.resolveFile(getProject().getBaseDir(),fileName); | |||||
return FILE_UTILS.resolveFile(getProject().getBaseDir(), fileName); | |||||
} | } | ||||
return FILE_UTILS.resolveFile(rootDirectory, fileName); | return FILE_UTILS.resolveFile(rootDirectory, fileName); | ||||
} | } | ||||
@@ -779,7 +779,7 @@ public class XmlProperty extends org.apache.tools.ant.Task { | |||||
* support non-file resources needs to override this method. We | * support non-file resources needs to override this method. We | ||||
* need to do so for backwards compatibility reasons since we | * need to do so for backwards compatibility reasons since we | ||||
* can't expect subclasses to support resources.</p> | * can't expect subclasses to support resources.</p> | ||||
* | |||||
* @return true for this task. | |||||
* @since Ant 1.7 | * @since Ant 1.7 | ||||
*/ | */ | ||||
protected boolean supportsNonFileResources() { | protected boolean supportsNonFileResources() { | ||||
@@ -979,7 +979,7 @@ public class Zip extends MatchingTask { | |||||
*/ | */ | ||||
as = getNonFileSetResourcesToAdd(rc, zipFile, true); | as = getNonFileSetResourcesToAdd(rc, zipFile, true); | ||||
} | } | ||||
Resource[][] toAdd = new Resource[rcs.length][]; | Resource[][] toAdd = new Resource[rcs.length][]; | ||||
int fsIndex = 0; | int fsIndex = 0; | ||||
int restIndex = 0; | int restIndex = 0; | ||||
@@ -65,7 +65,7 @@ import java.util.Vector; | |||||
* exposed to end-users, because it was too brittle during beta testing; classpath | * exposed to end-users, because it was too brittle during beta testing; classpath | ||||
* problems being the core issue. | * problems being the core issue. | ||||
* | * | ||||
* | |||||
* | |||||
* | * | ||||
* @since Ant 1.7 | * @since Ant 1.7 | ||||
*/ | */ | ||||
@@ -156,7 +156,7 @@ public class AptCompilerAdapter extends DefaultCompilerAdapter { | |||||
/** | /** | ||||
* Run the compilation. | * Run the compilation. | ||||
* | |||||
* @retrun true on success. | |||||
* @throws BuildException if the compilation has problems. | * @throws BuildException if the compilation has problems. | ||||
*/ | */ | ||||
public boolean execute() throws BuildException { | public boolean execute() throws BuildException { | ||||