Skip to content
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

Fixed an issue with Android N's OpenJDK where invalid instantiator is… #38

Merged
merged 1 commit into from May 9, 2016

Conversation

taivokasper
Copy link
Contributor

Fixed Objenesis for Android N preview.

@henri-tremblay henri-tremblay added this to the 2.3 milestone Apr 21, 2016
@henri-tremblay henri-tremblay self-assigned this Apr 21, 2016
@henri-tremblay
Copy link
Contributor

One question: Why are you using the bootclasspath content to deduce the version? Why not using the Android version?

@henri-tremblay
Copy link
Contributor

This is a fix for #37

@taivokasper
Copy link
Contributor Author

Current Android N preview reports 23 as the version not 24. From bootclasspath I can detect whether it uses OpenJDK or not so it seems more reliable to depend on it. I found the solution from this thread.

@Wavesonics
Copy link

A dev from Android comments in that thread that my boot class fix actually isn't a great idea, and we should use reflection to test for the Sun/Oracle method, if it does not exist, then skip the Objenesis stuff.

@henri-tremblay
Copy link
Contributor

@Wavesonics: Yes. PlatformDescription.getAndroidVersion0 is doing pretty much that. So, I'll do a mashup of that and the pull request

@henri-tremblay
Copy link
Contributor

I've modified your code to use UnsafeFactoryInstantiator. ObjectStreamClassInstantiator should be used only to get a serialization like behavior. However, I was surprised to see SunReflectionFactoryInstantiator not working. The ReflectionFactory class is part of the openjdk. Someone knows why it has disappeared?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants