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/11/19 12:29:31 UTC

logging-log4j2 git commit: LOG4J2-1677 removed method MapMessage::getDataValue (was added unnecessarily, filters can use existing method ::get)

Repository: logging-log4j2
Updated Branches:
  refs/heads/master 585f33835 -> 0f3d9cfe3


LOG4J2-1677 removed method MapMessage::getDataValue (was added unnecessarily, filters can use existing method ::get)


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

Branch: refs/heads/master
Commit: 0f3d9cfe3e18b1aa9dd45283b96fabe2b8057751
Parents: 585f338
Author: rpopma <rp...@apache.org>
Authored: Sat Nov 19 21:29:22 2016 +0900
Committer: rpopma <rp...@apache.org>
Committed: Sat Nov 19 21:29:22 2016 +0900

----------------------------------------------------------------------
 .../org/apache/logging/log4j/message/MapMessage.java     | 11 -----------
 .../org/apache/logging/log4j/core/filter/MapFilter.java  |  2 +-
 .../logging/log4j/core/filter/StructuredDataFilter.java  |  2 +-
 3 files changed, 2 insertions(+), 13 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/0f3d9cfe/log4j-api/src/main/java/org/apache/logging/log4j/message/MapMessage.java
----------------------------------------------------------------------
diff --git a/log4j-api/src/main/java/org/apache/logging/log4j/message/MapMessage.java b/log4j-api/src/main/java/org/apache/logging/log4j/message/MapMessage.java
index 0425de9..b113ed5 100644
--- a/log4j-api/src/main/java/org/apache/logging/log4j/message/MapMessage.java
+++ b/log4j-api/src/main/java/org/apache/logging/log4j/message/MapMessage.java
@@ -103,17 +103,6 @@ public class MapMessage implements MultiformatMessage {
     }
 
     /**
-     * Returns the value of the specified key in the message data, or {@code null} if the message data does not contain
-     * the specified key.
-     *
-     * @param key the key whose value to look up in the message data
-     * @return the value of the specified key in the message data, or {@code null}
-     */
-    public String getDataValue(final String key) {
-        return data.get(key);
-    }
-
-    /**
      * Clear the data.
      */
     public void clear() {

http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/0f3d9cfe/log4j-core/src/main/java/org/apache/logging/log4j/core/filter/MapFilter.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/filter/MapFilter.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/filter/MapFilter.java
index 85dc73e..c2ebc37 100644
--- a/log4j-core/src/main/java/org/apache/logging/log4j/core/filter/MapFilter.java
+++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/filter/MapFilter.java
@@ -84,7 +84,7 @@ public class MapFilter extends AbstractFilter {
     protected boolean filter(final MapMessage mapMessage) {
         boolean match = false;
         for (int i = 0; i < map.size(); i++) {
-            final String toMatch = mapMessage.getDataValue(map.getKeyAt(i));
+            final String toMatch = mapMessage.get(map.getKeyAt(i));
             match = toMatch != null && ((List<String>) map.getValueAt(i)).contains(toMatch);
 
             if ((!isAnd && match) || (isAnd && !match)) {

http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/0f3d9cfe/log4j-core/src/main/java/org/apache/logging/log4j/core/filter/StructuredDataFilter.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/filter/StructuredDataFilter.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/filter/StructuredDataFilter.java
index 9e46d27..111b1cd 100644
--- a/log4j-core/src/main/java/org/apache/logging/log4j/core/filter/StructuredDataFilter.java
+++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/filter/StructuredDataFilter.java
@@ -101,7 +101,7 @@ public final class StructuredDataFilter extends MapFilter {
             data.formatTo(sb);
             return sb;
         } else {
-            return appendOrNull(data.getDataValue(key), sb);
+            return appendOrNull(data.get(key), sb);
         }
     }