Author: ggregory
Date: Sun Nov 4 16:16:45 2012
New Revision: 1405580
URL: http://svn.apache.org/viewvc?rev=1405580&view=rev
Log:
Refactor Result creation with safe upper case in a new toResult method with a
default value. This removes a lot of duplicate code.
Modified:
logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/filter/DynamicThresholdFilter.java
Modified:
logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/filter/DynamicThresholdFilter.java
URL:
http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/filter/DynamicThresholdFilter.java?rev=1405580&r1=1405579&r2=1405580&view=diff
==============================================================================
---
logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/filter/DynamicThresholdFilter.java
(original)
+++
logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/filter/DynamicThresholdFilter.java
Sun Nov 4 16:16:45 2012
@@ -128,8 +128,8 @@ public final class DynamicThresholdFilte
@PluginAttr("defaultThreshold") String level,
@PluginAttr("onmatch")
String match,
@PluginAttr("onmismatch") String mismatch) {
- Result onMatch = match == null ? null : Result.toResult(match);
- Result onMismatch = mismatch == null ? null :
Result.toResult(mismatch);
+ Result onMatch = Result.toResult(match);
+ Result onMismatch = Result.toResult(mismatch);
Map<String, Level> map = new HashMap<String, Level>();
for (KeyValuePair pair : pairs) {
map.put(pair.getKey(),
Level.toLevel(pair.getValue().toUpperCase(Locale.ENGLISH)));