On Tue, 12 Oct 2021 17:42:01 GMT, Peter Levart <plev...@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

Reply via email to