8272042: java.util.ImmutableCollections$Map1 and MapN should not be @ValueBased

Reviewed-by: mchung, iris, naoto, smarks
This commit is contained in:
Roger Riggs 2021-11-23 15:02:48 +00:00
parent f4dc03ea6d
commit 5e7e2da227

View file

@ -1062,7 +1062,7 @@ class ImmutableCollections {
// ---------- Map Implementations ----------
@jdk.internal.ValueBased
// Not a jdk.internal.ValueBased class; disqualified by fields in superclass AbstractMap
abstract static class AbstractImmutableMap<K,V> extends AbstractMap<K,V> implements Serializable {
@Override public void clear() { throw uoe(); }
@Override public V compute(K key, BiFunction<? super K,? super V,? extends V> rf) { throw uoe(); }
@ -1093,7 +1093,7 @@ class ImmutableCollections {
}
}
@jdk.internal.ValueBased
// Not a jdk.internal.ValueBased class; disqualified by fields in superclass AbstractMap
static final class Map1<K,V> extends AbstractImmutableMap<K,V> {
@Stable
private final K k0;
@ -1160,7 +1160,7 @@ class ImmutableCollections {
* @param <K> the key type
* @param <V> the value type
*/
@jdk.internal.ValueBased
// Not a jdk.internal.ValueBased class; disqualified by fields in superclass AbstractMap
static final class MapN<K,V> extends AbstractImmutableMap<K,V> {
@Stable