RFR 9: 8138963 : java.lang.Objects new method to default to non-null (original) (raw)
Stephen Colebourne scolebourne at joda.org
Wed Oct 7 22:44:23 UTC 2015
- Previous message: RFR 9: 8138963 : java.lang.Objects new method to default to non-null
- Next message: RFR 9: 8138963 : java.lang.Objects new method to default to non-null
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
On 7 October 2015 at 23:24, Roger Riggs <Roger.Riggs at oracle.com> wrote:
Please consider and comment:
T nonNullOf(T obj, T defaultObj); T nonNullOf(T, obj, Supplier 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.
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}
Stephen
- Previous message: RFR 9: 8138963 : java.lang.Objects new method to default to non-null
- Next message: RFR 9: 8138963 : java.lang.Objects new method to default to non-null
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]