Browse Source

Merge branch '1.9.x'

master
Stefan Bodewig 8 years ago
parent
commit
7aeadd7b0d
47 changed files with 94 additions and 90 deletions
  1. +4
    -3
      src/main/org/apache/tools/ant/AntClassLoader.java
  2. +1
    -1
      src/main/org/apache/tools/ant/ArgumentProcessorRegistry.java
  3. +1
    -1
      src/main/org/apache/tools/ant/ComponentHelper.java
  4. +1
    -1
      src/main/org/apache/tools/ant/Diagnostics.java
  5. +1
    -1
      src/main/org/apache/tools/ant/DirectoryScanner.java
  6. +3
    -3
      src/main/org/apache/tools/ant/Main.java
  7. +1
    -1
      src/main/org/apache/tools/ant/Project.java
  8. +3
    -3
      src/main/org/apache/tools/ant/ProjectHelperRepository.java
  9. +6
    -1
      src/main/org/apache/tools/ant/filters/ReplaceTokens.java
  10. +2
    -2
      src/main/org/apache/tools/ant/launch/Launcher.java
  11. +1
    -1
      src/main/org/apache/tools/ant/listener/MailLogger.java
  12. +2
    -1
      src/main/org/apache/tools/ant/taskdefs/Classloader.java
  13. +2
    -2
      src/main/org/apache/tools/ant/taskdefs/Execute.java
  14. +2
    -2
      src/main/org/apache/tools/ant/taskdefs/HostInfo.java
  15. +2
    -5
      src/main/org/apache/tools/ant/taskdefs/Java.java
  16. +1
    -1
      src/main/org/apache/tools/ant/taskdefs/Javadoc.java
  17. +4
    -2
      src/main/org/apache/tools/ant/taskdefs/KeySubst.java
  18. +1
    -1
      src/main/org/apache/tools/ant/taskdefs/Length.java
  19. +5
    -5
      src/main/org/apache/tools/ant/taskdefs/ProcessDestroyer.java
  20. +1
    -1
      src/main/org/apache/tools/ant/taskdefs/RecorderEntry.java
  21. +2
    -2
      src/main/org/apache/tools/ant/taskdefs/SubAnt.java
  22. +2
    -1
      src/main/org/apache/tools/ant/taskdefs/XSLTProcess.java
  23. +1
    -1
      src/main/org/apache/tools/ant/taskdefs/optional/PropertyFile.java
  24. +2
    -2
      src/main/org/apache/tools/ant/taskdefs/optional/ccm/CCMCreateTask.java
  25. +4
    -3
      src/main/org/apache/tools/ant/taskdefs/optional/ejb/IPlanetEjbc.java
  26. +2
    -1
      src/main/org/apache/tools/ant/taskdefs/optional/image/Image.java
  27. +2
    -2
      src/main/org/apache/tools/ant/taskdefs/optional/javacc/JavaCC.java
  28. +1
    -1
      src/main/org/apache/tools/ant/taskdefs/optional/jsp/JspNameMangler.java
  29. +2
    -1
      src/main/org/apache/tools/ant/taskdefs/optional/junit/FailureRecorder.java
  30. +2
    -1
      src/main/org/apache/tools/ant/taskdefs/optional/junit/JUnitTask.java
  31. +1
    -1
      src/main/org/apache/tools/ant/taskdefs/optional/junit/JUnitTestRunner.java
  32. +3
    -3
      src/main/org/apache/tools/ant/taskdefs/optional/net/FTP.java
  33. +3
    -3
      src/main/org/apache/tools/ant/taskdefs/optional/net/FTPTask.java
  34. +2
    -2
      src/main/org/apache/tools/ant/taskdefs/optional/sos/SOS.java
  35. +1
    -1
      src/main/org/apache/tools/ant/taskdefs/optional/sos/SOSCmd.java
  36. +2
    -2
      src/main/org/apache/tools/ant/taskdefs/optional/sound/AntSoundPlayer.java
  37. +2
    -2
      src/main/org/apache/tools/ant/types/Path.java
  38. +2
    -2
      src/main/org/apache/tools/ant/types/selectors/modifiedselector/PropertiesfileCache.java
  39. +1
    -1
      src/main/org/apache/tools/ant/util/Base64Converter.java
  40. +1
    -4
      src/main/org/apache/tools/ant/util/CollectionUtils.java
  41. +1
    -1
      src/main/org/apache/tools/ant/util/LayoutPreservingProperties.java
  42. +2
    -2
      src/main/org/apache/tools/ant/util/ProxySetup.java
  43. +1
    -1
      src/main/org/apache/tools/ant/util/StringUtils.java
  44. +1
    -1
      src/main/org/apache/tools/bzip2/BZip2Constants.java
  45. +1
    -1
      src/main/org/apache/tools/bzip2/CRC.java
  46. +6
    -6
      src/main/org/apache/tools/zip/ZipOutputStream.java
  47. +0
    -4
      src/tests/junit/org/apache/tools/ant/AntClassLoaderTest.java

