test_class.declarator: permissionStore
test_class.modifier: private
test_class.original_string: private PermissionStoreImpl permissionStore;
test_class.type: PermissionStoreImpl
test_class.var_name: permissionStore
test_class.declarator: testPrincipal
test_class.modifier: private
test_class.original_string: private Principal testPrincipal;
test_class.type: Principal
test_class.var_name: testPrincipal
test_class.declarator: testPath = "/testPath"
test_class.modifier: private
test_class.original_string: private String testPath = "/testPath";
test_class.type: String
test_class.var_name: testPath
test_class.declarator: childPath = "/testPath/childNode"
test_class.modifier: private
test_class.original_string: private String childPath = "/testPath/childNode";
test_class.type: String
test_class.var_name: childPath
test_class.file: oak-core/src/test/java/org/apache/jackrabbit/oak/security/authorization/permission/PermissionStoreImplTest.java
test_class.identifier: PermissionStoreImplTest
test_class.interfaces: implements PermissionConstants
test_class.superclass: extends AbstractSecurityTest
test_case.body: @Test
      public void testGetNumEntriesMissingProperty() throws Exception {
          try {
              Tree everyoneTree = getPermissionRoot(EveryonePrincipal.NAME);
              everyoneTree.removeProperty(REP_NUM_PERMISSIONS);
  
              assertEquals(NumEntries.valueOf(2, false), permissionStore.getNumEntries(EveryonePrincipal.NAME, Long.MAX_VALUE));
          } finally {
              root.refresh();
          }
      }
test_case.class_method_signature: PermissionStoreImplTest.testGetNumEntriesMissingProperty()
test_case.full_signature: @Test public void testGetNumEntriesMissingProperty()
test_case.identifier: testGetNumEntriesMissingProperty
test_case.invocations: getPermissionRoot removeProperty assertEquals valueOf getNumEntries refresh
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testGetNumEntriesMissingProperty()
focal_class.declarator: log = LoggerFactory.getLogger(PermissionStoreImpl.class)
focal_class.modifier: private static final
focal_class.original_string: private static final Logger log = LoggerFactory.getLogger(PermissionStoreImpl.class);
focal_class.type: Logger
focal_class.var_name: log
focal_class.declarator: permissionRootName
focal_class.modifier: private final
focal_class.original_string: private final String permissionRootName;
focal_class.type: String
focal_class.var_name: permissionRootName
focal_class.declarator: restrictionProvider
focal_class.modifier: private final
focal_class.original_string: private final RestrictionProvider restrictionProvider;
focal_class.type: RestrictionProvider
focal_class.var_name: restrictionProvider
focal_class.declarator: principalTreeMap = new HashMap<>()
focal_class.modifier: private final
focal_class.original_string: private final Map<String, Tree> principalTreeMap = new HashMap<>();
focal_class.type: Map<String, Tree>
focal_class.var_name: principalTreeMap
focal_class.declarator: permissionsTree
focal_class.modifier: private
focal_class.original_string: private Tree permissionsTree;
focal_class.type: Tree
focal_class.var_name: permissionsTree
focal_class.declarator: bitsProvider
focal_class.modifier: private
focal_class.original_string: private PrivilegeBitsProvider bitsProvider;
focal_class.type: PrivilegeBitsProvider
focal_class.var_name: bitsProvider
focal_class.file: oak-core/src/main/java/org/apache/jackrabbit/oak/security/authorization/permission/PermissionStoreImpl.java
focal_class.identifier: PermissionStoreImpl
focal_class.interfaces: implements PermissionStore, PermissionConstants
focal_class.class_method_signature: PermissionStoreImpl.PermissionStoreImpl(@NotNull Root root, @NotNull String permissionRootName, @NotNull RestrictionProvider restrictionProvider)
focal_class.full_signature:   PermissionStoreImpl(@NotNull Root root, @NotNull String permissionRootName, @NotNull RestrictionProvider restrictionProvider)
focal_class.identifier: PermissionStoreImpl
focal_class.parameters: (@NotNull Root root, @NotNull String permissionRootName, @NotNull RestrictionProvider restrictionProvider)
focal_class.signature:  PermissionStoreImpl(@NotNull Root root, @NotNull String permissionRootName, @NotNull RestrictionProvider restrictionProvider)
focal_class.class_method_signature: PermissionStoreImpl.flush(@NotNull Root root)
focal_class.full_signature: @Override public void flush(@NotNull Root root)
focal_class.identifier: flush
focal_class.modifiers: @Override public
focal_class.parameters: (@NotNull Root root)
focal_class.return: void
focal_class.signature: void flush(@NotNull Root root)
focal_class.class_method_signature: PermissionStoreImpl.reset(@NotNull Root root)
focal_class.full_signature: private void reset(@NotNull Root root)
focal_class.identifier: reset
focal_class.modifiers: private
focal_class.parameters: (@NotNull Root root)
focal_class.return: void
focal_class.signature: void reset(@NotNull Root root)
focal_class.class_method_signature: PermissionStoreImpl.load(@NotNull String principalName, @NotNull String path)
focal_class.full_signature: @Nullable @Override public Collection<PermissionEntry> load(@NotNull String principalName, @NotNull String path)
focal_class.identifier: load
focal_class.modifiers: @Nullable @Override public
focal_class.parameters: (@NotNull String principalName, @NotNull String path)
focal_class.return: Collection<PermissionEntry>
focal_class.signature: Collection<PermissionEntry> load(@NotNull String principalName, @NotNull String path)
focal_class.class_method_signature: PermissionStoreImpl.getNumEntries(@NotNull String principalName, long max)
focal_class.full_signature: @NotNull @Override public NumEntries getNumEntries(@NotNull String principalName, long max)
focal_class.identifier: getNumEntries
focal_class.modifiers: @NotNull @Override public
focal_class.parameters: (@NotNull String principalName, long max)
focal_class.return: NumEntries
focal_class.signature: NumEntries getNumEntries(@NotNull String principalName, long max)
focal_class.class_method_signature: PermissionStoreImpl.load(@NotNull String principalName)
focal_class.full_signature: @Override @NotNull public PrincipalPermissionEntries load(@NotNull String principalName)
focal_class.identifier: load
focal_class.modifiers: @Override @NotNull public
focal_class.parameters: (@NotNull String principalName)
focal_class.return: PrincipalPermissionEntries
focal_class.signature: PrincipalPermissionEntries load(@NotNull String principalName)
focal_class.class_method_signature: PermissionStoreImpl.getPrincipalRoot(@NotNull String principalName)
focal_class.full_signature: @Nullable private Tree getPrincipalRoot(@NotNull String principalName)
focal_class.identifier: getPrincipalRoot
focal_class.modifiers: @Nullable private
focal_class.parameters: (@NotNull String principalName)
focal_class.return: Tree
focal_class.signature: Tree getPrincipalRoot(@NotNull String principalName)
focal_class.class_method_signature: PermissionStoreImpl.loadPermissionEntries(@NotNull Tree tree,
                                         @NotNull PrincipalPermissionEntries principalPermissionEntries)
