Skip to content

Commit

Permalink
Make Map.entry require nonnull parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
agentgt authored Aug 17, 2023
1 parent ccdfdd4 commit dddef51
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/java.base/share/classes/java/util/Map.java
Original file line number Diff line number Diff line change
Expand Up @@ -1751,7 +1751,7 @@ static <K extends Object, V extends Object> Map<K, V> ofEntries(Entry<? extends
* @see Map#ofEntries Map.ofEntries()
* @since 9
*/
static <K, V> Entry<K, V> entry(K k, V v) {
static <K, V> Entry<K, V> entry(@NonNull K k, @NonNull V v) {
// KeyValueHolder checks for nulls
return new KeyValueHolder<>(k, v);
}
Expand Down

0 comments on commit dddef51

Please sign in to comment.