You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tomee.apache.org by rm...@apache.org on 2014/08/30 10:58:02 UTC

svn commit: r1621435 - in /tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb: BeanContext.java core/stateful/StatefulContainer.java

Author: rmannibucau
Date: Sat Aug 30 08:58:01 2014
New Revision: 1621435

URL: http://svn.apache.org/r1621435
Log:
simplifying code - no logic change

Modified:
    tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/BeanContext.java
    tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/core/stateful/StatefulContainer.java

Modified: tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/BeanContext.java
URL: http://svn.apache.org/viewvc/tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/BeanContext.java?rev=1621435&r1=1621434&r2=1621435&view=diff
==============================================================================
--- tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/BeanContext.java (original)
+++ tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/BeanContext.java Sat Aug 30 08:58:01 2014
@@ -101,7 +101,6 @@ public class BeanContext extends Deploym
     public static final String USER_INTERCEPTOR_KEY = "org.apache.openejb.default.system.interceptors";
     public static final String USER_INTERCEPTOR_SEPARATOR = ",| |;";
 
-    private final boolean isPassivatingScope = true;
     private ConstructorInjectionBean<Object> constructorInjectionBean;
     private final boolean passivable;
 
@@ -1767,7 +1766,7 @@ public class BeanContext extends Deploym
     public boolean isPassivatingScope() {
         final CdiEjbBean<?> bean = get(CdiEjbBean.class);
         if (bean == null) {
-            return isPassivatingScope;
+            return true;
         }
 
         if (ConversationScoped.class == bean.getScope()) {
@@ -1778,7 +1777,7 @@ public class BeanContext extends Deploym
             }
         }
 
-        return isPassivatingScope;
+        return true;
     }
 
     public boolean isPassivable() {
@@ -1786,8 +1785,8 @@ public class BeanContext extends Deploym
     }
 
     public void stop() {
-        if (ejbTimerService != null && ejbTimerService instanceof EjbTimerServiceImpl) {
-            ((EjbTimerServiceImpl) ejbTimerService).stop();
+        if (ejbTimerService != null) {
+            ejbTimerService.stop();
         }
     }
 

Modified: tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/core/stateful/StatefulContainer.java
URL: http://svn.apache.org/viewvc/tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/core/stateful/StatefulContainer.java?rev=1621435&r1=1621434&r2=1621435&view=diff
==============================================================================
--- tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/core/stateful/StatefulContainer.java (original)
+++ tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/core/stateful/StatefulContainer.java Sat Aug 30 08:58:01 2014
@@ -382,10 +382,7 @@ public class StatefulContainer implement
             return true;
         }
         final Index<EntityManagerFactory, Map> factories = beanContext.getExtendedEntityManagerFactories();
-        if (factories != null && factories.size() > 0) {
-            return false;
-        }
-        return beanContext.isPassivable();
+        return !(factories != null && factories.size() > 0) && beanContext.isPassivable();
     }
 
     protected ProxyInfo createEJBObject(final BeanContext beanContext, final Method callMethod, final Object[] args, final InterfaceType interfaceType) throws OpenEJBException {