Browse Source

Handle case where listener cannot be instantiated.

Submitted by:	Glenn McAllister <glennm@ca.ibm.com>


git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@267790 13f79535-47bb-0310-9956-ffa450edef68
master
Conor MacNeill 25 years ago
parent
commit
f25950bbac
2 changed files with 6 additions and 4 deletions
  1. +2
    -1
      src/main/org/apache/tools/ant/DefaultLogger.java
  2. +4
    -3
      src/main/org/apache/tools/ant/Main.java

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

@@ -66,7 +66,8 @@ public class DefaultLogger implements BuildListener {

private PrintStream out;
private int msgOutputLevel;
private long startTime;
private long startTime = System.currentTimeMillis();


/**
* Constructs a new logger which will write to the specified


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

@@ -238,12 +238,13 @@ public class Main {
}

Project project = new Project();
addBuildListeners(project);
project.fireBuildStarted();

Throwable error = null;

try {
addBuildListeners(project);
project.fireBuildStarted();
project.init();

// set user-define properties
@@ -303,7 +304,7 @@ public class Main {
project.addBuildListener(listener);
}
catch(Exception exc) {
throw new BuildException("Unable to instantiate " + className, exc);
throw new BuildException("Unable to instantiate listener " + className, exc);
}
}
}


Loading…
Cancel
Save