mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-27 23:04:50 +02:00
8292317: Missing null check for Iterator.forEachRemaining implementations
Reviewed-by: sundar, smarks
This commit is contained in:
parent
0ec575a203
commit
906f1ca4d7
2 changed files with 29 additions and 1 deletions
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 1997, 2021, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1997, 2022, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
|
@ -1714,6 +1714,7 @@ public class Collections {
|
|||
throw new UnsupportedOperationException();
|
||||
}
|
||||
public void forEachRemaining(Consumer<? super Map.Entry<K, V>> action) {
|
||||
Objects.requireNonNull(action);
|
||||
i.forEachRemaining(entryConsumer(action));
|
||||
}
|
||||
};
|
||||
|
@ -3878,6 +3879,7 @@ public class Collections {
|
|||
}
|
||||
|
||||
public void forEachRemaining(Consumer<? super Entry<K, V>> action) {
|
||||
Objects.requireNonNull(action);
|
||||
i.forEachRemaining(
|
||||
e -> action.accept(checkedEntry(e, valueType)));
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue