Author: covener
Date: Fri Feb 26 20:24:03 2010
New Revision: 916809

URL: http://svn.apache.org/viewvc?rev=916809&view=rev
Log:
OWB-309: If we're checking an interceptors validity as a defined-in-bean or
defined-in-interceptor interceptor, and the signature looks like it comes from
the other type of interceptor signature, avoid adding it to the stack but 
don't treat it as an error.

Modified:
    
openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/util/WebBeansUtil.java

Modified: 
openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/util/WebBeansUtil.java
URL: 
http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/util/WebBeansUtil.java?rev=916809&r1=916808&r2=916809&view=diff
==============================================================================
--- 
openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/util/WebBeansUtil.java
 (original)
+++ 
openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/util/WebBeansUtil.java
 Fri Feb 26 20:24:03 2010
@@ -835,7 +835,10 @@
                 {
                     if (!invocationContext)
                     {
-                        throw new WebBeansConfigurationException("@" + 
commonAnnotation.getSimpleName() + " annotated method : " + method.getName() + 
" in class : " + clazz.getName() + " can not take any formal arguments");   
+                        /* We thought we were looking at an bean class that 
intercepts itself (no invocation context),
+                         * but this is actually a definedInInterceptor 
Interceptor bound via @Interceptors.
+                         */
+                        return null;   
                     }
                     // Check method criterias
                     Class<?>[] params = 
ClassUtil.getMethodParameterTypes(method);
@@ -846,7 +849,8 @@
                 }
                 else if(invocationContext)
                 {
-                    throw new WebBeansConfigurationException("@" + 
commonAnnotation.getSimpleName() + " annotated method : " + method.getName() + 
" in class : " + clazz.getName() + " must take a parameter with class type 
javax.interceptor.InvocationContext.");                        
+                    // Maybe it just intercepts itself, but we were looking at 
it like an @Interceptor
+                    return null;
                 }
 
                 if (!ClassUtil.getReturnType(method).equals(Void.TYPE))


Reply via email to