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

MethodHandleProxies.asInterfaceInstance does not support default methods

XMLWordPrintable

    • Icon: CSR CSR
    • Resolution: Approved
    • Icon: P4 P4
    • 11.0.7-oracle
    • core-libs
    • None
    • behavioral
    • minimal
    • Java API
    • Implementation

      Summary

      Calling a default method on an instance produced by MethodHandleProxies.asInterface throws a " java.lang.InternalError: bad proxy method" which violates the contract of the default methods

      Problem

      MethodHandleProxies.asInterfaceInstance does not support default methods and does not mention such methods with regards to selection of the uniquely named method.

      Solution

      The change supports MethodHandleProxies.asInterfaceInstance to invoke default method thereby avoiding recursive invocation back to the proxy class.

      Specification

      No spec change, only behavioural changes are ported.

            kravikumar Kiran Sidhartha Ravikumar (Inactive)
            webbuggrp Webbug Group
            Paul Sandoz
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: