git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@272443 13f79535-47bb-0310-9956-ffa450edef68master
@@ -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; | |||
@@ -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 */ | |||
@@ -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(); | |||
@@ -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); | |||
@@ -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 | |||
@@ -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); | |||
@@ -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() { | |||
@@ -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."); | |||
@@ -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> | |||
@@ -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 | |||
* | |||
@@ -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 | |||
@@ -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> | |||
@@ -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"}; | |||
} | |||
} | |||
} |
@@ -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(); | |||
@@ -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 | |||
@@ -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); | |||
@@ -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; | |||
} | |||
@@ -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; | |||
@@ -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> | |||
* | |||
@@ -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 { | |||
@@ -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 | |||
@@ -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> | |||
* | |||
@@ -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()) { | |||
@@ -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) {} | |||
@@ -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; | |||
@@ -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> | |||
@@ -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$ | |||
* | |||
@@ -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 | |||
@@ -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" | |||
*/ | |||
@@ -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; | |||
} | |||
@@ -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(); | |||
@@ -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 | |||
@@ -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); | |||
} | |||
} | |||
@@ -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 | |||
*/ | |||
@@ -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"); | |||
} | |||
} | |||
@@ -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()) { | |||
@@ -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> | |||
* | |||
@@ -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> | |||
* | |||
@@ -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 | |||
@@ -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 | |||
@@ -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 { | |||
@@ -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>"); | |||
@@ -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 | |||
*/ | |||
@@ -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) { | |||