Skip to content

Support private record serialization#2084

Open
migmacdev wants to merge 2 commits intosquare:masterfrom
migmacdev:private-record-serialization-support
Open

Support private record serialization#2084
migmacdev wants to merge 2 commits intosquare:masterfrom
migmacdev:private-record-serialization-support

Conversation

@migmacdev
Copy link

Description

Support private record serialization

Proposed solution for: #1528

@ZacSweers
Copy link
Collaborator

Can you explain the change a bit? I'm unfamiliar with this "unreflect" API

@JakeWharton
Copy link
Collaborator

Unreflect turns a reflection Method into a MethodHandle. I don't really think this is a workable long-term solution. We could just invoke the reflection Method by making it accessible, but isAccessible is going away so we'll be broken again in a year or two and then without a solution.

@migmacdev
Copy link
Author

Got it, instead I can use MethodHandles.privateLookupIn to obtain a lookup with private access, and falllback to the standard lookup if there's an IllegalAccessException.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants