• Icon: Sub-task Sub-task
    • Resolution: Fixed
    • Icon: P4 P4
    • 8
    • None
    • core-libs
    • None

      The language runtime needs to be enhanced with an alternate metafactory which can inject additional marker interfaces. Its signature and behavior is described below:

          /**
           * Alternate meta-factory for conversion of lambda expressions or method references to functional interfaces,
           * which supports serialization and other uncommon options.
           *
           * @param caller Stacked automatically by VM; represents a lookup context with the accessibility privileges
           * of the caller.
           * @param invokedName Stacked automatically by VM; the name of the invoked method as it appears at the call site.
           * Currently unused.
           * @param invokedType Stacked automatically by VM; the signature of the invoked method, which includes the
           * expected static type of the returned lambda object, and the static types of the captured
           * arguments for the lambda. In the event that the implementation method is an instance method,
           * the first argument in the invocation signature will correspond to the receiver.
           * @param samMethod The primary method in the functional interface to which the lambda or method reference is
           * being converted, represented as a method handle.
           * @param implMethod The implementation method which should be called (with suitable adaptation of argument
           * types, return types, and adjustment for captured arguments) when methods of the resulting
           * functional interface instance are invoked.
           * @param instantiatedMethodType The signature of the SAM method from the functional interface's perspective
           * @param flags A bitmask containing flags that may influence the translation of this lambda expression. Defined
           * fields include FLAG_SERIALIZABLE.
           * @param markerInterfaces Additional interfaces which the lambda object should implement.
           * @return a CallSite, which, when invoked, will return an instance of the functional interface
           * @throws ReflectiveOperationException
           * @throws LambdaConversionException If any of the meta-factory protocol invariants are violated
           */
          public static CallSite altMetaFactory(MethodHandles.Lookup caller,
                                                String invokedName,
                                                MethodType invokedType,
                                                MethodHandle samMethod,
                                                MethodHandle implMethod,
                                                MethodType instantiatedMethodType,
                                                int flags,
                                                Class... markerInterfaces)
                  throws ReflectiveOperationException, LambdaConversionException

            rfield Robert Field (Inactive)
            briangoetz Brian Goetz
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: