RFR: 8272347: ObjectMethods::bootstrap should specify NPE if any argument except lookup is null

Vicente Romero vicente.romero at oracle.com
Tue Aug 24 01:51:25 UTC 2021



On 8/23/21 4:07 PM, Brian Goetz wrote:
> Actually, it will not NPE if `names` is null and you have selected 
> equals/hashCode as the name.  Might be better to do requiresNonNull() 
> up front for all the arguments, just to make such analysis simpler:
>
> requireNonNull(methodName);
> requireNonNull(type);
> requireNonNull(recordClass);
> requireNonNull(names);
> requireNonNull(getters);

will do, thanks,

Vicente
>
> On 8/23/2021 4:04 PM, Brian Goetz wrote:
>> +1
>>
>> On 8/23/2021 2:22 PM, Vicente Romero wrote:
>>> Please review this simple PR along with the associated CSR. The PR 
>>> is basically adding a line the the specification of method 
>>> `java.lang.runtime.ObjectMethods::bootstrap` stating under what 
>>> conditions a NPE will be thrown.
>>>
>>> TIA
>>>
>>> link to the [CSR](https://bugs.openjdk.java.net/browse/JDK-8272852)
>>>
>>> -------------
>>>
>>> Commit messages:
>>>   - 8272347: ObjectMethods::bootstrap should specify NPE if any 
>>> argument except lookup is null
>>>
>>> Changes: https://git.openjdk.java.net/jdk/pull/5226/files
>>>   Webrev: https://webrevs.openjdk.java.net/?repo=jdk&pr=5226&range=00
>>>    Issue: https://bugs.openjdk.java.net/browse/JDK-8272347
>>>    Stats: 1 line in 1 file changed: 1 ins; 0 del; 0 mod
>>>    Patch: https://git.openjdk.java.net/jdk/pull/5226.diff
>>>    Fetch: git fetch https://git.openjdk.java.net/jdk 
>>> pull/5226/head:pull/5226
>>>
>>> PR: https://git.openjdk.java.net/jdk/pull/5226
>>
>



More information about the core-libs-dev mailing list