ppkarwasz opened a new pull request, #3968: URL: https://github.com/apache/logging-log4j2/pull/3968
The current factory pattern used with the `AbstractManager` registry is unnecessarily complex. It relies on: * **Stateless factory classes** to create managers of each type, * **Separate `FactoryData` parameter objects** to pass construction data #### What this PR does This PR simplifies the registry factory mechanism by: * Replacing the factory classes with **inline lambda factories** * Allowing **stateful factory lambdas**, removing boilerplate `FactoryData` classes in most cases * Keeping factory logic **localized and easier to follow** within the registry call site This is a **pure refactoring**, it does not change behavior. It improves code readability and maintainability by reducing indirection and eliminating unnecessary types. #### Notes `FactoryData` parameter objects are still used where necessary: * **`RollingFileManager`** and **`RollingRandomAccessFileManager`** still require parameter objects since they update state on each retrieval, not just during initialization. * Other managers still pass `Configuration` through `ConfigurationFactoryData` to access `getLoggerContext()`, which remains useful. ## Checklist ### ๐งช Tests (select one) - [ ] I have added or updated tests to cover my changes. - [x] No additional tests are needed for this change. ### ๐ Changelog (select one) - [x] I added a changelog entry in `src/changelog/.2.x.x`. (See [Changelog Entry File Guide](https://logging.apache.org/log4j/tools/log4j-changelog.html#changelog-entry-file)). - [ ] This is a trivial change and does not require a changelog entry. -- 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]
