src/java.desktop/share/classes/sun/awt/SunToolkit.java

Print this page

        

*** 1880,1889 **** --- 1880,1892 ---- private static final Object DEACTIVATION_TIMES_MAP_KEY = new Object(); 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) { map = new WeakHashMap<Window, Long>(); ctx.put(DEACTIVATION_TIMES_MAP_KEY, map);
*** 1891,1900 **** --- 1894,1906 ---- map.put(w, time); } 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) { return -1; }