Repository navigation
Conversation
Prevent callers from changing stored bootstrap arguments through constructor, setter, or getter array aliases. Preserve null-to-empty normalization and existing copy behavior, document explicit setter updates, and add behavioral regressions covering ownership, copying, and serialized output. This addresses the BootstrapMethod portion of BCEL-238. Generated-by: ChatGPT
|
Hello @agamal026 |
|
You're right; BootstrapMethod is not the only affected class. I selected it as a bounded part of BCEL-238: its arguments are a primitive A wider change needs contract distinctions. The selection was a limited ownership change, not a BootstrapMethod-specific user failure or a claim that the other APIs are safe. This PR also changes the existing live-array behavior: callers must use Would you prefer this as a scoped increment under BCEL-238, or should we first establish which related APIs should return copies versus live arrays? AI disclosure: This reply was drafted by OpenAI ChatGPT (GPT-6 Astra Pro), with source inspection and separate AI reviews. |
|
@agamal026 |
Problem
BootstrapMethodretains arrays supplied to its constructor/setter and exposes the stored array through its getter. A caller can therefore change the object's bootstrap arguments, including the bytes written bydump(), without an explicit update.Related to BCEL-238. This PR addresses
BootstrapMethodargument arrays within the broader issue.Changes
Callers that previously updated arguments by modifying a supplied array or a getter result must now apply those changes with
setBootstrapArguments(...).Validation and proof
Source:
4ec24e4, treef2d597d840a5b09af42518f21ceeaad8ebdfbf98, based on0d7c17fb365e4be8e3b66018548e7ebbda0e9507.Executed on 22 October 2026 with Maven 3.9.11 and OpenJDK 17.0.20 on Linux, targeting Java 8:
The four baseline failures are the constructor, setter, getter, and serialized-output ownership assertions. Both test files are byte-identical between the baseline and fixed runs.
The successful default run completed at 11:56:51 UTC, including coverage, RAT, Japicmp, Checkstyle, PMD, SpotBugs, and Javadoc checks.
Portable reproduction:
Immutable proof packet with logs, commands, case outcomes, and checksums.
The proof records exact commands, UTC times, source identities, sanitized logs, case counts, and the initial environment failures. This environment needed launchers for the installed JDK's
javap,javac, and Javadoc modules. No project test or check was skipped to work around those missing launchers. Local Linux/JDK 17 results do not establish coverage of other operating systems/JDKs or hosted CI execution.AI disclosure
ChatGPT generated the implementation, tests, documentation, and this description, and coordinated automated review and test execution. Independent AI reviewers checked scope and compatibility; no independent human review is claimed. The commit includes a
Generated-by: ChatGPTtrailer. The contribution guidelines and ASF Generative Tooling Guidance were reviewed.