From 1909e147eef504b349518a1e78d89beb28df4a31 Mon Sep 17 00:00:00 2001
From: Gintas Grigelionis Postcondition: request.getInput will return a non-null
* value, request.isInputValid will return true. Only the "action" attribute is required in the
* base class. Subclasses should check attributes accordingly.
- * @exception org.apache.tools.ant.BuildException if the attributes are invalid or incomplete.
+ * @throws BuildException if the attributes are invalid or incomplete.
*/
public void validateAttributes() throws BuildException {
if (task.getAction() == null) {
diff --git a/src/main/org/apache/tools/ant/taskdefs/optional/j2ee/GenericHotDeploymentTool.java b/src/main/org/apache/tools/ant/taskdefs/optional/j2ee/GenericHotDeploymentTool.java
index 5a5abbab6..e4a5b6b7b 100644
--- a/src/main/org/apache/tools/ant/taskdefs/optional/j2ee/GenericHotDeploymentTool.java
+++ b/src/main/org/apache/tools/ant/taskdefs/optional/j2ee/GenericHotDeploymentTool.java
@@ -88,7 +88,7 @@ public class GenericHotDeploymentTool extends AbstractHotDeploymentTool {
* Perform the actual deployment.
* For this generic implementation, a JVM is spawned using the
* supplied classpath, classname, JVM args, and command line arguments.
- * @exception org.apache.tools.ant.BuildException if the attributes are invalid or incomplete.
+ * @exception BuildException if the attributes are invalid or incomplete.
*/
public void deploy() throws BuildException {
java.setClassname(className);
@@ -101,7 +101,7 @@ public class GenericHotDeploymentTool extends AbstractHotDeploymentTool {
/**
* Validates the passed in attributes.
* Ensures the className and arguments attribute have been set.
- * @exception org.apache.tools.ant.BuildException if the attributes are invalid or incomplete.
+ * @throws BuildException if the attributes are invalid or incomplete.
*/
public void validateAttributes() throws BuildException {
super.validateAttributes();
diff --git a/src/main/org/apache/tools/ant/taskdefs/optional/j2ee/HotDeploymentTool.java b/src/main/org/apache/tools/ant/taskdefs/optional/j2ee/HotDeploymentTool.java
index 16c55d8e7..dae9667c8 100644
--- a/src/main/org/apache/tools/ant/taskdefs/optional/j2ee/HotDeploymentTool.java
+++ b/src/main/org/apache/tools/ant/taskdefs/optional/j2ee/HotDeploymentTool.java
@@ -43,13 +43,13 @@ public interface HotDeploymentTool {
/**
* Validates the passed in attributes.
- * @exception org.apache.tools.ant.BuildException if the attributes are invalid or incomplete.
+ * @exception BuildException if the attributes are invalid or incomplete.
*/
void validateAttributes() throws BuildException;
/**
* Perform the actual deployment.
- * @exception org.apache.tools.ant.BuildException if the attributes are invalid or incomplete.
+ * @throws BuildException if the attributes are invalid or incomplete.
*/
void deploy() throws BuildException;
diff --git a/src/main/org/apache/tools/ant/taskdefs/optional/j2ee/ServerDeploy.java b/src/main/org/apache/tools/ant/taskdefs/optional/j2ee/ServerDeploy.java
index 8965b8e88..02d6f61cb 100644
--- a/src/main/org/apache/tools/ant/taskdefs/optional/j2ee/ServerDeploy.java
+++ b/src/main/org/apache/tools/ant/taskdefs/optional/j2ee/ServerDeploy.java
@@ -97,7 +97,7 @@ public class ServerDeploy extends Task {
* This method calls the deploy() method on each of the vendor-specific tools
* in the true
if and only if this enumeration object
- * contains at least one more element to provide;
- * false
otherwise.
- */
- public boolean hasMoreElements() {
- return (pos < array.length);
- }
+ /**
+ * Initialize a new enumeration that wraps an array.
+ * @param array the array of object to enumerate.
+ */
+ public ArrayEnumeration(Object[] array) {
+ this.array = array;
+ this.pos = 0;
+ }
+ /**
+ * Tests if this enumeration contains more elements.
+ *
+ * @return true
if and only if this enumeration object
+ * contains at least one more element to provide;
+ * false
otherwise.
+ */
+ public boolean hasMoreElements() {
+ return (pos < array.length);
+ }
- /**
- * Returns the next element of this enumeration if this enumeration
- * object has at least one more element to provide.
- *
- * @return the next element of this enumeration.
- * @throws NoSuchElementException if no more elements exist.
- */
- public Object nextElement() throws NoSuchElementException {
- if (hasMoreElements()) {
- Object o = array[pos];
- pos++;
- return o;
- }
- throw new NoSuchElementException();
+ /**
+ * Returns the next element of this enumeration if this enumeration
+ * object has at least one more element to provide.
+ *
+ * @return the next element of this enumeration.
+ * @throws NoSuchElementException if no more elements exist.
+ */
+ public Object nextElement() throws NoSuchElementException {
+ if (hasMoreElements()) {
+ Object o = array[pos];
+ pos++;
+ return o;
}
+ throw new NoSuchElementException();
+ }
}
/**
* Convenient enumeration over an array of enumeration. For example:
@@ -130,48 +129,46 @@ class ArrayEnumeration implements Enumeration {
* }
*
*/
- class CompoundEnumeration implements Enumeration {
+class CompoundEnumeration implements Enumeration {
- /** enumeration array */
- private Enumeration[] enumArray;
+ /** enumeration array */
+ private Enumeration[] enumArray;
- /** index in the enums array */
- private int index = 0;
+ /** index in the enums array */
+ private int index = 0;
public CompoundEnumeration(Enumeration[] enumarray) {
- this.enumArray = enumarray;
+ this.enumArray = enumarray;
}
- /**
- * Tests if this enumeration contains more elements.
- *
- * @return true
if and only if this enumeration object
- * contains at least one more element to provide;
- * false
otherwise.
- */
+ /**
+ * Tests if this enumeration contains more elements.
+ *
+ * @return true
if and only if this enumeration object
+ * contains at least one more element to provide;
+ * false
otherwise.
+ */
public boolean hasMoreElements() {
- while (index < enumArray.length) {
- if (enumArray[index] != null && enumArray[index].hasMoreElements()) {
- return true;
- }
- index++;
- }
- return false;
+ while (index < enumArray.length) {
+ if (enumArray[index] != null && enumArray[index].hasMoreElements()) {
+ return true;
+ }
+ index++;
+ }
+ return false;
}
- /**
- * Returns the next element of this enumeration if this enumeration
- * object has at least one more element to provide.
- *
- * @return the next element of this enumeration.
- * @throws NoSuchElementException if no more elements exist.
- */
+ /**
+ * Returns the next element of this enumeration if this enumeration
+ * object has at least one more element to provide.
+ *
+ * @return the next element of this enumeration.
+ * @throws NoSuchElementException if no more elements exist.
+ */
public Object nextElement() throws NoSuchElementException {
- if (hasMoreElements()) {
- return enumArray[index].nextElement();
- }
- throw new NoSuchElementException();
+ if (hasMoreElements()) {
+ return enumArray[index].nextElement();
+ }
+ throw new NoSuchElementException();
}
}
-
-
diff --git a/src/tests/junit/org/apache/tools/ant/BuildFileRule.java b/src/tests/junit/org/apache/tools/ant/BuildFileRule.java
index c5a71c75a..a4441098a 100644
--- a/src/tests/junit/org/apache/tools/ant/BuildFileRule.java
+++ b/src/tests/junit/org/apache/tools/ant/BuildFileRule.java
@@ -170,7 +170,7 @@ public class BuildFileRule extends ExternalResource {
*
* @param targetName the target in the currently configured build file to run.
*/
- public void executeTarget(String targetName) {
+ public void executeTarget(String targetName) {
outputBuffer = new StringBuffer();
PrintStream out = new PrintStream(new AntOutputStream(outputBuffer));
errorBuffer = new StringBuffer();
From fd514f77c1be33f307e78baeda66080a23f5d7b8 Mon Sep 17 00:00:00 2001
From: Gintas Grigelionis src
to dest
- * @exception org.apache.tools.ant.BuildException The exception is
- * thrown, if the rename operation fails.
+ *
+ * @throws BuildException if the rename operation fails
*/
public void execute() throws BuildException {
log("DEPRECATED - The rename task is deprecated. Use move instead.");
diff --git a/src/main/org/apache/tools/ant/taskdefs/Rmic.java b/src/main/org/apache/tools/ant/taskdefs/Rmic.java
index 0a54b3efe..e093e498a 100644
--- a/src/main/org/apache/tools/ant/taskdefs/Rmic.java
+++ b/src/main/org/apache/tools/ant/taskdefs/Rmic.java
@@ -590,7 +590,7 @@ public class Rmic extends MatchingTask {
/**
* execute by creating an instance of an implementation
* class and getting to do the work
- * @throws org.apache.tools.ant.BuildException
+ * @throws BuildException
* if there's a problem with baseDir or RMIC
*/
@Override
@@ -701,7 +701,7 @@ public class Rmic extends MatchingTask {
/**
* Move the generated source file(s) to the base directory
*
- * @throws org.apache.tools.ant.BuildException When error
+ * @throws BuildException When error
* copying/removing files.
*/
private void moveGeneratedFile(File baseDir, File sourceBaseFile, String classname,
diff --git a/src/main/org/apache/tools/ant/taskdefs/Sleep.java b/src/main/org/apache/tools/ant/taskdefs/Sleep.java
index 6468c3901..7f124cca1 100644
--- a/src/main/org/apache/tools/ant/taskdefs/Sleep.java
+++ b/src/main/org/apache/tools/ant/taskdefs/Sleep.java
@@ -166,10 +166,9 @@ public class Sleep extends Task {
/**
- * Executes this build task. Throws org.apache.tools.ant.BuildException
- * if there is an error during task execution.
+ * Executes this build task.
*
- * @exception BuildException Description of Exception
+ * @throws BuildException if there is an error during task execution
*/
@Override
public void execute()
diff --git a/src/main/org/apache/tools/ant/taskdefs/XSLTProcess.java b/src/main/org/apache/tools/ant/taskdefs/XSLTProcess.java
index 83943141f..a28e15346 100644
--- a/src/main/org/apache/tools/ant/taskdefs/XSLTProcess.java
+++ b/src/main/org/apache/tools/ant/taskdefs/XSLTProcess.java
@@ -41,6 +41,7 @@ import org.apache.tools.ant.DynamicConfigurator;
import org.apache.tools.ant.Project;
import org.apache.tools.ant.ProjectComponent;
import org.apache.tools.ant.PropertyHelper;
+import org.apache.tools.ant.taskdefs.optional.TraXLiaison;
import org.apache.tools.ant.types.CommandlineJava;
import org.apache.tools.ant.types.Environment;
import org.apache.tools.ant.types.Mapper;
@@ -713,7 +714,7 @@ public class XSLTProcess extends MatchingTask implements XSLTLogger {
*/
private void resolveProcessor(final String proc) throws Exception {
if (proc.equals(PROCESSOR_TRAX)) {
- liaison = new org.apache.tools.ant.taskdefs.optional.TraXLiaison();
+ liaison = new TraXLiaison();
} else {
//anything else is a classname
final Class clazz = loadClass(proc);
diff --git a/src/main/org/apache/tools/ant/taskdefs/XmlProperty.java b/src/main/org/apache/tools/ant/taskdefs/XmlProperty.java
index 6f64a888e..9feb3579d 100644
--- a/src/main/org/apache/tools/ant/taskdefs/XmlProperty.java
+++ b/src/main/org/apache/tools/ant/taskdefs/XmlProperty.java
@@ -27,6 +27,7 @@ import javax.xml.parsers.ParserConfigurationException;
import org.apache.tools.ant.BuildException;
import org.apache.tools.ant.Project;
+import org.apache.tools.ant.Task;
import org.apache.tools.ant.types.Path;
import org.apache.tools.ant.types.Resource;
import org.apache.tools.ant.types.ResourceCollection;
@@ -174,7 +175,7 @@ import org.xml.sax.SAXException;
*
* @ant.task name="xmlproperty" category="xml"
*/
-public class XmlProperty extends org.apache.tools.ant.Task {
+public class XmlProperty extends Task {
private Resource src;
private String prefix = "";
diff --git a/src/main/org/apache/tools/ant/taskdefs/condition/IsReachable.java b/src/main/org/apache/tools/ant/taskdefs/condition/IsReachable.java
index e673b828b..818393b06 100644
--- a/src/main/org/apache/tools/ant/taskdefs/condition/IsReachable.java
+++ b/src/main/org/apache/tools/ant/taskdefs/condition/IsReachable.java
@@ -136,7 +136,7 @@ public class IsReachable extends ProjectComponent implements Condition {
*
* @return true if the condition is true.
*
- * @throws org.apache.tools.ant.BuildException
+ * @throws BuildException
* if an error occurs
*/
public boolean eval() throws BuildException {
diff --git a/src/main/org/apache/tools/ant/taskdefs/condition/Xor.java b/src/main/org/apache/tools/ant/taskdefs/condition/Xor.java
index a2e675cb5..2cc8e4c49 100644
--- a/src/main/org/apache/tools/ant/taskdefs/condition/Xor.java
+++ b/src/main/org/apache/tools/ant/taskdefs/condition/Xor.java
@@ -31,7 +31,7 @@ public class Xor extends ConditionBase implements Condition {
/**
* Evaluate the contained conditions.
* @return the result of xoring the conditions together.
- * @throws org.apache.tools.ant.BuildException
+ * @throws BuildException
* if an error occurs.
*/
public boolean eval() throws BuildException {
diff --git a/src/main/org/apache/tools/ant/taskdefs/optional/ejb/BorlandDeploymentTool.java b/src/main/org/apache/tools/ant/taskdefs/optional/ejb/BorlandDeploymentTool.java
index 99694f6fd..0c9e63266 100644
--- a/src/main/org/apache/tools/ant/taskdefs/optional/ejb/BorlandDeploymentTool.java
+++ b/src/main/org/apache/tools/ant/taskdefs/optional/ejb/BorlandDeploymentTool.java
@@ -325,7 +325,7 @@ public class BorlandDeploymentTool extends GenericDeploymentTool
* @param sourceJar java.io.File representing the produced jar file
*/
private void verifyBorlandJarV4(File sourceJar) {
- org.apache.tools.ant.taskdefs.Java javaTask = null;
+ Java javaTask = null;
log("verify BAS " + sourceJar, Project.MSG_INFO);
try {
String args = verifyArgs;
diff --git a/src/main/org/apache/tools/ant/taskdefs/optional/j2ee/AbstractHotDeploymentTool.java b/src/main/org/apache/tools/ant/taskdefs/optional/j2ee/AbstractHotDeploymentTool.java
index 11447e028..7c47f713c 100644
--- a/src/main/org/apache/tools/ant/taskdefs/optional/j2ee/AbstractHotDeploymentTool.java
+++ b/src/main/org/apache/tools/ant/taskdefs/optional/j2ee/AbstractHotDeploymentTool.java
@@ -85,7 +85,7 @@ public abstract class AbstractHotDeploymentTool implements HotDeploymentTool {
* validation of boilerplate attributes.
* vendorTools
collection. This performs the actual
* process of deployment on each tool.
- * @exception org.apache.tools.ant.BuildException if the attributes
+ * @throws BuildException if the attributes
* are invalid or incomplete, or a failure occurs in the deployment process.
*/
public void execute() throws BuildException {
diff --git a/src/main/org/apache/tools/ant/taskdefs/optional/pvcs/Pvcs.java b/src/main/org/apache/tools/ant/taskdefs/optional/pvcs/Pvcs.java
index 6956019af..964466184 100644
--- a/src/main/org/apache/tools/ant/taskdefs/optional/pvcs/Pvcs.java
+++ b/src/main/org/apache/tools/ant/taskdefs/optional/pvcs/Pvcs.java
@@ -33,6 +33,7 @@ import java.util.Vector;
import org.apache.tools.ant.BuildException;
import org.apache.tools.ant.Project;
+import org.apache.tools.ant.Task;
import org.apache.tools.ant.taskdefs.Execute;
import org.apache.tools.ant.taskdefs.ExecuteStreamHandler;
import org.apache.tools.ant.taskdefs.LogOutputStream;
@@ -71,7 +72,7 @@ import org.apache.tools.ant.util.FileUtils;
* discussion.
*
*/
-public class Pvcs extends org.apache.tools.ant.Task {
+public class Pvcs extends Task {
// CheckStyle - magic numbers
// checking for "X:\ 0=dquote,1=letter,2=:,3=\
private static final int POS_1 = 1;
@@ -143,7 +144,7 @@ public class Pvcs extends org.apache.tools.ant.Task {
}
/**
- * @exception org.apache.tools.ant.BuildException Something is stopping the build...
+ * @throws BuildException Something is stopping the build...
*/
public void execute() throws org.apache.tools.ant.BuildException {
int result = 0;
diff --git a/src/main/org/apache/tools/ant/taskdefs/optional/unix/AbstractAccessTask.java b/src/main/org/apache/tools/ant/taskdefs/optional/unix/AbstractAccessTask.java
index 2e1331f68..a2b53db18 100644
--- a/src/main/org/apache/tools/ant/taskdefs/optional/unix/AbstractAccessTask.java
+++ b/src/main/org/apache/tools/ant/taskdefs/optional/unix/AbstractAccessTask.java
@@ -32,6 +32,7 @@ package org.apache.tools.ant.taskdefs.optional.unix;
import java.io.File;
import org.apache.tools.ant.BuildException;
+import org.apache.tools.ant.taskdefs.ExecuteOn;
import org.apache.tools.ant.taskdefs.condition.Os;
import org.apache.tools.ant.types.Commandline;
import org.apache.tools.ant.types.FileSet;
@@ -42,8 +43,7 @@ import org.apache.tools.ant.types.FileSet;
* @ant.task category="filesystem"
*/
-public abstract class AbstractAccessTask
- extends org.apache.tools.ant.taskdefs.ExecuteOn {
+public abstract class AbstractAccessTask extends ExecuteOn {
/**
* Chmod task for setting file and directory permissions.
diff --git a/src/main/org/apache/tools/ant/types/RedirectorElement.java b/src/main/org/apache/tools/ant/types/RedirectorElement.java
index e72d394eb..79ab146b8 100644
--- a/src/main/org/apache/tools/ant/types/RedirectorElement.java
+++ b/src/main/org/apache/tools/ant/types/RedirectorElement.java
@@ -27,6 +27,7 @@ import java.util.Vector;
import org.apache.tools.ant.BuildException;
import org.apache.tools.ant.Project;
import org.apache.tools.ant.taskdefs.Redirector;
+import org.apache.tools.ant.util.MergingMapper;
/**
* Element representation of a Redirector
.
@@ -556,8 +557,7 @@ public class RedirectorElement extends DataType {
*/
protected Mapper createMergeMapper(File destfile) {
Mapper result = new Mapper(getProject());
- result.setClassname(
- org.apache.tools.ant.util.MergingMapper.class.getName());
+ result.setClassname(MergingMapper.class.getName());
result.setTo(destfile.getAbsolutePath());
return result;
}
diff --git a/src/main/org/apache/tools/ant/types/optional/ScriptCondition.java b/src/main/org/apache/tools/ant/types/optional/ScriptCondition.java
index fac02bfa4..ee432b123 100644
--- a/src/main/org/apache/tools/ant/types/optional/ScriptCondition.java
+++ b/src/main/org/apache/tools/ant/types/optional/ScriptCondition.java
@@ -38,7 +38,7 @@ public class ScriptCondition extends AbstractScriptComponent implements Conditio
*
* @return true if the condition is true
*
- * @throws org.apache.tools.ant.BuildException
+ * @throws BuildException
* if an error occurs
*/
public boolean eval() throws BuildException {
diff --git a/src/main/org/apache/tools/ant/types/optional/ScriptSelector.java b/src/main/org/apache/tools/ant/types/optional/ScriptSelector.java
index c07ed13d8..45e8784f0 100644
--- a/src/main/org/apache/tools/ant/types/optional/ScriptSelector.java
+++ b/src/main/org/apache/tools/ant/types/optional/ScriptSelector.java
@@ -85,7 +85,7 @@ public class ScriptSelector extends BaseSelector {
/**
* Initialize on demand.
*
- * @throws org.apache.tools.ant.BuildException
+ * @throws BuildException
* if something goes wrong
*/
private void init() throws BuildException {
diff --git a/src/main/org/apache/tools/ant/types/selectors/TokenizedPath.java b/src/main/org/apache/tools/ant/types/selectors/TokenizedPath.java
index cc87786d2..ed899e4c0 100644
--- a/src/main/org/apache/tools/ant/types/selectors/TokenizedPath.java
+++ b/src/main/org/apache/tools/ant/types/selectors/TokenizedPath.java
@@ -78,7 +78,8 @@ public class TokenizedPath {
tokenizedPath[parent.tokenizedPath.length] = child;
}
- /* package */ TokenizedPath(String path, String[] tokens) {
+ /* package */
+ TokenizedPath(String path, String[] tokens) {
this.path = path;
this.tokenizedPath = tokens;
}
diff --git a/src/main/org/apache/tools/ant/types/selectors/modifiedselector/ModifiedSelector.java b/src/main/org/apache/tools/ant/types/selectors/modifiedselector/ModifiedSelector.java
index 0899f9128..c1bcac7a9 100644
--- a/src/main/org/apache/tools/ant/types/selectors/modifiedselector/ModifiedSelector.java
+++ b/src/main/org/apache/tools/ant/types/selectors/modifiedselector/ModifiedSelector.java
@@ -397,6 +397,7 @@ public class ModifiedSelector extends BaseExtendSelector
* @param type the type to check against
* @return a castable object
*/
+ @SuppressWarnings("unchecked")
protected The encoding of the nested resources
No, default is platform default
+
+
diff --git a/src/main/org/apache/tools/ant/types/resources/ResourceList.java b/src/main/org/apache/tools/ant/types/resources/ResourceList.java
index b24277dda..79cbbb5cb 100644
--- a/src/main/org/apache/tools/ant/types/resources/ResourceList.java
+++ b/src/main/org/apache/tools/ant/types/resources/ResourceList.java
@@ -19,6 +19,7 @@ package org.apache.tools.ant.types.resources;
import java.io.BufferedInputStream;
import java.io.BufferedReader;
+import java.io.File;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.Reader;
@@ -49,6 +50,7 @@ public class ResourceList extends DataType implements ResourceCollection {
private final Union cachedResources = new Union();
private volatile boolean cached = false;
private String encoding = null;
+ private File baseDir;
public ResourceList() {
cachedResources.setCache(true);
@@ -99,6 +101,21 @@ public class ResourceList extends DataType implements ResourceCollection {
this.encoding = encoding;
}
+ /**
+ * Basedir to use for file resources read from nested resources -
+ * this allows the resources contained inside this collection to
+ * be considered relative to a certain base directory.
+ *
+ * @param basedir the basedir
+ * @since Ant 1.9.12
+ */
+ public final void setBasedir(File baseDir) {
+ if (isReference()) {
+ throw tooManyAttributes();
+ }
+ this.baseDir = baseDir;
+ }
+
/**
* Makes this instance in effect a reference to another ResourceList
* instance.
@@ -250,6 +267,11 @@ public class ResourceList extends DataType implements ResourceCollection {
// resource
}
}
+ if (baseDir != null) {
+ FileResource fr = new FileResource(baseDir, expandedLine);
+ fr.setProject(getProject());
+ return fr;
+ }
return new FileResource(getProject(), expandedLine);
}
}
diff --git a/src/tests/antunit/taskdefs/copy-test.xml b/src/tests/antunit/taskdefs/copy-test.xml
index 5bca72480..1fd4b59f1 100644
--- a/src/tests/antunit/taskdefs/copy-test.xml
+++ b/src/tests/antunit/taskdefs/copy-test.xml
@@ -484,4 +484,22 @@ public class NullByteStreamResource extends Resource {
basedir
+ Base directory that is used to resolve
+ relative file names against. Is also used to provide a base
+ directory to the FileResources created by this resource
+ collection. Since Ant 1.9.12
+
+ No
+
patternset
Patternsets may be nested within one another, adding the nested
diff --git a/src/etc/testcases/types/fileset.xml b/src/etc/testcases/types/fileset.xml
new file mode 100644
index 000000000..c0f6949ff
--- /dev/null
+++ b/src/etc/testcases/types/fileset.xml
@@ -0,0 +1,40 @@
+
+
+
+ * For a list of possible values see
+ *
+ * https://docs.oracle.com/javase/1.5.0/docs/guide/intl/encoding.doc.html.
+ * This doesn't actually test much, mainly reference handling.PatternSet.NameEntry
.
+ * @return PatternSet.PatternFileNameEntry
.
*/
public synchronized PatternSet.NameEntry createIncludesFile() {
if (isReference()) {
@@ -213,7 +213,7 @@ public abstract class AbstractFileSet extends DataType
/**
* Add a name entry to the excludes files list.
- * @return PatternSet.NameEntry
.
+ * @return PatternSet.PatternFileNameEntry
.
*/
public synchronized PatternSet.NameEntry createExcludesFile() {
if (isReference()) {
diff --git a/src/main/org/apache/tools/ant/types/PatternSet.java b/src/main/org/apache/tools/ant/types/PatternSet.java
index 9fb94050c..cd5797b2d 100644
--- a/src/main/org/apache/tools/ant/types/PatternSet.java
+++ b/src/main/org/apache/tools/ant/types/PatternSet.java
@@ -19,8 +19,10 @@ package org.apache.tools.ant.types;
import java.io.BufferedReader;
import java.io.File;
+import java.io.FileInputStream;
import java.io.FileReader;
import java.io.IOException;
+import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.List;
import java.util.StringTokenizer;
@@ -40,8 +42,8 @@ import org.apache.tools.ant.util.FileUtils;
public class PatternSet extends DataType implements Cloneable {
private ListPatternSet.NameEntry
.
+ * @return PatternSet.PatternFileNameEntry
.
*/
public synchronized PatternSet.NameEntry createIncludesFile() {
if (isReference()) {
@@ -148,7 +148,7 @@ public class Files extends AbstractSelectorContainer
/**
* Add a name entry to the excludes files list.
- * @return PatternSet.NameEntry
.
+ * @return PatternSet.PatternFileNameEntry
.
*/
public synchronized PatternSet.NameEntry createExcludesFile() {
if (isReference()) {
diff --git a/src/tests/junit/org/apache/tools/ant/types/FileSetTest.java b/src/tests/junit/org/apache/tools/ant/types/FileSetTest.java
index e5aa8758f..3ca5faa46 100644
--- a/src/tests/junit/org/apache/tools/ant/types/FileSetTest.java
+++ b/src/tests/junit/org/apache/tools/ant/types/FileSetTest.java
@@ -18,17 +18,41 @@
package org.apache.tools.ant.types;
+import org.apache.tools.ant.BuildFileRule;
+import org.junit.Before;
+import org.junit.Rule;
+import org.junit.Test;
+
+import static org.junit.Assert.assertEquals;
/**
* JUnit 4 testcases for org.apache.tools.ant.types.FileSet.
- *
- *