logging-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ggreg...@apache.org
Subject svn commit: r1448664 - /logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/config/ConfigurationFactory.java
Date Thu, 21 Feb 2013 14:42:07 GMT
Author: ggregory
Date: Thu Feb 21 14:42:07 2013
New Revision: 1448664

URL: http://svn.apache.org/r1448664
Log:
Fix some generics warnings.

Modified:
    logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/config/ConfigurationFactory.java

Modified: logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/config/ConfigurationFactory.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/config/ConfigurationFactory.java?rev=1448664&r1=1448663&r2=1448664&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/config/ConfigurationFactory.java
(original)
+++ logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/config/ConfigurationFactory.java
Thu Feb 21 14:42:07 2013
@@ -122,10 +122,10 @@ public abstract class ConfigurationFacto
         return configFactory;
     }
 
+    @SuppressWarnings("unchecked")
     private static void addFactory(final String factoryClass) {
         try {
-            final Class clazz = Class.forName(factoryClass);
-            addFactory(clazz);
+            addFactory((Class<ConfigurationFactory>) Class.forName(factoryClass));
         } catch (final ClassNotFoundException ex) {
             LOGGER.error("Unable to load class " + factoryClass, ex);
         } catch (final Exception ex) {
@@ -133,9 +133,9 @@ public abstract class ConfigurationFacto
         }
     }
 
-    private static void addFactory(final Class factoryClass) {
+    private static void addFactory(final Class<ConfigurationFactory> factoryClass)
{
         try {
-            factories.add((ConfigurationFactory) factoryClass.newInstance());
+            factories.add(factoryClass.newInstance());
         } catch (final Exception ex) {
             LOGGER.error("Unable to create instance of " + factoryClass.getName(), ex);
         }



Mime
View raw message