[jboss-cvs] javassist/src/main/javassist/scopedpool ...

Kabir Khan kkhan at jboss.com
Fri Feb 9 11:39:32 EST 2007


  User: kkhan   
  Date: 07/02/09 11:39:32

  Modified:    src/main/javassist/scopedpool  ScopedClassPool.java
  Log:
  Repair previous mistake when commiting
  
  Revision  Changes    Path
  1.7       +36 -10    javassist/src/main/javassist/scopedpool/ScopedClassPool.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: ScopedClassPool.java
  ===================================================================
  RCS file: /cvsroot/jboss/javassist/src/main/javassist/scopedpool/ScopedClassPool.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -b -r1.6 -r1.7
  --- ScopedClassPool.java	17 Aug 2006 13:18:11 -0000	1.6
  +++ ScopedClassPool.java	9 Feb 2007 16:39:32 -0000	1.7
  @@ -31,7 +31,7 @@
    * @author <a href="mailto:bill at jboss.org">Bill Burke</a>
    * @author <a href="adrian at jboss.com">Adrian Brock</a>
    * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
  - * @version $Revision: 1.6 $
  + * @version $Revision: 1.7 $
    */
   public class ScopedClassPool extends ClassPool {
       protected ScopedClassPoolRepository repository;
  @@ -42,6 +42,8 @@
   
       protected SoftValueHashMap softcache = new SoftValueHashMap();
   
  +    boolean isBootstrapCl = true;
  +
       static {
           ClassPool.doPruning = false;
           ClassPool.releaseUnmodifiedClassFile = false;
  @@ -56,9 +58,27 @@
        *            the original class pool
        * @param repository
        *            the repository
  +     *@deprecated
        */
       protected ScopedClassPool(ClassLoader cl, ClassPool src,
               ScopedClassPoolRepository repository) {
  +       this(cl, src, repository, false);
  +    }
  +    
  +    /**
  +     * Create a new ScopedClassPool.
  +     * 
  +     * @param cl
  +     *            the classloader
  +     * @param src
  +     *            the original class pool
  +     * @param repository
  +     *            the repository
  +     * @param isTemp
  +     *            Whether this is a temporary pool used to resolve references
  +     */
  +    protected ScopedClassPool(ClassLoader cl, ClassPool src, ScopedClassPoolRepository repository, boolean isTemp)
  +    {
           super(src);
           this.repository = repository;
           this.classLoader = new WeakReference(cl);
  @@ -67,6 +87,10 @@
               this.insertClassPath(classPath);
           }
           childFirstLookup = true;
  +       if (!isTemp && cl == null)
  +       {
  +          isBootstrapCl = true;
  +       }
       }
   
       /**
  @@ -76,9 +100,11 @@
        */
       public ClassLoader getClassLoader() {
          ClassLoader cl = getClassLoader0();
  -       if (cl == null)
  +       if (cl == null && !isBootstrapCl)
  +       {
             throw new IllegalStateException(
                     "ClassLoader has been garbage collected");
  +       }
          return cl;
       }
   
  
  
  



More information about the jboss-cvs-commits mailing list