view patches/openjdk/8013196-timezone_getdefault_throws_exception.patch @ 3019:f47f5152f6ac

Fix naming of patch. 2013-08-06 Andrew John Hughes <gnu.andrew@redhat.com> * 8013196-TimeZone_getDefault_throws_exception.patch: Renamed to... * 8013196-timezone_getdefault_throws_exception.patch: ...this. * Makefile.am: (ICEDTEA_PATCHES): Fix name of patch.
author Andrew John Hughes <gnu.andrew@redhat.com>
date Thu, 29 Aug 2013 16:16:25 +0100
parents patches/openjdk/8013196-TimeZone_getDefault_throws_exception.patch@7d370df4beac
children
line wrap: on
line source

# HG changeset patch
# User coffeys
# Date 1367438524 -3600
# Node ID 0f93d6b18a16bf893b152a46df0e22e32666f7ce
# Parent  55eaa0da2a8f6d9fe4966d3d9940258a1b0d4399
8013196: TimeZone.getDefault() throws NPE due to sun.awt.AppContext.getAppContext()
Reviewed-by: mchung, okutsu

--- openjdk/jdk/src/share/classes/sun/awt/AppContext.java
+++ openjdk/jdk/src/share/classes/sun/awt/AppContext.java
@@ -813,16 +813,24 @@
     static {
         sun.misc.SharedSecrets.setJavaAWTAccess(new sun.misc.JavaAWTAccess() {
             public Object get(Object key) {
-                return getAppContext().get(key);
+                AppContext ac = getAppContext();
+                return (ac == null) ? null : ac.get(key);
             }
             public void put(Object key, Object value) {
-                getAppContext().put(key, value);
+                AppContext ac = getAppContext();
+                if (ac != null) {
+                    ac.put(key, value);
+                }
             }
             public void remove(Object key) {
-                getAppContext().remove(key);
+                AppContext ac = getAppContext();
+                if (ac != null) {
+                    ac.remove(key);
+                }
             }
             public boolean isDisposed() {
-                return getAppContext().isDisposed();
+                AppContext ac = getAppContext();
+                return (ac == null) ? true : ac.isDisposed();
             }
             public boolean isMainAppContext() {
                 return (numAppContexts.get() == 1 && mainAppContext != null);