changeset 5424:23b82fb671d4

Merge
author lana
date Fri, 25 May 2012 19:34:32 -0700
parents a2d12ca36eb3 7def50698e78
children c892ca15ca52
files
diffstat 196 files changed, 4627 insertions(+), 2255 deletions(-) [+]
line wrap: on
line diff
--- a/.hgtags	Fri May 25 12:56:22 2012 +0400
+++ b/.hgtags	Fri May 25 19:34:32 2012 -0700
@@ -160,3 +160,5 @@
 45da9cb055ee258dc09e69c1718e27eadea38e45 jdk8-b36
 9e82ac15ab80370d6e021aea7b98c7c9626adb5e jdk8-b37
 c45f3509a70796c54b48f32910d1caf435763416 jdk8-b38
+b6f52911752110a2889681923992c7a0baa52ccc jdk8-b39
+b88fc3359dc7edabfa8a228855d8cebf8843c055 jdk8-b40
--- a/make/com/apple/osxui/Makefile	Fri May 25 12:56:22 2012 +0400
+++ b/make/com/apple/osxui/Makefile	Fri May 25 19:34:32 2012 -0700
@@ -65,12 +65,8 @@
 	com/apple/laf/ScreenMenuPropertyHandler.java \
 	com/apple/laf/ScreenMenuPropertyListener.java
 
-#RESOURCE_BUNDLES_COMPILED_PROPERTIES += \
-#	com/apple/laf/resources/aqua.properties \
-#	com/apple/laf/resources/aqua_de.properties \
-#	com/apple/laf/resources/aqua_fr.properties \
-#	com/apple/laf/resources/aqua_ja.properties
-
+RESOURCE_BUNDLES_COMPILED_PROPERTIES += \
+	com/apple/laf/resources/aqua.properties
 
 #
 # Rules
--- a/make/com/oracle/security/ucrypto/Makefile	Fri May 25 12:56:22 2012 +0400
+++ b/make/com/oracle/security/ucrypto/Makefile	Fri May 25 19:34:32 2012 -0700
@@ -139,7 +139,7 @@
   #
   CLASSDESTDIR = $(TEMPDIR)/classes
   JAVAHFLAGS = -bootclasspath \
-    "$(CLASSDESTDIR)$(CLASSPATH_SEPARATOR)$(CLASSBINDIR)"
+    "$(CLASSDESTDIR)$(CLASSPATH_SEPARATOR)$(CLASSBINDIR)$(JCE_PATH)"
 
   include $(BUILDDIR)/common/Mapfile-vers.gmk
   include $(BUILDDIR)/common/Library.gmk
--- a/make/common/Release.gmk	Fri May 25 12:56:22 2012 +0400
+++ b/make/common/Release.gmk	Fri May 25 19:34:32 2012 -0700
@@ -156,6 +156,7 @@
         jstack.1           \
         jstat.1            \
         jstatd.1           \
+        jvisualvm.1        \
 	native2ascii.1     \
 	rmic.1             \
         schemagen.1        \
@@ -1311,8 +1312,8 @@
 	@$(java-vm-cleanup)
 
 # Clean up names in the messages printed out
-CAT_FILTER = $(SED) -e "s@$(JDK_IMAGE_DIR)@JDK_IMAGE@g" \
-	            -e "s@$(JRE_IMAGE_DIR)@JRE_IMAGE@g"
+CAT_FILTER = $(SED) -e "s|$(JDK_IMAGE_DIR)|JDK_IMAGE|g" \
+	            -e "s|$(JRE_IMAGE_DIR)|JRE_IMAGE|g"
 
 # Report on the jre image comparison
 compare-image-jre: $(TEMP_PREV_JRE_COMPARISON)
--- a/make/common/internal/Resources.gmk	Fri May 25 12:56:22 2012 +0400
+++ b/make/common/internal/Resources.gmk	Fri May 25 19:34:32 2012 -0700
@@ -197,6 +197,10 @@
 	$(add-property-java-file)
 $(GENSRCDIR)/%.java: $(GENSRCDIR)/%.properties
 	$(add-property-java-file)
+ifdef PLATFORM_SRC_MACOS
+$(GENSRCDIR)/%.java: $(PLATFORM_SRC_MACOS)/classes/%.properties
+	$(add-property-java-file)
+endif
 ifndef OPENJDK
 $(GENSRCDIR)/%.java: $(CLOSED_PLATFORM_SRC)/classes/%.properties
 	$(add-property-java-file)
--- a/make/common/shared/Defs-java.gmk	Fri May 25 12:56:22 2012 +0400
+++ b/make/common/shared/Defs-java.gmk	Fri May 25 19:34:32 2012 -0700
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2007, 2011, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2007, 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
@@ -139,7 +139,7 @@
 # built implicitly/explicitly.
 #
 ifeq ($(wildcard $(SHARE_SRC)/classes/javax/crypto/Cipher.java),)
-  JCEFLAGS = $(CLASSPATH_SEPARATOR)$(LIBDIR)/jce.jar
+  JCE_PATH = $(CLASSPATH_SEPARATOR)$(LIBDIR)/jce.jar
 endif
 
 # Add the source level
@@ -152,11 +152,11 @@
 CLASS_VERSION = -target $(TARGET_CLASS_VERSION)
 JAVACFLAGS  += $(CLASS_VERSION)
 JAVACFLAGS  += -encoding ascii
-JAVACFLAGS  += "-Xbootclasspath:$(CLASSBINDIR)$(JCEFLAGS)"
+JAVACFLAGS  += "-Xbootclasspath:$(CLASSBINDIR)$(JCE_PATH)"
 JAVACFLAGS  += $(OTHER_JAVACFLAGS)
 
 # Needed for javah
-JAVAHFLAGS += -bootclasspath "$(CLASSBINDIR)$(JCEFLAGS)"
+JAVAHFLAGS += -bootclasspath "$(CLASSBINDIR)$(JCE_PATH)"
 
 # Needed for javadoc to ensure it builds documentation
 # against the newly built classes
--- a/make/java/redist/Makefile	Fri May 25 12:56:22 2012 +0400
+++ b/make/java/redist/Makefile	Fri May 25 19:34:32 2012 -0700
@@ -261,8 +261,7 @@
     ifeq ($(ZIP_DEBUGINFO_FILES),1)
       # the import JDK may not contain the target of the symlink
       ifneq ($(wildcard $(HOTSPOT_IMPORT_PATH)/$(ARCH_VM_SUBDIR)/$(LIBJSIG_DIZ_NAME)),)
-        # check for the .diz file, but create the .debuginfo link
-        IMPORT_LIST += $(LIB_LOCATION)/$(SERVER_LOCATION)/$(LIBJSIG_DEBUGINFO_NAME)
+        IMPORT_LIST += $(LIB_LOCATION)/$(SERVER_LOCATION)/$(LIBJSIG_DIZ_NAME)
       endif
     else
       # the import JDK may not contain the target of the symlink
@@ -319,8 +318,7 @@
   ifeq ($(ZIP_DEBUGINFO_FILES),1)
     # the import JDK may not contain the target of the symlink
     ifneq ($(wildcard $(HOTSPOT_IMPORT_PATH)/$(ARCH_VM_SUBDIR)/$(LIBJSIG_DIZ_NAME)),)
-      # check for the .diz file, but create the .debuginfo link
-      IMPORT_LIST += $(LIB_LOCATION)/$(CLIENT_LOCATION)/$(LIBJSIG_DEBUGINFO_NAME)
+      IMPORT_LIST += $(LIB_LOCATION)/$(CLIENT_LOCATION)/$(LIBJSIG_DIZ_NAME)
     endif
   else
     # the import JDK may not contain the target of the symlink
@@ -472,11 +470,24 @@
 	$(call install-sym-link, ../$(LIBJSIG_NAME))
 
   ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1)
-# we don't create a symlink to a libjsig.diz file
+# We don't create a symlink to a libjsig.diz file, but we do put
+# the libjsig.debuginfo symlink into a libjsig.diz file. The aurora
+# system does not like dangling symlinks.
+    ifeq ($(ZIP_DEBUGINFO_FILES),1)
+$(LIB_LOCATION)/$(CLIENT_LOCATION)/$(LIBJSIG_DIZ_NAME) \
+$(LIB_LOCATION)/$(SERVER_LOCATION)/$(LIBJSIG_DIZ_NAME):
+	@$(prep-target)
+	$(LN) -s ../$(LIBJSIG_DEBUGINFO_NAME) $(@D)/$(LIBJSIG_DEBUGINFO_NAME)
+	( $(CD) $(@D) ; \
+	 $(ZIPEXE) -y $(LIBJSIG_DIZ_NAME) $(LIBJSIG_DEBUGINFO_NAME) ; \
+	 $(RM) $(LIBJSIG_DEBUGINFO_NAME) ; \
+	)
+    else
 $(LIB_LOCATION)/$(CLIENT_LOCATION)/$(LIBJSIG_DEBUGINFO_NAME) \
 $(LIB_LOCATION)/$(SERVER_LOCATION)/$(LIBJSIG_DEBUGINFO_NAME):
 	@$(prep-target)
 	$(call install-sym-link, ../$(LIBJSIG_DEBUGINFO_NAME))
+    endif
   endif
 else
 $(LIB_LOCATION)/$(CLIENT_LOCATION)/$(LIBJSIG_NAME):
@@ -484,10 +495,22 @@
 	$(call install-sym-link, ../$(LIBJSIG_NAME))
 
   ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1)
-# we don't create a symlink to a libjsig.diz file
+# We don't create a symlink to a libjsig.diz file, but we do put
+# the libjsig.debuginfo symlink into a libjsig.diz file. The aurora
+# system does not like dangling symlinks.
+    ifeq ($(ZIP_DEBUGINFO_FILES),1)
+$(LIB_LOCATION)/$(CLIENT_LOCATION)/$(LIBJSIG_DIZ_NAME):
+	@$(prep-target)
+	$(LN) -s ../$(LIBJSIG_DEBUGINFO_NAME) $(@D)/$(LIBJSIG_DEBUGINFO_NAME)
+	( $(CD) $(@D) ; \
+	 $(ZIPEXE) -y $(LIBJSIG_DIZ_NAME) $(LIBJSIG_DEBUGINFO_NAME) ; \
+	 $(RM) $(LIBJSIG_DEBUGINFO_NAME) ; \
+	)
+    else
 $(LIB_LOCATION)/$(CLIENT_LOCATION)/$(LIBJSIG_DEBUGINFO_NAME):
 	@$(prep-target)
 	$(call install-sym-link, ../$(LIBJSIG_DEBUGINFO_NAME))
+    endif
   endif
 endif
 
--- a/make/sun/security/ec/Makefile	Fri May 25 12:56:22 2012 +0400
+++ b/make/sun/security/ec/Makefile	Fri May 25 19:34:32 2012 -0700
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2009, 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
@@ -160,7 +160,7 @@
       $(PKGDIR)/ECKeyPairGenerator.java
 
   JAVAHFLAGS = -bootclasspath \
-      "$(CLASSDESTDIR)$(CLASSPATH_SEPARATOR)$(CLASSBINDIR)"
+      "$(CLASSDESTDIR)$(CLASSPATH_SEPARATOR)$(CLASSBINDIR)$(JCE_PATH)"
 
 
   #
--- a/make/sun/security/mscapi/Makefile	Fri May 25 12:56:22 2012 +0400
+++ b/make/sun/security/mscapi/Makefile	Fri May 25 19:34:32 2012 -0700
@@ -150,7 +150,7 @@
 #
 CLASSDESTDIR = $(TEMPDIR)/classes
 JAVAHFLAGS = -bootclasspath \
-  "$(CLASSDESTDIR)$(CLASSPATH_SEPARATOR)$(CLASSBINDIR)"
+  "$(CLASSDESTDIR)$(CLASSPATH_SEPARATOR)$(CLASSBINDIR)$(JCE_PATH)"
 
 include $(BUILDDIR)/common/Mapfile-vers.gmk
 
--- a/make/sun/security/pkcs11/Makefile	Fri May 25 12:56:22 2012 +0400
+++ b/make/sun/security/pkcs11/Makefile	Fri May 25 19:34:32 2012 -0700
@@ -151,7 +151,7 @@
 #
 CLASSDESTDIR = $(TEMPDIR)/classes
 JAVAHFLAGS = -bootclasspath \
-    "$(CLASSDESTDIR)$(CLASSPATH_SEPARATOR)$(CLASSBINDIR)"
+    "$(CLASSDESTDIR)$(CLASSPATH_SEPARATOR)$(CLASSBINDIR)$(JCE_PATH)"
 
 include $(BUILDDIR)/common/Mapfile-vers.gmk
 
--- a/makefiles/com/oracle/security/ucrypto/Makefile	Fri May 25 12:56:22 2012 +0400
+++ b/makefiles/com/oracle/security/ucrypto/Makefile	Fri May 25 19:34:32 2012 -0700
@@ -139,7 +139,7 @@
   #
   CLASSDESTDIR = $(TEMPDIR)/classes
   JAVAHFLAGS = -bootclasspath \
-    "$(CLASSDESTDIR)$(CLASSPATH_SEPARATOR)$(CLASSBINDIR)"
+    "$(CLASSDESTDIR)$(CLASSPATH_SEPARATOR)$(CLASSBINDIR)$(JCE_PATH)"
 
   include $(BUILDDIR)/common/Mapfile-vers.gmk
   include $(BUILDDIR)/common/Library.gmk
--- a/makefiles/common/shared/Defs-java.gmk	Fri May 25 12:56:22 2012 +0400
+++ b/makefiles/common/shared/Defs-java.gmk	Fri May 25 19:34:32 2012 -0700
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2007, 2011, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2007, 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
@@ -141,7 +141,7 @@
 # built implicitly/explicitly.
 #
 ifeq ($(wildcard $(SHARE_SRC)/classes/javax/crypto/Cipher.java),)
-  JCEFLAGS = $(CLASSPATH_SEPARATOR)$(LIBDIR)/jce.jar
+  JCE_PATH = $(CLASSPATH_SEPARATOR)$(LIBDIR)/jce.jar
 endif
 
 # Add the source level
@@ -154,11 +154,11 @@
 CLASS_VERSION = -target $(TARGET_CLASS_VERSION)
 JAVACFLAGS  += $(CLASS_VERSION)
 JAVACFLAGS  += -encoding ascii
-JAVACFLAGS  += "-Xbootclasspath:$(CLASSBINDIR)$(JCEFLAGS)"
+JAVACFLAGS  += "-Xbootclasspath:$(CLASSBINDIR)$(JCE_PATH)"
 JAVACFLAGS  += $(OTHER_JAVACFLAGS)
 
 # Needed for javah
-JAVAHFLAGS += -bootclasspath "$(CLASSBINDIR)$(JCEFLAGS)"
+JAVAHFLAGS += -bootclasspath "$(CLASSBINDIR)$(JCE_PATH)"
 
 # Needed for javadoc to ensure it builds documentation
 # against the newly built classes
--- a/makefiles/sun/security/ec/Makefile	Fri May 25 12:56:22 2012 +0400
+++ b/makefiles/sun/security/ec/Makefile	Fri May 25 19:34:32 2012 -0700
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2009, 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
@@ -159,7 +159,8 @@
       $(PKGDIR)/ECDSASignature.java \
       $(PKGDIR)/ECKeyPairGenerator.java
 
-  JAVAHFLAGS += -Xbootclasspath/p:$(CLASSDESTDIR)
+  JAVAHFLAGS = -bootclasspath \
+    "$(CLASSDESTDIR)$(CLASSPATH_SEPARATOR)$(CLASSBINDIR)$(JCE_PATH)"
 
   #
   # C and C++ files
--- a/makefiles/sun/security/mscapi/Makefile	Fri May 25 12:56:22 2012 +0400
+++ b/makefiles/sun/security/mscapi/Makefile	Fri May 25 19:34:32 2012 -0700
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2005, 2011, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2005, 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
@@ -149,7 +149,8 @@
 # Rules
 #
 CLASSDESTDIR = $(TEMPDIR)/classes
-JAVAHFLAGS += -Xbootclasspath/p:$(CLASSDESTDIR)
+JAVAHFLAGS = -bootclasspath \
+  "$(CLASSDESTDIR)$(CLASSPATH_SEPARATOR)$(CLASSBINDIR)$(JCE_PATH)"
 
 include $(BUILDDIR)/common/Mapfile-vers.gmk
 
--- a/makefiles/sun/security/pkcs11/Makefile	Fri May 25 12:56:22 2012 +0400
+++ b/makefiles/sun/security/pkcs11/Makefile	Fri May 25 19:34:32 2012 -0700
@@ -150,7 +150,8 @@
 # Rules
 #
 CLASSDESTDIR = $(TEMPDIR)/classes
-JAVAHFLAGS = -bootclasspath "$(CLASSDESTDIR)$(CLASSPATH_SEPARATOR)$(CLASSBINDIR)"
+JAVAHFLAGS = -bootclasspath \
+  "$(CLASSDESTDIR)$(CLASSPATH_SEPARATOR)$(CLASSBINDIR)$(JCE_PATH)"
 
 include $(BUILDDIR)/common/Mapfile-vers.gmk
 
--- a/src/macosx/classes/com/apple/laf/AquaButtonLabeledUI.java	Fri May 25 12:56:22 2012 +0400
+++ b/src/macosx/classes/com/apple/laf/AquaButtonLabeledUI.java	Fri May 25 19:34:32 2012 -0700
@@ -30,6 +30,7 @@
 
 import javax.swing.*;
 import javax.swing.border.Border;
+import javax.swing.plaf.UIResource;
 import javax.swing.plaf.basic.BasicHTML;
 import javax.swing.text.View;
 
@@ -76,8 +77,11 @@
     protected void setThemeBorder(final AbstractButton b) {
         super.setThemeBorder(b);
 
-        // Set the correct border
-        b.setBorder(AquaButtonBorder.getBevelButtonBorder());
+        Border border = b.getBorder();
+        if (border == null || border instanceof UIResource) {
+            // Set the correct border
+            b.setBorder(AquaButtonBorder.getBevelButtonBorder());
+        }
     }
 
     protected abstract AquaButtonBorder getPainter();
--- a/src/macosx/classes/com/apple/laf/AquaLookAndFeel.java	Fri May 25 12:56:22 2012 +0400
+++ b/src/macosx/classes/com/apple/laf/AquaLookAndFeel.java	Fri May 25 19:34:32 2012 -0700
@@ -250,6 +250,7 @@
      */
     private void initResourceBundle(final UIDefaults table) {
         table.setDefaultLocale(Locale.getDefault());
+        table.addResourceBundle(PKG_PREFIX + "resources.aqua");
         try {
             final ResourceBundle aquaProperties = MacOSXResourceBundle.getMacResourceBundle(PKG_PREFIX + "resources.aqua");
             final Enumeration<String> propertyKeys = aquaProperties.getKeys();
@@ -259,7 +260,6 @@
                 table.put(key, aquaProperties.getString(key));
             }
         } catch (final Exception e) {
-            table.addResourceBundle(PKG_PREFIX + "resources.aqua");
         }
     }
 
--- a/src/macosx/classes/com/apple/laf/AquaTabbedPaneUI.java	Fri May 25 12:56:22 2012 +0400
+++ b/src/macosx/classes/com/apple/laf/AquaTabbedPaneUI.java	Fri May 25 19:34:32 2012 -0700
@@ -318,7 +318,7 @@
         }
 
         // not for the scrolling tabs
-        if (tabIndex >= 0) {
+        if (component == null && tabIndex >= 0) {
             paintTitle(g2d, font, metrics, textRect, tabIndex, title);
         }
 
--- a/src/macosx/classes/com/apple/laf/resources/aqua.properties	Fri May 25 12:56:22 2012 +0400
+++ b/src/macosx/classes/com/apple/laf/resources/aqua.properties	Fri May 25 19:34:32 2012 -0700
@@ -36,45 +36,45 @@
 # support.
 
 ############ FILE CHOOSER STRINGS #############
-FileChooser.fileDescriptionText=Generic File
-FileChooser.directoryDescriptionText=Directory
-FileChooser.newFolderErrorText=Error occured during folder creation
+FileChooser.fileDescription.textAndMnemonic=Generic File
+FileChooser.directoryDescription.textAndMnemonic=Directory
+FileChooser.newFolderError.textAndMnemonic=Error occured during folder creation
 FileChooser.newFolderErrorSeparator= :
-FileChooser.acceptAllFileFilterText=All Files
-FileChooser.cancelButtonText=Cancel
-FileChooser.saveButtonText=Save
-FileChooser.openButtonText=Open
-FileChooser.saveDialogTitleText=Save
-FileChooser.openDialogTitleText=Open
-FileChooser.updateButtonText=Update
-FileChooser.helpButtonText=Help
-FileChooser.directoryOpenButtonText=Open
+FileChooser.acceptAllFileFilter.textAndMnemonic=All Files
+FileChooser.cancelButton.textAndMnemonic=Cancel
+FileChooser.saveButton.textAndMnemonic=Save
+FileChooser.openButton.textAndMnemonic=Open
+FileChooser.saveDialogTitle.textAndMnemonic=Save
+FileChooser.openDialogTitle.textAndMnemonic=Open
+FileChooser.updateButton.textAndMnemonic=Update
+FileChooser.helpButton.textAndMnemonic=Help
+FileChooser.directoryOpenButton.textAndMnemonic=Open
 
 # File Size Units
 FileChooser.fileSizeKiloBytes={0} KB
 FileChooser.fileSizeMegaBytes={0} MB
 FileChooser.fileSizeGigaBytes={0} GB
 
-// Mac-specific strings
-FileChooser.saveTitleText=Save
-FileChooser.openTitleText=Open
-FileChooser.newFolderExistsErrorText=That name is already taken
-FileChooser.chooseButtonText=Choose
+# Mac-specific strings
+FileChooser.saveTitle.textAndMnemonic=Save
+FileChooser.openTitle.textAndMnemonic=Open
+FileChooser.newFolderExistsError.textAndMnemonic=That name is already taken
+FileChooser.chooseButton.textAndMnemonic=Choose
 
-FileChooser.newFolderButtonText=New Folder
-FileChooser.newFolderTitleText=New Folder
-FileChooser.fileNameLabelText=File:
-FileChooser.saveDialogFileNameLabelText=Save As:
-FileChooser.filesOfTypeLabelText=File Format:
+FileChooser.newFolderButton.textAndMnemonic=New Folder
+FileChooser.newFolderTitle.textAndMnemonic=New Folder
+FileChooser.fileNameLabel.textAndMnemonic=File:
+FileChooser.saveDialogFileNameLabel.textAndMnemonic=Save As:
+FileChooser.filesOfTypeLabel.textAndMnemonic=File Format:
 
 FileChooser.desktopName=Desktop
-FileChooser.newFolderPromptText=Name of new folder:
+FileChooser.newFolderPrompt.textAndMnemonic=Name of new folder:
 FileChooser.untitledFolderName=untitled folder
 FileChooser.untitledFileName=untitled
-FileChooser.createButtonText=Create
+FileChooser.createButton.textAndMnemonic=Create
 
-FileChooser.byDateText=Date Modified
-FileChooser.byNameText=Name
+FileChooser.byDate.textAndMnemonic=Date Modified
+FileChooser.by.textAndMnemonic=Name
 FileChooser.newFolderAccessibleName=New Folder
 
 FileChooser.mac.newFolder=untitled folder
@@ -82,76 +82,54 @@
 
 
 ############ COLOR CHOOSER STRINGS #############
-ColorChooser.previewText=Preview
-ColorChooser.okText=OK
-ColorChooser.cancelText=Cancel
-ColorChooser.resetText=Reset
-# VK_XXX constant for 'ColorChooser.resetText' button to make mnemonic
-ColorChooser.resetMnemonic=82
-ColorChooser.sampleText=Sample Text  Sample Text
-ColorChooser.swatchesNameText=Swatches
-ColorChooser.swatchesMnemonic=83
-ColorChooser.swatchesDisplayedMnemonicIndex=0
-ColorChooser.swatchesRecentText=Recent:
-ColorChooser.hsbNameText=HSB
-# Each of the ColorChooser types can define a mnemonic, as a KeyEvent.VK_XXX
-# constant, and an index into the text to render the mnemonic as. The
-# mnemonic is xxxMnemonic and the index of the character to underline is
-# xxxDisplayedMnemonicIndex.
-ColorChooser.hsbMnemonic=72
-ColorChooser.hsbDisplayedMnemonicIndex=0
-ColorChooser.hsbHueText=H
-ColorChooser.hsbSaturationText=S
-ColorChooser.hsbBrightnessText=B
-ColorChooser.hsbRedText=R
-ColorChooser.hsbGreenText=G
-ColorChooser.hsbBlueText=B
-ColorChooser.rgbNameText=RGB
-ColorChooser.rgbMnemonic=71
-ColorChooser.rgbDisplayedMnemonicIndex=1
-ColorChooser.rgbRedText=Red
-ColorChooser.rgbRedMnemonic=68
-ColorChooser.rgbGreenText=Green
-ColorChooser.rgbGreenMnemonic=78
-ColorChooser.rgbBlueText=Blue
-ColorChooser.rgbBlueMnemonic=66
+ColorChooser.preview.textAndMnemonic=Preview
+ColorChooser.ok.textAndMnemonic=OK
+ColorChooser.cancel.textAndMnemonic=Cancel
+ColorChooser.reset.textAndMnemonic=&Reset
+ColorChooser.sample.textAndMnemonic=Sample Text  Sample Text
+ColorChooser.swatches.textAndMnemonic=&Swatches
+ColorChooser.swatchesRecent.textAndMnemonic=Recent:
+ColorChooser.hsb.textAndMnemonic=&HSB
+ColorChooser.hsbHue.textAndMnemonic=H
+ColorChooser.hsbSaturation.textAndMnemonic=S
+ColorChooser.hsbBrightness.textAndMnemonic=B
+ColorChooser.hsbRed.textAndMnemonic=R
+ColorChooser.hsbGreen.textAndMnemonic=G
+ColorChooser.hsbBlue.textAndMnemonic=B
+ColorChooser.rgb.textAndMnemonic=R&GB
+ColorChooser.rgbRed.textAndMnemonic=Re&d
+ColorChooser.rgbGreen.textAndMnemonic=Gree&n
+ColorChooser.rgbBlue.textAndMnemonic=&Blue
 
 ############ OPTION PANE STRINGS #############
-# Mnemonic keys correspond to KeyEvent.VK_XXX constant
 # We only define mnemonics for YES/NO, but for completeness you can
 # define mnemonics for any of the buttons.
-OptionPane.yesButtonText=Yes
-OptionPane.yesButtonMnemonic=89
-OptionPane.noButtonText=No
-OptionPane.noButtonMnemonic=78
-OptionPane.okButtonText=OK
-OptionPane.okButtonMnemonic=0
-OptionPane.cancelButtonText=Cancel
-OptionPane.cancelButtonMnemonic=0
-OptionPane.titleText=Select an Option
+OptionPane.yesButton.textAndMnemonic=&Yes
+OptionPane.noButton.textAndMnemonic=&No
+OptionPane.okButton.textAndMnemonic=OK
+OptionPane.cancelButton.textAndMnemonic=Cancel
+OptionPane.title.textAndMnemonic=Select an Option
 # Title for the dialog for the showInputDialog methods. Only used if
 # the developer uses one of the variants that doesn't take a title.
-OptionPane.inputDialogTitle=Input
+OptionPane.inputDialog.titleAndMnemonic=Input
 # Title for the dialog for the showMessageDialog methods. Only used if
 # the developer uses one of the variants that doesn't take a title.
-OptionPane.messageDialogTitle=Message
+OptionPane.messageDialog.titleAndMnemonic=Message
 
 ############ Printing Dialog Strings ############
-PrintingDialog.titleProgressText=Printing
-PrintingDialog.titleAbortingText=Printing (Aborting)
+PrintingDialog.titleProgress.textAndMnemonic=Printing
+PrintingDialog.titleAborting.textAndMnemonic=Printing (Aborting)
 
-PrintingDialog.contentInitialText=Printing in progress...
+PrintingDialog.contentInitial.textAndMnemonic=Printing in progress...
 
 # The following string will be formatted by a MessageFormat
 # and {0} will be replaced by page number being printed
-PrintingDialog.contentProgressText=Printed page {0}...
+PrintingDialog.contentProgress.textAndMnemonic=Printed page {0}...
 
-PrintingDialog.contentAbortingText=Printing aborting...
+PrintingDialog.contentAborting.textAndMnemonic=Printing aborting...
 
-PrintingDialog.abortButtonText=Abort
-PrintingDialog.abortButtonMnemonic=65
-PrintingDialog.abortButtonDisplayedMnemonicIndex=0
-PrintingDialog.abortButtonToolTipText=Abort Printing
+PrintingDialog.abortButton.textAndMnemonic=&Abort
+PrintingDialog.abortButtonToolTip.textAndMnemonic=Abort Printing
 
 ############ Internal Frame Strings ############
 InternalFrame.iconButtonToolTip=Minimize
@@ -160,42 +138,42 @@
 InternalFrame.closeButtonToolTip=Close
 
 ############ Internal Frame Title Pane Strings ############
-InternalFrameTitlePane.restoreButtonText=Restore
-InternalFrameTitlePane.moveButtonText=Move
-InternalFrameTitlePane.sizeButtonText=Size
-InternalFrameTitlePane.minimizeButtonText=Minimize
-InternalFrameTitlePane.maximizeButtonText=Maximize
-InternalFrameTitlePane.closeButtonText=Close
+InternalFrameTitlePane.restoreButton.textAndMnemonic=Restore
+InternalFrameTitlePane.moveButton.textAndMnemonic=Move
+InternalFrameTitlePane.sizeButton.textAndMnemonic=Size
+InternalFrameTitlePane.minimizeButton.textAndMnemonic=Minimize
+InternalFrameTitlePane.maximizeButton.textAndMnemonic=Maximize
+InternalFrameTitlePane.closeButton.textAndMnemonic=Close
 
 ############ Text strings #############
 # Used for html forms
-FormView.submitButtonText=Submit Query
-FormView.resetButtonText=Reset
-FormView.browseFileButtonText=Browse...
+FormView.submitButton.textAndMnemonic=Submit Query
+FormView.resetButton.textAndMnemonic=Reset
+FormView.browseFileButton.textAndMnemonic=Browse...
 
 ############ Abstract Document Strings ############
-AbstractDocument.styleChangeText=style change
-AbstractDocument.additionText=addition
-AbstractDocument.deletionText=deletion
-AbstractDocument.undoText=Undo
-AbstractDocument.redoText=Redo
+AbstractDocument.styleChange.textAndMnemonic=style change
+AbstractDocument.addition.textAndMnemonic=addition
+AbstractDocument.deletion.textAndMnemonic=deletion
+AbstractDocument.undo.textAndMnemonic=Undo
+AbstractDocument.redo.textAndMnemonic=Redo
 
 ############ Abstract Button Strings ############
-AbstractButton.clickText=click
+AbstractButton.click.textAndMnemonic=click
 
 ############ Abstract Undoable Edit Strings ############
-AbstractUndoableEdit.undoText=Undo
-AbstractUndoableEdit.redoText=Redo
+AbstractUndoableEdit.undo.textAndMnemonic=Undo
+AbstractUndoableEdit.redo.textAndMnemonic=Redo
 
 ############ Combo Box Strings ############
-ComboBox.togglePopupText=togglePopup
+ComboBox.togglePopup.textAndMnemonic=togglePopup
 
 ############ Progress Monitor Strings ############
-ProgressMonitor.progressText=Progress...
+ProgressMonitor.progress.textAndMnemonic=Progress...
 
 ############ Split Pane Strings ############
-SplitPane.leftButtonText=left button
-SplitPane.rightButtonText=right button
+SplitPane.leftButton.textAndMnemonic=left button
+SplitPane.rightButton.textAndMnemonic=right button
 # Used for Isindex
 IsindexView.prompt=This is a searchable index.  Enter search keywords:
 
--- a/src/macosx/classes/java/util/prefs/MacOSXPreferences.java	Fri May 25 12:56:22 2012 +0400
+++ b/src/macosx/classes/java/util/prefs/MacOSXPreferences.java	Fri May 25 19:34:32 2012 -0700
@@ -135,18 +135,21 @@
 
 
     // AbstractPreferences implementation
+    @Override
     protected void putSpi(String key, String value)
     {
         file.addKeyToNode(path, key, value);
     }
 
     // AbstractPreferences implementation
+    @Override
     protected String getSpi(String key)
     {
         return file.getKeyFromNode(path, key);
     }
 
     // AbstractPreferences implementation
+    @Override
     protected void removeSpi(String key)
     {
         Objects.requireNonNull(key, "Specified key cannot be null");
@@ -155,6 +158,7 @@
 
 
     // AbstractPreferences implementation
+    @Override
     protected void removeNodeSpi()
         throws BackingStoreException
     {
@@ -174,6 +178,7 @@
 
 
     // AbstractPreferences implementation
+    @Override
     protected String[] childrenNamesSpi()
         throws BackingStoreException
     {
@@ -183,6 +188,7 @@
     }
 
     // AbstractPreferences implementation
+    @Override
     protected String[] keysSpi()
         throws BackingStoreException
     {
@@ -192,6 +198,7 @@
     }
 
     // AbstractPreferences implementation
+    @Override
     protected AbstractPreferences childSpi(String name)
     {
         // Add to parent's child list here and disallow sync
@@ -203,6 +210,7 @@
     }
 
     // AbstractPreferences override
+    @Override
     public void flush()
         throws BackingStoreException
     {
@@ -217,6 +225,7 @@
     }
 
     // AbstractPreferences implementation
+    @Override
     protected void flushSpi()
         throws BackingStoreException
     {
@@ -224,6 +233,7 @@
     }
 
     // AbstractPreferences override
+    @Override
     public void sync()
         throws BackingStoreException
     {
@@ -244,6 +254,7 @@
     }
 
     // AbstractPreferences implementation
+    @Override
     protected void syncSpi()
         throws BackingStoreException
     {
--- a/src/macosx/classes/java/util/prefs/MacOSXPreferencesFactory.java	Fri May 25 12:56:22 2012 +0400
+++ b/src/macosx/classes/java/util/prefs/MacOSXPreferencesFactory.java	Fri May 25 19:34:32 2012 -0700
@@ -26,10 +26,12 @@
 package java.util.prefs;
 
 class MacOSXPreferencesFactory implements PreferencesFactory {
+    @Override
     public Preferences userRoot() {
         return MacOSXPreferences.getUserRoot();
     }
 
+    @Override
     public Preferences systemRoot() {
         return MacOSXPreferences.getSystemRoot();
     }
--- a/src/macosx/classes/java/util/prefs/MacOSXPreferencesFile.java	Fri May 25 12:56:22 2012 +0400
+++ b/src/macosx/classes/java/util/prefs/MacOSXPreferencesFile.java	Fri May 25 19:34:32 2012 -0700
@@ -101,9 +101,10 @@
     }
 
     // Maps string -> weak reference to MacOSXPreferencesFile
-    private static HashMap cachedFiles = null;
+    private static HashMap<String, WeakReference<MacOSXPreferencesFile>>
+            cachedFiles;
     // Files that may have unflushed changes
-    private static HashSet changedFiles = null;
+    private static HashSet<MacOSXPreferencesFile> changedFiles;
 
 
     // Timer and pending sync and flush tasks (which are both scheduled
@@ -136,13 +137,14 @@
     {
         MacOSXPreferencesFile result = null;
 
-        if (cachedFiles == null) cachedFiles = new HashMap();
+        if (cachedFiles == null)
+            cachedFiles = new HashMap<>();
 
         String hashkey =
             newName + String.valueOf(isUser);
-        WeakReference hashvalue = (WeakReference)cachedFiles.get(hashkey);
+        WeakReference<MacOSXPreferencesFile> hashvalue = cachedFiles.get(hashkey);
         if (hashvalue != null) {
-            result = (MacOSXPreferencesFile)hashvalue.get();
+            result = hashvalue.get();
         }
         if (result == null) {
             // Java user node == CF current user, any host
@@ -150,7 +152,7 @@
             result = new MacOSXPreferencesFile(newName,
                                          isUser ? cfCurrentUser : cfAnyUser,
                                          isUser ? cfAnyHost : cfCurrentHost);
-            cachedFiles.put(hashkey, new WeakReference(result));
+            cachedFiles.put(hashkey, new WeakReference<MacOSXPreferencesFile>(result));
         }
 
         // Don't schedule this file for flushing until some nodes or
@@ -171,10 +173,11 @@
         boolean ok = true;
 
         if (cachedFiles != null  &&  !cachedFiles.isEmpty()) {
-            Iterator iter = cachedFiles.values().iterator();
+            Iterator<WeakReference<MacOSXPreferencesFile>> iter =
+                    cachedFiles.values().iterator();
             while (iter.hasNext()) {
-                WeakReference ref = (WeakReference)iter.next();
-                MacOSXPreferencesFile f = (MacOSXPreferencesFile)ref.get();
+                WeakReference<MacOSXPreferencesFile> ref = iter.next();
+                MacOSXPreferencesFile f = ref.get();
                 if (f != null) {
                     if (!f.synchronize()) ok = false;
                 } else {
@@ -202,10 +205,11 @@
     static synchronized boolean syncUser() {
         boolean ok = true;
         if (cachedFiles != null  &&  !cachedFiles.isEmpty()) {
-            Iterator<WeakReference> iter = cachedFiles.values().iterator();
+            Iterator<WeakReference<MacOSXPreferencesFile>> iter =
+                    cachedFiles.values().iterator();
             while (iter.hasNext()) {
-                WeakReference ref = iter.next();
-                MacOSXPreferencesFile f = (MacOSXPreferencesFile)ref.get();
+                WeakReference<MacOSXPreferencesFile> ref = iter.next();
+                MacOSXPreferencesFile f = ref.get();
                 if (f != null && f.user == cfCurrentUser) {
                     if (!f.synchronize()) {
                         ok = false;
@@ -240,12 +244,10 @@
         boolean ok = true;
 
         if (changedFiles != null  &&  !changedFiles.isEmpty()) {
-            Iterator iter = changedFiles.iterator();
-            while (iter.hasNext()) {
-                MacOSXPreferencesFile f = (MacOSXPreferencesFile)iter.next();
-                if (!f.synchronize()) ok = false;
+            for (MacOSXPreferencesFile f : changedFiles) {
+                if (!f.synchronize())
+                    ok = false;
             }
-
             changedFiles.clear();
         }
 
@@ -263,7 +265,8 @@
     private void markChanged()
     {
         // Add this file to the changed file list
-        if (changedFiles == null) changedFiles = new HashSet();
+        if (changedFiles == null)
+            changedFiles = new HashSet<>();
         changedFiles.add(this);
 
         // Schedule a new flush and a shutdown hook, if necessary
@@ -309,7 +312,9 @@
 
             if (syncInterval > 0) {
                 timer().schedule(new TimerTask() {
-                        public void run() { MacOSXPreferencesFile.syncWorld();}
+                    @Override
+                    public void run() {
+                        MacOSXPreferencesFile.syncWorld();}
                     }, syncInterval * 1000, syncInterval * 1000);
             } else {
                 // syncInterval property not set. No sync timer ever.
@@ -323,6 +328,7 @@
         if (timer == null) {
             timer = new Timer(true); // daemon
             Thread flushThread = new Thread() {
+                @Override
                 public void run() {
                     flushWorld();
                 }
--- a/src/macosx/classes/sun/lwawt/LWComponentPeer.java	Fri May 25 12:56:22 2012 +0400
+++ b/src/macosx/classes/sun/lwawt/LWComponentPeer.java	Fri May 25 19:34:32 2012 -0700
@@ -56,6 +56,8 @@
 import sun.java2d.opengl.OGLRenderQueue;
 import sun.java2d.pipe.Region;
 
+import sun.util.logging.PlatformLogger;
+
 import javax.swing.JComponent;
 import javax.swing.SwingUtilities;
 import javax.swing.RepaintManager;
@@ -65,7 +67,10 @@
 import com.sun.java.swing.SwingUtilities3;
 
 public abstract class LWComponentPeer<T extends Component, D extends JComponent>
-        implements ComponentPeer, DropTargetPeer {
+    implements ComponentPeer, DropTargetPeer
+{
+    private static final PlatformLogger focusLog = PlatformLogger.getLogger("sun.lwawt.focus.LWComponentPeer");
+
     // State lock is to be used for modifications to this
     // peer's fields (e.g. bounds, background, font, etc.)
     // It should be the last lock in the lock chain
@@ -372,7 +377,7 @@
     }
 
     @Override
-    public void dispose() {
+    public final void dispose() {
         if (disposed.compareAndSet(false, true)) {
             disposeImpl();
         }
@@ -885,7 +890,13 @@
     @Override
     public boolean requestFocus(Component lightweightChild, boolean temporary,
                                 boolean focusedWindowChangeAllowed, long time,
-                                CausedFocusEvent.Cause cause) {
+                                CausedFocusEvent.Cause cause)
+    {
+        if (focusLog.isLoggable(PlatformLogger.FINEST)) {
+            focusLog.finest("lightweightChild=" + lightweightChild + ", temporary=" + temporary +
+                            ", focusedWindowChangeAllowed=" + focusedWindowChangeAllowed +
+                            ", time= " + time + ", cause=" + cause);
+        }
         if (LWKeyboardFocusManagerPeer.getInstance(getAppContext()).
                 processSynchronousLightweightTransfer(getTarget(), lightweightChild, temporary,
                         focusedWindowChangeAllowed, time)) {
@@ -901,19 +912,44 @@
             case LWKeyboardFocusManagerPeer.SNFH_SUCCESS_PROCEED:
                 Window parentWindow = SunToolkit.getContainingWindow(getTarget());
                 if (parentWindow == null) {
+                    focusLog.fine("request rejected, parentWindow is null");
                     LWKeyboardFocusManagerPeer.removeLastFocusRequest(getTarget());
                     return false;
                 }
                 LWWindowPeer parentPeer = (LWWindowPeer) parentWindow.getPeer();
                 if (parentPeer == null) {
+                    focusLog.fine("request rejected, parentPeer is null");
                     LWKeyboardFocusManagerPeer.removeLastFocusRequest(getTarget());
                     return false;
                 }
 
+                // A fix for 7145768. Ensure the parent window is currently natively focused.
+                // The more evident place to perform this check is in KFM.shouldNativelyFocusHeavyweight,
+                // however that is the shared code and this particular problem's reproducibility has
+                // platform specifics. So, it was decided to narrow down the fix to lwawt (OSX) in
+                // current release. TODO: consider fixing it in the shared code.
+                if (!focusedWindowChangeAllowed) {
+                    LWWindowPeer decoratedPeer = parentPeer.isSimpleWindow() ?
+                        LWWindowPeer.getOwnerFrameDialog(parentPeer) : parentPeer;
+
+                    if (decoratedPeer == null || !decoratedPeer.getPlatformWindow().isActive()) {
+                        if (focusLog.isLoggable(PlatformLogger.FINE)) {
+                            focusLog.fine("request rejected, focusedWindowChangeAllowed==false, " +
+                                          "decoratedPeer is inactive: " + decoratedPeer);
+                        }
+                        LWKeyboardFocusManagerPeer.removeLastFocusRequest(getTarget());
+                        return false;
+                    }
+                }
+
                 boolean res = parentPeer.requestWindowFocus(cause);
                 // If parent window can be made focused and has been made focused (synchronously)
                 // then we can proceed with children, otherwise we retreat
                 if (!res || !parentWindow.isFocused()) {
+                    if (focusLog.isLoggable(PlatformLogger.FINE)) {
+                        focusLog.fine("request rejected, res= " + res + ", parentWindow.isFocused()=" +
+                                      parentWindow.isFocused());
+                    }
                     LWKeyboardFocusManagerPeer.removeLastFocusRequest(getTarget());
                     return false;
                 }
--- a/src/macosx/classes/sun/lwawt/LWCursorManager.java	Fri May 25 12:56:22 2012 +0400
+++ b/src/macosx/classes/sun/lwawt/LWCursorManager.java	Fri May 25 19:34:32 2012 -0700
@@ -88,20 +88,20 @@
         } else {
             cursor = (c != null) ? c.getCursor() : null;
         }
-        // TODO: default cursor for modal blocked windows
         setCursor(cursor);
     }
 
     /**
      * Returns the first visible, enabled and showing component under cursor.
+     * Returns null for modal blocked windows.
      *
      * @param cursorPos Current cursor position.
-     * @return Component
+     * @return Component or null.
      */
     private static final Component findComponent(final Point cursorPos) {
         final LWComponentPeer<?, ?> peer = LWWindowPeer.getPeerUnderCursor();
         Component c = null;
-        if (peer != null) {
+        if (peer != null && peer.getWindowPeerOrSelf().getBlocker() == null) {
             c = peer.getTarget();
             if (c instanceof Container) {
                 final Point p = peer.getLocationOnScreen();
--- a/src/macosx/classes/sun/lwawt/LWTextComponentPeer.java	Fri May 25 12:56:22 2012 +0400
+++ b/src/macosx/classes/sun/lwawt/LWTextComponentPeer.java	Fri May 25 19:34:32 2012 -0700
@@ -81,6 +81,18 @@
         firstChangeSkipped = true;
     }
 
+    @Override
+    protected final void disposeImpl() {
+        synchronized (getDelegateLock()) {
+            // visible caret has a timer thread which must be stopped
+            getTextComponent().getCaret().setVisible(false);
+        }
+        super.disposeImpl();
+    }
+
+    /**
+     * This method should be called under getDelegateLock().
+     */
     abstract JTextComponent getTextComponent();
 
     public Dimension getPreferredSize(final int rows, final int columns) {
--- a/src/macosx/classes/sun/lwawt/LWWindowPeer.java	Fri May 25 12:56:22 2012 +0400
+++ b/src/macosx/classes/sun/lwawt/LWWindowPeer.java	Fri May 25 19:34:32 2012 -0700
@@ -50,7 +50,7 @@
         EMBEDDEDFRAME
     }
 
-    private static final sun.util.logging.PlatformLogger focusLog = PlatformLogger.getLogger("sun.lwawt.focus.LWWindowPeer");
+    private static final PlatformLogger focusLog = PlatformLogger.getLogger("sun.lwawt.focus.LWWindowPeer");
 
     private PlatformWindow platformWindow;
 
@@ -101,8 +101,6 @@
     // events between MOUSE_PRESSED and MOUSE_RELEASED for particular button
     private static int mouseClickButtons = 0;
 
-    private volatile boolean cachedFocusableWindow;
-
     private volatile boolean isOpaque = true;
 
     private static final Font DEFAULT_FONT = new Font("Lucida Grande", Font.PLAIN, 13);
@@ -172,8 +170,6 @@
         setAlwaysOnTop(getTarget().isAlwaysOnTop());
         updateMinimumSize();
 
-        cachedFocusableWindow = getTarget().isFocusableWindow();
-
         setOpacity(getTarget().getOpacity());
         setOpaque(getTarget().isOpaque());
 
@@ -245,15 +241,17 @@
                         getInstance(getAppContext());
 
                     if (visible) {
-                        updateFocusableWindowState();
-                        changeFocusedWindow(true, true);
-
+                        if (!getTarget().isAutoRequestFocus()) {
+                            return;
+                        } else {
+                            requestWindowFocus(CausedFocusEvent.Cause.ACTIVATION);
+                        }
                     // Focus the owner in case this window is focused.
                     } else if (manager.getCurrentFocusedWindow() == getTarget()) {
+                        // Transfer focus to the owner.
                         LWWindowPeer owner = getOwnerFrameDialog(LWWindowPeer.this);
                         if (owner != null) {
-                            // KFM will do all the rest.
-                            owner.changeFocusedWindow(true, false);
+                            owner.requestWindowFocus(CausedFocusEvent.Cause.ACTIVATION);
                         }
                     }
                 }
@@ -400,7 +398,6 @@
 
     @Override
     public void updateFocusableWindowState() {
-        cachedFocusableWindow = getTarget().isFocusableWindow();
         platformWindow.updateFocusableWindowState();
     }
 
@@ -409,6 +406,8 @@
         synchronized (getPeerTreeLock()) {
             this.blocker = blocked ? (LWWindowPeer)blocker.getPeer() : null;
         }
+
+        platformWindow.setModalBlocked(blocked);
     }
 
     @Override
@@ -617,7 +616,7 @@
     }
 
     public void notifyActivation(boolean activation) {
-        changeFocusedWindow(activation, false);
+        changeFocusedWindow(activation);
     }
 
     // MouseDown in non-client area
@@ -1063,6 +1062,10 @@
         return lastMouseEventPeer;
     }
 
+    /*
+     * Requests platform to set native focus on a frame/dialog.
+     * In case of a simple window, triggers appropriate java focus change.
+     */
     public boolean requestWindowFocus(CausedFocusEvent.Cause cause) {
         if (focusLog.isLoggable(PlatformLogger.FINE)) {
             focusLog.fine("requesting native focus to " + this);
@@ -1106,14 +1109,14 @@
             }
 
             // DKFM will synthesize all the focus/activation events correctly.
-            changeFocusedWindow(true, false);
+            changeFocusedWindow(true);
             return true;
 
         // In case the toplevel is active but not focused, change focus directly,
         // as requesting native focus on it will not have effect.
         } else if (getTarget() == currentActive && !getTarget().hasFocus()) {
 
-            changeFocusedWindow(true, false);
+            changeFocusedWindow(true);
             return true;
         }
         return platformWindow.requestWindowFocus();
@@ -1122,7 +1125,19 @@
     private boolean focusAllowedFor() {
         Window window = getTarget();
         // TODO: check if modal blocked
-        return window.isVisible() && window.isEnabled() && window.isFocusableWindow();
+        return window.isVisible() && window.isEnabled() && isFocusableWindow();
+    }
+
+    private boolean isFocusableWindow() {
+        boolean focusable = getTarget().isFocusableWindow();
+        if (isSimpleWindow()) {
+            LWWindowPeer ownerPeer = getOwnerFrameDialog(this);
+            if (ownerPeer == null) {
+                return false;
+            }
+            return focusable && ownerPeer.getTarget().isFocusableWindow();
+        }
+        return focusable;
     }
 
     public boolean isSimpleWindow() {
@@ -1131,19 +1146,19 @@
     }
 
     /*
-     * "Delegates" the responsibility of managing focus to keyboard focus manager.
+     * Changes focused window on java level.
      */
-    private void changeFocusedWindow(boolean becomesFocused, boolean isShowing) {
+    private void changeFocusedWindow(boolean becomesFocused) {
         if (focusLog.isLoggable(PlatformLogger.FINE)) {
             focusLog.fine((becomesFocused?"gaining":"loosing") + " focus window: " + this);
         }
-        if (isShowing && !getTarget().isAutoRequestFocus() || skipNextFocusChange) {
+        if (skipNextFocusChange) {
             focusLog.fine("skipping focus change");
             skipNextFocusChange = false;
             return;
         }
-
-        if (!cachedFocusableWindow) {
+        if (!isFocusableWindow() && becomesFocused) {
+            focusLog.fine("the window is not focusable");
             return;
         }
         if (becomesFocused) {
@@ -1182,7 +1197,7 @@
         postEvent(windowEvent);
     }
 
-    private static LWWindowPeer getOwnerFrameDialog(LWWindowPeer peer) {
+    static LWWindowPeer getOwnerFrameDialog(LWWindowPeer peer) {
         Window owner = (peer != null ? peer.getTarget().getOwner() : null);
         while (owner != null && !(owner instanceof Frame || owner instanceof Dialog)) {
             owner = owner.getOwner();
--- a/src/macosx/classes/sun/lwawt/PlatformWindow.java	Fri May 25 12:56:22 2012 +0400
+++ b/src/macosx/classes/sun/lwawt/PlatformWindow.java	Fri May 25 19:34:32 2012 -0700
@@ -108,6 +108,8 @@
     public void flip(int x1, int y1, int x2, int y2,
                      BufferCapabilities.FlipContents flipAction);
 
+    public void setModalBlocked(boolean blocked);
+
     public void toFront();
 
     public void toBack();
--- a/src/macosx/classes/sun/lwawt/macosx/CEmbeddedFrame.java	Fri May 25 12:56:22 2012 +0400
+++ b/src/macosx/classes/sun/lwawt/macosx/CEmbeddedFrame.java	Fri May 25 19:34:32 2012 -0700
@@ -112,28 +112,19 @@
 
     public void handleFocusEvent(boolean focused) {
         this.focused = focused;
-        updateOverlayWindowActiveState();
+        if (parentWindowActive) {
+            responder.handleWindowFocusEvent(focused);
+        }
     }
 
     public void handleWindowFocusEvent(boolean parentWindowActive) {
         this.parentWindowActive = parentWindowActive;
-        updateOverlayWindowActiveState();
+        if (focused) {
+            responder.handleWindowFocusEvent(parentWindowActive);
+        }
     }
 
     public boolean isParentWindowActive() {
         return parentWindowActive;
     }
-
-    /*
-     * May change appearance of contents of window, and generate a
-     * WINDOW_ACTIVATED event.
-     */
-    private void updateOverlayWindowActiveState() {
-        final boolean showAsFocused = parentWindowActive && focused;
-        dispatchEvent(
-            new FocusEvent(this, showAsFocused ?
-                                 FocusEvent.FOCUS_GAINED :
-                                 FocusEvent.FOCUS_LOST));
-     }
-
 }
--- a/src/macosx/classes/sun/lwawt/macosx/CFileDialog.java	Fri May 25 12:56:22 2012 +0400
+++ b/src/macosx/classes/sun/lwawt/macosx/CFileDialog.java	Fri May 25 19:34:32 2012 -0700
@@ -34,6 +34,7 @@
 import java.io.*;
 
 import sun.awt.CausedFocusEvent.Cause;
+import sun.awt.AWTAccessor;
 import sun.java2d.pipe.Region;
 
 class CFileDialog implements FileDialogPeer {
@@ -53,33 +54,40 @@
                     title = " ";
                 }
 
-                String userFileName = nativeRunFileDialog(title,
-                        dialogMode, navigateApps,
+                String[] userFileNames = nativeRunFileDialog(title,
+                        dialogMode,
+                        target.isMultipleMode(),
+                        navigateApps,
                         target.getFilenameFilter() != null,
                         target.getDirectory(),
                         target.getFile());
 
-                File file = null;
-                if (userFileName != null) {
+                String directory = null;
+                String file = null;
+                File[] files = null;
+
+                if (userFileNames != null) {
                     // the dialog wasn't cancelled
-                    file = new File(userFileName);
+                    int filesNumber = userFileNames.length;
+                    files = new File[filesNumber];
+                    for (int i = 0; i < filesNumber; i++) {
+                        files[i] = new File(userFileNames[i]);
+                    }
+
+                    directory = files[0].getParent();
+                    // make sure directory always ends in '/'
+                    if (!directory.endsWith(File.separator)) {
+                        directory = directory + File.separator;
+                    }
+
+                    file = files[0].getName(); // pick any file
                 }
 
-                if (file != null) {
-                    // make sure directory always ends in '/'
-                    String parent = file.getParent();
-                    if (!parent.endsWith(File.separator)) {
-                        parent = parent + File.separator;
-                    }
-
-                    // store results back in component
-                    target.setDirectory(parent);
-                    target.setFile(file.getName());
-                } else {
-                    // setting file name to null is how we tell
-                    // java client that user hit the cancel button
-                    target.setFile(null);
-                }
+                // store results back in component
+                AWTAccessor.FileDialogAccessor accessor = AWTAccessor.getFileDialogAccessor();
+                accessor.setDirectory(target, directory);
+                accessor.setFile(target, file);
+                accessor.setFiles(target, files);
             } finally {
                 // Java2 Dialog waits for hide to let show() return
                 target.dispose();
@@ -133,8 +141,8 @@
         return ret;
     }
 
-    private native String nativeRunFileDialog(String title, int mode,
-            boolean shouldNavigateApps, boolean hasFilenameFilter,
+    private native String[] nativeRunFileDialog(String title, int mode,
+            boolean multipleMode, boolean shouldNavigateApps, boolean hasFilenameFilter,
             String directory, String file);
 
     @Override
--- a/src/macosx/classes/sun/lwawt/macosx/CPlatformEmbeddedFrame.java	Fri May 25 12:56:22 2012 +0400
+++ b/src/macosx/classes/sun/lwawt/macosx/CPlatformEmbeddedFrame.java	Fri May 25 19:34:32 2012 -0700
@@ -205,4 +205,7 @@
 
     @Override
     public void setWindowState(int windowState) {}
+
+    @Override
+    public void setModalBlocked(boolean blocked) {}
 }
--- a/src/macosx/classes/sun/lwawt/macosx/CPlatformResponder.java	Fri May 25 12:56:22 2012 +0400
+++ b/src/macosx/classes/sun/lwawt/macosx/CPlatformResponder.java	Fri May 25 19:34:32 2012 -0700
@@ -204,4 +204,8 @@
             }
         }
     }
+
+    void handleWindowFocusEvent(boolean gained) {
+        peer.notifyActivation(gained);
+    }
 }
--- a/src/macosx/classes/sun/lwawt/macosx/CPlatformView.java	Fri May 25 12:56:22 2012 +0400
+++ b/src/macosx/classes/sun/lwawt/macosx/CPlatformView.java	Fri May 25 19:34:32 2012 -0700
@@ -49,9 +49,9 @@
         super(0, true);
     }
 
-    public void initialize(LWWindowPeer peer) {
+    public void initialize(LWWindowPeer peer, CPlatformResponder responder) {
         this.peer = peer;
-        this.responder = new CPlatformResponder(peer, false);
+        this.responder = responder;
 
         if (!LWCToolkit.getSunAwtDisableCALayers()) {
             this.windowLayer = new CGLLayer(peer);
--- a/src/macosx/classes/sun/lwawt/macosx/CPlatformWindow.java	Fri May 25 12:56:22 2012 +0400
+++ b/src/macosx/classes/sun/lwawt/macosx/CPlatformWindow.java	Fri May 25 19:34:32 2012 -0700
@@ -61,6 +61,7 @@
     private static native void nativeSetNSWindowMinimizedIcon(long nsWindowPtr, long nsImage);
     private static native void nativeSetNSWindowRepresentedFilename(long nsWindowPtr, String representedFilename);
     private static native void nativeSetNSWindowSecurityWarningPositioning(long nsWindowPtr, double x, double y, float biasX, float biasY);
+    private static native void nativeSetEnabled(long nsWindowPtr, boolean isEnabled);
     private static native void nativeSynthesizeMouseEnteredExitedEvents(long nsWindowPtr);
 
     private static native int nativeGetScreenNSWindowIsOn_AppKitThread(long nsWindowPtr);
@@ -207,6 +208,7 @@
     private boolean visible = false; // visibility status from native perspective
     private boolean undecorated; // initialized in getInitialStyleBits()
     private Rectangle normalBounds = null; // not-null only for undecorated maximized windows
+    private CPlatformResponder responder;
 
     public CPlatformWindow(final PeerType peerType) {
         super(0, true);
@@ -231,8 +233,9 @@
         final long parentNSWindowPtr = (owner != null ? owner.getNSWindowPtr() : 0);
         String warningString = target.getWarningString();
 
+        responder = new CPlatformResponder(peer, false);
         contentView = new CPlatformView();
-        contentView.initialize(peer);
+        contentView.initialize(peer, responder);
 
         final long nativeWindowPtr = nativeCreateNSWindow(contentView.getAWTView(), styleBits, 0, 0, 0, 0);
         setPtr(nativeWindowPtr);
@@ -311,6 +314,10 @@
             styleBits = SET(styleBits, NONACTIVATING, true);
         }
 
+        if (Window.Type.UTILITY.equals(target.getType())) {
+            styleBits = SET(styleBits, UTILITY, true);
+        }
+
         if (target instanceof javax.swing.RootPaneContainer) {
             javax.swing.JRootPane rootpane = ((javax.swing.RootPaneContainer)target).getRootPane();
             Object prop = null;
@@ -800,6 +807,15 @@
         //       value when the native notification comes to us
     }
 
+    @Override
+    public void setModalBlocked(boolean blocked) {
+        if (target.getModalExclusionType() == Dialog.ModalExclusionType.APPLICATION_EXCLUDE) {
+            return;
+        }
+
+        nativeSetEnabled(getNSWindowPtr(), !blocked);
+    }
+
     // ----------------------------------------------------------------------
     //                          UTILITY METHODS
     // ----------------------------------------------------------------------
@@ -851,7 +867,7 @@
             focusLogger.fine("the app is inactive, so the notification is ignored");
             return;
         }
-        peer.notifyActivation(gained);
+        responder.handleWindowFocusEvent(gained);
     }
 
     private void deliverMoveResizeEvent(int x, int y, int width, int height) {
--- a/src/macosx/classes/sun/lwawt/macosx/CToolkitThreadBlockedHandler.java	Fri May 25 12:56:22 2012 +0400
+++ b/src/macosx/classes/sun/lwawt/macosx/CToolkitThreadBlockedHandler.java	Fri May 25 19:34:32 2012 -0700
@@ -27,9 +27,9 @@
 
 import sun.awt.datatransfer.ToolkitThreadBlockedHandler;
 
-// TODO:BG this class is really a NOOP right now, but should be filled in if needed.
+final class CToolkitThreadBlockedHandler implements ToolkitThreadBlockedHandler {
+    private final LWCToolkit toolkit = (LWCToolkit)java.awt.Toolkit.getDefaultToolkit();
 
-final class CToolkitThreadBlockedHandler implements ToolkitThreadBlockedHandler {
     public void lock() {
     }
 
@@ -41,9 +41,10 @@
     }
 
     public void enter() {
+        toolkit.startNativeNestedEventLoop();
     }
 
     public void exit() {
+        toolkit.stopNativeNestedEventLoop();
     }
-
 }
--- a/src/macosx/classes/sun/lwawt/macosx/LWCToolkit.java	Fri May 25 12:56:22 2012 +0400
+++ b/src/macosx/classes/sun/lwawt/macosx/LWCToolkit.java	Fri May 25 19:34:32 2012 -0700
@@ -63,6 +63,10 @@
 
     private static native void initIDs();
 
+    static native void startNativeNestedEventLoop();
+
+    static native void stopNativeNestedEventLoop();
+
     private static CInputMethodDescriptor sInputMethodDescriptor;
 
     static {
--- a/src/macosx/native/sun/awt/AWTView.m	Fri May 25 12:56:22 2012 +0400
+++ b/src/macosx/native/sun/awt/AWTView.m	Fri May 25 19:34:32 2012 -0700
@@ -48,7 +48,6 @@
 //#define IM_DEBUG TRUE
 //#define EXTRA_DEBUG
 
-
 static BOOL shouldUsePressAndHold() {
     static int shouldUsePressAndHold = -1;
     if (shouldUsePressAndHold != -1) return shouldUsePressAndHold;
@@ -81,7 +80,7 @@
     fEnablePressAndHold = shouldUsePressAndHold();
     fInPressAndHold = NO;
     fPAHNeedsToSelect = NO;
-    
+
     mouseIsOver = NO;
 
     if (windowLayer != nil) {
@@ -302,16 +301,25 @@
  */
 
 -(void) deliverJavaMouseEvent: (NSEvent *) event {
-    
-    NSEventType type = [event type];    
-    
+    BOOL isEnabled = YES;
+    NSWindow* window = [self window];
+    if ([window isKindOfClass: [AWTWindow_Panel class]] || [window isKindOfClass: [AWTWindow_Normal class]]) {
+        isEnabled = [(AWTWindow*)[window delegate] isEnabled];
+    }
+
+    if (!isEnabled) {
+        return;
+    }
+
+    NSEventType type = [event type];
+
     // check synthesized mouse entered/exited events
     if ((type == NSMouseEntered && mouseIsOver) || (type == NSMouseExited && !mouseIsOver)) {
         return;
     }else if ((type == NSMouseEntered && !mouseIsOver) || (type == NSMouseExited && mouseIsOver)) {
         mouseIsOver = !mouseIsOver;
     }
-    
+
     [AWTToolkit eventCountPlusPlus];
 
     JNIEnv *env = [ThreadUtilities getJNIEnv];
@@ -385,6 +393,14 @@
 }
 
 -(void) deliverJavaKeyEventHelper: (NSEvent *) event {
+    static NSEvent* sLastKeyEvent = nil;
+    if (event == sLastKeyEvent) {
+        // The event is repeatedly delivered by keyDown: after performKeyEquivalent:
+        return;
+    }
+    [sLastKeyEvent release];
+    sLastKeyEvent = [event retain];
+	
     [AWTToolkit eventCountPlusPlus];
     JNIEnv *env = [ThreadUtilities getJNIEnv];
 
--- a/src/macosx/native/sun/awt/AWTWindow.h	Fri May 25 12:56:22 2012 +0400
+++ b/src/macosx/native/sun/awt/AWTWindow.h	Fri May 25 19:34:32 2012 -0700
@@ -35,28 +35,53 @@
 
 @class AWTView;
 
-@interface AWTWindow : NSPanel <NSWindowDelegate> {
+@interface AWTWindow : NSObject <NSWindowDelegate> {
 @private
     JNFWeakJObjectWrapper *javaPlatformWindow;
     CMenuBar *javaMenuBar;
     NSSize javaMinSize;
     NSSize javaMaxSize;
     jint styleBits;
+    BOOL isEnabled;
 }
 
+// An instance of either AWTWindow_Normal or AWTWindow_Panel
+@property (nonatomic, retain) NSWindow *nsWindow;
+
 @property (nonatomic, retain) JNFWeakJObjectWrapper *javaPlatformWindow;
 @property (nonatomic, retain) CMenuBar *javaMenuBar;
 @property (nonatomic) NSSize javaMinSize;
 @property (nonatomic) NSSize javaMaxSize;
 @property (nonatomic) jint styleBits;
+@property (nonatomic) BOOL isEnabled;
 
 - (id) initWithPlatformWindow:(JNFWeakJObjectWrapper *)javaPlatformWindow
                     styleBits:(jint)styleBits
                     frameRect:(NSRect)frameRect
                   contentView:(NSView *)contentView;
 
-- (void) adjustGrowBoxWindow;
 - (BOOL) isTopmostWindowUnderMouse;
+
+// NSWindow overrides delegate methods
+- (BOOL) canBecomeKeyWindow;
+- (BOOL) canBecomeMainWindow;
+- (BOOL) worksWhenModal;
+- (void)sendEvent:(NSEvent *)event;
+
+@end
+
+@interface AWTWindow_Normal : NSWindow
+- (id) initWithDelegate:(AWTWindow *)delegate
+              frameRect:(NSRect)rect
+              styleMask:(NSUInteger)styleMask
+            contentView:(NSView *)view;
+@end
+
+@interface AWTWindow_Panel : NSPanel
+- (id) initWithDelegate:(AWTWindow *)delegate
+              frameRect:(NSRect)rect
+              styleMask:(NSUInteger)styleMask
+            contentView:(NSView *)view;
 @end
 
 #endif _AWTWINDOW_H
--- a/src/macosx/native/sun/awt/AWTWindow.m	Fri May 25 12:56:22 2012 +0400
+++ b/src/macosx/native/sun/awt/AWTWindow.m	Fri May 25 19:34:32 2012 -0700
@@ -51,22 +51,76 @@
 
 static JNF_CLASS_CACHE(jc_CPlatformWindow, "sun/lwawt/macosx/CPlatformWindow");
 
+// --------------------------------------------------------------
+// NSWindow/NSPanel descendants implementation
+#define AWT_NS_WINDOW_IMPLEMENTATION                            \
+- (id) initWithDelegate:(AWTWindow *)delegate                   \
+              frameRect:(NSRect)contectRect                     \
+              styleMask:(NSUInteger)styleMask                   \
+            contentView:(NSView *)view                          \
+{                                                               \
+    self = [super initWithContentRect:contectRect               \
+                            styleMask:styleMask                 \
+                              backing:NSBackingStoreBuffered    \
+                                defer:NO];                      \
+                                                                \
+    if (self == nil) return nil;                                \
+                                                                \
+    [self setDelegate:delegate];                                \
+    [self setContentView:view];                                 \
+    [self setInitialFirstResponder:view];                       \
+    [self setReleasedWhenClosed:NO];                            \
+    [self setPreservesContentDuringLiveResize:YES];             \
+                                                                \
+    return self;                                                \
+}                                                               \
+                                                                \
+/* NSWindow overrides */                                        \
+- (BOOL) canBecomeKeyWindow {                                   \
+    return [(AWTWindow*)[self delegate] canBecomeKeyWindow];    \
+}                                                               \
+                                                                \
+- (BOOL) canBecomeMainWindow {                                  \
+    return [(AWTWindow*)[self delegate] canBecomeMainWindow];   \
+}                                                               \
+                                                                \
+- (BOOL) worksWhenModal {                                       \
+    return [(AWTWindow*)[self delegate] worksWhenModal];        \
+}                                                               \
+                                                                \
+- (void)sendEvent:(NSEvent *)event {                            \
+    [(AWTWindow*)[self delegate] sendEvent:event];              \
+    [super sendEvent:event];                                    \
+}
+
+@implementation AWTWindow_Normal
+AWT_NS_WINDOW_IMPLEMENTATION
+@end
+@implementation AWTWindow_Panel
+AWT_NS_WINDOW_IMPLEMENTATION
+@end
+// END of NSWindow/NSPanel descendants implementation
+// --------------------------------------------------------------
+
+
 @implementation AWTWindow
 
+@synthesize nsWindow;
 @synthesize javaPlatformWindow;
 @synthesize javaMenuBar;
 @synthesize javaMinSize;
 @synthesize javaMaxSize;
 @synthesize styleBits;
+@synthesize isEnabled;
 
 - (void) updateMinMaxSize:(BOOL)resizable {
     if (resizable) {
-        [self setMinSize:self.javaMinSize];
-        [self setMaxSize:self.javaMaxSize];
+        [self.nsWindow setMinSize:self.javaMinSize];
+        [self.nsWindow setMaxSize:self.javaMaxSize];
     } else {
-        NSRect currentFrame = [self frame];
-        [self setMinSize:currentFrame.size];
-        [self setMaxSize:currentFrame.size];
+        NSRect currentFrame = [self.nsWindow frame];
+        [self.nsWindow setMinSize:currentFrame.size];
+        [self.nsWindow setMaxSize:currentFrame.size];
     }
 }
 
@@ -97,38 +151,38 @@
     if (IS(mask, RESIZABLE)) {
         BOOL resizable = IS(bits, RESIZABLE);
         [self updateMinMaxSize:resizable];
-        [self setShowsResizeIndicator:resizable];
+        [self.nsWindow setShowsResizeIndicator:resizable];
     }
 
     if (IS(mask, HAS_SHADOW)) {
-        [self setHasShadow:IS(bits, HAS_SHADOW)];
+        [self.nsWindow setHasShadow:IS(bits, HAS_SHADOW)];
     }
 
     if (IS(mask, ZOOMABLE)) {
-        [[self standardWindowButton:NSWindowZoomButton] setEnabled:IS(bits, ZOOMABLE)];
+        [[self.nsWindow standardWindowButton:NSWindowZoomButton] setEnabled:IS(bits, ZOOMABLE)];
     }
 
     if (IS(mask, ALWAYS_ON_TOP)) {
-        [self setLevel:IS(bits, ALWAYS_ON_TOP) ? NSFloatingWindowLevel : NSNormalWindowLevel];
+        [self.nsWindow setLevel:IS(bits, ALWAYS_ON_TOP) ? NSFloatingWindowLevel : NSNormalWindowLevel];
     }
 
     if (IS(mask, HIDES_ON_DEACTIVATE)) {
-        [self setHidesOnDeactivate:IS(bits, HIDES_ON_DEACTIVATE)];
+        [self.nsWindow setHidesOnDeactivate:IS(bits, HIDES_ON_DEACTIVATE)];
     }
 
     if (IS(mask, DRAGGABLE_BACKGROUND)) {
-        [self setMovableByWindowBackground:IS(bits, DRAGGABLE_BACKGROUND)];
+        [self.nsWindow setMovableByWindowBackground:IS(bits, DRAGGABLE_BACKGROUND)];
     }
 
     if (IS(mask, DOCUMENT_MODIFIED)) {
-        [self setDocumentEdited:IS(bits, DOCUMENT_MODIFIED)];
+        [self.nsWindow setDocumentEdited:IS(bits, DOCUMENT_MODIFIED)];
     }
 
-    if ([self respondsToSelector:@selector(toggleFullScreen:)]) {
+    if ([self.nsWindow respondsToSelector:@selector(toggleFullScreen:)]) {
         if (IS(mask, FULLSCREENABLE)) {
-            [self setCollectionBehavior:(1 << 7) /*NSWindowCollectionBehaviorFullScreenPrimary*/];
+            [self.nsWindow setCollectionBehavior:(1 << 7) /*NSWindowCollectionBehaviorFullScreenPrimary*/];
         } else {
-            [self setCollectionBehavior:NSWindowCollectionBehaviorDefault];
+            [self.nsWindow setCollectionBehavior:NSWindowCollectionBehaviorDefault];
         }
     }
 
@@ -150,42 +204,55 @@
         contentRect.size.height = 1.0;
     }
 
-    self = [super initWithContentRect:contentRect
-                            styleMask:styleMask
-                              backing:NSBackingStoreBuffered
-                                defer:NO];
+    self = [super init];
 
     if (self == nil) return nil; // no hope
 
+    if (IS(bits, UTILITY) ||
+        IS(bits, NONACTIVATING) ||
+        IS(bits, HUD) ||
+        IS(bits, HIDES_ON_DEACTIVATE))
+    {
+        self.nsWindow = [[AWTWindow_Panel alloc] initWithDelegate:self
+                            frameRect:contentRect
+                            styleMask:styleMask
+                          contentView:view];
+    }
+    else
+    {
+        // These windows will appear in the window list in the dock icon menu
+        self.nsWindow = [[AWTWindow_Normal alloc] initWithDelegate:self
+                            frameRect:contentRect
+                            styleMask:styleMask
+                          contentView:view];
+    }
+
+    if (self.nsWindow == nil) return nil; // no hope either
+
+    self.isEnabled = YES;
     self.javaPlatformWindow = platformWindow;
     self.styleBits = bits;
     [self setPropertiesForStyleBits:styleBits mask:MASK(_METHOD_PROP_BITMASK)];
 
-    [self setDelegate:self];
-    [self setContentView:view];
-    [self setInitialFirstResponder:view];
-    [self setReleasedWhenClosed:NO];
-    [self setPreservesContentDuringLiveResize:YES];
-
     return self;
 }
 
-// checks that this window is under the mouse cursor and this point is not overlapped by others windows 
+// checks that this window is under the mouse cursor and this point is not overlapped by others windows
 - (BOOL) isTopmostWindowUnderMouse {
-    
-    int currentWinID = [self windowNumber]; 
-    
-    NSRect screenRect = [[NSScreen mainScreen] frame];    
+
+    int currentWinID = [self.nsWindow windowNumber];
+
+    NSRect screenRect = [[NSScreen mainScreen] frame];
     NSPoint nsMouseLocation = [NSEvent mouseLocation];
-    CGPoint cgMouseLocation = CGPointMake(nsMouseLocation.x, screenRect.size.height - nsMouseLocation.y);    
-    
+    CGPoint cgMouseLocation = CGPointMake(nsMouseLocation.x, screenRect.size.height - nsMouseLocation.y);
+
     NSMutableArray *windows = (NSMutableArray *)CGWindowListCopyWindowInfo(kCGWindowListOptionOnScreenOnly | kCGWindowListExcludeDesktopElements, kCGNullWindowID);
-    
-    
+
+
     for (NSDictionary *window in windows) {
         int layer = [[window objectForKey:(id)kCGWindowLayer] intValue];
         if (layer == 0) {
-            int winID = [[window objectForKey:(id)kCGWindowNumber] intValue];            
+            int winID = [[window objectForKey:(id)kCGWindowNumber] intValue];
             CGRect rect;
             CGRectMakeWithDictionaryRepresentation((CFDictionaryRef)[window objectForKey:(id)kCGWindowBounds], &rect);
             if (CGRectContainsPoint(rect, cgMouseLocation)) {
@@ -199,35 +266,35 @@
 }
 
 - (void) synthesizeMouseEnteredExitedEvents {
-    
+
     int eventType = 0;
     BOOL isUnderMouse = [self isTopmostWindowUnderMouse];
-    BOOL mouseIsOver = [[self contentView] mouseIsOver];
-    
+    BOOL mouseIsOver = [[self.nsWindow contentView] mouseIsOver];
+
     if (isUnderMouse && !mouseIsOver) {
         eventType = NSMouseEntered;
     } else if (!isUnderMouse && mouseIsOver) {
-        eventType = NSMouseExited;        
+        eventType = NSMouseExited;
     } else {
         return;
     }
-    
-    NSPoint screenLocation = [NSEvent mouseLocation];        
-    NSPoint windowLocation = [self convertScreenToBase: screenLocation];        
+
+    NSPoint screenLocation = [NSEvent mouseLocation];
+    NSPoint windowLocation = [self.nsWindow convertScreenToBase: screenLocation];
     int modifierFlags = (eventType == NSMouseEntered) ? NSMouseEnteredMask : NSMouseExitedMask;
-    
+
     NSEvent *mouseEvent = [NSEvent enterExitEventWithType: eventType
                                                   location: windowLocation
                                              modifierFlags: modifierFlags
                                                  timestamp: 0
-                                              windowNumber: [self windowNumber]
+                                              windowNumber: [self.nsWindow windowNumber]
                                                    context: nil
                                                eventNumber: 0
                                             trackingNumber: 0
                                                   userData: nil
                             ];
-    
-    [[self contentView] deliverJavaMouseEvent: mouseEvent];
+
+    [[self.nsWindow contentView] deliverJavaMouseEvent: mouseEvent];
 }
 
 - (void) dealloc {
@@ -236,19 +303,20 @@
     JNIEnv *env = [ThreadUtilities getJNIEnv];
     [self.javaPlatformWindow setJObject:nil withEnv:env];
 
+    self.nsWindow = nil;
+
     [super dealloc];
 }
 
-
 // NSWindow overrides
 - (BOOL) canBecomeKeyWindow {
 AWT_ASSERT_APPKIT_THREAD;
-    return IS(self.styleBits, SHOULD_BECOME_KEY);
+    return self.isEnabled && IS(self.styleBits, SHOULD_BECOME_KEY);
 }
 
 - (BOOL) canBecomeMainWindow {
 AWT_ASSERT_APPKIT_THREAD;
-    return IS(self.styleBits, SHOULD_BECOME_MAIN);
+    return self.isEnabled && IS(self.styleBits, SHOULD_BECOME_MAIN);
 }
 
 - (BOOL) worksWhenModal {
@@ -270,7 +338,7 @@
         if (awtWindow != NULL) {
             // translate the point into Java coordinates
             NSPoint loc = [event locationInWindow];
-            loc.y = [self frame].size.height - loc.y;
+            loc.y = [self.nsWindow frame].size.height - loc.y;
 
             // send up to the GestureHandler to recursively dispatch on the AWT event thread
             static JNF_CLASS_CACHE(jc_GestureHandler, "com/apple/eawt/event/GestureHandler");
@@ -333,7 +401,7 @@
         // TODO: create generic AWT assert
     }
 
-    NSRect frame = ConvertNSScreenRect(env, [self frame]);
+    NSRect frame = ConvertNSScreenRect(env, [self.nsWindow frame]);
 
     static JNF_MEMBER_CACHE(jm_deliverMoveResizeEvent, jc_CPlatformWindow, "deliverMoveResizeEvent", "(IIII)V");
     JNFCallVoidMethod(env, platformWindow, jm_deliverMoveResizeEvent,
@@ -523,8 +591,8 @@
         if ([event type] == NSLeftMouseDown || [event type] == NSRightMouseDown || [event type] == NSOtherMouseDown) {
 
             NSPoint p = [NSEvent mouseLocation];
-            NSRect frame = [self frame];
-            NSRect contentRect = [self contentRectForFrameRect:frame];
+            NSRect frame = [self.nsWindow frame];
+            NSRect contentRect = [self.nsWindow contentRectForFrameRect:frame];
 
             // Check if the click happened in the non-client area (title bar)
             if (p.y >= (frame.origin.y + contentRect.size.height)) {
@@ -535,15 +603,14 @@
                 JNFCallVoidMethod(env, platformWindow, jm_deliverNCMouseDown);
             }
         }
-        [super sendEvent:event];
 }
 
 - (void)constrainSize:(NSSize*)size {
     float minWidth = 0.f, minHeight = 0.f;
 
     if (IS(self.styleBits, DECORATED)) {
-        NSRect frame = [self frame];
-        NSRect contentRect = [NSWindow contentRectForFrameRect:frame styleMask:[self styleMask]];
+        NSRect frame = [self.nsWindow frame];
+        NSRect contentRect = [NSWindow contentRectForFrameRect:frame styleMask:[self.nsWindow styleMask]];
 
         float top = frame.size.height - contentRect.size.height;
         float left = contentRect.origin.x - frame.origin.x;
@@ -562,6 +629,27 @@
     size->height = MAX(size->height, minHeight);
 }
 
+- (void) setEnabled: (BOOL)flag {
+    self.isEnabled = flag;
+
+    if (IS(self.styleBits, CLOSEABLE)) {
+        [[self.nsWindow standardWindowButton:NSWindowCloseButton] setEnabled: flag];
+    }
+
+    if (IS(self.styleBits, MINIMIZABLE)) {
+        [[self.nsWindow standardWindowButton:NSWindowMiniaturizeButton] setEnabled: flag];
+    }
+
+    if (IS(self.styleBits, ZOOMABLE)) {
+        [[self.nsWindow standardWindowButton:NSWindowZoomButton] setEnabled: flag];
+    }
+
+    if (IS(self.styleBits, RESIZABLE)) {
+        [self updateMinMaxSize:flag];
+        [self.nsWindow setShowsResizeIndicator:flag];
+    }
+}
+
 @end // AWTWindow
 
 
@@ -596,7 +684,7 @@
 
 JNF_COCOA_EXIT(env);
 
-    return ptr_to_jlong(window);
+    return ptr_to_jlong(window ? window.nsWindow : nil);
 }
 
 /*
@@ -610,17 +698,19 @@
 JNF_COCOA_ENTER(env);
 AWT_ASSERT_NOT_APPKIT_THREAD;
 
-    AWTWindow *window = OBJC(windowPtr);
+    NSWindow *nsWindow = OBJC(windowPtr);
     [JNFRunLoop performOnMainThreadWaiting:NO withBlock:^(){
         AWT_ASSERT_APPKIT_THREAD;
 
+        AWTWindow *window = (AWTWindow*)[nsWindow delegate];
+
         // scans the bit field, and only updates the values requested by the mask
         // (this implicity handles the _CALLBACK_PROP_BITMASK case, since those are passive reads)
         jint newBits = window.styleBits & ~mask | bits & mask;
 
         // resets the NSWindow's style mask if the mask intersects any of those bits
         if (mask & MASK(_STYLE_PROP_BITMASK)) {
-            [window setStyleMask:[AWTWindow styleMaskForStyleBits:newBits]];
+            [nsWindow setStyleMask:[AWTWindow styleMaskForStyleBits:newBits]];
         }
 
         // calls methods on NSWindow to change other properties, based on the mask
@@ -645,12 +735,14 @@
 JNF_COCOA_ENTER(env);
 AWT_ASSERT_NOT_APPKIT_THREAD;
 
-    AWTWindow *window = OBJC(windowPtr);
+    NSWindow *nsWindow = OBJC(windowPtr);
     CMenuBar *menuBar = OBJC(menuBarPtr);
     [JNFRunLoop performOnMainThreadWaiting:NO withBlock:^(){
         AWT_ASSERT_APPKIT_THREAD;
 
-        if ([window isKeyWindow]) [window.javaMenuBar deactivate];
+        AWTWindow *window = (AWTWindow*)[nsWindow delegate];
+
+        if ([nsWindow isKeyWindow]) [window.javaMenuBar deactivate];
         window.javaMenuBar = menuBar;
 
         // if ([self isKeyWindow]) {
@@ -674,15 +766,15 @@
 JNF_COCOA_ENTER(env);
 AWT_ASSERT_NOT_APPKIT_THREAD;
 
-    AWTWindow *window = OBJC(windowPtr);
+    NSWindow *nsWindow = OBJC(windowPtr);
     __block NSRect contentRect = NSZeroRect;
     __block NSRect frame = NSZeroRect;
 
     [JNFRunLoop performOnMainThreadWaiting:YES withBlock:^(){
         AWT_ASSERT_APPKIT_THREAD;
 
-        frame = [window frame];
-        contentRect = [NSWindow contentRectForFrameRect:frame styleMask:[window styleMask]];
+        frame = [nsWindow frame];
+        contentRect = [NSWindow contentRectForFrameRect:frame styleMask:[nsWindow styleMask]];
     }];
 
     jint top = (jint)(frame.size.height - contentRect.size.height);
@@ -712,24 +804,26 @@
     NSRect jrect = NSMakeRect(originX, originY, width, height);
 
     // TODO: not sure we need displayIfNeeded message in our view
-    AWTWindow *window = OBJC(windowPtr);
+    NSWindow *nsWindow = OBJC(windowPtr);
     [JNFRunLoop performOnMainThreadWaiting:NO withBlock:^(){
         AWT_ASSERT_APPKIT_THREAD;
 
+        AWTWindow *window = (AWTWindow*)[nsWindow delegate];
+
         NSRect rect = ConvertNSScreenRect(NULL, jrect);
         [window constrainSize:&rect.size];
 
-        [window setFrame:rect display:YES];
+        [nsWindow setFrame:rect display:YES];
 
         // only start tracking events if pointer is above the toplevel
         // TODO: should post an Entered event if YES.
         NSPoint mLocation = [NSEvent mouseLocation];
-        [window setAcceptsMouseMovedEvents:NSPointInRect(mLocation, rect)];
+        [nsWindow setAcceptsMouseMovedEvents:NSPointInRect(mLocation, rect)];
 
         // ensure we repaint the whole window after the resize operation
         // (this will also re-enable screen updates, which were disabled above)
         // TODO: send PaintEvent
-        
+
         [window synthesizeMouseEnteredExitedEvents];
     }];
 
@@ -752,10 +846,12 @@
     if (maxW < 1) maxW = 1;
     if (maxH < 1) maxH = 1;
 
-    AWTWindow *window = OBJC(windowPtr);
+    NSWindow *nsWindow = OBJC(windowPtr);
     [JNFRunLoop performOnMainThreadWaiting:NO withBlock:^(){
         AWT_ASSERT_APPKIT_THREAD;
 
+        AWTWindow *window = (AWTWindow*)[nsWindow delegate];
+
         NSSize min = { minW, minH };
         NSSize max = { maxW, maxH };
 
@@ -781,11 +877,11 @@
 JNF_COCOA_ENTER(env);
 AWT_ASSERT_NOT_APPKIT_THREAD;
 
-    AWTWindow *window = OBJC(windowPtr);
+    NSWindow *nsWindow = OBJC(windowPtr);
     [JNFRunLoop performOnMainThreadWaiting:NO withBlock:^(){
         AWT_ASSERT_APPKIT_THREAD;
 
-        [window orderBack:nil];
+        [nsWindow orderBack:nil];
     }];
 
 JNF_COCOA_EXIT(env);
@@ -802,14 +898,14 @@
 JNF_COCOA_ENTER(env);
 AWT_ASSERT_NOT_APPKIT_THREAD;
 
-    AWTWindow *window = OBJC(windowPtr);
+    NSWindow *nsWindow = OBJC(windowPtr);
     [JNFRunLoop performOnMainThreadWaiting:NO withBlock:^(){
         AWT_ASSERT_APPKIT_THREAD;
 
-        if (![window isKeyWindow]) {
-            [window makeKeyAndOrderFront:window];
+        if (![nsWindow isKeyWindow]) {
+            [nsWindow makeKeyAndOrderFront:nsWindow];
         } else {
-            [window orderFront:window];
+            [nsWindow orderFront:nsWindow];
         }
     }];
 
@@ -827,8 +923,8 @@
 JNF_COCOA_ENTER(env);
 AWT_ASSERT_NOT_APPKIT_THREAD;
 
-    AWTWindow *window = OBJC(windowPtr);
-    [window performSelectorOnMainThread:@selector(setTitle:)
+    NSWindow *nsWindow = OBJC(windowPtr);
+    [nsWindow performSelectorOnMainThread:@selector(setTitle:)
                               withObject:JNFJavaToNSString(env, jtitle)
                            waitUntilDone:NO];
 
@@ -846,11 +942,11 @@
 JNF_COCOA_ENTER(env);
 AWT_ASSERT_NOT_APPKIT_THREAD;
 
-    AWTWindow *window = OBJC(windowPtr);
+    NSWindow *nsWindow = OBJC(windowPtr);
     [JNFRunLoop performOnMainThreadWaiting:NO withBlock:^(){
         AWT_ASSERT_APPKIT_THREAD;
 
-        [window setAlphaValue:alpha];
+        [nsWindow setAlphaValue:alpha];
     }];
 
 JNF_COCOA_EXIT(env);
@@ -867,11 +963,11 @@
 JNF_COCOA_ENTER(env);
 AWT_ASSERT_NOT_APPKIT_THREAD;
 
-    AWTWindow *window = OBJC(windowPtr);
+    NSWindow *nsWindow = OBJC(windowPtr);
     [JNFRunLoop performOnMainThreadWaiting:NO withBlock:^(){
         AWT_ASSERT_APPKIT_THREAD;
 
-        [window invalidateShadow];
+        [nsWindow invalidateShadow];
     }];
 
 JNF_COCOA_EXIT(env);
@@ -890,8 +986,8 @@
 JNF_COCOA_ENTER(env);
 AWT_ASSERT_APPKIT_THREAD;
 
-    AWTWindow *window = OBJC(windowPtr);
-    NSDictionary *props = [[window screen] deviceDescription];
+    NSWindow *nsWindow = OBJC(windowPtr);
+    NSDictionary *props = [[nsWindow screen] deviceDescription];
     ret = [[props objectForKey:@"NSScreenNumber"] intValue];
 
 JNF_COCOA_EXIT(env);
@@ -910,12 +1006,12 @@
 JNF_COCOA_ENTER(env);
 AWT_ASSERT_NOT_APPKIT_THREAD;
 
-    AWTWindow *window = OBJC(windowPtr);
+    NSWindow *nsWindow = OBJC(windowPtr);
     NSImage *image = OBJC(nsImagePtr);
     [JNFRunLoop performOnMainThreadWaiting:NO withBlock:^(){
         AWT_ASSERT_APPKIT_THREAD;
 
-        [window setMiniwindowImage:image];
+        [nsWindow setMiniwindowImage:image];
     }];
 
 JNF_COCOA_EXIT(env);
@@ -932,12 +1028,12 @@
 JNF_COCOA_ENTER(env);
 AWT_ASSERT_NOT_APPKIT_THREAD;
 
-    AWTWindow *window = OBJC(windowPtr);
+    NSWindow *nsWindow = OBJC(windowPtr);
     NSURL *url = (filename == NULL) ? nil : [NSURL fileURLWithPath:JNFNormalizedNSStringForPath(env, filename)];
     [JNFRunLoop performOnMainThreadWaiting:NO withBlock:^(){
         AWT_ASSERT_APPKIT_THREAD;
 
-        [window setRepresentedURL:url];
+        [nsWindow setRepresentedURL:url];
     }];
 
 JNF_COCOA_EXIT(env);
@@ -969,14 +1065,16 @@
 {
     JNF_COCOA_ENTER(env);
     AWT_ASSERT_NOT_APPKIT_THREAD;
-    
-    AWTWindow *window = OBJC(windowPtr);
+
+    NSWindow *nsWindow = OBJC(windowPtr);
     [JNFRunLoop performOnMainThreadWaiting:NO withBlock:^(){
         AWT_ASSERT_APPKIT_THREAD;
-        
+
+        AWTWindow *window = (AWTWindow*)[nsWindow delegate];
+
         [window synthesizeMouseEnteredExitedEvents];
     }];
-    
+
     JNF_COCOA_EXIT(env);
 }
 
@@ -993,8 +1091,8 @@
 JNF_COCOA_ENTER(env);
 AWT_ASSERT_APPKIT_THREAD;
 
-    AWTWindow *window = OBJC(windowPtr);
-    NSScreen* screen = [window screen];
+    NSWindow *nsWindow = OBJC(windowPtr);
+    NSScreen* screen = [nsWindow screen];
 
     //+++gdb NOTE: This is using a linear search of the screens. If it should
     //  prove to be a bottleneck, this can definitely be improved. However,
@@ -1025,12 +1123,12 @@
 {
 JNF_COCOA_ENTER(env);
 
-    AWTWindow *window = OBJC(windowPtr);
+    NSWindow *nsWindow = OBJC(windowPtr);
     SEL toggleFullScreenSelector = @selector(toggleFullScreen:);
-    if (![window respondsToSelector:toggleFullScreenSelector]) return;
+    if (![nsWindow respondsToSelector:toggleFullScreenSelector]) return;
 
     [JNFRunLoop performOnMainThreadWaiting:NO withBlock:^(){
-        [window performSelector:toggleFullScreenSelector withObject:nil];
+        [nsWindow performSelector:toggleFullScreenSelector withObject:nil];
     }];
 
 JNF_COCOA_EXIT(env);
@@ -1044,15 +1142,31 @@
 JNF_COCOA_ENTER(env);
 AWT_ASSERT_NOT_APPKIT_THREAD;
 
-    AWTWindow *aWindow = OBJC(windowPtr);
+    NSWindow *nsWindow = OBJC(windowPtr);
     [JNFRunLoop performOnMainThreadWaiting:YES withBlock:^() {
         AWT_ASSERT_APPKIT_THREAD;
 
-        NSPoint pt = [aWindow mouseLocationOutsideOfEventStream];
-        underMouse = [[aWindow contentView] hitTest:pt] != nil;
+        NSPoint pt = [nsWindow mouseLocationOutsideOfEventStream];
+        underMouse = [[nsWindow contentView] hitTest:pt] != nil;
     }];
 
 JNF_COCOA_EXIT(env);
 
     return underMouse;
 }
+
+JNIEXPORT void JNICALL Java_sun_lwawt_macosx_CPlatformWindow_nativeSetEnabled
+(JNIEnv *env, jclass clazz, jlong windowPtr, jboolean isEnabled)
+{
+JNF_COCOA_ENTER(env);
+
+    NSWindow *nsWindow = OBJC(windowPtr);
+    [JNFRunLoop performOnMainThreadWaiting:NO withBlock:^(){
+        AWTWindow *window = (AWTWindow*)[nsWindow delegate];
+
+        [window setEnabled: isEnabled];
+    }];
+
+JNF_COCOA_EXIT(env);
+}
+
--- a/src/macosx/native/sun/awt/CFileDialog.h	Fri May 25 12:56:22 2012 +0400
+++ b/src/macosx/native/sun/awt/CFileDialog.h	Fri May 25 19:34:32 2012 -0700
@@ -46,11 +46,14 @@
     // File dialog's mode
     jint fMode;
 
+    // Indicates whether the user can select multiple files
+    BOOL fMultipleMode;
+
     // Should we navigate into apps?
     BOOL fNavigateApps;
 
-    // panel's filename
-    NSString *fReturnedFilename;
+    // Contains the absolute paths of the selected files as URLs
+    NSArray *fURLs;
 }
 
 // Allocator
@@ -60,6 +63,7 @@
             directory:(NSString *)inPath
                  file:(NSString *)inFile
                  mode:(jint)inMode
+         multipleMode:(BOOL)inMultipleMode
        shouldNavigate:(BOOL)inNavigateApps
               withEnv:(JNIEnv*)env;
 
@@ -69,7 +73,7 @@
 // Get dialog return value
 - (BOOL) userClickedOK;
 
-// Filename user chose
-- (NSString *) filename;
+// Returns the absolute paths of the selected files as URLs
+- (NSArray *) URLs;
 
 @end
--- a/src/macosx/native/sun/awt/CFileDialog.m	Fri May 25 12:56:22 2012 +0400
+++ b/src/macosx/native/sun/awt/CFileDialog.m	Fri May 25 19:34:32 2012 -0700
@@ -41,6 +41,7 @@
            directory:(NSString *)inPath
                 file:(NSString *)inFile
                 mode:(jint)inMode
+        multipleMode:(BOOL)inMultipleMode
       shouldNavigate:(BOOL)inNavigateApps
              withEnv:(JNIEnv*)env;
 {
@@ -54,6 +55,7 @@
         fTitle = inTitle;
         [fTitle retain];
         fMode = inMode;
+        fMultipleMode = inMultipleMode;
         fNavigateApps = inNavigateApps;
         fPanelResult = NSCancelButton;
     }
@@ -79,8 +81,8 @@
     [fTitle release];
     fTitle = nil;
 
-    [fReturnedFilename release];
-    fReturnedFilename = nil;
+    [fURLs release];
+    fURLs = nil;
 
     [super dealloc];
 }
@@ -105,7 +107,7 @@
 
         if (fMode == java_awt_FileDialog_LOAD) {
             NSOpenPanel *openPanel = (NSOpenPanel *)thePanel;
-            [openPanel setAllowsMultipleSelection:NO];
+            [openPanel setAllowsMultipleSelection:fMultipleMode];
             [openPanel setCanChooseFiles:YES];
             [openPanel setCanChooseDirectories:NO];
             [openPanel setCanCreateDirectories:YES];
@@ -114,8 +116,16 @@
         [thePanel setDelegate:self];
         fPanelResult = [thePanel runModalForDirectory:fDirectory file:fFile];
         [thePanel setDelegate:nil];
-        fReturnedFilename = [thePanel filename];
-        [fReturnedFilename retain];
+
+        if ([self userClickedOK]) {
+            if (fMode == java_awt_FileDialog_LOAD) {
+                NSOpenPanel *openPanel = (NSOpenPanel *)thePanel;
+                fURLs = [openPanel URLs];
+            } else {
+                fURLs = [NSArray arrayWithObject:[thePanel URL]];
+            }
+            [fURLs retain];
+        }
     }
 
     [self disposer];
@@ -158,8 +168,8 @@
     return fPanelResult == NSOKButton;
 }
 
-- (NSString *)filename {
-    return [[fReturnedFilename retain] autorelease];
+- (NSArray *)URLs {
+    return [[fURLs retain] autorelease];
 }
 @end
 
@@ -167,13 +177,14 @@
  * Class:     sun_lwawt_macosx_CFileDialog
  * Method:    nativeRunFileDialog
  * Signature: (Ljava/lang/String;ILjava/io/FilenameFilter;
- *             Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;
+ *             Ljava/lang/String;Ljava/lang/String;)[Ljava/lang/String;
  */
-JNIEXPORT jstring JNICALL
+JNIEXPORT jobjectArray JNICALL
 Java_sun_lwawt_macosx_CFileDialog_nativeRunFileDialog
-(JNIEnv *env, jobject peer, jstring title, jint mode, jboolean navigateApps, jboolean hasFilter, jstring directory, jstring file)
+(JNIEnv *env, jobject peer, jstring title, jint mode, jboolean multipleMode,
+ jboolean navigateApps, jboolean hasFilter, jstring directory, jstring file)
 {
-    jstring returnValue = NULL;
+    jobjectArray returnValue = NULL;
 
 JNF_COCOA_ENTER(env);
     NSString *dialogTitle = JNFJavaToNSString(env, title);
@@ -187,6 +198,7 @@
                                                             directory:JNFJavaToNSString(env, directory)
                                                                  file:JNFJavaToNSString(env, file)
                                                                  mode:mode
+                                                         multipleMode:multipleMode
                                                        shouldNavigate:navigateApps
                                                               withEnv:env];
 
@@ -196,8 +208,18 @@
                       waitUntilDone:YES];
 
     if ([dialogDelegate userClickedOK]) {
-        NSString *filename = [dialogDelegate filename];
-        returnValue = JNFNSToJavaString(env, filename);
+        NSArray *urls = [dialogDelegate URLs];
+        jsize count = [urls count];
+
+        jclass stringClass = (*env)->FindClass(env, "java/lang/String");
+        returnValue = (*env)->NewObjectArray(env, count, stringClass, NULL);
+        (*env)->DeleteLocalRef(env, stringClass);
+
+        [urls enumerateObjectsUsingBlock:^(id url, NSUInteger index, BOOL *stop) {
+            jstring filename = JNFNormalizedJavaStringForPath(env, [url path]);
+            (*env)->SetObjectArrayElement(env, returnValue, index, filename);
+            (*env)->DeleteLocalRef(env, filename);
+        }];
     }
 
     [dialogDelegate release];
--- a/src/macosx/native/sun/awt/CImage.m	Fri May 25 12:56:22 2012 +0400
+++ b/src/macosx/native/sun/awt/CImage.m	Fri May 25 19:34:32 2012 -0700
@@ -163,7 +163,6 @@
     if ([reps count]) {
         NSImage *nsImage = [[NSImage alloc] initWithSize:NSMakeSize(0, 0)];
         [nsImage addRepresentations: reps];
-        [reps release];
 
         if (nsImage != nil) {
             CFRetain(nsImage); // GC
--- a/src/macosx/native/sun/awt/LWCToolkit.m	Fri May 25 12:56:22 2012 +0400
+++ b/src/macosx/native/sun/awt/LWCToolkit.m	Fri May 25 19:34:32 2012 -0700
@@ -42,6 +42,7 @@
 @implementation AWTToolkit
 
 static long eventCount;
+static bool shouldKeepRunningNestedLoop = NO;
 
 + (long) getEventCount{
     return eventCount;
@@ -456,3 +457,36 @@
 {
 
 }
+
+/*
+ * Class:     sun_lwawt_macosx_LWCToolkit
+ * Method:    startNativeNestedEventLoop
+ * Signature: ()V
+ */
+JNIEXPORT void JNICALL Java_sun_lwawt_macosx_LWCToolkit_startNativeNestedEventLoop
+(JNIEnv *env, jclass cls)
+{
+    if(!shouldKeepRunningNestedLoop) {
+        NSRunLoop *theRL = [NSRunLoop currentRunLoop];
+        NSApplication * app = [NSApplication sharedApplication];
+        shouldKeepRunningNestedLoop = YES;
+        while (shouldKeepRunningNestedLoop && [theRL runMode:NSDefaultRunLoopMode beforeDate:[NSDate distantFuture]])
+        {
+            NSEvent * event = [app nextEventMatchingMask: 0xFFFFFFFF untilDate:nil inMode:NSDefaultRunLoopMode dequeue:YES];
+            if (event != nil) {
+                [app sendEvent: event];
+            }
+        }
+    }
+}
+
+/*
+ * Class:     sun_lwawt_macosx_LWCToolkit
+ * Method:    stopNativeNestedEventLoop
+ * Signature: ()V
+ */
+JNIEXPORT void JNICALL Java_sun_lwawt_macosx_LWCToolkit_stopNativeNestedEventLoop
+(JNIEnv *env, jclass cls)
+{
+    shouldKeepRunningNestedLoop = NO;
+}
--- a/src/macosx/native/sun/java2d/opengl/CGLSurfaceData.m	Fri May 25 12:56:22 2012 +0400
+++ b/src/macosx/native/sun/java2d/opengl/CGLSurfaceData.m	Fri May 25 19:34:32 2012 -0700
@@ -204,7 +204,8 @@
         if (!CGLSD_MakeCurrentToScratch(env, oglc)) {
             return NULL;
         }
-    } else if ([NSOpenGLContext currentContext] == nil) {
+    // make sure our context is current
+    } else if ([NSOpenGLContext currentContext] != ctxinfo->context) {
         [ctxinfo->context makeCurrentContext];
     }
 
--- a/src/share/classes/com/sun/crypto/provider/HmacCore.java	Fri May 25 12:56:22 2012 +0400
+++ b/src/share/classes/com/sun/crypto/provider/HmacCore.java	Fri May 25 19:34:32 2012 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2002, 2011, 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
@@ -38,16 +38,16 @@
  * This class constitutes the core of HMAC-<MD> algorithms, where
  * <MD> can be SHA1 or MD5, etc. See RFC 2104 for spec.
  *
- * It also contains the implementation classes for the SHA-256,
+ * It also contains the implementation classes for SHA-224, SHA-256,
  * SHA-384, and SHA-512 HMACs.
  *
  * @author Jan Luehe
  */
-final class HmacCore implements Cloneable {
+abstract class HmacCore extends MacSpi implements Cloneable {
 
-    private final MessageDigest md;
-    private final byte[] k_ipad; // inner padding - key XORd with ipad
-    private final byte[] k_opad; // outer padding - key XORd with opad
+    private MessageDigest md;
+    private byte[] k_ipad; // inner padding - key XORd with ipad
+    private byte[] k_opad; // outer padding - key XORd with opad
     private boolean first;       // Is this the first data to be processed?
 
     private final int blockLen;
@@ -73,22 +73,11 @@
     }
 
     /**
-     * Constructor used for cloning.
-     */
-    private HmacCore(HmacCore other) throws CloneNotSupportedException {
-        this.md = (MessageDigest)other.md.clone();
-        this.blockLen = other.blockLen;
-        this.k_ipad = other.k_ipad.clone();
-        this.k_opad = other.k_opad.clone();
-        this.first = other.first;
-    }
-
-    /**
      * Returns the length of the HMAC in bytes.
      *
      * @return the HMAC length in bytes.
      */
-    int getDigestLength() {
+    protected int engineGetMacLength() {
         return this.md.getDigestLength();
     }
 
@@ -103,9 +92,8 @@
      * @exception InvalidAlgorithmParameterException if the given algorithm
      * parameters are inappropriate for this MAC.
      */
-    void init(Key key, AlgorithmParameterSpec params)
+    protected void engineInit(Key key, AlgorithmParameterSpec params)
             throws InvalidKeyException, InvalidAlgorithmParameterException {
-
         if (params != null) {
             throw new InvalidAlgorithmParameterException
                 ("HMAC does not use parameters");
@@ -140,7 +128,7 @@
         Arrays.fill(secret, (byte)0);
         secret = null;
 
-        reset();
+        engineReset();
     }
 
     /**
@@ -148,7 +136,7 @@
      *
      * @param input the input byte to be processed.
      */
-    void update(byte input) {
+    protected void engineUpdate(byte input) {
         if (first == true) {
             // compute digest for 1st pass; start with inner pad
             md.update(k_ipad);
@@ -167,7 +155,7 @@
      * @param offset the offset in <code>input</code> where the input starts.
      * @param len the number of bytes to process.
      */
-    void update(byte input[], int offset, int len) {
+    protected void engineUpdate(byte input[], int offset, int len) {
         if (first == true) {
             // compute digest for 1st pass; start with inner pad
             md.update(k_ipad);
@@ -178,7 +166,13 @@
         md.update(input, offset, len);
     }
 
-    void update(ByteBuffer input) {
+    /**
+     * Processes the <code>input.remaining()</code> bytes in the ByteBuffer
+     * <code>input</code>.
+     *
+     * @param input the input byte buffer.
+     */
+    protected void engineUpdate(ByteBuffer input) {
         if (first == true) {
             // compute digest for 1st pass; start with inner pad
             md.update(k_ipad);
@@ -194,7 +188,7 @@
      *
      * @return the HMAC result.
      */
-    byte[] doFinal() {
+    protected byte[] engineDoFinal() {
         if (first == true) {
             // compute digest for 1st pass; start with inner pad
             md.update(k_ipad);
@@ -223,7 +217,7 @@
      * Resets the HMAC for further use, maintaining the secret key that the
      * HMAC was initialized with.
      */
-    void reset() {
+    protected void engineReset() {
         if (first == false) {
             md.reset();
             first = true;
@@ -234,115 +228,38 @@
      * Clones this object.
      */
     public Object clone() throws CloneNotSupportedException {
-        return new HmacCore(this);
+        HmacCore copy = (HmacCore) super.clone();
+        copy.md = (MessageDigest) md.clone();
+        copy.k_ipad = k_ipad.clone();
+        copy.k_opad = k_opad.clone();
+        return copy;
+    }
+
+    // nested static class for the HmacSHA224 implementation
+    public static final class HmacSHA224 extends HmacCore {
+        public HmacSHA224() throws NoSuchAlgorithmException {
+            super("SHA-224", 64);
+        }
     }
 
     // nested static class for the HmacSHA256 implementation
-    public static final class HmacSHA256 extends MacSpi implements Cloneable {
-        private final HmacCore core;
+    public static final class HmacSHA256 extends HmacCore {
         public HmacSHA256() throws NoSuchAlgorithmException {
-            core = new HmacCore("SHA-256", 64);
-        }
-        private HmacSHA256(HmacSHA256 base) throws CloneNotSupportedException {
-            core = (HmacCore)base.core.clone();
-        }
-        protected int engineGetMacLength() {
-            return core.getDigestLength();
-        }
-        protected void engineInit(Key key, AlgorithmParameterSpec params)
-                throws InvalidKeyException, InvalidAlgorithmParameterException {
-            core.init(key, params);
-        }
-        protected void engineUpdate(byte input) {
-            core.update(input);
-        }
-        protected void engineUpdate(byte input[], int offset, int len) {
-            core.update(input, offset, len);
-        }
-        protected void engineUpdate(ByteBuffer input) {
-            core.update(input);
-        }
-        protected byte[] engineDoFinal() {
-            return core.doFinal();
-        }
-        protected void engineReset() {
-            core.reset();
-        }
-        public Object clone() throws CloneNotSupportedException {
-            return new HmacSHA256(this);
+            super("SHA-256", 64);
         }
     }
 
     // nested static class for the HmacSHA384 implementation
-    public static final class HmacSHA384 extends MacSpi implements Cloneable {
-        private final HmacCore core;
+    public static final class HmacSHA384 extends HmacCore {
         public HmacSHA384() throws NoSuchAlgorithmException {
-            core = new HmacCore("SHA-384", 128);
-        }
-        private HmacSHA384(HmacSHA384 base) throws CloneNotSupportedException {
-            core = (HmacCore)base.core.clone();
-        }
-        protected int engineGetMacLength() {
-            return core.getDigestLength();
-        }
-        protected void engineInit(Key key, AlgorithmParameterSpec params)
-                throws InvalidKeyException, InvalidAlgorithmParameterException {
-            core.init(key, params);
-        }
-        protected void engineUpdate(byte input) {
-            core.update(input);
-        }
-        protected void engineUpdate(byte input[], int offset, int len) {
-            core.update(input, offset, len);
-        }
-        protected void engineUpdate(ByteBuffer input) {
-            core.update(input);
-        }
-        protected byte[] engineDoFinal() {
-            return core.doFinal();
-        }
-        protected void engineReset() {
-            core.reset();
-        }
-        public Object clone() throws CloneNotSupportedException {
-            return new HmacSHA384(this);
+            super("SHA-384", 128);
         }
     }
 
     // nested static class for the HmacSHA512 implementation
-    public static final class HmacSHA512 extends MacSpi implements Cloneable {
-        private final HmacCore core;
+    public static final class HmacSHA512 extends HmacCore {
         public HmacSHA512() throws NoSuchAlgorithmException {
-            core = new HmacCore("SHA-512", 128);
-        }
-        private HmacSHA512(HmacSHA512 base) throws CloneNotSupportedException {
-            core = (HmacCore)base.core.clone();
-        }
-        protected int engineGetMacLength() {
-            return core.getDigestLength();
-        }
-        protected void engineInit(Key key, AlgorithmParameterSpec params)
-                throws InvalidKeyException, InvalidAlgorithmParameterException {
-            core.init(key, params);
-        }
-        protected void engineUpdate(byte input) {
-            core.update(input);
-        }
-        protected void engineUpdate(byte input[], int offset, int len) {
-            core.update(input, offset, len);
-        }
-        protected void engineUpdate(ByteBuffer input) {
-            core.update(input);
-        }
-        protected byte[] engineDoFinal() {
-            return core.doFinal();
-        }
-        protected void engineReset() {
-            core.reset();
-        }
-        public Object clone() throws CloneNotSupportedException {
-            return new HmacSHA512(this);
+            super("SHA-512", 128);
         }
     }
-
 }
--- a/src/share/classes/com/sun/crypto/provider/HmacMD5.java	Fri May 25 12:56:22 2012 +0400
+++ b/src/share/classes/com/sun/crypto/provider/HmacMD5.java	Fri May 25 19:34:32 2012 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 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,97 +37,11 @@
  *
  * @author Jan Luehe
  */
-public final class HmacMD5 extends MacSpi implements Cloneable {
-
-    private HmacCore hmac;
-    private static final int MD5_BLOCK_LENGTH = 64;
-
+public final class HmacMD5 extends HmacCore {
     /**
      * Standard constructor, creates a new HmacMD5 instance.
      */
     public HmacMD5() throws NoSuchAlgorithmException {
-        hmac = new HmacCore(MessageDigest.getInstance("MD5"),
-                            MD5_BLOCK_LENGTH);
-    }
-
-    /**
-     * Returns the length of the HMAC in bytes.
-     *
-     * @return the HMAC length in bytes.
-     */
-    protected int engineGetMacLength() {
-        return hmac.getDigestLength();
-    }
-
-    /**
-     * Initializes the HMAC with the given secret key and algorithm parameters.
-     *
-     * @param key the secret key.
-     * @param params the algorithm parameters.
-     *
-     * @exception InvalidKeyException if the given key is inappropriate for
-     * initializing this MAC.
-     * @exception InvalidAlgorithmParameterException if the given algorithm
-     * parameters are inappropriate for this MAC.
-     */
-    protected void engineInit(Key key, AlgorithmParameterSpec params)
-        throws InvalidKeyException, InvalidAlgorithmParameterException {
-        hmac.init(key, params);
-    }
-
-    /**
-     * Processes the given byte.
-     *
-     * @param input the input byte to be processed.
-     */
-    protected void engineUpdate(byte input) {
-        hmac.update(input);
-    }
-
-    /**
-     * Processes the first <code>len</code> bytes in <code>input</code>,
-     * starting at <code>offset</code>.
-     *
-     * @param input the input buffer.
-     * @param offset the offset in <code>input</code> where the input starts.
-     * @param len the number of bytes to process.
-     */
-    protected void engineUpdate(byte input[], int offset, int len) {
-        hmac.update(input, offset, len);
-    }
-
-    protected void engineUpdate(ByteBuffer input) {
-        hmac.update(input);
-    }
-
-    /**
-     * Completes the HMAC computation and resets the HMAC for further use,
-     * maintaining the secret key that the HMAC was initialized with.
-     *
-     * @return the HMAC result.
-     */
-    protected byte[] engineDoFinal() {
-        return hmac.doFinal();
-    }
-
-    /**
-     * Resets the HMAC for further use, maintaining the secret key that the
-     * HMAC was initialized with.
-     */
-    protected void engineReset() {
-        hmac.reset();
-    }
-
-    /*
-     * Clones this object.
-     */
-    public Object clone() {
-        HmacMD5 that = null;
-        try {
-            that = (HmacMD5) super.clone();
-            that.hmac = (HmacCore) this.hmac.clone();
-        } catch (CloneNotSupportedException e) {
-        }
-        return that;
+        super("MD5", 64);
     }
 }
--- a/src/share/classes/com/sun/crypto/provider/HmacPKCS12PBESHA1.java	Fri May 25 12:56:22 2012 +0400
+++ b/src/share/classes/com/sun/crypto/provider/HmacPKCS12PBESHA1.java	Fri May 25 19:34:32 2012 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 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
@@ -41,26 +41,13 @@
  *
  * @author Valerie Peng
  */
-public final class HmacPKCS12PBESHA1 extends MacSpi implements Cloneable {
-
-    private HmacCore hmac = null;
-    private static final int SHA1_BLOCK_LENGTH = 64;
+public final class HmacPKCS12PBESHA1 extends HmacCore {
 
     /**
      * Standard constructor, creates a new HmacSHA1 instance.
      */
     public HmacPKCS12PBESHA1() throws NoSuchAlgorithmException {
-        this.hmac = new HmacCore(MessageDigest.getInstance("SHA1"),
-                                 SHA1_BLOCK_LENGTH);
-    }
-
-    /**
-     * Returns the length of the HMAC in bytes.
-     *
-     * @return the HMAC length in bytes.
-     */
-    protected int engineGetMacLength() {
-        return hmac.getDigestLength();
+        super("SHA1", 64);
     }
 
     /**
@@ -71,7 +58,7 @@
      *
      * @exception InvalidKeyException if the given key is inappropriate for
      * initializing this MAC.
-     u* @exception InvalidAlgorithmParameterException if the given algorithm
+     * @exception InvalidAlgorithmParameterException if the given algorithm
      * parameters are inappropriate for this MAC.
      */
     protected void engineInit(Key key, AlgorithmParameterSpec params)
@@ -140,64 +127,8 @@
                 ("IterationCount must be a positive number");
         }
         byte[] derivedKey = PKCS12PBECipherCore.derive(passwdChars, salt,
-            iCount, hmac.getDigestLength(), PKCS12PBECipherCore.MAC_KEY);
+            iCount, engineGetMacLength(), PKCS12PBECipherCore.MAC_KEY);
         SecretKey cipherKey = new SecretKeySpec(derivedKey, "HmacSHA1");
-        hmac.init(cipherKey, null);
-    }
-
-    /**
-     * Processes the given byte.
-     *
-     * @param input the input byte to be processed.
-     */
-    protected void engineUpdate(byte input) {
-        hmac.update(input);
-    }
-
-    /**
-     * Processes the first <code>len</code> bytes in <code>input</code>,
-     * starting at <code>offset</code>.
-     *
-     * @param input the input buffer.
-     * @param offset the offset in <code>input</code> where the input starts.
-     * @param len the number of bytes to process.
-     */
-    protected void engineUpdate(byte input[], int offset, int len) {
-        hmac.update(input, offset, len);
-    }
-
-    protected void engineUpdate(ByteBuffer input) {
-        hmac.update(input);
-    }
-
-    /**
-     * Completes the HMAC computation and resets the HMAC for further use,
-     * maintaining the secret key that the HMAC was initialized with.
-     *
-     * @return the HMAC result.
-     */
-    protected byte[] engineDoFinal() {
-        return hmac.doFinal();
-    }
-
-    /**
-     * Resets the HMAC for further use, maintaining the secret key that the
-     * HMAC was initialized with.
-     */
-    protected void engineReset() {
-        hmac.reset();
-    }
-
-    /*
-     * Clones this object.
-     */
-    public Object clone() {
-        HmacPKCS12PBESHA1 that = null;
-        try {
-            that = (HmacPKCS12PBESHA1)super.clone();
-            that.hmac = (HmacCore)this.hmac.clone();
-        } catch (CloneNotSupportedException e) {
-        }
-        return that;
+        super.engineInit(cipherKey, null);
     }
 }
--- a/src/share/classes/com/sun/crypto/provider/HmacSHA1.java	Fri May 25 12:56:22 2012 +0400
+++ b/src/share/classes/com/sun/crypto/provider/HmacSHA1.java	Fri May 25 19:34:32 2012 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 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,97 +37,11 @@
  *
  * @author Jan Luehe
  */
-public final class HmacSHA1 extends MacSpi implements Cloneable {
-
-    private HmacCore hmac = null;
-    private static final int SHA1_BLOCK_LENGTH = 64;
-
+public final class HmacSHA1 extends HmacCore {
     /**
      * Standard constructor, creates a new HmacSHA1 instance.
      */
     public HmacSHA1() throws NoSuchAlgorithmException {
-        this.hmac = new HmacCore(MessageDigest.getInstance("SHA1"),
-                                 SHA1_BLOCK_LENGTH);
-    }
-
-    /**
-     * Returns the length of the HMAC in bytes.
-     *
-     * @return the HMAC length in bytes.
-     */
-    protected int engineGetMacLength() {
-        return hmac.getDigestLength();
-    }
-
-    /**
-     * Initializes the HMAC with the given secret key and algorithm parameters.
-     *
-     * @param key the secret key.
-     * @param params the algorithm parameters.
-     *
-     * @exception InvalidKeyException if the given key is inappropriate for
-     * initializing this MAC.
-     * @exception InvalidAlgorithmParameterException if the given algorithm
-     * parameters are inappropriate for this MAC.
-     */
-    protected void engineInit(Key key, AlgorithmParameterSpec params)
-        throws InvalidKeyException, InvalidAlgorithmParameterException {
-        hmac.init(key, params);
-    }
-
-    /**
-     * Processes the given byte.
-     *
-     * @param input the input byte to be processed.
-     */
-    protected void engineUpdate(byte input) {
-        hmac.update(input);
-    }
-
-    /**
-     * Processes the first <code>len</code> bytes in <code>input</code>,
-     * starting at <code>offset</code>.
-     *
-     * @param input the input buffer.
-     * @param offset the offset in <code>input</code> where the input starts.
-     * @param len the number of bytes to process.
-     */
-    protected void engineUpdate(byte input[], int offset, int len) {
-        hmac.update(input, offset, len);
-    }
-
-    protected void engineUpdate(ByteBuffer input) {
-        hmac.update(input);
-    }
-
-    /**
-     * Completes the HMAC computation and resets the HMAC for further use,
-     * maintaining the secret key that the HMAC was initialized with.
-     *
-     * @return the HMAC result.
-     */
-    protected byte[] engineDoFinal() {
-        return hmac.doFinal();
-    }
-
-    /**
-     * Resets the HMAC for further use, maintaining the secret key that the
-     * HMAC was initialized with.
-     */
-    protected void engineReset() {
-        hmac.reset();
-    }
-
-    /*
-     * Clones this object.
-     */
-    public Object clone() {
-        HmacSHA1 that = null;
-        try {
-            that = (HmacSHA1)super.clone();
-            that.hmac = (HmacCore)this.hmac.clone();
-        } catch (CloneNotSupportedException e) {
-        }
-        return that;
+        super("SHA1", 64);
     }
 }
--- a/src/share/classes/com/sun/crypto/provider/KeyGeneratorCore.java	Fri May 25 12:56:22 2012 +0400
+++ b/src/share/classes/com/sun/crypto/provider/KeyGeneratorCore.java	Fri May 25 19:34:32 2012 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 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
@@ -105,11 +105,11 @@
         return new SecretKeySpec(b, name);
     }
 
-    // nested static class for the HmacSHA256 key generator
-    public static final class HmacSHA256KG extends KeyGeneratorSpi {
+    // nested static classes for the HmacSHA-2 family of key generator
+    abstract static class HmacSHA2KG extends KeyGeneratorSpi {
         private final KeyGeneratorCore core;
-        public HmacSHA256KG() {
-            core = new KeyGeneratorCore("HmacSHA256", 256);
+        protected HmacSHA2KG(String algoName, int len) {
+            core = new KeyGeneratorCore(algoName, len);
         }
         protected void engineInit(SecureRandom random) {
             core.implInit(random);
@@ -124,47 +124,26 @@
         protected SecretKey engineGenerateKey() {
             return core.implGenerateKey();
         }
-    }
 
-    // nested static class for the HmacSHA384 key generator
-    public static final class HmacSHA384KG extends KeyGeneratorSpi {
-        private final KeyGeneratorCore core;
-        public HmacSHA384KG() {
-            core = new KeyGeneratorCore("HmacSHA384", 384);
+        public static final class SHA224 extends HmacSHA2KG {
+            public SHA224() {
+                super("HmacSHA224", 224);
+            }
         }
-        protected void engineInit(SecureRandom random) {
-            core.implInit(random);
+        public static final class SHA256 extends HmacSHA2KG {
+            public SHA256() {
+                super("HmacSHA256", 256);
+            }
         }
-        protected void engineInit(AlgorithmParameterSpec params,
-                SecureRandom random) throws InvalidAlgorithmParameterException {
-            core.implInit(params, random);
+        public static final class SHA384 extends HmacSHA2KG {
+            public SHA384() {
+                super("HmacSHA384", 384);
+            }
         }
-        protected void engineInit(int keySize, SecureRandom random) {
-            core.implInit(keySize, random);
-        }
-        protected SecretKey engineGenerateKey() {
-            return core.implGenerateKey();
-        }
-    }
-
-    // nested static class for the HmacSHA384 key generator
-    public static final class HmacSHA512KG extends KeyGeneratorSpi {
-        private final KeyGeneratorCore core;
-        public HmacSHA512KG() {
-            core = new KeyGeneratorCore("HmacSHA512", 512);
-        }
-        protected void engineInit(SecureRandom random) {
-            core.implInit(random);
-        }
-        protected void engineInit(AlgorithmParameterSpec params,
-                SecureRandom random) throws InvalidAlgorithmParameterException {
-            core.implInit(params, random);
-        }
-        protected void engineInit(int keySize, SecureRandom random) {
-            core.implInit(keySize, random);
-        }
-        protected SecretKey engineGenerateKey() {
-            return core.implGenerateKey();
+        public static final class SHA512 extends HmacSHA2KG {
+            public SHA512() {
+                super("HmacSHA512", 512);
+            }
         }
     }
 
--- a/src/share/classes/com/sun/crypto/provider/OAEPParameters.java	Fri May 25 12:56:22 2012 +0400
+++ b/src/share/classes/com/sun/crypto/provider/OAEPParameters.java	Fri May 25 19:34:32 2012 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 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
@@ -108,6 +108,8 @@
     private static String convertToStandardName(String internalName) {
         if (internalName.equals("SHA")) {
             return "SHA-1";
+        } else if (internalName.equals("SHA224")) {
+            return "SHA-224";
         } else if (internalName.equals("SHA256")) {
             return "SHA-256";
         } else if (internalName.equals("SHA384")) {
@@ -143,6 +145,8 @@
                 String mgfDigestName = convertToStandardName(params.getName());
                 if (mgfDigestName.equals("SHA-1")) {
                     mgfSpec = MGF1ParameterSpec.SHA1;
+                } else if (mgfDigestName.equals("SHA-224")) {
+                    mgfSpec = MGF1ParameterSpec.SHA224;
                 } else if (mgfDigestName.equals("SHA-256")) {
                     mgfSpec = MGF1ParameterSpec.SHA256;
                 } else if (mgfDigestName.equals("SHA-384")) {
--- a/src/share/classes/com/sun/crypto/provider/SunJCE.java	Fri May 25 12:56:22 2012 +0400
+++ b/src/share/classes/com/sun/crypto/provider/SunJCE.java	Fri May 25 19:34:32 2012 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 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
@@ -65,7 +65,7 @@
  *
  * - Diffie-Hellman Key Agreement
  *
- * - HMAC-MD5, HMAC-SHA1, HMAC-SHA-256, HMAC-SHA-384, HMAC-SHA-512
+ * - HMAC-MD5, HMAC-SHA1, HMAC-SHA-224, HMAC-SHA-256, HMAC-SHA-384, HMAC-SHA-512
  *
  */
 
@@ -113,6 +113,7 @@
                             "NOPADDING|PKCS1PADDING|OAEPWITHMD5ANDMGF1PADDING"
                             + "|OAEPWITHSHA1ANDMGF1PADDING"
                             + "|OAEPWITHSHA-1ANDMGF1PADDING"
+                            + "|OAEPWITHSHA-224ANDMGF1PADDING"
                             + "|OAEPWITHSHA-256ANDMGF1PADDING"
                             + "|OAEPWITHSHA-384ANDMGF1PADDING"
                             + "|OAEPWITHSHA-512ANDMGF1PADDING");
@@ -221,12 +222,25 @@
                     put("KeyGenerator.HmacSHA1",
                         "com.sun.crypto.provider.HmacSHA1KeyGenerator");
 
+                    put("KeyGenerator.HmacSHA224",
+                        "com.sun.crypto.provider.KeyGeneratorCore$HmacSHA2KG$SHA224");
+                    put("Alg.Alias.KeyGenerator.OID.1.2.840.113549.2.8", "HmacSHA224");
+                    put("Alg.Alias.KeyGenerator.1.2.840.113549.2.8", "HmacSHA224");
+
                     put("KeyGenerator.HmacSHA256",
-                        "com.sun.crypto.provider.KeyGeneratorCore$HmacSHA256KG");
+                        "com.sun.crypto.provider.KeyGeneratorCore$HmacSHA2KG$SHA256");
+                    put("Alg.Alias.KeyGenerator.OID.1.2.840.113549.2.9", "HmacSHA256");
+                    put("Alg.Alias.KeyGenerator.1.2.840.113549.2.9", "HmacSHA256");
+
                     put("KeyGenerator.HmacSHA384",
-                        "com.sun.crypto.provider.KeyGeneratorCore$HmacSHA384KG");
+                        "com.sun.crypto.provider.KeyGeneratorCore$HmacSHA2KG$SHA384");
+                    put("Alg.Alias.KeyGenerator.OID.1.2.840.113549.2.10", "HmacSHA384");
+                    put("Alg.Alias.KeyGenerator.1.2.840.113549.2.10", "HmacSHA384");
+
                     put("KeyGenerator.HmacSHA512",
-                        "com.sun.crypto.provider.KeyGeneratorCore$HmacSHA512KG");
+                        "com.sun.crypto.provider.KeyGeneratorCore$HmacSHA2KG$SHA512");
+                    put("Alg.Alias.KeyGenerator.OID.1.2.840.113549.2.11", "HmacSHA512");
+                    put("Alg.Alias.KeyGenerator.1.2.840.113549.2.11", "HmacSHA512");
 
                     put("KeyPairGenerator.DiffieHellman",
                         "com.sun.crypto.provider.DHKeyPairGenerator");
@@ -389,12 +403,23 @@
                      */
                     put("Mac.HmacMD5", "com.sun.crypto.provider.HmacMD5");
                     put("Mac.HmacSHA1", "com.sun.crypto.provider.HmacSHA1");
+                    put("Mac.HmacSHA224",
+                        "com.sun.crypto.provider.HmacCore$HmacSHA224");
+                    put("Alg.Alias.Mac.OID.1.2.840.113549.2.8", "HmacSHA224");
+                    put("Alg.Alias.Mac.1.2.840.113549.2.8", "HmacSHA224");
                     put("Mac.HmacSHA256",
                         "com.sun.crypto.provider.HmacCore$HmacSHA256");
+                    put("Alg.Alias.Mac.OID.1.2.840.113549.2.9", "HmacSHA256");
+                    put("Alg.Alias.Mac.1.2.840.113549.2.9", "HmacSHA256");
                     put("Mac.HmacSHA384",
                         "com.sun.crypto.provider.HmacCore$HmacSHA384");
+                    put("Alg.Alias.Mac.OID.1.2.840.113549.2.10", "HmacSHA384");
+                    put("Alg.Alias.Mac.1.2.840.113549.2.10", "HmacSHA384");
                     put("Mac.HmacSHA512",
                         "com.sun.crypto.provider.HmacCore$HmacSHA512");
+                    put("Alg.Alias.Mac.OID.1.2.840.113549.2.11", "HmacSHA512");
+                    put("Alg.Alias.Mac.1.2.840.113549.2.11", "HmacSHA512");
+
                     put("Mac.HmacPBESHA1",
                         "com.sun.crypto.provider.HmacPKCS12PBESHA1");
 
@@ -405,6 +430,7 @@
 
                     put("Mac.HmacMD5 SupportedKeyFormats", "RAW");
                     put("Mac.HmacSHA1 SupportedKeyFormats", "RAW");
+                    put("Mac.HmacSHA224 SupportedKeyFormats", "RAW");
                     put("Mac.HmacSHA256 SupportedKeyFormats", "RAW");
                     put("Mac.HmacSHA384 SupportedKeyFormats", "RAW");
                     put("Mac.HmacSHA512 SupportedKeyFormats", "RAW");
--- a/src/share/classes/com/sun/java/swing/plaf/motif/resources/motif.properties	Fri May 25 12:56:22 2012 +0400
+++ b/src/share/classes/com/sun/java/swing/plaf/motif/resources/motif.properties	Fri May 25 19:34:32 2012 -0700
@@ -18,28 +18,23 @@
 
 ############ FILE CHOOSER STRINGS #############
 
-FileChooser.acceptAllFileFilterText=*
-FileChooser.cancelButtonText=Cancel
-FileChooser.saveButtonText=Save
-FileChooser.openButtonText=OK
-FileChooser.saveDialogTitleText=Save
-FileChooser.openDialogTitleText=Open
-FileChooser.updateButtonText=Update
-FileChooser.helpButtonText=Help
-FileChooser.pathLabelText=Enter path or folder name:
-FileChooser.pathLabelMnemonic=80
-FileChooser.filterLabelText=Filter
-FileChooser.filterLabelMnemonic=82
-FileChooser.foldersLabelText=Folders
-FileChooser.foldersLabelMnemonic=76
-FileChooser.filesLabelText=Files
-FileChooser.filesLabelMnemonic=73
-FileChooser.enterFileNameLabelText=Enter file name:
-FileChooser.enterFileNameLabelMnemonic=78
-FileChooser.enterFolderNameLabelText=Enter folder name:
+FileChooser.acceptAllFileFilter.textAndMnemonic=*
+FileChooser.cancelButton.textAndMnemonic=Cancel
+FileChooser.saveButton.textAndMnemonic=Save
+FileChooser.openButton.textAndMnemonic=OK
+FileChooser.saveDialogTitle.textAndMnemonic=Save
+FileChooser.openDialogTitle.textAndMnemonic=Open
+FileChooser.updateButton.textAndMnemonic=Update
+FileChooser.helpButton.textAndMnemonic=Help
+FileChooser.pathLabel.textAndMnemonic=Enter &path or folder name:
+FileChooser.filterLabel.textAndMnemonic=Filte&r
+FileChooser.foldersLabel.textAndMnemonic=Fo&lders
+FileChooser.filesLabel.textAndMnemonic=F&iles
+FileChooser.enterFileNameLabel.textAndMnemonic=E&nter file name:
+FileChooser.enterFolderNameLabel.textAndMnemonic=Enter folder name:
 
-FileChooser.cancelButtonToolTipText=Abort file chooser dialog.
-FileChooser.saveButtonToolTipText=Save selected file.
-FileChooser.openButtonToolTipText=Open selected file.
-FileChooser.updateButtonToolTipText=Update directory listing.
-FileChooser.helpButtonToolTipText=FileChooser help.
+FileChooser.cancelButtonToolTip.textAndMnemonic=Abort file chooser dialog.
+FileChooser.saveButtonToolTip.textAndMnemonic=Save selected file.
+FileChooser.openButtonToolTip.textAndMnemonic=Open selected file.
+FileChooser.updateButtonToolTip.textAndMnemonic=Update directory listing.
+FileChooser.helpButtonToolTip.textAndMnemonic=FileChooser help.
--- a/src/share/classes/com/sun/java/swing/plaf/motif/resources/motif_de.properties	Fri May 25 12:56:22 2012 +0400
+++ b/src/share/classes/com/sun/java/swing/plaf/motif/resources/motif_de.properties	Fri May 25 19:34:32 2012 -0700
@@ -18,28 +18,23 @@
 
 ############ FILE CHOOSER STRINGS #############
 
-FileChooser.acceptAllFileFilterText=*
-FileChooser.cancelButtonText=Abbrechen
-FileChooser.saveButtonText=Speichern
-FileChooser.openButtonText=OK
-FileChooser.saveDialogTitleText=Speichern
-FileChooser.openDialogTitleText=\u00D6ffnen
-FileChooser.updateButtonText=Aktualisieren
-FileChooser.helpButtonText=Hilfe
-FileChooser.pathLabelText=Pfad- oder Ordnernamen eingeben:
-FileChooser.pathLabelMnemonic=80
-FileChooser.filterLabelText=Filter
-FileChooser.filterLabelMnemonic=82
-FileChooser.foldersLabelText=Ordner
-FileChooser.foldersLabelMnemonic=76
-FileChooser.filesLabelText=Dateien
-FileChooser.filesLabelMnemonic=73
-FileChooser.enterFileNameLabelText=Dateinamen eingeben:
-FileChooser.enterFileNameLabelMnemonic=78
-FileChooser.enterFolderNameLabelText=Ordnernamen eingeben:
+FileChooser.acceptAllFileFilter.textAndMnemonic=*
+FileChooser.cancelButton.textAndMnemonic=Abbrechen
+FileChooser.saveButton.textAndMnemonic=Speichern
+FileChooser.openButton.textAndMnemonic=OK
+FileChooser.saveDialogTitle.textAndMnemonic=Speichern
+FileChooser.openDialogTitle.textAndMnemonic=\u00D6ffnen
+FileChooser.updateButton.textAndMnemonic=Aktualisieren
+FileChooser.helpButton.textAndMnemonic=Hilfe
+FileChooser.pathLabel.textAndMnemonic=&Pfad- oder Ordnernamen eingeben:
+FileChooser.filterLabel.textAndMnemonic=Filte&r
+FileChooser.foldersLabel.textAndMnemonic=Ordner(&L)
+FileChooser.filesLabel.textAndMnemonic=Date&ien
+FileChooser.enterFileNameLabel.textAndMnemonic=Datei&namen eingeben:
+FileChooser.enterFolderNameLabel.textAndMnemonic=Ordnernamen eingeben:
 
-FileChooser.cancelButtonToolTipText=Dialogfeld f\u00FCr Dateiauswahl schlie\u00DFen.
-FileChooser.saveButtonToolTipText=Ausgew\u00E4hlte Datei speichern.
-FileChooser.openButtonToolTipText=Ausgew\u00E4hlte Datei \u00F6ffnen.
-FileChooser.updateButtonToolTipText=Verzeichnisliste aktualisieren.
-FileChooser.helpButtonToolTipText=FileChooser-Hilfe.
+FileChooser.cancelButtonToolTip.textAndMnemonic=Dialogfeld f\u00FCr Dateiauswahl schlie\u00DFen.
+FileChooser.saveButtonToolTip.textAndMnemonic=Ausgew\u00E4hlte Datei speichern.
+FileChooser.openButtonToolTip.textAndMnemonic=Ausgew\u00E4hlte Datei \u00F6ffnen.
+FileChooser.updateButtonToolTip.textAndMnemonic=Verzeichnisliste aktualisieren.
+FileChooser.helpButtonToolTip.textAndMnemonic=FileChooser-Hilfe.
--- a/src/share/classes/com/sun/java/swing/plaf/motif/resources/motif_es.properties	Fri May 25 12:56:22 2012 +0400
+++ b/src/share/classes/com/sun/java/swing/plaf/motif/resources/motif_es.properties	Fri May 25 19:34:32 2012 -0700
@@ -18,28 +18,23 @@
 
 ############ FILE CHOOSER STRINGS #############
 
-FileChooser.acceptAllFileFilterText=*
-FileChooser.cancelButtonText=Cancelar
-FileChooser.saveButtonText=Guardar
-FileChooser.openButtonText=Aceptar
-FileChooser.saveDialogTitleText=Guardar
-FileChooser.openDialogTitleText=Abrir
-FileChooser.updateButtonText=Actualizar
-FileChooser.helpButtonText=Ayuda
-FileChooser.pathLabelText=Introducir nombre de la ruta de acceso o carpeta:
-FileChooser.pathLabelMnemonic=80
-FileChooser.filterLabelText=Filtro
-FileChooser.filterLabelMnemonic=82
-FileChooser.foldersLabelText=Carpetas
-FileChooser.foldersLabelMnemonic=76
-FileChooser.filesLabelText=Archivos
-FileChooser.filesLabelMnemonic=73
-FileChooser.enterFileNameLabelText=Introducir nombre de archivo:
-FileChooser.enterFileNameLabelMnemonic=78
-FileChooser.enterFolderNameLabelText=Introducir nombre de carpeta:
+FileChooser.acceptAllFileFilter.textAndMnemonic=*
+FileChooser.cancelButton.textAndMnemonic=Cancelar
+FileChooser.saveButton.textAndMnemonic=Guardar
+FileChooser.openButton.textAndMnemonic=Aceptar
+FileChooser.saveDialogTitle.textAndMnemonic=Guardar
+FileChooser.openDialogTitle.textAndMnemonic=Abrir
+FileChooser.updateButton.textAndMnemonic=Actualizar
+FileChooser.helpButton.textAndMnemonic=Ayuda
+FileChooser.pathLabel.textAndMnemonic=Introducir nombre de la ruta de acceso o car&peta:
+FileChooser.filterLabel.textAndMnemonic=Filt&ro
+FileChooser.foldersLabel.textAndMnemonic=Carpetas(&L)
+FileChooser.filesLabel.textAndMnemonic=Arch&ivos
+FileChooser.enterFileNameLabel.textAndMnemonic=I&ntroducir nombre de archivo:
+FileChooser.enterFolderNameLabel.textAndMnemonic=Introducir nombre de carpeta:
 
-FileChooser.cancelButtonToolTipText=Abortar cuadro de di\u00E1logo del selector de archivos.
-FileChooser.saveButtonToolTipText=Guardar archivo seleccionado.
-FileChooser.openButtonToolTipText=Abrir archivo seleccionado.
-FileChooser.updateButtonToolTipText=Actualizar lista de directorios.
-FileChooser.helpButtonToolTipText=Ayuda del selector de archivos.
+FileChooser.cancelButtonToolTip.textAndMnemonic=Abortar cuadro de di\u00E1logo del selector de archivos.
+FileChooser.saveButtonToolTip.textAndMnemonic=Guardar archivo seleccionado.
+FileChooser.openButtonToolTip.textAndMnemonic=Abrir archivo seleccionado.
+FileChooser.updateButtonToolTip.textAndMnemonic=Actualizar lista de directorios.
+FileChooser.helpButtonToolTip.textAndMnemonic=Ayuda del selector de archivos.
--- a/src/share/classes/com/sun/java/swing/plaf/motif/resources/motif_fr.properties	Fri May 25 12:56:22 2012 +0400
+++ b/src/share/classes/com/sun/java/swing/plaf/motif/resources/motif_fr.properties	Fri May 25 19:34:32 2012 -0700
@@ -18,28 +18,23 @@
 
 ############ FILE CHOOSER STRINGS #############
 
-FileChooser.acceptAllFileFilterText=*
-FileChooser.cancelButtonText=Annuler
-FileChooser.saveButtonText=Enregistrer
-FileChooser.openButtonText=OK
-FileChooser.saveDialogTitleText=Enregistrer
-FileChooser.openDialogTitleText=Ouvrir
-FileChooser.updateButtonText=Mettre \u00E0 jour
-FileChooser.helpButtonText=Aide
-FileChooser.pathLabelText=Entrez le chemin ou le nom du dossier :
-FileChooser.pathLabelMnemonic=80
-FileChooser.filterLabelText=Filtre
-FileChooser.filterLabelMnemonic=82
-FileChooser.foldersLabelText=Dossiers
-FileChooser.foldersLabelMnemonic=76
-FileChooser.filesLabelText=Fichiers
-FileChooser.filesLabelMnemonic=73
-FileChooser.enterFileNameLabelText=Entrez le nom du fichier :
-FileChooser.enterFileNameLabelMnemonic=78
-FileChooser.enterFolderNameLabelText=Entrez le nom du dossier :
+FileChooser.acceptAllFileFilter.textAndMnemonic=*
+FileChooser.cancelButton.textAndMnemonic=Annuler
+FileChooser.saveButton.textAndMnemonic=Enregistrer
+FileChooser.openButton.textAndMnemonic=OK
+FileChooser.saveDialogTitle.textAndMnemonic=Enregistrer
+FileChooser.openDialogTitle.textAndMnemonic=Ouvrir
+FileChooser.updateButton.textAndMnemonic=Mettre \u00E0 jour
+FileChooser.helpButton.textAndMnemonic=Aide
+FileChooser.pathLabel.textAndMnemonic=Entrez le chemin ou le nom du dossier (&P):
+FileChooser.filterLabel.textAndMnemonic=Filt&re
+FileChooser.foldersLabel.textAndMnemonic=Dossiers(&L)
+FileChooser.filesLabel.textAndMnemonic=F&ichiers
+FileChooser.enterFileNameLabel.textAndMnemonic=E&ntrez le nom du fichier :
+FileChooser.enterFolderNameLabel.textAndMnemonic=Entrez le nom du dossier :
 
-FileChooser.cancelButtonToolTipText=Ferme la bo\u00EEte de dialogue du s\u00E9lecteur de fichiers.
-FileChooser.saveButtonToolTipText=Enregistre le fichier s\u00E9lectionn\u00E9.
-FileChooser.openButtonToolTipText=Ouvre le fichier s\u00E9lectionn\u00E9.
-FileChooser.updateButtonToolTipText=Met \u00E0 jour la liste des r\u00E9pertoires.
-FileChooser.helpButtonToolTipText=Aide du s\u00E9lecteur de fichiers
+FileChooser.cancelButtonToolTip.textAndMnemonic=Ferme la bo\u00EEte de dialogue du s\u00E9lecteur de fichiers.
+FileChooser.saveButtonToolTip.textAndMnemonic=Enregistre le fichier s\u00E9lectionn\u00E9.
+FileChooser.openButtonToolTip.textAndMnemonic=Ouvre le fichier s\u00E9lectionn\u00E9.
+FileChooser.updateButtonToolTip.textAndMnemonic=Met \u00E0 jour la liste des r\u00E9pertoires.
+FileChooser.helpButtonToolTip.textAndMnemonic=Aide du s\u00E9lecteur de fichiers
--- a/src/share/classes/com/sun/java/swing/plaf/motif/resources/motif_it.properties	Fri May 25 12:56:22 2012 +0400
+++ b/src/share/classes/com/sun/java/swing/plaf/motif/resources/motif_it.properties	Fri May 25 19:34:32 2012 -0700
@@ -18,28 +18,23 @@
 
 ############ FILE CHOOSER STRINGS #############
 
-FileChooser.acceptAllFileFilterText=*
-FileChooser.cancelButtonText=Annulla
-FileChooser.saveButtonText=Salva
-FileChooser.openButtonText=OK
-FileChooser.saveDialogTitleText=Salva
-FileChooser.openDialogTitleText=Apri
-FileChooser.updateButtonText=Aggiorna
-FileChooser.helpButtonText=?
-FileChooser.pathLabelText=Percorso o nome cartella:
-FileChooser.pathLabelMnemonic=80
-FileChooser.filterLabelText=Filtro
-FileChooser.filterLabelMnemonic=82
-FileChooser.foldersLabelText=Cartelle
-FileChooser.foldersLabelMnemonic=76
-FileChooser.filesLabelText=File
-FileChooser.filesLabelMnemonic=73
-FileChooser.enterFileNameLabelText=Nome file:
-FileChooser.enterFileNameLabelMnemonic=78
-FileChooser.enterFolderNameLabelText=Nome cartella:
+FileChooser.acceptAllFileFilter.textAndMnemonic=*
+FileChooser.cancelButton.textAndMnemonic=Annulla
+FileChooser.saveButton.textAndMnemonic=Salva
+FileChooser.openButton.textAndMnemonic=OK
+FileChooser.saveDialogTitle.textAndMnemonic=Salva
+FileChooser.openDialogTitle.textAndMnemonic=Apri
+FileChooser.updateButton.textAndMnemonic=Aggiorna
+FileChooser.helpButton.textAndMnemonic=?
+FileChooser.pathLabel.textAndMnemonic=&Percorso o nome cartella:
+FileChooser.filterLabel.textAndMnemonic=Filt&ro
+FileChooser.foldersLabel.textAndMnemonic=Carte&lle
+FileChooser.filesLabel.textAndMnemonic=F&ile
+FileChooser.enterFileNameLabel.textAndMnemonic=&Nome file:
+FileChooser.enterFolderNameLabel.textAndMnemonic=Nome cartella:
 
-FileChooser.cancelButtonToolTipText=Chiude la finestra di dialogo di selezione file.
-FileChooser.saveButtonToolTipText=Salva il file selezionato.
-FileChooser.openButtonToolTipText=Apre il file selezionato.
-FileChooser.updateButtonToolTipText=Aggiorna lista directory.
-FileChooser.helpButtonToolTipText=Guida FileChooser.
+FileChooser.cancelButtonToolTip.textAndMnemonic=Chiude la finestra di dialogo di selezione file.
+FileChooser.saveButtonToolTip.textAndMnemonic=Salva il file selezionato.
+FileChooser.openButtonToolTip.textAndMnemonic=Apre il file selezionato.
+FileChooser.updateButtonToolTip.textAndMnemonic=Aggiorna lista directory.
+FileChooser.helpButtonToolTip.textAndMnemonic=Guida FileChooser.
--- a/src/share/classes/com/sun/java/swing/plaf/motif/resources/motif_ja.properties	Fri May 25 12:56:22 2012 +0400
+++ b/src/share/classes/com/sun/java/swing/plaf/motif/resources/motif_ja.properties	Fri May 25 19:34:32 2012 -0700
@@ -18,28 +18,23 @@
 
 ############ FILE CHOOSER STRINGS #############
 
-FileChooser.acceptAllFileFilterText=*
-FileChooser.cancelButtonText=\u53D6\u6D88
-FileChooser.saveButtonText=\u4FDD\u5B58
-FileChooser.openButtonText=OK
-FileChooser.saveDialogTitleText=\u4FDD\u5B58
-FileChooser.openDialogTitleText=\u958B\u304F
-FileChooser.updateButtonText=\u66F4\u65B0
-FileChooser.helpButtonText=\u30D8\u30EB\u30D7
-FileChooser.pathLabelText=\u30D1\u30B9\u307E\u305F\u306F\u30D5\u30A9\u30EB\u30C0\u540D\u3092\u5165\u529B:
-FileChooser.pathLabelMnemonic=80
-FileChooser.filterLabelText=\u30D5\u30A3\u30EB\u30BF
-FileChooser.filterLabelMnemonic=82
-FileChooser.foldersLabelText=\u30D5\u30A9\u30EB\u30C0
-FileChooser.foldersLabelMnemonic=76
-FileChooser.filesLabelText=\u30D5\u30A1\u30A4\u30EB
-FileChooser.filesLabelMnemonic=73
-FileChooser.enterFileNameLabelText=\u30D5\u30A1\u30A4\u30EB\u540D\u3092\u5165\u529B:
-FileChooser.enterFileNameLabelMnemonic=78
-FileChooser.enterFolderNameLabelText=\u30D5\u30A9\u30EB\u30C0\u540D\u3092\u5165\u529B:
+FileChooser.acceptAllFileFilter.textAndMnemonic=*
+FileChooser.cancelButton.textAndMnemonic=\u53D6\u6D88
+FileChooser.saveButton.textAndMnemonic=\u4FDD\u5B58
+FileChooser.openButton.textAndMnemonic=OK
+FileChooser.saveDialogTitle.textAndMnemonic=\u4FDD\u5B58
+FileChooser.openDialogTitle.textAndMnemonic=\u958B\u304F
+FileChooser.updateButton.textAndMnemonic=\u66F4\u65B0
+FileChooser.helpButton.textAndMnemonic=\u30D8\u30EB\u30D7
+FileChooser.pathLabel.textAndMnemonic=\u30D1\u30B9\u307E\u305F\u306F\u30D5\u30A9\u30EB\u30C0\u540D\u3092\u5165\u529B(&P):
+FileChooser.filterLabel.textAndMnemonic=\u30D5\u30A3\u30EB\u30BF(&R)
+FileChooser.foldersLabel.textAndMnemonic=\u30D5\u30A9\u30EB\u30C0(&L)
+FileChooser.filesLabel.textAndMnemonic=\u30D5\u30A1\u30A4\u30EB(&I)
+FileChooser.enterFileNameLabel.textAndMnemonic=\u30D5\u30A1\u30A4\u30EB\u540D\u3092\u5165\u529B(&N):
+FileChooser.enterFolderNameLabel.textAndMnemonic=\u30D5\u30A9\u30EB\u30C0\u540D\u3092\u5165\u529B:
 
-FileChooser.cancelButtonToolTipText=\u30D5\u30A1\u30A4\u30EB\u30FB\u30C1\u30E5\u30FC\u30B6\u30FB\u30C0\u30A4\u30A2\u30ED\u30B0\u3092\u7D42\u4E86\u3057\u307E\u3059\u3002
-FileChooser.saveButtonToolTipText=\u9078\u629E\u3057\u305F\u30D5\u30A1\u30A4\u30EB\u3092\u4FDD\u5B58\u3057\u307E\u3059\u3002
-FileChooser.openButtonToolTipText=\u9078\u629E\u3057\u305F\u30D5\u30A1\u30A4\u30EB\u3092\u958B\u304D\u307E\u3059\u3002
-FileChooser.updateButtonToolTipText=\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u306E\u30EA\u30B9\u30C8\u3092\u66F4\u65B0\u3057\u307E\u3059\u3002
-FileChooser.helpButtonToolTipText=FileChooser\u306E\u30D8\u30EB\u30D7\u3067\u3059\u3002
+FileChooser.cancelButtonToolTip.textAndMnemonic=\u30D5\u30A1\u30A4\u30EB\u30FB\u30C1\u30E5\u30FC\u30B6\u30FB\u30C0\u30A4\u30A2\u30ED\u30B0\u3092\u7D42\u4E86\u3057\u307E\u3059\u3002
+FileChooser.saveButtonToolTip.textAndMnemonic=\u9078\u629E\u3057\u305F\u30D5\u30A1\u30A4\u30EB\u3092\u4FDD\u5B58\u3057\u307E\u3059\u3002
+FileChooser.openButtonToolTip.textAndMnemonic=\u9078\u629E\u3057\u305F\u30D5\u30A1\u30A4\u30EB\u3092\u958B\u304D\u307E\u3059\u3002
+FileChooser.updateButtonToolTip.textAndMnemonic=\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u306E\u30EA\u30B9\u30C8\u3092\u66F4\u65B0\u3057\u307E\u3059\u3002
+FileChooser.helpButtonToolTip.textAndMnemonic=FileChooser\u306E\u30D8\u30EB\u30D7\u3067\u3059\u3002
--- a/src/share/classes/com/sun/java/swing/plaf/motif/resources/motif_ko.properties	Fri May 25 12:56:22 2012 +0400
+++ b/src/share/classes/com/sun/java/swing/plaf/motif/resources/motif_ko.properties	Fri May 25 19:34:32 2012 -0700
@@ -18,28 +18,23 @@
 
 ############ FILE CHOOSER STRINGS #############
 
-FileChooser.acceptAllFileFilterText=*
-FileChooser.cancelButtonText=\uCDE8\uC18C
-FileChooser.saveButtonText=\uC800\uC7A5
-FileChooser.openButtonText=\uD655\uC778
-FileChooser.saveDialogTitleText=\uC800\uC7A5
-FileChooser.openDialogTitleText=\uC5F4\uAE30
-FileChooser.updateButtonText=\uAC31\uC2E0
-FileChooser.helpButtonText=\uB3C4\uC6C0\uB9D0
-FileChooser.pathLabelText=\uACBD\uB85C \uB610\uB294 \uD3F4\uB354 \uC774\uB984 \uC785\uB825:
-FileChooser.pathLabelMnemonic=80
-FileChooser.filterLabelText=\uD544\uD130
-FileChooser.filterLabelMnemonic=82
-FileChooser.foldersLabelText=\uD3F4\uB354
-FileChooser.foldersLabelMnemonic=76
-FileChooser.filesLabelText=\uD30C\uC77C
-FileChooser.filesLabelMnemonic=73
-FileChooser.enterFileNameLabelText=\uD30C\uC77C \uC774\uB984 \uC785\uB825:
-FileChooser.enterFileNameLabelMnemonic=78
-FileChooser.enterFolderNameLabelText=\uD3F4\uB354 \uC774\uB984 \uC785\uB825:
+FileChooser.acceptAllFileFilter.textAndMnemonic=*
+FileChooser.cancelButton.textAndMnemonic=\uCDE8\uC18C
+FileChooser.saveButton.textAndMnemonic=\uC800\uC7A5
+FileChooser.openButton.textAndMnemonic=\uD655\uC778
+FileChooser.saveDialogTitle.textAndMnemonic=\uC800\uC7A5
+FileChooser.openDialogTitle.textAndMnemonic=\uC5F4\uAE30
+FileChooser.updateButton.textAndMnemonic=\uAC31\uC2E0
+FileChooser.helpButton.textAndMnemonic=\uB3C4\uC6C0\uB9D0
+FileChooser.pathLabel.textAndMnemonic=\uACBD\uB85C \uB610\uB294 \uD3F4\uB354 \uC774\uB984 \uC785\uB825(&P):
+FileChooser.filterLabel.textAndMnemonic=\uD544\uD130(&R)
+FileChooser.foldersLabel.textAndMnemonic=\uD3F4\uB354(&L)
+FileChooser.filesLabel.textAndMnemonic=\uD30C\uC77C(&I)
+FileChooser.enterFileNameLabel.textAndMnemonic=\uD30C\uC77C \uC774\uB984 \uC785\uB825(&N):
+FileChooser.enterFolderNameLabel.textAndMnemonic=\uD3F4\uB354 \uC774\uB984 \uC785\uB825:
 
-FileChooser.cancelButtonToolTipText=\uD30C\uC77C \uC120\uD0DD\uAE30 \uB300\uD654\uC0C1\uC790\uB97C \uC911\uB2E8\uD569\uB2C8\uB2E4.
-FileChooser.saveButtonToolTipText=\uC120\uD0DD\uB41C \uD30C\uC77C\uC744 \uC800\uC7A5\uD569\uB2C8\uB2E4.
-FileChooser.openButtonToolTipText=\uC120\uD0DD\uB41C \uD30C\uC77C\uC744 \uC5FD\uB2C8\uB2E4.
-FileChooser.updateButtonToolTipText=\uB514\uB809\uD1A0\uB9AC \uBAA9\uB85D\uC744 \uAC31\uC2E0\uD569\uB2C8\uB2E4.
-FileChooser.helpButtonToolTipText=FileChooser \uB3C4\uC6C0\uB9D0\uC785\uB2C8\uB2E4.
+FileChooser.cancelButtonToolTip.textAndMnemonic=\uD30C\uC77C \uC120\uD0DD\uAE30 \uB300\uD654\uC0C1\uC790\uB97C \uC911\uB2E8\uD569\uB2C8\uB2E4.
+FileChooser.saveButtonToolTip.textAndMnemonic=\uC120\uD0DD\uB41C \uD30C\uC77C\uC744 \uC800\uC7A5\uD569\uB2C8\uB2E4.
+FileChooser.openButtonToolTip.textAndMnemonic=\uC120\uD0DD\uB41C \uD30C\uC77C\uC744 \uC5FD\uB2C8\uB2E4.
+FileChooser.updateButtonToolTip.textAndMnemonic=\uB514\uB809\uD1A0\uB9AC \uBAA9\uB85D\uC744 \uAC31\uC2E0\uD569\uB2C8\uB2E4.
+FileChooser.helpButtonToolTip.textAndMnemonic=FileChooser \uB3C4\uC6C0\uB9D0\uC785\uB2C8\uB2E4.
--- a/src/share/classes/com/sun/java/swing/plaf/motif/resources/motif_pt_BR.properties	Fri May 25 12:56:22 2012 +0400
+++ b/src/share/classes/com/sun/java/swing/plaf/motif/resources/motif_pt_BR.properties	Fri May 25 19:34:32 2012 -0700
@@ -18,28 +18,23 @@
 
 ############ FILE CHOOSER STRINGS #############
 
-FileChooser.acceptAllFileFilterText=*
-FileChooser.cancelButtonText=Cancelar
-FileChooser.saveButtonText=Salvar
-FileChooser.openButtonText=OK
-FileChooser.saveDialogTitleText=Salvar
-FileChooser.openDialogTitleText=Abrir
-FileChooser.updateButtonText=Atualizar
-FileChooser.helpButtonText=Ajuda
-FileChooser.pathLabelText=Informar caminho ou nome da pasta:
-FileChooser.pathLabelMnemonic=80
-FileChooser.filterLabelText=Filtro
-FileChooser.filterLabelMnemonic=82
-FileChooser.foldersLabelText=Pastas
-FileChooser.foldersLabelMnemonic=76
-FileChooser.filesLabelText=Arquivos
-FileChooser.filesLabelMnemonic=73
-FileChooser.enterFileNameLabelText=Informar nome do arquivo:
-FileChooser.enterFileNameLabelMnemonic=78
-FileChooser.enterFolderNameLabelText=Informar nome da pasta:
+FileChooser.acceptAllFileFilter.textAndMnemonic=*
+FileChooser.cancelButton.textAndMnemonic=Cancelar
+FileChooser.saveButton.textAndMnemonic=Salvar
+FileChooser.openButton.textAndMnemonic=OK
+FileChooser.saveDialogTitle.textAndMnemonic=Salvar
+FileChooser.openDialogTitle.textAndMnemonic=Abrir
+FileChooser.updateButton.textAndMnemonic=Atualizar
+FileChooser.helpButton.textAndMnemonic=Ajuda
+FileChooser.pathLabel.textAndMnemonic=Informar caminho ou nome da &pasta:
+FileChooser.filterLabel.textAndMnemonic=Filt&ro
+FileChooser.foldersLabel.textAndMnemonic=Pastas(&L)
+FileChooser.filesLabel.textAndMnemonic=Arqu&ivos
+FileChooser.enterFileNameLabel.textAndMnemonic=I&nformar nome do arquivo:
+FileChooser.enterFolderNameLabel.textAndMnemonic=Informar nome da pasta:
 
-FileChooser.cancelButtonToolTipText=Abortar caixa de di\u00E1logo do seletor de arquivos.
-FileChooser.saveButtonToolTipText=Salvar arquivo selecionado.
-FileChooser.openButtonToolTipText=Abrir arquivo selecionado.
-FileChooser.updateButtonToolTipText=Atualizar lista de diret\u00F3rios.
-FileChooser.helpButtonToolTipText=Ajuda do FileChooser.
+FileChooser.cancelButtonToolTip.textAndMnemonic=Abortar caixa de di\u00E1logo do seletor de arquivos.
+FileChooser.saveButtonToolTip.textAndMnemonic=Salvar arquivo selecionado.
+FileChooser.openButtonToolTip.textAndMnemonic=Abrir arquivo selecionado.
+FileChooser.updateButtonToolTip.textAndMnemonic=Atualizar lista de diret\u00F3rios.
+FileChooser.helpButtonToolTip.textAndMnemonic=Ajuda do FileChooser.
--- a/src/share/classes/com/sun/java/swing/plaf/motif/resources/motif_sv.properties	Fri May 25 12:56:22 2012 +0400
+++ b/src/share/classes/com/sun/java/swing/plaf/motif/resources/motif_sv.properties	Fri May 25 19:34:32 2012 -0700
@@ -18,28 +18,23 @@
 
 ############ FILE CHOOSER STRINGS #############
 
-FileChooser.acceptAllFileFilterText=*
-FileChooser.cancelButtonText=Avbryt
-FileChooser.saveButtonText=Spara
-FileChooser.openButtonText=OK
-FileChooser.saveDialogTitleText=Spara
-FileChooser.openDialogTitleText=\u00D6ppna
-FileChooser.updateButtonText=Uppdatera
-FileChooser.helpButtonText=Hj\u00E4lp
-FileChooser.pathLabelText=Ange s\u00F6kv\u00E4g eller mappnamn:
-FileChooser.pathLabelMnemonic=80
-FileChooser.filterLabelText=Filter
-FileChooser.filterLabelMnemonic=82
-FileChooser.foldersLabelText=Mappar
-FileChooser.foldersLabelMnemonic=76
-FileChooser.filesLabelText=Filer
-FileChooser.filesLabelMnemonic=73
-FileChooser.enterFileNameLabelText=Ange filnamn:
-FileChooser.enterFileNameLabelMnemonic=78
-FileChooser.enterFolderNameLabelText=Ange ett mappnamn:
+FileChooser.acceptAllFileFilter.textAndMnemonic=*
+FileChooser.cancelButton.textAndMnemonic=Avbryt
+FileChooser.saveButton.textAndMnemonic=Spara
+FileChooser.openButton.textAndMnemonic=OK
+FileChooser.saveDialogTitle.textAndMnemonic=Spara
+FileChooser.openDialogTitle.textAndMnemonic=\u00D6ppna
+FileChooser.updateButton.textAndMnemonic=Uppdatera
+FileChooser.helpButton.textAndMnemonic=Hj\u00E4lp
+FileChooser.pathLabel.textAndMnemonic=Ange s\u00F6kv\u00E4g eller mappnamn(&P):
+FileChooser.filterLabel.textAndMnemonic=Filte&r
+FileChooser.foldersLabel.textAndMnemonic=Mappar(&L)
+FileChooser.filesLabel.textAndMnemonic=F&iler
+FileChooser.enterFileNameLabel.textAndMnemonic=A&nge filnamn:
+FileChooser.enterFolderNameLabel.textAndMnemonic=Ange ett mappnamn:
 
-FileChooser.cancelButtonToolTipText=Avbryt dialogrutan Filv\u00E4ljare.
-FileChooser.saveButtonToolTipText=Spara vald fil.
-FileChooser.openButtonToolTipText=\u00D6ppna vald fil.
-FileChooser.updateButtonToolTipText=Uppdatera kataloglistan.
-FileChooser.helpButtonToolTipText=Hj\u00E4lp - Filv\u00E4ljare.
+FileChooser.cancelButtonToolTip.textAndMnemonic=Avbryt dialogrutan Filv\u00E4ljare.
+FileChooser.saveButtonToolTip.textAndMnemonic=Spara vald fil.
+FileChooser.openButtonToolTip.textAndMnemonic=\u00D6ppna vald fil.
+FileChooser.updateButtonToolTip.textAndMnemonic=Uppdatera kataloglistan.
+FileChooser.helpButtonToolTip.textAndMnemonic=Hj\u00E4lp - Filv\u00E4ljare.
--- a/src/share/classes/com/sun/java/swing/plaf/motif/resources/motif_zh_CN.properties	Fri May 25 12:56:22 2012 +0400
+++ b/src/share/classes/com/sun/java/swing/plaf/motif/resources/motif_zh_CN.properties	Fri May 25 19:34:32 2012 -0700
@@ -18,28 +18,23 @@
 
 ############ FILE CHOOSER STRINGS #############
 
-FileChooser.acceptAllFileFilterText=*
-FileChooser.cancelButtonText=\u53D6\u6D88
-FileChooser.saveButtonText=\u4FDD\u5B58
-FileChooser.openButtonText=\u786E\u5B9A
-FileChooser.saveDialogTitleText=\u4FDD\u5B58
-FileChooser.openDialogTitleText=\u6253\u5F00
-FileChooser.updateButtonText=\u66F4\u65B0
-FileChooser.helpButtonText=\u5E2E\u52A9
-FileChooser.pathLabelText=\u952E\u5165\u8DEF\u5F84\u6216\u6587\u4EF6\u5939\u540D: 
-FileChooser.pathLabelMnemonic=80
-FileChooser.filterLabelText=\u7B5B\u9009\u5668
-FileChooser.filterLabelMnemonic=82
-FileChooser.foldersLabelText=\u6587\u4EF6\u5939
-FileChooser.foldersLabelMnemonic=76
-FileChooser.filesLabelText=\u6587\u4EF6
-FileChooser.filesLabelMnemonic=73
-FileChooser.enterFileNameLabelText=\u952E\u5165\u6587\u4EF6\u540D: 
-FileChooser.enterFileNameLabelMnemonic=78
-FileChooser.enterFolderNameLabelText=\u8F93\u5165\u6587\u4EF6\u5939\u540D:
+FileChooser.acceptAllFileFilter.textAndMnemonic=*
+FileChooser.cancelButton.textAndMnemonic=\u53D6\u6D88
+FileChooser.saveButton.textAndMnemonic=\u4FDD\u5B58
+FileChooser.openButton.textAndMnemonic=\u786E\u5B9A
+FileChooser.saveDialogTitle.textAndMnemonic=\u4FDD\u5B58
+FileChooser.openDialogTitle.textAndMnemonic=\u6253\u5F00
+FileChooser.updateButton.textAndMnemonic=\u66F4\u65B0
+FileChooser.helpButton.textAndMnemonic=\u5E2E\u52A9
+FileChooser.pathLabel.textAndMnemonic=\u952E\u5165\u8DEF\u5F84\u6216\u6587\u4EF6\u5939\u540D: (&P)
+FileChooser.filterLabel.textAndMnemonic=\u7B5B\u9009\u5668(&R)
+FileChooser.foldersLabel.textAndMnemonic=\u6587\u4EF6\u5939(&L)
+FileChooser.filesLabel.textAndMnemonic=\u6587\u4EF6(&I)
+FileChooser.enterFileNameLabel.textAndMnemonic=\u952E\u5165\u6587\u4EF6\u540D: (&N)
+FileChooser.enterFolderNameLabel.textAndMnemonic=\u8F93\u5165\u6587\u4EF6\u5939\u540D:
 
-FileChooser.cancelButtonToolTipText=\u4E2D\u6B62\u6587\u4EF6\u9009\u62E9\u5668\u5BF9\u8BDD\u6846\u3002
-FileChooser.saveButtonToolTipText=\u4FDD\u5B58\u6240\u9009\u6587\u4EF6\u3002
-FileChooser.openButtonToolTipText=\u6253\u5F00\u6240\u9009\u6587\u4EF6\u3002
-FileChooser.updateButtonToolTipText=\u66F4\u65B0\u76EE\u5F55\u5217\u8868\u3002
-FileChooser.helpButtonToolTipText=FileChooser \u5E2E\u52A9\u3002
+FileChooser.cancelButtonToolTip.textAndMnemonic=\u4E2D\u6B62\u6587\u4EF6\u9009\u62E9\u5668\u5BF9\u8BDD\u6846\u3002
+FileChooser.saveButtonToolTip.textAndMnemonic=\u4FDD\u5B58\u6240\u9009\u6587\u4EF6\u3002
+FileChooser.openButtonToolTip.textAndMnemonic=\u6253\u5F00\u6240\u9009\u6587\u4EF6\u3002
+FileChooser.updateButtonToolTip.textAndMnemonic=\u66F4\u65B0\u76EE\u5F55\u5217\u8868\u3002
+FileChooser.helpButtonToolTip.textAndMnemonic=FileChooser \u5E2E\u52A9\u3002
--- a/src/share/classes/com/sun/java/swing/plaf/motif/resources/motif_zh_TW.properties	Fri May 25 12:56:22 2012 +0400
+++ b/src/share/classes/com/sun/java/swing/plaf/motif/resources/motif_zh_TW.properties	Fri May 25 19:34:32 2012 -0700
@@ -18,28 +18,23 @@
 
 ############ FILE CHOOSER STRINGS #############
 
-FileChooser.acceptAllFileFilterText=*
-FileChooser.cancelButtonText=\u53D6\u6D88
-FileChooser.saveButtonText=\u5132\u5B58
-FileChooser.openButtonText=\u78BA\u5B9A
-FileChooser.saveDialogTitleText=\u5132\u5B58
-FileChooser.openDialogTitleText=\u958B\u555F
-FileChooser.updateButtonText=\u66F4\u65B0
-FileChooser.helpButtonText=\u8AAA\u660E
-FileChooser.pathLabelText=\u8F38\u5165\u8DEF\u5F91\u6216\u8CC7\u6599\u593E\u540D\u7A31:
-FileChooser.pathLabelMnemonic=80
-FileChooser.filterLabelText=\u7BE9\u9078
-FileChooser.filterLabelMnemonic=82
-FileChooser.foldersLabelText=\u8CC7\u6599\u593E
-FileChooser.foldersLabelMnemonic=76
-FileChooser.filesLabelText=\u6A94\u6848
-FileChooser.filesLabelMnemonic=73
-FileChooser.enterFileNameLabelText=\u8F38\u5165\u6A94\u6848\u540D\u7A31:
-FileChooser.enterFileNameLabelMnemonic=78
-FileChooser.enterFolderNameLabelText=\u8F38\u5165\u8CC7\u6599\u593E\u540D\u7A31:
+FileChooser.acceptAllFileFilter.textAndMnemonic=*
+FileChooser.cancelButton.textAndMnemonic=\u53D6\u6D88
+FileChooser.saveButton.textAndMnemonic=\u5132\u5B58
+FileChooser.openButton.textAndMnemonic=\u78BA\u5B9A
+FileChooser.saveDialogTitle.textAndMnemonic=\u5132\u5B58
+FileChooser.openDialogTitle.textAndMnemonic=\u958B\u555F
+FileChooser.updateButton.textAndMnemonic=\u66F4\u65B0
+FileChooser.helpButton.textAndMnemonic=\u8AAA\u660E
+FileChooser.pathLabel.textAndMnemonic=\u8F38\u5165\u8DEF\u5F91\u6216\u8CC7\u6599\u593E\u540D\u7A31(&P):
+FileChooser.filterLabel.textAndMnemonic=\u7BE9\u9078(&R)
+FileChooser.foldersLabel.textAndMnemonic=\u8CC7\u6599\u593E(&L)
+FileChooser.filesLabel.textAndMnemonic=\u6A94\u6848(&I)
+FileChooser.enterFileNameLabel.textAndMnemonic=\u8F38\u5165\u6A94\u6848\u540D\u7A31(&N):
+FileChooser.enterFolderNameLabel.textAndMnemonic=\u8F38\u5165\u8CC7\u6599\u593E\u540D\u7A31:
 
-FileChooser.cancelButtonToolTipText=\u4E2D\u6B62\u6A94\u6848\u9078\u64C7\u5668\u5C0D\u8A71\u65B9\u584A\u3002
-FileChooser.saveButtonToolTipText=\u5132\u5B58\u9078\u53D6\u7684\u6A94\u6848\u3002
-FileChooser.openButtonToolTipText=\u958B\u555F\u9078\u53D6\u7684\u6A94\u6848\u3002
-FileChooser.updateButtonToolTipText=\u66F4\u65B0\u76EE\u9304\u6E05\u55AE\u3002
-FileChooser.helpButtonToolTipText=\u300C\u6A94\u6848\u9078\u64C7\u5668\u300D\u8AAA\u660E\u3002
+FileChooser.cancelButtonToolTip.textAndMnemonic=\u4E2D\u6B62\u6A94\u6848\u9078\u64C7\u5668\u5C0D\u8A71\u65B9\u584A\u3002
+FileChooser.saveButtonToolTip.textAndMnemonic=\u5132\u5B58\u9078\u53D6\u7684\u6A94\u6848\u3002
+FileChooser.openButtonToolTip.textAndMnemonic=\u958B\u555F\u9078\u53D6\u7684\u6A94\u6848\u3002
+FileChooser.updateButtonToolTip.textAndMnemonic=\u66F4\u65B0\u76EE\u9304\u6E05\u55AE\u3002
+FileChooser.helpButtonToolTip.textAndMnemonic=\u300C\u6A94\u6848\u9078\u64C7\u5668\u300D\u8AAA\u660E\u3002
--- a/src/share/classes/com/sun/java/swing/plaf/windows/resources/windows.properties	Fri May 25 12:56:22 2012 +0400
+++ b/src/share/classes/com/sun/java/swing/plaf/windows/resources/windows.properties	Fri May 25 19:34:32 2012 -0700
@@ -18,34 +18,30 @@
 
 ############ FILE CHOOSER STRINGS #############
 
-FileChooser.lookInLabelText=Look in:
-FileChooser.lookInLabelMnemonic=73
-FileChooser.saveInLabelText=Save in:
-FileChooser.fileNameLabelText=File name:
-FileChooser.fileNameLabelMnemonic=78
-FileChooser.folderNameLabelText=Folder name:
-FileChooser.folderNameLabelMnemonic=78
-FileChooser.filesOfTypeLabelText=Files of type:
-FileChooser.filesOfTypeLabelMnemonic=84
-FileChooser.upFolderToolTipText=Up One Level
+FileChooser.lookInLabel.textAndMnemonic=Look &in:
+FileChooser.saveInLabel.textAndMnemonic=Save in:
+FileChooser.fileNameLabel.textAndMnemonic=File &name:
+FileChooser.folderNameLabel.textAndMnemonic=Folder &name:
+FileChooser.filesOfTypeLabel.textAndMnemonic=Files of &type:
+FileChooser.upFolderToolTip.textAndMnemonic=Up One Level
 FileChooser.upFolderAccessibleName=Up
-FileChooser.homeFolderToolTipText=Home
+FileChooser.homeFolderToolTip.textAndMnemonic=Home
 FileChooser.homeFolderAccessibleName=Home
-FileChooser.newFolderToolTipText=Create New Folder
+FileChooser.newFolderToolTip.textAndMnemonic=Create New Folder
 FileChooser.newFolderAccessibleName=New Folder
-FileChooser.newFolderActionLabelText=New Folder
-FileChooser.listViewButtonToolTipText=List
+FileChooser.newFolderActionLabel.textAndMnemonic=New Folder
+FileChooser.listViewButtonToolTip.textAndMnemonic=List
 FileChooser.listViewButtonAccessibleName=List
-FileChooser.listViewActionLabelText=List
-FileChooser.detailsViewButtonToolTipText=Details
+FileChooser.listViewActionLabel.textAndMnemonic=List
+FileChooser.detailsViewButtonToolTip.textAndMnemonic=Details
 FileChooser.detailsViewButtonAccessibleName=Details
 FileChooser.viewMenuButtonToolTipText = View Menu
 FileChooser.viewMenuButtonAccessibleName = View Menu
-FileChooser.detailsViewActionLabelText=Details
-FileChooser.refreshActionLabelText=Refresh
-FileChooser.viewMenuLabelText=View
-FileChooser.fileNameHeaderText=Name
-FileChooser.fileSizeHeaderText=Size
-FileChooser.fileTypeHeaderText=Type
-FileChooser.fileDateHeaderText=Modified
-FileChooser.fileAttrHeaderText=Attributes
+FileChooser.detailsViewActionLabel.textAndMnemonic=Details
+FileChooser.refreshActionLabel.textAndMnemonic=Refresh
+FileChooser.viewMenuLabel.textAndMnemonic=View
+FileChooser.fileNameHeader.textAndMnemonic=Name
+FileChooser.fileSizeHeader.textAndMnemonic=Size
+FileChooser.fileTypeHeader.textAndMnemonic=Type
+FileChooser.fileDateHeader.textAndMnemonic=Modified
+FileChooser.fileAttrHeader.textAndMnemonic=Attributes
--- a/src/share/classes/com/sun/java/swing/plaf/windows/resources/windows_de.properties	Fri May 25 12:56:22 2012 +0400
+++ b/src/share/classes/com/sun/java/swing/plaf/windows/resources/windows_de.properties	Fri May 25 19:34:32 2012 -0700
@@ -18,34 +18,30 @@
 
 ############ FILE CHOOSER STRINGS #############
 
-FileChooser.lookInLabelText=Suchen in:
-FileChooser.lookInLabelMnemonic=73
-FileChooser.saveInLabelText=Speichern in:
-FileChooser.fileNameLabelText=Dateiname:
-FileChooser.fileNameLabelMnemonic=78
-FileChooser.folderNameLabelText=Ordnername:
-FileChooser.folderNameLabelMnemonic=78
-FileChooser.filesOfTypeLabelText=Dateityp:
-FileChooser.filesOfTypeLabelMnemonic=84
-FileChooser.upFolderToolTipText=Eine Ebene h\u00F6her
+FileChooser.lookInLabel.textAndMnemonic=Suchen &in:
+FileChooser.saveInLabel.textAndMnemonic=Speichern in:
+FileChooser.fileNameLabel.textAndMnemonic=Datei&name:
+FileChooser.folderNameLabel.textAndMnemonic=Ord&nername:
+FileChooser.filesOfTypeLabel.textAndMnemonic=Da&teityp:
+FileChooser.upFolderToolTip.textAndMnemonic=Eine Ebene h\u00F6her
 FileChooser.upFolderAccessibleName=Nach oben
-FileChooser.homeFolderToolTipText=Home
+FileChooser.homeFolderToolTip.textAndMnemonic=Home
 FileChooser.homeFolderAccessibleName=Home
-FileChooser.newFolderToolTipText=Neuen Ordner erstellen
+FileChooser.newFolderToolTip.textAndMnemonic=Neuen Ordner erstellen
 FileChooser.newFolderAccessibleName=Neuer Ordner
-FileChooser.newFolderActionLabelText=Neuer Ordner
-FileChooser.listViewButtonToolTipText=Liste
+FileChooser.newFolderActionLabel.textAndMnemonic=Neuer Ordner
+FileChooser.listViewButtonToolTip.textAndMnemonic=Liste
 FileChooser.listViewButtonAccessibleName=Liste
-FileChooser.listViewActionLabelText=Liste
-FileChooser.detailsViewButtonToolTipText=Details
+FileChooser.listViewActionLabel.textAndMnemonic=Liste
+FileChooser.detailsViewButtonToolTip.textAndMnemonic=Details
 FileChooser.detailsViewButtonAccessibleName=Details
 FileChooser.viewMenuButtonToolTipText = Ansichtsmen\u00FC
 FileChooser.viewMenuButtonAccessibleName = Ansichtsmen\u00FC
-FileChooser.detailsViewActionLabelText=Details
-FileChooser.refreshActionLabelText=Aktualisieren
-FileChooser.viewMenuLabelText=Ansicht
-FileChooser.fileNameHeaderText=Name
-FileChooser.fileSizeHeaderText=Gr\u00F6\u00DFe
-FileChooser.fileTypeHeaderText=Typ
-FileChooser.fileDateHeaderText=Ge\u00E4ndert
-FileChooser.fileAttrHeaderText=Attribute
+FileChooser.detailsViewActionLabel.textAndMnemonic=Details
+FileChooser.refreshActionLabel.textAndMnemonic=Aktualisieren
+FileChooser.viewMenuLabel.textAndMnemonic=Ansicht
+FileChooser.fileNameHeader.textAndMnemonic=Name
+FileChooser.fileSizeHeader.textAndMnemonic=Gr\u00F6\u00DFe
+FileChooser.fileTypeHeader.textAndMnemonic=Typ
+FileChooser.fileDateHeader.textAndMnemonic=Ge\u00E4ndert
+FileChooser.fileAttrHeader.textAndMnemonic=Attribute
--- a/src/share/classes/com/sun/java/swing/plaf/windows/resources/windows_es.properties	Fri May 25 12:56:22 2012 +0400
+++ b/src/share/classes/com/sun/java/swing/plaf/windows/resources/windows_es.properties	Fri May 25 19:34:32 2012 -0700
@@ -18,34 +18,30 @@
 
 ############ FILE CHOOSER STRINGS #############
 
-FileChooser.lookInLabelText=Buscar en:
-FileChooser.lookInLabelMnemonic=73
-FileChooser.saveInLabelText=Guardar en:
-FileChooser.fileNameLabelText=Nombre de Archivo:
-FileChooser.fileNameLabelMnemonic=78
-FileChooser.folderNameLabelText=Nombre de la Carpeta:
-FileChooser.folderNameLabelMnemonic=78
-FileChooser.filesOfTypeLabelText=Archivos de Tipo:
-FileChooser.filesOfTypeLabelMnemonic=84
-FileChooser.upFolderToolTipText=Subir un Nivel
+FileChooser.lookInLabel.textAndMnemonic=Buscar en(&I):
+FileChooser.saveInLabel.textAndMnemonic=Guardar en:
+FileChooser.fileNameLabel.textAndMnemonic=&Nombre de Archivo:
+FileChooser.folderNameLabel.textAndMnemonic=&Nombre de la Carpeta:
+FileChooser.filesOfTypeLabel.textAndMnemonic=Archivos de &Tipo:
+FileChooser.upFolderToolTip.textAndMnemonic=Subir un Nivel
 FileChooser.upFolderAccessibleName=Arriba
-FileChooser.homeFolderToolTipText=Inicio
+FileChooser.homeFolderToolTip.textAndMnemonic=Inicio
 FileChooser.homeFolderAccessibleName=Inicio
-FileChooser.newFolderToolTipText=Crear Nueva Carpeta
+FileChooser.newFolderToolTip.textAndMnemonic=Crear Nueva Carpeta
 FileChooser.newFolderAccessibleName=Nueva Carpeta
-FileChooser.newFolderActionLabelText=Nueva Carpeta
-FileChooser.listViewButtonToolTipText=Lista
+FileChooser.newFolderActionLabel.textAndMnemonic=Nueva Carpeta
+FileChooser.listViewButtonToolTip.textAndMnemonic=Lista
 FileChooser.listViewButtonAccessibleName=Lista
-FileChooser.listViewActionLabelText=Lista
-FileChooser.detailsViewButtonToolTipText=Detalles
+FileChooser.listViewActionLabel.textAndMnemonic=Lista
+FileChooser.detailsViewButtonToolTip.textAndMnemonic=Detalles
 FileChooser.detailsViewButtonAccessibleName=Detalles
 FileChooser.viewMenuButtonToolTipText = Men\u00FA Ver
 FileChooser.viewMenuButtonAccessibleName = Men\u00FA Ver
-FileChooser.detailsViewActionLabelText=Detalles
-FileChooser.refreshActionLabelText=Refrescar
-FileChooser.viewMenuLabelText=Ver
-FileChooser.fileNameHeaderText=Nombre
-FileChooser.fileSizeHeaderText=Tama\u00F1o
-FileChooser.fileTypeHeaderText=Tipo
-FileChooser.fileDateHeaderText=Modificado
-FileChooser.fileAttrHeaderText=Atributos
+FileChooser.detailsViewActionLabel.textAndMnemonic=Detalles
+FileChooser.refreshActionLabel.textAndMnemonic=Refrescar
+FileChooser.viewMenuLabel.textAndMnemonic=Ver
+FileChooser.fileNameHeader.textAndMnemonic=Nombre
+FileChooser.fileSizeHeader.textAndMnemonic=Tama\u00F1o
+FileChooser.fileTypeHeader.textAndMnemonic=Tipo
+FileChooser.fileDateHeader.textAndMnemonic=Modificado
+FileChooser.fileAttrHeader.textAndMnemonic=Atributos
--- a/src/share/classes/com/sun/java/swing/plaf/windows/resources/windows_fr.properties	Fri May 25 12:56:22 2012 +0400
+++ b/src/share/classes/com/sun/java/swing/plaf/windows/resources/windows_fr.properties	Fri May 25 19:34:32 2012 -0700
@@ -18,34 +18,30 @@
 
 ############ FILE CHOOSER STRINGS #############
 
-FileChooser.lookInLabelText=Rechercher dans :
-FileChooser.lookInLabelMnemonic=73
-FileChooser.saveInLabelText=Enregistrer dans :
-FileChooser.fileNameLabelText=Nom du fichier :
-FileChooser.fileNameLabelMnemonic=78
-FileChooser.folderNameLabelText=Nom du dossier :
-FileChooser.folderNameLabelMnemonic=78
-FileChooser.filesOfTypeLabelText=Fichiers de type :
-FileChooser.filesOfTypeLabelMnemonic=84
-FileChooser.upFolderToolTipText=Remonte d'un niveau.
+FileChooser.lookInLabel.textAndMnemonic=Rechercher dans (&I):
+FileChooser.saveInLabel.textAndMnemonic=Enregistrer dans :
+FileChooser.fileNameLabel.textAndMnemonic=&Nom du fichier :
+FileChooser.folderNameLabel.textAndMnemonic=&Nom du dossier :
+FileChooser.filesOfTypeLabel.textAndMnemonic=Fichiers de &type :
+FileChooser.upFolderToolTip.textAndMnemonic=Remonte d'un niveau.
 FileChooser.upFolderAccessibleName=Monter
-FileChooser.homeFolderToolTipText=R\u00E9pertoire d'origine
+FileChooser.homeFolderToolTip.textAndMnemonic=R\u00E9pertoire d'origine
 FileChooser.homeFolderAccessibleName=R\u00E9pertoire d'origine
-FileChooser.newFolderToolTipText=Cr\u00E9e un dossier.
+FileChooser.newFolderToolTip.textAndMnemonic=Cr\u00E9e un dossier.
 FileChooser.newFolderAccessibleName=Nouveau dossier
-FileChooser.newFolderActionLabelText=Nouveau dossier
-FileChooser.listViewButtonToolTipText=Liste
+FileChooser.newFolderActionLabel.textAndMnemonic=Nouveau dossier
+FileChooser.listViewButtonToolTip.textAndMnemonic=Liste
 FileChooser.listViewButtonAccessibleName=Liste
-FileChooser.listViewActionLabelText=Liste
-FileChooser.detailsViewButtonToolTipText=D\u00E9tails
+FileChooser.listViewActionLabel.textAndMnemonic=Liste
+FileChooser.detailsViewButtonToolTip.textAndMnemonic=D\u00E9tails
 FileChooser.detailsViewButtonAccessibleName=D\u00E9tails
 FileChooser.viewMenuButtonToolTipText = Menu Affichage
 FileChooser.viewMenuButtonAccessibleName = Menu Affichage
-FileChooser.detailsViewActionLabelText=D\u00E9tails
-FileChooser.refreshActionLabelText=Actualiser
-FileChooser.viewMenuLabelText=Affichage
-FileChooser.fileNameHeaderText=Nom
-FileChooser.fileSizeHeaderText=Taille
-FileChooser.fileTypeHeaderText=Type
-FileChooser.fileDateHeaderText=Modifi\u00E9
-FileChooser.fileAttrHeaderText=Attributs
+FileChooser.detailsViewActionLabel.textAndMnemonic=D\u00E9tails
+FileChooser.refreshActionLabel.textAndMnemonic=Actualiser
+FileChooser.viewMenuLabel.textAndMnemonic=Affichage
+FileChooser.fileNameHeader.textAndMnemonic=Nom
+FileChooser.fileSizeHeader.textAndMnemonic=Taille
+FileChooser.fileTypeHeader.textAndMnemonic=Type
+FileChooser.fileDateHeader.textAndMnemonic=Modifi\u00E9
+FileChooser.fileAttrHeader.textAndMnemonic=Attributs
--- a/src/share/classes/com/sun/java/swing/plaf/windows/resources/windows_it.properties	Fri May 25 12:56:22 2012 +0400
+++ b/src/share/classes/com/sun/java/swing/plaf/windows/resources/windows_it.properties	Fri May 25 19:34:32 2012 -0700
@@ -18,34 +18,30 @@
 
 ############ FILE CHOOSER STRINGS #############
 
-FileChooser.lookInLabelText=Cerca in:
-FileChooser.lookInLabelMnemonic=73
-FileChooser.saveInLabelText=Salva in:
-FileChooser.fileNameLabelText=Nome file:
-FileChooser.fileNameLabelMnemonic=78
-FileChooser.folderNameLabelText=Nome della cartella:
-FileChooser.folderNameLabelMnemonic=78
-FileChooser.filesOfTypeLabelText=Tipo file:
-FileChooser.filesOfTypeLabelMnemonic=84
-FileChooser.upFolderToolTipText=Cartella superiore
+FileChooser.lookInLabel.textAndMnemonic=Cerca &in:
+FileChooser.saveInLabel.textAndMnemonic=Salva in:
+FileChooser.fileNameLabel.textAndMnemonic=&Nome file:
+FileChooser.folderNameLabel.textAndMnemonic=&Nome della cartella:
+FileChooser.filesOfTypeLabel.textAndMnemonic=&Tipo file:
+FileChooser.upFolderToolTip.textAndMnemonic=Cartella superiore
 FileChooser.upFolderAccessibleName=Superiore
-FileChooser.homeFolderToolTipText=Home
+FileChooser.homeFolderToolTip.textAndMnemonic=Home
 FileChooser.homeFolderAccessibleName=Home
-FileChooser.newFolderToolTipText=Crea nuova cartella
+FileChooser.newFolderToolTip.textAndMnemonic=Crea nuova cartella
 FileChooser.newFolderAccessibleName=Nuova cartella
-FileChooser.newFolderActionLabelText=Nuova cartella
-FileChooser.listViewButtonToolTipText=Lista
+FileChooser.newFolderActionLabel.textAndMnemonic=Nuova cartella
+FileChooser.listViewButtonToolTip.textAndMnemonic=Lista
 FileChooser.listViewButtonAccessibleName=Lista
-FileChooser.listViewActionLabelText=Lista
-FileChooser.detailsViewButtonToolTipText=Dettagli
+FileChooser.listViewActionLabel.textAndMnemonic=Lista
+FileChooser.detailsViewButtonToolTip.textAndMnemonic=Dettagli
 FileChooser.detailsViewButtonAccessibleName=Dettagli
 FileChooser.viewMenuButtonToolTipText = Visualizza menu
 FileChooser.viewMenuButtonAccessibleName = Visualizza menu
-FileChooser.detailsViewActionLabelText=Dettagli
-FileChooser.refreshActionLabelText=Aggiorna
-FileChooser.viewMenuLabelText=Visualizza
-FileChooser.fileNameHeaderText=Nome
-FileChooser.fileSizeHeaderText=Dimensioni
-FileChooser.fileTypeHeaderText=Tipo
-FileChooser.fileDateHeaderText=Modificato
-FileChooser.fileAttrHeaderText=Attributi
+FileChooser.detailsViewActionLabel.textAndMnemonic=Dettagli
+FileChooser.refreshActionLabel.textAndMnemonic=Aggiorna
+FileChooser.viewMenuLabel.textAndMnemonic=Visualizza
+FileChooser.fileNameHeader.textAndMnemonic=Nome
+FileChooser.fileSizeHeader.textAndMnemonic=Dimensioni
+FileChooser.fileTypeHeader.textAndMnemonic=Tipo
+FileChooser.fileDateHeader.textAndMnemonic=Modificato
+FileChooser.fileAttrHeader.textAndMnemonic=Attributi
--- a/src/share/classes/com/sun/java/swing/plaf/windows/resources/windows_ja.properties	Fri May 25 12:56:22 2012 +0400
+++ b/src/share/classes/com/sun/java/swing/plaf/windows/resources/windows_ja.properties	Fri May 25 19:34:32 2012 -0700
@@ -18,34 +18,30 @@
 
 ############ FILE CHOOSER STRINGS #############
 
-FileChooser.lookInLabelText=\u53C2\u7167:
-FileChooser.lookInLabelMnemonic=73
-FileChooser.saveInLabelText=\u4FDD\u5B58:
-FileChooser.fileNameLabelText=\u30D5\u30A1\u30A4\u30EB\u540D:
-FileChooser.fileNameLabelMnemonic=78
-FileChooser.folderNameLabelText=\u30D5\u30A9\u30EB\u30C0\u540D:
-FileChooser.folderNameLabelMnemonic=78
-FileChooser.filesOfTypeLabelText=\u30D5\u30A1\u30A4\u30EB\u306E\u30BF\u30A4\u30D7:
-FileChooser.filesOfTypeLabelMnemonic=84
-FileChooser.upFolderToolTipText=1\u30EC\u30D9\u30EB\u4E0A\u3078
+FileChooser.lookInLabel.textAndMnemonic=\u53C2\u7167(&I):
+FileChooser.saveInLabel.textAndMnemonic=\u4FDD\u5B58:
+FileChooser.fileNameLabel.textAndMnemonic=\u30D5\u30A1\u30A4\u30EB\u540D(&N):
+FileChooser.folderNameLabel.textAndMnemonic=\u30D5\u30A9\u30EB\u30C0\u540D(&N):
+FileChooser.filesOfTypeLabel.textAndMnemonic=\u30D5\u30A1\u30A4\u30EB\u306E\u30BF\u30A4\u30D7(&T):
+FileChooser.upFolderToolTip.textAndMnemonic=1\u30EC\u30D9\u30EB\u4E0A\u3078
 FileChooser.upFolderAccessibleName=\u4E0A\u3078
-FileChooser.homeFolderToolTipText=\u30DB\u30FC\u30E0
+FileChooser.homeFolderToolTip.textAndMnemonic=\u30DB\u30FC\u30E0
 FileChooser.homeFolderAccessibleName=\u30DB\u30FC\u30E0
-FileChooser.newFolderToolTipText=\u65B0\u898F\u30D5\u30A9\u30EB\u30C0\u306E\u4F5C\u6210
+FileChooser.newFolderToolTip.textAndMnemonic=\u65B0\u898F\u30D5\u30A9\u30EB\u30C0\u306E\u4F5C\u6210
 FileChooser.newFolderAccessibleName=\u65B0\u898F\u30D5\u30A9\u30EB\u30C0
-FileChooser.newFolderActionLabelText=\u65B0\u898F\u30D5\u30A9\u30EB\u30C0
-FileChooser.listViewButtonToolTipText=\u30EA\u30B9\u30C8
+FileChooser.newFolderActionLabel.textAndMnemonic=\u65B0\u898F\u30D5\u30A9\u30EB\u30C0
+FileChooser.listViewButtonToolTip.textAndMnemonic=\u30EA\u30B9\u30C8
 FileChooser.listViewButtonAccessibleName=\u30EA\u30B9\u30C8
-FileChooser.listViewActionLabelText=\u30EA\u30B9\u30C8
-FileChooser.detailsViewButtonToolTipText=\u8A73\u7D30
+FileChooser.listViewActionLabel.textAndMnemonic=\u30EA\u30B9\u30C8
+FileChooser.detailsViewButtonToolTip.textAndMnemonic=\u8A73\u7D30
 FileChooser.detailsViewButtonAccessibleName=\u8A73\u7D30
 FileChooser.viewMenuButtonToolTipText = \u8868\u793A\u30E1\u30CB\u30E5\u30FC
 FileChooser.viewMenuButtonAccessibleName = \u8868\u793A\u30E1\u30CB\u30E5\u30FC
-FileChooser.detailsViewActionLabelText=\u8A73\u7D30
-FileChooser.refreshActionLabelText=\u30EA\u30D5\u30EC\u30C3\u30B7\u30E5
-FileChooser.viewMenuLabelText=\u8868\u793A
-FileChooser.fileNameHeaderText=\u540D\u524D
-FileChooser.fileSizeHeaderText=\u30B5\u30A4\u30BA
-FileChooser.fileTypeHeaderText=\u30BF\u30A4\u30D7
-FileChooser.fileDateHeaderText=\u4FEE\u6B63\u65E5
-FileChooser.fileAttrHeaderText=\u5C5E\u6027
+FileChooser.detailsViewActionLabel.textAndMnemonic=\u8A73\u7D30
+FileChooser.refreshActionLabel.textAndMnemonic=\u30EA\u30D5\u30EC\u30C3\u30B7\u30E5
+FileChooser.viewMenuLabel.textAndMnemonic=\u8868\u793A
+FileChooser.fileNameHeader.textAndMnemonic=\u540D\u524D
+FileChooser.fileSizeHeader.textAndMnemonic=\u30B5\u30A4\u30BA
+FileChooser.fileTypeHeader.textAndMnemonic=\u30BF\u30A4\u30D7
+FileChooser.fileDateHeader.textAndMnemonic=\u4FEE\u6B63\u65E5
+FileChooser.fileAttrHeader.textAndMnemonic=\u5C5E\u6027
--- a/src/share/classes/com/sun/java/swing/plaf/windows/resources/windows_ko.properties	Fri May 25 12:56:22 2012 +0400
+++ b/src/share/classes/com/sun/java/swing/plaf/windows/resources/windows_ko.properties	Fri May 25 19:34:32 2012 -0700
@@ -18,34 +18,30 @@
 
 ############ FILE CHOOSER STRINGS #############
 
-FileChooser.lookInLabelText=\uAC80\uC0C9 \uC704\uCE58:
-FileChooser.lookInLabelMnemonic=73
-FileChooser.saveInLabelText=\uC800\uC7A5 \uC704\uCE58:
-FileChooser.fileNameLabelText=\uD30C\uC77C \uC774\uB984:
-FileChooser.fileNameLabelMnemonic=78
-FileChooser.folderNameLabelText=\uD3F4\uB354 \uC774\uB984:
-FileChooser.folderNameLabelMnemonic=78
-FileChooser.filesOfTypeLabelText=\uD30C\uC77C \uC720\uD615:
-FileChooser.filesOfTypeLabelMnemonic=84
-FileChooser.upFolderToolTipText=\uD55C \uB808\uBCA8 \uC704\uB85C
+FileChooser.lookInLabel.textAndMnemonic=\uAC80\uC0C9 \uC704\uCE58(&I):
+FileChooser.saveInLabel.textAndMnemonic=\uC800\uC7A5 \uC704\uCE58:
+FileChooser.fileNameLabel.textAndMnemonic=\uD30C\uC77C \uC774\uB984(&N):
+FileChooser.folderNameLabel.textAndMnemonic=\uD3F4\uB354 \uC774\uB984(&N):
+FileChooser.filesOfTypeLabel.textAndMnemonic=\uD30C\uC77C \uC720\uD615(&T):
+FileChooser.upFolderToolTip.textAndMnemonic=\uD55C \uB808\uBCA8 \uC704\uB85C
 FileChooser.upFolderAccessibleName=\uC704\uB85C
-FileChooser.homeFolderToolTipText=\uD648
+FileChooser.homeFolderToolTip.textAndMnemonic=\uD648
 FileChooser.homeFolderAccessibleName=\uD648
-FileChooser.newFolderToolTipText=\uC0C8 \uD3F4\uB354 \uC0DD\uC131
+FileChooser.newFolderToolTip.textAndMnemonic=\uC0C8 \uD3F4\uB354 \uC0DD\uC131
 FileChooser.newFolderAccessibleName=\uC0C8 \uD3F4\uB354
-FileChooser.newFolderActionLabelText=\uC0C8 \uD3F4\uB354
-FileChooser.listViewButtonToolTipText=\uBAA9\uB85D
+FileChooser.newFolderActionLabel.textAndMnemonic=\uC0C8 \uD3F4\uB354
+FileChooser.listViewButtonToolTip.textAndMnemonic=\uBAA9\uB85D
 FileChooser.listViewButtonAccessibleName=\uBAA9\uB85D
-FileChooser.listViewActionLabelText=\uBAA9\uB85D
-FileChooser.detailsViewButtonToolTipText=\uC138\uBD80 \uC815\uBCF4
+FileChooser.listViewActionLabel.textAndMnemonic=\uBAA9\uB85D
+FileChooser.detailsViewButtonToolTip.textAndMnemonic=\uC138\uBD80 \uC815\uBCF4
 FileChooser.detailsViewButtonAccessibleName=\uC138\uBD80 \uC815\uBCF4
 FileChooser.viewMenuButtonToolTipText = \uBCF4\uAE30 \uBA54\uB274
 FileChooser.viewMenuButtonAccessibleName = \uBCF4\uAE30 \uBA54\uB274
-FileChooser.detailsViewActionLabelText=\uC138\uBD80 \uC815\uBCF4
-FileChooser.refreshActionLabelText=\uC0C8\uB85C \uACE0\uCE68
-FileChooser.viewMenuLabelText=\uBCF4\uAE30
-FileChooser.fileNameHeaderText=\uC774\uB984
-FileChooser.fileSizeHeaderText=\uD06C\uAE30
-FileChooser.fileTypeHeaderText=\uC720\uD615
-FileChooser.fileDateHeaderText=\uC218\uC815 \uB0A0\uC9DC
-FileChooser.fileAttrHeaderText=\uC18D\uC131
+FileChooser.detailsViewActionLabel.textAndMnemonic=\uC138\uBD80 \uC815\uBCF4
+FileChooser.refreshActionLabel.textAndMnemonic=\uC0C8\uB85C \uACE0\uCE68
+FileChooser.viewMenuLabel.textAndMnemonic=\uBCF4\uAE30
+FileChooser.fileNameHeader.textAndMnemonic=\uC774\uB984
+FileChooser.fileSizeHeader.textAndMnemonic=\uD06C\uAE30
+FileChooser.fileTypeHeader.textAndMnemonic=\uC720\uD615
+FileChooser.fileDateHeader.textAndMnemonic=\uC218\uC815 \uB0A0\uC9DC
+FileChooser.fileAttrHeader.textAndMnemonic=\uC18D\uC131
--- a/src/share/classes/com/sun/java/swing/plaf/windows/resources/windows_pt_BR.properties	Fri May 25 12:56:22 2012 +0400
+++ b/src/share/classes/com/sun/java/swing/plaf/windows/resources/windows_pt_BR.properties	Fri May 25 19:34:32 2012 -0700
@@ -18,34 +18,30 @@
 
 ############ FILE CHOOSER STRINGS #############
 
-FileChooser.lookInLabelText=Consultar em:
-FileChooser.lookInLabelMnemonic=73
-FileChooser.saveInLabelText=Salvar em:
-FileChooser.fileNameLabelText=Nome do arquivo:
-FileChooser.fileNameLabelMnemonic=78
-FileChooser.folderNameLabelText=Nome da pasta:
-FileChooser.folderNameLabelMnemonic=78
-FileChooser.filesOfTypeLabelText=Arquivos do tipo:
-FileChooser.filesOfTypeLabelMnemonic=84
-FileChooser.upFolderToolTipText=Um N\u00EDvel Acima
+FileChooser.lookInLabel.textAndMnemonic=Consultar em(&I):
+FileChooser.saveInLabel.textAndMnemonic=Salvar em:
+FileChooser.fileNameLabel.textAndMnemonic=&Nome do arquivo:
+FileChooser.folderNameLabel.textAndMnemonic=&Nome da pasta:
+FileChooser.filesOfTypeLabel.textAndMnemonic=Arquivos do &tipo:
+FileChooser.upFolderToolTip.textAndMnemonic=Um N\u00EDvel Acima
 FileChooser.upFolderAccessibleName=Acima
-FileChooser.homeFolderToolTipText=In\u00EDcio
+FileChooser.homeFolderToolTip.textAndMnemonic=In\u00EDcio
 FileChooser.homeFolderAccessibleName=In\u00EDcio
-FileChooser.newFolderToolTipText=Criar Nova Pasta
+FileChooser.newFolderToolTip.textAndMnemonic=Criar Nova Pasta
 FileChooser.newFolderAccessibleName=Nova Pasta
-FileChooser.newFolderActionLabelText=Nova Pasta
-FileChooser.listViewButtonToolTipText=Lista
+FileChooser.newFolderActionLabel.textAndMnemonic=Nova Pasta
+FileChooser.listViewButtonToolTip.textAndMnemonic=Lista
 FileChooser.listViewButtonAccessibleName=Lista
-FileChooser.listViewActionLabelText=Lista
-FileChooser.detailsViewButtonToolTipText=Detalhes
+FileChooser.listViewActionLabel.textAndMnemonic=Lista
+FileChooser.detailsViewButtonToolTip.textAndMnemonic=Detalhes
 FileChooser.detailsViewButtonAccessibleName=Detalhes
 FileChooser.viewMenuButtonToolTipText = Exibir Menu
 FileChooser.viewMenuButtonAccessibleName = Exibir Menu
-FileChooser.detailsViewActionLabelText=Detalhes
-FileChooser.refreshActionLabelText=Atualizar
-FileChooser.viewMenuLabelText=Exibir
-FileChooser.fileNameHeaderText=Nome
-FileChooser.fileSizeHeaderText=Tamanho
-FileChooser.fileTypeHeaderText=Tipo
-FileChooser.fileDateHeaderText=Modificado
-FileChooser.fileAttrHeaderText=Atributos
+FileChooser.detailsViewActionLabel.textAndMnemonic=Detalhes
+FileChooser.refreshActionLabel.textAndMnemonic=Atualizar
+FileChooser.viewMenuLabel.textAndMnemonic=Exibir
+FileChooser.fileNameHeader.textAndMnemonic=Nome
+FileChooser.fileSizeHeader.textAndMnemonic=Tamanho
+FileChooser.fileTypeHeader.textAndMnemonic=Tipo
+FileChooser.fileDateHeader.textAndMnemonic=Modificado
+FileChooser.fileAttrHeader.textAndMnemonic=Atributos
--- a/src/share/classes/com/sun/java/swing/plaf/windows/resources/windows_sv.properties	Fri May 25 12:56:22 2012 +0400
+++ b/src/share/classes/com/sun/java/swing/plaf/windows/resources/windows_sv.properties	Fri May 25 19:34:32 2012 -0700
@@ -18,34 +18,30 @@
 
 ############ FILE CHOOSER STRINGS #############
 
-FileChooser.lookInLabelText=Leta i:
-FileChooser.lookInLabelMnemonic=73
-FileChooser.saveInLabelText=Spara i:
-FileChooser.fileNameLabelText=Filnamn:
-FileChooser.fileNameLabelMnemonic=78
-FileChooser.folderNameLabelText=Mapp:
-FileChooser.folderNameLabelMnemonic=78
-FileChooser.filesOfTypeLabelText=Filformat:
-FileChooser.filesOfTypeLabelMnemonic=84
-FileChooser.upFolderToolTipText=Upp en niv\u00E5
+FileChooser.lookInLabel.textAndMnemonic=Leta &i:
+FileChooser.saveInLabel.textAndMnemonic=Spara i:
+FileChooser.fileNameLabel.textAndMnemonic=Fil&namn:
+FileChooser.folderNameLabel.textAndMnemonic=Mapp(&N):
+FileChooser.filesOfTypeLabel.textAndMnemonic=Filforma&t:
+FileChooser.upFolderToolTip.textAndMnemonic=Upp en niv\u00E5
 FileChooser.upFolderAccessibleName=Upp
-FileChooser.homeFolderToolTipText=Hem
+FileChooser.homeFolderToolTip.textAndMnemonic=Hem
 FileChooser.homeFolderAccessibleName=Hem
-FileChooser.newFolderToolTipText=Skapa ny mapp
+FileChooser.newFolderToolTip.textAndMnemonic=Skapa ny mapp
 FileChooser.newFolderAccessibleName=Ny mapp
-FileChooser.newFolderActionLabelText=Ny mapp
-FileChooser.listViewButtonToolTipText=Lista
+FileChooser.newFolderActionLabel.textAndMnemonic=Ny mapp
+FileChooser.listViewButtonToolTip.textAndMnemonic=Lista
 FileChooser.listViewButtonAccessibleName=Lista
-FileChooser.listViewActionLabelText=Lista
-FileChooser.detailsViewButtonToolTipText=Detaljer
+FileChooser.listViewActionLabel.textAndMnemonic=Lista
+FileChooser.detailsViewButtonToolTip.textAndMnemonic=Detaljer
 FileChooser.detailsViewButtonAccessibleName=Detaljer
 FileChooser.viewMenuButtonToolTipText = Menyn Visa
 FileChooser.viewMenuButtonAccessibleName = Menyn Visa
-FileChooser.detailsViewActionLabelText=Detaljer
-FileChooser.refreshActionLabelText=F\u00F6rnya
-FileChooser.viewMenuLabelText=Vy
-FileChooser.fileNameHeaderText=Namn
-FileChooser.fileSizeHeaderText=Storlek
-FileChooser.fileTypeHeaderText=Typ
-FileChooser.fileDateHeaderText=\u00C4ndrad
-FileChooser.fileAttrHeaderText=Attribut
+FileChooser.detailsViewActionLabel.textAndMnemonic=Detaljer
+FileChooser.refreshActionLabel.textAndMnemonic=F\u00F6rnya
+FileChooser.viewMenuLabel.textAndMnemonic=Vy
+FileChooser.fileNameHeader.textAndMnemonic=Namn
+FileChooser.fileSizeHeader.textAndMnemonic=Storlek
+FileChooser.fileTypeHeader.textAndMnemonic=Typ
+FileChooser.fileDateHeader.textAndMnemonic=\u00C4ndrad
+FileChooser.fileAttrHeader.textAndMnemonic=Attribut
--- a/src/share/classes/com/sun/java/swing/plaf/windows/resources/windows_zh_CN.properties	Fri May 25 12:56:22 2012 +0400
+++ b/src/share/classes/com/sun/java/swing/plaf/windows/resources/windows_zh_CN.properties	Fri May 25 19:34:32 2012 -0700
@@ -18,34 +18,30 @@
 
 ############ FILE CHOOSER STRINGS #############
 
-FileChooser.lookInLabelText=\u67E5\u770B: 
-FileChooser.lookInLabelMnemonic=73
-FileChooser.saveInLabelText=\u4FDD\u5B58: 
-FileChooser.fileNameLabelText=\u6587\u4EF6\u540D: 
-FileChooser.fileNameLabelMnemonic=78
-FileChooser.folderNameLabelText=\u6587\u4EF6\u5939\u540D: 
-FileChooser.folderNameLabelMnemonic=78
-FileChooser.filesOfTypeLabelText=\u6587\u4EF6\u7C7B\u578B: 
-FileChooser.filesOfTypeLabelMnemonic=84
-FileChooser.upFolderToolTipText=\u5411\u4E0A\u4E00\u7EA7
+FileChooser.lookInLabel.textAndMnemonic=\u67E5\u770B: (&I)
+FileChooser.saveInLabel.textAndMnemonic=\u4FDD\u5B58: 
+FileChooser.fileNameLabel.textAndMnemonic=\u6587\u4EF6\u540D: (&N)
+FileChooser.folderNameLabel.textAndMnemonic=\u6587\u4EF6\u5939\u540D: (&N)
+FileChooser.filesOfTypeLabel.textAndMnemonic=\u6587\u4EF6\u7C7B\u578B: (&T)
+FileChooser.upFolderToolTip.textAndMnemonic=\u5411\u4E0A\u4E00\u7EA7
 FileChooser.upFolderAccessibleName=\u5411\u4E0A
-FileChooser.homeFolderToolTipText=\u4E3B\u76EE\u5F55
+FileChooser.homeFolderToolTip.textAndMnemonic=\u4E3B\u76EE\u5F55
 FileChooser.homeFolderAccessibleName=\u4E3B\u76EE\u5F55
-FileChooser.newFolderToolTipText=\u521B\u5EFA\u65B0\u6587\u4EF6\u5939
+FileChooser.newFolderToolTip.textAndMnemonic=\u521B\u5EFA\u65B0\u6587\u4EF6\u5939
 FileChooser.newFolderAccessibleName=\u65B0\u5EFA\u6587\u4EF6\u5939
-FileChooser.newFolderActionLabelText=\u65B0\u5EFA\u6587\u4EF6\u5939
-FileChooser.listViewButtonToolTipText=\u5217\u8868
+FileChooser.newFolderActionLabel.textAndMnemonic=\u65B0\u5EFA\u6587\u4EF6\u5939
+FileChooser.listViewButtonToolTip.textAndMnemonic=\u5217\u8868
 FileChooser.listViewButtonAccessibleName=\u5217\u8868
-FileChooser.listViewActionLabelText=\u5217\u8868
-FileChooser.detailsViewButtonToolTipText=\u8BE6\u7EC6\u8D44\u6599
+FileChooser.listViewActionLabel.textAndMnemonic=\u5217\u8868
+FileChooser.detailsViewButtonToolTip.textAndMnemonic=\u8BE6\u7EC6\u8D44\u6599
 FileChooser.detailsViewButtonAccessibleName=\u8BE6\u7EC6\u8D44\u6599
 FileChooser.viewMenuButtonToolTipText = \u67E5\u770B\u83DC\u5355
 FileChooser.viewMenuButtonAccessibleName = \u67E5\u770B\u83DC\u5355
-FileChooser.detailsViewActionLabelText=\u8BE6\u7EC6\u8D44\u6599
-FileChooser.refreshActionLabelText=\u5237\u65B0
-FileChooser.viewMenuLabelText=\u89C6\u56FE
-FileChooser.fileNameHeaderText=\u540D\u79F0
-FileChooser.fileSizeHeaderText=\u5927\u5C0F
-FileChooser.fileTypeHeaderText=\u7C7B\u578B
-FileChooser.fileDateHeaderText=\u4FEE\u6539\u65E5\u671F
-FileChooser.fileAttrHeaderText=\u5C5E\u6027
+FileChooser.detailsViewActionLabel.textAndMnemonic=\u8BE6\u7EC6\u8D44\u6599
+FileChooser.refreshActionLabel.textAndMnemonic=\u5237\u65B0
+FileChooser.viewMenuLabel.textAndMnemonic=\u89C6\u56FE
+FileChooser.fileNameHeader.textAndMnemonic=\u540D\u79F0
+FileChooser.fileSizeHeader.textAndMnemonic=\u5927\u5C0F
+FileChooser.fileTypeHeader.textAndMnemonic=\u7C7B\u578B
+FileChooser.fileDateHeader.textAndMnemonic=\u4FEE\u6539\u65E5\u671F
+FileChooser.fileAttrHeader.textAndMnemonic=\u5C5E\u6027
--- a/src/share/classes/com/sun/java/swing/plaf/windows/resources/windows_zh_TW.properties	Fri May 25 12:56:22 2012 +0400
+++ b/src/share/classes/com/sun/java/swing/plaf/windows/resources/windows_zh_TW.properties	Fri May 25 19:34:32 2012 -0700
@@ -18,34 +18,30 @@
 
 ############ FILE CHOOSER STRINGS #############
 
-FileChooser.lookInLabelText=\u67E5\u8A62:
-FileChooser.lookInLabelMnemonic=73
-FileChooser.saveInLabelText=\u5132\u5B58\u65BC: 
-FileChooser.fileNameLabelText=\u6A94\u6848\u540D\u7A31:
-FileChooser.fileNameLabelMnemonic=78
-FileChooser.folderNameLabelText=\u8CC7\u6599\u593E\u540D\u7A31:
-FileChooser.folderNameLabelMnemonic=78
-FileChooser.filesOfTypeLabelText=\u6A94\u6848\u985E\u578B:
-FileChooser.filesOfTypeLabelMnemonic=84
-FileChooser.upFolderToolTipText=\u5F80\u4E0A\u4E00\u5C64
+FileChooser.lookInLabel.textAndMnemonic=\u67E5\u8A62(&I):
+FileChooser.saveInLabel.textAndMnemonic=\u5132\u5B58\u65BC: 
+FileChooser.fileNameLabel.textAndMnemonic=\u6A94\u6848\u540D\u7A31(&N):
+FileChooser.folderNameLabel.textAndMnemonic=\u8CC7\u6599\u593E\u540D\u7A31(&N):
+FileChooser.filesOfTypeLabel.textAndMnemonic=\u6A94\u6848\u985E\u578B(&T):
+FileChooser.upFolderToolTip.textAndMnemonic=\u5F80\u4E0A\u4E00\u5C64
 FileChooser.upFolderAccessibleName=\u5F80\u4E0A
-FileChooser.homeFolderToolTipText=\u4E3B\u76EE\u9304
+FileChooser.homeFolderToolTip.textAndMnemonic=\u4E3B\u76EE\u9304
 FileChooser.homeFolderAccessibleName=\u4E3B\u76EE\u9304
-FileChooser.newFolderToolTipText=\u5EFA\u7ACB\u65B0\u8CC7\u6599\u593E
+FileChooser.newFolderToolTip.textAndMnemonic=\u5EFA\u7ACB\u65B0\u8CC7\u6599\u593E
 FileChooser.newFolderAccessibleName=\u65B0\u8CC7\u6599\u593E
-FileChooser.newFolderActionLabelText=\u65B0\u8CC7\u6599\u593E
-FileChooser.listViewButtonToolTipText=\u6E05\u55AE
+FileChooser.newFolderActionLabel.textAndMnemonic=\u65B0\u8CC7\u6599\u593E
+FileChooser.listViewButtonToolTip.textAndMnemonic=\u6E05\u55AE
 FileChooser.listViewButtonAccessibleName=\u6E05\u55AE
-FileChooser.listViewActionLabelText=\u6E05\u55AE
-FileChooser.detailsViewButtonToolTipText=\u8A73\u7D30\u8CC7\u8A0A
+FileChooser.listViewActionLabel.textAndMnemonic=\u6E05\u55AE
+FileChooser.detailsViewButtonToolTip.textAndMnemonic=\u8A73\u7D30\u8CC7\u8A0A
 FileChooser.detailsViewButtonAccessibleName=\u8A73\u7D30\u8CC7\u8A0A
 FileChooser.viewMenuButtonToolTipText = \u6AA2\u8996\u529F\u80FD\u8868
 FileChooser.viewMenuButtonAccessibleName = \u6AA2\u8996\u529F\u80FD\u8868
-FileChooser.detailsViewActionLabelText=\u8A73\u7D30\u8CC7\u8A0A
-FileChooser.refreshActionLabelText=\u91CD\u65B0\u6574\u7406
-FileChooser.viewMenuLabelText=\u6AA2\u8996
-FileChooser.fileNameHeaderText=\u540D\u7A31
-FileChooser.fileSizeHeaderText=\u5927\u5C0F
-FileChooser.fileTypeHeaderText=\u985E\u578B
-FileChooser.fileDateHeaderText=\u4FEE\u6539\u65E5\u671F
-FileChooser.fileAttrHeaderText=\u5C6C\u6027
+FileChooser.detailsViewActionLabel.textAndMnemonic=\u8A73\u7D30\u8CC7\u8A0A
+FileChooser.refreshActionLabel.textAndMnemonic=\u91CD\u65B0\u6574\u7406
+FileChooser.viewMenuLabel.textAndMnemonic=\u6AA2\u8996
+FileChooser.fileNameHeader.textAndMnemonic=\u540D\u7A31
+FileChooser.fileSizeHeader.textAndMnemonic=\u5927\u5C0F
+FileChooser.fileTypeHeader.textAndMnemonic=\u985E\u578B
+FileChooser.fileDateHeader.textAndMnemonic=\u4FEE\u6539\u65E5\u671F
+FileChooser.fileAttrHeader.textAndMnemonic=\u5C6C\u6027
--- a/src/share/classes/com/sun/rowset/FilteredRowSetImpl.java	Fri May 25 12:56:22 2012 +0400
+++ b/src/share/classes/com/sun/rowset/FilteredRowSetImpl.java	Fri May 25 19:34:32 2012 -0700
@@ -128,7 +128,7 @@
          for(int rows=this.getRow(); rows<=this.size();rows++) {
              bool = super.internalNext();
 
-             if( p == null) {
+             if( !bool || p == null) {
                return bool;
              }
              if(p.evaluate(this)){
--- a/src/share/classes/java/awt/Component.java	Fri May 25 12:56:22 2012 +0400
+++ b/src/share/classes/java/awt/Component.java	Fri May 25 19:34:32 2012 -0700
@@ -7169,6 +7169,9 @@
      * Set from its parent. If all ancestors of this Component have null
      * specified for the Set, then the current KeyboardFocusManager's default
      * Set is used.
+     * <p>
+     * This method may throw a {@code ClassCastException} if any {@code Object}
+     * in {@code keystrokes} is not an {@code AWTKeyStroke}.
      *
      * @param id one of KeyboardFocusManager.FORWARD_TRAVERSAL_KEYS,
      *        KeyboardFocusManager.BACKWARD_TRAVERSAL_KEYS, or
@@ -7182,8 +7185,7 @@
      *         KeyboardFocusManager.FORWARD_TRAVERSAL_KEYS,
      *         KeyboardFocusManager.BACKWARD_TRAVERSAL_KEYS, or
      *         KeyboardFocusManager.UP_CYCLE_TRAVERSAL_KEYS, or if keystrokes
-     *         contains null, or if any Object in keystrokes is not an
-     *         AWTKeyStroke, or if any keystroke represents a KEY_TYPED event,
+     *         contains null, or if any keystroke represents a KEY_TYPED event,
      *         or if any keystroke already maps to another focus traversal
      *         operation for this Component
      * @since 1.4
@@ -7831,7 +7833,7 @@
             if (focusLog.isLoggable(PlatformLogger.FINER)) {
                 focusLog.finer("clear global focus owner");
             }
-            KeyboardFocusManager.getCurrentKeyboardFocusManager().clearGlobalFocusOwner();
+            KeyboardFocusManager.getCurrentKeyboardFocusManager().clearGlobalFocusOwnerPriv();
         }
         if (focusLog.isLoggable(PlatformLogger.FINER)) {
             focusLog.finer("returning result: " + res);
@@ -7912,7 +7914,7 @@
             if (focusLog.isLoggable(PlatformLogger.FINER)) {
                 focusLog.finer("clear global focus owner");
             }
-            KeyboardFocusManager.getCurrentKeyboardFocusManager().clearGlobalFocusOwner();
+            KeyboardFocusManager.getCurrentKeyboardFocusManager().clearGlobalFocusOwnerPriv();
         }
         if (focusLog.isLoggable(PlatformLogger.FINER)) {
             focusLog.finer("returning result: " + res);
@@ -7945,11 +7947,11 @@
         if (rootAncestor != null) {
             Container rootAncestorRootAncestor =
                 rootAncestor.getFocusCycleRootAncestor();
+            Container fcr = (rootAncestorRootAncestor != null) ?
+                rootAncestorRootAncestor : rootAncestor;
+
             KeyboardFocusManager.getCurrentKeyboardFocusManager().
-                setGlobalCurrentFocusCycleRoot(
-                                               (rootAncestorRootAncestor != null)
-                                               ? rootAncestorRootAncestor
-                                               : rootAncestor);
+                setGlobalCurrentFocusCycleRootPriv(fcr);
             rootAncestor.requestFocus(CausedFocusEvent.Cause.TRAVERSAL_UP);
         } else {
             Window window = getContainingWindow();
@@ -7959,7 +7961,7 @@
                     getDefaultComponent(window);
                 if (toFocus != null) {
                     KeyboardFocusManager.getCurrentKeyboardFocusManager().
-                        setGlobalCurrentFocusCycleRoot(window);
+                        setGlobalCurrentFocusCycleRootPriv(window);
                     toFocus.requestFocus(CausedFocusEvent.Cause.TRAVERSAL_UP);
                 }
             }
--- a/src/share/classes/java/awt/Container.java	Fri May 25 12:56:22 2012 +0400
+++ b/src/share/classes/java/awt/Container.java	Fri May 25 19:34:32 2012 -0700
@@ -3093,6 +3093,9 @@
      * Set from its parent. If all ancestors of this Container have null
      * specified for the Set, then the current KeyboardFocusManager's default
      * Set is used.
+     * <p>
+     * This method may throw a {@code ClassCastException} if any {@code Object}
+     * in {@code keystrokes} is not an {@code AWTKeyStroke}.
      *
      * @param id one of KeyboardFocusManager.FORWARD_TRAVERSAL_KEYS,
      *        KeyboardFocusManager.BACKWARD_TRAVERSAL_KEYS,
@@ -3109,8 +3112,7 @@
      *         KeyboardFocusManager.BACKWARD_TRAVERSAL_KEYS,
      *         KeyboardFocusManager.UP_CYCLE_TRAVERSAL_KEYS, or
      *         KeyboardFocusManager.DOWN_CYCLE_TRAVERSAL_KEYS, or if keystrokes
-     *         contains null, or if any Object in keystrokes is not an
-     *         AWTKeyStroke, or if any keystroke represents a KEY_TYPED event,
+     *         contains null, or if any keystroke represents a KEY_TYPED event,
      *         or if any keystroke already maps to another focus traversal
      *         operation for this Container
      * @since 1.4
@@ -3243,7 +3245,7 @@
 
         if (root != currentFocusCycleRoot) {
             KeyboardFocusManager.getCurrentKeyboardFocusManager().
-                setGlobalCurrentFocusCycleRoot(root);
+                setGlobalCurrentFocusCycleRootPriv(root);
         }
         return root;
     }
@@ -3300,7 +3302,7 @@
         Container cont = kfm.getCurrentFocusCycleRoot();
 
         if (cont == this || isParentOf(cont)) {
-            kfm.setGlobalCurrentFocusCycleRoot(null);
+            kfm.setGlobalCurrentFocusCycleRootPriv(null);
         }
     }
 
@@ -3504,7 +3506,7 @@
     public void transferFocusDownCycle() {
         if (isFocusCycleRoot()) {
             KeyboardFocusManager.getCurrentKeyboardFocusManager().
-                setGlobalCurrentFocusCycleRoot(this);
+                setGlobalCurrentFocusCycleRootPriv(this);
             Component toFocus = getFocusTraversalPolicy().
                 getDefaultComponent(this);
             if (toFocus != null) {
--- a/src/share/classes/java/awt/DefaultKeyboardFocusManager.java	Fri May 25 12:56:22 2012 +0400
+++ b/src/share/classes/java/awt/DefaultKeyboardFocusManager.java	Fri May 25 19:34:32 2012 -0700
@@ -116,7 +116,7 @@
         } else if (fe.getOppositeComponent() != null &&
                    doRestoreFocus(fe.getOppositeComponent(), vetoedComponent, false)) {
         } else {
-            clearGlobalFocusOwner();
+            clearGlobalFocusOwnerPriv();
         }
     }
     private void restoreFocus(WindowEvent we) {
@@ -130,7 +130,7 @@
         {
             // do nothing, everything is done in restoreFocus()
         } else {
-            clearGlobalFocusOwner();
+            clearGlobalFocusOwnerPriv();
         }
     }
     private boolean restoreFocus(Window aWindow, Component vetoedComponent,
@@ -141,7 +141,7 @@
         if (toFocus != null && toFocus != vetoedComponent && doRestoreFocus(toFocus, vetoedComponent, false)) {
             return true;
         } else if (clearOnFailure) {
-            clearGlobalFocusOwner();
+            clearGlobalFocusOwnerPriv();
             return true;
         } else {
             return false;
@@ -164,7 +164,7 @@
             {
                 return true;
             } else if (clearOnFailure) {
-                clearGlobalFocusOwner();
+                clearGlobalFocusOwnerPriv();
                 return true;
             } else {
                 return false;
--- a/src/share/classes/java/awt/Dialog.java	Fri May 25 12:56:22 2012 +0400
+++ b/src/share/classes/java/awt/Dialog.java	Fri May 25 19:34:32 2012 -0700
@@ -670,7 +670,7 @@
 
         this.title = title;
         setModalityType(modalityType);
-        SunToolkit.checkAndSetPolicy(this, false);
+        SunToolkit.checkAndSetPolicy(this);
     }
 
     /**
@@ -721,7 +721,7 @@
 
         this.title = title;
         setModalityType(modalityType);
-        SunToolkit.checkAndSetPolicy(this, false);
+        SunToolkit.checkAndSetPolicy(this);
     }
 
     /**
@@ -1037,7 +1037,7 @@
                 predictedFocusOwner = getMostRecentFocusOwner();
                 if (conditionalShow(predictedFocusOwner, time)) {
                     modalFilter = ModalEventFilter.createFilterForDialog(this);
-                    Conditional cond = new Conditional() {
+                    final Conditional cond = new Conditional() {
                         @Override
                         public boolean evaluate() {
                             return windowClosingException == null;
@@ -1067,7 +1067,12 @@
 
                     modalityPushed();
                     try {
-                        EventQueue eventQueue = Toolkit.getDefaultToolkit().getSystemEventQueue();
+                        final EventQueue eventQueue = AccessController.doPrivileged(
+                            new PrivilegedAction<EventQueue>() {
+                                public EventQueue run() {
+                                    return Toolkit.getDefaultToolkit().getSystemEventQueue();
+                                }
+                        });
                         secondaryLoop = eventQueue.createSecondaryLoop(cond, modalFilter, 0);
                         if (!secondaryLoop.enter()) {
                             secondaryLoop = null;
--- a/src/share/classes/java/awt/FileDialog.java	Fri May 25 12:56:22 2012 +0400
+++ b/src/share/classes/java/awt/FileDialog.java	Fri May 25 19:34:32 2012 -0700
@@ -147,8 +147,8 @@
     static {
         AWTAccessor.setFileDialogAccessor(
             new AWTAccessor.FileDialogAccessor() {
-                public void setFiles(FileDialog fileDialog, String directory, String files[]) {
-                    fileDialog.setFiles(directory, files);
+                public void setFiles(FileDialog fileDialog, File files[]) {
+                    fileDialog.setFiles(files);
                 }
                 public void setFile(FileDialog fileDialog, String file) {
                     fileDialog.file = ("".equals(file)) ? null : file;
@@ -446,13 +446,9 @@
      * @see #getFiles
      * @since 1.7
      */
-    private void setFiles(String directory, String files[]) {
+    private void setFiles(File files[]) {
         synchronized (getObjectLock()) {
-            int filesNumber = (files != null) ? files.length : 0;
-            this.files = new File[filesNumber];
-            for (int i = 0; i < filesNumber; i++) {
-                this.files[i] = new File(directory, files[i]);
-            }
+            this.files = files;
         }
     }
 
--- a/src/share/classes/java/awt/Frame.java	Fri May 25 12:56:22 2012 +0400
+++ b/src/share/classes/java/awt/Frame.java	Fri May 25 19:34:32 2012 -0700
@@ -449,7 +449,7 @@
 
     private void init(String title, GraphicsConfiguration gc) {
         this.title = title;
-        SunToolkit.checkAndSetPolicy(this, false);
+        SunToolkit.checkAndSetPolicy(this);
     }
 
     /**
--- a/src/share/classes/java/awt/KeyboardFocusManager.java	Fri May 25 12:56:22 2012 +0400
+++ b/src/share/classes/java/awt/KeyboardFocusManager.java	Fri May 25 19:34:32 2012 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 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
@@ -246,15 +246,7 @@
     public static void setCurrentKeyboardFocusManager(
         KeyboardFocusManager newManager) throws SecurityException
     {
-        SecurityManager security = System.getSecurityManager();
-        if (security != null) {
-            if (replaceKeyboardFocusManagerPermission == null) {
-                replaceKeyboardFocusManagerPermission =
-                    new AWTPermission("replaceKeyboardFocusManager");
-            }
-            security.
-                checkPermission(replaceKeyboardFocusManagerPermission);
-        }
+        checkReplaceKFMPermission();
 
         KeyboardFocusManager oldManager = null;
 
@@ -399,11 +391,6 @@
     private static java.util.Map mostRecentFocusOwners = new WeakHashMap();
 
     /**
-     * Error String for initializing SecurityExceptions.
-     */
-    private static final String notPrivileged = "this KeyboardFocusManager is not installed in the current thread's context";
-
-    /**
      * We cache the permission used to verify that the calling thread is
      * permitted to access the global focus state.
      */
@@ -503,17 +490,13 @@
      * @see #setGlobalFocusOwner
      * @throws SecurityException if this KeyboardFocusManager is not the
      *         current KeyboardFocusManager for the calling thread's context
+     *         and if the calling thread does not have "replaceKeyboardFocusManager"
+     *         permission
      */
     protected Component getGlobalFocusOwner() throws SecurityException {
         synchronized (KeyboardFocusManager.class) {
-            if (this == getCurrentKeyboardFocusManager()) {
-                return focusOwner;
-            } else {
-                if (focusLog.isLoggable(PlatformLogger.FINER)) {
-                    focusLog.finer("This manager is " + this + ", current is " + getCurrentKeyboardFocusManager());
-                }
-                throw new SecurityException(notPrivileged);
-            }
+            checkKFMSecurity();
+            return focusOwner;
         }
     }
 
@@ -538,15 +521,23 @@
      * @see Component#requestFocus()
      * @see Component#requestFocusInWindow()
      * @see Component#isFocusable
+     * @throws SecurityException if this KeyboardFocusManager is not the
+     *         current KeyboardFocusManager for the calling thread's context
+     *         and if the calling thread does not have "replaceKeyboardFocusManager"
+     *         permission
      * @beaninfo
      *       bound: true
      */
-    protected void setGlobalFocusOwner(Component focusOwner) {
+    protected void setGlobalFocusOwner(Component focusOwner)
+        throws SecurityException
+    {
         Component oldFocusOwner = null;
         boolean shouldFire = false;
 
         if (focusOwner == null || focusOwner.isFocusable()) {
             synchronized (KeyboardFocusManager.class) {
+                checkKFMSecurity();
+
                 oldFocusOwner = getFocusOwner();
 
                 try {
@@ -584,6 +575,27 @@
     }
 
     /**
+     * Clears the focus owner at both the Java and native levels if the
+     * focus owner exists and resides in the same context as the calling thread,
+     * otherwise the method returns silently.
+     * <p>
+     * The focus owner component will receive a permanent FOCUS_LOST event.
+     * After this operation completes, the native windowing system will discard
+     * all user-generated KeyEvents until the user selects a new Component to
+     * receive focus, or a Component is given focus explicitly via a call to
+     * {@code requestFocus()}. This operation does not change the focused or
+     * active Windows.
+     *
+     * @see Component#requestFocus()
+     * @see java.awt.event.FocusEvent#FOCUS_LOST
+     */
+    public void clearFocusOwner() {
+        if (getFocusOwner() != null) {
+            clearGlobalFocusOwner();
+        }
+    }
+
+    /**
      * Clears the global focus owner at both the Java and native levels. If
      * there exists a focus owner, that Component will receive a permanent
      * FOCUS_LOST event. After this operation completes, the native windowing
@@ -591,11 +603,26 @@
      * a new Component to receive focus, or a Component is given focus
      * explicitly via a call to <code>requestFocus()</code>. This operation
      * does not change the focused or active Windows.
+     * <p>
+     * If a SecurityManager is installed, the calling thread must be granted
+     * the "replaceKeyboardFocusManager" AWTPermission. If this permission is
+     * not granted, this method will throw a SecurityException, and the current
+     * focus owner will not be cleared.
+     * <p>
+     * This method is intended to be used only by KeyboardFocusManager set as
+     * current KeyboardFocusManager for the calling thread's context. It is not
+     * for general client use.
      *
+     * @see KeyboardFocusManager#clearFocusOwner
      * @see Component#requestFocus()
      * @see java.awt.event.FocusEvent#FOCUS_LOST
+     * @throws SecurityException if the calling thread does not have
+     *         "replaceKeyboardFocusManager" permission
      */
-    public void clearGlobalFocusOwner() {
+    public void clearGlobalFocusOwner()
+        throws SecurityException
+    {
+        checkReplaceKFMPermission();
         if (!GraphicsEnvironment.isHeadless()) {
             // Toolkit must be fully initialized, otherwise
             // _clearGlobalFocusOwner will crash or throw an exception
@@ -609,6 +636,15 @@
         peer.clearGlobalFocusOwner(activeWindow);
     }
 
+    void clearGlobalFocusOwnerPriv() {
+        AccessController.doPrivileged(new PrivilegedAction<Void>() {
+            public Void run() {
+                clearGlobalFocusOwner();
+                return null;
+            }
+        });
+    }
+
     Component getNativeFocusOwner() {
         return peer.getCurrentFocusOwner();
     }
@@ -660,29 +696,21 @@
      * are equivalent unless a temporary focus change is currently in effect.
      * In such a situation, the permanent focus owner will again be the focus
      * owner when the temporary focus change ends.
-     * <p>
-     * This method will throw a SecurityException if this KeyboardFocusManager
-     * is not the current KeyboardFocusManager for the calling thread's
-     * context.
      *
      * @return the permanent focus owner
      * @see #getPermanentFocusOwner
      * @see #setGlobalPermanentFocusOwner
      * @throws SecurityException if this KeyboardFocusManager is not the
      *         current KeyboardFocusManager for the calling thread's context
+     *         and if the calling thread does not have "replaceKeyboardFocusManager"
+     *         permission
      */
     protected Component getGlobalPermanentFocusOwner()
         throws SecurityException
     {
         synchronized (KeyboardFocusManager.class) {
-            if (this == getCurrentKeyboardFocusManager()) {
-                return permanentFocusOwner;
-            } else {
-                if (focusLog.isLoggable(PlatformLogger.FINER)) {
-                    focusLog.finer("This manager is " + this + ", current is " + getCurrentKeyboardFocusManager());
-                }
-                throw new SecurityException(notPrivileged);
-            }
+            checkKFMSecurity();
+            return permanentFocusOwner;
         }
     }
 
@@ -708,16 +736,23 @@
      * @see Component#requestFocus()
      * @see Component#requestFocusInWindow()
      * @see Component#isFocusable
+     * @throws SecurityException if this KeyboardFocusManager is not the
+     *         current KeyboardFocusManager for the calling thread's context
+     *         and if the calling thread does not have "replaceKeyboardFocusManager"
+     *         permission
      * @beaninfo
      *       bound: true
      */
     protected void setGlobalPermanentFocusOwner(Component permanentFocusOwner)
+        throws SecurityException
     {
         Component oldPermanentFocusOwner = null;
         boolean shouldFire = false;
 
         if (permanentFocusOwner == null || permanentFocusOwner.isFocusable()) {
             synchronized (KeyboardFocusManager.class) {
+                checkKFMSecurity();
+
                 oldPermanentFocusOwner = getPermanentFocusOwner();
 
                 try {
@@ -770,27 +805,19 @@
      * Returns the focused Window, even if the calling thread is in a different
      * context than the focused Window. The focused Window is the Window that
      * is or contains the focus owner.
-     * <p>
-     * This method will throw a SecurityException if this KeyboardFocusManager
-     * is not the current KeyboardFocusManager for the calling thread's
-     * context.
      *
      * @return the focused Window
      * @see #getFocusedWindow
      * @see #setGlobalFocusedWindow
      * @throws SecurityException if this KeyboardFocusManager is not the
      *         current KeyboardFocusManager for the calling thread's context
+     *         and if the calling thread does not have "replaceKeyboardFocusManager"
+     *         permission
      */
     protected Window getGlobalFocusedWindow() throws SecurityException {
         synchronized (KeyboardFocusManager.class) {
-            if (this == getCurrentKeyboardFocusManager()) {
-               return focusedWindow;
-            } else {
-                if (focusLog.isLoggable(PlatformLogger.FINER)) {
-                    focusLog.finer("This manager is " + this + ", current is " + getCurrentKeyboardFocusManager());
-                }
-                throw new SecurityException(notPrivileged);
-            }
+            checkKFMSecurity();
+            return focusedWindow;
         }
     }
 
@@ -812,15 +839,23 @@
      * @see Component#requestFocus()
      * @see Component#requestFocusInWindow()
      * @see Window#isFocusableWindow
+     * @throws SecurityException if this KeyboardFocusManager is not the
+     *         current KeyboardFocusManager for the calling thread's context
+     *         and if the calling thread does not have "replaceKeyboardFocusManager"
+     *         permission
      * @beaninfo
      *       bound: true
      */
-    protected void setGlobalFocusedWindow(Window focusedWindow) {
+    protected void setGlobalFocusedWindow(Window focusedWindow)
+        throws SecurityException
+    {
         Window oldFocusedWindow = null;
         boolean shouldFire = false;
 
         if (focusedWindow == null || focusedWindow.isFocusableWindow()) {
             synchronized (KeyboardFocusManager.class) {
+                checkKFMSecurity();
+
                 oldFocusedWindow = getFocusedWindow();
 
                 try {
@@ -874,27 +909,19 @@
      * or its children with special decorations, such as a highlighted title
      * bar. The active Window is always either the focused Window, or the first
      * Frame or Dialog that is an owner of the focused Window.
-     * <p>
-     * This method will throw a SecurityException if this KeyboardFocusManager
-     * is not the current KeyboardFocusManager for the calling thread's
-     * context.
      *
      * @return the active Window
      * @see #getActiveWindow
      * @see #setGlobalActiveWindow
      * @throws SecurityException if this KeyboardFocusManager is not the
      *         current KeyboardFocusManager for the calling thread's context
+     *         and if the calling thread does not have "replaceKeyboardFocusManager"
+     *         permission
      */
     protected Window getGlobalActiveWindow() throws SecurityException {
         synchronized (KeyboardFocusManager.class) {
-            if (this == getCurrentKeyboardFocusManager()) {
-               return activeWindow;
-            } else {
-                if (focusLog.isLoggable(PlatformLogger.FINER)) {
-                    focusLog.finer("This manager is " + this + ", current is " + getCurrentKeyboardFocusManager());
-                }
-                throw new SecurityException(notPrivileged);
-            }
+            checkKFMSecurity();
+            return activeWindow;
         }
     }
 
@@ -917,12 +944,20 @@
      * @see #getGlobalActiveWindow
      * @see Component#requestFocus()
      * @see Component#requestFocusInWindow()
+     * @throws SecurityException if this KeyboardFocusManager is not the
+     *         current KeyboardFocusManager for the calling thread's context
+     *         and if the calling thread does not have "replaceKeyboardFocusManager"
+     *         permission
      * @beaninfo
      *       bound: true
      */
-    protected void setGlobalActiveWindow(Window activeWindow) {
+    protected void setGlobalActiveWindow(Window activeWindow)
+        throws SecurityException
+    {
         Window oldActiveWindow;
         synchronized (KeyboardFocusManager.class) {
+            checkKFMSecurity();
+
             oldActiveWindow = getActiveWindow();
             if (focusLog.isLoggable(PlatformLogger.FINER)) {
                 focusLog.finer("Setting global active window to " + activeWindow + ", old active " + oldActiveWindow);
@@ -991,12 +1026,12 @@
 
     /**
      * Sets the default focus traversal keys for a given traversal operation.
-     * This traversal key <code>Set</code> will be in effect on all
-     * <code>Window</code>s that have no such <code>Set</code> of
-     * their own explicitly defined. This <code>Set</code> will also be
-     * inherited, recursively, by any child <code>Component</code> of
-     * those <code>Windows</code> that has
-     * no such <code>Set</code> of its own explicitly defined.
+     * This traversal key {@code Set} will be in effect on all
+     * {@code Window}s that have no such {@code Set} of
+     * their own explicitly defined. This {@code Set} will also be
+     * inherited, recursively, by any child {@code Component} of
+     * those {@code Windows} that has
+     * no such {@code Set} of its own explicitly defined.
      * <p>
      * The default values for the default focus traversal keys are
      * implementation-dependent. Sun recommends that all implementations for a
@@ -1011,66 +1046,67 @@
      *    <th>Default</th>
      * </tr>
      * <tr>
-     *    <td><code>KeyboardFocusManager.FORWARD_TRAVERSAL_KEYS</code></td>
+     *    <td>{@code KeyboardFocusManager.FORWARD_TRAVERSAL_KEYS}</td>
      *    <td>Normal forward keyboard traversal</td>
-     *    <td><code>TAB</code> on <code>KEY_PRESSED</code>,
-     *        <code>CTRL-TAB</code> on <code>KEY_PRESSED</code></td>
+     *    <td>{@code TAB} on {@code KEY_PRESSED},
+     *        {@code CTRL-TAB} on {@code KEY_PRESSED}</td>
      * </tr>
      * <tr>
-     *    <td><code>KeyboardFocusManager.BACKWARD_TRAVERSAL_KEYS</code></td>
+     *    <td>{@code KeyboardFocusManager.BACKWARD_TRAVERSAL_KEYS}</td>
      *    <td>Normal reverse keyboard traversal</td>
-     *    <td><code>SHIFT-TAB</code> on <code>KEY_PRESSED</code>,
-     *        <code>CTRL-SHIFT-TAB</code> on <code>KEY_PRESSED</code></td>
+     *    <td>{@code SHIFT-TAB} on {@code KEY_PRESSED},
+     *        {@code CTRL-SHIFT-TAB} on {@code KEY_PRESSED}</td>
      * </tr>
      * <tr>
-     *    <td><code>KeyboardFocusManager.UP_CYCLE_TRAVERSAL_KEYS</code></td>
+     *    <td>{@code KeyboardFocusManager.UP_CYCLE_TRAVERSAL_KEYS}</td>
      *    <td>Go up one focus traversal cycle</td>
      *    <td>none</td>
      * </tr>
      * <tr>
-     *    <td><code>KeyboardFocusManager.DOWN_CYCLE_TRAVERSAL_KEYS</code></td>
+     *    <td>{@code KeyboardFocusManager.DOWN_CYCLE_TRAVERSAL_KEYS}</td>
      *    <td>Go down one focus traversal cycle</td>
      *    <td>none</td>
      * </tr>
      * </table>
      *
-     * To disable a traversal key, use an empty <code>Set</code>;
-     * <code>Collections.EMPTY_SET</code> is recommended.
+     * To disable a traversal key, use an empty {@code Set};
+     * {@code Collections.EMPTY_SET} is recommended.
      * <p>
-     * Using the <code>AWTKeyStroke</code> API, client code can
+     * Using the {@code AWTKeyStroke} API, client code can
      * specify on which of two
-     * specific <code>KeyEvent</code>s, <code>KEY_PRESSED</code> or
-     * <code>KEY_RELEASED</code>, the focus traversal operation will
-     * occur. Regardless of which <code>KeyEvent</code> is specified,
-     * however, all <code>KeyEvent</code>s related to the focus
-     * traversal key, including the associated <code>KEY_TYPED</code>
+     * specific {@code KeyEvent}s, {@code KEY_PRESSED} or
+     * {@code KEY_RELEASED}, the focus traversal operation will
+     * occur. Regardless of which {@code KeyEvent} is specified,
+     * however, all {@code KeyEvent}s related to the focus
+     * traversal key, including the associated {@code KEY_TYPED}
      * event, will be consumed, and will not be dispatched
-     * to any <code>Component</code>. It is a runtime error to
-     * specify a <code>KEY_TYPED</code> event as
+     * to any {@code Component}. It is a runtime error to
+     * specify a {@code KEY_TYPED} event as
      * mapping to a focus traversal operation, or to map the same event to
      * multiple default focus traversal operations.
+     * <p>
+     * This method may throw a {@code ClassCastException} if any {@code Object}
+     * in {@code keystrokes} is not an {@code AWTKeyStroke}.
      *
      * @param id one of
-     *        <code>KeyboardFocusManager.FORWARD_TRAVERSAL_KEYS</code>,
-     *        <code>KeyboardFocusManager.BACKWARD_TRAVERSAL_KEYS</code>,
-     *        <code>KeyboardFocusManager.UP_CYCLE_TRAVERSAL_KEYS</code>, or
-     *        <code>KeyboardFocusManager.DOWN_CYCLE_TRAVERSAL_KEYS</code>
-     * @param keystrokes the Set of <code>AWTKeyStroke</code>s for the
+     *        {@code KeyboardFocusManager.FORWARD_TRAVERSAL_KEYS},
+     *        {@code KeyboardFocusManager.BACKWARD_TRAVERSAL_KEYS},
+     *        {@code KeyboardFocusManager.UP_CYCLE_TRAVERSAL_KEYS}, or
+     *        {@code KeyboardFocusManager.DOWN_CYCLE_TRAVERSAL_KEYS}
+     * @param keystrokes the Set of {@code AWTKeyStroke}s for the
      *        specified operation
      * @see #getDefaultFocusTraversalKeys
      * @see Component#setFocusTraversalKeys
      * @see Component#getFocusTraversalKeys
      * @throws IllegalArgumentException if id is not one of
-     *         <code>KeyboardFocusManager.FORWARD_TRAVERSAL_KEYS</code>,
-     *         <code>KeyboardFocusManager.BACKWARD_TRAVERSAL_KEYS</code>,
-     *         <code>KeyboardFocusManager.UP_CYCLE_TRAVERSAL_KEYS</code>, or
-     *         <code>KeyboardFocusManager.DOWN_CYCLE_TRAVERSAL_KEYS</code>,
-     *         or if keystrokes is <code>null</code>,
-     *         or if keystrokes contains <code>null</code>,
-     *         or if any <code>Object</code> in
-     *         keystrokes is not an <code>AWTKeyStroke</code>,
+     *         {@code KeyboardFocusManager.FORWARD_TRAVERSAL_KEYS},
+     *         {@code KeyboardFocusManager.BACKWARD_TRAVERSAL_KEYS},
+     *         {@code KeyboardFocusManager.UP_CYCLE_TRAVERSAL_KEYS}, or
+     *         {@code KeyboardFocusManager.DOWN_CYCLE_TRAVERSAL_KEYS},
+     *         or if keystrokes is {@code null},
+     *         or if keystrokes contains {@code null},
      *         or if any keystroke
-     *         represents a <code>KEY_TYPED</code> event,
+     *         represents a {@code KEY_TYPED} event,
      *         or if any keystroke already maps
      *         to another default focus traversal operation
      * @beaninfo
@@ -1090,20 +1126,12 @@
         Set oldKeys;
 
         synchronized (this) {
-            for (Iterator iter = keystrokes.iterator(); iter.hasNext(); ) {
-                Object obj = iter.next();
+            for (AWTKeyStroke keystroke : keystrokes) {
 
-                if (obj == null) {
+                if (keystroke == null) {
                     throw new IllegalArgumentException("cannot set null focus traversal key");
                 }
 
-                // Fix for 6195831:
-                //According to javadoc this method should throw IAE instead of ClassCastException
-                if (!(obj instanceof AWTKeyStroke)) {
-                    throw new IllegalArgumentException("object is expected to be AWTKeyStroke");
-                }
-                AWTKeyStroke keystroke = (AWTKeyStroke)obj;
-
                 if (keystroke.getKeyChar() != KeyEvent.CHAR_UNDEFINED) {
                     throw new IllegalArgumentException("focus traversal keys cannot map to KEY_TYPED events");
                 }
@@ -1201,10 +1229,6 @@
      * Components represent the next and previous Components to focus during
      * normal focus traversal. In that case, the current focus cycle root is
      * used to differentiate among the possibilities.
-     * <p>
-     * This method will throw a SecurityException if this KeyboardFocusManager
-     * is not the current KeyboardFocusManager for the calling thread's
-     * context.
      *
      * @return the current focus cycle root, or null if the current focus cycle
      *         root is not a member of the calling thread's context
@@ -1212,19 +1236,15 @@
      * @see #setGlobalCurrentFocusCycleRoot
      * @throws SecurityException if this KeyboardFocusManager is not the
      *         current KeyboardFocusManager for the calling thread's context
+     *         and if the calling thread does not have "replaceKeyboardFocusManager"
+     *         permission
      */
     protected Container getGlobalCurrentFocusCycleRoot()
         throws SecurityException
     {
         synchronized (KeyboardFocusManager.class) {
-            if (this == getCurrentKeyboardFocusManager()) {
-                return currentFocusCycleRoot;
-            } else {
-                if (focusLog.isLoggable(PlatformLogger.FINER)) {
-                    focusLog.finer("This manager is " + this + ", current is " + getCurrentKeyboardFocusManager());
-                }
-                throw new SecurityException(notPrivileged);
-            }
+            checkKFMSecurity();
+            return currentFocusCycleRoot;
         }
     }
 
@@ -1235,16 +1255,27 @@
      * In that case, the current focus cycle root is used to differentiate
      * among the possibilities.
      * <p>
+     * If a SecurityManager is installed, the calling thread must be granted
+     * the "replaceKeyboardFocusManager" AWTPermission. If this permission is
+     * not granted, this method will throw a SecurityException, and the current
+     * focus cycle root will not be changed.
+     * <p>
      * This method is intended to be used only by KeyboardFocusManagers and
      * focus implementations. It is not for general client use.
      *
      * @param newFocusCycleRoot the new focus cycle root
      * @see #getCurrentFocusCycleRoot
      * @see #getGlobalCurrentFocusCycleRoot
+     * @throws SecurityException if the calling thread does not have
+     *         "replaceKeyboardFocusManager" permission
      * @beaninfo
      *       bound: true
      */
-    public void setGlobalCurrentFocusCycleRoot(Container newFocusCycleRoot) {
+    public void setGlobalCurrentFocusCycleRoot(Container newFocusCycleRoot)
+        throws SecurityException
+    {
+        checkReplaceKFMPermission();
+
         Container oldFocusCycleRoot;
 
         synchronized (KeyboardFocusManager.class) {
@@ -1256,6 +1287,15 @@
                            newFocusCycleRoot);
     }
 
+    void setGlobalCurrentFocusCycleRootPriv(final Container newFocusCycleRoot) {
+        AccessController.doPrivileged(new PrivilegedAction<Void>() {
+            public Void run() {
+                setGlobalCurrentFocusCycleRoot(newFocusCycleRoot);
+                return null;
+            }
+        });
+    }
+
     /**
      * Adds a PropertyChangeListener to the listener list. The listener is
      * registered for all bound properties of this class, including the
@@ -3065,4 +3105,39 @@
                 : null;
         }
     }
+
+    private static void checkReplaceKFMPermission()
+        throws SecurityException
+    {
+        SecurityManager security = System.getSecurityManager();
+        if (security != null) {
+            if (replaceKeyboardFocusManagerPermission == null) {
+                replaceKeyboardFocusManagerPermission =
+                    new AWTPermission("replaceKeyboardFocusManager");
+            }
+            security.
+                checkPermission(replaceKeyboardFocusManagerPermission);
+        }
+    }
+
+    // Checks if this KeyboardFocusManager instance is the current KFM,
+    // or otherwise checks if the calling thread has "replaceKeyboardFocusManager"
+    // permission. Here's the reasoning to do so:
+    //
+    // A system KFM instance (which is the current KFM by default) may have no
+    // "replaceKFM" permission when a client code is on the call stack beneath,
+    // but still it should be able to execute the methods protected by this check
+    // due to the system KFM is trusted (and so it does like "privileged").
+    //
+    // If this KFM instance is not the current KFM but the client code has all
+    // permissions we can't throw SecurityException because it would contradict
+    // the security concepts. In this case the trusted client code is responsible
+    // for calling the secured methods from KFM instance which is not current.
+    private void checkKFMSecurity()
+        throws SecurityException
+    {
+        if (this != getCurrentKeyboardFocusManager()) {
+            checkReplaceKFMPermission();
+        }
+    }
 }
--- a/src/share/classes/java/awt/Window.java	Fri May 25 12:56:22 2012 +0400
+++ b/src/share/classes/java/awt/Window.java	Fri May 25 19:34:32 2012 -0700
@@ -506,7 +506,7 @@
 
         modalExclusionType = Dialog.ModalExclusionType.NO_EXCLUDE;
 
-        SunToolkit.checkAndSetPolicy(this, false);
+        SunToolkit.checkAndSetPolicy(this);
     }
 
     /**
@@ -2568,7 +2568,7 @@
                     }
                 }
             KeyboardFocusManager.getCurrentKeyboardFocusManager().
-                clearGlobalFocusOwner();
+                clearGlobalFocusOwnerPriv();
         }
     }
 
--- a/src/share/classes/java/lang/Integer.java	Fri May 25 12:56:22 2012 +0400
+++ b/src/share/classes/java/lang/Integer.java	Fri May 25 19:34:32 2012 -0700
@@ -780,6 +780,9 @@
             int j = low;
             for(int k = 0; k < cache.length; k++)
                 cache[k] = new Integer(j++);
+
+            // range [-128, 127] must be interned (JLS7 5.1.7)
+            assert IntegerCache.high >= 127;
         }
 
         private IntegerCache() {}
@@ -801,7 +804,6 @@
      * @since  1.5
      */
     public static Integer valueOf(int i) {
-        assert IntegerCache.high >= 127;
         if (i >= IntegerCache.low && i <= IntegerCache.high)
             return IntegerCache.cache[i + (-IntegerCache.low)];
         return new Integer(i);
--- a/src/share/classes/java/nio/MappedByteBuffer.java	Fri May 25 12:56:22 2012 +0400
+++ b/src/share/classes/java/nio/MappedByteBuffer.java	Fri May 25 19:34:32 2012 -0700
@@ -139,6 +139,9 @@
         return isLoaded0(mappingAddress(offset), length, Bits.pageCount(length));
     }
 
+    // not used, but a potential target for a store, see load() for details.
+    private static byte unused;
+
     /**
      * Loads this buffer's content into physical memory.
      *
@@ -157,15 +160,20 @@
         long length = mappingLength(offset);
         load0(mappingAddress(offset), length);
 
-        // touch each page
+        // Read a byte from each page to bring it into memory. A checksum
+        // is computed as we go along to prevent the compiler from otherwise
+        // considering the loop as dead code.
         Unsafe unsafe = Unsafe.getUnsafe();
         int ps = Bits.pageSize();
         int count = Bits.pageCount(length);
         long a = mappingAddress(offset);
+        byte x = 0;
         for (int i=0; i<count; i++) {
-            unsafe.getByte(a);
+            x ^= unsafe.getByte(a);
             a += ps;
         }
+        if (unused != 0)
+            unused = x;
 
         return this;
     }
--- a/src/share/classes/java/security/spec/MGF1ParameterSpec.java	Fri May 25 12:56:22 2012 +0400
+++ b/src/share/classes/java/security/spec/MGF1ParameterSpec.java	Fri May 25 19:34:32 2012 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 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
@@ -42,6 +42,7 @@
  * <pre>
  * OAEP-PSSDigestAlgorithms    ALGORITHM-IDENTIFIER ::= {
  *   { OID id-sha1 PARAMETERS NULL   }|
+ *   { OID id-sha224 PARAMETERS NULL   }|
  *   { OID id-sha256 PARAMETERS NULL }|
  *   { OID id-sha384 PARAMETERS NULL }|
  *   { OID id-sha512 PARAMETERS NULL },
@@ -63,6 +64,11 @@
     public static final MGF1ParameterSpec SHA1 =
         new MGF1ParameterSpec("SHA-1");
     /**
+     * The MGF1ParameterSpec which uses "SHA-224" message digest.
+     */
+    public static final MGF1ParameterSpec SHA224 =
+        new MGF1ParameterSpec("SHA-224");
+    /**
      * The MGF1ParameterSpec which uses "SHA-256" message digest.
      */
     public static final MGF1ParameterSpec SHA256 =
--- a/src/share/classes/java/security/spec/PSSParameterSpec.java	Fri May 25 12:56:22 2012 +0400
+++ b/src/share/classes/java/security/spec/PSSParameterSpec.java	Fri May 25 19:34:32 2012 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2001, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 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
@@ -47,6 +47,7 @@
  * <pre>
  * OAEP-PSSDigestAlgorithms    ALGORITHM-IDENTIFIER ::= {
  *   { OID id-sha1 PARAMETERS NULL   }|
+ *   { OID id-sha224 PARAMETERS NULL   }|
  *   { OID id-sha256 PARAMETERS NULL }|
  *   { OID id-sha384 PARAMETERS NULL }|
  *   { OID id-sha512 PARAMETERS NULL },
--- a/src/share/classes/java/util/NoSuchElementException.java	Fri May 25 12:56:22 2012 +0400
+++ b/src/share/classes/java/util/NoSuchElementException.java	Fri May 25 19:34:32 2012 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1994, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1994, 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
@@ -26,13 +26,12 @@
 package java.util;
 
 /**
- * Thrown by the <code>nextElement</code> method of an
- * <code>Enumeration</code> to indicate that there are no more
- * elements in the enumeration.
+ * Thrown by various accessor methods to indicate that the element being requested
+ * does not exist.
  *
  * @author  unascribed
- * @see     java.util.Enumeration
  * @see     java.util.Enumeration#nextElement()
+ * @see     java.util.Iterator#next()
  * @since   JDK1.0
  */
 public
--- a/src/share/classes/java/util/UUID.java	Fri May 25 12:56:22 2012 +0400
+++ b/src/share/classes/java/util/UUID.java	Fri May 25 19:34:32 2012 -0700
@@ -90,9 +90,11 @@
 
     /*
      * The random number generator used by this class to create random
-     * based UUIDs.
+     * based UUIDs. In a holder class to defer initialization until needed.
      */
-    private static volatile SecureRandom numberGenerator = null;
+    private static class Holder {
+        static final SecureRandom numberGenerator = new SecureRandom();
+    }
 
     // Constructors and Factories
 
@@ -137,10 +139,7 @@
      * @return  A randomly generated {@code UUID}
      */
     public static UUID randomUUID() {
-        SecureRandom ng = numberGenerator;
-        if (ng == null) {
-            numberGenerator = ng = new SecureRandom();
-        }
+        SecureRandom ng = Holder.numberGenerator;
 
         byte[] randomBytes = new byte[16];
         ng.nextBytes(randomBytes);
@@ -255,7 +254,8 @@
      * The variant number has the following meaning:
      * <p><ul>
      * <li>0    Reserved for NCS backward compatibility
-     * <li>2    The Leach-Salz variant (used by this class)
+     * <li>2    <a href="http://www.ietf.org/rfc/rfc4122.txt">IETF&nbsp;RFC&nbsp;4122</a>
+     * (Leach-Salz), used by this class
      * <li>6    Reserved, Microsoft Corporation backward compatibility
      * <li>7    Reserved for future definition
      * </ul>
@@ -265,7 +265,7 @@
     public int variant() {
         // This field is composed of a varying number of bits.
         // 0    -    -    Reserved for NCS backward compatibility
-        // 1    0    -    The Leach-Salz variant (used by this class)
+        // 1    0    -    The IETF aka Leach-Salz variant (used by this class)
         // 1    1    0    Reserved, Microsoft backward compatibility
         // 1    1    1    Reserved for future definition.
         return (int) ((leastSigBits >>> (64 - (leastSigBits >>> 62)))
--- a/src/share/classes/java/util/concurrent/atomic/AtomicIntegerFieldUpdater.java	Fri May 25 12:56:22 2012 +0400
+++ b/src/share/classes/java/util/concurrent/atomic/AtomicIntegerFieldUpdater.java	Fri May 25 19:34:32 2012 -0700
@@ -35,7 +35,11 @@
 
 package java.util.concurrent.atomic;
 import sun.misc.Unsafe;
-import java.lang.reflect.*;
+import java.lang.reflect.Field;
+import java.lang.reflect.Modifier;
+import java.security.AccessController;
+import java.security.PrivilegedExceptionAction;
+import java.security.PrivilegedActionException;
 
 /**
  * A reflection-based utility that enables atomic updates to
@@ -67,7 +71,9 @@
      * @throws IllegalArgumentException if the field is not a
      * volatile integer type
      * @throws RuntimeException with a nested reflection-based
-     * exception if the class does not hold field or is the wrong type
+     * exception if the class does not hold field or is the wrong type,
+     * or the field is inaccessible to the caller according to Java language
+     * access control
      */
     public static <U> AtomicIntegerFieldUpdater<U> newUpdater(Class<U> tclass, String fieldName) {
         return new AtomicIntegerFieldUpdaterImpl<U>(tclass, fieldName);
@@ -267,17 +273,29 @@
         private final Class<T> tclass;
         private final Class<?> cclass;
 
-        AtomicIntegerFieldUpdaterImpl(Class<T> tclass, String fieldName) {
+        AtomicIntegerFieldUpdaterImpl(final Class<T> tclass, final String fieldName) {
             Field field = null;
             Class<?> caller = null;
             int modifiers = 0;
             try {
-                field = tclass.getDeclaredField(fieldName);
+                field = AccessController.doPrivileged(
+                    new PrivilegedExceptionAction<Field>() {
+                        public Field run() throws NoSuchFieldException {
+                            return tclass.getDeclaredField(fieldName);
+                        }
+                    });
                 caller = sun.reflect.Reflection.getCallerClass(3);
                 modifiers = field.getModifiers();
                 sun.reflect.misc.ReflectUtil.ensureMemberAccess(
                     caller, tclass, null, modifiers);
-                sun.reflect.misc.ReflectUtil.checkPackageAccess(tclass);
+                ClassLoader cl = tclass.getClassLoader();
+                ClassLoader ccl = caller.getClassLoader();
+                if ((ccl != null) && (ccl != cl) &&
+                    ((cl == null) || !isAncestor(cl, ccl))) {
+                  sun.reflect.misc.ReflectUtil.checkPackageAccess(tclass);
+                }
+            } catch (PrivilegedActionException pae) {
+                throw new RuntimeException(pae.getException());
             } catch (Exception ex) {
                 throw new RuntimeException(ex);
             }
@@ -295,6 +313,22 @@
             offset = unsafe.objectFieldOffset(field);
         }
 
+        /**
+         * Returns true if the second classloader can be found in the first
+         * classloader's delegation chain.
+         * Equivalent to the inaccessible: first.isAncestor(second).
+         */
+        private static boolean isAncestor(ClassLoader first, ClassLoader second) {
+            ClassLoader acl = first;
+            do {
+                acl = acl.getParent();
+                if (second == acl) {
+                    return true;
+                }
+            } while (acl != null);
+            return false;
+        }
+
         private void fullCheck(T obj) {
             if (!tclass.isInstance(obj))
                 throw new ClassCastException();
--- a/src/share/classes/java/util/concurrent/atomic/AtomicLongFieldUpdater.java	Fri May 25 12:56:22 2012 +0400
+++ b/src/share/classes/java/util/concurrent/atomic/AtomicLongFieldUpdater.java	Fri May 25 19:34:32 2012 -0700
@@ -35,7 +35,11 @@
 
 package java.util.concurrent.atomic;
 import sun.misc.Unsafe;
-import java.lang.reflect.*;
+import java.lang.reflect.Field;
+import java.lang.reflect.Modifier;
+import java.security.AccessController;
+import java.security.PrivilegedExceptionAction;
+import java.security.PrivilegedActionException;
 
 /**
  * A reflection-based utility that enables atomic updates to
@@ -67,7 +71,9 @@
      * @throws IllegalArgumentException if the field is not a
      * volatile long type.
      * @throws RuntimeException with a nested reflection-based
-     * exception if the class does not hold field or is the wrong type.
+     * exception if the class does not hold field or is the wrong type,
+     * or the field is inaccessible to the caller according to Java language
+     * access control
      */
     public static <U> AtomicLongFieldUpdater<U> newUpdater(Class<U> tclass, String fieldName) {
         if (AtomicLong.VM_SUPPORTS_LONG_CAS)
@@ -267,17 +273,29 @@
         private final Class<T> tclass;
         private final Class<?> cclass;
 
-        CASUpdater(Class<T> tclass, String fieldName) {
+        CASUpdater(final Class<T> tclass, final String fieldName) {
             Field field = null;
             Class<?> caller = null;
             int modifiers = 0;
             try {
-                field = tclass.getDeclaredField(fieldName);
+                field = AccessController.doPrivileged(
+                    new PrivilegedExceptionAction<Field>() {
+                        public Field run() throws NoSuchFieldException {
+                            return tclass.getDeclaredField(fieldName);
+                        }
+                    });
                 caller = sun.reflect.Reflection.getCallerClass(3);
                 modifiers = field.getModifiers();
                 sun.reflect.misc.ReflectUtil.ensureMemberAccess(
                     caller, tclass, null, modifiers);
-                sun.reflect.misc.ReflectUtil.checkPackageAccess(tclass);
+                ClassLoader cl = tclass.getClassLoader();
+                ClassLoader ccl = caller.getClassLoader();
+                if ((ccl != null) && (ccl != cl) &&
+                    ((cl == null) || !isAncestor(cl, ccl))) {
+                  sun.reflect.misc.ReflectUtil.checkPackageAccess(tclass);
+                }
+            } catch (PrivilegedActionException pae) {
+                throw new RuntimeException(pae.getException());
             } catch (Exception ex) {
                 throw new RuntimeException(ex);
             }
@@ -350,17 +368,29 @@
         private final Class<T> tclass;
         private final Class<?> cclass;
 
-        LockedUpdater(Class<T> tclass, String fieldName) {
+        LockedUpdater(final Class<T> tclass, final String fieldName) {
             Field field = null;
             Class<?> caller = null;
             int modifiers = 0;
             try {
-                field = tclass.getDeclaredField(fieldName);
+                field = AccessController.doPrivileged(
+                    new PrivilegedExceptionAction<Field>() {
+                        public Field run() throws NoSuchFieldException {
+                            return tclass.getDeclaredField(fieldName);
+                        }
+                    });
                 caller = sun.reflect.Reflection.getCallerClass(3);
                 modifiers = field.getModifiers();
                 sun.reflect.misc.ReflectUtil.ensureMemberAccess(
                     caller, tclass, null, modifiers);
-                sun.reflect.misc.ReflectUtil.checkPackageAccess(tclass);
+                ClassLoader cl = tclass.getClassLoader();
+                ClassLoader ccl = caller.getClassLoader();
+                if ((ccl != null) && (ccl != cl) &&
+                    ((cl == null) || !isAncestor(cl, ccl))) {
+                  sun.reflect.misc.ReflectUtil.checkPackageAccess(tclass);
+                }
+            } catch (PrivilegedActionException pae) {
+                throw new RuntimeException(pae.getException());
             } catch (Exception ex) {
                 throw new RuntimeException(ex);
             }
@@ -433,4 +463,20 @@
             );
         }
     }
+
+    /**
+     * Returns true if the second classloader can be found in the first
+     * classloader's delegation chain.
+     * Equivalent to the inaccessible: first.isAncestor(second).
+     */
+    private static boolean isAncestor(ClassLoader first, ClassLoader second) {
+        ClassLoader acl = first;
+        do {
+            acl = acl.getParent();
+            if (second == acl) {
+                return true;
+            }
+        } while (acl != null);
+        return false;
+    }
 }
--- a/src/share/classes/java/util/concurrent/atomic/AtomicReferenceFieldUpdater.java	Fri May 25 12:56:22 2012 +0400
+++ b/src/share/classes/java/util/concurrent/atomic/AtomicReferenceFieldUpdater.java	Fri May 25 19:34:32 2012 -0700
@@ -35,7 +35,11 @@
 
 package java.util.concurrent.atomic;
 import sun.misc.Unsafe;
-import java.lang.reflect.*;
+import java.lang.reflect.Field;
+import java.lang.reflect.Modifier;
+import java.security.AccessController;
+import java.security.PrivilegedExceptionAction;
+import java.security.PrivilegedActionException;
 
 /**
  * A reflection-based utility that enables atomic updates to
@@ -86,7 +90,9 @@
      * @return the updater
      * @throws IllegalArgumentException if the field is not a volatile reference type.
      * @throws RuntimeException with a nested reflection-based
-     * exception if the class does not hold field or is the wrong type.
+     * exception if the class does not hold field or is the wrong type,
+     * or the field is inaccessible to the caller according to Java language
+     * access control
      */
     public static <U, W> AtomicReferenceFieldUpdater<U,W> newUpdater(Class<U> tclass, Class<W> vclass, String fieldName) {
         return new AtomicReferenceFieldUpdaterImpl<U,W>(tclass,
@@ -197,21 +203,33 @@
          * screenings fail.
          */
 
-        AtomicReferenceFieldUpdaterImpl(Class<T> tclass,
+        AtomicReferenceFieldUpdaterImpl(final Class<T> tclass,
                                         Class<V> vclass,
-                                        String fieldName) {
+                                        final String fieldName) {
             Field field = null;
             Class<?> fieldClass = null;
             Class<?> caller = null;
             int modifiers = 0;
             try {
-                field = tclass.getDeclaredField(fieldName);
+                field = AccessController.doPrivileged(
+                    new PrivilegedExceptionAction<Field>() {
+                        public Field run() throws NoSuchFieldException {
+                            return tclass.getDeclaredField(fieldName);
+                        }
+                    });
                 caller = sun.reflect.Reflection.getCallerClass(3);
                 modifiers = field.getModifiers();
                 sun.reflect.misc.ReflectUtil.ensureMemberAccess(
-                    caller, tclass, null, modifiers);
-                sun.reflect.misc.ReflectUtil.checkPackageAccess(tclass);
+                                                                caller, tclass, null, modifiers);
+                ClassLoader cl = tclass.getClassLoader();
+                ClassLoader ccl = caller.getClassLoader();
+                if ((ccl != null) && (ccl != cl) &&
+                    ((cl == null) || !isAncestor(cl, ccl))) {
+                    sun.reflect.misc.ReflectUtil.checkPackageAccess(tclass);
+                }
                 fieldClass = field.getType();
+            } catch (PrivilegedActionException pae) {
+                throw new RuntimeException(pae.getException());
             } catch (Exception ex) {
                 throw new RuntimeException(ex);
             }
@@ -232,6 +250,22 @@
             offset = unsafe.objectFieldOffset(field);
         }
 
+        /**
+         * Returns true if the second classloader can be found in the first
+         * classloader's delegation chain.
+         * Equivalent to the inaccessible: first.isAncestor(second).
+         */
+        private static boolean isAncestor(ClassLoader first, ClassLoader second) {
+            ClassLoader acl = first;
+            do {
+                acl = acl.getParent();
+                if (second == acl) {
+                    return true;
+                }
+            } while (acl != null);
+            return false;
+        }
+
         void targetCheck(T obj) {
             if (!tclass.isInstance(obj))
                 throw new ClassCastException();
@@ -281,7 +315,7 @@
         }
 
         @SuppressWarnings("unchecked")
-        public V get(T obj) {
+            public V get(T obj) {
             if (obj == null || obj.getClass() != tclass || cclass != null)
                 targetCheck(obj);
             return (V)unsafe.getObjectVolatile(obj, offset);
@@ -292,14 +326,14 @@
                 return;
             }
             throw new RuntimeException(
-                new IllegalAccessException("Class " +
-                    cclass.getName() +
-                    " can not access a protected member of class " +
-                    tclass.getName() +
-                    " using an instance of " +
-                    obj.getClass().getName()
-                )
-            );
+                                       new IllegalAccessException("Class " +
+                                                                  cclass.getName() +
+                                                                  " can not access a protected member of class " +
+                                                                  tclass.getName() +
+                                                                  " using an instance of " +
+                                                                  obj.getClass().getName()
+                                                                  )
+                                       );
         }
     }
 }
--- a/src/share/classes/java/util/prefs/AbstractPreferences.java	Fri May 25 12:56:22 2012 +0400
+++ b/src/share/classes/java/util/prefs/AbstractPreferences.java	Fri May 25 19:34:32 2012 -0700
@@ -305,8 +305,10 @@
      * @param key key whose mapping is to be removed from the preference node.
      * @throws IllegalStateException if this node (or an ancestor) has been
      *         removed with the {@link #removeNode()} method.
+     * @throws NullPointerException {@inheritDoc}.
      */
     public void remove(String key) {
+        Objects.requireNonNull(key, "Specified key cannot be null");
         synchronized(lock) {
             if (removed)
                 throw new IllegalStateException("Node has been removed.");
--- a/src/share/classes/java/util/regex/Pattern.java	Fri May 25 12:56:22 2012 +0400
+++ b/src/share/classes/java/util/regex/Pattern.java	Fri May 25 19:34:32 2012 -0700
@@ -152,15 +152,24 @@
  *     <td headers="matches">A digit: <tt>[0-9]</tt></td></tr>
  * <tr><td valign="top" headers="construct predef"><tt>\D</tt></td>
  *     <td headers="matches">A non-digit: <tt>[^0-9]</tt></td></tr>
+ * <tr><td valign="top" headers="construct predef"><tt>\h</tt></td>
+ *     <td headers="matches">A horizontal whitespace character:
+ *     <tt>[ \t\xA0&#92;u1680&#92;u180e&#92;u2000-&#92;u200a&#92;u202f&#92;u205f&#92;u3000]</tt></td></tr>
+ * <tr><td valign="top" headers="construct predef"><tt>\H</tt></td>
+ *     <td headers="matches">A non-horizontal whitespace character: <tt>[^\h]</tt></td></tr>
  * <tr><td valign="top" headers="construct predef"><tt>\s</tt></td>
  *     <td headers="matches">A whitespace character: <tt>[ \t\n\x0B\f\r]</tt></td></tr>
  * <tr><td valign="top" headers="construct predef"><tt>\S</tt></td>
  *     <td headers="matches">A non-whitespace character: <tt>[^\s]</tt></td></tr>
+ * <tr><td valign="top" headers="construct predef"><tt>\v</tt></td>
+ *     <td headers="matches">A vertical whitespace character: <tt>[\n\x0B\f\r\x85&#92;u2028&#92;u2029]</tt>
+ *     </td></tr>
+ * <tr><td valign="top" headers="construct predef"><tt>\V</tt></td>
+ *     <td headers="matches">A non-vertical whitespace character: <tt>[^\v]</tt></td></tr>
  * <tr><td valign="top" headers="construct predef"><tt>\w</tt></td>
  *     <td headers="matches">A word character: <tt>[a-zA-Z_0-9]</tt></td></tr>
  * <tr><td valign="top" headers="construct predef"><tt>\W</tt></td>
  *     <td headers="matches">A non-word character: <tt>[^\w]</tt></td></tr>
- *
  * <tr><th>&nbsp;</th></tr>
  * <tr align="left"><th colspan="2" id="posix">POSIX character classes</b> (US-ASCII only)<b></th></tr>
  *
@@ -244,6 +253,13 @@
  *     <td headers="matches">The end of the input</td></tr>
  *
  * <tr><th>&nbsp;</th></tr>
+ * <tr align="left"><th colspan="2" id="lineending">Linebreak matcher</th></tr>
+ * <tr><td valign="top" headers="construct lineending"><tt>\R</tt></td>
+ *     <td headers="matches">Any Unicode linebreak sequence, is equivalent to
+ *     <tt>&#92;u000D&#92;u000A|[&#92;u000A&#92;u000B&#92;u000C&#92;u000D&#92;u0085&#92;u2028&#92;u2029]
+ *     </tt></td></tr>
+ *
+ * <tr><th>&nbsp;</th></tr>
  * <tr align="left"><th colspan="2" id="greedy">Greedy quantifiers</th></tr>
  *
  * <tr><td valign="top" headers="construct greedy"><i>X</i><tt>?</tt></td>
@@ -599,11 +615,9 @@
  *   <li> Noncharacter_Code_Point
  *   <li> Assigned
  * </ul>
-
-
  * <p>
- * <b>Predefined Character classes</b> and <b>POSIX character classes</b> are in
- * conformance with the recommendation of <i>Annex C: Compatibility Properties</i>
+ * The following <b>Predefined Character classes</b> and <b>POSIX character classes</b>
+ * are in conformance with the recommendation of <i>Annex C: Compatibility Properties</i>
  * of <a href="http://www.unicode.org/reports/tr18/"><i>Unicode Regular Expression
  * </i></a>, when {@link #UNICODE_CHARACTER_CLASS} flag is specified.
  * <p>
@@ -668,12 +682,6 @@
  *
  * <ul>
  *    <li><p> Predefined character classes (Unicode character)
- *    <p><tt>\h&nbsp;&nbsp;&nbsp;&nbsp;</tt>A horizontal whitespace
- *    <p><tt>\H&nbsp;&nbsp;&nbsp;&nbsp;</tt>A non horizontal whitespace
- *    <p><tt>\v&nbsp;&nbsp;&nbsp;&nbsp;</tt>A vertical whitespace
- *    <p><tt>\V&nbsp;&nbsp;&nbsp;&nbsp;</tt>A non vertical whitespace
- *    <p><tt>\R&nbsp;&nbsp;&nbsp;&nbsp;</tt>Any Unicode linebreak sequence
- *    <tt>\u005cu000D\u005cu000A|[\u005cu000A\u005cu000B\u005cu000C\u005cu000D\u005cu0085\u005cu2028\u005cu2029]</tt>
  *    <p><tt>\X&nbsp;&nbsp;&nbsp;&nbsp;</tt>Match Unicode
  *    <a href="http://www.unicode.org/reports/tr18/#Default_Grapheme_Clusters">
  *    <i>extended grapheme cluster</i></a>
@@ -2178,7 +2186,7 @@
                 }
                 unread();
                 prev = cursor;
-                ch = escape(false, first == 0);
+                ch = escape(false, first == 0, false);
                 if (ch >= 0) {
                     append(ch, first);
                     first++;
@@ -2276,7 +2284,7 @@
      * If the returned value is greater than zero, it is the value that
      * matches the escape sequence.
      */
-    private int escape(boolean inclass, boolean create) {
+    private int escape(boolean inclass, boolean create, boolean isrange) {
         int ch = skip();
         switch (ch) {
         case '0':
@@ -2318,6 +2326,8 @@
             if (create) root = new LastMatch();
             return -1;
         case 'H':
+            if (create) root = new HorizWS().complement();
+            return -1;
         case 'I':
         case 'J':
         case 'K':
@@ -2327,8 +2337,11 @@
         case 'O':
         case 'P':
         case 'Q':
+            break;
         case 'R':
-            break;
+            if (inclass) break;
+            if (create) root = new LineEnding();
+            return -1;
         case 'S':
             if (create) root = has(UNICODE_CHARACTER_CLASS)
                                ? new Utype(UnicodeProp.WHITE_SPACE).complement()
@@ -2336,8 +2349,10 @@
             return -1;
         case 'T':
         case 'U':
+            break;
         case 'V':
-            break;
+            if (create) root = new VertWS().complement();
+            return -1;
         case 'W':
             if (create) root = has(UNICODE_CHARACTER_CLASS)
                                ? new Utype(UnicodeProp.WORD).complement()
@@ -2373,7 +2388,10 @@
         case 'f':
             return '\f';
         case 'g':
+            break;
         case 'h':
+            if (create) root = new HorizWS();
+            return -1;
         case 'i':
         case 'j':
             break;
@@ -2413,7 +2431,18 @@
         case 'u':
             return u();
         case 'v':
-            return '\013';
+            // '\v' was implemented as VT/0x0B in releases < 1.8 (though
+            // undocumented). In JDK8 '\v' is specified as a predefined
+            // character class for all vertical whitespace characters.
+            // So [-1, root=VertWS node] pair is returned (instead of a
+            // single 0x0B). This breaks the range if '\v' is used as
+            // the start or end value, such as [\v-...] or [...-\v], in
+            // which a single definite value (0x0B) is expected. For
+            // compatiblity concern '\013'/0x0B is returned if isrange.
+            if (isrange)
+                return '\013';
+            if (create) root = new VertWS();
+            return -1;
         case 'w':
             if (create) root = has(UNICODE_CHARACTER_CLASS)
                                ? new Utype(UnicodeProp.WORD)
@@ -2590,13 +2619,14 @@
                     oneLetter = false;
                 return family(oneLetter, comp);
             } else { // ordinary escape
+                boolean isrange = temp[cursor+1] == '-';
                 unread();
-                ch = escape(true, true);
+                ch = escape(true, true, isrange);
                 if (ch == -1)
                     return (CharProperty) root;
             }
         } else {
-            ch = single();
+            next();
         }
         if (ch >= 0) {
             if (peek() == '-') {
@@ -2606,9 +2636,15 @@
                 }
                 if (endRange != ']') {
                     next();
-                    int m = single();
-                    if (m < ch)
+                    int m = peek();
+                    if (m == '\\') {
+                        m = escape(true, false, true);
+                    } else {
+                        next();
+                    }
+                    if (m < ch) {
                         throw error("Illegal character range");
+                    }
                     if (has(CASE_INSENSITIVE))
                         return caseInsensitiveRangeFor(ch, m);
                     else
@@ -2620,17 +2656,6 @@
         throw error("Unexpected character '"+((char)ch)+"'");
     }
 
-    private int single() {
-        int ch = peek();
-        switch (ch) {
-        case '\\':
-            return escape(true, false);
-        default:
-            next();
-            return ch;
-        }
-    }
-
     /**
      * Parses a Unicode character family and returns its representative node.
      */
@@ -3695,6 +3720,35 @@
     }
 
     /**
+     * Node class that matches a Unicode line ending '\R'
+     */
+    static final class LineEnding extends Node {
+        boolean match(Matcher matcher, int i, CharSequence seq) {
+            // (u+000Du+000A|[u+000Au+000Bu+000Cu+000Du+0085u+2028u+2029])
+            if (i < matcher.to) {
+                int ch = seq.charAt(i);
+                if (ch == 0x0A || ch == 0x0B || ch == 0x0C ||
+                    ch == 0x85 || ch == 0x2028 || ch == 0x2029)
+                    return next.match(matcher, i + 1, seq);
+                if (ch == 0x0D) {
+                    i++;
+                    if (i < matcher.to && seq.charAt(i) == 0x0A)
+                        i++;
+                    return next.match(matcher, i, seq);
+                }
+            } else {
+                matcher.hitEnd = true;
+            }
+            return false;
+        }
+        boolean study(TreeInfo info) {
+            info.minLength++;
+            info.maxLength += 2;
+            return next.study(info);
+        }
+    }
+
+    /**
      * Abstract node class to match one character satisfying some
      * boolean property.
      */
@@ -3789,7 +3843,6 @@
         }
     }
 
-
     /**
      * Node class that matches a Unicode block.
      */
@@ -3838,7 +3891,6 @@
         }
     }
 
-
     /**
      * Node class that matches a POSIX type.
      */
@@ -3851,6 +3903,28 @@
     }
 
     /**
+     * Node class that matches a Perl vertical whitespace
+     */
+    static final class VertWS extends BmpCharProperty {
+        boolean isSatisfiedBy(int cp) {
+            return (cp >= 0x0A && cp <= 0x0D) ||
+                   cp == 0x85 || cp == 0x2028 || cp == 0x2029;
+        }
+    }
+
+    /**
+     * Node class that matches a Perl horizontal whitespace
+     */
+    static final class HorizWS extends BmpCharProperty {
+        boolean isSatisfiedBy(int cp) {
+            return cp == 0x09 || cp == 0x20 || cp == 0xa0 ||
+                   cp == 0x1680 || cp == 0x180e ||
+                   cp >= 0x2000 && cp <= 0x200a ||
+                   cp == 0x202f || cp == 0x205f || cp == 0x3000;
+        }
+    }
+
+    /**
      * Base class for all Slice nodes
      */
     static class SliceNode extends Node {
--- a/src/share/classes/javax/swing/JApplet.java	Fri May 25 12:56:22 2012 +0400
+++ b/src/share/classes/javax/swing/JApplet.java	Fri May 25 19:34:32 2012 -0700
@@ -149,7 +149,7 @@
         setRootPaneCheckingEnabled(true);
 
         setFocusTraversalPolicyProvider(true);
-        sun.awt.SunToolkit.checkAndSetPolicy(this, true);
+        sun.awt.SunToolkit.checkAndSetPolicy(this);
 
         enableEvents(AWTEvent.KEY_EVENT_MASK);
     }
--- a/src/share/classes/javax/swing/JComponent.java	Fri May 25 12:56:22 2012 +0400
+++ b/src/share/classes/javax/swing/JComponent.java	Fri May 25 19:34:32 2012 -0700
@@ -4148,6 +4148,9 @@
      * Refer to
      * {@link java.awt.Component#setFocusTraversalKeys}
      * for a complete description of this method.
+     * <p>
+     * This method may throw a {@code ClassCastException} if any {@code Object}
+     * in {@code keystrokes} is not an {@code AWTKeyStroke}.
      *
      * @param id one of KeyboardFocusManager.FORWARD_TRAVERSAL_KEYS,
      *        KeyboardFocusManager.BACKWARD_TRAVERSAL_KEYS, or
@@ -4160,8 +4163,7 @@
      *         KeyboardFocusManager.FORWARD_TRAVERSAL_KEYS,
      *         KeyboardFocusManager.BACKWARD_TRAVERSAL_KEYS, or
      *         KeyboardFocusManager.UP_CYCLE_TRAVERSAL_KEYS, or if keystrokes
-     *         contains null, or if any Object in keystrokes is not an
-     *         AWTKeyStroke, or if any keystroke represents a KEY_TYPED event,
+     *         contains null, or if any keystroke represents a KEY_TYPED event,
      *         or if any keystroke already maps to another focus traversal
      *         operation for this Component
      * @since 1.5
@@ -5571,6 +5573,7 @@
      * {@inheritDoc}
      */
     @Override
+    @Deprecated
     public void hide() {
         boolean showing = isShowing();
         super.hide();
--- a/src/share/classes/javax/swing/JDialog.java	Fri May 25 12:56:22 2012 +0400
+++ b/src/share/classes/javax/swing/JDialog.java	Fri May 25 19:34:32 2012 -0700
@@ -654,7 +654,7 @@
                 getRootPane().setWindowDecorationStyle(JRootPane.PLAIN_DIALOG);
             }
         }
-        sun.awt.SunToolkit.checkAndSetPolicy(this, true);
+        sun.awt.SunToolkit.checkAndSetPolicy(this);
     }
 
     /**
--- a/src/share/classes/javax/swing/JFrame.java	Fri May 25 12:56:22 2012 +0400
+++ b/src/share/classes/javax/swing/JFrame.java	Fri May 25 19:34:32 2012 -0700
@@ -266,7 +266,7 @@
                 getRootPane().setWindowDecorationStyle(JRootPane.FRAME);
             }
         }
-        sun.awt.SunToolkit.checkAndSetPolicy(this, true);
+        sun.awt.SunToolkit.checkAndSetPolicy(this);
     }
 
     /**
--- a/src/share/classes/javax/swing/JInternalFrame.java	Fri May 25 12:56:22 2012 +0400
+++ b/src/share/classes/javax/swing/JInternalFrame.java	Fri May 25 19:34:32 2012 -0700
@@ -349,7 +349,7 @@
         setRootPaneCheckingEnabled(true);
         desktopIcon = new JDesktopIcon(this);
         updateUI();
-        sun.awt.SunToolkit.checkAndSetPolicy(this, true);
+        sun.awt.SunToolkit.checkAndSetPolicy(this);
         addPropertyChangeListenerIfNecessary();
     }
 
--- a/src/share/classes/javax/swing/JWindow.java	Fri May 25 12:56:22 2012 +0400
+++ b/src/share/classes/javax/swing/JWindow.java	Fri May 25 19:34:32 2012 -0700
@@ -264,7 +264,7 @@
         setLocale( JComponent.getDefaultLocale() );
         setRootPane(createRootPane());
         setRootPaneCheckingEnabled(true);
-        sun.awt.SunToolkit.checkAndSetPolicy(this, true);
+        sun.awt.SunToolkit.checkAndSetPolicy(this);
     }
 
     /**
--- a/src/share/classes/javax/swing/UIManager.java	Fri May 25 12:56:22 2012 +0400
+++ b/src/share/classes/javax/swing/UIManager.java	Fri May 25 19:34:32 2012 -0700
@@ -191,6 +191,7 @@
         private UIDefaults[] tables = new UIDefaults[2];
 
         boolean initialized = false;
+        boolean focusPolicyInitialized = false;
         MultiUIDefaults multiUIDefaults = new MultiUIDefaults(tables);
         LookAndFeel lookAndFeel;
         LookAndFeel multiLookAndFeel = null;
@@ -1000,6 +1001,7 @@
      */
     public static ComponentUI getUI(JComponent target) {
         maybeInitialize();
+        maybeInitializeFocusPolicy(target);
         ComponentUI ui = null;
         LookAndFeel multiLAF = getLAFState().multiLookAndFeel;
         if (multiLAF != null) {
@@ -1422,6 +1424,27 @@
         }
     }
 
+    /*
+     * Sets default swing focus traversal policy.
+     */
+    private static void maybeInitializeFocusPolicy(JComponent comp) {
+        // Check for JRootPane which indicates that a swing toplevel
+        // is coming, in which case a swing default focus policy
+        // should be instatiated. See 7125044.
+        if (comp instanceof JRootPane) {
+            synchronized (classLock) {
+                if (!getLAFState().focusPolicyInitialized) {
+                    getLAFState().focusPolicyInitialized = true;
+
+                    if (FocusManager.isFocusManagerEnabled()) {
+                        KeyboardFocusManager.getCurrentKeyboardFocusManager().
+                            setDefaultFocusTraversalPolicy(
+                                new LayoutFocusTraversalPolicy());
+                    }
+                }
+            }
+        }
+    }
 
     /*
      * Only called by maybeInitialize().
@@ -1433,17 +1456,6 @@
         initializeAuxiliaryLAFs(swingProps);
         initializeInstalledLAFs(swingProps);
 
-        // Enable the Swing default LayoutManager.
-        String toolkitName = Toolkit.getDefaultToolkit().getClass().getName();
-        // don't set default policy if this is XAWT.
-        if (!"sun.awt.X11.XToolkit".equals(toolkitName)) {
-            if (FocusManager.isFocusManagerEnabled()) {
-                KeyboardFocusManager.getCurrentKeyboardFocusManager().
-                    setDefaultFocusTraversalPolicy(
-                        new LayoutFocusTraversalPolicy());
-            }
-        }
-
         // Install Swing's PaintEventDispatcher
         if (RepaintManager.HANDLE_TOP_LEVEL_PAINT) {
             sun.awt.PaintEventDispatcher.setPaintEventDispatcher(
--- a/src/share/classes/sun/awt/AWTAccessor.java	Fri May 25 12:56:22 2012 +0400
+++ b/src/share/classes/sun/awt/AWTAccessor.java	Fri May 25 19:34:32 2012 -0700
@@ -34,6 +34,8 @@
 import java.awt.peer.ComponentPeer;
 import java.security.AccessControlContext;
 
+import java.io.File;
+
 /**
  * The AWTAccessor utility class.
  * The main purpose of this class is to enable accessing
@@ -455,7 +457,7 @@
         /*
          * Sets the files the user selects
          */
-        void setFiles(FileDialog fileDialog, String directory, String files[]);
+        void setFiles(FileDialog fileDialog, File files[]);
 
         /*
          * Sets the file the user selects
--- a/src/share/classes/sun/awt/SunToolkit.java	Fri May 25 12:56:22 2012 +0400
+++ b/src/share/classes/sun/awt/SunToolkit.java	Fri May 25 19:34:32 2012 -0700
@@ -461,48 +461,11 @@
         AWTAccessor.getWindowAccessor().setLWRequestStatus(changed, status);
     };
 
-    public static void checkAndSetPolicy(Container cont, boolean isSwingCont)
-    {
-        FocusTraversalPolicy defaultPolicy = KeyboardFocusManager
-            .getCurrentKeyboardFocusManager().getDefaultFocusTraversalPolicy();
+    public static void checkAndSetPolicy(Container cont) {
+        FocusTraversalPolicy defaultPolicy = KeyboardFocusManager.
+            getCurrentKeyboardFocusManager().
+                getDefaultFocusTraversalPolicy();
 
-        String toolkitName = Toolkit.getDefaultToolkit().getClass().getName();
-        // if this is not XAWT then use default policy
-        // because Swing change it
-        if (!"sun.awt.X11.XToolkit".equals(toolkitName)) {
-            cont.setFocusTraversalPolicy(defaultPolicy);
-            return;
-        }
-
-        String policyName = defaultPolicy.getClass().getName();
-
-        if (DefaultFocusTraversalPolicy.class != defaultPolicy.getClass()) {
-            // Policy was changed
-            // Check if it is awt policy or swing policy
-            // If it is Swing policy we shouldn't use it in AWT frames
-            // If it is AWT policy  we shouldn't use it in Swing frames
-            // Otherwise we should use this policy
-            if (policyName.startsWith("java.awt.")) {
-                // AWT
-                if (isSwingCont) {
-                    // Can't use AWT policy in Swing windows - should use Swing's one.
-                    defaultPolicy = createLayoutPolicy();
-                } else {
-                    // New awt policy.
-                }
-            } else if (policyName.startsWith("javax.swing.")) {
-                if (isSwingCont) {
-                    // New Swing's policy
-                } else {
-                    defaultPolicy = new DefaultFocusTraversalPolicy();
-                }
-            }
-        } else {
-            // Policy is default, use different default policy for swing
-            if (isSwingCont) {
-                defaultPolicy = createLayoutPolicy();
-            }
-        }
         cont.setFocusTraversalPolicy(defaultPolicy);
     }
 
--- a/src/share/classes/sun/management/Agent.java	Fri May 25 12:56:22 2012 +0400
+++ b/src/share/classes/sun/management/Agent.java	Fri May 25 19:34:32 2012 -0700
@@ -168,7 +168,10 @@
 
         // management properties can be overridden by system properties
         // which take precedence
-        configProps.putAll(System.getProperties());
+        Properties sysProps = System.getProperties();
+        synchronized(sysProps){
+            configProps.putAll(sysProps);
+        }
 
         // if user specifies config file into command line for either
         // jcmd utilities or attach command it overrides properties set in
@@ -264,7 +267,10 @@
 
         // management properties can be overridden by system properties
         // which take precedence
-        props.putAll(System.getProperties());
+        Properties sysProps = System.getProperties();
+        synchronized(sysProps){
+            props.putAll(sysProps);
+        }
 
         return props;
    }
--- a/src/share/classes/sun/nio/ch/SocketChannelImpl.java	Fri May 25 12:56:22 2012 +0400
+++ b/src/share/classes/sun/nio/ch/SocketChannelImpl.java	Fri May 25 19:34:32 2012 -0700
@@ -629,17 +629,6 @@
                                 break;
                             }
 
-                            synchronized (stateLock) {
-                                if (isOpen() && (localAddress == null) ||
-                                    ((InetSocketAddress)localAddress)
-                                        .getAddress().isAnyLocalAddress())
-                                {
-                                    // Socket was not bound before connecting or
-                                    // Socket was bound with an "anyLocalAddress"
-                                    localAddress = Net.localAddress(fd);
-                                }
-                            }
-
                         } finally {
                             readerCleanup();
                             end((n > 0) || (n == IOStatus.UNAVAILABLE));
@@ -659,6 +648,8 @@
                             // Connection succeeded; disallow further
                             // invocation
                             state = ST_CONNECTED;
+                            if (isOpen())
+                                localAddress = Net.localAddress(fd);
                             return true;
                         }
                         // If nonblocking and no exception then connection
@@ -747,6 +738,8 @@
                 if (n > 0) {
                     synchronized (stateLock) {
                         state = ST_CONNECTED;
+                        if (isOpen())
+                            localAddress = Net.localAddress(fd);
                     }
                     return true;
                 }
--- a/src/share/classes/sun/security/ec/ECDSASignature.java	Fri May 25 12:56:22 2012 +0400
+++ b/src/share/classes/sun/security/ec/ECDSASignature.java	Fri May 25 19:34:32 2012 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2009, 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
@@ -41,6 +41,7 @@
  *
  *   . "NONEwithECDSA"
  *   . "SHA1withECDSA"
+ *   . "SHA224withECDSA"
  *   . "SHA256withECDSA"
  *   . "SHA384withECDSA"
  *   . "SHA512withECDSA"
@@ -162,6 +163,13 @@
         }
     }
 
+    // Nested class for SHA224withECDSA signatures
+    public static final class SHA224 extends ECDSASignature {
+        public SHA224() {
+           super("SHA-224");
+        }
+    }
+
     // Nested class for SHA256withECDSA signatures
     public static final class SHA256 extends ECDSASignature {
         public SHA256() {
--- a/src/share/classes/sun/security/ec/SunECEntries.java	Fri May 25 12:56:22 2012 +0400
+++ b/src/share/classes/sun/security/ec/SunECEntries.java	Fri May 25 19:34:32 2012 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2009, 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
@@ -133,17 +133,31 @@
             "sun.security.ec.ECDSASignature$Raw");
         map.put("Signature.SHA1withECDSA",
             "sun.security.ec.ECDSASignature$SHA1");
+        map.put("Signature.SHA224withECDSA",
+            "sun.security.ec.ECDSASignature$SHA224");
+        map.put("Alg.Alias.Signature.OID.1.2.840.10045.4.3.1", "SHA224withECDSA");
+        map.put("Alg.Alias.Signature.1.2.840.10045.4.3.1", "SHA224withECDSA");
+
         map.put("Signature.SHA256withECDSA",
             "sun.security.ec.ECDSASignature$SHA256");
+        map.put("Alg.Alias.Signature.OID.1.2.840.10045.4.3.2", "SHA256withECDSA");
+        map.put("Alg.Alias.Signature.1.2.840.10045.4.3.2", "SHA256withECDSA");
+
         map.put("Signature.SHA384withECDSA",
             "sun.security.ec.ECDSASignature$SHA384");
+        map.put("Alg.Alias.Signature.OID.1.2.840.10045.4.3.3", "SHA384withECDSA");
+        map.put("Alg.Alias.Signature.1.2.840.10045.4.3.3", "SHA384withECDSA");
+
         map.put("Signature.SHA512withECDSA",
             "sun.security.ec.ECDSASignature$SHA512");
+        map.put("Alg.Alias.Signature.OID.1.2.840.10045.4.3.4", "SHA512withECDSA");
+        map.put("Alg.Alias.Signature.1.2.840.10045.4.3.4", "SHA512withECDSA");
 
         String ecKeyClasses = "java.security.interfaces.ECPublicKey" +
                 "|java.security.interfaces.ECPrivateKey";
         map.put("Signature.NONEwithECDSA SupportedKeyClasses", ecKeyClasses);
         map.put("Signature.SHA1withECDSA SupportedKeyClasses", ecKeyClasses);
+        map.put("Signature.SHA224withECDSA SupportedKeyClasses", ecKeyClasses);
         map.put("Signature.SHA256withECDSA SupportedKeyClasses", ecKeyClasses);
         map.put("Signature.SHA384withECDSA SupportedKeyClasses", ecKeyClasses);
         map.put("Signature.SHA512withECDSA SupportedKeyClasses", ecKeyClasses);
@@ -152,6 +166,7 @@
 
         map.put("Signature.NONEwithECDSA ImplementedIn", "Software");
         map.put("Signature.SHA1withECDSA ImplementedIn", "Software");
+        map.put("Signature.SHA224withECDSA ImplementedIn", "Software");
         map.put("Signature.SHA256withECDSA ImplementedIn", "Software");
         map.put("Signature.SHA384withECDSA ImplementedIn", "Software");
         map.put("Signature.SHA512withECDSA ImplementedIn", "Software");
--- a/src/share/classes/sun/security/pkcs11/P11Digest.java	Fri May 25 12:56:22 2012 +0400
+++ b/src/share/classes/sun/security/pkcs11/P11Digest.java	Fri May 25 19:34:32 2012 -0700
@@ -39,7 +39,7 @@
 
 /**
  * MessageDigest implementation class. This class currently supports
- * MD2, MD5, SHA-1, SHA-256, SHA-384, and SHA-512.
+ * MD2, MD5, SHA-1, SHA-224, SHA-256, SHA-384, and SHA-512.
  *
  * Note that many digest operations are on fairly small amounts of data
  * (less than 100 bytes total). For example, the 2nd hashing in HMAC or
@@ -99,6 +99,9 @@
         case (int)CKM_SHA_1:
             digestLength = 20;
             break;
+        case (int)CKM_SHA224:
+            digestLength = 28;
+            break;
         case (int)CKM_SHA256:
             digestLength = 32;
             break;
--- a/src/share/classes/sun/security/pkcs11/P11Mac.java	Fri May 25 12:56:22 2012 +0400
+++ b/src/share/classes/sun/security/pkcs11/P11Mac.java	Fri May 25 19:34:32 2012 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 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
@@ -40,8 +40,8 @@
 
 /**
  * MAC implementation class. This class currently supports HMAC using
- * MD5, SHA-1, SHA-256, SHA-384, and SHA-512 and the SSL3 MAC using MD5
- * and SHA-1.
+ * MD5, SHA-1, SHA-224, SHA-256, SHA-384, and SHA-512 and the SSL3 MAC
+ * using MD5 and SHA-1.
  *
  * Note that unlike other classes (e.g. Signature), this does not
  * composite various operations if the token only supports part of the
@@ -107,6 +107,9 @@
         case (int)CKM_SHA_1_HMAC:
             macLength = 20;
             break;
+        case (int)CKM_SHA224_HMAC:
+            macLength = 28;
+            break;
         case (int)CKM_SHA256_HMAC:
             macLength = 32;
             break;
--- a/src/share/classes/sun/security/pkcs11/P11Signature.java	Fri May 25 12:56:22 2012 +0400
+++ b/src/share/classes/sun/security/pkcs11/P11Signature.java	Fri May 25 19:34:32 2012 -0700
@@ -53,12 +53,14 @@
  *   . MD2withRSA
  *   . MD5withRSA
  *   . SHA1withRSA
+ *   . SHA224withRSA
  *   . SHA256withRSA
  *   . SHA384withRSA
  *   . SHA512withRSA
  * . ECDSA
  *   . NONEwithECDSA
  *   . SHA1withECDSA
+ *   . SHA224withECDSA
  *   . SHA256withECDSA
  *   . SHA384withECDSA
  *   . SHA512withECDSA
@@ -143,6 +145,7 @@
         case (int)CKM_MD2_RSA_PKCS:
         case (int)CKM_MD5_RSA_PKCS:
         case (int)CKM_SHA1_RSA_PKCS:
+        case (int)CKM_SHA224_RSA_PKCS:
         case (int)CKM_SHA256_RSA_PKCS:
         case (int)CKM_SHA384_RSA_PKCS:
         case (int)CKM_SHA512_RSA_PKCS:
@@ -181,6 +184,8 @@
                 String digestAlg;
                 if (algorithm.equals("SHA1withECDSA")) {
                     digestAlg = "SHA-1";
+                } else if (algorithm.equals("SHA224withECDSA")) {
+                    digestAlg = "SHA-224";
                 } else if (algorithm.equals("SHA256withECDSA")) {
                     digestAlg = "SHA-256";
                 } else if (algorithm.equals("SHA384withECDSA")) {
@@ -207,6 +212,9 @@
             } else if (algorithm.equals("MD2withRSA")) {
                 md = MessageDigest.getInstance("MD2");
                 digestOID = AlgorithmId.MD2_oid;
+            } else if (algorithm.equals("SHA224withRSA")) {
+                md = MessageDigest.getInstance("SHA-224");
+                digestOID = AlgorithmId.SHA224_oid;
             } else if (algorithm.equals("SHA256withRSA")) {
                 md = MessageDigest.getInstance("SHA-256");
                 digestOID = AlgorithmId.SHA256_oid;
@@ -332,6 +340,8 @@
             encodedLength = 34;
         } else if (algorithm.equals("SHA1withRSA")) {
             encodedLength = 35;
+        } else if (algorithm.equals("SHA224withRSA")) {
+            encodedLength = 47;
         } else if (algorithm.equals("SHA256withRSA")) {
             encodedLength = 51;
         } else if (algorithm.equals("SHA384withRSA")) {
--- a/src/share/classes/sun/security/pkcs11/SunPKCS11.java	Fri May 25 12:56:22 2012 +0400
+++ b/src/share/classes/sun/security/pkcs11/SunPKCS11.java	Fri May 25 19:34:32 2012 -0700
@@ -342,6 +342,7 @@
                 System.out.println("Library info:");
                 System.out.println(p11Info);
             }
+
             if ((slotID < 0) || showInfo) {
                 long[] slots = p11.C_GetSlotList(false);
                 if (showInfo) {
@@ -520,24 +521,37 @@
                 m(CKM_MD2));
         d(MD, "MD5",            P11Digest,
                 m(CKM_MD5));
-        d(MD, "SHA1",           P11Digest,              s("SHA", "SHA-1"),
+        d(MD, "SHA1",           P11Digest, s("SHA", "SHA-1"),
                 m(CKM_SHA_1));
+
+        d(MD, "SHA-224",        P11Digest,
+                s("2.16.840.1.101.3.4.2.4", "OID.2.16.840.1.101.3.4.2.4"),
+                m(CKM_SHA224));
         d(MD, "SHA-256",        P11Digest,
+                s("2.16.840.1.101.3.4.2.1", "OID.2.16.840.1.101.3.4.2.1"),
                 m(CKM_SHA256));
         d(MD, "SHA-384",        P11Digest,
+                s("2.16.840.1.101.3.4.2.2", "OID.2.16.840.1.101.3.4.2.2"),
                 m(CKM_SHA384));
         d(MD, "SHA-512",        P11Digest,
+                s("2.16.840.1.101.3.4.2.3", "OID.2.16.840.1.101.3.4.2.3"),
                 m(CKM_SHA512));
 
         d(MAC, "HmacMD5",       P11MAC,
                 m(CKM_MD5_HMAC));
         d(MAC, "HmacSHA1",      P11MAC,
                 m(CKM_SHA_1_HMAC));
+        d(MAC, "HmacSHA224",    P11MAC,
+                s("1.2.840.113549.2.8", "OID.1.2.840.113549.2.8"),
+                m(CKM_SHA224_HMAC));
         d(MAC, "HmacSHA256",    P11MAC,
+                s("1.2.840.113549.2.9", "OID.1.2.840.113549.2.9"),
                 m(CKM_SHA256_HMAC));
         d(MAC, "HmacSHA384",    P11MAC,
+                s("1.2.840.113549.2.10", "OID.1.2.840.113549.2.10"),
                 m(CKM_SHA384_HMAC));
         d(MAC, "HmacSHA512",    P11MAC,
+                s("1.2.840.113549.2.11", "OID.1.2.840.113549.2.11"),
                 m(CKM_SHA512_HMAC));
         d(MAC, "SslMacMD5",     P11MAC,
                 m(CKM_SSL3_MD5_MAC));
@@ -648,11 +662,17 @@
                 m(CKM_ECDSA));
         d(SIG, "SHA1withECDSA", P11Signature,           s("ECDSA"),
                 m(CKM_ECDSA_SHA1, CKM_ECDSA));
+        d(SIG, "SHA224withECDSA",       P11Signature,
+                s("1.2.840.10045.4.3.1", "OID.1.2.840.10045.4.3.1"),
+                m(CKM_ECDSA));
         d(SIG, "SHA256withECDSA",       P11Signature,
+                s("1.2.840.10045.4.3.2", "OID.1.2.840.10045.4.3.2"),
                 m(CKM_ECDSA));
         d(SIG, "SHA384withECDSA",       P11Signature,
+                s("1.2.840.10045.4.3.3", "OID.1.2.840.10045.4.3.3"),
                 m(CKM_ECDSA));
         d(SIG, "SHA512withECDSA",       P11Signature,
+                s("1.2.840.10045.4.3.4", "OID.1.2.840.10045.4.3.4"),
                 m(CKM_ECDSA));
         d(SIG, "MD2withRSA",    P11Signature,
                 m(CKM_MD2_RSA_PKCS, CKM_RSA_PKCS, CKM_RSA_X_509));
@@ -660,11 +680,17 @@
                 m(CKM_MD5_RSA_PKCS, CKM_RSA_PKCS, CKM_RSA_X_509));
         d(SIG, "SHA1withRSA",   P11Signature,
                 m(CKM_SHA1_RSA_PKCS, CKM_RSA_PKCS, CKM_RSA_X_509));
+        d(SIG, "SHA224withRSA", P11Signature,
+                s("1.2.840.113549.1.1.14", "OID.1.2.840.113549.1.1.14"),
+                m(CKM_SHA224_RSA_PKCS, CKM_RSA_PKCS, CKM_RSA_X_509));
         d(SIG, "SHA256withRSA", P11Signature,
+                s("1.2.840.113549.1.1.11", "OID.1.2.840.113549.1.1.11"),
                 m(CKM_SHA256_RSA_PKCS, CKM_RSA_PKCS, CKM_RSA_X_509));
         d(SIG, "SHA384withRSA", P11Signature,
+                s("1.2.840.113549.1.1.12", "OID.1.2.840.113549.1.1.12"),
                 m(CKM_SHA384_RSA_PKCS, CKM_RSA_PKCS, CKM_RSA_X_509));
         d(SIG, "SHA512withRSA", P11Signature,
+                s("1.2.840.113549.1.1.13", "OID.1.2.840.113549.1.1.13"),
                 m(CKM_SHA512_RSA_PKCS, CKM_RSA_PKCS, CKM_RSA_X_509));
 
         /*
--- a/src/share/classes/sun/security/pkcs11/wrapper/Functions.java	Fri May 25 12:56:22 2012 +0400
+++ b/src/share/classes/sun/security/pkcs11/wrapper/Functions.java	Fri May 25 19:34:32 2012 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved.
  */
 
 /* Copyright  (c) 2002 Graz University of Technology. All rights reserved.
@@ -630,6 +630,7 @@
         addMech(CKM_X9_42_DH_DERIVE,            "CKM_X9_42_DH_DERIVE");
         addMech(CKM_X9_42_DH_HYBRID_DERIVE,     "CKM_X9_42_DH_HYBRID_DERIVE");
         addMech(CKM_X9_42_MQV_DERIVE,           "CKM_X9_42_MQV_DERIVE");
+        addMech(CKM_SHA224_RSA_PKCS,            "CKM_SHA224_RSA_PKCS");
         addMech(CKM_SHA256_RSA_PKCS,            "CKM_SHA256_RSA_PKCS");
         addMech(CKM_SHA384_RSA_PKCS,            "CKM_SHA384_RSA_PKCS");
         addMech(CKM_SHA512_RSA_PKCS,            "CKM_SHA512_RSA_PKCS");
@@ -675,6 +676,9 @@
         addMech(CKM_RIPEMD160,                  "CKM_RIPEMD160");
         addMech(CKM_RIPEMD160_HMAC,             "CKM_RIPEMD160_HMAC");
         addMech(CKM_RIPEMD160_HMAC_GENERAL,     "CKM_RIPEMD160_HMAC_GENERAL");
+        addMech(CKM_SHA224,                     "CKM_SHA224");
+        addMech(CKM_SHA224_HMAC,                "CKM_SHA224_HMAC");
+        addMech(CKM_SHA224_HMAC_GENERAL,        "CKM_SHA224_HMAC_GENERAL");
         addMech(CKM_SHA256,                     "CKM_SHA256");
         addMech(CKM_SHA256_HMAC,                "CKM_SHA256_HMAC");
         addMech(CKM_SHA256_HMAC_GENERAL,        "CKM_SHA256_HMAC_GENERAL");
@@ -734,6 +738,7 @@
         addMech(CKM_MD5_KEY_DERIVATION,         "CKM_MD5_KEY_DERIVATION");
         addMech(CKM_MD2_KEY_DERIVATION,         "CKM_MD2_KEY_DERIVATION");
         addMech(CKM_SHA1_KEY_DERIVATION,        "CKM_SHA1_KEY_DERIVATION");
+        addMech(CKM_SHA224_KEY_DERIVATION,      "CKM_SHA224_KEY_DERIVATION");
         addMech(CKM_SHA256_KEY_DERIVATION,      "CKM_SHA256_KEY_DERIVATION");
         addMech(CKM_SHA384_KEY_DERIVATION,      "CKM_SHA384_KEY_DERIVATION");
         addMech(CKM_SHA512_KEY_DERIVATION,      "CKM_SHA512_KEY_DERIVATION");
--- a/src/share/classes/sun/security/provider/DigestBase.java	Fri May 25 12:56:22 2012 +0400
+++ b/src/share/classes/sun/security/provider/DigestBase.java	Fri May 25 19:34:32 2012 -0700
@@ -39,7 +39,6 @@
  *  . abstract void implCompress(byte[] b, int ofs);
  *  . abstract void implDigest(byte[] out, int ofs);
  *  . abstract void implReset();
- *  . public abstract Object clone();
  *
  * See the inline documentation for details.
  *
@@ -61,7 +60,7 @@
     // buffer to store partial blocks, blockSize bytes large
     // Subclasses should not access this array directly except possibly in their
     // implDigest() method. See MD5.java as an example.
-    final byte[] buffer;
+    byte[] buffer;
     // offset into buffer
     private int bufOfs;
 
@@ -83,18 +82,6 @@
         buffer = new byte[blockSize];
     }
 
-    /**
-     * Constructor for cloning. Replicates common data.
-     */
-    DigestBase(DigestBase base) {
-        this.algorithm = base.algorithm;
-        this.digestLength = base.digestLength;
-        this.blockSize = base.blockSize;
-        this.buffer = base.buffer.clone();
-        this.bufOfs = base.bufOfs;
-        this.bytesProcessed = base.bytesProcessed;
-    }
-
     // return digest length. See JCA doc.
     protected final int engineGetDigestLength() {
         return digestLength;
@@ -206,12 +193,11 @@
      */
     abstract void implReset();
 
-    /**
-     * Clone this digest. Should be implemented as "return new MyDigest(this)".
-     * That constructor should first call "super(baseDigest)" and then copy
-     * subclass specific data.
-     */
-    public abstract Object clone();
+    public Object clone() throws CloneNotSupportedException {
+        DigestBase copy = (DigestBase) super.clone();
+        copy.buffer = copy.buffer.clone();
+        return copy;
+    }
 
     // padding used for the MD5, and SHA-* message digests
     static final byte[] padding;
@@ -223,5 +209,4 @@
         padding = new byte[136];
         padding[0] = (byte)0x80;
     }
-
 }
--- a/src/share/classes/sun/security/provider/MD2.java	Fri May 25 12:56:22 2012 +0400
+++ b/src/share/classes/sun/security/provider/MD2.java	Fri May 25 19:34:32 2012 -0700
@@ -39,14 +39,14 @@
 public final class MD2 extends DigestBase {
 
     // state, 48 ints
-    private final int[] X;
+    private int[] X;
 
     // checksum, 16 ints. they are really bytes, but byte arithmetic in
     // the JVM is much slower that int arithmetic.
-    private final int[] C;
+    private int[] C;
 
     // temporary store for checksum C during final digest
-    private final byte[] cBytes;
+    private byte[] cBytes;
 
     /**
      * Create a new MD2 digest. Called by the JCA framework
@@ -58,15 +58,12 @@
         cBytes = new byte[16];
     }
 
-    private MD2(MD2 base) {
-        super(base);
-        this.X = base.X.clone();
-        this.C = base.C.clone();
-        cBytes = new byte[16];
-    }
-
-    public Object clone() {
-        return new MD2(this);
+    public Object clone() throws CloneNotSupportedException {
+        MD2 copy = (MD2) super.clone();
+        copy.X = copy.X.clone();
+        copy.C = copy.C.clone();
+        copy.cBytes = new byte[16];
+        return copy;
     }
 
     // reset state and checksum
--- a/src/share/classes/sun/security/provider/MD4.java	Fri May 25 12:56:22 2012 +0400
+++ b/src/share/classes/sun/security/provider/MD4.java	Fri May 25 19:34:32 2012 -0700
@@ -44,9 +44,9 @@
 public final class MD4 extends DigestBase {
 
     // state of this object
-    private final int[] state;
+    private int[] state;
     // temporary buffer, used by implCompress()
-    private final int[] x;
+    private int[] x;
 
     // rotation constants
     private static final int S11 = 3;
@@ -93,16 +93,12 @@
         implReset();
     }
 
-    // Cloning constructor
-    private MD4(MD4 base) {
-        super(base);
-        this.state = base.state.clone();
-        this.x = new int[16];
-    }
-
     // clone this object
-    public Object clone() {
-        return new MD4(this);
+    public Object clone() throws CloneNotSupportedException {
+        MD4 copy = (MD4) super.clone();
+        copy.state = copy.state.clone();
+        copy.x = new int[16];
+        return copy;
     }
 
     /**
--- a/src/share/classes/sun/security/provider/MD5.java	Fri May 25 12:56:22 2012 +0400
+++ b/src/share/classes/sun/security/provider/MD5.java	Fri May 25 19:34:32 2012 -0700
@@ -39,9 +39,9 @@
 public final class MD5 extends DigestBase {
 
     // state of this object
-    private final int[] state;
+    private int[] state;
     // temporary buffer, used by implCompress()
-    private final int[] x;
+    private int[] x;
 
     // rotation constants
     private static final int S11 = 7;
@@ -69,16 +69,12 @@
         implReset();
     }
 
-    // Cloning constructor
-    private MD5(MD5 base) {
-        super(base);
-        this.state = base.state.clone();
-        this.x = new int[16];
-    }
-
     // clone this object
-    public Object clone() {
-        return new MD5(this);
+    public Object clone() throws CloneNotSupportedException {
+        MD5 copy = (MD5) super.clone();
+        copy.state = copy.state.clone();
+        copy.x = new int[16];
+        return copy;
     }
 
     /**
--- a/src/share/classes/sun/security/provider/SHA.java	Fri May 25 12:56:22 2012 +0400
+++ b/src/share/classes/sun/security/provider/SHA.java	Fri May 25 19:34:32 2012 -0700
@@ -47,10 +47,10 @@
     // 64 bytes are included in each hash block so the low order
     // bits of count are used to know how to pack the bytes into ints
     // and to know when to compute the block and start the next one.
-    private final int[] W;
+    private int[] W;
 
     // state of this
-    private final int[] state;
+    private int[] state;
 
     /**
      * Creates a new SHA object.
@@ -62,19 +62,14 @@
         implReset();
     }
 
-    /**
-     * Creates a SHA object.with state (for cloning) */
-    private SHA(SHA base) {
-        super(base);
-        this.state = base.state.clone();
-        this.W = new int[80];
-    }
-
     /*
      * Clones this object.
      */
-    public Object clone() {
-        return new SHA(this);
+    public Object clone() throws CloneNotSupportedException {
+        SHA copy = (SHA) super.clone();
+        copy.state = copy.state.clone();
+        copy.W = new int[80];
+        return copy;
     }
 
     /**
--- a/src/share/classes/sun/security/provider/SHA2.java	Fri May 25 12:56:22 2012 +0400
+++ b/src/share/classes/sun/security/provider/SHA2.java	Fri May 25 19:34:32 2012 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2002, 2006, 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
@@ -40,7 +40,7 @@
  * @author      Valerie Peng
  * @author      Andreas Sterbenz
  */
-public final class SHA2 extends DigestBase {
+abstract class SHA2 extends DigestBase {
 
     private static final int ITERATION = 64;
     // Constants for each round
@@ -64,46 +64,30 @@
     };
 
     // buffer used by implCompress()
-    private final int[] W;
+    private int[] W;
 
     // state of this object
-    private final int[] state;
+    private int[] state;
+
+    // initial state value. different between SHA-224 and SHA-256
+    private final int[] initialHashes;
 
     /**
      * Creates a new SHA object.
      */
-    public SHA2() {
-        super("SHA-256", 32, 64);
+    SHA2(String name, int digestLength, int[] initialHashes) {
+        super(name, digestLength, 64);
+        this.initialHashes = initialHashes;
         state = new int[8];
         W = new int[64];
         implReset();
     }
 
     /**
-     * Creates a SHA2 object.with state (for cloning)
-     */
-    private SHA2(SHA2 base) {
-        super(base);
-        this.state = base.state.clone();
-        this.W = new int[64];
-    }
-
-    public Object clone() {
-        return new SHA2(this);
-    }
-
-    /**
      * Resets the buffers and hash value to start a new hash.
      */
     void implReset() {
-        state[0] = 0x6a09e667;
-        state[1] = 0xbb67ae85;
-        state[2] = 0x3c6ef372;
-        state[3] = 0xa54ff53a;
-        state[4] = 0x510e527f;
-        state[5] = 0x9b05688c;
-        state[6] = 0x1f83d9ab;
-        state[7] = 0x5be0cd19;
+        System.arraycopy(initialHashes, 0, state, 0, state.length);
     }
 
     void implDigest(byte[] out, int ofs) {
@@ -242,4 +226,38 @@
         state[7] += h;
     }
 
+    public Object clone() throws CloneNotSupportedException {
+        SHA2 copy = (SHA2) super.clone();
+        copy.state = copy.state.clone();
+        copy.W = new int[64];
+        return copy;
+    }
+
+    /**
+     * SHA-224 implementation class.
+     */
+    public static final class SHA224 extends SHA2 {
+        private static final int[] INITIAL_HASHES = {
+            0xc1059ed8, 0x367cd507, 0x3070dd17, 0xf70e5939,
+            0xffc00b31, 0x68581511, 0x64f98fa7, 0xbefa4fa4
+        };
+
+        public SHA224() {
+            super("SHA-224", 28, INITIAL_HASHES);
+        }
+    }
+
+    /**
+     * SHA-256 implementation class.
+     */
+    public static final class SHA256 extends SHA2 {
+        private static final int[] INITIAL_HASHES = {
+            0x6a09e667, 0xbb67ae85, 0x3c6ef372, 0xa54ff53a,
+            0x510e527f, 0x9b05688c, 0x1f83d9ab, 0x5be0cd19
+        };
+
+        public SHA256() {
+            super("SHA-256", 32, INITIAL_HASHES);
+        }
+    }
 }
--- a/src/share/classes/sun/security/provider/SHA5.java	Fri May 25 12:56:22 2012 +0400
+++ b/src/share/classes/sun/security/provider/SHA5.java	Fri May 25 19:34:32 2012 -0700
@@ -82,10 +82,10 @@
     };
 
     // buffer used by implCompress()
-    private final long[] W;
+    private long[] W;
 
     // state of this object
-    private final long[] state;
+    private long[] state;
 
     // initial state value. different between SHA-384 and SHA-512
     private final long[] initialHashes;
@@ -101,16 +101,6 @@
         implReset();
     }
 
-    /**
-     * Creates a SHA object with state (for cloning)
-     */
-    SHA5(SHA5 base) {
-        super(base);
-        this.initialHashes = base.initialHashes;
-        this.state = base.state.clone();
-        this.W = new long[80];
-    }
-
     final void implReset() {
         System.arraycopy(initialHashes, 0, state, 0, state.length);
     }
@@ -255,6 +245,13 @@
         state[7] += h;
     }
 
+    public Object clone() throws CloneNotSupportedException {
+        SHA5 copy = (SHA5) super.clone();
+        copy.state = copy.state.clone();
+        copy.W = new long[80];
+        return copy;
+    }
+
     /**
      * SHA-512 implementation class.
      */
@@ -270,14 +267,6 @@
         public SHA512() {
             super("SHA-512", 64, INITIAL_HASHES);
         }
-
-        private SHA512(SHA512 base) {
-            super(base);
-        }
-
-        public Object clone() {
-            return new SHA512(this);
-        }
     }
 
     /**
@@ -295,14 +284,5 @@
         public SHA384() {
             super("SHA-384", 48, INITIAL_HASHES);
         }
-
-        private SHA384(SHA384 base) {
-            super(base);
-        }
-
-        public Object clone() {
-            return new SHA384(this);
-        }
     }
-
 }
--- a/src/share/classes/sun/security/provider/SecureRandom.java	Fri May 25 12:56:22 2012 +0400
+++ b/src/share/classes/sun/security/provider/SecureRandom.java	Fri May 25 19:34:32 2012 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2003, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 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
@@ -102,7 +102,7 @@
         try {
             digest = MessageDigest.getInstance ("SHA");
         } catch (NoSuchAlgorithmException e) {
-            throw new InternalError("internal error: SHA-1 not available.");
+            throw new InternalError("internal error: SHA-1 not available.", e);
         }
 
         if (seed != null) {
--- a/src/share/classes/sun/security/provider/SunEntries.java	Fri May 25 12:56:22 2012 +0400
+++ b/src/share/classes/sun/security/provider/SunEntries.java	Fri May 25 19:34:32 2012 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1996, 2006, 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
@@ -43,6 +43,10 @@
  *   identifier strings "OID.1.3.14.3.2.13", "OID.1.3.14.3.2.27" and
  *   "OID.1.2.840.10040.4.3".
  *
+ * - SHA-2 is a set of message digest schemes described in FIPS 180-2.
+ *   SHA-2 family of hash functions includes SHA-224, SHA-256, SHA-384,
+ *   and SHA-512.
+ *
  * - DSA is the key generation scheme as described in FIPS 186.
  *   Aliases for DSA include the OID strings "OID.1.3.14.3.2.12"
  *   and "OID.1.2.840.10040.4.1".
@@ -140,9 +144,19 @@
         map.put("Alg.Alias.MessageDigest.SHA-1", "SHA");
         map.put("Alg.Alias.MessageDigest.SHA1", "SHA");
 
-        map.put("MessageDigest.SHA-256", "sun.security.provider.SHA2");
+        map.put("MessageDigest.SHA-224", "sun.security.provider.SHA2$SHA224");
+        map.put("Alg.Alias.MessageDigest.2.16.840.1.101.3.4.2.4", "SHA-224");
+        map.put("Alg.Alias.MessageDigest.OID.2.16.840.1.101.3.4.2.4", "SHA-224");
+
+        map.put("MessageDigest.SHA-256", "sun.security.provider.SHA2$SHA256");
+        map.put("Alg.Alias.MessageDigest.2.16.840.1.101.3.4.2.1", "SHA-256");
+        map.put("Alg.Alias.MessageDigest.OID.2.16.840.1.101.3.4.2.1", "SHA-256");
         map.put("MessageDigest.SHA-384", "sun.security.provider.SHA5$SHA384");
+        map.put("Alg.Alias.MessageDigest.2.16.840.1.101.3.4.2.2", "SHA-384");
+        map.put("Alg.Alias.MessageDigest.OID.2.16.840.1.101.3.4.2.2", "SHA-384");
         map.put("MessageDigest.SHA-512", "sun.security.provider.SHA5$SHA512");
+        map.put("Alg.Alias.MessageDigest.2.16.840.1.101.3.4.2.3", "SHA-512");
+        map.put("Alg.Alias.MessageDigest.OID.2.16.840.1.101.3.4.2.3", "SHA-512");
 
         /*
          * Algorithm Parameter Generator engines
--- a/src/share/classes/sun/security/provider/certpath/SunCertPathBuilder.java	Fri May 25 12:56:22 2012 +0400
+++ b/src/share/classes/sun/security/provider/certpath/SunCertPathBuilder.java	Fri May 25 19:34:32 2012 -0700
@@ -318,7 +318,9 @@
             }
 
             // break out of loop if search is successful
-            break;
+            if (pathCompleted) {
+                break;
+            }
         }
 
         if (debug != null) {
--- a/src/share/classes/sun/security/rsa/RSASignature.java	Fri May 25 12:56:22 2012 +0400
+++ b/src/share/classes/sun/security/rsa/RSASignature.java	Fri May 25 19:34:32 2012 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 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
@@ -39,8 +39,8 @@
  * PKCS#1 RSA signatures with the various message digest algorithms.
  * This file contains an abstract base class with all the logic plus
  * a nested static class for each of the message digest algorithms
- * (see end of the file). We support MD2, MD5, SHA-1, SHA-256, SHA-384,
- * and SHA-512.
+ * (see end of the file). We support MD2, MD5, SHA-1, SHA-224, SHA-256,
+ * SHA-384, and SHA-512.
  *
  * @since   1.5
  * @author  Andreas Sterbenz
@@ -276,6 +276,13 @@
         }
     }
 
+    // Nested class for SHA224withRSA signatures
+    public static final class SHA224withRSA extends RSASignature {
+        public SHA224withRSA() {
+            super("SHA-224", AlgorithmId.SHA224_oid, 11);
+        }
+    }
+
     // Nested class for SHA256withRSA signatures
     public static final class SHA256withRSA extends RSASignature {
         public SHA256withRSA() {
--- a/src/share/classes/sun/security/rsa/SunRsaSignEntries.java	Fri May 25 12:56:22 2012 +0400
+++ b/src/share/classes/sun/security/rsa/SunRsaSignEntries.java	Fri May 25 19:34:32 2012 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 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
@@ -52,6 +52,8 @@
                 "sun.security.rsa.RSASignature$MD5withRSA");
         map.put("Signature.SHA1withRSA",
                 "sun.security.rsa.RSASignature$SHA1withRSA");
+        map.put("Signature.SHA224withRSA",
+                "sun.security.rsa.RSASignature$SHA224withRSA");
         map.put("Signature.SHA256withRSA",
                 "sun.security.rsa.RSASignature$SHA256withRSA");
         map.put("Signature.SHA384withRSA",
@@ -66,6 +68,7 @@
         map.put("Signature.MD2withRSA SupportedKeyClasses", rsaKeyClasses);
         map.put("Signature.MD5withRSA SupportedKeyClasses", rsaKeyClasses);
         map.put("Signature.SHA1withRSA SupportedKeyClasses", rsaKeyClasses);
+        map.put("Signature.SHA224withRSA SupportedKeyClasses", rsaKeyClasses);
         map.put("Signature.SHA256withRSA SupportedKeyClasses", rsaKeyClasses);
         map.put("Signature.SHA384withRSA SupportedKeyClasses", rsaKeyClasses);
         map.put("Signature.SHA512withRSA SupportedKeyClasses", rsaKeyClasses);
@@ -88,6 +91,9 @@
         map.put("Alg.Alias.Signature.OID.1.2.840.113549.1.1.5", "SHA1withRSA");
         map.put("Alg.Alias.Signature.1.3.14.3.2.29",            "SHA1withRSA");
 
+        map.put("Alg.Alias.Signature.1.2.840.113549.1.1.14",     "SHA224withRSA");
+        map.put("Alg.Alias.Signature.OID.1.2.840.113549.1.1.14", "SHA224withRSA");
+
         map.put("Alg.Alias.Signature.1.2.840.113549.1.1.11",     "SHA256withRSA");
         map.put("Alg.Alias.Signature.OID.1.2.840.113549.1.1.11", "SHA256withRSA");
 
--- a/src/share/classes/sun/security/ssl/SSLContextImpl.java	Fri May 25 12:56:22 2012 +0400
+++ b/src/share/classes/sun/security/ssl/SSLContextImpl.java	Fri May 25 19:34:32 2012 -0700
@@ -267,36 +267,42 @@
 
     // Get suported CipherSuiteList.
     CipherSuiteList getSuportedCipherSuiteList() {
-        // Clear cache of available ciphersuites.
-        clearAvailableCache();
+        // The maintenance of cipher suites needs to be synchronized.
+        synchronized (this) {
+            // Clear cache of available ciphersuites.
+            clearAvailableCache();
 
-        if (supportedCipherSuiteList == null) {
-            supportedCipherSuiteList =
-                getApplicableCipherSuiteList(getSuportedProtocolList(), false);
+            if (supportedCipherSuiteList == null) {
+                supportedCipherSuiteList = getApplicableCipherSuiteList(
+                        getSuportedProtocolList(), false);
+            }
+
+            return supportedCipherSuiteList;
         }
-
-        return supportedCipherSuiteList;
     }
 
     // Get default CipherSuiteList.
     CipherSuiteList getDefaultCipherSuiteList(boolean roleIsServer) {
-        // Clear cache of available ciphersuites.
-        clearAvailableCache();
+        // The maintenance of cipher suites needs to be synchronized.
+        synchronized (this) {
+            // Clear cache of available ciphersuites.
+            clearAvailableCache();
 
-        if (roleIsServer) {
-            if (defaultServerCipherSuiteList == null) {
-                defaultServerCipherSuiteList = getApplicableCipherSuiteList(
+            if (roleIsServer) {
+                if (defaultServerCipherSuiteList == null) {
+                    defaultServerCipherSuiteList = getApplicableCipherSuiteList(
                         getDefaultProtocolList(true), true);
+                }
+
+                return defaultServerCipherSuiteList;
+            } else {
+                if (defaultClientCipherSuiteList == null) {
+                    defaultClientCipherSuiteList = getApplicableCipherSuiteList(
+                        getDefaultProtocolList(false), true);
+                }
+
+                return defaultClientCipherSuiteList;
             }
-
-            return defaultServerCipherSuiteList;
-        } else {
-            if (defaultClientCipherSuiteList == null) {
-                defaultClientCipherSuiteList = getApplicableCipherSuiteList(
-                        getDefaultProtocolList(false), true);
-            }
-
-            return defaultClientCipherSuiteList;
         }
     }
 
@@ -364,8 +370,11 @@
      * Clear cache of available ciphersuites. If we support all ciphers
      * internally, there is no need to clear the cache and calling this
      * method has no effect.
+     *
+     * Note that every call to clearAvailableCache() and the maintenance of
+     * cipher suites need to be synchronized with this instance.
      */
-    synchronized void clearAvailableCache() {
+    private void clearAvailableCache() {
         if (CipherSuite.DYNAMIC_AVAILABILITY) {
             supportedCipherSuiteList = null;
             defaultServerCipherSuiteList = null;
--- a/src/share/classes/sun/security/validator/SimpleValidator.java	Fri May 25 12:56:22 2012 +0400
+++ b/src/share/classes/sun/security/validator/SimpleValidator.java	Fri May 25 19:34:32 2012 -0700
@@ -311,7 +311,7 @@
         // if the certificate is self-issued, ignore the pathLenConstraint
         // checking.
         if (!X509CertImpl.isSelfIssued(cert)) {
-            if (maxPathLen <= 1) {   // reserved one for end-entity certificate
+            if (maxPathLen <= 0) {
                 throw new ValidatorException("Violated path length constraints",
                     ValidatorException.T_CA_EXTENSIONS, cert);
             }
--- a/src/share/classes/sun/security/x509/AlgorithmId.java	Fri May 25 12:56:22 2012 +0400
+++ b/src/share/classes/sun/security/x509/AlgorithmId.java	Fri May 25 19:34:32 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
@@ -175,9 +175,9 @@
             // it's NULL. They are ---
             // rfc3370 2.1: Implementations SHOULD generate SHA-1
             // AlgorithmIdentifiers with absent parameters.
-            // rfc3447 C1: When id-sha1, id-sha256, id-sha384 and id-sha512
-            // are used in an AlgorithmIdentifier the parameters (which are
-            // optional) SHOULD be omitted.
+            // rfc3447 C1: When id-sha1, id-sha224, id-sha256, id-sha384 and
+            // id-sha512 are used in an AlgorithmIdentifier the parameters
+            // (which are optional) SHOULD be omitted.
             // rfc3279 2.3.2: The id-dsa algorithm syntax includes optional
             // domain parameters... When omitted, the parameters component
             // MUST be omitted entirely
@@ -185,6 +185,7 @@
             // is used, the AlgorithmIdentifier parameters field MUST be absent.
             /*if (
                 algid.equals((Object)SHA_oid) ||
+                algid.equals((Object)SHA224_oid) ||
                 algid.equals((Object)SHA256_oid) ||
                 algid.equals((Object)SHA384_oid) ||
                 algid.equals((Object)SHA512_oid) ||
@@ -488,7 +489,10 @@
             name.equalsIgnoreCase("SHA512")) {
             return AlgorithmId.SHA512_oid;
         }
-
+        if (name.equalsIgnoreCase("SHA-224") ||
+            name.equalsIgnoreCase("SHA224")) {
+            return AlgorithmId.SHA224_oid;
+        }
 
         // Various public key algorithms
         if (name.equalsIgnoreCase("RSA")) {
@@ -625,6 +629,9 @@
     public static final ObjectIdentifier SHA_oid =
     ObjectIdentifier.newInternal(new int[] {1, 3, 14, 3, 2, 26});
 
+    public static final ObjectIdentifier SHA224_oid =
+    ObjectIdentifier.newInternal(new int[] {2, 16, 840, 1, 101, 3, 4, 2, 4});
+
     public static final ObjectIdentifier SHA256_oid =
     ObjectIdentifier.newInternal(new int[] {2, 16, 840, 1, 101, 3, 4, 2, 1});
 
@@ -664,6 +671,8 @@
                                        { 1, 2, 840, 113549, 1, 1, 5 };
     private static final int sha1WithRSAEncryption_OIW_data[] =
                                        { 1, 3, 14, 3, 2, 29 };
+    private static final int sha224WithRSAEncryption_data[] =
+                                       { 1, 2, 840, 113549, 1, 1, 14 };
     private static final int sha256WithRSAEncryption_data[] =
                                        { 1, 2, 840, 113549, 1, 1, 11 };
     private static final int sha384WithRSAEncryption_data[] =
@@ -681,6 +690,7 @@
     public static final ObjectIdentifier md5WithRSAEncryption_oid;
     public static final ObjectIdentifier sha1WithRSAEncryption_oid;
     public static final ObjectIdentifier sha1WithRSAEncryption_OIW_oid;
+    public static final ObjectIdentifier sha224WithRSAEncryption_oid;
     public static final ObjectIdentifier sha256WithRSAEncryption_oid;
     public static final ObjectIdentifier sha384WithRSAEncryption_oid;
     public static final ObjectIdentifier sha512WithRSAEncryption_oid;
@@ -810,6 +820,14 @@
             ObjectIdentifier.newInternal(sha1WithRSAEncryption_OIW_data);
 
     /**
+     * Identifies a signing algorithm where a SHA224 digest is
+     * encrypted using an RSA private key; defined by PKCS #1.
+     * OID = 1.2.840.113549.1.1.14
+     */
+        sha224WithRSAEncryption_oid =
+            ObjectIdentifier.newInternal(sha224WithRSAEncryption_data);
+
+    /**
      * Identifies a signing algorithm where a SHA256 digest is
      * encrypted using an RSA private key; defined by PKCS #1.
      * OID = 1.2.840.113549.1.1.11
@@ -859,6 +877,7 @@
         nameTable.put(MD5_oid, "MD5");
         nameTable.put(MD2_oid, "MD2");
         nameTable.put(SHA_oid, "SHA");
+        nameTable.put(SHA224_oid, "SHA224");
         nameTable.put(SHA256_oid, "SHA256");
         nameTable.put(SHA384_oid, "SHA384");
         nameTable.put(SHA512_oid, "SHA512");
@@ -881,6 +900,7 @@
         nameTable.put(shaWithDSA_OIW_oid, "SHA1withDSA");
         nameTable.put(sha1WithRSAEncryption_oid, "SHA1withRSA");
         nameTable.put(sha1WithRSAEncryption_OIW_oid, "SHA1withRSA");
+        nameTable.put(sha224WithRSAEncryption_oid, "SHA224withRSA");
         nameTable.put(sha256WithRSAEncryption_oid, "SHA256withRSA");
         nameTable.put(sha384WithRSAEncryption_oid, "SHA384withRSA");
         nameTable.put(sha512WithRSAEncryption_oid, "SHA512withRSA");
--- a/src/share/classes/sun/tools/jcmd/JCmd.java	Fri May 25 12:56:22 2012 +0400
+++ b/src/share/classes/sun/tools/jcmd/JCmd.java	Fri May 25 19:34:32 2012 -0700
@@ -142,8 +142,11 @@
         // Cast to HotSpotVirtualMachine as this is an
         // implementation specific method.
         HotSpotVirtualMachine hvm = (HotSpotVirtualMachine) vm;
-        String lines[] = command .split("\\n");
+        String lines[] = command.split("\\n");
         for (String line : lines) {
+            if (line.trim().equals("stop")) {
+                break;
+            }
             try (InputStream in = hvm.executeJCmd(line);) {
                 // read to EOF and just print output
                 byte b[] = new byte[256];
--- a/src/share/demo/jfc/Notepad/Notepad.java	Fri May 25 12:56:22 2012 +0400
+++ b/src/share/demo/jfc/Notepad/Notepad.java	Fri May 25 19:34:32 2012 -0700
@@ -39,71 +39,18 @@
 
 
 
-import java.awt.BorderLayout;
-import java.awt.Color;
-import java.awt.Component;
-import java.awt.Container;
-import java.awt.FileDialog;
-import java.awt.Font;
-import java.awt.Frame;
-import java.awt.Graphics;
-import java.awt.Insets;
-import java.awt.event.ActionEvent;
-import java.awt.event.WindowAdapter;
-import java.awt.event.WindowEvent;
-import java.beans.PropertyChangeEvent;
-import java.beans.PropertyChangeListener;
-import java.io.File;
-import java.io.FileReader;
-import java.io.FileWriter;
-import java.io.IOException;
-import java.io.Reader;
-import java.io.Writer;
-import java.net.URL;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Locale;
-import java.util.Map;
-import java.util.MissingResourceException;
-import java.util.ResourceBundle;
-import java.util.StringTokenizer;
-import java.util.logging.Level;
-import java.util.logging.Logger;
-import javax.swing.AbstractAction;
-import javax.swing.Action;
-import javax.swing.BorderFactory;
-import javax.swing.Box;
-import javax.swing.BoxLayout;
-import javax.swing.ImageIcon;
-import javax.swing.JButton;
-import javax.swing.JComponent;
-import javax.swing.JFileChooser;
-import javax.swing.JFrame;
-import javax.swing.JMenu;
-import javax.swing.JMenuBar;
-import javax.swing.JMenuItem;
-import javax.swing.JOptionPane;
-import javax.swing.JPanel;
-import javax.swing.JProgressBar;
-import javax.swing.JScrollPane;
-import javax.swing.JTextArea;
-import javax.swing.JToolBar;
-import javax.swing.JViewport;
-import javax.swing.SwingUtilities;
-import javax.swing.UIManager;
+import java.awt.*;
+import java.awt.event.*;
+import java.beans.*;
+import java.io.*;
+import java.net.*;
+import java.util.*;
+import java.util.logging.*;
+import javax.swing.*;
+import javax.swing.undo.*;
+import javax.swing.text.*;
+import javax.swing.event.*;
 import javax.swing.UIManager.LookAndFeelInfo;
-import javax.swing.event.UndoableEditEvent;
-import javax.swing.event.UndoableEditListener;
-import javax.swing.text.BadLocationException;
-import javax.swing.text.Document;
-import javax.swing.text.JTextComponent;
-import javax.swing.text.PlainDocument;
-import javax.swing.text.Segment;
-import javax.swing.text.TextAction;
-import javax.swing.undo.CannotRedoException;
-import javax.swing.undo.CannotUndoException;
-import javax.swing.undo.UndoManager;
 
 
 /**
@@ -115,16 +62,27 @@
 @SuppressWarnings("serial")
 class Notepad extends JPanel {
 
+    protected static Properties properties;
     private static ResourceBundle resources;
     private final static String EXIT_AFTER_PAINT = "-exit";
     private static boolean exitAfterFirstPaint;
 
+    private static final String[] MENUBAR_KEYS = {"file", "edit", "debug"};
+    private static final String[] TOOLBAR_KEYS = {"new", "open", "save", "-", "cut", "copy", "paste"};
+    private static final String[] FILE_KEYS = {"new", "open", "save", "-", "exit"};
+    private static final String[] EDIT_KEYS = {"cut", "copy", "paste", "-", "undo", "redo"};
+    private static final String[] DEBUG_KEYS = {"dump", "showElementTree"};
+
     static {
         try {
+            properties = new Properties();
+            properties.load(Notepad.class.getResourceAsStream(
+                    "resources/NotepadSystem.properties"));
             resources = ResourceBundle.getBundle("resources.Notepad",
                     Locale.getDefault());
-        } catch (MissingResourceException mre) {
-            System.err.println("resources/Notepad.properties not found");
+        } catch (MissingResourceException | IOException  e) {
+            System.err.println("resources/Notepad.properties "
+                    + "or resources/NotepadSystem.properties not found");
             System.exit(1);
         }
     }
@@ -163,26 +121,22 @@
         // install the command table
         commands = new HashMap<Object, Action>();
         Action[] actions = getActions();
-        for (int i = 0; i < actions.length; i++) {
-            Action a = actions[i];
-            //commands.put(a.getText(Action.NAME), a);
+        for (Action a : actions) {
             commands.put(a.getValue(Action.NAME), a);
         }
 
         JScrollPane scroller = new JScrollPane();
         JViewport port = scroller.getViewport();
         port.add(editor);
-        try {
-            String vpFlag = resources.getString("ViewportBackingStore");
+
+        String vpFlag = getProperty("ViewportBackingStore");
+        if (vpFlag != null) {
             Boolean bs = Boolean.valueOf(vpFlag);
-            port.setScrollMode(bs.booleanValue()
+            port.setScrollMode(bs
                     ? JViewport.BACKINGSTORE_SCROLL_MODE
                     : JViewport.BLIT_SCROLL_MODE);
-        } catch (MissingResourceException ignored) {
-            // just use the viewport default
         }
 
-        menuItems = new HashMap<String, JMenuItem>();
         JPanel panel = new JPanel();
         panel.setLayout(new BorderLayout());
         panel.add("North", createToolbar());
@@ -191,31 +145,26 @@
         add("South", createStatusbar());
     }
 
-    public static void main(String[] args) {
-        try {
-            if (args.length > 0 && args[0].equals(EXIT_AFTER_PAINT)) {
-                exitAfterFirstPaint = true;
+    public static void main(String[] args) throws Exception {
+        if (args.length > 0 && args[0].equals(EXIT_AFTER_PAINT)) {
+            exitAfterFirstPaint = true;
+        }
+        SwingUtilities.invokeAndWait(new Runnable() {
+
+            public void run() {
+                JFrame frame = new JFrame();
+                frame.setTitle(resources.getString("Title"));
+                frame.setBackground(Color.lightGray);
+                frame.getContentPane().setLayout(new BorderLayout());
+                Notepad notepad = new Notepad();
+                frame.getContentPane().add("Center", notepad);
+                frame.setJMenuBar(notepad.createMenubar());
+                frame.addWindowListener(new AppCloser());
+                frame.pack();
+                frame.setSize(500, 600);
+                frame.setVisible(true);
             }
-            SwingUtilities.invokeAndWait(new Runnable() {
-
-                public void run() {
-                    JFrame frame = new JFrame();
-                    frame.setTitle(resources.getString("Title"));
-                    frame.setBackground(Color.lightGray);
-                    frame.getContentPane().setLayout(new BorderLayout());
-                    Notepad notepad = new Notepad();
-                    frame.getContentPane().add("Center", notepad);
-                    frame.setJMenuBar(notepad.createMenubar());
-                    frame.addWindowListener(new AppCloser());
-                    frame.pack();
-                    frame.setSize(500, 600);
-                    frame.setVisible(true);
-                }
-            });
-        } catch (Throwable t) {
-            Logger.getLogger(Notepad.class.getName()).log(Level.SEVERE,
-                    "uncaught exception", t);
-        }
+        });
     }
 
     /**
@@ -274,9 +223,7 @@
 
     /**
      * This is the hook through which all menu items are
-     * created.  It registers the result with the menuitem
-     * hashtable so that it can be fetched with getMenuItem().
-     * @see #getMenuItem
+     * created.
      */
     protected JMenuItem createMenuItem(String cmd) {
         JMenuItem mi = new JMenuItem(getResourceString(cmd + labelSuffix));
@@ -285,7 +232,7 @@
             mi.setHorizontalTextPosition(JButton.RIGHT);
             mi.setIcon(new ImageIcon(url));
         }
-        String astr = getResourceString(cmd + actionSuffix);
+        String astr = getProperty(cmd + actionSuffix);
         if (astr == null) {
             astr = cmd;
         }
@@ -298,25 +245,17 @@
         } else {
             mi.setEnabled(false);
         }
-        menuItems.put(cmd, mi);
         return mi;
     }
 
-    /**
-     * Fetch the menu item that was created for the given
-     * command.
-     * @param cmd  Name of the action.
-     * @returns item created for the given command or null
-     *  if one wasn't created.
-     */
-    protected JMenuItem getMenuItem(String cmd) {
-        return menuItems.get(cmd);
-    }
-
     protected Action getAction(String cmd) {
         return commands.get(cmd);
     }
 
+    protected String getProperty(String key) {
+        return properties.getProperty(key);
+    }
+
     protected String getResourceString(String nm) {
         String str;
         try {
@@ -330,20 +269,11 @@
     protected URL getResource(String key) {
         String name = getResourceString(key);
         if (name != null) {
-            URL url = this.getClass().getResource(name);
-            return url;
+            return this.getClass().getResource(name);
         }
         return null;
     }
 
-    protected Container getToolbar() {
-        return toolbar;
-    }
-
-    protected JMenuBar getMenubar() {
-        return menubar;
-    }
-
     /**
      * Create a status bar
      */
@@ -368,12 +298,11 @@
      */
     private Component createToolbar() {
         toolbar = new JToolBar();
-        String[] toolKeys = tokenize(getResourceString("toolbar"));
-        for (int i = 0; i < toolKeys.length; i++) {
-            if (toolKeys[i].equals("-")) {
+        for (String toolKey: getToolBarKeys()) {
+            if (toolKey.equals("-")) {
                 toolbar.add(Box.createHorizontalStrut(5));
             } else {
-                toolbar.add(createTool(toolKeys[i]));
+                toolbar.add(createTool(toolKey));
             }
         }
         toolbar.add(Box.createHorizontalGlue());
@@ -408,7 +337,7 @@
         b.setRequestFocusEnabled(false);
         b.setMargin(new Insets(1, 1, 1, 1));
 
-        String astr = getResourceString(key + actionSuffix);
+        String astr = getProperty(key + actionSuffix);
         if (astr == null) {
             astr = key;
         }
@@ -429,43 +358,17 @@
     }
 
     /**
-     * Take the given string and chop it up into a series
-     * of strings on whitespace boundaries.  This is useful
-     * for trying to get an array of strings out of the
-     * resource file.
-     */
-    protected String[] tokenize(String input) {
-        List<String> v = new ArrayList<String>();
-        StringTokenizer t = new StringTokenizer(input);
-        String cmd[];
-
-        while (t.hasMoreTokens()) {
-            v.add(t.nextToken());
-        }
-        cmd = new String[v.size()];
-        for (int i = 0; i < cmd.length; i++) {
-            cmd[i] = v.get(i);
-        }
-
-        return cmd;
-    }
-
-    /**
      * Create the menubar for the app.  By default this pulls the
      * definition of the menu from the associated resource file.
      */
     protected JMenuBar createMenubar() {
-        JMenuItem mi;
         JMenuBar mb = new JMenuBar();
-
-        String[] menuKeys = tokenize(getResourceString("menubar"));
-        for (int i = 0; i < menuKeys.length; i++) {
-            JMenu m = createMenu(menuKeys[i]);
+        for(String menuKey: getMenuBarKeys()){
+            JMenu m = createMenu(menuKey);
             if (m != null) {
                 mb.add(m);
             }
         }
-        this.menubar = mb;
         return mb;
     }
 
@@ -474,19 +377,42 @@
      * definition of the menu from the associated resource file.
      */
     protected JMenu createMenu(String key) {
-        String[] itemKeys = tokenize(getResourceString(key));
-        JMenu menu = new JMenu(getResourceString(key + "Label"));
-        for (int i = 0; i < itemKeys.length; i++) {
-            if (itemKeys[i].equals("-")) {
+        JMenu menu = new JMenu(getResourceString(key + labelSuffix));
+        for (String itemKey: getItemKeys(key)) {
+            if (itemKey.equals("-")) {
                 menu.addSeparator();
             } else {
-                JMenuItem mi = createMenuItem(itemKeys[i]);
+                JMenuItem mi = createMenuItem(itemKey);
                 menu.add(mi);
             }
         }
         return menu;
     }
 
+    /**
+     *  Get keys for menus
+     */
+    protected String[] getItemKeys(String key) {
+        switch (key) {
+            case "file":
+                return FILE_KEYS;
+            case "edit":
+                return EDIT_KEYS;
+            case "debug":
+                return DEBUG_KEYS;
+            default:
+                return null;
+        }
+    }
+
+    protected String[] getMenuBarKeys() {
+        return MENUBAR_KEYS;
+    }
+
+    protected String[] getToolBarKeys() {
+        return TOOLBAR_KEYS;
+    }
+
     // Yarked from JMenu, ideally this would be public.
     protected PropertyChangeListener createActionChangeListener(JMenuItem b) {
         return new ActionChangedListener(b);
@@ -516,13 +442,11 @@
     }
     private JTextComponent editor;
     private Map<Object, Action> commands;
-    private Map<String, JMenuItem> menuItems;
-    private JMenuBar menubar;
     private JToolBar toolbar;
     private JComponent status;
     private JFrame elementTreeFrame;
     protected ElementTreePanel elementTreePanel;
-    protected FileDialog fileDialog;
+
     /**
      * Listener for the edits on the current document.
      */
@@ -773,10 +697,6 @@
             super(showElementTreeAction);
         }
 
-        ShowElementTreeAction(String nm) {
-            super(nm);
-        }
-
         public void actionPerformed(ActionEvent e) {
             if (elementTreeFrame == null) {
                 // Create a frame containing an instance of
--- a/src/share/demo/jfc/Notepad/resources/Notepad.properties	Fri May 25 12:56:22 2012 +0400
+++ b/src/share/demo/jfc/Notepad/resources/Notepad.properties	Fri May 25 19:34:32 2012 -0700
@@ -3,16 +3,6 @@
 
 Title=Notepad
 ElementTreeFrameTitle=Elements
-# The following string should NOT be translated: ViewportBackingStore
-ViewportBackingStore=false
-
-# menubar definition
-#
-# Each of the strings that follow form a key to be 
-# used to the actual menu definition.
-
-# The following string should NOT be translated: menubar
-menubar=file edit debug
 
 # file Menu definition
 #
@@ -24,8 +14,6 @@
 # save ->  Notepad.saveAction
 # exit ->  Notepad.exitAction
 
-# The following string should NOT be translated: file
-file=new open save - exit
 fileLabel=File
 openLabel=Open
 openImage=resources/open.gif
@@ -42,38 +30,22 @@
 # copy  -> JTextComponent.copyAction
 # paste -> JTextComponent.pasteAction
 
-# The following string should NOT be translated: edit
-edit=cut copy paste - undo redo
 editLabel=Edit
 cutLabel=Cut
-# The following string should NOT be translated: cutAction
-cutAction=cut-to-clipboard
 cutImage=resources/cut.gif
 copyLabel=Copy
-# The following string should NOT be translated: copyAction
-copyAction=copy-to-clipboard
 copyImage=resources/copy.gif
 pasteLabel=Paste
-# The following string should NOT be translated: pasteAction
-pasteAction=paste-from-clipboard
 pasteImage=resources/paste.gif
 undoLabel=Undo
-# The following string should NOT be translated: undoAction
-undoAction=Undo
 redoLabel=Redo
-# The following string should NOT be translated: redoAction
-redoAction=Redo
 
 #
 # debug Menu definition
 #
 
-# The following string should NOT be translated: debug
-debug=dump showElementTree
 debugLabel=Debug
 dumpLabel=Dump model to System.err
-# The following string should NOT be translated: dumpAction
-dumpAction=dump-model
 showElementTreeLabel=Show Elements
 
 # toolbar definition
@@ -83,8 +55,6 @@
 # are of course sharable, and in this case are shared
 # with the menu items.
 
-# The following string should NOT be translated: toolbar
-toolbar=new open save - cut copy paste
 newTooltip=Create a new file
 openTooltip=Open a file
 saveTooltip=Save to a file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/demo/jfc/Notepad/resources/NotepadSystem.properties	Fri May 25 19:34:32 2012 -0700
@@ -0,0 +1,12 @@
+#
+# Non-translatable properties for Notepad example
+
+ViewportBackingStore=false
+
+cutAction=cut-to-clipboard
+copyAction=copy-to-clipboard
+pasteAction=paste-from-clipboard
+undoAction=Undo
+redoAction=Redo
+dumpAction=dump-model
+
--- a/src/share/demo/management/MemoryMonitor/README.txt	Fri May 25 12:56:22 2012 +0400
+++ b/src/share/demo/management/MemoryMonitor/README.txt	Fri May 25 19:34:32 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/share/demo/nio/zipfs/src/com/sun/nio/zipfs/ZipFileSystem.java	Fri May 25 12:56:22 2012 +0400
+++ b/src/share/demo/nio/zipfs/src/com/sun/nio/zipfs/ZipFileSystem.java	Fri May 25 19:34:32 2012 -0700
@@ -651,7 +651,11 @@
                     }
 
                     public int read(ByteBuffer dst) throws IOException {
-                        return rbc.read(dst);
+                        int n = rbc.read(dst);
+                        if (n > 0) {
+                            read += n;
+                        }
+                        return n;
                     }
 
                     public SeekableByteChannel truncate(long size)
--- a/src/share/native/com/sun/java/util/jar/pack/jni.cpp	Fri May 25 12:56:22 2012 +0400
+++ b/src/share/native/com/sun/java/util/jar/pack/jni.cpp	Fri May 25 19:34:32 2012 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 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
@@ -82,7 +82,11 @@
 static unpacker* get_unpacker() {
   //fprintf(stderr, "get_unpacker()\n");
   JavaVM* vm = null;
-  JNI_GetCreatedJavaVMs(&vm, 1, null);
+  jsize nVM = 0;
+  jint retval = JNI_GetCreatedJavaVMs(&vm, 1, &nVM);
+  // other VM implements may differ, thus for correctness, we need these checks
+  if (retval != JNI_OK || nVM != 1)
+    return null;
   void* envRaw = null;
   vm->GetEnv(&envRaw, JNI_VERSION_1_1);
   JNIEnv* env = (JNIEnv*) envRaw;
--- a/src/share/native/java/net/net_util.h	Fri May 25 12:56:22 2012 +0400
+++ b/src/share/native/java/net/net_util.h	Fri May 25 19:34:32 2012 -0700
@@ -139,6 +139,9 @@
 int
 NET_IsEqual(jbyte* caddr1, jbyte* caddr2);
 
+int
+NET_IsZeroAddr(jbyte* caddr);
+
 /* Socket operations
  *
  * These work just like the JVM_* procedures, except that they may do some
--- a/src/share/native/sun/java2d/opengl/OGLContext.h	Fri May 25 12:56:22 2012 +0400
+++ b/src/share/native/sun/java2d/opengl/OGLContext.h	Fri May 25 19:34:32 2012 -0700
@@ -84,6 +84,7 @@
     GLdouble   *xformMatrix;
     GLuint     blitTextureID;
     GLint      textureFunction;
+    jboolean   vertexCacheEnabled;
 } OGLContext;
 
 /**
--- a/src/share/native/sun/java2d/opengl/OGLTextRenderer.c	Fri May 25 12:56:22 2012 +0400
+++ b/src/share/native/sun/java2d/opengl/OGLTextRenderer.c	Fri May 25 19:34:32 2012 -0700
@@ -202,11 +202,6 @@
 
     J2dTraceLn(J2D_TRACE_INFO, "OGLTR_InitGlyphCache");
 
-    // init vertex cache (if it hasn't been already)
-    if (!OGLVertexCache_InitVertexCache()) {
-        return JNI_FALSE;
-    }
-
     // init glyph cache data structure
     gcinfo = AccelGlyphCache_Init(OGLTR_CACHE_WIDTH,
                                   OGLTR_CACHE_HEIGHT,
@@ -583,6 +578,10 @@
 {
     J2dTraceLn(J2D_TRACE_INFO, "OGLTR_EnableGlyphVertexCache");
 
+    if (!OGLVertexCache_InitVertexCache(oglc)) {
+        return;
+    }
+
     if (glyphCache == NULL) {
         if (!OGLTR_InitGlyphCache(JNI_FALSE)) {
             return;
--- a/src/share/native/sun/java2d/opengl/OGLVertexCache.c	Fri May 25 12:56:22 2012 +0400
+++ b/src/share/native/sun/java2d/opengl/OGLVertexCache.c	Fri May 25 19:34:32 2012 -0700
@@ -67,30 +67,32 @@
     } while (0)
 
 jboolean
-OGLVertexCache_InitVertexCache()
+OGLVertexCache_InitVertexCache(OGLContext *oglc)
 {
     J2dTraceLn(J2D_TRACE_INFO, "OGLVertexCache_InitVertexCache");
 
-    if (vertexCache != NULL) {
-        return JNI_TRUE;
+    if (vertexCache == NULL) {
+        vertexCache = (J2DVertex *)malloc(OGLVC_MAX_INDEX * sizeof(J2DVertex));
+        if (vertexCache == NULL) {
+            return JNI_FALSE;
+        }
     }
 
-    vertexCache = (J2DVertex *)malloc(OGLVC_MAX_INDEX * sizeof(J2DVertex));
-    if (vertexCache == NULL) {
-        return JNI_FALSE;
+    if (!oglc->vertexCacheEnabled) {
+        j2d_glTexCoordPointer(2, GL_FLOAT,
+                              sizeof(J2DVertex), vertexCache);
+        j2d_glColorPointer(4, GL_UNSIGNED_BYTE,
+                           sizeof(J2DVertex), ((jfloat *)vertexCache) + 2);
+        j2d_glVertexPointer(2, GL_FLOAT,
+                            sizeof(J2DVertex), ((jfloat *)vertexCache) + 3);
+
+        j2d_glEnableClientState(GL_TEXTURE_COORD_ARRAY);
+        j2d_glEnableClientState(GL_COLOR_ARRAY);
+        j2d_glEnableClientState(GL_VERTEX_ARRAY);
+
+        oglc->vertexCacheEnabled = JNI_TRUE;
     }
 
-    j2d_glTexCoordPointer(2, GL_FLOAT,
-                          sizeof(J2DVertex), vertexCache);
-    j2d_glColorPointer(4, GL_UNSIGNED_BYTE,
-                       sizeof(J2DVertex), ((jfloat *)vertexCache) + 2);
-    j2d_glVertexPointer(2, GL_FLOAT,
-                        sizeof(J2DVertex), ((jfloat *)vertexCache) + 3);
-
-    j2d_glEnableClientState(GL_TEXTURE_COORD_ARRAY);
-    j2d_glEnableClientState(GL_COLOR_ARRAY);
-    j2d_glEnableClientState(GL_VERTEX_ARRAY);
-
     return JNI_TRUE;
 }
 
@@ -149,10 +151,6 @@
 {
     J2dTraceLn(J2D_TRACE_INFO, "OGLVertexCache_InitMaskCache");
 
-    if (!OGLVertexCache_InitVertexCache()) {
-        return JNI_FALSE;
-    }
-
     maskCacheTexID =
         OGLContext_CreateBlitTexture(GL_INTENSITY8, GL_LUMINANCE,
                                      OGLVC_MASK_CACHE_WIDTH_IN_TEXELS,
@@ -179,6 +177,10 @@
 {
     J2dTraceLn(J2D_TRACE_INFO, "OGLVertexCache_EnableMaskCache");
 
+    if (!OGLVertexCache_InitVertexCache(oglc)) {
+        return;
+    }
+
     if (maskCacheTexID == 0) {
         if (!OGLVertexCache_InitMaskCache()) {
             return;
--- a/src/share/native/sun/java2d/opengl/OGLVertexCache.h	Fri May 25 12:56:22 2012 +0400
+++ b/src/share/native/sun/java2d/opengl/OGLVertexCache.h	Fri May 25 19:34:32 2012 -0700
@@ -65,7 +65,7 @@
 /**
  * Exported methods.
  */
-jboolean OGLVertexCache_InitVertexCache();
+jboolean OGLVertexCache_InitVertexCache(OGLContext *oglc);
 void OGLVertexCache_FlushVertexCache();
 void OGLVertexCache_RestoreColorState(OGLContext *oglc);
 
--- a/src/solaris/classes/sun/awt/X11/GtkFileDialogPeer.java	Fri May 25 12:56:22 2012 +0400
+++ b/src/solaris/classes/sun/awt/X11/GtkFileDialogPeer.java	Fri May 25 19:34:32 2012 -0700
@@ -73,7 +73,7 @@
         if (filenames == null) {
             accessor.setDirectory(fd, null);
             accessor.setFile(fd, null);
-            accessor.setFiles(fd, null, null);
+            accessor.setFiles(fd, null);
         } else {
             // Fix 6987233: add the trailing slash if it's absent
             String with_separator = directory;
@@ -83,7 +83,13 @@
             }
             accessor.setDirectory(fd, with_separator);
             accessor.setFile(fd, filenames[0]);
-            accessor.setFiles(fd, directory, filenames);
+
+            int filesNumber = (filenames != null) ? filenames.length : 0;
+            File[] files = new File[filesNumber];
+            for (int i = 0; i < filesNumber; i++) {
+                files[i] = new File(directory, filenames[i]);
+            }
+            accessor.setFiles(fd, files);
         }
     }
 
--- a/src/solaris/classes/sun/awt/X11/XFileDialogPeer.java	Fri May 25 12:56:22 2012 +0400
+++ b/src/solaris/classes/sun/awt/X11/XFileDialogPeer.java	Fri May 25 19:34:32 2012 -0700
@@ -396,11 +396,18 @@
             savedFile = file.substring(index+1);
         }
 
+        String[] fileNames = fileList.getSelectedItems();
+        int filesNumber = (fileNames != null) ? fileNames.length : 0;
+        File[] files = new File[filesNumber];
+        for (int i = 0; i < filesNumber; i++) {
+            files[i] = new File(savedDir, fileNames[i]);
+        }
+
         AWTAccessor.FileDialogAccessor fileDialogAccessor = AWTAccessor.getFileDialogAccessor();
 
         fileDialogAccessor.setDirectory(target, savedDir);
         fileDialogAccessor.setFile(target, savedFile);
-        fileDialogAccessor.setFiles(target, savedDir, fileList.getSelectedItems());
+        fileDialogAccessor.setFiles(target, files);
     }
 
     /**
@@ -419,7 +426,7 @@
 
         fileDialogAccessor.setDirectory(target, null);
         fileDialogAccessor.setFile(target, null);
-        fileDialogAccessor.setFiles(target, null, null);
+        fileDialogAccessor.setFiles(target, null);
 
         handleQuitButton();
     }
--- a/src/solaris/native/java/net/Inet4AddressImpl.c	Fri May 25 12:56:22 2012 +0400
+++ b/src/solaris/native/java/net/Inet4AddressImpl.c	Fri May 25 19:34:32 2012 -0700
@@ -671,12 +671,19 @@
            * We did receive something, but is it what we were expecting?
            * I.E.: A ICMP_ECHOREPLY packet with the proper PID.
            */
-          if (icmplen >= 8 && icmp->icmp_type == ICMP_ECHOREPLY &&
-               (ntohs(icmp->icmp_id) == pid) &&
-               (him->sin_addr.s_addr == sa_recv.sin_addr.s_addr)) {
-            close(fd);
-            return JNI_TRUE;
-          }
+          if (icmplen >= 8 && icmp->icmp_type == ICMP_ECHOREPLY
+               && (ntohs(icmp->icmp_id) == pid)) {
+            if ((him->sin_addr.s_addr == sa_recv.sin_addr.s_addr)) {
+              close(fd);
+              return JNI_TRUE;
+            }
+
+            if (him->sin_addr.s_addr == 0) {
+              close(fd);
+              return JNI_TRUE;
+            }
+         }
+
         }
       } while (tmout2 > 0);
       timeout -= 1000;
--- a/src/solaris/native/java/net/Inet6AddressImpl.c	Fri May 25 12:56:22 2012 +0400
+++ b/src/solaris/native/java/net/Inet6AddressImpl.c	Fri May 25 19:34:32 2012 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 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
@@ -73,7 +73,7 @@
     } else {
         // ensure null-terminated
         hostname[NI_MAXHOST] = '\0';
-#if defined(__linux__) && defined(_ALLBSD_SOURCE)
+#if defined(__linux__) || defined(_ALLBSD_SOURCE)
         /* On Linux/FreeBSD gethostname() says "host.domain.sun.com".  On
          * Solaris gethostname() says "host", so extra work is needed.
          */
@@ -532,10 +532,15 @@
            *       from the host that we are trying to determine is reachable.
            */
           if (n >= 8 && icmp6->icmp6_type == ICMP6_ECHO_REPLY &&
-              (ntohs(icmp6->icmp6_id) == pid) &&
-              NET_IsEqual(caddr, recv_caddr)) {
-            close(fd);
-            return JNI_TRUE;
+              (ntohs(icmp6->icmp6_id) == pid)) {
+            if (NET_IsEqual(caddr, recv_caddr)) {
+              close(fd);
+              return JNI_TRUE;
+            }
+            if (NET_IsZeroAddr(caddr)) {
+              close(fd);
+              return JNI_TRUE;
+            }
           }
         }
       } while (tmout2 > 0);
--- a/src/solaris/native/java/net/net_util_md.c	Fri May 25 12:56:22 2012 +0400
+++ b/src/solaris/native/java/net/net_util_md.c	Fri May 25 19:34:32 2012 -0700
@@ -961,6 +961,16 @@
     return 1;
 }
 
+int NET_IsZeroAddr(jbyte* caddr) {
+    int i;
+    for (i = 0; i < 16; i++) {
+        if (caddr[i] != 0) {
+            return 0;
+        }
+    }
+    return 1;
+}
+
 /*
  * Map the Java level socket option to the platform specific
  * level and option name.
--- a/src/solaris/native/java/util/TimeZone_md.c	Fri May 25 12:56:22 2012 +0400
+++ b/src/solaris/native/java/util/TimeZone_md.c	Fri May 25 19:34:32 2012 -0700
@@ -651,7 +651,7 @@
     }
 
 #ifdef __solaris__
-    if (strcmp(tz, "localtime") == 0) {
+    if (tz != NULL && strcmp(tz, "localtime") == 0) {
         tz = getSolarisDefaultZoneID();
         freetz = tz;
     }
--- a/src/solaris/native/sun/nio/ch/EPollArrayWrapper.c	Fri May 25 12:56:22 2012 +0400
+++ b/src/solaris/native/sun/nio/ch/EPollArrayWrapper.c	Fri May 25 19:34:32 2012 -0700
@@ -30,40 +30,10 @@
 
 #include "sun_nio_ch_EPollArrayWrapper.h"
 
-#include <dlfcn.h>
 #include <unistd.h>
 #include <sys/resource.h>
 #include <sys/time.h>
-
-#ifdef  __cplusplus
-extern "C" {
-#endif
-
-/* epoll_wait(2) man page */
-
-typedef union epoll_data {
-    void *ptr;
-    int fd;
-    __uint32_t u32;
-    __uint64_t u64;
-} epoll_data_t;
-
-
-/* x86-64 has same alignment as 32-bit */
-#ifdef __x86_64__
-#define EPOLL_PACKED __attribute__((packed))
-#else
-#define EPOLL_PACKED
-#endif
-
-struct epoll_event {
-    __uint32_t events;  /* Epoll events */
-    epoll_data_t data;  /* User data variable */
-} EPOLL_PACKED;
-
-#ifdef  __cplusplus
-}
-#endif
+#include <sys/epoll.h>
 
 #define RESTARTABLE(_cmd, _result) do { \
   do { \
@@ -71,18 +41,6 @@
   } while((_result == -1) && (errno == EINTR)); \
 } while(0)
 
-/*
- * epoll event notification is new in 2.6 kernel. As the offical build
- * platform for the JDK is on a 2.4-based distribution then we must
- * obtain the addresses of the epoll functions dynamically.
- */
-typedef int (*epoll_create_t)(int size);
-typedef int (*epoll_ctl_t)   (int epfd, int op, int fd, struct epoll_event *event);
-typedef int (*epoll_wait_t)  (int epfd, struct epoll_event *events, int maxevents, int timeout);
-
-static epoll_create_t epoll_create_func;
-static epoll_ctl_t    epoll_ctl_func;
-static epoll_wait_t   epoll_wait_func;
 
 static int
 iepoll(int epfd, struct epoll_event *events, int numfds, jlong timeout)
@@ -96,7 +54,7 @@
     start = t.tv_sec * 1000 + t.tv_usec / 1000;
 
     for (;;) {
-        int res = (*epoll_wait_func)(epfd, events, numfds, timeout);
+        int res = epoll_wait(epfd, events, numfds, timeout);
         if (res < 0 && errno == EINTR) {
             if (remaining >= 0) {
                 gettimeofday(&t, NULL);
@@ -117,14 +75,6 @@
 JNIEXPORT void JNICALL
 Java_sun_nio_ch_EPollArrayWrapper_init(JNIEnv *env, jclass this)
 {
-    epoll_create_func = (epoll_create_t) dlsym(RTLD_DEFAULT, "epoll_create");
-    epoll_ctl_func    = (epoll_ctl_t)    dlsym(RTLD_DEFAULT, "epoll_ctl");
-    epoll_wait_func   = (epoll_wait_t)   dlsym(RTLD_DEFAULT, "epoll_wait");
-
-    if ((epoll_create_func == NULL) || (epoll_ctl_func == NULL) ||
-        (epoll_wait_func == NULL)) {
-        JNU_ThrowInternalError(env, "unable to get address of epoll functions, pre-2.6 kernel?");
-    }
 }
 
 JNIEXPORT jint JNICALL
@@ -134,7 +84,7 @@
      * epoll_create expects a size as a hint to the kernel about how to
      * dimension internal structures. We can't predict the size in advance.
      */
-    int epfd = (*epoll_create_func)(256);
+    int epfd = epoll_create(256);
     if (epfd < 0) {
        JNU_ThrowIOExceptionWithLastError(env, "epoll_create failed");
     }
@@ -173,7 +123,7 @@
     event.events = events;
     event.data.fd = fd;
 
-    RESTARTABLE((*epoll_ctl_func)(epfd, (int)opcode, (int)fd, &event), res);
+    RESTARTABLE(epoll_ctl(epfd, (int)opcode, (int)fd, &event), res);
 
     /*
      * A channel may be registered with several Selectors. When each Selector
@@ -199,7 +149,7 @@
     int res;
 
     if (timeout <= 0) {           /* Indefinite or no wait */
-        RESTARTABLE((*epoll_wait_func)(epfd, events, numfds, timeout), res);
+        RESTARTABLE(epoll_wait(epfd, events, numfds, timeout), res);
     } else {                      /* Bounded wait; bounded restarts */
         res = iepoll(epfd, events, numfds, timeout);
     }
--- a/src/windows/classes/sun/awt/windows/WFileDialogPeer.java	Fri May 25 12:56:22 2012 +0400
+++ b/src/windows/classes/sun/awt/windows/WFileDialogPeer.java	Fri May 25 19:34:32 2012 -0700
@@ -139,13 +139,16 @@
 
         String jDirectory = null;
         String jFile = null;
-        String jFiles[] = null;
+        File[] jFiles = null;
 
         if (multiple) {
             jDirectory = wFiles[0];
-            jFiles = new String[wFiles.length - 1];
-            System.arraycopy(wFiles, 1, jFiles, 0, jFiles.length);
-            jFile = jFiles[1]; // choose any file
+            int filesNumber = wFiles.length - 1;
+            jFiles = new File[filesNumber];
+            for (int i = 0; i < filesNumber; i++) {
+                jFiles[i] = new File(jDirectory, wFiles[i + 1]);
+        }
+            jFile = wFiles[1]; // choose any file
         } else {
             int index = wFiles[0].lastIndexOf(java.io.File.separatorChar);
             if (index == -1) {
@@ -155,7 +158,7 @@
                 jDirectory = wFiles[0].substring(0, index + 1);
                 jFile = wFiles[0].substring(index + 1);
             }
-            jFiles = new String[] { jFile };
+            jFiles = new File[] { new File(jDirectory, jFile) };
         }
 
         final FileDialog fileDialog = (FileDialog)target;
@@ -163,7 +166,7 @@
 
         fileDialogAccessor.setDirectory(fileDialog, jDirectory);
         fileDialogAccessor.setFile(fileDialog, jFile);
-        fileDialogAccessor.setFiles(fileDialog, jDirectory, jFiles);
+        fileDialogAccessor.setFiles(fileDialog, jFiles);
 
         WToolkit.executeOnEventHandlerThread(fileDialog, new Runnable() {
              public void run() {
@@ -178,7 +181,7 @@
         final FileDialog fileDialog = (FileDialog)target;
 
         AWTAccessor.getFileDialogAccessor().setFile(fileDialog, null);
-        AWTAccessor.getFileDialogAccessor().setFiles(fileDialog, null, null);
+        AWTAccessor.getFileDialogAccessor().setFiles(fileDialog, null);
 
         WToolkit.executeOnEventHandlerThread(fileDialog, new Runnable() {
              public void run() {
--- a/src/windows/classes/sun/security/mscapi/RSASignature.java	Fri May 25 12:56:22 2012 +0400
+++ b/src/windows/classes/sun/security/mscapi/RSASignature.java	Fri May 25 19:34:32 2012 -0700
@@ -57,8 +57,8 @@
  *
  * NOTE: NONEwithRSA must be supplied with a pre-computed message digest.
  *       Only the following digest algorithms are supported: MD5, SHA-1,
- *       SHA-256, SHA-384, SHA-512 and a special-purpose digest algorithm
- *       which is a concatenation of SHA-1 and MD5 digests.
+ *       SHA-256, SHA-384, SHA-512 and a special-purpose digest
+ *       algorithm which is a concatenation of SHA-1 and MD5 digests.
  *
  * @since   1.6
  * @author  Stanley Man-Kit Ho
--- a/src/windows/classes/sun/security/mscapi/SunMSCAPI.java	Fri May 25 12:56:22 2012 +0400
+++ b/src/windows/classes/sun/security/mscapi/SunMSCAPI.java	Fri May 25 19:34:32 2012 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 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
@@ -81,18 +81,26 @@
          */
         // NONEwithRSA must be supplied with a pre-computed message digest.
         // Only the following digest algorithms are supported: MD5, SHA-1,
-        // SHA-256, SHA-384, SHA-512 and a special-purpose digest algorithm
-        // which is a concatenation of SHA-1 and MD5 digests.
+        // SHA-256, SHA-384, SHA-512 and a special-purpose digest
+        // algorithm which is a concatenation of SHA-1 and MD5 digests.
         map.put("Signature.NONEwithRSA",
             "sun.security.mscapi.RSASignature$Raw");
         map.put("Signature.SHA1withRSA",
             "sun.security.mscapi.RSASignature$SHA1");
         map.put("Signature.SHA256withRSA",
             "sun.security.mscapi.RSASignature$SHA256");
+        map.put("Alg.Alias.Signature.1.2.840.113549.1.1.11",     "SHA256withRSA");
+        map.put("Alg.Alias.Signature.OID.1.2.840.113549.1.1.11", "SHA256withRSA");
         map.put("Signature.SHA384withRSA",
             "sun.security.mscapi.RSASignature$SHA384");
+        map.put("Alg.Alias.Signature.1.2.840.113549.1.1.12",     "SHA384withRSA");
+        map.put("Alg.Alias.Signature.OID.1.2.840.113549.1.1.12", "SHA384withRSA");
+
         map.put("Signature.SHA512withRSA",
             "sun.security.mscapi.RSASignature$SHA512");
+        map.put("Alg.Alias.Signature.1.2.840.113549.1.1.13",     "SHA512withRSA");
+        map.put("Alg.Alias.Signature.OID.1.2.840.113549.1.1.13", "SHA512withRSA");
+
         map.put("Signature.MD5withRSA",
             "sun.security.mscapi.RSASignature$MD5");
         map.put("Signature.MD2withRSA",
--- a/src/windows/native/sun/tools/attach/WindowsVirtualMachine.c	Fri May 25 12:56:22 2012 +0400
+++ b/src/windows/native/sun/tools/attach/WindowsVirtualMachine.c	Fri May 25 19:34:32 2012 -0700
@@ -466,7 +466,17 @@
         }
         CloseHandle(hThread);
     } else {
-        JNU_ThrowIOExceptionWithLastError(env, "CreateRemoteThread failed");
+        if (GetLastError() == ERROR_NOT_ENOUGH_MEMORY) {
+            //
+            // This error will occur when attaching to a process belonging to
+            // another terminal session. See "Remarks":
+            // http://msdn.microsoft.com/en-us/library/ms682437%28VS.85%29.aspx
+            //
+            JNU_ThrowIOException(env,
+                "Insufficient memory or insufficient privileges to attach");
+        } else {
+            JNU_ThrowIOExceptionWithLastError(env, "CreateRemoteThread failed");
+        }
     }
 
     VirtualFreeEx(hProcess, pCode, 0, MEM_RELEASE);
--- a/test/com/sun/crypto/provider/Cipher/RSA/TestOAEP.java	Fri May 25 12:56:22 2012 +0400
+++ b/test/com/sun/crypto/provider/Cipher/RSA/TestOAEP.java	Fri May 25 19:34:32 2012 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 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
@@ -58,6 +58,7 @@
         Cipher.getInstance("RSA/ECB/OAEPwithMD5andMGF1Padding");
         Cipher.getInstance("RSA/ECB/OAEPwithSHA1andMGF1Padding");
         Cipher.getInstance("RSA/ECB/OAEPwithSHA-1andMGF1Padding");
+        Cipher.getInstance("RSA/ECB/OAEPwithSHA-224andMGF1Padding");
         Cipher.getInstance("RSA/ECB/OAEPwithSHA-256andMGF1Padding");
         Cipher.getInstance("RSA/ECB/OAEPwithSHA-384andMGF1Padding");
         Cipher.getInstance("RSA/ECB/OAEPwithSHA-512andMGF1Padding");
@@ -88,6 +89,18 @@
         // tests alias works
         testEncryptDecrypt("SHA-1", 16);
 
+        // basic test using SHA-224
+        testEncryptDecrypt("SHA-224", 0);
+        testEncryptDecrypt("SHA-224", 16);
+        testEncryptDecrypt("SHA-224", 38);
+        try {
+            testEncryptDecrypt("SHA-224", 39);
+            throw new Exception("Unexpectedly completed call");
+        } catch (IllegalBlockSizeException e) {
+            // ok
+            System.out.println(e);
+        }
+
         // basic test using SHA-256
         testEncryptDecrypt("SHA-256", 0);
         testEncryptDecrypt("SHA-256", 16);
@@ -195,6 +208,7 @@
         System.out.println("Done (" + (stop - start) + " ms).");
     }
 
+    // NOTE: OAEP can process up to (modLen - 2*digestLen - 2) bytes of data
     private static void testEncryptDecrypt(String hashAlg, int dataLength) throws Exception {
         System.out.println("Testing OAEP with hash " + hashAlg + ", " + dataLength + " bytes");
         Cipher c = Cipher.getInstance("RSA/ECB/OAEPwith" + hashAlg + "andMGF1Padding", cp);
--- a/test/com/sun/crypto/provider/Cipher/RSA/TestOAEPParameterSpec.java	Fri May 25 12:56:22 2012 +0400
+++ b/test/com/sun/crypto/provider/Cipher/RSA/TestOAEPParameterSpec.java	Fri May 25 19:34:32 2012 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 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
@@ -121,6 +121,7 @@
     public static void main(String[] argv) throws Exception {
         boolean status = true;
         byte[] p = { (byte) 0x01, (byte) 0x02, (byte) 0x03, (byte) 0x04 };
+        status &= runTest("SHA-224", MGF1ParameterSpec.SHA224, p);
         status &= runTest("SHA-256", MGF1ParameterSpec.SHA256, p);
         status &= runTest("SHA-384", MGF1ParameterSpec.SHA384, p);
         status &= runTest("SHA-512", MGF1ParameterSpec.SHA512, p);
--- a/test/com/sun/crypto/provider/Cipher/RSA/TestOAEPWithParams.java	Fri May 25 12:56:22 2012 +0400
+++ b/test/com/sun/crypto/provider/Cipher/RSA/TestOAEPWithParams.java	Fri May 25 19:34:32 2012 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 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
@@ -47,10 +47,10 @@
     private static Random random = new Random();
 
     private static String MD[] = {
-        "MD5", "SHA1", "SHA-256"
+        "MD5", "SHA1", "SHA-224", "SHA-256"
     };
     private static int DATA_LENGTH[] = {
-        62, 54, 30
+        62, 54, 34, 30
     };
     public static void main(String[] args) throws Exception {
         long start = System.currentTimeMillis();
--- a/test/com/sun/crypto/provider/KeyGenerator/Test4628062.java	Fri May 25 12:56:22 2012 +0400
+++ b/test/com/sun/crypto/provider/KeyGenerator/Test4628062.java	Fri May 25 19:34:32 2012 -0700
@@ -23,7 +23,7 @@
 
 /*
  * @test
- * @bug 4628062
+ * @bug 4628062 4963723
  * @summary Verify that AES KeyGenerator supports default initialization
  *      when init is not called
  * @author Valerie Peng
@@ -34,39 +34,45 @@
 
 public class Test4628062 {
 
-    private static final String ALGO = "AES";
-    private static final int[] KEYSIZES =
-        { 16, 24, 32 }; // in bytes
+    private static final int[] AES_SIZES = { 16, 24, 32 }; // in bytes
+    private static final int[] HMACSHA224_SIZES = { 28 };
+    private static final int[] HMACSHA256_SIZES = { 32 };
+    private static final int[] HMACSHA384_SIZES = { 48 };
+    private static final int[] HMACSHA512_SIZES = { 64 };
 
-    public boolean execute() throws Exception {
-        KeyGenerator kg = KeyGenerator.getInstance(ALGO, "SunJCE");
+    public boolean execute(String algo, int[] keySizes) throws Exception {
+        KeyGenerator kg = KeyGenerator.getInstance(algo, "SunJCE");
 
         // TEST FIX 4628062
         Key keyWithDefaultSize = kg.generateKey();
         byte[] encoding = keyWithDefaultSize.getEncoded();
-        if (encoding.length == 0) {
+        int defKeyLen = encoding.length ;
+        if (defKeyLen == 0) {
             throw new Exception("default key length is 0!");
+        } else if (defKeyLen != keySizes[0]) {
+            throw new Exception("default key length mismatch!");
         }
 
         // BONUS TESTS
-        // 1. call init(int keysize) with various valid key sizes
-        // and see if the generated key is the right size.
-        for (int i=0; i<KEYSIZES.length; i++) {
-            kg.init(KEYSIZES[i]*8); // in bits
-            Key key = kg.generateKey();
-            if (key.getEncoded().length != KEYSIZES[i]) {
-                throw new Exception("key is generated with the wrong length!");
+        if (keySizes.length > 1) {
+            // 1. call init(int keysize) with various valid key sizes
+            // and see if the generated key is the right size.
+            for (int i=0; i<keySizes.length; i++) {
+                kg.init(keySizes[i]*8); // in bits
+                Key key = kg.generateKey();
+                if (key.getEncoded().length != keySizes[i]) {
+                    throw new Exception("key is generated with the wrong length!");
+                }
+            }
+            // 2. call init(int keysize) with invalid key size and see
+            // if the expected InvalidParameterException is thrown.
+            try {
+                kg.init(keySizes[0]*8+1);
+            } catch (InvalidParameterException ex) {
+            } catch (Exception ex) {
+                throw new Exception("wrong exception is thrown for invalid key size!");
             }
         }
-        // 2. call init(int keysize) with invalid key size and see
-        // if the expected InvalidParameterException is thrown.
-        try {
-            kg.init(KEYSIZES[0]*8+1);
-        } catch (InvalidParameterException ex) {
-        } catch (Exception ex) {
-            throw new Exception("wrong exception is thrown for invalid key size!");
-        }
-
         // passed all tests...hooray!
         return true;
     }
@@ -76,8 +82,20 @@
 
         Test4628062 test = new Test4628062();
         String testName = test.getClass().getName();
-        if (test.execute()) {
-            System.out.println(testName + ": Passed!");
+        if (test.execute("AES", AES_SIZES)) {
+            System.out.println(testName + ": AES Passed!");
+        }
+        if (test.execute("HmacSHA224", HMACSHA224_SIZES)) {
+            System.out.println(testName + ": HmacSHA224 Passed!");
+        }
+        if (test.execute("HmacSHA256", HMACSHA256_SIZES)) {
+            System.out.println(testName + ": HmacSHA256 Passed!");
+        }
+        if (test.execute("HmacSHA384", HMACSHA384_SIZES)) {
+            System.out.println(testName + ": HmacSHA384 Passed!");
+        }
+        if (test.execute("HmacSHA512", HMACSHA512_SIZES)) {
+            System.out.println(testName + ": HmacSHA512 Passed!");
         }
     }
 }
--- a/test/com/sun/crypto/provider/Mac/MacClone.java	Fri May 25 12:56:22 2012 +0400
+++ b/test/com/sun/crypto/provider/Mac/MacClone.java	Fri May 25 19:34:32 2012 -0700
@@ -28,15 +28,33 @@
  * @author Jan Luehe
  */
 import javax.crypto.*;
+import javax.crypto.spec.SecretKeySpec;
 
 public class MacClone {
 
     public static void main(String[] args) throws Exception {
 
+        String[] algos = { "HmacMD5", "HmacSHA1", "HmacSHA224", "HmacSHA256",
+                           "HmacSHA384", "HmacSHA512" };
+        KeyGenerator kgen = KeyGenerator.getInstance("DES");
+        SecretKey skey = kgen.generateKey();
+        for (String algo : algos) {
+            doTest(algo, skey);
+        }
+
+        String[] algos2 = { "HmacPBESHA1" };
+        skey = new SecretKeySpec("whatever".getBytes(), "PBE");
+        for (String algo : algos2) {
+            doTest(algo, skey);
+        }
+        System.out.println("Test Passed");
+    }
+
+    private static void doTest(String algo, SecretKey skey) throws Exception {
         //
-        // Clone uninitialized Mac object
+        // Clone an uninitialized Mac object
         //
-        Mac mac = Mac.getInstance("HmacSHA1", "SunJCE");
+        Mac mac = Mac.getInstance(algo, "SunJCE");
         Mac macClone = (Mac)mac.clone();
         System.out.println(macClone.getProvider().toString());
         System.out.println(macClone.getAlgorithm());
@@ -51,12 +69,9 @@
         }
 
         //
-        // Clone initialized Mac object
+        // Clone an initialized Mac object
         //
-        KeyGenerator kgen = KeyGenerator.getInstance("DES");
-        SecretKey skey = kgen.generateKey();
-
-        mac = Mac.getInstance("HmacSHA1", "SunJCE");
+        mac = Mac.getInstance(algo, "SunJCE");
         mac.init(skey);
         macClone = (Mac)mac.clone();
         System.out.println(macClone.getProvider().toString());
@@ -66,7 +81,20 @@
         byte[] macFinal = mac.doFinal();
         byte[] macCloneFinal = macClone.doFinal();
         if (!java.util.Arrays.equals(macFinal, macCloneFinal)) {
-            throw new Exception("MAC results are different");
-        }
+            throw new Exception("ERROR: MAC result of init clone is different");
+        } else System.out.println("MAC check#1 passed");
+
+        //
+        // Clone an updated Mac object
+        //
+        mac.update((byte)0x12);
+        macClone = (Mac)mac.clone();
+        mac.update((byte)0x34);
+        macClone.update((byte)0x34);
+        macFinal = mac.doFinal();
+        macCloneFinal = macClone.doFinal();
+        if (!java.util.Arrays.equals(macFinal, macCloneFinal)) {
+            throw new Exception("ERROR: MAC result of updated clone is different");
+        } else System.out.println("MAC check#2 passed");
     }
 }
--- a/test/com/sun/crypto/provider/Mac/MacKAT.java	Fri May 25 12:56:22 2012 +0400
+++ b/test/com/sun/crypto/provider/Mac/MacKAT.java	Fri May 25 19:34:32 2012 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 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
@@ -23,7 +23,7 @@
 
 /**
  * @test
- * @bug 4846410 6313661
+ * @bug 4846410 6313661 4963723
  * @summary Basic known-answer-test for Hmac and SslMac algorithms
  * @author Andreas Sterbenz
  */
@@ -147,7 +147,9 @@
     private static Test t(String alg, String input, String macvalue, String key) {
         return new MacTest(alg, b(input), b(macvalue), b(key));
     }
-
+    private static Test t(String alg, String input, String macvalue, byte[] key) {
+        return new MacTest(alg, b(input), b(macvalue), key);
+    }
     private static Test t(String alg, byte[] input, String macvalue, String key) {
         return new MacTest(alg, input, b(macvalue), b(key));
     }
@@ -155,8 +157,8 @@
     private static Test t(String alg, byte[] input, String macvalue, byte[] key) {
         return new MacTest(alg, input, b(macvalue), key);
     }
-
     private final static byte[] ALONG, BLONG, BKEY;
+    private final static byte[] BKEY_20, DDDATA_50, AAKEY_20, CDDATA_50, AAKEY_131;
 
     static {
         ALONG = new byte[1024 * 128];
@@ -166,6 +168,16 @@
         random.nextBytes(BLONG);
         BKEY = new byte[128];
         random.nextBytes(BKEY);
+        BKEY_20 = new byte[20];
+        Arrays.fill(BKEY_20, (byte) 0x0b);
+        DDDATA_50 = new byte[50];
+        Arrays.fill(DDDATA_50, (byte) 0xdd);
+        AAKEY_20 = new byte[20];
+        Arrays.fill(AAKEY_20, (byte) 0xaa);
+        CDDATA_50 = new byte[50];
+        Arrays.fill(CDDATA_50, (byte) 0xcd);
+        AAKEY_131 = new byte[131];
+        Arrays.fill(AAKEY_131, (byte) 0xaa);
     }
 
     private final static Test[] tests = {
@@ -203,15 +215,24 @@
                 "1b:34:61:29:05:0d:73:db:25:d0:dd:64:06:29:f6:8a"),
         t("HmacSHA512", BLONG, "fb:cf:4b:c6:d5:49:5a:5b:0b:d9:2a:32:f5:fa:68:d2:68:a4:0f:ae:53:fc:49:12:e6:1d:53:cf:b2:cb:c5:c5:f2:2d:86:bd:14:61:30:c3:a6:6f:44:1f:77:9b:aa:a1:22:48:a9:dd:d0:45:86:d1:a1:82:53:13:c4:03:06:a3",
                 BKEY),
+        // Test vectors From RFC4231
+        t("HmacSHA224", s("Hi There"), "89:6f:b1:12:8a:bb:df:19:68:32:10:7c:d4:9d:f3:3f:47:b4:b1:16:99:12:ba:4f:53:68:4b:22", BKEY_20),
+        t("HmacSHA224", s("what do ya want for nothing?"), "a3:0e:01:09:8b:c6:db:bf:45:69:0f:3a:7e:9e:6d:0f:8b:be:a2:a3:9e:61:48:00:8f:d0:5e:44", s("Jefe")),
+        t("HmacSHA224", DDDATA_50, "7f:b3:cb:35:88:c6:c1:f6:ff:a9:69:4d:7d:6a:d2:64:93:65:b0:c1:f6:5d:69:d1:ec:83:33:ea", AAKEY_20),
+        t("HmacSHA224", CDDATA_50, "6c:11:50:68:74:01:3c:ac:6a:2a:bc:1b:b3:82:62:7c:ec:6a:90:d8:6e:fc:01:2d:e7:af:ec:5a", "01:02:03:04:05:06:07:08:09:0a:0b:0c:0d:0e:0f:10:11:12:13:14:15:16:17:18:19"),
+        t("HmacSHA224", s("Test Using Larger Than Block-Size Key - Hash Key First"), "95:e9:a0:db:96:20:95:ad:ae:be:9b:2d:6f:0d:bc:e2:d4:99:f1:12:f2:d2:b7:27:3f:a6:87:0e", AAKEY_131),
+        t("HmacSHA224", s("This is a test using a larger than block-size key and a larger than block-size data. The key needs to be hashed before being used by the HMAC algorithm."), "3a:85:41:66:ac:5d:9f:02:3f:54:d5:17:d0:b3:9d:bd:94:67:70:db:9c:2b:95:c9:f6:f5:65:d1", AAKEY_131),
     };
 
     static void runTests(Test[] tests) throws Exception {
         long start = System.currentTimeMillis();
         Provider p = Security.getProvider("SunJCE");
         System.out.println("Testing provider " + p.getName() + "...");
+        Mac.getInstance("HmacSHA224", p);
         Mac.getInstance("HmacSHA256", p);
         Mac.getInstance("HmacSHA384", p);
         Mac.getInstance("HmacSHA512", p);
+        KeyGenerator.getInstance("HmacSHA224", p);
         KeyGenerator.getInstance("HmacSHA256", p);
         KeyGenerator.getInstance("HmacSHA384", p);
         KeyGenerator.getInstance("HmacSHA512", p);
--- a/test/demo/zipfs/ZipFSTester.java	Fri May 25 12:56:22 2012 +0400
+++ b/test/demo/zipfs/ZipFSTester.java	Fri May 25 19:34:32 2012 -0700
@@ -540,6 +540,20 @@
                 bbSrc.flip();
                 bbDst.flip();
             }
+
+            // Check if source read position is at the end
+            if (chSrc.position() != chSrc.size()) {
+                System.out.printf("src[%s]: size=%d, position=%d%n",
+                                  chSrc.toString(), chSrc.size(), chSrc.position());
+                throw new RuntimeException("CHECK FAILED!");
+            }
+
+            // Check if destination read position is at the end
+            if (chDst.position() != chDst.size()) {
+                System.out.printf("dst[%s]: size=%d, position=%d%n",
+                                  chDst.toString(), chDst.size(), chDst.position());
+                throw new RuntimeException("CHECK FAILED!");
+            }
         } catch (IOException x) {
             x.printStackTrace();
         }
@@ -587,6 +601,20 @@
                 dstCh.write(bb);
                 bb.clear();
             }
+
+            // Check if source read position is at the end
+            if (srcCh.position() != srcCh.size()) {
+                System.out.printf("src[%s]: size=%d, position=%d%n",
+                                  srcCh.toString(), srcCh.size(), srcCh.position());
+                throw new RuntimeException("CHECK FAILED!");
+            }
+
+            // Check if destination write position is at the end
+            if (dstCh.position() != dstCh.size()) {
+                System.out.printf("dst[%s]: size=%d, position=%d%n",
+                                  dstCh.toString(), dstCh.size(), dstCh.position());
+                throw new RuntimeException("CHECK FAILED!");
+            }
         }
     }
 
@@ -616,10 +644,17 @@
 
         try (SeekableByteChannel sbc = Files.newByteChannel(path)) {
             System.out.printf("   sbc[0]: pos=%d, size=%d%n", sbc.position(), sbc.size());
+            if (sbc.position() != 0) {
+                throw new RuntimeException("CHECK FAILED!");
+            }
+
             bb = ByteBuffer.allocate((int)sbc.size());
             n = sbc.read(bb);
             System.out.printf("   sbc[1]: read=%d, pos=%d, size=%d%n",
                               n, sbc.position(), sbc.size());
+            if (sbc.position() != sbc.size()) {
+                throw new RuntimeException("CHECK FAILED!");
+            }
             bb2 = ByteBuffer.allocate((int)sbc.size());
         }
 
@@ -629,10 +664,16 @@
             sbc.position(N);
             System.out.printf("   sbc[2]: pos=%d, size=%d%n",
                               sbc.position(), sbc.size());
+            if (sbc.position() != N) {
+                throw new RuntimeException("CHECK FAILED!");
+            }
             bb2.limit(100);
             n = sbc.read(bb2);
             System.out.printf("   sbc[3]: read=%d, pos=%d, size=%d%n",
                               n, sbc.position(), sbc.size());
+            if (n < 0 || sbc.position() != (N + n)) {
+                throw new RuntimeException("CHECK FAILED!");
+            }
             System.out.printf("   sbc[4]: bb[%d]=%d, bb1[0]=%d%n",
                               N, bb.get(N) & 0xff, bb2.get(0) & 0xff);
         }
--- a/test/demo/zipfs/basic.sh	Fri May 25 12:56:22 2012 +0400
+++ b/test/demo/zipfs/basic.sh	Fri May 25 19:34:32 2012 -0700
@@ -22,6 +22,7 @@
 #
 # @test
 # @bug 6990846 7009092 7009085 7015391 7014948 7005986 7017840 7007596
+# 7157656
 # @summary Test ZipFileSystem demo
 # @build Basic PathOps ZipFSTester
 # @run shell basic.sh
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/awt/Dialog/ModalDialogPermission/ModalDialogPermission.java	Fri May 25 19:34:32 2012 -0700
@@ -0,0 +1,60 @@
+/*
+ * 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 java.awt.Dialog;
+import java.awt.Frame;
+import java.util.Timer;
+import java.util.TimerTask;
+
+/*
+  @test
+  @bug 7080109
+  @summary Dialog.show() lacks doPrivileged() to access system event queue.
+  @author sergey.bylokhov@oracle.com: area=awt.dialog
+  @run main/othervm/policy=java.policy -Djava.security.manager ModalDialogPermission
+*/
+public final class ModalDialogPermission {
+
+    public static void main(final String[] args) {
+        Thread.setDefaultUncaughtExceptionHandler(new Thread.UncaughtExceptionHandler() {
+            @Override
+            public void uncaughtException(final Thread t, final Throwable e) {
+                throw new RuntimeException(e);
+            }
+        });
+        final Frame frame = new Frame();
+        final Dialog dialog = new Dialog(frame, "ModalDialog", true);
+        final Timer t = new Timer();
+        t.schedule(new TimerTask() {
+
+            @Override
+            public void run() {
+                dialog.setVisible(false);
+                dialog.dispose();
+            }
+        }, 3000L);
+        dialog.show();
+        frame.dispose();
+        t.cancel();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/awt/Dialog/ModalDialogPermission/java.policy	Fri May 25 19:34:32 2012 -0700
@@ -0,0 +1,3 @@
+grant {
+    permission java.lang.RuntimePermission "setDefaultUncaughtExceptionHandler";
+};
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/awt/Focus/FocusTraversalPolicy/InitialFTP.java	Fri May 25 19:34:32 2012 -0700
@@ -0,0 +1,26 @@
+/*
+  @test
+  @bug       7125044
+  @summary   Tests defaut focus traversal policy in AWT & Swing toplevel windows.
+  @author    anton.tarasov@sun.com: area=awt.focus
+  @run       main InitialFTP_AWT
+  @run       main InitialFTP_Swing
+*/
+
+import java.awt.FocusTraversalPolicy;
+import java.awt.Window;
+
+public class InitialFTP {
+    public static void test(Window win, Class<? extends FocusTraversalPolicy> expectedPolicy) {
+        FocusTraversalPolicy ftp = win.getFocusTraversalPolicy();
+
+        System.out.println("==============" + "\n" +
+                           "Tested window:    " + win + "\n" +
+                           "Expected policy:  " + expectedPolicy + "\n" +
+                           "Effective policy: " + ftp.getClass());
+
+        if (!expectedPolicy.equals(ftp.getClass())) {
+            throw new RuntimeException("Test failed: wrong effective focus policy");
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/awt/Focus/FocusTraversalPolicy/InitialFTP_AWT.java	Fri May 25 19:34:32 2012 -0700
@@ -0,0 +1,50 @@
+/*
+  @bug       7125044
+  @summary   Tests default focus traversal policy in AWT toplevel windows.
+  @author    anton.tarasov@sun.com: area=awt.focus
+*/
+
+import java.awt.Button;
+import java.awt.DefaultFocusTraversalPolicy;
+import java.awt.FlowLayout;
+import java.awt.FocusTraversalPolicy;
+import java.awt.Frame;
+import java.awt.List;
+import java.awt.TextArea;
+import java.awt.Window;
+
+public class InitialFTP_AWT {
+    public static void main(String[] args) {
+        AWTFrame f0 = new AWTFrame("frame0");
+        f0.setVisible(true);
+
+        InitialFTP.test(f0, DefaultFocusTraversalPolicy.class);
+
+        AWTFrame f1 = new AWTFrame("frame1");
+        f1.setVisible(true);
+
+        InitialFTP.test(f1, DefaultFocusTraversalPolicy.class);
+
+        System.out.println("Test passed.");
+    }
+}
+
+class AWTFrame extends Frame {
+    Button button = new Button("button");
+    TextArea text = new TextArea("qwerty");
+    List list = new List();
+
+    public AWTFrame(String title) {
+        super(title);
+
+        list.add("one");
+        list.add("two");
+        list.add("three");
+
+        this.setLayout(new FlowLayout());
+        this.add(button);
+        this.add(text);
+        this.add(list);
+        this.pack();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/awt/Focus/FocusTraversalPolicy/InitialFTP_Swing.java	Fri May 25 19:34:32 2012 -0700
@@ -0,0 +1,46 @@
+/*
+  @bug       7125044
+  @summary   Tests default focus traversal policy in Swing toplevel windows.
+  @author    anton.tarasov@sun.com: area=awt.focus
+*/
+
+import java.awt.FlowLayout;
+import java.awt.FocusTraversalPolicy;
+import java.awt.Window;
+import javax.swing.JButton;
+import javax.swing.JFrame;
+import javax.swing.JList;
+import javax.swing.JTextArea;
+import javax.swing.LayoutFocusTraversalPolicy;
+
+public class InitialFTP_Swing {
+    public static void main(String[] args) {
+        SwingFrame f0 = new SwingFrame("frame0");
+        f0.setVisible(true);
+
+        InitialFTP.test(f0, LayoutFocusTraversalPolicy.class);
+
+        SwingFrame f1 = new SwingFrame("frame1");
+        f1.setVisible(true);
+
+        InitialFTP.test(f1, LayoutFocusTraversalPolicy.class);
+
+        System.out.println("Test passed.");
+    }
+}
+
+class SwingFrame extends JFrame {
+    JButton button = new JButton("button");
+    JTextArea text = new JTextArea("qwerty");
+    JList list = new JList(new String[] {"one", "two", "three"});
+
+    public SwingFrame(String title) {
+        super(title);
+
+        this.setLayout(new FlowLayout());
+        this.add(button);
+        this.add(text);
+        this.add(list);
+        this.pack();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/awt/event/KeyEvent/SwallowKeyEvents/SwallowKeyEvents.java	Fri May 25 19:34:32 2012 -0700
@@ -0,0 +1,100 @@
+/*
+ * 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       7154072
+  @summary   Tests that key events with modifiers are not swallowed.
+  @author    anton.tarasov: area=awt.focus
+  @library   ../../../regtesthelpers
+  @build     Util
+  @run       main SwallowKeyEvents
+*/
+
+import java.awt.AWTException;
+import java.awt.Frame;
+import java.awt.Robot;
+import java.awt.TextField;
+import java.awt.event.KeyAdapter;
+import java.awt.event.KeyEvent;
+import test.java.awt.regtesthelpers.Util;
+
+public class SwallowKeyEvents {
+    static final int PRESS_COUNT = 10;
+
+    static int keyPressedCount = 0;
+
+    static Frame f = new Frame("Frame");
+    static TextField t = new TextField("text");
+    static Robot r;
+
+    public static void main(String[] args) {
+        f.add(t);
+        f.pack();
+        f.setVisible(true);
+
+        t.requestFocus();
+
+        try {
+            r = new Robot();
+        } catch (AWTException ex) {
+            throw new RuntimeException(ex);
+        }
+
+        Util.waitForIdle(r);
+
+        t.addKeyListener(new KeyAdapter() {
+            public void keyPressed(KeyEvent ke) {
+                System.out.println(ke);
+                if (ke.getKeyCode() == KeyEvent.VK_M) {
+                    keyPressedCount++;
+                }
+            }
+        });
+
+        test();
+
+        System.out.println("key_pressed count: " + keyPressedCount);
+
+        if (keyPressedCount != PRESS_COUNT) {
+            throw new RuntimeException("Test failed!");
+        } else {
+            System.out.println("Test passed.");
+        }
+    }
+
+    public static void test() {
+        r.keyPress(KeyEvent.VK_SHIFT);
+        r.keyPress(KeyEvent.VK_META);
+
+        for (int i=0; i<PRESS_COUNT; i++) {
+            r.delay(100);
+            r.keyPress(KeyEvent.VK_M);
+            r.delay(100);
+            r.keyRelease(KeyEvent.VK_M);
+        }
+
+        r.keyRelease(KeyEvent.VK_META);
+        r.keyRelease(KeyEvent.VK_SHIFT);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/net/Inet4Address/PingThis.java	Fri May 25 19:34:32 2012 -0700
@@ -0,0 +1,91 @@
+/*
+ * 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 7163874
+ * @summary InetAddress.isReachable is returning false
+ *          for InetAdress 0.0.0.0 and ::0
+ * @run main PingThis
+ * @run main/othervm -Djava.net.preferIPv4Stack=true PingThis
+ */
+
+import java.net.Inet6Address;
+import java.net.InetAddress;
+import java.net.NetworkInterface;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.Iterator;
+import java.util.List;
+
+public class PingThis {
+    private static boolean hasIPv6() throws Exception {
+        List<NetworkInterface> nics = Collections.list(NetworkInterface
+                .getNetworkInterfaces());
+        for (NetworkInterface nic : nics) {
+            List<InetAddress> addrs = Collections.list(nic.getInetAddresses());
+            for (InetAddress addr : addrs) {
+                if (addr instanceof Inet6Address)
+                    return true;
+            }
+        }
+
+        return false;
+    }
+
+    public static void main(String args[]) throws Exception {
+        if (System.getProperty("os.name").startsWith("Windows")) {
+            return;
+        }
+
+        boolean preferIPv4Stack = "true".equals(System
+                .getProperty("java.net.preferIPv4Stack"));
+        List<String> addrs = new ArrayList<String>();
+        InetAddress inetAddress = null;
+
+        addrs.add("0.0.0.0");
+        if (!preferIPv4Stack) {
+            if (hasIPv6()) {
+                addrs.add("::0");
+            }
+        }
+
+        for (String addr : addrs) {
+            inetAddress = InetAddress.getByName(addr);
+            System.out.println("The target ip is "
+                    + inetAddress.getHostAddress());
+            boolean isReachable = inetAddress.isReachable(3000);
+            System.out.println("the target is reachable: " + isReachable);
+            if (isReachable) {
+                System.out.println("Test passed ");
+            } else {
+                System.out.println("Test failed ");
+                throw new Exception("address " + inetAddress.getHostAddress()
+                        + " can not be reachable!");
+            }
+        }
+    }
+}
--- a/test/java/nio/MappedByteBuffer/Truncate.java	Fri May 25 12:56:22 2012 +0400
+++ b/test/java/nio/MappedByteBuffer/Truncate.java	Fri May 25 19:34:32 2012 -0700
@@ -88,6 +88,11 @@
             }
         };
         Thread t = new Thread(r);
+        t.setUncaughtExceptionHandler(new Thread.UncaughtExceptionHandler() {
+            public void uncaughtException(Thread t, Throwable e) {
+                e.printStackTrace();
+            }
+        });
         t.start();
         try { t.join(); } catch (InterruptedException ignore) { }
     }
--- a/test/java/rmi/activation/checkusage/CheckUsage.java	Fri May 25 12:56:22 2012 +0400
+++ b/test/java/rmi/activation/checkusage/CheckUsage.java	Fri May 25 19:34:32 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/testlibrary/ActivationLibrary.java	Fri May 25 12:56:22 2012 +0400
+++ b/test/java/rmi/testlibrary/ActivationLibrary.java	Fri May 25 19:34:32 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	Fri May 25 12:56:22 2012 +0400
+++ b/test/java/rmi/testlibrary/JavaVM.java	Fri May 25 19:34:32 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) {
+            addOptions(new String[] {"-showversion"});
+        }
+
         StringTokenizer optionsTokenizer = new StringTokenizer(options);
         StringTokenizer argsTokenizer = new StringTokenizer(args);
         int optionsCount = optionsTokenizer.countTokens();
@@ -150,15 +186,43 @@
         vm = Runtime.getRuntime().exec(javaCommand);
 
         /* output from the execed process may optionally be captured. */
-        StreamPipe.plugTogether(vm.getInputStream(), this.outputStream);
-        StreamPipe.plugTogether(vm.getErrorStream(), this.errorStream);
+        StreamPipe.plugTogether(this, vm.getInputStream(), this.outputStream);
+        StreamPipe.plugTogether(this, vm.getErrorStream(), this.errorStream);
 
         try {
-            Thread.sleep(2000);
-        } catch (Exception ignore) {
+            if (forcesOutput) {
+                // Wait distant vm to start, by using waiting time slices of 100 ms.
+                // Wait at most for 2secs, after it considers the vm to be started.
+                final long vmStartSleepTime = 100;
+                final int maxTrials = 20;
+                int numTrials = 0;
+                while (!started && numTrials < maxTrials) {
+                    numTrials++;
+                    Thread.sleep(vmStartSleepTime);
+                }
+
+                // Outputs running status of distant vm
+                String message =
+                    "aft