Browse Source

Reduce a small number of long lines

git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@272443 13f79535-47bb-0310-9956-ffa450edef68
master
Conor MacNeill 23 years ago
parent
commit
80080d456c
44 changed files with 210 additions and 130 deletions
  1. +9
    -6
      src/main/org/apache/tools/ant/ProjectHelper.java
  2. +2
    -1
      src/main/org/apache/tools/ant/listener/MailLogger.java
  3. +8
    -9
      src/main/org/apache/tools/ant/taskdefs/AbstractCvsTask.java
  4. +2
    -1
      src/main/org/apache/tools/ant/taskdefs/Ant.java
  5. +4
    -2
      src/main/org/apache/tools/ant/taskdefs/Available.java
  6. +8
    -7
      src/main/org/apache/tools/ant/taskdefs/Checksum.java
  7. +8
    -4
      src/main/org/apache/tools/ant/taskdefs/Chmod.java
  8. +4
    -2
      src/main/org/apache/tools/ant/taskdefs/ConditionTask.java
  9. +2
    -1
      src/main/org/apache/tools/ant/taskdefs/Copy.java
  10. +4
    -2
      src/main/org/apache/tools/ant/taskdefs/Cvs.java
  11. +4
    -2
      src/main/org/apache/tools/ant/taskdefs/Delete.java
  12. +11
    -10
      src/main/org/apache/tools/ant/taskdefs/DependSet.java
  13. +2
    -1
      src/main/org/apache/tools/ant/taskdefs/Echo.java
  14. +10
    -5
      src/main/org/apache/tools/ant/taskdefs/Exec.java
  15. +18
    -10
      src/main/org/apache/tools/ant/taskdefs/Execute.java
  16. +2
    -1
      src/main/org/apache/tools/ant/taskdefs/ExecuteJava.java
  17. +7
    -7
      src/main/org/apache/tools/ant/taskdefs/ExecuteOn.java
  18. +15
    -11
      src/main/org/apache/tools/ant/taskdefs/ExecuteWatchdog.java
  19. +2
    -1
      src/main/org/apache/tools/ant/taskdefs/Filter.java
  20. +6
    -4
      src/main/org/apache/tools/ant/taskdefs/Jar.java
  21. +2
    -1
      src/main/org/apache/tools/ant/taskdefs/Java.java
  22. +2
    -1
      src/main/org/apache/tools/ant/taskdefs/Javac.java
  23. +6
    -3
      src/main/org/apache/tools/ant/taskdefs/Javadoc.java
  24. +6
    -3
      src/main/org/apache/tools/ant/taskdefs/Jikes.java
  25. +4
    -2
      src/main/org/apache/tools/ant/taskdefs/JikesOutputParser.java
  26. +4
    -2
      src/main/org/apache/tools/ant/taskdefs/MatchingTask.java
  27. +2
    -1
      src/main/org/apache/tools/ant/taskdefs/Move.java
  28. +2
    -1
      src/main/org/apache/tools/ant/taskdefs/Replace.java
  29. +4
    -2
      src/main/org/apache/tools/ant/taskdefs/SignJar.java
  30. +2
    -2
      src/main/org/apache/tools/ant/taskdefs/Tar.java
  31. +2
    -1
      src/main/org/apache/tools/ant/taskdefs/Tstamp.java
  32. +4
    -2
      src/main/org/apache/tools/ant/taskdefs/UpToDate.java
  33. +2
    -2
      src/main/org/apache/tools/ant/taskdefs/Zip.java
  34. +2
    -1
      src/main/org/apache/tools/ant/taskdefs/compilers/CompilerAdapter.java
  35. +4
    -2
      src/main/org/apache/tools/ant/taskdefs/compilers/CompilerAdapterFactory.java
  36. +4
    -2
      src/main/org/apache/tools/ant/taskdefs/compilers/DefaultCompilerAdapter.java
  37. +2
    -1
      src/main/org/apache/tools/ant/taskdefs/compilers/Javac12.java
  38. +2
    -1
      src/main/org/apache/tools/ant/taskdefs/compilers/Javac13.java
  39. +2
    -1
      src/main/org/apache/tools/ant/taskdefs/compilers/Jikes.java
  40. +2
    -1
      src/main/org/apache/tools/ant/taskdefs/compilers/Jvc.java
  41. +4
    -2
      src/main/org/apache/tools/ant/taskdefs/cvslib/ChangeLogParser.java
  42. +14
    -7
      src/main/org/apache/tools/ant/taskdefs/cvslib/ChangeLogWriter.java
  43. +2
    -1
      src/main/org/apache/tools/ant/taskdefs/cvslib/CvsTagDiff.java
  44. +2
    -1
      src/main/org/apache/tools/ant/taskdefs/cvslib/RedirectingStreamHandler.java

+ 9
- 6
src/main/org/apache/tools/ant/ProjectHelper.java View File

