Skip to content

Go: introduce JavaTypeShallowClass#7782

Merged
greg-at-moderne merged 1 commit into
mainfrom
greg-go-rpc-shallowclass-bug
May 26, 2026
Merged

Go: introduce JavaTypeShallowClass#7782
greg-at-moderne merged 1 commit into
mainfrom
greg-go-rpc-shallowclass-bug

Conversation

@greg-at-moderne
Copy link
Copy Markdown
Contributor

@greg-at-moderne greg-at-moderne commented May 26, 2026

What's changed?

In Go, introducing the JavaTypeShallowClass next to the already existing JavaTypeClass.
As a consequence in a lot of places, we need to use FullyQualified super type instead of JavaTypeClass.

What's your motivation?

Without this, the JavaTypeShallowClass objects get conflated/coerced into JavaTypeClass over RPC. And unexpected things happen. The symptoms observed include:

java.lang.IllegalArgumentException: No enum constant org.openrewrite.java.tree.JavaType.FullyQualified.Kind.
  java.base/java.lang.Enum.valueOf(Enum.java:293)
  org.openrewrite.java.tree.JavaType$FullyQualified$Kind.valueOf(JavaType.java:389)
  org.openrewrite.java.internal.rpc.JavaTypeReceiver.lambda$visitClass$7(JavaTypeReceiver.java:74)
  org.openrewrite.rpc.RpcReceiveQueue.receiveAndGet(RpcReceiveQueue.java:71)
  org.openrewrite.java.internal.rpc.JavaTypeReceiver.visitClass(JavaTypeReceiver.java:74)

@github-project-automation github-project-automation Bot moved this to In Progress in OpenRewrite May 26, 2026
@greg-at-moderne greg-at-moderne marked this pull request as ready for review May 26, 2026 11:22
@greg-at-moderne greg-at-moderne merged commit 01529f4 into main May 26, 2026
@greg-at-moderne greg-at-moderne deleted the greg-go-rpc-shallowclass-bug branch May 26, 2026 11:22
@github-project-automation github-project-automation Bot moved this from In Progress to Done in OpenRewrite May 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

1 participant