mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-28 07:14:30 +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}
|
* @return {@code obj} if not {@code null}
|
||||||
* @throws NullPointerException if {@code obj} is {@code null}
|
* @throws NullPointerException if {@code obj} is {@code null}
|
||||||
*/
|
*/
|
||||||
|
@ForceInline
|
||||||
public static <T> T requireNonNull(T obj) {
|
public static <T> T requireNonNull(T obj) {
|
||||||
if (obj == null)
|
if (obj == null)
|
||||||
throw new NullPointerException();
|
throw new NullPointerException();
|
||||||
|
@ -252,6 +253,7 @@ public final class Objects {
|
||||||
* @return {@code obj} if not {@code null}
|
* @return {@code obj} if not {@code null}
|
||||||
* @throws NullPointerException if {@code obj} is {@code null}
|
* @throws NullPointerException if {@code obj} is {@code null}
|
||||||
*/
|
*/
|
||||||
|
@ForceInline
|
||||||
public static <T> T requireNonNull(T obj, String message) {
|
public static <T> T requireNonNull(T obj, String message) {
|
||||||
if (obj == null)
|
if (obj == null)
|
||||||
throw new NullPointerException(message);
|
throw new NullPointerException(message);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue