Skip to content

Honor ConfigurationFactory active state#4199

Open
DragonFSKY wants to merge 4 commits into
apache:2.xfrom
DragonFSKY:fix-3896-configuration-factory-active
Open

Honor ConfigurationFactory active state#4199
DragonFSKY wants to merge 4 commits into
apache:2.xfrom
DragonFSKY:fix-3896-configuration-factory-active

Conversation

@DragonFSKY

Copy link
Copy Markdown

Fixes #3896.

This change makes ConfigurationFactory active-state handling consistent:

  • Aggregate lookup skips inactive factories before querying their capabilities or creating configurations.
  • Direct use of inactive JSON, YAML, and Log4j 1.x compatibility factories fails with IllegalStateException.
  • Activation remains dynamic and honors overridden isActive() implementations.

Tests cover aggregate lookup paths, dynamic activation, overridden active state, and missing JSON/YAML dependencies. Existing Log4j 1.x configuration tests now explicitly enable compatibility mode where required, and the affected OSGi package versions reflect the new protected overrides.

Checklist

  • Base your changes on 2.x branch if you are targeting Log4j 2; use main otherwise
  • ./mvnw verify succeeds (the build instructions)
  • Non-trivial changes contain an entry file in the src/changelog/.2.x.x directory
  • Tests are provided

@ramanathan1504

Copy link
Copy Markdown
Contributor

@DragonFSKY I've just taken a quick look at your PR and noticed there are multiple new test cases. Since it touches multiple files, please give us a little time. We will review it ASAP!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Development

Successfully merging this pull request may close these issues.

Fix ConfigurationFactory::isActive overrides

2 participants