gnodet opened a new pull request, #14028: URL: https://github.com/apache/maven/pull/14028
Backport of #2526 to `maven-4.0.x`. The `maven-4.0.x` branch already contained a richer version of the `EnhancedCompositeBeanHelper` class (with sealed-type support and more tests) so a straight cherry-pick conflicts. This manual application ports the one optimization that was missing on the branch: a third `ACCESSIBLE_FIELD_CACHE` that avoids repeated `field.canAccess()` and `field.setAccessible()` calls by caching the accessibility state of each `Field` object. **Changes applied from d3bd71bbdf2e88f1674b4e977a7c8c5547df9e1b:** - Add `ACCESSIBLE_FIELD_CACHE: ConcurrentMap<Field, Boolean>` - Update `setFieldValue()` to look up/store accessibility in the new cache - Update `clearCaches()` to also clear `ACCESSIBLE_FIELD_CACHE` **Intentionally NOT ported from master:** - `putIfAbsent → put` in `buildFieldCache`: `maven-4.0.x` deliberately uses `putIfAbsent` so the child class's field wins when a field is shadowed (tested by `testSetPropertyOnShadowedFieldInjectsIntoChildField`) - Removal of `resolveClassForImplementationHint` / sealed-type handling: that extra logic is correct and needed on `maven-4.0.x` - Test removals: `maven-4.0.x` has a superset of the master test suite; all tests retained Manual application of d3bd71bbdf2e88f1674b4e977a7c8c5547df9e1b. -- 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]
