commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rsi...@apache.org
Subject cvs commit: jakarta-commons/discovery/src/java/org/apache/commons/discovery/resource ResourceDiscoverImpl.java
Date Wed, 06 Oct 2004 22:31:01 GMT
rsitze      2004/10/06 15:31:01

  Modified:    discovery/src/java/org/apache/commons/discovery/resource
                        ResourceDiscoverImpl.java
  Log:
  Defer creation of ClassLoaders until we need them,
  and create a useful default [non-null].
  
  Revision  Changes    Path
  1.5       +4 -2      jakarta-commons/discovery/src/java/org/apache/commons/discovery/resource/ResourceDiscoverImpl.java
  
  Index: ResourceDiscoverImpl.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/discovery/src/java/org/apache/commons/discovery/resource/ResourceDiscoverImpl.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- ResourceDiscoverImpl.java	27 Feb 2004 23:36:55 -0000	1.4
  +++ ResourceDiscoverImpl.java	6 Oct 2004 22:31:01 -0000	1.5
  @@ -38,7 +38,6 @@
        * Construct a new resource discoverer
        */
       public ResourceDiscoverImpl() {
  -        setClassLoaders(new ClassLoaders());
       }
       
       /**
  @@ -61,10 +60,13 @@
        * It is recommended to add the most specific loaders first.
        */
       public void addClassLoader(ClassLoader loader) {
  -        classLoaders.put(loader);
  +        getClassLoaders().put(loader);
       }
   
       protected ClassLoaders getClassLoaders() {
  +        if (classLoaders == null) {
  +            classLoaders = ClassLoaders.getLibLoaders(this.getClass(), null, true);
  +        }
           return classLoaders;
       }
   
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message