Browse Source

Root cause of InstantiationException may be null in class.newInstance()

git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@276829 13f79535-47bb-0310-9956-ffa450edef68
master
Peter Reilly 21 years ago
parent
commit
81531e4ccc
1 changed files with 8 additions and 2 deletions
  1. +8
    -2
      src/main/org/apache/tools/ant/launch/Launcher.java

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

@@ -223,9 +223,15 @@ public class Launcher {
main.startAnt(newArgs, null, null);
} catch (Throwable t) {
if (t instanceof InstantiationException) {
t.printStackTrace();
InstantiationException ie = (InstantiationException) t;
System.err.println("Instantiation Exception - root cause:");
ie.getCause().printStackTrace();
if (ie.getCause() == null) {
System.err.println("Instantiation Exception - root cause: "
+ ie.getCause());
} else {
System.err.println("Instantiation Exception - root cause:");
ie.getCause().printStackTrace();
}
} else {
t.printStackTrace();
}


Loading…
Cancel
Save