Browse Source

there simply is no better logger around

master
Stefan Bodewig 8 years ago
parent
commit
4cecc03af6
16 changed files with 34 additions and 29 deletions
  1. +3
    -3
      src/main/org/apache/tools/ant/Main.java
  2. +1
    -1
      src/main/org/apache/tools/ant/Project.java
  3. +3
    -3
      src/main/org/apache/tools/ant/ProjectHelperRepository.java
  4. +6
    -1
      src/main/org/apache/tools/ant/filters/ReplaceTokens.java
  5. +2
    -2
      src/main/org/apache/tools/ant/launch/Launcher.java
  6. +1
    -1
      src/main/org/apache/tools/ant/listener/MailLogger.java
  7. +2
    -2
      src/main/org/apache/tools/ant/taskdefs/Execute.java
  8. +1
    -1
      src/main/org/apache/tools/ant/taskdefs/KeySubst.java
  9. +5
    -5
      src/main/org/apache/tools/ant/taskdefs/ProcessDestroyer.java
  10. +1
    -1
      src/main/org/apache/tools/ant/taskdefs/RecorderEntry.java
  11. +1
    -1
      src/main/org/apache/tools/ant/taskdefs/optional/PropertyFile.java
  12. +2
    -2
      src/main/org/apache/tools/ant/taskdefs/optional/ejb/IPlanetEjbc.java
  13. +1
    -1
      src/main/org/apache/tools/ant/taskdefs/optional/junit/JUnitTestRunner.java
  14. +2
    -2
      src/main/org/apache/tools/ant/taskdefs/optional/sound/AntSoundPlayer.java
  15. +2
    -2
      src/main/org/apache/tools/ant/types/selectors/modifiedselector/PropertiesfileCache.java
  16. +1
    -1
      src/main/org/apache/tools/ant/util/LayoutPreservingProperties.java

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


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

@@ -153,7 +153,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
}
}



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


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

@@ -401,7 +401,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/ejb/IPlanetEjbc.java View File

@@ -310,7 +310,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;
}

@@ -1484,7 +1484,7 @@ public class IPlanetEjbc {
System.out.println(text);
}
} catch (IOException e) {
e.printStackTrace();
e.printStackTrace(); //NOSONAR
} finally {
FileUtils.close(reader);
}


+ 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]);


+ 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/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/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;
}


Loading…
Cancel
Save