Repository navigation
Conversation
garydgregory
added a commit
that referenced
this pull request
Oct 18, 2026
Emit boolean literals so generated creators call FieldGen.setInitValue(boolean) and avoid the type mismatch caused by the int overload. Improve on PR #536 by preserving explicit false ConstantValue attributes, which the PR loses during reconstruction. This keeps regenerated fields usable as compile-time constants. Also allow false to replace a previous true value. Use the low bit for noncanonical integer encodings to match HotSpot behavior. Document the fixture's indirect use and generated creator workflow. Extend tests to cover initializer replacement and cancellation, noncanonical encodings, and preservation of boolean ConstantValue attributes. The PR's javap comparison alone does not detect missing constant attributes.
Member
|
Thank you for the fix. The reported bug is real, and emitting boolean literals resolves the generated creator’s runtime failure. Closing this PR in favor of commit 7fc6cd4f, which incorporates that fix and addresses additional round-trip correctness issues:
You are credited in |
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.
Summary
BCEL-379:
BCELifierprints the numericCONSTANT_Integervalue for a boolean field, so its generated creator callsFieldGen.setInitValue(int)and fails at runtime. Emit a boolean literal for boolean fields while leaving other constant types unchanged.The regression checks true and false literals from compiled bytecode and adds the fixture to the existing generate/compile/run/javap round trip. The change also includes a
changes.xmlentry.Jira: https://issues.apache.org/jira/browse/BCEL-379
Validation
mvn: BUILD SUCCESS on macOS with JDK 27.mvn -q verify: passed.mvn -q checkstyle:check: passed after correcting the new fixture header.Contribution checklist
mvnbuild passed.