ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From adammurd...@apache.org
Subject cvs commit: jakarta-ant-myrmidon/container/src/java/org/apache/myrmidon/components/library DefaultLibraryManager.java
Date Wed, 15 May 2002 10:10:14 GMT
adammurdoch    02/05/15 03:10:14

  Modified:    container/src/java/org/apache/myrmidon/components/library
                        DefaultLibraryManager.java
  Log:
  Use shared classloader for libraries with an empty classpath.
  
  Revision  Changes    Path
  1.6       +8 -2      jakarta-ant-myrmidon/container/src/java/org/apache/myrmidon/components/library/DefaultLibraryManager.java
  
  Index: DefaultLibraryManager.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant-myrmidon/container/src/java/org/apache/myrmidon/components/library/DefaultLibraryManager.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- DefaultLibraryManager.java	13 May 2002 09:52:30 -0000	1.5
  +++ DefaultLibraryManager.java	15 May 2002 10:10:14 -0000	1.6
  @@ -39,7 +39,7 @@
    * The default library manager implementation.
    *
    * @author <a href="mailto:adammurdoch@apache.org">Adam Murdoch</a>
  - * @version $Revision: 1.5 $ $Date: 2002/05/13 09:52:30 $
  + * @version $Revision: 1.6 $ $Date: 2002/05/15 10:10:14 $
    */
   public class DefaultLibraryManager
       implements Serviceable, Contextualizable, Initializable, LibraryManager
  @@ -141,6 +141,11 @@
       public Library createLibrary( final File[] files )
           throws Exception
       {
  +        if( files == null || files.length == 0 )
  +        {
  +            return m_rootLibrary;
  +        }
  +
           try
           {
               // Build a list of optional packages for the files
  @@ -201,12 +206,13 @@
               parentClassLoaders[ i ] = parentLibraries[ i ].getClassLoader();
           }
           final ClassLoader classLoader = new MultiParentURLClassLoader( urls, parentClassLoaders
);
  -        final Extension[] extns = packages[ 0 ].getAvailableExtensions();
           String name = null;
  +        final Extension[] extns = packages[ 0 ].getAvailableExtensions();
           if( extns != null && extns.length > 0 )
           {
               name = extns[ 0 ].getExtensionName();
           }
  +
           return new DefaultLibrary( name, null, classLoader, urls );
       }
   
  
  
  

--
To unsubscribe, e-mail:   <mailto:ant-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:ant-dev-help@jakarta.apache.org>


Mime
View raw message