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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to