gnodet opened a new pull request, #2436:
URL: https://github.com/apache/maven/pull/2436
This commit refactors the WrapperProperties template used for Maven model
properties:
TEMPLATE CHANGES (src/mdo/java/WrapperProperties.java):
- Removed caching mechanism (orderedProps field and ensureInitialized()
method)
- Simplified read operations to directly delegate to getter.get()
- Introduced writeOperation() pattern for all write operations that:
* Creates a fresh OrderedProperties from current state
* Performs the operation on the copy
* Only calls setter if changes were made
- All write operations now use synchronized writeOperation() wrapper
- Maintains insertion order through OrderedProperties inner class
- Supports multiple wrapper instances sharing the same backend storage
The new approach eliminates cache invalidation complexity while ensuring:
- Thread safety through synchronized write operations
- Insertion order preservation
- Immediate visibility of changes across wrapper instances
- Proper delegation to underlying storage
SIDE EFFECTS:
- Consolidated redundant test classes into single PropertiesTest
- Removed PropertiesOrderTest and WrapperPropertiesOrderTest (functionality
covered by PropertiesTest)
- Cleaned up duplicate test methods in PropertiesTest
This refactoring simplifies the WrapperProperties implementation while
maintaining
all required functionality for Maven model property management.
--
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]