You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@logging.apache.org by vy...@apache.org on 2021/12/14 01:40:50 UTC

[logging-log4j2] branch release-2.x updated: Remove static dependency on JndiLookup.class (#625)

This is an automated email from the ASF dual-hosted git repository.

vy pushed a commit to branch release-2.x
in repository https://gitbox.apache.org/repos/asf/logging-log4j2.git


The following commit(s) were added to refs/heads/release-2.x by this push:
     new 7236183  Remove static dependency on JndiLookup.class (#625)
7236183 is described below

commit 7236183f2ee1ef807618e88639ef1aa0110677e5
Author: Ryan Schmitt <rs...@pobox.com>
AuthorDate: Mon Dec 13 17:39:31 2021 -0800

    Remove static dependency on JndiLookup.class (#625)
    
    This change ensures that it remains safe to remove `JndiLookup.class`.
---
 .../main/java/org/apache/logging/log4j/core/lookup/Interpolator.java    | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/lookup/Interpolator.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/lookup/Interpolator.java
index 75c0a45..9c491ac 100644
--- a/log4j-core/src/main/java/org/apache/logging/log4j/core/lookup/Interpolator.java
+++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/lookup/Interpolator.java
@@ -78,7 +78,7 @@ public class Interpolator extends AbstractConfigurationAwareLookup {
         for (final Map.Entry<String, PluginType<?>> entry : plugins.entrySet()) {
             try {
                 final Class<? extends StrLookup> clazz = entry.getValue().getPluginClass().asSubclass(StrLookup.class);
-                if (!clazz.getName().equals(JndiLookup.class.getName()) || JndiManager.isJndiEnabled()) {
+                if (!clazz.getName().equals("org.apache.logging.log4j.core.lookup.JndiLookup") || JndiManager.isJndiEnabled()) {
                     strLookupMap.put(entry.getKey().toLowerCase(), ReflectionUtil.instantiate(clazz));
                 }
             } catch (final Throwable t) {