CVS: plexus-container/src/java/org/apache/plexus DefaultPlexusContainer.java,1.26,1.27

Jason van Zyl <[email protected]> Sun, 20 Jul 2003 21:16:33 -0500
Newsgroups gmane.comp.java.plexus.devel
Message-ID <[email protected]>
Update of /cvsroot/plexus/plexus-container/src/java/org/apache/plexus
In directory hogshead.codehaus.org:/tmp/cvs-serv30831/src/java/org/apache/plexus

Modified Files:
	DefaultPlexusContainer.java 
Log Message:
o Fixing a bug where configurations pulled in using the
'configurations-directory' directive were not being interpolated.


Index: DefaultPlexusContainer.java
===================================================================
RCS file: /cvsroot/plexus/plexus-container/src/java/org/apache/plexus/DefaultPlexusContainer.java,v
retrieving revision 1.26
retrieving revision 1.27
diff -u -d -r1.26 -r1.27
--- DefaultPlexusContainer.java	13 Jun 2003 01:52:24 -0000	1.26
+++ DefaultPlexusContainer.java	21 Jul 2003 02:16:31 -0000	1.27
@@ -349,15 +349,19 @@
     private void initializeConfiguration()
         throws Exception
     {
-        InterpolationFilterReader interpolationFilterReader =
-            new InterpolationFilterReader( getConfigurationReader(),
-                                           new ContextMapAdapter( getContext() ) );
-
-        setConfiguration( builder.parse( interpolationFilterReader ) );
+        setConfiguration( builder.parse( getInterpolationConfigurationReader( getConfigurationReader() ) ) );
 
         processConfigurationsDirectory();
     }
 
+    private Reader getInterpolationConfigurationReader( Reader reader )
+    {
+        InterpolationFilterReader interpolationFilterReader =
+            new InterpolationFilterReader( reader, new ContextMapAdapter( getContext() ) );
+
+        return interpolationFilterReader;
+    }
+
     /**
      * Process any additional component configuration files that have been
      * specified. The specified directory is scanned recursively so configurations
@@ -389,7 +393,9 @@
                 for ( int i = 0; i < confs.length; i++ )
                 {
                     File conf = new File( configurationsDirectory, confs[i] );
-                    Configuration c = builder.parse( new FileReader( conf ) );
+
+                    Configuration c = builder.parse( getInterpolationConfigurationReader( new FileReader( conf ) ) );
+
                     componentsConfiguration.addAllChildren( c.getChild( "components" ) );
                 }
             }