focal_class.full_signature: private void loadPermissionEntries(@NotNull Tree tree,
                                         @NotNull PrincipalPermissionEntries principalPermissionEntries)
focal_class.identifier: loadPermissionEntries
focal_class.modifiers: private
focal_class.parameters: (@NotNull Tree tree,
                                         @NotNull PrincipalPermissionEntries principalPermissionEntries)
focal_class.return: void
focal_class.signature: void loadPermissionEntries(@NotNull Tree tree,
                                         @NotNull PrincipalPermissionEntries principalPermissionEntries)
focal_class.class_method_signature: PermissionStoreImpl.loadPermissionEntries(@NotNull String path,
                                                                @NotNull Tree tree)
focal_class.full_signature: @NotNull private Collection<PermissionEntry> loadPermissionEntries(@NotNull String path,
                                                                @NotNull Tree tree)
focal_class.identifier: loadPermissionEntries
focal_class.modifiers: @NotNull private
focal_class.parameters: (@NotNull String path,
                                                                @NotNull Tree tree)
focal_class.return: Collection<PermissionEntry>
focal_class.signature: Collection<PermissionEntry> loadPermissionEntries(@NotNull String path,
                                                                @NotNull Tree tree)
focal_class.class_method_signature: PermissionStoreImpl.createPermissionEntry(@NotNull String path,
                                                    @NotNull Tree entryTree)
focal_class.full_signature: @NotNull private PermissionEntry createPermissionEntry(@NotNull String path,
                                                    @NotNull Tree entryTree)
focal_class.identifier: createPermissionEntry
focal_class.modifiers: @NotNull private
focal_class.parameters: (@NotNull String path,
                                                    @NotNull Tree entryTree)
focal_class.return: PermissionEntry
focal_class.signature: PermissionEntry createPermissionEntry(@NotNull String path,
                                                    @NotNull Tree entryTree)
focal_method.body: @NotNull
      @Override
      public NumEntries getNumEntries(@NotNull String principalName, long max) {
          Tree tree = getPrincipalRoot(principalName);
          if (tree == null) {
              return NumEntries.ZERO;
          } else {
              // if rep:numPermissions is present it contains the exact number of
              // access controlled nodes for the given principal name.
              // if this property is missing (backward compat) we use the old
              // mechanism and use child-cnt with a max value to get a rough idea
              // about the magnitude (note: this approximation ignores the hash-collisions)
              long l = TreeUtil.getLong(tree, REP_NUM_PERMISSIONS, -1);
              return (l >= 0) ? NumEntries.valueOf(l, true) : NumEntries.valueOf(tree.getChildrenCount(max), false);
          }
      }
focal_method.class_method_signature: PermissionStoreImpl.getNumEntries(@NotNull String principalName, long max)
focal_method.full_signature: @NotNull @Override public NumEntries getNumEntries(@NotNull String principalName, long max)
focal_method.identifier: getNumEntries
focal_method.invocations: getPrincipalRoot getLong valueOf valueOf getChildrenCount
focal_method.modifiers: @NotNull @Override public
focal_method.parameters: (@NotNull String principalName, long max)
focal_method.return: NumEntries
focal_method.signature: NumEntries getNumEntries(@NotNull String principalName, long max)