JDK-8224985 : assertion related to NPE at DynamicCallSiteDesc::withArgs should be reworded
  • Type: CSR
  • Component: core-libs
  • Sub-Component: java.lang.invoke
  • Priority: P4
  • Status: Closed
  • Resolution: Approved
  • Fix Versions: 17
  • Submitted: 2019-05-29
  • Updated: 2021-05-17
  • Resolved: 2021-05-07
Related Reports
CSR :  
Description
Summary
-------

The assertion related to NullPointerException at method java.lang.constant.DynamicCallSiteDesc::withArgs should be reworded.

Problem
-------

The assertion should mention that the NPE can be thrown if the argument contains any null entry.

Solution
--------

Reword the assertion.

Specification
-------------

    diff -r dd321e3596c0 -r 78f3b29fb255 src/java.base/share/classes/java/lang/constant/DynamicCallSiteDesc.java
    --- a/src/java.base/share/classes/java/lang/constant/DynamicCallSiteDesc.java   Wed May 29 13:58:05 2019 +0100
    +++ b/src/java.base/share/classes/java/lang/constant/DynamicCallSiteDesc.java   Wed May 29 09:14:55 2019 -0400
    @@ -156,7 +156,7 @@
          *                      to the bootstrap, that would appear in the
          *                      {@code BootstrapMethods} attribute
          * @return the nominal descriptor
    -     * @throws NullPointerException if any parameter is null
    +     * @throws NullPointerException if the argument or its contents are {@code null}
          */
         public DynamicCallSiteDesc withArgs(ConstantDesc... bootstrapArgs) {
             return new DynamicCallSiteDesc(bootstrapMethod, invocationName, invocationType, bootstrapArgs);
Comments
Moving to Approved. Wording suggestion: "@throws NullPointerException if the argument or its contents are {@code null}"
07-05-2021