r/java • u/Shawn-Yang25 • Jun 16 '26
Apache Fory Serialization 1.2.0 released: JDK 25/26 support without sun.misc.Unsafe
https://github.com/apache/fory/releases/tag/v1.2.0
51
Upvotes
r/java • u/Shawn-Yang25 • Jun 16 '26
View all comments
Show parent comment
10
u/Shawn-Yang25 Jun 16 '26 edited Jun 16 '26
It's recommanded in https://openjdk.org/jeps/500, but we also have a fallback path, if it's removed by JDK or unavailable, we use ObjectStreamClass.newInstance to create object instance, which also works. ReflectionFactory has less checks, which is faster, ObjectStreamClass.newInstance has more checks, but also works.
For record classes, we still invoke record constructor.