zemiles opened a new pull request, #1810: URL: https://github.com/apache/commons-lang/pull/1810
Fixes [LANG-1835](https://issues.apache.org/jira/browse/LANG-1835). AnnotationUtils can invoke compiler-generated methods in annotation types, causing lambda bodies to execute, exceptions to be thrown, or incorrect hash codes and string representations. Restrict equals(), hashCode(), and toString() to public, abstract, non-synthetic annotation members. Add six regression tests for annotations containing Runnable, Supplier, and Function constants, including equality between distinct annotation instances without executing lambda bodies. Also use package-private visibility for the existing JUnit 5 setup method. Validation: - All six new regression tests fail without the fix. - All 16 AnnotationUtilsTest tests pass with the fix. - The default Maven build passes on JDK 25: 95,978 tests, zero failures or errors, and 17 skipped. - Coverage, license, Checkstyle, API compatibility, SpotBugs, PMD, and Javadoc checks pass. - AnnotationUtilsTest and Checkstyle were rerun successfully after the setup visibility adjustment. Checklist: - [ ] Read the [contribution guidelines](https://github.com/apache/commons-lang/blob/master/CONTRIBUTING.md). - [ ] Read the [ASF Generative Tooling Guidance](https://www.apache.org/legal/generative-tooling.html). - [x] I used AI to create part of this pull request. OpenAI Codex generated the implementation and regression tests, and helped with validation and the PR description. - [x] Run a successful build using the default Maven goal. - [x] Write regression tests that fail without the runtime fix. - [x] Write a description explaining the change. - [x] Use a meaningful commit subject and body. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
