public synchronized void removeHolder()

in src/main/java/org/apache/sling/auth/core/impl/PathBasedHolderCache.java [61:80]


    public synchronized void removeHolder(final T holder) {
        final Map<String, SortedSet<T>> byHostMap = cache.get(holder.protocol);
        if (byHostMap != null) {
            final SortedSet<T> byPathSet = byHostMap.get(holder.host);
            if (byPathSet != null) {

                // create a new set without the removed holder
                final SortedSet<T> set = new TreeSet<>();
                set.addAll(byPathSet);
                set.remove(holder);

                // replace the old set with the new one (or remove if empty)
                if (set.isEmpty()) {
                    byHostMap.remove(holder.host);
                } else {
                    byHostMap.put(holder.host, set);
                }
            }
        }
    }