--- old/src/share/classes/java/util/Objects.java Tue Apr 16 11:39:37 2013 +++ new/src/share/classes/java/util/Objects.java Tue Apr 16 11:39:36 2013 @@ -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. - * - *

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 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 requireNonNull(T obj, Supplier messageSupplier) { - if (obj == null) - throw new NullPointerException(messageSupplier.get()); - return obj; - } }