Repository: tomee Updated Branches: refs/heads/tomee-1.7.x ccb3706b9 -> 3a0787b24
fixing BaseEjbProxyHandler#equals regression handling local beans Project: http://git-wip-us.apache.org/repos/asf/tomee/repo Commit: http://git-wip-us.apache.org/repos/asf/tomee/commit/3a0787b2 Tree: http://git-wip-us.apache.org/repos/asf/tomee/tree/3a0787b2 Diff: http://git-wip-us.apache.org/repos/asf/tomee/diff/3a0787b2 Branch: refs/heads/tomee-1.7.x Commit: 3a0787b240e6e708c11f0ed05a1c5b6b97a7f38c Parents: ccb3706 Author: Romain Manni-Bucau <[email protected]> Authored: Tue Mar 24 11:16:01 2015 +0100 Committer: Romain Manni-Bucau <[email protected]> Committed: Tue Mar 24 11:16:01 2015 +0100 ---------------------------------------------------------------------- .../openejb/core/ivm/BaseEjbProxyHandler.java | 34 ++++++++++---------- 1 file changed, 17 insertions(+), 17 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/tomee/blob/3a0787b2/container/openejb-core/src/main/java/org/apache/openejb/core/ivm/BaseEjbProxyHandler.java ---------------------------------------------------------------------- diff --git a/container/openejb-core/src/main/java/org/apache/openejb/core/ivm/BaseEjbProxyHandler.java b/container/openejb-core/src/main/java/org/apache/openejb/core/ivm/BaseEjbProxyHandler.java index 3bbae2e..2a01773 100644 --- a/container/openejb-core/src/main/java/org/apache/openejb/core/ivm/BaseEjbProxyHandler.java +++ b/container/openejb-core/src/main/java/org/apache/openejb/core/ivm/BaseEjbProxyHandler.java @@ -27,18 +27,8 @@ import org.apache.openejb.core.ThreadContext; import org.apache.openejb.loader.SystemInstance; import org.apache.openejb.spi.ContainerSystem; import org.apache.openejb.spi.SecurityService; -import org.apache.openejb.util.proxy.ProxyManager; +import org.apache.openejb.util.proxy.LocalBeanProxyFactory; -import javax.ejb.AccessLocalException; -import javax.ejb.EJBException; -import javax.ejb.EJBTransactionRequiredException; -import javax.ejb.EJBTransactionRolledbackException; -import javax.ejb.NoSuchEJBException; -import javax.ejb.NoSuchObjectLocalException; -import javax.ejb.TransactionRequiredLocalException; -import javax.ejb.TransactionRolledbackLocalException; -import javax.transaction.TransactionRequiredException; -import javax.transaction.TransactionRolledbackException; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; @@ -63,6 +53,16 @@ import java.util.List; import java.util.Set; import java.util.WeakHashMap; import java.util.concurrent.locks.ReentrantLock; +import javax.ejb.AccessLocalException; +import javax.ejb.EJBException; +import javax.ejb.EJBTransactionRequiredException; +import javax.ejb.EJBTransactionRolledbackException; +import javax.ejb.NoSuchEJBException; +import javax.ejb.NoSuchObjectLocalException; +import javax.ejb.TransactionRequiredLocalException; +import javax.ejb.TransactionRolledbackLocalException; +import javax.transaction.TransactionRequiredException; +import javax.transaction.TransactionRolledbackException; import static org.apache.openejb.core.ivm.IntraVmCopyMonitor.State.CLASSLOADER_COPY; import static org.apache.openejb.core.ivm.IntraVmCopyMonitor.State.COPY; @@ -497,12 +497,12 @@ public abstract class BaseEjbProxyHandler implements InvocationHandler, Serializ return true; } if (!BaseEjbProxyHandler.class.isInstance(obj)) { - if (!Proxy.isProxyClass(obj.getClass())) { - return false; - } - try { - obj = ProxyManager.getInvocationHandler(obj); - } catch (final IllegalArgumentException e) { + final Class<?> aClass = obj.getClass(); + if (Proxy.isProxyClass(aClass)) { + obj = Proxy.getInvocationHandler(obj); + } else if (LocalBeanProxyFactory.isProxy(aClass)) { + obj = LocalBeanProxyFactory.getInvocationHandler(obj); + } else { return false; } }
