jackrabbit-oak-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ang...@apache.org
Subject svn commit: r1539087 - in /jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak: core/SecureNodeState.java security/authorization/permission/CompiledPermissionImpl.java
Date Tue, 05 Nov 2013 18:05:03 GMT
Author: angela
Date: Tue Nov  5 18:05:03 2013
New Revision: 1539087

URL: http://svn.apache.org/r1539087
Log:
OAK-1146 : Remove equals/hashcode on SecureNodeState and TreePermissionImpl

Modified:
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/core/SecureNodeState.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/security/authorization/permission/CompiledPermissionImpl.java

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/core/SecureNodeState.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/core/SecureNodeState.java?rev=1539087&r1=1539086&r2=1539087&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/core/SecureNodeState.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/core/SecureNodeState.java
Tue Nov  5 18:05:03 2013
@@ -161,25 +161,6 @@ class SecureNodeState extends AbstractNo
         return new MemoryNodeBuilder(this);
     }
 
-    //-------------------------------------------------------------< Object >---
-
-    @Override
-    public boolean equals(Object object) {
-        if (object == this) {
-            return true;
-        } else if (object instanceof SecureNodeState) {
-            SecureNodeState that = (SecureNodeState) object;
-            // TODO: We should be able to do this optimization also across
-            // different revisions (root states) as long as the path,
-            // the subtree, and any security-related areas like the
-            // permission store are equal for both states.
-            if (state.equals(that.state) && treePermission.equals(that.treePermission))
{
-                return true;
-            }
-        }
-        return super.equals(object);
-    }
-
     //------------------------------------------------------< inner classes >---
 
     /**

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/security/authorization/permission/CompiledPermissionImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/security/authorization/permission/CompiledPermissionImpl.java?rev=1539087&r1=1539086&r2=1539087&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/security/authorization/permission/CompiledPermissionImpl.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/security/authorization/permission/CompiledPermissionImpl.java
Tue Nov  5 18:05:03 2013
@@ -413,7 +413,6 @@ final class CompiledPermissionImpl imple
 
     private final class TreePermissionImpl implements TreePermission {
 
-        private final ImmutableTree rootTree;
         private final ImmutableTree tree;
         private final TreePermissionImpl parent;
 
@@ -430,14 +429,8 @@ final class CompiledPermissionImpl imple
             this.tree = tree;
             if (parentPermission instanceof TreePermissionImpl) {
                 parent = (TreePermissionImpl) parentPermission;
-                rootTree = parent.rootTree;
             } else {
                 parent = null;
-                if (tree.isRoot()) {
-                    rootTree = tree;
-                } else {
-                    rootTree = root.getTree("/");
-                }
             }
             readableTree = readPolicy.isReadableTree(tree, parent);
             isAcTree = (treeType == TreeTypeProvider.TYPE_AC);
@@ -515,29 +508,6 @@ final class CompiledPermissionImpl imple
             return hasPermissions(getIterator(property), permissions, tree.getPath());
         }
 
-        //---------------------------------------------------------< Object >---
-        @Override
-        public boolean equals(Object object) {
-            if (object == this) {
-                return true;
-            } else if (object instanceof TreePermissionImpl) {
-                TreePermissionImpl that = (TreePermissionImpl) object;
-                // TODO: We should be able to do this optimization also across
-                // different revisions (root states) as long as the path,
-                // the subtree, and any security-related areas like the
-                // permission store are equal for both states.
-                return rootTree.equals(that.rootTree)
-                        && tree.getPath().equals(that.tree.getPath());
-            } else {
-                return false;
-            }
-        }
-
-        @Override
-        public int hashCode() {
-            return 0;
-        }
-
         //--------------------------------------------------------< private >---
         private Iterator<PermissionEntry> getIterator(@Nullable PropertyState property)
{
             EntryPredicate predicate = new EntryPredicate(tree, property);



Mime
View raw message