-
Enhancement
-
Resolution: Fixed
-
P3
-
22
sun.reflect.ReflectionFactory::newConstructorForSerialization is JDK unsupported API used by 3rd party serialization framework.
This API currently generates the bytecode which fails the verification because `new C; invokespecial A()` where the given class `C` and invoke a no-arg constructor of `C`'s first non-`Serializable` superclass `A` is not a valid operation per the VM specification. VM special cases the classes generated for reflection to skip verification for the constructors generated for serialization and externalization. See [1] for details.
Reimplementing ReflectionFactory::newConstructorForSerialization with method handles will allow the VM hack to be removed.
[1] https://bugs.openjdk.org/browse/JDK-8305104?focusedCommentId=14570146&page=com.atlassian.jira.plugin.system.issuetabpanels%3Acomment-tabpanel#comment-14570146
This API currently generates the bytecode which fails the verification because `new C; invokespecial A()` where the given class `C` and invoke a no-arg constructor of `C`'s first non-`Serializable` superclass `A` is not a valid operation per the VM specification. VM special cases the classes generated for reflection to skip verification for the constructors generated for serialization and externalization. See [1] for details.
Reimplementing ReflectionFactory::newConstructorForSerialization with method handles will allow the VM hack to be removed.
[1] https://bugs.openjdk.org/browse/JDK-8305104?focusedCommentId=14570146&page=com.atlassian.jira.plugin.system.issuetabpanels%3Acomment-tabpanel#comment-14570146
- blocks
-
JDK-8242888 Convert dynamic proxy to hidden classes
- In Progress
- csr for
-
JDK-8315811 Reimplement sun.reflect.ReflectionFactory::newConstructorForSerialization with method handles
- Closed
- duplicates
-
JDK-8307575 Migrate the serialization constructor accessors to Method Handles
- Closed
- relates to
-
JDK-8327624 Remove VM implementation that bypass verification for core reflection
- Resolved
-
JDK-8305104 Remove the old core reflection implementation
- Resolved
(2 links to)