openwebbeans-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gpetra...@apache.org
Subject svn commit: r1484906 - /openwebbeans/branches/owb_1.1.x/webbeans-impl/src/main/java/org/apache/webbeans/util/InjectionExceptionUtils.java
Date Tue, 21 May 2013 19:03:32 GMT
Author: gpetracek
Date: Tue May 21 19:03:32 2013
New Revision: 1484906

URL: http://svn.apache.org/r1484906
Log:
OWB-774 additional hint in case of an AmbiguousResolutionException

Modified:
    openwebbeans/branches/owb_1.1.x/webbeans-impl/src/main/java/org/apache/webbeans/util/InjectionExceptionUtils.java

Modified: openwebbeans/branches/owb_1.1.x/webbeans-impl/src/main/java/org/apache/webbeans/util/InjectionExceptionUtils.java
URL: http://svn.apache.org/viewvc/openwebbeans/branches/owb_1.1.x/webbeans-impl/src/main/java/org/apache/webbeans/util/InjectionExceptionUtils.java?rev=1484906&r1=1484905&r2=1484906&view=diff
==============================================================================
--- openwebbeans/branches/owb_1.1.x/webbeans-impl/src/main/java/org/apache/webbeans/util/InjectionExceptionUtils.java
(original)
+++ openwebbeans/branches/owb_1.1.x/webbeans-impl/src/main/java/org/apache/webbeans/util/InjectionExceptionUtils.java
Tue May 21 19:03:32 2013
@@ -123,9 +123,20 @@ public class InjectionExceptionUtils
 
     private static void addBeanInfo(Set<Bean<?>> beans, ViolationMessageBuilder
violationMessage)
     {
+        String sourcePath;
         for(Bean<?> currentBean : beans)
         {
-            violationMessage.addLine(currentBean.toString());
+            try
+            {
+                Class beanClass = currentBean.getBeanClass();
+                sourcePath = beanClass.getResource(beanClass.getSimpleName() + ".class").toExternalForm();
+            }
+            catch (RuntimeException e)
+            {
+                sourcePath = "unknown path";
+            }
+
+            violationMessage.addLine(currentBean.toString() + " from " + sourcePath);
         }
     }
 



Mime
View raw message