[webbeans-commits] Webbeans SVN: r2432 - ri/trunk/impl/src/main/java/org/jboss/webbeans/injection.

webbeans-commits at lists.jboss.org webbeans-commits at lists.jboss.org
Thu Apr 16 10:27:01 EDT 2009


Author: cpopetz
Date: 2009-04-16 10:27:01 -0400 (Thu, 16 Apr 2009)
New Revision: 2432

Modified:
   ri/trunk/impl/src/main/java/org/jboss/webbeans/injection/NonContextualInjector.java
Log:
Don't deactivate the app context if it was active on entry, as it doesn't protect itself from
reentrant calls like the dependent scope does.


Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/injection/NonContextualInjector.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/injection/NonContextualInjector.java	2009-04-16 12:33:10 UTC (rev 2431)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/injection/NonContextualInjector.java	2009-04-16 14:27:01 UTC (rev 2432)
@@ -98,7 +98,11 @@
       if (DependentContext.instance() != null && ApplicationContext.instance() != null)
       {
          DependentContext.instance().setActive(true);
-         ApplicationContext.instance().setActive(true);
+         boolean startApplication = !ApplicationContext.instance().isActive();
+         if (startApplication)
+         {
+            ApplicationContext.instance().setActive(true);
+         }
          Set<FieldInjectionPoint<?>> injectionPoints = instances.putIfAbsent(instance.getClass(), new Callable<Set<FieldInjectionPoint<?>>>()
          {
             
@@ -114,7 +118,10 @@
             injectionPoint.inject(instance, manager, null);
          }
          DependentContext.instance().setActive(false);
-         ApplicationContext.instance().setActive(false);
+         if (startApplication)
+         {
+            ApplicationContext.instance().setActive(false);
+         }
       }
    }
    




More information about the weld-commits mailing list