RFR: 8272347: ObjectMethods::bootstrap should specify NPE if any argument except lookup is null [v2]
Vicente Romero
vromero at openjdk.java.net
Tue Aug 24 03:06:30 UTC 2021
On Mon, 23 Aug 2021 23:13:58 GMT, Mandy Chung <mchung at openjdk.org> wrote:
>> Vicente Romero has updated the pull request incrementally with one additional commit since the last revision:
>>
>> addressing review comments
>
> 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.
-------------
PR: https://git.openjdk.java.net/jdk/pull/5226
More information about the core-libs-dev
mailing list