test_class.declarator: cache = new PermissionEntryCache()
test_class.modifier: private
test_class.original_string: private PermissionEntryCache cache = new PermissionEntryCache();
test_class.type: PermissionEntryCache
test_class.var_name: cache
test_class.declarator: permissionEntry
test_class.modifier: private
test_class.original_string: private PermissionEntry permissionEntry;
test_class.type: PermissionEntry
test_class.var_name: permissionEntry
test_class.declarator: ppe
test_class.modifier: private
test_class.original_string: private PrincipalPermissionEntries ppe;
test_class.type: PrincipalPermissionEntries
test_class.var_name: ppe
test_class.declarator: store
test_class.modifier: private
test_class.original_string: private PermissionStore store;
test_class.type: PermissionStore
test_class.var_name: store
test_class.file: oak-core/src/test/java/org/apache/jackrabbit/oak/security/authorization/permission/PermissionEntryCacheTest.java
test_class.identifier: PermissionEntryCacheTest
test_case.body: @Test
      public void testLoadMissingInit() {
          ppe.setFullyLoaded(true);
          when(store.load("a")).thenReturn(ppe);
  
          Collection<PermissionEntry> result = new TreeSet<>();
          cache.load(store, result, "a", "/path");
  
          assertTrue(result.isEmpty());
      }
test_case.class_method_signature: PermissionEntryCacheTest.testLoadMissingInit()
test_case.full_signature: @Test public void testLoadMissingInit()
test_case.identifier: testLoadMissingInit
test_case.invocations: setFullyLoaded thenReturn when load load assertTrue isEmpty
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testLoadMissingInit()
focal_class.declarator: log = LoggerFactory.getLogger(PermissionEntryCache.class)
focal_class.modifier: private static final
focal_class.original_string: private static final Logger log = LoggerFactory.getLogger(PermissionEntryCache.class);
focal_class.type: Logger
focal_class.var_name: log
focal_class.declarator: entries = new HashMap<>()
focal_class.modifier: private final
focal_class.original_string: private final Map<String, PrincipalPermissionEntries> entries = new HashMap<>();
focal_class.type: Map<String, PrincipalPermissionEntries>
focal_class.var_name: entries
focal_class.file: oak-core/src/main/java/org/apache/jackrabbit/oak/security/authorization/permission/PermissionEntryCache.java
focal_class.identifier: PermissionEntryCache
focal_class.class_method_signature: PermissionEntryCache.getFullyLoadedEntries(@NotNull PermissionStore store,
                                                       @NotNull String principalName)
focal_class.full_signature: @NotNull PrincipalPermissionEntries getFullyLoadedEntries(@NotNull PermissionStore store,
                                                       @NotNull String principalName)
focal_class.identifier: getFullyLoadedEntries
focal_class.modifiers: @NotNull
focal_class.parameters: (@NotNull PermissionStore store,
                                                       @NotNull String principalName)
focal_class.return: PrincipalPermissionEntries
focal_class.signature: PrincipalPermissionEntries getFullyLoadedEntries(@NotNull PermissionStore store,
                                                       @NotNull String principalName)
focal_class.class_method_signature: PermissionEntryCache.init(@NotNull String principalName, long expectedSize)
focal_class.full_signature:  void init(@NotNull String principalName, long expectedSize)
focal_class.identifier: init
focal_class.parameters: (@NotNull String principalName, long expectedSize)
focal_class.return: void
focal_class.signature: void init(@NotNull String principalName, long expectedSize)
focal_class.class_method_signature: PermissionEntryCache.load(@NotNull PermissionStore store,
                @NotNull Collection<PermissionEntry> ret,
                @NotNull String principalName,
                @NotNull String path)
focal_class.full_signature:  void load(@NotNull PermissionStore store,
                @NotNull Collection<PermissionEntry> ret,
                @NotNull String principalName,
                @NotNull String path)
focal_class.identifier: load
focal_class.parameters: (@NotNull PermissionStore store,
                @NotNull Collection<PermissionEntry> ret,
                @NotNull String principalName,
                @NotNull String path)
focal_class.return: void
focal_class.signature: void load(@NotNull PermissionStore store,
                @NotNull Collection<PermissionEntry> ret,
                @NotNull String principalName,
                @NotNull String path)
focal_method.body: void load(@NotNull PermissionStore store,
                @NotNull Collection<PermissionEntry> ret,
                @NotNull String principalName,
                @NotNull String path) {
          if (entries.containsKey(principalName)) {
              PrincipalPermissionEntries ppe = entries.get(principalName);
              Collection<PermissionEntry> pes = ppe.getEntriesByPath(path);
              if (ppe.isFullyLoaded() || pes != null) {
                  // no need to read from store
                  if (pes != null) {
                      ret.addAll(pes);
                  }
              } else {
                  // read entries for path from store
                  pes = store.load(principalName, path);
                  if (pes == null) {
                      // nothing to add to the result collection 'ret'.
                      // nevertheless, remember the absence of any permission entries
                      // in the cache to avoid reading from store again.
                      ppe.rememberNotAccessControlled(path);
                  } else {
                      ppe.putEntriesByPath(path, pes);
                      ret.addAll(pes);
                  }
              }
          } else {
              log.error("Failed to load entries for principal '{}' at path {}", principalName, path);
          }
      }
focal_method.class_method_signature: PermissionEntryCache.load(@NotNull PermissionStore store,
                @NotNull Collection<PermissionEntry> ret,
                @NotNull String principalName,
                @NotNull String path)
focal_method.full_signature:  void load(@NotNull PermissionStore store,
                @NotNull Collection<PermissionEntry> ret,
                @NotNull String principalName,
                @NotNull String path)
focal_method.identifier: load
focal_method.invocations: containsKey get getEntriesByPath isFullyLoaded addAll load rememberNotAccessControlled putEntriesByPath addAll error
focal_method.parameters: (@NotNull PermissionStore store,
                @NotNull Collection<PermissionEntry> ret,
                @NotNull String principalName,
                @NotNull String path)
focal_method.return: void
focal_method.signature: void load(@NotNull PermissionStore store,
                @NotNull Collection<PermissionEntry> ret,
                @NotNull String principalName,
                @NotNull String path)