+ 4
- 3
src/main/org/apache/tools/ant/AntClassLoader.java View File

@@ -49,6 +49,7 @@ import org.apache.tools.ant.util.CollectionUtils;
import org.apache.tools.ant.util.FileUtils;
import org.apache.tools.ant.util.JavaEnvUtils;
import org.apache.tools.ant.util.LoaderUtils;
import org.apache.tools.ant.util.StringUtils;
import org.apache.tools.ant.util.VectorSet;
import org.apache.tools.zip.ZipLong;

@@ -405,6 +406,8 @@ public class AntClassLoader extends ClassLoader implements SubBuildListener, Clo
protected void log(final String message, final int priority) {
if (project != null) {
project.log(message, priority);
} else if (priority < Project.MSG_INFO) {
System.err.println(message);
}
}

@@ -1018,7 +1021,6 @@ public class AntClassLoader extends ClassLoader implements SubBuildListener, Clo
final String msg = "CLASSPATH element " + file
+ " is not a JAR.";
log(msg, Project.MSG_WARN);
System.err.println(msg);
return null;
}
jarFile = new JarFile(file);
@@ -1041,8 +1043,7 @@ public class AntClassLoader extends ClassLoader implements SubBuildListener, Clo
} catch (final Exception e) {
final String msg = "Unable to obtain resource from " + file + ": ";
log(msg + e, Project.MSG_WARN);
System.err.println(msg);
e.printStackTrace();
log(StringUtils.getStackTrace(e), Project.MSG_WARN);
}
return null;
}


+ 1
- 1
src/main/org/apache/tools/ant/ArgumentProcessorRegistry.java View File

@@ -93,7 +93,7 @@ public class ArgumentProcessorRegistry {
+ SERVICE_ID + " (" + e.getClass().getName() + ": "
+ e.getMessage() + ")");
if (DEBUG) {
e.printStackTrace(System.err);
e.printStackTrace(System.err); //NOSONAR
}
}
}


+ 1
- 1
src/main/org/apache/tools/ant/ComponentHelper.java View File

@@ -971,7 +971,7 @@ public class ComponentHelper {
Throwable t = ex.getTargetException();
out.println("Cause: The constructor threw the exception");
out.println(t.toString());
t.printStackTrace(out);
t.printStackTrace(out); //NOSONAR
} catch (NoClassDefFoundError ncdfe) {
jars = true;
out.println("Cause: A class needed by class " + classname


+ 1
- 1
src/main/org/apache/tools/ant/Diagnostics.java View File

@@ -472,7 +472,7 @@ public final class Diagnostics {
// report error if something weird happens...this is diagnostic.
if (error != null) {
out.println("Error while running org.apache.env.Which");
error.printStackTrace();
error.printStackTrace(out); //NOSONAR
}
}



+ 1
- 1
src/main/org/apache/tools/ant/DirectoryScanner.java View File

@@ -146,7 +146,7 @@ public class DirectoryScanner
* method instead.
*/
@Deprecated
protected static final String[] DEFAULTEXCLUDES = {
protected static final String[] DEFAULTEXCLUDES = { //NOSONAR
// Miscellaneous typical temporary files
SelectorUtils.DEEP_TREE_MATCH + "/*~",
SelectorUtils.DEEP_TREE_MATCH + "/#*#",


+ 3
- 3
src/main/org/apache/tools/ant/Main.java View File

@@ -246,7 +246,7 @@ public class Main implements AntMain {
printMessage(be);
}
} catch (final Throwable exc) {
exc.printStackTrace();
exc.printStackTrace(); //NOSONAR
printMessage(exc);
} finally {
handleLogfile();
@@ -881,11 +881,11 @@ public class Main implements AntMain {
// but if we don't, we lose valuable information
System.err.println("Caught an exception while logging the"
+ " end of the build. Exception was:");
t.printStackTrace();
t.printStackTrace(); //NOSONAR
if (error != null) {
System.err.println("There has been an error prior to"
+ " that:");
error.printStackTrace();
error.printStackTrace(); //NOSONAR
}
throw new BuildException(t); //NOSONAR
}


+ 1
- 1
src/main/org/apache/tools/ant/Project.java View File

@@ -873,7 +873,7 @@ public class Project implements ResourceFactory {
try {
setBasedir(".");
} catch (final BuildException ex) {
ex.printStackTrace();
ex.printStackTrace(); //NOSONAR
}
}
return baseDir;


+ 3
- 3
src/main/org/apache/tools/ant/ProjectHelperRepository.java View File

@@ -108,7 +108,7 @@ public class ProjectHelperRepository {
+ e.getClass().getName()
+ ": " + e.getMessage() + ")");
if (DEBUG) {
e.printStackTrace(System.err);
e.printStackTrace(System.err); //NOSONAR
}
}
}
@@ -175,7 +175,7 @@ public class ProjectHelperRepository {
+ ProjectHelper.HELPER_PROPERTY + " ("
+ e.getMessage() + ")");
if (DEBUG) {
e.printStackTrace(System.err);
e.printStackTrace(System.err); //NOSONAR
}
}
return null;
@@ -203,7 +203,7 @@ public class ProjectHelperRepository {
System.out.println("Unable to load ProjectHelper from service "
+ ProjectHelper.SERVICE_ID + " (" + e.getMessage() + ")");
if (DEBUG) {
e.printStackTrace(System.err);
e.printStackTrace(System.err); //NOSONAR
}
}
return null;


+ 6
- 1
src/main/org/apache/tools/ant/filters/ReplaceTokens.java View File

@@ -27,6 +27,7 @@ import java.util.Properties;
import java.util.SortedMap;
import java.util.TreeMap;

import org.apache.tools.ant.Project;
import org.apache.tools.ant.types.Parameter;
import org.apache.tools.ant.types.Resource;
import org.apache.tools.ant.types.resources.FileResource;
@@ -244,7 +245,11 @@ public final class ReplaceTokens
in = resource.getInputStream();
props.load(in);
} catch (IOException ioe) {
ioe.printStackTrace();
if (getProject() != null) {
getProject().log("getProperties failed, " + ioe.getMessage(), Project.MSG_ERR);
} else {
ioe.printStackTrace(); //NOSONAR
}
} finally {
FileUtils.close(in);
}


+ 2
- 2
src/main/org/apache/tools/ant/launch/Launcher.java View File

@@ -117,7 +117,7 @@ public class Launcher {
System.err.println(e.getMessage());
} catch (final Throwable t) {
exitCode = EXIT_CODE_ERROR;
t.printStackTrace(System.err);
t.printStackTrace(System.err); //NOSONAR
}
if (exitCode != 0) {
if (launchDiag) {
@@ -297,7 +297,7 @@ public class Launcher {
"Failed to locate" + mainClassname);
thrown = cnfe;
} catch (final Throwable t) {
t.printStackTrace(System.err);
t.printStackTrace(System.err); //NOSONAR
thrown=t;
}
if(thrown!=null) {


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

@@ -177,7 +177,7 @@ public class MailLogger extends DefaultLogger {
}
} catch (Exception e) {
System.out.println("MailLogger failed to send e-mail!");
e.printStackTrace(System.err);
e.printStackTrace(System.err); //NOSONAR
}
}



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

@@ -27,6 +27,7 @@ import org.apache.tools.ant.Project;
import org.apache.tools.ant.Task;
import org.apache.tools.ant.types.Path;
import org.apache.tools.ant.types.Reference;
import org.apache.tools.ant.util.StringUtils;

/**
* EXPERIMENTAL
@@ -238,7 +239,7 @@ public class Classloader extends Task {
// TODO add exceptions

} catch (Exception ex) {
ex.printStackTrace();
log(StringUtils.getStackTrace(ex), Project.MSG_ERR);
}
}
}

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

@@ -113,7 +113,7 @@ public class Execute {
procEnvironment = System.getenv();
return procEnvironment;
} catch (Exception x) {
x.printStackTrace();
x.printStackTrace(); //NOSONAR
}
}

@@ -162,7 +162,7 @@ public class Execute {
procEnvironment.put(var.substring(0, eq), var.substring(eq + 1));
}
} catch (java.io.IOException exc) {
exc.printStackTrace();
exc.printStackTrace(); //NOSONAR
// Just try to see how much we got
}
return procEnvironment;


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

@@ -43,11 +43,11 @@ import org.apache.tools.ant.Task;
public class HostInfo extends Task {
private static final String DEF_REM_ADDR6 = "::";

private static final String DEF_REM_ADDR4 = "0.0.0.0";
private static final String DEF_REM_ADDR4 = "0.0.0.0"; //NOSONAR

private static final String DEF_LOCAL_ADDR6 = "::1";

private static final String DEF_LOCAL_ADDR4 = "127.0.0.1";
private static final String DEF_LOCAL_ADDR4 = "127.0.0.1"; //NOSONAR

private static final String DEF_LOCAL_NAME = "localhost";
private static final String DEF_DOMAIN = "localdomain";


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

@@ -40,6 +40,7 @@ import org.apache.tools.ant.types.PropertySet;
import org.apache.tools.ant.types.RedirectorElement;
import org.apache.tools.ant.types.Reference;
import org.apache.tools.ant.util.KeepAliveInputStream;
import org.apache.tools.ant.util.StringUtils;

/**
* Launcher for Java applications. Allows use of
@@ -997,11 +998,7 @@ public class Java extends Task {
* @since 1.6.2
*/
private void log(Throwable t) {
StringWriter sw = new StringWriter();
PrintWriter w = new PrintWriter(sw);
t.printStackTrace(w);
w.close();
log(sw.toString(), Project.MSG_ERR);
log(StringUtils.getStackTrace(t), Project.MSG_ERR);
}

