Skip to content

THRIFT-6135: Set isset bits in Java constructors without calling setXIsSet() - #3970

Open
slachiewicz wants to merge 1 commit into
apache:masterfrom
slachiewicz:THRIFT-6135
Open

slachiewicz wants to merge 1 commit into
apache:masterfrom
slachiewicz:THRIFT-6135

Conversation

@slachiewicz

Copy link
Copy Markdown
Member

A generated constructor marked a primitive field as set by calling the public, overridable setXIsSet(true), which javac 21 and later report as this-escape. The constructor now sets the bit directly, as that method does, so there is nothing to suppress. CI builds lib/java with JDK 17, which has no this-escape lint, so the check below was run locally.

Verified: the Java generated for ThriftTest, DebugProtoTest, OptionalRequiredTest, ManyOptionals, JavaTypes and the IDL from the ticket compiles with javac 21 -Xlint:this-escape -Werror (56 warnings before); gradle test in lib/java → 377 passed.

…IsSet()

Client: java

A generated constructor marked a primitive field as set by calling the public,
overridable setXIsSet(true), which javac 21 and later report as this-escape, an
error under -Werror. The constructor now sets the bit directly, as that method
does, so there is nothing to suppress.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@mergeable mergeable Bot added java Pull requests that update Java code compiler labels Sep 27, 2026
@slachiewicz
slachiewicz marked this pull request as ready for review September 27, 2026 18:09

This branch has not been deployed

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

Labels

compiler java Pull requests that update Java code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant