Author: struberg
Date: Wed Jan 16 23:46:42 2013
New Revision: 1434504

URL: http://svn.apache.org/viewvc?rev=1434504&view=rev
Log:
OWB-344 fix interceptor-only lifecycle methods

Modified:
    
openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/portable/InjectionTargetImpl.java

Modified: 
openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/portable/InjectionTargetImpl.java
URL: 
http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/portable/InjectionTargetImpl.java?rev=1434504&r1=1434503&r2=1434504&view=diff
==============================================================================
--- 
openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/portable/InjectionTargetImpl.java
 (original)
+++ 
openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/portable/InjectionTargetImpl.java
 Wed Jan 16 23:46:42 2013
@@ -304,12 +304,6 @@ public class InjectionTargetImpl<T> exte
     @Override
     public void postConstruct(final T instance)
     {
-        if (postConstructMethods == null || postConstructMethods.size() == 0)
-        {
-            return;
-        }
-
-
         Map<Interceptor<?>, ?> interceptorInstances = null;
         T internalInstance = instance;
 
@@ -324,6 +318,10 @@ public class InjectionTargetImpl<T> exte
                 internalInstance = (T) dih.getTarget();
             }
         }
+        else if (postConstructMethods == null || postConstructMethods.size() 
== 0)
+        {
+            return;
+        }
 
         InvocationContext ic = new 
LifecycleInterceptorInvocationContext<T>(internalInstance, 
InterceptionType.POST_CONSTRUCT, postConstructInterceptors,
                                                                             
interceptorInstances, postConstructMethods);
@@ -340,11 +338,6 @@ public class InjectionTargetImpl<T> exte
     @Override
     public void preDestroy(T instance)
     {
-        if (preDestroyMethods == null || preDestroyMethods.size() == 0)
-        {
-            return;
-        }
-
         Map<Interceptor<?>, ?> interceptorInstances = null;
         T internalInstance = instance;
 
@@ -359,6 +352,10 @@ public class InjectionTargetImpl<T> exte
                 internalInstance = (T) dih.getTarget();
             }
         }
+        else if (preDestroyMethods == null || preDestroyMethods.size() == 0)
+        {
+            return;
+        }
 
         InvocationContext ic = new 
LifecycleInterceptorInvocationContext<T>(internalInstance, 
InterceptionType.PRE_DESTROY, preDestroyInterceptors,
                                                                             
interceptorInstances, preDestroyMethods);


Reply via email to