]> source.dussan.org Git - poi.git/commitdiff
Fix generics warnings
authorNick Burch <nick@apache.org>
Fri, 22 Oct 2010 17:14:34 +0000 (17:14 +0000)
committerNick Burch <nick@apache.org>
Fri, 22 Oct 2010 17:14:34 +0000 (17:14 +0000)
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1026409 13f79535-47bb-0310-9956-ffa450edef68

src/java/org/apache/poi/util/POILogFactory.java

index a9ce66f36b3273c4b2c2814bbc7176f5c7c0e15a..3d446c85dd3e9bae1e44368615ca82fb0d5f57d4 100644 (file)
@@ -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