git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@475983 13f79535-47bb-0310-9956-ffa450edef68master
| @@ -25,6 +25,8 @@ import org.apache.tools.ant.MagicNames; | |||||
| import org.apache.tools.ant.types.Path; | import org.apache.tools.ant.types.Path; | ||||
| import org.apache.tools.ant.types.Reference; | import org.apache.tools.ant.types.Reference; | ||||
| // CheckStyle:HideUtilityClassConstructorCheck OFF - bc | |||||
| /** | /** | ||||
| * Offers some helper methods on the Path structure in ant. | * Offers some helper methods on the Path structure in ant. | ||||
| * | * | ||||
| @@ -23,6 +23,8 @@ import java.util.Dictionary; | |||||
| import java.util.Enumeration; | import java.util.Enumeration; | ||||
| import java.util.NoSuchElementException; | import java.util.NoSuchElementException; | ||||
| // CheckStyle:HideUtilityClassConstructorCheck OFF - bc | |||||
| /** | /** | ||||
| * A set of helper methods related to collection manipulation. | * A set of helper methods related to collection manipulation. | ||||
| * | * | ||||
| @@ -453,7 +453,8 @@ public class DOMElementWriter { | |||||
| * <code>&#x5d;&#x5d;&gt;</code>.</p> | * <code>&#x5d;&#x5d;&gt;</code>.</p> | ||||
| * | * | ||||
| * <p>See XML 1.0 2.2 <a | * <p>See XML 1.0 2.2 <a | ||||
| * href="http://www.w3.org/TR/1998/REC-xml-19980210#charsets">http://www.w3.org/TR/1998/REC-xml-19980210#charsets</a> and | |||||
| * href="http://www.w3.org/TR/1998/REC-xml-19980210#charsets"> | |||||
| * http://www.w3.org/TR/1998/REC-xml-19980210#charsets</a> and | |||||
| * 2.7 <a | * 2.7 <a | ||||
| * href="http://www.w3.org/TR/1998/REC-xml-19980210#sec-cdata-sect">http://www.w3.org/TR/1998/REC-xml-19980210#sec-cdata-sect</a>.</p> | * href="http://www.w3.org/TR/1998/REC-xml-19980210#sec-cdata-sect">http://www.w3.org/TR/1998/REC-xml-19980210#sec-cdata-sect</a>.</p> | ||||
| * @param value the value to be encoded. | * @param value the value to be encoded. | ||||
| @@ -23,6 +23,8 @@ import org.w3c.dom.Document; | |||||
| import org.w3c.dom.Element; | import org.w3c.dom.Element; | ||||
| import org.w3c.dom.Text; | import org.w3c.dom.Text; | ||||
| // CheckStyle:HideUtilityClassConstructorCheck OFF - bc | |||||
| /** | /** | ||||
| * Some utility methods for common tasks when building DOM trees in memory. | * Some utility methods for common tasks when building DOM trees in memory. | ||||
| * | * | ||||
| @@ -250,6 +250,7 @@ public class FileUtils { | |||||
| overwrite, preserveLastModified, encoding); | overwrite, preserveLastModified, encoding); | ||||
| } | } | ||||
| // CheckStyle:ParameterNumberCheck OFF - bc | |||||
| /** | /** | ||||
| * Convenience method to copy a file from a source to a | * Convenience method to copy a file from a source to a | ||||
| * destination specifying if token filtering must be used, if | * destination specifying if token filtering must be used, if | ||||
| @@ -510,6 +511,8 @@ public class FileUtils { | |||||
| inputEncoding, outputEncoding, project); | inputEncoding, outputEncoding, project); | ||||
| } | } | ||||
| // CheckStyle:ParameterNumberCheck ON | |||||
| /** | /** | ||||
| * Calls File.setLastModified(long time). Originally written to | * Calls File.setLastModified(long time). Originally written to | ||||
| * to dynamically bind to that call on Java1.2+. | * to dynamically bind to that call on Java1.2+. | ||||
| @@ -29,6 +29,8 @@ import org.xml.sax.Parser; | |||||
| import org.xml.sax.SAXException; | import org.xml.sax.SAXException; | ||||
| import org.xml.sax.XMLReader; | import org.xml.sax.XMLReader; | ||||
| // CheckStyle:HideUtilityClassConstructorCheck OFF - bc | |||||
| /** | /** | ||||
| * Collection of helper methods that retrieve a ParserFactory or | * Collection of helper methods that retrieve a ParserFactory or | ||||
| * Parsers and Readers. | * Parsers and Readers. | ||||
| @@ -103,6 +103,10 @@ public class LazyFileOutputStream extends OutputStream { | |||||
| ensureOpened(); | ensureOpened(); | ||||
| } | } | ||||
| /** | |||||
| * Close the file. | |||||
| * @throws IOException if there is an error. | |||||
| */ | |||||
| public synchronized void close() throws IOException { | public synchronized void close() throws IOException { | ||||
| if (alwaysCreate && !closed) { | if (alwaysCreate && !closed) { | ||||
| ensureOpened(); | ensureOpened(); | ||||
| @@ -115,19 +119,31 @@ public class LazyFileOutputStream extends OutputStream { | |||||
| /** | /** | ||||
| * Delegates to the three-arg version. | * Delegates to the three-arg version. | ||||
| * @param b the bytearray to write. | |||||
| * @throws IOException if there is a problem. | |||||
| */ | */ | ||||
| public void write(byte[] b) throws IOException { | public void write(byte[] b) throws IOException { | ||||
| write(b, 0, b.length); | write(b, 0, b.length); | ||||
| } | } | ||||
| //inherit doc | |||||
| /** | |||||
| * Write part of a byte array. | |||||
| * @param b the byte array. | |||||
| * @param offset write from this index. | |||||
| * @param len the number of bytes to write. | |||||
| * @throws IOException if there is a probem. | |||||
| */ | |||||
| public synchronized void write(byte[] b, int offset, int len) | public synchronized void write(byte[] b, int offset, int len) | ||||
| throws IOException { | throws IOException { | ||||
| ensureOpened(); | ensureOpened(); | ||||
| fos.write(b, offset, len); | fos.write(b, offset, len); | ||||
| } | } | ||||
| //inherit doc | |||||
| /** | |||||
| * Write a byte. | |||||
| * @param b the byte to write. | |||||
| * @throws IOException if there is a problem. | |||||
| */ | |||||
| public synchronized void write(int b) throws IOException { | public synchronized void write(int b) throws IOException { | ||||
| ensureOpened(); | ensureOpened(); | ||||
| fos.write(b); | fos.write(b); | ||||
| @@ -50,26 +50,48 @@ public class LazyHashtable extends Hashtable { | |||||
| } | } | ||||
| /** | |||||
| * Get a enumeration over the elements. | |||||
| * @return an enumeration. | |||||
| */ | |||||
| public Enumeration elements() { | public Enumeration elements() { | ||||
| initAll(); | initAll(); | ||||
| return super.elements(); | return super.elements(); | ||||
| } | } | ||||
| /** | |||||
| * Check if the table is empty. | |||||
| * @return true if it is. | |||||
| */ | |||||
| public boolean isEmpty() { | public boolean isEmpty() { | ||||
| initAll(); | initAll(); | ||||
| return super.isEmpty(); | return super.isEmpty(); | ||||
| } | } | ||||
| /** | |||||
| * Get the size of the table. | |||||
| * @return the size. | |||||
| */ | |||||
| public int size() { | public int size() { | ||||
| initAll(); | initAll(); | ||||
| return super.size(); | return super.size(); | ||||
| } | } | ||||
| /** | |||||
| * Check if the table contains a particular value. | |||||
| * @param value the value to look for. | |||||
| * @return true if the table contains the value. | |||||
| */ | |||||
| public boolean contains(Object value) { | public boolean contains(Object value) { | ||||
| initAll(); | initAll(); | ||||
| return super.contains(value); | return super.contains(value); | ||||
| } | } | ||||
| /** | |||||
| * Check if the table contains a particular key. | |||||
| * @param value the key to look for. | |||||
| * @return true if the table contains key. | |||||
| */ | |||||
| public boolean containsKey(Object value) { | public boolean containsKey(Object value) { | ||||
| initAll(); | initAll(); | ||||
| return super.containsKey(value); | return super.containsKey(value); | ||||
| @@ -77,11 +99,17 @@ public class LazyHashtable extends Hashtable { | |||||
| /** | /** | ||||
| * Delegates to {@link #contains contains}. | * Delegates to {@link #contains contains}. | ||||
| * @param value the value to look for. | |||||
| * @return true if the table contains the value. | |||||
| */ | */ | ||||
| public boolean containsValue(Object value) { | public boolean containsValue(Object value) { | ||||
| return contains(value); | return contains(value); | ||||
| } | } | ||||
| /** | |||||
| * Get an enumeration over the keys. | |||||
| * @return an enumeration. | |||||
| */ | |||||
| public Enumeration keys() { | public Enumeration keys() { | ||||
| initAll(); | initAll(); | ||||
| return super.keys(); | return super.keys(); | ||||
| @@ -75,6 +75,11 @@ public class LeadPipeInputStream extends PipedInputStream { | |||||
| } | } | ||||
| //inherit doc | //inherit doc | ||||
| /** | |||||
| * Read a byte from the stream. | |||||
| * @return the byte (0 to 255) or -1 if there are no more. | |||||
| * @throws IOException if there is an error. | |||||
| */ | |||||
| public synchronized int read() throws IOException { | public synchronized int read() throws IOException { | ||||
| int result = -1; | int result = -1; | ||||
| try { | try { | ||||
| @@ -21,6 +21,8 @@ import java.io.File; | |||||
| import org.apache.tools.ant.BuildException; | import org.apache.tools.ant.BuildException; | ||||
| import org.apache.tools.ant.launch.Locator; | import org.apache.tools.ant.launch.Locator; | ||||
| // CheckStyle:HideUtilityClassConstructorCheck OFF - bc | |||||
| /** | /** | ||||
| * ClassLoader utility methods | * ClassLoader utility methods | ||||
| * | * | ||||
| @@ -52,6 +52,8 @@ import org.apache.tools.ant.types.resources.selectors.Exists; | |||||
| import org.apache.tools.ant.types.resources.selectors.ResourceSelector; | import org.apache.tools.ant.types.resources.selectors.ResourceSelector; | ||||
| import org.apache.tools.ant.types.selectors.SelectorUtils; | import org.apache.tools.ant.types.selectors.SelectorUtils; | ||||
| // CheckStyle:HideUtilityClassConstructorCheck OFF - bc | |||||
| /** | /** | ||||
| * This class provides utility methods to process Resources. | * This class provides utility methods to process Resources. | ||||
| * | * | ||||
| @@ -59,7 +61,7 @@ import org.apache.tools.ant.types.selectors.SelectorUtils; | |||||
| */ | */ | ||||
| public class ResourceUtils { | public class ResourceUtils { | ||||
| private static class Outdated implements ResourceSelector { | |||||
| private static final class Outdated implements ResourceSelector { | |||||
| private Resource control; | private Resource control; | ||||
| private long granularity; | private long granularity; | ||||
| private Outdated(Resource control, long granularity) { | private Outdated(Resource control, long granularity) { | ||||
| @@ -226,6 +228,7 @@ public class ResourceUtils { | |||||
| false, null, null, project); | false, null, null, project); | ||||
| } | } | ||||
| // CheckStyle:ParameterNumberCheck OFF - bc | |||||
| /** | /** | ||||
| * Convenience method to copy content from one Resource to another | * Convenience method to copy content from one Resource to another | ||||
| * specifying whether token filtering must be used, whether filter chains | * specifying whether token filtering must be used, whether filter chains | ||||
| @@ -383,6 +386,7 @@ public class ResourceUtils { | |||||
| setLastModified((Touchable) dest, source.getLastModified()); | setLastModified((Touchable) dest, source.getLastModified()); | ||||
| } | } | ||||
| } | } | ||||
| // CheckStyle:ParameterNumberCheck ON | |||||
| /** | /** | ||||
| * Set the last modified time of an object implementing | * Set the last modified time of an object implementing | ||||
| @@ -28,7 +28,7 @@ import java.io.IOException; | |||||
| */ | */ | ||||
| public interface Retryable { | public interface Retryable { | ||||
| /** The value to use to never give up. */ | /** The value to use to never give up. */ | ||||
| public static final int RETRY_FOREVER = -1; | |||||
| int RETRY_FOREVER = -1; | |||||
| /** | /** | ||||
| * Called to execute the code. | * Called to execute the code. | ||||
| * @throws IOException if there is a problem. | * @throws IOException if there is a problem. | ||||
| @@ -21,7 +21,9 @@ package org.apache.tools.ant.util; | |||||
| * XML Parser constants, all kept in one place for ease of reuse | * XML Parser constants, all kept in one place for ease of reuse | ||||
| * @see <a href="http://xml.apache.org/xerces-j/features.html">Xerces features</a> | * @see <a href="http://xml.apache.org/xerces-j/features.html">Xerces features</a> | ||||
| * @see <a href="http://xml.apache.org/xerces-j/properties.html">Xerces properties</a> | * @see <a href="http://xml.apache.org/xerces-j/properties.html">Xerces properties</a> | ||||
| * @see <a href="http://www.saxproject.org/apidoc/org/xml/sax/package-summary.html#package_description">SAX.</a> | |||||
| * @see <a href= | |||||
| * "http://www.saxproject.org/apidoc/org/xml/sax/package-summary.html#package_description" | |||||
| * >SAX.</a> | |||||
| */ | */ | ||||
| public class XmlConstants { | public class XmlConstants { | ||||
| @@ -47,10 +49,13 @@ public class XmlConstants { | |||||
| /** property for schema source */ | /** property for schema source */ | ||||
| public static final String FEATURE_JAXP12_SCHEMA_SOURCE = | public static final String FEATURE_JAXP12_SCHEMA_SOURCE = | ||||
| "http://java.sun.com/xml/jaxp/properties/schemaSource"; | "http://java.sun.com/xml/jaxp/properties/schemaSource"; | ||||
| /** the namespace for XML schema */ | |||||
| public static final String URI_XSD = | public static final String URI_XSD = | ||||
| "http://www.w3.org/2001/XMLSchema"; | "http://www.w3.org/2001/XMLSchema"; | ||||
| /** the sax external entities feature */ | |||||
| public static final String FEATURE_EXTERNAL_ENTITIES = | public static final String FEATURE_EXTERNAL_ENTITIES = | ||||
| "http://xml.org/sax/features/external-general-entities"; | "http://xml.org/sax/features/external-general-entities"; | ||||
| /** the apache.org/xml disalllow doctype decl feature */ | |||||
| public static final String FEATURE_DISALLOW_DTD = | public static final String FEATURE_DISALLOW_DTD = | ||||
| "http://apache.org/xml/features/disallow-doctype-decl"; | "http://apache.org/xml/features/disallow-doctype-decl"; | ||||
| } | } | ||||
| @@ -94,6 +94,7 @@ public class RegexpFactory extends RegexpMatcherFactory { | |||||
| /** | /** | ||||
| * Wrapper over RegexpMatcherFactory.createInstance that ensures that | * Wrapper over RegexpMatcherFactory.createInstance that ensures that | ||||
| * we are dealing with a Regexp implementation. | * we are dealing with a Regexp implementation. | ||||
| * @param classname the name of the class to use. | |||||
| * @return the instance. | * @return the instance. | ||||
| * @throws BuildException if there is a problem. | * @throws BuildException if there is a problem. | ||||
| * @since 1.3 | * @since 1.3 | ||||
| @@ -17,6 +17,8 @@ | |||||
| */ | */ | ||||
| package org.apache.tools.ant.util.regexp; | package org.apache.tools.ant.util.regexp; | ||||
| // CheckStyle:HideUtilityClassConstructorCheck OFF - bc | |||||
| /*** | /*** | ||||
| * Regular expression utilities class which handles flag operations. | * Regular expression utilities class which handles flag operations. | ||||
| * | * | ||||