@@ -137,6 +137,7 @@ private ImmutableCollections() { }
137
137
138
138
static UnsupportedOperationException uoe () { return new UnsupportedOperationException (); }
139
139
140
+ @ jdk .internal .ValueBased
140
141
static abstract class AbstractImmutableCollection <E > extends AbstractCollection <E > {
141
142
// all mutating methods throw UnsupportedOperationException
142
143
@ Override public boolean add (E e ) { throw uoe (); }
@@ -160,6 +161,7 @@ static <E> List<E> listCopy(Collection<? extends E> coll) {
160
161
}
161
162
}
162
163
164
+ @ jdk .internal .ValueBased
163
165
static abstract class AbstractImmutableList <E > extends AbstractImmutableCollection <E >
164
166
implements List <E >, RandomAccess {
165
167
@@ -444,6 +446,7 @@ public <T> T[] toArray(T[] a) {
444
446
}
445
447
}
446
448
449
+ @ jdk .internal .ValueBased
447
450
static final class List12 <E > extends AbstractImmutableList <E >
448
451
implements Serializable {
449
452
@@ -526,6 +529,7 @@ public <T> T[] toArray(T[] a) {
526
529
}
527
530
}
528
531
532
+ @ jdk .internal .ValueBased
529
533
static final class ListN <E > extends AbstractImmutableList <E >
530
534
implements Serializable {
531
535
@@ -607,6 +611,7 @@ public <T> T[] toArray(T[] a) {
607
611
608
612
// ---------- Set Implementations ----------
609
613
614
+ @ jdk .internal .ValueBased
610
615
static abstract class AbstractImmutableSet <E > extends AbstractImmutableCollection <E >
611
616
implements Set <E > {
612
617
@@ -634,6 +639,7 @@ public boolean equals(Object o) {
634
639
public abstract int hashCode ();
635
640
}
636
641
642
+ @ jdk .internal .ValueBased
637
643
static final class Set12 <E > extends AbstractImmutableSet <E >
638
644
implements Serializable {
639
645
@@ -759,6 +765,7 @@ public <T> T[] toArray(T[] a) {
759
765
* least one null is always present.
760
766
* @param <E> the element type
761
767
*/
768
+ @ jdk .internal .ValueBased
762
769
static final class SetN <E > extends AbstractImmutableSet <E >
763
770
implements Serializable {
764
771
@@ -925,6 +932,7 @@ public <T> T[] toArray(T[] a) {
925
932
926
933
// ---------- Map Implementations ----------
927
934
935
+ @ jdk .internal .ValueBased
928
936
abstract static class AbstractImmutableMap <K ,V > extends AbstractMap <K ,V > implements Serializable {
929
937
@ Override public void clear () { throw uoe (); }
930
938
@ Override public V compute (K key , BiFunction <? super K ,? super V ,? extends V > rf ) { throw uoe (); }
@@ -955,6 +963,7 @@ public V getOrDefault(Object key, V defaultValue) {
955
963
}
956
964
}
957
965
966
+ @ jdk .internal .ValueBased
958
967
static final class Map1 <K ,V > extends AbstractImmutableMap <K ,V > {
959
968
@ Stable
960
969
private final K k0 ;
@@ -1021,6 +1030,7 @@ public int hashCode() {
1021
1030
* @param <K> the key type
1022
1031
* @param <V> the value type
1023
1032
*/
1033
+ @ jdk .internal .ValueBased
1024
1034
static final class MapN <K ,V > extends AbstractImmutableMap <K ,V > {
1025
1035
1026
1036
@ Stable
0 commit comments