Skip to content

THRIFT-735: Note the stricter read() of required unions in the Java README - #4232

Open
slachiewicz wants to merge 1 commit into
apache:masterfrom
slachiewicz:THRIFT-735-release-note
Open

slachiewicz wants to merge 1 commit into
apache:masterfrom
slachiewicz:THRIFT-735-release-note

Conversation

@slachiewicz

@slachiewicz slachiewicz commented Nov 25, 2026 •

Copy link
Copy Markdown
Member

Documents the behaviour change from #4125: generated read() now throws TProtocolException for 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.

Copilot AI balanced review requested due to automatic review settings November 25, 2026 07:17

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

@mergeable mergeable Bot added the java Pull requests that update Java code label Nov 25, 2026
@slachiewicz
slachiewicz force-pushed the THRIFT-735-release-note branch from b4c496c to fc3f0ad Compare November 27, 2026 15:17
Copilot AI balanced review requested due to automatic review settings November 27, 2026 15:17

This comment was marked as resolved.

@slachiewicz slachiewicz changed the title THRIFT-735: Note the stricter read() of required unions in the Java release notes [skip ci] THRIFT-735: Note the stricter read() of required unions in the Java README Nov 27, 2026
Copilot AI balanced review requested due to automatic review settings December 5, 2026 22:02
@slachiewicz
slachiewicz force-pushed the THRIFT-735-release-note branch from fc3f0ad to 659dde7 Compare December 5, 2026 22:02

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 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

Comment thread lib/java/README.md Resolved
…elease notes [skip ci]

Client: java

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Copilot AI balanced review requested due to automatic review settings December 6, 2026 00:51
@slachiewicz
slachiewicz force-pushed the THRIFT-735-release-note branch from 659dde7 to 688aa56 Compare December 6, 2026 00:51

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 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 thread lib/java/README.md
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 thread lib/java/README.md
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

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

Labels

java Pull requests that update Java code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants