Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8270209

java.lang.constant.DynamicCallSiteDesc::of should throw NPE if elements in `bootstrapArgs` is null

    XMLWordPrintable

    Details

    • Type: CSR
    • Status: Closed
    • Priority: P2
    • Resolution: Approved
    • Fix Version/s: 17
    • Component/s: core-libs
    • Labels:
      None
    • Subcomponent:
    • Compatibility Risk:
      minimal
    • Interface Kind:
      Java API
    • Scope:
      SE

      Description

      Summary

      java.lang.constant.DynamicCallSiteDesc::of (the version taking the varargs bootstrapArgs argument) should throw NullPointerException if element in bootstrapArgs is null.

      Problem

      The @throws NullPointerException assertion should mention that a NPE can be thrown if any argument contains any null entry.

      Solution

      Reword the assertion.

      Specification

      diff --git a/src/java.base/share/classes/java/lang/constant/DynamicCallSiteDesc.java b/src/java.base/share/classes/java/lang/constant/DynamicCallSiteDesc.java
      index 9b5b1d66cf8..cf6d09c14b3 100644
      --- a/src/java.base/share/classes/java/lang/constant/DynamicCallSiteDesc.java
      +++ b/src/java.base/share/classes/java/lang/constant/DynamicCallSiteDesc.java
      @@ -100,7 +100,7 @@ public class DynamicCallSiteDesc {
            *                      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 any parameter or its contents are {@code null}
            * @throws IllegalArgumentException if the invocation name has the incorrect
            * format
            * @jvms 4.2.2 Unqualified Names

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              vromero Vicente Arturo Romero Zaldivar
              Reporter:
              pgundarlahal Prashanthram Gundarlahally
              Reviewed By:
              Jorn Vernee, Mandy Chung
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: