src/solaris/classes/sun/awt/X11InputMethod.java
Print this page
rev 9830 : 8039642: Fix raw and unchecked warnings in sun.awt.*
Reviewed-by: darcy, prr
*** 98,108 ****
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 boolean disposed = false;
//reset the XIC if necessary
private boolean needResetXIC = false;
private WeakReference<Component> needResetXICClient = new WeakReference<>(null);
--- 98,108 ----
private Component lastXICFocussedComponent = null;
private boolean isLastXICActive = false;
private boolean isLastTemporary = false;
private boolean isActive = false;
private boolean isActiveClient = false;
! 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,168 ****
// 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;
// UNSELECTED_RAW_TEXT_HIGHLIGHT
! 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);
styles[1] = Collections.unmodifiableMap(map);
// UNSELECTED_CONVERTED_TEXT_HIGHLIGHT
! 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);
styles[3] = Collections.unmodifiableMap(map);
highlightStyles = styles;
}
--- 134,166 ----
// this structure needs to be accessed within AWT_LOCK/UNLOCK
transient private long pData = 0; // accessed by native
// Initialize highlight mapping table
static {
! @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);
styles[0] = Collections.unmodifiableMap(map);
// SELECTED_RAW_TEXT_HIGHLIGHT
! 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.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);
styles[3] = Collections.unmodifiableMap(map);
highlightStyles = styles;
}
*** 431,441 ****
}
/**
* @see java.awt.Toolkit#mapInputMethodHighlight
*/
! public static Map mapInputMethodHighlight(InputMethodHighlight highlight) {
int index;
int state = highlight.getState();
if (state == InputMethodHighlight.RAW_TEXT) {
index = 0;
} else if (state == InputMethodHighlight.CONVERTED_TEXT) {
--- 429,439 ----
}
/**
* @see java.awt.Toolkit#mapInputMethodHighlight
*/
! 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) {