Browse Source

checkstyle

git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@471562 13f79535-47bb-0310-9956-ffa450edef68
master
Peter Reilly 18 years ago
parent
commit
f0e86c70ce
39 changed files with 125 additions and 37 deletions
  1. +5
    -0
      src/main/org/apache/tools/ant/DefaultLogger.java
  2. +4
    -0
      src/main/org/apache/tools/ant/DirectoryScanner.java
  3. +2
    -0
      src/main/org/apache/tools/ant/NoBannerLogger.java
  4. +2
    -0
      src/main/org/apache/tools/ant/ProjectComponent.java
  5. +3
    -0
      src/main/org/apache/tools/ant/Task.java
  6. +3
    -0
      src/main/org/apache/tools/ant/filters/util/ChainReaderHelper.java
  7. +6
    -1
      src/main/org/apache/tools/ant/taskdefs/AbstractJarSignerTask.java
  8. +1
    -0
      src/main/org/apache/tools/ant/taskdefs/Available.java
  9. +2
    -0
      src/main/org/apache/tools/ant/taskdefs/Copy.java
  10. +21
    -16
      src/main/org/apache/tools/ant/taskdefs/CopyPath.java
  11. +1
    -0
      src/main/org/apache/tools/ant/taskdefs/DefBase.java
  12. +2
    -0
      src/main/org/apache/tools/ant/taskdefs/Delete.java
  13. +5
    -0
      src/main/org/apache/tools/ant/taskdefs/DiagnosticsTask.java
  14. +2
    -0
      src/main/org/apache/tools/ant/taskdefs/Echo.java
  15. +1
    -1
      src/main/org/apache/tools/ant/taskdefs/EchoXML.java
  16. +2
    -0
      src/main/org/apache/tools/ant/taskdefs/Exec.java
  17. +2
    -0
      src/main/org/apache/tools/ant/taskdefs/ExecTask.java
  18. +3
    -2
      src/main/org/apache/tools/ant/taskdefs/Execute.java
  19. +7
    -1
      src/main/org/apache/tools/ant/taskdefs/ExecuteOn.java
  20. +6
    -2
      src/main/org/apache/tools/ant/taskdefs/FixCRLF.java
  21. +3
    -0
      src/main/org/apache/tools/ant/taskdefs/GenerateKey.java
  22. +1
    -1
      src/main/org/apache/tools/ant/taskdefs/Jar.java
  23. +2
    -0
      src/main/org/apache/tools/ant/taskdefs/Java.java
  24. +4
    -1
      src/main/org/apache/tools/ant/taskdefs/Javac.java
  25. +2
    -0
      src/main/org/apache/tools/ant/taskdefs/Jikes.java
  26. +2
    -0
      src/main/org/apache/tools/ant/taskdefs/JikesOutputParser.java
  27. +2
    -0
      src/main/org/apache/tools/ant/taskdefs/MatchingTask.java
  28. +2
    -0
      src/main/org/apache/tools/ant/taskdefs/Pack.java
  29. +2
    -0
      src/main/org/apache/tools/ant/taskdefs/Property.java
  30. +1
    -0
      src/main/org/apache/tools/ant/taskdefs/Recorder.java
  31. +11
    -0
      src/main/org/apache/tools/ant/taskdefs/RecorderEntry.java
  32. +1
    -1
      src/main/org/apache/tools/ant/taskdefs/SQLExec.java
  33. +2
    -1
      src/main/org/apache/tools/ant/taskdefs/XSLTProcess.java
  34. +1
    -1
      src/main/org/apache/tools/ant/taskdefs/cvslib/ChangeLogParser.java
  35. +3
    -3
      src/main/org/apache/tools/ant/taskdefs/cvslib/ChangeLogTask.java
  36. +2
    -2
      src/main/org/apache/tools/ant/taskdefs/rmic/DefaultRmicAdapter.java
  37. +1
    -1
      src/main/org/apache/tools/ant/taskdefs/rmic/KaffeRmic.java
  38. +1
    -1
      src/main/org/apache/tools/ant/taskdefs/rmic/RmicAdapterFactory.java
  39. +2
    -2
      src/main/org/apache/tools/ant/taskdefs/rmic/XNewRmic.java

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

@@ -39,6 +39,7 @@ public class DefaultLogger implements BuildLogger {
*/ */
public static final int LEFT_COLUMN_SIZE = 12; public static final int LEFT_COLUMN_SIZE = 12;


// CheckStyle:VisibilityModifier OFF - bc
/** PrintStream to write non-error messages to */ /** PrintStream to write non-error messages to */
protected PrintStream out; protected PrintStream out;


@@ -51,11 +52,15 @@ public class DefaultLogger implements BuildLogger {
/** Time of the start of the build */ /** Time of the start of the build */
private long startTime = System.currentTimeMillis(); private long startTime = System.currentTimeMillis();


// CheckStyle:ConstantNameCheck OFF - bc
/** Line separator */ /** Line separator */
protected static final String lSep = StringUtils.LINE_SEP; protected static final String lSep = StringUtils.LINE_SEP;
// CheckStyle:ConstantNameCheck ON


/** Whether or not to use emacs-style output */ /** Whether or not to use emacs-style output */
protected boolean emacsMode = false; protected boolean emacsMode = false;
// CheckStyle:VisibilityModifier ON



/** /**
* Sole constructor. * Sole constructor.


+ 4
- 0
src/main/org/apache/tools/ant/DirectoryScanner.java View File

@@ -186,6 +186,8 @@ public class DirectoryScanner
resetDefaultExcludes(); resetDefaultExcludes();
} }


// CheckStyle:VisibilityModifier OFF - bc

/** The base directory to be scanned. */ /** The base directory to be scanned. */
protected File basedir; protected File basedir;


@@ -259,6 +261,8 @@ public class DirectoryScanner
/** Whether or not everything tested so far has been included. */ /** Whether or not everything tested so far has been included. */
protected boolean everythingIncluded = true; protected boolean everythingIncluded = true;


// CheckStyle:VisibilityModifier ON

/** /**
* Temporary table to speed up the various scanning methods. * Temporary table to speed up the various scanning methods.
* *


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

@@ -26,6 +26,7 @@ import org.apache.tools.ant.util.StringUtils;
*/ */
public class NoBannerLogger extends DefaultLogger { public class NoBannerLogger extends DefaultLogger {


// CheckStyle:VisibilityModifier OFF - bc
/** /**
* Name of the current target, if it should * Name of the current target, if it should
* be displayed on the next message. This is * be displayed on the next message. This is
@@ -34,6 +35,7 @@ public class NoBannerLogger extends DefaultLogger {
* the target is logged. * the target is logged.
*/ */
protected String targetName; protected String targetName;
// CheckStyle:VisibilityModifier ON


/** Sole constructor. */ /** Sole constructor. */
public NoBannerLogger() { public NoBannerLogger() {


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

@@ -26,6 +26,7 @@ package org.apache.tools.ant;
*/ */
public abstract class ProjectComponent implements Cloneable { public abstract class ProjectComponent implements Cloneable {


// CheckStyle:VisibilityModifier OFF - bc
/** /**
* Project object of this component. * Project object of this component.
* @deprecated since 1.6.x. * @deprecated since 1.6.x.
@@ -42,6 +43,7 @@ public abstract class ProjectComponent implements Cloneable {
* Please use the {@link #getLocation()} method. * Please use the {@link #getLocation()} method.
*/ */
protected Location location = Location.UNKNOWN_LOCATION; protected Location location = Location.UNKNOWN_LOCATION;
// CheckStyle:VisibilityModifier ON


/** Sole constructor. */ /** Sole constructor. */
public ProjectComponent() { public ProjectComponent() {


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

@@ -32,6 +32,7 @@ import java.io.IOException;
* @see Project#createTask * @see Project#createTask
*/ */
public abstract class Task extends ProjectComponent { public abstract class Task extends ProjectComponent {
// CheckStyle:VisibilityModifier OFF - bc
/** /**
* Target this task belongs to, if any. * Target this task belongs to, if any.
* @deprecated since 1.6.x. * @deprecated since 1.6.x.
@@ -78,6 +79,8 @@ public abstract class Task extends ProjectComponent {
*/ */
protected RuntimeConfigurable wrapper; protected RuntimeConfigurable wrapper;


// CheckStyle:VisibilityModifier ON

/** /**
* Whether or not this task is invalid. A task becomes invalid * Whether or not this task is invalid. A task becomes invalid
* if a conflicting class is specified as the implementation for * if a conflicting class is specified as the implementation for


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

@@ -43,6 +43,7 @@ public final class ChainReaderHelper {


// default buffer size // default buffer size
private static final int DEFAULT_BUFFER_SIZE = 8192; private static final int DEFAULT_BUFFER_SIZE = 8192;
// CheckStyle:VisibilityModifier OFF - bc
/** /**
* The primary reader to which the reader chain is to be attached. * The primary reader to which the reader chain is to be attached.
*/ */
@@ -61,6 +62,8 @@ public final class ChainReaderHelper {
/** The Ant project */ /** The Ant project */
private Project project = null; private Project project = null;


// CheckStyle:VisibilityModifier ON

/** /**
* Sets the primary reader * Sets the primary reader
* @param rdr the reader object * @param rdr the reader object


+ 6
- 1
src/main/org/apache/tools/ant/taskdefs/AbstractJarSignerTask.java View File

@@ -22,6 +22,7 @@ import java.io.File;
import java.util.Enumeration; import java.util.Enumeration;
import java.util.Vector; import java.util.Vector;


import org.apache.tools.ant.BuildException;
import org.apache.tools.ant.Task; import org.apache.tools.ant.Task;
import org.apache.tools.ant.types.Environment; import org.apache.tools.ant.types.Environment;
import org.apache.tools.ant.types.FileSet; import org.apache.tools.ant.types.FileSet;
@@ -35,6 +36,7 @@ import org.apache.tools.ant.util.JavaEnvUtils;
*/ */


public abstract class AbstractJarSignerTask extends Task { public abstract class AbstractJarSignerTask extends Task {
// CheckStyle:VisibilityModifier OFF - bc
/** /**
* The name of the jar file. * The name of the jar file.
*/ */
@@ -75,6 +77,9 @@ public abstract class AbstractJarSignerTask extends Task {
* name of JDK program we are looking for * name of JDK program we are looking for
*/ */
protected static final String JARSIGNER_COMMAND = "jarsigner"; protected static final String JARSIGNER_COMMAND = "jarsigner";

// CheckStyle:VisibilityModifier ON

/** /**
* redirector used to talk to the jarsigner program * redirector used to talk to the jarsigner program
*/ */
@@ -274,7 +279,7 @@ public abstract class AbstractJarSignerTask extends Task {
* @throws BuildException if the property is not correctly defined. * @throws BuildException if the property is not correctly defined.
*/ */
protected void declareSysProperty( protected void declareSysProperty(
ExecTask cmd, Environment.Variable property) {
ExecTask cmd, Environment.Variable property) throws BuildException {
addValue(cmd, "-J-D" + property.getContent()); addValue(cmd, "-J-D" + property.getContent());
} }




+ 1
- 0
src/main/org/apache/tools/ant/taskdefs/Available.java View File

@@ -475,6 +475,7 @@ public class Available extends Task implements Condition {
/** /**
* @see EnumeratedAttribute#getValues * @see EnumeratedAttribute#getValues
*/ */
/** {@inheritDoc}. */
public String[] getValues() { public String[] getValues() {
return VALUES; return VALUES;
} }


+ 2
- 0
src/main/org/apache/tools/ant/taskdefs/Copy.java View File

@@ -67,6 +67,7 @@ import org.apache.tools.ant.util.FlatFileNameMapper;
public class Copy extends Task { public class Copy extends Task {
static final File NULL_FILE_PLACEHOLDER = new File("/NULL_FILE"); static final File NULL_FILE_PLACEHOLDER = new File("/NULL_FILE");
static final String LINE_SEPARATOR = System.getProperty("line.separator"); static final String LINE_SEPARATOR = System.getProperty("line.separator");
// CheckStyle:VisibilityModifier OFF - bc
protected File file = null; // the source file protected File file = null; // the source file
protected File destFile = null; // the destination file protected File destFile = null; // the destination file
protected File destDir = null; // the destination directory protected File destDir = null; // the destination directory
@@ -92,6 +93,7 @@ public class Copy extends Task {
private String inputEncoding = null; private String inputEncoding = null;
private String outputEncoding = null; private String outputEncoding = null;
private long granularity = 0; private long granularity = 0;
// CheckStyle:VisibilityModifier ON


/** /**
* Copy task constructor. * Copy task constructor.


+ 21
- 16
src/main/org/apache/tools/ant/taskdefs/CopyPath.java View File

@@ -39,30 +39,35 @@ import java.io.IOException;


public class CopyPath extends Task { public class CopyPath extends Task {


private FileNameMapper mapper;
private Path path;
// Error messages
/** No destdir attribute */
public static final String ERROR_NO_DESTDIR = "No destDir specified";


private File destDir;
/** No path */
public static final String ERROR_NO_PATH = "No path specified";


protected FileUtils fileUtils;
/** No mapper */
public static final String ERROR_NO_MAPPER = "No mapper specified";


// TODO not read, yet in a public setter
private long granularity = 0;
// fileutils
private static final FileUtils FILE_UTILS = FileUtils.getFileUtils();


protected boolean preserveLastModified = false;
// --- Fields --
private FileNameMapper mapper;


public CopyPath() {
fileUtils = FileUtils.getFileUtils();
granularity = fileUtils.getFileTimestampGranularity();
}
private Path path;


public static final String ERROR_NO_DESTDIR = "No destDir specified";
private File destDir;


public static final String ERROR_NO_PATH = "No path specified";
// TODO not read, yet in a public setter
private long granularity = FILE_UTILS.getFileTimestampGranularity();


public static final String ERROR_NO_MAPPER = "No mapper specified";
private boolean preserveLastModified = false;


/**
* The dest dir attribute.
* @param destDir the value of the destdir attribute.
*/
public void setDestDir(File destDir) { public void setDestDir(File destDir) {
this.destDir = destDir; this.destDir = destDir;
} }
@@ -173,7 +178,7 @@ public class CopyPath extends Task {
try { try {
log("Copying " + sourceFile + " to " + destFile, Project.MSG_VERBOSE); log("Copying " + sourceFile + " to " + destFile, Project.MSG_VERBOSE);


fileUtils.copyFile(sourceFile, destFile, null, null, false,
FILE_UTILS.copyFile(sourceFile, destFile, null, null, false,
preserveLastModified, null, null, getProject()); preserveLastModified, null, null, getProject());
} catch (IOException ioe) { } catch (IOException ioe) {
String msg = "Failed to copy " + sourceFile + " to " + destFile + " due to " String msg = "Failed to copy " + sourceFile + " to " + destFile + " due to "


+ 1
- 0
src/main/org/apache/tools/ant/taskdefs/DefBase.java View File

@@ -142,6 +142,7 @@ public abstract class DefBase extends AntlibDefinition {


/** /**
* @see org.apache.tools.ant.Task#init() * @see org.apache.tools.ant.Task#init()
* @throws BuildException on error.
* @since Ant 1.6 * @since Ant 1.6
*/ */
public void init() throws BuildException { public void init() throws BuildException {


+ 2
- 0
src/main/org/apache/tools/ant/taskdefs/Delete.java View File

@@ -97,6 +97,7 @@ public class Delete extends MatchingTask {
public int size() { return dirs.length; } public int size() { return dirs.length; }
} }


// CheckStyle:VisibilityModifier OFF - bc
protected File file = null; protected File file = null;
protected File dir = null; protected File dir = null;
protected Vector filesets = new Vector(); protected Vector filesets = new Vector();
@@ -109,6 +110,7 @@ public class Delete extends MatchingTask {
private boolean failonerror = true; private boolean failonerror = true;
private boolean deleteOnExit = false; private boolean deleteOnExit = false;
private Resources rcs = null; private Resources rcs = null;
// CheckStyle:VisibilityModifier ON


/** /**
* Set the name of a single file to be removed. * Set the name of a single file to be removed.


+ 5
- 0
src/main/org/apache/tools/ant/taskdefs/DiagnosticsTask.java View File

@@ -30,6 +30,11 @@ public class DiagnosticsTask extends Task {


private static final String[] ARGS = new String[0]; private static final String[] ARGS = new String[0];


/**
* Execute the task.
* This delgates to the Diagnositics class.
* @throws BuildException on error.
*/
public void execute() throws BuildException { public void execute() throws BuildException {
Diagnostics.main(ARGS); Diagnostics.main(ARGS);
} }


+ 2
- 0
src/main/org/apache/tools/ant/taskdefs/Echo.java View File

@@ -40,6 +40,7 @@ import org.apache.tools.ant.types.LogLevel;
* @ant.task category="utility" * @ant.task category="utility"
*/ */
public class Echo extends Task { public class Echo extends Task {
// CheckStyle:VisibilityModifier OFF - bc
protected String message = ""; protected String message = "";
protected File file = null; protected File file = null;
protected boolean append = false; protected boolean append = false;
@@ -48,6 +49,7 @@ public class Echo extends Task {


// by default, messages are always displayed // by default, messages are always displayed
protected int logLevel = Project.MSG_WARN; protected int logLevel = Project.MSG_WARN;
// CheckStyle:VisibilityModifier ON


/** /**
* Does the work. * Does the work.


+ 1
- 1
src/main/org/apache/tools/ant/taskdefs/EchoXML.java View File

@@ -46,7 +46,7 @@ public class EchoXML extends XMLFragment {


private File file; private File file;
private boolean append; private boolean append;
public static final String ERROR_NO_XML = "No nested XML specified";
private static final String ERROR_NO_XML = "No nested XML specified";


/** /**
* Set the output file. * Set the output file.


+ 2
- 0
src/main/org/apache/tools/ant/taskdefs/Exec.java View File

@@ -48,7 +48,9 @@ public class Exec extends Task {
private String out; private String out;
private File dir; private File dir;
private String command; private String command;
// CheckStyle:VisibilityModifier OFF - bc
protected PrintWriter fos = null; protected PrintWriter fos = null;
// CheckStyle:VisibilityModifier ON
private boolean failOnError = false; private boolean failOnError = false;


/** /**


+ 2
- 0
src/main/org/apache/tools/ant/taskdefs/ExecTask.java View File

@@ -43,6 +43,7 @@ import org.apache.tools.ant.util.FileUtils;
*/ */
public class ExecTask extends Task { public class ExecTask extends Task {


// CheckStyle:VisibilityModifier OFF - bc
private static final FileUtils FILE_UTILS = FileUtils.getFileUtils(); private static final FileUtils FILE_UTILS = FileUtils.getFileUtils();


private String os; private String os;
@@ -70,6 +71,7 @@ public class ExecTask extends Task {


protected Redirector redirector = new Redirector(this); protected Redirector redirector = new Redirector(this);
protected RedirectorElement redirectorElement; protected RedirectorElement redirectorElement;
// CheckStyle:VisibilityModifier ON


/** /**
* Controls whether the VM (1.3 and above) is used to execute the * Controls whether the VM (1.3 and above) is used to execute the


+ 3
- 2
src/main/org/apache/tools/ant/taskdefs/Execute.java View File

@@ -595,7 +595,7 @@ public class Execute {


/** /**
* Did this execute return in a failure. * Did this execute return in a failure.
* @see #isFailure(int)
* @see #isFailure(int)
* @return true if and only if the exit code is interpreted as a failure * @return true if and only if the exit code is interpreted as a failure
* @since Ant1.7 * @since Ant1.7
*/ */
@@ -1215,7 +1215,8 @@ public class Execute {
} }
FileUtils.delete(f); FileUtils.delete(f);
} }
}.start();
}
.start();
} }
} }
} }

+ 7
- 1
src/main/org/apache/tools/ant/taskdefs/ExecuteOn.java View File

@@ -49,6 +49,8 @@ import org.apache.tools.ant.util.SourceFileScanner;
*/ */
public class ExecuteOn extends ExecTask { public class ExecuteOn extends ExecTask {


// CheckStyle:VisibilityModifier OFF - bc

// filesets has been protected so we need to keep that even after // filesets has been protected so we need to keep that even after
// switching to resource collections. In fact, they will still // switching to resource collections. In fact, they will still
// get a different treatment form the other resource collections // get a different treatment form the other resource collections
@@ -80,6 +82,7 @@ public class ExecuteOn extends ExecTask {
*/ */
protected boolean srcIsFirst = true; protected boolean srcIsFirst = true;


// CheckStyle:VisibilityModifier ON
/** /**
* Add a set of files upon which to operate. * Add a set of files upon which to operate.
* @param set the FileSet to add. * @param set the FileSet to add.
@@ -724,12 +727,15 @@ public class ExecuteOn extends ExecTask {
* for the type attribute. * for the type attribute.
*/ */
public static class FileDirBoth extends EnumeratedAttribute { public static class FileDirBoth extends EnumeratedAttribute {
/** File value */
public static final String FILE = "file"; public static final String FILE = "file";
/** Dir value */
public static final String DIR = "dir"; public static final String DIR = "dir";
/** /**
* @see EnumeratedAttribute#getValues * @see EnumeratedAttribute#getValues
*/ */
public String[] getValues() {
/** {@inheritDoc}. */
public String[] getValues() {
return new String[] {FILE, DIR, "both"}; return new String[] {FILE, DIR, "both"};
} }
} }


+ 6
- 2
src/main/org/apache/tools/ant/taskdefs/FixCRLF.java View File

@@ -83,7 +83,7 @@ import org.apache.tools.ant.util.FileUtils;


public class FixCRLF extends MatchingTask implements ChainableReader { public class FixCRLF extends MatchingTask implements ChainableReader {


public static final String ERROR_FILE_AND_SRCDIR
private static final String ERROR_FILE_AND_SRCDIR
= "srcdir and file are mutually exclusive"; = "srcdir and file are mutually exclusive";


private static final FileUtils FILE_UTILS = FileUtils.getFileUtils(); private static final FileUtils FILE_UTILS = FileUtils.getFileUtils();
@@ -211,7 +211,8 @@ public class FixCRLF extends MatchingTask implements ChainableReader {
/** /**
* Specify tab length in characters. * Specify tab length in characters.
* *
* @param tlength specify the length of tab in spaces,
* @param tlength specify the length of tab in spaces.
* @throws BuildException on error.
*/ */
public void setTablength(int tlength) throws BuildException { public void setTablength(int tlength) throws BuildException {
try { try {
@@ -273,6 +274,7 @@ public class FixCRLF extends MatchingTask implements ChainableReader {


/** /**
* Executes the task. * Executes the task.
* @throws BuildException on error.
*/ */
public void execute() throws BuildException { public void execute() throws BuildException {
// first off, make sure that we've got a srcdir and destdir // first off, make sure that we've got a srcdir and destdir
@@ -614,6 +616,7 @@ public class FixCRLF extends MatchingTask implements ChainableReader {
* Enumerated attribute with the values "asis", "add" and "remove". * Enumerated attribute with the values "asis", "add" and "remove".
*/ */
public static class AddAsisRemove extends EnumeratedAttribute { public static class AddAsisRemove extends EnumeratedAttribute {
/** {@inheritDoc}. */
public String[] getValues() { public String[] getValues() {
return new String[] {"add", "asis", "remove"}; return new String[] {"add", "asis", "remove"};
} }
@@ -626,6 +629,7 @@ public class FixCRLF extends MatchingTask implements ChainableReader {
/** /**
* @see EnumeratedAttribute#getValues * @see EnumeratedAttribute#getValues
*/ */
/** {@inheritDoc}. */
public String[] getValues() { public String[] getValues() {
return new String[] {"asis", "cr", "lf", "crlf", return new String[] {"asis", "cr", "lf", "crlf",
"mac", "unix", "dos"}; "mac", "unix", "dos"};


+ 3
- 0
src/main/org/apache/tools/ant/taskdefs/GenerateKey.java View File

@@ -157,6 +157,8 @@ public class GenerateKey extends Task {
} }
} }


// CheckStyle:VisibilityModifier OFF - bc

/** /**
* The alias of signer. * The alias of signer.
*/ */
@@ -177,6 +179,7 @@ public class GenerateKey extends Task {
protected int keysize; protected int keysize;
protected int validity; protected int validity;
protected boolean verbose; protected boolean verbose;
// CheckStyle:VisibilityModifier ON


/** /**
* Distinguished name list. * Distinguished name list.


+ 1
- 1
src/main/org/apache/tools/ant/taskdefs/Jar.java View File

@@ -391,7 +391,7 @@ public class Jar extends Zip {
Service service; Service service;


serviceIterator = serviceList.iterator(); serviceIterator = serviceList.iterator();
while(serviceIterator.hasNext()) {
while (serviceIterator.hasNext()) {
service = (Service) serviceIterator.next(); service = (Service) serviceIterator.next();
//stolen from writeManifest //stolen from writeManifest
super.zipFile(service.getAsStream(), zOut, super.zipFile(service.getAsStream(), zOut,


+ 2
- 0
src/main/org/apache/tools/ant/taskdefs/Java.java View File

@@ -65,8 +65,10 @@ public class Java extends Task {
private File output; private File output;
private File error; private File error;


// CheckStyle:VisibilityModifier OFF - bc
protected Redirector redirector = new Redirector(this); protected Redirector redirector = new Redirector(this);
protected RedirectorElement redirectorElement; protected RedirectorElement redirectorElement;
// CheckStyle:VisibilityModifier ON


private String resultProperty; private String resultProperty;
private Permissions perm = null; private Permissions perm = null;


+ 4
- 1
src/main/org/apache/tools/ant/taskdefs/Javac.java View File

@@ -104,9 +104,11 @@ public class Javac extends MatchingTask {
private String memoryMaximumSize; private String memoryMaximumSize;
private FacadeTaskHelper facade = null; private FacadeTaskHelper facade = null;


// CheckStyle:VisibilityModifier OFF - bc
protected boolean failOnError = true; protected boolean failOnError = true;
protected boolean listFiles = false; protected boolean listFiles = false;
protected File[] compileList = new File[0]; protected File[] compileList = new File[0];
// CheckStyle:VisibilityModifier ON


private String source; private String source;
private String debugLevel; private String debugLevel;
@@ -905,7 +907,7 @@ public class Javac extends MatchingTask {
* attribute looks like.</p> * attribute looks like.</p>
* *
* @see #getCompilerVersion * @see #getCompilerVersion
*
* @return the compiler.
* @since Ant 1.5 * @since Ant 1.5
*/ */
public String getCompiler() { public String getCompiler() {
@@ -931,6 +933,7 @@ public class Javac extends MatchingTask {
* account.</p> * account.</p>
* *
* @see #getCompiler * @see #getCompiler
* @return the compiler.
* *
* @since Ant 1.5 * @since Ant 1.5
*/ */


+ 2
- 0
src/main/org/apache/tools/ant/taskdefs/Jikes.java View File

@@ -40,9 +40,11 @@ import org.apache.tools.ant.util.FileUtils;
*/ */
public class Jikes { public class Jikes {


// CheckStyle:VisibilityModifier OFF - bc
protected JikesOutputParser jop; protected JikesOutputParser jop;
protected String command; protected String command;
protected Project project; protected Project project;
// CheckStyle:VisibilityModifier ON


/** /**
* Constructs a new Jikes object. * Constructs a new Jikes object.


+ 2
- 0
src/main/org/apache/tools/ant/taskdefs/JikesOutputParser.java View File

@@ -38,6 +38,7 @@ import org.apache.tools.ant.Task;
* Use Jikes' exit value to detect compilation failure. * Use Jikes' exit value to detect compilation failure.
*/ */
public class JikesOutputParser implements ExecuteStreamHandler { public class JikesOutputParser implements ExecuteStreamHandler {
// CheckStyle:VisibilityModifier OFF - bc
protected Task task; protected Task task;
protected boolean errorFlag = false; // no errors so far protected boolean errorFlag = false; // no errors so far
protected int errors; protected int errors;
@@ -46,6 +47,7 @@ public class JikesOutputParser implements ExecuteStreamHandler {
protected boolean emacsMode; protected boolean emacsMode;


protected BufferedReader br; protected BufferedReader br;
// CheckStyle:VisibilityModifier ON


/** /**
* Ignore. * Ignore.


+ 2
- 0
src/main/org/apache/tools/ant/taskdefs/MatchingTask.java View File

@@ -56,7 +56,9 @@ import org.apache.tools.ant.types.selectors.modifiedselector.ModifiedSelector;


public abstract class MatchingTask extends Task implements SelectorContainer { public abstract class MatchingTask extends Task implements SelectorContainer {


// CheckStyle:VisibilityModifier OFF - bc
protected FileSet fileset = new FileSet(); protected FileSet fileset = new FileSet();
// CheckStyle:VisibilityModifier ON


/** {@inheritDoc}. */ /** {@inheritDoc}. */
public void setProject(Project project) { public void setProject(Project project) {


+ 2
- 0
src/main/org/apache/tools/ant/taskdefs/Pack.java View File

@@ -36,8 +36,10 @@ import org.apache.tools.ant.types.resources.FileResource;


public abstract class Pack extends Task { public abstract class Pack extends Task {


// CheckStyle:VisibilityModifier OFF - bc
protected File zipFile; protected File zipFile;
protected File source; protected File source;
// CheckStyle:VisibilityModifier ON
private Resource src; private Resource src;


/** /**


+ 2
- 0
src/main/org/apache/tools/ant/taskdefs/Property.java View File

@@ -70,6 +70,7 @@ import org.apache.tools.ant.types.Reference;
*/ */
public class Property extends Task { public class Property extends Task {


// CheckStyle:VisibilityModifier OFF - bc
protected String name; protected String name;
protected String value; protected String value;
protected File file; protected File file;
@@ -82,6 +83,7 @@ public class Property extends Task {
private Project fallback; private Project fallback;


protected boolean userProperty; // set read-only properties protected boolean userProperty; // set read-only properties
// CheckStyle:VisibilityModifier ON


/** /**
* Constructor for Property. * Constructor for Property.


+ 1
- 0
src/main/org/apache/tools/ant/taskdefs/Recorder.java View File

@@ -178,6 +178,7 @@ public class Recorder extends Task implements SubBuildListener {
/** /**
* @see EnumeratedAttribute#getValues() * @see EnumeratedAttribute#getValues()
*/ */
/** {@inheritDoc}. */
public String[] getValues() { public String[] getValues() {
return VALUES; return VALUES;
} }


+ 11
- 0
src/main/org/apache/tools/ant/taskdefs/RecorderEntry.java View File

@@ -90,6 +90,7 @@ public class RecorderEntry implements BuildLogger, SubBuildListener {
/** /**
* @see org.apache.tools.ant.BuildListener#buildStarted(BuildEvent) * @see org.apache.tools.ant.BuildListener#buildStarted(BuildEvent)
*/ */
/** {@inheritDoc}. */
public void buildStarted(BuildEvent event) { public void buildStarted(BuildEvent event) {
log("> BUILD STARTED", Project.MSG_DEBUG); log("> BUILD STARTED", Project.MSG_DEBUG);
} }
@@ -97,6 +98,7 @@ public class RecorderEntry implements BuildLogger, SubBuildListener {
/** /**
* @see org.apache.tools.ant.BuildListener#buildFinished(BuildEvent) * @see org.apache.tools.ant.BuildListener#buildFinished(BuildEvent)
*/ */
/** {@inheritDoc}. */
public void buildFinished(BuildEvent event) { public void buildFinished(BuildEvent event) {
log("< BUILD FINISHED", Project.MSG_DEBUG); log("< BUILD FINISHED", Project.MSG_DEBUG);


@@ -142,6 +144,7 @@ public class RecorderEntry implements BuildLogger, SubBuildListener {
/** /**
* @see org.apache.tools.ant.BuildListener#targetStarted(BuildEvent) * @see org.apache.tools.ant.BuildListener#targetStarted(BuildEvent)
*/ */
/** {@inheritDoc}. */
public void targetStarted(BuildEvent event) { public void targetStarted(BuildEvent event) {
log(">> TARGET STARTED -- " + event.getTarget(), Project.MSG_DEBUG); log(">> TARGET STARTED -- " + event.getTarget(), Project.MSG_DEBUG);
log(StringUtils.LINE_SEP + event.getTarget().getName() + ":", log(StringUtils.LINE_SEP + event.getTarget().getName() + ":",
@@ -152,6 +155,7 @@ public class RecorderEntry implements BuildLogger, SubBuildListener {
/** /**
* @see org.apache.tools.ant.BuildListener#targetFinished(BuildEvent) * @see org.apache.tools.ant.BuildListener#targetFinished(BuildEvent)
*/ */
/** {@inheritDoc}. */
public void targetFinished(BuildEvent event) { public void targetFinished(BuildEvent event) {
log("<< TARGET FINISHED -- " + event.getTarget(), Project.MSG_DEBUG); log("<< TARGET FINISHED -- " + event.getTarget(), Project.MSG_DEBUG);


@@ -164,6 +168,7 @@ public class RecorderEntry implements BuildLogger, SubBuildListener {
/** /**
* @see org.apache.tools.ant.BuildListener#taskStarted(BuildEvent) * @see org.apache.tools.ant.BuildListener#taskStarted(BuildEvent)
*/ */
/** {@inheritDoc}. */
public void taskStarted(BuildEvent event) { public void taskStarted(BuildEvent event) {
log(">>> TASK STARTED -- " + event.getTask(), Project.MSG_DEBUG); log(">>> TASK STARTED -- " + event.getTask(), Project.MSG_DEBUG);
} }
@@ -171,6 +176,7 @@ public class RecorderEntry implements BuildLogger, SubBuildListener {
/** /**
* @see org.apache.tools.ant.BuildListener#taskFinished(BuildEvent) * @see org.apache.tools.ant.BuildListener#taskFinished(BuildEvent)
*/ */
/** {@inheritDoc}. */
public void taskFinished(BuildEvent event) { public void taskFinished(BuildEvent event) {
log("<<< TASK FINISHED -- " + event.getTask(), Project.MSG_DEBUG); log("<<< TASK FINISHED -- " + event.getTask(), Project.MSG_DEBUG);
flush(); flush();
@@ -179,6 +185,7 @@ public class RecorderEntry implements BuildLogger, SubBuildListener {
/** /**
* @see org.apache.tools.ant.BuildListener#messageLogged(BuildEvent) * @see org.apache.tools.ant.BuildListener#messageLogged(BuildEvent)
*/ */
/** {@inheritDoc}. */
public void messageLogged(BuildEvent event) { public void messageLogged(BuildEvent event) {
log("--- MESSAGE LOGGED", Project.MSG_DEBUG); log("--- MESSAGE LOGGED", Project.MSG_DEBUG);


@@ -224,6 +231,7 @@ public class RecorderEntry implements BuildLogger, SubBuildListener {
/** /**
* @see BuildLogger#setMessageOutputLevel(int) * @see BuildLogger#setMessageOutputLevel(int)
*/ */
/** {@inheritDoc}. */
public void setMessageOutputLevel(int level) { public void setMessageOutputLevel(int level) {
if (level >= Project.MSG_ERR && level <= Project.MSG_DEBUG) { if (level >= Project.MSG_ERR && level <= Project.MSG_DEBUG) {
loglevel = level; loglevel = level;
@@ -233,6 +241,7 @@ public class RecorderEntry implements BuildLogger, SubBuildListener {
/** /**
* @see BuildLogger#setOutputPrintStream(PrintStream) * @see BuildLogger#setOutputPrintStream(PrintStream)
*/ */
/** {@inheritDoc}. */
public void setOutputPrintStream(PrintStream output) { public void setOutputPrintStream(PrintStream output) {
closeFile(); closeFile();
out = output; out = output;
@@ -242,6 +251,7 @@ public class RecorderEntry implements BuildLogger, SubBuildListener {
/** /**
* @see BuildLogger#setEmacsMode(boolean) * @see BuildLogger#setEmacsMode(boolean)
*/ */
/** {@inheritDoc}. */
public void setEmacsMode(boolean emacsMode) { public void setEmacsMode(boolean emacsMode) {
this.emacsMode = emacsMode; this.emacsMode = emacsMode;
} }
@@ -250,6 +260,7 @@ public class RecorderEntry implements BuildLogger, SubBuildListener {
/** /**
* @see BuildLogger#setErrorPrintStream(PrintStream) * @see BuildLogger#setErrorPrintStream(PrintStream)
*/ */
/** {@inheritDoc}. */
public void setErrorPrintStream(PrintStream err) { public void setErrorPrintStream(PrintStream err) {
setOutputPrintStream(err); setOutputPrintStream(err);
} }


+ 1
- 1
src/main/org/apache/tools/ant/taskdefs/SQLExec.java View File

@@ -715,7 +715,7 @@ public class SQLExec extends JDBCTask {
public void setSrc(File src) { public void setSrc(File src) {
//there are places (in this file, and perhaps elsewhere, where it is assumed //there are places (in this file, and perhaps elsewhere, where it is assumed
//that null is an acceptable parameter. //that null is an acceptable parameter.
if (src!=null) {
if (src != null) {
setSrcResource(new FileResource(src)); setSrcResource(new FileResource(src));
} }
} }


+ 2
- 1
src/main/org/apache/tools/ant/taskdefs/XSLTProcess.java View File

@@ -1060,7 +1060,8 @@ public class XSLTProcess extends MatchingTask implements XSLTLogger {
// Use '.' so a dir+"/"+name would not result in an absolute path // Use '.' so a dir+"/"+name would not result in an absolute path
liaison.addParam( liaison.addParam(
fileDirParameter, fileDirParameter,
(file.getParent()!=null) ? file.getParent().replace('\\','/') : "." );
(file.getParent() != null)
? file.getParent().replace('\\', '/') : ".");
} }
} }




+ 1
- 1
src/main/org/apache/tools/ant/taskdefs/cvslib/ChangeLogParser.java View File

@@ -75,7 +75,7 @@ class ChangeLogParser {
public CVSEntry[] getEntrySetAsArray() { public CVSEntry[] getEntrySetAsArray() {
final CVSEntry[] array = new CVSEntry[ entries.size() ]; final CVSEntry[] array = new CVSEntry[ entries.size() ];
int i = 0; int i = 0;
for(Enumeration e = entries.elements(); e.hasMoreElements();) {
for (Enumeration e = entries.elements(); e.hasMoreElements();) {
array[i++] = (CVSEntry) e.nextElement(); array[i++] = (CVSEntry) e.nextElement();
} }
return array; return array;


+ 3
- 3
src/main/org/apache/tools/ant/taskdefs/cvslib/ChangeLogTask.java View File

@@ -327,7 +327,7 @@ public class ChangeLogTask extends AbstractCvsTask {
for (int i = 0; i < entrySet.length; i++) { for (int i = 0; i < entrySet.length; i++) {
final CVSEntry cvsEntry = entrySet[i]; final CVSEntry cvsEntry = entrySet[i];
final Date date = cvsEntry.getDate(); final Date date = cvsEntry.getDate();
//bug#30471 //bug#30471
//this is caused by Date.after throwing a NullPointerException //this is caused by Date.after throwing a NullPointerException
//for some reason there's no date set in the CVSEntry //for some reason there's no date set in the CVSEntry
@@ -339,12 +339,12 @@ public class ChangeLogTask extends AbstractCvsTask {
//according to the docs it doesn't throw, according to the bug report it does //according to the docs it doesn't throw, according to the bug report it does
//http://java.sun.com/j2se/1.5.0/docs/api/java/util/Date.html#after(java.util.Date) //http://java.sun.com/j2se/1.5.0/docs/api/java/util/Date.html#after(java.util.Date)
//according to the docs it does throw //according to the docs it does throw
//for now skip entries which are missing a date //for now skip entries which are missing a date
if (null == date) { if (null == date) {
continue; continue;
} }
if (null != startDate && startDate.after(date)) { if (null != startDate && startDate.after(date)) {
//Skip dates that are too early //Skip dates that are too early
continue; continue;


+ 2
- 2
src/main/org/apache/tools/ant/taskdefs/rmic/DefaultRmicAdapter.java View File

@@ -209,12 +209,12 @@ public abstract class DefaultRmicAdapter implements RmicAdapter {
} }
//for java1.5+, we generate compatible stubs, that is, unless //for java1.5+, we generate compatible stubs, that is, unless
//the caller asked for IDL or IIOP support. //the caller asked for IDL or IIOP support.
if (stubOption == null &&
if (stubOption == null &&
!attributes.getIiop() && !attributes.getIiop() &&
!attributes.getIdl()) { !attributes.getIdl()) {
stubOption = STUB_COMPAT; stubOption = STUB_COMPAT;
} }
if(stubOption!=null) {
if (stubOption != null) {
//set the non-null stubOption //set the non-null stubOption
cmd.createArgument().setValue(stubOption); cmd.createArgument().setValue(stubOption);
} }


+ 1
- 1
src/main/org/apache/tools/ant/taskdefs/rmic/KaffeRmic.java View File

@@ -57,7 +57,7 @@ public class KaffeRmic extends DefaultRmicAdapter {
if (i != 0) { if (i != 0) {
buf.append(", "); buf.append(", ");
} }
buf.append(RMIC_CLASSNAMES[i]); buf.append(RMIC_CLASSNAMES[i]);
} }
buf.append(" have been found. A common solution is to set the" buf.append(" have been found. A common solution is to set the"


+ 1
- 1
src/main/org/apache/tools/ant/taskdefs/rmic/RmicAdapterFactory.java View File

@@ -68,7 +68,7 @@ public final class RmicAdapterFactory {
*/ */
public static RmicAdapter getRmic(String rmicType, Task task) public static RmicAdapter getRmic(String rmicType, Task task)
throws BuildException { throws BuildException {
//convert to lower case in the English locale,
//convert to lower case in the English locale,
String compiler = rmicType.toLowerCase(Locale.ENGLISH); String compiler = rmicType.toLowerCase(Locale.ENGLISH);


//handle default specially by choosing the sun or kaffe compiler //handle default specially by choosing the sun or kaffe compiler


+ 2
- 2
src/main/org/apache/tools/ant/taskdefs/rmic/XNewRmic.java View File

@@ -15,7 +15,7 @@ public class XNewRmic extends ForkingSunRmic {
* the name of this adapter for users to select * the name of this adapter for users to select
*/ */
public static final String COMPILER_NAME = "xnew"; public static final String COMPILER_NAME = "xnew";
public XNewRmic() { public XNewRmic() {
} }
@@ -24,7 +24,7 @@ public class XNewRmic extends ForkingSunRmic {
* @return a command line that hands off to thw * @return a command line that hands off to thw
*/ */
protected Commandline setupRmicCommand() { protected Commandline setupRmicCommand() {
String options[]=new String[] {
String options[] = new String[] {
"-Xnew" "-Xnew"
}; };
Commandline commandline = super.setupRmicCommand(options); Commandline commandline = super.setupRmicCommand(options);


Loading…
Cancel
Save