cziegeler    01/10/12 06:04:03

  Modified:    .        build.xml
               bin/anttasks ClassAvailable.class
               bin/src  ClassAvailable.java
  Log:
  Fixed ClassAvailable task
  
  Revision  Changes    Path
  1.80      +1 -3      xml-cocoon2/build.xml
  
  Index: build.xml
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/build.xml,v
  retrieving revision 1.79
  retrieving revision 1.80
  diff -u -r1.79 -r1.80
  --- build.xml 2001/10/12 12:34:40     1.79
  +++ build.xml 2001/10/12 13:04:02     1.80
  @@ -302,9 +302,7 @@
       <available property="jaxen.present" classname="org.jaxen.dom.XPath">
         <classpath refid="classpath"/>
       </available>
  -    <available property="jfor.present" 
classname="org.jfor.jfor.converter.Converter">
  -      <classpath refid="classpath"/>
  -    </available>
  +    <ClassAvailable classpathref="classpath" property="jfor.present" 
classname="org.jfor.jfor.converter.Converter"/>
     </target>
   
     <!-- =================================================================== 
-->
  
  
  
  1.3       +38 -39    xml-cocoon2/bin/anttasks/ClassAvailable.class
  
        <<Binary file>>
  
  
  1.3       +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.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- ClassAvailable.java       2001/10/10 12:50:34     1.2
  +++ ClassAvailable.java       2001/10/12 13:04:03     1.3
  @@ -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