On Tue, 24 Aug 2021 03:03:37 GMT, Vicente Romero <[email protected]> wrote:
>> src/java.base/share/classes/java/lang/runtime/ObjectMethods.java line 327:
>>
>>> 325: * @throws IllegalArgumentException if the bootstrap arguments are
>>> invalid
>>> 326: * or inconsistent
>>> 327: * @throws NullPointerException if any argument but {@code lookup}
>>> is {@code null}
>>
>> `names` may be null if the {@code methodName} is {@code "equals"} or {@code
>> "hashCode"}. This should be captured here.
>
> 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`.
-------------
PR: https://git.openjdk.java.net/jdk/pull/5226