You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@logging.apache.org by rg...@apache.org on 2020/02/23 17:33:18 UTC
[logging-log4j2] branch master updated: ThreadContext: Convert
static fields to ivars (#341)
This is an automated email from the ASF dual-hosted git repository.
rgoers pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/logging-log4j2.git
The following commit(s) were added to refs/heads/master by this push:
new df19b3b ThreadContext: Convert static fields to ivars (#341)
df19b3b is described below
commit df19b3b6f70b58c15ea72f73c9098ca1c39257ae
Author: Marius Volkhart <ma...@volkhart.com>
AuthorDate: Sun Feb 23 18:33:08 2020 +0100
ThreadContext: Convert static fields to ivars (#341)
These don't get used outside the scope of init().
---
log4j-api/src/main/java/org/apache/logging/log4j/ThreadContext.java | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/log4j-api/src/main/java/org/apache/logging/log4j/ThreadContext.java b/log4j-api/src/main/java/org/apache/logging/log4j/ThreadContext.java
index 5318410..18471b7 100644
--- a/log4j-api/src/main/java/org/apache/logging/log4j/ThreadContext.java
+++ b/log4j-api/src/main/java/org/apache/logging/log4j/ThreadContext.java
@@ -192,8 +192,6 @@ public final class ThreadContext {
private static final String DISABLE_STACK = "disableThreadContextStack";
private static final String DISABLE_ALL = "disableThreadContext";
- private static boolean disableAll;
- private static boolean useMap;
private static boolean useStack;
private static ThreadContextMap contextMap;
private static ThreadContextStack contextStack;
@@ -214,9 +212,9 @@ public final class ThreadContext {
ThreadContextMapFactory.init();
contextMap = null;
final PropertiesUtil managerProps = PropertiesUtil.getProperties();
- disableAll = managerProps.getBooleanProperty(DISABLE_ALL);
+ boolean disableAll = managerProps.getBooleanProperty(DISABLE_ALL);
useStack = !(managerProps.getBooleanProperty(DISABLE_STACK) || disableAll);
- useMap = !(managerProps.getBooleanProperty(DISABLE_MAP) || disableAll);
+ boolean useMap = !(managerProps.getBooleanProperty(DISABLE_MAP) || disableAll);
contextStack = new DefaultThreadContextStack(useStack);
if (!useMap) {