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

Mandy Chung mchung at openjdk.java.net
Mon Aug 23 23:18:38 UTC 2021


On Mon, 23 Aug 2021 18:08:02 GMT, Vicente Romero <vromero at openjdk.org> 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)

Does the existing `ObjectMethodsTest` test verify all NPE cases?

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.

-------------

PR: https://git.openjdk.java.net/jdk/pull/5226


More information about the core-libs-dev mailing list