diff --git a/src/main/org/apache/tools/ant/types/LogLevel.java b/src/main/org/apache/tools/ant/types/LogLevel.java index f953b97fe..19c916dd9 100644 --- a/src/main/org/apache/tools/ant/types/LogLevel.java +++ b/src/main/org/apache/tools/ant/types/LogLevel.java @@ -29,7 +29,6 @@ import java.io.FileOutputStream; import org.apache.tools.ant.BuildException; import org.apache.tools.ant.Project; import org.apache.tools.ant.Task; -import org.apache.tools.ant.util.FileUtils; import org.apache.tools.ant.types.EnumeratedAttribute; /** diff --git a/src/main/org/apache/tools/ant/types/PropertySet.java b/src/main/org/apache/tools/ant/types/PropertySet.java index 7d982aea1..c39776001 100644 --- a/src/main/org/apache/tools/ant/types/PropertySet.java +++ b/src/main/org/apache/tools/ant/types/PropertySet.java @@ -30,7 +30,6 @@ import java.util.Vector; import org.apache.tools.ant.BuildException; import org.apache.tools.ant.Project; -import org.apache.tools.ant.types.ResourceCollection; import org.apache.tools.ant.types.resources.PropertyResource; import org.apache.tools.ant.util.FileNameMapper; import org.apache.tools.ant.util.regexp.RegexpMatcher; @@ -440,7 +439,7 @@ public class PropertySet extends DataType implements ResourceCollection { static final String ALL = "all"; static final String SYSTEM = "system"; static final String COMMANDLINE = "commandline"; - /** @see EnumeratedAttribute#getValues() */ + /** {@inheritDoc}. */ public String[] getValues() { return new String[] {ALL, SYSTEM, COMMANDLINE}; } diff --git a/src/main/org/apache/tools/ant/types/resources/CompressedResource.java b/src/main/org/apache/tools/ant/types/resources/CompressedResource.java index b5eb95758..6685a5931 100644 --- a/src/main/org/apache/tools/ant/types/resources/CompressedResource.java +++ b/src/main/org/apache/tools/ant/types/resources/CompressedResource.java @@ -40,9 +40,14 @@ public abstract class CompressedResource extends Resource { private Resource resource; + /** no arg constructor */ public CompressedResource() { } + /** + * Constructor with another resource to wrap. + * @param other the resource to wrap. + */ public CompressedResource(ResourceCollection other) { addConfigured(other); } @@ -64,12 +69,21 @@ public abstract class CompressedResource extends Resource { resource = (Resource) a.iterator().next(); } + /** + * Get the name of the resource. + * @return the name of the wrapped resource. + */ public String getName() { return getResource().getName(); } - public void setName(String name) { + /** + * Overridden, not allowed to set the name of the resource. + * @param name not used. + * @throws BuildException always. + */ + public void setName(String name) throws BuildException { throw new BuildException("you can't change the name of a compressed" + " resource"); } @@ -101,7 +115,12 @@ public abstract class CompressedResource extends Resource { return getResource().getLastModified(); } - public void setLastModified(long lastmodified) { + /** + * Override setLastModified. + * @param lastmodified not used. + * @throws BuildException always. + */ + public void setLastModified(long lastmodified) throws BuildException { throw new BuildException("you can't change the timestamp of a " + " compressed resource"); } @@ -114,7 +133,12 @@ public abstract class CompressedResource extends Resource { return getResource().isDirectory(); } - public void setDirectory(boolean directory) { + /** + * Override setDirectory. + * @param directory not used. + * @throws BuildException always. + */ + public void setDirectory(boolean directory) throws BuildException { throw new BuildException("you can't change the directory state of a " + " compressed resource"); } @@ -147,7 +171,12 @@ public abstract class CompressedResource extends Resource { } } - public void setSize(long size) { + /** + * Override setSize. + * @param size not used. + * @throws BuildException always. + */ + public void setSize(long size) throws BuildException { throw new BuildException("you can't change the size of a " + " compressed resource"); } @@ -163,10 +192,10 @@ public abstract class CompressedResource extends Resource { return 0; } if (other instanceof CompressedResource) { - return getResource().compareTo(((CompressedResource)other).getResource()); + return getResource().compareTo( + ((CompressedResource) other).getResource()); } return getResource().compareTo(other); - } /** @@ -176,7 +205,7 @@ public abstract class CompressedResource extends Resource { public int hashCode() { return getResource().hashCode(); } - + /** * Get an InputStream for the Resource. * @return an InputStream containing this Resource's content. @@ -242,6 +271,8 @@ public abstract class CompressedResource extends Resource { * Is supposed to wrap the stream to allow decompression on the fly. * * @param in InputStream to wrap, will never be null. + * @return a compressed inputstream. + * @throws IOException if there is a problem. */ protected abstract InputStream wrapStream(InputStream in) throws IOException; @@ -250,6 +281,8 @@ public abstract class CompressedResource extends Resource { * Is supposed to wrap the stream to allow compression on the fly. * * @param out OutputStream to wrap, will never be null. + * @return a compressed outputstream. + * @throws IOException if there is a problem. */ protected abstract OutputStream wrapStream(OutputStream out) throws IOException; diff --git a/src/main/org/apache/tools/ant/types/resources/PropertyResource.java b/src/main/org/apache/tools/ant/types/resources/PropertyResource.java index 31afde879..e263b5b5d 100644 --- a/src/main/org/apache/tools/ant/types/resources/PropertyResource.java +++ b/src/main/org/apache/tools/ant/types/resources/PropertyResource.java @@ -51,6 +51,7 @@ public class PropertyResource extends Resource { /** * Construct a new PropertyResource with the specified name. + * @param p the project to use. * @param n the String name of this PropertyResource (Ant property name/key). */ public PropertyResource(Project p, String n) { diff --git a/src/main/org/apache/tools/ant/types/resources/Sort.java b/src/main/org/apache/tools/ant/types/resources/Sort.java index 9dc2e3c32..ee32c975a 100644 --- a/src/main/org/apache/tools/ant/types/resources/Sort.java +++ b/src/main/org/apache/tools/ant/types/resources/Sort.java @@ -18,7 +18,6 @@ package org.apache.tools.ant.types.resources; import java.util.Stack; -import java.util.Vector; import java.util.TreeMap; import java.util.Iterator; import java.util.Collection; diff --git a/src/main/org/apache/tools/ant/types/resources/selectors/Compare.java b/src/main/org/apache/tools/ant/types/resources/selectors/Compare.java index f75b7c658..de9d451a3 100644 --- a/src/main/org/apache/tools/ant/types/resources/selectors/Compare.java +++ b/src/main/org/apache/tools/ant/types/resources/selectors/Compare.java @@ -18,14 +18,7 @@ package org.apache.tools.ant.types.resources.selectors; import java.util.Stack; -import java.util.Vector; -import java.util.TreeMap; import java.util.Iterator; -import java.util.Collection; -import java.util.Comparator; -import java.util.Collections; -import java.util.AbstractCollection; -import java.util.NoSuchElementException; import org.apache.tools.ant.Project; import org.apache.tools.ant.BuildException;