src/share/classes/java/awt/AWTKeyStroke.java
Print this page
@@ -1,7 +1,7 @@
/*
- * Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
@@ -241,11 +241,11 @@
} catch (NoSuchMethodException e) {
}
return null;
}
});
- return (Constructor)ctor;
+ return ctor;
}
private static synchronized AWTKeyStroke getCachedStroke
(char keyChar, int keyCode, int modifiers, boolean onKeyRelease)
{
@@ -273,11 +273,11 @@
cacheKey.keyChar = keyChar;
cacheKey.keyCode = keyCode;
cacheKey.modifiers = mapNewModifiers(mapOldModifiers(modifiers));
cacheKey.onKeyRelease = onKeyRelease;
- AWTKeyStroke stroke = (AWTKeyStroke)cache.get(cacheKey);
+ AWTKeyStroke stroke = cache.get(cacheKey);
if (stroke == null) {
stroke = cacheKey;
cache.put(stroke, stroke);
AppContext.getAppContext().remove(APP_CONTEXT_KEYSTROKE_KEY);
}
@@ -579,11 +579,11 @@
if (token.equals("typed")) {
typed = true;
continue;
}
- Integer tokenMask = (Integer)modifierKeywords.get(token);
+ Integer tokenMask = modifierKeywords.get(token);
if (tokenMask != null) {
mask |= tokenMask.intValue();
} else {
throw new IllegalArgumentException(errmsg);
}
@@ -877,13 +877,13 @@
name2code.put(name, code);
}
public synchronized Integer findCode(String name) {
assert(name != null);
- return (Integer)name2code.get(name);
+ return name2code.get(name);
}
public synchronized String findName(Integer code) {
assert(code != null);
- return (String)code2name.get(code);
+ return code2name.get(code);
}
}