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

Proxy::newProxyInstance and MethodHandleProxies::asInterfaceInstance should reject sealed interfaces

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • P2
    • Resolution: Fixed
    • 17
    • 17
    • core-libs
    • None

    Backports

      Description

        Creating as a P2 for now as this may need attention in Java 17.

        Proxy.newProxyInstance doesn't specify how it deals with sealed interfaces. I suspect we may need to update the list of restrictions so that IllegalArgumentException is thrown if an interface is sealed.

        As things stand, a confusing IncompatibleClassChangeError will be thrown when attempting to define the proxy class.

        Attachments

          Issue Links

            Activity

              People

                mchung Mandy Chung
                alanb Alan Bateman
                Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                  Created:
                  Updated:
                  Resolved: