mirror of
https://github.com/openjdk/jdk.git
synced 2026-03-13 17:33:10 +00:00
8004148: NPE in sun.awt.SunToolkit.getWindowDeactivationTime
Reviewed-by: serb
This commit is contained in:
parent
99895e4249
commit
04edcf722c
@ -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) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user