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

Refactor specifications of varargs processing in j.l.invoke

    Details

    • Type: Enhancement
    • Status: Open
    • Priority: P5
    • Resolution: Unresolved
    • Affects Version/s: 10
    • Fix Version/s: None
    • Component/s: core-libs
    • Labels:
      None

      Description

      After JDK-8185993 there are two descriptions of varargs processing in j.l.invoke.

      The first one is in asVarargsCollector:
      "... the adapter replaces all trailing arguments from the original trailing argument position onward, by a new array of type arrayType, whose elements comprise (in order) the replaced arguments."
      asVarargsCollector also specifies the same in terms of an implied asCollector call:
      "In the final case, it is exactly as if the target method handle were temporarily adapted with a fixed arity collector to the arity required by the caller type"

      The second one is added to invokeWithArguments by JDK-8186469 (see the issue for the javadoc text). The second version is supposed to implement the same action as asVarargsCollector but without arity limitations that asVarargsCollector+invoke have.

      The javadocs of asVarargsCollector and invokeWithArguments deserve some refactoring in order to avoid the same concept using different wordings in two places.

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              slukyanov Stanislav Lukyanov (Inactive)
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated: