RFR: JDK-8282776: Bad NullPointerException message when invoking an interface MethodHandle on a null receiver [v4]
Paul Sandoz
psandoz at openjdk.java.net
Tue Mar 29 17:35:46 UTC 2022
On Wed, 23 Mar 2022 23:22:31 GMT, Mandy Chung <mchung at openjdk.org> wrote:
>> A simple patch to call `Objects.requireNonNull(recv)` for an explicit null receiver check rather than NPE thrown by `Object::getClass`. The message of NPE generated by JEP 358 (Helpful NullPointerExceptions) is supposed to be helpful but not in this case.
>
> Mandy Chung has updated the pull request incrementally with one additional commit since the last revision:
>
> per feedback
Moving the check under the `!isInstance(recv)` check is better.
-------------
Marked as reviewed by psandoz (Reviewer).
PR: https://git.openjdk.java.net/jdk/pull/7766
More information about the core-libs-dev
mailing list