openwebbeans-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cove...@apache.org
Subject svn commit: r904559 - in /openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/container: InjectionResolver.java ResolutionUtil.java
Date Fri, 29 Jan 2010 17:04:24 GMT
Author: covener
Date: Fri Jan 29 17:04:23 2010
New Revision: 904559

URL: http://svn.apache.org/viewvc?rev=904559&view=rev
Log:
[OWB-255] provide details about the injection point during fatal deploy-time errors

Modified:
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/container/InjectionResolver.java
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/container/ResolutionUtil.java

Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/container/InjectionResolver.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/container/InjectionResolver.java?rev=904559&r1=904558&r2=904559&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/container/InjectionResolver.java
(original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/container/InjectionResolver.java
Fri Jan 29 17:04:23 2010
@@ -153,7 +153,7 @@
             }
         }
         
-        ResolutionUtil.checkResolvedBeans(beanSet, clazz, qualifiers);
+        ResolutionUtil.checkResolvedBeans(beanSet, clazz, qualifiers, injectionPoint);
         
         Bean<?> bean = beanSet.iterator().next();
         
@@ -220,7 +220,7 @@
         }
         
 
-        ResolutionUtil.checkResolvedBeans(beanSet, clazz, qualifiers);   
+        ResolutionUtil.checkResolvedBeans(beanSet, clazz, qualifiers, injectionPoint);  

 
         return beanSet.iterator().next();
         

Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/container/ResolutionUtil.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/container/ResolutionUtil.java?rev=904559&r1=904558&r2=904559&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/container/ResolutionUtil.java
(original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/container/ResolutionUtil.java
Fri Jan 29 17:04:23 2010
@@ -22,6 +22,7 @@
 import javax.enterprise.inject.AmbiguousResolutionException;
 import javax.enterprise.inject.UnsatisfiedResolutionException;
 import javax.enterprise.inject.spi.Bean;
+import javax.enterprise.inject.spi.InjectionPoint;
 
 import org.apache.webbeans.util.AnnotationUtil;
 import org.apache.webbeans.util.Asserts;
@@ -67,7 +68,12 @@
         AnnotationUtil.checkQualifierConditions(qualifiers);
     }
 
-    public static void checkResolvedBeans(Set<Bean<?>> resolvedSet, Class<?>
type, Annotation[] qualifiers)
+    public static void checkResolvedBeans(Set<Bean<?>> resolvedSet, Class<?>
type, Annotation[] qualifiers) 
+    {
+        checkResolvedBeans(resolvedSet, type, qualifiers, null);
+    }
+    
+    public static void checkResolvedBeans(Set<Bean<?>> resolvedSet, Class<?>
type, Annotation[] qualifiers, InjectionPoint injectionPoint)
     {
         StringBuffer qualifierMessage = new StringBuffer("[");
         
@@ -89,6 +95,11 @@
         {
             StringBuffer message = new StringBuffer("Api type [" + type.getName() + "] is
not found with the qualifiers ");            
             message.append(qualifierMessage);
+
+            if (injectionPoint != null) 
+            { 
+                message.append(" for injection into " + injectionPoint.toString());
+            }
             
             throw new UnsatisfiedResolutionException(message.toString());
         }



Mime
View raw message