openwebbeans-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From strub...@apache.org
Subject svn commit: r1798821 - in /openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans: component/creation/ObserverMethodsBuilder.java event/ObserverMethodImpl.java
Date Thu, 15 Jun 2017 12:39:44 GMT
Author: struberg
Date: Thu Jun 15 12:39:44 2017
New Revision: 1798821

URL: http://svn.apache.org/viewvc?rev=1798821&view=rev
Log:
OWB-1182 fire ProcessInjectionPoint for observer method parameters

Modified:
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/creation/ObserverMethodsBuilder.java
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/event/ObserverMethodImpl.java

Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/creation/ObserverMethodsBuilder.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/creation/ObserverMethodsBuilder.java?rev=1798821&r1=1798820&r2=1798821&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/creation/ObserverMethodsBuilder.java
(original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/creation/ObserverMethodsBuilder.java
Thu Jun 15 12:39:44 2017
@@ -106,27 +106,28 @@ public class ObserverMethodsBuilder<T>
     {
         List<AnnotatedParameter<?>> parameters = (List<AnnotatedParameter<?>>)(List<?>)annotatedMethod.getParameters();
         AnnotatedParameter<?> observesParameter = null;
-        for(AnnotatedParameter<?> parameter : parameters)
+        for (AnnotatedParameter<?> parameter : parameters)
         {
-            if(parameter.isAnnotationPresent(Observes.class) || parameter.isAnnotationPresent(ObservesAsync.class))
+            if (parameter.isAnnotationPresent(Observes.class) || parameter.isAnnotationPresent(ObservesAsync.class))
             {
                 if (observesParameter != null)
                 {
                     throw new WebBeansConfigurationException("Observer method : " + annotatedMethod.getJavaMember().getName()
                             + " in class : " + annotatedMethod.getJavaMember().getDeclaringClass().getName()
-                            + " must not define two parameters that are annotated with @Observes");
+                            + " must not define two parameters that are annotated with @Observes
or @ObservesAsync");
                 }
                 observesParameter = parameter;
             }
         }
 
-        if(observesParameter != null)
+        if (observesParameter != null)
         {
             checkObserverMethodConditions(ownerBean, observesParameter);
 
             //Looking for ObserverMethod
             ObserverMethod<?> definedObserver = webBeansContext.getNotificationManager().
                     getObservableMethodForAnnotatedMethod(annotatedMethod, observesParameter,
ownerBean);
+
             return definedObserver;
         }
 

Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/event/ObserverMethodImpl.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/event/ObserverMethodImpl.java?rev=1798821&r1=1798820&r2=1798821&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/event/ObserverMethodImpl.java
(original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/event/ObserverMethodImpl.java
Thu Jun 15 12:39:44 2017
@@ -24,7 +24,6 @@ import java.lang.reflect.Method;
 import java.lang.reflect.Modifier;
 import java.lang.reflect.Type;
 import java.util.ArrayList;
-import java.util.Collection;
 import java.util.HashSet;
 import java.util.LinkedHashSet;
 import java.util.List;
@@ -58,7 +57,6 @@ import org.apache.webbeans.container.Bea
 import org.apache.webbeans.context.creational.CreationalContextImpl;
 import org.apache.webbeans.exception.WebBeansConfigurationException;
 import org.apache.webbeans.exception.WebBeansException;
-import org.apache.webbeans.inject.impl.InjectionPointFactory;
 import org.apache.webbeans.logger.WebBeansLoggerFacade;
 import org.apache.webbeans.proxy.OwbNormalScopeProxy;
 import org.apache.webbeans.spi.plugins.OpenWebBeansEjbPlugin;
@@ -191,9 +189,7 @@ public class ObserverMethodImpl<T> imple
         {
             if (!parameter.isAnnotationPresent(observerAnnotation))
             {
-                Collection<Annotation> qualifierAnnots = getWebBeansContext().getAnnotationManager().getQualifierAnnotations(parameter.getAnnotations());
-
-                injectionPoints.add(InjectionPointFactory.getPartialInjectionPoint(ownerBean,
parameter, qualifierAnnots));
+                injectionPoints.add(getWebBeansContext().getInjectionPointFactory().buildInjectionPoint(ownerBean,
parameter, true));
             }
         }
 



Mime
View raw message