jdk/src/share/classes/java/util/Objects.java
changeset 16864 e3d9b9cf6d3c
parent 16863 f51406efb328
child 17431 335d87f0d817
--- a/jdk/src/share/classes/java/util/Objects.java	Mon Apr 15 18:31:48 2013 -0700
+++ b/jdk/src/share/classes/java/util/Objects.java	Tue Apr 16 12:23:16 2013 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2009, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2009, 2011, 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
@@ -25,8 +25,6 @@
 
 package java.util;
 
-import java.util.function.Supplier;
-
 /**
  * This class consists of {@code static} utility methods for operating
  * on objects.  These utilities include {@code null}-safe or {@code
@@ -228,30 +226,4 @@
             throw new NullPointerException(message);
         return obj;
     }
-
-    /**
-     * Checks that the specified object reference is not {@code null} and
-     * throws a customized {@link NullPointerException} if it is.
-     *
-     * <p>Unlike the method {@link requireNonNull(Object, String},
-     * this method allows creation of the message to be deferred until
-     * after the null check is made. While this may confer a
-     * performance advantage in the non-null case, when deciding to
-     * call this method care should be taken that the costs of
-     * creating the message supplier are less than the cost of just
-     * creating the string message directly.
-     *
-     * @param obj     the object reference to check for nullity
-     * @param messageSupplier supplier of the detail message to be
-     * used in the event that a {@code NullPointerException} is thrown
-     * @param <T> the type of the reference
-     * @return {@code obj} if not {@code null}
-     * @throws NullPointerException if {@code obj} is {@code null}
-     * @since 1.8
-     */
-    public static <T> T requireNonNull(T obj, Supplier<String> messageSupplier) {
-        if (obj == null)
-            throw new NullPointerException(messageSupplier.get());
-        return obj;
-    }
 }