Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Java 9 support: use Unsafe-based reflection in Java 9+ #1218
So there's good news and bad news.
Note to project maintainer: This is a terminal state, meaning the
I think this might be the wrong solution to the problem. Unfortunately, the right solution to this problem is a lot of work.
Instead of using a bigger, more powerful weapon to read & write platform types, I think Gson should have a new java-platform-typeadapters module.
Wherever Gson’s users are relying on reflection to read+write a platform type like java.util.UUID, we should handwrite a type adapter. That way we avoid getting into an arms race with the JDK maintainers who really don’t want their fields to be reflected upon.