cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cziege...@apache.org
Subject cvs commit: xml-cocoon2/bin/src ClassAvailable.java
Date Fri, 12 Oct 2001 13:05:07 GMT
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:     webmaster@xml.apache.org
To unsubscribe, e-mail:          cocoon-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: cocoon-cvs-help@xml.apache.org


Mime
View raw message