RFR: 8271820: Implementation of JEP 416: Reimplement Core Reflection with Method Handle [v12]

Peter Levart plevart at openjdk.java.net
Tue Oct 12 22:21:53 UTC 2021


On Tue, 12 Oct 2021 17:42:01 GMT, Peter Levart <plevart at openjdk.org> wrote:

>> Mandy Chung has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Fix left-over assignment
>
> src/java.base/share/classes/jdk/internal/reflect/MethodHandleCharacterFieldAccessorImpl.java line 137:
> 
>> 135:     {
>> 136:         if (isReadOnly()) {
>> 137:             ensureObj(obj);     // throw NPE if obj is null on instance field
> 
> I think ensureObj(obj) must go before if statement in setChar

No, it's OK. You are relying on `setter.invokeExact(obj, c)` to throw NPE later...

-------------

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


More information about the core-libs-dev mailing list