Author: peterreilly Date: Thu Nov 16 15:36:03 2006 New Revision: 475982 URL: http://svn.apache.org/viewvc?view=rev&rev=475982 Log: checkstyle
Modified: ant/core/trunk/src/main/org/apache/tools/ant/types/AbstractFileSet.java ant/core/trunk/src/main/org/apache/tools/ant/types/ArchiveFileSet.java ant/core/trunk/src/main/org/apache/tools/ant/types/ArchiveScanner.java ant/core/trunk/src/main/org/apache/tools/ant/types/Commandline.java ant/core/trunk/src/main/org/apache/tools/ant/types/CommandlineJava.java ant/core/trunk/src/main/org/apache/tools/ant/types/DataType.java ant/core/trunk/src/main/org/apache/tools/ant/types/EnumeratedAttribute.java ant/core/trunk/src/main/org/apache/tools/ant/types/Environment.java ant/core/trunk/src/main/org/apache/tools/ant/types/LogLevel.java ant/core/trunk/src/main/org/apache/tools/ant/types/Mapper.java ant/core/trunk/src/main/org/apache/tools/ant/types/Path.java ant/core/trunk/src/main/org/apache/tools/ant/types/Quantifier.java ant/core/trunk/src/main/org/apache/tools/ant/types/Resource.java ant/core/trunk/src/main/org/apache/tools/ant/types/ResourceCollection.java ant/core/trunk/src/main/org/apache/tools/ant/types/TarFileSet.java ant/core/trunk/src/main/org/apache/tools/ant/types/XMLCatalog.java ant/core/trunk/src/main/org/apache/tools/ant/types/ZipFileSet.java ant/core/trunk/src/main/org/apache/tools/ant/types/optional/ScriptMapper.java ant/core/trunk/src/main/org/apache/tools/ant/types/spi/Service.java Modified: ant/core/trunk/src/main/org/apache/tools/ant/types/AbstractFileSet.java URL: http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/types/AbstractFileSet.java?view=diff&rev=475982&r1=475981&r2=475982 ============================================================================== --- ant/core/trunk/src/main/org/apache/tools/ant/types/AbstractFileSet.java (original) +++ ant/core/trunk/src/main/org/apache/tools/ant/types/AbstractFileSet.java Thu Nov 16 15:36:03 2006 @@ -332,6 +332,7 @@ /** * Whether default exclusions should be used or not. + * @return the default exclusions value. * @since Ant 1.6.3 */ public synchronized boolean getDefaultexcludes() { @@ -768,6 +769,7 @@ /** * Get the merged include patterns for this AbstractFileSet. + * @param p the project to use. * @return the include patterns of the default pattern set and all * nested patternsets. * @@ -779,6 +781,7 @@ /** * Get the merged exclude patterns for this AbstractFileSet. + * @param p the project to use. * @return the exclude patterns of the default pattern set and all * nested patternsets. * @@ -790,6 +793,7 @@ /** * Get the merged patterns for this AbstractFileSet. + * @param p the project to use. * @return the default patternset merged with the additional sets * in a new PatternSet instance. * Modified: ant/core/trunk/src/main/org/apache/tools/ant/types/ArchiveFileSet.java URL: http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/types/ArchiveFileSet.java?view=diff&rev=475982&r1=475981&r2=475982 ============================================================================== --- ant/core/trunk/src/main/org/apache/tools/ant/types/ArchiveFileSet.java (original) +++ ant/core/trunk/src/main/org/apache/tools/ant/types/ArchiveFileSet.java Thu Nov 16 15:36:03 2006 @@ -225,6 +225,7 @@ /** * Creates a scanner for this type of archive. + * @return the scanner. */ protected abstract ArchiveScanner newArchiveScanner(); @@ -444,6 +445,7 @@ /** * Return the prefix prepended to entries in the archive file. + * @return the prefix. * @deprecated since 1.7. */ public String getPrefix() { @@ -452,6 +454,7 @@ /** * Return the full pathname of the single entryZ in this fileset. + * @return the full pathname. * @deprecated since 1.7. */ public String getFullpath() { @@ -459,6 +462,7 @@ } /** + * @return the file mode. * @deprecated since 1.7. */ public int getFileMode() { @@ -466,6 +470,7 @@ } /** + * @return the dir mode. * @deprecated since 1.7. */ public int getDirMode() { Modified: ant/core/trunk/src/main/org/apache/tools/ant/types/ArchiveScanner.java URL: http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/types/ArchiveScanner.java?view=diff&rev=475982&r1=475981&r2=475982 ============================================================================== --- ant/core/trunk/src/main/org/apache/tools/ant/types/ArchiveScanner.java (original) +++ ant/core/trunk/src/main/org/apache/tools/ant/types/ArchiveScanner.java Thu Nov 16 15:36:03 2006 @@ -38,12 +38,15 @@ * @since Ant 1.7 */ public abstract class ArchiveScanner extends DirectoryScanner { + // CheckStyle:VisibilityModifier OFF - bc /** * The archive file which should be scanned. */ protected File srcFile; + // CheckStyle:VisibilityModifier ON + /** * The archive resource which should be scanned. */ @@ -320,6 +323,11 @@ lastScannedResource = thisresource; } + /** + * Remove trailing slash if present. + * @param s the file name to trim. + * @return the trimed file name. + */ protected static final String trimSeparator(String s) { return s.endsWith("/") ? s.substring(0, s.length() - 1) : s; } Modified: ant/core/trunk/src/main/org/apache/tools/ant/types/Commandline.java URL: http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/types/Commandline.java?view=diff&rev=475982&r1=475981&r2=475982 ============================================================================== --- ant/core/trunk/src/main/org/apache/tools/ant/types/Commandline.java (original) +++ ant/core/trunk/src/main/org/apache/tools/ant/types/Commandline.java Thu Nov 16 15:36:03 2006 @@ -54,7 +54,7 @@ */ public class Commandline implements Cloneable { /** win9x uses a (shudder) bat file (antRun.bat) for executing commands */ - private static boolean IS_WIN_9X = Os.isFamily("win9x"); + private static final boolean IS_WIN_9X = Os.isFamily("win9x"); /** * The arguments of the command Modified: ant/core/trunk/src/main/org/apache/tools/ant/types/CommandlineJava.java URL: http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/types/CommandlineJava.java?view=diff&rev=475982&r1=475981&r2=475982 ============================================================================== --- ant/core/trunk/src/main/org/apache/tools/ant/types/CommandlineJava.java (original) +++ ant/core/trunk/src/main/org/apache/tools/ant/types/CommandlineJava.java Thu Nov 16 15:36:03 2006 @@ -75,7 +75,10 @@ * Specialized Environment class for System properties. */ public static class SysProperties extends Environment implements Cloneable { + // CheckStyle:VisibilityModifier OFF - bc + /** the system properties. */ Properties sys = null; + // CheckStyle:VisibilityModifier ON private Vector propertySets = new Vector(); /** Modified: ant/core/trunk/src/main/org/apache/tools/ant/types/DataType.java URL: http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/types/DataType.java?view=diff&rev=475982&r1=475981&r2=475982 ============================================================================== --- ant/core/trunk/src/main/org/apache/tools/ant/types/DataType.java (original) +++ ant/core/trunk/src/main/org/apache/tools/ant/types/DataType.java Thu Nov 16 15:36:03 2006 @@ -38,6 +38,7 @@ * */ public abstract class DataType extends ProjectComponent implements Cloneable { + // CheckStyle:VisibilityModifier OFF - bc /** * The description the user has set. @@ -73,6 +74,8 @@ */ protected boolean checked = true; + // CheckStyle:VisibilityModifier ON + /** * Sets a description of the current data type. It will be useful * in commenting what we are doing. @@ -355,6 +358,7 @@ /** * @since Ant 1.7 * @return a shallow copy of this DataType. + * @throws CloneNotSupportedException if there is a problem. */ public Object clone() throws CloneNotSupportedException { DataType dt = (DataType) super.clone(); Modified: ant/core/trunk/src/main/org/apache/tools/ant/types/EnumeratedAttribute.java URL: http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/types/EnumeratedAttribute.java?view=diff&rev=475982&r1=475981&r2=475982 ============================================================================== --- ant/core/trunk/src/main/org/apache/tools/ant/types/EnumeratedAttribute.java (original) +++ ant/core/trunk/src/main/org/apache/tools/ant/types/EnumeratedAttribute.java Thu Nov 16 15:36:03 2006 @@ -29,12 +29,14 @@ * */ public abstract class EnumeratedAttribute { - + // CheckStyle:VisibilityModifier OFF - bc /** * The selected value in this enumeration. */ protected String value; + // CheckStyle:VisibilityModifier ON + /** * the index of the selected value in the array. */ @@ -68,7 +70,8 @@ Class/*<? extends EnumeratedAttribute>*/ clazz, String value) throws BuildException { if (!EnumeratedAttribute.class.isAssignableFrom(clazz)) { - throw new BuildException("You have to provide a subclass from EnumeratedAttribut as clazz-parameter."); + throw new BuildException( + "You have to provide a subclass from EnumeratedAttribut as clazz-parameter."); } EnumeratedAttribute ea = null; try { Modified: ant/core/trunk/src/main/org/apache/tools/ant/types/Environment.java URL: http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/types/Environment.java?view=diff&rev=475982&r1=475981&r2=475982 ============================================================================== --- ant/core/trunk/src/main/org/apache/tools/ant/types/Environment.java (original) +++ ant/core/trunk/src/main/org/apache/tools/ant/types/Environment.java Thu Nov 16 15:36:03 2006 @@ -26,12 +26,15 @@ * */ public class Environment { + // CheckStyle:VisibilityModifier OFF - bc /** * a vector of type Enviromment.Variable * @see Variable */ protected Vector variables; + + // CheckStyle:VisibilityModifier ON /** * representation of a single env value Modified: ant/core/trunk/src/main/org/apache/tools/ant/types/LogLevel.java URL: http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/types/LogLevel.java?view=diff&rev=475982&r1=475981&r2=475982 ============================================================================== --- ant/core/trunk/src/main/org/apache/tools/ant/types/LogLevel.java (original) +++ ant/core/trunk/src/main/org/apache/tools/ant/types/LogLevel.java Thu Nov 16 15:36:03 2006 @@ -18,18 +18,7 @@ package org.apache.tools.ant.types; -import java.io.File; -import java.io.FileWriter; -import java.io.IOException; -import java.io.Writer; -import java.io.BufferedWriter; -import java.io.OutputStreamWriter; -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.types.EnumeratedAttribute; /** * The enumerated values for Ant's log level. Modified: ant/core/trunk/src/main/org/apache/tools/ant/types/Mapper.java URL: http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/types/Mapper.java?view=diff&rev=475982&r1=475981&r2=475982 ============================================================================== --- ant/core/trunk/src/main/org/apache/tools/ant/types/Mapper.java (original) +++ ant/core/trunk/src/main/org/apache/tools/ant/types/Mapper.java Thu Nov 16 15:36:03 2006 @@ -30,12 +30,15 @@ * */ public class Mapper extends DataType implements Cloneable { + // CheckStyle:VisibilityModifier OFF - bc protected MapperType type = null; protected String classname = null; protected Path classpath = null; protected String from = null; protected String to = null; + + // CheckStyle:VisibilityModifier ON private ContainerMapper container = null; Modified: ant/core/trunk/src/main/org/apache/tools/ant/types/Path.java URL: http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/types/Path.java?view=diff&rev=475982&r1=475981&r2=475982 ============================================================================== --- ant/core/trunk/src/main/org/apache/tools/ant/types/Path.java (original) +++ ant/core/trunk/src/main/org/apache/tools/ant/types/Path.java Thu Nov 16 15:36:03 2006 @@ -42,7 +42,8 @@ * <sometask><br> * <somepath><br> * <pathelement location="/path/to/file.jar" /><br> - * <pathelement path="/path/to/file2.jar:/path/to/class2;/path/to/class3" /> + * <pathelement + * path="/path/to/file2.jar:/path/to/class2;/path/to/class3" /> * <br> * <pathelement location="/path/to/file3.jar" /><br> * <pathelement location="/path/to/file4.jar" /><br> @@ -61,11 +62,13 @@ */ public class Path extends DataType implements Cloneable, ResourceCollection { + // CheckStyle:VisibilityModifier OFF - bc /** The system classpath as a Path object */ public static Path systemClasspath = new Path(null, System.getProperty("java.class.path")); + /** * The system bootclasspath as a Path object. * @@ -74,7 +77,10 @@ public static Path systemBootClasspath = new Path(null, System.getProperty("sun.boot.class.path")); - private static Iterator EMPTY_ITERATOR = Collections.EMPTY_SET.iterator(); + private static final Iterator EMPTY_ITERATOR + = Collections.EMPTY_SET.iterator(); + + // CheckStyle:VisibilityModifier OFF - bc /** * Helper class, holds the nested <code><pathelement></code> values. @@ -109,14 +115,26 @@ return parts; } + /** + * Create an iterator. + * @return an iterator. + */ public Iterator iterator() { return new FileResourceIterator(null, parts); } + /** + * Check if this resource is only for filesystems. + * @return true. + */ public boolean isFilesystemOnly() { return true; } + /** + * Get the number of resources. + * @return the number of parts. + */ public int size() { return parts == null ? 0 : parts.length; } @@ -344,8 +362,8 @@ * @return a textual representation of the path. */ public String toString() { - return isReference() ? getCheckedRef().toString() : - union == null ? "" : union.toString(); + return isReference() ? getCheckedRef().toString() + : union == null ? "" : union.toString(); } /** @@ -660,7 +678,7 @@ * are added to this container while the Iterator is in use. * @return a "fail-fast" Iterator. */ - public synchronized final Iterator iterator() { + public final synchronized Iterator iterator() { if (isReference()) { return ((Path) getCheckedRef()).iterator(); } Modified: ant/core/trunk/src/main/org/apache/tools/ant/types/Quantifier.java URL: http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/types/Quantifier.java?view=diff&rev=475982&r1=475981&r2=475982 ============================================================================== --- ant/core/trunk/src/main/org/apache/tools/ant/types/Quantifier.java (original) +++ ant/core/trunk/src/main/org/apache/tools/ant/types/Quantifier.java Thu Nov 16 15:36:03 2006 @@ -40,10 +40,15 @@ = new String[] {"all", "each", "every", "any", "some", "one", "majority", "most", "none"}; + /** ALL instance */ public static final Quantifier ALL = new Quantifier("all"); + /** ANY instance */ public static final Quantifier ANY = new Quantifier("any"); + /** ONE instance */ public static final Quantifier ONE = new Quantifier("one"); + /** MAJORITY instance */ public static final Quantifier MAJORITY = new Quantifier("majority"); + /** NONE instance */ public static final Quantifier NONE = new Quantifier("none"); private static abstract class Predicate { Modified: ant/core/trunk/src/main/org/apache/tools/ant/types/Resource.java URL: http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/types/Resource.java?view=diff&rev=475982&r1=475981&r2=475982 ============================================================================== --- ant/core/trunk/src/main/org/apache/tools/ant/types/Resource.java (original) +++ ant/core/trunk/src/main/org/apache/tools/ant/types/Resource.java Thu Nov 16 15:36:03 2006 @@ -241,8 +241,8 @@ if (isReference()) { return ((Resource) getCheckedRef()).getSize(); } - return isExists() ? - (size != null ? size.longValue() : UNKNOWN_SIZE) + return isExists() + ? (size != null ? size.longValue() : UNKNOWN_SIZE) : 0L; } @@ -280,6 +280,7 @@ /** * Implement basic Resource equality. + * @param other the object to check against. * @return true if the specified Object is equal to this Resource. * @since Ant 1.7 */ @@ -343,7 +344,7 @@ public Iterator iterator() { return isReference() ? ((Resource) getCheckedRef()).iterator() : new Iterator() { - boolean done = false; + private boolean done = false; public boolean hasNext() { return !done; } Modified: ant/core/trunk/src/main/org/apache/tools/ant/types/ResourceCollection.java URL: http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/types/ResourceCollection.java?view=diff&rev=475982&r1=475981&r2=475982 ============================================================================== --- ant/core/trunk/src/main/org/apache/tools/ant/types/ResourceCollection.java (original) +++ ant/core/trunk/src/main/org/apache/tools/ant/types/ResourceCollection.java Thu Nov 16 15:36:03 2006 @@ -30,13 +30,13 @@ * are <code>org.apache.tools.ant.types.Resource</code> instances. * @return an Iterator of Resources. */ - public Iterator iterator(); + Iterator iterator(); /** * Learn the number of contained Resources. * @return number of elements as int. */ - public int size(); + int size(); /** * Indicate whether this ResourceCollection is composed entirely of @@ -45,6 +45,6 @@ * instances of FileResource. * @return whether this is a filesystem-only resource collection. */ - public boolean isFilesystemOnly(); + boolean isFilesystemOnly(); } Modified: ant/core/trunk/src/main/org/apache/tools/ant/types/TarFileSet.java URL: http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/types/TarFileSet.java?view=diff&rev=475982&r1=475981&r2=475982 ============================================================================== --- ant/core/trunk/src/main/org/apache/tools/ant/types/TarFileSet.java (original) +++ ant/core/trunk/src/main/org/apache/tools/ant/types/TarFileSet.java Thu Nov 16 15:36:03 2006 @@ -174,6 +174,10 @@ return groupIdSet; } + /** + * Create a new scanner. + * @return the created scanner. + */ protected ArchiveScanner newArchiveScanner() { TarScanner zs = new TarScanner(); return zs; @@ -215,6 +219,12 @@ } } + /** + * Configure a fileset based on this fileset. + * If the fileset is a TarFileSet copy in the tarfileset + * specific attributes. + * @param zfs the archive fileset to configure. + */ protected void configureFileSet(ArchiveFileSet zfs) { super.configureFileSet(zfs); if (zfs instanceof TarFileSet) { Modified: ant/core/trunk/src/main/org/apache/tools/ant/types/XMLCatalog.java URL: http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/types/XMLCatalog.java?view=diff&rev=475982&r1=475981&r2=475982 ============================================================================== --- ant/core/trunk/src/main/org/apache/tools/ant/types/XMLCatalog.java (original) +++ ant/core/trunk/src/main/org/apache/tools/ant/types/XMLCatalog.java Thu Nov 16 15:36:03 2006 @@ -368,7 +368,11 @@ /** * Implements the EntityResolver.resolveEntity() interface method. - * + * @param publicId the public id to resolve. + * @param systemId the system id to resolve. + * @throws SAXException if there is a parsing problem. + * @throws IOException if there is an IO problem. + * @return the resolved entity. * @see org.xml.sax.EntityResolver#resolveEntity */ public InputSource resolveEntity(String publicId, String systemId) @@ -396,7 +400,10 @@ /** * Implements the URIResolver.resolve() interface method. - * + * @param href an href attribute. + * @param base the base URI. + * @return a Source object, or null if href cannot be resolved. + * @throws TransformerException if an error occurs. * @see javax.xml.transform.URIResolver#resolve */ public Source resolve(String href, String base) Modified: ant/core/trunk/src/main/org/apache/tools/ant/types/ZipFileSet.java URL: http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/types/ZipFileSet.java?view=diff&rev=475982&r1=475981&r2=475982 ============================================================================== --- ant/core/trunk/src/main/org/apache/tools/ant/types/ZipFileSet.java (original) +++ ant/core/trunk/src/main/org/apache/tools/ant/types/ZipFileSet.java Thu Nov 16 15:36:03 2006 @@ -84,6 +84,10 @@ return encoding; } + /** + * Return a new archive scanner based on this one. + * @return a new ZipScanner with the same encoding as this one. + */ protected ArchiveScanner newArchiveScanner() { ZipScanner zs = new ZipScanner(); zs.setEncoding(encoding); Modified: ant/core/trunk/src/main/org/apache/tools/ant/types/optional/ScriptMapper.java URL: http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/types/optional/ScriptMapper.java?view=diff&rev=475982&r1=475981&r2=475982 ============================================================================== --- ant/core/trunk/src/main/org/apache/tools/ant/types/optional/ScriptMapper.java (original) +++ ant/core/trunk/src/main/org/apache/tools/ant/types/optional/ScriptMapper.java Thu Nov 16 15:36:03 2006 @@ -28,7 +28,7 @@ public class ScriptMapper extends AbstractScriptComponent implements FileNameMapper { - ArrayList files; + private ArrayList files; static final String[] EMPTY_STRING_ARRAY = new String[0]; @@ -59,7 +59,7 @@ /** * Add a mapped name - * @param mapping + * @param mapping the value to use. */ public void addMappedName(String mapping) { files.add(mapping); Modified: ant/core/trunk/src/main/org/apache/tools/ant/types/spi/Service.java URL: http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/types/spi/Service.java?view=diff&rev=475982&r1=475981&r2=475982 ============================================================================== --- ant/core/trunk/src/main/org/apache/tools/ant/types/spi/Service.java (original) +++ ant/core/trunk/src/main/org/apache/tools/ant/types/spi/Service.java Thu Nov 16 15:36:03 2006 @@ -81,6 +81,7 @@ * services as an inputstream. * @return an inputstream of the classname names * encoded as UTF-8. + * @throws IOException if there is an error. */ public InputStream getAsStream() throws IOException { ByteArrayOutputStream arrayOut; --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]