Details
-
Enhancement
-
Resolution: Unresolved
-
P4
-
None
-
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. InJDK-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.
Dynamic proxy is serializable and supported by the default serialization. In
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
- csr for
-
JDK-8332770 Convert dynamic proxy to hidden classes
- Draft
- is blocked by
-
JDK-8315810 Reimplement sun.reflect.ReflectionFactory::newConstructorForSerialization with method handles
- Resolved
- relates to
-
JDK-8229959 Convert proxy class to use constant dynamic
- Resolved
- links to
-
Review openjdk/jdk/8278
-
Review(master) openjdk/jdk/19356