openwebbeans-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From strub...@apache.org
Subject svn commit: r894508 - /openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/config/DefinitionUtil.java
Date Tue, 29 Dec 2009 23:15:19 GMT
Author: struberg
Date: Tue Dec 29 23:15:19 2009
New Revision: 894508

URL: http://svn.apache.org/viewvc?rev=894508&view=rev
Log:
OWB-212 improve logging in case of a not finding the bean which should get disposed

Modified:
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/config/DefinitionUtil.java

Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/config/DefinitionUtil.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/config/DefinitionUtil.java?rev=894508&r1=894507&r2=894508&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/config/DefinitionUtil.java
(original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/config/DefinitionUtil.java
Tue Dec 29 23:15:19 2009
@@ -21,6 +21,7 @@
 import java.lang.reflect.Modifier;
 import java.lang.reflect.ParameterizedType;
 import java.lang.reflect.Type;
+import java.util.Arrays;
 import java.util.HashSet;
 import java.util.List;
 import java.util.Set;
@@ -704,6 +705,11 @@
 
 
             Set<Bean<?>> set = InjectionResolver.getInstance().implResolveByType(type,
annot);
+            if (set.isEmpty()) {
+                throw new UnsatisfiedResolutionException("Producer method component of the
disposal method : " + declaredMethod.getName() + 
+                              " in class : " + clazz.getName() + ". Cannot find bean " +
type + " with qualifier " + Arrays.toString(annot));
+            }
+            
             Bean<?> bean = set.iterator().next();
             ProducerMethodBean<?> pr = null;
 



Mime
View raw message