cvs commit: jakarta-bcel/src/java/org/apache/bcel/util SyntheticRepository.java

[email protected]
Newsgroups gmane.comp.jakarta.bcel.devel
Message-ID <[email protected]>
mdahm       2002/07/06 08:51:34

  Modified:    src/java/org/apache/bcel Repository.java
               src/java/org/apache/bcel/util SyntheticRepository.java
  Log:
  Bug fix #10517
  
  Revision  Changes    Path
  1.10      +8 -2      jakarta-bcel/src/java/org/apache/bcel/Repository.java
  
  Index: Repository.java
  ===================================================================
  RCS file: /home/cvs/jakarta-bcel/src/java/org/apache/bcel/Repository.java,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- Repository.java	13 Jun 2002 09:32:50 -0000	1.9
  +++ Repository.java	6 Jul 2002 15:51:34 -0000	1.10
  @@ -76,7 +76,13 @@
      */
     public static JavaClass lookupClass(String class_name) {
       try {
  -      return _repository.loadClass(class_name);
  +      JavaClass clazz = _repository.findClass(class_name);
  +
  +      if(clazz == null) {
  +	return _repository.loadClass(class_name);
  +      } else {
  +	return clazz;
  +      }
       } catch(ClassNotFoundException ex) { return null; }
     }
   
  
  
  
  1.4       +5 -4      jakarta-bcel/src/java/org/apache/bcel/util/SyntheticRepository.java
  
  Index: SyntheticRepository.java
  ===================================================================
  RCS file: /home/cvs/jakarta-bcel/src/java/org/apache/bcel/util/SyntheticRepository.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- SyntheticRepository.java	6 Jun 2002 11:32:05 -0000	1.3
  +++ SyntheticRepository.java	6 Jul 2002 15:51:34 -0000	1.4
  @@ -108,7 +108,7 @@
     public void storeClass(JavaClass clazz) {
       _loadedClasses.put(clazz.getClassName(), clazz);
       clazz.setRepository(this);
  -  }
  + }
   
     /**
      * Remove class from repository
  @@ -118,14 +118,15 @@
     }
   
     /**
  -   * Find an already defined JavaClass.
  +   * Find an already defined (cached) JavaClass object by name.
      */
     public JavaClass findClass(String className) {
       return (JavaClass)_loadedClasses.get(className);
     }
   
     /**
  -   * Lookup a JavaClass object from the class name provided.
  +   * Load a JavaClass object for the given class name using
  +   * the CLASSPATH environment variable.
      */
     public JavaClass loadClass(String className) 
       throws ClassNotFoundException
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.