8004148: NPE in sun.awt.SunToolkit.getWindowDeactivationTime

Reviewed-by: serb
This commit is contained in:
Anton Tarasov 2014-11-14 12:32:43 +03:00
parent 99895e4249
commit 04edcf722c

View File

@ -1882,6 +1882,9 @@ public abstract class SunToolkit extends Toolkit
public synchronized void setWindowDeactivationTime(Window w, long time) {
AppContext ctx = getAppContext(w);
if (ctx == null) {
return;
}
@SuppressWarnings("unchecked")
WeakHashMap<Window, Long> map = (WeakHashMap<Window, Long>)ctx.get(DEACTIVATION_TIMES_MAP_KEY);
if (map == null) {
@ -1893,6 +1896,9 @@ public abstract class SunToolkit extends Toolkit
public synchronized long getWindowDeactivationTime(Window w) {
AppContext ctx = getAppContext(w);
if (ctx == null) {
return -1;
}
@SuppressWarnings("unchecked")
WeakHashMap<Window, Long> map = (WeakHashMap<Window, Long>)ctx.get(DEACTIVATION_TIMES_MAP_KEY);
if (map == null) {