RuedigerMoeller / fast-serialization

FST: fast java serialization drop in-replacement
Apache License 2.0
1.59k stars 247 forks source link

JDK 9 Support #219

Open JLLeitschuh opened 7 years ago

JLLeitschuh commented 7 years ago

Does this work in JDK 9? Are the generated objects compatible with JDK 9 serialization?

RuedigerMoeller commented 7 years ago

a) I haven't tried yet. It probably won't work with modules out of the box due to new reflection limitations. b) fst is api compatible, the serialized objects however are not compatible to stock jdk serialization

JLLeitschuh commented 7 years ago

Also, JDK 9 removed/moved sun.misc.Unsafe which means that it won't work.

RuedigerMoeller commented 7 years ago

That's right. It will be portable, but probably a specialized build will be necessary as AFAIK multi version jars will not work with jdk 8 and lower.

As FST can work without Unsafe (fallback code in case Unsafe is null), there is a chance it runs out of the box .. or with minor changes such as turning off Unsafe usage. Ofc jdk9 modules won't work

RuedigerMoeller commented 6 years ago

unsafe is still there but has moved https://dzone.com/articles/using-sunmiscunsafe-in-java-9-1

RuedigerMoeller commented 6 years ago

I made a branch 'jdk9' which actually compiles with java 9. Unfortunately memory mapped files do not work (because of removed AFAIK unreplaceable internal API). Serialization works, but generates WARNING: An illegal reflective access operation has occurred on System.err. I don't know how to workaround this reasonably (without strange --add-opens commandline).

Anybody has an idea ?

Serialization ofc requires "deep" reflective access to various packages, how can I "legalize" this ?