-
Enhancement
-
Resolution: Duplicate
-
P4
-
21
-
None
The serialization constructor in ReflectionFactory is the only one whose accessor is still magic-based (JDK-8305104). They are not used before java.lang.invoke is ready; thus, it's totally safe to migrate them (used by serialization and sun.reflect.ReflectionFactory::newConstructorForSerialization) to exclusively methodhandle-based accessors.
A prototype exists as part of https://github.com/openjdk/jdk/pull/1830 which I have tweaked since the introduction of methodhandle accessors and added extra comments and assertions.
With this migration, hidden classes can be serialized as regular objects (in particular, proxies), and it will simplify the removal of old core reflection implementation.
A prototype exists as part of https://github.com/openjdk/jdk/pull/1830 which I have tweaked since the introduction of methodhandle accessors and added extra comments and assertions.
With this migration, hidden classes can be serialized as regular objects (in particular, proxies), and it will simplify the removal of old core reflection implementation.
- duplicates
-
JDK-8315810 Reimplement sun.reflect.ReflectionFactory::newConstructorForSerialization with method handles
- Resolved
- relates to
-
JDK-8305104 Remove the old core reflection implementation
- Resolved
- links to
-
Review openjdk/jdk/13853