On 7 Oct 2015, at 23:44, Stephen Colebourne <scolebou...@joda.org> wrote:
> On 7 October 2015 at 23:24, Roger Riggs <roger.ri...@oracle.com> wrote: >> Please consider and comment: >> >> <T> T nonNullOf(T obj, T defaultObj); >> <T> T nonNullOf(T, obj, Supplier<T> defaultSupplier); >> >> Details are in the updated webrev: >> http://cr.openjdk.java.net/~rriggs/webrev-object-non-null/ > > I think I can live with that name. +1 > The Javadoc for the supplier variant needs to mention that an NPE is > thrown if the supplier itself is null. > > @throws NullPointerException if {@code obj} is null and either {@code > supplier} is null or the {@code supplier.get()} value is {@code null} +1 Shouldn’t the supplier variant signature be as follows: public static <T> T nonNullOf(T obj, Supplier<? extends T> supplier) { -Chris.