src/solaris/classes/sun/awt/X11InputMethod.java

Print this page

        

@@ -98,11 +98,11 @@
     private Component lastXICFocussedComponent = null;
     private boolean   isLastXICActive = false;
     private boolean   isLastTemporary = false;
     private boolean   isActive = false;
     private boolean   isActiveClient = false;
-    private static Map[] highlightStyles;
+    private static Map<TextAttribute, ?>[] highlightStyles;
     private boolean disposed = false;
 
     //reset the XIC if necessary
     private boolean   needResetXIC = false;
     private WeakReference<Component> needResetXICClient = new WeakReference<>(null);

@@ -134,35 +134,33 @@
     // this structure needs to be accessed within AWT_LOCK/UNLOCK
     transient private long pData = 0; // accessed by native
 
     // Initialize highlight mapping table
     static {
-        Map styles[] = new Map[4];
-        HashMap map;
+        @SuppressWarnings({"unchecked", "rawtypes"})
+        Map<TextAttribute, ?> styles[] = new Map[4];
+        HashMap<TextAttribute, Object> map;
 
         // UNSELECTED_RAW_TEXT_HIGHLIGHT
-        map = new HashMap(1);
-        map.put(TextAttribute.WEIGHT,
-                  TextAttribute.WEIGHT_BOLD);
+        map = new HashMap<>(1);
+        map.put(TextAttribute.WEIGHT, TextAttribute.WEIGHT_BOLD);
         styles[0] = Collections.unmodifiableMap(map);
 
         // SELECTED_RAW_TEXT_HIGHLIGHT
-        map = new HashMap(1);
-        map.put(TextAttribute.SWAP_COLORS,
-                  TextAttribute.SWAP_COLORS_ON);
+        map = new HashMap<>(1);
+        map.put(TextAttribute.SWAP_COLORS, TextAttribute.SWAP_COLORS_ON);
         styles[1] = Collections.unmodifiableMap(map);
 
         // UNSELECTED_CONVERTED_TEXT_HIGHLIGHT
-        map = new HashMap(1);
+        map = new HashMap<>(1);
         map.put(TextAttribute.INPUT_METHOD_UNDERLINE,
                   TextAttribute.UNDERLINE_LOW_ONE_PIXEL);
         styles[2] = Collections.unmodifiableMap(map);
 
         // SELECTED_CONVERTED_TEXT_HIGHLIGHT
-        map = new HashMap(1);
-        map.put(TextAttribute.SWAP_COLORS,
-                  TextAttribute.SWAP_COLORS_ON);
+        map = new HashMap<>(1);
+        map.put(TextAttribute.SWAP_COLORS, TextAttribute.SWAP_COLORS_ON);
         styles[3] = Collections.unmodifiableMap(map);
 
         highlightStyles = styles;
     }
 

@@ -431,11 +429,11 @@
     }
 
     /**
      * @see java.awt.Toolkit#mapInputMethodHighlight
      */
-    public static Map mapInputMethodHighlight(InputMethodHighlight highlight) {
+    public static Map<TextAttribute, ?> mapInputMethodHighlight(InputMethodHighlight highlight) {
         int index;
         int state = highlight.getState();
         if (state == InputMethodHighlight.RAW_TEXT) {
             index = 0;
         } else if (state == InputMethodHighlight.CONVERTED_TEXT) {