8282143: Objects.requireNonNull should be ForceInline
Reviewed-by: psandoz
This commit is contained in:
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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user