Browse Source

NPE while useing -listener for commons logger.

There is a difference between using a -logger and -listener.
The former may use a log file and the latter does not get this set.
The commons logger code assumes that it is passed the log stream in
both cases.
The fix is just to initialize the out and err streams in the commons
logger class.
PR: 27373


git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@276225 13f79535-47bb-0310-9956-ffa450edef68
master
Peter Reilly 21 years ago
parent
commit
2d3188c5d2
2 changed files with 4 additions and 2 deletions
  1. +2
    -0
      WHATSNEW
  2. +2
    -2
      src/main/org/apache/tools/ant/listener/CommonsLoggingListener.java

+ 2
- 0
WHATSNEW View File

@@ -82,6 +82,8 @@ Fixed bugs:
* regression from ant 1.5, exec task outputted two redundant trailing newlines.
Bugzilla Report 27546.

* NPE when running commons listener. Bugzilla Report 27373.

Other changes:
--------------



+ 2
- 2
src/main/org/apache/tools/ant/listener/CommonsLoggingListener.java View File

@@ -279,8 +279,8 @@ public class CommonsLoggingListener implements BuildListener, BuildLogger {
System.setErr(tmpErr);
}

PrintStream out;
PrintStream err;
PrintStream out = System.out;
PrintStream err = System.err;

public void setMessageOutputLevel(int level) {
// Use the logger config


Loading…
Cancel
Save