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 2015/03/20 14:13:43 UTC

tomee git commit: TOMEE-1529 BaseEjbProxyHandler#equals was not optimized and could be very very slow when stacktrace was huge

Repository: tomee
Updated Branches:
  refs/heads/tomee-1.7.x a0e6ad472 -> 6f6df9158


TOMEE-1529 BaseEjbProxyHandler#equals was not optimized and could be very very slow when stacktrace was huge


Project: http://git-wip-us.apache.org/repos/asf/tomee/repo
Commit: http://git-wip-us.apache.org/repos/asf/tomee/commit/6f6df915
Tree: http://git-wip-us.apache.org/repos/asf/tomee/tree/6f6df915
Diff: http://git-wip-us.apache.org/repos/asf/tomee/diff/6f6df915

Branch: refs/heads/tomee-1.7.x
Commit: 6f6df9158da3be64cc2e07758efd8bb5cfbf533b
Parents: a0e6ad4
Author: Romain Manni-Bucau <rm...@apache.org>
Authored: Fri Mar 20 14:13:34 2015 +0100
Committer: Romain Manni-Bucau <rm...@apache.org>
Committed: Fri Mar 20 14:13:34 2015 +0100

----------------------------------------------------------------------
 .../org/apache/openejb/core/ivm/BaseEjbProxyHandler.java  | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tomee/blob/6f6df915/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 a63352f..3bbae2e 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
@@ -50,6 +50,7 @@ import java.io.Serializable;
 import java.lang.ref.WeakReference;
 import java.lang.reflect.InvocationHandler;
 import java.lang.reflect.Method;
+import java.lang.reflect.Proxy;
 import java.math.BigDecimal;
 import java.rmi.AccessException;
 import java.rmi.NoSuchObjectException;
@@ -492,16 +493,19 @@ public abstract class BaseEjbProxyHandler implements InvocationHandler, Serializ
         if (obj == null) {
             return false;
         }
+        if (this == obj) {
+            return true;
+        }
         if (!BaseEjbProxyHandler.class.isInstance(obj)) {
+            if (!Proxy.isProxyClass(obj.getClass())) {
+                return false;
+            }
             try {
                 obj = ProxyManager.getInvocationHandler(obj);
             } catch (final IllegalArgumentException e) {
                 return false;
             }
         }
-        if (this == obj) {
-            return true;
-        }
         final BaseEjbProxyHandler other = (BaseEjbProxyHandler) obj;
         return equalHandler(other);
     }