Browse Source

checkstyle

git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@471554 13f79535-47bb-0310-9956-ffa450edef68
master
Peter Reilly 18 years ago
parent
commit
231e1c4688
35 changed files with 120 additions and 115 deletions
  1. +2
    -2
      src/main/org/apache/tools/ant/taskdefs/optional/Javah.java
  2. +3
    -3
      src/main/org/apache/tools/ant/taskdefs/optional/Native2Ascii.java
  3. +1
    -1
      src/main/org/apache/tools/ant/taskdefs/optional/RenameExtensions.java
  4. +1
    -1
      src/main/org/apache/tools/ant/taskdefs/optional/ReplaceRegExp.java
  5. +4
    -4
      src/main/org/apache/tools/ant/taskdefs/optional/Rpm.java
  6. +2
    -2
      src/main/org/apache/tools/ant/taskdefs/optional/StyleBook.java
  7. +3
    -2
      src/main/org/apache/tools/ant/taskdefs/optional/TraXLiaison.java
  8. +6
    -2
      src/main/org/apache/tools/ant/taskdefs/optional/dotnet/DotnetCompile.java
  9. +9
    -9
      src/main/org/apache/tools/ant/taskdefs/optional/dotnet/DotnetResource.java
  10. +1
    -1
      src/main/org/apache/tools/ant/taskdefs/optional/dotnet/Ildasm.java
  11. +2
    -2
      src/main/org/apache/tools/ant/taskdefs/optional/extension/DeweyDecimal.java
  12. +2
    -2
      src/main/org/apache/tools/ant/taskdefs/optional/extension/JarLibResolveTask.java
  13. +5
    -5
      src/main/org/apache/tools/ant/taskdefs/optional/extension/Specification.java
  14. +4
    -4
      src/main/org/apache/tools/ant/taskdefs/optional/javah/SunJavah.java
  15. +3
    -2
      src/main/org/apache/tools/ant/taskdefs/optional/junit/JUnitTask.java
  16. +11
    -13
      src/main/org/apache/tools/ant/taskdefs/optional/junit/JUnitTaskMirror.java
  17. +1
    -1
      src/main/org/apache/tools/ant/taskdefs/optional/junit/JUnitTaskMirrorImpl.java
  18. +8
    -6
      src/main/org/apache/tools/ant/taskdefs/optional/junit/JUnitTestRunner.java
  19. +3
    -2
      src/main/org/apache/tools/ant/taskdefs/optional/junit/XMLResultAggregator.java
  20. +2
    -2
      src/main/org/apache/tools/ant/taskdefs/optional/native2ascii/DefaultNative2Ascii.java
  21. +3
    -4
      src/main/org/apache/tools/ant/taskdefs/optional/native2ascii/Native2AsciiAdapterFactory.java
  22. +2
    -2
      src/main/org/apache/tools/ant/taskdefs/optional/native2ascii/SunNative2Ascii.java
  23. +6
    -6
      src/main/org/apache/tools/ant/taskdefs/optional/net/FTP.java
  24. +16
    -17
      src/main/org/apache/tools/ant/taskdefs/optional/net/FTPConfigurator.java
  25. +1
    -1
      src/main/org/apache/tools/ant/taskdefs/optional/net/MimeMail.java
  26. +3
    -3
      src/main/org/apache/tools/ant/taskdefs/optional/script/ScriptDef.java
  27. +2
    -2
      src/main/org/apache/tools/ant/taskdefs/optional/script/ScriptDefBase.java
  28. +1
    -1
      src/main/org/apache/tools/ant/taskdefs/optional/splash/SplashTask.java
  29. +3
    -3
      src/main/org/apache/tools/ant/taskdefs/optional/ssh/AbstractSshMessage.java
  30. +3
    -3
      src/main/org/apache/tools/ant/taskdefs/optional/ssh/SSHUserInfo.java
  31. +1
    -1
      src/main/org/apache/tools/ant/taskdefs/optional/ssh/ScpFromMessage.java
  32. +3
    -3
      src/main/org/apache/tools/ant/taskdefs/optional/ssh/ScpFromMessageBySftp.java
  33. +1
    -1
      src/main/org/apache/tools/ant/taskdefs/optional/ssh/ScpToMessageBySftp.java
  34. +1
    -1
      src/main/org/apache/tools/ant/taskdefs/optional/starteam/TreeBasedTask.java
  35. +1
    -1
      src/main/org/apache/tools/ant/taskdefs/optional/unix/Symlink.java

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

