git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@471554 13f79535-47bb-0310-9956-ffa450edef68master
@@ -353,7 +353,7 @@ public class Javah extends Task { | |||||
facade.setImplementation(JavahAdapterFactory.getDefault()); | facade.setImplementation(JavahAdapterFactory.getDefault()); | ||||
} else { | } else { | ||||
facade.setImplementation(impl); | facade.setImplementation(impl); | ||||
} | |||||
} | |||||
} | } | ||||
/** | /** | ||||
@@ -414,7 +414,7 @@ public class Javah extends Task { | |||||
classpath = classpath.concatSystemClasspath("ignore"); | classpath = classpath.concatSystemClasspath("ignore"); | ||||
} | } | ||||
JavahAdapter ad = | |||||
JavahAdapter ad = | |||||
JavahAdapterFactory.getAdapter(facade.getImplementation(), | JavahAdapterFactory.getAdapter(facade.getImplementation(), | ||||
this); | this); | ||||
if (!ad.compile(this)) { | if (!ad.compile(this)) { | ||||
@@ -131,7 +131,7 @@ public class Native2Ascii extends MatchingTask { | |||||
facade.setImplementation(Native2AsciiAdapterFactory.getDefault()); | facade.setImplementation(Native2AsciiAdapterFactory.getDefault()); | ||||
} else { | } else { | ||||
facade.setImplementation(impl); | facade.setImplementation(impl); | ||||
} | |||||
} | |||||
} | } | ||||
/** | /** | ||||
@@ -233,7 +233,7 @@ public class Native2Ascii extends MatchingTask { | |||||
* @param srcName name of the input file. | * @param srcName name of the input file. | ||||
* @param destName name of the input file. | * @param destName name of the input file. | ||||
*/ | */ | ||||
private void convert(String srcName, String destName) | |||||
private void convert(String srcName, String destName) | |||||
throws BuildException { | throws BuildException { | ||||
File srcFile; // File to convert | File srcFile; // File to convert | ||||
File destFile; // where to put the results | File destFile; // where to put the results | ||||
@@ -261,7 +261,7 @@ public class Native2Ascii extends MatchingTask { | |||||
} | } | ||||
log("converting " + srcName, Project.MSG_VERBOSE); | log("converting " + srcName, Project.MSG_VERBOSE); | ||||
Native2AsciiAdapter ad = | |||||
Native2AsciiAdapter ad = | |||||
Native2AsciiAdapterFactory.getAdapter(facade.getImplementation(), | Native2AsciiAdapterFactory.getAdapter(facade.getImplementation(), | ||||
this); | this); | ||||
if (!ad.convert(this, srcFile, destFile)) { | if (!ad.convert(this, srcFile, destFile)) { | ||||
@@ -39,7 +39,7 @@ import org.apache.tools.ant.types.Mapper; | |||||
* | * | ||||
* @version 1.2 | * @version 1.2 | ||||
* | * | ||||
* @deprecated since 1.5.x. | |||||
* @deprecated since 1.5.x. | |||||
* Use <move> instead | * Use <move> instead | ||||
*/ | */ | ||||
public class RenameExtensions extends MatchingTask { | public class RenameExtensions extends MatchingTask { | ||||
@@ -210,7 +210,7 @@ public class ReplaceRegExp extends Task { | |||||
* each line, which is not easy to do when processing the file as a whole. | * each line, which is not easy to do when processing the file as a whole. | ||||
* Defaults to <i>false</i>.</td> | * Defaults to <i>false</i>.</td> | ||||
* @param byline the byline attribute as a string | * @param byline the byline attribute as a string | ||||
* @deprecated since 1.6.x. | |||||
* @deprecated since 1.6.x. | |||||
* Use setByLine(boolean). | * Use setByLine(boolean). | ||||
*/ | */ | ||||
public void setByLine(String byline) { | public void setByLine(String byline) { | ||||
@@ -183,7 +183,7 @@ public class Rpm extends Task { | |||||
log("Building the RPM based on the " + specFile + " file"); | log("Building the RPM based on the " + specFile + " file"); | ||||
int returncode = exe.execute(); | int returncode = exe.execute(); | ||||
if (Execute.isFailure(returncode)) { | if (Execute.isFailure(returncode)) { | ||||
String msg = "'" + toExecute.getExecutable() | |||||
String msg = "'" + toExecute.getExecutable() | |||||
+ "' failed with exit code " + returncode; | + "' failed with exit code " + returncode; | ||||
if (failOnError) { | if (failOnError) { | ||||
throw new BuildException(msg); | throw new BuildException(msg); | ||||
@@ -279,8 +279,8 @@ public class Rpm extends Task { | |||||
} | } | ||||
/** | /** | ||||
* If <code>true</code>, stop the build process when the rpmbuild command | |||||
* exits with an error status. | |||||
* If <code>true</code>, stop the build process when the rpmbuild command | |||||
* exits with an error status. | |||||
* @param value <code>true</code> if it should halt, otherwise | * @param value <code>true</code> if it should halt, otherwise | ||||
* <code>false</code>. The default is <code>false</code>. | * <code>false</code>. The default is <code>false</code>. | ||||
* | * | ||||
@@ -291,7 +291,7 @@ public class Rpm extends Task { | |||||
} | } | ||||
/** | /** | ||||
* If true, output from the RPM build command will only be logged to DEBUG. | |||||
* If true, output from the RPM build command will only be logged to DEBUG. | |||||
* @param value <code>false</code> if output should be logged, otherwise | * @param value <code>false</code> if output should be logged, otherwise | ||||
* <code>true</code>. The default is <code>false</code>. | * <code>true</code>. The default is <code>false</code>. | ||||
* | * | ||||
@@ -30,7 +30,7 @@ import org.apache.tools.ant.taskdefs.Java; | |||||
* and options are available. Do not set any apart from the <tt>classpath</tt> | * and options are available. Do not set any apart from the <tt>classpath</tt> | ||||
* as they are not guaranteed to be there in future. | * as they are not guaranteed to be there in future. | ||||
* @todo stop extending from Java. | * @todo stop extending from Java. | ||||
* @deprecated since 1.7. | |||||
* @deprecated since 1.7. | |||||
* This task is considered unsupported by the Ant developers | * This task is considered unsupported by the Ant developers | ||||
*/ | */ | ||||
public class StyleBook extends Java { | public class StyleBook extends Java { | ||||
@@ -63,7 +63,7 @@ public class StyleBook extends Java { | |||||
/** | /** | ||||
* Set the directory that contains the stylebook skin; | * Set the directory that contains the stylebook skin; | ||||
* required. | * required. | ||||
* @param skinDirectory the location of the stylebook skin | |||||
* @param skinDirectory the location of the stylebook skin | |||||
*/ | */ | ||||
public void setSkinDirectory(final File skinDirectory) { | public void setSkinDirectory(final File skinDirectory) { | ||||
m_skinDirectory = skinDirectory; | m_skinDirectory = skinDirectory; | ||||
@@ -337,7 +337,8 @@ public class TraXLiaison implements XSLTLiaison3, ErrorListener, XSLTLoggerAware | |||||
* Sets the paramters for the transformer. | * Sets the paramters for the transformer. | ||||
*/ | */ | ||||
private void setTransformationParameters() { | private void setTransformationParameters() { | ||||
for (final Enumeration enumeration = params.keys(); enumeration.hasMoreElements(); ) { | |||||
for (final Enumeration enumeration = params.keys(); | |||||
enumeration.hasMoreElements();) { | |||||
final String name = (String) enumeration.nextElement(); | final String name = (String) enumeration.nextElement(); | ||||
final String value = (String) params.get(name); | final String value = (String) params.get(name); | ||||
transformer.setParameter(name, value); | transformer.setParameter(name, value); | ||||
@@ -565,4 +566,4 @@ public class TraXLiaison implements XSLTLiaison3, ErrorListener, XSLTLoggerAware | |||||
setOutputProperty(prop.getName(), prop.getValue()); | setOutputProperty(prop.getName(), prop.getValue()); | ||||
} | } | ||||
} | } | ||||
} | |||||
} |
@@ -914,8 +914,12 @@ public abstract class DotnetCompile | |||||
while (files.hasMoreElements()) { | while (files.hasMoreElements()) { | ||||
File file = (File) files.nextElement(); | File file = (File) files.nextElement(); | ||||
if (isFileManagedBinary(file)) { | if (isFileManagedBinary(file)) { | ||||
if (isWindows) command.addArgument('"'+REFERENCE_OPTION+file.toString()+'"'); | |||||
else command.addArgument(REFERENCE_OPTION+file.toString()); | |||||
if (isWindows) { | |||||
command.addArgument( | |||||
'"' + REFERENCE_OPTION + file.toString() + '"'); | |||||
} else { | |||||
command.addArgument(REFERENCE_OPTION + file.toString()); | |||||
} | |||||
} else { | } else { | ||||
log("ignoring " + file + " as it is not a managed executable", | log("ignoring " + file + " as it is not a managed executable", | ||||
Project.MSG_VERBOSE); | Project.MSG_VERBOSE); | ||||
@@ -68,7 +68,7 @@ public class DotnetResource { | |||||
/** | /** | ||||
* embed the resource in the assembly (default, true) or just link to it. | * embed the resource in the assembly (default, true) or just link to it. | ||||
* | |||||
* | |||||
* @param embed | * @param embed | ||||
*/ | */ | ||||
public void setEmbed(boolean embed) { | public void setEmbed(boolean embed) { | ||||
@@ -81,7 +81,7 @@ public class DotnetResource { | |||||
/** | /** | ||||
* name the resource | * name the resource | ||||
* | |||||
* | |||||
* @param file | * @param file | ||||
*/ | */ | ||||
public void setFile(File file) { | public void setFile(File file) { | ||||
@@ -94,7 +94,7 @@ public class DotnetResource { | |||||
/** | /** | ||||
* VB and J# only: is a resource public or not? | * VB and J# only: is a resource public or not? | ||||
* | |||||
* | |||||
* @param aPublic | * @param aPublic | ||||
*/ | */ | ||||
public void setPublic(Boolean aPublic) { | public void setPublic(Boolean aPublic) { | ||||
@@ -107,7 +107,7 @@ public class DotnetResource { | |||||
/** | /** | ||||
* should the resource have a name? | * should the resource have a name? | ||||
* | |||||
* | |||||
* @param name | * @param name | ||||
*/ | */ | ||||
public void setName(String name) { | public void setName(String name) { | ||||
@@ -116,7 +116,7 @@ public class DotnetResource { | |||||
/** | /** | ||||
* Filesets root namespace. The value always ends with '.' . | * Filesets root namespace. The value always ends with '.' . | ||||
* | |||||
* | |||||
* @return String namespace name | * @return String namespace name | ||||
*/ | */ | ||||
public String getNamespace() { | public String getNamespace() { | ||||
@@ -125,7 +125,7 @@ public class DotnetResource { | |||||
/** | /** | ||||
* Sets filesets root namespace. | * Sets filesets root namespace. | ||||
* | |||||
* | |||||
* @param namespace | * @param namespace | ||||
* String root namespace | * String root namespace | ||||
*/ | */ | ||||
@@ -206,7 +206,7 @@ public class DotnetResource { | |||||
/** | /** | ||||
* Adds a resource file set. | * Adds a resource file set. | ||||
* | |||||
* | |||||
* @param fileset | * @param fileset | ||||
* FileSet | * FileSet | ||||
*/ | */ | ||||
@@ -216,10 +216,10 @@ public class DotnetResource { | |||||
/** | /** | ||||
* Checks that <resource> node has embedded <filesets> | * Checks that <resource> node has embedded <filesets> | ||||
* | |||||
* | |||||
* @return boolean | * @return boolean | ||||
*/ | */ | ||||
public boolean hasFilesets() { | public boolean hasFilesets() { | ||||
return fileSets.size() > 0; | return fileSets.size() > 0; | ||||
} | } | ||||
} | |||||
} |
@@ -60,7 +60,7 @@ import java.io.File; | |||||
public class Ildasm extends Task { | public class Ildasm extends Task { | ||||
private static final FileUtils FILE_UTILS = FileUtils.getFileUtils(); | private static final FileUtils FILE_UTILS = FileUtils.getFileUtils(); | ||||
/** | /** | ||||
* source file (mandatory) | * source file (mandatory) | ||||
*/ | */ | ||||
@@ -25,11 +25,11 @@ package org.apache.tools.ant.taskdefs.optional.extension; | |||||
* "1.2.3.4.5.6.7". This allows an extensible number to be used to | * "1.2.3.4.5.6.7". This allows an extensible number to be used to | ||||
* represent major, minor, micro, etc versions. The version number | * represent major, minor, micro, etc versions. The version number | ||||
* must begin with a number. | * must begin with a number. | ||||
* | |||||
* | |||||
* Original Implementation moved to org.apache.tools.ant.util.DeweyDecimal | * Original Implementation moved to org.apache.tools.ant.util.DeweyDecimal | ||||
*/ | */ | ||||
public final class DeweyDecimal extends org.apache.tools.ant.util.DeweyDecimal { | public final class DeweyDecimal extends org.apache.tools.ant.util.DeweyDecimal { | ||||
/** | /** | ||||
* Construct a DeweyDecimal from an array of integer components. | * Construct a DeweyDecimal from an array of integer components. | ||||
* | * | ||||
@@ -156,7 +156,7 @@ public class JarLibResolveTask extends Task { | |||||
final String message = "Property Already set to: " + candidate; | final String message = "Property Already set to: " + candidate; | ||||
if (failOnError) { | if (failOnError) { | ||||
throw new BuildException(message); | throw new BuildException(message); | ||||
} | |||||
} | |||||
getProject().log(message, Project.MSG_ERR); | getProject().log(message, Project.MSG_ERR); | ||||
return; | return; | ||||
} | } | ||||
@@ -282,4 +282,4 @@ public class JarLibResolveTask extends Task { | |||||
throw new BuildException(message); | throw new BuildException(message); | ||||
} | } | ||||
} | } | ||||
} | |||||
} |
@@ -39,9 +39,9 @@ import org.apache.tools.ant.util.StringUtils; | |||||
* | * | ||||
*/ | */ | ||||
public final class Specification { | public final class Specification { | ||||
private static final String MISSING = "Missing "; | private static final String MISSING = "Missing "; | ||||
/** | /** | ||||
* Manifest Attribute Name object for SPECIFICATION_TITLE. | * Manifest Attribute Name object for SPECIFICATION_TITLE. | ||||
*/ | */ | ||||
@@ -325,7 +325,7 @@ public final class Specification { | |||||
public String[] getSections() { | public String[] getSections() { | ||||
if (null == sections) { | if (null == sections) { | ||||
return null; | return null; | ||||
} | |||||
} | |||||
final String[] newSections = new String[ sections.length ]; | final String[] newSections = new String[ sections.length ]; | ||||
System.arraycopy(sections, 0, newSections, 0, sections.length); | System.arraycopy(sections, 0, newSections, 0, sections.length); | ||||
return newSections; | return newSections; | ||||
@@ -526,10 +526,10 @@ public final class Specification { | |||||
return specification; | return specification; | ||||
} | } | ||||
sectionsToAdd.addAll(Arrays.asList(specification.getSections())); | sectionsToAdd.addAll(Arrays.asList(specification.getSections())); | ||||
final String[] sections = | final String[] sections = | ||||
(String[]) sectionsToAdd.toArray(new String[sectionsToAdd.size()]); | (String[]) sectionsToAdd.toArray(new String[sectionsToAdd.size()]); | ||||
return new Specification(specification.getSpecificationTitle(), | return new Specification(specification.getSpecificationTitle(), | ||||
specification.getSpecificationVersion().toString(), | specification.getSpecificationVersion().toString(), | ||||
specification.getSpecificationVendor(), | specification.getSpecificationVendor(), | ||||
@@ -54,8 +54,8 @@ public class SunJavah implements JavahAdapter { | |||||
c = Class.forName("com.sun.tools.javah.Main"); | c = Class.forName("com.sun.tools.javah.Main"); | ||||
} | } | ||||
} catch (ClassNotFoundException ex) { | } catch (ClassNotFoundException ex) { | ||||
throw new BuildException("Can't load javah", ex, | |||||
javah.getLocation()); | |||||
throw new BuildException( | |||||
"Can't load javah", ex, javah.getLocation()); | |||||
} | } | ||||
cmd.setExecutable(c.getName()); | cmd.setExecutable(c.getName()); | ||||
ej.setJavaCommand(cmd); | ej.setJavaCommand(cmd); | ||||
@@ -94,8 +94,8 @@ public class SunJavah implements JavahAdapter { | |||||
cmd.createArgument().setValue("-force"); | cmd.createArgument().setValue("-force"); | ||||
} | } | ||||
if (javah.getStubs() && !javah.getOld()) { | if (javah.getStubs() && !javah.getOld()) { | ||||
throw new BuildException("stubs only available in old mode.", | |||||
javah.getLocation()); | |||||
throw new BuildException( | |||||
"stubs only available in old mode.", javah.getLocation()); | |||||
} | } | ||||
if (javah.getStubs()) { | if (javah.getStubs()) { | ||||
@@ -948,8 +948,9 @@ public class JUnitTask extends Task { | |||||
+ String.valueOf(showOutput)); | + String.valueOf(showOutput)); | ||||
cmd.createArgument().setValue(Constants.OUTPUT_TO_FORMATTERS | cmd.createArgument().setValue(Constants.OUTPUT_TO_FORMATTERS | ||||
+ String.valueOf(outputToFormatters)); | + String.valueOf(outputToFormatters)); | ||||
cmd.createArgument().setValue(Constants.LOGTESTLISTENEREVENTS+"true"); // #31885 | |||||
cmd.createArgument().setValue( | |||||
Constants.LOGTESTLISTENEREVENTS + "true"); // #31885 | |||||
StringBuffer formatterArg = new StringBuffer(STRING_BUFFER_SIZE); | StringBuffer formatterArg = new StringBuffer(STRING_BUFFER_SIZE); | ||||
final FormatterElement[] feArray = mergeFormatters(test); | final FormatterElement[] feArray = mergeFormatters(test); | ||||
@@ -34,16 +34,15 @@ import org.apache.tools.ant.types.Permissions; | |||||
* - JUnitTestRunner | * - JUnitTestRunner | ||||
* Cf. JUnitTask.SplitLoader#isSplit(String) | * Cf. JUnitTask.SplitLoader#isSplit(String) | ||||
* Public only to permit access from classes in this package; do not use directly. | * Public only to permit access from classes in this package; do not use directly. | ||||
* | |||||
* | |||||
* @since 1.7 | * @since 1.7 | ||||
* @see "bug #38799" | * @see "bug #38799" | ||||
*/ | */ | ||||
public interface JUnitTaskMirror { | public interface JUnitTaskMirror { | ||||
void addVmExit(JUnitTest test, JUnitResultFormatterMirror formatter, | void addVmExit(JUnitTest test, JUnitResultFormatterMirror formatter, | ||||
OutputStream out, String message, String testCase); | OutputStream out, String message, String testCase); | ||||
JUnitTestRunnerMirror newJUnitTestRunner(JUnitTest test, boolean haltOnError, | JUnitTestRunnerMirror newJUnitTestRunner(JUnitTest test, boolean haltOnError, | ||||
boolean filterTrace, boolean haltOnFailure, boolean showOutput, | boolean filterTrace, boolean haltOnFailure, boolean showOutput, | ||||
boolean logTestListenerEvents, AntClassLoader classLoader); | boolean logTestListenerEvents, AntClassLoader classLoader); | ||||
@@ -77,7 +76,7 @@ public interface JUnitTaskMirror { | |||||
* No problems with this test. | * No problems with this test. | ||||
*/ | */ | ||||
int SUCCESS = 0; | int SUCCESS = 0; | ||||
/** | /** | ||||
* Some tests failed. | * Some tests failed. | ||||
*/ | */ | ||||
@@ -89,23 +88,22 @@ public interface JUnitTaskMirror { | |||||
int ERRORS = 2; | int ERRORS = 2; | ||||
void setPermissions(Permissions perm); | void setPermissions(Permissions perm); | ||||
void run(); | void run(); | ||||
void addFormatter(JUnitResultFormatterMirror formatter); | void addFormatter(JUnitResultFormatterMirror formatter); | ||||
int getRetCode(); | int getRetCode(); | ||||
void handleErrorFlush(String output); | void handleErrorFlush(String output); | ||||
void handleErrorOutput(String output); | void handleErrorOutput(String output); | ||||
void handleOutput(String output); | void handleOutput(String output); | ||||
int handleInput(byte[] buffer, int offset, int length) throws IOException; | int handleInput(byte[] buffer, int offset, int length) throws IOException; | ||||
void handleFlush(String output); | void handleFlush(String output); | ||||
} | } | ||||
} | } |
@@ -93,7 +93,7 @@ public final class JUnitTaskMirrorImpl implements JUnitTaskMirror { | |||||
} | } | ||||
public String toString() { | public String toString() { | ||||
return test.getName()+":"+testCase; | |||||
return test.getName() + ":" + testCase; | |||||
} | } | ||||
} | } | ||||
} | } |
@@ -188,7 +188,7 @@ public class JUnitTestRunner implements TestListener, JUnitTaskMirror.JUnitTestR | |||||
public JUnitTestRunner(JUnitTest test, boolean haltOnError, | public JUnitTestRunner(JUnitTest test, boolean haltOnError, | ||||
boolean filtertrace, boolean haltOnFailure, | boolean filtertrace, boolean haltOnFailure, | ||||
boolean showOutput, boolean logTestListenerEvents) { | boolean showOutput, boolean logTestListenerEvents) { | ||||
this(test, haltOnError, filtertrace, haltOnFailure, showOutput, | |||||
this(test, haltOnError, filtertrace, haltOnFailure, showOutput, | |||||
logTestListenerEvents, null); | logTestListenerEvents, null); | ||||
} | } | ||||
@@ -207,7 +207,7 @@ public class JUnitTestRunner implements TestListener, JUnitTaskMirror.JUnitTestR | |||||
public JUnitTestRunner(JUnitTest test, boolean haltOnError, | public JUnitTestRunner(JUnitTest test, boolean haltOnError, | ||||
boolean filtertrace, boolean haltOnFailure, | boolean filtertrace, boolean haltOnFailure, | ||||
boolean showOutput, ClassLoader loader) { | boolean showOutput, ClassLoader loader) { | ||||
this(test, haltOnError, filtertrace, haltOnFailure, showOutput, | |||||
this(test, haltOnError, filtertrace, haltOnFailure, showOutput, | |||||
false, loader); | false, loader); | ||||
} | } | ||||
@@ -253,12 +253,14 @@ public class JUnitTestRunner implements TestListener, JUnitTaskMirror.JUnitTestR | |||||
System.setOut( | System.setOut( | ||||
new PrintStream( | new PrintStream( | ||||
new OutputStream() { | new OutputStream() { | ||||
public void write(int b) {} | |||||
public void write(int b) { | |||||
} | |||||
})); | })); | ||||
System.setErr( | System.setErr( | ||||
new PrintStream( | new PrintStream( | ||||
new OutputStream() { | new OutputStream() { | ||||
public void write(int b) {} | |||||
public void write(int b) { | |||||
} | |||||
})); | })); | ||||
} | } | ||||
} else { | } else { | ||||
@@ -369,7 +371,7 @@ public class JUnitTestRunner implements TestListener, JUnitTaskMirror.JUnitTestR | |||||
long start = System.currentTimeMillis(); | long start = System.currentTimeMillis(); | ||||
fireStartTestSuite(); | fireStartTestSuite(); | ||||
startTestSuiteSuccess = true; | |||||
startTestSuiteSuccess = true; | |||||
if (exception != null) { // had an exception constructing suite | if (exception != null) { // had an exception constructing suite | ||||
for (int i = 0; i < formatters.size(); i++) { | for (int i = 0; i < formatters.size(); i++) { | ||||
((TestListener) formatters.elementAt(i)) | ((TestListener) formatters.elementAt(i)) | ||||
@@ -900,7 +902,7 @@ public class JUnitTestRunner implements TestListener, JUnitTaskMirror.JUnitTestR | |||||
// We would prefer to show "failure" for things that logically are. | // We would prefer to show "failure" for things that logically are. | ||||
try { | try { | ||||
String msg = t.getMessage(); | String msg = t.getMessage(); | ||||
AssertionFailedError failure = msg != null | |||||
AssertionFailedError failure = msg != null | |||||
? new AssertionFailedError(msg) : new AssertionFailedError(); | ? new AssertionFailedError(msg) : new AssertionFailedError(); | ||||
// To compile on pre-JDK 4 (even though this should always succeed): | // To compile on pre-JDK 4 (even though this should always succeed): | ||||
Method initCause = Throwable.class.getMethod("initCause", new Class[] {Throwable.class}); | Method initCause = Throwable.class.getMethod("initCause", new Class[] {Throwable.class}); | ||||
@@ -245,9 +245,10 @@ public class XMLResultAggregator extends Task implements XMLConstants { | |||||
File file = files[i]; | File file = files[i]; | ||||
try { | try { | ||||
log("Parsing file: '" + file + "'", Project.MSG_VERBOSE); | log("Parsing file: '" + file + "'", Project.MSG_VERBOSE); | ||||
if(file.length()>0) { | |||||
if (file.length() > 0) { | |||||
Document testsuiteDoc | Document testsuiteDoc | ||||
= builder.parse(FileUtils.getFileUtils().toURI(files[i].getAbsolutePath())); | |||||
= builder.parse( | |||||
FileUtils.getFileUtils().toURI(files[i].getAbsolutePath())); | |||||
Element elem = testsuiteDoc.getDocumentElement(); | Element elem = testsuiteDoc.getDocumentElement(); | ||||
// make sure that this is REALLY a testsuite. | // make sure that this is REALLY a testsuite. | ||||
if (TESTSUITE.equals(elem.getNodeName())) { | if (TESTSUITE.equals(elem.getNodeName())) { | ||||
@@ -47,7 +47,7 @@ public abstract class DefaultNative2Ascii implements Native2AsciiAdapter { | |||||
addFiles(cmd, args, srcFile, destFile); | addFiles(cmd, args, srcFile, destFile); | ||||
return run(cmd, args); | return run(cmd, args); | ||||
} | } | ||||
/** | /** | ||||
* Sets up the initial command line. | * Sets up the initial command line. | ||||
* | * | ||||
@@ -93,4 +93,4 @@ public abstract class DefaultNative2Ascii implements Native2AsciiAdapter { | |||||
*/ | */ | ||||
protected abstract boolean run(Commandline cmd, ProjectComponent log) | protected abstract boolean run(Commandline cmd, ProjectComponent log) | ||||
throws BuildException; | throws BuildException; | ||||
} | |||||
} |
@@ -79,10 +79,9 @@ public class Native2AsciiAdapterFactory { | |||||
* isn't an instance of Native2AsciiAdapter. | * isn't an instance of Native2AsciiAdapter. | ||||
*/ | */ | ||||
private static Native2AsciiAdapter resolveClassName(String className) | private static Native2AsciiAdapter resolveClassName(String className) | ||||
throws BuildException | |||||
{ | |||||
throws BuildException { | |||||
return (Native2AsciiAdapter) ClasspathUtils.newInstance(className, | return (Native2AsciiAdapter) ClasspathUtils.newInstance(className, | ||||
Native2AsciiAdapterFactory.class.getClassLoader(), | |||||
Native2AsciiAdapterFactory.class.getClassLoader(), | |||||
Native2AsciiAdapter.class); | Native2AsciiAdapter.class); | ||||
} | } | ||||
} | |||||
} |
@@ -54,7 +54,7 @@ public final class SunNative2Ascii extends DefaultNative2Ascii { | |||||
+ "sun.tools.native2ascii.Main"); | + "sun.tools.native2ascii.Main"); | ||||
} | } | ||||
Object o = n2aMain.newInstance(); | Object o = n2aMain.newInstance(); | ||||
return ((Boolean) convert.invoke(o, | |||||
return ((Boolean) convert.invoke(o, | |||||
new Object[] {cmd.getArguments()}) | new Object[] {cmd.getArguments()}) | ||||
).booleanValue(); | ).booleanValue(); | ||||
} catch (BuildException ex) { | } catch (BuildException ex) { | ||||
@@ -65,4 +65,4 @@ public final class SunNative2Ascii extends DefaultNative2Ascii { | |||||
throw new BuildException("Error starting Sun's native2ascii: ", ex); | throw new BuildException("Error starting Sun's native2ascii: ", ex); | ||||
} | } | ||||
} | } | ||||
} | |||||
} |
@@ -901,7 +901,7 @@ public class FTP | |||||
} | } | ||||
public String toString() { | public String toString() { | ||||
return "AntFtpFile: "+curpwd+"%"+ftpFile; | |||||
return "AntFtpFile: " + curpwd + "%" + ftpFile; | |||||
} | } | ||||
} | } | ||||
/** | /** | ||||
@@ -1058,10 +1058,10 @@ public class FTP | |||||
public void setPassword(String password) { | public void setPassword(String password) { | ||||
this.password = password; | this.password = password; | ||||
} | } | ||||
/** | /** | ||||
* Sets the login account to use on the specified server. | * Sets the login account to use on the specified server. | ||||
* | |||||
* | |||||
* @param pAccount the account name on remote system | * @param pAccount the account name on remote system | ||||
* @since Ant 1.7 | * @since Ant 1.7 | ||||
*/ | */ | ||||
@@ -1215,7 +1215,7 @@ public class FTP | |||||
* Sets the FTP action to be taken. Currently accepts "put", "get", "del", | * Sets the FTP action to be taken. Currently accepts "put", "get", "del", | ||||
* "mkdir", "chmod", "list", and "site". | * "mkdir", "chmod", "list", and "site". | ||||
* | * | ||||
* @deprecated since 1.5.x. | |||||
* @deprecated since 1.5.x. | |||||
* setAction(String) is deprecated and is replaced with | * setAction(String) is deprecated and is replaced with | ||||
* setAction(FTP.Action) to make Ant's Introspection mechanism do the | * setAction(FTP.Action) to make Ant's Introspection mechanism do the | ||||
* work and also to encapsulate operations on the type in its own | * work and also to encapsulate operations on the type in its own | ||||
@@ -2307,7 +2307,7 @@ public class FTP | |||||
public void execute() throws IOException { | public void execute() throws IOException { | ||||
doSiteCommand(lftp, FTP.this.initialSiteCommand); | doSiteCommand(lftp, FTP.this.initialSiteCommand); | ||||
} | } | ||||
}, "initial site command: "+ this.initialSiteCommand); | |||||
}, "initial site command: " + this.initialSiteCommand); | |||||
} | } | ||||
@@ -2362,7 +2362,7 @@ public class FTP | |||||
} | } | ||||
} catch (IOException ex) { | } catch (IOException ex) { | ||||
throw new BuildException("error during FTP transfer: " + ex,ex); | |||||
throw new BuildException("error during FTP transfer: " + ex, ex); | |||||
} finally { | } finally { | ||||
if (ftp != null && ftp.isConnected()) { | if (ftp != null && ftp.isConnected()) { | ||||
try { | try { | ||||
@@ -22,9 +22,9 @@ import org.apache.tools.ant.Project; | |||||
/** | /** | ||||
* The sole purpose of this class is (note that it is package-private | * The sole purpose of this class is (note that it is package-private | ||||
* is to serve as a separate, static compilation unit for importing | |||||
* FTPClientConfig, to enable users who wish to use the FTP task | |||||
* without using its new features to avoid the need to | |||||
* is to serve as a separate, static compilation unit for importing | |||||
* FTPClientConfig, to enable users who wish to use the FTP task | |||||
* without using its new features to avoid the need to | |||||
* upgrade to jakarta-commons-net 1.4.0, where FTPClientConfig was | * upgrade to jakarta-commons-net 1.4.0, where FTPClientConfig was | ||||
* introduced. | * introduced. | ||||
*/ | */ | ||||
@@ -40,53 +40,52 @@ class FTPConfigurator { | |||||
static FTPClient configure(FTPClient client, FTP task) { | static FTPClient configure(FTPClient client, FTP task) { | ||||
task.log("custom configuration", Project.MSG_VERBOSE); | task.log("custom configuration", Project.MSG_VERBOSE); | ||||
FTPClientConfig config; | FTPClientConfig config; | ||||
String systemTypeKey = task.getSystemTypeKey(); | |||||
String systemTypeKey = task.getSystemTypeKey(); | |||||
if (systemTypeKey != null && !"".equals(systemTypeKey)) { | if (systemTypeKey != null && !"".equals(systemTypeKey)) { | ||||
config = new FTPClientConfig(systemTypeKey); | config = new FTPClientConfig(systemTypeKey); | ||||
task.log("custom config: system key = " | |||||
task.log("custom config: system key = " | |||||
+ systemTypeKey, Project.MSG_VERBOSE); | + systemTypeKey, Project.MSG_VERBOSE); | ||||
} else { | } else { | ||||
config = new FTPClientConfig(); | config = new FTPClientConfig(); | ||||
task.log("custom config: system key = default (UNIX)", | |||||
task.log("custom config: system key = default (UNIX)", | |||||
Project.MSG_VERBOSE); | Project.MSG_VERBOSE); | ||||
} | } | ||||
String defaultDateFormatConfig = task.getDefaultDateFormatConfig(); | String defaultDateFormatConfig = task.getDefaultDateFormatConfig(); | ||||
if (defaultDateFormatConfig != null) { | if (defaultDateFormatConfig != null) { | ||||
config.setDefaultDateFormatStr(defaultDateFormatConfig); | config.setDefaultDateFormatStr(defaultDateFormatConfig); | ||||
task.log("custom config: default date format = " | |||||
task.log("custom config: default date format = " | |||||
+ defaultDateFormatConfig, Project.MSG_VERBOSE); | + defaultDateFormatConfig, Project.MSG_VERBOSE); | ||||
} | } | ||||
String recentDateFormatConfig = task.getRecentDateFormatConfig(); | String recentDateFormatConfig = task.getRecentDateFormatConfig(); | ||||
if (recentDateFormatConfig != null) { | if (recentDateFormatConfig != null) { | ||||
config.setRecentDateFormatStr(recentDateFormatConfig); | config.setRecentDateFormatStr(recentDateFormatConfig); | ||||
task.log("custom config: recent date format = " | |||||
task.log("custom config: recent date format = " | |||||
+ recentDateFormatConfig, Project.MSG_VERBOSE); | + recentDateFormatConfig, Project.MSG_VERBOSE); | ||||
} | } | ||||
String serverLanguageCodeConfig = task.getServerLanguageCodeConfig(); | String serverLanguageCodeConfig = task.getServerLanguageCodeConfig(); | ||||
if (serverLanguageCodeConfig != null) { | if (serverLanguageCodeConfig != null) { | ||||
config.setServerLanguageCode(serverLanguageCodeConfig); | config.setServerLanguageCode(serverLanguageCodeConfig); | ||||
task.log("custom config: server language code = " | |||||
task.log("custom config: server language code = " | |||||
+ serverLanguageCodeConfig, Project.MSG_VERBOSE); | + serverLanguageCodeConfig, Project.MSG_VERBOSE); | ||||
} | } | ||||
String serverTimeZoneConfig = task.getServerTimeZoneConfig(); | String serverTimeZoneConfig = task.getServerTimeZoneConfig(); | ||||
if (serverTimeZoneConfig != null) { | if (serverTimeZoneConfig != null) { | ||||
config.setServerTimeZoneId(serverTimeZoneConfig); | config.setServerTimeZoneId(serverTimeZoneConfig); | ||||
task.log("custom config: server time zone ID = " | |||||
task.log("custom config: server time zone ID = " | |||||
+ serverTimeZoneConfig, Project.MSG_VERBOSE); | + serverTimeZoneConfig, Project.MSG_VERBOSE); | ||||
} | } | ||||
String shortMonthNamesConfig = task.getShortMonthNamesConfig(); | String shortMonthNamesConfig = task.getShortMonthNamesConfig(); | ||||
if (shortMonthNamesConfig != null) { | if (shortMonthNamesConfig != null) { | ||||
config.setShortMonthNames(shortMonthNamesConfig); | config.setShortMonthNames(shortMonthNamesConfig); | ||||
task.log("custom config: short month names = " | |||||
task.log("custom config: short month names = " | |||||
+ shortMonthNamesConfig, Project.MSG_VERBOSE); | + shortMonthNamesConfig, Project.MSG_VERBOSE); | ||||
} | } | ||||
client.configure(config); | client.configure(config); | ||||
return client; | return client; | ||||
} | } | ||||
} | } |
@@ -23,7 +23,7 @@ import org.apache.tools.ant.taskdefs.email.EmailTask; | |||||
/** | /** | ||||
* A task to send SMTP email; Use <tt>mail</tt> instead | * A task to send SMTP email; Use <tt>mail</tt> instead | ||||
* | * | ||||
* @deprecated since 1.6.x. | |||||
* @deprecated since 1.6.x. | |||||
* Use {@link EmailTask} instead. | * Use {@link EmailTask} instead. | ||||
* | * | ||||
* @since Ant1.4 | * @since Ant1.4 | ||||
@@ -296,11 +296,11 @@ public class ScriptDef extends DefBase { | |||||
* | * | ||||
* @param attributes collection of attributes | * @param attributes collection of attributes | ||||
* @param elements a list of nested element values. | * @param elements a list of nested element values. | ||||
* @deprecated since 1.7. | |||||
* @deprecated since 1.7. | |||||
* Use executeScript(attribute, elements, instance) instead. | * Use executeScript(attribute, elements, instance) instead. | ||||
*/ | */ | ||||
public void executeScript(Map attributes, Map elements) { | public void executeScript(Map attributes, Map elements) { | ||||
executeScript(attributes, elements,null); | |||||
executeScript(attributes, elements, null); | |||||
} | } | ||||
/** | /** | ||||
@@ -316,7 +316,7 @@ public class ScriptDef extends DefBase { | |||||
runner.addBean("attributes", attributes); | runner.addBean("attributes", attributes); | ||||
runner.addBean("elements", elements); | runner.addBean("elements", elements); | ||||
runner.addBean("project", getProject()); | runner.addBean("project", getProject()); | ||||
if(instance!=null) { | |||||
if (instance != null) { | |||||
runner.addBean("self", instance); | runner.addBean("self", instance); | ||||
} | } | ||||
runner.executeScript("scriptdef_" + name); | runner.executeScript("scriptdef_" + name); | ||||
@@ -39,7 +39,7 @@ public class ScriptDefBase extends Task implements DynamicConfigurator { | |||||
/** Attributes */ | /** Attributes */ | ||||
private Map attributes = new HashMap(); | private Map attributes = new HashMap(); | ||||
private String text; | private String text; | ||||
/** | /** | ||||
@@ -105,7 +105,7 @@ public class ScriptDefBase extends Task implements DynamicConfigurator { | |||||
* @since ant1.7 | * @since ant1.7 | ||||
*/ | */ | ||||
public void addText(String text) { | public void addText(String text) { | ||||
this.text=getProject().replaceProperties(text); | |||||
this.text = getProject().replaceProperties(text); | |||||
} | } | ||||
/** | /** | ||||
@@ -62,7 +62,7 @@ public class SplashTask extends Task { | |||||
* flag to enable proxy settings; optional, deprecated : consider | * flag to enable proxy settings; optional, deprecated : consider | ||||
* using <setproxy> instead | * using <setproxy> instead | ||||
* @param useProxy if ture, enable proxy settings | * @param useProxy if ture, enable proxy settings | ||||
* @deprecated since 1.5.x. | |||||
* @deprecated since 1.5.x. | |||||
* Use org.apache.tools.ant.taskdefs.optional.SetProxy | * Use org.apache.tools.ant.taskdefs.optional.SetProxy | ||||
*/ | */ | ||||
public void setUseproxy(boolean useProxy) { | public void setUseproxy(boolean useProxy) { | ||||
@@ -251,8 +251,8 @@ public abstract class AbstractSshMessage { | |||||
public boolean count(long len) { | public boolean count(long len) { | ||||
totalLength += len; | totalLength += len; | ||||
percentTransmitted = trackProgress(initFileSize, | |||||
totalLength, | |||||
percentTransmitted = trackProgress(initFileSize, | |||||
totalLength, | |||||
percentTransmitted); | percentTransmitted); | ||||
return true; | return true; | ||||
} | } | ||||
@@ -261,7 +261,7 @@ public abstract class AbstractSshMessage { | |||||
} | } | ||||
public long getTotalLength() { | public long getTotalLength() { | ||||
return totalLength; | |||||
return totalLength; | |||||
} | } | ||||
} | } | ||||
} | } |
@@ -189,7 +189,7 @@ public class SSHUserInfo implements UserInfo, UIKeyboardInteractive { | |||||
public void showMessage(String message) { | public void showMessage(String message) { | ||||
//log(message, Project.MSG_DEBUG); | //log(message, Project.MSG_DEBUG); | ||||
} | } | ||||
public String[] promptKeyboardInteractive(String destination, | public String[] promptKeyboardInteractive(String destination, | ||||
String name, | String name, | ||||
String instruction, | String instruction, | ||||
@@ -198,8 +198,8 @@ public class SSHUserInfo implements UserInfo, UIKeyboardInteractive { | |||||
if (prompt.length != 1 || echo[0] != false || this.password == null) { | if (prompt.length != 1 || echo[0] != false || this.password == null) { | ||||
return null; | return null; | ||||
} | } | ||||
String[] response=new String[1]; | |||||
response[0]=this.password; | |||||
String[] response = new String[1]; | |||||
response[0] = this.password; | |||||
return response; | return response; | ||||
} | } | ||||
@@ -216,7 +216,7 @@ public class ScpFromMessage extends AbstractSshMessage { | |||||
try { | try { | ||||
while (true) { | while (true) { | ||||
length = in.read(buf, 0, | length = in.read(buf, 0, | ||||
(BUFFER_SIZE < filesize) ? BUFFER_SIZE | |||||
(BUFFER_SIZE < filesize) ? BUFFER_SIZE | |||||
: (int) filesize); | : (int) filesize); | ||||
if (length < 0) { | if (length < 0) { | ||||
throw new EOFException("Unexpected end of stream."); | throw new EOFException("Unexpected end of stream."); | ||||
@@ -127,8 +127,8 @@ public class ScpFromMessageBySftp extends ScpFromMessage { | |||||
if (name.equals(".") || name.equals("..")) { | if (name.equals(".") || name.equals("..")) { | ||||
continue; | continue; | ||||
} | } | ||||
getDir(channel, | |||||
channel.pwd() + "/" + name + "/", | |||||
getDir(channel, | |||||
channel.pwd() + "/" + name + "/", | |||||
new File(localFile, le.getFilename())); | new File(localFile, le.getFilename())); | ||||
} else{ | } else{ | ||||
getFile(channel, le, localFile); | getFile(channel, le, localFile); | ||||
@@ -137,7 +137,7 @@ public class ScpFromMessageBySftp extends ScpFromMessage { | |||||
channel.cd(".."); | channel.cd(".."); | ||||
} | } | ||||
private void getFile(ChannelSftp channel, | |||||
private void getFile(ChannelSftp channel, | |||||
ChannelSftp.LsEntry le, | ChannelSftp.LsEntry le, | ||||
File localFile) throws IOException, SftpException { | File localFile) throws IOException, SftpException { | ||||
String remoteFile = le.getFilename(); | String remoteFile = le.getFilename(); | ||||
@@ -185,7 +185,7 @@ public class ScpToMessageBySftp extends ScpToMessage/*AbstractSshMessage*/ { | |||||
try{ | try{ | ||||
channel.stat(dir); | channel.stat(dir); | ||||
} | } | ||||
catch(SftpException e){ | |||||
catch (SftpException e) { | |||||
// dir does not exist. | // dir does not exist. | ||||
if (e.id==ChannelSftp.SSH_FX_NO_SUCH_FILE) { | if (e.id==ChannelSftp.SSH_FX_NO_SUCH_FILE) { | ||||
channel.mkdir(dir); | channel.mkdir(dir); | ||||
@@ -462,7 +462,7 @@ public abstract class TreeBasedTask extends StarTeamTask { | |||||
protected boolean isUsingViewLabel() { | protected boolean isUsingViewLabel() { | ||||
return null != this.labelInUse && this.labelInUse.isViewLabel(); | return null != this.labelInUse && this.labelInUse.isViewLabel(); | ||||
} | } | ||||
/** | /** | ||||
* returns true if a label has been specified and it is a revision label. | * returns true if a label has been specified and it is a revision label. | ||||
* | * | ||||
@@ -263,7 +263,7 @@ public class Symlink extends DispatchTask { | |||||
File dir = (File) dirs.next(); | File dir = (File) dirs.next(); | ||||
Vector linksInDir = (Vector) byDir.get(dir); | Vector linksInDir = (Vector) byDir.get(dir); | ||||
Properties linksToStore = new Properties(); | Properties linksToStore = new Properties(); | ||||
// fill up a Properties object with link and resource names: | // fill up a Properties object with link and resource names: | ||||
for (Iterator dlnk = linksInDir.iterator(); dlnk.hasNext();) { | for (Iterator dlnk = linksInDir.iterator(); dlnk.hasNext();) { | ||||
File lnk = (File) dlnk.next(); | File lnk = (File) dlnk.next(); | ||||