You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@logging.apache.org by rp...@apache.org on 2016/08/23 13:42:24 UTC

[06/23] logging-log4j2 git commit: [LOG4J2-1538] Dynamic removal of filter may cause NPE.

[LOG4J2-1538] Dynamic removal of filter may cause NPE.

Project: http://git-wip-us.apache.org/repos/asf/logging-log4j2/repo
Commit: http://git-wip-us.apache.org/repos/asf/logging-log4j2/commit/9bea362a
Tree: http://git-wip-us.apache.org/repos/asf/logging-log4j2/tree/9bea362a
Diff: http://git-wip-us.apache.org/repos/asf/logging-log4j2/diff/9bea362a

Branch: refs/heads/LOG4J2-1349-gcfree-threadcontext
Commit: 9bea362a0440cfed0e12eb503e95e1c8eadbe827
Parents: 3a4d9a6
Author: Gary Gregory <gg...@apache.org>
Authored: Mon Aug 22 17:24:36 2016 -0700
Committer: Gary Gregory <gg...@apache.org>
Committed: Mon Aug 22 17:24:36 2016 -0700

----------------------------------------------------------------------
 .../org/apache/logging/log4j/core/config/AppenderControl.java     | 3 ++-
 src/changes/changes.xml                                           | 3 +++
 2 files changed, 5 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/9bea362a/log4j-core/src/main/java/org/apache/logging/log4j/core/config/AppenderControl.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/config/AppenderControl.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/config/AppenderControl.java
index 68d4db1..de0a777 100644
--- a/log4j-core/src/main/java/org/apache/logging/log4j/core/config/AppenderControl.java
+++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/config/AppenderControl.java
@@ -90,7 +90,8 @@ public class AppenderControl extends AbstractFilterable {
 
     @PerformanceSensitive
     private boolean isFilteredByAppenderControl(final LogEvent event) {
-        return getFilter() != null && Filter.Result.DENY == getFilter().filter(event);
+        final Filter filter = getFilter();
+        return filter != null && Filter.Result.DENY == filter.filter(event);
     }
 
     @PerformanceSensitive

http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/9bea362a/src/changes/changes.xml
----------------------------------------------------------------------
diff --git a/src/changes/changes.xml b/src/changes/changes.xml
index 98c0aee..93eeef0 100644
--- a/src/changes/changes.xml
+++ b/src/changes/changes.xml
@@ -24,6 +24,9 @@
   </properties>
   <body>
     <release version="2.7" date="2016-MM-DD" description="GA Release 2.7">
+      <action issue="LOG4J2-1538" dev="ggregory" type="fix" due-to="Igor Karpov">
+        Dynamic removal of filter may cause NPE.
+      </action>
       <action issue="LOG4J2-1532" dev="ggregory" type="fix" due-to="Gary Gregory">
         Attributes are not merged properly in composite configurations.
       </action>