[maven-4.0.x] Fix field accessibility leak in EnhancedCompositeBeanHelper (#11425) by gnodet · Pull Request #11433 · apache/maven (original) (raw)

@gnodet

…1425)

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:

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 mentioned this pull request

Nov 12, 2025

@gnodet gnodet deleted the backport/maven-4.0.x/pr-11425 branch

November 14, 2025 07:13

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 }})