Re: RFR: JDK-8282776: Bad NullPointerException message when invoking an interface MethodHandle on a null receiver [v4]

2022-03-29 Thread Paul Sandoz
On Wed, 23 Mar 2022 23:22:31 GMT, Mandy Chung  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


Re: RFR: JDK-8282776: Bad NullPointerException message when invoking an interface MethodHandle on a null receiver [v4]

2022-03-23 Thread Mandy Chung
> 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

-

Changes:
  - all: https://git.openjdk.java.net/jdk/pull/7766/files
  - new: https://git.openjdk.java.net/jdk/pull/7766/files/62f74c70..55c38cf8

Webrevs:
 - full: https://webrevs.openjdk.java.net/?repo=jdk=7766=03
 - incr: https://webrevs.openjdk.java.net/?repo=jdk=7766=02-03

  Stats: 4 lines in 1 file changed: 2 ins; 0 del; 2 mod
  Patch: https://git.openjdk.java.net/jdk/pull/7766.diff
  Fetch: git fetch https://git.openjdk.java.net/jdk pull/7766/head:pull/7766

PR: https://git.openjdk.java.net/jdk/pull/7766