sbailliez    2002/07/16 05:56:08

  Modified:    src/main/org/apache/tools/ant Tag: ANT_15_BRANCH
                        Diagnostics.java
  Log:
  Forgot to catch Errors while doing the diagnostics..making it totally useless
  when there is a ClassDefNotFoundError...that is...most of the time..
  hem...
  
  Revision  Changes    Path
  No                   revision
  
  
  No                   revision
  
  
  1.1.2.5   +8 -3      
jakarta-ant/src/main/org/apache/tools/ant/Diagnostics.java
  
  Index: Diagnostics.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-ant/src/main/org/apache/tools/ant/Diagnostics.java,v
  retrieving revision 1.1.2.4
  retrieving revision 1.1.2.5
  diff -u -r1.1.2.4 -r1.1.2.5
  --- Diagnostics.java  28 Jun 2002 23:10:03 -0000      1.1.2.4
  +++ Diagnostics.java  16 Jul 2002 12:56:07 -0000      1.1.2.5
  @@ -258,7 +258,7 @@
               out.println("Download it at http://xml.apache.org/commons/";);
           } catch (InvocationTargetException e) {
               error = e.getTargetException() == null ? e : 
e.getTargetException();
  -        } catch (Exception e) {
  +        } catch (Throwable e) {
               error = e;
           }
           // report error if something weird happens...this is diagnostic.
  @@ -274,11 +274,11 @@
        * because Ant requires multiple libraries to compile and one of them
        * was missing when compiling Ant.
        * @param out the stream to print the tasks report to
  -     * @param is the stream defining the mapping task name/classname, can be
        * <tt>null</tt> for a missing stream (ie mapping).
        */
       private static void doReportTasksAvailability(PrintStream out){
  -        InputStream is = 
Main.class.getResourceAsStream("/org/apache/tools/ant/taskdefs/defaults.properties");
  +        InputStream is = Main.class.getResourceAsStream(
  +                "/org/apache/tools/ant/taskdefs/defaults.properties");
           if (is == null) {
               out.println("None available");
           } else {
  @@ -293,6 +293,11 @@
                           props.remove(key);
                       } catch (ClassNotFoundException e){
                           out.println(key + " : Not Available");
  +                    } catch (NoClassDefFoundError e) {
  +                        String pkg = e.getMessage().replace('/', '.');
  +                        out.println(key + " : Missing dependency " + pkg );
  +                    } catch (Error e) {
  +                        out.println(key + " : Initialization error");
                       }
                   }
                   if (props.size() == 0){
  
  
  

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to