From 2c2d283868755776bf327e6de0fda002fffd06e8 Mon Sep 17 00:00:00 2001 From: Mark Rogers Date: Tue, 22 Jul 2014 13:51:08 +0000 Subject: [PATCH] Merged HEAD-BUG-FIX (5.0/Cloud) to HEAD (5.0/Cloud) 76027: Merged V4.2-BUG-FIX (4.2.3) to HEAD-BUG-FIX (5.0/Cloud) 75707: Merged DEV to V4.2-BUG-FIX (4.2.3) 71368 : MNT-11318 : Rule script gets executed six times when a document is moved - implement equals and hashCode methods for policy proxies with SingleHandler git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@77548 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261 --- .../alfresco/repo/policy/PolicyFactory.java | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/source/java/org/alfresco/repo/policy/PolicyFactory.java b/source/java/org/alfresco/repo/policy/PolicyFactory.java index 71e818a874..8e59aebd81 100644 --- a/source/java/org/alfresco/repo/policy/PolicyFactory.java +++ b/source/java/org/alfresco/repo/policy/PolicyFactory.java @@ -271,6 +271,25 @@ import org.alfresco.service.cmr.repository.StoreRef; throw e.getTargetException(); } } + + public boolean equals(Object obj) + { + if (obj != null && Proxy.isProxyClass(obj.getClass())) + { + InvocationHandler handler = Proxy.getInvocationHandler(obj); + if (handler instanceof SingleHandler) + { + return ((SingleHandler)handler).policyInterface.equals(policyInterface); + } + } + + return obj.equals(policyInterface); + } + + public int hashCode() + { + return policyInterface.hashCode(); + } }