logging-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ggreg...@apache.org
Subject svn commit: r1514953 - in /logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core: config/Configuration.java layout/PatternLayout.java layout/RFC5424Layout.java
Date Sat, 17 Aug 2013 06:24:49 GMT
Author: ggregory
Date: Sat Aug 17 06:24:49 2013
New Revision: 1514953

URL: http://svn.apache.org/r1514953
Log:
Use generics to let the call site declare the return type, it knows what it is doing.

Modified:
    logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/config/Configuration.java
    logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/layout/PatternLayout.java
    logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/layout/RFC5424Layout.java

Modified: logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/config/Configuration.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/config/Configuration.java?rev=1514953&r1=1514952&r2=1514953&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/config/Configuration.java
(original)
+++ logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/config/Configuration.java
Sat Aug 17 06:24:49 2013
@@ -76,7 +76,7 @@ public interface Configuration extends F
 
     void createConfiguration(Node node, LogEvent event);
 
-    Object getComponent(String name);
+    <T> T getComponent(String name);
 
     void addComponent(String name, Object object);
 

Modified: logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/layout/PatternLayout.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/layout/PatternLayout.java?rev=1514953&r1=1514952&r2=1514953&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/layout/PatternLayout.java
(original)
+++ logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/layout/PatternLayout.java
Sat Aug 17 06:24:49 2013
@@ -182,7 +182,7 @@ public final class PatternLayout extends
         if (config == null) {
             return new PatternParser(config, KEY, LogEventPatternConverter.class);
         }
-        PatternParser parser = (PatternParser) config.getComponent(KEY);
+        PatternParser parser = config.getComponent(KEY);
         if (parser == null) {
             parser = new PatternParser(config, KEY, LogEventPatternConverter.class);
             config.addComponent(KEY, parser);

Modified: logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/layout/RFC5424Layout.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/layout/RFC5424Layout.java?rev=1514953&r1=1514952&r2=1514953&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/layout/RFC5424Layout.java
(original)
+++ logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/layout/RFC5424Layout.java
Sat Aug 17 06:24:49 2013
@@ -204,7 +204,7 @@ public final class RFC5424Layout extends
             return new PatternParser(config, PatternLayout.KEY, LogEventPatternConverter.class,
                 filterClass);
         }
-        PatternParser parser = (PatternParser) config.getComponent(COMPONENT_KEY);
+        PatternParser parser = config.getComponent(COMPONENT_KEY);
         if (parser == null) {
             parser = new PatternParser(config, PatternLayout.KEY, ThrowablePatternConverter.class);
             config.addComponent(COMPONENT_KEY, parser);



Mime
View raw message