提交 55f2f042 编写于 作者: N naoto

7117465: Warning cleanup for IMF classes

Reviewed-by: okutsu
上级 b79c3ab0
......@@ -190,6 +190,6 @@ public class InputMethodHighlight {
private boolean selected;
private int state;
private int variation;
private Map style;
private Map<TextAttribute, ?> style;
};
......@@ -313,4 +313,7 @@ public final class CompositionArea extends JPanel implements InputMethodListener
compositionWindow.pack();
}
// Proclaim serial compatibility with 1.7.0
private static final long serialVersionUID = -1057247068746557444L;
}
......@@ -257,7 +257,7 @@ class CompositionAreaHandler implements InputMethodListener,
*/
InputMethodRequests getClientInputMethodRequests() {
if (clientComponent != null) {
return (InputMethodRequests) clientComponent.getInputMethodRequests();
return clientComponent.getInputMethodRequests();
}
return null;
......
......@@ -79,7 +79,7 @@ public class InputContext extends java.awt.im.InputContext
private boolean inputMethodCreationFailed;
// holding bin for previously used input method instances, but not the current one
private HashMap usedInputMethods;
private HashMap<InputMethodLocator, InputMethod> usedInputMethods;
// the current client component is kept until the user focusses on a different
// client component served by the same input context. When that happens, we call
......@@ -106,7 +106,7 @@ public class InputContext extends java.awt.im.InputContext
// cache location notification
private Rectangle clientWindowLocation = null;
// holding the state of clientWindowNotificationEnabled of only non-current input methods
private HashMap perInputMethodState;
private HashMap<InputMethod, Boolean> perInputMethodState;
// Input Method selection hot key stuff
private static AWTKeyStroke inputMethodSelectionKey;
......@@ -219,6 +219,7 @@ public class InputContext extends java.awt.im.InputContext
/**
* @see java.awt.im.InputContext#dispatchEvent
*/
@SuppressWarnings("fallthrough")
public void dispatchEvent(AWTEvent event) {
if (event instanceof InputMethodEvent) {
......@@ -394,7 +395,7 @@ public class InputContext extends java.awt.im.InputContext
isInputMethodActive = true;
if (perInputMethodState != null) {
Boolean state = (Boolean) perInputMethodState.remove(inputMethod);
Boolean state = perInputMethodState.remove(inputMethod);
if (state != null) {
clientWindowNotificationEnabled = state.booleanValue();
}
......@@ -549,10 +550,10 @@ public class InputContext extends java.awt.im.InputContext
// keep the input method instance around for future use
if (usedInputMethods == null) {
usedInputMethods = new HashMap(5);
usedInputMethods = new HashMap<>(5);
}
if (perInputMethodState == null) {
perInputMethodState = new HashMap(5);
perInputMethodState = new HashMap<>(5);
}
usedInputMethods.put(inputMethodLocator.deriveLocator(null), inputMethod);
perInputMethodState.put(inputMethod,
......@@ -689,10 +690,10 @@ public class InputContext extends java.awt.im.InputContext
}
inputMethodLocator = null;
if (usedInputMethods != null && !usedInputMethods.isEmpty()) {
Iterator iterator = usedInputMethods.values().iterator();
Iterator<InputMethod> iterator = usedInputMethods.values().iterator();
usedInputMethods = null;
while (iterator.hasNext()) {
((InputMethod) iterator.next()).dispose();
iterator.next().dispose();
}
}
......@@ -830,13 +831,13 @@ public class InputContext extends java.awt.im.InputContext
// see whether we have a previously used input method
if (usedInputMethods != null) {
inputMethodInstance = (InputMethod) usedInputMethods.remove(locator.deriveLocator(null));
inputMethodInstance = usedInputMethods.remove(locator.deriveLocator(null));
if (inputMethodInstance != null) {
if (locale != null) {
inputMethodInstance.setLocale(locale);
}
inputMethodInstance.setCharacterSubsets(characterSubsets);
Boolean state = (Boolean) perInputMethodState.remove(inputMethodInstance);
Boolean state = perInputMethodState.remove(inputMethodInstance);
if (state != null) {
enableClientWindowNotification(inputMethodInstance, state.booleanValue());
}
......@@ -919,7 +920,7 @@ public class InputContext extends java.awt.im.InputContext
// method becomes the current one.
if (requester != inputMethod) {
if (perInputMethodState == null) {
perInputMethodState = new HashMap(5);
perInputMethodState = new HashMap<>(5);
}
perInputMethodState.put(requester, Boolean.valueOf(enable));
return;
......@@ -1029,7 +1030,7 @@ public class InputContext extends java.awt.im.InputContext
* Initializes the input method selection key definition in preference trees
*/
private void initializeInputMethodSelectionKey() {
AccessController.doPrivileged(new PrivilegedAction() {
AccessController.doPrivileged(new PrivilegedAction<Object>() {
public Object run() {
// Look in user's tree
Preferences root = Preferences.userRoot();
......
......@@ -72,12 +72,11 @@ public class InputMethodContext
static {
// check whether we should use below-the-spot input
// get property from command line
String inputStyle = (String) AccessController.doPrivileged
String inputStyle = AccessController.doPrivileged
(new GetPropertyAction("java.awt.im.style", null));
// get property from awt.properties file
if (inputStyle == null) {
inputStyle = Toolkit.getDefaultToolkit().
getProperty("java.awt.im.style", null);
inputStyle = Toolkit.getProperty("java.awt.im.style", null);
}
belowTheSpotInputRequested = "below-the-spot".equals(inputStyle);
}
......
......@@ -68,4 +68,7 @@ public class InputMethodJFrame
return super.getInputContext();
}
}
// Proclaim serial compatibility with 1.7.0
private static final long serialVersionUID = -4705856747771842549L;
}
......@@ -270,7 +270,7 @@ class ExecutableInputMethodManager extends InputMethodManager
// IM preference stuff
private static final String preferredIMNode = "/sun/awt/im/preferredInputMethod";
private static final String descriptorKey = "descriptor";
private Hashtable preferredLocatorCache = new Hashtable();
private Hashtable<String, InputMethodLocator> preferredLocatorCache = new Hashtable<>();
private Preferences userRoot;
ExecutableInputMethodManager() {
......@@ -430,7 +430,7 @@ class ExecutableInputMethodManager extends InputMethodManager
synchronized (javaInputMethodLocatorList) {
javaInputMethodLocatorList.clear();
try {
AccessController.doPrivileged(new PrivilegedExceptionAction() {
AccessController.doPrivileged(new PrivilegedExceptionAction<Object>() {
public Object run() {
for (InputMethodDescriptor descriptor :
ServiceLoader.loadInstalled(InputMethodDescriptor.class)) {
......@@ -611,7 +611,7 @@ class ExecutableInputMethodManager extends InputMethodManager
}
// look for the cached preference first.
preferredLocator = (InputMethodLocator)preferredLocatorCache.get(locale.toString().intern());
preferredLocator = preferredLocatorCache.get(locale.toString().intern());
if (preferredLocator != null) {
return preferredLocator;
}
......@@ -767,8 +767,8 @@ class ExecutableInputMethodManager extends InputMethodManager
}
private Preferences getUserRoot() {
return (Preferences)AccessController.doPrivileged(new PrivilegedAction() {
public Object run() {
return AccessController.doPrivileged(new PrivilegedAction<Preferences>() {
public Preferences run() {
return Preferences.userRoot();
}
});
......
......@@ -61,4 +61,7 @@ public class SimpleInputMethodWindow
return super.getInputContext();
}
}
// Proclaim serial compatibility with 1.7.0
private static final long serialVersionUID = 5093376647036461555L;
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册