/**


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

@@ -1313,7 +1313,7 @@ public class Javadoc extends Task {
* cannot be static in inner classes.) The first letter
* from each element is used to build up the scope string.
*/
static final String[] SCOPE_ELEMENTS = {
static final String[] SCOPE_ELEMENTS = { //NOSONAR
"overview", "packages", "types", "constructors",
"methods", "fields"
};


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

@@ -28,8 +28,10 @@ import java.util.Hashtable;
import java.util.StringTokenizer;

import org.apache.tools.ant.BuildException;
import org.apache.tools.ant.Project;
import org.apache.tools.ant.Task;
import org.apache.tools.ant.util.FileUtils;
import org.apache.tools.ant.util.StringUtils;

/**
* Keyword substitution. Input file is written to output file.
@@ -80,7 +82,7 @@ public class KeySubst extends Task {
}
bw.flush();
} catch (IOException ioe) {
ioe.printStackTrace();
log(StringUtils.getStackTrace(ioe), Project.MSG_ERR);
} finally {
FileUtils.close(bw);
FileUtils.close(br);
@@ -153,7 +155,7 @@ public class KeySubst extends Task {
System.out.println(KeySubst.replace("$f ${VERSION} f ${b} jj $",
hash));
} catch (Exception e) {
e.printStackTrace();
e.printStackTrace(); //NOSONAR
}
}



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

@@ -247,7 +247,7 @@ public class Length extends Task implements Condition {

/** EnumeratedAttribute operation mode */
public static class FileMode extends EnumeratedAttribute {
static final String[] MODES = new String[] {EACH, ALL};
static final String[] MODES = new String[] {EACH, ALL}; //NOSONAR

/**
* Return the possible values for FileMode.


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

@@ -84,7 +84,7 @@ class ProcessDestroyer implements Runnable {
} catch (NoSuchMethodException e) {
// it just won't be added as a shutdown hook... :(
} catch (Exception e) {
e.printStackTrace();
e.printStackTrace(); //NOSONAR
}
}

@@ -100,14 +100,14 @@ class ProcessDestroyer implements Runnable {
addShutdownHookMethod.invoke(Runtime.getRuntime(), args);
added = true;
} catch (IllegalAccessException e) {
e.printStackTrace();
e.printStackTrace(); //NOSONAR
} catch (InvocationTargetException e) {
Throwable t = e.getTargetException();
if (t != null && t.getClass() == IllegalStateException.class) {
// shutdown already is in progress
running = true;
} else {
e.printStackTrace();
e.printStackTrace(); //NOSONAR
}
}
}
@@ -129,14 +129,14 @@ class ProcessDestroyer implements Runnable {
System.err.println("Could not remove shutdown hook");
}
} catch (IllegalAccessException e) {
e.printStackTrace();
e.printStackTrace(); //NOSONAR
} catch (InvocationTargetException e) {
Throwable t = e.getTargetException();
if (t != null && t.getClass() == IllegalStateException.class) {
// shutdown already is in progress
running = true;
} else {
e.printStackTrace();
e.printStackTrace(); //NOSONAR
}
}
// start the hook thread, a unstarted thread may not be


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

@@ -111,7 +111,7 @@ public class RecorderEntry implements BuildLogger, SubBuildListener {
} else {
out.println(StringUtils.LINE_SEP + "BUILD FAILED"
+ StringUtils.LINE_SEP);
error.printStackTrace(out);
error.printStackTrace(out); //NOSONAR
}
}
cleanup();


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

@@ -34,7 +34,7 @@ import org.apache.tools.ant.types.Path;
import org.apache.tools.ant.types.PropertySet;
import org.apache.tools.ant.types.Reference;
import org.apache.tools.ant.types.ResourceCollection;
import org.apache.tools.ant.util.StringUtils;

/**
* Calls a given target for all defined sub-builds. This is an extension
@@ -255,7 +255,7 @@ public class SubAnt extends Task {
log("Target '" + file
+ "' failed with message '"
+ thrownException.getMessage() + "'.", Project.MSG_ERR);
thrownException.printStackTrace(System.err);
log(StringUtils.getStackTrace(thrownException), Project.MSG_ERR);
if (buildException == null) {
buildException =
new BuildException(thrownException);


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

@@ -58,6 +58,7 @@ import org.apache.tools.ant.util.ClasspathUtils;
import org.apache.tools.ant.util.FileNameMapper;
import org.apache.tools.ant.util.FileUtils;
import org.apache.tools.ant.util.ResourceUtils;
import org.apache.tools.ant.util.StringUtils;

/**
* Processes a set of XML documents via XSLT. This is
@@ -952,7 +953,7 @@ public class XSLTProcess extends MatchingTask implements XSLTLogger {
try {
resolveProcessor(PROCESSOR_TRAX);
} catch (final Throwable e1) {
e1.printStackTrace();
log(StringUtils.getStackTrace(e1), Project.MSG_ERR);
handleError(e1);
}
}


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

@@ -390,7 +390,7 @@ public class PropertyFile extends Task {
} catch (NullPointerException npe) {
// Default to string type
// which means do nothing
npe.printStackTrace();
npe.printStackTrace(); //NOSONAR
}

if (newValue == null) {


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

@@ -30,7 +30,7 @@ import org.apache.tools.ant.Project;
import org.apache.tools.ant.taskdefs.Execute;
import org.apache.tools.ant.taskdefs.ExecuteStreamHandler;
import org.apache.tools.ant.types.Commandline;
import org.apache.tools.ant.util.StringUtils;

/**
* Creates new Continuus ccm task and sets it as the default.
@@ -322,7 +322,7 @@ public class CCMCreateTask extends Continuus implements ExecuteStreamHandler {
} // end of if ()
} catch (NullPointerException npe) {
log("error procession stream , null pointer exception", Project.MSG_ERR);
npe.printStackTrace();
log(StringUtils.getStackTrace(npe), Project.MSG_ERR);
throw new BuildException(npe.getClass().getName());
} catch (Exception e) {
log("error procession stream " + e.getMessage(), Project.MSG_ERR);


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

@@ -43,6 +43,7 @@ import org.xml.sax.InputSource;
import org.xml.sax.SAXException;

import org.apache.tools.ant.util.FileUtils;
import org.apache.tools.ant.util.StringUtils;

/**
* Compiles EJB stubs and skeletons for the iPlanet Application
@@ -310,7 +311,7 @@ public class IPlanetEjbc {
// SAXException or ParserConfigurationException may be thrown
System.out.println("An exception was generated while trying to ");
System.out.println("create a new SAXParser.");
e.printStackTrace();
e.printStackTrace(); //NOSONAR
return;
}

@@ -443,7 +444,7 @@ public class IPlanetEjbc {
p.destroy();
} catch (IOException e) {
log("An IOException has occurred while trying to execute ejbc.");
e.printStackTrace();
log(StringUtils.getStackTrace(e));
} catch (InterruptedException e) {
// Do nothing
}
@@ -1484,7 +1485,7 @@ public class IPlanetEjbc {
System.out.println(text);
}
} catch (IOException e) {
e.printStackTrace();
e.printStackTrace(); //NOSONAR
} finally {
FileUtils.close(reader);
}


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

@@ -40,6 +40,7 @@ import org.apache.tools.ant.types.optional.image.TransformOperation;
import org.apache.tools.ant.util.FileNameMapper;
import org.apache.tools.ant.util.FileUtils;
import org.apache.tools.ant.util.IdentityMapper;
import org.apache.tools.ant.util.StringUtils;

import com.sun.media.jai.codec.FileSeekableStream;

@@ -392,7 +393,7 @@ public class Image extends MatchingTask {
}

} catch (Exception err) {
err.printStackTrace();
log(StringUtils.getStackTrace(err), Project.MSG_ERR);
throw new BuildException(err.getMessage());
}
}


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

@@ -77,7 +77,7 @@ public class JavaCC extends Task {
protected static final int TASKDEF_TYPE_JJTREE = 2;
protected static final int TASKDEF_TYPE_JJDOC = 3;

protected static final String[] ARCHIVE_LOCATIONS =
protected static final String[] ARCHIVE_LOCATIONS = //NOSONAR
new String[] {
"JavaCC.zip",
"bin/lib/JavaCC.zip",
@@ -85,7 +85,7 @@ public class JavaCC extends Task {
"javacc.jar", // used by jpackage for JavaCC 3.x
};

protected static final int[] ARCHIVE_LOCATIONS_VS_MAJOR_VERSION =
protected static final int[] ARCHIVE_LOCATIONS_VS_MAJOR_VERSION = //NOSONAR
new int[] {
1,
2,


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

@@ -33,7 +33,7 @@ public class JspNameMangler implements JspMangler {
/**
* this is the list of keywords which can not be used as classnames
*/
public static final String[] keywords = {
public static final String[] keywords = { //NOSONAR
"assert",
"abstract", "boolean", "break", "byte",
"case", "catch", "char", "class",


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

@@ -38,6 +38,7 @@ import org.apache.tools.ant.BuildListener;
import org.apache.tools.ant.Project;
import org.apache.tools.ant.ProjectComponent;
import org.apache.tools.ant.util.FileUtils;
import org.apache.tools.ant.util.StringUtils;

/**
* <p>Collects all failing test <i>cases</i> and creates a new JUnit test class containing
@@ -260,7 +261,7 @@ public class FailureRecorder extends ProjectComponent implements JUnitResultForm
createClassFooter();

} catch (IOException e) {
e.printStackTrace();
log(StringUtils.getStackTrace(e));
} finally {
FileUtils.close(writer);
}


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

@@ -62,6 +62,7 @@ import org.apache.tools.ant.types.PropertySet;
import org.apache.tools.ant.util.FileUtils;
import org.apache.tools.ant.util.LoaderUtils;
import org.apache.tools.ant.util.SplitClassLoader;
import org.apache.tools.ant.util.StringUtils;

/**
* Runs JUnit tests.
@@ -1298,7 +1299,7 @@ public class JUnitTask extends Task {
+ " testcase not started or mixing ant versions?";
}
} catch (final Exception e) {
e.printStackTrace();
log(StringUtils.getStackTrace(e), Project.MSG_INFO);
// ignored.
} finally {
FileUtils.close(br);


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

@@ -1023,7 +1023,7 @@ public class JUnitTestRunner implements TestListener, JUnitTaskMirror.JUnitTestR
}
}
} catch (final IOException e) {
e.printStackTrace();
e.printStackTrace(); //NOSONAR
}
} else {
final JUnitTest t = new JUnitTest(args[0]);


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

@@ -144,7 +144,7 @@ public class FTP extends Task implements FTPTaskConfig {
private String initialSiteCommand = null;
private boolean enableRemoteVerification = true;

protected static final String[] ACTION_STRS = {
protected static final String[] ACTION_STRS = { //NOSONAR
"sending",
"getting",
"deleting",
@@ -155,7 +155,7 @@ public class FTP extends Task implements FTPTaskConfig {
"site"
};

protected static final String[] COMPLETED_ACTION_STRS = {
protected static final String[] COMPLETED_ACTION_STRS = { //NOSONAR
"sent",
"retrieved",
"deleted",
@@ -166,7 +166,7 @@ public class FTP extends Task implements FTPTaskConfig {
"site command executed"
};

protected static final String[] ACTION_TARGET_STRS = {
protected static final String[] ACTION_TARGET_STRS = { //NOSONAR
"files",
"files",
"files",


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

@@ -108,7 +108,7 @@ public class FTPTask extends Task implements FTPTaskConfig {
private ClassLoader mirrorLoader;
private FTPTaskMirror delegate = null;

public static final String[] ACTION_STRS = {
public static final String[] ACTION_STRS = { //NOSONAR
"sending",
"getting",
"deleting",
@@ -119,7 +119,7 @@ public class FTPTask extends Task implements FTPTaskConfig {
"site"
};

public static final String[] COMPLETED_ACTION_STRS = {
public static final String[] COMPLETED_ACTION_STRS = { //NOSONAR
"sent",
"retrieved",
"deleted",
@@ -130,7 +130,7 @@ public class FTPTask extends Task implements FTPTaskConfig {
"site command executed"
};

public static final String[] ACTION_TARGET_STRS = {
public static final String[] ACTION_TARGET_STRS = { //NOSONAR
"files",
"files",
"files",


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

@@ -41,7 +41,7 @@ public abstract class SOS extends Task implements SOSCmd {

private String sosCmdDir = null;
private String sosUsername = null;
private String sosPassword = "";
private String sosPassword = null;
private String projectPath = null;
private String vssServerPath = null;
private String sosServerPath = null;
@@ -269,7 +269,7 @@ public abstract class SOS extends Task implements SOSCmd {
* @return empty string if it wasn't set.
*/
protected String getPassword() {
return sosPassword;
return sosPassword == null ? "" : sosPassword;
}

/**


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

@@ -53,7 +53,7 @@ public interface SOSCmd {
/** The username option */
String FLAG_USERNAME = "-name";
/** The password option */
String FLAG_PASSWORD = "-password";
String FLAG_PASSWORD = "-password"; //NOSONAR
/** The log option */
String FLAG_COMMENT = "-log";
/** The workdir option */


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

@@ -109,7 +109,7 @@ public class AntSoundPlayer implements LineListener, BuildListener {
project.log("Audio format is not yet supported: "
+ uafe.getMessage());
} catch (IOException ioe) {
ioe.printStackTrace();
ioe.printStackTrace(); //NOSONAR
}

if (audioInputStream != null) {
@@ -125,7 +125,7 @@ public class AntSoundPlayer implements LineListener, BuildListener {
project.log("The sound device is currently unavailable");
return;
} catch (IOException e) {
e.printStackTrace();
e.printStackTrace(); //NOSONAR
}

if (duration != null) {


+ 2
- 2
src/main/org/apache/tools/ant/types/Path.java View File

@@ -67,7 +67,7 @@ public class Path extends DataType implements Cloneable, ResourceCollection {
// CheckStyle:VisibilityModifier OFF - bc

/** The system classpath as a Path object */
public static Path systemClasspath =
public static final Path systemClasspath =
new Path(null, System.getProperty("java.class.path"));


@@ -76,7 +76,7 @@ public class Path extends DataType implements Cloneable, ResourceCollection {
*
* @since Ant 1.6.2
*/
public static Path systemBootClasspath =
public static final Path systemBootClasspath =
new Path(null, System.getProperty("sun.boot.class.path"));

// CheckStyle:VisibilityModifier OFF - bc


+ 2
- 2
src/main/org/apache/tools/ant/types/selectors/modifiedselector/PropertiesfileCache.java View File

@@ -137,7 +137,7 @@ public class PropertiesfileCache implements Cache {
cache.load(bis);
bis.close();
} catch (Exception e) {
e.printStackTrace();
e.printStackTrace(); //NOSONAR
}
}
// after loading the cache is up to date with the file
@@ -164,7 +164,7 @@ public class PropertiesfileCache implements Cache {
bos.flush();
bos.close();
} catch (Exception e) {
e.printStackTrace();
e.printStackTrace(); //NOSONAR
}
}
cacheDirty = false;


+ 1
- 1
src/main/org/apache/tools/ant/util/Base64Converter.java View File

@@ -49,7 +49,7 @@ public class Base64Converter {

// CheckStyle:ConstantNameCheck OFF - bc
/** Provided for BC purposes */
public static final char[] alphabet = ALPHABET;
public static final char[] alphabet = ALPHABET; //NOSONAR
// CheckStyle:ConstantNameCheck ON




+ 1
- 4
src/main/org/apache/tools/ant/util/CollectionUtils.java View File

@@ -36,12 +36,9 @@ import java.util.Vector;
*/
public class CollectionUtils {

/**
* Collections.emptyList() is Java5+.
*/
@SuppressWarnings("rawtypes")
@Deprecated
public static final List EMPTY_LIST = Collections.EMPTY_LIST;
public static final List EMPTY_LIST = Collections.EMPTY_LIST; //NOSONAR

/**
* Please use Vector.equals() or List.equals().


+ 1
- 1
src/main/org/apache/tools/ant/util/LayoutPreservingProperties.java View File

@@ -700,7 +700,7 @@ public class LayoutPreservingProperties extends Properties {
dolly = super.clone();
} catch (final CloneNotSupportedException e) {
// should be fine
e.printStackTrace();
e.printStackTrace(); //NOSONAR
}
return dolly;
}


+ 2
- 2
src/main/org/apache/tools/ant/util/ProxySetup.java View File

@@ -57,7 +57,7 @@ public class ProxySetup {
/** the http proxy username property */
public static final String HTTP_PROXY_USERNAME = "http.proxyUser";
/** the http proxy password property */
public static final String HTTP_PROXY_PASSWORD = "http.proxyPassword";
public static final String HTTP_PROXY_PASSWORD = "http.proxyPassword"; //NOSONAR
/** the socks proxy host property */
public static final String SOCKS_PROXY_HOST = "socksProxyHost";
/** the socks proxy port property */
@@ -65,7 +65,7 @@ public class ProxySetup {
/** the socks proxy username property */
public static final String SOCKS_PROXY_USERNAME = "java.net.socks.username";
/** the socks proxy password property */
public static final String SOCKS_PROXY_PASSWORD = "java.net.socks.password";
public static final String SOCKS_PROXY_PASSWORD = "java.net.socks.password"; //NOSONAR

/**
* create a proxy setup class bound to this project


+ 1
- 1
src/main/org/apache/tools/ant/util/StringUtils.java View File

@@ -97,7 +97,7 @@ public final class StringUtils {
public static String getStackTrace(Throwable t) {
StringWriter sw = new StringWriter();
PrintWriter pw = new PrintWriter(sw, true);
t.printStackTrace(pw);
t.printStackTrace(pw); //NOSONAR
pw.flush();
pw.close();
return sw.toString();


+ 1
- 1
src/main/org/apache/tools/bzip2/BZip2Constants.java View File

@@ -52,7 +52,7 @@ public interface BZip2Constants {
* <p>FIXME: This array should be in a private or package private
* location, since it could be modified by malicious code.</p>
*/
int[] rNums = {
int[] rNums = { //NOSONAR
619, 720, 127, 481, 931, 816, 813, 233, 566, 247,
985, 724, 205, 454, 863, 491, 741, 242, 949, 214,
733, 859, 335, 708, 621, 574, 73, 654, 730, 472,


+ 1
- 1
src/main/org/apache/tools/bzip2/CRC.java View File

@@ -30,7 +30,7 @@ package org.apache.tools.bzip2;
*
*/
final class CRC {
static final int crc32Table[] = {
static final int crc32Table[] = { //NOSONAR
0x00000000, 0x04c11db7, 0x09823b6e, 0x0d4326d9,
0x130476dc, 0x17c56b6b, 0x1a864db2, 0x1e475005,
0x2608edb8, 0x22c9f00f, 0x2f8ad6d6, 0x2b4bcb61,


+ 6
- 6
src/main/org/apache/tools/zip/ZipOutputStream.java View File

@@ -963,33 +963,33 @@ public class ZipOutputStream extends FilterOutputStream {
*
* @since 1.1
*/
protected static final byte[] LFH_SIG = ZipLong.LFH_SIG.getBytes();
protected static final byte[] LFH_SIG = ZipLong.LFH_SIG.getBytes(); //NOSONAR
/**
* data descriptor signature
*
* @since 1.1
*/
protected static final byte[] DD_SIG = ZipLong.DD_SIG.getBytes();
protected static final byte[] DD_SIG = ZipLong.DD_SIG.getBytes(); //NOSONAR
/**
* central file header signature
*
* @since 1.1
*/
protected static final byte[] CFH_SIG = ZipLong.CFH_SIG.getBytes();
protected static final byte[] CFH_SIG = ZipLong.CFH_SIG.getBytes(); //NOSONAR
/**
* end of central dir signature
*
* @since 1.1
*/
protected static final byte[] EOCD_SIG = ZipLong.getBytes(0X06054B50L);
protected static final byte[] EOCD_SIG = ZipLong.getBytes(0X06054B50L); //NOSONAR
/**
* ZIP64 end of central dir signature
*/
static final byte[] ZIP64_EOCD_SIG = ZipLong.getBytes(0X06064B50L);
static final byte[] ZIP64_EOCD_SIG = ZipLong.getBytes(0X06064B50L); //NOSONAR
/**
* ZIP64 end of central dir locator signature
*/
static final byte[] ZIP64_EOCD_LOC_SIG = ZipLong.getBytes(0X07064B50L);
static final byte[] ZIP64_EOCD_LOC_SIG = ZipLong.getBytes(0X07064B50L); //NOSONAR

/**
* Writes next block of compressed data to the output stream.


+ 0
- 4
src/tests/junit/org/apache/tools/ant/AntClassLoaderTest.java View File

@@ -195,10 +195,6 @@ public class AntClassLoaderTest {
int startMessage = log.indexOf("CLASSPATH element ");
assertTrue(startMessage >= 0);
assertTrue(log.indexOf("foo.jar is not a JAR", startMessage) > 0);
log = errBuffer.toString();
startMessage = log.indexOf("CLASSPATH element ");
assertTrue(startMessage >= 0);
assertTrue(log.indexOf("foo.jar is not a JAR", startMessage) > 0);
} finally {
System.setErr(sysErr);
}


Loading…
Cancel
Save