code: private synchronized void addedLoginModule() {
          boolean changedEntries = false;
  
          synchronized (pendingContextEntryRefs) {
              // Check for pending entries that are now satisfied.
              Iterator<ServiceReference<JAASLoginContextEntry>> i = pendingContextEntryRefs.iterator();
              while (i.hasNext()) {
                  ServiceReference<JAASLoginContextEntry> contextEntryRef = i.next();
                  String[] entryModulePids = (String[]) contextEntryRef.getProperty(JAASLoginContextEntryImpl.CFG_KEY_LOGIN_MODULE_REF);
                  if (haveAllModules(entryModulePids)) {
                      i.remove(); // remove from pending list
                      jaasLoginContextEntries.putReference((String) contextEntryRef.getProperty(KEY_ID), contextEntryRef);
                      changedEntries = true;
                  }
              }
          }
  
          if (changedEntries) {
              modified(properties);
          }
      }
docs: Iterate through pending context entries, find any entries
  that are now satisfied, and move them to the main list.