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

Convert dynamic proxy to hidden classes

    XMLWordPrintable

Details

    • Enhancement
    • Resolution: Unresolved
    • P4
    • 24
    • None
    • core-libs
    • None

    Description

      As hidden classes, the methods can be passed as an immutable list class data, accessed via a condy, so the implementations can use `List.get` to access the Method objects, without using reflection to initialize fields. The Proxy implementation is therefore simplified.

      Dynamic proxy is serializable and supported by the default serialization. In JDK-8315810, default serialization now support hidden classes, now that it allocates instances with MethodHandle (backed by Unsafe). The serialization specification and implementation thus need no update.

      Proxy implementations appear in stacktraces, and they cannot be hidden in the existing implementation due to it being under user ClassLoaders; meanwhile, hidden class methods are always hidden. This change in stacktrace will affect users; we can add a flag to restore the old implementation, so that users can ensure their code works properly on both implementations to ease transition.

      Attachments

        Issue Links

          Activity

            People

              liach Chen Liang
              mchung Mandy Chung
              Votes:
              1 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated: