Skip to content

RPC: Add support for JavaType.Primitive #5684

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

Merged
merged 5 commits into from
Jun 30, 2025
Merged

Conversation

knutwannheden
Copy link
Contributor

Enums are a bit special in Java compared to many other programming languages, as they are proper objects and are allowed to have instance fields as well as implement interfaces. For normal enums the RPC mechanism only sends the enum constant's name. For JavaType.Primitive this doesn't quite work, because the RPC receiver currently assumes that "new" references are either transferred with a value or a valueType, but JavaType.Primitive instances get sent without either of these, because they have an onChange and a codec. Therefore, there is currently an exception for the JavaType.Primitive type in RPC.

Enums are a bit special in Java compared to many other programming languages, as they are proper objects and are allowed to have instance fields as well as implement interfaces. For normal enums the RPC mechanism only sends the enum constant's name. For `JavaType.Primitive` this doesn't quite work, because the RPC receiver currently assumes that "new" references are either transferred with a `value` or a `valueType`, but `JavaType.Primitive` instances get sent without either of these, because they have an `onChange` and a codec. Therefore, there is currently an exception for the `JavaType.Primitive` type in RPC.
@knutwannheden knutwannheden merged commit 1f4436d into main Jun 30, 2025
2 checks passed
@knutwannheden knutwannheden deleted the rpc-javatype-primitive branch June 30, 2025 09:43
@github-project-automation github-project-automation bot moved this from In Progress to Done in OpenRewrite Jun 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

1 participant