Browse Source

checkstyle

git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@475983 13f79535-47bb-0310-9956-ffa450edef68
master
Peter Reilly 18 years ago
parent
commit
9dfd03133b
15 changed files with 81 additions and 6 deletions
  1. +2
    -0
      src/main/org/apache/tools/ant/util/ClasspathUtils.java
  2. +2
    -0
      src/main/org/apache/tools/ant/util/CollectionUtils.java
  3. +2
    -1
      src/main/org/apache/tools/ant/util/DOMElementWriter.java
  4. +2
    -0
      src/main/org/apache/tools/ant/util/DOMUtils.java
  5. +3
    -0
      src/main/org/apache/tools/ant/util/FileUtils.java
  6. +2
    -0
      src/main/org/apache/tools/ant/util/JAXPUtils.java
  7. +18
    -2
      src/main/org/apache/tools/ant/util/LazyFileOutputStream.java
  8. +28
    -0
      src/main/org/apache/tools/ant/util/LazyHashtable.java
  9. +5
    -0
      src/main/org/apache/tools/ant/util/LeadPipeInputStream.java
  10. +2
    -0
      src/main/org/apache/tools/ant/util/LoaderUtils.java
  11. +5
    -1
      src/main/org/apache/tools/ant/util/ResourceUtils.java
  12. +1
    -1
      src/main/org/apache/tools/ant/util/Retryable.java
  13. +6
    -1
      src/main/org/apache/tools/ant/util/XmlConstants.java
  14. +1
    -0
      src/main/org/apache/tools/ant/util/regexp/RegexpFactory.java
  15. +2
    -0
      src/main/org/apache/tools/ant/util/regexp/RegexpUtil.java

+ 2
- 0
src/main/org/apache/tools/ant/util/ClasspathUtils.java View File

@@ -25,6 +25,8 @@ import org.apache.tools.ant.MagicNames;
import org.apache.tools.ant.types.Path;
import org.apache.tools.ant.types.Reference;

// CheckStyle:HideUtilityClassConstructorCheck OFF - bc

