mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-27 23:04:50 +02:00
8282143: Objects.requireNonNull should be ForceInline
Reviewed-by: psandoz
This commit is contained in:
parent
732d891f9f
commit
fc52a2182a
1 changed files with 2 additions and 0 deletions
|
@ -227,6 +227,7 @@ public final class Objects {
|
|||
* @return {@code obj} if not {@code null}
|
||||
* @throws NullPointerException if {@code obj} is {@code null}
|
||||
*/
|
||||
@ForceInline
|
||||
public static <T> T requireNonNull(T obj) {
|
||||
if (obj == null)
|
||||
throw new NullPointerException();
|
||||
|
@ -252,6 +253,7 @@ public final class Objects {
|
|||
* @return {@code obj} if not {@code null}
|
||||
* @throws NullPointerException if {@code obj} is {@code null}
|
||||
*/
|
||||
@ForceInline
|
||||
public static <T> T requireNonNull(T obj, String message) {
|
||||
if (obj == null)
|
||||
throw new NullPointerException(message);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue