diff --git a/src/main/org/apache/tools/ant/util/Base64Converter.java b/src/main/org/apache/tools/ant/util/Base64Converter.java index 07b2326bc..b05b71119 100644 --- a/src/main/org/apache/tools/ant/util/Base64Converter.java +++ b/src/main/org/apache/tools/ant/util/Base64Converter.java @@ -25,7 +25,7 @@ package org.apache.tools.ant.util; **/ public class Base64Converter { - private final static char[] ALPHABET = { + private static final char[] ALPHABET = { 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', // 0 to 7 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', // 8 to 15 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', // 16 to 23 @@ -35,8 +35,10 @@ public class Base64Converter { 'w', 'x', 'y', 'z', '0', '1', '2', '3', // 48 to 55 '4', '5', '6', '7', '8', '9', '+', '/'}; // 56 to 63 + // CheckStyle:ConstantNameCheck OFF - bc /** Provided for BC purposes */ public static final char[] alphabet = ALPHABET; + // CheckStyle:ConstantNameCheck ON /** diff --git a/src/main/org/apache/tools/ant/util/ChainedMapper.java b/src/main/org/apache/tools/ant/util/ChainedMapper.java index 159236df5..92054ec68 100755 --- a/src/main/org/apache/tools/ant/util/ChainedMapper.java +++ b/src/main/org/apache/tools/ant/util/ChainedMapper.java @@ -31,7 +31,7 @@ import java.util.ArrayList; */ public class ChainedMapper extends ContainerMapper { - //inherit doc + /** {@inheritDoc}. */ public String[] mapFileName(String sourceFileName) { List inputs = new ArrayList(); List results = new ArrayList(); diff --git a/src/main/org/apache/tools/ant/util/ClasspathUtils.java b/src/main/org/apache/tools/ant/util/ClasspathUtils.java index 20785cd35..7d13f0467 100644 --- a/src/main/org/apache/tools/ant/util/ClasspathUtils.java +++ b/src/main/org/apache/tools/ant/util/ClasspathUtils.java @@ -263,8 +263,7 @@ public class ClasspathUtils { try { Class clazz = Class.forName(className, true, userDefinedLoader); Object o = clazz.newInstance(); - if (!expectedType.isInstance(o)) - { + if (!expectedType.isInstance(o)) { throw new BuildException( "Class of unexpected Type: " + className diff --git a/src/main/org/apache/tools/ant/util/CompositeMapper.java b/src/main/org/apache/tools/ant/util/CompositeMapper.java index be462cb11..78f72e7e1 100755 --- a/src/main/org/apache/tools/ant/util/CompositeMapper.java +++ b/src/main/org/apache/tools/ant/util/CompositeMapper.java @@ -27,7 +27,7 @@ import java.util.Iterator; */ public class CompositeMapper extends ContainerMapper { - //inherit doc + /** {@inheritDoc}. */ public String[] mapFileName(String sourceFileName) { HashSet results = new HashSet(); diff --git a/src/main/org/apache/tools/ant/util/ConcatFileInputStream.java b/src/main/org/apache/tools/ant/util/ConcatFileInputStream.java index 466733694..7d509847a 100755 --- a/src/main/org/apache/tools/ant/util/ConcatFileInputStream.java +++ b/src/main/org/apache/tools/ant/util/ConcatFileInputStream.java @@ -51,13 +51,20 @@ public class ConcatFileInputStream extends InputStream { this.file = file; } - // inherit doc + /** + * Close the stream. + * @throws IOException if there is an error. + */ public void close() throws IOException { closeCurrent(); eof = true; } - // inherit doc + /** + * Read a byte. + * @return the byte (0 - 255) or -1 if this is the end of the stream. + * @throws IOException if there is an error. + */ public int read() throws IOException { int result = readCurrent(); if (result == EOF && !eof) { diff --git a/src/main/org/apache/tools/ant/util/ConcatResourceInputStream.java b/src/main/org/apache/tools/ant/util/ConcatResourceInputStream.java index 73ccffef8..98b613c3c 100755 --- a/src/main/org/apache/tools/ant/util/ConcatResourceInputStream.java +++ b/src/main/org/apache/tools/ant/util/ConcatResourceInputStream.java @@ -67,13 +67,20 @@ public class ConcatResourceInputStream extends InputStream { return ignoreErrors; } - // inherit doc - public void close() throws IOException { + /** + * Close the stream. + * @throws IOException if there is an error. + */ + public void close() throws IOException { closeCurrent(); eof = true; } - // inherit doc + /** + * Read a byte. + * @return the byte (0 - 255) or -1 if this is the end of the stream. + * @throws IOException if there is an error. + */ public int read() throws IOException { if (eof) { return EOF; diff --git a/src/main/org/apache/tools/ant/util/DOMElementWriter.java b/src/main/org/apache/tools/ant/util/DOMElementWriter.java index b5125d2ec..2aee62f80 100644 --- a/src/main/org/apache/tools/ant/util/DOMElementWriter.java +++ b/src/main/org/apache/tools/ant/util/DOMElementWriter.java @@ -130,6 +130,7 @@ public class DOMElementWriter { * XML namespaces will be ignored. * @param xmlDeclaration flag to indicate whether the ?xml? declaration * should be included. + * @param namespacePolicy the policy to use. * @since Ant1.7 */ public DOMElementWriter(boolean xmlDeclaration, @@ -140,11 +141,13 @@ public class DOMElementWriter { private static String lSep = System.getProperty("line.separator"); + // CheckStyle:VisibilityModifier OFF - bc /** * Don't try to be too smart but at least recognize the predefined * entities. */ protected String[] knownEntities = {"gt", "amp", "lt", "apos", "quot"}; + // CheckStyle:VisibilityModifier ON /** @@ -164,7 +167,9 @@ public class DOMElementWriter { } /** - * Writes the XML declaration. + * Writes the XML declaration if xmlDeclaration is true. + * @param wri the writer to write to. + * @throws IOException if there is an error. * @since Ant 1.7.0 */ public void writeXMLDeclaration(Writer wri) throws IOException { @@ -365,6 +370,7 @@ public class DOMElementWriter { * @param indent number of * @param indentWith string that should be used to indent the * corresponding tag. + * @param hasChildren if true indent. * @throws IOException if an error happens while writing to the stream. */ public void closeElement(Element element, Writer out, int indent, diff --git a/src/main/org/apache/tools/ant/util/DOMUtils.java b/src/main/org/apache/tools/ant/util/DOMUtils.java index 7512482ed..18347fcda 100644 --- a/src/main/org/apache/tools/ant/util/DOMUtils.java +++ b/src/main/org/apache/tools/ant/util/DOMUtils.java @@ -35,7 +35,7 @@ public class DOMUtils { /** * Get a new Document instance, - * + * @return the document. * @since Ant 1.6.3 */ public static Document newDocument() { @@ -163,4 +163,4 @@ public class DOMUtils { Element e = createChildElement(parent, name); appendCDATA(e, content); } -} \ No newline at end of file +} diff --git a/src/main/org/apache/tools/ant/util/FileTokenizer.java b/src/main/org/apache/tools/ant/util/FileTokenizer.java index 34720a67c..01ee976ed 100644 --- a/src/main/org/apache/tools/ant/util/FileTokenizer.java +++ b/src/main/org/apache/tools/ant/util/FileTokenizer.java @@ -20,8 +20,6 @@ package org.apache.tools.ant.util; import java.io.IOException; import java.io.Reader; import org.apache.tools.ant.ProjectComponent; -import org.apache.tools.ant.util.FileUtils; -import org.apache.tools.ant.util.Tokenizer; /** * Class to read the complete input into a string. diff --git a/src/main/org/apache/tools/ant/util/FileUtils.java b/src/main/org/apache/tools/ant/util/FileUtils.java index 0da460f2b..a31ae6f53 100644 --- a/src/main/org/apache/tools/ant/util/FileUtils.java +++ b/src/main/org/apache/tools/ant/util/FileUtils.java @@ -1105,7 +1105,8 @@ public class FileUtils { File f = new File(path).getAbsoluteFile(); java.lang.reflect.Method toURIMethod = File.class.getMethod("toURI", new Class[0]); Object uriObj = toURIMethod.invoke(f, new Object[] {}); - java.lang.reflect.Method toASCIIStringMethod = uriClazz.getMethod("toASCIIString", new Class[0]); + java.lang.reflect.Method toASCIIStringMethod + = uriClazz.getMethod("toASCIIString", new Class[0]); return (String) toASCIIStringMethod.invoke(uriObj, new Object[] {}); } catch (Exception e) { // Reflection problems? Should not happen, debug. diff --git a/src/main/org/apache/tools/ant/util/GlobPatternMapper.java b/src/main/org/apache/tools/ant/util/GlobPatternMapper.java index f095f31b5..82f3972d5 100644 --- a/src/main/org/apache/tools/ant/util/GlobPatternMapper.java +++ b/src/main/org/apache/tools/ant/util/GlobPatternMapper.java @@ -33,6 +33,7 @@ package org.apache.tools.ant.util; */ public class GlobPatternMapper implements FileNameMapper { + // CheckStyle:VisibilityModifier OFF - bc /** * Part of "from" pattern before the *. */ @@ -63,6 +64,8 @@ public class GlobPatternMapper implements FileNameMapper { */ protected String toPostfix = null; + // CheckStyle:VisibilityModifier ON + private boolean handleDirSep = false; private boolean caseSensitive = true; diff --git a/src/main/org/apache/tools/ant/util/IdentityStack.java b/src/main/org/apache/tools/ant/util/IdentityStack.java index a9f83a54e..1c5d14ee0 100755 --- a/src/main/org/apache/tools/ant/util/IdentityStack.java +++ b/src/main/org/apache/tools/ant/util/IdentityStack.java @@ -60,6 +60,7 @@ public class IdentityStack extends Stack { /** * Override methods that use .equals() comparisons on elements. * @param o the Object to search for. + * @return true if the stack contains the object. * @see java.util.Vector#contains(Object) */ public synchronized boolean contains(Object o) { @@ -70,6 +71,7 @@ public class IdentityStack extends Stack { * Override methods that use .equals() comparisons on elements. * @param o the Object to search for. * @param pos the position from which to search. + * @return the position of the object, -1 if not found. * @see java.util.Vector#indexOf(Object, int) */ public synchronized int indexOf(Object o, int pos) { @@ -85,6 +87,7 @@ public class IdentityStack extends Stack { * Override methods that use .equals() comparisons on elements. * @param o the Object to search for. * @param pos the position from which to search (backward). + * @return the position of the object, -1 if not found. * @see java.util.Vector#indexOf(Object, int) */ public synchronized int lastIndexOf(Object o, int pos) { diff --git a/src/main/org/apache/tools/ant/util/JavaEnvUtils.java b/src/main/org/apache/tools/ant/util/JavaEnvUtils.java index 10bb79bd6..6a8aed13c 100644 --- a/src/main/org/apache/tools/ant/util/JavaEnvUtils.java +++ b/src/main/org/apache/tools/ant/util/JavaEnvUtils.java @@ -342,7 +342,9 @@ public final class JavaEnvUtils { switch(javaVersionNumber) { case 16: case 15: - tests.addElement("com.sun.org.apache.xerces.internal.jaxp.datatype.DatatypeFactoryImpl "); + tests.addElement( + "com.sun.org.apache.xerces.internal.jaxp.datatype.DatatypeFactoryImpl "); + // Fall tru case 14: tests.addElement("sun.audio.AudioPlayer"); if (javaVersionNumber == 14) { diff --git a/src/main/org/apache/tools/ant/util/LazyFileOutputStream.java b/src/main/org/apache/tools/ant/util/LazyFileOutputStream.java index ce56d4d05..f3e360b3a 100644 --- a/src/main/org/apache/tools/ant/util/LazyFileOutputStream.java +++ b/src/main/org/apache/tools/ant/util/LazyFileOutputStream.java @@ -41,6 +41,7 @@ public class LazyFileOutputStream extends OutputStream { /** * Creates a stream that will eventually write to the file with * the given name and replace it. + * @param name the filename. */ public LazyFileOutputStream(String name) { this(name, false); @@ -50,6 +51,8 @@ public class LazyFileOutputStream extends OutputStream { * Creates a stream that will eventually write to the file with * the given name and optionally append to instead of replacing * it. + * @param name the filename. + * @param append if true append rather than replace. */ public LazyFileOutputStream(String name, boolean append) { this(new File(name), append); @@ -58,6 +61,7 @@ public class LazyFileOutputStream extends OutputStream { /** * Creates a stream that will eventually write to the file with * the given name and replace it. + * @param f the file to create. */ public LazyFileOutputStream(File f) { this(f, false); @@ -67,6 +71,8 @@ public class LazyFileOutputStream extends OutputStream { * Creates a stream that will eventually write to the file with * the given name and optionally append to instead of replacing * it. + * @param file the file to create. + * @param append if true append rather than replace. */ public LazyFileOutputStream(File file, boolean append) { this(file, append, false); @@ -76,6 +82,9 @@ public class LazyFileOutputStream extends OutputStream { * Creates a stream that will eventually write to the file with * the given name, optionally append to instead of replacing * it, and optionally always create a file (even if zero length). + * @param file the file to create. + * @param append if true append rather than replace. + * @param alwaysCreate if true create the file even if nothing to write. */ public LazyFileOutputStream(File file, boolean append, boolean alwaysCreate) { @@ -88,6 +97,7 @@ public class LazyFileOutputStream extends OutputStream { * Explicitly open the file for writing. * *

Returns silently if the file has already been opened.

+ * @throws IOException if there is an error. */ public void open() throws IOException { ensureOpened(); diff --git a/src/main/org/apache/tools/ant/util/LazyHashtable.java b/src/main/org/apache/tools/ant/util/LazyHashtable.java index 8f51bdf2b..766b1ba0c 100644 --- a/src/main/org/apache/tools/ant/util/LazyHashtable.java +++ b/src/main/org/apache/tools/ant/util/LazyHashtable.java @@ -29,8 +29,11 @@ import java.util.Enumeration; * @since Ant 1.6 */ public class LazyHashtable extends Hashtable { + // CheckStyle:VisibilityModifier OFF - bc protected boolean initAllDone = false; + // CheckStyle:VisibilityModifier OFF - bc + /** No arg constructor. */ public LazyHashtable() { super(); } diff --git a/src/main/org/apache/tools/ant/util/LeadPipeInputStream.java b/src/main/org/apache/tools/ant/util/LeadPipeInputStream.java index 29944717b..8ca828836 100755 --- a/src/main/org/apache/tools/ant/util/LeadPipeInputStream.java +++ b/src/main/org/apache/tools/ant/util/LeadPipeInputStream.java @@ -67,6 +67,7 @@ public class LeadPipeInputStream extends PipedInputStream { * circular buffer of the specified size. * @param src the PipedOutputStream source. * @param size the size of the circular buffer. + * @throws IOException if there is an error. */ public LeadPipeInputStream(PipedOutputStream src, int size) throws IOException { super(src); diff --git a/src/main/org/apache/tools/ant/util/LineOrientedOutputStream.java b/src/main/org/apache/tools/ant/util/LineOrientedOutputStream.java index 33e621995..30e5d88b9 100644 --- a/src/main/org/apache/tools/ant/util/LineOrientedOutputStream.java +++ b/src/main/org/apache/tools/ant/util/LineOrientedOutputStream.java @@ -48,6 +48,7 @@ public abstract class LineOrientedOutputStream extends OutputStream { * separator is detected. * * @param cc data to log (byte). + * @throws IOException if there is an error. */ public final void write(int cc) throws IOException { final byte c = (byte) cc; @@ -63,6 +64,7 @@ public abstract class LineOrientedOutputStream extends OutputStream { /** * Flush this log stream + * @throws IOException if there is an error. */ public final void flush() throws IOException { if (buffer.size() > 0) { @@ -73,6 +75,7 @@ public abstract class LineOrientedOutputStream extends OutputStream { /** * Converts the buffer to a string and sends it to * processLine + * @throws IOException if there is an error. */ protected void processBuffer() throws IOException { try { @@ -86,11 +89,13 @@ public abstract class LineOrientedOutputStream extends OutputStream { * Processes a line. * * @param line the line to log. + * @throws IOException if there is an error. */ protected abstract void processLine(String line) throws IOException; /** * Writes all remaining + * @throws IOException if there is an error. */ public final void close() throws IOException { if (buffer.size() > 0) { diff --git a/src/main/org/apache/tools/ant/util/MergingMapper.java b/src/main/org/apache/tools/ant/util/MergingMapper.java index 4932c6667..761652654 100644 --- a/src/main/org/apache/tools/ant/util/MergingMapper.java +++ b/src/main/org/apache/tools/ant/util/MergingMapper.java @@ -27,7 +27,9 @@ package org.apache.tools.ant.util; * */ public class MergingMapper implements FileNameMapper { + // CheckStyle:VisibilityModifier OFF - bc protected String[] mergedFile = null; + // CheckStyle:VisibilityModifier ON /** * Ignored. diff --git a/src/main/org/apache/tools/ant/util/ProxySetup.java b/src/main/org/apache/tools/ant/util/ProxySetup.java index 9f4af897a..f5b459ca6 100644 --- a/src/main/org/apache/tools/ant/util/ProxySetup.java +++ b/src/main/org/apache/tools/ant/util/ProxySetup.java @@ -38,26 +38,41 @@ public class ProxySetup { * @value */ public static final String USE_SYSTEM_PROXIES = "java.net.useSystemProxies"; + /** the http proxyhost property */ public static final String HTTP_PROXY_HOST = "http.proxyHost"; + /** the http proxyport property */ public static final String HTTP_PROXY_PORT = "http.proxyPort"; + /** the https proxyhost property */ public static final String HTTPS_PROXY_HOST = "https.proxyHost"; + /** the https proxyport property */ public static final String HTTPS_PROXY_PORT = "https.proxyPort"; + /** the ftp proxyhost property */ public static final String FTP_PROXY_HOST = "ftp.proxyHost"; + /** the ftp proxyport property */ public static final String FTP_PROXY_PORT = "ftp.proxyPort"; + /** the ftp proxyport property */ public static final String HTTP_NON_PROXY_HOSTS = "http.nonProxyHosts"; + /** the http hosts not to be proxied property */ public static final String HTTPS_NON_PROXY_HOSTS = "https.nonProxyHosts"; + /** the ftp hosts not to be proxied property */ public static final String FTP_NON_PROXY_HOSTS = "ftp.nonProxyHosts"; + /** the http proxy username property */ public static final String HTTP_PROXY_USERNAME = "http.proxyUser"; + /** the http proxy password property */ public static final String HTTP_PROXY_PASSWORD = "http.proxyPassword"; + /** the socks proxy host property */ public static final String SOCKS_PROXY_HOST = "socksProxyHost"; + /** the socks proxy port property */ public static final String SOCKS_PROXY_PORT = "socksProxyPort"; + /** the socks proxy username property */ public static final String SOCKS_PROXY_USERNAME = "java.net.socks.username"; + /** the socks proxy password property */ public static final String SOCKS_PROXY_PASSWORD = "java.net.socks.password"; /** * create a proxy setup class bound to this project - * @param owner + * @param owner the project that owns this setup. */ public ProxySetup(Project owner) { this.owner = owner; diff --git a/src/main/org/apache/tools/ant/util/RegexpPatternMapper.java b/src/main/org/apache/tools/ant/util/RegexpPatternMapper.java index 2f0a36223..53e128b3c 100644 --- a/src/main/org/apache/tools/ant/util/RegexpPatternMapper.java +++ b/src/main/org/apache/tools/ant/util/RegexpPatternMapper.java @@ -29,9 +29,11 @@ import org.apache.tools.ant.util.regexp.RegexpMatcherFactory; * */ public class RegexpPatternMapper implements FileNameMapper { + // CheckStyle:VisibilityModifier OFF - bc protected RegexpMatcher reg = null; protected char[] to = null; protected StringBuffer result = new StringBuffer(); + // CheckStyle:VisibilityModifier ON /** * Constructor for RegexpPatternMapper. diff --git a/src/main/org/apache/tools/ant/util/RetryHandler.java b/src/main/org/apache/tools/ant/util/RetryHandler.java index e3f35c0c9..dd62bc27c 100644 --- a/src/main/org/apache/tools/ant/util/RetryHandler.java +++ b/src/main/org/apache/tools/ant/util/RetryHandler.java @@ -64,7 +64,8 @@ public class RetryHandler { + this.retriesAllowed + "), giving up", Project.MSG_WARN); throw e; } else { - task.log("try #" + retries + ": IO error (" + desc + "), retrying", Project.MSG_WARN); + task.log("try #" + retries + ": IO error (" + desc + + "), retrying", Project.MSG_WARN); } } } diff --git a/src/main/org/apache/tools/ant/util/Retryable.java b/src/main/org/apache/tools/ant/util/Retryable.java index 8f400af93..067ea8584 100644 --- a/src/main/org/apache/tools/ant/util/Retryable.java +++ b/src/main/org/apache/tools/ant/util/Retryable.java @@ -27,7 +27,12 @@ import java.io.IOException; * @see RetryHandler */ public interface Retryable { + /** The value to use to never give up. */ public static final int RETRY_FOREVER = -1; + /** + * Called to execute the code. + * @throws IOException if there is a problem. + */ void execute() throws IOException; } diff --git a/src/main/org/apache/tools/ant/util/SourceFileScanner.java b/src/main/org/apache/tools/ant/util/SourceFileScanner.java index 4766395ac..fd3d8a988 100644 --- a/src/main/org/apache/tools/ant/util/SourceFileScanner.java +++ b/src/main/org/apache/tools/ant/util/SourceFileScanner.java @@ -36,7 +36,9 @@ import org.apache.tools.ant.types.resources.FileResource; */ public class SourceFileScanner implements ResourceFactory { + // CheckStyle:VisibilityModifier OFF - bc protected Task task; + // CheckStyle:VisibilityModifier ON private static final FileUtils FILE_UTILS = FileUtils.getFileUtils(); private File destDir; // base directory of the fileset diff --git a/src/main/org/apache/tools/ant/util/StringTokenizer.java b/src/main/org/apache/tools/ant/util/StringTokenizer.java index 26296d1c2..a029b6734 100644 --- a/src/main/org/apache/tools/ant/util/StringTokenizer.java +++ b/src/main/org/apache/tools/ant/util/StringTokenizer.java @@ -20,7 +20,6 @@ package org.apache.tools.ant.util; import java.io.IOException; import java.io.Reader; import org.apache.tools.ant.ProjectComponent; -import org.apache.tools.ant.util.Tokenizer; /** * Class to tokenize the input as areas separated diff --git a/src/main/org/apache/tools/ant/util/StringUtils.java b/src/main/org/apache/tools/ant/util/StringUtils.java index f5408ca2a..93f0d8ce7 100644 --- a/src/main/org/apache/tools/ant/util/StringUtils.java +++ b/src/main/org/apache/tools/ant/util/StringUtils.java @@ -100,8 +100,10 @@ public final class StringUtils { } /** - * Checks that a string buffer ends up with a given string. It may sound trivial with the existing - * JDK API but the various implementation among JDKs can make those methods extremely resource intensive + * Checks that a string buffer ends up with a given string. It may sound + * trivial with the existing + * JDK API but the various implementation among JDKs can make those + * methods extremely resource intensive * and perform poorly due to massive memory allocation and copying. See * @param buffer the buffer to perform the check on * @param suffix the suffix diff --git a/src/main/org/apache/tools/ant/util/UUEncoder.java b/src/main/org/apache/tools/ant/util/UUEncoder.java index 9105dacc5..a2f0fec7e 100644 --- a/src/main/org/apache/tools/ant/util/UUEncoder.java +++ b/src/main/org/apache/tools/ant/util/UUEncoder.java @@ -54,6 +54,7 @@ public class UUEncoder { * input stream. * @param is the input stream. * @param out the output stream. + * @throws IOException if there is an error. */ public void encode(InputStream is, OutputStream out) throws IOException { diff --git a/src/main/org/apache/tools/ant/util/WeakishReference.java b/src/main/org/apache/tools/ant/util/WeakishReference.java index d4deeec07..92f322fb2 100644 --- a/src/main/org/apache/tools/ant/util/WeakishReference.java +++ b/src/main/org/apache/tools/ant/util/WeakishReference.java @@ -22,8 +22,10 @@ package org.apache.tools.ant.util; import java.lang.ref.WeakReference; /** - * These classes are part of some code to reduce memory leaks by only retaining weak references to things - * on Java1.2+, and yet still work (with leaky hard references) on Java1.1. Now that Ant is 1.2+ only, + * These classes are part of some code to reduce memory leaks by only + * retaining weak references to things + * on Java1.2+, and yet still work (with leaky hard references) on Java1.1. + * Now that Ant is 1.2+ only, * life is simpler and none of the classes are needed any more. * * They are only retained in case a third-party task uses them diff --git a/src/main/org/apache/tools/ant/util/XmlConstants.java b/src/main/org/apache/tools/ant/util/XmlConstants.java index 03d0a2484..f852c62d4 100644 --- a/src/main/org/apache/tools/ant/util/XmlConstants.java +++ b/src/main/org/apache/tools/ant/util/XmlConstants.java @@ -25,18 +25,26 @@ package org.apache.tools.ant.util; */ public class XmlConstants { + /** property for location of xml schema */ public static final String PROPERTY_SCHEMA_LOCATION = "http://apache.org/xml/properties/schema/external-schemaLocation"; + /** property for location of no-name schema */ public static final String PROPERTY_NO_NAMESPACE_SCHEMA_LOCATION = "http://apache.org/xml/properties/schema/external-noNamespaceSchemaLocation"; + /** property for full validation */ public static final String FEATURE_XSD_FULL_VALIDATION = "http://apache.org/xml/features/validation/schema-full-checking"; + /** property for xsd */ public static final String FEATURE_XSD = "http://apache.org/xml/features/validation/schema"; + /** property for validation */ public static final String FEATURE_VALIDATION = "http://xml.org/sax/features/validation"; + /** property for namespace support */ public static final String FEATURE_NAMESPACES = "http://xml.org/sax/features/namespaces"; + /** property for schema language */ public static final String FEATURE_JAXP12_SCHEMA_LANGUAGE = "http://java.sun.com/xml/jaxp/properties/schemaLanguage"; + /** property for schema source */ public static final String FEATURE_JAXP12_SCHEMA_SOURCE = "http://java.sun.com/xml/jaxp/properties/schemaSource"; public static final String URI_XSD = diff --git a/src/main/org/apache/tools/ant/util/java15/ProxyDiagnostics.java b/src/main/org/apache/tools/ant/util/java15/ProxyDiagnostics.java index d10990efd..a8d4eb605 100644 --- a/src/main/org/apache/tools/ant/util/java15/ProxyDiagnostics.java +++ b/src/main/org/apache/tools/ant/util/java15/ProxyDiagnostics.java @@ -40,9 +40,9 @@ import java.util.Iterator; */ public class ProxyDiagnostics { - String destination; + private String destination; - URI destURI; + private URI destURI; /** {@value} */ public static final String DEFAULT_DESTINATION = "http://ant.apache.org/"; @@ -69,6 +69,10 @@ public class ProxyDiagnostics { this(DEFAULT_DESTINATION); } + /** + * Get the diagnostics for proxy information. + * @return the information. + */ public String toString() { ProxySelector selector = ProxySelector.getDefault(); List list = selector.select(destURI); diff --git a/src/main/org/apache/tools/ant/util/optional/ScriptRunner.java b/src/main/org/apache/tools/ant/util/optional/ScriptRunner.java index 65de020d7..d55361173 100644 --- a/src/main/org/apache/tools/ant/util/optional/ScriptRunner.java +++ b/src/main/org/apache/tools/ant/util/optional/ScriptRunner.java @@ -24,7 +24,6 @@ import java.io.IOException; import org.apache.bsf.BSFException; import org.apache.bsf.BSFManager; -import org.apache.tools.ant.AntClassLoader; import org.apache.tools.ant.BuildException; import org.apache.tools.ant.ProjectComponent; import org.apache.tools.ant.Project; @@ -187,6 +186,7 @@ public class ScriptRunner { /** * Set the class path to be used. + * @param classpath the path to use. */ public void setClasspath(Path classpath) { this.classpath = classpath; diff --git a/src/main/org/apache/tools/ant/util/optional/WeakishReference12.java b/src/main/org/apache/tools/ant/util/optional/WeakishReference12.java index 0bd0aabdf..f8ebfc3f5 100644 --- a/src/main/org/apache/tools/ant/util/optional/WeakishReference12.java +++ b/src/main/org/apache/tools/ant/util/optional/WeakishReference12.java @@ -20,8 +20,6 @@ package org.apache.tools.ant.util.optional; import org.apache.tools.ant.util.WeakishReference; -import java.lang.ref.WeakReference; - /** * This is a reference that really is is Weak, as it uses the * appropriate java.lang.ref class. diff --git a/src/main/org/apache/tools/ant/util/regexp/JakartaOroMatcher.java b/src/main/org/apache/tools/ant/util/regexp/JakartaOroMatcher.java index 550817b9c..59d9e9146 100644 --- a/src/main/org/apache/tools/ant/util/regexp/JakartaOroMatcher.java +++ b/src/main/org/apache/tools/ant/util/regexp/JakartaOroMatcher.java @@ -32,8 +32,10 @@ import org.apache.tools.ant.BuildException; public class JakartaOroMatcher implements RegexpMatcher { private String pattern; + // CheckStyle:VisibilityModifier OFF - bc protected final Perl5Compiler compiler = new Perl5Compiler(); protected final Perl5Matcher matcher = new Perl5Matcher(); + // CheckStyle:VisibilityModifier ON /** * Constructor for JakartaOroMatcher. diff --git a/src/main/org/apache/tools/ant/util/regexp/RegexpFactory.java b/src/main/org/apache/tools/ant/util/regexp/RegexpFactory.java index 14b5a8e0b..6330bc145 100644 --- a/src/main/org/apache/tools/ant/util/regexp/RegexpFactory.java +++ b/src/main/org/apache/tools/ant/util/regexp/RegexpFactory.java @@ -86,14 +86,16 @@ public class RegexpFactory extends RegexpMatcherFactory { cause = orCause(cause, be, true); } - throw new BuildException("No supported regular expression matcher found" + - (cause != null ? ": " + cause : ""), cause); + throw new BuildException( + "No supported regular expression matcher found" + + (cause != null ? ": " + cause : ""), cause); } /** * Wrapper over RegexpMatcherFactory.createInstance that ensures that * we are dealing with a Regexp implementation. - * + * @return the instance. + * @throws BuildException if there is a problem. * @since 1.3 * * @see RegexpMatcherFactory#createInstance(String) diff --git a/src/main/org/apache/tools/ant/util/regexp/RegexpMatcherFactory.java b/src/main/org/apache/tools/ant/util/regexp/RegexpMatcherFactory.java index 8fcc96f48..7fbc79864 100644 --- a/src/main/org/apache/tools/ant/util/regexp/RegexpMatcherFactory.java +++ b/src/main/org/apache/tools/ant/util/regexp/RegexpMatcherFactory.java @@ -94,8 +94,9 @@ public class RegexpMatcherFactory { cause = orCause(cause, be, true); } - throw new BuildException("No supported regular expression matcher found" + - (cause != null ? ": " + cause : ""), cause); + throw new BuildException( + "No supported regular expression matcher found" + + (cause != null ? ": " + cause : ""), cause); } static Throwable orCause(Throwable deflt, BuildException be, boolean ignoreCnfe) {