Index: trunk/src/com/kitfox/svg/SVGUniverse.java
===================================================================
--- trunk/src/com/kitfox/svg/SVGUniverse.java	(revision 10865)
+++ trunk/src/com/kitfox/svg/SVGUniverse.java	(revision 11525)
@@ -4,14 +4,14 @@
  * All rights reserved.
  *
- * Redistribution and use in source and binary forms, with or 
+ * Redistribution and use in source and binary forms, with or
  * without modification, are permitted provided that the following
  * conditions are met:
  *
- *   - Redistributions of source code must retain the above 
+ *   - Redistributions of source code must retain the above
  *     copyright notice, this list of conditions and the following
  *     disclaimer.
  *   - Redistributions in binary form must reproduce the above
  *     copyright notice, this list of conditions and the following
- *     disclaimer in the documentation and/or other materials 
+ *     disclaimer in the documentation and/or other materials
  *     provided with the distribution.
  *
@@ -27,6 +27,6 @@
  * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
- * OF THE POSSIBILITY OF SUCH DAMAGE. 
- * 
+ * OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
  * Mark McKay can be contacted at mark@kitfox.com.  Salamander and other
  * projects can be found at http://www.kitfox.com
@@ -36,5 +36,4 @@
 package com.kitfox.svg;
 
-import com.kitfox.svg.app.beans.SVGIcon;
 import java.awt.Graphics2D;
 import java.awt.image.BufferedImage;
@@ -58,11 +57,12 @@
 import java.util.Base64;
 import java.util.HashMap;
-import java.util.Iterator;
 import java.util.logging.Level;
 import java.util.logging.Logger;
 import java.util.zip.GZIPInputStream;
+
 import javax.imageio.ImageIO;
 import javax.xml.parsers.ParserConfigurationException;
 import javax.xml.parsers.SAXParserFactory;
+
 import org.xml.sax.EntityResolver;
 import org.xml.sax.InputSource;
@@ -70,4 +70,6 @@
 import org.xml.sax.SAXParseException;
 import org.xml.sax.XMLReader;
+
+import com.kitfox.svg.app.beans.SVGIcon;
 
 /**
@@ -89,7 +91,7 @@
      * initiated from streams will have the scheme <i>svgSalamander</i>.
      */
-    final HashMap loadedDocs = new HashMap();
-    final HashMap loadedFonts = new HashMap();
-    final HashMap loadedImages = new HashMap();
+    final HashMap<URI, SVGDiagram> loadedDocs = new HashMap<>();
+    final HashMap<String, Font> loadedFonts = new HashMap<>();
+    final HashMap<URL, SoftReference<BufferedImage>> loadedImages = new HashMap<>();
     public static final String INPUTSTREAM_SCHEME = "svgSalamander";
     /**
@@ -141,7 +143,6 @@
     public Font getDefaultFont()
     {
-        for (Iterator it = loadedFonts.values().iterator(); it.hasNext();)
-        {
-            return (Font) it.next();
+        for (Font font : loadedFonts.values()) {
+            return font;
         }
         return null;
@@ -150,5 +151,5 @@
     public Font getFont(String fontName)
     {
-        return (Font) loadedFonts.get(fontName);
+        return loadedFonts.get(fontName);
     }
 
@@ -183,5 +184,5 @@
                     }
 
-                    SoftReference ref = new SoftReference(img);
+                    SoftReference<BufferedImage> ref = new SoftReference<>(img);
                     loadedImages.put(url, ref);
 
@@ -218,5 +219,5 @@
         }
 
-        SoftReference ref;
+        SoftReference<BufferedImage> ref;
         try
         {
@@ -231,9 +232,9 @@
                 icon.paintIcon(null, g, 0, 0);
                 g.dispose();
-                ref = new SoftReference(img);
+                ref = new SoftReference<>(img);
             } else
             {
                 BufferedImage img = ImageIO.read(imageURL);
-                ref = new SoftReference(img);
+                ref = new SoftReference<>(img);
             }
             loadedImages.put(imageURL, ref);
@@ -247,5 +248,5 @@
     BufferedImage getImage(URL imageURL)
     {
-        SoftReference ref = (SoftReference) loadedImages.get(imageURL);
+        SoftReference<BufferedImage> ref = loadedImages.get(imageURL);
         if (ref == null)
         {
@@ -253,5 +254,5 @@
         }
 
-        BufferedImage img = (BufferedImage) ref.get();
+        BufferedImage img = ref.get();
         //If image was cleared from memory, reload it
         if (img == null)
@@ -265,5 +266,5 @@
                     "Could not load image", e);
             }
-            ref = new SoftReference(img);
+            ref = new SoftReference<>(img);
             loadedImages.put(imageURL, ref);
         }
@@ -308,5 +309,5 @@
             URI xmlBase = new URI(path.getScheme(), path.getSchemeSpecificPart(), null);
 
-            SVGDiagram dia = (SVGDiagram) loadedDocs.get(xmlBase);
+            SVGDiagram dia = loadedDocs.get(xmlBase);
             if (dia == null && loadIfAbsent)
             {
@@ -316,5 +317,5 @@
 
                 loadSVG(url, false);
-                dia = (SVGDiagram) loadedDocs.get(xmlBase);
+                dia = loadedDocs.get(xmlBase);
                 if (dia == null)
                 {
@@ -349,5 +350,5 @@
         }
 
-        SVGDiagram dia = (SVGDiagram) loadedDocs.get(xmlBase);
+        SVGDiagram dia = loadedDocs.get(xmlBase);
         if (dia != null || !loadIfAbsent)
         {
@@ -372,5 +373,5 @@
 
             loadSVG(url, false);
-            dia = (SVGDiagram) loadedDocs.get(xmlBase);
+            dia = loadedDocs.get(xmlBase);
             return dia;
         } catch (Exception e)
@@ -604,14 +605,14 @@
     /**
      * Get list of uris of all loaded documents and subdocuments.
-     * @return 
-     */
-    public ArrayList getLoadedDocumentURIs()
-    {
-        return new ArrayList(loadedDocs.keySet());
-    }
-    
+     * @return
+     */
+    public ArrayList<URI> getLoadedDocumentURIs()
+    {
+        return new ArrayList<>(loadedDocs.keySet());
+    }
+
     /**
      * Remove loaded document from cache.
-     * @param uri 
+     * @param uri
      */
     public void removeDocument(URI uri)
@@ -619,5 +620,5 @@
         loadedDocs.remove(uri);
     }
-    
+
     public boolean isVerbose()
     {
