Skip to content
Permalink
Browse files
8272042: java.util.ImmutableCollections$Map1 and MapN should not be @…
…valuebased

Reviewed-by: mchung, iris, naoto, smarks
  • Loading branch information
Roger Riggs committed Nov 23, 2021
1 parent f4dc03e commit 5e7e2da227cd2b5e2d3d1e2f59fb74ddd1835abb
Showing 1 changed file with 3 additions and 3 deletions.
@@ -1062,7 +1062,7 @@ public <T> T[] toArray(T[] a) {

// ---------- 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 @@ public V getOrDefault(Object key, V defaultValue) {
}
}

@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 @@ public int hashCode() {
* @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

1 comment on commit 5e7e2da

@openjdk-notifier
Copy link

@openjdk-notifier openjdk-notifier bot commented on 5e7e2da Nov 23, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.