[jboss-cvs] JBossAS SVN: r73094 - projects/ejb3/trunk/interceptors/src/main/java/org/jboss/ejb3/interceptors/aop.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Tue May 6 20:28:47 EDT 2008


Author: ALRubinger
Date: 2008-05-06 20:28:47 -0400 (Tue, 06 May 2008)
New Revision: 73094

Modified:
   projects/ejb3/trunk/interceptors/src/main/java/org/jboss/ejb3/interceptors/aop/InterceptorsFactory.java
Log:
[EJBTHREE-1339] Fix NPE, issue still fails as interceptors for lifecycle methods not called

Modified: projects/ejb3/trunk/interceptors/src/main/java/org/jboss/ejb3/interceptors/aop/InterceptorsFactory.java
===================================================================
--- projects/ejb3/trunk/interceptors/src/main/java/org/jboss/ejb3/interceptors/aop/InterceptorsFactory.java	2008-05-07 00:08:43 UTC (rev 73093)
+++ projects/ejb3/trunk/interceptors/src/main/java/org/jboss/ejb3/interceptors/aop/InterceptorsFactory.java	2008-05-07 00:28:47 UTC (rev 73094)
@@ -278,9 +278,21 @@
       return (Map<Class<? extends Annotation>, List<Interceptor>>) instanceAdvisor.getMetaData().getMetaData(InterceptorsFactory.class, "lifeCycleInterceptors");
    }
    
-   public static List<Interceptor> getLifeCycleInterceptors(InstanceAdvisor instanceAdvisor, Class<? extends Annotation> lifeCycleAnnotationClass)
+   public static List<Interceptor> getLifeCycleInterceptors(InstanceAdvisor instanceAdvisor,
+         Class<? extends Annotation> lifeCycleAnnotationClass)
    {
-      return getLifeCycleInterceptors(instanceAdvisor).get(lifeCycleAnnotationClass);
+      // Obtain lifecycle interceptors
+      Map<Class<? extends Annotation>, List<Interceptor>> lifecycleInterceptors = getLifeCycleInterceptors(instanceAdvisor);
+
+      // If there are no lifecycle interceptors
+      if (lifecycleInterceptors == null)
+      {
+         // Return an empty list
+         return new ArrayList<Interceptor>();
+      }
+      
+      // Return the interceptors for this lifecycle annotation class
+      return lifecycleInterceptors.get(lifeCycleAnnotationClass);
    }
    
    /**




More information about the jboss-cvs-commits mailing list