You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@logging.apache.org by gg...@apache.org on 2015/08/09 17:50:33 UTC

logging-log4j2 git commit: Replace calls like: final LoggerContext context = (LoggerContext) LogManager.getContext(false); with new LoggerContext methods like: final LoggerContext context = LoggerContext.getContext(false);

Repository: logging-log4j2
Updated Branches:
  refs/heads/master b0316f530 -> 7e0feed98


Replace calls like:
  final LoggerContext context = (LoggerContext)
LogManager.getContext(false);
with new LoggerContext methods like:
  final LoggerContext context = LoggerContext.getContext(false);

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

Branch: refs/heads/master
Commit: 7e0feed9849403f960c66a07878939823dafe914
Parents: b0316f5
Author: ggregory <gg...@apache.org>
Authored: Sun Aug 9 08:50:31 2015 -0700
Committer: ggregory <gg...@apache.org>
Committed: Sun Aug 9 08:50:31 2015 -0700

----------------------------------------------------------------------
 .../org/apache/logging/log4j/core/SimplePerfTest.java    | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/7e0feed9/log4j-core/src/test/java/org/apache/logging/log4j/core/SimplePerfTest.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/test/java/org/apache/logging/log4j/core/SimplePerfTest.java b/log4j-core/src/test/java/org/apache/logging/log4j/core/SimplePerfTest.java
index bba9895..e4ae209 100644
--- a/log4j-core/src/test/java/org/apache/logging/log4j/core/SimplePerfTest.java
+++ b/log4j-core/src/test/java/org/apache/logging/log4j/core/SimplePerfTest.java
@@ -48,11 +48,12 @@ public class SimplePerfTest {
     @BeforeClass
     public static void setupClass() {
 
-        final Configuration config = ((LoggerContext)LogManager.getContext()).getConfiguration();
-        if (!DefaultConfiguration.DEFAULT_NAME.equals(config.getName())) {
-            System.out.println("Configuration was " + config.getName());
-            ((LoggerContext)LogManager.getContext()).start(new DefaultConfiguration());
-        }
+		final Configuration config = LoggerContext.getContext().getConfiguration();
+		
+		if (!DefaultConfiguration.DEFAULT_NAME.equals(config.getName())) {
+			System.out.println("Configuration was " + config.getName());
+			LoggerContext.getContext().start(new DefaultConfiguration());
+		}
 
         for (int i=0; i < WARMUP; ++i) {
             overhead();