ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From co...@apache.org
Subject cvs commit: jakarta-ant/src/main/org/apache/tools/ant AntClassLoader.java
Date Sat, 07 Jul 2001 13:54:40 GMT
conor       01/07/07 06:54:40

  Modified:    src/main/org/apache/tools/ant AntClassLoader.java
  Log:
  AntClassLoader now ignores paths which are invalid relative to the
  project.
  
  PR:	381
  
  Revision  Changes    Path
  1.22      +15 -5     jakarta-ant/src/main/org/apache/tools/ant/AntClassLoader.java
  
  Index: AntClassLoader.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/src/main/org/apache/tools/ant/AntClassLoader.java,v
  retrieving revision 1.21
  retrieving revision 1.22
  diff -u -r1.21 -r1.22
  --- AntClassLoader.java	2001/07/07 13:51:10	1.21
  +++ AntClassLoader.java	2001/07/07 13:54:40	1.22
  @@ -394,7 +394,7 @@
                   File pathComponent = project.resolveFile((String)pathElements[i]);
                   stream = getResourceStream(pathComponent, name);
               }
  -            catch {BuildException e) {
  +            catch (BuildException e) {
                   // ignore path elements which are invalid relative to the project
               }
           }
  @@ -525,8 +525,13 @@
           if (url == null) {
               String[] pathElements = classpath.list();
               for (int i = 0; i < pathElements.length && url == null; ++i) {
  -                File pathComponent = project.resolveFile((String)pathElements[i]);
  -                url = getResourceURL(pathComponent, name);
  +                try {
  +                    File pathComponent = project.resolveFile((String)pathElements[i]);
  +                    url = getResourceURL(pathComponent, name);
  +                }
  +                catch (BuildException e) {
  +                    // ignore path elements which ar einvalid relative to the project
  +                }
               }
           }
           
  @@ -757,8 +762,13 @@
           try {
               String[] pathElements = path.list();
               for (int i = 0; i < pathElements.length && stream == null; ++i)
{
  -                File pathComponent = project.resolveFile((String)pathElements[i]);
  -                stream = getResourceStream(pathComponent, classFilename);
  +                try {
  +                    File pathComponent = project.resolveFile((String)pathElements[i]);
  +                    stream = getResourceStream(pathComponent, classFilename);
  +                }
  +                catch (BuildException e) {
  +                    // ignore invalid paths 
  +                }
               }
           
               if (stream == null) {
  
  
  

Mime
View raw message