serializer icon indicating copy to clipboard operation
serializer copied to clipboard

Some issues de/serializing certain types. e.g. EnumSet, Exceptions and Records

Open RafaShobr opened this issue 1 year ago • 4 comments

Environment Details

  • Eclipse Serializer Version: 1.0.0
  • JDK version: 17.0.7
  • OS: Windows 10

Describe the bug

Hello! I stumbled across your de/serialization framework, which looks great! As we are just in the middle of transitioning away from hessian, I thought to give it a try. :) We have created a little testsuite to check if serialization works for us and a few things seem to be not working, so I wanted to ask if these are bugs or if I need to configure something or if there is any other way around the issues.

  1. exceptions: org.eclipse.serializer.persistence.exceptions.PersistenceExceptionTypeNotPersistable: Type not persistable: "class java.lang.Exception". Is there a way to enable exceptions?
  2. EnumSet: java.lang.NullPointerException: Cannot load from object array because "this.this$0.universe" is null
  3. BitSet: does not seem to be properly de/serialized (Expected :{135}, Actual :{})
  4. ImmutableList: e.g. List.of(1) -> Expected :[1] Actual :[1, java.lang.Object@69d2e517] some strange object in the list?
  5. ImmutableSet: like above, but with Set.of(1)
  6. de/serializing an object that has transient fields which are initialized like e.g. private transient ReentrantReadWriteLock rwLock = new ReentrantReadWriteLock(); private transient WriteLock wLock = rwLock.writeLock(); private transient ReadLock rLock = rwLock.readLock(); the fields remain null. -> nullreference in later code
  7. When trying to de/serialize records, I get Could not obtain access to "jdk.internal.misc.Unsafe", please start the VM with --add-exports java.base/jdk.internal.misc=ALL-UNNAMED

Regards, Raphael

RafaShobr avatar Nov 02 '23 13:11 RafaShobr