-
Notifications
You must be signed in to change notification settings - Fork 27
Fix Java 9 Runtime Issues #382
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix Java 9 Runtime Issues #382
Conversation
| import org.bouncycastle.jcajce.spec.GOST28147ParameterSpec; | ||
| import org.bouncycastle.jcajce.util.BCJcaJceHelper; | ||
| import org.objenesis.instantiator.sun.MagicInstantiator; | ||
| import org.objenesis.instantiator.sun.UnsafeFactoryInstantiator; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The implementation of MagicInstantiator was using a security problem in the JDK to perform construction less instantiation and in Java 9 the "security problem" was resolved with no backwards compatibility added. I switched to using the UnsafeFactoryInstantiator because it uses the Java unsafe package which is still available in Java 9 and is also available across different JVM vendors.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't see warnings about module encapsulation in the Azul 9 logs, only deprecated usage of isAccessible, unchecked-casts and raw types. Please fix these wherever possible or add suppressions:
[WARNING] /home/travis/build/joyent/java-manta/java-manta-client-kryo-serialization/src/main/java/com/joyent/manta/serialization/ReflectionUtils.java:[122,19] isAccessible() in java.lang.reflect.AccessibleObject has been deprecated
[WARNING] /home/travis/build/joyent/java-manta/java-manta-client-kryo-serialization/src/main/java/com/joyent/manta/serialization/ReflectionUtils.java:[149,19] isAccessible() in java.lang.reflect.AccessibleObject has been deprecated
[WARNING] /home/travis/build/joyent/java-manta/java-manta-client-kryo-serialization/src/main/java/com/joyent/manta/serialization/BaseBlockCipherSerializer.java:[145,38] found raw type: org.objenesis.instantiator.sun.UnsafeFactoryInstantiator
missing type arguments for generic class org.objenesis.instantiator.sun.UnsafeFactoryInstantiator<T>
[WARNING] /home/travis/build/joyent/java-manta/java-manta-client-kryo-serialization/src/main/java/com/joyent/manta/serialization/BaseBlockCipherSerializer.java:[145,34] unchecked call to UnsafeFactoryInstantiator(java.lang.Class<T>) as a member of the raw type org.objenesis.instantiator.sun.UnsafeFactoryInstantiator
[WARNING] /home/travis/build/joyent/java-manta/java-manta-client-kryo-serialization/src/main/java/com/joyent/manta/serialization/BaseBlockCipherSerializer.java:[147,38] found raw type: org.objenesis.instantiator.sun.UnsafeFactoryInstantiator
missing type arguments for generic class org.objenesis.instantiator.sun.UnsafeFactoryInstantiator<T>
[WARNING] /home/travis/build/joyent/java-manta/java-manta-client-kryo-serialization/src/main/java/com/joyent/manta/serialization/BaseBlockCipherSerializer.java:[147,34] unchecked call to UnsafeFactoryInstantiator(java.lang.Class<T>) as a member of the raw type org.objenesis.instantiator.sun.UnsafeFactoryInstantiator
|
Warnings have been resolved. |
|
One last deprecation remains: |
Referencing #356