@@ -185,12 +185,13 @@ public class ProjectHelper {
if (is != null) {
// This code is needed by EBCDIC and other strange systems.
// It's a fix for bugs reported in xerces
BufferedReader rd;
InputStreamReader isr;
try {
rd = new BufferedReader(new InputStreamReader(is, "UTF-8"));
isr = new InputStreamReader(is, "UTF-8");
} catch (java.io.UnsupportedEncodingException e) {
rd = new BufferedReader(new InputStreamReader(is));
isr = new InputStreamReader(is);
}
BufferedReader rd = new BufferedReader(isr);
String helperClassName = rd.readLine();
rd.close();
@@ -435,8 +436,9 @@ public class ProjectHelper {
project.log("Property ${" + propertyName
+ "} has not been set", Project.MSG_VERBOSE);
}
fragment = (keys.containsKey(propertyName)) ? (String) keys.get(propertyName)
: "${" + propertyName + "}";
fragment = (keys.containsKey(propertyName))
? (String) keys.get(propertyName)
: "${" + propertyName + "}";
}
sb.append(fragment);
}
@@ -461,7 +463,8 @@ public class ProjectHelper {
* <code>${</code> without a closing
* <code>}</code>
*/
public static void parsePropertyString(String value, Vector fragments, Vector propertyRefs)
public static void parsePropertyString(String value, Vector fragments,
Vector propertyRefs)
throws BuildException {
int prev = 0;
int pos;


+ 2
- 1
src/main/org/apache/tools/ant/listener/MailLogger.java View File

@@ -94,7 +94,8 @@ import org.apache.tools.mail.MailMessage;
* MailLogger.properties.file property</i> . Any properties defined in that
* file will override Ant properties.
*
* @author Erik Hatcher <a href="mailto:ehatcher@apache.org">ehatcher@apache.org</a>
* @author Erik Hatcher
* <a href="mailto:ehatcher@apache.org">ehatcher@apache.org</a>
*/
public class MailLogger extends DefaultLogger {
/** Buffer in which the message is constructed prior to sending */


+ 8
- 9
src/main/org/apache/tools/ant/taskdefs/AbstractCvsTask.java View File

@@ -77,8 +77,10 @@ import org.apache.tools.ant.util.StringUtils;
*
* @author costin@dnt.ro
* @author stefano@apache.org
* @author Wolfgang Werner <a href="mailto:wwerner@picturesafe.de">wwerner@picturesafe.de</a>
* @author Kevin Ross <a href="mailto:kevin.ross@bredex.com">kevin.ross@bredex.com</a>
* @author Wolfgang Werner
* <a href="mailto:wwerner@picturesafe.de">wwerner@picturesafe.de</a>
* @author Kevin Ross
* <a href="mailto:kevin.ross@bredex.com">kevin.ross@bredex.com</a>
*
* @since Ant 1.5
*/
@@ -180,8 +182,8 @@ public abstract class AbstractCvsTask extends Task {
super();
}

public void setExecuteStreamHandler(ExecuteStreamHandler executeStreamHandler){
this.executeStreamHandler = executeStreamHandler;
public void setExecuteStreamHandler(ExecuteStreamHandler handler){
this.executeStreamHandler = handler;
}

protected ExecuteStreamHandler getExecuteStreamHandler(){
@@ -278,7 +280,8 @@ public abstract class AbstractCvsTask extends Task {
* with a pass file.
if(passFile == null){

File defaultPassFile = new File(System.getProperty("user.home") + File.separatorChar + ".cvspass");
File defaultPassFile = new File(System.getProperty("user.home")
+ File.separatorChar + ".cvspass");

if(defaultPassFile.exists())
this.setPassfile(defaultPassFile);
@@ -353,10 +356,6 @@ public abstract class AbstractCvsTask extends Task {
log("Caught exception: " + e.getMessage(), Project.MSG_WARN);
}
} finally {
//
// condition used to be if(output == null) outputStream.close(). This is
// not appropriate. Check if the stream itself is not null, then close().
//
if (outputStream != null) {
try {
outputStream.close();


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

@@ -348,7 +348,8 @@ public class Ant extends Task {
getOwningTarget() != null &&
target.equals(this.getOwningTarget().getName())) {

throw new BuildException("ant task calling its own parent target");
throw new BuildException("ant task calling its own parent "
+ "target");
}

newProject.executeTarget(target);


+ 4
- 2
src/main/org/apache/tools/ant/taskdefs/Available.java View File

@@ -68,9 +68,11 @@ import org.apache.tools.ant.util.FileUtils;
import org.apache.tools.ant.util.StringUtils;

/**
* Will set the given property if the requested resource is available at runtime.
* Will set the given property if the requested resource is available at
* runtime.
*
* @author Stefano Mazzocchi <a href="mailto:stefano@apache.org">stefano@apache.org</a>
* @author Stefano Mazzocchi
* <a href="mailto:stefano@apache.org">stefano@apache.org</a>
* @author <a href="mailto:umagesh@apache.org">Magesh Umasankar</a>
*
* @since Ant 1.1


+ 8
- 7
src/main/org/apache/tools/ant/taskdefs/Checksum.java View File

@@ -244,13 +244,13 @@ public class Checksum extends MatchingTask implements Condition {

if (file != null) {
if (filesets.size() > 0) {
throw new BuildException(
"Multiple files cannot be used when Property is specified");
throw new BuildException("Multiple files cannot be used "
+ "when Property is specified");
}
} else {
if (filesets.size() > 1) {
throw new BuildException(
"Multiple files cannot be used when Property is specified");
throw new BuildException("Multiple files cannot be used "
+ "when Property is specified");
}
}
}
@@ -265,8 +265,8 @@ public class Checksum extends MatchingTask implements Condition {
}

if (isCondition && forceOverwrite) {
throw new BuildException(
"ForceOverwrite cannot be used when conditions are being used.");
throw new BuildException("ForceOverwrite cannot be used when "
+ "conditions are being used.");
}

messageDigest = null;
@@ -327,7 +327,8 @@ public class Checksum extends MatchingTask implements Condition {
if (file != null) {
if (file.exists()) {
if (property == null) {
File dest = new File(file.getParent(), file.getName() + fileext);
File dest
= new File(file.getParent(), file.getName() + fileext);
if (forceOverwrite || isCondition ||
(file.lastModified() > dest.lastModified())) {
includeFileMap.put(file, dest);


+ 8
- 4
src/main/org/apache/tools/ant/taskdefs/Chmod.java View File

@@ -68,7 +68,8 @@ import org.apache.tools.ant.types.PatternSet;
* Chmod equivalent for unix-like environments.
*
* @author costin@eng.sun.com
* @author Mariusz Nowostawski (Marni) <a href="mailto:mnowostawski@infoscience.otago.ac.nz">mnowostawski@infoscience.otago.ac.nz</a>
* @author Mariusz Nowostawski (Marni)
* <a href="mailto:mnowostawski@infoscience.otago.ac.nz">mnowostawski@infoscience.otago.ac.nz</a>
* @author <a href="mailto:stefan.bodewig@epost.de">Stefan Bodewig</a>
*
* @since Ant 1.1
@@ -216,15 +217,18 @@ public class Chmod extends ExecuteOn {


public void setExecutable(String e) {
throw new BuildException(taskType + " doesn\'t support the executable attribute", location);
throw new BuildException(taskType
+ " doesn\'t support the executable attribute", location);
}

public void setCommand(Commandline cmdl) {
throw new BuildException(taskType + " doesn\'t support the command attribute", location);
throw new BuildException(taskType
+ " doesn\'t support the command attribute", location);
}

public void setSkipEmptyFilesets(boolean skip) {
throw new BuildException(taskType + " doesn\'t support the skipemptyfileset attribute", location);
throw new BuildException(taskType
+ " doesn\'t support the skipemptyfileset attribute", location);
}

protected boolean isValidOs() {


+ 4
- 2
src/main/org/apache/tools/ant/taskdefs/ConditionTask.java View File

@@ -101,10 +101,12 @@ public class ConditionTask extends ConditionBase {
*/
public void execute() throws BuildException {
if (countConditions() > 1) {
throw new BuildException("You must not nest more than one condition into <condition>");
throw new BuildException("You must not nest more than one "
+ "condition into <condition>");
}
if (countConditions() < 1) {
throw new BuildException("You must nest a condition into <condition>");
throw new BuildException("You must nest a condition into "
+ "<condition>");
}
if (property == null) {
throw new BuildException("The property attribute is required.");


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

@@ -85,7 +85,8 @@ import java.util.Enumeration;
* document, the following mailing list discussions, and the
* copyfile/copydir tasks.</p>
*
* @author Glenn McAllister <a href="mailto:glennm@ca.ibm.com">glennm@ca.ibm.com</a>
* @author Glenn McAllister
* <a href="mailto:glennm@ca.ibm.com">glennm@ca.ibm.com</a>
* @author <a href="mailto:stefan.bodewig@epost.de">Stefan Bodewig</a>
* @author <A href="gholam@xtra.co.nz">Michael McCallum</A>
* @author <a href="mailto:umagesh@rediffmail.com">Magesh Umasankar</a>


+ 4
- 2
src/main/org/apache/tools/ant/taskdefs/Cvs.java View File

@@ -63,8 +63,10 @@ package org.apache.tools.ant.taskdefs;
*
* @author costin@dnt.ro
* @author stefano@apache.org
* @author Wolfgang Werner <a href="mailto:wwerner@picturesafe.de">wwerner@picturesafe.de</a>
* @author Kevin Ross <a href="mailto:kevin.ross@bredex.com">kevin.ross@bredex.com</a>
* @author Wolfgang Werner
* <a href="mailto:wwerner@picturesafe.de">wwerner@picturesafe.de</a>
* @author Kevin Ross
* <a href="mailto:kevin.ross@bredex.com">kevin.ross@bredex.com</a>
*
* @since Ant 1.1
*


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

@@ -72,9 +72,11 @@ import java.util.Vector;
* to provide backwards compatibility for a release. The future position
* is to use nested filesets exclusively.</p>
*
* @author Stefano Mazzocchi <a href="mailto:stefano@apache.org">stefano@apache.org</a>
* @author Stefano Mazzocchi
* <a href="mailto:stefano@apache.org">stefano@apache.org</a>
* @author Tom Dimock <a href="mailto:tad1@cornell.edu">tad1@cornell.edu</a>
* @author Glenn McAllister <a href="mailto:glennm@ca.ibm.com">glennm@ca.ibm.com</a>
* @author Glenn McAllister
* <a href="mailto:glennm@ca.ibm.com">glennm@ca.ibm.com</a>
* @author Jon S. Stevens <a href="mailto:jon@latchkey.com">jon@latchkey.com</a>
*
* @since Ant 1.2


+ 11
- 10
src/main/org/apache/tools/ant/taskdefs/DependSet.java View File

@@ -81,18 +81,19 @@ import org.apache.tools.ant.types.FileList;
* <li>targetfileset (fileset describing the target files to examine)
* <li>targetfilelist (filelist describing the target files to examine)
* </ul>
* At least one instance of either a fileset or filelist for both source and target
* are required.
* At least one instance of either a fileset or filelist for both source and
* target are required.
* <p>
* This task will examine each of the source files against each of the target files.
* If any target files are out of date with respect to any of the source files, all targets are removed.
* If any files named in a (src or target) filelist do not exist, all targets are removed.
* Hint: If missing files should be ignored, specify them as include patterns in filesets,
* rather than using filelists.
* This task will examine each of the source files against each of the target
* files. If any target files are out of date with respect to any of the source
* files, all targets are removed. If any files named in a (src or target)
* filelist do not exist, all targets are removed.
* Hint: If missing files should be ignored, specify them as include patterns
* in filesets, rather than using filelists.
* </p><p>
* This task attempts to optimize speed of dependency checking. It will stop after the first
* out of date file is found and remove all targets, rather than exhaustively checking every
* source vs target combination unnecessarily.
* This task attempts to optimize speed of dependency checking. It will stop
* after the first out of date file is found and remove all targets, rather
* than exhaustively checking every source vs target combination unnecessarily.
* </p><p>
* Example uses:
* <ul><li>


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

@@ -164,7 +164,8 @@ public class Echo extends Task {

public static class EchoLevel extends EnumeratedAttribute {
public String[] getValues() {
return new String[] {"error", "warning", "info", "verbose", "debug"};
return new String[] {"error", "warning", "info",
"verbose", "debug"};
}
}
}

+ 10
- 5
src/main/org/apache/tools/ant/taskdefs/Exec.java View File

@@ -76,7 +76,8 @@ import java.io.InputStreamReader;
* @author duncan@x180.com
* @author rubys@us.ibm.com
*
* @deprecated delegate to {@link org.apache.tools.ant.taskdefs.Execute Execute} instead.
* @deprecated delegate to {@link org.apache.tools.ant.taskdefs.Execute Execute}
* instead.
*/
public class Exec extends Task {
private String os;
@@ -89,8 +90,10 @@ public class Exec extends Task {
private static final int BUFFER_SIZE = 512;

public Exec() {
System.err.println("As of Ant 1.2 released in October 2000, the Exec class");
System.err.println("is considered to be dead code by the Ant developers and is unmaintained.");
System.err.println("As of Ant 1.2 released in October 2000, "
+ "the Exec class");
System.err.println("is considered to be dead code by the Ant "
+ "developers and is unmaintained.");
System.err.println("Don\'t use it!");
}

@@ -123,7 +126,8 @@ public class Exec extends Task {
} else {
String ant = project.getProperty("ant.home");
if (ant == null) {
throw new BuildException("Property 'ant.home' not found", location);
throw new BuildException("Property 'ant.home' not "
+ "found", location);
}
String antRun = project.resolveFile(ant + "/bin/antRun.bat").toString();
@@ -133,7 +137,8 @@ public class Exec extends Task {
} else {
String ant = project.getProperty("ant.home");
if (ant == null) {
throw new BuildException("Property 'ant.home' not found", location);
throw new BuildException("Property 'ant.home' not found",
location);
}
String antRun = project.resolveFile(ant + "/bin/antRun").toString();



+ 18
- 10
src/main/org/apache/tools/ant/taskdefs/Execute.java View File

@@ -140,7 +140,8 @@ public class Execute {
shellLauncher = new WinNTCommandLauncher(baseLauncher);
} else {
// Windows 98/95 - need to use an auxiliary script
shellLauncher = new ScriptCommandLauncher("bin/antRun.bat", baseLauncher);
shellLauncher
= new ScriptCommandLauncher("bin/antRun.bat", baseLauncher);
}
} else if (Os.isFamily("netware")) {
// NetWare. Need to determine which JDK we're running in
@@ -153,10 +154,12 @@ public class Execute {
baseLauncher = new CommandLauncher();
}

shellLauncher = new PerlScriptCommandLauncher("bin/antRun.pl", baseLauncher);
shellLauncher
= new PerlScriptCommandLauncher("bin/antRun.pl", baseLauncher);
} else {
// Generic
shellLauncher = new ScriptCommandLauncher("bin/antRun", new CommandLauncher());
shellLauncher = new ScriptCommandLauncher("bin/antRun",
new CommandLauncher());
}
}

@@ -272,7 +275,8 @@ public class Execute {
* @param watchdog a watchdog for the subprocess or <code>null</code> to
* to disable a timeout for the subprocess.
*/
public Execute(ExecuteStreamHandler streamHandler, ExecuteWatchdog watchdog) {
public Execute(ExecuteStreamHandler streamHandler,
ExecuteWatchdog watchdog) {
this.streamHandler = streamHandler;
this.watchdog = watchdog;
}
@@ -363,7 +367,8 @@ public class Execute {
* executable with a script, etc
*
* @param vmLauncher true if exec should launch through thge VM,
* false if the shell should be used to launch the command.
* false if the shell should be used to launch the
* command.
*/
public void setVMLauncher(boolean useVMLauncher) {
this.useVMLauncher = useVMLauncher;
@@ -383,7 +388,8 @@ public class Execute {
public static Process launch(Project project, String[] command,
String[] env, File dir, boolean useVM)
throws IOException {
CommandLauncher launcher = vmLauncher != null ? vmLauncher : shellLauncher;
CommandLauncher launcher
= vmLauncher != null ? vmLauncher : shellLauncher;
if (!useVM) {
launcher = shellLauncher;
}
@@ -498,8 +504,8 @@ public class Execute {
*
* @throws BuildException if the command does not return 0.
*/
public static void runCommand(Task task, String[] cmdline) throws BuildException
{
public static void runCommand(Task task, String[] cmdline)
throws BuildException {
try {
task.log(Commandline.toString(cmdline), Project.MSG_VERBOSE);
Execute exe = new Execute(new LogStreamHandler(task,
@@ -621,7 +627,8 @@ public class Execute {
} else if (realexc instanceof IOException) {
throw (IOException) realexc;
} else {
throw new BuildException("Unable to execute command", realexc);
throw new BuildException("Unable to execute command",
realexc);
}
} catch (Exception exc) {
// IllegalAccess, IllegalArgument, ClassCast
@@ -743,7 +750,8 @@ public class Execute {
if (workingDir == null) {
return exec(project, cmd, env);
}
throw new IOException("Cannot locate antRun script: No project provided");
throw new IOException("Cannot locate antRun script: "
+ "No project provided");
}

// Locate the auxiliary script


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

@@ -128,7 +128,8 @@ public class ExecuteJava implements Runnable, TimeoutObserver {
if (classpath == null) {
target = Class.forName(classname);
} else {
loader = new AntClassLoader(project.getCoreLoader(), project, classpath, false);
loader = new AntClassLoader(project.getCoreLoader(), project,
classpath, false);
loader.setIsolated(true);
loader.setThreadContextLoader();
target = loader.forceLoadClass(classname);


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

@@ -286,8 +286,7 @@ public class ExecuteOn extends ExecTask {
for (int j = 0; j < subTargets.length; j++) {
String name = null;
if (!relative) {
name =
(new File(destDir, subTargets[j])).getAbsolutePath();
name = (new File(destDir, subTargets[j])).getAbsolutePath();
} else {
name = subTargets[j];
}
@@ -303,7 +302,8 @@ public class ExecuteOn extends ExecTask {
targets.copyInto(targetFiles);
String[] orig = cmdl.getCommandline();
String[] result = new String[orig.length + srcFiles.length + targetFiles.length];
String[] result
= new String[orig.length + srcFiles.length + targetFiles.length];

int srcIndex = orig.length;
if (srcFilePos != null) {
@@ -331,8 +331,8 @@ public class ExecuteOn extends ExecTask {
// targetIndex --> end
System.arraycopy(orig, targetIndex, result,
targetIndex + srcFiles.length + targetFiles.length,
orig.length - targetIndex);
targetIndex + srcFiles.length + targetFiles.length,
orig.length - targetIndex);
} else {
// 0 --> targetIndex
System.arraycopy(orig, 0, result, 0, targetIndex);
@@ -349,8 +349,8 @@ public class ExecuteOn extends ExecTask {
// srcIndex --> end
System.arraycopy(orig, srcIndex, result,
srcIndex + srcFiles.length + targetFiles.length,
orig.length - srcIndex);
srcIndex + srcFiles.length + targetFiles.length,
orig.length - srcIndex);
srcIndex += targetFiles.length;
}



+ 15
- 11
src/main/org/apache/tools/ant/taskdefs/ExecuteWatchdog.java View File

@@ -97,7 +97,8 @@ public class ExecuteWatchdog implements TimeoutObserver {
/**
* Creates a new watchdog with a given timeout.
*
* @param timeout the timeout for the process in milliseconds. It must be greather than 0.
* @param timeout the timeout for the process in milliseconds.
* It must be greather than 0.
*/
public ExecuteWatchdog(long timeout) {
watchdog = new Watchdog(timeout);
@@ -108,7 +109,7 @@ public class ExecuteWatchdog implements TimeoutObserver {
* Watches the given process and terminates it, if it runs for too long.
* All information from the previous run are reset.
* @param process the process to monitor. It cannot be <tt>null</tt>
* @throws IllegalStateException thrown if a process is still being monitored.
* @throws IllegalStateException if a process is still being monitored.
*/
public synchronized void start(Process process) {
if (process == null) {
@@ -125,7 +126,8 @@ public class ExecuteWatchdog implements TimeoutObserver {
}

/**
* Stops the watcher. It will notify all threads possibly waiting on this object.
* Stops the watcher. It will notify all threads possibly waiting
* on this object.
*/
public synchronized void stop() {
watchdog.stop();
@@ -166,12 +168,12 @@ public class ExecuteWatchdog implements TimeoutObserver {
}

/**
* This method will rethrow the exception that was possibly caught during the
* run of the process. It will only remains valid once the process has been
* terminated either by 'error', timeout or manual intervention. Information
* will be discarded once a new process is ran.
* @throws BuildException a wrapped exception over the one that was silently
* swallowed and stored during the process run.
* This method will rethrow the exception that was possibly caught during
* the run of the process. It will only remains valid once the process has
* been terminated either by 'error', timeout or manual intervention.
* Information will be discarded once a new process is ran.
* @throws BuildException a wrapped exception over the one that was
* silently swallowed and stored during the process run.
*/
public void checkException() throws BuildException {
if (caught != null) {
@@ -182,7 +184,8 @@ public class ExecuteWatchdog implements TimeoutObserver {

/**
* Indicates whether or not the watchdog is still monitoring the process.
* @return <tt>true</tt> if the process is still running, otherwise <tt>false</tt>.
* @return <tt>true</tt> if the process is still running, otherwise
* <tt>false</tt>.
*/
public boolean isWatching(){
return watch;
@@ -190,7 +193,8 @@ public class ExecuteWatchdog implements TimeoutObserver {

/**
* Indicates whether the last process run was killed on timeout or not.
* @return <tt>true</tt> if the process was killed otherwise <tt>false</tt>.
* @return <tt>true</tt> if the process was killed otherwise
* <tt>false</tt>.
*/
public boolean killedProcess(){
return killedProcess;


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

@@ -65,7 +65,8 @@ import org.apache.tools.ant.Project;
* of the project to do token substitution, or sets mutiple tokens by
* reading these from a file.
*
* @author Stefano Mazzocchi <a href="mailto:stefano@apache.org">stefano@apache.org</a>
* @author Stefano Mazzocchi
* <a href="mailto:stefano@apache.org">stefano@apache.org</a>
* @author Gero Vermaas <a href="mailto:gero@xs4all.nl">gero@xs4all.nl</a>
* @author <A href="gholam@xtra.co.nz">Michael McCallum</A>
*


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

@@ -78,7 +78,8 @@ import java.util.Enumeration;
* Creates a JAR archive.
*
* @author James Davidson <a href="mailto:duncan@x180.com">duncan@x180.com</a>
* @author Brian Deitte <a href="mailto:bdeitte@macromedia.com">bdeitte@macromedia.com</a>
* @author Brian Deitte
* <a href="mailto:bdeitte@macromedia.com">bdeitte@macromedia.com</a>
*
* @since Ant 1.1
*
@@ -291,8 +292,8 @@ public class Jar extends Zip {
/**
* Create the index list to speed up classloading.
* This is a JDK 1.3+ specific feature and is enabled by default. See
* <a href="http://java.sun.com/j2se/1.3/docs/guide/jar/jar.html#JAR+Index">the
* JAR index specification</a> for more details.
* <a href="http://java.sun.com/j2se/1.3/docs/guide/jar/jar.html#JAR+Index">
* the JAR index specification</a> for more details.
*
* @param zOut the zip stream representing the jar being built.
* @throws IOException thrown if there is an error while creating the
@@ -390,7 +391,8 @@ public class Jar extends Zip {
filesetManifest.merge(newManifest);
}
} catch (ManifestException e) {
log("Manifest in file " + file + " is invalid: " + e.getMessage(), Project.MSG_ERR);
log("Manifest in file " + file + " is invalid: "
+ e.getMessage(), Project.MSG_ERR);
throw new BuildException("Invalid Manifest", e, getLocation());
}
} else {


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

@@ -76,7 +76,8 @@ import java.util.Vector;
* the same JVM for the called application thus resulting in much
* faster operation.
*
* @author Stefano Mazzocchi <a href="mailto:stefano@apache.org">stefano@apache.org</a>
* @author Stefano Mazzocchi
* <a href="mailto:stefano@apache.org">stefano@apache.org</a>
* @author <a href="mailto:stefan.bodewig@epost.de">Stefan Bodewig</a>
*
* @since Ant 1.1


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

@@ -100,7 +100,8 @@ import java.util.Vector;
* compile decision based on timestamp.
*
* @author James Davidson <a href="mailto:duncan@x180.com">duncan@x180.com</a>
* @author Robin Green <a href="mailto:greenrd@hotmail.com">greenrd@hotmail.com</a>
* @author Robin Green
* <a href="mailto:greenrd@hotmail.com">greenrd@hotmail.com</a>
* @author <a href="mailto:stefan.bodewig@epost.de">Stefan Bodewig</a>
* @author <a href="mailto:jayglanville@home.com">J D Glanville</a>
*


+ 6
- 3
src/main/org/apache/tools/ant/taskdefs/Javadoc.java View File

@@ -97,8 +97,10 @@ import org.apache.tools.ant.util.JavaEnvUtils;
* <CODE>System.exit()</CODE> which would break Ant functionality.
*
* @author Jon S. Stevens <a href="mailto:jon@clearink.com">jon@clearink.com</a>
* @author Stefano Mazzocchi <a href="mailto:stefano@apache.org">stefano@apache.org</a>
* @author Patrick Chanezon <a href="mailto:chanezon@netscape.com">chanezon@netscape.com</a>
* @author Stefano Mazzocchi
* <a href="mailto:stefano@apache.org">stefano@apache.org</a>
* @author Patrick Chanezon
* <a href="mailto:chanezon@netscape.com">chanezon@netscape.com</a>
* @author Ernst de Haan <a href="mailto:ernst@jollem.com">ernst@jollem.com</a>
* @author <a href="mailto:stefan.bodewig@epost.de">Stefan Bodewig</a>
*
@@ -1077,7 +1079,8 @@ public class Javadoc extends Task {
// Ant javadoc task rules for group attribute:
// Args are comma-delimited.
// Each arg is 2 space-delimited strings.
// E.g., group="XSLT_Packages org.apache.xalan.xslt*,XPath_Packages org.apache.xalan.xpath*"
// E.g., group="XSLT_Packages org.apache.xalan.xslt*,
// XPath_Packages org.apache.xalan.xpath*"
if (group != null) {
StringTokenizer tok = new StringTokenizer(group, ",", false);
while (tok.hasMoreTokens()) {


+ 6
- 3
src/main/org/apache/tools/ant/taskdefs/Jikes.java View File

@@ -87,8 +87,10 @@ public class Jikes {
protected Jikes(JikesOutputParser jop, String command, Project project) {
super();

System.err.println("As of Ant 1.2 released in October 2000, the Jikes class");
System.err.println("is considered to be dead code by the Ant developers and is unmaintained.");
System.err.println("As of Ant 1.2 released in October 2000, "
+ "the Jikes class");
System.err.println("is considered to be dead code by the Ant "
+ "developers and is unmaintained.");
System.err.println("Don\'t use it!");

this.jop = jop;
@@ -125,7 +127,8 @@ public class Jikes {
commandArray = new String[] { command,
"@" + tmpFile.getAbsolutePath()};
} catch (IOException e) {
throw new BuildException("Error creating temporary file", e);
throw new BuildException("Error creating temporary file",
e);
} finally {
if (out != null) {
try {out.close();} catch (Throwable t) {}


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

@@ -120,8 +120,10 @@ public class JikesOutputParser implements ExecuteStreamHandler {
protected JikesOutputParser(Task task, boolean emacsMode) {
super();

System.err.println("As of Ant 1.2 released in October 2000, the JikesOutputParser class");
System.err.println("is considered to be dead code by the Ant developers and is unmaintained.");
System.err.println("As of Ant 1.2 released in October 2000, the "
+ "JikesOutputParser class");
System.err.println("is considered to be dead code by the Ant "
+ "developers and is unmaintained.");
System.err.println("Don\'t use it!");

this.task = task;


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

@@ -67,8 +67,10 @@ import java.util.StringTokenizer;
* This is an abstract task that should be used by all those tasks that
* require to include or exclude files based on pattern matching.
*
* @author Arnout J. Kuiper <a href="mailto:ajkuiper@wxs.nl">ajkuiper@wxs.nl</a>
* @author Stefano Mazzocchi <a href="mailto:stefano@apache.org">stefano@apache.org</a>
* @author Arnout J. Kuiper
* <a href="mailto:ajkuiper@wxs.nl">ajkuiper@wxs.nl</a>
* @author Stefano Mazzocchi
* <a href="mailto:stefano@apache.org">stefano@apache.org</a>
* @author Sam Ruby <a href="mailto:rubys@us.ibm.com">rubys@us.ibm.com</a>
* @author Jon S. Stevens <a href="mailto:jon@clearink.com">jon@clearink.com</a>
* @author <a href="mailto:stefan.bodewig@epost.de">Stefan Bodewig</a>


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

@@ -79,7 +79,8 @@ import java.util.Enumeration;
* document, the following mailing list discussions, and the
* copyfile/copydir tasks.</p>
*
* @author Glenn McAllister <a href="mailto:glennm@ca.ibm.com">glennm@ca.ibm.com</a>
* @author Glenn McAllister
* <a href="mailto:glennm@ca.ibm.com">glennm@ca.ibm.com</a>
* @author <a href="mailto:umagesh@rediffmail.com">Magesh Umasankar</a>
* @version $Revision$
*


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

@@ -82,7 +82,8 @@ import java.util.Vector;
* values in the indicated files. Each value can be either a string
* or the value of a property available in a designated property file.
*
* @author Stefano Mazzocchi <a href="mailto:stefano@apache.org">stefano@apache.org</a>
* @author Stefano Mazzocchi
* <a href="mailto:stefano@apache.org">stefano@apache.org</a>
* @author <a href="mailto:erik@desknetinc.com">Erik Langenbach</a>
*
* @since Ant 1.1


+ 4
- 2
src/main/org/apache/tools/ant/taskdefs/SignJar.java View File

@@ -69,8 +69,10 @@ import org.apache.tools.ant.types.FileSet;
/**
* Sign a archive.
*
* @author Peter Donald <a href="mailto:donaldp@apache.org">donaldp@apache.org</a>
* @author Nick Fortescue <a href="mailto:nick@ox.compsoc.net">nick@ox.compsoc.net</a>
* @author Peter Donald
* <a href="mailto:donaldp@apache.org">donaldp@apache.org</a>
* @author Nick Fortescue
* <a href="mailto:nick@ox.compsoc.net">nick@ox.compsoc.net</a>
* @since Ant 1.1
* @ant.task category="java"
*/


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

@@ -74,7 +74,8 @@ import org.apache.tools.tar.TarEntry;
/**
* Creates a TAR archive.
*
* @author Stefano Mazzocchi <a href="mailto:stefano@apache.org">stefano@apache.org</a>
* @author Stefano Mazzocchi
* <a href="mailto:stefano@apache.org">stefano@apache.org</a>
* @author <a href="mailto:stefan.bodewig@epost.de">Stefan Bodewig</a>
* @author <a href="mailto:umagesh@apache.org">Magesh Umasankar</a>
*
@@ -136,7 +137,6 @@ public class Tar extends MatchingTask {
* @deprecated for consistency with other tasks, please use setDestFile()
*/
public void setTarfile(File tarFile) {
//log("DEPRECATED - The tarfile attribute is deprecated. Please use the destfile attribute instead.");
this.tarFile = tarFile;
}



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

@@ -107,7 +107,8 @@ public class Tstamp extends Task {
SimpleDateFormat tstamp = new SimpleDateFormat ("HHmm");
project.setNewProperty(prefix + "TSTAMP", tstamp.format(d));

SimpleDateFormat today = new SimpleDateFormat ("MMMM d yyyy", Locale.US);
SimpleDateFormat today
= new SimpleDateFormat ("MMMM d yyyy", Locale.US);
project.setNewProperty(prefix + "TODAY", today.format(d));

Enumeration i = customFormats.elements();


+ 4
- 2
src/main/org/apache/tools/ant/taskdefs/UpToDate.java View File

@@ -73,8 +73,10 @@ import java.util.Vector;
* Will set the given property if the specified target has a timestamp
* greater than all of the source files.
*
* @author William Ferguson <a href="mailto:williamf@mincom.com">williamf@mincom.com</a>
* @author Hiroaki Nakamura <a href="mailto:hnakamur@mc.neweb.ne.jp">hnakamur@mc.neweb.ne.jp</a>
* @author William Ferguson
* <a href="mailto:williamf@mincom.com">williamf@mincom.com</a>
* @author Hiroaki Nakamura
* <a href="mailto:hnakamur@mc.neweb.ne.jp">hnakamur@mc.neweb.ne.jp</a>
* @author <a href="mailto:stefan.bodewig@epost.de">Stefan Bodewig</a>
*
* @since Ant 1.2


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

@@ -611,8 +611,8 @@ public class Zip extends MatchingTask {
} else {
for (int i = 0; i < files.length; ++i) {
if (files[i].equals(zipFile)) {
throw new BuildException("A zip file cannot include itself",
location);
throw new BuildException("A zip file cannot include "
+ "itself", location);
}
}



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

@@ -67,7 +67,8 @@ import org.apache.tools.ant.taskdefs.Javac;
* task, the execute command and a parameterless constructor (for
* reflection).</p>
*
* @author Jay Dickon Glanville <a href="mailto:jayglanville@home.com">jayglanville@home.com</a>
* @author Jay Dickon Glanville
* <a href="mailto:jayglanville@home.com">jayglanville@home.com</a>
* @since Ant 1.3
*/



+ 4
- 2
src/main/org/apache/tools/ant/taskdefs/compilers/CompilerAdapterFactory.java View File

@@ -131,8 +131,10 @@ public class CompilerAdapterFactory {
+ "classic compiler", Project.MSG_WARN);
return new Javac12();
} else {
throw new BuildException("Unable to find a javac compiler;\n"
+ "com.sun.tools.javac.Main is not on the classpath.\n"
throw new BuildException("Unable to find a javac "
+ "compiler;\n"
+ "com.sun.tools.javac.Main is not on the "
+ "classpath.\n"
+ "Perhaps JAVA_HOME does not point to the JDK");
}
}


+ 4
- 2
src/main/org/apache/tools/ant/taskdefs/compilers/DefaultCompilerAdapter.java View File

@@ -75,7 +75,8 @@ import java.io.IOException;
* Currently, this is a cut-and-paste of the original javac task.
*
* @author James Davidson <a href="mailto:duncan@x180.com">duncan@x180.com</a>
* @author Robin Green <a href="mailto:greenrd@hotmail.com">greenrd@hotmail.com</a>
* @author Robin Green
* <a href="mailto:greenrd@hotmail.com">greenrd@hotmail.com</a>
* @author <a href="mailto:stefan.bodewig@epost.de">Stefan Bodewig</a>
* @author <a href="mailto:jayglanville@home.com">J D Glanville</a>
*
@@ -202,7 +203,8 @@ public abstract class DefaultCompilerAdapter implements CompilerAdapter {
// we cannot be using Java 1.0 when forking, so we only have to
// distinguish between Java 1.1, and Java 1.2 and higher, as Java 1.1
// has its own parameter format
boolean usingJava1_1 = Project.getJavaVersion().equals(Project.JAVA_1_1);
boolean usingJava1_1
= Project.getJavaVersion().equals(Project.JAVA_1_1);
String memoryParameterPrefix = usingJava1_1 ? "-J-" : "-J-X";
if (memoryInitialSize != null) {
if (!attributes.isForkedJavac()) {


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

@@ -70,7 +70,8 @@ import java.lang.reflect.Method;
* was refactored.
*
* @author James Davidson <a href="mailto:duncan@x180.com">duncan@x180.com</a>
* @author Robin Green <a href="mailto:greenrd@hotmail.com">greenrd@hotmail.com</a>
* @author Robin Green
* <a href="mailto:greenrd@hotmail.com">greenrd@hotmail.com</a>
* @author <a href="mailto:stefan.bodewig@epost.de">Stefan Bodewig</a>
* @author <a href="mailto:jayglanville@home.com">J D Glanville</a>
*


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

@@ -68,7 +68,8 @@ import java.lang.reflect.Method;
* was refactored.
*
* @author James Davidson <a href="mailto:duncan@x180.com">duncan@x180.com</a>
* @author Robin Green <a href="mailto:greenrd@hotmail.com">greenrd@hotmail.com</a>
* @author Robin Green
* <a href="mailto:greenrd@hotmail.com">greenrd@hotmail.com</a>
* @author <a href="mailto:stefan.bodewig@epost.de">Stefan Bodewig</a>
* @author <a href="mailto:jayglanville@home.com">J D Glanville</a>
*


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

@@ -65,7 +65,8 @@ import org.apache.tools.ant.types.Commandline;
* was refactored.
*
* @author James Davidson <a href="mailto:duncan@x180.com">duncan@x180.com</a>
* @author Robin Green <a href="mailto:greenrd@hotmail.com">greenrd@hotmail.com</a>
* @author Robin Green
* <a href="mailto:greenrd@hotmail.com">greenrd@hotmail.com</a>
* @author <a href="mailto:stefan.bodewig@epost.de">Stefan Bodewig</a>
* @author <a href="mailto:jayglanville@home.com">J D Glanville</a>
* @since Ant 1.3


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

@@ -65,7 +65,8 @@ import org.apache.tools.ant.types.Commandline;
* was refactored.
*
* @author James Davidson <a href="mailto:duncan@x180.com">duncan@x180.com</a>
* @author Robin Green <a href="mailto:greenrd@hotmail.com">greenrd@hotmail.com</a>
* @author Robin Green
* <a href="mailto:greenrd@hotmail.com">greenrd@hotmail.com</a>
* @author <a href="mailto:stefan.bodewig@epost.de">Stefan Bodewig</a>
* @author <a href="mailto:jayglanville@home.com">J D Glanville</a>
* @since Ant 1.3


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

@@ -143,12 +143,14 @@ class ChangeLogParser {
if (line.startsWith("======")) {
//We have ended changelog for that particular file
//so we can save it
final int end = m_comment.length() - lineSeparator.length(); //was -1
final int end
= m_comment.length() - lineSeparator.length(); //was -1
m_comment = m_comment.substring(0, end);
saveEntry();
m_status = GET_FILE;
} else if (line.startsWith("----------------------------")) {
final int end = m_comment.length() - lineSeparator.length(); //was -1
final int end
= m_comment.length() - lineSeparator.length(); //was -1
m_comment = m_comment.substring(0, end);
m_status = GET_PREVIOUS_REV;
} else {


+ 14
- 7
src/main/org/apache/tools/ant/taskdefs/cvslib/ChangeLogWriter.java View File

@@ -65,9 +65,11 @@ import java.util.Enumeration;
*/
class ChangeLogWriter {
/** output format for dates writtn to xml file */
private static final SimpleDateFormat c_outputDate = new SimpleDateFormat("yyyy-MM-dd");
private static final SimpleDateFormat c_outputDate
= new SimpleDateFormat("yyyy-MM-dd");
/** output format for times writtn to xml file */
private static final SimpleDateFormat c_outputTime = new SimpleDateFormat("hh:mm");
private static final SimpleDateFormat c_outputTime
= new SimpleDateFormat("hh:mm");


/**
@@ -99,9 +101,12 @@ class ChangeLogWriter {
*/
private void printEntry(final PrintWriter output, final CVSEntry entry) {
output.println("\t<entry>");
output.println("\t\t<date>" + c_outputDate.format(entry.getDate()) + "</date>");
output.println("\t\t<time>" + c_outputTime.format(entry.getDate()) + "</time>");
output.println("\t\t<author><![CDATA[" + entry.getAuthor() + "]]></author>");
output.println("\t\t<date>" + c_outputDate.format(entry.getDate())
+ "</date>");
output.println("\t\t<time>" + c_outputTime.format(entry.getDate())
+ "</time>");
output.println("\t\t<author><![CDATA[" + entry.getAuthor()
+ "]]></author>");

final Enumeration enumeration = entry.getFiles().elements();

@@ -110,12 +115,14 @@ class ChangeLogWriter {

output.println("\t\t<file>");
output.println("\t\t\t<name>" + file.getName() + "</name>");
output.println("\t\t\t<revision>" + file.getRevision() + "</revision>");
output.println("\t\t\t<revision>" + file.getRevision()
+ "</revision>");

final String previousRevision = file.getPreviousRevision();

if (previousRevision != null) {
output.println("\t\t\t<prevrevision>" + previousRevision + "</prevrevision>");
output.println("\t\t\t<prevrevision>" + previousRevision
+ "</prevrevision>");
}

output.println("\t\t</file>");


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

@@ -161,7 +161,8 @@ public class CvsTagDiff extends Task {
/**
* Initialize this task.
* CvsTagDiff initializes a member cvs task in init() to perform the rdiff in execute().
* CvsTagDiff initializes a member cvs task in init() to perform the
* rdiff in execute().
*
* @exception BuildException if an error occurs
*/


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

@@ -74,7 +74,8 @@ class RedirectingStreamHandler

String getErrors() {
try {
final ByteArrayOutputStream error = (ByteArrayOutputStream) getErr();
final ByteArrayOutputStream error
= (ByteArrayOutputStream) getErr();

return error.toString("ASCII");
} catch (final Exception e) {


Loading…
Cancel
Save