src/solaris/classes/sun/awt/X11/XWM.java

Print this page
rev 9830 : 8039642: Fix raw and unchecked warnings in sun.awt.*
Reviewed-by: darcy, prr

@@ -1070,10 +1070,11 @@
     private HashMap<Class<?>, Collection<?>> protocolsMap = new HashMap<Class<?>, Collection<?>>();
     /**
      * Returns all protocols supporting given protocol interface
      */
     <T> Collection<T> getProtocols(Class<T> protocolInterface) {
+        @SuppressWarnings("unchecked")
         Collection<T> res = (Collection<T>) protocolsMap.get(protocolInterface);
         if (res != null) {
             return res;
         } else {
             return new LinkedList<T>();

@@ -1320,13 +1321,13 @@
                 }
             }
         }
     }
 
-    HashMap storedInsets = new HashMap();
+    HashMap<Class<?>, Insets> storedInsets = new HashMap<>();
     Insets guessInsets(XDecoratedPeer window) {
-        Insets res = (Insets)storedInsets.get(window.getClass());
+        Insets res = storedInsets.get(window.getClass());
         if (res == null) {
             switch (WMID) {
               case ENLIGHTEN_WM:
                   res = new Insets(19, 4, 4, 4);
                   break;