Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Only set default configuration name if none has been previously set (… #3454

Open
wants to merge 2 commits into
base: 2.x
Choose a base branch
from

Conversation

JWT007
Copy link
Contributor

@JWT007 JWT007 commented Feb 11, 2025

[#3431]

AbstractConfiguration#setToDefault() - only sets default configuration name if none has been previously set,

  • added test for this change
  • added changelog entry

// LOG4J2-1176 facilitate memory leak investigation
setName(DefaultConfiguration.DEFAULT_NAME + "@" + Integer.toHexString(hashCode()));
// LOG4J2-3431 don't set a default name if one has already been set
if (this.getName() == null || this.getName().trim().isEmpty()) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We have a Strings.isEmpty utility method for this.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ppkarwasz should I update the PR?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ppkarwasz - Fixed and moved changelog file as mentioned in other PR.

Copy link

Job Requested goals Build Tool Version Build Outcome Build Scan®
build-macos-latest clean install 3.9.8 Build Scan PUBLISHED
build-ubuntu-latest clean install 3.9.8 Build Scan PUBLISHED
build-windows-latest clean install 3.9.8 Build Scan PUBLISHED
Generated by gradle/develocity-actions

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

AbstractConfiguration clears Configuration name if some conditions are met (i.e. no defined loggers)
3 participants