--- old/src/share/classes/java/lang/ClassValue.java 2014-05-15 10:53:47.000000000 -0700 +++ new/src/share/classes/java/lang/ClassValue.java 2014-05-15 10:53:46.000000000 -0700 @@ -25,7 +25,6 @@ package java.lang; -import java.lang.ClassValue.ClassValueMap; import java.util.WeakHashMap; import java.lang.ref.WeakReference; import java.util.concurrent.atomic.AtomicInteger; @@ -375,10 +374,10 @@ synchronized (CRITICAL_SECTION) { // private object to avoid deadlocks // happens about once per type if ((map = type.classValueMap) == null) - type.classValueMap = map = new ClassValueMap(type); - } - return map; + type.classValueMap = map = new ClassValueMap(); } + return map; + } static Entry makeEntry(Version explicitVersion, T value) { // Note that explicitVersion might be different from this.version. @@ -398,12 +397,11 @@ // The following class could also be top level and non-public: - /** A backing map for all ClassValues, relative a single given type. + /** A backing map for all ClassValues. * Gives a fully serialized "true state" for each pair (ClassValue cv, Class type). * Also manages an unserialized fast-path cache. */ static class ClassValueMap extends WeakHashMap> { - private final Class type; private Entry[] cacheArray; private int cacheLoad, cacheLoadLimit; @@ -413,11 +411,10 @@ */ private static final int INITIAL_ENTRIES = 32; - /** Build a backing map for ClassValues, relative the given type. + /** Build a backing map for ClassValues. * Also, create an empty cache array and install it on the class. */ - ClassValueMap(Class type) { - this.type = type; + ClassValueMap() { sizeCache(INITIAL_ENTRIES); }