logging-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ggreg...@apache.org
Subject svn commit: r1521645 - /logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/ConsoleAppender.java
Date Tue, 10 Sep 2013 21:10:13 GMT
Author: ggregory
Date: Tue Sep 10 21:10:12 2013
New Revision: 1521645

URL: http://svn.apache.org/r1521645
Log:
Statement unnecessarily nested within else clause.

Modified:
    logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/ConsoleAppender.java

Modified: logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/ConsoleAppender.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/ConsoleAppender.java?rev=1521645&r1=1521644&r2=1521645&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/ConsoleAppender.java
(original)
+++ logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/ConsoleAppender.java
Tue Sep 10 21:10:12 2013
@@ -118,22 +118,21 @@ public final class ConsoleAppender exten
         if (!propsUtil.getStringProperty("os.name").startsWith("Windows") ||
             propsUtil.getBooleanProperty("log4j.skipJansi")) {
             return printStream;
-        } else {
-            try {
-                final ClassLoader loader = Loader.getClassLoader();
-                // We type the parameter as a wildcard to avoid a hard reference to Jansi.
-                final Class<?> clazz = loader.loadClass("org.fusesource.jansi.WindowsAnsiOutputStream");
-                final Constructor<?> constructor = clazz.getConstructor(OutputStream.class);
-                return (OutputStream) constructor.newInstance(printStream);
-            } catch (final ClassNotFoundException cnfe) {
-                LOGGER.debug("Jansi is not installed");
-            } catch (final NoSuchMethodException nsme) {
-                LOGGER.warn("WindowsAnsiOutputStream is missing the proper constructor");
-            } catch (final Exception ex) {
-                LOGGER.warn("Unable to instantiate WindowsAnsiOutputStream");
-            }
-            return printStream;
         }
+        try {
+            final ClassLoader loader = Loader.getClassLoader();
+            // We type the parameter as a wildcard to avoid a hard reference to Jansi.
+            final Class<?> clazz = loader.loadClass("org.fusesource.jansi.WindowsAnsiOutputStream");
+            final Constructor<?> constructor = clazz.getConstructor(OutputStream.class);
+            return (OutputStream) constructor.newInstance(printStream);
+        } catch (final ClassNotFoundException cnfe) {
+            LOGGER.debug("Jansi is not installed");
+        } catch (final NoSuchMethodException nsme) {
+            LOGGER.warn("WindowsAnsiOutputStream is missing the proper constructor");
+        } catch (final Exception ex) {
+            LOGGER.warn("Unable to instantiate WindowsAnsiOutputStream");
+        }
+        return printStream;
     }
 
     /**



Mime
View raw message