[maven-4.0.x] Fix field accessibility leak in EnhancedCompositeBeanHelper (#11425) by gnodet · Pull Request #11433 · apache/maven (original) (raw)
The previous implementation cached field accessibility state globally, which could cause issues when the same field is accessed from different contexts or security managers. This was particularly problematic in plugin unit tests where fields would remain accessible after being set.
The fix ensures that field accessibility is properly restored to its original state after setting field values, preventing accessibility state from leaking between different bean instances.
Added unit tests to verify:
- Field accessibility is restored after setting values
- Multiple field accesses don't leak accessibility state
- The fix works correctly across different bean instances
This resolves the issue reported on the dev list regarding compiler plugin unit test failures related to field accessibility.
(cherry picked from commit 6e30ae6)
gnodet deleted the backport/maven-4.0.x/pr-11425 branch
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
[ Show hidden characters]({{ revealButtonHref }})