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

    • Icon: CSR CSR
    • Resolution: Approved
    • Icon: P2 P2
    • 17
    • core-libs
    • None
    • minimal
    • Java API
    • SE

      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

            vromero Vicente Arturo Romero Zaldivar
            pgundarlahal Prashanthram Gundarlahally
            Jorn Vernee, Mandy Chung (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: