Browse Source

checkstyle

git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@474079 13f79535-47bb-0310-9956-ffa450edef68
master
Peter Reilly 18 years ago
parent
commit
5d029deab9
34 changed files with 127 additions and 34 deletions
  1. +3
    -1
      src/main/org/apache/tools/ant/util/Base64Converter.java
  2. +1
    -1
      src/main/org/apache/tools/ant/util/ChainedMapper.java
  3. +1
    -2
      src/main/org/apache/tools/ant/util/ClasspathUtils.java
  4. +1
    -1
      src/main/org/apache/tools/ant/util/CompositeMapper.java
  5. +9
    -2
      src/main/org/apache/tools/ant/util/ConcatFileInputStream.java
  6. +10
    -3
      src/main/org/apache/tools/ant/util/ConcatResourceInputStream.java
  7. +7
    -1
      src/main/org/apache/tools/ant/util/DOMElementWriter.java
  8. +2
    -2
      src/main/org/apache/tools/ant/util/DOMUtils.java
  9. +0
    -2
      src/main/org/apache/tools/ant/util/FileTokenizer.java
  10. +2
    -1
      src/main/org/apache/tools/ant/util/FileUtils.java
  11. +3
    -0
      src/main/org/apache/tools/ant/util/GlobPatternMapper.java
  12. +3
    -0
      src/main/org/apache/tools/ant/util/IdentityStack.java
  13. +3
    -1
      src/main/org/apache/tools/ant/util/JavaEnvUtils.java
  14. +10
    -0
      src/main/org/apache/tools/ant/util/LazyFileOutputStream.java
  15. +3
    -0
      src/main/org/apache/tools/ant/util/LazyHashtable.java
  16. +1
    -0
      src/main/org/apache/tools/ant/util/LeadPipeInputStream.java
  17. +5
    -0
      src/main/org/apache/tools/ant/util/LineOrientedOutputStream.java
  18. +2
    -0
      src/main/org/apache/tools/ant/util/MergingMapper.java
  19. +16
    -1
      src/main/org/apache/tools/ant/util/ProxySetup.java
  20. +2
    -0
      src/main/org/apache/tools/ant/util/RegexpPatternMapper.java
  21. +2
    -1
      src/main/org/apache/tools/ant/util/RetryHandler.java
  22. +5
    -0
      src/main/org/apache/tools/ant/util/Retryable.java
  23. +2
    -0
      src/main/org/apache/tools/ant/util/SourceFileScanner.java
  24. +0
    -1
      src/main/org/apache/tools/ant/util/StringTokenizer.java
  25. +4
    -2
      src/main/org/apache/tools/ant/util/StringUtils.java
  26. +1
    -0
      src/main/org/apache/tools/ant/util/UUEncoder.java
  27. +4
    -2
      src/main/org/apache/tools/ant/util/WeakishReference.java
  28. +8
    -0
      src/main/org/apache/tools/ant/util/XmlConstants.java
  29. +6
    -2
      src/main/org/apache/tools/ant/util/java15/ProxyDiagnostics.java
  30. +1
    -1
      src/main/org/apache/tools/ant/util/optional/ScriptRunner.java
  31. +0
    -2
      src/main/org/apache/tools/ant/util/optional/WeakishReference12.java
  32. +2
    -0
      src/main/org/apache/tools/ant/util/regexp/JakartaOroMatcher.java
  33. +5
    -3
      src/main/org/apache/tools/ant/util/regexp/RegexpFactory.java
  34. +3
    -2
      src/main/org/apache/tools/ant/util/regexp/RegexpMatcherFactory.java

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

@@ -25,7 +25,7 @@ package org.apache.tools.ant.util;
**/ **/
public class Base64Converter { public class Base64Converter {


private final static char[] ALPHABET = {
private static final char[] ALPHABET = {
'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', // 0 to 7 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', // 0 to 7
'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', // 8 to 15 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', // 8 to 15
'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', // 16 to 23 '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 'w', 'x', 'y', 'z', '0', '1', '2', '3', // 48 to 55
'4', '5', '6', '7', '8', '9', '+', '/'}; // 56 to 63 '4', '5', '6', '7', '8', '9', '+', '/'}; // 56 to 63


// CheckStyle:ConstantNameCheck OFF - bc
/** Provided for BC purposes */ /** Provided for BC purposes */
public static final char[] alphabet = ALPHABET; public static final char[] alphabet = ALPHABET;
// CheckStyle:ConstantNameCheck ON




/** /**


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

@@ -31,7 +31,7 @@ import java.util.ArrayList;
*/ */
public class ChainedMapper extends ContainerMapper { public class ChainedMapper extends ContainerMapper {


//inherit doc
/** {@inheritDoc}. */
public String[] mapFileName(String sourceFileName) { public String[] mapFileName(String sourceFileName) {
List inputs = new ArrayList(); List inputs = new ArrayList();
List results = new ArrayList(); List results = new ArrayList();


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

@@ -263,8 +263,7 @@ public class ClasspathUtils {
try { try {
Class clazz = Class.forName(className, true, userDefinedLoader); Class clazz = Class.forName(className, true, userDefinedLoader);
Object o = clazz.newInstance(); Object o = clazz.newInstance();
if (!expectedType.isInstance(o))
{
if (!expectedType.isInstance(o)) {
throw new BuildException( throw new BuildException(
"Class of unexpected Type: " "Class of unexpected Type: "
+ className + className


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

@@ -27,7 +27,7 @@ import java.util.Iterator;
*/ */
public class CompositeMapper extends ContainerMapper { public class CompositeMapper extends ContainerMapper {


//inherit doc
/** {@inheritDoc}. */
public String[] mapFileName(String sourceFileName) { public String[] mapFileName(String sourceFileName) {
HashSet results = new HashSet(); HashSet results = new HashSet();




+ 9
- 2
src/main/org/apache/tools/ant/util/ConcatFileInputStream.java View File

@@ -51,13 +51,20 @@ public class ConcatFileInputStream extends InputStream {
this.file = file; this.file = file;
} }


// inherit doc
/**
* Close the stream.
* @throws IOException if there is an error.
*/
public void close() throws IOException { public void close() throws IOException {
closeCurrent(); closeCurrent();
eof = true; 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 { public int read() throws IOException {
int result = readCurrent(); int result = readCurrent();
if (result == EOF && !eof) { if (result == EOF && !eof) {


+ 10
- 3
src/main/org/apache/tools/ant/util/ConcatResourceInputStream.java View File

@@ -67,13 +67,20 @@ public class ConcatResourceInputStream extends InputStream {
return ignoreErrors; 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(); closeCurrent();
eof = true; 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 { public int read() throws IOException {
if (eof) { if (eof) {
return EOF; return EOF;


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

@@ -130,6 +130,7 @@ public class DOMElementWriter {
* XML namespaces will be ignored. * XML namespaces will be ignored.
* @param xmlDeclaration flag to indicate whether the ?xml? declaration * @param xmlDeclaration flag to indicate whether the ?xml? declaration
* should be included. * should be included.
* @param namespacePolicy the policy to use.
* @since Ant1.7 * @since Ant1.7
*/ */
public DOMElementWriter(boolean xmlDeclaration, public DOMElementWriter(boolean xmlDeclaration,
@@ -140,11 +141,13 @@ public class DOMElementWriter {


private static String lSep = System.getProperty("line.separator"); 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 * Don't try to be too smart but at least recognize the predefined
* entities. * entities.
*/ */
protected String[] knownEntities = {"gt", "amp", "lt", "apos", "quot"}; 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 * @since Ant 1.7.0
*/ */
public void writeXMLDeclaration(Writer wri) throws IOException { public void writeXMLDeclaration(Writer wri) throws IOException {
@@ -365,6 +370,7 @@ public class DOMElementWriter {
* @param indent number of * @param indent number of
* @param indentWith string that should be used to indent the * @param indentWith string that should be used to indent the
* corresponding tag. * corresponding tag.
* @param hasChildren if true indent.
* @throws IOException if an error happens while writing to the stream. * @throws IOException if an error happens while writing to the stream.
*/ */
public void closeElement(Element element, Writer out, int indent, public void closeElement(Element element, Writer out, int indent,


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

@@ -35,7 +35,7 @@ public class DOMUtils {


/** /**
* Get a new Document instance, * Get a new Document instance,
*
* @return the document.
* @since Ant 1.6.3 * @since Ant 1.6.3
*/ */
public static Document newDocument() { public static Document newDocument() {
@@ -163,4 +163,4 @@ public class DOMUtils {
Element e = createChildElement(parent, name); Element e = createChildElement(parent, name);
appendCDATA(e, content); appendCDATA(e, content);
} }
}
}

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

@@ -20,8 +20,6 @@ package org.apache.tools.ant.util;
import java.io.IOException; import java.io.IOException;
import java.io.Reader; import java.io.Reader;
import org.apache.tools.ant.ProjectComponent; 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. * Class to read the complete input into a string.


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

@@ -1105,7 +1105,8 @@ public class FileUtils {
File f = new File(path).getAbsoluteFile(); File f = new File(path).getAbsoluteFile();
java.lang.reflect.Method toURIMethod = File.class.getMethod("toURI", new Class[0]); java.lang.reflect.Method toURIMethod = File.class.getMethod("toURI", new Class[0]);
Object uriObj = toURIMethod.invoke(f, new Object[] {}); 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[] {}); return (String) toASCIIStringMethod.invoke(uriObj, new Object[] {});
} catch (Exception e) { } catch (Exception e) {
// Reflection problems? Should not happen, debug. // Reflection problems? Should not happen, debug.


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

@@ -33,6 +33,7 @@ package org.apache.tools.ant.util;
*/ */
public class GlobPatternMapper implements FileNameMapper { public class GlobPatternMapper implements FileNameMapper {


// CheckStyle:VisibilityModifier OFF - bc
/** /**
* Part of "from" pattern before the *. * Part of "from" pattern before the *.
*/ */
@@ -63,6 +64,8 @@ public class GlobPatternMapper implements FileNameMapper {
*/ */
protected String toPostfix = null; protected String toPostfix = null;


// CheckStyle:VisibilityModifier ON

private boolean handleDirSep = false; private boolean handleDirSep = false;
private boolean caseSensitive = true; private boolean caseSensitive = true;




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

@@ -60,6 +60,7 @@ public class IdentityStack extends Stack {
/** /**
* Override methods that use <code>.equals()</code> comparisons on elements. * Override methods that use <code>.equals()</code> comparisons on elements.
* @param o the Object to search for. * @param o the Object to search for.
* @return true if the stack contains the object.
* @see java.util.Vector#contains(Object) * @see java.util.Vector#contains(Object)
*/ */
public synchronized boolean contains(Object o) { public synchronized boolean contains(Object o) {
@@ -70,6 +71,7 @@ public class IdentityStack extends Stack {
* Override methods that use <code>.equals()</code> comparisons on elements. * Override methods that use <code>.equals()</code> comparisons on elements.
* @param o the Object to search for. * @param o the Object to search for.
* @param pos the position from which to search. * @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) * @see java.util.Vector#indexOf(Object, int)
*/ */
public synchronized int indexOf(Object o, int pos) { public synchronized int indexOf(Object o, int pos) {
@@ -85,6 +87,7 @@ public class IdentityStack extends Stack {
* Override methods that use <code>.equals()</code> comparisons on elements. * Override methods that use <code>.equals()</code> comparisons on elements.
* @param o the Object to search for. * @param o the Object to search for.
* @param pos the position from which to search (backward). * @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) * @see java.util.Vector#indexOf(Object, int)
*/ */
public synchronized int lastIndexOf(Object o, int pos) { public synchronized int lastIndexOf(Object o, int pos) {


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

@@ -342,7 +342,9 @@ public final class JavaEnvUtils {
switch(javaVersionNumber) { switch(javaVersionNumber) {
case 16: case 16:
case 15: 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: case 14:
tests.addElement("sun.audio.AudioPlayer"); tests.addElement("sun.audio.AudioPlayer");
if (javaVersionNumber == 14) { if (javaVersionNumber == 14) {


+ 10
- 0
src/main/org/apache/tools/ant/util/LazyFileOutputStream.java View File

@@ -41,6 +41,7 @@ public class LazyFileOutputStream extends OutputStream {
/** /**
* Creates a stream that will eventually write to the file with * Creates a stream that will eventually write to the file with
* the given name and replace it. * the given name and replace it.
* @param name the filename.
*/ */
public LazyFileOutputStream(String name) { public LazyFileOutputStream(String name) {
this(name, false); this(name, false);
@@ -50,6 +51,8 @@ public class LazyFileOutputStream extends OutputStream {
* Creates a stream that will eventually write to the file with * Creates a stream that will eventually write to the file with
* the given name and optionally append to instead of replacing * the given name and optionally append to instead of replacing
* it. * it.
* @param name the filename.
* @param append if true append rather than replace.
*/ */
public LazyFileOutputStream(String name, boolean append) { public LazyFileOutputStream(String name, boolean append) {
this(new File(name), 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 * Creates a stream that will eventually write to the file with
* the given name and replace it. * the given name and replace it.
* @param f the file to create.
*/ */
public LazyFileOutputStream(File f) { public LazyFileOutputStream(File f) {
this(f, false); this(f, false);
@@ -67,6 +71,8 @@ public class LazyFileOutputStream extends OutputStream {
* Creates a stream that will eventually write to the file with * Creates a stream that will eventually write to the file with
* the given name and optionally append to instead of replacing * the given name and optionally append to instead of replacing
* it. * it.
* @param file the file to create.
* @param append if true append rather than replace.
*/ */
public LazyFileOutputStream(File file, boolean append) { public LazyFileOutputStream(File file, boolean append) {
this(file, append, false); this(file, append, false);
@@ -76,6 +82,9 @@ public class LazyFileOutputStream extends OutputStream {
* Creates a stream that will eventually write to the file with * Creates a stream that will eventually write to the file with
* the given name, optionally append to instead of replacing * the given name, optionally append to instead of replacing
* it, and optionally always create a file (even if zero length). * 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, public LazyFileOutputStream(File file, boolean append,
boolean alwaysCreate) { boolean alwaysCreate) {
@@ -88,6 +97,7 @@ public class LazyFileOutputStream extends OutputStream {
* Explicitly open the file for writing. * Explicitly open the file for writing.
* *
* <p>Returns silently if the file has already been opened.</p> * <p>Returns silently if the file has already been opened.</p>
* @throws IOException if there is an error.
*/ */
public void open() throws IOException { public void open() throws IOException {
ensureOpened(); ensureOpened();


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

@@ -29,8 +29,11 @@ import java.util.Enumeration;
* @since Ant 1.6 * @since Ant 1.6
*/ */
public class LazyHashtable extends Hashtable { public class LazyHashtable extends Hashtable {
// CheckStyle:VisibilityModifier OFF - bc
protected boolean initAllDone = false; protected boolean initAllDone = false;
// CheckStyle:VisibilityModifier OFF - bc


/** No arg constructor. */
public LazyHashtable() { public LazyHashtable() {
super(); super();
} }


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

@@ -67,6 +67,7 @@ public class LeadPipeInputStream extends PipedInputStream {
* circular buffer of the specified size. * circular buffer of the specified size.
* @param src the <code>PipedOutputStream</code> source. * @param src the <code>PipedOutputStream</code> source.
* @param size the size of the circular buffer. * @param size the size of the circular buffer.
* @throws IOException if there is an error.
*/ */
public LeadPipeInputStream(PipedOutputStream src, int size) throws IOException { public LeadPipeInputStream(PipedOutputStream src, int size) throws IOException {
super(src); super(src);


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

@@ -48,6 +48,7 @@ public abstract class LineOrientedOutputStream extends OutputStream {
* separator is detected. * separator is detected.
* *
* @param cc data to log (byte). * @param cc data to log (byte).
* @throws IOException if there is an error.
*/ */
public final void write(int cc) throws IOException { public final void write(int cc) throws IOException {
final byte c = (byte) cc; final byte c = (byte) cc;
@@ -63,6 +64,7 @@ public abstract class LineOrientedOutputStream extends OutputStream {


/** /**
* Flush this log stream * Flush this log stream
* @throws IOException if there is an error.
*/ */
public final void flush() throws IOException { public final void flush() throws IOException {
if (buffer.size() > 0) { if (buffer.size() > 0) {
@@ -73,6 +75,7 @@ public abstract class LineOrientedOutputStream extends OutputStream {
/** /**
* Converts the buffer to a string and sends it to * Converts the buffer to a string and sends it to
* <code>processLine</code> * <code>processLine</code>
* @throws IOException if there is an error.
*/ */
protected void processBuffer() throws IOException { protected void processBuffer() throws IOException {
try { try {
@@ -86,11 +89,13 @@ public abstract class LineOrientedOutputStream extends OutputStream {
* Processes a line. * Processes a line.
* *
* @param line the line to log. * @param line the line to log.
* @throws IOException if there is an error.
*/ */
protected abstract void processLine(String line) throws IOException; protected abstract void processLine(String line) throws IOException;


/** /**
* Writes all remaining * Writes all remaining
* @throws IOException if there is an error.
*/ */
public final void close() throws IOException { public final void close() throws IOException {
if (buffer.size() > 0) { if (buffer.size() > 0) {


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

@@ -27,7 +27,9 @@ package org.apache.tools.ant.util;
* *
*/ */
public class MergingMapper implements FileNameMapper { public class MergingMapper implements FileNameMapper {
// CheckStyle:VisibilityModifier OFF - bc
protected String[] mergedFile = null; protected String[] mergedFile = null;
// CheckStyle:VisibilityModifier ON


/** /**
* Ignored. * Ignored.


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

@@ -38,26 +38,41 @@ public class ProxySetup {
* @value * @value
*/ */
public static final String USE_SYSTEM_PROXIES = "java.net.useSystemProxies"; public static final String USE_SYSTEM_PROXIES = "java.net.useSystemProxies";
/** the http proxyhost property */
public static final String HTTP_PROXY_HOST = "http.proxyHost"; public static final String HTTP_PROXY_HOST = "http.proxyHost";
/** the http proxyport property */
public static final String HTTP_PROXY_PORT = "http.proxyPort"; public static final String HTTP_PROXY_PORT = "http.proxyPort";
/** the https proxyhost property */
public static final String HTTPS_PROXY_HOST = "https.proxyHost"; public static final String HTTPS_PROXY_HOST = "https.proxyHost";
/** the https proxyport property */
public static final String HTTPS_PROXY_PORT = "https.proxyPort"; public static final String HTTPS_PROXY_PORT = "https.proxyPort";
/** the ftp proxyhost property */
public static final String FTP_PROXY_HOST = "ftp.proxyHost"; public static final String FTP_PROXY_HOST = "ftp.proxyHost";
/** the ftp proxyport property */
public static final String FTP_PROXY_PORT = "ftp.proxyPort"; public static final String FTP_PROXY_PORT = "ftp.proxyPort";
/** the ftp proxyport property */
public static final String HTTP_NON_PROXY_HOSTS = "http.nonProxyHosts"; 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"; 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"; public static final String FTP_NON_PROXY_HOSTS = "ftp.nonProxyHosts";
/** the http proxy username property */
public static final String HTTP_PROXY_USERNAME = "http.proxyUser"; public static final String HTTP_PROXY_USERNAME = "http.proxyUser";
/** the http proxy password property */
public static final String HTTP_PROXY_PASSWORD = "http.proxyPassword"; public static final String HTTP_PROXY_PASSWORD = "http.proxyPassword";
/** the socks proxy host property */
public static final String SOCKS_PROXY_HOST = "socksProxyHost"; public static final String SOCKS_PROXY_HOST = "socksProxyHost";
/** the socks proxy port property */
public static final String SOCKS_PROXY_PORT = "socksProxyPort"; public static final String SOCKS_PROXY_PORT = "socksProxyPort";
/** the socks proxy username property */
public static final String SOCKS_PROXY_USERNAME = "java.net.socks.username"; 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"; public static final String SOCKS_PROXY_PASSWORD = "java.net.socks.password";




/** /**
* create a proxy setup class bound to this project * create a proxy setup class bound to this project
* @param owner
* @param owner the project that owns this setup.
*/ */
public ProxySetup(Project owner) { public ProxySetup(Project owner) {
this.owner = owner; this.owner = owner;


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

@@ -29,9 +29,11 @@ import org.apache.tools.ant.util.regexp.RegexpMatcherFactory;
* *
*/ */
public class RegexpPatternMapper implements FileNameMapper { public class RegexpPatternMapper implements FileNameMapper {
// CheckStyle:VisibilityModifier OFF - bc
protected RegexpMatcher reg = null; protected RegexpMatcher reg = null;
protected char[] to = null; protected char[] to = null;
protected StringBuffer result = new StringBuffer(); protected StringBuffer result = new StringBuffer();
// CheckStyle:VisibilityModifier ON


/** /**
* Constructor for RegexpPatternMapper. * Constructor for RegexpPatternMapper.


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

@@ -64,7 +64,8 @@ public class RetryHandler {
+ this.retriesAllowed + "), giving up", Project.MSG_WARN); + this.retriesAllowed + "), giving up", Project.MSG_WARN);
throw e; throw e;
} else { } else {
task.log("try #" + retries + ": IO error (" + desc + "), retrying", Project.MSG_WARN);
task.log("try #" + retries + ": IO error (" + desc
+ "), retrying", Project.MSG_WARN);
} }
} }
} }


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

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


} }

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

@@ -36,7 +36,9 @@ import org.apache.tools.ant.types.resources.FileResource;
*/ */
public class SourceFileScanner implements ResourceFactory { public class SourceFileScanner implements ResourceFactory {


// CheckStyle:VisibilityModifier OFF - bc
protected Task task; protected Task task;
// CheckStyle:VisibilityModifier ON


private static final FileUtils FILE_UTILS = FileUtils.getFileUtils(); private static final FileUtils FILE_UTILS = FileUtils.getFileUtils();
private File destDir; // base directory of the fileset private File destDir; // base directory of the fileset


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

@@ -20,7 +20,6 @@ package org.apache.tools.ant.util;
import java.io.IOException; import java.io.IOException;
import java.io.Reader; import java.io.Reader;
import org.apache.tools.ant.ProjectComponent; import org.apache.tools.ant.ProjectComponent;
import org.apache.tools.ant.util.Tokenizer;


/** /**
* Class to tokenize the input as areas separated * Class to tokenize the input as areas separated


+ 4
- 2
src/main/org/apache/tools/ant/util/StringUtils.java View File

@@ -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 * and perform poorly due to massive memory allocation and copying. See
* @param buffer the buffer to perform the check on * @param buffer the buffer to perform the check on
* @param suffix the suffix * @param suffix the suffix


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

@@ -54,6 +54,7 @@ public class UUEncoder {
* input stream. * input stream.
* @param is the input stream. * @param is the input stream.
* @param out the output stream. * @param out the output stream.
* @throws IOException if there is an error.
*/ */
public void encode(InputStream is, OutputStream out) public void encode(InputStream is, OutputStream out)
throws IOException { throws IOException {


+ 4
- 2
src/main/org/apache/tools/ant/util/WeakishReference.java View File

@@ -22,8 +22,10 @@ package org.apache.tools.ant.util;
import java.lang.ref.WeakReference; 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. * life is simpler and none of the classes are needed any more.
* *
* They are only retained in case a third-party task uses them * They are only retained in case a third-party task uses them


+ 8
- 0
src/main/org/apache/tools/ant/util/XmlConstants.java View File

@@ -25,18 +25,26 @@ package org.apache.tools.ant.util;
*/ */


public class XmlConstants { public class XmlConstants {
/** property for location of xml schema */
public static final String PROPERTY_SCHEMA_LOCATION = public static final String PROPERTY_SCHEMA_LOCATION =
"http://apache.org/xml/properties/schema/external-schemaLocation"; "http://apache.org/xml/properties/schema/external-schemaLocation";
/** property for location of no-name schema */
public static final String PROPERTY_NO_NAMESPACE_SCHEMA_LOCATION = public static final String PROPERTY_NO_NAMESPACE_SCHEMA_LOCATION =
"http://apache.org/xml/properties/schema/external-noNamespaceSchemaLocation"; "http://apache.org/xml/properties/schema/external-noNamespaceSchemaLocation";
/** property for full validation */
public static final String FEATURE_XSD_FULL_VALIDATION = public static final String FEATURE_XSD_FULL_VALIDATION =
"http://apache.org/xml/features/validation/schema-full-checking"; "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"; 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"; 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"; public static final String FEATURE_NAMESPACES = "http://xml.org/sax/features/namespaces";
/** property for schema language */
public static final String FEATURE_JAXP12_SCHEMA_LANGUAGE = public static final String FEATURE_JAXP12_SCHEMA_LANGUAGE =
"http://java.sun.com/xml/jaxp/properties/schemaLanguage"; "http://java.sun.com/xml/jaxp/properties/schemaLanguage";
/** 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";
public static final String URI_XSD = public static final String URI_XSD =


+ 6
- 2
src/main/org/apache/tools/ant/util/java15/ProxyDiagnostics.java View File

@@ -40,9 +40,9 @@ import java.util.Iterator;
*/ */
public class ProxyDiagnostics { public class ProxyDiagnostics {


String destination;
private String destination;


URI destURI;
private URI destURI;


/** {@value} */ /** {@value} */
public static final String DEFAULT_DESTINATION = "http://ant.apache.org/"; public static final String DEFAULT_DESTINATION = "http://ant.apache.org/";
@@ -69,6 +69,10 @@ public class ProxyDiagnostics {
this(DEFAULT_DESTINATION); this(DEFAULT_DESTINATION);
} }


/**
* Get the diagnostics for proxy information.
* @return the information.
*/
public String toString() { public String toString() {
ProxySelector selector = ProxySelector.getDefault(); ProxySelector selector = ProxySelector.getDefault();
List list = selector.select(destURI); List list = selector.select(destURI);


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

@@ -24,7 +24,6 @@ import java.io.IOException;
import org.apache.bsf.BSFException; import org.apache.bsf.BSFException;
import org.apache.bsf.BSFManager; import org.apache.bsf.BSFManager;


import org.apache.tools.ant.AntClassLoader;
import org.apache.tools.ant.BuildException; import org.apache.tools.ant.BuildException;
import org.apache.tools.ant.ProjectComponent; import org.apache.tools.ant.ProjectComponent;
import org.apache.tools.ant.Project; import org.apache.tools.ant.Project;
@@ -187,6 +186,7 @@ public class ScriptRunner {


/** /**
* Set the class path to be used. * Set the class path to be used.
* @param classpath the path to use.
*/ */
public void setClasspath(Path classpath) { public void setClasspath(Path classpath) {
this.classpath = classpath; this.classpath = classpath;


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

@@ -20,8 +20,6 @@ package org.apache.tools.ant.util.optional;


import org.apache.tools.ant.util.WeakishReference; 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 * This is a reference that really is is Weak, as it uses the
* appropriate java.lang.ref class. * appropriate java.lang.ref class.


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

@@ -32,8 +32,10 @@ import org.apache.tools.ant.BuildException;
public class JakartaOroMatcher implements RegexpMatcher { public class JakartaOroMatcher implements RegexpMatcher {


private String pattern; private String pattern;
// CheckStyle:VisibilityModifier OFF - bc
protected final Perl5Compiler compiler = new Perl5Compiler(); protected final Perl5Compiler compiler = new Perl5Compiler();
protected final Perl5Matcher matcher = new Perl5Matcher(); protected final Perl5Matcher matcher = new Perl5Matcher();
// CheckStyle:VisibilityModifier ON


/** /**
* Constructor for JakartaOroMatcher. * Constructor for JakartaOroMatcher.


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

@@ -86,14 +86,16 @@ public class RegexpFactory extends RegexpMatcherFactory {
cause = orCause(cause, be, true); 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 * Wrapper over RegexpMatcherFactory.createInstance that ensures that
* we are dealing with a Regexp implementation. * we are dealing with a Regexp implementation.
*
* @return the instance.
* @throws BuildException if there is a problem.
* @since 1.3 * @since 1.3
* *
* @see RegexpMatcherFactory#createInstance(String) * @see RegexpMatcherFactory#createInstance(String)


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

@@ -94,8 +94,9 @@ public class RegexpMatcherFactory {
cause = orCause(cause, be, true); 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) { static Throwable orCause(Throwable deflt, BuildException be, boolean ignoreCnfe) {


Loading…
Cancel
Save