--- old/src/share/classes/sun/awt/AppContext.java 2011-12-02 17:45:27.034403300 +0400 +++ new/src/share/classes/sun/awt/AppContext.java 2011-12-02 17:45:26.351364200 +0400 @@ -171,7 +171,7 @@ * HashMap's potentially risky methods, such as clear(), elements(), * putAll(), etc. */ - private final HashMap table = new HashMap(); + private final Map table = new HashMap<>(); private final ThreadGroup threadGroup; @@ -198,8 +198,8 @@ // On the main Thread, we get the ThreadGroup, make a corresponding // AppContext, and instantiate the Java EventQueue. This way, legacy // code is unaffected by the move to multiple AppContext ability. - AccessController.doPrivileged(new PrivilegedAction() { - public Object run() { + AccessController.doPrivileged(new PrivilegedAction() { + public Void run() { ThreadGroup currentThreadGroup = Thread.currentThread().getThreadGroup(); ThreadGroup parentThreadGroup = currentThreadGroup.getParent(); @@ -210,7 +210,7 @@ } mainAppContext = new AppContext(currentThreadGroup); numAppContexts = 1; - return mainAppContext; + return null; } }); } @@ -399,8 +399,8 @@ log.finer("exception occured while disposing app context", t); } } - AccessController.doPrivileged(new PrivilegedAction() { - public Object run() { + AccessController.doPrivileged(new PrivilegedAction() { + public Void run() { if (!GraphicsEnvironment.isHeadless() && SystemTray.isSupported()) { SystemTray systemTray = SystemTray.getSystemTray(); @@ -523,7 +523,7 @@ } } - static final class CreateThreadAction implements PrivilegedAction { + static final class CreateThreadAction implements PrivilegedAction { private final AppContext appContext; private final Runnable runnable; @@ -532,7 +532,7 @@ runnable = r; } - public Object run() { + public Thread run() { Thread t = new Thread(appContext.getThreadGroup(), runnable); t.setContextClassLoader(appContext.getContextClassLoader()); t.setPriority(Thread.NORM_PRIORITY + 1); @@ -552,8 +552,8 @@ if (appContext != AppContext.getAppContext()) { // Create a thread that belongs to the thread group associated // with the AppContext and invokes EventQueue.postEvent. - PrivilegedAction action = new CreateThreadAction(appContext, r); - Thread thread = (Thread)AccessController.doPrivileged(action); + PrivilegedAction action = new CreateThreadAction(appContext, r); + Thread thread = AccessController.doPrivileged(action); thread.start(); } else { r.run();