poi-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From n...@apache.org
Subject svn commit: r1026409 - /poi/trunk/src/java/org/apache/poi/util/POILogFactory.java
Date Fri, 22 Oct 2010 17:14:34 GMT
Author: nick
Date: Fri Oct 22 17:14:34 2010
New Revision: 1026409

URL: http://svn.apache.org/viewvc?rev=1026409&view=rev
Log:
Fix generics warnings

Modified:
    poi/trunk/src/java/org/apache/poi/util/POILogFactory.java

Modified: poi/trunk/src/java/org/apache/poi/util/POILogFactory.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/java/org/apache/poi/util/POILogFactory.java?rev=1026409&r1=1026408&r2=1026409&view=diff
==============================================================================
--- poi/trunk/src/java/org/apache/poi/util/POILogFactory.java (original)
+++ poi/trunk/src/java/org/apache/poi/util/POILogFactory.java Fri Oct 22 17:14:34 2010
@@ -36,7 +36,7 @@ public class POILogFactory
     /**
      * Map of POILogger instances, with classes as keys
      */
-    private static Map _loggers = new HashMap();;
+    private static Map<String,POILogger> _loggers = new HashMap<String,POILogger>();;
 
     /**
      * A common instance of NullLogger, as it does nothing
@@ -108,11 +108,12 @@ public class POILogFactory
         // Fetch the right logger for them, creating
         //  it if that's required 
         if (_loggers.containsKey(cat)) {
-            logger = ( POILogger ) _loggers.get(cat);
+            logger = _loggers.get(cat);
         } else {
             try {
-              Class loggerClass = Class.forName(_loggerClassName);
-              logger = ( POILogger ) loggerClass.newInstance();
+              Class<? extends POILogger> loggerClass = 
+                 (Class<? extends POILogger>)Class.forName(_loggerClassName);
+              logger = loggerClass.newInstance();
               logger.initialize(cat);
             } catch(Exception e) {
               // Give up and use the null logger



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@poi.apache.org
For additional commands, e-mail: commits-help@poi.apache.org


Mime
View raw message