Skip to content

Fix handling of onmatch and onmismatch#4116

Open
ramanathan1504 wants to merge 11 commits intoapache:2.xfrom
ramanathan1504:fix-handling-of-onmatch-and-onmismatch
Open

Fix handling of onmatch and onmismatch#4116
ramanathan1504 wants to merge 11 commits intoapache:2.xfrom
ramanathan1504:fix-handling-of-onmatch-and-onmismatch

Conversation

@ramanathan1504
Copy link
Copy Markdown
Contributor

Fixes #3505 Issue #2791

Addressed review feedback in this update:

  1. Properties builder robustness (log4j-core/.../PropertiesConfigurationBuilder.java)

    • Added explicit guard for missing rootProperties in build().
    • Replaced direct Long.parseLong(...) for shutdownTimeout with validated parsing (parseShutdownTimeout(...)) that throws a ConfigurationException with a clear message.
    • Kept builder API usage compatible with current interfaces (setLevelAttribute(...), setAdditivityAttribute(...)) to avoid regressions.
  2. Properties consumption correctness (log4j-core/.../PropertiesConfigurationBuilder.java)

    • Switched logger/root levelAndRefs reads to remove the consumed key (properties.remove("")) to avoid stale/unprocessed entries.
    • Ensured remaining logger/root properties are processed via processRemainingProperties(...) before returning, so extra nested attributes/components are not dropped.
  3. Null/empty check cleanup (log4j-core/.../PropertiesConfigurationBuilder.java)

    • Simplified redundant null-or-empty check to Strings.isEmpty(type) in createComponent(...).
  4. Changelog typo fix (src/changelog/.2.x.x/2791_rework_ComponentBuilder_API.xml)

    • Corrected JVerify -> JSpecify.

JWT007 and others added 11 commits February 27, 2025 20:13
+ made all Default***Builder implementations @ProviderrType
+ added setXXXAttribute method to some component builder interfaces with default implementations
+ added JSpecify @NullMarked to packages and @nullable where approrpiate to fields/mehods (per last PR review)
+ deprecated ComponentBuilder#addAttribute(...) methods and replaced with ComponentBuilder#setAttribute(...) methods in line with other builders (i.e. Plugins) - also since they don't just add but also remove if the value is null
+ reorganized ConfigurationBuilder to group getters, setters, builder factory methods
+ incremented package-info.java @Version annoations
+ added some null-guards in BuiltConfiguration#setup()
+ moved DeffaultConfigurationBuilder XML generation code from top to bottom of source file
+ removed "extra" attributes in Default***Builder constructors and replaced with setXXXAttribute chained calls in DefaultConfigurrationBuilder#newXXX(...)  convenience methods
+ javadoc'd both packages (fixing documentation errors)
…instead of void (apache#2791)

+ added @BaselineIgnore due to API change (but breaks no code)
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.

2 participants