src/share/classes/java/awt/AWTKeyStroke.java
Print this page
*** 1,7 ****
/*
! * Copyright (c) 2000, 2011, 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
--- 1,7 ----
/*
! * 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,251 ****
} catch (NoSuchMethodException e) {
}
return null;
}
});
! return (Constructor)ctor;
}
private static synchronized AWTKeyStroke getCachedStroke
(char keyChar, int keyCode, int modifiers, boolean onKeyRelease)
{
--- 241,251 ----
} catch (NoSuchMethodException e) {
}
return null;
}
});
! return ctor;
}
private static synchronized AWTKeyStroke getCachedStroke
(char keyChar, int keyCode, int modifiers, boolean onKeyRelease)
{
*** 273,283 ****
cacheKey.keyChar = keyChar;
cacheKey.keyCode = keyCode;
cacheKey.modifiers = mapNewModifiers(mapOldModifiers(modifiers));
cacheKey.onKeyRelease = onKeyRelease;
! AWTKeyStroke stroke = (AWTKeyStroke)cache.get(cacheKey);
if (stroke == null) {
stroke = cacheKey;
cache.put(stroke, stroke);
AppContext.getAppContext().remove(APP_CONTEXT_KEYSTROKE_KEY);
}
--- 273,283 ----
cacheKey.keyChar = keyChar;
cacheKey.keyCode = keyCode;
cacheKey.modifiers = mapNewModifiers(mapOldModifiers(modifiers));
cacheKey.onKeyRelease = onKeyRelease;
! AWTKeyStroke stroke = cache.get(cacheKey);
if (stroke == null) {
stroke = cacheKey;
cache.put(stroke, stroke);
AppContext.getAppContext().remove(APP_CONTEXT_KEYSTROKE_KEY);
}
*** 579,589 ****
if (token.equals("typed")) {
typed = true;
continue;
}
! Integer tokenMask = (Integer)modifierKeywords.get(token);
if (tokenMask != null) {
mask |= tokenMask.intValue();
} else {
throw new IllegalArgumentException(errmsg);
}
--- 579,589 ----
if (token.equals("typed")) {
typed = true;
continue;
}
! Integer tokenMask = modifierKeywords.get(token);
if (tokenMask != null) {
mask |= tokenMask.intValue();
} else {
throw new IllegalArgumentException(errmsg);
}
*** 877,889 ****
name2code.put(name, code);
}
public synchronized Integer findCode(String name) {
assert(name != null);
! return (Integer)name2code.get(name);
}
public synchronized String findName(Integer code) {
assert(code != null);
! return (String)code2name.get(code);
}
}
--- 877,889 ----
name2code.put(name, code);
}
public synchronized Integer findCode(String name) {
assert(name != null);
! return name2code.get(name);
}
public synchronized String findName(Integer code) {
assert(code != null);
! return code2name.get(code);
}
}