You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
Partially. I'm always frustrated when I have to write an empty default constructor to allow deserialization of Properties and INI files, while JSON frameworks such as Gson and Jackson allow the same without requiring a default constructor.
Describe the solution you'd like
A solution based on sun.misc.Unsafe so that an empty instance is created for deserialization, without calling any constructor, as described in https://dzone.com/articles/understanding-sunmiscunsafe.
Ideally, the programmer could disable this behavior via settings and use the "classic" solution, based on Reflection, if they prefer it.
oswaldobapvicjr
changed the title
Allow object deserialization without the default constructor
Allow object instantiation without calling the default constructor
Jun 9, 2023
Is your feature request related to a problem? Please describe.
Partially. I'm always frustrated when I have to write an empty default constructor to allow deserialization of Properties and INI files, while JSON frameworks such as Gson and Jackson allow the same without requiring a default constructor.
Describe the solution you'd like
A solution based on
sun.misc.Unsafe
so that an empty instance is created for deserialization, without calling any constructor, as described in https://dzone.com/articles/understanding-sunmiscunsafe.Ideally, the programmer could disable this behavior via settings and use the "classic" solution, based on Reflection, if they prefer it.
Additional context
https://www.baeldung.com/java-unsafe
The text was updated successfully, but these errors were encountered: