Code Review Request: 7160242: (prefs) Preferences.remove(null) does not throw NPE [macosx] (original) (raw)

Alan Bateman Alan.Bateman at oracle.com
Wed Apr 25 08:46:12 UTC 2012


On 24/04/2012 23:20, Kurchi Hazra wrote:

Thanks Remi. I changed it: http://cr.openjdk.java.net/~khazra/7160242/webrev.02/

Can you also point out what advantage using Object.requireNonNull has over simply doing a key == null check as I was doing before? The change looks fine to me; I thought original change was fine too (Objects.requiresNonNull reduces the verbosity in many cases but much of much of a muchness in this case).

Thanks for adding a test. One thing is catching the exception at L41 - that can will potentially hide other exceptions so I suggest removing it, if some other exception is thrown then the test will fail. Minor nit is you are missing a space in "catch(" at L39. No need to re-generate the webrev for these comments.

-Alan.



More information about the core-libs-dev mailing list