Repository navigation
THRIFT-6522: Reject non-string message fields in Java exceptions - #4134
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
marked this pull request as ready for review
November 8, 2026 01:35
slachiewicz
requested review from
Jens-G,
fishy,
jimexist and
mhlakhani
as code owners
November 8, 2026 01:35
Member
Code reviewNo issues found. Checked for bugs and CLAUDE.md compliance. Two suggestions, below the bar for an issue but verified:
thrift/compiler/cpp/tests/CMakeLists.txt Lines 130 to 132 in ba99031
thrift/compiler/cpp/src/thrift/generate/t_java_generator.cc Lines 881 to 892 in ba99031 🤖 Generated with Claude Code |
Client: java An exception field named "message" generates getMessage(), which must override Throwable.getMessage() and so return String. Any other type (bool excepted, it gets isMessage()) produced Java that never compiled. The generator now fails with a message naming the exception and field before writing the file. Tested with t_java_generator_message_field_tests: i32, list and binary are rejected, string and bool still generate. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
slachiewicz
force-pushed
the
THRIFT-6522
branch
from
November 13, 2026 17:26
ba99031 to
d8890d4
Compare
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.
Jira: THRIFT-6522
An exception field named
messagegeneratesgetMessage(), which overridesThrowable.getMessage()and must returnString. With any other type (aboolgetsisMessage()and is fine) the generated Java never compiled. The Java generator now stops with an error naming the exception and the field, before writing any file.IDL that used such a field produced uncompilable Java before, so no working build breaks.
Verified:
thrift_compiler_tests "*named message"→ fails on master (ani32 messagefield is not reported), 2 of 2 test cases pass on this branch; the full suite passes (42 test cases).