JDK 8 code review request for 8011800: Add java.util.Objects.requireNonNull(T, Supplier<String>)

Alan Bateman Alan.Bateman at oracle.com
Wed Apr 10 12:01:34 UTC 2013


On 09/04/2013 22:12, Joe Darcy wrote:
> Hello,
>
> Please review my changes for
>
>     8011800: Add java.util.Objects.requireNonNull(T, Supplier<String>)
>     http://cr.openjdk.java.net/~darcy/8011800.0/
>
> which add a new method to java.util.Objects to take a Supplier<String> 
> rather than a String.
>
> Patch inline below.
>
> Thanks,
>
> -Joe
>
A typo in the javadoc "this methods allows" -> "this method allows".

A subjective comment, but I would drop the word "sibling" from the 
statement.

A minor nit with the @param spilling over into a second line is that it 
might be clearer to indent it so that it's clear where the next tag 
starts. I see the existing requiresNonNull are inconsistent on this point.

The uninteresting Supplier is null case isn't specified, perhaps this is 
deliberate?

A typo in the test at line 208, "rvariant" -> "variant".

Also the printed message at line 226 when you get don't pantaloons 
should say "Supplier" rather than "2-arg".

-Alan.




More information about the core-libs-dev mailing list