< prev index next > src/java.base/share/classes/java/security/SecureClassLoader.java
Print this page
import java.util.Map;
import java.util.Objects;
import java.util.concurrent.ConcurrentHashMap;
import java.util.function.Function;
+ import jdk.internal.misc.CDS;
/**
* This class extends {@code ClassLoader} with additional support for defining
* classes with an associated code source and permissions.
*
/**
* Called by the VM, during -Xshare:dump
*/
private void resetArchivedStates() {
- pdcache.clear();
+ if (CDS.isDumpingProtectionDomains()) {
+ if (System.getProperty("cds.debug.archived.protection.domains") != null) {
+ for (Map.Entry<CodeSourceKey, ProtectionDomain> entry : pdcache.entrySet()) {
+ CodeSourceKey key = entry.getKey();
+ System.out.println("Archiving ProtectionDomain " + key.cs + " for " + this);
+ }
+ }
+ } else {
+ pdcache.clear();
+ }
}
}
< prev index next >