ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sbaill...@apache.org
Subject cvs commit: jakarta-ant/src/main/org/apache/tools/ant Diagnostics.java
Date Tue, 16 Jul 2002 12:48:23 GMT
sbailliez    2002/07/16 05:48:23

  Modified:    src/main/org/apache/tools/ant 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
  1.3       +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.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- Diagnostics.java	9 Jul 2002 21:05:57 -0000	1.2
  +++ Diagnostics.java	16 Jul 2002 12:48:22 -0000	1.3
  @@ -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:ant-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:ant-dev-help@jakarta.apache.org>


Mime
View raw message