Description
stillalex, i found that the check for existence of the passed tree in CompiledPermissionImpl.buildVersionDelegatee is redundant, due to the while loop just before calling the method. line 204ff:
while (!versionableTree.exists()) { versionableTree = versionableTree.getParent(); } return new VersionTreePermission(tree, buildVersionDelegatee(versionableTree), providerCtx.getTreeProvider());
and subsequently:
private TreePermission buildVersionDelegatee(@NotNull Tree versionableTree) { if (!versionableTree.exists()) { return TreePermission.EMPTY; } else if (versionableTree.isRoot()) { return createRootPermission(versionableTree); } [...] }
due to the loop the method buildVersionDelegatee either gets an existing tree or the root tree. IMO we should remove that extra if (see attached patch). wdyt?