ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From peterrei...@apache.org
Subject cvs commit: ant/src/main/org/apache/tools/ant/launch Launcher.java
Date Wed, 08 Sep 2004 09:43:50 GMT
peterreilly    2004/09/08 02:43:50

  Modified:    src/main/org/apache/tools/ant/launch Launcher.java
  Log:
  Root cause of InstantiationException may be null in class.newInstance()
  
  Revision  Changes    Path
  1.20      +8 -2      ant/src/main/org/apache/tools/ant/launch/Launcher.java
  
  Index: Launcher.java
  ===================================================================
  RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/launch/Launcher.java,v
  retrieving revision 1.19
  retrieving revision 1.20
  diff -u -r1.19 -r1.20
  --- Launcher.java	6 Sep 2004 09:14:42 -0000	1.19
  +++ Launcher.java	8 Sep 2004 09:43:50 -0000	1.20
  @@ -223,9 +223,15 @@
               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();
               }
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org


Mime
View raw message