< prev index next >

src/java.base/share/classes/java/lang/ClassLoader.java

Print this page

2632         }
2633 
2634         if (CDS.isDumpingAOTLinkedClasses()) {
2635             if (System.getProperty("cds.debug.archived.packages") != null) {
2636                 for (Map.Entry<String, NamedPackage> entry : packages.entrySet()) {
2637                     String key = entry.getKey();
2638                     NamedPackage value = entry.getValue();
2639                     System.out.println("Archiving " +
2640                                        (value instanceof Package ? "Package" : "NamedPackage") +
2641                                        " \"" + key + "\" for " + this);
2642                 }
2643             }
2644         } else {
2645             reinitObjectField("packages", new ConcurrentHashMap<>());
2646         }
2647 
2648         reinitObjectField("package2certs", new ConcurrentHashMap<>());
2649         classes.clear();
2650         classes.trimToSize();
2651         classLoaderValueMap = null;

2652     }
2653 }
2654 
2655 /*
2656  * A utility class that will enumerate over an array of enumerations.
2657  */
2658 final class CompoundEnumeration<E> implements Enumeration<E> {
2659     private final Enumeration<E>[] enums;
2660     private int index;
2661 
2662     public CompoundEnumeration(Enumeration<E>[] enums) {
2663         this.enums = enums;
2664     }
2665 
2666     private boolean next() {
2667         while (index < enums.length) {
2668             if (enums[index] != null && enums[index].hasMoreElements()) {
2669                 return true;
2670             }
2671             index++;

2632         }
2633 
2634         if (CDS.isDumpingAOTLinkedClasses()) {
2635             if (System.getProperty("cds.debug.archived.packages") != null) {
2636                 for (Map.Entry<String, NamedPackage> entry : packages.entrySet()) {
2637                     String key = entry.getKey();
2638                     NamedPackage value = entry.getValue();
2639                     System.out.println("Archiving " +
2640                                        (value instanceof Package ? "Package" : "NamedPackage") +
2641                                        " \"" + key + "\" for " + this);
2642                 }
2643             }
2644         } else {
2645             reinitObjectField("packages", new ConcurrentHashMap<>());
2646         }
2647 
2648         reinitObjectField("package2certs", new ConcurrentHashMap<>());
2649         classes.clear();
2650         classes.trimToSize();
2651         classLoaderValueMap = null;
2652         libraries.clear();
2653     }
2654 }
2655 
2656 /*
2657  * A utility class that will enumerate over an array of enumerations.
2658  */
2659 final class CompoundEnumeration<E> implements Enumeration<E> {
2660     private final Enumeration<E>[] enums;
2661     private int index;
2662 
2663     public CompoundEnumeration(Enumeration<E>[] enums) {
2664         this.enums = enums;
2665     }
2666 
2667     private boolean next() {
2668         while (index < enums.length) {
2669             if (enums[index] != null && enums[index].hasMoreElements()) {
2670                 return true;
2671             }
2672             index++;
< prev index next >