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