Re: JDK 8 code review request for 8011800: Add java.util.Objects.requireNonNull(T, SupplierString)

2013-04-10 Thread Joe Darcy
Hi David, On 04/09/2013 07:38 PM, David Holmes wrote: Hi Joe, On 10/04/2013 7:12 AM, Joe Darcy wrote: Hello, Please review my changes for 8011800: Add java.util.Objects.requireNonNull(T, SupplierString) http://cr.openjdk.java.net/~darcy/8011800.0/ which add a new method to

Re: JDK 8 code review request for 8011800: Add java.util.Objects.requireNonNull(T, SupplierString)

2013-04-10 Thread Peter Levart
Hi Joe, This is similar to recent addition to j.u.l.Logger, which is ok. No matter how lambda construction is optimized, if it captures any non-constant arguments, new object will always be constructed (unless perhaps JIT could optimize this away using escape analysis). Myself I often find

Re: JDK 8 code review request for 8011800: Add java.util.Objects.requireNonNull(T, SupplierString)

2013-04-10 Thread Alan Bateman
On 09/04/2013 22:12, Joe Darcy wrote: Hello, Please review my changes for 8011800: Add java.util.Objects.requireNonNull(T, SupplierString) http://cr.openjdk.java.net/~darcy/8011800.0/ which add a new method to java.util.Objects to take a SupplierString rather than a String. Patch

Re: JDK 8 code review request for 8011800: Add java.util.Objects.requireNonNull(T, SupplierString)

2013-04-10 Thread Remi Forax
On 04/09/2013 11:12 PM, Joe Darcy wrote: Hello, Please review my changes for 8011800: Add java.util.Objects.requireNonNull(T, SupplierString) http://cr.openjdk.java.net/~darcy/8011800.0/ which add a new method to java.util.Objects to take a SupplierString rather than a String.

Re: JDK 8 code review request for 8011800: Add java.util.Objects.requireNonNull(T, SupplierString)

2013-04-10 Thread Joe Darcy
Hello, On 04/10/2013 05:01 AM, Alan Bateman wrote: On 09/04/2013 22:12, Joe Darcy wrote: Hello, Please review my changes for 8011800: Add java.util.Objects.requireNonNull(T, SupplierString) http://cr.openjdk.java.net/~darcy/8011800.0/ which add a new method to java.util.Objects to

Re: JDK 8 code review request for 8011800: Add java.util.Objects.requireNonNull(T, SupplierString)

2013-04-10 Thread Joseph Darcy
On 4/10/2013 5:02 AM, Remi Forax wrote: On 04/09/2013 11:12 PM, Joe Darcy wrote: Hello, Please review my changes for 8011800: Add java.util.Objects.requireNonNull(T, SupplierString) http://cr.openjdk.java.net/~darcy/8011800.0/ which add a new method to java.util.Objects to take a

JDK 8 code review request for 8011800: Add java.util.Objects.requireNonNull(T, SupplierString)

2013-04-09 Thread Joe Darcy
Hello, Please review my changes for 8011800: Add java.util.Objects.requireNonNull(T, SupplierString) http://cr.openjdk.java.net/~darcy/8011800.0/ which add a new method to java.util.Objects to take a SupplierString rather than a String. Patch inline below. Thanks, -Joe ---

JDK 8 code review request for 8011800: Add java.util.Objects.requireNonNull(T, SupplierString)

2013-04-09 Thread Paul Benedict
If obj is null and the supplier is also null, you will not get an NPE with the expected message. Since it's kind of odd to get an NPE constructing an NPE, I think: @throws NullPointerException if {@code obj} is {@code null} should be changed to: @throws NullPointerException if {@code obj} or

Re: JDK 8 code review request for 8011800: Add java.util.Objects.requireNonNull(T, SupplierString)

2013-04-09 Thread Mike Duigou
Are we convinced that the capture cost of the lambdas likely to be used as suppliers is generally (*) better than the string construction that using a Supplier would avoid? (*) I say generally because I am certain examples could be found in which either is clearly better. Mike On Apr 9

Re: JDK 8 code review request for 8011800: Add java.util.Objects.requireNonNull(T, SupplierString)

2013-04-09 Thread Joe Darcy
On 04/09/2013 06:00 PM, Mike Duigou wrote: Are we convinced that the capture cost of the lambdas likely to be used as suppliers is generally (*) better than the string construction that using a Supplier would avoid? (*) I say generally because I am certain examples could be found in which

Re: JDK 8 code review request for 8011800: Add java.util.Objects.requireNonNull(T, SupplierString)

2013-04-09 Thread David Holmes
Hi Joe, On 10/04/2013 7:12 AM, Joe Darcy wrote: Hello, Please review my changes for 8011800: Add java.util.Objects.requireNonNull(T, SupplierString) http://cr.openjdk.java.net/~darcy/8011800.0/ which add a new method to java.util.Objects to take a SupplierString rather than a