Skip to content

Commit 900f1db

Browse files
committed
Remove redundant @nonnull annotations
1 parent 962f4d5 commit 900f1db

File tree

1 file changed

+14
-14
lines changed
  • src/java.base/share/classes/java/util

1 file changed

+14
-14
lines changed

src/java.base/share/classes/java/util/Map.java

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -641,7 +641,7 @@ public static <K, V> Comparator<Map.Entry<K, V>> comparingByValue(Comparator<? s
641641
* @since 17
642642
*/
643643
@SuppressWarnings("unchecked")
644-
public static <K extends @NonNull Object, V extends @NonNull Object> Map.Entry<K, V> copyOf(Map.Entry<? extends K, ? extends V> e) {
644+
public static <K extends Object, V extends Object> Map.Entry<K, V> copyOf(Map.Entry<? extends K, ? extends V> e) {
645645
Objects.requireNonNull(e);
646646
if (e instanceof KeyValueHolder) {
647647
return (Map.Entry<K, V>) e;
@@ -1395,7 +1395,7 @@ static <K, V> Map<K, V> of() {
13951395
*
13961396
* @since 9
13971397
*/
1398-
static <K extends @NonNull Object, V extends @NonNull Object> Map<K, V> of(K k1, V v1) {
1398+
static <K extends Object, V extends Object> Map<K, V> of(K k1, V v1) {
13991399
return new ImmutableCollections.Map1<>(k1, v1);
14001400
}
14011401

@@ -1415,7 +1415,7 @@ static <K, V> Map<K, V> of() {
14151415
*
14161416
* @since 9
14171417
*/
1418-
static <K extends @NonNull Object, V extends @NonNull Object> Map<K, V> of(K k1, V v1, K k2, V v2) {
1418+
static <K extends Object, V extends Object> Map<K, V> of(K k1, V v1, K k2, V v2) {
14191419
return new ImmutableCollections.MapN<>(k1, v1, k2, v2);
14201420
}
14211421

@@ -1437,7 +1437,7 @@ static <K, V> Map<K, V> of() {
14371437
*
14381438
* @since 9
14391439
*/
1440-
static <K extends @NonNull Object, V extends @NonNull Object> Map<K, V> of(K k1, V v1, K k2, V v2, K k3, V v3) {
1440+
static <K extends Object, V extends Object> Map<K, V> of(K k1, V v1, K k2, V v2, K k3, V v3) {
14411441
return new ImmutableCollections.MapN<>(k1, v1, k2, v2, k3, v3);
14421442
}
14431443

@@ -1461,7 +1461,7 @@ static <K, V> Map<K, V> of() {
14611461
*
14621462
* @since 9
14631463
*/
1464-
static <K extends @NonNull Object, V extends @NonNull Object> Map<K, V> of(K k1, V v1, K k2, V v2, K k3, V v3, K k4, V v4) {
1464+
static <K extends Object, V extends Object> Map<K, V> of(K k1, V v1, K k2, V v2, K k3, V v3, K k4, V v4) {
14651465
return new ImmutableCollections.MapN<>(k1, v1, k2, v2, k3, v3, k4, v4);
14661466
}
14671467

@@ -1487,7 +1487,7 @@ static <K, V> Map<K, V> of() {
14871487
*
14881488
* @since 9
14891489
*/
1490-
static <K extends @NonNull Object, V extends @NonNull Object> Map<K, V> of(K k1, V v1, K k2, V v2, K k3, V v3, K k4, V v4, K k5, V v5) {
1490+
static <K extends Object, V extends Object> Map<K, V> of(K k1, V v1, K k2, V v2, K k3, V v3, K k4, V v4, K k5, V v5) {
14911491
return new ImmutableCollections.MapN<>(k1, v1, k2, v2, k3, v3, k4, v4, k5, v5);
14921492
}
14931493

@@ -1515,7 +1515,7 @@ static <K, V> Map<K, V> of() {
15151515
*
15161516
* @since 9
15171517
*/
1518-
static <K extends @NonNull Object, V extends @NonNull Object> Map<K, V> of(K k1, V v1, K k2, V v2, K k3, V v3, K k4, V v4, K k5, V v5,
1518+
static <K extends Object, V extends Object> Map<K, V> of(K k1, V v1, K k2, V v2, K k3, V v3, K k4, V v4, K k5, V v5,
15191519
K k6, V v6) {
15201520
return new ImmutableCollections.MapN<>(k1, v1, k2, v2, k3, v3, k4, v4, k5, v5,
15211521
k6, v6);
@@ -1547,7 +1547,7 @@ static <K, V> Map<K, V> of() {
15471547
*
15481548
* @since 9
15491549
*/
1550-
static <K extends @NonNull Object, V extends @NonNull Object> Map<K, V> of(K k1, V v1, K k2, V v2, K k3, V v3, K k4, V v4, K k5, V v5,
1550+
static <K extends Object, V extends Object> Map<K, V> of(K k1, V v1, K k2, V v2, K k3, V v3, K k4, V v4, K k5, V v5,
15511551
K k6, V v6, K k7, V v7) {
15521552
return new ImmutableCollections.MapN<>(k1, v1, k2, v2, k3, v3, k4, v4, k5, v5,
15531553
k6, v6, k7, v7);
@@ -1581,7 +1581,7 @@ static <K, V> Map<K, V> of() {
15811581
*
15821582
* @since 9
15831583
*/
1584-
static <K extends @NonNull Object, V extends @NonNull Object> Map<K, V> of(K k1, V v1, K k2, V v2, K k3, V v3, K k4, V v4, K k5, V v5,
1584+
static <K extends Object, V extends Object> Map<K, V> of(K k1, V v1, K k2, V v2, K k3, V v3, K k4, V v4, K k5, V v5,
15851585
K k6, V v6, K k7, V v7, K k8, V v8) {
15861586
return new ImmutableCollections.MapN<>(k1, v1, k2, v2, k3, v3, k4, v4, k5, v5,
15871587
k6, v6, k7, v7, k8, v8);
@@ -1617,7 +1617,7 @@ static <K, V> Map<K, V> of() {
16171617
*
16181618
* @since 9
16191619
*/
1620-
static <K extends @NonNull Object, V extends @NonNull Object> Map<K, V> of(K k1, V v1, K k2, V v2, K k3, V v3, K k4, V v4, K k5, V v5,
1620+
static <K extends Object, V extends Object> Map<K, V> of(K k1, V v1, K k2, V v2, K k3, V v3, K k4, V v4, K k5, V v5,
16211621
K k6, V v6, K k7, V v7, K k8, V v8, K k9, V v9) {
16221622
return new ImmutableCollections.MapN<>(k1, v1, k2, v2, k3, v3, k4, v4, k5, v5,
16231623
k6, v6, k7, v7, k8, v8, k9, v9);
@@ -1655,7 +1655,7 @@ static <K, V> Map<K, V> of() {
16551655
*
16561656
* @since 9
16571657
*/
1658-
static <K extends @NonNull Object, V extends @NonNull Object> Map<K, V> of(K k1, V v1, K k2, V v2, K k3, V v3, K k4, V v4, K k5, V v5,
1658+
static <K extends Object, V extends Object> Map<K, V> of(K k1, V v1, K k2, V v2, K k3, V v3, K k4, V v4, K k5, V v5,
16591659
K k6, V v6, K k7, V v7, K k8, V v8, K k9, V v9, K k10, V v10) {
16601660
return new ImmutableCollections.MapN<>(k1, v1, k2, v2, k3, v3, k4, v4, k5, v5,
16611661
k6, v6, k7, v7, k8, v8, k9, v9, k10, v10);
@@ -1694,7 +1694,7 @@ static <K, V> Map<K, V> of() {
16941694
*/
16951695
@SafeVarargs
16961696
@SuppressWarnings("varargs")
1697-
static <K extends @NonNull Object, V extends @NonNull Object> Map<K, V> ofEntries(Entry<? extends K, ? extends V>... entries) {
1697+
static <K extends Object, V extends Object> Map<K, V> ofEntries(Entry<? extends K, ? extends V>... entries) {
16981698
if (entries.length == 0) { // implicit null check of entries array
16991699
@SuppressWarnings("unchecked")
17001700
var map = (Map<K,V>) ImmutableCollections.EMPTY_MAP;
@@ -1750,7 +1750,7 @@ static <K, V> Map<K, V> of() {
17501750
* @see Map#ofEntries Map.ofEntries()
17511751
* @since 9
17521752
*/
1753-
static <K extends @NonNull Object, V extends @NonNull Object> Entry<K, V> entry(@NonNull K k, @NonNull V v) {
1753+
static <K extends Object, V extends Object> Entry<K, V> entry(K k, V v) {
17541754
// KeyValueHolder checks for nulls
17551755
return new KeyValueHolder<>(k, v);
17561756
}
@@ -1773,7 +1773,7 @@ static <K, V> Map<K, V> of() {
17731773
* @since 10
17741774
*/
17751775
@SuppressWarnings({"rawtypes","unchecked"})
1776-
static <K extends @NonNull Object, V extends @NonNull Object> Map<K, V> copyOf(Map<? extends K, ? extends V> map) {
1776+
static <K extends Object, V extends Object> Map<K, V> copyOf(Map<? extends K, ? extends V> map) {
17771777
if (map instanceof ImmutableCollections.AbstractImmutableMap) {
17781778
return (Map<K,V>)map;
17791779
} else {

0 commit comments

Comments
 (0)