ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dona...@apache.org
Subject cvs commit: jakarta-ant/proposal/myrmidon/src/java/org/apache/myrmidon/components/deployer DefaultDeployer.java
Date Thu, 07 Feb 2002 12:43:26 GMT
donaldp     02/02/07 04:43:26

  Modified:    proposal/myrmidon/src/java/org/apache/myrmidon/components/deployer
                        DefaultDeployer.java
  Log:
  Avoided aliasing problem when creating child deployers by creating a new HashMap and adding
all parents entrys rather than just referring to parents copy  (which could lead to you altering
the parents copy accidently)
  
  Revision  Changes    Path
  1.20      +5 -4      jakarta-ant/proposal/myrmidon/src/java/org/apache/myrmidon/components/deployer/DefaultDeployer.java
  
  Index: DefaultDeployer.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/java/org/apache/myrmidon/components/deployer/DefaultDeployer.java,v
  retrieving revision 1.19
  retrieving revision 1.20
  diff -u -r1.19 -r1.20
  --- DefaultDeployer.java	7 Feb 2002 11:59:02 -0000	1.19
  +++ DefaultDeployer.java	7 Feb 2002 12:43:26 -0000	1.20
  @@ -48,13 +48,13 @@
       private PackageManager m_packageManager;
   
       /** Map from ClassLoader to the deployer for that class loader. */
  -    private Map m_classLoaderDeployers = new HashMap();
  +    private final Map m_classLoaderDeployers = new HashMap();
   
       /**
        * Map from File to the ClassLoader for that library.  This map is shared
        * by all descendents of the root deployer.
        */
  -    private Map m_fileDeployers;
  +    private final Map m_fileDeployers;
   
       /**
        * Creates a root deployer.
  @@ -67,7 +67,8 @@
       private DefaultDeployer( final DefaultDeployer parent )
       {
           m_parent = parent;
  -        m_fileDeployers = parent.m_fileDeployers;
  +        m_fileDeployers = new HashMap();
  +        m_fileDeployers.putAll( parent.m_fileDeployers );
       }
   
       /**
  @@ -140,7 +141,7 @@
       private URLClassLoader getClassLoaderForFile( final File file )
           throws Exception
       {
  -        File canonFile = file.getCanonicalFile();
  +        final File canonFile = file.getCanonicalFile();
   
           // Locate cached classloader, creating it if necessary
           URLClassLoader classLoader = (URLClassLoader)m_fileDeployers.get( canonFile );
  
  
  

--
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