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

Vicente Romero vicente.romero at oracle.com
Thu Aug 26 02:33:31 UTC 2021



On 8/25/21 4:45 PM, Mandy Chung wrote:
>
>
> On 8/25/21 12:08 PM, Vicente Romero wrote:
>> On Wed, 25 Aug 2021 02:17:12 GMT, Mandy Chung<mchung at openjdk.org>  wrote:
>>
>>>> Hi Mandy, I have changed the implementation of the method to explicitly require all arguments but lookup to be non-null as suggested by Brian. I have also covered, I think, all the missing test cases in test `ObjectMethodsTest`, thanks for your comments.
>>> I think you meant requiring `names` to be non-null but `lookup` may still be null.  It's okay to change the spec to require `names` to be non-null.
>>>
>>> Probably better to mention in `@param names` that `names` is ignored when the `methodName` is `equals` or `hashCode`.
>> no I think I prefer to force names to be non-null all the time, that way we offer a more consistent interface to users. They don't have to remember what case was for which names can be null.
>
> What I meant is to require it to be non-null but the spec should also 
> mention `names` parameter is ignored if the method name is `equals` 
> and `hashCode`.
>
> Mandy

I see, I have updated the PR, thanks for your comments
>
>> -------------
>>
>> PR:https://git.openjdk.java.net/jdk/pull/5226
>

Vicente


More information about the core-libs-dev mailing list