avalon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nic...@apache.org
Subject svn commit: rev 23232 - avalon/trunk/runtime/composition/impl/src/java/org/apache/avalon/composition/model/impl
Date Sun, 25 Jul 2004 16:46:17 GMT
Author: niclas
Date: Sun Jul 25 09:46:16 2004
New Revision: 23232

Modified:
   avalon/trunk/runtime/composition/impl/src/java/org/apache/avalon/composition/model/impl/DefaultContainmentModelAssemblyHelper.java
Log:
Optional dependency didn't really work. Fixed.

Modified: avalon/trunk/runtime/composition/impl/src/java/org/apache/avalon/composition/model/impl/DefaultContainmentModelAssemblyHelper.java
==============================================================================
--- avalon/trunk/runtime/composition/impl/src/java/org/apache/avalon/composition/model/impl/DefaultContainmentModelAssemblyHelper.java
(original)
+++ avalon/trunk/runtime/composition/impl/src/java/org/apache/avalon/composition/model/impl/DefaultContainmentModelAssemblyHelper.java
Sun Jul 25 09:46:16 2004
@@ -207,7 +207,7 @@
         //
 
         DependencyModel[] dependencies = model.getDependencyModels();
-        for( int i=0; i<dependencies.length; i++ )
+        for( int i=0; i < dependencies.length; i++ )
         {
             DependencyModel dependency = dependencies[i];
             if( null == dependency.getProvider() )
@@ -221,10 +221,13 @@
                 }
                 catch( Throwable e )
                 {
-                    final String error = 
-                      "Unable to assemble component: " + model 
-                      + " due to a service provider establishment failure.";
-                    throw new AssemblyException( error, e );
+                    if( dependency.getDependency().isRequired() )
+                    {
+                        final String error = 
+                          "Unable to assemble component: " + model 
+                          + " due to a service provider establishment failure.";
+                        throw new AssemblyException( error, e );
+                    }
                 }
                 finally
                 {

---------------------------------------------------------------------
To unsubscribe, e-mail: cvs-unsubscribe@avalon.apache.org
For additional commands, e-mail: cvs-help@avalon.apache.org


Mime
View raw message