cziegeler    01/10/12 06:05:07

  Modified:    bin/anttasks Tag: cocoon_20_branch ClassAvailable.class
               bin/src  Tag: cocoon_20_branch ClassAvailable.java
  Log:
  Fixed ClassAvailable task
  
  Revision  Changes    Path
  No                   revision
  
  
  No                   revision
  
  
  1.1.2.2   +38 -39    xml-cocoon2/bin/anttasks/ClassAvailable.class
  
        <<Binary file>>
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.1.2.2   +11 -13    xml-cocoon2/bin/src/ClassAvailable.java
  
  Index: ClassAvailable.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/bin/src/ClassAvailable.java,v
  retrieving revision 1.1.2.1
  retrieving revision 1.1.2.2
  diff -u -r1.1.2.1 -r1.1.2.2
  --- ClassAvailable.java       2001/10/10 12:49:32     1.1.2.1
  +++ ClassAvailable.java       2001/10/12 13:05:07     1.1.2.2
  @@ -41,7 +41,7 @@
   
       public Path createClasspath() {
           if (this.classpath == null) {
  -            this.classpath = new Path(project);
  +            this.classpath = new Path(this.project);
           }
           return this.classpath.createPath();
       }
  @@ -83,7 +83,7 @@
               classpath.setProject(project);
           }
   
  -        if ((classname != null) && !checkClass(classname)) {
  +        if (!findClassInComponents(classname)) {
               log("Unable to load class " + classname + " to set property " + 
property, Project.MSG_VERBOSE);
               return false;
           }
  @@ -91,10 +91,6 @@
           return true;
       }
   
  -    private boolean checkClass(String classname) {
  -        return this.findClassInComponents(classname);
  -    }
  -
       /**
        * Get an inputstream to a given resource in the given file which may
        * either be a directory or a zip file.
  @@ -145,13 +141,15 @@
       private boolean findClassInComponents(String name) {
           // we need to search the components of the path to see if we can 
find the
           // class we want.
  -        InputStream stream = null;
  -        String classname = name.replace('.', '/') + ".class";
  -        String[] list = classpath.list();
  -        for (int i = 0; i < list.length; i++ ) {
  -            File pathComponent = (File)project.resolveFile(list[i]);
  -            return this.contains(pathComponent, classname);
  +        final String classname = name.replace('.', '/') + ".class";
  +        final String[] list = classpath.list();
  +        boolean found = false;
  +        int i = 0;
  +        while (i < list.length && found == false) {
  +            final File pathComponent = (File)project.resolveFile(list[i]);
  +            found = this.contains(pathComponent, classname);
  +            i++;
           }
  -        return false;
  +        return found;
       }
   }
  
  
  

----------------------------------------------------------------------
In case of troubles, e-mail:     [EMAIL PROTECTED]
To unsubscribe, e-mail:          [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to