/**
* Offers some helper methods on the Path structure in ant.
*


+ 2
- 0
src/main/org/apache/tools/ant/util/CollectionUtils.java View File

@@ -23,6 +23,8 @@ import java.util.Dictionary;
import java.util.Enumeration;
import java.util.NoSuchElementException;

// CheckStyle:HideUtilityClassConstructorCheck OFF - bc

/**
* A set of helper methods related to collection manipulation.
*


+ 2
- 1
src/main/org/apache/tools/ant/util/DOMElementWriter.java View File

@@ -453,7 +453,8 @@ public class DOMElementWriter {
* <code>&amp;#x5d;&amp;#x5d;&amp;gt;</code>.</p>
*
* <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
* 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.


+ 2
- 0
src/main/org/apache/tools/ant/util/DOMUtils.java View File

@@ -23,6 +23,8 @@ import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.Text;

// CheckStyle:HideUtilityClassConstructorCheck OFF - bc

/**
* Some utility methods for common tasks when building DOM trees in memory.
*


+ 3
- 0
src/main/org/apache/tools/ant/util/FileUtils.java View File

@@ -250,6 +250,7 @@ public class FileUtils {
overwrite, preserveLastModified, encoding);
}

// CheckStyle:ParameterNumberCheck OFF - bc
/**
* Convenience method to copy a file from a source to a
* destination specifying if token filtering must be used, if
@@ -510,6 +511,8 @@ public class FileUtils {
inputEncoding, outputEncoding, project);
}

// CheckStyle:ParameterNumberCheck ON

/**
* Calls File.setLastModified(long time). Originally written to
* to dynamically bind to that call on Java1.2+.


+ 2
- 0
src/main/org/apache/tools/ant/util/JAXPUtils.java View File

@@ -29,6 +29,8 @@ import org.xml.sax.Parser;
import org.xml.sax.SAXException;
import org.xml.sax.XMLReader;

// CheckStyle:HideUtilityClassConstructorCheck OFF - bc

/**
* Collection of helper methods that retrieve a ParserFactory or
* Parsers and Readers.


+ 18
- 2
src/main/org/apache/tools/ant/util/LazyFileOutputStream.java View File

@@ -103,6 +103,10 @@ public class LazyFileOutputStream extends OutputStream {
ensureOpened();
}

/**
* Close the file.
* @throws IOException if there is an error.
*/
public synchronized void close() throws IOException {
if (alwaysCreate && !closed) {
ensureOpened();
@@ -115,19 +119,31 @@ public class LazyFileOutputStream extends OutputStream {

/**
* 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 {
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)
throws IOException {
ensureOpened();
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 {
ensureOpened();
fos.write(b);


+ 28
- 0
src/main/org/apache/tools/ant/util/LazyHashtable.java View File

@@ -50,26 +50,48 @@ public class LazyHashtable extends Hashtable {
}


/**
* Get a enumeration over the elements.
* @return an enumeration.
*/
public Enumeration elements() {
initAll();
return super.elements();
}

/**
* Check if the table is empty.
* @return true if it is.
*/
public boolean isEmpty() {
initAll();
return super.isEmpty();
}

/**
* Get the size of the table.
* @return the size.
*/
public int size() {
initAll();
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) {
initAll();
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) {
initAll();
return super.containsKey(value);
@@ -77,11 +99,17 @@ public class LazyHashtable extends Hashtable {

/**
* 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) {
return contains(value);
}

/**
* Get an enumeration over the keys.
* @return an enumeration.
*/
public Enumeration keys() {
initAll();
return super.keys();


+ 5
- 0
src/main/org/apache/tools/ant/util/LeadPipeInputStream.java View File

@@ -75,6 +75,11 @@ public class LeadPipeInputStream extends PipedInputStream {
}

//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 {
int result = -1;
try {


+ 2
- 0
src/main/org/apache/tools/ant/util/LoaderUtils.java View File

@@ -21,6 +21,8 @@ import java.io.File;
import org.apache.tools.ant.BuildException;
import org.apache.tools.ant.launch.Locator;

// CheckStyle:HideUtilityClassConstructorCheck OFF - bc

/**
* ClassLoader utility methods
*


+ 5
- 1
src/main/org/apache/tools/ant/util/ResourceUtils.java View File

@@ -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.selectors.SelectorUtils;

// CheckStyle:HideUtilityClassConstructorCheck OFF - bc

/**
* This class provides utility methods to process Resources.
*
@@ -59,7 +61,7 @@ import org.apache.tools.ant.types.selectors.SelectorUtils;
*/
public class ResourceUtils {

private static class Outdated implements ResourceSelector {
private static final class Outdated implements ResourceSelector {
private Resource control;
private long granularity;
private Outdated(Resource control, long granularity) {
@@ -226,6 +228,7 @@ public class ResourceUtils {
false, null, null, project);
}

// CheckStyle:ParameterNumberCheck OFF - bc
/**
* Convenience method to copy content from one Resource to another
* specifying whether token filtering must be used, whether filter chains
@@ -383,6 +386,7 @@ public class ResourceUtils {
setLastModified((Touchable) dest, source.getLastModified());
}
}
// CheckStyle:ParameterNumberCheck ON

/**
* Set the last modified time of an object implementing


+ 1
- 1
src/main/org/apache/tools/ant/util/Retryable.java View File

@@ -28,7 +28,7 @@ import java.io.IOException;
*/
public interface Retryable {
/** The value to use to never give up. */
public static final int RETRY_FOREVER = -1;
int RETRY_FOREVER = -1;
/**
* Called to execute the code.
* @throws IOException if there is a problem.


+ 6
- 1
src/main/org/apache/tools/ant/util/XmlConstants.java View File

@@ -21,7 +21,9 @@ package org.apache.tools.ant.util;
* 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/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 {
@@ -47,10 +49,13 @@ public class XmlConstants {
/** property for schema source */
public static final String FEATURE_JAXP12_SCHEMA_SOURCE =
"http://java.sun.com/xml/jaxp/properties/schemaSource";
/** the namespace for XML schema */
public static final String URI_XSD =
"http://www.w3.org/2001/XMLSchema";
/** the sax external entities feature */
public static final String FEATURE_EXTERNAL_ENTITIES =
"http://xml.org/sax/features/external-general-entities";
/** the apache.org/xml disalllow doctype decl feature */
public static final String FEATURE_DISALLOW_DTD =
"http://apache.org/xml/features/disallow-doctype-decl";
}

+ 1
- 0
src/main/org/apache/tools/ant/util/regexp/RegexpFactory.java View File

@@ -94,6 +94,7 @@ public class RegexpFactory extends RegexpMatcherFactory {
/**
* Wrapper over RegexpMatcherFactory.createInstance that ensures that
* we are dealing with a Regexp implementation.
* @param classname the name of the class to use.
* @return the instance.
* @throws BuildException if there is a problem.
* @since 1.3


+ 2
- 0
src/main/org/apache/tools/ant/util/regexp/RegexpUtil.java View File

@@ -17,6 +17,8 @@
*/
package org.apache.tools.ant.util.regexp;

// CheckStyle:HideUtilityClassConstructorCheck OFF - bc

/***
* Regular expression utilities class which handles flag operations.
*


Loading…
Cancel
Save