8282143: Objects.requireNonNull should be ForceInline

Reviewed-by: psandoz
This commit is contained in:
Quan Anh Mai 2022-03-02 00:46:35 +00:00 committed by Paul Sandoz
parent 732d891f9f
commit fc52a2182a

@ -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);