Skip to main content
Sign in
Snippets Groups Projects
Commit 3a555f05 authored by Christian Thalinger's avatar Christian Thalinger
Browse files

8032606: ClassValue.ClassValueMap.type is unused

Reviewed-by: jrose, vlivanov
parent 4bb7d288
No related branches found
No related tags found
No related merge requests found
...@@ -25,7 +25,6 @@ ...@@ -25,7 +25,6 @@
package java.lang; package java.lang;
import java.lang.ClassValue.ClassValueMap;
import java.util.WeakHashMap; import java.util.WeakHashMap;
import java.lang.ref.WeakReference; import java.lang.ref.WeakReference;
import java.util.concurrent.atomic.AtomicInteger; import java.util.concurrent.atomic.AtomicInteger;
...@@ -375,7 +374,7 @@ public abstract class ClassValue<T> { ...@@ -375,7 +374,7 @@ public abstract class ClassValue<T> {
synchronized (CRITICAL_SECTION) { // private object to avoid deadlocks synchronized (CRITICAL_SECTION) { // private object to avoid deadlocks
// happens about once per type // happens about once per type
if ((map = type.classValueMap) == null) if ((map = type.classValueMap) == null)
type.classValueMap = map = new ClassValueMap(type); type.classValueMap = map = new ClassValueMap();
} }
return map; return map;
} }
...@@ -398,12 +397,11 @@ public abstract class ClassValue<T> { ...@@ -398,12 +397,11 @@ public abstract class ClassValue<T> {
// The following class could also be top level and non-public: // 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). * Gives a fully serialized "true state" for each pair (ClassValue cv, Class type).
* Also manages an unserialized fast-path cache. * Also manages an unserialized fast-path cache.
*/ */
static class ClassValueMap extends WeakHashMap<ClassValue.Identity, Entry<?>> { static class ClassValueMap extends WeakHashMap<ClassValue.Identity, Entry<?>> {
private final Class<?> type;
private Entry<?>[] cacheArray; private Entry<?>[] cacheArray;
private int cacheLoad, cacheLoadLimit; private int cacheLoad, cacheLoadLimit;
...@@ -413,11 +411,10 @@ public abstract class ClassValue<T> { ...@@ -413,11 +411,10 @@ public abstract class ClassValue<T> {
*/ */
private static final int INITIAL_ENTRIES = 32; 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. * Also, create an empty cache array and install it on the class.
*/ */
ClassValueMap(Class<?> type) { ClassValueMap() {
this.type = type;
sizeCache(INITIAL_ENTRIES); sizeCache(INITIAL_ENTRIES);
} }
... ...
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment