logging-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ggreg...@apache.org
Subject svn commit: r1394292 - /logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/ConsoleAppender.java
Date Thu, 04 Oct 2012 21:58:45 GMT
Author: ggregory
Date: Thu Oct  4 21:58:45 2012
New Revision: 1394292

URL: http://svn.apache.org/viewvc?rev=1394292&view=rev
Log:
Remove compiler warnings and document.

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

Modified: logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/ConsoleAppender.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/ConsoleAppender.java?rev=1394292&r1=1394291&r2=1394292&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/ConsoleAppender.java
(original)
+++ logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/ConsoleAppender.java
Thu Oct  4 21:58:45 2012
@@ -100,8 +100,9 @@ public final class ConsoleAppender exten
         } else {
             try {
                 ClassLoader loader = Loader.getClassLoader();
-                Class clazz = loader.loadClass("org.fusesource.jansi.WindowsAnsiOutputStream");
-                Constructor constructor = clazz.getConstructor(OutputStream.class);
+                // We type the parameter as a wildcard to avoid a hard reference to Jansi.
+                Class<?> clazz = loader.loadClass("org.fusesource.jansi.WindowsAnsiOutputStream");
+                Constructor<?> constructor = clazz.getConstructor(OutputStream.class);
                 return (OutputStream) constructor.newInstance(printStream);
             } catch (ClassNotFoundException cnfe) {
                 LOGGER.debug("Jansi is not installed");



Mime
View raw message