Skip to content

Commit

Permalink
OAK-8266 : Redundant check for existing tree in CompiledPermissionImp…
Browse files Browse the repository at this point in the history
…l.buildVersionDelegatee

git-svn-id: https://svn.apache.org/repos/asf/jackrabbit/oak/trunk@1858199 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information
anchela committed Apr 26, 2019
1 parent a2a987c commit 0cd3f54
Showing 1 changed file with 5 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -201,9 +201,6 @@ public TreePermission getTreePermission(@NotNull Tree tree, @NotNull TreeType ty
* (or item in the subtree) but that item no longer exists
* -> evaluation by path might be more accurate (-> see #isGranted)
*/
while (!versionableTree.exists()) {
versionableTree = versionableTree.getParent();
}
return new VersionTreePermission(tree, buildVersionDelegatee(versionableTree), providerCtx.getTreeProvider());
}
}
Expand All @@ -222,11 +219,13 @@ public TreePermission getTreePermission(@NotNull Tree tree, @NotNull TreeType ty

@NotNull
private TreePermission buildVersionDelegatee(@NotNull Tree versionableTree) {
if (!versionableTree.exists()) {
return TreePermission.EMPTY;
} else if (versionableTree.isRoot()) {
while (!versionableTree.exists()) {
versionableTree = versionableTree.getParent();
}
if (versionableTree.isRoot()) {
return createRootPermission(versionableTree);
}

TreeType type = typeProvider.getType(versionableTree);
switch (type) {
case HIDDEN : return ALL;
Expand Down

0 comments on commit 0cd3f54

Please sign in to comment.