Repository navigation
THRIFT-735: Note the stricter read() of required unions in the Java README - #4232
Open
slachiewicz wants to merge 1 commit into
Open
slachiewicz wants to merge 1 commit into
slachiewicz wants to merge 1 commit into
Conversation
slachiewicz
force-pushed
the
THRIFT-735-release-note
branch
from
November 27, 2026 15:17
b4c496c to
fc3f0ad
Compare
slachiewicz
force-pushed
the
THRIFT-735-release-note
branch
from
December 5, 2026 22:02
fc3f0ad to
659dde7
Compare
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
The Java README overgeneralizes the read() failure and should clarify that the workaround applies only to standard-scheme protocols and requires marking the field optional in the reader’s IDL, then regenerating and redeploying the reader.
1 open issue
Review effort: Balanced
…elease notes [skip ci] Client: java Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
slachiewicz
force-pushed
the
THRIFT-735-release-note
branch
from
December 6, 2026 00:51
659dde7 to
688aa56
Compare
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
The Java README still needs to clarify that only regenerated standard-scheme readers call validate() and that an optional field containing an unset union must be cleared or given a known member before reserialization.
2 open issues
1 resolved since last review
Review effort: Balanced
Comment on lines
+305
to
+308
| - Generated `validate()` rejects a field declared `required` whose type is a | ||
| union (typedef'd unions included) when the union has no member set, and | ||
| generated `read()` ends with `validate()`. With the standard scheme | ||
| (`TBinaryProtocol`, `TCompactProtocol`, `TJSONProtocol`), a reader whose IDL |
Comment on lines
+311
to
+315
| ([THRIFT-735](https://issues.apache.org/jira/browse/THRIFT-735)). Optional | ||
| fields are unchanged: if old readers must accept unknown members, make the | ||
| field optional in the reader's IDL, then regenerate and redeploy the reader; | ||
| changing only the writer's IDL is not enough. `TTupleProtocol` is unaffected: | ||
| it already rejected an unknown union member, required or optional. |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Documents the behaviour change from #4125: generated
read()now throwsTProtocolExceptionfor a struct whose required union field arrives with a member the reader's IDL does not know. The README entry tells users to make the field optional if old readers must accept unknown members.