changeset 5338:5997930a2d28

Merge
author lana
date Wed, 12 Sep 2012 12:32:05 -0700
parents fd190f90dc17 33cc14b77bef
children cd32baf15248
files src/share/classes/java/awt/KeyboardFocusManager.java src/share/classes/sun/awt/SunToolkit.java src/solaris/classes/sun/awt/X11/XToolkit.java test/java/awt/Mouse/EnterExitEvents/DragWindowTest.java test/sun/tools/jconsole/ImmutableResourceTest.java test/sun/tools/jconsole/ImmutableResourceTest.sh
diffstat 184 files changed, 3967 insertions(+), 2048 deletions(-) [+]
line wrap: on
line diff
--- a/make/common/shared/Defs-java.gmk	Wed Sep 05 15:19:51 2012 -0700
+++ b/make/common/shared/Defs-java.gmk	Wed Sep 12 12:32:05 2012 -0700
@@ -156,7 +156,7 @@
 
 # Needed for javadoc to ensure it builds documentation
 # against the newly built classes
-JAVADOCFLAGS += -bootclasspath $(CLASSBINDIR)
+JAVADOCFLAGS += -bootclasspath "$(CLASSBINDIR)$(JCE_PATH)"
 
 # Needed for JAVADOC and BOOT_JAVACFLAGS
 NO_PROPRIETARY_API_WARNINGS = -XDignore.symbol.file=true
--- a/make/java/nio/Makefile	Wed Sep 05 15:19:51 2012 -0700
+++ b/make/java/nio/Makefile	Wed Sep 12 12:32:05 2012 -0700
@@ -274,7 +274,6 @@
 	sun/nio/ch/UnixAsynchronousServerSocketChannelImpl.java \
 	sun/nio/ch/UnixAsynchronousSocketChannelImpl.java \
 	\
-	sun/nio/fs/GnomeFileTypeDetector.java \
 	sun/nio/fs/BsdFileStore.java \
 	sun/nio/fs/BsdFileSystem.java \
 	sun/nio/fs/BsdFileSystemProvider.java \
@@ -306,7 +305,6 @@
 	UnixAsynchronousServerSocketChannelImpl.c \
 	UnixAsynchronousSocketChannelImpl.c \
 	\
-	GnomeFileTypeDetector.c \
 	BsdNativeDispatcher.c \
 	UnixCopyFile.c \
 	UnixNativeDispatcher.c \
@@ -322,7 +320,6 @@
 	sun/nio/ch/UnixAsynchronousServerSocketChannelImpl.java \
 	sun/nio/ch/UnixAsynchronousSocketChannelImpl.java \
 	\
-	sun/nio/fs/GnomeFileTypeDetector.java \
 	sun/nio/fs/BsdNativeDispatcher.java \
 	sun/nio/fs/UnixCopyFile.java \
 	sun/nio/fs/UnixNativeDispatcher.java
--- a/make/java/nio/mapfile-bsd	Wed Sep 05 15:19:51 2012 -0700
+++ b/make/java/nio/mapfile-bsd	Wed Sep 12 12:32:05 2012 -0700
@@ -121,10 +121,6 @@
 		Java_sun_nio_fs_BsdNativeDispatcher_getfsstat;
 		Java_sun_nio_fs_BsdNativeDispatcher_fsstatEntry;
 		Java_sun_nio_fs_BsdNativeDispatcher_endfsstat;
-		Java_sun_nio_fs_GnomeFileTypeDetector_initializeGio;
-		Java_sun_nio_fs_GnomeFileTypeDetector_probeUsingGio;
-		Java_sun_nio_fs_GnomeFileTypeDetector_initializeGnomeVfs;
-		Java_sun_nio_fs_GnomeFileTypeDetector_probeUsingGnomeVfs;
 		Java_sun_nio_fs_UnixNativeDispatcher_init;
 		Java_sun_nio_fs_UnixNativeDispatcher_getcwd;
 		Java_sun_nio_fs_UnixNativeDispatcher_strerror;
@@ -170,7 +166,6 @@
 		Java_sun_nio_fs_UnixNativeDispatcher_getgrgid;
 		Java_sun_nio_fs_UnixNativeDispatcher_getpwnam0;
 		Java_sun_nio_fs_UnixNativeDispatcher_getgrnam0;
-		Java_sun_nio_fs_UnixNativeDispatcher_getextmntent;
 		Java_sun_nio_fs_UnixCopyFile_transfer;
 		handleSocketError;
 
--- a/make/java/nio/mapfile-linux	Wed Sep 05 15:19:51 2012 -0700
+++ b/make/java/nio/mapfile-linux	Wed Sep 12 12:32:05 2012 -0700
@@ -143,6 +143,7 @@
 		Java_sun_nio_fs_LinuxNativeDispatcher_fsetxattr0;
 		Java_sun_nio_fs_LinuxNativeDispatcher_fremovexattr0;
 		Java_sun_nio_fs_LinuxNativeDispatcher_setmntent0;
+                Java_sun_nio_fs_LinuxNativeDispatcher_getmntent;
 		Java_sun_nio_fs_LinuxNativeDispatcher_endmntent;
 		Java_sun_nio_fs_UnixNativeDispatcher_init;
 		Java_sun_nio_fs_UnixNativeDispatcher_getcwd;
@@ -189,7 +190,6 @@
 		Java_sun_nio_fs_UnixNativeDispatcher_getgrgid;
 		Java_sun_nio_fs_UnixNativeDispatcher_getpwnam0;
 		Java_sun_nio_fs_UnixNativeDispatcher_getgrnam0;
-		Java_sun_nio_fs_UnixNativeDispatcher_getextmntent;
 		Java_sun_nio_fs_UnixCopyFile_transfer;
 		handleSocketError;
 
--- a/make/java/nio/mapfile-solaris	Wed Sep 05 15:19:51 2012 -0700
+++ b/make/java/nio/mapfile-solaris	Wed Sep 12 12:32:05 2012 -0700
@@ -169,10 +169,10 @@
 		Java_sun_nio_fs_UnixNativeDispatcher_getgrgid;
 		Java_sun_nio_fs_UnixNativeDispatcher_getpwnam0;
 		Java_sun_nio_fs_UnixNativeDispatcher_getgrnam0;
-		Java_sun_nio_fs_UnixNativeDispatcher_getextmntent;
 		Java_sun_nio_fs_UnixCopyFile_transfer;
 		Java_sun_nio_fs_SolarisNativeDispatcher_init;
 		Java_sun_nio_fs_SolarisNativeDispatcher_facl;
+		Java_sun_nio_fs_SolarisNativeDispatcher_getextmntent;
 		Java_sun_nio_fs_SolarisWatchService_init;
 		Java_sun_nio_fs_SolarisWatchService_portCreate;
 		Java_sun_nio_fs_SolarisWatchService_portAssociate;
--- a/make/netbeans/jconsole/build.xml	Wed Sep 05 15:19:51 2012 -0700
+++ b/make/netbeans/jconsole/build.xml	Wed Sep 12 12:32:05 2012 -0700
@@ -50,6 +50,7 @@
             <fileset dir="${classes.dir}">
                 <include name="sun/tools/jconsole/**/*.class"/>
                 <include name="com/sun/tools/jconsole/**/*.class"/>
+                <include name="sun/tools/jconsole/resources/*.properties"/>
                 <include name="sun/tools/jconsole/resources/*.gif"/>
                 <include name="sun/tools/jconsole/resources/*.png"/>
             </fileset>
--- a/make/sun/jconsole/FILES.gmk	Wed Sep 05 15:19:51 2012 -0700
+++ b/make/sun/jconsole/FILES.gmk	Wed Sep 12 12:32:05 2012 -0700
@@ -30,17 +30,22 @@
 MANIFEST = sun/tools/jconsole/manifest
 
 PNG_FILES = \
-	sun/tools/jconsole/resources/brandlogo.png \
-	sun/tools/jconsole/resources/collapse-winlf.png \
-	sun/tools/jconsole/resources/connected16.png \
-	sun/tools/jconsole/resources/connected24.png \
-	sun/tools/jconsole/resources/disconnected16.png \
-	sun/tools/jconsole/resources/disconnected24.png \
-	sun/tools/jconsole/resources/expand-winlf.png \
-	sun/tools/jconsole/resources/masthead-left.png \
-	sun/tools/jconsole/resources/masthead-right.png
+  sun/tools/jconsole/resources/brandlogo.png \
+  sun/tools/jconsole/resources/collapse-winlf.png \
+  sun/tools/jconsole/resources/connected16.png \
+  sun/tools/jconsole/resources/connected24.png \
+  sun/tools/jconsole/resources/disconnected16.png \
+  sun/tools/jconsole/resources/disconnected24.png \
+  sun/tools/jconsole/resources/expand-winlf.png \
+  sun/tools/jconsole/resources/masthead-left.png \
+  sun/tools/jconsole/resources/masthead-right.png
 
 GIF_FILES = \
-	sun/tools/jconsole/resources/mbean.gif \
-	sun/tools/jconsole/resources/mbeanserverdelegate.gif \
-	sun/tools/jconsole/resources/xobject.gif
+  sun/tools/jconsole/resources/mbean.gif \
+  sun/tools/jconsole/resources/mbeanserverdelegate.gif \
+  sun/tools/jconsole/resources/xobject.gif
+
+PROP_FILES = \
+  sun/tools/jconsole/resources/messages.properties \
+  sun/tools/jconsole/resources/messages_ja.properties \
+  sun/tools/jconsole/resources/messages_zh_CN.properties
--- a/make/sun/jconsole/Makefile	Wed Sep 05 15:19:51 2012 -0700
+++ b/make/sun/jconsole/Makefile	Wed Sep 12 12:32:05 2012 -0700
@@ -53,21 +53,21 @@
 
 FILES_png = $(PNG_FILES:%.png=$(CLASSBINDIR)/%.png)
 FILES_gif = $(GIF_FILES:%.gif=$(CLASSBINDIR)/%.gif)
-
+FILES_prop = $(PROP_FILES:%.properties=$(CLASSBINDIR)/%.properties)
 build: $(GENSRCDIR)/sun/tools/jconsole/Version.java
 
 #
 # Resources
 #
 LOCALE_SET_DEFINITION = jdk
-RESOURCE_BUNDLES_JAVA = $(PKGDIR)/resources/JConsoleResources.java
+RESOURCE_BUNDLES_UNCOMPILED_PROPERTIES = $(PKGDIR)/resources/messages.properties
 
 #
 # Rules.
 #
 include $(BUILDDIR)/common/Classes.gmk
 
-build: $(FILES_png) $(FILES_gif) $(TEMPDIR)/manifest $(JARFILE)
+build: $(FILES_png) $(FILES_gif) $(FILES_prop) $(TEMPDIR)/manifest $(JARFILE)
 
 $(GENSRCDIR)/sun/tools/jconsole/Version.java: \
                 $(SHARE_SRC)/classes/sun/tools/jconsole/Version.java.template
@@ -85,7 +85,7 @@
 # Extra rule to build jconsole.jar
 #
 
-$(JARFILE): $(LIBDIR) $(FILES_class) $(FILES_png) $(FILES_gif) $(TEMPDIR)/manifest
+$(JARFILE): $(LIBDIR) $(FILES_class) $(FILES_png) $(FILES_gif) $(FILES_prop) $(TEMPDIR)/manifest
 	$(BOOT_JAR_CMD) -cfm $(JARFILE) $(TEMPDIR)/manifest \
                -C $(CLASSBINDIR) sun/tools/jconsole \
                -C $(CLASSBINDIR) com/sun/tools/jconsole \
--- a/src/macosx/classes/com/apple/laf/ScreenMenuItem.java	Wed Sep 05 15:19:51 2012 -0700
+++ b/src/macosx/classes/com/apple/laf/ScreenMenuItem.java	Wed Sep 12 12:32:05 2012 -0700
@@ -34,7 +34,7 @@
 
 import sun.lwawt.macosx.CMenuItem;
 
-class ScreenMenuItem extends MenuItem implements ActionListener, ComponentListener, ScreenMenuPropertyHandler {
+final class ScreenMenuItem extends MenuItem implements ActionListener, ComponentListener, ScreenMenuPropertyHandler {
     ScreenMenuPropertyListener fListener;
     JMenuItem fMenuItem;
 
@@ -96,19 +96,32 @@
         fMenuItem.removeComponentListener(this);
     }
 
-    public void setAccelerator(final KeyStroke ks) {
-        if (ks == null) {
-            setShortcut(null);
+    static void syncLabelAndKS(MenuItem menuItem, String label, KeyStroke ks) {
+        final MenuComponentPeer peer = menuItem.getPeer();
+        if (!(peer instanceof CMenuItem)) {
+            //Is it possible?
             return;
         }
+        final CMenuItem cmi = (CMenuItem) peer;
+        if (ks == null) {
+            cmi.setLabel(label);
+        } else {
+            cmi.setLabel(label, ks.getKeyChar(), ks.getKeyCode(),
+                         ks.getModifiers());
+        }
+    }
 
-        final MenuComponentPeer peer = getPeer();
-        if (peer instanceof CMenuItem) {
-            final CMenuItem ourPeer = (CMenuItem)peer;
-            ourPeer.setLabel(fMenuItem.getText(), ks.getKeyChar(), ks.getKeyCode(), ks.getModifiers());
-        } else {
-            setShortcut(new MenuShortcut(ks.getKeyCode(), (ks.getModifiers() & InputEvent.SHIFT_MASK) != 0));
-        }
+    @Override
+    public synchronized void setLabel(final String label) {
+        syncLabelAndKS(this, label, fMenuItem.getAccelerator());
+    }
+
+    @Override
+    public void setAccelerator(final KeyStroke ks) {
+        // We call CMenuItem.setLabel(..,..,..) directly and does not initialize
+        // shortcut property. So shortcut property should not be used from the
+        // peers code directly or indirectly.
+        syncLabelAndKS(this, fMenuItem.getText(), ks);
     }
 
     public void actionPerformed(final ActionEvent e) {
--- a/src/macosx/classes/com/apple/laf/ScreenMenuItemCheckbox.java	Wed Sep 05 15:19:51 2012 -0700
+++ b/src/macosx/classes/com/apple/laf/ScreenMenuItemCheckbox.java	Wed Sep 12 12:32:05 2012 -0700
@@ -36,7 +36,7 @@
 
 import sun.lwawt.macosx.*;
 
-class ScreenMenuItemCheckbox extends CheckboxMenuItem implements ActionListener, ComponentListener, ScreenMenuPropertyHandler, ItemListener {
+final class ScreenMenuItemCheckbox extends CheckboxMenuItem implements ActionListener, ComponentListener, ScreenMenuPropertyHandler, ItemListener {
     JMenuItem fMenuItem;
     MenuContainer fParent;
 
@@ -110,19 +110,17 @@
         super.removeNotify();
     }
 
+    @Override
+    public synchronized void setLabel(final String label) {
+        ScreenMenuItem.syncLabelAndKS(this, label, fMenuItem.getAccelerator());
+    }
+
+    @Override
     public void setAccelerator(final KeyStroke ks) {
-        if (ks == null) {
-            setShortcut(null);
-            return;
-        }
-
-        final MenuComponentPeer peer = getPeer();
-        if (peer instanceof CMenuItem) {
-            final CMenuItem ourPeer = (CMenuItem)peer;
-            ourPeer.setLabel(fMenuItem.getText(), ks.getKeyChar(), ks.getKeyCode(), ks.getModifiers());
-        } else {
-            setShortcut(new MenuShortcut(ks.getKeyCode(), (ks.getModifiers() & InputEvent.SHIFT_MASK) != 0));
-        }
+        // We call CMenuItem.setLabel(..,..,..) directly and does not initialize
+        // shortcut property. So shortcut property should not be used from the
+        // peers code directly or indirectly.
+        ScreenMenuItem.syncLabelAndKS(this, fMenuItem.getText(), ks);
     }
 
     public void actionPerformed(final ActionEvent e) {
--- a/src/macosx/classes/sun/font/CFontManager.java	Wed Sep 05 15:19:51 2012 -0700
+++ b/src/macosx/classes/sun/font/CFontManager.java	Wed Sep 12 12:32:05 2012 -0700
@@ -37,6 +37,7 @@
 import javax.swing.plaf.FontUIResource;
 
 import sun.awt.FontConfiguration;
+import sun.awt.HeadlessToolkit;
 import sun.lwawt.macosx.*;
 
 public class CFontManager extends SunFontManager {
@@ -342,9 +343,14 @@
     @Override
     public String getFontPath(boolean noType1Fonts) {
         // In the case of the Cocoa toolkit, since we go through NSFont, we dont need to register /Library/Fonts
-        if (Toolkit.getDefaultToolkit() instanceof LWCToolkit) {
+        Toolkit tk = Toolkit.getDefaultToolkit();
+        if (tk instanceof HeadlessToolkit) {
+            tk = ((HeadlessToolkit)tk).getUnderlyingToolkit();
+        }
+        if (tk instanceof LWCToolkit) {
             return "";
         }
+
         // X11 case
         return "/Library/Fonts";
     }
--- a/src/macosx/classes/sun/lwawt/LWComponentPeer.java	Wed Sep 05 15:19:51 2012 -0700
+++ b/src/macosx/classes/sun/lwawt/LWComponentPeer.java	Wed Sep 12 12:32:05 2012 -0700
@@ -40,6 +40,7 @@
 import java.awt.peer.ComponentPeer;
 import java.awt.peer.ContainerPeer;
 
+import java.awt.peer.KeyboardFocusManagerPeer;
 import java.util.concurrent.atomic.AtomicBoolean;
 import java.lang.reflect.Field;
 import java.security.AccessController;
@@ -282,7 +283,7 @@
      * Note that we call setVisible() at the end of initialization.
      */
     public final void initialize() {
-        platformComponent.initialize(target, this, getPlatformWindow());
+        platformComponent.initialize(getPlatformWindow());
         initializeImpl();
         setVisible(target.isVisible());
     }
@@ -894,15 +895,15 @@
                             ", focusedWindowChangeAllowed=" + focusedWindowChangeAllowed +
                             ", time= " + time + ", cause=" + cause);
         }
-        if (LWKeyboardFocusManagerPeer.getInstance(getAppContext()).
-                processSynchronousLightweightTransfer(getTarget(), lightweightChild, temporary,
-                        focusedWindowChangeAllowed, time)) {
+        if (LWKeyboardFocusManagerPeer.processSynchronousLightweightTransfer(
+                getTarget(), lightweightChild, temporary,
+                focusedWindowChangeAllowed, time)) {
             return true;
         }
 
-        int result = LWKeyboardFocusManagerPeer.getInstance(getAppContext()).
-                shouldNativelyFocusHeavyweight(getTarget(), lightweightChild, temporary,
-                        focusedWindowChangeAllowed, time, cause);
+        int result = LWKeyboardFocusManagerPeer.shouldNativelyFocusHeavyweight(
+                getTarget(), lightweightChild, temporary,
+                focusedWindowChangeAllowed, time, cause);
         switch (result) {
             case LWKeyboardFocusManagerPeer.SNFH_FAILURE:
                 return false;
@@ -951,14 +952,13 @@
                     return false;
                 }
 
-                LWComponentPeer focusOwnerPeer =
-                    LWKeyboardFocusManagerPeer.getInstance(getAppContext()).
-                        getFocusOwner();
-                Component focusOwner = (focusOwnerPeer != null) ? focusOwnerPeer.getTarget() : null;
+                KeyboardFocusManagerPeer kfmPeer = LWKeyboardFocusManagerPeer.getInstance();
+                Component focusOwner = kfmPeer.getCurrentFocusOwner();
                 return LWKeyboardFocusManagerPeer.deliverFocus(lightweightChild,
                         getTarget(), temporary,
                         focusedWindowChangeAllowed,
                         time, cause, focusOwner);
+
             case LWKeyboardFocusManagerPeer.SNFH_SUCCESS_HANDLED:
                 return true;
         }
@@ -1263,8 +1263,8 @@
     protected void handleJavaFocusEvent(FocusEvent e) {
         // Note that the peer receives all the FocusEvents from
         // its lightweight children as well
-        LWKeyboardFocusManagerPeer.getInstance(getAppContext()).
-                setFocusOwner(e.getID() == FocusEvent.FOCUS_GAINED ? this : null);
+        KeyboardFocusManagerPeer kfmPeer = LWKeyboardFocusManagerPeer.getInstance();
+        kfmPeer.setCurrentFocusOwner(e.getID() == FocusEvent.FOCUS_GAINED ? getTarget() : null);
     }
 
     /**
--- a/src/macosx/classes/sun/lwawt/LWKeyboardFocusManagerPeer.java	Wed Sep 05 15:19:51 2012 -0700
+++ b/src/macosx/classes/sun/lwawt/LWKeyboardFocusManagerPeer.java	Wed Sep 12 12:32:05 2012 -0700
@@ -26,85 +26,47 @@
 package sun.lwawt;
 
 import java.awt.Component;
-import java.awt.KeyboardFocusManager;
 import java.awt.Window;
-
-import java.util.Map;
-import java.util.HashMap;
-
-import sun.awt.AWTAccessor;
-import sun.awt.AppContext;
 import sun.awt.KeyboardFocusManagerPeerImpl;
 
 public class LWKeyboardFocusManagerPeer extends KeyboardFocusManagerPeerImpl {
+    private static final LWKeyboardFocusManagerPeer inst = new LWKeyboardFocusManagerPeer();
 
-    private Object lock = new Object();
-    private LWWindowPeer focusedWindow;
-    private LWComponentPeer focusOwner;
+    private Window focusedWindow;
+    private Component focusOwner;
 
-    private static Map<KeyboardFocusManager, LWKeyboardFocusManagerPeer> instances =
-        new HashMap<KeyboardFocusManager, LWKeyboardFocusManagerPeer>();
-
-    public static synchronized LWKeyboardFocusManagerPeer getInstance(AppContext ctx) {
-        return getInstance(AWTAccessor.getKeyboardFocusManagerAccessor().
-                           getCurrentKeyboardFocusManager(ctx));
+    public static LWKeyboardFocusManagerPeer getInstance() {
+        return inst;
     }
 
-    public static synchronized LWKeyboardFocusManagerPeer getInstance(KeyboardFocusManager manager) {
-        LWKeyboardFocusManagerPeer instance = instances.get(manager);
-        if (instance == null) {
-            instance = new LWKeyboardFocusManagerPeer(manager);
-            instances.put(manager, instance);
-        }
-        return instance;
+    private LWKeyboardFocusManagerPeer() {
     }
 
-    public LWKeyboardFocusManagerPeer(KeyboardFocusManager manager) {
-        super(manager);
+    @Override
+    public void setCurrentFocusedWindow(Window win) {
+        synchronized (this) {
+            focusedWindow = win;
+        }
     }
 
     @Override
     public Window getCurrentFocusedWindow() {
-        synchronized (lock) {
-            return (focusedWindow != null) ? (Window)focusedWindow.getTarget() : null;
+        synchronized (this) {
+            return focusedWindow;
         }
     }
 
     @Override
     public Component getCurrentFocusOwner() {
-        synchronized (lock) {
-            return (focusOwner != null) ? focusOwner.getTarget() : null;
+        synchronized (this) {
+            return focusOwner;
         }
     }
 
     @Override
     public void setCurrentFocusOwner(Component comp) {
-        synchronized (lock) {
-            focusOwner = (comp != null) ? (LWComponentPeer)comp.getPeer() : null;
-        }
-    }
-
-    void setFocusedWindow(LWWindowPeer peer) {
-        synchronized (lock) {
-            focusedWindow = peer;
-        }
-    }
-
-    LWWindowPeer getFocusedWindow() {
-        synchronized (lock) {
-            return focusedWindow;
-        }
-    }
-
-    void setFocusOwner(LWComponentPeer peer) {
-        synchronized (lock) {
-            focusOwner = peer;
-        }
-    }
-
-    LWComponentPeer getFocusOwner() {
-        synchronized (lock) {
-            return focusOwner;
+        synchronized (this) {
+            focusOwner = comp;
         }
     }
 }
--- a/src/macosx/classes/sun/lwawt/LWToolkit.java	Wed Sep 05 15:19:51 2012 -0700
+++ b/src/macosx/classes/sun/lwawt/LWToolkit.java	Wed Sep 12 12:32:05 2012 -0700
@@ -415,8 +415,8 @@
     }
 
     @Override
-    public KeyboardFocusManagerPeer createKeyboardFocusManagerPeer(KeyboardFocusManager manager) {
-        return LWKeyboardFocusManagerPeer.getInstance(manager);
+    public KeyboardFocusManagerPeer getKeyboardFocusManagerPeer() {
+        return LWKeyboardFocusManagerPeer.getInstance();
     }
 
     @Override
--- a/src/macosx/classes/sun/lwawt/LWWindowPeer.java	Wed Sep 05 15:19:51 2012 -0700
+++ b/src/macosx/classes/sun/lwawt/LWWindowPeer.java	Wed Sep 12 12:32:05 2012 -0700
@@ -232,8 +232,7 @@
         // TODO: update graphicsConfig, see 4868278
         platformWindow.setVisible(visible);
         if (isSimpleWindow()) {
-            LWKeyboardFocusManagerPeer manager = LWKeyboardFocusManagerPeer.
-                getInstance(getAppContext());
+            KeyboardFocusManagerPeer kfmPeer = LWKeyboardFocusManagerPeer.getInstance();
 
             if (visible) {
                 if (!getTarget().isAutoRequestFocus()) {
@@ -241,7 +240,7 @@
                 } else {
                     requestWindowFocus(CausedFocusEvent.Cause.ACTIVATION);
                 }
-            } else if (manager.getCurrentFocusedWindow() == getTarget()) {
+            } else if (kfmPeer.getCurrentFocusedWindow() == getTarget()) {
                 // Transfer focus to the owner.
                 LWWindowPeer owner = getOwnerFrameDialog(LWWindowPeer.this);
                 if (owner != null) {
@@ -751,42 +750,39 @@
             }
         } else {
             if (targetPeer != lastMouseEventPeer) {
-
-                if (id != MouseEvent.MOUSE_DRAGGED || lastMouseEventPeer == null) {
-                    // lastMouseEventPeer may be null if mouse was out of Java windows
-                    if (lastMouseEventPeer != null && lastMouseEventPeer.isEnabled()) {
-                        // Sometimes, MOUSE_EXITED is not sent by delegate (or is sent a bit
-                        // later), in which case lastWindowPeer is another window
-                        if (lastWindowPeer != this) {
-                            Point oldp = lastMouseEventPeer.windowToLocal(x, y, lastWindowPeer);
-                            // Additionally translate from this to lastWindowPeer coordinates
-                            Rectangle lr = lastWindowPeer.getBounds();
-                            oldp.x += r.x - lr.x;
-                            oldp.y += r.y - lr.y;
-                            postEvent(new MouseEvent(lastMouseEventPeer.getTarget(),
-                                                     MouseEvent.MOUSE_EXITED,
-                                                     when, modifiers,
-                                                     oldp.x, oldp.y, screenX, screenY,
-                                                     clickCount, popupTrigger, button));
-                        } else {
-                            Point oldp = lastMouseEventPeer.windowToLocal(x, y, this);
-                            postEvent(new MouseEvent(lastMouseEventPeer.getTarget(),
-                                                     MouseEvent.MOUSE_EXITED,
-                                                     when, modifiers,
-                                                     oldp.x, oldp.y, screenX, screenY,
-                                                     clickCount, popupTrigger, button));
-                        }
-                    }
-                    if (targetPeer != null && targetPeer.isEnabled() && id != MouseEvent.MOUSE_ENTERED) {
-                        Point newp = targetPeer.windowToLocal(x, y, curWindowPeer);
-                        postEvent(new MouseEvent(targetPeer.getTarget(),
-                                                 MouseEvent.MOUSE_ENTERED,
+                // lastMouseEventPeer may be null if mouse was out of Java windows
+                if (lastMouseEventPeer != null && lastMouseEventPeer.isEnabled()) {
+                    // Sometimes, MOUSE_EXITED is not sent by delegate (or is sent a bit
+                    // later), in which case lastWindowPeer is another window
+                    if (lastWindowPeer != this) {
+                        Point oldp = lastMouseEventPeer.windowToLocal(x, y, lastWindowPeer);
+                        // Additionally translate from this to lastWindowPeer coordinates
+                        Rectangle lr = lastWindowPeer.getBounds();
+                        oldp.x += r.x - lr.x;
+                        oldp.y += r.y - lr.y;
+                        postEvent(new MouseEvent(lastMouseEventPeer.getTarget(),
+                                                 MouseEvent.MOUSE_EXITED,
                                                  when, modifiers,
-                                                 newp.x, newp.y, screenX, screenY,
+                                                 oldp.x, oldp.y, screenX, screenY,
+                                                 clickCount, popupTrigger, button));
+                    } else {
+                        Point oldp = lastMouseEventPeer.windowToLocal(x, y, this);
+                        postEvent(new MouseEvent(lastMouseEventPeer.getTarget(),
+                                                 MouseEvent.MOUSE_EXITED,
+                                                 when, modifiers,
+                                                 oldp.x, oldp.y, screenX, screenY,
                                                  clickCount, popupTrigger, button));
                     }
                 }
                 lastMouseEventPeer = targetPeer;
+                if (targetPeer != null && targetPeer.isEnabled() && id != MouseEvent.MOUSE_ENTERED) {
+                    Point newp = targetPeer.windowToLocal(x, y, curWindowPeer);
+                    postEvent(new MouseEvent(targetPeer.getTarget(),
+                                             MouseEvent.MOUSE_ENTERED,
+                                             when, modifiers,
+                                             newp.x, newp.y, screenX, screenY,
+                                             clickCount, popupTrigger, button));
+                }
             }
             // TODO: fill "bdata" member of AWTEvent
 
@@ -905,9 +901,8 @@
     public void dispatchKeyEvent(int id, long when, int modifiers,
                                  int keyCode, char keyChar, int keyLocation)
     {
-        LWComponentPeer focusOwner =
-            LWKeyboardFocusManagerPeer.getInstance(getAppContext()).
-                getFocusOwner();
+        KeyboardFocusManagerPeer kfmPeer = LWKeyboardFocusManagerPeer.getInstance();
+        Component focusOwner = kfmPeer.getCurrentFocusOwner();
 
         // Null focus owner may receive key event when
         // application hides the focused window upon ESC press
@@ -915,9 +910,10 @@
         // may come to already hidden window. This check eliminates NPE.
         if (focusOwner != null) {
             KeyEvent event =
-                new KeyEvent(focusOwner.getTarget(), id, when, modifiers,
+                new KeyEvent(focusOwner, id, when, modifiers,
                              keyCode, keyChar, keyLocation);
-            focusOwner.postEvent(event);
+            LWComponentPeer peer = (LWComponentPeer)focusOwner.getPeer();
+            peer.postEvent(event);
         }
     }
 
@@ -1234,10 +1230,8 @@
             }
         }
 
-        LWKeyboardFocusManagerPeer manager = LWKeyboardFocusManagerPeer.
-            getInstance(getAppContext());
-
-        Window oppositeWindow = becomesFocused ? manager.getCurrentFocusedWindow() : null;
+        KeyboardFocusManagerPeer kfmPeer = LWKeyboardFocusManagerPeer.getInstance();
+        Window oppositeWindow = becomesFocused ? kfmPeer.getCurrentFocusedWindow() : null;
 
         // Note, the method is not called:
         // - when the opposite (gaining focus) window is an owned/owner window.
@@ -1250,7 +1244,7 @@
             grabbingWindow.ungrab();
         }
 
-        manager.setFocusedWindow(becomesFocused ? LWWindowPeer.this : null);
+        kfmPeer.setCurrentFocusedWindow(becomesFocused ? getTarget() : null);
 
         int eventID = becomesFocused ? WindowEvent.WINDOW_GAINED_FOCUS : WindowEvent.WINDOW_LOST_FOCUS;
         WindowEvent windowEvent = new WindowEvent(getTarget(), eventID, oppositeWindow);
--- a/src/macosx/classes/sun/lwawt/PlatformComponent.java	Wed Sep 05 15:19:51 2012 -0700
+++ b/src/macosx/classes/sun/lwawt/PlatformComponent.java	Wed Sep 12 12:32:05 2012 -0700
@@ -23,15 +23,38 @@
  * questions.
  */
 
+
 package sun.lwawt;
 
-import java.awt.Component;
-
+/**
+ * Can be used to store information about native resource related to the
+ * lightweight component.
+ */
 public interface PlatformComponent {
 
-    public void initialize(Component target, LWComponentPeer peer, PlatformWindow platformWindow);
+    /**
+     * Initializes platform component.
+     *
+     * @param platformWindow already initialized {@code PlatformWindow}.
+     */
+    void initialize(PlatformWindow platformWindow);
 
-    public void setBounds(int x, int y, int w, int h);
+    /**
+     * Moves and resizes this component. The new location of the top-left corner
+     * is specified by {@code x} and {@code y}, and the new size is specified by
+     * {@code w} and {@code h}. The location is specified relative to the {@code
+     * platformWindow}.
+     *
+     * @param x the X location of the component
+     * @param y the Y location of the component
+     * @param w the width of the component
+     * @param h the height of the component
+     */
+    void setBounds(int x, int y, int w, int h);
 
-    public void dispose();
+    /**
+     * Releases all of the native resources used by this {@code
+     * PlatformComponent}.
+     */
+    void dispose();
 }
--- a/src/macosx/classes/sun/lwawt/macosx/CDropTargetContextPeer.java	Wed Sep 05 15:19:51 2012 -0700
+++ b/src/macosx/classes/sun/lwawt/macosx/CDropTargetContextPeer.java	Wed Sep 12 12:32:05 2012 -0700
@@ -38,7 +38,7 @@
     private long    fNativeDropTransfer = 0;
     private long    fNativeDataAvailable = 0;
     private Object  fNativeData    = null;
-    private boolean insideTarget = false;
+    private boolean insideTarget = true;
 
     Object awtLockAccess = new Object();
 
--- a/src/macosx/classes/sun/lwawt/macosx/CFRetainedResource.java	Wed Sep 05 15:19:51 2012 -0700
+++ b/src/macosx/classes/sun/lwawt/macosx/CFRetainedResource.java	Wed Sep 12 12:32:05 2012 -0700
@@ -33,8 +33,8 @@
 public class CFRetainedResource {
     private static native void nativeCFRelease(final long ptr, final boolean disposeOnAppKitThread);
 
-    final boolean disposeOnAppKitThread;
-    protected long ptr;
+    private final boolean disposeOnAppKitThread;
+    protected volatile long ptr;
 
     /**
      * @param ptr CFRetained native object pointer
--- a/src/macosx/classes/sun/lwawt/macosx/CPlatformComponent.java	Wed Sep 05 15:19:51 2012 -0700
+++ b/src/macosx/classes/sun/lwawt/macosx/CPlatformComponent.java	Wed Sep 12 12:32:05 2012 -0700
@@ -23,27 +23,24 @@
  * questions.
  */
 
+
 package sun.lwawt.macosx;
 
-import java.awt.Component;
 import java.awt.Insets;
 
 import sun.lwawt.PlatformComponent;
 import sun.lwawt.PlatformWindow;
-import sun.lwawt.LWComponentPeer;
 
-import sun.lwawt.macosx.CFRetainedResource;
+/**
+ * On OSX {@code CPlatformComponent} stores pointer to the native CAlayer which
+ * can be used from JAWT.
+ */
+final class CPlatformComponent extends CFRetainedResource
+        implements PlatformComponent {
 
-public class CPlatformComponent extends CFRetainedResource implements PlatformComponent {
+    private volatile PlatformWindow platformWindow;
 
-    Component target;
-    LWComponentPeer peer;
-    PlatformWindow platformWindow;
-
-    private native long nativeCreateComponent(long windowLayer);
-    private native long nativeSetBounds(long ptr, int x, int y, int width, int height);
-
-    public CPlatformComponent() {
+    CPlatformComponent() {
         super(0, true);
     }
 
@@ -51,27 +48,28 @@
         return ptr;
     }
 
-    public void initialize(Component target, LWComponentPeer peer, PlatformWindow platformWindow) {
-        this.target = target;
-        this.peer = peer;
+    @Override
+    public void initialize(final PlatformWindow platformWindow) {
         this.platformWindow = platformWindow;
-
-        long windowLayerPtr = platformWindow.getLayerPtr();
-        setPtr(nativeCreateComponent(windowLayerPtr));
+        setPtr(nativeCreateComponent(platformWindow.getLayerPtr()));
     }
 
     // TODO: visibility, z-order
 
     @Override
-    public void setBounds(int x, int y, int width, int height) {
+    public void setBounds(final int x, final int y, final int w, final int h) {
         // translates values from the coordinate system of the top-level window
         // to the coordinate system of the content view
-        Insets insets = platformWindow.getPeer().getInsets();
-        nativeSetBounds(getPointer(), x - insets.left, y - insets.top, width, height);
+        final Insets insets = platformWindow.getPeer().getInsets();
+        nativeSetBounds(getPointer(), x - insets.left, y - insets.top, w, h);
     }
 
     @Override
     public void dispose() {
         super.dispose();
     }
+
+    private native long nativeCreateComponent(long windowLayer);
+
+    private native void nativeSetBounds(long ptr, int x, int y, int w, int h);
 }
--- a/src/macosx/classes/sun/nio/ch/KQueueArrayWrapper.java	Wed Sep 05 15:19:51 2012 -0700
+++ b/src/macosx/classes/sun/nio/ch/KQueueArrayWrapper.java	Wed Sep 12 12:32:05 2012 -0700
@@ -34,7 +34,8 @@
 import sun.misc.*;
 import java.io.IOException;
 import java.io.FileDescriptor;
-
+import java.util.Iterator;
+import java.util.LinkedList;
 
 /*
  * struct kevent {           // 32-bit    64-bit
@@ -99,6 +100,18 @@
         kq = init();
     }
 
+    // Used to update file description registrations
+    private static class Update {
+        SelChImpl channel;
+        int events;
+        Update(SelChImpl channel, int events) {
+            this.channel = channel;
+            this.events = events;
+        }
+    }
+
+    private LinkedList<Update> updateList = new LinkedList<Update>();
+
     void initInterrupt(int fd0, int fd1) {
         outgoingInterruptFD = fd1;
         incomingInterruptFD = fd0;
@@ -136,14 +149,41 @@
         }
     }
 
-    void setInterest(int fd, int events) {
-        register0(kq, fd, events & POLLIN, events & POLLOUT);
+    void setInterest(SelChImpl channel, int events) {
+        synchronized (updateList) {
+            // update existing registration
+            updateList.add(new Update(channel, events));
+        }
     }
 
-    void release(int fd) {
-        register0(kq, fd, 0, 0);
+    void release(SelChImpl channel) {
+        synchronized (updateList) {
+            // flush any pending updates
+            for (Iterator<Update> it = updateList.iterator(); it.hasNext();) {
+                if (it.next().channel == channel) {
+                    it.remove();
+                }
+            }
+
+            // remove
+            register0(kq, channel.getFDVal(), 0, 0);
+        }
     }
 
+    void updateRegistrations() {
+        synchronized (updateList) {
+            Update u = null;
+            while ((u = updateList.poll()) != null) {
+                SelChImpl ch = u.channel;
+                if (!ch.isOpen())
+                    continue;
+
+                register0(kq, ch.getFDVal(), u.events & POLLIN, u.events & POLLOUT);
+            }
+        }
+    }
+
+
     void close() throws IOException {
         if (keventArray != null) {
             keventArray.free();
@@ -156,6 +196,7 @@
     }
 
     int poll(long timeout) {
+        updateRegistrations();
         int updated = kevent0(kq, keventArrayAddress, NUM_KEVENTS, timeout);
         return updated;
     }
@@ -172,4 +213,3 @@
                                long timeout);
     private static native void interrupt(int fd);
 }
-
--- a/src/macosx/classes/sun/nio/ch/KQueueSelectorImpl.java	Wed Sep 05 15:19:51 2012 -0700
+++ b/src/macosx/classes/sun/nio/ch/KQueueSelectorImpl.java	Wed Sep 12 12:32:05 2012 -0700
@@ -184,7 +184,6 @@
             FileDispatcherImpl.closeIntFD(fd0);
             FileDispatcherImpl.closeIntFD(fd1);
             if (kqueueWrapper != null) {
-                kqueueWrapper.release(fd0);
                 kqueueWrapper.close();
                 kqueueWrapper = null;
                 selectedKeys = null;
@@ -220,7 +219,7 @@
     protected void implDereg(SelectionKeyImpl ski) throws IOException {
         int fd = ski.channel.getFDVal();
         fdMap.remove(Integer.valueOf(fd));
-        kqueueWrapper.release(fd);
+        kqueueWrapper.release(ski.channel);
         totalChannels--;
         keys.remove(ski);
         selectedKeys.remove(ski);
@@ -234,8 +233,7 @@
     public void putEventOps(SelectionKeyImpl ski, int ops) {
         if (closed)
             throw new ClosedSelectorException();
-        int fd = IOUtil.fdVal(ski.channel.getFD());
-        kqueueWrapper.setInterest(fd, ops);
+        kqueueWrapper.setInterest(ski.channel, ops);
     }
 
 
@@ -254,4 +252,3 @@
         Util.load();
     }
 }
-
--- a/src/macosx/native/sun/awt/AWTEvent.h	Wed Sep 05 15:19:51 2012 -0700
+++ b/src/macosx/native/sun/awt/AWTEvent.h	Wed Sep 12 12:32:05 2012 -0700
@@ -33,5 +33,7 @@
 void DeliverJavaMouseEvent(JNIEnv *env, NSEvent *event, jobject peer);
 void SendAdditionalJavaEvents(JNIEnv *env, NSEvent *nsEvent, jobject peer);
 jint GetJavaMouseModifiers(NSInteger button, NSUInteger modifierFlags);
+jint NsKeyModifiersToJavaModifiers(NSUInteger nsFlags, BOOL isExtMods);
+NSUInteger JavaModifiersToNsKeyModifiers(jint javaModifiers, BOOL isExtMods);
 
 #endif /* __AWTEVENT_H */
--- a/src/macosx/native/sun/awt/AWTEvent.m	Wed Sep 05 15:19:51 2012 -0700
+++ b/src/macosx/native/sun/awt/AWTEvent.m	Wed Sep 12 12:32:05 2012 -0700
@@ -244,6 +244,7 @@
     //NSUInteger cgsRightMask;
     unsigned short leftKeyCode;
     unsigned short rightKeyCode;
+    jint javaExtMask;
     jint javaMask;
     jint javaKey;
 }
@@ -254,6 +255,7 @@
         0,
         0,
         0, // no Java equivalent
+        0, // no Java equivalent
         java_awt_event_KeyEvent_VK_CAPS_LOCK
     },
     {
@@ -263,6 +265,7 @@
         56,
         60,
         java_awt_event_InputEvent_SHIFT_DOWN_MASK,
+        java_awt_event_InputEvent_SHIFT_MASK,
         java_awt_event_KeyEvent_VK_SHIFT
     },
     {
@@ -272,6 +275,7 @@
         59,
         62,
         java_awt_event_InputEvent_CTRL_DOWN_MASK,
+        java_awt_event_InputEvent_CTRL_MASK,
         java_awt_event_KeyEvent_VK_CONTROL
     },
     {
@@ -281,6 +285,7 @@
         58,
         61,
         java_awt_event_InputEvent_ALT_DOWN_MASK,
+        java_awt_event_InputEvent_ALT_MASK,
         java_awt_event_KeyEvent_VK_ALT
     },
     {
@@ -290,6 +295,7 @@
         55,
         54,
         java_awt_event_InputEvent_META_DOWN_MASK,
+        java_awt_event_InputEvent_META_MASK,
         java_awt_event_KeyEvent_VK_META
     },
     // NSNumericPadKeyMask
@@ -298,10 +304,11 @@
         0,
         0,
         0, // no Java equivalent
+        0, // no Java equivalent
         java_awt_event_KeyEvent_VK_HELP
     },
     // NSFunctionKeyMask
-    {0, 0, 0, 0, 0}
+    {0, 0, 0, 0, 0, 0}
 };
 
 /*
@@ -491,15 +498,14 @@
 /*
  * This returns the java modifiers for a key NSEvent.
  */
-static jint
-NsKeyModifiersToJavaModifiers(NSUInteger nsFlags)
+jint NsKeyModifiersToJavaModifiers(NSUInteger nsFlags, BOOL isExtMods)
 {
     jint javaModifiers = 0;
     const struct _nsKeyToJavaModifier* cur;
 
     for (cur = nsKeyToJavaModifierTable; cur->nsMask != 0; ++cur) {
         if ((cur->nsMask & nsFlags) != 0) {
-            javaModifiers |= cur->javaMask;
+            javaModifiers |= isExtMods? cur->javaExtMask : cur->javaMask;
         }
     }
 
@@ -507,6 +513,33 @@
 }
 
 /*
+ * This returns the NSEvent flags for java key modifiers.
+ */
+NSUInteger JavaModifiersToNsKeyModifiers(jint javaModifiers, BOOL isExtMods)
+{
+    NSUInteger nsFlags = 0;
+    const struct _nsKeyToJavaModifier* cur;
+
+    for (cur = nsKeyToJavaModifierTable; cur->nsMask != 0; ++cur) {
+        jint mask = isExtMods? cur->javaExtMask : cur->javaMask; 
+        if ((mask & javaModifiers) != 0) {
+            nsFlags |= cur->nsMask;
+        }
+    }
+
+    // special case
+    jint mask = isExtMods? java_awt_event_InputEvent_ALT_GRAPH_DOWN_MASK : 
+                           java_awt_event_InputEvent_ALT_GRAPH_MASK;
+
+    if ((mask & javaModifiers) != 0) {
+        nsFlags |= NSAlternateKeyMask;      
+    }
+
+    return nsFlags;
+}
+
+
+/*
  * Returns the correct java character for a key event.  Most unicode
  * characters don't require any fussing, but a few seem to need adjusting,
  * see nsCharToJavaChar.
@@ -517,7 +550,7 @@
     unichar returnValue = java_awt_event_KeyEvent_CHAR_UNDEFINED;
     NSString *chars = nil;
     unichar testChar = 0, testDeadChar = 0;
-    jint javaModifiers = NsKeyModifiersToJavaModifiers([event modifierFlags]);
+    jint javaModifiers = NsKeyModifiersToJavaModifiers([event modifierFlags], TRUE);
 
     switch ([event type]) {
     case NSFlagsChanged:
@@ -657,7 +690,7 @@
             testChar = [chars characterAtIndex:0];
         }
 
-        javaModifiers = NsKeyModifiersToJavaModifiers([event modifierFlags]);
+        javaModifiers = NsKeyModifiersToJavaModifiers([event modifierFlags], TRUE);
         if (javaModifiers == 0) {
       // TODO: dead key chars
 //            testDeadChar = GetDeadKeyCharacter(event);
@@ -692,7 +725,7 @@
 jint GetJavaMouseModifiers(NSInteger button, NSUInteger modifierFlags)
 {
     // Mousing needs the key modifiers
-    jint modifiers = NsKeyModifiersToJavaModifiers(modifierFlags);
+    jint modifiers = NsKeyModifiersToJavaModifiers(modifierFlags, TRUE);
 
 
     /*
@@ -788,7 +821,7 @@
     jint javaKeyCode, javaKeyLocation;
     BOOL postsTyped = NO;
     unichar testChar, testDeadChar = 0;
-    jint javaModifiers = NsKeyModifiersToJavaModifiers([nsEvent modifierFlags]);
+    jint javaModifiers = NsKeyModifiersToJavaModifiers([nsEvent modifierFlags], TRUE);
 
     if (javaModifiers == 0) {
         testDeadChar = [nsEvent deadKeyCharacter];
@@ -984,7 +1017,7 @@
 
 JNF_COCOA_ENTER(env);
 
-    jmodifiers = NsKeyModifiersToJavaModifiers(modifierFlags);
+    jmodifiers = NsKeyModifiersToJavaModifiers(modifierFlags, TRUE);
 
 JNF_COCOA_EXIT(env);
 
--- a/src/macosx/native/sun/awt/AWTSurfaceLayers.m	Wed Sep 05 15:19:51 2012 -0700
+++ b/src/macosx/native/sun/awt/AWTSurfaceLayers.m	Wed Sep 12 12:32:05 2012 -0700
@@ -78,11 +78,10 @@
 
     // translates values to the coordinate system of the "root" layer
     CGFloat newY = windowLayer.bounds.size.height - rect.origin.y - rect.size.height;
+    CGRect newRect = CGRectMake(rect.origin.x, newY, rect.size.width, rect.size.height);
 
-    // REMIND: why do we need to inverse position?
-    CGRect newRect = CGRectMake(-rect.origin.x, -newY, rect.size.width, rect.size.height);
+    layer.frame = newRect;
 
-    layer.bounds = newRect;
     [AWTSurfaceLayers repaintLayersRecursively:layer];
 }
 
--- a/src/macosx/native/sun/awt/CDragSource.m	Wed Sep 05 15:19:51 2012 -0700
+++ b/src/macosx/native/sun/awt/CDragSource.m	Wed Sep 12 12:32:05 2012 -0700
@@ -460,7 +460,7 @@
     }
 
     // Convert fModifiers (extModifiers) to NS:
-    NSUInteger modifiers = [DnDUtilities mapJavaExtModifiersToNSKeyModifiers:fModifiers];
+    NSUInteger modifiers = JavaModifiersToNsKeyModifiers(fModifiers, TRUE); 
 
     // Just a dummy value ...
     NSInteger eventNumber = 0;
@@ -658,7 +658,7 @@
     }
 
     // b) drag actions (key modifiers) have changed:
-    jint modifiers = [DnDUtilities currentJavaExtKeyModifiers];
+    jint modifiers = NsKeyModifiersToJavaModifiers([NSEvent modifierFlags], YES);
     if (fDragKeyModifiers != modifiers) {
         NSDragOperation currentOp = [DnDUtilities nsDragOperationForModifiers:[NSEvent modifierFlags]];
         NSDragOperation allowedOp = [DnDUtilities mapJavaDragOperationToNS:fSourceActions] & currentOp;
--- a/src/macosx/native/sun/awt/CMenuItem.m	Wed Sep 05 15:19:51 2012 -0700
+++ b/src/macosx/native/sun/awt/CMenuItem.m	Wed Sep 12 12:32:05 2012 -0700
@@ -70,6 +70,18 @@
     JNIEnv *env = [ThreadUtilities getJNIEnv];
 JNF_COCOA_ENTER(env);
 
+    // If we are called as a result of user pressing a shorcut, do nothing,
+    // because AWTView has already sent corresponding key event to the Java 
+    // layer from performKeyEquivalent
+    NSEvent *currEvent = [[NSApplication sharedApplication] currentEvent];
+    if ([currEvent type] == NSKeyDown) {
+        NSString *menuKey = [sender keyEquivalent];
+        NSString *eventKey = [currEvent characters];
+        if ([menuKey isEqualToString:eventKey]) {
+            return;
+        }
+    }
+
     if (fIsCheckbox) {
         static JNF_CLASS_CACHE(jc_CCheckboxMenuItem, "sun/lwawt/macosx/CCheckboxMenuItem");
         static JNF_MEMBER_CACHE(jm_ckHandleAction, jc_CCheckboxMenuItem, "handleAction", "(Z)V");
@@ -83,14 +95,8 @@
         static JNF_CLASS_CACHE(jc_CMenuItem, "sun/lwawt/macosx/CMenuItem");
         static JNF_MEMBER_CACHE(jm_handleAction, jc_CMenuItem, "handleAction", "(JI)V"); // AWT_THREADING Safe (event)
 
-        NSEvent *currEvent = [[NSApplication sharedApplication] currentEvent];
         NSUInteger modifiers = [currEvent modifierFlags];
-        jint javaModifiers = 0;
-
-        if ((modifiers & NSCommandKeyMask) != 0)   javaModifiers |= java_awt_Event_META_MASK;
-        if ((modifiers & NSShiftKeyMask) != 0)     javaModifiers |= java_awt_Event_SHIFT_MASK;
-        if ((modifiers & NSControlKeyMask) != 0)   javaModifiers |= java_awt_Event_CTRL_MASK;
-        if ((modifiers & NSAlternateKeyMask) != 0) javaModifiers |= java_awt_Event_ALT_MASK;
+        jint javaModifiers = NsKeyModifiersToJavaModifiers(modifiers, NO);
 
         JNFCallVoidMethod(env, fPeer, jm_handleAction, UTC(currEvent), javaModifiers); // AWT_THREADING Safe (event)
     }
@@ -117,10 +123,7 @@
             modifiers &= ~java_awt_event_KeyEvent_SHIFT_MASK;
         }
 
-        if ((modifiers & java_awt_event_KeyEvent_SHIFT_MASK) != 0) modifierMask |= NSShiftKeyMask;
-        if ((modifiers & java_awt_event_KeyEvent_CTRL_MASK) != 0)  modifierMask |= NSControlKeyMask;
-        if ((modifiers & java_awt_event_KeyEvent_ALT_MASK) != 0)   modifierMask |= NSAlternateKeyMask;
-        if ((modifiers & java_awt_event_KeyEvent_META_MASK) != 0)  modifierMask |= NSCommandKeyMask;
+        modifierMask = JavaModifiersToNsKeyModifiers(modifiers, NO);
     }
 
     [JNFRunLoop performOnMainThreadWaiting:YES withBlock:^(){
--- a/src/macosx/native/sun/awt/CTextPipe.m	Wed Sep 05 15:19:51 2012 -0700
+++ b/src/macosx/native/sun/awt/CTextPipe.m	Wed Sep 12 12:32:05 2012 -0700
@@ -235,9 +235,22 @@
     CGContextSetTextMatrix(cgRef, CGAffineTransformIdentity); // resets the damage from CoreText
 
     NSString *string = [NSString stringWithCharacters:chars length:length];
+    /*
+       The calls below were used previously but for unknown reason did not 
+       render using the right font (see bug 7183516) when attribString is not 
+       initialized with font dictionary attributes.  It seems that "options" 
+       in CTTypesetterCreateWithAttributedStringAndOptions which contains the 
+       font dictionary is ignored.
+
     NSAttributedString *attribString = [[NSAttributedString alloc] initWithString:string];
 
     CTTypesetterRef typeSetterRef = CTTypesetterCreateWithAttributedStringAndOptions((CFAttributedStringRef) attribString, (CFDictionaryRef) ctsDictionaryFor(nsFont, JRSFontStyleUsesFractionalMetrics(strike->fStyle)));
+    */
+    NSAttributedString *attribString = [[NSAttributedString alloc]
+        initWithString:string
+        attributes:ctsDictionaryFor(nsFont, JRSFontStyleUsesFractionalMetrics(strike->fStyle))];
+    
+    CTTypesetterRef typeSetterRef = CTTypesetterCreateWithAttributedString((CFAttributedStringRef) attribString);
 
     CFRange range = {0, length};
     CTLineRef lineRef = CTTypesetterCreateLine(typeSetterRef, range);
--- a/src/macosx/native/sun/awt/DnDUtilities.h	Wed Sep 05 15:19:51 2012 -0700
+++ b/src/macosx/native/sun/awt/DnDUtilities.h	Wed Sep 12 12:32:05 2012 -0700
@@ -42,7 +42,6 @@
 + (jint)narrowJavaDropActions:(jint)actions;
 
 // Mouse and key modifiers mapping:
-+ (NSUInteger)mapJavaExtModifiersToNSKeyModifiers:(jint)modifiers;
 + (NSUInteger)mapJavaExtModifiersToNSMouseDownButtons:(jint)modifiers;
 + (NSUInteger)mapJavaExtModifiersToNSMouseUpButtons:(jint)modifiers;
 
@@ -50,9 +49,6 @@
 + (jint)extractJavaExtKeyModifiersFromJavaExtModifiers:(jint)modifiers;
 + (jint)extractJavaExtMouseModifiersFromJavaExtModifiers:(jint)modifiers;
 
-// Get the current keyboard modifier keys as java modifiers (for operationChanged)
-+ (jint)currentJavaExtKeyModifiers;
-
 // Getting the state of the current Drag
 + (NSDragOperation)nsDragOperationForModifiers:(NSUInteger)modifiers;
 + (jint) javaKeyModifiersForNSDragOperation:(NSDragOperation)dragOp;
--- a/src/macosx/native/sun/awt/DnDUtilities.m	Wed Sep 05 15:19:51 2012 -0700
+++ b/src/macosx/native/sun/awt/DnDUtilities.m	Wed Sep 12 12:32:05 2012 -0700
@@ -161,28 +161,6 @@
 }
 
 // Mouse and key modifiers mapping:
-+ (NSUInteger)mapJavaExtModifiersToNSKeyModifiers:(jint)modifiers
-{
-    NSUInteger result = 0;
-
-    if ((modifiers & java_awt_event_InputEvent_SHIFT_DOWN_MASK) != 0)
-        result |= NSShiftKeyMask;
-
-    if ((modifiers & java_awt_event_InputEvent_CTRL_DOWN_MASK) != 0)
-        result |= NSControlKeyMask;
-
-    if ((modifiers & java_awt_event_InputEvent_META_DOWN_MASK) != 0)
-        result |= NSCommandKeyMask;
-
-    if ((modifiers & java_awt_event_InputEvent_ALT_DOWN_MASK) != 0)
-        result |= NSAlternateKeyMask;
-
-    if ((modifiers & java_awt_event_InputEvent_ALT_GRAPH_DOWN_MASK) != 0)
-        result |= NSAlternateKeyMask;
-
-    return result;
-}
-
 + (NSUInteger)mapJavaExtModifiersToNSMouseDownButtons:(jint)modifiers
 {
     NSUInteger result = NSLeftMouseDown;
@@ -245,32 +223,6 @@
     return modifiers & mask;
 }
 
-
-+ (jint)currentJavaExtKeyModifiers
-{
-    NSUInteger modifiers = [NSEvent modifierFlags];
-    jint jmodifiers = 0;
-
-    if(modifiers & NSShiftKeyMask) {
-        jmodifiers |= java_awt_event_InputEvent_SHIFT_DOWN_MASK;
-    }
-
-    if(modifiers & NSControlKeyMask) {
-        jmodifiers |= java_awt_event_InputEvent_CTRL_DOWN_MASK;
-    }
-
-    if(modifiers & NSAlternateKeyMask) {
-        jmodifiers |= java_awt_event_InputEvent_ALT_DOWN_MASK;
-    }
-
-    if(modifiers & NSCommandKeyMask) {
-        jmodifiers |= java_awt_event_InputEvent_META_DOWN_MASK;
-    }
-
-    return jmodifiers;
-}
-
-
 + (NSDragOperation) nsDragOperationForModifiers:(NSUInteger)modifiers {
 
     // Java first
--- a/src/macosx/native/sun/awt/ImageSurfaceData.h	Wed Sep 05 15:19:51 2012 -0700
+++ b/src/macosx/native/sun/awt/ImageSurfaceData.h	Wed Sep 12 12:32:05 2012 -0700
@@ -41,7 +41,7 @@
 // If there is an image present, this is a no-op
 void makeSureImageIsCreated(ImageSDOps* isdo);
 
-struct _ContextInfo
+typedef struct _ContextInfo
 {
     BOOL                useWindowContextReference;
     BOOL                canUseJavaPixelsAsContext;
@@ -50,10 +50,9 @@
     size_t                bytesPerRow;
     CGImageAlphaInfo    alphaInfo;
     CGColorSpaceRef        colorSpace;
-}
-typedef ContextInfo;
+} ContextInfo;
 
-struct _ImageInfo
+typedef struct _ImageInfo
 {
     size_t                bitsPerComponent;
     size_t                bitsPerPixel;
@@ -61,8 +60,7 @@
     size_t                bytesPerRow;
     CGImageAlphaInfo    alphaInfo;
     CGColorSpaceRef        colorSpace;
-}
-typedef ImageInfo;
+} ImageInfo;
 
 struct _ImageSDOps
 {
--- a/src/macosx/native/sun/awt/ImageSurfaceData.m	Wed Sep 05 15:19:51 2012 -0700
+++ b/src/macosx/native/sun/awt/ImageSurfaceData.m	Wed Sep 12 12:32:05 2012 -0700
@@ -53,10 +53,6 @@
 // for vImage framework headers
 #include <Accelerate/Accelerate.h>
 
-
-// private Quartz routines needed here
-CG_EXTERN void CGContextSetCTM(CGContextRef ref, CGAffineTransform tx);
-
 static ContextInfo sDefaultContextInfo[sun_java2d_OSXOffScreenSurfaceData_TYPE_3BYTE_RGB+1] =
 {
     {YES,    YES,    8,        4,        0,        kCGImageAlphaPremultipliedFirst | kCGBitmapByteOrder32Host,    NULL},    // TYPE_CUSTOM            // special case
@@ -942,7 +938,6 @@
     // intitalize the context to match the Java coordinate system
 
     // BG, since the context is created above, we can just concat
-    //CGContextSetCTM(qsdo->cgRef, CGAffineTransformMake(1, 0, 0, -1, 0, isdo->height));
     CGContextConcatCTM(qsdo->cgRef, CGAffineTransformMake(1, 0, 0, -1, 0, isdo->height));
 
     CGContextSaveGState(qsdo->cgRef); // this will make sure we don't go pass device context settings
@@ -1114,7 +1109,9 @@
                 if (qsdo->cgRef != NULL)
                 {
                     CGContextSaveGState(qsdo->cgRef);
-                    CGContextSetCTM(qsdo->cgRef, CGAffineTransformMake(1, 0, 0, 1, 0, 0));
+                    CGAffineTransform currCTM = CGContextGetCTM(qsdo->cgRef);
+                    CGAffineTransform inverse = CGAffineTransformInvert(currCTM);
+                    CGContextConcatCTM(qsdo->cgRef, inverse);
                     CGContextSetBlendMode(qsdo->cgRef, kCGBlendModeCopy);
                     CGContextSetAlpha(qsdo->cgRef, 1.0f);
                     CGContextDrawImage(qsdo->cgRef, CGRectMake(0, 0, width, height), javaImg);
--- a/src/macosx/native/sun/awt/QuartzRenderer.m	Wed Sep 05 15:19:51 2012 -0700
+++ b/src/macosx/native/sun/awt/QuartzRenderer.m	Wed Sep 12 12:32:05 2012 -0700
@@ -50,9 +50,6 @@
 // same value as defined in Sun's own code
 #define XOR_ALPHA_CUTOFF 128
 
-// private Quartz routines needed here
-CG_EXTERN void CGContextSetCTM(CGContextRef ref, CGAffineTransform tx);
-
 
 static CGFloat gRoundRectCtrlpts[10][12] =
 {
@@ -536,7 +533,7 @@
 
     makeSureImageIsCreated(isdo);
 
-    CGAffineTransform ctm = CGContextGetCTM(cgRef);
+    CGContextSaveGState(cgRef);
     CGContextConcatCTM(cgRef, CGAffineTransformMake(a, b, c, d, tx, ty));
     jint alphaInfo = isdo->contextInfo.alphaInfo & kCGBitmapAlphaInfoMask;
 
@@ -551,7 +548,7 @@
         CGImageRelease(subImg);
     }
 
-    CGContextSetCTM(cgRef, ctm);
+    CGContextRestoreGState(cgRef);
     UnlockImage(env, isdo);
 }
 
--- a/src/macosx/native/sun/awt/QuartzSurfaceData.m	Wed Sep 05 15:19:51 2012 -0700
+++ b/src/macosx/native/sun/awt/QuartzSurfaceData.m	Wed Sep 12 12:32:05 2012 -0700
@@ -40,9 +40,6 @@
 #import <AppKit/AppKit.h>
 #import "ThreadUtilities.h"
 
-// private Quartz routines needed here
-CG_EXTERN void CGContextSetCTM(CGContextRef ref, CGAffineTransform tx);
-
 //#define DEBUG
 #if defined DEBUG
     #define PRINT(msg) {fprintf(stderr, "%s\n", msg);}
@@ -50,9 +47,6 @@
     #define PRINT(msg) {}
 #endif
 
-// from CGAffineTransformPrivate.h
-extern CGPoint CGPointApplyInverseAffineTransform(CGPoint point, CGAffineTransform t);
-
 #define kOffset (0.5f)
 
 BOOL gAdjustForJavaDrawing;
@@ -608,7 +602,8 @@
                 // We need to flip both y coefficeints to flip the offset point into the java coordinate system.
                 ctm.b = -ctm.b; ctm.d = -ctm.d; ctm.tx = 0.0f; ctm.ty = 0.0f;
                 CGPoint offsets = {kOffset, kOffset};
-                offsets = CGPointApplyInverseAffineTransform(offsets, ctm);
+                CGAffineTransform inverse = CGAffineTransformInvert(ctm);
+                offsets = CGPointApplyAffineTransform(offsets, inverse);
                 qsdo->graphicsStateInfo.offsetX = offsets.x;
                 qsdo->graphicsStateInfo.offsetY = offsets.y;
             }
--- a/src/share/classes/com/sun/crypto/provider/AESCrypt.java	Wed Sep 05 15:19:51 2012 -0700
+++ b/src/share/classes/com/sun/crypto/provider/AESCrypt.java	Wed Sep 12 12:32:05 2012 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2012, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -37,6 +37,7 @@
 package com.sun.crypto.provider;
 
 import java.security.InvalidKeyException;
+import java.util.Arrays;
 
 /**
  * Rijndael --pronounced Reindaal-- is a symmetric cipher with a 128-bit
@@ -54,7 +55,12 @@
     private Object[] sessionK = null;
     private int[] K = null;
 
-    /** (ROUNDS-1) * 4 */
+    /** Cipher encryption/decryption key */
+    // skip re-generating Session and Sub keys if the cipher key is
+    // the same
+    private byte[] lastKey = null;
+
+    /** ROUNDS * 4 */
     private int limit = 0;
 
     AESCrypt() {
@@ -82,41 +88,45 @@
                 key.length + " bytes");
         }
 
-        // generate session key and reset sub key.
-        sessionK = makeKey(key);
-        setSubKey(decrypting);
+        if (!Arrays.equals(key, lastKey)) {
+            // re-generate session key 'sessionK' when cipher key changes
+            makeSessionKey(key);
+            lastKey = key.clone();  // save cipher key
+        }
+
+        // set sub key to the corresponding session Key
+        this.K = (int[]) sessionK[(decrypting? 1:0)];
     }
 
-    private void setSubKey(boolean decrypting) {
-        int[][] Kd = (int[][]) sessionK[decrypting ? 1 : 0];
-        int rounds = Kd.length;
-        this.K = new int[rounds*4];
-        for(int i=0; i<rounds; i++) {
+    /**
+     * Expand an int[(ROUNDS+1)][4] into int[(ROUNDS+1)*4].
+     * For decryption round keys, need to rotate right by 4 ints.
+     * @param kr The round keys for encryption or decryption.
+     * @param decrypting True if 'kr' is for decryption and false otherwise.
+     */
+    private static final int[] expandToSubKey(int[][] kr, boolean decrypting) {
+        int total = kr.length;
+        int[] expK = new int[total*4];
+        if (decrypting) {
+            // decrypting, rotate right by 4 ints
+            // i.e. i==0
             for(int j=0; j<4; j++) {
-                K[i*4 + j] = Kd[i][j];
+                expK[j] = kr[total-1][j];
+            }
+            for(int i=1; i<total; i++) {
+                for(int j=0; j<4; j++) {
+                    expK[i*4 + j] = kr[i-1][j];
+                }
+            }
+        } else {
+            // encrypting, straight expansion
+            for(int i=0; i<total; i++) {
+                for(int j=0; j<4; j++) {
+                    expK[i*4 + j] = kr[i][j];
+                }
             }
         }
-
-        if (decrypting) {
-            int j0 = K[K.length-4];
-            int j1 = K[K.length-3];
-            int j2 = K[K.length-2];
-            int j3 = K[K.length-1];
-
-            for (int i=this.K.length-1; i>3; i--) {
-                this.K[i] = this.K[i-4];
-            }
-            K[0] = j0;
-            K[1] = j1;
-            K[2] = j2;
-            K[3] = j3;
-        }
-
-        ROUNDS_12 = (rounds>=13);
-        ROUNDS_14 = (rounds==15);
-
-        rounds--;
-        limit=rounds*4;
+        return expK;
     }
 
     private static int[]
@@ -566,10 +576,10 @@
     /**
      * Expand a user-supplied key material into a session key.
      *
-     * @param key The 128/192/256-bit user-key to use.
+     * @param k The 128/192/256-bit cipher key to use.
      * @exception InvalidKeyException  If the key is invalid.
      */
-    private static Object[] makeKey(byte[] k) throws InvalidKeyException {
+    private void makeSessionKey(byte[] k) throws InvalidKeyException {
         if (k == null) {
             throw new InvalidKeyException("Empty key");
         }
@@ -639,10 +649,18 @@
                            U4[ tt         & 0xFF];
             }
         }
-        // assemble the encryption (Ke) and decryption (Kd) round keys into
-        // one sessionKey object
-        Object[] result = new Object[] {Ke, Kd};
-        return result;
+
+        // assemble the encryption (Ke) and decryption (Kd) round keys
+        // and expand them into arrays of ints.
+        int[] expandedKe = expandToSubKey(Ke, false); // decrypting==false
+        int[] expandedKd = expandToSubKey(Kd, true);  // decrypting==true
+
+        ROUNDS_12 = (ROUNDS>=12);
+        ROUNDS_14 = (ROUNDS==14);
+        limit = ROUNDS*4;
+
+        // store the expanded sub keys into 'sessionK'
+        sessionK = new Object[] { expandedKe, expandedKd };
     }
 
 
--- a/src/share/classes/com/sun/java/swing/plaf/gtk/GTKPainter.java	Wed Sep 05 15:19:51 2012 -0700
+++ b/src/share/classes/com/sun/java/swing/plaf/gtk/GTKPainter.java	Wed Sep 12 12:32:05 2012 -0700
@@ -926,9 +926,20 @@
                                      int x, int y, int w, int h) {
         // Text is odd in that it uses the TEXT_BACKGROUND vs BACKGROUND.
         JComponent c = context.getComponent();
+        Container container = c.getParent();
+        Container containerParent = null;
         GTKStyle style = (GTKStyle)context.getStyle();
         Region id = context.getRegion();
         int state = context.getComponentState();
+
+        if (c instanceof ListCellRenderer && container != null) {
+            containerParent = container.getParent();
+            if (containerParent instanceof JComboBox
+                    && containerParent.hasFocus()) {
+                state |= SynthConstants.FOCUSED;
+            }
+        }
+
         synchronized (UNIXToolkit.GTK_LOCK) {
             if (ENGINE.paintCachedImage(g, x, y, w, h, id, state)) {
                 return;
@@ -938,9 +949,10 @@
             int focusSize = 0;
             boolean interiorFocus = style.getClassSpecificBoolValue(
                     context, "interior-focus", true);
+
+            focusSize = style.getClassSpecificIntValue(context,
+                    "focus-line-width",1);
             if (!interiorFocus && (state & SynthConstants.FOCUSED) != 0) {
-                focusSize = style.getClassSpecificIntValue(context,
-                        "focus-line-width",1);
                 x += focusSize;
                 y += focusSize;
                 w -= 2 * focusSize;
@@ -961,11 +973,25 @@
                                 h - (2 * yThickness),
                                 ColorType.TEXT_BACKGROUND);
 
-            if (focusSize > 0) {
-                x -= focusSize;
-                y -= focusSize;
-                w += 2 * focusSize;
-                h += 2 * focusSize;
+            if (focusSize > 0 && (state & SynthConstants.FOCUSED) != 0) {
+                if (!interiorFocus) {
+                    x -=  focusSize;
+                    y -=  focusSize;
+                    w +=  2 * focusSize;
+                    h +=  2 * focusSize;
+                } else {
+                    if (containerParent instanceof JComboBox) {
+                        x += (focusSize + 2);
+                        y += (focusSize + 1);
+                        w -= (2 * focusSize + 1);
+                        h -= (2 * focusSize + 2);
+                    } else {
+                        x += focusSize;
+                        y += focusSize;
+                        w -= 2 * focusSize;
+                        h -= 2 * focusSize;
+                    }
+                }
                 ENGINE.paintFocus(g, context, id, gtkState,
                         "entry", x, y, w, h);
             }
--- a/src/share/classes/java/awt/Component.java	Wed Sep 05 15:19:51 2012 -0700
+++ b/src/share/classes/java/awt/Component.java	Wed Sep 12 12:32:05 2012 -0700
@@ -150,7 +150,7 @@
  *    import java.awt.event.*;
  *    import java.io.Serializable;
  *
- *    class MyApp java.io.Serializable
+ *    class MyApp implements java.io.Serializable
  *    {
  *         BigObjectThatShouldNotBeSerializedWithAButton bigOne;
  *         Button aButton = new Button();
--- a/src/share/classes/java/awt/KeyboardFocusManager.java	Wed Sep 05 15:19:51 2012 -0700
+++ b/src/share/classes/java/awt/KeyboardFocusManager.java	Wed Sep 12 12:32:05 2012 -0700
@@ -458,7 +458,7 @@
     private void initPeer() {
         Toolkit tk = Toolkit.getDefaultToolkit();
         KeyboardFocusManagerPeerProvider peerProvider = (KeyboardFocusManagerPeerProvider)tk;
-        peer = peerProvider.createKeyboardFocusManagerPeer(this);
+        peer = peerProvider.getKeyboardFocusManagerPeer();
     }
 
     /**
--- a/src/share/classes/java/awt/peer/KeyboardFocusManagerPeer.java	Wed Sep 05 15:19:51 2012 -0700
+++ b/src/share/classes/java/awt/peer/KeyboardFocusManagerPeer.java	Wed Sep 12 12:32:05 2012 -0700
@@ -34,6 +34,14 @@
 public interface KeyboardFocusManagerPeer {
 
     /**
+     * Sets the window that should become the focused window.
+     *
+     * @param win the window that should become the focused window
+     *
+     */
+    void setCurrentFocusedWindow(Window win);
+
+    /**
      * Returns the currently focused window.
      *
      * @return the currently focused window
--- a/src/share/classes/java/beans/IndexedPropertyDescriptor.java	Wed Sep 05 15:19:51 2012 -0700
+++ b/src/share/classes/java/beans/IndexedPropertyDescriptor.java	Wed Sep 12 12:32:05 2012 -0700
@@ -495,6 +495,16 @@
         indexedReadMethodName = old.indexedReadMethodName;
     }
 
+    void updateGenericsFor(Class<?> type) {
+        super.updateGenericsFor(type);
+        try {
+            setIndexedPropertyType(findIndexedPropertyType(getIndexedReadMethod0(), getIndexedWriteMethod0()));
+        }
+        catch (IntrospectionException exception) {
+            setIndexedPropertyType(null);
+        }
+    }
+
     /**
      * Returns a hash code value for the object.
      * See {@link java.lang.Object#hashCode} for a complete description.
--- a/src/share/classes/java/beans/Introspector.java	Wed Sep 05 15:19:51 2012 -0700
+++ b/src/share/classes/java/beans/Introspector.java	Wed Sep 12 12:32:05 2012 -0700
@@ -574,26 +574,25 @@
             // replace existing property descriptor
             // only if we have types to resolve
             // in the context of this.beanClass
-            try {
-                String name = pd.getName();
-                Method read = pd.getReadMethod();
-                Method write = pd.getWriteMethod();
-                boolean cls = true;
-                if (read != null) cls = cls && read.getGenericReturnType() instanceof Class;
-                if (write != null) cls = cls && write.getGenericParameterTypes()[0] instanceof Class;
-                if (pd instanceof IndexedPropertyDescriptor) {
-                    IndexedPropertyDescriptor ipd = (IndexedPropertyDescriptor)pd;
-                    Method readI = ipd.getIndexedReadMethod();
-                    Method writeI = ipd.getIndexedWriteMethod();
-                    if (readI != null) cls = cls && readI.getGenericReturnType() instanceof Class;
-                    if (writeI != null) cls = cls && writeI.getGenericParameterTypes()[1] instanceof Class;
-                    if (!cls) {
-                        pd = new IndexedPropertyDescriptor(this.beanClass, name, read, write, readI, writeI);
-                    }
-                } else if (!cls) {
-                    pd = new PropertyDescriptor(this.beanClass, name, read, write);
+            Method read = pd.getReadMethod();
+            Method write = pd.getWriteMethod();
+            boolean cls = true;
+            if (read != null) cls = cls && read.getGenericReturnType() instanceof Class;
+            if (write != null) cls = cls && write.getGenericParameterTypes()[0] instanceof Class;
+            if (pd instanceof IndexedPropertyDescriptor) {
+                IndexedPropertyDescriptor ipd = (IndexedPropertyDescriptor) pd;
+                Method readI = ipd.getIndexedReadMethod();
+                Method writeI = ipd.getIndexedWriteMethod();
+                if (readI != null) cls = cls && readI.getGenericReturnType() instanceof Class;
+                if (writeI != null) cls = cls && writeI.getGenericParameterTypes()[1] instanceof Class;
+                if (!cls) {
+                    pd = new IndexedPropertyDescriptor(ipd);
+                    pd.updateGenericsFor(this.beanClass);
                 }
-            } catch ( IntrospectionException e ) {
+            }
+            else if (!cls) {
+                pd = new PropertyDescriptor(pd);
+                pd.updateGenericsFor(this.beanClass);
             }
         }
         list.add(pd);
@@ -1460,7 +1459,7 @@
     private PropertyDescriptor[] properties;
     private int defaultProperty;
     private MethodDescriptor[] methods;
-    private final Reference<BeanInfo> targetBeanInfoRef;
+    private Reference<BeanInfo> targetBeanInfoRef;
 
     public GenericBeanInfo(BeanDescriptor beanDescriptor,
                 EventSetDescriptor[] events, int defaultEvent,
@@ -1472,7 +1471,9 @@
         this.properties = properties;
         this.defaultProperty = defaultProperty;
         this.methods = methods;
-        this.targetBeanInfoRef = new SoftReference<BeanInfo>(targetBeanInfo);
+        this.targetBeanInfoRef = (targetBeanInfo != null)
+                ? new SoftReference<>(targetBeanInfo)
+                : null;
     }
 
     /**
@@ -1539,10 +1540,25 @@
     }
 
     public java.awt.Image getIcon(int iconKind) {
-        BeanInfo targetBeanInfo = this.targetBeanInfoRef.get();
+        BeanInfo targetBeanInfo = getTargetBeanInfo();
         if (targetBeanInfo != null) {
             return targetBeanInfo.getIcon(iconKind);
         }
         return super.getIcon(iconKind);
     }
+
+    private BeanInfo getTargetBeanInfo() {
+        if (this.targetBeanInfoRef == null) {
+            return null;
+        }
+        BeanInfo targetBeanInfo = this.targetBeanInfoRef.get();
+        if (targetBeanInfo == null) {
+            targetBeanInfo = ThreadGroupContext.getContext().getBeanInfoFinder()
+                    .find(this.beanDescriptor.getBeanClass());
+            if (targetBeanInfo != null) {
+                this.targetBeanInfoRef = new SoftReference<>(targetBeanInfo);
+            }
+        }
+        return targetBeanInfo;
+    }
 }
--- a/src/share/classes/java/beans/PropertyDescriptor.java	Wed Sep 05 15:19:51 2012 -0700
+++ b/src/share/classes/java/beans/PropertyDescriptor.java	Wed Sep 12 12:32:05 2012 -0700
@@ -109,6 +109,10 @@
         if (writeMethodName != null && getWriteMethod() == null) {
             throw new IntrospectionException("Method not found: " + writeMethodName);
         }
+        boundInitialization(beanClass);
+    }
+
+    private void boundInitialization(Class<?> beanClass) {
         // If this class or one of its base classes allow PropertyChangeListener,
         // then we assume that any properties we discover are "bound".
         // See Introspector.getTargetPropertyInfo() method.
@@ -159,6 +163,7 @@
         setReadMethod(read);
         setWriteMethod(write);
         this.baseName = base;
+        boundInitialization(bean);
     }
 
     /**
@@ -591,7 +596,7 @@
         Method yw = y.getWriteMethod();
 
         try {
-            if (yw != null && yw.getDeclaringClass() == getClass0()) {
+            if (yw != null) {
                 setWriteMethod(yw);
             } else {
                 setWriteMethod(xw);
@@ -630,6 +635,16 @@
         constrained = old.constrained;
     }
 
+    void updateGenericsFor(Class<?> type) {
+        setClass0(type);
+        try {
+            setPropertyType(findPropertyType(getReadMethod0(), getWriteMethod0()));
+        }
+        catch (IntrospectionException exception) {
+            setPropertyType(null);
+        }
+    }
+
     /**
      * Returns the property type that corresponds to the read and write method.
      * The type precedence is given to the readMethod.
--- a/src/share/classes/java/beans/XMLEncoder.java	Wed Sep 05 15:19:51 2012 -0700
+++ b/src/share/classes/java/beans/XMLEncoder.java	Wed Sep 12 12:32:05 2012 -0700
@@ -631,7 +631,12 @@
         }
 
         if (d.name != null) {
-            outputXML(isArgument ? "object" : "void", " idref=" + quote(d.name), value);
+            if (isArgument) {
+                writeln("<object idref=" + quote(d.name) + "/>");
+            }
+            else {
+                outputXML("void", " idref=" + quote(d.name), value);
+            }
         }
         else if (d.exp != null) {
             outputStatement(d.exp, outer, isArgument);
@@ -710,12 +715,14 @@
         }
         else {
             d.refs = 2;
-            getValueData(target).refs++;
-            List<Statement> statements = statementList(target);
-            if (!statements.contains(exp)) {
-                statements.add(exp);
+            if (d.name == null) {
+                getValueData(target).refs++;
+                List<Statement> statements = statementList(target);
+                if (!statements.contains(exp)) {
+                    statements.add(exp);
+                }
+                outputValue(target, outer, false);
             }
-            outputValue(target, outer, false);
             if (expression) {
                 outputValue(value, outer, isArgument);
             }
--- a/src/share/classes/java/nio/X-Buffer.java.template	Wed Sep 05 15:19:51 2012 -0700
+++ b/src/share/classes/java/nio/X-Buffer.java.template	Wed Sep 12 12:32:05 2012 -0700
@@ -888,6 +888,8 @@
      */
     public $Type$Buffer put(String src, int start, int end) {
         checkBounds(start, end - start, src.length());
+        if (end - start > remaining())
+            throw new BufferOverflowException();
         for (int i = start; i < end; i++)
             this.put(src.charAt(i));
         return this;
--- a/src/share/classes/java/security/Signature.java	Wed Sep 05 15:19:51 2012 -0700
+++ b/src/share/classes/java/security/Signature.java	Wed Sep 12 12:32:05 2012 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1996, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1996, 2012, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -658,7 +658,7 @@
         throws SignatureException {
         if (state == VERIFY) {
             if ((signature == null) || (offset < 0) || (length < 0) ||
-                (offset + length > signature.length)) {
+                (length > signature.length - offset)) {
                 throw new IllegalArgumentException("Bad arguments");
             }
 
--- a/src/share/classes/java/util/AbstractCollection.java	Wed Sep 05 15:19:51 2012 -0700
+++ b/src/share/classes/java/util/AbstractCollection.java	Wed Sep 12 12:32:05 2012 -0700
@@ -180,13 +180,21 @@
 
         for (int i = 0; i < r.length; i++) {
             if (! it.hasNext()) { // fewer elements than expected
-                if (a != r)
+                if (a == r) {
+                    r[i] = null; // null-terminate
+                } else if (a.length < i) {
                     return Arrays.copyOf(r, i);
-                r[i] = null; // null-terminate
-                return r;
+                } else {
+                    System.arraycopy(r, 0, a, 0, i);
+                    if (a.length > i) {
+                        a[i] = null;
+                    }
+                }
+                return a;
             }
             r[i] = (T)it.next();
         }
+        // more elements than expected
         return it.hasNext() ? finishToArray(r, it) : r;
     }
 
--- a/src/share/classes/javax/crypto/CryptoPermissions.java	Wed Sep 05 15:19:51 2012 -0700
+++ b/src/share/classes/javax/crypto/CryptoPermissions.java	Wed Sep 12 12:32:05 2012 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -30,10 +30,16 @@
 import java.util.Hashtable;
 import java.util.Vector;
 import java.util.NoSuchElementException;
+import java.util.concurrent.ConcurrentHashMap;
 import java.io.Serializable;
 import java.io.InputStream;
 import java.io.InputStreamReader;
 import java.io.BufferedReader;
+import java.io.ObjectStreamField;
+import java.io.ObjectInputStream;
+import java.io.ObjectInputStream.GetField;
+import java.io.ObjectOutputStream;
+import java.io.ObjectOutputStream.PutField;
 import java.io.IOException;
 
 /**
@@ -61,15 +67,24 @@
 
     private static final long serialVersionUID = 4946547168093391015L;
 
-    // This class is similar to java.security.Permissions
-    private Hashtable perms;
+    /**
+     * @serialField perms java.util.Hashtable
+     */
+    private static final ObjectStreamField[] serialPersistentFields = {
+        new ObjectStreamField("perms", Hashtable.class),
+    };
+
+    // Switched from Hashtable to ConcurrentHashMap to improve scalability.
+    // To maintain serialization compatibility, this field is made transient
+    // and custom readObject/writeObject methods are used.
+    private transient ConcurrentHashMap<String,PermissionCollection> perms;
 
     /**
      * Creates a new CryptoPermissions object containing
      * no CryptoPermissionCollections.
      */
     CryptoPermissions() {
-        perms = new Hashtable(7);
+        perms = new ConcurrentHashMap<>(7);
     }
 
     /**
@@ -132,9 +147,7 @@
                         getPermissionCollection(cryptoPerm);
         pc.add(cryptoPerm);
         String alg = cryptoPerm.getAlgorithm();
-        if (!perms.containsKey(alg)) {
-            perms.put(alg, pc);
-        }
+        perms.putIfAbsent(alg, pc);
     }
 
     /**
@@ -382,20 +395,17 @@
     PermissionCollection getPermissionCollection(String alg) {
         // If this CryptoPermissions includes CryptoAllPermission,
         // we should return CryptoAllPermission.
-        if (perms.containsKey(CryptoAllPermission.ALG_NAME)) {
-            return
-                (PermissionCollection)(perms.get(CryptoAllPermission.ALG_NAME));
-        }
+        PermissionCollection pc = perms.get(CryptoAllPermission.ALG_NAME);
+        if (pc == null) {
+            pc = perms.get(alg);
 
-        PermissionCollection pc = (PermissionCollection)perms.get(alg);
-
-        // If there isn't a PermissionCollection for
-        // the given algorithm,we should return the
-        // PermissionCollection for the wildcard
-        // if there is one.
-        if (pc == null) {
-            pc = (PermissionCollection)perms.get(
-                                       CryptoPermission.ALG_NAME_WILDCARD);
+            // If there isn't a PermissionCollection for
+            // the given algorithm,we should return the
+            // PermissionCollection for the wildcard
+            // if there is one.
+            if (pc == null) {
+                pc = perms.get(CryptoPermission.ALG_NAME_WILDCARD);
+            }
         }
         return pc;
     }
@@ -421,6 +431,28 @@
         }
         return pc;
     }
+
+    private void readObject(ObjectInputStream s)
+        throws IOException, ClassNotFoundException {
+        ObjectInputStream.GetField fields = s.readFields();
+        @SuppressWarnings("unchecked")
+        Hashtable<String,PermissionCollection> permTable =
+                (Hashtable<String,PermissionCollection>)
+                (fields.get("perms", null));
+        if (permTable != null) {
+            perms = new ConcurrentHashMap<>(permTable);
+        } else {
+            perms = new ConcurrentHashMap<>();
+        }
+    }
+
+    private void writeObject(ObjectOutputStream s) throws IOException {
+        Hashtable<String,PermissionCollection> permTable =
+                new Hashtable<>(perms);
+        ObjectOutputStream.PutField fields = s.putFields();
+        fields.put("perms", permTable);
+        s.writeFields();
+    }
 }
 
 final class PermissionsEnumerator implements Enumeration {
@@ -463,7 +495,6 @@
         } else {
             throw new NoSuchElementException("PermissionsEnumerator");
         }
-
     }
 
     private Enumeration getNextEnumWithMore() {
--- a/src/share/classes/javax/crypto/JceSecurityManager.java	Wed Sep 05 15:19:51 2012 -0700
+++ b/src/share/classes/javax/crypto/JceSecurityManager.java	Wed Sep 12 12:32:05 2012 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -29,6 +29,8 @@
 import java.net.*;
 import java.util.*;
 import java.util.jar.*;
+import java.util.concurrent.ConcurrentHashMap;
+import java.util.concurrent.ConcurrentMap;
 
 /**
  * The JCE security manager.
@@ -51,7 +53,10 @@
     private static final CryptoPermissions exemptPolicy;
     private static final CryptoAllPermission allPerm;
     private static final Vector TrustedCallersCache = new Vector(2);
-    private static final Map exemptCache = new HashMap();
+    private static final ConcurrentMap<URL,CryptoPermissions> exemptCache =
+            new ConcurrentHashMap<>();
+    private static final CryptoPermissions CACHE_NULL_MARK =
+            new CryptoPermissions();
 
     // singleton instance
     static final JceSecurityManager INSTANCE;
@@ -116,17 +121,19 @@
             return defaultPerm;
         }
 
-        CryptoPermissions appPerms;
-        synchronized (this.getClass()) {
-            if (exemptCache.containsKey(callerCodeBase)) {
-                appPerms = (CryptoPermissions)exemptCache.get(callerCodeBase);
-            } else {
-                appPerms = getAppPermissions(callerCodeBase);
-                exemptCache.put(callerCodeBase, appPerms);
+        CryptoPermissions appPerms = exemptCache.get(callerCodeBase);
+        if (appPerms == null) {
+            // no match found in cache
+            synchronized (this.getClass()) {
+                appPerms = exemptCache.get(callerCodeBase);
+                if (appPerms == null) {
+                    appPerms = getAppPermissions(callerCodeBase);
+                    exemptCache.putIfAbsent(callerCodeBase,
+                        (appPerms == null? CACHE_NULL_MARK:appPerms));
+                }
             }
         }
-
-        if (appPerms == null) {
+        if (appPerms == null || appPerms == CACHE_NULL_MARK) {
             return defaultPerm;
         }
 
--- a/src/share/classes/javax/swing/JTable.java	Wed Sep 05 15:19:51 2012 -0700
+++ b/src/share/classes/javax/swing/JTable.java	Wed Sep 12 12:32:05 2012 -0700
@@ -5468,7 +5468,7 @@
                 if (constructor.getDeclaringClass() == String.class) {
                     value = s;
                 }
-                super.stopCellEditing();
+                return super.stopCellEditing();
             }
 
             try {
--- a/src/share/classes/sun/awt/HToolkit.java	Wed Sep 05 15:19:51 2012 -0700
+++ b/src/share/classes/sun/awt/HToolkit.java	Wed Sep 12 12:32:05 2012 -0700
@@ -44,6 +44,14 @@
 public class HToolkit extends SunToolkit
     implements ComponentFactory {
 
+    private static final KeyboardFocusManagerPeer kfmPeer = new KeyboardFocusManagerPeer() {
+        public void setCurrentFocusedWindow(Window win) {}
+        public Window getCurrentFocusedWindow() { return null; }
+        public void setCurrentFocusOwner(Component comp) {}
+        public Component getCurrentFocusOwner() { return null; }
+        public void clearGlobalFocusOwner(Window activeWindow) {}
+    };
+
     public HToolkit() {
     }
 
@@ -152,15 +160,9 @@
         throw new HeadlessException();
     }
 
-    public KeyboardFocusManagerPeer createKeyboardFocusManagerPeer(KeyboardFocusManager manager) {
+    public KeyboardFocusManagerPeer getKeyboardFocusManagerPeer() {
         // See 6833019.
-        return
-            new KeyboardFocusManagerPeer() {
-                public Window getCurrentFocusedWindow() { return null; }
-                public void setCurrentFocusOwner(Component comp) {}
-                public Component getCurrentFocusOwner() { return null; }
-                public void clearGlobalFocusOwner(Window activeWindow) {}
-            };
+        return kfmPeer;
     }
 
     public TrayIconPeer createTrayIcon(TrayIcon target)
--- a/src/share/classes/sun/awt/HeadlessToolkit.java	Wed Sep 05 15:19:51 2012 -0700
+++ b/src/share/classes/sun/awt/HeadlessToolkit.java	Wed Sep 12 12:32:05 2012 -0700
@@ -30,22 +30,25 @@
 import java.awt.dnd.peer.DragSourceContextPeer;
 import java.awt.event.*;
 import java.awt.im.InputMethodHighlight;
-import java.awt.im.spi.InputMethodDescriptor;
 import java.awt.image.*;
 import java.awt.datatransfer.Clipboard;
 import java.awt.peer.*;
 import java.beans.PropertyChangeListener;
-import java.lang.reflect.Constructor;
-import java.lang.reflect.InvocationTargetException;
 import java.net.URL;
 import java.util.Map;
 import java.util.Properties;
-import sun.awt.im.InputContext;
-import sun.awt.image.ImageRepresentation;
 
 public class HeadlessToolkit extends Toolkit
     implements ComponentFactory, KeyboardFocusManagerPeerProvider {
 
+    private static final KeyboardFocusManagerPeer kfmPeer = new KeyboardFocusManagerPeer() {
+        public void setCurrentFocusedWindow(Window win) {}
+        public Window getCurrentFocusedWindow() { return null; }
+        public void setCurrentFocusOwner(Component comp) {}
+        public Component getCurrentFocusOwner() { return null; }
+        public void clearGlobalFocusOwner(Window activeWindow) {}
+    };
+
     private Toolkit tk;
     private ComponentFactory componentFactory;
 
@@ -179,15 +182,9 @@
         throw new HeadlessException();
     }
 
-    public KeyboardFocusManagerPeer createKeyboardFocusManagerPeer(KeyboardFocusManager manager) {
+    public KeyboardFocusManagerPeer getKeyboardFocusManagerPeer() {
         // See 6833019.
-        return
-            new KeyboardFocusManagerPeer() {
-                public Window getCurrentFocusedWindow() { return null; }
-                public void setCurrentFocusOwner(Component comp) {}
-                public Component getCurrentFocusOwner() { return null; }
-                public void clearGlobalFocusOwner(Window activeWindow) {}
-            };
+        return kfmPeer;
     }
 
     public TrayIconPeer createTrayIcon(TrayIcon target)
--- a/src/share/classes/sun/awt/KeyboardFocusManagerPeerImpl.java	Wed Sep 05 15:19:51 2012 -0700
+++ b/src/share/classes/sun/awt/KeyboardFocusManagerPeerImpl.java	Wed Sep 12 12:32:05 2012 -0700
@@ -53,12 +53,6 @@
     public static final int SNFH_SUCCESS_HANDLED = 1;
     public static final int SNFH_SUCCESS_PROCEED = 2;
 
-    protected KeyboardFocusManager manager;
-
-    public KeyboardFocusManagerPeerImpl(KeyboardFocusManager manager) {
-        this.manager = manager;
-    }
-
     @Override
     public void clearGlobalFocusOwner(Window activeWindow) {
         if (activeWindow != null) {
--- a/src/share/classes/sun/awt/KeyboardFocusManagerPeerProvider.java	Wed Sep 05 15:19:51 2012 -0700
+++ b/src/share/classes/sun/awt/KeyboardFocusManagerPeerProvider.java	Wed Sep 12 12:32:05 2012 -0700
@@ -25,20 +25,19 @@
 
 package sun.awt;
 
-import java.awt.KeyboardFocusManager;
 import java.awt.peer.KeyboardFocusManagerPeer;
 
 /**
  * {@link KeyboardFocusManagerPeerProvider} is required to be implemented by
  * the currently used {@link java.awt.Toolkit} instance. In order to initialize
- * {@link java.awt.KeyboardFocusManager}, an instance of {@link KeyboardFocusManagerPeer}
- * is needed. To create that instance, the {@link #createKeyboardFocusManagerPeer}
+ * {@link java.awt.KeyboardFocusManager}, a singleton instance of {@link KeyboardFocusManagerPeer}
+ * is needed. To obtain that instance, the {@link #getKeyboardFocusManagerPeer}
  * method of the current toolkit is called.
  */
 public interface KeyboardFocusManagerPeerProvider {
 
     /**
-     * Creates a KeyboardFocusManagerPeer for the specified KeyboardFocusManager.
+     * Gets a singleton KeyboardFocusManagerPeer instance.
      */
-    KeyboardFocusManagerPeer createKeyboardFocusManagerPeer(KeyboardFocusManager manager);
+    KeyboardFocusManagerPeer getKeyboardFocusManagerPeer();
 }
--- a/src/share/classes/sun/awt/SunToolkit.java	Wed Sep 05 15:19:51 2012 -0700
+++ b/src/share/classes/sun/awt/SunToolkit.java	Wed Sep 12 12:32:05 2012 -0700
@@ -196,7 +196,7 @@
     public abstract RobotPeer createRobot(Robot target, GraphicsDevice screen)
         throws AWTException;
 
-    public abstract KeyboardFocusManagerPeer createKeyboardFocusManagerPeer(KeyboardFocusManager manager)
+    public abstract KeyboardFocusManagerPeer getKeyboardFocusManagerPeer()
         throws HeadlessException;
 
     /**
@@ -505,15 +505,19 @@
             // Don't call flushPendingEvents() recursively
             if (!isFlushingPendingEvents) {
                 isFlushingPendingEvents = true;
-                AppContext appContext = AppContext.getAppContext();
-                PostEventQueue postEventQueue =
-                    (PostEventQueue)appContext.get(POST_EVENT_QUEUE_KEY);
-                if (postEventQueue != null) {
-                    postEventQueue.flush();
+                try {
+                    AppContext appContext = AppContext.getAppContext();
+                    PostEventQueue postEventQueue =
+                        (PostEventQueue)appContext.get(POST_EVENT_QUEUE_KEY);
+                    if (postEventQueue != null) {
+                        postEventQueue.flush();
+                    }
+                }
+                finally {
+                    isFlushingPendingEvents = false;
                 }
             }
         } finally {
-            isFlushingPendingEvents = false;
             flushLock.unlock();
         }
     }
--- a/src/share/classes/sun/awt/image/VolatileSurfaceManager.java	Wed Sep 05 15:19:51 2012 -0700
+++ b/src/share/classes/sun/awt/image/VolatileSurfaceManager.java	Wed Sep 12 12:32:05 2012 -0700
@@ -333,11 +333,12 @@
             // using a SurfaceData that was created in a different
             // display mode.
             sdBackup = null;
-            sdCurrent = getBackupSurface();
             // Now, invalidate the old hardware-based SurfaceData
+            // Note that getBackupSurface may set sdAccel to null so we have to invalidate it before
             SurfaceData oldData = sdAccel;
             sdAccel = null;
             oldData.invalidate();
+            sdCurrent = getBackupSurface();
         }
         // Update graphicsConfig for the vImg in case it changed due to
         // this display change event
--- a/src/share/classes/sun/security/ssl/SSLSocketImpl.java	Wed Sep 05 15:19:51 2012 -0700
+++ b/src/share/classes/sun/security/ssl/SSLSocketImpl.java	Wed Sep 12 12:32:05 2012 -0700
@@ -1576,11 +1576,9 @@
         Throwable cachedThrowable = null;
         try {
             switch (state) {
-            /*
-             * java.net code sometimes closes sockets "early", when
-             * we can't actually do I/O on them.
-             */
             case cs_START:
+                // unconnected socket or handshaking has not been initialized
+                closeSocket(selfInitiated);
                 break;
 
             /*
--- a/src/share/classes/sun/tools/jconsole/AboutDialog.java	Wed Sep 05 15:19:51 2012 -0700
+++ b/src/share/classes/sun/tools/jconsole/AboutDialog.java	Wed Sep 12 12:32:05 2012 -0700
@@ -30,13 +30,12 @@
 import java.beans.PropertyVetoException;
 import java.net.URI;
 
-import javax.accessibility.*;
 import javax.swing.*;
 import javax.swing.border.*;
 import javax.swing.event.*;
 
+
 import static java.awt.BorderLayout.*;
-import static sun.tools.jconsole.Resources.*;
 import static sun.tools.jconsole.Utilities.*;
 
 @SuppressWarnings("serial")
@@ -47,7 +46,7 @@
     private static final Color borderColor   = Color.black;
 
     private Icon mastheadIcon =
-        new MastheadIcon(getText("Help.AboutDialog.masthead.title"));
+        new MastheadIcon(Messages.HELP_ABOUT_DIALOG_MASTHEAD_TITLE);
 
     private static AboutDialog aboutDialog;
 
@@ -55,10 +54,9 @@
     private Action closeAction;
 
     public AboutDialog(JConsole jConsole) {
-        super(jConsole, Resources.getText("Help.AboutDialog.title"), false);
+        super(jConsole, Messages.HELP_ABOUT_DIALOG_TITLE, false);
 
-        setAccessibleDescription(this,
-                                 getText("Help.AboutDialog.accessibleDescription"));
+        setAccessibleDescription(this, Messages.HELP_ABOUT_DIALOG_ACCESSIBLE_DESCRIPTION);
         setDefaultCloseOperation(HIDE_ON_CLOSE);
         setResizable(false);
         JComponent cp = (JComponent)getContentPane();
@@ -67,7 +65,7 @@
 
         JLabel mastheadLabel = new JLabel(mastheadIcon);
         setAccessibleName(mastheadLabel,
-                          getText("Help.AboutDialog.masthead.accessibleName"));
+                Messages.HELP_ABOUT_DIALOG_MASTHEAD_ACCESSIBLE_NAME);
 
         JPanel mainPanel = new TPanel(0, 0);
         mainPanel.add(mastheadLabel, NORTH);
@@ -75,7 +73,7 @@
         String jConsoleVersion = Version.getVersion();
         String vmName = System.getProperty("java.vm.name");
         String vmVersion = System.getProperty("java.vm.version");
-        String urlStr = getText("Help.AboutDialog.userGuideLink.url");
+        String urlStr = Messages.HELP_ABOUT_DIALOG_USER_GUIDE_LINK_URL;
         if (isBrowseSupported()) {
             urlStr = "<a style='color:#35556b' href=\"" + urlStr + "\">" + urlStr + "</a>";
         }
@@ -86,9 +84,9 @@
         String colorStr = String.format("%06x", textColor.getRGB() & 0xFFFFFF);
         JEditorPane helpLink = new JEditorPane("text/html",
                                 "<html><font color=#"+ colorStr + ">" +
-                        getText("Help.AboutDialog.jConsoleVersion", jConsoleVersion) +
-                "<p>" + getText("Help.AboutDialog.javaVersion", (vmName +", "+ vmVersion)) +
-                "<p>" + getText("Help.AboutDialog.userGuideLink", urlStr) +
+                        Resources.format(Messages.HELP_ABOUT_DIALOG_JCONSOLE_VERSION, jConsoleVersion) +
+                "<p>" + Resources.format(Messages.HELP_ABOUT_DIALOG_JAVA_VERSION, (vmName +", "+ vmVersion)) +
+                "<p>" + Resources.format(Messages.HELP_ABOUT_DIALOG_USER_GUIDE_LINK, urlStr) +
                                                  "</html>");
         helpLink.setOpaque(false);
         helpLink.setEditable(false);
@@ -155,7 +153,7 @@
     }
 
     static void browseUserGuide(JConsole jConsole) {
-        getAboutDialog(jConsole).browse(getText("Help.AboutDialog.userGuideLink.url"));
+        getAboutDialog(jConsole).browse(Messages.HELP_ABOUT_DIALOG_USER_GUIDE_LINK_URL);
     }
 
     static boolean isBrowseSupported() {
@@ -176,7 +174,7 @@
     }
 
     private void createActions() {
-        closeAction = new AbstractAction(getText("Close")) {
+        closeAction = new AbstractAction(Messages.CLOSE) {
             public void actionPerformed(ActionEvent ev) {
                 setVisible(false);
                 statusBar.setText("");
--- a/src/share/classes/sun/tools/jconsole/BorderedComponent.java	Wed Sep 05 15:19:51 2012 -0700
+++ b/src/share/classes/sun/tools/jconsole/BorderedComponent.java	Wed Sep 12 12:32:05 2012 -0700
@@ -33,11 +33,10 @@
 import javax.swing.plaf.*;
 import javax.swing.plaf.basic.BasicGraphicsUtils;
 
+
 import static javax.swing.SwingConstants.*;
 
 import static sun.tools.jconsole.JConsole.*;
-import static sun.tools.jconsole.Resources.*;
-import static sun.tools.jconsole.Utilities.*;
 
 @SuppressWarnings("serial")
 public class BorderedComponent extends JPanel implements ActionListener {
@@ -47,8 +46,6 @@
     JComponent comp;
     boolean collapsed = false;
 
-    private JPopupMenu popupMenu;
-
     private Icon collapseIcon;
     private Icon expandIcon;
 
@@ -100,7 +97,7 @@
                 moreOrLessButton.setMargin(new Insets(0, 0, 0, 0));
                 moreOrLessButton.addActionListener(this);
                 String toolTip =
-                    getText("BorderedComponent.moreOrLessButton.toolTip");
+                    Messages.BORDERED_COMPONENT_MORE_OR_LESS_BUTTON_TOOLTIP;
                 moreOrLessButton.setToolTipText(toolTip);
                 borderLabel.add(moreOrLessButton);
                 borderLabel.setSize(borderLabel.getPreferredSize());
@@ -136,7 +133,8 @@
     public void setValueLabel(String str) {
         this.valueLabelStr = str;
         if (label != null) {
-            label.setText(Resources.getText("Current value",valueLabelStr));
+            label.setText(Resources.format(Messages.CURRENT_VALUE,
+                                           valueLabelStr));
         }
     }
 
@@ -151,8 +149,8 @@
             remove(comp);
             if (valueLabelStr != null) {
                 if (label == null) {
-                    label = new JLabel(Resources.getText("Current value",
-                                                         valueLabelStr));
+                    label = new JLabel(Resources.format(Messages.CURRENT_VALUE,
+                                                        valueLabelStr));
                 }
                 add(label);
             }
@@ -439,8 +437,6 @@
          * @param insets the object to be reinitialized
          */
         public Insets getBorderInsets(Component c, Insets insets) {
-            int height = 16;
-
             Border border = getBorder();
             if (border != null) {
                 if (border instanceof AbstractBorder) {
--- a/src/share/classes/sun/tools/jconsole/ClassTab.java	Wed Sep 05 15:19:51 2012 -0700
+++ b/src/share/classes/sun/tools/jconsole/ClassTab.java	Wed Sep 12 12:32:05 2012 -0700
@@ -33,17 +33,11 @@
 
 import javax.swing.*;
 import javax.swing.border.*;
-import javax.swing.event.*;
-import javax.swing.text.*;
 
-import java.util.*;
-import java.util.List;
+
 import java.util.concurrent.*;
 
-import sun.awt.*;
-
 import static sun.tools.jconsole.Formatter.*;
-import static sun.tools.jconsole.Resources.*;
 import static sun.tools.jconsole.Utilities.*;
 
 
@@ -58,13 +52,9 @@
 
     private static final String loadedPlotterKey        = "loaded";
     private static final String totalLoadedPlotterKey   = "totalLoaded";
-    private static final String loadedPlotterName       = Resources.getText("Loaded");
-    private static final String totalLoadedPlotterName  = Resources.getText("Total Loaded");
     private static final Color  loadedPlotterColor      = Plotter.defaultColor;
     private static final Color  totalLoadedPlotterColor = Color.red;
 
-    private static final String infoLabelFormat = "ClassTab.infoLabelFormat";
-
     /*
       Hierarchy of panels and layouts for this tab:
 
@@ -88,7 +78,7 @@
     */
 
     public static String getTabName() {
-        return Resources.getText("Classes");
+        return Messages.CLASSES;
     }
 
     public ClassTab(VMPanel vmPanel) {
@@ -108,40 +98,40 @@
         JPanel controlPanel = new JPanel(new FlowLayout(FlowLayout.CENTER, 20, 5));
         topPanel.add(controlPanel, BorderLayout.CENTER);
 
-        verboseCheckBox = new JCheckBox(Resources.getText("Verbose Output"));
+        verboseCheckBox = new JCheckBox(Messages.VERBOSE_OUTPUT);
         verboseCheckBox.addActionListener(this);
-        verboseCheckBox.setToolTipText(getText("Verbose Output.toolTip"));
+        verboseCheckBox.setToolTipText(Messages.VERBOSE_OUTPUT_TOOLTIP);
         JPanel topRightPanel = new JPanel();
         topRightPanel.setBorder(new EmptyBorder(0, 65-8, 0, 70));
         topRightPanel.add(verboseCheckBox);
         topPanel.add(topRightPanel, BorderLayout.AFTER_LINE_ENDS);
 
-        loadedClassesMeter = new PlotterPanel(Resources.getText("Number of Loaded Classes"),
+        loadedClassesMeter = new PlotterPanel(Messages.NUMBER_OF_LOADED_CLASSES,
                                               Plotter.Unit.NONE, false);
         loadedClassesMeter.plotter.createSequence(loadedPlotterKey,
-                                                  loadedPlotterName,
+                                                  Messages.LOADED,
                                                   loadedPlotterColor,
                                                   true);
         loadedClassesMeter.plotter.createSequence(totalLoadedPlotterKey,
-                                                  totalLoadedPlotterName,
+                                                  Messages.TOTAL_LOADED,
                                                   totalLoadedPlotterColor,
                                                   true);
         setAccessibleName(loadedClassesMeter.plotter,
-                          getText("ClassTab.loadedClassesPlotter.accessibleName"));
+                          Messages.CLASS_TAB_LOADED_CLASSES_PLOTTER_ACCESSIBLE_NAME);
         plotterPanel.add(loadedClassesMeter);
 
         timeComboBox = new TimeComboBox(loadedClassesMeter.plotter);
-        controlPanel.add(new LabeledComponent(Resources.getText("Time Range:"),
-                                              getMnemonicInt("Time Range:"),
+        controlPanel.add(new LabeledComponent(Messages.TIME_RANGE_COLON,
+                                              Resources.getMnemonicInt(Messages.TIME_RANGE_COLON),
                                               timeComboBox));
 
         LabeledComponent.layout(plotterPanel);
 
-        bottomPanel.setBorder(new CompoundBorder(new TitledBorder(Resources.getText("Details")),
-                                                  new EmptyBorder(10, 10, 10, 10)));
+        bottomPanel.setBorder(new CompoundBorder(new TitledBorder(Messages.DETAILS),
+                                                 new EmptyBorder(10, 10, 10, 10)));
 
         details = new HTMLPane();
-        setAccessibleName(details, getText("Details"));
+        setAccessibleName(details, Messages.DETAILS);
         JScrollPane scrollPane = new JScrollPane(details);
         scrollPane.setPreferredSize(new Dimension(0, 150));
         bottomPanel.add(scrollPane, BorderLayout.SOUTH);
@@ -226,10 +216,10 @@
 
                 long time = System.currentTimeMillis();
                 String timeStamp = formatDateTime(time);
-                text += newRow(Resources.getText("Time"), timeStamp);
-                text += newRow(Resources.getText("Current classes loaded"), justify(clCount, 5));
-                text += newRow(Resources.getText("Total classes loaded"),   justify(ctCount, 5));
-                text += newRow(Resources.getText("Total classes unloaded"), justify(cuCount, 5));
+                text += newRow(Messages.TIME, timeStamp);
+                text += newRow(Messages.CURRENT_CLASSES_LOADED, justify(clCount, 5));
+                text += newRow(Messages.TOTAL_CLASSES_LOADED,   justify(ctCount, 5));
+                text += newRow(Messages.TOTAL_CLASSES_UNLOADED, justify(cuCount, 5));
 
                 return text;
             }
@@ -246,12 +236,13 @@
 
     private static class ClassOverviewPanel extends OverviewPanel {
         ClassOverviewPanel() {
-            super(getText("Classes"), loadedPlotterKey, loadedPlotterName, null);
+            super(Messages.CLASSES, loadedPlotterKey, Messages.LOADED, null);
         }
 
         private void updateClassInfo(long total, long loaded) {
             long unloaded = (total - loaded);
-            getInfoLabel().setText(getText(infoLabelFormat, loaded, unloaded, total));
+            getInfoLabel().setText(Resources.format(Messages.CLASS_TAB_INFO_LABEL_FORMAT,
+                                   loaded, unloaded, total));
         }
     }
 }
--- a/src/share/classes/sun/tools/jconsole/ConnectDialog.java	Wed Sep 05 15:19:51 2012 -0700
+++ b/src/share/classes/sun/tools/jconsole/ConnectDialog.java	Wed Sep 12 12:32:05 2012 -0700
@@ -29,23 +29,17 @@
 import java.awt.*;
 import java.awt.event.*;
 import java.util.*;
-import java.net.MalformedURLException;
-import java.io.IOException;
 
-import javax.accessibility.*;
 import javax.swing.*;
-import javax.swing.Timer;
 import javax.swing.border.*;
 import javax.swing.event.*;
 import javax.swing.plaf.basic.BasicRadioButtonUI;
 import javax.swing.table.*;
 
-import javax.management.remote.JMXServiceURL;
-import javax.management.remote.JMXConnector;
+
 
 import static java.awt.BorderLayout.*;
 import static javax.swing.ListSelectionModel.*;
-import static sun.tools.jconsole.Resources.*;
 import static sun.tools.jconsole.Utilities.*;
 
 @SuppressWarnings("serial")
@@ -66,7 +60,7 @@
     JPanel radioButtonPanel;
 
     private Icon mastheadIcon =
-        new MastheadIcon(getText("ConnectDialog.masthead.title"));
+        new MastheadIcon(Messages.CONNECT_DIALOG_MASTHEAD_TITLE);
     private Color hintTextColor, disabledTableCellColor;
 
     // The table of managed VM (local process)
@@ -79,11 +73,11 @@
 
 
     public ConnectDialog(JConsole jConsole) {
-        super(jConsole, Resources.getText("ConnectDialog.title"), true);
+        super(jConsole, Messages.CONNECT_DIALOG_TITLE, true);
 
         this.jConsole = jConsole;
         setAccessibleDescription(this,
-                                 getText("ConnectDialog.accessibleDescription"));
+                                 Messages.CONNECT_DIALOG_ACCESSIBLE_DESCRIPTION);
         setDefaultCloseOperation(HIDE_ON_CLOSE);
         setResizable(false);
         Container cp = (JComponent)getContentPane();
@@ -95,7 +89,7 @@
 
         statusBar = new JLabel(" ", JLabel.CENTER);
         setAccessibleName(statusBar,
-                          getText("ConnectDialog.statusBar.accessibleName"));
+                          Messages.CONNECT_DIALOG_STATUS_BAR_ACCESSIBLE_NAME);
 
         Font normalLabelFont = statusBar.getFont();
         Font boldLabelFont = normalLabelFont.deriveFont(Font.BOLD);
@@ -103,7 +97,7 @@
 
         JLabel mastheadLabel = new JLabel(mastheadIcon);
         setAccessibleName(mastheadLabel,
-                          getText("ConnectDialog.masthead.accessibleName"));
+                          Messages.CONNECT_DIALOG_MASTHEAD_ACCESSIBLE_NAME);
 
         cp.add(mastheadLabel, NORTH);
         cp.add(radioButtonPanel, CENTER);
@@ -117,7 +111,7 @@
         remoteTF.addFocusListener(this);
         remoteTF.setPreferredSize(remoteTF.getPreferredSize());
         setAccessibleName(remoteTF,
-                          getText("Remote Process.textField.accessibleName"));
+                          Messages.REMOTE_PROCESS_TEXT_FIELD_ACCESSIBLE_NAME);
 
         //
         // If the VM supports the local attach mechanism (is: Sun
@@ -141,8 +135,8 @@
             TableColumn cmdLineColumn = columnModel.getColumn(COL_NAME);
             cmdLineColumn.setResizable(false);
 
-            localRadioButton = new JRadioButton(getText("Local Process:"));
-            localRadioButton.setMnemonic(getMnemonicInt("Local Process:"));
+            localRadioButton = new JRadioButton(Messages.LOCAL_PROCESS_COLON);
+            localRadioButton.setMnemonic(Resources.getMnemonicInt(Messages.LOCAL_PROCESS_COLON));
             localRadioButton.setFont(boldLabelFont);
             localRadioButton.addItemListener(this);
             radioButtonGroup.add(localRadioButton);
@@ -167,8 +161,8 @@
             localTablePanel.add(localMessageLabel, SOUTH);
         }
 
-        remoteRadioButton = new JRadioButton(getText("Remote Process:"));
-        remoteRadioButton.setMnemonic(getMnemonicInt("Remote Process:"));
+        remoteRadioButton = new JRadioButton(Messages.REMOTE_PROCESS_COLON);
+        remoteRadioButton.setMnemonic(Resources.getMnemonicInt(Messages.REMOTE_PROCESS_COLON));
         remoteRadioButton.setFont(boldLabelFont);
         radioButtonGroup.add(remoteRadioButton);
 
@@ -207,7 +201,7 @@
 
         remoteTFPanel.add(remoteTF, NORTH);
 
-        remoteMessageLabel = new JLabel("<html>" + getText("remoteTF.usage"));
+        remoteMessageLabel = new JLabel("<html>" + Messages.REMOTE_TF_USAGE + "</html>");
         remoteMessageLabel.setFont(smallLabelFont);
         remoteMessageLabel.setForeground(hintTextColor);
         remoteTFPanel.add(remoteMessageLabel, CENTER);
@@ -222,11 +216,10 @@
         userNameTF.getDocument().addDocumentListener(this);
         userNameTF.addFocusListener(this);
         setAccessibleName(userNameTF,
-                          getText("Username.accessibleName"));
-        String labelKey = "Username: ";
+            Messages.USERNAME_ACCESSIBLE_NAME);
         LabeledComponent lc;
-        lc = new LabeledComponent(getText(labelKey),
-                                  getMnemonicInt(labelKey),
+        lc = new LabeledComponent(Messages.USERNAME_COLON_,
+                                  Resources.getMnemonicInt(Messages.USERNAME_COLON_),
                                   userNameTF);
         lc.label.setFont(boldLabelFont);
         userPwdPanel.add(lc);
@@ -238,10 +231,10 @@
         passwordTF.getDocument().addDocumentListener(this);
         passwordTF.addFocusListener(this);
         setAccessibleName(passwordTF,
-                          getText("Password.accessibleName"));
-        labelKey = "Password: ";
-        lc = new LabeledComponent(getText(labelKey),
-                                  getMnemonicInt(labelKey),
+            Messages.PASSWORD_ACCESSIBLE_NAME);
+
+        lc = new LabeledComponent(Messages.PASSWORD_COLON_,
+                                  Resources.getMnemonicInt(Messages.PASSWORD_COLON_),
                                   passwordTF);
         lc.setBorder(new EmptyBorder(0, 12, 0, 0)); // Left padding
         lc.label.setFont(boldLabelFont);
@@ -250,7 +243,7 @@
         remoteTFPanel.add(userPwdPanel, SOUTH);
 
         String connectButtonToolTipText =
-            getText("ConnectDialog.connectButton.toolTip");
+            Messages.CONNECT_DIALOG_CONNECT_BUTTON_TOOLTIP;
         connectButton = new JButton(connectAction);
         connectButton.setToolTipText(connectButtonToolTipText);
 
@@ -288,7 +281,7 @@
             String colorStr =
                 String.format("%06x", hintTextColor.getRGB() & 0xFFFFFF);
             remoteMessageLabel.setText("<html><font color=#" + colorStr + ">" +
-                                       getText("remoteTF.usage"));
+                                       Messages.REMOTE_TF_USAGE);
         }
         if (localMessageLabel != null) {
             localMessageLabel.setForeground(hintTextColor);
@@ -300,9 +293,9 @@
     }
 
     private void createActions() {
-        connectAction = new AbstractAction(getText("Connect")) {
+        connectAction = new AbstractAction(Messages.CONNECT) {
             /* init */ {
-                putValue(Action.MNEMONIC_KEY, getMnemonicInt("Connect"));
+                putValue(Action.MNEMONIC_KEY, Resources.getMnemonicInt(Messages.CONNECT));
             }
 
             public void actionPerformed(ActionEvent ev) {
@@ -321,7 +314,6 @@
                     try {
                         if (txt.startsWith(JConsole.ROOT_URL)) {
                             String url = txt;
-                            String msg = null;
                             jConsole.addUrl(url, userName, password, false);
                             remoteTF.setText(JConsole.ROOT_URL);
                             return;
@@ -361,7 +353,7 @@
             }
         };
 
-        cancelAction = new AbstractAction(getText("Cancel")) {
+        cancelAction = new AbstractAction(Messages.CANCEL) {
             public void actionPerformed(ActionEvent ev) {
                 setVisible(false);
                 statusBar.setText("");
@@ -588,9 +580,9 @@
             LocalVirtualMachine lvm = vmModel.vmAt(row);
             if (!lvm.isManageable()) {
                 if (lvm.isAttachable()) {
-                    labelText = getText("Management Will Be Enabled");
+                    labelText = Messages.MANAGEMENT_WILL_BE_ENABLED;
                 } else {
-                    labelText = getText("Management Not Enabled");
+                    labelText = Messages.MANAGEMENT_NOT_ENABLED;
                 }
             }
         }
@@ -650,8 +642,8 @@
     // Represents the list of managed VMs as a tabular data model.
     private static class ManagedVmTableModel extends AbstractTableModel {
         private static String[] columnNames = {
-            Resources.getText("Column.Name"),
-            Resources.getText("Column.PID"),
+            Messages.COLUMN_NAME,
+            Messages.COLUMN_PID,
         };
 
         private List<LocalVirtualMachine> vmList;
@@ -678,7 +670,7 @@
             }
         }
 
-        public Class getColumnClass(int column) {
+        public Class<?> getColumnClass(int column) {
             switch (column) {
                 case COL_NAME: return String.class;
                 case COL_PID:  return Integer.class;
@@ -706,13 +698,6 @@
         }
     }
 
-
-    // Convenience method
-    private static String getText(String key) {
-        return Resources.getText(key);
-    }
-
-
     // A blank component that takes up as much space as the
     // button part of a JRadioButton.
     private static class Padder extends JPanel {
@@ -721,7 +706,7 @@
         Padder(JRadioButton radioButton) {
             this.radioButton = radioButton;
 
-            setAccessibleName(this, getText("Blank"));
+            setAccessibleName(this, Messages.BLANK);
         }
 
         public Dimension getPreferredSize() {
@@ -758,7 +743,6 @@
             if (g == null) {
                 return null;
             }
-            String clippedText =
                 SwingUtilities.layoutCompoundLabel(button,
                                                    g.getFontMetrics(),
                                                    text,
--- a/src/share/classes/sun/tools/jconsole/CreateMBeanDialog.java	Wed Sep 05 15:19:51 2012 -0700
+++ b/src/share/classes/sun/tools/jconsole/CreateMBeanDialog.java	Wed Sep 12 12:32:05 2012 -0700
@@ -32,23 +32,21 @@
 import java.util.Comparator;
 
 import javax.swing.*;
-import javax.swing.Timer;
 import javax.swing.border.*;
-import javax.swing.event.*;
 
 import javax.management.MBeanServerConnection;
 import javax.management.ObjectName;
 import javax.management.InstanceAlreadyExistsException;
 import javax.management.InstanceNotFoundException;
 
-import static sun.tools.jconsole.Resources.*;
+
 import static sun.tools.jconsole.Utilities.*;
 
 @SuppressWarnings("serial")
 public class CreateMBeanDialog extends InternalDialog
                 implements ActionListener {
     JConsole jConsole;
-    JComboBox connections;
+    JComboBox<ProxyClient> connections;
     JButton createMBeanButton, unregisterMBeanButton, cancelButton;
 
     private static final String HOTSPOT_MBEAN =
@@ -60,7 +58,7 @@
 
         this.jConsole = jConsole;
         setAccessibleDescription(this,
-                                 getText("Hotspot MBeans.dialog.accessibleDescription"));
+                                 Messages.HOTSPOT_MBEANS_DIALOG_ACCESSIBLE_DESCRIPTION);
         Container cp = getContentPane();
         ((JComponent)cp).setBorder(new EmptyBorder(10, 10, 4, 10));
 
@@ -71,12 +69,10 @@
                                                         false,
                                                         true));
         cp.add(centerPanel, BorderLayout.CENTER);
-        connections = new JComboBox();
+        connections = new JComboBox<ProxyClient>();
         updateConnections();
 
-        centerPanel.add(new LabeledComponent(Resources.
-                                             getText("Manage Hotspot MBeans "+
-                                                     "in: "),
+        centerPanel.add(new LabeledComponent(Resources.format(Messages.MANAGE_HOTSPOT_MBEANS_IN_COLON_),
                                              connections));
 
         JPanel bottomPanel = new JPanel(new BorderLayout());
@@ -85,11 +81,11 @@
         JPanel buttonPanel = new JPanel();
         bottomPanel.add(buttonPanel, BorderLayout.NORTH);
         buttonPanel.add(createMBeanButton =
-                        new JButton(Resources.getText("Create")));
+                        new JButton(Messages.CREATE));
         buttonPanel.add(unregisterMBeanButton =
-                        new JButton(Resources.getText("Unregister")));
+                        new JButton(Messages.UNREGISTER));
         buttonPanel.add(cancelButton =
-                        new JButton(Resources.getText("Cancel")));
+                        new JButton(Messages.CANCEL));
 
         statusBar = new JLabel(" ", JLabel.CENTER);
         bottomPanel.add(statusBar, BorderLayout.SOUTH);
@@ -133,7 +129,8 @@
             }
         }
         connections.invalidate();
-        connections.setModel(new DefaultComboBoxModel(data.toArray()));
+        connections.setModel(new DefaultComboBoxModel<ProxyClient>
+            (data.toArray(new ProxyClient[data.size()])));
         connections.validate();
     }
 
@@ -144,7 +141,6 @@
             new Thread("CreateMBeanDialog.actionPerformed") {
                     public void run() {
                         try {
-                            StringBuffer buff = null;
                             Object c = connections.getSelectedItem();
                             if(c == null) return;
                             if(ev.getSource() == createMBeanButton) {
@@ -163,13 +159,9 @@
                             }
                             return;
                         } catch(InstanceAlreadyExistsException e) {
-                            statusBar.setText(Resources.
-                                              getText("Error: MBeans already "
-                                                      + "exist"));
+                            statusBar.setText(Messages.ERROR_COLON_MBEANS_ALREADY_EXIST);
                         } catch(InstanceNotFoundException e) {
-                            statusBar.setText(Resources.
-                                              getText("Error: MBeans do not "
-                                                      + "exist"));
+                            statusBar.setText(Messages.ERROR_COLON_MBEANS_DO_NOT_EXIST);
                         } catch(Exception e) {
                             statusBar.setText(e.toString());
                         }
--- a/src/share/classes/sun/tools/jconsole/Formatter.java	Wed Sep 05 15:19:51 2012 -0700
+++ b/src/share/classes/sun/tools/jconsole/Formatter.java	Wed Sep 12 12:32:05 2012 -0700
@@ -28,7 +28,6 @@
 import java.text.*;
 import java.util.*;
 
-import static sun.tools.jconsole.Resources.*;
 
 class Formatter {
     final static long SECOND = 1000;
@@ -48,7 +47,7 @@
         String str;
         if (t < 1 * MINUTE) {
             String seconds = String.format("%.3f", t / (double)SECOND);
-            str = Resources.getText("DurationSeconds", seconds);
+            str = Resources.format(Messages.DURATION_SECONDS, seconds);
         } else {
             long remaining = t;
             long days = remaining / DAY;
@@ -58,13 +57,13 @@
             long minutes = remaining / MINUTE;
 
             if (t >= 1 * DAY) {
-                str = Resources.getText("DurationDaysHoursMinutes",
-                                        days, hours, minutes);
+                str = Resources.format(Messages.DURATION_DAYS_HOURS_MINUTES,
+                                       days, hours, minutes);
             } else if (t >= 1 * HOUR) {
-                str = Resources.getText("DurationHoursMinutes",
-                                        hours, minutes);
+                str = Resources.format(Messages.DURATION_HOURS_MINUTES,
+                                       hours, minutes);
             } else {
-                str = Resources.getText("DurationMinutes", minutes);
+                str = Resources.format(Messages.DURATION_MINUTES, minutes);
             }
         }
         return str;
@@ -88,8 +87,7 @@
         return dateDF.format(time) + " " + timeWithSecondsDF.format(time);
     }
 
-    static DateFormat getDateTimeFormat(String key) {
-        String dtfStr = getText(key);
+    static DateFormat getDateTimeFormat(String dtfStr) {
         int dateStyle = -1;
         int timeStyle = -1;
 
@@ -153,18 +151,18 @@
         }
         String[] strings = formatLongs(bytes);
         for (int i = 0; i < n; i++) {
-            strings[i] = getText("kbytes", strings[i]);
+            strings[i] = Resources.format(Messages.KBYTES, strings[i]);
         }
         return strings;
     }
 
     static String formatKBytes(long bytes) {
         if (bytes == -1) {
-            return getText("kbytes", "-1");
+            return Resources.format(Messages.KBYTES, "-1");
         }
 
         long kb = bytes / 1024;
-        return getText("kbytes", justify(kb, 10));
+        return Resources.format(Messages.KBYTES, justify(kb, 10));
     }
 
 
@@ -182,13 +180,13 @@
         int exp = (int)Math.log10((double)vMax);
 
         if (exp < 3) {
-            s = Resources.getText("Size Bytes", v);
+            s = Resources.format(Messages.SIZE_BYTES, v);
         } else if (exp < 6) {
-            s = Resources.getText("Size Kb", trimDouble(v / Math.pow(10.0, 3)));
+            s = Resources.format(Messages.SIZE_KB, trimDouble(v / Math.pow(10.0, 3)));
         } else if (exp < 9) {
-            s = Resources.getText("Size Mb", trimDouble(v / Math.pow(10.0, 6)));
+            s = Resources.format(Messages.SIZE_MB, trimDouble(v / Math.pow(10.0, 6)));
         } else {
-            s = Resources.getText("Size Gb", trimDouble(v / Math.pow(10.0, 9)));
+            s = Resources.format(Messages.SIZE_GB, trimDouble(v / Math.pow(10.0, 9)));
         }
         if (html) {
             s = s.replace(" ", "&nbsp;");
--- a/src/share/classes/sun/tools/jconsole/HTMLPane.java	Wed Sep 05 15:19:51 2012 -0700
+++ b/src/share/classes/sun/tools/jconsole/HTMLPane.java	Wed Sep 12 12:32:05 2012 -0700
@@ -25,8 +25,6 @@
 
 package sun.tools.jconsole;
 
-import java.awt.Color;
-
 import javax.swing.*;
 import javax.swing.event.*;
 import javax.swing.text.*;
--- a/src/share/classes/sun/tools/jconsole/InternalDialog.java	Wed Sep 05 15:19:51 2012 -0700
+++ b/src/share/classes/sun/tools/jconsole/InternalDialog.java	Wed Sep 12 12:32:05 2012 -0700
@@ -30,8 +30,8 @@
 
 import javax.swing.*;
 
+
 import static javax.swing.JLayeredPane.*;
-import static sun.tools.jconsole.Resources.*;
 
 /**
  * Used instead of JDialog in a JDesktopPane/JInternalFrame environment.
@@ -73,7 +73,7 @@
         private ImageIcon rightIcon =
             new ImageIcon(InternalDialog.class.getResource("resources/masthead-right.png"));
 
-        private Font font = Font.decode(getText("Masthead.font"));
+        private Font font = Font.decode(Messages.MASTHEAD_FONT);
         private int gap = 10;
         private String title;
 
--- a/src/share/classes/sun/tools/jconsole/JConsole.java	Wed Sep 05 15:19:51 2012 -0700
+++ b/src/share/classes/sun/tools/jconsole/JConsole.java	Wed Sep 12 12:32:05 2012 -0700
@@ -29,7 +29,6 @@
 import java.awt.event.*;
 import java.beans.*;
 import java.io.*;
-import java.lang.reflect.InvocationTargetException;
 import java.net.*;
 import java.util.*;
 import java.util.List;
@@ -38,8 +37,6 @@
 import javax.swing.border.*;
 import javax.swing.event.*;
 import javax.swing.plaf.*;
-import javax.management.remote.JMXServiceURL;
-import javax.management.remote.JMXConnector;
 import javax.security.auth.login.FailedLoginException;
 import javax.net.ssl.SSLHandshakeException;
 
@@ -47,7 +44,6 @@
 
 import sun.net.util.IPAddressUtil;
 
-import static sun.tools.jconsole.Resources.*;
 import static sun.tools.jconsole.Utilities.*;
 
 @SuppressWarnings("serial")
@@ -68,7 +64,7 @@
                 try {
                     UIManager.setLookAndFeel(systemLaF);
                 } catch (Exception e) {
-                    System.err.println(Resources.getText("JConsole: ", e.getMessage()));
+                    System.err.println(Resources.format(Messages.JCONSOLE_COLON_, e.getMessage()));
                 }
             }
         }
@@ -87,7 +83,7 @@
 
 
     private final static String title =
-        Resources.getText("Java Monitoring & Management Console");
+        Messages.JAVA_MONITORING___MANAGEMENT_CONSOLE;
     public final static String ROOT_URL =
         "service:jmx:";
 
@@ -116,7 +112,7 @@
 
         setRootPane(new FixedJRootPane());
         setAccessibleDescription(this,
-                                 getText("JConsole.accessibleDescription"));
+                                 Messages.JCONSOLE_ACCESSIBLE_DESCRIPTION);
         setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
 
         menuBar = new JMenuBar();
@@ -124,12 +120,12 @@
 
         // TODO: Use Actions !
 
-        JMenu connectionMenu = new JMenu(getText("Connection"));
-        connectionMenu.setMnemonic(getMnemonicInt("Connection"));
+        JMenu connectionMenu = new JMenu(Messages.CONNECTION);
+        connectionMenu.setMnemonic(Resources.getMnemonicInt(Messages.CONNECTION));
         menuBar.add(connectionMenu);
         if(hotspot) {
-            hotspotMI = new JMenuItem(getText("Hotspot MBeans..."));
-            hotspotMI.setMnemonic(getMnemonicInt("Hotspot MBeans..."));
+            hotspotMI = new JMenuItem(Messages.HOTSPOT_MBEANS_ELLIPSIS);
+            hotspotMI.setMnemonic(Resources.getMnemonicInt(Messages.HOTSPOT_MBEANS_ELLIPSIS));
             hotspotMI.setAccelerator(KeyStroke.
                                      getKeyStroke(KeyEvent.VK_H,
                                                   InputEvent.CTRL_MASK));
@@ -139,8 +135,8 @@
             connectionMenu.addSeparator();
         }
 
-        connectMI = new JMenuItem(Resources.getText("New Connection..."));
-        connectMI.setMnemonic(getMnemonicInt("New Connection..."));
+        connectMI = new JMenuItem(Messages.NEW_CONNECTION_ELLIPSIS);
+        connectMI.setMnemonic(Resources.getMnemonicInt(Messages.NEW_CONNECTION_ELLIPSIS));
         connectMI.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_N,
                                                         InputEvent.CTRL_MASK));
         connectMI.addActionListener(this);
@@ -148,27 +144,27 @@
 
         connectionMenu.addSeparator();
 
-        exitMI = new JMenuItem(Resources.getText("Exit"));
-        exitMI.setMnemonic(getMnemonicInt("Exit"));
+        exitMI = new JMenuItem(Messages.EXIT);
+        exitMI.setMnemonic(Resources.getMnemonicInt(Messages.EXIT));
         exitMI.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_F4,
                                                      InputEvent.ALT_MASK));
         exitMI.addActionListener(this);
         connectionMenu.add(exitMI);
 
 
-        JMenu helpMenu = new JMenu(getText("HelpMenu.title"));
-        helpMenu.setMnemonic(getMnemonicInt("HelpMenu.title"));
+        JMenu helpMenu = new JMenu(Messages.HELP_MENU_TITLE);
+        helpMenu.setMnemonic(Resources.getMnemonicInt(Messages.HELP_MENU_TITLE));
         menuBar.add(helpMenu);
 
         if (AboutDialog.isBrowseSupported()) {
-            userGuideMI = new JMenuItem(getText("HelpMenu.UserGuide.title"));
-            userGuideMI.setMnemonic(getMnemonicInt("HelpMenu.UserGuide.title"));
+            userGuideMI = new JMenuItem(Messages.HELP_MENU_USER_GUIDE_TITLE);
+            userGuideMI.setMnemonic(Resources.getMnemonicInt(Messages.HELP_MENU_USER_GUIDE_TITLE));
             userGuideMI.addActionListener(this);
             helpMenu.add(userGuideMI);
             helpMenu.addSeparator();
         }
-        aboutMI = new JMenuItem(getText("HelpMenu.About.title"));
-        aboutMI.setMnemonic(getMnemonicInt("HelpMenu.About.title"));
+        aboutMI = new JMenuItem(Messages.HELP_MENU_ABOUT_TITLE);
+        aboutMI.setMnemonic(Resources.getMnemonicInt(Messages.HELP_MENU_ABOUT_TITLE));
         aboutMI.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_F1, 0));
         aboutMI.addActionListener(this);
         helpMenu.add(aboutMI);
@@ -191,8 +187,8 @@
             ((BorderLayout)cp.getLayout()).
             getLayoutComponent(BorderLayout.CENTER);
 
-        windowMenu = new WindowMenu(Resources.getText("Window"));
-        windowMenu.setMnemonic(getMnemonicInt("Window"));
+        windowMenu = new WindowMenu(Messages.WINDOW);
+        windowMenu.setMnemonic(Resources.getMnemonicInt(Messages.WINDOW));
         // Add Window menu before Help menu
         menuBar.add(windowMenu, menuBar.getComponentCount() - 1);
 
@@ -219,25 +215,25 @@
         WindowMenu(String text) {
             super(text);
 
-            cascadeMI = new JMenuItem(Resources.getText("Cascade"));
-            cascadeMI.setMnemonic(getMnemonicInt("Cascade"));
+            cascadeMI = new JMenuItem(Messages.CASCADE);
+            cascadeMI.setMnemonic(Resources.getMnemonicInt(Messages.CASCADE));
             cascadeMI.addActionListener(JConsole.this);
             add(cascadeMI);
 
-            tileMI = new JMenuItem(Resources.getText("Tile"));
-            tileMI.setMnemonic(getMnemonicInt("Tile"));
+            tileMI = new JMenuItem(Messages.TILE);
+            tileMI.setMnemonic(Resources.getMnemonicInt(Messages.TILE));
             tileMI.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_T,
                                                          InputEvent.CTRL_MASK));
             tileMI.addActionListener(JConsole.this);
             add(tileMI);
 
-            minimizeAllMI = new JMenuItem(Resources.getText("Minimize All"));
-            minimizeAllMI.setMnemonic(getMnemonicInt("Minimize All"));
+            minimizeAllMI = new JMenuItem(Messages.MINIMIZE_ALL);
+            minimizeAllMI.setMnemonic(Resources.getMnemonicInt(Messages.MINIMIZE_ALL));
             minimizeAllMI.addActionListener(JConsole.this);
             add(minimizeAllMI);
 
-            restoreAllMI = new JMenuItem(Resources.getText("Restore All"));
-            restoreAllMI.setMnemonic(getMnemonicInt("Restore All"));
+            restoreAllMI = new JMenuItem(Messages.RESTORE_ALL);
+            restoreAllMI.setMnemonic(Resources.getMnemonicInt(Messages.RESTORE_ALL));
             restoreAllMI.addActionListener(JConsole.this);
             add(restoreAllMI);
 
@@ -721,7 +717,7 @@
     }
 
     private String errorMessage(Exception ex) {
-       String msg = Resources.getText("Connection failed");
+       String msg = Messages.CONNECTION_FAILED;
        if (ex instanceof IOException || ex instanceof SecurityException) {
            Throwable cause = null;
            Throwable c = ex.getCause();
@@ -732,7 +728,7 @@
            if (cause instanceof ConnectException) {
                return msg + ": " + cause.getMessage();
            } else if (cause instanceof UnknownHostException) {
-               return Resources.getText("Unknown Host", cause.getMessage());
+               return Resources.format(Messages.UNKNOWN_HOST, cause.getMessage());
            } else if (cause instanceof NoRouteToHostException) {
                return msg + ": " + cause.getMessage();
            } else if (cause instanceof FailedLoginException) {
@@ -741,7 +737,7 @@
                return msg + ": "+ cause.getMessage();
            }
         } else if (ex instanceof MalformedURLException) {
-           return Resources.getText("Invalid URL", ex.getMessage());
+           return Resources.format(Messages.INVALID_URL, ex.getMessage());
         }
         return msg + ": " + ex.getMessage();
     }
@@ -770,7 +766,7 @@
 
 
     private static void usage() {
-        System.err.println(Resources.getText("zz usage text", "jconsole"));
+        System.err.println(Resources.format(Messages.ZZ_USAGE_TEXT, "jconsole"));
     }
 
     private static void mainInit(final List<String> urls,
@@ -1003,13 +999,13 @@
                 pluginService = plugins;
             } catch (ServiceConfigurationError e) {
                 // Error occurs during initialization of plugin
-                System.out.println(Resources.getText("Fail to load plugin",
+                System.out.println(Resources.format(Messages.FAIL_TO_LOAD_PLUGIN,
                                    e.getMessage()));
             } catch (MalformedURLException e) {
                 if (JConsole.isDebug()) {
                     e.printStackTrace();
                 }
-                System.out.println(Resources.getText("Invalid plugin path",
+                System.out.println(Resources.format(Messages.INVALID_PLUGIN_PATH,
                                    e.getMessage()));
             }
         }
--- a/src/share/classes/sun/tools/jconsole/LabeledComponent.java	Wed Sep 05 15:19:51 2012 -0700
+++ b/src/share/classes/sun/tools/jconsole/LabeledComponent.java	Wed Sep 12 12:32:05 2012 -0700
@@ -26,7 +26,6 @@
 package sun.tools.jconsole;
 
 import java.awt.*;
-import java.awt.event.*;
 
 import javax.swing.*;
 
--- a/src/share/classes/sun/tools/jconsole/LocalVirtualMachine.java	Wed Sep 05 15:19:51 2012 -0700
+++ b/src/share/classes/sun/tools/jconsole/LocalVirtualMachine.java	Wed Sep 12 12:32:05 2012 -0700
@@ -39,7 +39,6 @@
 // Sun private
 import sun.management.ConnectorAddressLink;
 import sun.jvmstat.monitor.HostIdentifier;
-import sun.jvmstat.monitor.Monitor;
 import sun.jvmstat.monitor.MonitoredHost;
 import sun.jvmstat.monitor.MonitoredVm;
 import sun.jvmstat.monitor.MonitoredVmUtil;
@@ -131,7 +130,7 @@
 
     private static void getMonitoredVMs(Map<Integer, LocalVirtualMachine> map) {
         MonitoredHost host;
-        Set vms;
+        Set<Integer> vms;
         try {
             host = MonitoredHost.getMonitoredHost(new HostIdentifier((String)null));
             vms = host.activeVms();
--- a/src/share/classes/sun/tools/jconsole/MBeansTab.java	Wed Sep 05 15:19:51 2012 -0700
+++ b/src/share/classes/sun/tools/jconsole/MBeansTab.java	Wed Sep 12 12:32:05 2012 -0700
@@ -52,7 +52,7 @@
     private XDataViewer viewer;
 
     public static String getTabName() {
-        return Resources.getText("MBeans");
+        return Messages.MBEANS;
     }
 
     public MBeansTab(final VMPanel vmPanel) {
--- a/src/share/classes/sun/tools/jconsole/MaximizableInternalFrame.java	Wed Sep 05 15:19:51 2012 -0700
+++ b/src/share/classes/sun/tools/jconsole/MaximizableInternalFrame.java	Wed Sep 12 12:32:05 2012 -0700
@@ -222,7 +222,7 @@
     static {
         if (JConsole.IS_WIN) {
             try {
-                Class Part =
+                Class<?> Part =
                     Class.forName("com.sun.java.swing.plaf.windows.TMSchema$Part");
                 if (Part != null) {
                     WP_MINBUTTON        = Part.getField("WP_MINBUTTON").get(null);
--- a/src/share/classes/sun/tools/jconsole/MemoryPoolProxy.java	Wed Sep 05 15:19:51 2012 -0700
+++ b/src/share/classes/sun/tools/jconsole/MemoryPoolProxy.java	Wed Sep 12 12:32:05 2012 -0700
@@ -26,7 +26,6 @@
 package sun.tools.jconsole;
 
 import javax.management.ObjectName;
-import java.lang.management.ManagementFactory;
 import java.lang.management.MemoryPoolMXBean;
 import java.lang.management.MemoryUsage;
 import com.sun.management.GarbageCollectorMXBean;
@@ -34,21 +33,18 @@
 import java.util.HashMap;
 import java.util.Set;
 import java.util.Map;
-import java.util.Map.Entry;
 
 import static java.lang.management.ManagementFactory.*;
 
 public class MemoryPoolProxy {
     private String poolName;
     private ProxyClient client;
-    private ObjectName  objName;
     private MemoryPoolMXBean pool;
     private Map<ObjectName,Long> gcMBeans;
     private GcInfo lastGcInfo;
 
     public MemoryPoolProxy(ProxyClient client, ObjectName poolName) throws java.io.IOException {
         this.client = client;
-        this.objName = objName;
         this.pool = client.getMXBean(poolName, MemoryPoolMXBean.class);
         this.poolName = this.pool.getName();
         this.gcMBeans = new HashMap<ObjectName,Long>();
@@ -73,10 +69,6 @@
         return (gcMBeans.size() != 0);
     }
 
-    public ObjectName getObjectName() {
-        return objName;
-    }
-
     public MemoryPoolStat getStat() throws java.io.IOException {
         long usageThreshold = (pool.isUsageThresholdSupported()
                                   ? pool.getUsageThreshold()
--- a/src/share/classes/sun/tools/jconsole/MemoryPoolStat.java	Wed Sep 05 15:19:51 2012 -0700
+++ b/src/share/classes/sun/tools/jconsole/MemoryPoolStat.java	Wed Sep 12 12:32:05 2012 -0700
@@ -129,6 +129,6 @@
      * null if no GC occurs.
      */
     public MemoryUsage getAfterGcUsage() {
-        return beforeGcUsage;
+        return afterGcUsage;
     }
 }
--- a/src/share/classes/sun/tools/jconsole/MemoryTab.java	Wed Sep 05 15:19:51 2012 -0700
+++ b/src/share/classes/sun/tools/jconsole/MemoryTab.java	Wed Sep 12 12:32:05 2012 -0700
@@ -38,18 +38,14 @@
 import javax.management.openmbean.CompositeData;
 import javax.swing.*;
 import javax.swing.border.*;
-import javax.swing.text.*;
 
-import sun.management.*;
 
 import static sun.tools.jconsole.Formatter.*;
-import static sun.tools.jconsole.OverviewPanel.*;
-import static sun.tools.jconsole.Resources.*;
 import static sun.tools.jconsole.Utilities.*;
 
 @SuppressWarnings("serial")
 class MemoryTab extends Tab implements ActionListener, ItemListener {
-    JComboBox plotterChoice;
+    JComboBox<Plotter> plotterChoice;
     TimeComboBox timeComboBox;
     JButton gcButton;
 
@@ -67,19 +63,11 @@
     private static final String committedKey   = "committed";
     private static final String maxKey         = "max";
     private static final String thresholdKey   = "threshold";
-
-    private static final String usedName        = Resources.getText("Used");
-    private static final String committedName   = Resources.getText("Committed");
-    private static final String maxName         = Resources.getText("Max");
-    private static final String thresholdName   = Resources.getText("Threshold");
-
     private static final Color  usedColor      = Plotter.defaultColor;
     private static final Color  committedColor = null;
     private static final Color  maxColor       = null;
     private static final Color  thresholdColor = Color.red;
 
-    private static final String infoLabelFormat = "MemoryTab.infoLabelFormat";
-
     /*
       Hierarchy of panels and layouts for this tab:
 
@@ -105,7 +93,7 @@
 
 
     public static String getTabName() {
-        return getText("Memory");
+        return Messages.MEMORY;
     }
 
     public MemoryTab(VMPanel vmPanel) {
@@ -125,32 +113,32 @@
         topPanel.add(controlPanel, BorderLayout.CENTER);
 
         // Plotter choice
-        plotterChoice = new JComboBox();
+        plotterChoice = new JComboBox<Plotter>();
         plotterChoice.addItemListener(this);
-        controlPanel.add(new LabeledComponent(getText("Chart:"),
-                                              getMnemonicInt("Chart:"),
+        controlPanel.add(new LabeledComponent(Messages.CHART_COLON,
+                                              Resources.getMnemonicInt(Messages.CHART_COLON),
                                               plotterChoice));
 
         // Range control
         timeComboBox = new TimeComboBox();
-        controlPanel.add(new LabeledComponent(getText("Time Range:"),
-                                              getMnemonicInt("Time Range:"),
+        controlPanel.add(new LabeledComponent(Messages.TIME_RANGE_COLON,
+                                              Resources.getMnemonicInt(Messages.TIME_RANGE_COLON),
                                               timeComboBox));
 
-        gcButton = new JButton(getText("Perform GC"));
-        gcButton.setMnemonic(getMnemonicInt("Perform GC"));
+        gcButton = new JButton(Messages.PERFORM_GC);
+        gcButton.setMnemonic(Resources.getMnemonicInt(Messages.PERFORM_GC));
         gcButton.addActionListener(this);
-        gcButton.setToolTipText(getText("Perform GC.toolTip"));
+        gcButton.setToolTipText(Messages.PERFORM_GC_TOOLTIP);
         JPanel topRightPanel = new JPanel();
         topRightPanel.setBorder(new EmptyBorder(0, 65-8, 0, 70));
         topRightPanel.add(gcButton);
         topPanel.add(topRightPanel, BorderLayout.AFTER_LINE_ENDS);
 
-        bottomPanel.setBorder(new CompoundBorder(new TitledBorder(getText("Details")),
+        bottomPanel.setBorder(new CompoundBorder(new TitledBorder(Messages.DETAILS),
                                                   new EmptyBorder(10, 10, 10, 10)));
 
         details = new HTMLPane();
-        setAccessibleName(details, getText("Details"));
+        setAccessibleName(details, Messages.DETAILS);
         bottomPanel.add(new JScrollPane(details), BorderLayout.CENTER);
 
         poolChart = new PoolChart();
@@ -165,31 +153,31 @@
 
         heapPlotter = new Plotter(Plotter.Unit.BYTES) {
             public String toString() {
-                return Resources.getText("Heap Memory Usage");
+                return Messages.HEAP_MEMORY_USAGE;
             }
         };
         proxyClient.addWeakPropertyChangeListener(heapPlotter);
 
         nonHeapPlotter = new Plotter(Plotter.Unit.BYTES) {
             public String toString() {
-                return Resources.getText("Non-Heap Memory Usage");
+                return Messages.NON_HEAP_MEMORY_USAGE;
             }
         };
 
         setAccessibleName(heapPlotter,
-                          getText("MemoryTab.heapPlotter.accessibleName"));
+                          Messages.MEMORY_TAB_HEAP_PLOTTER_ACCESSIBLE_NAME);
         setAccessibleName(nonHeapPlotter,
-                          getText("MemoryTab.nonHeapPlotter.accessibleName"));
+                          Messages.MEMORY_TAB_NON_HEAP_PLOTTER_ACCESSIBLE_NAME);
 
         proxyClient.addWeakPropertyChangeListener(nonHeapPlotter);
 
-        heapPlotter.createSequence(usedKey,         usedName,      usedColor,      true);
-        heapPlotter.createSequence(committedKey,    committedName, committedColor, false);
-        heapPlotter.createSequence(maxKey,          maxName,       maxColor,       false);
+        heapPlotter.createSequence(usedKey,         Messages.USED,      usedColor,      true);
+        heapPlotter.createSequence(committedKey,    Messages.COMMITTED, committedColor, false);
+        heapPlotter.createSequence(maxKey,          Messages.MAX,       maxColor,       false);
 
-        nonHeapPlotter.createSequence(usedKey,      usedName,      usedColor,      true);
-        nonHeapPlotter.createSequence(committedKey, committedName, committedColor, false);
-        nonHeapPlotter.createSequence(maxKey,       maxName,       maxColor,       false);
+        nonHeapPlotter.createSequence(usedKey,      Messages.USED,      usedColor,      true);
+        nonHeapPlotter.createSequence(committedKey, Messages.COMMITTED, committedColor, false);
+        nonHeapPlotter.createSequence(maxKey,       Messages.MAX,       maxColor,       false);
 
         plotterList.add(heapPlotter);
         plotterList.add(nonHeapPlotter);
@@ -202,8 +190,8 @@
         for (ObjectName objectName : objectNames) {
             String type = objectName.getKeyProperty("type");
             if (type.equals("MemoryPool")) {
-                String name = getText("MemoryPoolLabel",
-                                      objectName.getKeyProperty("name"));
+                String name = Resources.format(Messages.MEMORY_POOL_LABEL,
+                                               objectName.getKeyProperty("name"));
                 // Heap or non-heap?
                 boolean isHeap = false;
                 AttributeList al =
@@ -215,10 +203,10 @@
                 PoolPlotter poolPlotter = new PoolPlotter(objectName, name, isHeap);
                 proxyClient.addWeakPropertyChangeListener(poolPlotter);
 
-                poolPlotter.createSequence(usedKey,      usedName,      usedColor,      true);
-                poolPlotter.createSequence(committedKey, committedName, committedColor, false);
-                poolPlotter.createSequence(maxKey,       maxName,       maxColor,       false);
-                poolPlotter.createSequence(thresholdKey, thresholdName, thresholdColor, false);
+                poolPlotter.createSequence(usedKey,      Messages.USED,      usedColor,      true);
+                poolPlotter.createSequence(committedKey, Messages.COMMITTED, committedColor, false);
+                poolPlotter.createSequence(maxKey,       Messages.MAX,       maxColor,       false);
+                poolPlotter.createSequence(thresholdKey, Messages.THRESHOLD, thresholdColor, false);
                 poolPlotter.setUseDashedTransitions(thresholdKey, true);
 
                 if (isHeap) {
@@ -286,7 +274,6 @@
                 max       = new long[n];
                 threshold = new long[n];
                 timeStamp = System.currentTimeMillis();
-                int poolCount = 0;
 
                 for (int i = 0; i < n; i++) {
                     Plotter plotter = plotterList.get(i);
@@ -400,22 +387,22 @@
         //long time = plotter.getLastTimeStamp();
         long time = System.currentTimeMillis();
         String timeStamp = formatDateTime(time);
-        text += newRow(getText("Time"), timeStamp);
+        text += newRow(Messages.TIME, timeStamp);
 
         long used = plotter.getLastValue(usedKey);
         long committed = plotter.getLastValue(committedKey);
         long max = plotter.getLastValue(maxKey);
         long threshold = plotter.getLastValue(thresholdKey);
 
-        text += newRow(getText("Used"), formatKBytes(used));
+        text += newRow(Messages.USED, formatKBytes(used));
         if (committed > 0L) {
-            text += newRow(getText("Committed"), formatKBytes(committed));
+            text += newRow(Messages.COMMITTED, formatKBytes(committed));
         }
         if (max > 0L) {
-            text += newRow(getText("Max"), formatKBytes(max));
+            text += newRow(Messages.MAX, formatKBytes(max));
         }
         if (threshold > 0L) {
-            text += newRow(getText("Usage Threshold"), formatKBytes(threshold));
+            text += newRow(Messages.USAGE_THRESHOLD, formatKBytes(threshold));
         }
 
         try {
@@ -427,11 +414,11 @@
                 String gcName = garbageCollectorMBean.getName();
                 long gcCount = garbageCollectorMBean.getCollectionCount();
                 long gcTime = garbageCollectorMBean.getCollectionTime();
-                String str = getText("GC time details", justify(formatTime(gcTime), 14),
-                                     gcName,
-                                     String.format("%,d",gcCount));
+                String str = Resources.format(Messages.GC_TIME_DETAILS, justify(formatTime(gcTime), 14),
+                                              gcName,
+                                              String.format("%,d",gcCount));
                 if (!descPrinted) {
-                    text += newRow(getText("GC time"), str);
+                    text += newRow(Messages.GC_TIME, str);
                     descPrinted = true;
                 } else {
                     text += newRow(null, str);
@@ -465,8 +452,8 @@
             this.isHeap     = isHeap;
 
             setAccessibleName(this,
-                              getText("MemoryTab.poolPlotter.accessibleName",
-                                      name));
+                              Resources.format(Messages.MEMORY_TAB_POOL_PLOTTER_ACCESSIBLE_NAME,
+                                               name));
         }
 
 
@@ -627,7 +614,7 @@
             g.setColor(nonHeapColor);
             g.fillRect(nonHeapRect.x + 1, nonHeapRect.y + 1, nonHeapRect.width - 1, nonHeapRect.height - 1);
 
-            String str = getText("Heap");
+            String str = Messages.HEAP;
             int stringWidth = fm.stringWidth(str);
             int x = heapRect.x + (heapRect.width - stringWidth) / 2;
             int y = heapRect.y + heapRect.height - 6;
@@ -639,7 +626,7 @@
             g.setColor(Color.black);
             g.drawString(str, x, y);
 
-            str = getText("Non-Heap");
+            str = Messages.NON_HEAP;
             stringWidth = fm.stringWidth(str);
             x = nonHeapRect.x + (nonHeapRect.width - stringWidth) / 2;
             y = nonHeapRect.y + nonHeapRect.height - 6;
@@ -728,26 +715,26 @@
 
         protected class AccessiblePoolChart extends AccessibleJPanel {
             public String getAccessibleName() {
-                String name = getText("MemoryTab.poolChart.accessibleName");
+                String name = Messages.MEMORY_TAB_POOL_CHART_ACCESSIBLE_NAME;
 
                 String keyValueList = "";
                 for (PoolPlotter poolPlotter : poolPlotters) {
                     String value = (poolPlotter.value * 100 / poolPlotter.max) + "%";
                     // Assume format string ends with newline
                     keyValueList +=
-                        getText("Plotter.accessibleName.keyAndValue",
-                                poolPlotter.toString(), value);
+                        Resources.format(Messages.PLOTTER_ACCESSIBLE_NAME_KEY_AND_VALUE,
+                                         poolPlotter.toString(), value);
                     if (poolPlotter.threshold > 0L) {
                         String threshold =
                             (poolPlotter.threshold * 100 / poolPlotter.max) + "%";
                         if (poolPlotter.value > poolPlotter.threshold) {
                             keyValueList +=
-                                getText("MemoryTab.poolChart.aboveThreshold",
-                                        threshold);
+                               Resources.format(Messages.MEMORY_TAB_POOL_CHART_ABOVE_THRESHOLD,
+                                                threshold);
                         } else {
                             keyValueList +=
-                                getText("MemoryTab.poolChart.belowThreshold",
-                                        threshold);
+                                    Resources.format(Messages.MEMORY_TAB_POOL_CHART_BELOW_THRESHOLD,
+                                                     threshold);
                         }
                     }
                 }
@@ -767,14 +754,14 @@
 
     private static class MemoryOverviewPanel extends OverviewPanel {
         MemoryOverviewPanel() {
-            super(getText("Heap Memory Usage"), usedKey, usedName, Plotter.Unit.BYTES);
+            super(Messages.HEAP_MEMORY_USAGE, usedKey, Messages.USED, Plotter.Unit.BYTES);
         }
 
         private void updateMemoryInfo(long used, long committed, long max) {
-            getInfoLabel().setText(getText(infoLabelFormat,
-                                           formatBytes(used, true),
-                                           formatBytes(committed, true),
-                                           formatBytes(max, true)));
+            getInfoLabel().setText(Resources.format(Messages.MEMORY_TAB_INFO_LABEL_FORMAT,
+                                                    formatBytes(used, true),
+                                                    formatBytes(committed, true),
+                                                    formatBytes(max, true)));
         }
     }
 }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/classes/sun/tools/jconsole/Messages.java	Wed Sep 12 12:32:05 2012 -0700
@@ -0,0 +1,316 @@
+/*
+ * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package sun.tools.jconsole;
+
+
+/**
+ * Class that contains localized messages.
+ *
+ */
+final public class Messages {
+    private static final String BUNDLE_NAME = "sun.tools.jconsole.resources.messages";
+
+    static {
+        Resources.initializeMessages(Messages.class, BUNDLE_NAME);
+    }
+    // TODO:
+    // The names of some of the constants below looks strange.
+    // That's because they  were generated programmatically
+    // from the messages. They should be cleaned up,
+    // ___ should be removed etc.
+    public static String ONE_DAY;
+    public static String ONE_HOUR;
+    public static String ONE_MIN;
+    public static String ONE_MONTH;
+    public static String ONE_YEAR;
+    public static String TWO_HOURS;
+    public static String THREE_HOURS;
+    public static String THREE_MONTHS;
+    public static String FIVE_MIN;
+    public static String SIX_HOURS;
+    public static String SIX_MONTHS;
+    public static String SEVEN_DAYS;
+    public static String TEN_MIN;
+    public static String TWELVE_HOURS;
+    public static String THIRTY_MIN;
+    public static String LESS_THAN;
+    public static String A_LOT_LESS_THAN;
+    public static String GREATER_THAN;
+    public static String ACTION_CAPITALIZED;
+    public static String ACTION_INFO_CAPITALIZED;
+    public static String ALL;
+    public static String ARCHITECTURE;
+    public static String ATTRIBUTE;
+    public static String ATTRIBUTE_VALUE;
+    public static String ATTRIBUTE_VALUES;
+    public static String ATTRIBUTES;
+    public static String BLANK;
+    public static String BLOCKED_COUNT_WAITED_COUNT;
+    public static String BOOT_CLASS_PATH;
+    public static String BORDERED_COMPONENT_MORE_OR_LESS_BUTTON_TOOLTIP;
+    public static String CPU_USAGE;
+    public static String CPU_USAGE_FORMAT;
+    public static String CANCEL;
+    public static String CASCADE;
+    public static String CHART_COLON;
+    public static String CLASS_PATH;
+    public static String CLASS_NAME;
+    public static String CLASS_TAB_INFO_LABEL_FORMAT;
+    public static String CLASS_TAB_LOADED_CLASSES_PLOTTER_ACCESSIBLE_NAME;
+    public static String CLASSES;
+    public static String CLOSE;
+    public static String COLUMN_NAME;
+    public static String COLUMN_PID;
+    public static String COMMITTED_MEMORY;
+    public static String COMMITTED_VIRTUAL_MEMORY;
+    public static String COMMITTED;
+    public static String CONNECT;
+    public static String CONNECT_DIALOG_CONNECT_BUTTON_TOOLTIP;
+    public static String CONNECT_DIALOG_ACCESSIBLE_DESCRIPTION;
+    public static String CONNECT_DIALOG_MASTHEAD_ACCESSIBLE_NAME;
+    public static String CONNECT_DIALOG_MASTHEAD_TITLE;
+    public static String CONNECT_DIALOG_STATUS_BAR_ACCESSIBLE_NAME;
+    public static String CONNECT_DIALOG_TITLE;
+    public static String CONNECTED_PUNCTUATION_CLICK_TO_DISCONNECT_;
+    public static String CONNECTION_FAILED;
+    public static String CONNECTION;
+    public static String CONNECTION_NAME;
+    public static String CONNECTION_NAME__DISCONNECTED_;
+    public static String CONSTRUCTOR;
+    public static String CURRENT_CLASSES_LOADED;
+    public static String CURRENT_HEAP_SIZE;
+    public static String CURRENT_VALUE;
+    public static String CREATE;
+    public static String DAEMON_THREADS;
+    public static String DISCONNECTED_PUNCTUATION_CLICK_TO_CONNECT_;
+    public static String DOUBLE_CLICK_TO_EXPAND_FORWARD_SLASH_COLLAPSE;
+    public static String DOUBLE_CLICK_TO_VISUALIZE;
+    public static String DESCRIPTION;
+    public static String DESCRIPTOR;
+    public static String DETAILS;
+    public static String DETECT_DEADLOCK;
+    public static String DETECT_DEADLOCK_TOOLTIP;
+    public static String DIMENSION_IS_NOT_SUPPORTED_COLON;
+    public static String DISCARD_CHART;
+    public static String DURATION_DAYS_HOURS_MINUTES;
+    public static String DURATION_HOURS_MINUTES;
+    public static String DURATION_MINUTES;
+    public static String DURATION_SECONDS;
+    public static String EMPTY_ARRAY;
+    public static String ERROR;
+    public static String ERROR_COLON_MBEANS_ALREADY_EXIST;
+    public static String ERROR_COLON_MBEANS_DO_NOT_EXIST;
+    public static String EVENT;
+    public static String EXIT;
+    public static String FAIL_TO_LOAD_PLUGIN;
+    public static String FILE_CHOOSER_FILE_EXISTS_CANCEL_OPTION;
+    public static String FILE_CHOOSER_FILE_EXISTS_MESSAGE;
+    public static String FILE_CHOOSER_FILE_EXISTS_OK_OPTION;
+    public static String FILE_CHOOSER_FILE_EXISTS_TITLE;
+    public static String FILE_CHOOSER_SAVED_FILE;
+    public static String FILE_CHOOSER_SAVE_FAILED_MESSAGE;
+    public static String FILE_CHOOSER_SAVE_FAILED_TITLE;
+    public static String FREE_PHYSICAL_MEMORY;
+    public static String FREE_SWAP_SPACE;
+    public static String GARBAGE_COLLECTOR;
+    public static String GC_INFO;
+    public static String GC_TIME;
+    public static String GC_TIME_DETAILS;
+    public static String HEAP_MEMORY_USAGE;
+    public static String HEAP;
+    public static String HELP_ABOUT_DIALOG_ACCESSIBLE_DESCRIPTION;
+    public static String HELP_ABOUT_DIALOG_JCONSOLE_VERSION;
+    public static String HELP_ABOUT_DIALOG_JAVA_VERSION;
+    public static String HELP_ABOUT_DIALOG_MASTHEAD_ACCESSIBLE_NAME;
+    public static String HELP_ABOUT_DIALOG_MASTHEAD_TITLE;
+    public static String HELP_ABOUT_DIALOG_TITLE;
+    public static String HELP_ABOUT_DIALOG_USER_GUIDE_LINK;
+    public static String HELP_ABOUT_DIALOG_USER_GUIDE_LINK_URL;
+    public static String HELP_MENU_ABOUT_TITLE;
+    public static String HELP_MENU_USER_GUIDE_TITLE;
+    public static String HELP_MENU_TITLE;
+    public static String HOTSPOT_MBEANS_ELLIPSIS;
+    public static String HOTSPOT_MBEANS_DIALOG_ACCESSIBLE_DESCRIPTION;
+    public static String IMPACT;
+    public static String INFO;
+    public static String INFO_CAPITALIZED;
+    public static String INVALID_PLUGIN_PATH;
+    public static String INVALID_URL;
+    public static String IS;
+    public static String JAVA_MONITORING___MANAGEMENT_CONSOLE;
+    public static String JCONSOLE_COLON_;
+    public static String JCONSOLE_VERSION; // in version template
+    public static String JCONSOLE_ACCESSIBLE_DESCRIPTION;
+    public static String JIT_COMPILER;
+    public static String LIBRARY_PATH;
+    public static String LIVE_THREADS;
+    public static String LOADED;
+    public static String LOCAL_PROCESS_COLON;
+    public static String MASTHEAD_FONT;
+    public static String MANAGEMENT_NOT_ENABLED;
+    public static String MANAGEMENT_WILL_BE_ENABLED;
+    public static String MBEAN_ATTRIBUTE_INFO;
+    public static String MBEAN_INFO;
+    public static String MBEAN_NOTIFICATION_INFO;
+    public static String MBEAN_OPERATION_INFO;
+    public static String MBEANS;
+    public static String MBEANS_TAB_CLEAR_NOTIFICATIONS_BUTTON;
+    public static String MBEANS_TAB_CLEAR_NOTIFICATIONS_BUTTON_TOOLTIP;
+    public static String MBEANS_TAB_COMPOSITE_NAVIGATION_MULTIPLE;
+    public static String MBEANS_TAB_COMPOSITE_NAVIGATION_SINGLE;
+    public static String MBEANS_TAB_REFRESH_ATTRIBUTES_BUTTON;
+    public static String MBEANS_TAB_REFRESH_ATTRIBUTES_BUTTON_TOOLTIP;
+    public static String MBEANS_TAB_SUBSCRIBE_NOTIFICATIONS_BUTTON;
+    public static String MBEANS_TAB_SUBSCRIBE_NOTIFICATIONS_BUTTON_TOOLTIP;
+    public static String MBEANS_TAB_TABULAR_NAVIGATION_MULTIPLE;
+    public static String MBEANS_TAB_TABULAR_NAVIGATION_SINGLE;
+    public static String MBEANS_TAB_UNSUBSCRIBE_NOTIFICATIONS_BUTTON;
+    public static String MBEANS_TAB_UNSUBSCRIBE_NOTIFICATIONS_BUTTON_TOOLTIP;
+    public static String MANAGE_HOTSPOT_MBEANS_IN_COLON_;
+    public static String MAX;
+    public static String MAXIMUM_HEAP_SIZE;
+    public static String MEMORY;
+    public static String MEMORY_POOL_LABEL;
+    public static String MEMORY_TAB_HEAP_PLOTTER_ACCESSIBLE_NAME;
+    public static String MEMORY_TAB_INFO_LABEL_FORMAT;
+    public static String MEMORY_TAB_NON_HEAP_PLOTTER_ACCESSIBLE_NAME;
+    public static String MEMORY_TAB_POOL_CHART_ABOVE_THRESHOLD;
+    public static String MEMORY_TAB_POOL_CHART_ACCESSIBLE_NAME;
+    public static String MEMORY_TAB_POOL_CHART_BELOW_THRESHOLD;
+    public static String MEMORY_TAB_POOL_PLOTTER_ACCESSIBLE_NAME;
+    public static String MESSAGE;
+    public static String METHOD_SUCCESSFULLY_INVOKED;
+    public static String MINIMIZE_ALL;
+    public static String MONITOR_LOCKED;
+    public static String NAME;
+    public static String NAME_STATE;
+    public static String NAME_STATE_LOCK_NAME;
+    public static String NAME_STATE_LOCK_NAME_LOCK_OWNER;
+    public static String NAME_AND_BUILD;// in version template
+    public static String NEW_CONNECTION_ELLIPSIS;
+    public static String NO_DEADLOCK_DETECTED;
+    public static String NON_HEAP_MEMORY_USAGE;
+    public static String NON_HEAP;
+    public static String NOTIFICATION;
+    public static String NOTIFICATION_BUFFER;
+    public static String NOTIFICATIONS;
+    public static String NOTIF_TYPES;
+    public static String NUMBER_OF_THREADS;
+    public static String NUMBER_OF_LOADED_CLASSES;
+    public static String NUMBER_OF_PROCESSORS;
+    public static String OBJECT_NAME;
+    public static String OPERATING_SYSTEM;
+    public static String OPERATION;
+    public static String OPERATION_INVOCATION;
+    public static String OPERATION_RETURN_VALUE;
+    public static String OPERATIONS;
+    public static String OVERVIEW;
+    public static String OVERVIEW_PANEL_PLOTTER_ACCESSIBLE_NAME;
+    public static String PARAMETER;
+    public static String PASSWORD_COLON_;
+    public static String PASSWORD_ACCESSIBLE_NAME;
+    public static String PEAK;
+    public static String PERFORM_GC;
+    public static String PERFORM_GC_TOOLTIP;
+    public static String PLOTTER_ACCESSIBLE_NAME;
+    public static String PLOTTER_ACCESSIBLE_NAME_KEY_AND_VALUE;
+    public static String PLOTTER_ACCESSIBLE_NAME_NO_DATA;
+    public static String PLOTTER_SAVE_AS_MENU_ITEM;
+    public static String PLOTTER_TIME_RANGE_MENU;
+    public static String PROBLEM_ADDING_LISTENER;
+    public static String PROBLEM_DISPLAYING_MBEAN;
+    public static String PROBLEM_INVOKING;
+    public static String PROBLEM_REMOVING_LISTENER;
+    public static String PROBLEM_SETTING_ATTRIBUTE;
+    public static String PROCESS_CPU_TIME;
+    public static String READABLE;
+    public static String RECONNECT;
+    public static String REMOTE_PROCESS_COLON;
+    public static String REMOTE_PROCESS_TEXT_FIELD_ACCESSIBLE_NAME;
+    public static String RESTORE_ALL;
+    public static String RETURN_TYPE;
+    public static String SEQ_NUM;
+    public static String SIZE_BYTES;
+    public static String SIZE_GB;
+    public static String SIZE_KB;
+    public static String SIZE_MB;
+    public static String SOURCE;
+    public static String STACK_TRACE;
+    public static String SUMMARY_TAB_HEADER_DATE_TIME_FORMAT;
+    public static String SUMMARY_TAB_PENDING_FINALIZATION_LABEL;
+    public static String SUMMARY_TAB_PENDING_FINALIZATION_VALUE;
+    public static String SUMMARY_TAB_TAB_NAME;
+    public static String SUMMARY_TAB_VM_VERSION;
+    public static String THREADS;
+    public static String THREAD_TAB_THREAD_INFO_ACCESSIBLE_NAME;
+    public static String THREAD_TAB_THREAD_PLOTTER_ACCESSIBLE_NAME;
+    public static String THRESHOLD;
+    public static String TILE;
+    public static String TIME_RANGE_COLON;
+    public static String TIME;
+    public static String TIME_STAMP;
+    public static String TOTAL_LOADED;
+    public static String TOTAL_CLASSES_LOADED;
+    public static String TOTAL_CLASSES_UNLOADED;
+    public static String TOTAL_COMPILE_TIME;
+    public static String TOTAL_PHYSICAL_MEMORY;
+    public static String TOTAL_THREADS_STARTED;
+    public static String TOTAL_SWAP_SPACE;
+    public static String TYPE;
+    public static String UNAVAILABLE;
+    public static String UNKNOWN_CAPITALIZED;
+    public static String UNKNOWN_HOST;
+    public static String UNREGISTER;
+    public static String UPTIME;
+    public static String USAGE_THRESHOLD;
+    public static String REMOTE_TF_USAGE;
+    public static String USED;
+    public static String USERNAME_COLON_;
+    public static String USERNAME_ACCESSIBLE_NAME;
+    public static String USER_DATA;
+    public static String VIRTUAL_MACHINE;
+    public static String VM_ARGUMENTS;
+    public static String VMINTERNAL_FRAME_ACCESSIBLE_DESCRIPTION;
+    public static String VALUE;
+    public static String VENDOR;
+    public static String VERBOSE_OUTPUT;
+    public static String VERBOSE_OUTPUT_TOOLTIP;
+    public static String VIEW;
+    public static String WINDOW;
+    public static String WINDOWS;
+    public static String WRITABLE;
+    public static String CONNECTION_FAILED1;
+    public static String CONNECTION_FAILED2;
+    public static String CONNECTION_LOST1;
+    public static String CONNECTING_TO1;
+    public static String CONNECTING_TO2;
+    public static String DEADLOCK_TAB;
+    public static String DEADLOCK_TAB_N;
+    public static String EXPAND;
+    public static String KBYTES;
+    public static String PLOT;
+    public static String VISUALIZE;
+    public static String ZZ_USAGE_TEXT;
+}
--- a/src/share/classes/sun/tools/jconsole/OverviewPanel.java	Wed Sep 05 15:19:51 2012 -0700
+++ b/src/share/classes/sun/tools/jconsole/OverviewPanel.java	Wed Sep 12 12:32:05 2012 -0700
@@ -26,14 +26,12 @@
 package sun.tools.jconsole;
 
 import java.awt.*;
-import java.awt.event.*;
 
 import javax.swing.*;
-import javax.swing.border.*;
+
 
 import static javax.swing.SwingConstants.*;
 import static sun.tools.jconsole.JConsole.*;
-import static sun.tools.jconsole.Resources.*;
 import static sun.tools.jconsole.Utilities.*;
 
 
@@ -68,7 +66,7 @@
             }
             plotter.createSequence(plotterKey, plotterName, PLOTTER_COLOR, true);
             setAccessibleName(plotter,
-                              getText("OverviewPanel.plotter.accessibleName",
+                              Resources.format(Messages.OVERVIEW_PANEL_PLOTTER_ACCESSIBLE_NAME,
                                       title));
             setPlotter(plotter);
         }
--- a/src/share/classes/sun/tools/jconsole/OverviewTab.java	Wed Sep 05 15:19:51 2012 -0700
+++ b/src/share/classes/sun/tools/jconsole/OverviewTab.java	Wed Sep 12 12:32:05 2012 -0700
@@ -26,15 +26,11 @@
 package sun.tools.jconsole;
 
 import java.awt.*;
-import java.lang.reflect.InvocationTargetException;
 import java.util.ArrayList;
 
 import javax.swing.*;
 import javax.swing.border.*;
 
-import static sun.tools.jconsole.JConsole.*;
-import static sun.tools.jconsole.Resources.*;
-
 
 @SuppressWarnings("serial")
 class OverviewTab extends Tab {
@@ -42,7 +38,7 @@
     TimeComboBox timeComboBox;
 
     public static String getTabName() {
-        return getText("Overview");
+        return Messages.OVERVIEW;
     }
 
     public OverviewTab(VMPanel vmPanel) {
@@ -58,8 +54,8 @@
         topPanel.add(controlPanel, BorderLayout.CENTER);
 
         timeComboBox = new TimeComboBox();
-        LabeledComponent lc = new LabeledComponent(Resources.getText("Time Range:"),
-                                                   getMnemonicInt("Time Range:"),
+        LabeledComponent lc = new LabeledComponent(Messages.TIME_RANGE_COLON,
+                                                   Resources.getMnemonicInt(Messages.TIME_RANGE_COLON),
                                                    timeComboBox);
         controlPanel.add(lc);
 
--- a/src/share/classes/sun/tools/jconsole/Plotter.java	Wed Sep 05 15:19:51 2012 -0700
+++ b/src/share/classes/sun/tools/jconsole/Plotter.java	Wed Sep 12 12:32:05 2012 -0700
@@ -38,14 +38,11 @@
 import javax.swing.filechooser.*;
 import javax.swing.filechooser.FileFilter;
 
+
 import com.sun.tools.jconsole.JConsoleContext;
 
-import static com.sun.tools.jconsole.JConsoleContext.ConnectionState.*;
-
 import static sun.tools.jconsole.Formatter.*;
 import static sun.tools.jconsole.ProxyClient.*;
-import static sun.tools.jconsole.Resources.*;
-import static sun.tools.jconsole.Utilities.*;
 
 @SuppressWarnings("serial")
 public class Plotter extends JComponent
@@ -56,22 +53,22 @@
     }
 
     static final String[] rangeNames = {
-        Resources.getText(" 1 min"),
-        Resources.getText(" 5 min"),
-        Resources.getText("10 min"),
-        Resources.getText("30 min"),
-        Resources.getText(" 1 hour"),
-        Resources.getText(" 2 hours"),
-        Resources.getText(" 3 hours"),
-        Resources.getText(" 6 hours"),
-        Resources.getText("12 hours"),
-        Resources.getText(" 1 day"),
-        Resources.getText(" 7 days"),
-        Resources.getText(" 1 month"),
-        Resources.getText(" 3 months"),
-        Resources.getText(" 6 months"),
-        Resources.getText(" 1 year"),
-        Resources.getText("All")
+        Messages.ONE_MIN,
+        Messages.FIVE_MIN,
+        Messages.TEN_MIN,
+        Messages.THIRTY_MIN,
+        Messages.ONE_HOUR,
+        Messages.TWO_HOURS,
+        Messages.THREE_HOURS,
+        Messages.SIX_HOURS,
+        Messages.TWELVE_HOURS,
+        Messages.ONE_DAY,
+        Messages.SEVEN_DAYS,
+        Messages.ONE_MONTH,
+        Messages.THREE_MONTHS,
+        Messages.SIX_MONTHS,
+        Messages.ONE_YEAR,
+        Messages.ALL
     };
 
     static final int[] rangeValues = {
@@ -247,9 +244,9 @@
     @Override
     public JPopupMenu getComponentPopupMenu() {
         if (popupMenu == null) {
-            popupMenu = new JPopupMenu(Resources.getText("Chart:"));
-            timeRangeMenu = new JMenu(Resources.getText("Plotter.timeRangeMenu"));
-            timeRangeMenu.setMnemonic(getMnemonicInt("Plotter.timeRangeMenu"));
+            popupMenu = new JPopupMenu(Messages.CHART_COLON);
+            timeRangeMenu = new JMenu(Messages.PLOTTER_TIME_RANGE_MENU);
+            timeRangeMenu.setMnemonic(Resources.getMnemonicInt(Messages.PLOTTER_TIME_RANGE_MENU));
             popupMenu.add(timeRangeMenu);
             menuRBs = new JRadioButtonMenuItem[rangeNames.length];
             ButtonGroup rbGroup = new ButtonGroup();
@@ -265,8 +262,8 @@
 
             popupMenu.addSeparator();
 
-            saveAsMI = new JMenuItem(getText("Plotter.saveAsMenuItem"));
-            saveAsMI.setMnemonic(getMnemonicInt("Plotter.saveAsMenuItem"));
+            saveAsMI = new JMenuItem(Messages.PLOTTER_SAVE_AS_MENU_ITEM);
+            saveAsMI.setMnemonic(Resources.getMnemonicInt(Messages.PLOTTER_SAVE_AS_MENU_ITEM));
             saveAsMI.addActionListener(this);
             popupMenu.add(saveAsMI);
         }
@@ -318,9 +315,9 @@
 
             out.close();
             JOptionPane.showMessageDialog(this,
-                                          getText("FileChooser.savedFile",
-                                                  file.getAbsolutePath(),
-                                                  file.length()));
+                                          Resources.format(Messages.FILE_CHOOSER_SAVED_FILE,
+                                                           file.getAbsolutePath(),
+                                                           file.length()));
         } catch (IOException ex) {
             String msg = ex.getLocalizedMessage();
             String path = file.getAbsolutePath();
@@ -328,9 +325,10 @@
                 msg = msg.substring(path.length()).trim();
             }
             JOptionPane.showMessageDialog(this,
-                                          getText("FileChooser.saveFailed.message",
-                                                  path, msg),
-                                          getText("FileChooser.saveFailed.title"),
+                                          Resources.format(Messages.FILE_CHOOSER_SAVE_FAILED_MESSAGE,
+                                                           path,
+                                                           msg),
+                                          Messages.FILE_CHOOSER_SAVE_FAILED_TITLE,
                                           JOptionPane.ERROR_MESSAGE);
         }
     }
@@ -1020,13 +1018,13 @@
                 }
 
                 if (file.exists()) {
-                    String okStr = getText("FileChooser.fileExists.okOption");
-                    String cancelStr = getText("FileChooser.fileExists.cancelOption");
+                    String okStr = Messages.FILE_CHOOSER_FILE_EXISTS_OK_OPTION;
+                    String cancelStr = Messages.FILE_CHOOSER_FILE_EXISTS_CANCEL_OPTION;
                     int ret =
                         JOptionPane.showOptionDialog(this,
-                                                     getText("FileChooser.fileExists.message",
-                                                             file.getName()),
-                                                     getText("FileChooser.fileExists.title"),
+                                                     Resources.format(Messages.FILE_CHOOSER_FILE_EXISTS_MESSAGE,
+                                                                      file.getName()),
+                                                     Messages.FILE_CHOOSER_FILE_EXISTS_TITLE,
                                                      JOptionPane.OK_CANCEL_OPTION,
                                                      JOptionPane.WARNING_MESSAGE,
                                                      null,
@@ -1053,7 +1051,7 @@
     protected class AccessiblePlotter extends AccessibleJComponent {
         private static final long serialVersionUID = -3847205410473510922L;
         protected AccessiblePlotter() {
-            setAccessibleName(getText("Plotter.accessibleName"));
+            setAccessibleName(Messages.PLOTTER_ACCESSIBLE_NAME);
         }
 
         @Override
@@ -1067,7 +1065,7 @@
                         String value = "null";
                         if (seq.size > 0) {
                             if (unit == Unit.BYTES) {
-                                value = getText("Size Bytes", seq.value(seq.size - 1));
+                                value = Resources.format(Messages.SIZE_BYTES, seq.value(seq.size - 1));
                             } else {
                                 value =
                                     getFormattedValue(seq.value(seq.size - 1), false) +
@@ -1076,13 +1074,13 @@
                         }
                         // Assume format string ends with newline
                         keyValueList +=
-                            getText("Plotter.accessibleName.keyAndValue",
+                            Resources.format(Messages.PLOTTER_ACCESSIBLE_NAME_KEY_AND_VALUE,
                                     seq.key, value);
                     }
                 }
                 name += "\n" + keyValueList + ".";
             } else {
-                name += "\n" + getText("Plotter.accessibleName.noData");
+                name += "\n" + Messages.PLOTTER_ACCESSIBLE_NAME_NO_DATA;
             }
             return name;
         }
--- a/src/share/classes/sun/tools/jconsole/PlotterPanel.java	Wed Sep 05 15:19:51 2012 -0700
+++ b/src/share/classes/sun/tools/jconsole/PlotterPanel.java	Wed Sep 12 12:32:05 2012 -0700
@@ -25,7 +25,6 @@
 
 package sun.tools.jconsole;
 
-import java.awt.*;
 import java.awt.event.*;
 
 import javax.accessibility.*;
--- a/src/share/classes/sun/tools/jconsole/ProxyClient.java	Wed Sep 05 15:19:51 2012 -0700
+++ b/src/share/classes/sun/tools/jconsole/ProxyClient.java	Wed Sep 12 12:32:05 2012 -0700
@@ -27,7 +27,6 @@
 
 import com.sun.management.HotSpotDiagnosticMXBean;
 import com.sun.tools.jconsole.JConsoleContext;
-import com.sun.tools.jconsole.JConsoleContext.ConnectionState;
 import java.beans.PropertyChangeListener;
 import java.beans.PropertyChangeEvent;
 import java.io.IOException;
@@ -512,7 +511,7 @@
 
     public String toString() {
         if (!isConnected()) {
-            return Resources.getText("ConnectionName (disconnected)", displayName);
+            return Resources.format(Messages.CONNECTION_NAME__DISCONNECTED_, displayName);
         } else {
             return displayName;
         }
@@ -603,10 +602,10 @@
                 assert(false);
             }
         }
-        Set mbeans = server.queryNames(name, null);
+        Set<ObjectName> mbeans = server.queryNames(name, null);
         Map<ObjectName,MBeanInfo> result =
             new HashMap<ObjectName,MBeanInfo>(mbeans.size());
-        Iterator iterator = mbeans.iterator();
+        Iterator<ObjectName> iterator = mbeans.iterator();
         while (iterator.hasNext()) {
             Object object = iterator.next();
             if (object instanceof ObjectName) {
@@ -712,10 +711,10 @@
                 // should not reach here
                 assert(false);
             }
-            Set mbeans = server.queryNames(poolName, null);
+            Set<ObjectName> mbeans = server.queryNames(poolName, null);
             if (mbeans != null) {
                 memoryPoolProxies = new ArrayList<MemoryPoolProxy>();
-                Iterator iterator = mbeans.iterator();
+                Iterator<ObjectName> iterator = mbeans.iterator();
                 while (iterator.hasNext()) {
                     ObjectName objName = (ObjectName) iterator.next();
                     MemoryPoolProxy p = new MemoryPoolProxy(this, objName);
@@ -738,10 +737,10 @@
                 // should not reach here
                 assert(false);
             }
-            Set mbeans = server.queryNames(gcName, null);
+            Set<ObjectName> mbeans = server.queryNames(gcName, null);
             if (mbeans != null) {
                 garbageCollectorMBeans = new ArrayList<GarbageCollectorMXBean>();
-                Iterator iterator = mbeans.iterator();
+                Iterator<ObjectName> iterator = mbeans.iterator();
                 while (iterator.hasNext()) {
                     ObjectName on = (ObjectName) iterator.next();
                     String name = GARBAGE_COLLECTOR_MXBEAN_DOMAIN_TYPE +
--- a/src/share/classes/sun/tools/jconsole/Resources.java	Wed Sep 05 15:19:51 2012 -0700
+++ b/src/share/classes/sun/tools/jconsole/Resources.java	Wed Sep 12 12:32:05 2012 -0700
@@ -25,89 +25,185 @@
 
 package sun.tools.jconsole;
 
+import java.awt.event.KeyEvent;
+import java.lang.reflect.Field;
+import java.lang.reflect.Modifier;
 import java.text.MessageFormat;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.Map;
 import java.util.MissingResourceException;
 import java.util.ResourceBundle;
 
-import sun.tools.jconsole.resources.JConsoleResources;
-
 /**
- * Provides resource support for jconsole.
+ * Toolkit that provides resource support for JConsole.
  */
 public final class Resources {
+    private static Map<String, Integer> MNEMONIC_LOOKUP = Collections
+            .synchronizedMap(new HashMap<String, Integer>());
 
-    private static final Object lock = new Object();
-    private static JConsoleResources resources = null;
-    static {
+    private Resources() {
+        throw new AssertionError();
+    }
+
+    /**
+     * Convenience method for {@link MessageFormat#format(String, Object...)}.
+     *
+     * @param pattern the pattern
+     * @param objects the arguments for the pattern
+     *
+     * @return a formatted string
+     */
+    public static String format(String pattern, Object... arguments) {
+            return MessageFormat.format(pattern, arguments);
+    }
+
+    /**
+     * Returns the mnemonic for a message.
+     *
+     * @param message the message
+     *
+     * @return the mnemonic <code>int</code>
+     */
+    public static int getMnemonicInt(String message) {
+        Integer integer = MNEMONIC_LOOKUP.get(message);
+        if (integer != null) {
+            return integer.intValue();
+        }
+        return 0;
+    }
+
+    /**
+     * Initializes all non-final public static fields in the given class with
+     * messages from a {@link ResourceBundle}.
+     *
+     * @param clazz the class containing the fields
+     */
+    public static void initializeMessages(Class<?> clazz, String rbName) {
+        ResourceBundle rb = null;
         try {
-            resources =
-                (JConsoleResources)ResourceBundle.getBundle("sun.tools.jconsole.resources.JConsoleResources");
-        } catch (MissingResourceException e) {
-            // gracefully handle this later
+            rb = ResourceBundle.getBundle(rbName);
+        } catch (MissingResourceException mre) {
+            // fall through, handled later
+        }
+        for (Field field : clazz.getFields()) {
+            if (isWritableField(field)) {
+                String key = field.getName();
+                String message = getMessage(rb, key);
+                int mnemonicInt = findMnemonicInt(message);
+                message = removeMnemonicAmpersand(message);
+                message = replaceWithPlatformLineFeed(message);
+                setFieldValue(field, message);
+                MNEMONIC_LOOKUP.put(message, mnemonicInt);
+            }
         }
     }
 
-    private Resources() { throw new AssertionError(); }
-
-    /**
-     * Returns the text of the jconsole resource for the specified key
-     * formatted with the specified arguments.
-     *
-     */
-    public static String getText(String key, Object... args) {
-        String format = getString(key);
-        if (format == null) {
-            format = "missing resource key: key = \"" + key + "\", " +
-                "arguments = \"{0}\", \"{1}\", \"{2}\"";
-        }
-        return formatMessage(format, args);
-    }
-
-    static String formatMessage(String format, Object... args) {
-        String ss = null;
-        synchronized (lock) {
-            /*
-             * External synchronization required for safe use of
-             * java.text.MessageFormat:
-             */
-            ss = MessageFormat.format(format, args);
-        }
-        return ss;
+    private static boolean isWritableField(Field field) {
+        int modifiers = field.getModifiers();
+        return Modifier.isPublic(modifiers) && Modifier.isStatic(modifiers)
+                && !Modifier.isFinal(modifiers);
     }
 
     /**
-     * Returns the mnemonic keycode int of the jconsole resource for the specified key.
+     * Returns the message corresponding to the key in the bundle or a text
+     * describing it's missing.
      *
+     * @param rb the resource bundle
+     * @param key the key
+     *
+     * @return the message
      */
-    public static int getMnemonicInt(String key) {
-        int mnemonic = 0;
-        if (resources != null) {
-            Object obj = resources.getObject(key+".mnemonic");
-            if (obj instanceof Character) {
-                mnemonic = (int)(Character)obj;
-                if (mnemonic >= 'a' && mnemonic <='z') {
-                    mnemonic -= ('a' - 'A');
-                }
-            } else if (obj instanceof Integer) {
-                mnemonic = (Integer)obj;
-            }
+    private static String getMessage(ResourceBundle rb, String key) {
+        if (rb == null) {
+            return "missing resource bundle";
         }
-        return mnemonic;
+        try {
+            return rb.getString(key);
+        } catch (MissingResourceException mre) {
+            return "missing message for key = \"" + key
+                    + "\" in resource bundle ";
+        }
+    }
+
+    private static void setFieldValue(Field field, String value) {
+        try {
+            field.set(null, value);
+        } catch (IllegalArgumentException | IllegalAccessException e) {
+            throw new Error("Unable to access or set message for field " + field.getName());
+        }
     }
 
     /**
-     * Returns the jconsole resource string for the specified key.
+     * Returns a {@link String} where all <code>\n</code> in the <text> have
+     * been replaced with the line separator for the platform.
      *
+     * @param text the to be replaced
+     *
+     * @return the replaced text
      */
-    private static String getString(String key) {
-        if (resources != null) {
-            try {
-                return resources.getString(key);
-            } catch (MissingResourceException e) {
-                return null;
+    private static String replaceWithPlatformLineFeed(String text) {
+        return text.replace("\n", System.getProperty("line.separator"));
+    }
+
+    /**
+     * Removes the mnemonic identifier (<code>&</code>) from a string unless
+     * it's escaped by <code>&&</code> or placed at the end.
+     *
+     * @param message the message
+     *
+     * @return a message with the mnemonic identifier removed
+     */
+    private static String removeMnemonicAmpersand(String message) {
+        StringBuilder s = new StringBuilder();
+        for (int i = 0; i < message.length(); i++) {
+            char current = message.charAt(i);
+            if (current != '&' || i == message.length() - 1
+                    || message.charAt(i + 1) == '&') {
+                s.append(current);
             }
         }
-        return "missing resource bundle: key = \"" + key + "\", " +
-            "arguments = \"{0}\", \"{1}\", \"{2}\"";
+        return s.toString();
+    }
+
+    /**
+     * Finds the mnemonic character in a message.
+     *
+     * The mnemonic character is the first character followed by the first
+     * <code>&</code> that is not followed by another <code>&</code>.
+     *
+     * @return the mnemonic as an <code>int</code>, or <code>0</code> if it
+     *         can't be found.
+     */
+    private static int findMnemonicInt(String s) {
+        for (int i = 0; i < s.length() - 1; i++) {
+            if (s.charAt(i) == '&') {
+                if (s.charAt(i + 1) != '&') {
+                    return lookupMnemonicInt(s.substring(i + 1, i + 2));
+                } else {
+                    i++;
+                }
+            }
+        }
+        return 0;
+    }
+
+    /**
+     * Lookups the mnemonic for a key in the {@link KeyEvent} class.
+     *
+     * @param c the character to lookup
+     *
+     * @return the mnemonic as an <code>int</code>, or <code>0</code> if it
+     *         can't be found.
+     */
+    private static int lookupMnemonicInt(String c) {
+        try {
+            return KeyEvent.class.getDeclaredField("VK_" + c.toUpperCase())
+                    .getInt(null);
+        } catch (IllegalArgumentException | IllegalAccessException
+                | NoSuchFieldException | SecurityException e) {
+            // Missing VK is okay
+            return 0;
+        }
     }
 }
--- a/src/share/classes/sun/tools/jconsole/SummaryTab.java	Wed Sep 05 15:19:51 2012 -0700
+++ b/src/share/classes/sun/tools/jconsole/SummaryTab.java	Wed Sep 12 12:32:05 2012 -0700
@@ -29,24 +29,19 @@
 import java.io.*;
 import java.lang.management.*;
 import java.lang.reflect.*;
-import java.net.URL;
 import java.text.*;
 import java.util.*;
 import java.util.concurrent.*;
 
 import javax.swing.*;
-import javax.swing.event.*;
-import javax.swing.text.*;
+
 
 import static sun.tools.jconsole.Formatter.*;
-import static sun.tools.jconsole.Resources.*;
 import static sun.tools.jconsole.Utilities.*;
 
 @SuppressWarnings("serial")
 class SummaryTab extends Tab {
     private static final String cpuUsageKey = "cpu";
-    private static final String cpuUsageName = getText("CPU Usage");
-    private static final String cpuUsageFormat = "CPUUsageFormat";
 
     private static final String newDivider =   "<tr><td colspan=4><font size =-1><hr>";
     private static final String newTable =     "<tr><td colspan=4 align=left><table cellpadding=1>";
@@ -70,7 +65,7 @@
     }
 
     public static String getTabName() {
-        return Resources.getText("SummaryTab.tabName");
+        return Messages.SUMMARY_TAB_TAB_NAME;
     }
 
     public SummaryTab(VMPanel vmPanel) {
@@ -83,7 +78,7 @@
         add(new JScrollPane(info));
 
         headerDateTimeFormat =
-            getDateTimeFormat("SummaryTab.headerDateTimeFormat");
+            Formatter.getDateTimeFormat(Messages.SUMMARY_TAB_HEADER_DATE_TIME_FORMAT);
     }
 
     public SwingWorker<?, ?> newSwingWorker() {
@@ -138,7 +133,7 @@
                proxyClient.getSunOperatingSystemMXBean();
 
             append("<tr><td colspan=4>");
-            append("<center><b>" + getText("SummaryTab.tabName") + "</b></center>");
+            append("<center><b>" + Messages.SUMMARY_TAB_TAB_NAME + "</b></center>");
             String dateTime =
                 headerDateTimeFormat.format(System.currentTimeMillis());
             append("<center>" + dateTime + "</center>");
@@ -147,30 +142,30 @@
 
             {  // VM info
                 append(newLeftTable);
-                append("Connection name", vmPanel.getDisplayName());
-                append("Virtual Machine",
-                       getText("SummaryTab.vmVersion",
-                               rmBean.getVmName(), rmBean.getVmVersion()));
-                append("Vendor", rmBean.getVmVendor());
-                append("Name", rmBean.getName());
+                append(Messages.CONNECTION_NAME, vmPanel.getDisplayName());
+                append(Messages.VIRTUAL_MACHINE,
+                       Resources.format(Messages.SUMMARY_TAB_VM_VERSION,
+                                        rmBean.getVmName(), rmBean.getVmVersion()));
+                append(Messages.VENDOR, rmBean.getVmVendor());
+                append(Messages.NAME, rmBean.getName());
                 append(endTable);
 
                 append(newRightTable);
                 result.upTime = rmBean.getUptime();
-                append("Uptime", formatTime(result.upTime));
+                append(Messages.UPTIME, formatTime(result.upTime));
                 if (sunOSMBean != null) {
                     result.processCpuTime = sunOSMBean.getProcessCpuTime();
-                    append("Process CPU time", formatNanoTime(result.processCpuTime));
+                    append(Messages.PROCESS_CPU_TIME, formatNanoTime(result.processCpuTime));
                 }
 
                 if (cmpMBean != null) {
-                    append("JIT compiler", cmpMBean.getName());
-                    append("Total compile time",
+                    append(Messages.JIT_COMPILER, cmpMBean.getName());
+                    append(Messages.TOTAL_COMPILE_TIME,
                            cmpMBean.isCompilationTimeMonitoringSupported()
                                     ? formatTime(cmpMBean.getTotalCompilationTime())
-                                    : getText("Unavailable"));
+                                    : Messages.UNAVAILABLE);
                 } else {
-                    append("JIT compiler", getText("Unavailable"));
+                    append(Messages.JIT_COMPILER, Messages.UNAVAILABLE);
                 }
                 append(endTable);
             }
@@ -185,10 +180,10 @@
                 long ttCount = tmBean.getTotalStartedThreadCount();
                 String[] strings1 = formatLongs(tlCount, tpCount,
                                                 tdCount, ttCount);
-                append("Live Threads",          strings1[0]);
-                append("Peak",                  strings1[1]);
-                append("Daemon threads",        strings1[2]);
-                append("Total threads started", strings1[3]);
+                append(Messages.LIVE_THREADS, strings1[0]);
+                append(Messages.PEAK, strings1[1]);
+                append(Messages.DAEMON_THREADS, strings1[2]);
+                append(Messages.TOTAL_THREADS_STARTED, strings1[3]);
                 append(endTable);
 
                 append(newRightTable);
@@ -196,9 +191,9 @@
                 long cuCount = clMBean.getUnloadedClassCount();
                 long ctCount = clMBean.getTotalLoadedClassCount();
                 String[] strings2 = formatLongs(clCount, cuCount, ctCount);
-                append("Current classes loaded", strings2[0]);
-                append("Total classes loaded",   strings2[2]);
-                append("Total classes unloaded", strings2[1]);
+                append(Messages.CURRENT_CLASSES_LOADED, strings2[0]);
+                append(Messages.TOTAL_CLASSES_LOADED, strings2[2]);
+                append(Messages.TOTAL_CLASSES_UNLOADED, strings2[1]);
                 append(null, "");
                 append(endTable);
             }
@@ -210,16 +205,16 @@
 
                 append(newLeftTable);
                 String[] strings1 = formatKByteStrings(u.getUsed(), u.getMax());
-                append("Current heap size", strings1[0]);
-                append("Maximum heap size", strings1[1]);
+                append(Messages.CURRENT_HEAP_SIZE, strings1[0]);
+                append(Messages.MAXIMUM_HEAP_SIZE, strings1[1]);
                 append(endTable);
 
                 append(newRightTable);
                 String[] strings2 = formatKByteStrings(u.getCommitted());
-                append("Committed memory",  strings2[0]);
-                append("SummaryTab.pendingFinalization.label",
-                       getText("SummaryTab.pendingFinalization.value",
-                               memoryBean.getObjectPendingFinalizationCount()));
+                append(Messages.COMMITTED_MEMORY,  strings2[0]);
+                append(Messages.SUMMARY_TAB_PENDING_FINALIZATION_LABEL,
+                       Messages.SUMMARY_TAB_PENDING_FINALIZATION_VALUE,
+                       memoryBean.getObjectPendingFinalizationCount());
                 append(endTable);
 
                 append(newTable);
@@ -230,10 +225,10 @@
                     long gcCount = garbageCollectorMBean.getCollectionCount();
                     long gcTime = garbageCollectorMBean.getCollectionTime();
 
-                    append("Garbage collector",
-                           getText("GcInfo", gcName, gcCount,
-                                   (gcTime >= 0) ? formatTime(gcTime)
-                                                 : getText("Unavailable")),
+                    append(Messages.GARBAGE_COLLECTOR,
+                           Resources.format(Messages.GC_INFO, gcName, gcCount,
+                                            (gcTime >= 0) ? formatTime(gcTime)
+                                                 : Messages.UNAVAILABLE),
                            4);
                 }
                 append(endTable);
@@ -247,9 +242,9 @@
                 String osVersion = osMBean.getVersion();
                 String osArch = osMBean.getArch();
                 result.nCPUs = osMBean.getAvailableProcessors();
-                append("Operating System", osName + " " + osVersion);
-                append("Architecture", osArch);
-                append("Number of processors", result.nCPUs+"");
+                append(Messages.OPERATING_SYSTEM, osName + " " + osVersion);
+                append(Messages.ARCHITECTURE, osArch);
+                append(Messages.NUMBER_OF_PROCESSORS, result.nCPUs+"");
 
                 if (pathSeparator == null) {
                     // Must use separator of remote OS, not File.pathSeparator
@@ -268,14 +263,14 @@
                                            sunOSMBean.getTotalSwapSpaceSize(),
                                            sunOSMBean.getFreeSwapSpaceSize());
 
-                    append("Committed virtual memory", kbStrings1[0]);
+                    append(Messages.COMMITTED_VIRTUAL_MEMORY, kbStrings1[0]);
                     append(endTable);
 
                     append(newRightTable);
-                    append("Total physical memory", kbStrings2[0]);
-                    append("Free physical memory",  kbStrings2[1]);
-                    append("Total swap space",      kbStrings2[2]);
-                    append("Free swap space",       kbStrings2[3]);
+                    append(Messages.TOTAL_PHYSICAL_MEMORY, kbStrings2[0]);
+                    append(Messages.FREE_PHYSICAL_MEMORY,  kbStrings2[1]);
+                    append(Messages.TOTAL_SWAP_SPACE,      kbStrings2[2]);
+                    append(Messages.FREE_SWAP_SPACE,       kbStrings2[3]);
                 }
 
                 append(endTable);
@@ -290,13 +285,13 @@
                 for (String arg : inputArguments) {
                     args += arg + " ";
                 }
-                append("VM arguments", args, 4);
-                append("Class path",   rmBean.getClassPath(), 4);
-                append("Library path", rmBean.getLibraryPath(), 4);
-                append("Boot class path",
+                append(Messages.VM_ARGUMENTS, args, 4);
+                append(Messages.CLASS_PATH,   rmBean.getClassPath(), 4);
+                append(Messages.LIBRARY_PATH, rmBean.getLibraryPath(), 4);
+                append(Messages.BOOT_CLASS_PATH,
                        rmBean.isBootClassPathSupported()
                                     ? rmBean.getBootClassPath()
-                                    : getText("Unavailable"),
+                                    : Messages.UNAVAILABLE,
                        4);
                 append(endTable);
             }
@@ -327,7 +322,7 @@
     }
 
     void append(String label, String value) {
-        append(newRow((label != null) ? getText(label) : label, value));
+        append(newRow(label, value));
     }
 
     private void append(String label, String value, int columnPerRow) {
@@ -335,13 +330,7 @@
             value = value.replace(pathSeparator,
                                   "<b></b>" + pathSeparator);
         }
-        append(newRow(getText(label), value, columnPerRow));
-    }
-
-    void append(String label1, String value1,
-                String label2, String value2) {
-        append(newRow(getText(label1), value1,
-                      getText(label2), value2));
+        append(newRow(label, value, columnPerRow));
     }
 
     OverviewPanel[] getOverviewPanels() {
@@ -355,7 +344,7 @@
         private long prevUpTime, prevProcessCpuTime;
 
         CPUOverviewPanel() {
-            super(getText("CPU Usage"), cpuUsageKey, cpuUsageName, Plotter.Unit.PERCENT);
+            super(Messages.CPU_USAGE, cpuUsageKey, Messages.CPU_USAGE, Plotter.Unit.PERCENT);
             getPlotter().setDecimals(CPU_DECIMALS);
         }
 
@@ -373,14 +362,11 @@
 
                 getPlotter().addValues(result.timeStamp,
                                 Math.round(cpuUsage * Math.pow(10.0, CPU_DECIMALS)));
-                getInfoLabel().setText(getText(cpuUsageFormat,
+                getInfoLabel().setText(Resources.format(Messages.CPU_USAGE_FORMAT,
                                                String.format("%."+CPU_DECIMALS+"f", cpuUsage)));
             }
             this.prevUpTime = result.upTime;
             this.prevProcessCpuTime = result.processCpuTime;
         }
     }
-
-
-
 }
--- a/src/share/classes/sun/tools/jconsole/Tab.java	Wed Sep 05 15:19:51 2012 -0700
+++ b/src/share/classes/sun/tools/jconsole/Tab.java	Wed Sep 12 12:32:05 2012 -0700
@@ -26,9 +26,6 @@
 package sun.tools.jconsole;
 
 import java.awt.*;
-import java.awt.event.*;
-import java.beans.*;
-
 import javax.swing.*;
 
 public abstract class Tab extends JPanel {
--- a/src/share/classes/sun/tools/jconsole/ThreadTab.java	Wed Sep 05 15:19:51 2012 -0700
+++ b/src/share/classes/sun/tools/jconsole/ThreadTab.java	Wed Sep 12 12:32:05 2012 -0700
@@ -35,14 +35,11 @@
 import javax.swing.border.*;
 import javax.swing.event.*;
 
+
 import java.util.*;
 import java.util.concurrent.*;
 import java.util.List;
 
-import sun.awt.*;
-
-import static sun.tools.jconsole.OverviewPanel.*;
-import static sun.tools.jconsole.Resources.*;
 import static sun.tools.jconsole.Utilities.*;
 
 
@@ -51,7 +48,7 @@
     PlotterPanel threadMeter;
     TimeComboBox timeComboBox;
     JTabbedPane threadListTabbedPane;
-    DefaultListModel listModel;
+    DefaultListModel<Long> listModel;
     JTextField filterTF;
     JLabel messageLabel;
     JSplitPane threadsSplitPane;
@@ -64,9 +61,6 @@
     private static final String threadCountKey   = "threadCount";
     private static final String peakKey          = "peak";
 
-    private static final String threadCountName   = Resources.getText("Live Threads");
-    private static final String peakName          = Resources.getText("Peak");
-
     private static final Color  threadCountColor = Plotter.defaultColor;
     private static final Color  peakColor        = Color.red;
 
@@ -93,7 +87,7 @@
 
 
     public static String getTabName() {
-        return Resources.getText("Threads");
+        return Messages.THREADS;
     }
 
     public ThreadTab(VMPanel vmPanel) {
@@ -111,28 +105,28 @@
         JPanel controlPanel = new JPanel(new FlowLayout(FlowLayout.CENTER, 20, 5));
         topPanel.add(controlPanel, BorderLayout.CENTER);
 
-        threadMeter = new PlotterPanel(Resources.getText("Number of Threads"),
+        threadMeter = new PlotterPanel(Messages.NUMBER_OF_THREADS,
                                        Plotter.Unit.NONE, true);
-        threadMeter.plotter.createSequence(threadCountKey, threadCountName,  threadCountColor, true);
-        threadMeter.plotter.createSequence(peakKey,        peakName,         peakColor,        true);
+        threadMeter.plotter.createSequence(threadCountKey, Messages.LIVE_THREADS,  threadCountColor, true);
+        threadMeter.plotter.createSequence(peakKey,        Messages.PEAK,         peakColor,        true);
         setAccessibleName(threadMeter.plotter,
-                          getText("ThreadTab.threadPlotter.accessibleName"));
+                          Messages.THREAD_TAB_THREAD_PLOTTER_ACCESSIBLE_NAME);
 
         plotterPanel.add(threadMeter);
 
         timeComboBox = new TimeComboBox(threadMeter.plotter);
-        controlPanel.add(new LabeledComponent(Resources.getText("Time Range:"),
-                                              getMnemonicInt("Time Range:"),
+        controlPanel.add(new LabeledComponent(Messages.TIME_RANGE_COLON,
+                                              Resources.getMnemonicInt(Messages.TIME_RANGE_COLON),
                                               timeComboBox));
 
-        listModel = new DefaultListModel();
+        listModel = new DefaultListModel<Long>();
 
         JTextArea textArea = new JTextArea();
         textArea.setBorder(thinEmptyBorder);
         textArea.setEditable(false);
         setAccessibleName(textArea,
-                          getText("ThreadTab.threadInfo.accessibleName"));
-        JList list = new ThreadJList(listModel, textArea);
+                          Messages.THREAD_TAB_THREAD_INFO_ACCESSIBLE_NAME);
+        ThreadJList list = new ThreadJList(listModel, textArea);
 
         Dimension di = new Dimension(super.getPreferredSize());
         di.width = Math.min(di.width, 200);
@@ -165,11 +159,11 @@
                                                  filterTF.getPreferredSize().height));
         firstTabToolPanel.add(separator);
 
-        JButton detectDeadlockButton = new JButton(Resources.getText("Detect Deadlock"));
-        detectDeadlockButton.setMnemonic(getMnemonicInt("Detect Deadlock"));
+        JButton detectDeadlockButton = new JButton(Messages.DETECT_DEADLOCK);
+        detectDeadlockButton.setMnemonic(Resources.getMnemonicInt(Messages.DETECT_DEADLOCK));
         detectDeadlockButton.setActionCommand("detectDeadlock");
         detectDeadlockButton.addActionListener(this);
-        detectDeadlockButton.setToolTipText(getText("Detect Deadlock.toolTip"));
+        detectDeadlockButton.setToolTipText(Messages.DETECT_DEADLOCK_TOOLTIP);
         firstTabToolPanel.add(detectDeadlockButton);
 
         messageLabel = new JLabel();
@@ -177,7 +171,7 @@
 
         firstTabPanel.add(threadsSplitPane, BorderLayout.CENTER);
         firstTabPanel.add(firstTabToolPanel, BorderLayout.SOUTH);
-        threadListTabbedPane.addTab(Resources.getText("Threads"), firstTabPanel);
+        threadListTabbedPane.addTab(Messages.THREADS, firstTabPanel);
 
         plotterPanel.add(threadListTabbedPane);
     }
@@ -356,32 +350,32 @@
                         }
                         if (ti != null) {
                             if (ti.getLockName() == null) {
-                                sb.append(Resources.getText("Name State",
+                                sb.append(Resources.format(Messages.NAME_STATE,
                                               ti.getThreadName(),
                                               ti.getThreadState().toString()));
                             } else if (ti.getLockOwnerName() == null) {
-                                sb.append(Resources.getText("Name State LockName",
+                                sb.append(Resources.format(Messages.NAME_STATE_LOCK_NAME,
                                               ti.getThreadName(),
                                               ti.getThreadState().toString(),
                                               ti.getLockName()));
                             } else {
-                                sb.append(Resources.getText("Name State LockName LockOwner",
+                                sb.append(Resources.format(Messages.NAME_STATE_LOCK_NAME_LOCK_OWNER,
                                               ti.getThreadName(),
                                               ti.getThreadState().toString(),
                                               ti.getLockName(),
                                               ti.getLockOwnerName()));
                             }
-                            sb.append(Resources.getText("BlockedCount WaitedCount",
+                            sb.append(Resources.format(Messages.BLOCKED_COUNT_WAITED_COUNT,
                                               ti.getBlockedCount(),
                                               ti.getWaitedCount()));
-                            sb.append(Resources.getText("Stack trace"));
+                            sb.append(Messages.STACK_TRACE);
                             int index = 0;
                             for (StackTraceElement e : ti.getStackTrace()) {
                                 sb.append(e.toString()+"\n");
                                 if (monitors != null) {
                                     for (MonitorInfo mi : monitors) {
                                         if (mi.getLockedStackDepth() == index) {
-                                            sb.append(Resources.getText("Monitor locked", mi.toString()));
+                                            sb.append(Resources.format(Messages.MONITOR_LOCKED, mi.toString()));
                                         }
                                     }
                                 }
@@ -429,7 +423,7 @@
                                 try {
                                     SwingUtilities.invokeAndWait(new Runnable() {
                                         public void run() {
-                                            String msg = Resources.getText("No deadlock detected");
+                                            String msg = Messages.NO_DEADLOCK_DETECTED;
                                             messageLabel.setText(msg);
                                             threadListTabbedPane.revalidate();
                                         }
@@ -459,13 +453,13 @@
 
                             if (deadlockedThreads != null) {
                                 for (int i = 0; i < deadlockedThreads.length; i++) {
-                                    DefaultListModel listModel = new DefaultListModel();
+                                    DefaultListModel<Long> listModel = new DefaultListModel<Long>();
                                     JTextArea textArea = new JTextArea();
                                     textArea.setBorder(thinEmptyBorder);
                                     textArea.setEditable(false);
                                     setAccessibleName(textArea,
-                                        getText("ThreadTab.threadInfo.accessibleName"));
-                                    JList list = new ThreadJList(listModel, textArea);
+                                                      Messages.THREAD_TAB_THREAD_INFO_ACCESSIBLE_NAME);
+                                    ThreadJList list = new ThreadJList(listModel, textArea);
                                     JScrollPane threadlistSP = new JScrollPane(list);
                                     JScrollPane textAreaSP = new JScrollPane(textArea);
                                     threadlistSP.setBorder(null);
@@ -477,9 +471,9 @@
                                     splitPane.setDividerLocation(threadsSplitPane.getDividerLocation());
                                     String tabName;
                                     if (deadlockedThreads.length > 1) {
-                                        tabName = Resources.getText("deadlockTabN", i+1);
+                                        tabName = Resources.format(Messages.DEADLOCK_TAB_N, i+1);
                                     } else {
-                                        tabName = Resources.getText("deadlockTab");
+                                        tabName = Messages.DEADLOCK_TAB;
                                     }
                                     threadListTabbedPane.addTab(tabName, splitPane);
 
@@ -591,10 +585,10 @@
 
 
 
-    private class ThreadJList extends JList {
+    private class ThreadJList extends JList<Long> {
         private JTextArea textArea;
 
-        ThreadJList(DefaultListModel listModel, JTextArea textArea) {
+        ThreadJList(DefaultListModel<Long> listModel, JTextArea textArea) {
             super(listModel);
 
             this.textArea = textArea;
@@ -603,7 +597,7 @@
 
             addListSelectionListener(ThreadTab.this);
             setCellRenderer(new DefaultListCellRenderer() {
-                public Component getListCellRendererComponent(JList list, Object value, int index,
+                public Component getListCellRendererComponent(JList<?> list, Object value, int index,
                                                               boolean isSelected, boolean cellHasFocus) {
                     super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus);
 
@@ -691,12 +685,12 @@
 
     private static class ThreadOverviewPanel extends OverviewPanel {
         ThreadOverviewPanel() {
-            super(getText("Threads"), threadCountKey, threadCountName, null);
+            super(Messages.THREADS, threadCountKey,  Messages.LIVE_THREADS, null);
         }
 
         private void updateThreadsInfo(long tlCount, long tpCount, long ttCount, long timeStamp) {
             getPlotter().addValues(timeStamp, tlCount);
-            getInfoLabel().setText(getText(infoLabelFormat, tlCount, tpCount, ttCount));
+            getInfoLabel().setText(Resources.format(infoLabelFormat, tlCount, tpCount, ttCount));
         }
     }
 }
--- a/src/share/classes/sun/tools/jconsole/VMInternalFrame.java	Wed Sep 05 15:19:51 2012 -0700
+++ b/src/share/classes/sun/tools/jconsole/VMInternalFrame.java	Wed Sep 12 12:32:05 2012 -0700
@@ -26,16 +26,9 @@
 package sun.tools.jconsole;
 
 import java.awt.*;
-import java.awt.event.*;
-import java.io.*;
-import java.util.*;
+import javax.swing.*;
 
-import javax.swing.*;
-import javax.swing.Timer;
-import javax.swing.border.*;
-import javax.swing.event.*;
 
-import static sun.tools.jconsole.Resources.*;
 import static sun.tools.jconsole.Utilities.*;
 
 @SuppressWarnings("serial")
@@ -47,7 +40,7 @@
 
         this.vmPanel = vmPanel;
         setAccessibleDescription(this,
-                                 getText("VMInternalFrame.accessibleDescription"));
+                                 Messages.VMINTERNAL_FRAME_ACCESSIBLE_DESCRIPTION);
         getContentPane().add(vmPanel, BorderLayout.CENTER);
         pack();
         vmPanel.updateFrameTitle();
--- a/src/share/classes/sun/tools/jconsole/VMPanel.java	Wed Sep 05 15:19:51 2012 -0700
+++ b/src/share/classes/sun/tools/jconsole/VMPanel.java	Wed Sep 12 12:32:05 2012 -0700
@@ -28,18 +28,16 @@
 import java.awt.*;
 import java.awt.event.*;
 import java.beans.*;
-import java.io.*;
 import java.lang.reflect.*;
 import java.util.*;
 import java.util.List;
 import java.util.Timer;
-
 import javax.swing.*;
 import javax.swing.plaf.*;
 
+
 import com.sun.tools.jconsole.JConsolePlugin;
 import com.sun.tools.jconsole.JConsoleContext;
-import static com.sun.tools.jconsole.JConsoleContext.ConnectionState.*;
 
 import static sun.tools.jconsole.ProxyClient.*;
 
@@ -51,13 +49,10 @@
     private int updateInterval;
     private String hostName;
     private int port;
-    private int vmid;
     private String userName;
     private String password;
     private String url;
     private VMInternalFrame vmIF = null;
-    private static final String windowsLaF =
-            "com.sun.java.swing.plaf.windows.WindowsLookAndFeel";
     private static ArrayList<TabInfo> tabInfos = new ArrayList<TabInfo>();
     private boolean wasConnected = false;
 
@@ -100,7 +95,6 @@
         this.updateInterval = updateInterval;
         this.hostName = proxyClient.getHostName();
         this.port = proxyClient.getPort();
-        this.vmid = proxyClient.getVmid();
         this.userName = proxyClient.getUserName();
         this.password = proxyClient.getPassword();
         this.url = proxyClient.getUrl();
@@ -186,9 +180,9 @@
     public String getToolTipText(MouseEvent event) {
         if (connectedIconBounds.contains(event.getPoint())) {
             if (isConnected()) {
-                return getText("Connected. Click to disconnect.");
+                return Messages.CONNECTED_PUNCTUATION_CLICK_TO_DISCONNECT_;
             } else {
-                return getText("Disconnected. Click to connect.");
+                return Messages.DISCONNECTED_PUNCTUATION_CLICK_TO_CONNECT_;
             }
         } else {
             return super.getToolTipText(event);
@@ -219,7 +213,7 @@
 
     private Tab instantiate(TabInfo tabInfo) {
         try {
-            Constructor con = tabInfo.tabClass.getConstructor(VMPanel.class);
+            Constructor<?> con = tabInfo.tabClass.getConstructor(VMPanel.class);
             return (Tab) con.newInstance(this);
         } catch (Exception ex) {
             System.err.println(ex);
@@ -354,7 +348,7 @@
     private void onConnecting() {
         time0 = System.currentTimeMillis();
 
-        final JConsole jc = (JConsole) SwingUtilities.getWindowAncestor(this);
+        SwingUtilities.getWindowAncestor(this);
 
         String connectionName = getConnectionName();
         progressBar = new JProgressBar();
@@ -363,9 +357,9 @@
         progressPanel.add(progressBar);
 
         Object[] message = {
-            "<html><h3>" + getText("connectingTo1", connectionName) + "</h3></html>",
+            "<html><h3>" + Resources.format(Messages.CONNECTING_TO1, connectionName) + "</h3></html>",
             progressPanel,
-            "<html><b>" + getText("connectingTo2", connectionName) + "</b></html>"
+            "<html><b>" + Resources.format(Messages.CONNECTING_TO2, connectionName) + "</b></html>"
         };
 
         optionPane =
@@ -373,7 +367,7 @@
                 message,
                 JOptionPane.DEFAULT_OPTION,
                 JOptionPane.INFORMATION_MESSAGE, null,
-                new String[]{getText("Cancel")},
+                new String[]{Messages.CANCEL},
                 0);
 
 
@@ -409,7 +403,7 @@
         if (vmIF != null) {
             String displayName = getDisplayName();
             if (!proxyClient.isConnected()) {
-                displayName = getText("ConnectionName (disconnected)", displayName);
+                displayName = Resources.format(Messages.CONNECTION_NAME__DISCONNECTED_, displayName);
             }
             vmIF.setTitle(displayName);
         }
@@ -458,25 +452,18 @@
     private void vmPanelDied() {
         disconnect();
 
-        final JConsole jc = (JConsole) SwingUtilities.getWindowAncestor(this);
-
         JOptionPane optionPane;
-
-        final String connectStr = getText("Connect");
-        final String reconnectStr = getText("Reconnect");
-        final String cancelStr = getText("Cancel");
-
         String msgTitle, msgExplanation, buttonStr;
 
         if (wasConnected) {
             wasConnected = false;
-            msgTitle = getText("connectionLost1");
-            msgExplanation = getText("connectionLost2", getConnectionName());
-            buttonStr = reconnectStr;
+            msgTitle = Messages.CONNECTION_LOST1;
+            msgExplanation = Resources.format(Messages.CONNECTING_TO2, getConnectionName());
+            buttonStr = Messages.RECONNECT;
         } else {
-            msgTitle = getText("connectionFailed1");
-            msgExplanation = getText("connectionFailed2", getConnectionName());
-            buttonStr = connectStr;
+            msgTitle =Messages.CONNECTION_FAILED1;
+            msgExplanation = Resources.format(Messages.CONNECTION_FAILED2, getConnectionName());
+            buttonStr = Messages.CONNECT;
         }
 
         optionPane =
@@ -485,7 +472,7 @@
                 "<b>" + msgExplanation + "</b>",
                 JOptionPane.DEFAULT_OPTION,
                 JOptionPane.WARNING_MESSAGE, null,
-                new String[]{buttonStr, cancelStr},
+                new String[]{buttonStr, Messages.CANCEL},
                 0);
 
         optionPane.addPropertyChangeListener(new PropertyChangeListener() {
@@ -494,7 +481,7 @@
                 if (event.getPropertyName().equals(JOptionPane.VALUE_PROPERTY)) {
                     Object value = event.getNewValue();
 
-                    if (value == reconnectStr || value == connectStr) {
+                    if (value == Messages.RECONNECT || value == Messages.CONNECT) {
                         connect();
                     } else if (!everConnected) {
                         try {
@@ -643,11 +630,6 @@
         }
     }
 
-    // Convenience methods
-    private static String getText(String key, Object... args) {
-        return Resources.getText(key, args);
-    }
-
     private void createPluginTabs() {
         // add plugin tabs if not done
         if (!pluginTabsAdded) {
--- a/src/share/classes/sun/tools/jconsole/VariableGridLayout.java	Wed Sep 05 15:19:51 2012 -0700
+++ b/src/share/classes/sun/tools/jconsole/VariableGridLayout.java	Wed Sep 12 12:32:05 2012 -0700
@@ -26,7 +26,6 @@
 package sun.tools.jconsole;
 
 import java.awt.*;
-import java.util.*;
 
 import javax.swing.*;
 
--- a/src/share/classes/sun/tools/jconsole/Version.java.template	Wed Sep 05 15:19:51 2012 -0700
+++ b/src/share/classes/sun/tools/jconsole/Version.java.template	Wed Sep 12 12:32:05 2012 -0700
@@ -26,6 +26,7 @@
 package sun.tools.jconsole;
 
 import java.io.PrintStream;
+import sun.tools.jconsole.Messages;
 
 public class Version {
     private static final String jconsole_version =
@@ -34,19 +35,19 @@
     public static void print(PrintStream ps) {
         printFullVersion(ps);
 
-        ps.println(Resources.getText("Name and Build",
-                                     System.getProperty("java.runtime.name"),
-                                     System.getProperty("java.runtime.version")));
+        ps.println(Resources.format(Messages.NAME_AND_BUILD,
+                                    System.getProperty("java.runtime.name"),
+                                    System.getProperty("java.runtime.version")));
 
-        ps.println(Resources.getText("Name Build and Mode",
-                                     System.getProperty("java.vm.name"),
-                                     System.getProperty("java.vm.version"),
-                                     System.getProperty("java.vm.info")));
+        ps.println(Resources.format(Messages.NAME_AND_BUILD,
+                                    System.getProperty("java.vm.name"),
+                                    System.getProperty("java.vm.version"),
+                                    System.getProperty("java.vm.info")));
 
     }
 
     public static void printFullVersion(PrintStream ps) {
-        ps.println(Resources.getText("JConsole version", jconsole_version));
+        ps.println(Resources.format(Messages.JCONSOLE_VERSION, jconsole_version));
     }
 
     static String getVersion() {
--- a/src/share/classes/sun/tools/jconsole/inspector/OperationEntry.java	Wed Sep 05 15:19:51 2012 -0700
+++ b/src/share/classes/sun/tools/jconsole/inspector/OperationEntry.java	Wed Sep 12 12:32:05 2012 -0700
@@ -25,30 +25,14 @@
 
 package sun.tools.jconsole.inspector;
 
-// java import
 import java.awt.*;
-import java.awt.event.*;
-import java.awt.dnd.*;
-import java.lang.reflect.*;
-import java.io.*;
-//
-
-// swing import
-import javax.swing.border.*;
-import javax.swing.event.*;
 import javax.swing.*;
-//
-
-// jmx import
 import javax.management.*;
-//
-
 
 @SuppressWarnings("serial")
 public class OperationEntry extends JPanel {
     private MBeanOperationInfo operation;
     private JComboBox sigs;
-    private Dimension preferredSize;
     private XTextField inputs[];
 
     public OperationEntry (MBeanOperationInfo operation,
@@ -61,26 +45,10 @@
         setPanel(isCallable, button, xoperations);
     }
 
-    /**
-     * This method chops off the throws exceptions, removes "java.lang".
-     */
-    private String preProcessSignature(String signature) {
-        int index;
-        if ((index=signature.indexOf(" throws"))>0) {
-            signature = signature.substring(0,index);
-        }
-        while ((index = signature.indexOf("java.lang."))>0) {
-            signature = signature.substring(0,index)+
-                signature.substring(index+10,signature.length());
-        }
-        return signature;
-    }
-
-    private void setPanel(boolean isCallable,
+     private void setPanel(boolean isCallable,
                           JButton button,
                           XOperations xoperations) {
         try {
-            String defaultVal;
             MBeanParameterInfo params[] = operation.getSignature();
             add(new JLabel("(",JLabel.CENTER));
             inputs = new XTextField[params.length];
--- a/src/share/classes/sun/tools/jconsole/inspector/TableSorter.java	Wed Sep 05 15:19:51 2012 -0700
+++ b/src/share/classes/sun/tools/jconsole/inspector/TableSorter.java	Wed Sep 12 12:32:05 2012 -0700
@@ -94,7 +94,7 @@
     @SuppressWarnings("unchecked")
     private int compare(Object o1, Object o2) {
         // take care of the case where both o1 & o2 are null. Needed to keep
-        // the method symetric. Without this quickSort gives surprising results.
+        // the method symmetric. Without this quickSort gives surprising results.
         if (o1 == o2)
             return 0;
         if (o1==null)
--- a/src/share/classes/sun/tools/jconsole/inspector/ThreadDialog.java	Wed Sep 05 15:19:51 2012 -0700
+++ b/src/share/classes/sun/tools/jconsole/inspector/ThreadDialog.java	Wed Sep 12 12:32:05 2012 -0700
@@ -28,7 +28,6 @@
 // java import
 import java.awt.*;
 import javax.swing.*;
-import java.io.*;
 //
 
 public class ThreadDialog implements Runnable {
--- a/src/share/classes/sun/tools/jconsole/inspector/Utils.java	Wed Sep 05 15:19:51 2012 -0700
+++ b/src/share/classes/sun/tools/jconsole/inspector/Utils.java	Wed Sep 12 12:32:05 2012 -0700
@@ -284,7 +284,7 @@
      */
     public static Object newStringConstructor(String type, String param)
             throws Exception {
-        Constructor c = Utils.getClass(type).getConstructor(String.class);
+        Constructor<?> c = Utils.getClass(type).getConstructor(String.class);
         try {
             return c.newInstance(param);
         } catch (InvocationTargetException e) {
--- a/src/share/classes/sun/tools/jconsole/inspector/XArrayDataViewer.java	Wed Sep 05 15:19:51 2012 -0700
+++ b/src/share/classes/sun/tools/jconsole/inspector/XArrayDataViewer.java	Wed Sep 12 12:32:05 2012 -0700
@@ -46,9 +46,9 @@
         if (isViewableValue(value)) {
             Object[] arr;
             if (value instanceof Collection) {
-                arr = ((Collection) value).toArray();
+                arr = ((Collection<?>) value).toArray();
             } else if (value instanceof Map) {
-                arr = ((Map) value).entrySet().toArray();
+                arr = ((Map<?,?>) value).entrySet().toArray();
             } else if (value instanceof Object[]) {
                 arr = (Object[]) value;
             } else {
--- a/src/share/classes/sun/tools/jconsole/inspector/XDataViewer.java	Wed Sep 05 15:19:51 2012 -0700
+++ b/src/share/classes/sun/tools/jconsole/inspector/XDataViewer.java	Wed Sep 12 12:32:05 2012 -0700
@@ -34,7 +34,7 @@
 import java.awt.Container;
 
 import sun.tools.jconsole.MBeansTab;
-import sun.tools.jconsole.Resources;
+import sun.tools.jconsole.Messages;
 
 public class XDataViewer {
 
@@ -100,10 +100,10 @@
     public static String getActionLabel(int type) {
         if(type == ARRAY ||
            type == OPEN)
-            return Resources.getText("visualize");
+            return Messages.VISUALIZE;
         if(type == NUMERIC)
-            return Resources.getText("plot");
-        return Resources.getText("expand");
+            return Messages.PLOT;
+        return Messages.EXPAND;
     }
 
     public Component createOperationViewer(Object value,
--- a/src/share/classes/sun/tools/jconsole/inspector/XMBeanAttributes.java	Wed Sep 05 15:19:51 2012 -0700
+++ b/src/share/classes/sun/tools/jconsole/inspector/XMBeanAttributes.java	Wed Sep 12 12:32:05 2012 -0700
@@ -66,9 +66,9 @@
 import javax.swing.table.TableColumnModel;
 import javax.swing.table.TableModel;
 
-import sun.tools.jconsole.Resources;
 import sun.tools.jconsole.MBeansTab;
 import sun.tools.jconsole.JConsole;
+import sun.tools.jconsole.Messages;
 import sun.tools.jconsole.ProxyClient.SnapshotMBeanServerConnection;
 
 /*IMPORTANT :
@@ -84,8 +84,8 @@
             Logger.getLogger(XMBeanAttributes.class.getPackage().getName());
 
     private final static String[] columnNames =
-    {Resources.getText("Name"),
-     Resources.getText("Value")};
+    {Messages.NAME,
+     Messages.VALUE};
 
     private XMBean mbean;
     private MBeanInfo mbeanInfo;
@@ -267,7 +267,7 @@
 
     public boolean isColumnEditable(int column) {
         if (column < getColumnCount()) {
-            return getColumnName(column).equals(Resources.getText("Value"));
+            return getColumnName(column).equals(Messages.VALUE);
         }
         else {
             return false;
@@ -313,7 +313,7 @@
             if (value != null) {
                 tip = value.toString();
                 if(isAttributeViewable(row, VALUE_COLUMN))
-                    tip = Resources.getText("Double click to expand/collapse")+
+                    tip = Messages.DOUBLE_CLICK_TO_EXPAND_FORWARD_SLASH_COLLAPSE+
                         ". " + tip;
             }
 
@@ -589,7 +589,7 @@
                               comp,
                               rowMinHeight);
 
-                    mbeansTab.getDataViewer().registerForMouseEvent(
+                    XDataViewer.registerForMouseEvent(
                             comp, mouseListener);
                 } else
                     return cell;
@@ -724,7 +724,7 @@
                         mbeansTab.getDataViewer().createAttributeViewer(
                             value, mbean, attribute, XMBeanAttributes.this);
                     cell.init(cell.getMinRenderer(), comp, cell.getMinHeight());
-                    mbeansTab.getDataViewer().registerForMouseEvent(comp, mouseListener);
+                    XDataViewer.registerForMouseEvent(comp, mouseListener);
                 }
             } else {
                 cell = new ZoomedCell(value);
@@ -735,7 +735,7 @@
         }
     }
 
-    //will be called in a synchronzed block
+    //will be called in a synchronized block
     protected void addTableData(DefaultTableModel tableModel,
                                 XMBean mbean,
                                 MBeanAttributeInfo[] attributesInfo,
@@ -749,7 +749,7 @@
         for (int i = 0; i < attributesInfo.length; i++) {
             rowData[0] = (attributesInfo[i].getName());
             if (unavailableAttributes.containsKey(rowData[0])) {
-                rowData[1] = Resources.getText("Unavailable");
+                rowData[1] = Messages.UNAVAILABLE;
             } else if (viewableAttributes.containsKey(rowData[0])) {
                 rowData[1] = viewableAttributes.get(rowData[0]);
                 if (!attributesInfo[i].isWritable() ||
@@ -811,7 +811,6 @@
         }
     }
 
-    @SuppressWarnings("serial")
     class ValueCellEditor extends XTextFieldEditor {
         // implements javax.swing.table.TableCellEditor
         @Override
@@ -866,7 +865,6 @@
         }
     }
 
-    @SuppressWarnings("serial")
     class MaximizedCellRenderer extends  DefaultTableCellRenderer {
         Component comp;
         MaximizedCellRenderer(Component comp) {
@@ -1018,7 +1016,7 @@
                             (String)tableValue);// value
                     } catch (Throwable ex) {
                         popupAndLog(ex,"tableChanged",
-                                "Problem setting attribute");
+                                    Messages.PROBLEM_SETTING_ATTRIBUTE);
                     }
                 }
                 final String attributeName = getValueName(e.getFirstRow());
@@ -1042,7 +1040,7 @@
                         }
                         mbean.setAttribute(attribute);
                     } catch (Throwable ex) {
-                        popupAndLog(ex,method,"Problem setting attribute");
+                        popupAndLog(ex,method,Messages.PROBLEM_SETTING_ATTRIBUTE);
                     }
                     return null;
                 }
@@ -1062,7 +1060,7 @@
         }
 
         // Call this outside EDT
-        private void popupAndLog(Throwable ex, String method, String key) {
+        private void popupAndLog(Throwable ex, String method, String title) {
             ex = Utils.getActualException(ex);
             if (JConsole.isDebug()) ex.printStackTrace();
 
@@ -1070,7 +1068,7 @@
                     : ex.toString();
             EventQueue.invokeLater(
                     new ThreadDialog(component, message+"\n",
-                                     Resources.getText(key),
+                                     title,
                                      JOptionPane.ERROR_MESSAGE));
         }
     }
--- a/src/share/classes/sun/tools/jconsole/inspector/XMBeanInfo.java	Wed Sep 05 15:19:51 2012 -0700
+++ b/src/share/classes/sun/tools/jconsole/inspector/XMBeanInfo.java	Wed Sep 12 12:32:05 2012 -0700
@@ -35,7 +35,8 @@
 import javax.swing.border.TitledBorder;
 import javax.swing.event.*;
 import javax.swing.table.*;
-import sun.tools.jconsole.Resources;
+
+import sun.tools.jconsole.Messages;
 
 import static sun.tools.jconsole.Utilities.*;
 
@@ -43,11 +44,11 @@
 public class XMBeanInfo extends JPanel {
 
     private static final Color lightYellow = new Color(255, 255, 128);
-    private final int NAME_COLUMN = 0;
+     private final int NAME_COLUMN = 0;
     private final int VALUE_COLUMN = 1;
     private final String[] columnNames = {
-        Resources.getText("Name"),
-        Resources.getText("Value")
+        Messages.NAME,
+        Messages.VALUE
     };
     private JTable infoTable = new JTable();
     private JTable descTable = new JTable();
@@ -163,7 +164,7 @@
         descTable.setAutoResizeMode(JTable.AUTO_RESIZE_SUBSEQUENT_COLUMNS);
         JScrollPane descTableScrollPane = new JScrollPane(descTable);
         descBorderPanel.setBorder(
-                BorderFactory.createTitledBorder(Resources.getText("Descriptor")));
+            BorderFactory.createTitledBorder(Messages.DESCRIPTOR));
         descBorderPanel.add(descTableScrollPane);
         // Add the two tables to the grid
         //
@@ -230,20 +231,20 @@
         emptyInfoTable();
         emptyDescTable();
         ((TitledBorder) infoBorderPanel.getBorder()).setTitle(
-                Resources.getText("MBeanInfo"));
-        String text = Resources.getText("Info") + ":";
+                Messages.MBEAN_INFO);
+        String text = Messages.INFO + ":";
         DefaultTableModel tableModel = (DefaultTableModel) infoTable.getModel();
         Object rowData[] = new Object[2];
         rowData[0] = new TableRowDivider(text);
         rowData[1] = new TableRowDivider("");
         tableModel.addRow(rowData);
-        rowData[0] = Resources.getText("ObjectName");
+        rowData[0] = Messages.OBJECT_NAME;
         rowData[1] = mbean.getObjectName();
         tableModel.addRow(rowData);
-        rowData[0] = Resources.getText("ClassName");
+        rowData[0] = Messages.CLASS_NAME;
         rowData[1] = mbeanInfo.getClassName();
         tableModel.addRow(rowData);
-        rowData[0] = Resources.getText("Description");
+        rowData[0] = Messages.DESCRIPTION;
         rowData[1] = mbeanInfo.getDescription();
         tableModel.addRow(rowData);
         addDescriptor(mbeanInfo.getDescriptor(), text);
@@ -252,13 +253,13 @@
         int i = 0;
         for (MBeanConstructorInfo mbci : mbeanInfo.getConstructors()) {
             addMBeanConstructorInfo(mbci,
-                    Resources.getText("Constructor") + "-" + i + ":");
+                    Messages.CONSTRUCTOR + "-" + i + ":");
             // MBeanParameterInfo
             //
             int j = 0;
             for (MBeanParameterInfo mbpi : mbci.getSignature()) {
                 addMBeanParameterInfo(mbpi,
-                        Resources.getText("Parameter") + "-" + i + "-" + j + ":");
+                        Messages.PARAMETER + "-" + i + "-" + j + ":");
                 j++;
             }
             i++;
@@ -271,29 +272,29 @@
         emptyInfoTable();
         emptyDescTable();
         ((TitledBorder) infoBorderPanel.getBorder()).setTitle(
-                Resources.getText("MBeanAttributeInfo"));
-        String text = Resources.getText("Attribute") + ":";
+                Messages.MBEAN_ATTRIBUTE_INFO);
+        String text = Messages.ATTRIBUTE + ":";
         DefaultTableModel tableModel = (DefaultTableModel) infoTable.getModel();
         Object rowData[] = new Object[2];
         rowData[0] = new TableRowDivider(text);
         rowData[1] = new TableRowDivider("");
         tableModel.addRow(rowData);
-        rowData[0] = Resources.getText("Name");
+        rowData[0] = Messages.NAME;
         rowData[1] = mbai.getName();
         tableModel.addRow(rowData);
-        rowData[0] = Resources.getText("Description");
+        rowData[0] = Messages.DESCRIPTION;
         rowData[1] = mbai.getDescription();
         tableModel.addRow(rowData);
-        rowData[0] = Resources.getText("Readable");
+        rowData[0] = Messages.READABLE;
         rowData[1] = mbai.isReadable();
         tableModel.addRow(rowData);
-        rowData[0] = Resources.getText("Writable");
+        rowData[0] = Messages.WRITABLE;
         rowData[1] = mbai.isWritable();
         tableModel.addRow(rowData);
-        rowData[0] = Resources.getText("Is");
+        rowData[0] = Messages.IS;
         rowData[1] = mbai.isIs();
         tableModel.addRow(rowData);
-        rowData[0] = Resources.getText("Type");
+        rowData[0] = Messages.TYPE;
         rowData[1] = mbai.getType();
         tableModel.addRow(rowData);
         addDescriptor(mbai.getDescriptor(), text);
@@ -305,36 +306,36 @@
         emptyInfoTable();
         emptyDescTable();
         ((TitledBorder) infoBorderPanel.getBorder()).setTitle(
-                Resources.getText("MBeanOperationInfo"));
-        String text = Resources.getText("Operation") + ":";
+                Messages.MBEAN_OPERATION_INFO);
+        String text = Messages.OPERATION + ":";
         DefaultTableModel tableModel = (DefaultTableModel) infoTable.getModel();
         Object rowData[] = new Object[2];
         rowData[0] = new TableRowDivider(text);
         rowData[1] = new TableRowDivider("");
         tableModel.addRow(rowData);
-        rowData[0] = Resources.getText("Name");
+        rowData[0] = Messages.NAME;
         rowData[1] = mboi.getName();
         tableModel.addRow(rowData);
-        rowData[0] = Resources.getText("Description");
+        rowData[0] = Messages.DESCRIPTION;
         rowData[1] = mboi.getDescription();
         tableModel.addRow(rowData);
-        rowData[0] = Resources.getText("Impact");
+        rowData[0] = Messages.IMPACT;
         switch (mboi.getImpact()) {
             case MBeanOperationInfo.INFO:
-                rowData[1] = Resources.getText("INFO");
+                rowData[1] = Messages.INFO_CAPITALIZED;
                 break;
             case MBeanOperationInfo.ACTION:
-                rowData[1] = Resources.getText("ACTION");
+                rowData[1] = Messages.ACTION_CAPITALIZED;
                 break;
             case MBeanOperationInfo.ACTION_INFO:
-                rowData[1] = Resources.getText("ACTION_INFO");
+                rowData[1] = Messages.ACTION_INFO_CAPITALIZED;
                 break;
             case MBeanOperationInfo.UNKNOWN:
-                rowData[1] = Resources.getText("UNKNOWN");
+                rowData[1] = Messages.UNKNOWN_CAPITALIZED;
                 break;
         }
         tableModel.addRow(rowData);
-        rowData[0] = Resources.getText("ReturnType");
+        rowData[0] = Messages.RETURN_TYPE;
         rowData[1] = mboi.getReturnType();
         tableModel.addRow(rowData);
         addDescriptor(mboi.getDescriptor(), text);
@@ -343,7 +344,7 @@
         int i = 0;
         for (MBeanParameterInfo mbpi : mboi.getSignature()) {
             addMBeanParameterInfo(mbpi,
-                    Resources.getText("Parameter") + "-" + i++ + ":");
+                    Messages.PARAMETER + "-" + i++ + ":");
         }
         tableModel.newDataAvailable(new TableModelEvent(tableModel));
     }
@@ -353,20 +354,20 @@
         emptyInfoTable();
         emptyDescTable();
         ((TitledBorder) infoBorderPanel.getBorder()).setTitle(
-                Resources.getText("MBeanNotificationInfo"));
-        String text = Resources.getText("Notification") + ":";
+                Messages.MBEAN_NOTIFICATION_INFO);
+        String text = Messages.NOTIFICATION + ":";
         DefaultTableModel tableModel = (DefaultTableModel) infoTable.getModel();
         Object rowData[] = new Object[2];
         rowData[0] = new TableRowDivider(text);
         rowData[1] = new TableRowDivider("");
         tableModel.addRow(rowData);
-        rowData[0] = Resources.getText("Name");
+        rowData[0] = Messages.NAME;
         rowData[1] = mbni.getName();
         tableModel.addRow(rowData);
-        rowData[0] = Resources.getText("Description");
+        rowData[0] = Messages.DESCRIPTION;
         rowData[1] = mbni.getDescription();
         tableModel.addRow(rowData);
-        rowData[0] = Resources.getText("NotifTypes");
+        rowData[0] = Messages.NOTIF_TYPES;
         rowData[1] = Arrays.toString(mbni.getNotifTypes());
         tableModel.addRow(rowData);
         addDescriptor(mbni.getDescriptor(), text);
@@ -380,10 +381,10 @@
         rowData[0] = new TableRowDivider(text);
         rowData[1] = new TableRowDivider("");
         tableModel.addRow(rowData);
-        rowData[0] = Resources.getText("Name");
+        rowData[0] = Messages.NAME;
         rowData[1] = mbci.getName();
         tableModel.addRow(rowData);
-        rowData[0] = Resources.getText("Description");
+        rowData[0] = Messages.DESCRIPTION;
         rowData[1] = mbci.getDescription();
         tableModel.addRow(rowData);
         addDescriptor(mbci.getDescriptor(), text);
@@ -397,13 +398,13 @@
         rowData[0] = new TableRowDivider(text);
         rowData[1] = new TableRowDivider("");
         tableModel.addRow(rowData);
-        rowData[0] = Resources.getText("Name");
+        rowData[0] = Messages.NAME;
         rowData[1] = mbpi.getName();
         tableModel.addRow(rowData);
-        rowData[0] = Resources.getText("Description");
+        rowData[0] = Messages.DESCRIPTION;
         rowData[1] = mbpi.getDescription();
         tableModel.addRow(rowData);
-        rowData[0] = Resources.getText("Type");
+        rowData[0] = Messages.TYPE;
         rowData[1] = mbpi.getType();
         tableModel.addRow(rowData);
         addDescriptor(mbpi.getDescriptor(), text);
--- a/src/share/classes/sun/tools/jconsole/inspector/XMBeanNotifications.java	Wed Sep 05 15:19:51 2012 -0700
+++ b/src/share/classes/sun/tools/jconsole/inspector/XMBeanNotifications.java	Wed Sep 12 12:32:05 2012 -0700
@@ -26,7 +26,6 @@
 package sun.tools.jconsole.inspector;
 
 import javax.swing.*;
-import javax.swing.event.*;
 import javax.swing.table.*;
 import javax.swing.tree.*;
 import java.awt.Font;
@@ -46,19 +45,19 @@
 import javax.management.openmbean.TabularData;
 
 import sun.tools.jconsole.JConsole;
-import sun.tools.jconsole.Resources;
+import sun.tools.jconsole.Messages;
 
 @SuppressWarnings("serial")
 public class XMBeanNotifications extends JTable implements NotificationListener {
 
     private final static String[] columnNames = {
-        Resources.getText("TimeStamp"),
-        Resources.getText("Type"),
-        Resources.getText("UserData"),
-        Resources.getText("SeqNum"),
-        Resources.getText("Message"),
-        Resources.getText("Event"),
-        Resources.getText("Source")
+        Messages.TIME_STAMP,
+        Messages.TYPE,
+        Messages.USER_DATA,
+        Messages.SEQ_NUM,
+        Messages.MESSAGE,
+        Messages.EVENT,
+        Messages.SOURCE
     };
     private HashMap<ObjectName, XMBeanNotificationsListener> listeners =
             new HashMap<ObjectName, XMBeanNotificationsListener>();
@@ -183,7 +182,7 @@
         }
 
         if (cell != null) {
-            toolTip = Resources.getText("Double click to expand/collapse") +
+            toolTip = Messages.DOUBLE_CLICK_TO_EXPAND_FORWARD_SLASH_COLLAPSE+
                     ". " + cell.toString();
         } else {
             Object val =
@@ -599,7 +598,6 @@
 
     class XMBeanNotificationsListener implements NotificationListener {
 
-        private String[] columnNames;
         private XMBean xmbean;
         private DefaultMutableTreeNode node;
         private volatile long received;
@@ -615,7 +613,6 @@
             this.notifications = notifications;
             this.xmbean = xmbean;
             this.node = node;
-            this.columnNames = columnNames;
             register(node);
         }
 
--- a/src/share/classes/sun/tools/jconsole/inspector/XObject.java	Wed Sep 05 15:19:51 2012 -0700
+++ b/src/share/classes/sun/tools/jconsole/inspector/XObject.java	Wed Sep 12 12:32:05 2012 -0700
@@ -28,17 +28,6 @@
 // java import
 import javax.swing.*;
 
-//
-
-// java import
-import java.io.*;
-import java.awt.*;
-import java.awt.dnd.*;
-import java.awt.datatransfer.*;
-import java.net.*;
-//
-
-
 /**
  * This provides a wrapper to the Object class to allow it to be
  displayed/manipulated as a GUI object.
--- a/src/share/classes/sun/tools/jconsole/inspector/XOpenTypeViewer.java	Wed Sep 05 15:19:51 2012 -0700
+++ b/src/share/classes/sun/tools/jconsole/inspector/XOpenTypeViewer.java	Wed Sep 12 12:32:05 2012 -0700
@@ -28,33 +28,21 @@
 import javax.swing.*;
 import javax.swing.event.*;
 import javax.swing.table.*;
-import javax.swing.tree.*;
-import javax.swing.border.*;
 import java.awt.BorderLayout;
-import java.awt.GridLayout;
 import java.awt.FlowLayout;
 import java.awt.Component;
-import java.awt.EventQueue;
 import java.awt.Color;
 import java.awt.Font;
-import java.awt.Rectangle;
 import java.awt.event.*;
-import java.awt.Insets;
 import java.awt.Dimension;
-import java.awt.GridBagConstraints;
-import java.awt.GridBagLayout;
 import java.util.*;
-import java.io.*;
 import java.lang.reflect.Array;
 
-import javax.management.*;
 import javax.management.openmbean.*;
 
-import sun.tools.jconsole.BorderedComponent;
 import sun.tools.jconsole.JConsole;
-import sun.tools.jconsole.LabeledComponent;
+import sun.tools.jconsole.Messages;
 import sun.tools.jconsole.Resources;
-import sun.tools.jconsole.VariableGridLayout;
 
 @SuppressWarnings("serial")
 public class XOpenTypeViewer extends JPanel implements ActionListener {
@@ -65,9 +53,9 @@
     XOpenTypeDataListener listener = new XOpenTypeDataListener();
 
     private static final String compositeNavigationSingle =
-            Resources.getText("MBeansTab.compositeNavigationSingle");
+            Messages.MBEANS_TAB_COMPOSITE_NAVIGATION_SINGLE;
     private static final String tabularNavigationSingle =
-            Resources.getText("MBeansTab.tabularNavigationSingle");
+            Messages.MBEANS_TAB_TABULAR_NAVIGATION_SINGLE;
 
     private static TableCellEditor editor =
             new Utils.ReadOnlyTableCellEditor(new JTextField());
@@ -121,7 +109,6 @@
 
     static abstract class XOpenTypeData extends JTable {
         XOpenTypeData parent;
-        private Color defaultColor;
         protected int col1Width = -1;
         protected int col2Width = -1;
         private boolean init;
@@ -139,7 +126,7 @@
                 Object value = getModel().getValueAt(row, col);
                 if (value != null) {
                     if(isClickableElement(value))
-                        return Resources.getText("Double click to visualize")
+                        return Messages.DOUBLE_CLICK_TO_VISUALIZE
                         + ". " + value.toString();
                     else
                         return value.toString();
@@ -265,7 +252,7 @@
                 Object c1 = o1.get(key);
                 Object c2 = o2.get(key);
                 if (c1 instanceof Comparable && c2 instanceof Comparable) {
-                    int result = ((Comparable) c1).compareTo(c2);
+                    int result = ((Comparable<Object>) c1).compareTo(c2);
                     if (result != 0)
                         return result;
                 }
@@ -358,7 +345,7 @@
 
     static class XCompositeData extends XOpenTypeData {
         protected final String[] columnNames = {
-            Resources.getText("Name"), Resources.getText("Value")
+            Messages.NAME, Messages.VALUE
         };
         CompositeData composite;
 
@@ -398,8 +385,8 @@
 
         private void load(CompositeData data) {
             CompositeType type = data.getCompositeType();
-            Set keys = type.keySet();
-            Iterator it = keys.iterator();
+            Set<String> keys = type.keySet();
+            Iterator<String> it = keys.iterator();
             Object[] rowData = new Object[2];
             while (it.hasNext()) {
                 String key = (String) it.next();
@@ -408,13 +395,13 @@
                 if (val == null) {
                     rowData[1] = "";
                 } else {
-                    OpenType openType = type.getType(key);
+                    OpenType<?> openType = type.getType(key);
                     if (openType instanceof CompositeType) {
                         rowData[1] =
                                 new XCompositeData(this, (CompositeData) val);
                     } else if (openType instanceof ArrayType) {
                         rowData[1] =
-                                new XArrayData(this, (ArrayType) openType, val);
+                                new XArrayData(this, (ArrayType<?>) openType, val);
                     } else if (openType instanceof SimpleType) {
                         rowData[1] = val;
                     } else if (openType instanceof TabularType) {
@@ -453,21 +440,21 @@
 
         private int dimension;
         private int size;
-        private OpenType elemType;
+        private OpenType<?> elemType;
         private Object val;
         private boolean isCompositeType;
         private boolean isTabularType;
         private int currentIndex;
         private CompositeData[] elements;
-        private final String[] arrayColumns = {Resources.getText("Value")};
+        private final String[] arrayColumns = {Messages.VALUE};
         private Font normalFont, boldFont;
 
-        XArrayData(XOpenTypeData parent, ArrayType type, Object val) {
+        XArrayData(XOpenTypeData parent, ArrayType<?> type, Object val) {
             this(parent, type.getDimension(), type.getElementOpenType(), val);
         }
 
         XArrayData(XOpenTypeData parent, int dimension,
-                OpenType elemType, Object val) {
+                OpenType<?> elemType, Object val) {
             super(parent);
             this.dimension = dimension;
             this.elemType = elemType;
@@ -486,10 +473,9 @@
 
         public void viewed(XOpenTypeViewer viewer) throws Exception {
             if (size == 0)
-                throw new Exception(Resources.getText("Empty array"));
+                throw new Exception(Messages.EMPTY_ARRAY);
             if (dimension > 1)
-                throw new Exception(Resources.getText("Dimension is not " +
-                        "supported:") +
+                throw new Exception(Messages.DIMENSION_IS_NOT_SUPPORTED_COLON +
                         dimension);
             super.viewed(viewer);
         }
@@ -565,7 +551,7 @@
 
         public String toString() {
             if (dimension > 1) {
-                return Resources.getText("Dimension is not supported:") +
+                return Messages.DIMENSION_IS_NOT_SUPPORTED_COLON +
                         dimension;
             } else {
                 return elemType.getTypeName() + "[" + size + "]";
@@ -694,7 +680,7 @@
                     tabular.canIncrement() || tabular.canDecrement();
             if (hasMoreThanOneElement) {
                 tabularLabel.setText(
-                        Resources.getText("MBeansTab.tabularNavigationMultiple",
+                        Resources.format(Messages.MBEANS_TAB_TABULAR_NAVIGATION_MULTIPLE,
                         String.format("%d", tabular.getSelectedElementIndex() + 1),
                         String.format("%d", tabular.getElementCount())));
             } else {
@@ -717,7 +703,7 @@
                     array.canIncrement() || array.canDecrement();
             if (hasMoreThanOneElement) {
                 compositeLabel.setText(
-                        Resources.getText("MBeansTab.compositeNavigationMultiple",
+                        Resources.format(Messages.MBEANS_TAB_COMPOSITE_NAVIGATION_MULTIPLE,
                         String.format("%d", array.getSelectedElementIndex() + 1),
                         String.format("%d", array.getElementCount())));
             } else {
@@ -781,8 +767,8 @@
                 JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED);
 
         JPanel buttons = new JPanel(new FlowLayout(FlowLayout.LEFT));
-        tabularPrev = new JButton(Resources.getText("<"));
-        tabularNext = new JButton(Resources.getText(">"));
+        tabularPrev = new JButton(Messages.LESS_THAN);
+        tabularNext = new JButton(Messages.GREATER_THAN);
         JPanel tabularButtons = new JPanel(new FlowLayout(FlowLayout.LEFT));
         tabularButtons.add(tabularPrev);
         tabularPrev.addActionListener(this);
@@ -793,13 +779,13 @@
         tabularNext.addActionListener(this);
         tabularButtons.setBackground(Color.white);
 
-        prev = new JButton(Resources.getText("<<"));
+        prev = new JButton(Messages.A_LOT_LESS_THAN);
         prev.addActionListener(this);
         buttons.add(prev);
 
-        incr = new JButton(Resources.getText(">"));
+        incr = new JButton(Messages.GREATER_THAN);
         incr.addActionListener(this);
-        decr = new JButton(Resources.getText("<"));
+        decr = new JButton(Messages.LESS_THAN);
         decr.addActionListener(this);
 
         JPanel array = new JPanel();
--- a/src/share/classes/sun/tools/jconsole/inspector/XOperations.java	Wed Sep 05 15:19:51 2012 -0700
+++ b/src/share/classes/sun/tools/jconsole/inspector/XOperations.java	Wed Sep 12 12:32:05 2012 -0700
@@ -26,22 +26,18 @@
 package sun.tools.jconsole.inspector;
 
 import javax.swing.*;
-import javax.swing.event.*;
-import javax.swing.table.*;
-import javax.swing.tree.*;
 import java.awt.BorderLayout;
 import java.awt.GridLayout;
 import java.awt.FlowLayout;
 import java.awt.Component;
 import java.awt.event.*;
 import java.util.*;
-import java.io.*;
 
 import javax.management.*;
 
-import sun.tools.jconsole.Resources;
 import sun.tools.jconsole.MBeansTab;
 import sun.tools.jconsole.JConsole;
+import sun.tools.jconsole.Messages;
 
 public abstract class XOperations extends JPanel implements ActionListener {
 
@@ -185,8 +181,8 @@
                     } else {
                         new ThreadDialog(
                                 button,
-                                Resources.getText("Method successfully invoked"),
-                                Resources.getText("Info"),
+                                Messages.METHOD_SUCCESSFULLY_INVOKED,
+                                Messages.INFO,
                                 JOptionPane.INFORMATION_MESSAGE).run();
                     }
                 } catch (Throwable t) {
@@ -196,9 +192,9 @@
                     }
                     new ThreadDialog(
                             button,
-                            Resources.getText("Problem invoking") + " " +
+                            Messages.PROBLEM_INVOKING + " " +
                             button.getText() + " : " + t.toString(),
-                            Resources.getText("Error"),
+                            Messages.ERROR,
                             JOptionPane.ERROR_MESSAGE).run();
                 }
             }
--- a/src/share/classes/sun/tools/jconsole/inspector/XPlotter.java	Wed Sep 05 15:19:51 2012 -0700
+++ b/src/share/classes/sun/tools/jconsole/inspector/XPlotter.java	Wed Sep 12 12:32:05 2012 -0700
@@ -27,7 +27,6 @@
 
 import sun.tools.jconsole.Plotter;
 import javax.swing.JTable;
-import java.awt.Graphics;
 
 @SuppressWarnings("serial")
 public class XPlotter extends Plotter {
--- a/src/share/classes/sun/tools/jconsole/inspector/XPlottingViewer.java	Wed Sep 05 15:19:51 2012 -0700
+++ b/src/share/classes/sun/tools/jconsole/inspector/XPlottingViewer.java	Wed Sep 12 12:32:05 2012 -0700
@@ -45,10 +45,7 @@
         new HashMap<String, XPlottingViewer>();
      private static HashMap<String, Timer> timerCache =
          new HashMap<String, Timer>();
-    private JPanel bordered;
-    private Number value;
     private MBeansTab tab;
-    private XMBean mbean;
     private String attributeName;
     private String key;
     private JTable table;
@@ -62,7 +59,6 @@
 
         this.tab = tab;
         this.key = key;
-        this.mbean = mbean;
         this.table = table;
         this.attributeName = attributeName;
         Plotter plotter = createPlotter(mbean, attributeName, key, table);
@@ -70,9 +66,9 @@
     }
 
     static void dispose(MBeansTab tab) {
-        Iterator it = plotterCache.keySet().iterator();
+        Iterator<String> it = plotterCache.keySet().iterator();
         while(it.hasNext()) {
-            String key = (String) it.next();
+            String key = it.next();
             if(key.startsWith(String.valueOf(tab.hashCode()))) {
                 it.remove();
             }
@@ -187,7 +183,7 @@
         final GridBagLayout gbl = new GridBagLayout();
         buttonPanel.setLayout(gbl);
         setLayout(new BorderLayout());
-        plotButton = new JButton(Resources.getText("Discard chart"));
+        plotButton = new JButton(Messages.DISCARD_CHART);
         plotButton.addActionListener(this);
         plotButton.setEnabled(true);
 
--- a/src/share/classes/sun/tools/jconsole/inspector/XSheet.java	Wed Sep 05 15:19:51 2012 -0700
+++ b/src/share/classes/sun/tools/jconsole/inspector/XSheet.java	Wed Sep 12 12:32:05 2012 -0700
@@ -57,8 +57,6 @@
 import sun.tools.jconsole.*;
 import sun.tools.jconsole.inspector.XNodeInfo.Type;
 
-import static sun.tools.jconsole.Resources.*;
-
 @SuppressWarnings("serial")
 public class XSheet extends JPanel
         implements ActionListener, NotificationListener {
@@ -106,28 +104,24 @@
         southPanel = new JPanel();
         add(southPanel, BorderLayout.SOUTH);
         // create the refresh button
-        String refreshButtonKey = "MBeansTab.refreshAttributesButton";
-        refreshButton = new JButton(getText(refreshButtonKey));
-        refreshButton.setMnemonic(getMnemonicInt(refreshButtonKey));
-        refreshButton.setToolTipText(getText(refreshButtonKey + ".toolTip"));
+        refreshButton = new JButton(Messages.MBEANS_TAB_REFRESH_ATTRIBUTES_BUTTON);
+        refreshButton.setMnemonic(Resources.getMnemonicInt(Messages.MBEANS_TAB_REFRESH_ATTRIBUTES_BUTTON));
+        refreshButton.setToolTipText(Messages.MBEANS_TAB_REFRESH_ATTRIBUTES_BUTTON_TOOLTIP);
         refreshButton.addActionListener(this);
         // create the clear button
-        String clearButtonKey = "MBeansTab.clearNotificationsButton";
-        clearButton = new JButton(getText(clearButtonKey));
-        clearButton.setMnemonic(getMnemonicInt(clearButtonKey));
-        clearButton.setToolTipText(getText(clearButtonKey + ".toolTip"));
+        clearButton = new JButton(Messages.MBEANS_TAB_CLEAR_NOTIFICATIONS_BUTTON);
+        clearButton.setMnemonic(Resources.getMnemonicInt(Messages.MBEANS_TAB_CLEAR_NOTIFICATIONS_BUTTON));
+        clearButton.setToolTipText(Messages.MBEANS_TAB_CLEAR_NOTIFICATIONS_BUTTON_TOOLTIP);
         clearButton.addActionListener(this);
         // create the subscribe button
-        String subscribeButtonKey = "MBeansTab.subscribeNotificationsButton";
-        subscribeButton = new JButton(getText(subscribeButtonKey));
-        subscribeButton.setMnemonic(getMnemonicInt(subscribeButtonKey));
-        subscribeButton.setToolTipText(getText(subscribeButtonKey + ".toolTip"));
+        subscribeButton = new JButton(Messages.MBEANS_TAB_SUBSCRIBE_NOTIFICATIONS_BUTTON);
+        subscribeButton.setMnemonic(Resources.getMnemonicInt(Messages.MBEANS_TAB_SUBSCRIBE_NOTIFICATIONS_BUTTON));
+        subscribeButton.setToolTipText(Messages.MBEANS_TAB_SUBSCRIBE_NOTIFICATIONS_BUTTON_TOOLTIP);
         subscribeButton.addActionListener(this);
         // create the unsubscribe button
-        String unsubscribeButtonKey = "MBeansTab.unsubscribeNotificationsButton";
-        unsubscribeButton = new JButton(getText(unsubscribeButtonKey));
-        unsubscribeButton.setMnemonic(getMnemonicInt(unsubscribeButtonKey));
-        unsubscribeButton.setToolTipText(getText(unsubscribeButtonKey + ".toolTip"));
+        unsubscribeButton = new JButton(Messages.MBEANS_TAB_UNSUBSCRIBE_NOTIFICATIONS_BUTTON);
+        unsubscribeButton.setMnemonic(Resources.getMnemonicInt(Messages.MBEANS_TAB_UNSUBSCRIBE_NOTIFICATIONS_BUTTON));
+        unsubscribeButton.setToolTipText(Messages.MBEANS_TAB_UNSUBSCRIBE_NOTIFICATIONS_BUTTON_TOOLTIP);
         unsubscribeButton.addActionListener(this);
         // create XMBeanAttributes container
         mbeanAttributes = new XMBeanAttributes(mbeansTab);
@@ -238,7 +232,7 @@
                         t.printStackTrace();
                     }
                     showErrorDialog(t.toString(),
-                            Resources.getText("Problem displaying MBean"));
+                            Messages.PROBLEM_DISPLAYING_MBEAN);
                 }
             }
         };
@@ -279,7 +273,7 @@
                                             new JPanel(new BorderLayout());
                                     attributeBorderPanel.setBorder(
                                             BorderFactory.createTitledBorder(
-                                            Resources.getText("Attribute value")));
+                                            Messages.ATTRIBUTE_VALUE));
                                     JPanel attributeValuePanel =
                                             new JPanel(new BorderLayout());
                                     attributeValuePanel.setBorder(
@@ -314,7 +308,7 @@
                                         t.printStackTrace();
                                     }
                                     showErrorDialog(t.toString(),
-                                            Resources.getText("Problem displaying MBean"));
+                                            Messages.PROBLEM_DISPLAYING_MBEAN);
                                 }
                             }
                         };
@@ -333,7 +327,7 @@
                 JPanel operationPanel = new JPanel(new BorderLayout());
                 JPanel operationBorderPanel = new JPanel(new BorderLayout());
                 operationBorderPanel.setBorder(BorderFactory.createTitledBorder(
-                        Resources.getText("Operation invocation")));
+                        Messages.OPERATION_INVOCATION));
                 operationBorderPanel.add(new JScrollPane(mbeanOperations));
                 operationPanel.add(operationBorderPanel, BorderLayout.NORTH);
                 mbi.addMBeanOperationInfo(mboi);
@@ -389,7 +383,7 @@
                         mainPanel.removeAll();
                         JPanel borderPanel = new JPanel(new BorderLayout());
                         borderPanel.setBorder(BorderFactory.createTitledBorder(
-                                Resources.getText("Attribute values")));
+                                Messages.ATTRIBUTE_VALUES));
                         borderPanel.add(new JScrollPane(mbeanAttributes));
                         mainPanel.add(borderPanel, BorderLayout.CENTER);
                         // add the refresh button to the south panel
@@ -409,7 +403,7 @@
                         t.printStackTrace();
                     }
                     showErrorDialog(t.toString(),
-                            Resources.getText("Problem displaying MBean"));
+                            Messages.PROBLEM_DISPLAYING_MBEAN);
                 }
             }
         };
@@ -442,7 +436,7 @@
                         mainPanel.removeAll();
                         JPanel borderPanel = new JPanel(new BorderLayout());
                         borderPanel.setBorder(BorderFactory.createTitledBorder(
-                                Resources.getText("Operation invocation")));
+                                Messages.OPERATION_INVOCATION));
                         borderPanel.add(new JScrollPane(mbeanOperations));
                         mainPanel.add(borderPanel, BorderLayout.CENTER);
                         southPanel.setVisible(false);
@@ -459,7 +453,7 @@
                         t.printStackTrace();
                     }
                     showErrorDialog(t.toString(),
-                            Resources.getText("Problem displaying MBean"));
+                            Messages.PROBLEM_DISPLAYING_MBEAN);
                 }
             }
         };
@@ -479,7 +473,7 @@
         mainPanel.removeAll();
         JPanel borderPanel = new JPanel(new BorderLayout());
         borderPanel.setBorder(BorderFactory.createTitledBorder(
-                Resources.getText("Notification buffer")));
+                Messages.NOTIFICATION_BUFFER));
         borderPanel.add(new JScrollPane(mbeanNotifications));
         mainPanel.add(borderPanel, BorderLayout.CENTER);
         // add the subscribe/unsubscribe/clear buttons to the south panel
@@ -528,7 +522,7 @@
                         t.printStackTrace();
                     }
                     showErrorDialog(t.getMessage(),
-                            Resources.getText("Problem adding listener"));
+                            Messages.PROBLEM_ADDING_LISTENER);
                 }
             }
         }.execute();
@@ -557,7 +551,7 @@
                         t.printStackTrace();
                     }
                     showErrorDialog(t.getMessage(),
-                            Resources.getText("Problem removing listener"));
+                            Messages.PROBLEM_REMOVING_LISTENER);
                 }
             }
         }.execute();
@@ -586,7 +580,7 @@
     // Call on EDT
     private void updateReceivedNotifications(
             DefaultMutableTreeNode emitter, long received, boolean bold) {
-        String text = Resources.getText("Notifications") + "[" + received + "]";
+        String text = Messages.NOTIFICATIONS + "[" + received + "]";
         DefaultMutableTreeNode selectedNode = (DefaultMutableTreeNode) mbeansTab.getTree().getLastSelectedPathComponent();
         if (bold && emitter != selectedNode) {
             text = "<html><b>" + text + "</b></html>";
@@ -600,7 +594,7 @@
     // Call on EDT
     private void clearNotifications() {
         updateNotificationsNodeLabel(currentNode,
-                Resources.getText("Notifications"));
+                Messages.NOTIFICATIONS);
     }
 
     /**
@@ -609,7 +603,7 @@
     // Call on EDT
     private void clearNotifications0() {
         updateNotificationsNodeLabel(currentNode,
-                Resources.getText("Notifications") + "[0]");
+                Messages.NOTIFICATIONS + "[0]");
     }
 
     /**
@@ -712,7 +706,7 @@
             new ThreadDialog(
                     (Component) e.getSource(),
                     message,
-                    Resources.getText("Operation return value"),
+                    Messages.OPERATION_RETURN_VALUE,
                     JOptionPane.INFORMATION_MESSAGE).run();
         } // Got notification
         else if (e.getType().equals(
--- a/src/share/classes/sun/tools/jconsole/inspector/XTable.java	Wed Sep 05 15:19:51 2012 -0700
+++ b/src/share/classes/sun/tools/jconsole/inspector/XTable.java	Wed Sep 12 12:32:05 2012 -0700
@@ -36,7 +36,7 @@
 public abstract class XTable extends JTable {
     static final int NAME_COLUMN = 0;
     static final int VALUE_COLUMN = 1;
-    private Color defaultColor, editableColor, droppableColor, errorColor;
+    private Color defaultColor, editableColor, errorColor;
     private Font normalFont, boldFont;
 
     public XTable () {
@@ -139,7 +139,6 @@
         if (defaultColor == null) {
             defaultColor = tcr.getForeground();
             editableColor = Color.blue;
-            droppableColor = Color.green;
             errorColor = Color.red;
             // this sometimes happens for some reason
             if (defaultColor == null) {
--- a/src/share/classes/sun/tools/jconsole/inspector/XTextField.java	Wed Sep 05 15:19:51 2012 -0700
+++ b/src/share/classes/sun/tools/jconsole/inspector/XTextField.java	Wed Sep 12 12:32:05 2012 -0700
@@ -26,12 +26,7 @@
 package sun.tools.jconsole.inspector;
 
 import java.awt.*;
-import java.awt.dnd.*;
 import java.awt.event.*;
-import java.awt.datatransfer.*;
-import java.io.*;
-import java.util.*;
-import javax.swing.plaf.*;
 import javax.swing.event.*;
 import javax.swing.*;
 
@@ -44,16 +39,8 @@
     implements DocumentListener,
                ActionListener {
 
-    private static final Color selF = Color.red;
-    private static final Color selB = Color.yellow;
-    private Color fore=null, back=null;
-    private HashMap items = null; //used for popup menu selection
     private XObject selectedObject;
-    private XObject currentObject;
-    private Class expectedClass;
-    private Object value;
     protected JTextField textField;
-    private JButton browseObjects;
 
     private static boolean allowNullSelection = false;
 
@@ -81,13 +68,12 @@
     }
 
     public XTextField(Object value,
-                      Class expectedClass,
+                      Class<?> expectedClass,
                       int colWidth,
                       boolean isCallable,
                       JButton button,
                       XOperations operation) {
         super(new BorderLayout());
-        this.expectedClass = expectedClass;
         this.button = button;
         this.operation = operation;
         add(textField = new JTextField(value.toString(),colWidth),
@@ -112,17 +98,13 @@
         return allowNullSelection;
     }
 
-    protected void init(Object value, Class expectedClass) {
-        this.expectedClass = expectedClass;
-        this.value = value;
-        boolean fieldEditable =  Utils.isEditableType(expectedClass.getName());
+    protected void init(Object value, Class<?> expectedClass) {
+         boolean fieldEditable =  Utils.isEditableType(expectedClass.getName());
         clearObject();
         if (value != null) {
-            currentObject = new XObject(value);
             textField.setText(value.toString());
         }
         else {
-            currentObject = XObject.NULL_OBJECT;
             //null String value for the moment
             textField.setText("");
         }
@@ -140,35 +122,12 @@
         }
     }
 
-
-
-
-
-    private synchronized void setObject(XObject object) {
-        clearObject();
-        selectedObject = object;
-        currentObject = object;
-        setSelectedColors();
-        textField.setText(object.getText());
-        textField.getDocument().addDocumentListener(this);
-        paintImmediately(getVisibleRect());
-    }
-
     private synchronized void clearObject() {
         textField.getDocument().removeDocumentListener(this);
         selectedObject = null;
-        currentObject = null;
         setDefaultColors();
     }
 
-    private synchronized void setSelectedColors() {
-        // fore = textField.getForeground();
-        // back = textField.getBackground();
-
-        //textField.setForeground(Color.red);
-        // textField.setBackground(Color.yellow);
-    }
-
     private synchronized void setDefaultColors() {
         //  if (fore != null) textField.setForeground(fore);
         // if (back != null)  textField.setBackground(back);
@@ -194,12 +153,6 @@
         }
     }
 
-    private JPopupMenu buildEditPopupMenu() {
-        JPopupMenu menu = new JPopupMenu();
-        return menu;
-    }
-
-
     // ACTIONLISTENER IMPLEMENTATION
     public void actionPerformed(ActionEvent e) {
         if (e.getSource() instanceof JTextField) {
--- a/src/share/classes/sun/tools/jconsole/inspector/XTree.java	Wed Sep 05 15:19:51 2012 -0700
+++ b/src/share/classes/sun/tools/jconsole/inspector/XTree.java	Wed Sep 12 12:32:05 2012 -0700
@@ -32,7 +32,7 @@
 import javax.swing.tree.*;
 import sun.tools.jconsole.JConsole;
 import sun.tools.jconsole.MBeansTab;
-import sun.tools.jconsole.Resources;
+import sun.tools.jconsole.Messages;
 import sun.tools.jconsole.inspector.XNodeInfo;
 import static sun.tools.jconsole.inspector.XNodeInfo.Type;
 
@@ -182,7 +182,7 @@
      * Returns true if any of the children nodes is a non MBean metadata node.
      */
     private boolean hasNonMetadataNodes(DefaultMutableTreeNode node) {
-        for (Enumeration e = node.children(); e.hasMoreElements();) {
+        for (Enumeration<?> e = node.children(); e.hasMoreElements();) {
             DefaultMutableTreeNode n = (DefaultMutableTreeNode) e.nextElement();
             Object uo = n.getUserObject();
             if (uo instanceof XNodeInfo) {
@@ -205,7 +205,7 @@
      * Returns true if any of the children nodes is an MBean metadata node.
      */
     public boolean hasMetadataNodes(DefaultMutableTreeNode node) {
-        for (Enumeration e = node.children(); e.hasMoreElements();) {
+        for (Enumeration<?> e = node.children(); e.hasMoreElements();) {
             DefaultMutableTreeNode n = (DefaultMutableTreeNode) e.nextElement();
             Object uo = n.getUserObject();
             if (uo instanceof XNodeInfo) {
@@ -251,7 +251,7 @@
         Set<DefaultMutableTreeNode> metadataNodes =
                 new HashSet<DefaultMutableTreeNode>();
         DefaultTreeModel model = (DefaultTreeModel) getModel();
-        for (Enumeration e = node.children(); e.hasMoreElements();) {
+        for (Enumeration<?> e = node.children(); e.hasMoreElements();) {
             DefaultMutableTreeNode n = (DefaultMutableTreeNode) e.nextElement();
             Object uo = n.getUserObject();
             if (uo instanceof XNodeInfo) {
@@ -596,7 +596,7 @@
             if (ai != null && ai.length > 0) {
                 DefaultMutableTreeNode attributes = new DefaultMutableTreeNode();
                 XNodeInfo attributesUO = new XNodeInfo(Type.ATTRIBUTES, mbean,
-                        Resources.getText("Attributes"), null);
+                        Messages.ATTRIBUTES, null);
                 attributes.setUserObject(attributesUO);
                 node.insert(attributes, childIndex++);
                 for (MBeanAttributeInfo mbai : ai) {
@@ -613,7 +613,7 @@
             if (oi != null && oi.length > 0) {
                 DefaultMutableTreeNode operations = new DefaultMutableTreeNode();
                 XNodeInfo operationsUO = new XNodeInfo(Type.OPERATIONS, mbean,
-                        Resources.getText("Operations"), null);
+                        Messages.OPERATIONS, null);
                 operations.setUserObject(operationsUO);
                 node.insert(operations, childIndex++);
                 for (MBeanOperationInfo mboi : oi) {
@@ -646,7 +646,7 @@
             if (isBroadcaster != null && isBroadcaster.booleanValue()) {
                 DefaultMutableTreeNode notifications = new DefaultMutableTreeNode();
                 XNodeInfo notificationsUO = new XNodeInfo(Type.NOTIFICATIONS, mbean,
-                        Resources.getText("Notifications"), null);
+                        Messages.NOTIFICATIONS, null);
                 notifications.setUserObject(notificationsUO);
                 node.insert(notifications, childIndex++);
                 if (ni != null && ni.length > 0) {
--- a/src/share/classes/sun/tools/jconsole/inspector/XTreeRenderer.java	Wed Sep 05 15:19:51 2012 -0700
+++ b/src/share/classes/sun/tools/jconsole/inspector/XTreeRenderer.java	Wed Sep 12 12:32:05 2012 -0700
@@ -30,8 +30,6 @@
 import javax.swing.JTree;
 import javax.swing.tree.DefaultMutableTreeNode;
 import javax.swing.tree.DefaultTreeCellRenderer;
-import sun.tools.jconsole.Resources;
-import sun.tools.jconsole.inspector.XNodeInfo.Type;
 
 @SuppressWarnings("serial")
 public class XTreeRenderer extends DefaultTreeCellRenderer {
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/classes/sun/tools/jconsole/resources/messages.properties	Wed Sep 12 12:32:05 2012 -0700
@@ -0,0 +1,273 @@
+ONE_DAY=\ 1 day
+ONE_HOUR=\ 1 hour
+ONE_MIN=\ 1 min
+ONE_MONTH=\ 1 month
+ONE_YEAR=\ 1 year
+TWO_HOURS=\ 2 hours
+THREE_HOURS=\ 3 hours
+THREE_MONTHS=\ 3 months
+FIVE_MIN=\ 5 min
+SIX_HOURS=\ 6 hours
+SIX_MONTHS=\ 6 months
+SEVEN_DAYS=\ 7 days
+TEN_MIN=10 min
+TWELVE_HOURS=12 hours
+THIRTY_MIN=30 min
+LESS_THAN=<
+A_LOT_LESS_THAN=<<
+GREATER_THAN=>
+ACTION_CAPITALIZED=ACTION
+ACTION_INFO_CAPITALIZED=ACTION_INFO
+ALL=All
+ARCHITECTURE=Architecture
+ATTRIBUTE=Attribute
+ATTRIBUTE_VALUE=Attribute value
+ATTRIBUTE_VALUES=Attribute values
+ATTRIBUTES=Attributes
+BLANK=Blank
+BLOCKED_COUNT_WAITED_COUNT=Total blocked: {0}  Total waited: {1}\n
+BOOT_CLASS_PATH=Boot class path
+BORDERED_COMPONENT_MORE_OR_LESS_BUTTON_TOOLTIP=Toggle to show more or less information
+CPU_USAGE=CPU Usage
+CPU_USAGE_FORMAT=CPU Usage: {0}%
+CANCEL=Cancel
+CASCADE=&Cascade
+CHART_COLON=&Chart:
+CLASS_PATH=Class path
+CLASS_NAME=ClassName
+CLASS_TAB_INFO_LABEL_FORMAT=<html>Loaded: {0}    Unloaded: {1}    Total: {2}</html>
+CLASS_TAB_LOADED_CLASSES_PLOTTER_ACCESSIBLE_NAME=Chart for Loaded Classes.
+CLASSES=Classes
+CLOSE=Close
+COLUMN_NAME=Name
+COLUMN_PID=PID
+COMMITTED_MEMORY=Committed memory
+COMMITTED_VIRTUAL_MEMORY=Committed virtual memory
+COMMITTED=Committed
+CONNECT=&Connect
+CONNECT_DIALOG_CONNECT_BUTTON_TOOLTIP=Connect to Java Virtual Machine
+CONNECT_DIALOG_ACCESSIBLE_DESCRIPTION=Dialog for making a new connection to a local or remote Java Virtual Machine
+CONNECT_DIALOG_MASTHEAD_ACCESSIBLE_NAME=Masthead Graphic
+CONNECT_DIALOG_MASTHEAD_TITLE=New Connection
+CONNECT_DIALOG_STATUS_BAR_ACCESSIBLE_NAME=Status Bar
+CONNECT_DIALOG_TITLE=JConsole: New Connection
+CONNECTED_PUNCTUATION_CLICK_TO_DISCONNECT_=Connected. Click to disconnect.
+CONNECTION_FAILED=Connection failed
+CONNECTION=&Connection
+CONNECTION_NAME=Connection name
+CONNECTION_NAME__DISCONNECTED_={0} (disconnected)
+CONSTRUCTOR=Constructor
+CURRENT_CLASSES_LOADED=Current classes loaded
+CURRENT_HEAP_SIZE=Current heap size
+CURRENT_VALUE=Current value: {0}
+CREATE=Create
+DAEMON_THREADS=Daemon threads
+DISCONNECTED_PUNCTUATION_CLICK_TO_CONNECT_=Disconnected. Click to connect.
+DOUBLE_CLICK_TO_EXPAND_FORWARD_SLASH_COLLAPSE=Double click to expand/collapse
+DOUBLE_CLICK_TO_VISUALIZE=Double click to visualize
+DESCRIPTION=Description
+DESCRIPTOR=Descriptor
+DETAILS=Details
+DETECT_DEADLOCK=&Detect Deadlock
+DETECT_DEADLOCK_TOOLTIP=Detect deadlocked threads
+DIMENSION_IS_NOT_SUPPORTED_COLON=Dimension is not supported:
+DISCARD_CHART=Discard chart
+DURATION_DAYS_HOURS_MINUTES={0,choice,1#{0,number,integer} day |1.0<{0,number,integer} days }{1,choice,0<{1,number,integer} hours |1#{1,number,integer} hour |1<{1,number,integer} hours }{2,choice,0<{2,number,integer} minutes|1#{2,number,integer} minute|1.0<{2,number,integer} minutes}
+DURATION_HOURS_MINUTES={0,choice,1#{0,number,integer} hour |1<{0,number,integer} hours }{1,choice,0<{1,number,integer} minutes|1#{1,number,integer} minute|1.0<{1,number,integer} minutes}
+DURATION_MINUTES={0,choice,1#{0,number,integer} minute|1.0<{0,number,integer} minutes}
+DURATION_SECONDS={0} seconds
+EMPTY_ARRAY=Empty array
+ERROR=Error
+ERROR_COLON_MBEANS_ALREADY_EXIST=Error: MBeans already exist
+ERROR_COLON_MBEANS_DO_NOT_EXIST=Error: MBeans do not exist
+EVENT=Event
+EXIT=E&xit
+FAIL_TO_LOAD_PLUGIN=Warning: Fail to load plugin: {0}
+FILE_CHOOSER_FILE_EXISTS_CANCEL_OPTION=Cancel
+FILE_CHOOSER_FILE_EXISTS_MESSAGE=<html><center>File already exists:<br>{0}<br>Do you want to replace it?
+FILE_CHOOSER_FILE_EXISTS_OK_OPTION=Replace
+FILE_CHOOSER_FILE_EXISTS_TITLE=File Exists
+FILE_CHOOSER_SAVED_FILE=<html>Saved to file:<br>{0}<br>({1} bytes)
+FILE_CHOOSER_SAVE_FAILED_MESSAGE=<html><center>Save to file failed:<br>{0}<br>{1}
+FILE_CHOOSER_SAVE_FAILED_TITLE=Save Failed
+FREE_PHYSICAL_MEMORY=Free physical memory
+FREE_SWAP_SPACE=Free swap space
+GARBAGE_COLLECTOR=Garbage collector
+GC_INFO=Name = ''{0}'', Collections = {1,choice,-1#Unavailable|0#{1,number,integer}}, Total time spent = {2}
+GC_TIME=GC time
+GC_TIME_DETAILS={0} on {1} ({2} collections)
+HEAP_MEMORY_USAGE=Heap Memory Usage
+HEAP=Heap
+HELP_ABOUT_DIALOG_ACCESSIBLE_DESCRIPTION=Dialog containing information about JConsole and JDK versions
+HELP_ABOUT_DIALOG_JCONSOLE_VERSION=JConsole version:<br>{0}
+HELP_ABOUT_DIALOG_JAVA_VERSION=Java VM version:<br>{0}
+HELP_ABOUT_DIALOG_MASTHEAD_ACCESSIBLE_NAME=Masthead Graphic
+HELP_ABOUT_DIALOG_MASTHEAD_TITLE=About JConsole
+HELP_ABOUT_DIALOG_TITLE=JConsole: About
+HELP_ABOUT_DIALOG_USER_GUIDE_LINK=JConsole &User Guide:<br>{0}
+HELP_ABOUT_DIALOG_USER_GUIDE_LINK_URL=http://java.sun.com/javase/6/docs/technotes/guides/management/jconsole.html
+HELP_MENU_ABOUT_TITLE=&About JConsole
+HELP_MENU_USER_GUIDE_TITLE=Online &User Guide
+HELP_MENU_TITLE=&Help
+HOTSPOT_MBEANS_ELLIPSIS=&Hotspot MBeans...
+HOTSPOT_MBEANS_DIALOG_ACCESSIBLE_DESCRIPTION=Dialog for managing Hotspot MBeans
+IMPACT=Impact
+INFO=Info
+INFO_CAPITALIZED=INFO
+INVALID_PLUGIN_PATH=Warning: Invalid plugin path: {0}
+INVALID_URL=Invalid URL: {0}
+IS=Is
+JAVA_MONITORING___MANAGEMENT_CONSOLE=Java Monitoring && Management Console
+JCONSOLE_COLON_=JConsole: {0}
+JCONSOLE_VERSION=JConsole version "{0}"
+JCONSOLE_ACCESSIBLE_DESCRIPTION=Java Monitoring && Management Console
+JIT_COMPILER=JIT compiler
+LIBRARY_PATH=Library path
+LIVE_THREADS=Live threads
+LOADED=Loaded
+LOCAL_PROCESS_COLON=&Local Process:
+MASTHEAD_FONT=Dialog-PLAIN-25
+MANAGEMENT_NOT_ENABLED=<b>Note</b>: The management agent is not enabled on this process.
+MANAGEMENT_WILL_BE_ENABLED=<b>Note</b>: The management agent will be enabled on this process.
+MBEAN_ATTRIBUTE_INFO=MBeanAttributeInfo
+MBEAN_INFO=MBeanInfo
+MBEAN_NOTIFICATION_INFO=MBeanNotificationInfo
+MBEAN_OPERATION_INFO=MBeanOperationInfo
+MBEANS=MBeans
+MBEANS_TAB_CLEAR_NOTIFICATIONS_BUTTON=&Clear
+MBEANS_TAB_CLEAR_NOTIFICATIONS_BUTTON_TOOLTIP=Clear notifications
+MBEANS_TAB_COMPOSITE_NAVIGATION_MULTIPLE=Composite Navigation {0}/{1}
+MBEANS_TAB_COMPOSITE_NAVIGATION_SINGLE=Composite Navigation
+MBEANS_TAB_REFRESH_ATTRIBUTES_BUTTON=&Refresh
+MBEANS_TAB_REFRESH_ATTRIBUTES_BUTTON_TOOLTIP=Refresh attributes
+MBEANS_TAB_SUBSCRIBE_NOTIFICATIONS_BUTTON=&Subscribe
+MBEANS_TAB_SUBSCRIBE_NOTIFICATIONS_BUTTON_TOOLTIP=Start listening for notifications
+MBEANS_TAB_TABULAR_NAVIGATION_MULTIPLE=Tabular Navigation {0}/{1}
+MBEANS_TAB_TABULAR_NAVIGATION_SINGLE=Tabular Navigation
+MBEANS_TAB_UNSUBSCRIBE_NOTIFICATIONS_BUTTON=&Unsubscribe
+MBEANS_TAB_UNSUBSCRIBE_NOTIFICATIONS_BUTTON_TOOLTIP=Stop listening for notifications
+MANAGE_HOTSPOT_MBEANS_IN_COLON_=Manage Hotspot MBeans in:
+MAX=Max
+MAXIMUM_HEAP_SIZE=Maximum heap size
+MEMORY=Memory
+MEMORY_POOL_LABEL=Memory Pool "{0}"
+MEMORY_TAB_HEAP_PLOTTER_ACCESSIBLE_NAME=Memory usage chart for heap.
+MEMORY_TAB_INFO_LABEL_FORMAT=<html>Used: {0}    Committed: {1}    Max: {2}</html>
+MEMORY_TAB_NON_HEAP_PLOTTER_ACCESSIBLE_NAME=Memory usage chart for non heap.
+MEMORY_TAB_POOL_CHART_ABOVE_THRESHOLD=which is above the threshold of {0}.\n
+MEMORY_TAB_POOL_CHART_ACCESSIBLE_NAME=Memory Pool Usage Chart.
+MEMORY_TAB_POOL_CHART_BELOW_THRESHOLD=which is below the threshold of {0}.\n
+MEMORY_TAB_POOL_PLOTTER_ACCESSIBLE_NAME=Memory usage chart for {0}.
+MESSAGE=Message
+METHOD_SUCCESSFULLY_INVOKED=Method successfully invoked
+MINIMIZE_ALL=&Minimize All
+MONITOR_LOCKED=\ \ \ - locked {0}\n
+NAME=Name
+NAME_AND_BUILD={0} (build {1})
+NAME_STATE=Name: {0}\nState: {1}\n
+NAME_STATE_LOCK_NAME=Name: {0}\nState: {1} on {2}\n
+NAME_STATE_LOCK_NAME_LOCK_OWNER=Name: {0}\nState: {1} on {2} owned by: {3}\n
+NEW_CONNECTION_ELLIPSIS=&New Connection...
+NO_DEADLOCK_DETECTED=No deadlock detected
+NON_HEAP_MEMORY_USAGE=Non-Heap Memory Usage
+NON_HEAP=Non-Heap
+NOTIFICATION=Notification
+NOTIFICATION_BUFFER=Notification buffer
+NOTIFICATIONS=Notifications
+NOTIF_TYPES=NotifTypes
+NUMBER_OF_THREADS=Number of Threads
+NUMBER_OF_LOADED_CLASSES=Number of Loaded Classes
+NUMBER_OF_PROCESSORS=Number of processors
+OBJECT_NAME=ObjectName
+OPERATING_SYSTEM=Operating System
+OPERATION=Operation
+OPERATION_INVOCATION=Operation invocation
+OPERATION_RETURN_VALUE=Operation return value
+OPERATIONS=Operations
+OVERVIEW=Overview
+OVERVIEW_PANEL_PLOTTER_ACCESSIBLE_NAME=Chart for {0}.
+PARAMETER=Parameter
+PASSWORD_ACCESSIBLE_NAME=Password
+PASSWORD_COLON_=&Password:
+PEAK=Peak
+PERFORM_GC=Perform &GC
+PERFORM_GC_TOOLTIP=Request Garbage Collection
+PLOTTER_ACCESSIBLE_NAME=Chart
+PLOTTER_ACCESSIBLE_NAME_KEY_AND_VALUE={0}={1}\n
+PLOTTER_ACCESSIBLE_NAME_NO_DATA=No data plotted.
+PLOTTER_SAVE_AS_MENU_ITEM=Save data &as...
+PLOTTER_TIME_RANGE_MENU=&Time Range
+PROBLEM_ADDING_LISTENER=Problem adding listener
+PROBLEM_DISPLAYING_MBEAN=Problem displaying MBean
+PROBLEM_INVOKING=Problem invoking
+PROBLEM_REMOVING_LISTENER=Problem removing listener
+PROBLEM_SETTING_ATTRIBUTE=Problem setting attribute
+PROCESS_CPU_TIME=Process CPU time
+READABLE=Readable
+RECONNECT=Reconnect
+REMOTE_PROCESS_COLON=&Remote Process:
+REMOTE_PROCESS_TEXT_FIELD_ACCESSIBLE_NAME=Remote Process
+RESTORE_ALL=&Restore All
+RETURN_TYPE=ReturnType
+SEQ_NUM=SeqNum
+SIZE_BYTES={0,number,integer} bytes
+SIZE_GB={0} Gb
+SIZE_KB={0} Kb
+SIZE_MB={0} Mb
+SOURCE=Source
+STACK_TRACE=\nStack trace: \n
+SUMMARY_TAB_HEADER_DATE_TIME_FORMAT=FULL,FULL
+SUMMARY_TAB_PENDING_FINALIZATION_LABEL=Pending finalization
+SUMMARY_TAB_PENDING_FINALIZATION_VALUE={0} objects
+SUMMARY_TAB_TAB_NAME=VM Summary
+SUMMARY_TAB_VM_VERSION={0} version {1}
+THREADS=Threads
+THREAD_TAB_THREAD_INFO_ACCESSIBLE_NAME=Thread Information
+THREAD_TAB_THREAD_PLOTTER_ACCESSIBLE_NAME=Chart for number of threads.
+THRESHOLD=Threshold
+TILE=&Tile
+TIME_RANGE_COLON=&Time Range:
+TIME=Time
+TIME_STAMP=TimeStamp
+TOTAL_LOADED=Total Loaded
+TOTAL_CLASSES_LOADED=Total classes loaded
+TOTAL_CLASSES_UNLOADED=Total classes unloaded
+TOTAL_COMPILE_TIME=Total compile time
+TOTAL_PHYSICAL_MEMORY=Total physical memory
+TOTAL_THREADS_STARTED=Total threads started
+TOTAL_SWAP_SPACE=Total swap space
+TYPE=Type
+UNAVAILABLE=Unavailable
+UNKNOWN_CAPITALIZED=UNKNOWN
+UNKNOWN_HOST=Unknown Host: {0}
+UNREGISTER=Unregister
+UPTIME=Uptime
+USAGE_THRESHOLD=Usage Threshold
+REMOTE_TF_USAGE=<b>Usage</b>: &lt;hostname&gt;:&lt;port&gt; OR service:jmx:&lt;protocol&gt;:&lt;sap&gt;
+USED=Used
+USERNAME_COLON_=&Username:
+USERNAME_ACCESSIBLE_NAME=User Name
+USER_DATA=UserData
+VIRTUAL_MACHINE=Virtual Machine
+VM_ARGUMENTS=VM arguments
+VMINTERNAL_FRAME_ACCESSIBLE_DESCRIPTION=Internal frame for monitoring a Java Virtual Machine
+VALUE=Value
+VENDOR=Vendor
+VERBOSE_OUTPUT=Verbose Output
+VERBOSE_OUTPUT_TOOLTIP=Enable verbose output for class loading system
+VIEW=View
+WINDOW=&Window
+WINDOWS=Windows
+WRITABLE=Writable
+CONNECTION_FAILED1=Connection Failed: Retry?
+CONNECTION_FAILED2=The connection to {0} did not succeed.<br>Would you like to try again?
+CONNECTION_LOST1=Connection Lost: Reconnect?
+CONNECTING_TO1=Connecting to {0}
+CONNECTING_TO2=You are currently being connected to {0}.<br>This will take a few moments.
+DEADLOCK_TAB=Deadlock
+DEADLOCK_TAB_N=Deadlock {0}
+EXPAND=expand
+KBYTES={0} kbytes
+PLOT=plot
+VISUALIZE=visualize
+ZZ_USAGE_TEXT=Usage: {0} [ -interval=n ] [ -notile ] [ -pluginpath <path> ] [ -version ] [ connection ... ]\n\n  -interval   Set the update interval to n seconds (default is 4 seconds)\n  -notile     Do not tile windows initially (for two or more connections)\n  -pluginpath Specify the path that jconsole uses to look up the plugins\n  -version    Print program version\n\n  connection = pid || host:port || JMX URL (service:jmx:<protocol>://...)\n  pid         The process id of a target process\n  host        A remote host name or IP address\n  port        The port number for the remote connection\n\n  -J          Specify the input arguments to the Java virtual machine\n              on which jconsole is running
--- a/src/share/demo/management/MemoryMonitor/README.txt	Wed Sep 05 15:19:51 2012 -0700
+++ b/src/share/demo/management/MemoryMonitor/README.txt	Wed Sep 12 12:32:05 2012 -0700
@@ -38,7 +38,7 @@
 
 To run the MemoryMonitor demo
 
-   java -jar <JDK_HOME>/demo/management/MemoryMonitor.jar 
+   java -jar <JDK_HOME>/demo/management/MemoryMonitor/MemoryMonitor.jar 
 
 These instructions assume that this installation's version of the java
 command is in your path.  If it isn't, then you should either
--- a/src/solaris/classes/sun/awt/X11/XComponentPeer.java	Wed Sep 05 15:19:51 2012 -0700
+++ b/src/solaris/classes/sun/awt/X11/XComponentPeer.java	Wed Sep 12 12:32:05 2012 -0700
@@ -618,7 +618,7 @@
             final XWindowPeer parentXWindow = getParentTopLevel();
             Window parentWindow = (Window)parentXWindow.getTarget();
             if (parentXWindow.isFocusableWindow() && parentXWindow.isSimpleWindow() &&
-                XKeyboardFocusManagerPeer.getCurrentNativeFocusedWindow() != parentWindow)
+                XKeyboardFocusManagerPeer.getInstance().getCurrentFocusedWindow() != parentWindow)
             {
                 postEvent(new InvocationEvent(parentWindow, new  Runnable() {
                         public void run() {
--- a/src/solaris/classes/sun/awt/X11/XDecoratedPeer.java	Wed Sep 05 15:19:51 2012 -0700
+++ b/src/solaris/classes/sun/awt/X11/XDecoratedPeer.java	Wed Sep 12 12:32:05 2012 -0700
@@ -1108,7 +1108,7 @@
         focusLog.fine("Request for decorated window focus");
         // If this is Frame or Dialog we can't assure focus request success - but we still can try
         // If this is Window and its owner Frame is active we can be sure request succedded.
-        Window focusedWindow = XKeyboardFocusManagerPeer.getCurrentNativeFocusedWindow();
+        Window focusedWindow = XKeyboardFocusManagerPeer.getInstance().getCurrentFocusedWindow();
         Window activeWindow = XWindowPeer.getDecoratedOwner(focusedWindow);
 
         focusLog.finer("Current window is: active={0}, focused={1}",
@@ -1201,7 +1201,7 @@
     }
 
     public void handleWindowFocusOut(Window oppositeWindow, long serial) {
-        Window actualFocusedWindow = XKeyboardFocusManagerPeer.getCurrentNativeFocusedWindow();
+        Window actualFocusedWindow = XKeyboardFocusManagerPeer.getInstance().getCurrentFocusedWindow();
 
         // If the actual focused window is not this decorated window then retain it.
         if (actualFocusedWindow != null && actualFocusedWindow != target) {
--- a/src/solaris/classes/sun/awt/X11/XDialogPeer.java	Wed Sep 05 15:19:51 2012 -0700
+++ b/src/solaris/classes/sun/awt/X11/XDialogPeer.java	Wed Sep 12 12:32:05 2012 -0700
@@ -135,7 +135,7 @@
      * Thus we don't have to perform any transitive (a blocker of a blocker) checks.
      */
     boolean isFocusedWindowModalBlocker() {
-        Window focusedWindow = XKeyboardFocusManagerPeer.getCurrentNativeFocusedWindow();
+        Window focusedWindow = XKeyboardFocusManagerPeer.getInstance().getCurrentFocusedWindow();
         XWindowPeer focusedWindowPeer = null;
 
         if (focusedWindow != null) {
--- a/src/solaris/classes/sun/awt/X11/XEmbedChildProxyPeer.java	Wed Sep 05 15:19:51 2012 -0700
+++ b/src/solaris/classes/sun/awt/X11/XEmbedChildProxyPeer.java	Wed Sep 12 12:32:05 2012 -0700
@@ -98,11 +98,11 @@
     public void handleEvent(AWTEvent e) {
         switch (e.getID()) {
           case FocusEvent.FOCUS_GAINED:
-              XKeyboardFocusManagerPeer.setCurrentNativeFocusOwner(proxy);
+              XKeyboardFocusManagerPeer.getInstance().setCurrentFocusOwner(proxy);
               container.focusGained(handle);
               break;
           case FocusEvent.FOCUS_LOST:
-              XKeyboardFocusManagerPeer.setCurrentNativeFocusOwner(null);
+              XKeyboardFocusManagerPeer.getInstance().setCurrentFocusOwner(null);
               container.focusLost(handle);
               break;
           case KeyEvent.KEY_PRESSED:
@@ -174,7 +174,7 @@
         if (lightweightChild == null) {
             lightweightChild = (Component)proxy;
         }
-        Component currentOwner = XKeyboardFocusManagerPeer.getCurrentNativeFocusOwner();
+        Component currentOwner = XKeyboardFocusManagerPeer.getInstance().getCurrentFocusOwner();
         if (currentOwner != null && currentOwner.getPeer() == null) {
             currentOwner = null;
         }
@@ -226,7 +226,8 @@
               if (parent != null) {
                   Window parentWindow = (Window)parent;
                   // and check that it is focused
-                  if (!parentWindow.isFocused() && XKeyboardFocusManagerPeer.getCurrentNativeFocusedWindow() == parentWindow) {
+                  if (!parentWindow.isFocused() &&
+                      XKeyboardFocusManagerPeer.getInstance().getCurrentFocusedWindow() == parentWindow) {
                       // if it is not - skip requesting focus on Solaris
                       // but return true for compatibility.
                       return true;
--- a/src/solaris/classes/sun/awt/X11/XEmbedClientHelper.java	Wed Sep 05 15:19:51 2012 -0700
+++ b/src/solaris/classes/sun/awt/X11/XEmbedClientHelper.java	Wed Sep 12 12:32:05 2012 -0700
@@ -204,7 +204,7 @@
         // XEMBED_FOCUS_OUT client messages), so we first need to check if
         // embedded is an active window before sending WINDOW_LOST_FOCUS
         // to shared code
-        if (XKeyboardFocusManagerPeer.getCurrentNativeFocusedWindow() == embedded.target) {
+        if (XKeyboardFocusManagerPeer.getInstance().getCurrentFocusedWindow() == embedded.target) {
             embedded.handleWindowFocusOut(null, 0);
         }
     }
--- a/src/solaris/classes/sun/awt/X11/XKeyboardFocusManagerPeer.java	Wed Sep 05 15:19:51 2012 -0700
+++ b/src/solaris/classes/sun/awt/X11/XKeyboardFocusManagerPeer.java	Wed Sep 12 12:32:05 2012 -0700
@@ -25,66 +25,48 @@
 package sun.awt.X11;
 
 import java.awt.Component;
-import java.awt.KeyboardFocusManager;
 import java.awt.Window;
-
-import java.awt.event.FocusEvent;
-
-import java.awt.peer.KeyboardFocusManagerPeer;
-import java.awt.peer.ComponentPeer;
-
-import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Method;
-
 import sun.util.logging.PlatformLogger;
-
 import sun.awt.CausedFocusEvent;
-import sun.awt.SunToolkit;
 import sun.awt.KeyboardFocusManagerPeerImpl;
 
 public class XKeyboardFocusManagerPeer extends KeyboardFocusManagerPeerImpl {
     private static final PlatformLogger focusLog = PlatformLogger.getLogger("sun.awt.X11.focus.XKeyboardFocusManagerPeer");
+    private static final XKeyboardFocusManagerPeer inst = new XKeyboardFocusManagerPeer();
 
-    private static Object lock = new Object() {};
-    private static Component currentFocusOwner;
-    private static Window currentFocusedWindow;
+    private Component currentFocusOwner;
+    private Window currentFocusedWindow;
 
-    XKeyboardFocusManagerPeer(KeyboardFocusManager manager) {
-        super(manager);
+    public static XKeyboardFocusManagerPeer getInstance() {
+        return inst;
+    }
+
+    private XKeyboardFocusManagerPeer() {
     }
 
     @Override
     public void setCurrentFocusOwner(Component comp) {
-        setCurrentNativeFocusOwner(comp);
+        synchronized (this) {
+            currentFocusOwner = comp;
+        }
     }
 
     @Override
     public Component getCurrentFocusOwner() {
-        return getCurrentNativeFocusOwner();
-    }
-
-    @Override
-    public Window getCurrentFocusedWindow() {
-        return getCurrentNativeFocusedWindow();
-    }
-
-    public static void setCurrentNativeFocusOwner(Component comp) {
-        synchronized (lock) {
-            currentFocusOwner = comp;
-        }
-    }
-
-    public static Component getCurrentNativeFocusOwner() {
-        synchronized(lock) {
+        synchronized(this) {
             return currentFocusOwner;
         }
     }
 
-    public static void setCurrentNativeFocusedWindow(Window win) {
-        if (focusLog.isLoggable(PlatformLogger.FINER)) focusLog.finer("Setting current native focused window " + win);
+    @Override
+    public void setCurrentFocusedWindow(Window win) {
+        if (focusLog.isLoggable(PlatformLogger.FINER)) {
+            focusLog.finer("Setting current focused window " + win);
+        }
+
         XWindowPeer from = null, to = null;
 
-        synchronized(lock) {
+        synchronized(this) {
             if (currentFocusedWindow != null) {
                 from = (XWindowPeer)currentFocusedWindow.getPeer();
             }
@@ -104,8 +86,9 @@
         }
     }
 
-    public static Window getCurrentNativeFocusedWindow() {
-        synchronized(lock) {
+    @Override
+    public Window getCurrentFocusedWindow() {
+        synchronized(this) {
             return currentFocusedWindow;
         }
     }
@@ -124,6 +107,6 @@
                                                          focusedWindowChangeAllowed,
                                                          time,
                                                          cause,
-                                                         getCurrentNativeFocusOwner());
+                                                         getInstance().getCurrentFocusOwner());
     }
 }
--- a/src/solaris/classes/sun/awt/X11/XLabelPeer.java	Wed Sep 05 15:19:51 2012 -0700
+++ b/src/solaris/classes/sun/awt/X11/XLabelPeer.java	Wed Sep 12 12:32:05 2012 -0700
@@ -140,7 +140,7 @@
     }
     public void setFont(Font f) {
         super.setFont(f);
-        target.repaint();
+        repaint();
     }
 
     public void setAlignment(int align) {
--- a/src/solaris/classes/sun/awt/X11/XToolkit.java	Wed Sep 05 15:19:51 2012 -0700
+++ b/src/solaris/classes/sun/awt/X11/XToolkit.java	Wed Sep 12 12:32:05 2012 -0700
@@ -649,7 +649,7 @@
                 long w = 0;
                 if (windowToXWindow(ev.get_xany().get_window()) != null) {
                     Component owner =
-                        XKeyboardFocusManagerPeer.getCurrentNativeFocusOwner();
+                        XKeyboardFocusManagerPeer.getInstance().getCurrentFocusOwner();
                     if (owner != null) {
                         XWindow ownerWindow = (XWindow) AWTAccessor.getComponentAccessor().getPeer(owner);
                         if (ownerWindow != null) {
@@ -1121,9 +1121,8 @@
         return peer;
     }
 
-    public KeyboardFocusManagerPeer createKeyboardFocusManagerPeer(KeyboardFocusManager manager) throws HeadlessException {
-        XKeyboardFocusManagerPeer peer = new XKeyboardFocusManagerPeer(manager);
-        return peer;
+    public KeyboardFocusManagerPeer getKeyboardFocusManagerPeer() throws HeadlessException {
+        return XKeyboardFocusManagerPeer.getInstance();
     }
 
     /**
--- a/src/solaris/classes/sun/awt/X11/XWindowPeer.java	Wed Sep 05 15:19:51 2012 -0700
+++ b/src/solaris/classes/sun/awt/X11/XWindowPeer.java	Wed Sep 12 12:32:05 2012 -0700
@@ -616,7 +616,7 @@
 
     public void handleWindowFocusIn_Dispatch() {
         if (EventQueue.isDispatchThread()) {
-            XKeyboardFocusManagerPeer.setCurrentNativeFocusedWindow((Window) target);
+            XKeyboardFocusManagerPeer.getInstance().setCurrentFocusedWindow((Window) target);
             WindowEvent we = new WindowEvent((Window)target, WindowEvent.WINDOW_GAINED_FOCUS);
             SunToolkit.setSystemGenerated(we);
             target.dispatchEvent(we);
@@ -625,7 +625,7 @@
 
     public void handleWindowFocusInSync(long serial) {
         WindowEvent we = new WindowEvent((Window)target, WindowEvent.WINDOW_GAINED_FOCUS);
-        XKeyboardFocusManagerPeer.setCurrentNativeFocusedWindow((Window) target);
+        XKeyboardFocusManagerPeer.getInstance().setCurrentFocusedWindow((Window) target);
         sendEvent(we);
     }
     // NOTE: This method may be called by privileged threads.
@@ -633,7 +633,7 @@
     public void handleWindowFocusIn(long serial) {
         WindowEvent we = new WindowEvent((Window)target, WindowEvent.WINDOW_GAINED_FOCUS);
         /* wrap in Sequenced, then post*/
-        XKeyboardFocusManagerPeer.setCurrentNativeFocusedWindow((Window) target);
+        XKeyboardFocusManagerPeer.getInstance().setCurrentFocusedWindow((Window) target);
         postEvent(wrapInSequenced((AWTEvent) we));
     }
 
@@ -641,15 +641,15 @@
     //       DO NOT INVOKE CLIENT CODE ON THIS THREAD!
     public void handleWindowFocusOut(Window oppositeWindow, long serial) {
         WindowEvent we = new WindowEvent((Window)target, WindowEvent.WINDOW_LOST_FOCUS, oppositeWindow);
-        XKeyboardFocusManagerPeer.setCurrentNativeFocusedWindow(null);
-        XKeyboardFocusManagerPeer.setCurrentNativeFocusOwner(null);
+        XKeyboardFocusManagerPeer.getInstance().setCurrentFocusedWindow(null);
+        XKeyboardFocusManagerPeer.getInstance().setCurrentFocusOwner(null);
         /* wrap in Sequenced, then post*/
         postEvent(wrapInSequenced((AWTEvent) we));
     }
     public void handleWindowFocusOutSync(Window oppositeWindow, long serial) {
         WindowEvent we = new WindowEvent((Window)target, WindowEvent.WINDOW_LOST_FOCUS, oppositeWindow);
-        XKeyboardFocusManagerPeer.setCurrentNativeFocusedWindow(null);
-        XKeyboardFocusManagerPeer.setCurrentNativeFocusOwner(null);
+        XKeyboardFocusManagerPeer.getInstance().setCurrentFocusedWindow(null);
+        XKeyboardFocusManagerPeer.getInstance().setCurrentFocusOwner(null);
         sendEvent(we);
     }
 
@@ -1137,7 +1137,7 @@
             // getWMState() always returns 0 (Withdrawn) for simple windows. Hence
             // we ignore the state for such windows.
             if (isVisible() && (state == XUtilConstants.NormalState || isSimpleWindow())) {
-                if (XKeyboardFocusManagerPeer.getCurrentNativeFocusedWindow() ==
+                if (XKeyboardFocusManagerPeer.getInstance().getCurrentFocusedWindow() ==
                         getTarget())
                 {
                     show = true;
@@ -1164,15 +1164,25 @@
     }
 
     public void dispose() {
+        if (isGrabbed()) {
+            if (grabLog.isLoggable(PlatformLogger.FINE)) {
+                grabLog.fine("Generating UngrabEvent on {0} because of the window disposal", this);
+            }
+            postEventToEventQueue(new sun.awt.UngrabEvent(getEventSource()));
+        }
+
         SunToolkit.awtLock();
+
         try {
             windows.remove(this);
         } finally {
             SunToolkit.awtUnlock();
         }
+
         if (warningWindow != null) {
             warningWindow.destroy();
         }
+
         removeRootPropertyEventDispatcher();
         mustControlStackPosition = false;
         super.dispose();
@@ -1184,12 +1194,13 @@
          * receive WM_TAKE_FOCUS.
          */
         if (isSimpleWindow()) {
-            if (target == XKeyboardFocusManagerPeer.getCurrentNativeFocusedWindow()) {
+            if (target == XKeyboardFocusManagerPeer.getInstance().getCurrentFocusedWindow()) {
                 Window owner = getDecoratedOwner((Window)target);
                 ((XWindowPeer)AWTAccessor.getComponentAccessor().getPeer(owner)).requestWindowFocus();
             }
         }
     }
+
     boolean isResizable() {
         return winAttr.isResizable;
     }
@@ -1824,7 +1835,7 @@
         // If this is Frame or Dialog we can't assure focus request success - but we still can try
         // If this is Window and its owner Frame is active we can be sure request succedded.
         Window ownerWindow  = XWindowPeer.getDecoratedOwner((Window)target);
-        Window focusedWindow = XKeyboardFocusManagerPeer.getCurrentNativeFocusedWindow();
+        Window focusedWindow = XKeyboardFocusManagerPeer.getInstance().getCurrentFocusedWindow();
         Window activeWindow = XWindowPeer.getDecoratedOwner(focusedWindow);
 
         if (isWMStateNetHidden()) {
--- a/src/solaris/classes/sun/awt/motif/MToolkit.java	Wed Sep 05 15:19:51 2012 -0700
+++ b/src/solaris/classes/sun/awt/motif/MToolkit.java	Wed Sep 12 12:32:05 2012 -0700
@@ -330,7 +330,7 @@
         return null;
     }
 
-    public KeyboardFocusManagerPeer createKeyboardFocusManagerPeer(KeyboardFocusManager manager) {
+    public KeyboardFocusManagerPeer getKeyboardFocusManagerPeer() {
         return null;
     }
 
--- a/src/solaris/classes/sun/nio/fs/DefaultFileTypeDetector.java	Wed Sep 05 15:19:51 2012 -0700
+++ b/src/solaris/classes/sun/nio/fs/DefaultFileTypeDetector.java	Wed Sep 12 12:32:05 2012 -0700
@@ -25,12 +25,15 @@
 
 package sun.nio.fs;
 
+import java.nio.file.FileSystems;
 import java.nio.file.spi.FileTypeDetector;
+import java.nio.file.spi.FileSystemProvider;
 
 public class DefaultFileTypeDetector {
     private DefaultFileTypeDetector() { }
 
     public static FileTypeDetector create() {
-        return new GnomeFileTypeDetector();
+        FileSystemProvider provider = FileSystems.getDefault().provider();
+        return ((UnixFileSystemProvider)provider).getFileTypeDetector();
     }
 }
--- a/src/solaris/classes/sun/nio/fs/LinuxFileSystem.java	Wed Sep 05 15:19:51 2012 -0700
+++ b/src/solaris/classes/sun/nio/fs/LinuxFileSystem.java	Wed Sep 12 12:32:05 2012 -0700
@@ -82,7 +82,7 @@
             try {
                 for (;;) {
                     UnixMountEntry entry = new UnixMountEntry();
-                    int res = getextmntent(fp, entry);
+                    int res = getmntent(fp, entry);
                     if (res < 0)
                         break;
                     entries.add(entry);
--- a/src/solaris/classes/sun/nio/fs/LinuxFileSystemProvider.java	Wed Sep 05 15:19:51 2012 -0700
+++ b/src/solaris/classes/sun/nio/fs/LinuxFileSystemProvider.java	Wed Sep 12 12:32:05 2012 -0700
@@ -27,6 +27,7 @@
 
 import java.nio.file.*;
 import java.nio.file.attribute.*;
+import java.nio.file.spi.FileTypeDetector;
 import java.io.IOException;
 
 /**
@@ -96,4 +97,9 @@
             return super.readAttributes(file, type, options);
         }
     }
+
+    @Override
+    FileTypeDetector getFileTypeDetector() {
+        return new GnomeFileTypeDetector();
+    }
 }
--- a/src/solaris/classes/sun/nio/fs/LinuxNativeDispatcher.java	Wed Sep 05 15:19:51 2012 -0700
+++ b/src/solaris/classes/sun/nio/fs/LinuxNativeDispatcher.java	Wed Sep 12 12:32:05 2012 -0700
@@ -51,9 +51,15 @@
     private static native long setmntent0(long pathAddress, long typeAddress)
         throws UnixException;
 
-   /**
-    * int endmntent(FILE* filep);
-    */
+    /**
+     * int getmntent(FILE *fp, struct mnttab *mp, int len);
+     */
+    static native int getmntent(long fp, UnixMountEntry entry)
+        throws UnixException;
+
+    /**
+     * int endmntent(FILE* filep);
+     */
     static native void endmntent(long stream) throws UnixException;
 
     /**
@@ -90,7 +96,6 @@
     private static native void fsetxattr0(int filedes, long nameAddress,
         long valueAdddress, int valueLen) throws UnixException;
 
-
     /**
      * fremovexattr(int filedes, const char *name);
      */
--- a/src/solaris/classes/sun/nio/fs/SolarisFileSystem.java	Wed Sep 05 15:19:51 2012 -0700
+++ b/src/solaris/classes/sun/nio/fs/SolarisFileSystem.java	Wed Sep 12 12:32:05 2012 -0700
@@ -30,7 +30,7 @@
 import java.util.*;
 import java.security.AccessController;
 import sun.security.action.GetPropertyAction;
-import static sun.nio.fs.UnixNativeDispatcher.*;
+import static sun.nio.fs.SolarisNativeDispatcher.*;
 
 /**
  * Solaris implementation of FileSystem
--- a/src/solaris/classes/sun/nio/fs/SolarisFileSystemProvider.java	Wed Sep 05 15:19:51 2012 -0700
+++ b/src/solaris/classes/sun/nio/fs/SolarisFileSystemProvider.java	Wed Sep 12 12:32:05 2012 -0700
@@ -27,6 +27,7 @@
 
 import java.nio.file.*;
 import java.nio.file.attribute.*;
+import java.nio.file.spi.FileTypeDetector;
 import java.io.IOException;
 
 /**
@@ -79,4 +80,9 @@
                                                            Util.followLinks(options));
         return super.getFileAttributeView(obj, name, options);
     }
+
+    @Override
+    FileTypeDetector getFileTypeDetector() {
+        return new GnomeFileTypeDetector();
+    }
 }
--- a/src/solaris/classes/sun/nio/fs/SolarisNativeDispatcher.java	Wed Sep 05 15:19:51 2012 -0700
+++ b/src/solaris/classes/sun/nio/fs/SolarisNativeDispatcher.java	Wed Sep 12 12:32:05 2012 -0700
@@ -36,6 +36,12 @@
     private SolarisNativeDispatcher() { }
 
     /**
+     * int getextmntent(FILE *fp, struct extmnttab *mp, int len);
+     */
+    static native int getextmntent(long fp, UnixMountEntry entry)
+        throws UnixException;
+
+    /**
      * int facl(int filedes, int cmd, int nentries, void aclbufp)
      */
     static native int facl(int fd, int cmd, int nentries, long aclbufp)
--- a/src/solaris/classes/sun/nio/fs/UnixFileSystemProvider.java	Wed Sep 05 15:19:51 2012 -0700
+++ b/src/solaris/classes/sun/nio/fs/UnixFileSystemProvider.java	Wed Sep 12 12:32:05 2012 -0700
@@ -27,6 +27,7 @@
 
 import java.nio.file.*;
 import java.nio.file.attribute.*;
+import java.nio.file.spi.FileTypeDetector;
 import java.nio.channels.*;
 import java.net.URI;
 import java.util.concurrent.ExecutorService;
@@ -495,4 +496,17 @@
             return null;    // keep compiler happy
         }
     }
+
+    /**
+     * Returns a {@code FileTypeDetector} for this platform.
+     */
+    FileTypeDetector getFileTypeDetector() {
+        return new AbstractFileTypeDetector() {
+            @Override
+            public String implProbeContentType(Path file) {
+                return null;
+            }
+        };
+    }
+
 }
--- a/src/solaris/classes/sun/nio/fs/UnixNativeDispatcher.java	Wed Sep 05 15:19:51 2012 -0700
+++ b/src/solaris/classes/sun/nio/fs/UnixNativeDispatcher.java	Wed Sep 12 12:32:05 2012 -0700
@@ -498,11 +498,6 @@
     private static native int getgrnam0(long nameAddress) throws UnixException;
 
     /**
-     * int getextmntent(FILE *fp, struct extmnttab *mp, int len);
-     */
-    static native int getextmntent(long fp, UnixMountEntry entry) throws UnixException;
-
-    /**
      * statvfs(const char* path, struct statvfs *buf)
      */
     static void statvfs(UnixPath path, UnixFileStoreAttributes attrs)
--- a/src/solaris/native/sun/awt/fontpath.c	Wed Sep 05 15:19:51 2012 -0700
+++ b/src/solaris/native/sun/awt/fontpath.c	Wed Sep 12 12:32:05 2012 -0700
@@ -583,9 +583,6 @@
 }
 
 #include <dlfcn.h>
-#if !(defined(__linux__) || defined(MACOSX))
-#include <link.h>
-#endif
 
 #include "fontconfig.h"
 
--- a/src/solaris/native/sun/java2d/opengl/OGLFuncs_md.h	Wed Sep 05 15:19:51 2012 -0700
+++ b/src/solaris/native/sun/java2d/opengl/OGLFuncs_md.h	Wed Sep 12 12:32:05 2012 -0700
@@ -28,7 +28,7 @@
 
 #include <stdlib.h>
 #ifndef MACOSX
-#include <link.h>
+#include <dlfcn.h>
 #endif
 #include "jvm_md.h"
 #include "J2D_GL/glx.h"
--- a/src/solaris/native/sun/java2d/x11/XRBackendNative.c	Wed Sep 05 15:19:51 2012 -0700
+++ b/src/solaris/native/sun/java2d/x11/XRBackendNative.c	Wed Sep 12 12:32:05 2012 -0700
@@ -70,7 +70,6 @@
 
 #ifdef __solaris__
 /* Solaris 10 will not have these symbols at runtime */
-#include <link.h>
 
 typedef Picture (*XRenderCreateLinearGradientFuncType)
                                      (Display *dpy,
--- a/src/solaris/native/sun/nio/ch/DatagramDispatcher.c	Wed Sep 05 15:19:51 2012 -0700
+++ b/src/solaris/native/sun/nio/ch/DatagramDispatcher.c	Wed Sep 12 12:32:05 2012 -0700
@@ -34,6 +34,7 @@
 #include <sys/types.h>
 #include <sys/uio.h>
 #include <sys/socket.h>
+#include <string.h>
 
 #include "nio_util.h"
 #include <limits.h>
--- a/src/solaris/native/sun/nio/ch/Net.c	Wed Sep 05 15:19:51 2012 -0700
+++ b/src/solaris/native/sun/nio/ch/Net.c	Wed Sep 12 12:32:05 2012 -0700
@@ -39,83 +39,6 @@
 #include "nio_util.h"
 #include "nio.h"
 
-/**
- * Definitions for source-specific multicast to allow for building
- * with older header files.
- */
-
-#ifdef __solaris__
-
-#ifndef IP_BLOCK_SOURCE
-
-#define IP_BLOCK_SOURCE                 0x15
-#define IP_UNBLOCK_SOURCE               0x16
-#define IP_ADD_SOURCE_MEMBERSHIP        0x17
-#define IP_DROP_SOURCE_MEMBERSHIP       0x18
-
-#define MCAST_BLOCK_SOURCE              0x2b
-#define MCAST_UNBLOCK_SOURCE            0x2c
-#define MCAST_JOIN_SOURCE_GROUP         0x2d
-#define MCAST_LEAVE_SOURCE_GROUP        0x2e
-
-#endif  /* IP_BLOCK_SOURCE */
-
-struct my_ip_mreq_source {
-        struct in_addr  imr_multiaddr;
-        struct in_addr  imr_sourceaddr;
-        struct in_addr  imr_interface;
-};
-
-/*
- * Use #pragma pack() construct to force 32-bit alignment on amd64.
- */
-#if defined(amd64)
-#pragma pack(4)
-#endif
-
-struct my_group_source_req {
-        uint32_t                gsr_interface;  /* interface index */
-        struct sockaddr_storage gsr_group;      /* group address */
-        struct sockaddr_storage gsr_source;     /* source address */
-};
-
-#if defined(amd64)
-#pragma pack()
-#endif
-
-#endif  /* __solaris__ */
-
-
-#ifdef __linux__
-
-#ifndef IP_BLOCK_SOURCE
-
-#define IP_BLOCK_SOURCE                 38
-#define IP_UNBLOCK_SOURCE               37
-#define IP_ADD_SOURCE_MEMBERSHIP        39
-#define IP_DROP_SOURCE_MEMBERSHIP       40
-
-#define MCAST_BLOCK_SOURCE              43
-#define MCAST_UNBLOCK_SOURCE            44
-#define MCAST_JOIN_SOURCE_GROUP         42
-#define MCAST_LEAVE_SOURCE_GROUP        45
-
-#endif  /* IP_BLOCK_SOURCE */
-
-struct my_ip_mreq_source {
-        struct in_addr  imr_multiaddr;
-        struct in_addr  imr_interface;
-        struct in_addr  imr_sourceaddr;
-};
-
-struct my_group_source_req {
-        uint32_t                gsr_interface;  /* interface index */
-        struct sockaddr_storage gsr_group;      /* group address */
-        struct sockaddr_storage gsr_source;     /* source address */
-};
-
-#endif   /* __linux__ */
-
 #ifdef _ALLBSD_SOURCE
 
 #ifndef IP_BLOCK_SOURCE
@@ -155,7 +78,12 @@
         struct sockaddr_storage gsr_source;     /* source address */
 };
 
-#endif   /* _ALLBSD_SOURCE */
+#else   /* _ALLBSD_SOURCE */
+
+#define my_ip_mreq_source         ip_mreq_source
+#define my_group_source_req       group_source_req
+
+#endif
 
 
 #define COPY_INET6_ADDRESS(env, source, target) \
@@ -576,8 +504,8 @@
         optval = (void*)&mreq6;
         optlen = sizeof(mreq6);
     } else {
-#if defined (__linux__) || defined(MACOSX)
-        /* Include-mode filtering broken on Mac OS & Linux at least to 2.6.24 */
+#ifdef MACOSX
+        /* no IPv6 include-mode filtering for now */
         return IOS_UNAVAILABLE;
 #else
         initGroupSourceReq(env, group, index, source, &req);
--- a/src/solaris/native/sun/nio/fs/BsdNativeDispatcher.c	Wed Sep 05 15:19:51 2012 -0700
+++ b/src/solaris/native/sun/nio/fs/BsdNativeDispatcher.c	Wed Sep 12 12:32:05 2012 -0700
@@ -46,8 +46,6 @@
 static jfieldID entry_dir;
 static jfieldID entry_fstype;
 static jfieldID entry_options;
-static jfieldID entry_dev;
-
 
 struct fsstat_iter {
     struct statfs *buf;
@@ -81,7 +79,6 @@
     entry_dir = (*env)->GetFieldID(env, clazz, "dir", "[B");
     entry_fstype = (*env)->GetFieldID(env, clazz, "fstype", "[B");
     entry_options = (*env)->GetFieldID(env, clazz, "opts", "[B");
-    entry_dev = (*env)->GetFieldID(env, clazz, "dev", "J");
 }
 
 JNIEXPORT jlong JNICALL
@@ -160,7 +157,6 @@
         options="ro";
     else
         options="";
-    dev = 0;
 
     iter->pos++;
 
@@ -192,9 +188,6 @@
     (*env)->SetByteArrayRegion(env, bytes, 0, len, (jbyte*)options);
     (*env)->SetObjectField(env, entry, entry_options, bytes);
 
-    if (dev != 0)
-        (*env)->SetLongField(env, entry, entry_dev, (jlong)dev);
-
     return 0;
 }
 
@@ -208,3 +201,4 @@
         free(iter);
     }
 }
+
--- a/src/solaris/native/sun/nio/fs/GnomeFileTypeDetector.c	Wed Sep 05 15:19:51 2012 -0700
+++ b/src/solaris/native/sun/nio/fs/GnomeFileTypeDetector.c	Wed Sep 12 12:32:05 2012 -0700
@@ -30,15 +30,12 @@
 
 #include <stdlib.h>
 #include <dlfcn.h>
-#ifndef __APPLE__
-#include <link.h>
-#endif
 
 #ifdef __solaris__
 #include <strings.h>
 #endif
 
-#if defined(__linux__) || defined(__APPLE__)
+#if defined(__linux__)
 #include <string.h>
 #endif
 
--- a/src/solaris/native/sun/nio/fs/LinuxNativeDispatcher.c	Wed Sep 05 15:19:51 2012 -0700
+++ b/src/solaris/native/sun/nio/fs/LinuxNativeDispatcher.c	Wed Sep 12 12:32:05 2012 -0700
@@ -29,6 +29,7 @@
 #include "jlong.h"
 
 #include <stdio.h>
+#include <string.h>
 #include <dlfcn.h>
 #include <errno.h>
 #include <mntent.h>
@@ -45,6 +46,11 @@
 fremovexattr_func* my_fremovexattr_func = NULL;
 flistxattr_func* my_flistxattr_func = NULL;
 
+static jfieldID entry_name;
+static jfieldID entry_dir;
+static jfieldID entry_fstype;
+static jfieldID entry_options;
+
 static void throwUnixException(JNIEnv* env, int errnum) {
     jobject x = JNU_NewObjectByName(env, "sun/nio/fs/UnixException",
         "(I)V", errnum);
@@ -60,6 +66,15 @@
     my_fsetxattr_func = (fsetxattr_func*)dlsym(RTLD_DEFAULT, "fsetxattr");
     my_fremovexattr_func = (fremovexattr_func*)dlsym(RTLD_DEFAULT, "fremovexattr");
     my_flistxattr_func = (flistxattr_func*)dlsym(RTLD_DEFAULT, "flistxattr");
+
+    clazz = (*env)->FindClass(env, "sun/nio/fs/UnixMountEntry");
+    if (clazz == NULL)
+        return;
+
+    entry_name = (*env)->GetFieldID(env, clazz, "name", "[B");
+    entry_dir = (*env)->GetFieldID(env, clazz, "dir", "[B");
+    entry_fstype = (*env)->GetFieldID(env, clazz, "fstype", "[B");
+    entry_options = (*env)->GetFieldID(env, clazz, "opts", "[B");
 }
 
 JNIEXPORT jint JNICALL
@@ -151,6 +166,61 @@
     return ptr_to_jlong(fp);
 }
 
+JNIEXPORT jint JNICALL
+Java_sun_nio_fs_LinuxNativeDispatcher_getmntent(JNIEnv* env, jclass this,
+    jlong value, jobject entry)
+{
+    struct mntent ent;
+    char buf[1024];
+    int buflen = sizeof(buf);
+    struct mntent* m;
+    FILE* fp = jlong_to_ptr(value);
+    jsize len;
+    jbyteArray bytes;
+    char* name;
+    char* dir;
+    char* fstype;
+    char* options;
+
+    m = getmntent_r(fp, &ent, (char*)&buf, buflen);
+    if (m == NULL)
+        return -1;
+    name = m->mnt_fsname;
+    dir = m->mnt_dir;
+    fstype = m->mnt_type;
+    options = m->mnt_opts;
+
+    len = strlen(name);
+    bytes = (*env)->NewByteArray(env, len);
+    if (bytes == NULL)
+        return -1;
+    (*env)->SetByteArrayRegion(env, bytes, 0, len, (jbyte*)name);
+    (*env)->SetObjectField(env, entry, entry_name, bytes);
+
+    len = strlen(dir);
+    bytes = (*env)->NewByteArray(env, len);
+    if (bytes == NULL)
+        return -1;
+    (*env)->SetByteArrayRegion(env, bytes, 0, len, (jbyte*)dir);
+    (*env)->SetObjectField(env, entry, entry_dir, bytes);
+
+    len = strlen(fstype);
+    bytes = (*env)->NewByteArray(env, len);
+    if (bytes == NULL)
+        return -1;
+    (*env)->SetByteArrayRegion(env, bytes, 0, len, (jbyte*)fstype);
+    (*env)->SetObjectField(env, entry, entry_fstype, bytes);
+
+    len = strlen(options);
+    bytes = (*env)->NewByteArray(env, len);
+    if (bytes == NULL)
+        return -1;
+    (*env)->SetByteArrayRegion(env, bytes, 0, len, (jbyte*)options);
+    (*env)->SetObjectField(env, entry, entry_options, bytes);
+
+    return 0;
+}
+
 JNIEXPORT void JNICALL
 Java_sun_nio_fs_LinuxNativeDispatcher_endmntent(JNIEnv* env, jclass this, jlong stream)
 {
--- a/src/solaris/native/sun/nio/fs/SolarisNativeDispatcher.c	Wed Sep 05 15:19:51 2012 -0700
+++ b/src/solaris/native/sun/nio/fs/SolarisNativeDispatcher.c	Wed Sep 12 12:32:05 2012 -0700
@@ -28,12 +28,22 @@
 #include "jvm.h"
 #include "jlong.h"
 
-#include <dlfcn.h>
+#include <strings.h>
 #include <errno.h>
 #include <sys/acl.h>
+#include <sys/mnttab.h>
+#include <sys/mkdev.h>
+
+#include "jni.h"
 
 #include "sun_nio_fs_SolarisNativeDispatcher.h"
 
+static jfieldID entry_name;
+static jfieldID entry_dir;
+static jfieldID entry_fstype;
+static jfieldID entry_options;
+static jfieldID entry_dev;
+
 static void throwUnixException(JNIEnv* env, int errnum) {
     jobject x = JNU_NewObjectByName(env, "sun/nio/fs/UnixException",
         "(I)V", errnum);
@@ -44,6 +54,15 @@
 
 JNIEXPORT void JNICALL
 Java_sun_nio_fs_SolarisNativeDispatcher_init(JNIEnv *env, jclass clazz) {
+    clazz = (*env)->FindClass(env, "sun/nio/fs/UnixMountEntry");
+    if (clazz == NULL)
+        return;
+
+    entry_name = (*env)->GetFieldID(env, clazz, "name", "[B");
+    entry_dir = (*env)->GetFieldID(env, clazz, "dir", "[B");
+    entry_fstype = (*env)->GetFieldID(env, clazz, "fstype", "[B");
+    entry_options = (*env)->GetFieldID(env, clazz, "opts", "[B");
+    entry_dev = (*env)->GetFieldID(env, clazz, "dev", "J");
 }
 
 JNIEXPORT jint JNICALL
@@ -59,3 +78,63 @@
     }
     return (jint)n;
 }
+
+JNIEXPORT jint JNICALL
+Java_sun_nio_fs_SolarisNativeDispatcher_getextmntent(JNIEnv* env, jclass this,
+    jlong value, jobject entry)
+{
+    struct extmnttab ent;
+    FILE* fp = jlong_to_ptr(value);
+    jsize len;
+    jbyteArray bytes;
+    char* name;
+    char* dir;
+    char* fstype;
+    char* options;
+    dev_t dev;
+
+    if (getextmntent(fp, &ent, 0))
+        return -1;
+    name = ent.mnt_special;
+    dir = ent.mnt_mountp;
+    fstype = ent.mnt_fstype;
+    options = ent.mnt_mntopts;
+    dev = makedev(ent.mnt_major, ent.mnt_minor);
+    if (dev == NODEV) {
+        throwUnixException(env, errno);
+        return -1;
+    }
+
+    len = strlen(name);
+    bytes = (*env)->NewByteArray(env, len);
+    if (bytes == NULL)
+        return -1;
+    (*env)->SetByteArrayRegion(env, bytes, 0, len, (jbyte*)name);
+    (*env)->SetObjectField(env, entry, entry_name, bytes);
+
+    len = strlen(dir);
+    bytes = (*env)->NewByteArray(env, len);
+    if (bytes == NULL)
+        return -1;
+    (*env)->SetByteArrayRegion(env, bytes, 0, len, (jbyte*)dir);
+    (*env)->SetObjectField(env, entry, entry_dir, bytes);
+
+    len = strlen(fstype);
+    bytes = (*env)->NewByteArray(env, len);
+    if (bytes == NULL)
+        return -1;
+    (*env)->SetByteArrayRegion(env, bytes, 0, len, (jbyte*)fstype);
+    (*env)->SetObjectField(env, entry, entry_fstype, bytes);
+
+    len = strlen(options);
+    bytes = (*env)->NewByteArray(env, len);
+    if (bytes == NULL)
+        return -1;
+    (*env)->SetByteArrayRegion(env, bytes, 0, len, (jbyte*)options);
+    (*env)->SetObjectField(env, entry, entry_options, bytes);
+
+    if (dev != 0)
+        (*env)->SetLongField(env, entry, entry_dev, (jlong)dev);
+
+    return 0;
+}
--- a/src/solaris/native/sun/nio/fs/UnixNativeDispatcher.c	Wed Sep 05 15:19:51 2012 -0700
+++ b/src/solaris/native/sun/nio/fs/UnixNativeDispatcher.c	Wed Sep 12 12:32:05 2012 -0700
@@ -40,13 +40,10 @@
 
 #ifdef __solaris__
 #include <strings.h>
-#include <sys/mnttab.h>
-#include <sys/mkdev.h>
 #endif
 
 #ifdef __linux__
 #include <string.h>
-#include <mntent.h>
 #endif
 
 #ifdef _ALLBSD_SOURCE
@@ -1018,7 +1015,7 @@
 
         if (res != 0 || p == NULL || p->pw_name == NULL || *(p->pw_name) == '\0') {
             /* not found or error */
-            if (errno != 0 && errno != ENOENT)
+            if (errno != 0 && errno != ENOENT && errno != ESRCH)
                 throwUnixException(env, errno);
         } else {
             uid = p->pw_uid;
@@ -1064,7 +1061,7 @@
         retry = 0;
         if (res != 0 || g == NULL || g->gr_name == NULL || *(g->gr_name) == '\0') {
             /* not found or error */
-            if (errno != 0 && errno != ENOENT) {
+            if (errno != 0 && errno != ENOENT && errno != ESRCH) {
                 if (errno == ERANGE) {
                     /* insufficient buffer size so need larger buffer */
                     buflen += ENT_BUF_SIZE;
@@ -1083,105 +1080,3 @@
 
     return gid;
 }
-
-JNIEXPORT jint JNICALL
-Java_sun_nio_fs_UnixNativeDispatcher_getextmntent(JNIEnv* env, jclass this,
-    jlong value, jobject entry)
-{
-#ifdef __solaris__
-    struct extmnttab ent;
-#elif defined(_ALLBSD_SOURCE)
-    char buf[1024];
-    char *str;
-    char *last;
-#else
-    struct mntent ent;
-    char buf[1024];
-    int buflen = sizeof(buf);
-    struct mntent* m;
-#endif
-    FILE* fp = jlong_to_ptr(value);
-    jsize len;
-    jbyteArray bytes;
-    char* name;
-    char* dir;
-    char* fstype;
-    char* options;
-    dev_t dev;
-
-#ifdef __solaris__
-    if (getextmntent(fp, &ent, 0))
-        return -1;
-    name = ent.mnt_special;
-    dir = ent.mnt_mountp;
-    fstype = ent.mnt_fstype;
-    options = ent.mnt_mntopts;
-    dev = makedev(ent.mnt_major, ent.mnt_minor);
-    if (dev == NODEV) {
-        /* possible bug on Solaris 8 and 9 */
-        throwUnixException(env, errno);
-        return -1;
-    }
-#elif defined(_ALLBSD_SOURCE)
-again:
-    if (!(str = fgets(buf, sizeof(buf), fp)))
-        return -1;
-
-    name = strtok_r(str, " \t\n", &last);
-    if (name == NULL)
-        return -1;
-
-    // skip comments
-    if (*name == '#')
-        goto again;
-
-    dir = strtok_r((char *)NULL, " \t\n", &last);
-    fstype = strtok_r((char *)NULL, " \t\n", &last);
-    options = strtok_r((char *)NULL, " \t\n", &last);
-    if (options == NULL)
-        return -1;
-    dev = 0;
-#else
-    m = getmntent_r(fp, &ent, (char*)&buf, buflen);
-    if (m == NULL)
-        return -1;
-    name = m->mnt_fsname;
-    dir = m->mnt_dir;
-    fstype = m->mnt_type;
-    options = m->mnt_opts;
-    dev = 0;
-#endif
-
-    len = strlen(name);
-    bytes = (*env)->NewByteArray(env, len);
-    if (bytes == NULL)
-        return -1;
-    (*env)->SetByteArrayRegion(env, bytes, 0, len, (jbyte*)name);
-    (*env)->SetObjectField(env, entry, entry_name, bytes);
-
-    len = strlen(dir);
-    bytes = (*env)->NewByteArray(env, len);
-    if (bytes == NULL)
-        return -1;
-    (*env)->SetByteArrayRegion(env, bytes, 0, len, (jbyte*)dir);
-    (*env)->SetObjectField(env, entry, entry_dir, bytes);
-
-    len = strlen(fstype);
-    bytes = (*env)->NewByteArray(env, len);
-    if (bytes == NULL)
-        return -1;
-    (*env)->SetByteArrayRegion(env, bytes, 0, len, (jbyte*)fstype);
-    (*env)->SetObjectField(env, entry, entry_fstype, bytes);
-
-    len = strlen(options);
-    bytes = (*env)->NewByteArray(env, len);
-    if (bytes == NULL)
-        return -1;
-    (*env)->SetByteArrayRegion(env, bytes, 0, len, (jbyte*)options);
-    (*env)->SetObjectField(env, entry, entry_options, bytes);
-
-    if (dev != 0)
-        (*env)->SetLongField(env, entry, entry_dev, (jlong)dev);
-
-    return 0;
-}
--- a/src/solaris/native/sun/security/jgss/wrapper/NativeFunc.c	Wed Sep 05 15:19:51 2012 -0700
+++ b/src/solaris/native/sun/security/jgss/wrapper/NativeFunc.c	Wed Sep 12 12:32:05 2012 -0700
@@ -26,9 +26,6 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <dlfcn.h>
-#ifndef __APPLE__
-#include <link.h>
-#endif
 #include "NativeFunc.h"
 
 /* standard GSS method names (ordering is from mapfile) */
--- a/src/solaris/native/sun/security/pkcs11/j2secmod_md.c	Wed Sep 05 15:19:51 2012 -0700
+++ b/src/solaris/native/sun/security/pkcs11/j2secmod_md.c	Wed Sep 12 12:32:05 2012 -0700
@@ -28,9 +28,6 @@
 #include <string.h>
 
 #include <dlfcn.h>
-#ifndef __APPLE__
-#include <link.h>
-#endif
 
 #include <jni_util.h>
 
--- a/src/solaris/native/sun/security/pkcs11/wrapper/p11_md.c	Wed Sep 05 15:19:51 2012 -0700
+++ b/src/solaris/native/sun/security/pkcs11/wrapper/p11_md.c	Wed Sep 12 12:32:05 2012 -0700
@@ -64,9 +64,6 @@
 #include <assert.h>
 
 #include <dlfcn.h>
-#ifndef __APPLE__
-#include <link.h>
-#endif
 
 #include <jni.h>
 
--- a/src/solaris/native/sun/security/smartcardio/pcsc_md.c	Wed Sep 05 15:19:51 2012 -0700
+++ b/src/solaris/native/sun/security/smartcardio/pcsc_md.c	Wed Sep 12 12:32:05 2012 -0700
@@ -29,9 +29,6 @@
 #include <assert.h>
 
 #include <dlfcn.h>
-#ifndef __APPLE__
-#include <link.h>
-#endif
 
 #include <winscard.h>
 
--- a/src/solaris/npt/npt_md.h	Wed Sep 05 15:19:51 2012 -0700
+++ b/src/solaris/npt/npt_md.h	Wed Sep 12 12:32:05 2012 -0700
@@ -32,9 +32,6 @@
 #include <string.h>
 #include <errno.h>
 #include <dlfcn.h>
-#ifndef __APPLE__
-#include <link.h>
-#endif
 #include <jvm_md.h>
 
 #define NPT_LIBNAME "npt"
--- a/src/windows/classes/sun/awt/windows/WKeyboardFocusManagerPeer.java	Wed Sep 05 15:19:51 2012 -0700
+++ b/src/windows/classes/sun/awt/windows/WKeyboardFocusManagerPeer.java	Wed Sep 12 12:32:05 2012 -0700
@@ -25,7 +25,6 @@
 
 package sun.awt.windows;
 
-import java.awt.KeyboardFocusManager;
 import java.awt.Window;
 import java.awt.Component;
 import java.awt.peer.ComponentPeer;
@@ -37,8 +36,13 @@
     static native Component getNativeFocusOwner();
     static native Window getNativeFocusedWindow();
 
-    WKeyboardFocusManagerPeer(KeyboardFocusManager manager) {
-        super(manager);
+    private static final WKeyboardFocusManagerPeer inst = new WKeyboardFocusManagerPeer();
+
+    public static WKeyboardFocusManagerPeer getInstance() {
+        return inst;
+    }
+
+    private WKeyboardFocusManagerPeer() {
     }
 
     @Override
@@ -52,6 +56,12 @@
     }
 
     @Override
+    public void setCurrentFocusedWindow(Window win) {
+        // Not used on Windows
+        throw new RuntimeException("not implemented");
+    }
+
+    @Override
     public Window getCurrentFocusedWindow() {
         return getNativeFocusedWindow();
     }
--- a/src/windows/classes/sun/awt/windows/WToolkit.java	Wed Sep 05 15:19:51 2012 -0700
+++ b/src/windows/classes/sun/awt/windows/WToolkit.java	Wed Sep 12 12:32:05 2012 -0700
@@ -500,10 +500,10 @@
         return true;
     }
 
-    public KeyboardFocusManagerPeer createKeyboardFocusManagerPeer(KeyboardFocusManager manager)
+    public KeyboardFocusManagerPeer getKeyboardFocusManagerPeer()
       throws HeadlessException
     {
-        return new WKeyboardFocusManagerPeer(manager);
+        return WKeyboardFocusManagerPeer.getInstance();
     }
 
     protected native void setDynamicLayoutNative(boolean b);
--- a/src/windows/classes/sun/java2d/ScreenUpdateManager.java	Wed Sep 05 15:19:51 2012 -0700
+++ b/src/windows/classes/sun/java2d/ScreenUpdateManager.java	Wed Sep 12 12:32:05 2012 -0700
@@ -110,6 +110,11 @@
     public SurfaceData getReplacementScreenSurface(WComponentPeer peer,
                                                    SurfaceData oldsd)
     {
+        SurfaceData surfaceData = peer.getSurfaceData();
+        if (surfaceData.isValid()) {
+            return surfaceData;
+        }
+        peer.replaceSurfaceData();
         return peer.getSurfaceData();
     }
 
--- a/src/windows/classes/sun/java2d/d3d/D3DSurfaceData.java	Wed Sep 05 15:19:51 2012 -0700
+++ b/src/windows/classes/sun/java2d/d3d/D3DSurfaceData.java	Wed Sep 12 12:32:05 2012 -0700
@@ -486,7 +486,7 @@
             int dataType = 0;
             int scanStride = width;
 
-            if (dcm.getPixelSize() == 24 || dcm.getPixelSize() == 32) {
+            if (dcm.getPixelSize() > 16) {
                 dataType = DataBuffer.TYPE_INT;
             } else {
                 // 15, 16
--- a/src/windows/native/sun/windows/awt_TextField.cpp	Wed Sep 05 15:19:51 2012 -0700
+++ b/src/windows/native/sun/windows/awt_TextField.cpp	Wed Sep 12 12:32:05 2012 -0700
@@ -75,6 +75,7 @@
 AwtTextField::HandleEvent(MSG *msg, BOOL synthetic)
 {
     MsgRouting returnVal;
+    BOOL systemBeeperEnabled = FALSE;
     /*
      * RichEdit 1.0 control starts internal message loop if the
      * left mouse button is pressed while the cursor is not over
@@ -217,6 +218,25 @@
         }
         delete msg;
         return mrConsume;
+    } else if (msg->message == WM_KEYDOWN) {
+        UINT virtualKey = (UINT) msg->wParam;
+
+        switch(virtualKey){
+          case VK_RETURN:
+          case VK_UP:
+          case VK_DOWN:
+          case VK_LEFT:
+          case VK_RIGHT:
+          case VK_DELETE:
+          case VK_BACK:
+              SystemParametersInfo(SPI_GETBEEP, 0, &systemBeeperEnabled, 0);
+              if(systemBeeperEnabled){
+                  // disable system beeper for the RICHEDIT control to be compatible
+                  // with the EDIT control behaviour
+                  SystemParametersInfo(SPI_SETBEEP, 0, NULL, 0);
+              }
+              break;
+          }
     }
     /*
      * Store the 'synthetic' parameter so that the WM_PASTE security check
@@ -226,6 +246,10 @@
     returnVal = AwtComponent::HandleEvent(msg, synthetic);
     m_synthetic = FALSE;
 
+    if(systemBeeperEnabled){
+      SystemParametersInfo(SPI_SETBEEP, 1, NULL, 0);
+    }
+
     return returnVal;
 }
 
--- a/test/Makefile	Wed Sep 05 15:19:51 2012 -0700
+++ b/test/Makefile	Wed Sep 12 12:32:05 2012 -0700
@@ -512,7 +512,8 @@
 JDK_ALL_TARGETS += jdk_misc
 jdk_misc: $(call TestDirs, \
           demo/jvmti demo/zipfs javax/naming javax/script \
-          javax/smartcardio com/sun/jndi com/sun/xml sun/misc)
+          javax/smartcardio com/sun/jndi com/sun/xml \
+          com/sun/corba sun/misc)
 	$(call RunAgentvmBatch)
 
 # Stable samevm testruns (minus items from PROBLEM_LIST)
--- a/test/ProblemList.txt	Wed Sep 05 15:19:51 2012 -0700
+++ b/test/ProblemList.txt	Wed Sep 12 12:32:05 2012 -0700
@@ -474,9 +474,6 @@
 # Registry already running on port, solaris
 java/rmi/Naming/legalRegistryNames/LegalRegistryNames.java      generic-all
 
-# Fails on Linux 32 and 64bit -server?, impl not garbage collected???
-java/rmi/transport/pinLastArguments/PinLastArguments.java       generic-all
-
 # 7146541
 java/rmi/transport/rapidExportUnexport/RapidExportUnexport.java	linux-all
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/com/sun/corba/cachedSocket/7056731.sh	Wed Sep 12 12:32:05 2012 -0700
@@ -0,0 +1,122 @@
+#
+# Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# This code is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License version 2 only, as
+# published by the Free Software Foundation.
+#
+# This code is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+# version 2 for more details (a copy is included in the LICENSE file that
+# accompanied this code).
+#
+# You should have received a copy of the GNU General Public License version
+# 2 along with this work; if not, write to the Free Software Foundation,
+# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+#
+# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+# or visit www.oracle.com if you need additional information or have any
+# questions.
+#
+
+#
+#  @test
+#  @bug 7056731
+#  @summary Race condition in CORBA code causes re-use of ABORTed connections
+#
+#  @run shell 7056731.sh
+#
+
+OS=`uname -s`
+case "$OS" in
+  SunOS | Linux | Darwin )
+    PS=":"
+    FS="/"
+    ;;
+  Windows* | CYGWIN* )
+    PS=";"
+    FS="\\"
+    ;;
+  * )
+    echo "Unrecognized system!"
+    exit 1;
+    ;;
+esac
+
+if [ "${TESTJAVA}" = "" ] ; then
+  echo "TESTJAVA not set.  Test cannot execute.  Failed."
+  exit 1
+fi
+
+JAVA="${TESTJAVA}${FS}bin${FS}java"
+PORT=1052
+cp -r ${TESTSRC}${FS}*.java  ${TESTSRC}${FS}Hello.idl .
+echo "Testing...please wait"
+
+${TESTJAVA}${FS}bin${FS}idlj -fall Hello.idl
+${TESTJAVA}${FS}bin${FS}javac *.java HelloApp/*.java
+
+echo "starting orbd"
+${TESTJAVA}${FS}bin${FS}orbd -ORBInitialPort $PORT -ORBInitialHost localhost &
+ORB_PROC=$!
+sleep 2 #give orbd time to start
+echo "started orb"
+echo "starting server"
+${TESTJAVA}${FS}bin${FS}java -cp . HelloServer -ORBInitialPort $PORT -ORBInitialHost localhost &
+SERVER_PROC=$!
+sleep 2 #give server time to start
+echo "started server"
+echo "starting client (debug mode)"
+${TESTJAVA}${FS}bin${FS}java -cp . -agentlib:jdwp=transport=dt_socket,server=y,address=8000 HelloClient -ORBInitialPort $PORT -ORBInitialHost localhost > client.$$ 2>&1 & 
+JVM_PROC=$!
+sleep 2 #give jvm/debugger/client time to start
+
+echo "started client (debug mode)"
+echo "starting debugger and issuing commands"
+(sleep 2;
+echo "stop in com.sun.corba.se.impl.protocol.CorbaClientRequestDispatcherImpl.unregisterWaiter";
+sleep 2;
+echo "run";
+sleep 2;
+echo "cont";
+sleep 2;
+echo "cont";
+sleep 2;
+echo "cont";
+sleep 2;
+echo "suspend 1";
+sleep 2;
+kill -9 $SERVER_PROC &> /dev/null;
+sleep 2;
+echo "cont";
+sleep 2;
+echo "thread 1"
+sleep 2;
+echo "clear com.sun.corba.se.impl.protocol.CorbaClientRequestDispatcherImpl.unregisterWaiter"
+sleep 2;
+echo "resume 1";
+)| ${TESTJAVA}${FS}bin${FS}jdb -connect com.sun.jdi.SocketAttach:hostname=localhost,port=8000
+
+sleep 5 # give time for Client to throw exception
+
+# JVM_PROC should have exited but just in case, include it.
+kill -9 $ORB_PROC $JVM_PROC
+
+grep "ORBUtilSystemException.writeErrorSend" client.$$
+result=$?
+if [ $result -eq 0 ]
+then
+    echo "Failed"
+    exitCode=1;
+else 
+    echo "Passed"
+    exitCode=0
+fi
+
+#jtreg complaining about not being able to clean up; let's sleep
+sleep 2
+rm -rf out.$$ client.$$
+sleep 2
+exit ${exitCode}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/com/sun/corba/cachedSocket/Hello.idl	Wed Sep 12 12:32:05 2012 -0700
@@ -0,0 +1,31 @@
+/*
+ * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+module HelloApp
+{
+  interface Hello
+  {
+    string sayHello();
+    oneway void shutdown();
+  };
+};
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/com/sun/corba/cachedSocket/HelloClient.java	Wed Sep 12 12:32:05 2012 -0700
@@ -0,0 +1,67 @@
+/*
+ * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import HelloApp.*;
+import org.omg.CosNaming.*;
+import org.omg.CosNaming.NamingContextPackage.*;
+import org.omg.CORBA.*;
+
+public class HelloClient
+{
+    static Hello helloImpl;
+
+    public static void main(String args[])
+    {
+        try{
+            // create and initialize the ORB
+            ORB orb = ORB.init(args, null);
+
+            // get the root naming context
+            org.omg.CORBA.Object objRef =
+                orb.resolve_initial_references("NameService");
+            // Use NamingContextExt instead of NamingContext. This is
+            // part of the Interoperable naming Service.
+            NamingContextExt ncRef = NamingContextExtHelper.narrow(objRef);
+
+            // resolve the Object Reference in Naming
+            String name = "Hello";
+            helloImpl = HelloHelper.narrow(ncRef.resolve_str(name));
+
+            System.out.println("Obtained a handle on server object: " + helloImpl);
+            for (int i = 0; i < 2; i++) {
+                try {
+                    System.out.println(helloImpl.sayHello());
+                } catch (Exception e) {
+                    System.out.println("Exception: " + e.getMessage());
+                    e.printStackTrace();
+                }
+                Thread.sleep(2000);
+            }
+
+        } catch (Exception e) {
+            System.out.println("ERROR : " + e) ;
+            e.printStackTrace(System.out);
+        }
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/com/sun/corba/cachedSocket/HelloServer.java	Wed Sep 12 12:32:05 2012 -0700
@@ -0,0 +1,97 @@
+/*
+ * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import HelloApp.*;
+import org.omg.CosNaming.*;
+import org.omg.CosNaming.NamingContextPackage.*;
+import org.omg.CORBA.*;
+import org.omg.PortableServer.*;
+import org.omg.PortableServer.POA;
+
+import java.util.Properties;
+
+class HelloImpl extends HelloPOA {
+    private ORB orb;
+
+    public void setORB(ORB orb_val) {
+        orb = orb_val;
+    }
+
+    // implement sayHello() method
+    public String sayHello() {
+        return "\nHello world !!\n";
+    }
+
+    // implement shutdown() method
+    public void shutdown() {
+        orb.shutdown(false);
+    }
+}
+
+
+public class HelloServer {
+
+    public static void main(String args[]) {
+        try{
+            // create and initialize the ORB
+            ORB orb = ORB.init(args, null);
+
+            // get reference to rootpoa & activate the POAManager
+            POA rootpoa = POAHelper.narrow(orb.resolve_initial_references("RootPOA"));
+            rootpoa.the_POAManager().activate();
+
+            // create servant and register it with the ORB
+            HelloImpl helloImpl = new HelloImpl();
+            helloImpl.setORB(orb);
+
+            // get object reference from the servant
+            org.omg.CORBA.Object ref = rootpoa.servant_to_reference(helloImpl);
+            Hello href = HelloHelper.narrow(ref);
+
+            // get the root naming context
+            org.omg.CORBA.Object objRef =
+                orb.resolve_initial_references("NameService");
+            // Use NamingContextExt which is part of the Interoperable
+            // Naming Service (INS) specification.
+            NamingContextExt ncRef = NamingContextExtHelper.narrow(objRef);
+
+            // bind the Object Reference in Naming
+            String name = "Hello";
+            NameComponent path[] = ncRef.to_name( name );
+            ncRef.rebind(path, href);
+
+            System.out.println("HelloServer ready and waiting ...");
+
+            // wait for invocations from clients
+            while (true) {
+                orb.run();
+            }
+        } catch (Exception e) {
+            System.out.println("ERROR: " + e);
+            e.printStackTrace(System.out);
+        }
+
+        System.out.println("HelloServer Exiting ...");
+
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/awt/Frame/ResizeAfterSetFont/ResizeAfterSetFont.java	Wed Sep 12 12:32:05 2012 -0700
@@ -0,0 +1,75 @@
+/*
+ * Copyright (c) 2012 Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * Portions Copyright (c) 2012 IBM Corporation
+ */
+
+/*
+ @test
+ @bug 7170655
+ @summary Frame size does not change after changing font
+ @author Jonathan Lu
+ @library ../../regtesthelpers
+ @build Util
+ @run main ResizeAfterSetFont
+ */
+
+import java.awt.*;
+import test.java.awt.regtesthelpers.Util;
+
+public class ResizeAfterSetFont {
+
+    public static void main(String[] args) throws Exception {
+        Frame frame = new Frame("bug7170655");
+        frame.setLayout(new BorderLayout());
+        frame.setBackground(Color.LIGHT_GRAY);
+
+        Panel panel = new Panel();
+        panel.setLayout(new GridLayout(0, 1, 1, 1));
+
+        Label label = new Label("Test Label");
+        label.setBackground(Color.white);
+        label.setForeground(Color.RED);
+        label.setFont(new Font("Dialog", Font.PLAIN, 12));
+
+        panel.add(label);
+        frame.add(panel, "South");
+        frame.pack();
+        frame.setVisible(true);
+
+        Util.waitForIdle(null);
+
+        Dimension dimBefore = frame.getSize();
+        label.setFont(new Font("Dialog", Font.PLAIN, 24));
+
+        frame.validate();
+        frame.pack();
+        Dimension dimAfter = frame.getSize();
+
+        if (dimBefore.equals(dimAfter)) {
+            throw new Exception(
+                    "Frame size does not change after Label.setFont()!");
+        }
+    }
+}
--- a/test/java/awt/Mouse/EnterExitEvents/DragWindowTest.java	Wed Sep 05 15:19:51 2012 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,219 +0,0 @@
-/*
- * Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
- * @test
- * @bug 7154048
- * @summary Window created under a mouse does not receive mouse enter event.
- *     Mouse Entered/Exited events are wrongly generated during dragging the window
- *     from one component to another
- * @library ../../regtesthelpers
- * @build Util
- * @author alexandr.scherbatiy area=awt.event
- * @run main DragWindowTest
- */
-
-import java.awt.*;
-import java.awt.event.*;
-import javax.swing.*;
-
-import java.util.concurrent.*;
-import sun.awt.SunToolkit;
-
-import test.java.awt.regtesthelpers.Util;
-
-public class DragWindowTest {
-
-    private static volatile int dragWindowMouseEnteredCount = 0;
-    private static volatile int dragWindowMouseReleasedCount = 0;
-    private static volatile int buttonMouseEnteredCount = 0;
-    private static volatile int labelMouseReleasedCount = 0;
-    private static MyDragWindow dragWindow;
-    private static JLabel label;
-    private static JButton button;
-
-    public static void main(String[] args) throws Exception {
-
-        SunToolkit toolkit = (SunToolkit) Toolkit.getDefaultToolkit();
-        Robot robot = new Robot();
-        robot.setAutoDelay(50);
-
-        SwingUtilities.invokeAndWait(new Runnable() {
-
-            @Override
-            public void run() {
-                createAndShowGUI();
-            }
-        });
-
-        toolkit.realSync();
-
-        Point pointToClick = Util.invokeOnEDT(new Callable<Point>() {
-
-            @Override
-            public Point call() throws Exception {
-                return getCenterPoint(label);
-            }
-        });
-
-
-        robot.mouseMove(pointToClick.x, pointToClick.y);
-        robot.mousePress(InputEvent.BUTTON1_MASK);
-        toolkit.realSync();
-
-        if (dragWindowMouseEnteredCount != 1) {
-            throw new RuntimeException("No MouseEntered event on Drag Window!");
-        }
-
-        Point pointToDrag = Util.invokeOnEDT(new Callable<Point>() {
-
-            @Override
-            public Point call() throws Exception {
-                button.addMouseListener(new ButtonMouseListener());
-                return getCenterPoint(button);
-            }
-        });
-
-        robot.mouseMove(pointToDrag.x, pointToDrag.y);
-        toolkit.realSync();
-
-        if (buttonMouseEnteredCount != 0) {
-            throw new RuntimeException("Extra MouseEntered event on button!");
-        }
-
-        robot.mouseRelease(InputEvent.BUTTON1_MASK);
-        toolkit.realSync();
-
-        if (labelMouseReleasedCount != 1) {
-            throw new RuntimeException("No MouseReleased event on label!");
-        }
-
-    }
-
-    private static Point getCenterPoint(Component comp) {
-        Point p = comp.getLocationOnScreen();
-        Rectangle rect = comp.getBounds();
-        return new Point(p.x + rect.width / 2, p.y + rect.height / 2);
-    }
-
-    private static void createAndShowGUI() {
-
-        JFrame frame = new JFrame("Main Frame");
-        frame.setSize(300, 200);
-        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
-
-        label = new JLabel("Label");
-
-        LabelMouseListener listener = new LabelMouseListener(frame);
-        label.addMouseListener(listener);
-        label.addMouseMotionListener(listener);
-
-        button = new JButton("Button");
-        Panel panel = new Panel(new BorderLayout());
-
-        panel.add(label, BorderLayout.NORTH);
-        panel.add(button, BorderLayout.CENTER);
-
-        frame.getContentPane().add(panel);
-        frame.setVisible(true);
-
-    }
-
-    private static Point getAbsoluteLocation(MouseEvent e) {
-        return new Point(e.getXOnScreen(), e.getYOnScreen());
-    }
-
-    static class MyDragWindow extends Window {
-
-        static int d = 30;
-
-        public MyDragWindow(Window parent, Point location) {
-            super(parent);
-            setSize(150, 150);
-            setVisible(true);
-            JPanel panel = new JPanel();
-            add(panel);
-            setLocation(location.x - d, location.y - d);
-            addMouseListener(new DragWindowMouseListener());
-        }
-
-        void dragTo(Point point) {
-            setLocation(point.x - d, point.y - d);
-        }
-    }
-
-    static class LabelMouseListener extends MouseAdapter {
-
-        Point origin;
-        Window parent;
-
-        public LabelMouseListener(Window parent) {
-            this.parent = parent;
-        }
-
-        @Override
-        public void mousePressed(MouseEvent e) {
-            if (dragWindow == null) {
-                dragWindow = new MyDragWindow(parent, getAbsoluteLocation(e));
-            } else {
-                dragWindow.setVisible(true);
-                dragWindow.dragTo(getAbsoluteLocation(e));
-            }
-        }
-
-        @Override
-        public void mouseReleased(MouseEvent e) {
-            labelMouseReleasedCount++;
-            if (dragWindow != null) {
-                dragWindow.setVisible(false);
-            }
-        }
-
-        public void mouseDragged(MouseEvent e) {
-            if (dragWindow != null) {
-                dragWindow.dragTo(getAbsoluteLocation(e));
-            }
-        }
-    }
-
-    static class DragWindowMouseListener extends MouseAdapter {
-
-        @Override
-        public void mouseEntered(MouseEvent e) {
-            dragWindowMouseEnteredCount++;
-        }
-
-        @Override
-        public void mouseReleased(MouseEvent e) {
-            dragWindowMouseReleasedCount++;
-        }
-    }
-
-    static class ButtonMouseListener extends MouseAdapter {
-
-        @Override
-        public void mouseEntered(MouseEvent e) {
-            buttonMouseEnteredCount++;
-        }
-    }
-}
--- a/test/java/beans/Introspector/6380849/TestBeanInfo.java	Wed Sep 05 15:19:51 2012 -0700
+++ b/test/java/beans/Introspector/6380849/TestBeanInfo.java	Wed Sep 12 12:32:05 2012 -0700
@@ -38,8 +38,7 @@
 
 import java.beans.BeanInfo;
 import java.beans.Introspector;
-import java.lang.ref.Reference;
-import java.lang.reflect.Field;
+import java.lang.reflect.Method;
 
 public class TestBeanInfo implements Runnable {
 
@@ -60,10 +59,9 @@
         try {
             actual = Introspector.getBeanInfo(type);
             type = actual.getClass();
-            Field field = type.getDeclaredField("targetBeanInfoRef"); // NON-NLS: field name
-            field.setAccessible(true);
-            Reference ref = (Reference) field.get(actual);
-            actual = (BeanInfo) ref.get();
+            Method method = type.getDeclaredMethod("getTargetBeanInfo"); // NON-NLS: method name
+            method.setAccessible(true);
+            actual = (BeanInfo) method.invoke(actual);
         }
         catch (Exception exception) {
             throw new Error("unexpected error", exception);
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/beans/Introspector/Test7186794.java	Wed Sep 12 12:32:05 2012 -0700
@@ -0,0 +1,55 @@
+/*
+ * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @bug 7186794
+ * @summary Tests setter in the super class
+ * @author Sergey Malenkov
+ */
+
+import java.util.List;
+
+public class Test7186794 {
+
+    public static void main(String[] args) {
+        if (null == BeanUtils.findPropertyDescriptor(MyBean.class, "value").getWriteMethod()) {
+            throw new Error("The property setter is not found");
+        }
+    }
+
+    public static class BaseBean {
+
+        protected List<String> value;
+
+        public void setValue(List<String> value) {
+            this.value = value;
+        }
+    }
+
+    public static class MyBean extends BaseBean {
+        public List<String> getValue() {
+            return super.value;
+        }
+    }
+}
--- a/test/java/beans/Introspector/Test7189112.java	Wed Sep 05 15:19:51 2012 -0700
+++ b/test/java/beans/Introspector/Test7189112.java	Wed Sep 12 12:32:05 2012 -0700
@@ -28,17 +28,11 @@
  * @author Sergey Malenkov
  */
 
-import java.beans.IntrospectionException;
-import java.beans.Introspector;
-import java.beans.PropertyDescriptor;
-
 public class Test7189112 {
 
-    public static void main(String[] args) throws IntrospectionException {
-        for (PropertyDescriptor pd : Introspector.getBeanInfo(MyBean.class).getPropertyDescriptors()) {
-            if (pd.getName().equals("value") && (null == pd.getWriteMethod())) {
-                throw new Error("The property setter is not found");
-            }
+    public static void main(String[] args) {
+        if (null == BeanUtils.findPropertyDescriptor(MyBean.class, "value").getWriteMethod()) {
+            throw new Error("The property setter is not found");
         }
     }
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/beans/Introspector/Test7192955.java	Wed Sep 12 12:32:05 2012 -0700
@@ -0,0 +1,83 @@
+/*
+ * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @bug 7192955
+ * @summary Tests that all properties are bound
+ * @author Sergey Malenkov
+ */
+
+import java.beans.PropertyChangeListener;
+import java.util.List;
+
+public class Test7192955 {
+
+    public static void main(String[] args) {
+        if (!BeanUtils.findPropertyDescriptor(MyBean.class, "test").isBound()) {
+            throw new Error("a simple property is not bound");
+        }
+        if (!BeanUtils.findPropertyDescriptor(MyBean.class, "list").isBound()) {
+            throw new Error("a generic property is not bound");
+        }
+        if (!BeanUtils.findPropertyDescriptor(MyBean.class, "readOnly").isBound()) {
+            throw new Error("a read-only property is not bound");
+        }
+    }
+
+    public static class BaseBean {
+
+        private List<String> list;
+
+        public List<String> getList() {
+            return this.list;
+        }
+
+        public void setList(List<String> list) {
+            this.list = list;
+        }
+
+        public void addPropertyChangeListener(PropertyChangeListener listener) {
+        }
+
+        public void removePropertyChangeListener(PropertyChangeListener listener) {
+        }
+
+        public List<String> getReadOnly() {
+            return this.list;
+        }
+    }
+
+    public static class MyBean extends BaseBean {
+
+        private String test;
+
+        public String getTest() {
+            return this.test;
+        }
+
+        public void setTest(String test) {
+            this.test = test;
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/beans/Introspector/Test7193977.java	Wed Sep 12 12:32:05 2012 -0700
@@ -0,0 +1,159 @@
+/*
+ * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @bug 7193977
+ * @summary Tests that generified property descriptors do not loose additional info
+ * @author Sergey Malenkov
+ */
+
+import java.awt.Image;
+import java.beans.BeanDescriptor;
+import java.beans.BeanInfo;
+import java.beans.EventSetDescriptor;
+import java.beans.IntrospectionException;
+import java.beans.Introspector;
+import java.beans.MethodDescriptor;
+import java.beans.PropertyDescriptor;
+import java.util.Arrays;
+import java.util.List;
+
+public class Test7193977 {
+
+    private static final List<String> names = Arrays.asList("listType", "list", "value");
+
+    public static void main(String args[]) {
+        for (String name : names) {
+            test(Abstract.class, name);
+            test(Concrete.class, name);
+        }
+    }
+
+    private static void test(Class<?> type, String name) {
+        if (!Boolean.TRUE.equals(BeanUtils.getPropertyDescriptor(type, name).getValue("transient"))) {
+            throw new Error("property '" + name + "' is not transient");
+        }
+    }
+
+    public static final class Concrete extends Abstract<String> {
+    }
+
+    public static abstract class Abstract<T> {
+        private List<T> list;
+
+        public List<T> getList() {
+            return this.list;
+        }
+
+        public void setList(List<T> list) {
+            this.list = list;
+        }
+
+        public T getValue(int index) {
+            return (0 <= index) && (this.list != null) && (index < this.list.size())
+                    ? this.list.get(index)
+                    : null;
+        }
+
+        public void setValue(int index, T value) {
+            if ((0 <= index) && (this.list != null)) {
+                if (index == this.list.size()) {
+                    this.list.add(value);
+                }
+                else if (index < this.list.size()) {
+                    this.list.set(index, value);
+                }
+            }
+        }
+
+        public String getListType() {
+            return (this.list != null)
+                    ? this.list.getClass().getName()
+                    : null;
+        }
+
+        public void setListType(String type) throws Exception {
+            this.list = (type != null)
+                    ? (List<T>) Class.forName(type).newInstance()
+                    : null;
+        }
+    }
+
+    public static final class ConcreteBeanInfo extends Wrapper {
+        public ConcreteBeanInfo() throws IntrospectionException {
+            super(Concrete.class);
+        }
+    }
+
+    public static final class AbstractBeanInfo extends Wrapper {
+        public AbstractBeanInfo() throws IntrospectionException {
+            super(Abstract.class);
+            for (PropertyDescriptor pd : getPropertyDescriptors()) {
+                if (names.contains(pd.getName())) {
+                    pd.setValue("transient", Boolean.TRUE);
+                }
+            }
+        }
+    }
+
+    private static class Wrapper implements BeanInfo {
+        private final BeanInfo info;
+
+        Wrapper(Class<?> type) throws IntrospectionException {
+            this.info = Introspector.getBeanInfo(type, Introspector.IGNORE_IMMEDIATE_BEANINFO);
+        }
+
+        public BeanDescriptor getBeanDescriptor() {
+            return this.info.getBeanDescriptor();
+        }
+
+        public EventSetDescriptor[] getEventSetDescriptors() {
+            return this.info.getEventSetDescriptors();
+        }
+
+        public int getDefaultEventIndex() {
+            return this.info.getDefaultEventIndex();
+        }
+
+        public PropertyDescriptor[] getPropertyDescriptors() {
+            return this.info.getPropertyDescriptors();
+        }
+
+        public int getDefaultPropertyIndex() {
+            return this.info.getDefaultPropertyIndex();
+        }
+
+        public MethodDescriptor[] getMethodDescriptors() {
+            return this.info.getMethodDescriptors();
+        }
+
+        public BeanInfo[] getAdditionalBeanInfo() {
+            return this.info.getAdditionalBeanInfo();
+        }
+
+        public Image getIcon(int kind) {
+            return this.info.getIcon(kind);
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/beans/Introspector/Test7195106.java	Wed Sep 12 12:32:05 2012 -0700
@@ -0,0 +1,67 @@
+/*
+ * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @bug 7195106
+ * @summary Tests that explicit BeanInfo is not collected
+ * @author Sergey Malenkov
+ */
+
+import java.awt.Image;
+import java.awt.image.BufferedImage;
+import java.beans.BeanInfo;
+import java.beans.Introspector;
+import java.beans.SimpleBeanInfo;
+
+public class Test7195106 {
+
+    public static void main(String[] arg) throws Exception {
+        BeanInfo info = Introspector.getBeanInfo(My.class);
+        if (null == info.getIcon(BeanInfo.ICON_COLOR_16x16)) {
+            throw new Error("Unexpected behavior");
+        }
+        try {
+            int[] array = new int[1024];
+            while (true) {
+                array = new int[array.length << 1];
+            }
+        }
+        catch (OutOfMemoryError error) {
+            System.gc();
+        }
+        if (null == info.getIcon(BeanInfo.ICON_COLOR_16x16)) {
+            throw new Error("Explicit BeanInfo is collected");
+        }
+    }
+
+    public static class My {
+    }
+
+    public static class MyBeanInfo extends SimpleBeanInfo {
+        @Override
+        public Image getIcon(int type) {
+            return new BufferedImage(16, 16, BufferedImage.TYPE_INT_RGB);
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/beans/XMLEncoder/Test7169395.java	Wed Sep 12 12:32:05 2012 -0700
@@ -0,0 +1,101 @@
+/*
+ * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @bug 7169395
+ * @summary Tests that array list initialized correctly
+ * @author Sergey Malenkov
+ */
+
+import java.beans.ConstructorProperties;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Map;
+import java.util.TreeMap;
+
+public class Test7169395 extends AbstractTest {
+
+    public static void main(String[] args) {
+        new Test7169395().test(true);
+    }
+
+    protected Object getObject() {
+        Container container = new Container();
+        container.add("test-null", null);
+        container.add("test-value", "value");
+        container.add("test-other", "other");
+        return container;
+    }
+
+    public static class Component {
+
+        private final Container container;
+        private final String name;
+        private String value;
+
+        @ConstructorProperties({ "container", "name" })
+        public Component(Container container, String name) {
+            this.container = container;
+            this.name = name;
+        }
+
+        public Container getContainer() {
+            return this.container;
+        }
+
+        public String getName() {
+            return this.name;
+        }
+
+        public String getValue() {
+            return this.value;
+        }
+
+        public void setValue(String value) {
+            this.value = value;
+        }
+    }
+
+    public static class Container {
+
+        private final Map<String, Component> map = new TreeMap<String, Component>();
+
+        public Collection<Component> getComponents() {
+            return new ArrayList<Component>(this.map.values());
+        }
+
+        public void setComponents(Collection<Component> components) {
+            this.map.clear();
+            for (Component component : components){
+                this.map.put(component.getName(), component);
+            }
+        }
+
+        public void add(String name, String value) {
+            Component list = new Component(this, name);
+            list.setValue(value);
+            this.map.put(name, list);
+        }
+    }
+}
--- a/test/java/nio/Buffer/Basic-X.java.template	Wed Sep 05 15:19:51 2012 -0700
+++ b/test/java/nio/Buffer/Basic-X.java.template	Wed Sep 12 12:32:05 2012 -0700
@@ -402,6 +402,19 @@
         ck(b, b.charAt(1), 'f');
         ck(b, b.subSequence(1, 3).toString().equals("fg"));
 
+        // String ops
+
+        // 7190219
+        b.clear();
+        int pos = b.position();
+        tryCatch(b, BufferOverflowException.class, new Runnable() {
+            public void run() {
+                b.put(String.valueOf(new char[b.capacity() + 1]), 0,
+                        b.capacity() + 1);
+            }});
+        ck(b, b.position(), pos);
+        relGet(b);
+
 #end[char]
 
         // Compact
--- a/test/java/nio/Buffer/Basic.java	Wed Sep 05 15:19:51 2012 -0700
+++ b/test/java/nio/Buffer/Basic.java	Wed Sep 12 12:32:05 2012 -0700
@@ -25,7 +25,7 @@
  * @summary Unit test for buffers
  * @bug 4413135 4414911 4416536 4416562 4418782 4471053 4472779 4490253 4523725
  *      4526177 4463011 4660660 4661219 4663521 4782970 4804304 4938424 6231529
- *      6221101 6234263 6535542 6591971 6593946 6795561
+ *      6221101 6234263 6535542 6591971 6593946 6795561 7190219
  * @author Mark Reinhold
  */
 
--- a/test/java/nio/Buffer/BasicByte.java	Wed Sep 05 15:19:51 2012 -0700
+++ b/test/java/nio/Buffer/BasicByte.java	Wed Sep 12 12:32:05 2012 -0700
@@ -404,6 +404,19 @@
 
 
 
+
+
+
+
+
+
+
+
+
+
+
+
+
         // Compact
 
         relPut(b);
--- a/test/java/nio/Buffer/BasicChar.java	Wed Sep 05 15:19:51 2012 -0700
+++ b/test/java/nio/Buffer/BasicChar.java	Wed Sep 12 12:32:05 2012 -0700
@@ -402,6 +402,19 @@
         ck(b, b.charAt(1), 'f');
         ck(b, b.subSequence(1, 3).toString().equals("fg"));
 
+        // String ops
+
+        // 7190219
+        b.clear();
+        int pos = b.position();
+        tryCatch(b, BufferOverflowException.class, new Runnable() {
+            public void run() {
+                b.put(String.valueOf(new char[b.capacity() + 1]), 0,
+                        b.capacity() + 1);
+            }});
+        ck(b, b.position(), pos);
+        relGet(b);
+
 
 
         // Compact
--- a/test/java/nio/Buffer/BasicDouble.java	Wed Sep 05 15:19:51 2012 -0700
+++ b/test/java/nio/Buffer/BasicDouble.java	Wed Sep 12 12:32:05 2012 -0700
@@ -404,6 +404,19 @@
 
 
 
+
+
+
+
+
+
+
+
+
+
+
+
+
         // Compact
 
         relPut(b);
--- a/test/java/nio/Buffer/BasicFloat.java	Wed Sep 05 15:19:51 2012 -0700
+++ b/test/java/nio/Buffer/BasicFloat.java	Wed Sep 12 12:32:05 2012 -0700
@@ -404,6 +404,19 @@
 
 
 
+
+
+
+
+
+
+
+
+
+
+
+
+
         // Compact
 
         relPut(b);
--- a/test/java/nio/Buffer/BasicInt.java	Wed Sep 05 15:19:51 2012 -0700
+++ b/test/java/nio/Buffer/BasicInt.java	Wed Sep 12 12:32:05 2012 -0700
@@ -404,6 +404,19 @@
 
 
 
+
+
+
+
+
+
+
+
+
+
+
+
+
         // Compact
 
         relPut(b);
--- a/test/java/nio/Buffer/BasicLong.java	Wed Sep 05 15:19:51 2012 -0700
+++ b/test/java/nio/Buffer/BasicLong.java	Wed Sep 12 12:32:05 2012 -0700
@@ -404,6 +404,19 @@
 
 
 
+
+
+
+
+
+
+
+
+
+
+
+
+
         // Compact
 
         relPut(b);
--- a/test/java/nio/Buffer/BasicShort.java	Wed Sep 05 15:19:51 2012 -0700
+++ b/test/java/nio/Buffer/BasicShort.java	Wed Sep 12 12:32:05 2012 -0700
@@ -404,6 +404,19 @@
 
 
 
+
+
+
+
+
+
+
+
+
+
+
+
+
         // Compact
 
         relPut(b);
--- a/test/java/nio/channels/DatagramChannel/MulticastSendReceiveTests.java	Wed Sep 05 15:19:51 2012 -0700
+++ b/test/java/nio/channels/DatagramChannel/MulticastSendReceiveTests.java	Wed Sep 12 12:32:05 2012 -0700
@@ -22,10 +22,11 @@
  */
 
 /* @test
- * @bug 4527345 7026376
+ * @bug 4527345 7026376 6633549
  * @summary Unit test for DatagramChannel's multicast support
  * @build MulticastSendReceiveTests NetworkConfiguration
  * @run main MulticastSendReceiveTests
+ * @run main/othervm -Djava.net.preferIPv4Stack=true MulticastSendReceiveTests
  */
 
 import java.nio.ByteBuffer;
@@ -186,6 +187,10 @@
                 id = sendDatagram(source, nif, group, port);
                 receiveDatagram(dc, source, id);
             } catch (UnsupportedOperationException x) {
+                String os = System.getProperty("os.name");
+                // Exclude-mode filtering supported on these platforms so UOE should never be thrown
+                if (os.equals("SunOS") || os.equals("Linux"))
+                    throw x;
                 System.out.println("Exclude-mode filtering not supported!");
             }
 
@@ -212,6 +217,10 @@
                 id = sendDatagram(source, nif, group, port);
                 receiveDatagram(dc, source, id);
             } catch (UnsupportedOperationException x) {
+                String os = System.getProperty("os.name");
+                // Include-mode filtering supported on these platforms so UOE should never be thrown
+                if (os.equals("SunOS") || os.equals("Linux"))
+                    throw x;
                 System.out.println("Include-mode filtering not supported!");
             }
         }
--- a/test/java/rmi/activation/checkusage/CheckUsage.java	Wed Sep 05 15:19:51 2012 -0700
+++ b/test/java/rmi/activation/checkusage/CheckUsage.java	Wed Sep 12 12:32:05 2012 -0700
@@ -53,12 +53,9 @@
             rmidVM.start();
 
             // wait for registry exit
+            int rmidVMExitStatus = rmidVM.getVM().waitFor();
             System.err.println("rmid exited with status: " +
-                               rmidVM.getVM().waitFor());
-            try {
-                Thread.sleep(7000);
-            } catch (InterruptedException ie) {
-            }
+                               rmidVMExitStatus);
 
             String usage = new String(berr.toByteArray());
 
--- a/test/java/rmi/registry/readTest/readTest.sh	Wed Sep 05 15:19:51 2012 -0700
+++ b/test/java/rmi/registry/readTest/readTest.sh	Wed Sep 12 12:32:05 2012 -0700
@@ -35,18 +35,23 @@
     FS="/"
     FILEURL="file:"
     ;;
-  Windows* | CYGWIN* )
+  Windows* )
     PS=";"
     FS="\\"
     FILEURL="file:/"
     ;;
+  CYGWIN* )
+    PS=";"
+    FS="/"
+    FILEURL="file:/"
+    ;;
   * )
     echo "Unrecognized system!"
     exit 1;
     ;;
 esac
 
-TEST_CLASSPATH=.:$TESTCLASSES
+TEST_CLASSPATH=.$PS$TESTCLASSES
 cp -r ${TESTSRC}${FS}* .
 ${TESTJAVA}${FS}bin${FS}javac testPkg${FS}*java
 ${TESTJAVA}${FS}bin${FS}javac -cp $TEST_CLASSPATH readTest.java
@@ -62,8 +67,16 @@
 sleep 3
 cd ..
 
+case "$OS" in
+  CYGWIN* )
+    CODEBASE=`cygpath -w $PWD`
+    ;;
+  * )
+    CODEBASE=`pwd`
+    ;;  
+esac
 # trailing / after code base is important for rmi codebase property.
-${TESTJAVA}${FS}bin${FS}java -cp $TEST_CLASSPATH -Djava.rmi.server.codebase=${FILEURL}`pwd`/ readTest > OUT.TXT 2>&1 &
+${TESTJAVA}${FS}bin${FS}java -cp $TEST_CLASSPATH -Djava.rmi.server.codebase=${FILEURL}$CODEBASE/ readTest > OUT.TXT 2>&1 &
 TEST_PID=$!
 #bulk of testcase - let it run for a while
 sleep 5
--- a/test/java/rmi/testlibrary/ActivationLibrary.java	Wed Sep 05 15:19:51 2012 -0700
+++ b/test/java/rmi/testlibrary/ActivationLibrary.java	Wed Sep 12 12:32:05 2012 -0700
@@ -63,19 +63,30 @@
      */
     public static void deactivate(Remote remote,
                                   ActivationID id) {
-        for (int i = 0; i < 5; i ++) {
+        // We do as much as 50 deactivation trials, each separated by
+        // at least 100 milliseconds sleep time (max sleep time of 5 secs).
+        final long deactivateSleepTime = 100;
+        for (int i = 0; i < 50; i ++) {
             try {
                 if (Activatable.inactive(id) == true) {
                     mesg("inactive successful");
                     return;
                 } else {
-                    Thread.sleep(1000);
+                    mesg("inactive trial failed. Sleeping " +
+                         deactivateSleepTime +
+                         " milliseconds before next trial");
+                    Thread.sleep(deactivateSleepTime);
                 }
             } catch (InterruptedException e) {
-                continue;
+                Thread.currentThread().interrupt();
+                mesg("Thread interrupted while trying to deactivate activatable. Exiting deactivation");
+                return;
             } catch (Exception e) {
                 try {
                     // forcibly unexport the object
+                    mesg("Unexpected exception. Have to forcibly unexport the object." +
+                         " Exception was :");
+                    e.printStackTrace();
                     Activatable.unexportObject(remote, true);
                 } catch (NoSuchObjectException ex) {
                 }
@@ -99,37 +110,61 @@
      * activation system.
      */
     public static boolean rmidRunning(int port) {
-        int allowedNotReady = 10;
+        int allowedNotReady = 50;
         int connectionRefusedExceptions = 0;
 
-        for (int i = 0; i < 15 ; i++) {
+        /* We wait as much as a total of 7.5 secs trying to see Rmid running.
+         * We do this by pausing steps of 100 milliseconds (so up to 75 steps),
+         * right after trying to lookup and find RMID running in the other vm.
+         */
+        final long rmidWaitingStepTime = 100;
+        for (int i = 0; i <= 74; i++) {
 
             try {
-                Thread.sleep(500);
                 LocateRegistry.getRegistry(port).lookup(SYSTEM_NAME);
+                mesg("Activation System available after " +
+                     (i * rmidWaitingStepTime) + " milliseconds");
                 return true;
 
             } catch (java.rmi.ConnectException e) {
+                mesg("Remote connection refused after " +
+                     (i * rmidWaitingStepTime) + " milliseconds");
+
                 // ignore connect exceptions until we decide rmid is not up
-
                 if ((connectionRefusedExceptions ++) >= allowedNotReady) {
                     return false;
                 }
 
+            } catch (java.rmi.NoSuchObjectException nsoe) {
+                /* Activation System still unavailable.
+                 * Ignore this since we are just waiting for its availibility.
+                 * Just signal unavailibility.
+                 */
+                mesg("Activation System still unavailable after more than " +
+                     (i * rmidWaitingStepTime) + " milliseconds");
+
             } catch (NotBoundException e) {
-
                 return false;
 
             } catch (Exception e) {
-                // print out other types of exceptions as an FYI.
-                // test should not fail as rmid is likely to be in an
-                // undetermined state at this point.
-
+                /* print out other types of exceptions as an FYI.
+                 * test should not fail as rmid is likely to be in an
+                 * undetermined state at this point.
+                 */
                 mesg("caught an exception trying to" +
                      " start rmid, last exception was: " +
                      e.getMessage());
                 e.printStackTrace();
             }
+
+            // Waiting for another 100 milliseconds.
+            try {
+                Thread.sleep(100);
+            } catch (InterruptedException e) {
+                Thread.currentThread().interrupt();
+                mesg("Thread interrupted while checking if Activation System is running. Exiting check");
+                return false;
+            }
         }
         return false;
     }
--- a/test/java/rmi/testlibrary/JavaVM.java	Wed Sep 05 15:19:51 2012 -0700
+++ b/test/java/rmi/testlibrary/JavaVM.java	Wed Sep 12 12:32:05 2012 -0700
@@ -36,7 +36,6 @@
  */
 public class JavaVM {
 
-    // need to
     protected Process vm = null;
 
     private String classname = "";
@@ -46,6 +45,10 @@
     private OutputStream errorStream = System.err;
     private String policyFileName = null;
 
+    // This is used to shorten waiting time at startup.
+    private volatile boolean started = false;
+    private boolean forcesOutput = true; // default behavior
+
     private static void mesg(Object mesg) {
         System.err.println("JAVAVM: " + mesg.toString());
     }
@@ -79,6 +82,25 @@
         this.errorStream = err;
     }
 
+    /* This constructor will instantiate a JavaVM object for which caller
+     * can ask for forcing initial version output on child vm process
+     * (if forcesVersionOutput is true), or letting the started vm behave freely
+     * (when forcesVersionOutput is false).
+     */
+    public JavaVM(String classname,
+                  String options, String args,
+                  OutputStream out, OutputStream err,
+                  boolean forcesVersionOutput) {
+        this(classname, options, args, out, err);
+        this.forcesOutput = forcesVersionOutput;
+    }
+
+
+    public void setStarted() {
+        started = true;
+    }
+
+    // Prepends passed opts array to current options
     public void addOptions(String[] opts) {
         String newOpts = "";
         for (int i = 0 ; i < opts.length ; i ++) {
@@ -87,6 +109,8 @@
         newOpts += " ";
         options = newOpts + options;
     }
+
+    // Prepends passed arguments array to current args
     public void addArguments(String[] arguments) {
         String newArgs = "";
         for (int i = 0 ; i < arguments.length ; i ++) {
@@ -127,6 +151,18 @@
 
         addOptions(new String[] { getCodeCoverageOptions() });
 
+        /*
+         * If forcesOutput is true :
+         *  We force the new starting vm to output something so that we can know
+         *  when it is effectively started by redirecting standard output through
+         *  the next StreamPipe call (the vm is considered started when a first
+         *  output has been streamed out).
+         *  We do this by prepnding a "-showversion" option in the command line.
+         */
+        if (forcesOutput) {
+            addOpt