@@ -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)) {


+ 3
- 3
src/main/org/apache/tools/ant/taskdefs/optional/Native2Ascii.java View File

@@ -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)) {


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

@@ -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 {


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

@@ -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) {


+ 4
- 4
src/main/org/apache/tools/ant/taskdefs/optional/Rpm.java View File

@@ -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>.
*


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

@@ -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;


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

@@ -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());
}
}
}
}

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

@@ -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);


+ 9
- 9
src/main/org/apache/tools/ant/taskdefs/optional/dotnet/DotnetResource.java View File

@@ -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;
}
}
}

+ 1
- 1
src/main/org/apache/tools/ant/taskdefs/optional/dotnet/Ildasm.java View File

@@ -60,7 +60,7 @@ import java.io.File;
public class Ildasm extends Task {

private static final FileUtils FILE_UTILS = FileUtils.getFileUtils();
/**
* source file (mandatory)
*/


+ 2
- 2
src/main/org/apache/tools/ant/taskdefs/optional/extension/DeweyDecimal.java View File

@@ -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.
*


+ 2
- 2
src/main/org/apache/tools/ant/taskdefs/optional/extension/JarLibResolveTask.java View File

@@ -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);
}
}
}
}

+ 5
- 5
src/main/org/apache/tools/ant/taskdefs/optional/extension/Specification.java View File

@@ -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(),


+ 4
- 4
src/main/org/apache/tools/ant/taskdefs/optional/javah/SunJavah.java View File

@@ -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()) {


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

@@ -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);


+ 11
- 13
src/main/org/apache/tools/ant/taskdefs/optional/junit/JUnitTaskMirror.java View File

@@ -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);

}
}

+ 1
- 1
src/main/org/apache/tools/ant/taskdefs/optional/junit/JUnitTaskMirrorImpl.java View File

@@ -93,7 +93,7 @@ public final class JUnitTaskMirrorImpl implements JUnitTaskMirror {
}

public String toString() {
return test.getName()+":"+testCase;
return test.getName() + ":" + testCase;
}
}
}

+ 8
- 6
src/main/org/apache/tools/ant/taskdefs/optional/junit/JUnitTestRunner.java View File

@@ -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});


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

@@ -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())) {


+ 2
- 2
src/main/org/apache/tools/ant/taskdefs/optional/native2ascii/DefaultNative2Ascii.java View File

@@ -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;
}
}

+ 3
- 4
src/main/org/apache/tools/ant/taskdefs/optional/native2ascii/Native2AsciiAdapterFactory.java View File

@@ -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);
}
}
}

+ 2
- 2
src/main/org/apache/tools/ant/taskdefs/optional/native2ascii/SunNative2Ascii.java View File

@@ -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);
}
}
}
}

+ 6
- 6
src/main/org/apache/tools/ant/taskdefs/optional/net/FTP.java View File

@@ -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 {


+ 16
- 17
src/main/org/apache/tools/ant/taskdefs/optional/net/FTPConfigurator.java View File

@@ -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;
}
}

+ 1
- 1
src/main/org/apache/tools/ant/taskdefs/optional/net/MimeMail.java View File

@@ -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


+ 3
- 3
src/main/org/apache/tools/ant/taskdefs/optional/script/ScriptDef.java View File

@@ -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);


+ 2
- 2
src/main/org/apache/tools/ant/taskdefs/optional/script/ScriptDefBase.java View File

@@ -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);
}

/**


+ 1
- 1
src/main/org/apache/tools/ant/taskdefs/optional/splash/SplashTask.java View File

@@ -62,7 +62,7 @@ public class SplashTask extends Task {
* flag to enable proxy settings; optional, deprecated : consider
* using &lt;setproxy&gt; 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) {


+ 3
- 3
src/main/org/apache/tools/ant/taskdefs/optional/ssh/AbstractSshMessage.java View File

@@ -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;
}
}
}

+ 3
- 3
src/main/org/apache/tools/ant/taskdefs/optional/ssh/SSHUserInfo.java View File

@@ -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;
}



+ 1
- 1
src/main/org/apache/tools/ant/taskdefs/optional/ssh/ScpFromMessage.java View File

@@ -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.");


+ 3
- 3
src/main/org/apache/tools/ant/taskdefs/optional/ssh/ScpFromMessageBySftp.java View File

@@ -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();


+ 1
- 1
src/main/org/apache/tools/ant/taskdefs/optional/ssh/ScpToMessageBySftp.java View File

@@ -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);


+ 1
- 1
src/main/org/apache/tools/ant/taskdefs/optional/starteam/TreeBasedTask.java View File

@@ -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.
*


+ 1
- 1
src/main/org/apache/tools/ant/taskdefs/optional/unix/Symlink.java View File

@@ -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();


Loading…
Cancel
Save