changeset 9568:82c35c2546a4 jdk8u20-b15

Merge
author lana
date Wed, 14 May 2014 11:00:21 -0700
parents 7071909c7964 def6553ecc32
children d723d05cd17a 1e14ff21ce20 5c6dbbfe11c1
files
diffstat 80 files changed, 2172 insertions(+), 1050 deletions(-) [+]
line wrap: on
line diff
--- a/src/macosx/classes/com/apple/laf/AquaImageFactory.java	Tue May 13 23:18:27 2014 -0700
+++ b/src/macosx/classes/com/apple/laf/AquaImageFactory.java	Wed May 14 11:00:21 2014 -0700
@@ -57,7 +57,7 @@
 
         return new IconUIResource(new AquaIcon.CachingScalingIcon(kAlertIconSize, kAlertIconSize) {
             Image createImage() {
-                return getThisApplicationsIcon(kAlertIconSize, kAlertIconSize);
+                return getGenericJavaIcon();
             }
         });
     }
@@ -83,24 +83,6 @@
         return getAppIconCompositedOn(lockIcon);
     }
 
-    static Image getThisApplicationsIcon(final int width, final int height) {
-        final String path = getPathToThisApplication();
-
-        if (path == null) {
-            return getGenericJavaIcon();
-        }
-
-        if (path.endsWith("/Home/bin")) {
-            return getGenericJavaIcon();
-        }
-
-        if (path.startsWith("/usr/bin")) {
-            return getGenericJavaIcon();
-        }
-
-        return AquaUtils.getCImageCreator().createImageOfFile(path, height, width);
-    }
-
     static Image getGenericJavaIcon() {
         return java.security.AccessController.doPrivileged(new PrivilegedAction<Image>() {
             public Image run() {
@@ -144,7 +126,7 @@
         final Icon smallAppIconScaled = new AquaIcon.CachingScalingIcon(
                 kAlertSubIconSize, kAlertSubIconSize) {
                     Image createImage() {
-                        return getThisApplicationsIcon(kAlertSubIconSize, kAlertSubIconSize);
+                        return getGenericJavaIcon();
                     }
                 };
 
@@ -528,4 +510,4 @@
     public static Color getSelectionInactiveForegroundColorUIResource() {
         return new SystemColorProxy(LWCToolkit.getAppleColor(LWCToolkit.INACTIVE_SELECTION_FOREGROUND_COLOR));
     }
-}
\ No newline at end of file
+}
--- a/src/macosx/native/sun/awt/AWTWindow.m	Tue May 13 23:18:27 2014 -0700
+++ b/src/macosx/native/sun/awt/AWTWindow.m	Wed May 14 11:00:21 2014 -0700
@@ -261,7 +261,8 @@
 
 // returns id for the topmost window under mouse
 + (NSInteger) getTopmostWindowUnderMouseID {
-
+    NSInteger result = -1;
+    
     NSRect screenRect = [[NSScreen mainScreen] frame];
     NSPoint nsMouseLocation = [NSEvent mouseLocation];
     CGPoint cgMouseLocation = CGPointMake(nsMouseLocation.x, screenRect.size.height - nsMouseLocation.y);
@@ -274,11 +275,13 @@
             CGRect rect;
             CGRectMakeWithDictionaryRepresentation((CFDictionaryRef)[window objectForKey:(id)kCGWindowBounds], &rect);
             if (CGRectContainsPoint(rect, cgMouseLocation)) {
-                return [[window objectForKey:(id)kCGWindowNumber] integerValue];
+                result = [[window objectForKey:(id)kCGWindowNumber] integerValue];
+                break;
             }
         }
     }
-    return -1;
+    [windows release];
+    return result;
 }
 
 // checks that this window is under the mouse cursor and this point is not overlapped by others windows
--- a/src/macosx/native/sun/awt/CGraphicsDevice.m	Tue May 13 23:18:27 2014 -0700
+++ b/src/macosx/native/sun/awt/CGraphicsDevice.m	Wed May 14 11:00:21 2014 -0700
@@ -66,7 +66,8 @@
             CFArrayAppendValue(validModes, cRef);
         }
     }
-
+    CFRelease(allModes);
+    
     CGDisplayModeRef currentMode = CGDisplayCopyDisplayMode(displayID);
 
     BOOL containsCurrentMode = NO;
@@ -81,6 +82,7 @@
     if (!containsCurrentMode) {
         CFArrayAppendValue(validModes, currentMode);
     }
+    CGDisplayModeRelease(currentMode);
 
     return validModes;
 }
@@ -235,17 +237,19 @@
 {
     JNF_COCOA_ENTER(env);
     CFArrayRef allModes = getAllValidDisplayModes(displayID);
-
     CGDisplayModeRef closestMatch = getBestModeForParameters(allModes, (int)w, (int)h, (int)bpp, (int)refrate);
+    
     __block CGError retCode = kCGErrorSuccess;
     if (closestMatch != NULL) {
-        [JNFRunLoop performOnMainThreadWaiting:YES withBlock:^(){
+        CGDisplayModeRetain(closestMatch);
+        [ThreadUtilities performOnMainThreadWaiting:YES block:^(){
             CGDisplayConfigRef config;
             retCode = CGBeginDisplayConfiguration(&config);
             if (retCode == kCGErrorSuccess) {
                 CGConfigureDisplayWithDisplayMode(config, displayID, closestMatch, NULL);
                 retCode = CGCompleteDisplayConfiguration(config, kCGConfigureForAppOnly);
             }
+            CGDisplayModeRelease(closestMatch);
         }];
     } else {
         [JNFException raise:env as:kIllegalArgumentException reason:"Invalid display mode"];
@@ -253,8 +257,7 @@
 
     if (retCode != kCGErrorSuccess){
         [JNFException raise:env as:kIllegalArgumentException reason:"Unable to set display mode!"];
-    }    
-
+    }
     CFRelease(allModes);
     JNF_COCOA_EXIT(env);
 }
--- a/src/share/classes/com/sun/accessibility/internal/resources/accessibility_de.properties	Tue May 13 23:18:27 2014 -0700
+++ b/src/share/classes/com/sun/accessibility/internal/resources/accessibility_de.properties	Wed May 14 11:00:21 2014 -0700
@@ -17,7 +17,7 @@
 awtcomponent=AWT-Komponente
 checkbox=Kontrollk\u00E4stchen
 colorchooser=Farbauswahl
-columnheader=Spalten-Header
+columnheader=Spaltenheader
 combobox=Kombinationsfeld
 canvas=Leinwand
 desktopicon=Desktopsymbol
@@ -46,7 +46,7 @@
 pushbutton=Schaltfl\u00E4che
 radiobutton=Optionsfeld
 rootpane=Root-Bereich
-rowheader=Zeilen-Header
+rowheader=Zeilenheader
 scrollbar=Bildlaufleiste
 scrollpane=Bildlaufbereich
 separator=Trennzeichen
--- a/src/share/classes/com/sun/crypto/provider/RSACipher.java	Tue May 13 23:18:27 2014 -0700
+++ b/src/share/classes/com/sun/crypto/provider/RSACipher.java	Wed May 14 11:00:21 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2014, 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,6 +39,8 @@
 
 import sun.security.rsa.*;
 import sun.security.jca.Providers;
+import sun.security.internal.spec.TlsRsaPremasterSecretParameterSpec;
+import sun.security.util.KeyUtil;
 
 /**
  * RSA cipher implementation. Supports RSA en/decryption and signing/verifying
@@ -91,8 +93,8 @@
     // padding object
     private RSAPadding padding;
 
-    // cipher parameter for OAEP padding
-    private OAEPParameterSpec spec = null;
+    // cipher parameter for OAEP padding and TLS RSA premaster secret
+    private AlgorithmParameterSpec spec = null;
 
     // buffer for the data
     private byte[] buffer;
@@ -110,6 +112,9 @@
     // hash algorithm for OAEP
     private String oaepHashAlgorithm = "SHA-1";
 
+    // the source of randomness
+    private SecureRandom random;
+
     public RSACipher() {
         paddingType = PAD_PKCS1;
     }
@@ -175,7 +180,7 @@
 
     // see JCE spec
     protected AlgorithmParameters engineGetParameters() {
-        if (spec != null) {
+        if (spec != null && spec instanceof OAEPParameterSpec) {
             try {
                 AlgorithmParameters params =
                     AlgorithmParameters.getInstance("OAEP",
@@ -276,8 +281,13 @@
             buffer = new byte[n];
         } else if (paddingType == PAD_PKCS1) {
             if (params != null) {
-                throw new InvalidAlgorithmParameterException
-                ("Parameters not supported");
+                if (!(params instanceof TlsRsaPremasterSecretParameterSpec)) {
+                    throw new InvalidAlgorithmParameterException(
+                            "Parameters not supported");
+                }
+
+                spec = params;
+                this.random = random;   // for TLS RSA premaster secret
             }
             int blockType = (mode <= MODE_DECRYPT) ? RSAPadding.PAD_BLOCKTYPE_2
                                                    : RSAPadding.PAD_BLOCKTYPE_1;
@@ -293,19 +303,18 @@
                 throw new InvalidKeyException
                         ("OAEP cannot be used to sign or verify signatures");
             }
-            OAEPParameterSpec myParams;
             if (params != null) {
                 if (!(params instanceof OAEPParameterSpec)) {
                     throw new InvalidAlgorithmParameterException
                         ("Wrong Parameters for OAEP Padding");
                 }
-                myParams = (OAEPParameterSpec) params;
+                spec = params;
             } else {
-                myParams = new OAEPParameterSpec(oaepHashAlgorithm, "MGF1",
+                spec = new OAEPParameterSpec(oaepHashAlgorithm, "MGF1",
                     MGF1ParameterSpec.SHA1, PSource.PSpecified.DEFAULT);
             }
             padding = RSAPadding.getInstance(RSAPadding.PAD_OAEP_MGF1, n,
-                random, myParams);
+                random, (OAEPParameterSpec)spec);
             if (encrypt) {
                 int k = padding.getMaxDataSize();
                 buffer = new byte[k];
@@ -420,17 +429,40 @@
         if (wrappedKey.length > buffer.length) {
             throw new InvalidKeyException("Key is too long for unwrapping");
         }
+
+        boolean isTlsRsaPremasterSecret =
+                algorithm.equals("TlsRsaPremasterSecret");
+        Exception failover = null;
+        byte[] encoded = null;
+
         update(wrappedKey, 0, wrappedKey.length);
         try {
-            byte[] encoded = doFinal();
-            return ConstructKeys.constructKey(encoded, algorithm, type);
+            encoded = doFinal();
         } catch (BadPaddingException e) {
-            // should not occur
-            throw new InvalidKeyException("Unwrapping failed", e);
+            if (isTlsRsaPremasterSecret) {
+                failover = e;
+            } else {
+                throw new InvalidKeyException("Unwrapping failed", e);
+            }
         } catch (IllegalBlockSizeException e) {
             // should not occur, handled with length check above
             throw new InvalidKeyException("Unwrapping failed", e);
         }
+
+        if (isTlsRsaPremasterSecret) {
+            if (!(spec instanceof TlsRsaPremasterSecretParameterSpec)) {
+                throw new IllegalStateException(
+                        "No TlsRsaPremasterSecretParameterSpec specified");
+            }
+
+            // polish the TLS premaster secret
+            encoded = KeyUtil.checkTlsPreMasterSecretKey(
+                ((TlsRsaPremasterSecretParameterSpec)spec).getClientVersion(),
+                ((TlsRsaPremasterSecretParameterSpec)spec).getServerVersion(),
+                random, encoded, (failover != null));
+        }
+
+        return ConstructKeys.constructKey(encoded, algorithm, type);
     }
 
     // see JCE spec
@@ -438,5 +470,4 @@
         RSAKey rsaKey = RSAKeyFactory.toRSAKey(key);
         return rsaKey.getModulus().bitLength();
     }
-
 }
--- a/src/share/classes/com/sun/crypto/provider/TlsRsaPremasterSecretGenerator.java	Tue May 13 23:18:27 2014 -0700
+++ b/src/share/classes/com/sun/crypto/provider/TlsRsaPremasterSecretGenerator.java	Wed May 14 11:00:21 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2014, 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
@@ -56,7 +56,7 @@
 
     protected void engineInit(AlgorithmParameterSpec params,
             SecureRandom random) throws InvalidAlgorithmParameterException {
-        if (params instanceof TlsRsaPremasterSecretParameterSpec == false) {
+        if (!(params instanceof TlsRsaPremasterSecretParameterSpec)) {
             throw new InvalidAlgorithmParameterException(MSG);
         }
         this.spec = (TlsRsaPremasterSecretParameterSpec)params;
@@ -67,21 +67,20 @@
         throw new InvalidParameterException(MSG);
     }
 
+    // Only can be used in client side to generate TLS RSA premaster secret.
     protected SecretKey engineGenerateKey() {
         if (spec == null) {
             throw new IllegalStateException(
                 "TlsRsaPremasterSecretGenerator must be initialized");
         }
-        byte[] b = spec.getEncodedSecret();
-        if (b == null) {
-            if (random == null) {
-                random = new SecureRandom();
-            }
-            b = new byte[48];
-            random.nextBytes(b);
-            b[0] = (byte)spec.getMajorVersion();
-            b[1] = (byte)spec.getMinorVersion();
+
+        if (random == null) {
+            random = new SecureRandom();
         }
+        byte[] b = new byte[48];
+        random.nextBytes(b);
+        b[0] = (byte)spec.getMajorVersion();
+        b[1] = (byte)spec.getMinorVersion();
 
         return new SecretKeySpec(b, "TlsRsaPremasterSecret");
     }
--- a/src/share/classes/com/sun/java/swing/plaf/windows/resources/windows_fr.properties	Tue May 13 23:18:27 2014 -0700
+++ b/src/share/classes/com/sun/java/swing/plaf/windows/resources/windows_fr.properties	Wed May 14 11:00:21 2014 -0700
@@ -25,8 +25,8 @@
 FileChooser.filesOfTypeLabel.textAndMnemonic=&Type de fichier :
 FileChooser.upFolderToolTip.textAndMnemonic=Remonte d'un niveau.
 FileChooser.upFolderAccessibleName=Monter
-FileChooser.homeFolderToolTip.textAndMnemonic=R\u00E9pertoire d'origine
-FileChooser.homeFolderAccessibleName=R\u00E9pertoire d'origine
+FileChooser.homeFolderToolTip.textAndMnemonic=R\u00E9pertoire de base
+FileChooser.homeFolderAccessibleName=R\u00E9pertoire de base
 FileChooser.newFolderToolTip.textAndMnemonic=Cr\u00E9e un dossier.
 FileChooser.newFolderAccessibleName=Nouveau dossier
 FileChooser.newFolderActionLabel.textAndMnemonic=Nouveau dossier
--- a/src/share/classes/com/sun/java/swing/plaf/windows/resources/windows_sv.properties	Tue May 13 23:18:27 2014 -0700
+++ b/src/share/classes/com/sun/java/swing/plaf/windows/resources/windows_sv.properties	Wed May 14 11:00:21 2014 -0700
@@ -22,7 +22,7 @@
 FileChooser.saveInLabel.textAndMnemonic=Spara i:
 FileChooser.fileNameLabel.textAndMnemonic=Fil&namn:
 FileChooser.folderNameLabel.textAndMnemonic=Mapp&namn:
-FileChooser.filesOfTypeLabel.textAndMnemonic=Filer av &typ:
+FileChooser.filesOfTypeLabel.textAndMnemonic=Filer av &typen:
 FileChooser.upFolderToolTip.textAndMnemonic=Upp en niv\u00E5
 FileChooser.upFolderAccessibleName=Upp
 FileChooser.homeFolderToolTip.textAndMnemonic=Hem
--- a/src/share/classes/com/sun/java/util/jar/pack/DriverResource_zh_CN.java	Tue May 13 23:18:27 2014 -0700
+++ b/src/share/classes/com/sun/java/util/jar/pack/DriverResource_zh_CN.java	Wed May 14 11:00:21 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2014, 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
@@ -48,7 +48,7 @@
      * Do not translate command arguments and words with a prefix of '-' or '--'.
      */
     private static final Object[][] resource = {
-        {VERSION, "{0}\u7248\u672C{1}"}, // parameter 0:class name;parameter 1: version value
+        {VERSION, "{0}\u7248\u672C {1}"}, // parameter 0:class name;parameter 1: version value
         {BAD_ARGUMENT, "\u9519\u8BEF\u53C2\u6570: {0}"},
         {BAD_OPTION, "\u9519\u8BEF\u9009\u9879: {0}={1}"}, // parameter 0:option name;parameter 1:option value
         {BAD_REPACK_OUTPUT, "--repack \u8F93\u51FA\u9519\u8BEF: {0}"}, // parameter 0:filename
--- a/src/share/classes/com/sun/rowset/RowSetResourceBundle_de.properties	Tue May 13 23:18:27 2014 -0700
+++ b/src/share/classes/com/sun/rowset/RowSetResourceBundle_de.properties	Wed May 14 11:00:21 2014 -0700
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2005, 2014, 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
@@ -140,7 +140,7 @@
 #WebRowSetXmlReader exception
 wrsxmlreader.invalidcp = Ende von RowSet wurde erreicht. Ung\u00FCltige Cursorposition
 wrsxmlreader.readxml = readXML: {0}
-wrsxmlreader.parseerr = ** Parsing-Fehler: {0}, Zeile: {1} , URI: {2}
+wrsxmlreader.parseerr = ** Parsingfehler: {0}, Zeile: {1} , URI: {2}
 
 #WebRowSetXmlWriter exceptions
 wrsxmlwriter.ioex = IOException: {0}
--- a/src/share/classes/com/sun/rowset/RowSetResourceBundle_ja.properties	Tue May 13 23:18:27 2014 -0700
+++ b/src/share/classes/com/sun/rowset/RowSetResourceBundle_ja.properties	Wed May 14 11:00:21 2014 -0700
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2005, 2014, 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
@@ -51,8 +51,8 @@
 cachedrowsetimpl.last = last: TYPE_FORWARD_ONLY
 cachedrowsetimpl.absolute = absolute: \u7121\u52B9\u306A\u30AB\u30FC\u30BD\u30EB\u4F4D\u7F6E
 cachedrowsetimpl.relative = relative: \u7121\u52B9\u306A\u30AB\u30FC\u30BD\u30EB\u4F4D\u7F6E
-cachedrowsetimpl.asciistream = ascii\u30B9\u30C8\u30EA\u30FC\u30E0\u306E\u8AAD\u8FBC\u307F\u306B\u5931\u6557\u3057\u307E\u3057\u305F
-cachedrowsetimpl.binstream = \u30D0\u30A4\u30CA\u30EA\u30FB\u30B9\u30C8\u30EA\u30FC\u30E0\u306E\u8AAD\u8FBC\u307F\u306B\u5931\u6557\u3057\u307E\u3057\u305F
+cachedrowsetimpl.asciistream = ascii\u30B9\u30C8\u30EA\u30FC\u30E0\u306E\u8AAD\u8FBC\u307F\u304C\u5931\u6557\u3057\u307E\u3057\u305F
+cachedrowsetimpl.binstream = \u30D0\u30A4\u30CA\u30EA\u30FB\u30B9\u30C8\u30EA\u30FC\u30E0\u306E\u8AAD\u8FBC\u307F\u304C\u5931\u6557\u3057\u307E\u3057\u305F
 cachedrowsetimpl.failedins = \u884C\u306E\u633F\u5165\u306B\u5931\u6557
 cachedrowsetimpl.updateins = \u633F\u5165\u884C\u306B\u304A\u3044\u3066updateRow\u304C\u547C\u3073\u51FA\u3055\u308C\u307E\u3057\u305F
 cachedrowsetimpl.movetoins = moveToInsertRow: CONCUR_READ_ONLY
@@ -101,7 +101,7 @@
 
 #JdbcRowSetImpl exceptions
 jdbcrowsetimpl.invalstate = \u7121\u52B9\u306A\u72B6\u614B
-jdbcrowsetimpl.connect = JdbcRowSet(connect): JNDI\u304C\u63A5\u7D9A\u3067\u304D\u307E\u305B\u3093
+jdbcrowsetimpl.connect = JdbcRowSet (connect): JNDI\u304C\u63A5\u7D9A\u3067\u304D\u307E\u305B\u3093
 jdbcrowsetimpl.paramtype = \u30D1\u30E9\u30E1\u30FC\u30BF\u30FB\u30BF\u30A4\u30D7\u3092\u63A8\u5B9A\u3067\u304D\u307E\u305B\u3093
 jdbcrowsetimpl.matchcols = \u4E00\u81F4\u5217\u304C\u5217\u306E\u30BB\u30C3\u30C8\u3068\u540C\u3058\u3067\u306F\u3042\u308A\u307E\u305B\u3093
 jdbcrowsetimpl.setmatchcols = \u4E00\u81F4\u5217\u3092\u53D6\u5F97\u3059\u308B\u524D\u306B\u8A2D\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044
--- a/src/share/classes/com/sun/rowset/RowSetResourceBundle_pt_BR.properties	Tue May 13 23:18:27 2014 -0700
+++ b/src/share/classes/com/sun/rowset/RowSetResourceBundle_pt_BR.properties	Wed May 14 11:00:21 2014 -0700
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2005, 2014, 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
@@ -153,7 +153,7 @@
 xmlrch.errmetadata = Erro ao definir metadados : {0}
 xmlrch.errinsertval = Erro ao inserir valores : {0}
 xmlrch.errconstr = Erro ao construir a linha : {0}
-xmlrch.errdel = Erro ao deletar a linha : {0}
+xmlrch.errdel = Erro ao excluir a linha : {0}
 xmlrch.errinsert = Erro ao construir a linha de inser\u00E7\u00E3o : {0}
 xmlrch.errinsdel = Erro ao construir a linha insdel : {0}
 xmlrch.errupdate = Erro ao construir a linha de atualiza\u00E7\u00E3o : {0}
--- a/src/share/classes/com/sun/rowset/RowSetResourceBundle_sv.properties	Tue May 13 23:18:27 2014 -0700
+++ b/src/share/classes/com/sun/rowset/RowSetResourceBundle_sv.properties	Wed May 14 11:00:21 2014 -0700
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2005, 2014, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -29,11 +29,11 @@
 cachedrowsetimpl.nullhash = Kan inte instansiera CachedRowSetImpl. Null-hashtabell skickades till konstruktor
 cachedrowsetimpl.invalidop = En ogiltig \u00E5tg\u00E4rd utf\u00F6rdes p\u00E5 infogad rad
 cachedrowsetimpl.accfailed = acceptChanges utf\u00F6rdes inte
-cachedrowsetimpl.invalidcp = Mark\u00F6rpositionen \u00E4r ogiltig
+cachedrowsetimpl.invalidcp = Ogiltigt mark\u00F6rl\u00E4ge
 cachedrowsetimpl.illegalop = En otill\u00E5ten \u00E5tg\u00E4rd utf\u00F6rdes p\u00E5 en icke infogad rad
 cachedrowsetimpl.clonefail = Kloningen utf\u00F6rdes inte: {0}
-cachedrowsetimpl.invalidcol = Kolumnindexet \u00E4r ogiltigt
-cachedrowsetimpl.invalcolnm = Kolumnnamnet \u00E4r ogiltigt
+cachedrowsetimpl.invalidcol = Ogiltigt kolumnindex
+cachedrowsetimpl.invalcolnm = Ogiltigt kolumnnamn
 cachedrowsetimpl.boolfail = getBoolen utf\u00F6rdes inte f\u00F6r v\u00E4rdet ({0}) i kolumnen {1}
 cachedrowsetimpl.bytefail = getByte utf\u00F6rdes inte f\u00F6r v\u00E4rdet ({0}) i kolumnen {1}
 cachedrowsetimpl.shortfail = getShort utf\u00F6rdes inte f\u00F6r v\u00E4rdet ({0}) i kolumnen {1}
@@ -60,7 +60,7 @@
 cachedrowsetimpl.movetoins2 = moveToInsertRow: ogiltigt antal kolumner
 cachedrowsetimpl.tablename = Tabellnamnet kan inte vara null
 cachedrowsetimpl.keycols = Ogiltiga nyckelkolumner
-cachedrowsetimpl.invalidcol = Kolumnindexet \u00E4r ogiltigt
+cachedrowsetimpl.invalidcol = Ogiltigt kolumnindex
 cachedrowsetimpl.opnotsupp = Databasen har inte st\u00F6d f\u00F6r denna \u00E5tg\u00E4rd
 cachedrowsetimpl.matchcols = Matchningskolumnerna \u00E4r inte samma som de som st\u00E4llts in
 cachedrowsetimpl.setmatchcols = St\u00E4ll in matchningskolumnerna innan du h\u00E4mtar dem
@@ -81,7 +81,7 @@
 
 # WebRowSetImpl exceptions
 webrowsetimpl.nullhash = Kan inte instansiera WebRowSetImpl. Null-hashtabell skickades till konstruktor.
-webrowsetimpl.invalidwr = Ogiltig f\u00F6rfattare
+webrowsetimpl.invalidwr = Ogiltig skrivfunktion
 webrowsetimpl.invalidrd = Ogiltig l\u00E4sare
 
 #FilteredRowSetImpl exceptions
--- a/src/share/classes/com/sun/swing/internal/plaf/metal/resources/metal_fr.properties	Tue May 13 23:18:27 2014 -0700
+++ b/src/share/classes/com/sun/swing/internal/plaf/metal/resources/metal_fr.properties	Wed May 14 11:00:21 2014 -0700
@@ -25,8 +25,8 @@
 FileChooser.filesOfTypeLabel.textAndMnemonic=&Type de fichier :
 FileChooser.upFolderToolTip.textAndMnemonic=Remonte d'un niveau.
 FileChooser.upFolderAccessibleName=Monter
-FileChooser.homeFolderToolTip.textAndMnemonic=R\u00E9pertoire d'origine
-FileChooser.homeFolderAccessibleName=R\u00E9pertoire d'origine
+FileChooser.homeFolderToolTip.textAndMnemonic=R\u00E9pertoire de base
+FileChooser.homeFolderAccessibleName=R\u00E9pertoire de base
 FileChooser.newFolderToolTip.textAndMnemonic=Cr\u00E9e un dossier.
 FileChooser.newFolderAccessibleName=Nouveau dossier
 FileChooser.newFolderActionLabel.textAndMnemonic=Nouveau dossier
--- a/src/share/classes/com/sun/swing/internal/plaf/metal/resources/metal_sv.properties	Tue May 13 23:18:27 2014 -0700
+++ b/src/share/classes/com/sun/swing/internal/plaf/metal/resources/metal_sv.properties	Wed May 14 11:00:21 2014 -0700
@@ -22,7 +22,7 @@
 FileChooser.saveInLabel.textAndMnemonic=Spara i:
 FileChooser.fileNameLabel.textAndMnemonic=&Fil:
 FileChooser.folderNameLabel.textAndMnemonic=&Mapp:
-FileChooser.filesOfTypeLabel.textAndMnemonic=Mapp&namn:
+FileChooser.filesOfTypeLabel.textAndMnemonic=Filer av &typen:
 FileChooser.upFolderToolTip.textAndMnemonic=Upp en niv\u00E5
 FileChooser.upFolderAccessibleName=Upp
 FileChooser.homeFolderToolTip.textAndMnemonic=Hem
--- a/src/share/classes/com/sun/swing/internal/plaf/synth/resources/synth_fr.properties	Tue May 13 23:18:27 2014 -0700
+++ b/src/share/classes/com/sun/swing/internal/plaf/synth/resources/synth_fr.properties	Wed May 14 11:00:21 2014 -0700
@@ -25,8 +25,8 @@
 FileChooser.filesOfTypeLabel.textAndMnemonic=&Type de fichier :
 FileChooser.upFolderToolTip.textAndMnemonic=Remonte d'un niveau.
 FileChooser.upFolderAccessibleName=Monter
-FileChooser.homeFolderToolTip.textAndMnemonic=R\u00E9pertoire d'origine
-FileChooser.homeFolderAccessibleName=R\u00E9pertoire d'origine
+FileChooser.homeFolderToolTip.textAndMnemonic=R\u00E9pertoire de base
+FileChooser.homeFolderAccessibleName=R\u00E9pertoire de base
 FileChooser.newFolderToolTip.textAndMnemonic=Cr\u00E9e un dossier.
 FileChooser.newFolderAccessibleName=Nouveau dossier
 FileChooser.newFolderActionLabel.textAndMnemonic=Nouveau dossier
--- a/src/share/classes/com/sun/swing/internal/plaf/synth/resources/synth_sv.properties	Tue May 13 23:18:27 2014 -0700
+++ b/src/share/classes/com/sun/swing/internal/plaf/synth/resources/synth_sv.properties	Wed May 14 11:00:21 2014 -0700
@@ -22,7 +22,7 @@
 FileChooser.saveInLabel.textAndMnemonic=Spara i:
 FileChooser.fileNameLabel.textAndMnemonic=Fil&namn:
 FileChooser.folderNameLabel.textAndMnemonic=Mapp&namn:
-FileChooser.filesOfTypeLabel.textAndMnemonic=Filer av &typ:
+FileChooser.filesOfTypeLabel.textAndMnemonic=Filer av &typen:
 FileChooser.upFolderToolTip.textAndMnemonic=Upp en niv\u00E5
 FileChooser.upFolderAccessibleName=Upp
 FileChooser.homeFolderToolTip.textAndMnemonic=Hem
--- a/src/share/classes/com/sun/tools/jdi/resources/jdi_ja.properties	Tue May 13 23:18:27 2014 -0700
+++ b/src/share/classes/com/sun/tools/jdi/resources/jdi_ja.properties	Wed May 14 11:00:21 2014 -0700
@@ -47,6 +47,6 @@
 memory_listening.name = VM\u3078\u306E\u63A5\u7D9A\u3092\u30EA\u30B9\u30CB\u30F3\u30B0\u3059\u308B\u305F\u3081\u306E\u5171\u6709\u30E1\u30E2\u30EA\u30FC\u9818\u57DF\u540D
 memory_listening.name.label = \u540D\u524D
 memory_listening.description = \u305D\u306E\u4ED6\u306EVM\u306B\u3088\u308A\u958B\u59CB\u3055\u308C\u308B\u5171\u6709\u30E1\u30E2\u30EA\u30FC\u63A5\u7D9A\u3092\u53D7\u3051\u5165\u308C\u307E\u3059
-process_attaching.description = \u30C7\u30D0\u30C3\u30B0\u3059\u308B\u30D7\u30ED\u30BB\u30B9\u306B\u30D7\u30ED\u30BB\u30B9ID(pid)\u3092\u4F7F\u7528\u3057\u3066\u63A5\u7D9A\u3057\u307E\u3059
+process_attaching.description = \u30C7\u30D0\u30C3\u30B0\u3059\u308B\u30D7\u30ED\u30BB\u30B9\u306B\u30D7\u30ED\u30BB\u30B9ID (pid)\u3092\u4F7F\u7528\u3057\u3066\u63A5\u7D9A\u3057\u307E\u3059
 process_attaching.pid = pid
-process_attaching.pid.label = \u30C7\u30D0\u30C3\u30B0\u3059\u308B\u30D7\u30ED\u30BB\u30B9ID(pid)
+process_attaching.pid.label = \u30C7\u30D0\u30C3\u30B0\u3059\u308B\u30D7\u30ED\u30BB\u30B9ID (pid)
--- a/src/share/classes/java/nio/file/Files.java	Tue May 13 23:18:27 2014 -0700
+++ b/src/share/classes/java/nio/file/Files.java	Wed May 14 11:00:21 2014 -0700
@@ -752,9 +752,12 @@
         }
         if (parent == null) {
             // unable to find existing parent
-            if (se != null)
+            if (se == null) {
+                throw new FileSystemException(dir.toString(), null,
+                    "Unable to determine if root directory exists");
+            } else {
                 throw se;
-            throw new IOException("Root directory does not exist");
+            }
         }
 
         // create directories
--- a/src/share/classes/java/util/Locale.java	Tue May 13 23:18:27 2014 -0700
+++ b/src/share/classes/java/util/Locale.java	Wed May 14 11:00:21 2014 -0700
@@ -2905,8 +2905,8 @@
                 for (int i = 1; i < subtags.length; i++) {
                     if (isSubtagIllFormed(subtags[i], false)) {
                         isIllFormed = true;
+                        break;
                     }
-                    break;
                 }
             }
             if (isIllFormed) {
--- a/src/share/classes/java/util/stream/SortedOps.java	Tue May 13 23:18:27 2014 -0700
+++ b/src/share/classes/java/util/stream/SortedOps.java	Wed May 14 11:00:21 2014 -0700
@@ -278,16 +278,60 @@
     }
 
     /**
+     * Abstract {@link Sink} for implementing sort on reference streams.
+     *
+     * <p>
+     * Note: documentation below applies to reference and all primitive sinks.
+     * <p>
+     * Sorting sinks first accept all elements, buffering then into an array
+     * or a re-sizable data structure, if the size of the pipeline is known or
+     * unknown respectively.  At the end of the sink protocol those elements are
+     * sorted and then pushed downstream.
+     * This class records if {@link #cancellationRequested} is called.  If so it
+     * can be inferred that the source pushing source elements into the pipeline
+     * knows that the pipeline is short-circuiting.  In such cases sub-classes
+     * pushing elements downstream will preserve the short-circuiting protocol
+     * by calling {@code downstream.cancellationRequested()} and checking the
+     * result is {@code false} before an element is pushed.
+     * <p>
+     * Note that the above behaviour is an optimization for sorting with
+     * sequential streams.  It is not an error that more elements, than strictly
+     * required to produce a result, may flow through the pipeline.  This can
+     * occur, in general (not restricted to just sorting), for short-circuiting
+     * parallel pipelines.
+     */
+    private static abstract class AbstractRefSortingSink<T> extends Sink.ChainedReference<T, T> {
+        protected final Comparator<? super T> comparator;
+        // @@@ could be a lazy final value, if/when support is added
+        protected boolean cancellationWasRequested;
+
+        AbstractRefSortingSink(Sink<? super T> downstream, Comparator<? super T> comparator) {
+            super(downstream);
+            this.comparator = comparator;
+        }
+
+        /**
+         * Records is cancellation is requested so short-circuiting behaviour
+         * can be preserved when the sorted elements are pushed downstream.
+         *
+         * @return false, as this sink never short-circuits.
+         */
+        @Override
+        public final boolean cancellationRequested() {
+            cancellationWasRequested = true;
+            return false;
+        }
+    }
+
+    /**
      * {@link Sink} for implementing sort on SIZED reference streams.
      */
-    private static final class SizedRefSortingSink<T> extends Sink.ChainedReference<T, T> {
-        private final Comparator<? super T> comparator;
+    private static final class SizedRefSortingSink<T> extends AbstractRefSortingSink<T> {
         private T[] array;
         private int offset;
 
         SizedRefSortingSink(Sink<? super T> sink, Comparator<? super T> comparator) {
-            super(sink);
-            this.comparator = comparator;
+            super(sink, comparator);
         }
 
         @Override
@@ -301,8 +345,14 @@
         public void end() {
             Arrays.sort(array, 0, offset, comparator);
             downstream.begin(offset);
-            for (int i = 0; i < offset; i++)
-                downstream.accept(array[i]);
+            if (!cancellationWasRequested) {
+                for (int i = 0; i < offset; i++)
+                    downstream.accept(array[i]);
+            }
+            else {
+                for (int i = 0; i < offset && !downstream.cancellationRequested(); i++)
+                    downstream.accept(array[i]);
+            }
             downstream.end();
             array = null;
         }
@@ -316,13 +366,11 @@
     /**
      * {@link Sink} for implementing sort on reference streams.
      */
-    private static final class RefSortingSink<T> extends Sink.ChainedReference<T, T> {
-        private final Comparator<? super T> comparator;
+    private static final class RefSortingSink<T> extends AbstractRefSortingSink<T> {
         private ArrayList<T> list;
 
         RefSortingSink(Sink<? super T> sink, Comparator<? super T> comparator) {
-            super(sink);
-            this.comparator = comparator;
+            super(sink, comparator);
         }
 
         @Override
@@ -336,7 +384,15 @@
         public void end() {
             list.sort(comparator);
             downstream.begin(list.size());
-            list.forEach(downstream::accept);
+            if (!cancellationWasRequested) {
+                list.forEach(downstream::accept);
+            }
+            else {
+                for (T t : list) {
+                    if (downstream.cancellationRequested()) break;
+                    downstream.accept(t);
+                }
+            }
             downstream.end();
             list = null;
         }
@@ -348,9 +404,26 @@
     }
 
     /**
+     * Abstract {@link Sink} for implementing sort on int streams.
+     */
+    private static abstract class AbstractIntSortingSink extends Sink.ChainedInt<Integer> {
+        protected boolean cancellationWasRequested;
+
+        AbstractIntSortingSink(Sink<? super Integer> downstream) {
+            super(downstream);
+        }
+
+        @Override
+        public final boolean cancellationRequested() {
+            cancellationWasRequested = true;
+            return false;
+        }
+    }
+
+    /**
      * {@link Sink} for implementing sort on SIZED int streams.
      */
-    private static final class SizedIntSortingSink extends Sink.ChainedInt<Integer> {
+    private static final class SizedIntSortingSink extends AbstractIntSortingSink {
         private int[] array;
         private int offset;
 
@@ -369,8 +442,14 @@
         public void end() {
             Arrays.sort(array, 0, offset);
             downstream.begin(offset);
-            for (int i = 0; i < offset; i++)
-                downstream.accept(array[i]);
+            if (!cancellationWasRequested) {
+                for (int i = 0; i < offset; i++)
+                    downstream.accept(array[i]);
+            }
+            else {
+                for (int i = 0; i < offset && !downstream.cancellationRequested(); i++)
+                    downstream.accept(array[i]);
+            }
             downstream.end();
             array = null;
         }
@@ -384,7 +463,7 @@
     /**
      * {@link Sink} for implementing sort on int streams.
      */
-    private static final class IntSortingSink extends Sink.ChainedInt<Integer> {
+    private static final class IntSortingSink extends AbstractIntSortingSink {
         private SpinedBuffer.OfInt b;
 
         IntSortingSink(Sink<? super Integer> sink) {
@@ -403,8 +482,16 @@
             int[] ints = b.asPrimitiveArray();
             Arrays.sort(ints);
             downstream.begin(ints.length);
-            for (int anInt : ints)
-                downstream.accept(anInt);
+            if (!cancellationWasRequested) {
+                for (int anInt : ints)
+                    downstream.accept(anInt);
+            }
+            else {
+                for (int anInt : ints) {
+                    if (downstream.cancellationRequested()) break;
+                    downstream.accept(anInt);
+                }
+            }
             downstream.end();
         }
 
@@ -415,9 +502,26 @@
     }
 
     /**
+     * Abstract {@link Sink} for implementing sort on long streams.
+     */
+    private static abstract class AbstractLongSortingSink extends Sink.ChainedLong<Long> {
+        protected boolean cancellationWasRequested;
+
+        AbstractLongSortingSink(Sink<? super Long> downstream) {
+            super(downstream);
+        }
+
+        @Override
+        public final boolean cancellationRequested() {
+            cancellationWasRequested = true;
+            return false;
+        }
+    }
+
+    /**
      * {@link Sink} for implementing sort on SIZED long streams.
      */
-    private static final class SizedLongSortingSink extends Sink.ChainedLong<Long> {
+    private static final class SizedLongSortingSink extends AbstractLongSortingSink {
         private long[] array;
         private int offset;
 
@@ -436,8 +540,14 @@
         public void end() {
             Arrays.sort(array, 0, offset);
             downstream.begin(offset);
-            for (int i = 0; i < offset; i++)
-                downstream.accept(array[i]);
+            if (!cancellationWasRequested) {
+                for (int i = 0; i < offset; i++)
+                    downstream.accept(array[i]);
+            }
+            else {
+                for (int i = 0; i < offset && !downstream.cancellationRequested(); i++)
+                    downstream.accept(array[i]);
+            }
             downstream.end();
             array = null;
         }
@@ -451,7 +561,7 @@
     /**
      * {@link Sink} for implementing sort on long streams.
      */
-    private static final class LongSortingSink extends Sink.ChainedLong<Long> {
+    private static final class LongSortingSink extends AbstractLongSortingSink {
         private SpinedBuffer.OfLong b;
 
         LongSortingSink(Sink<? super Long> sink) {
@@ -470,8 +580,16 @@
             long[] longs = b.asPrimitiveArray();
             Arrays.sort(longs);
             downstream.begin(longs.length);
-            for (long aLong : longs)
-                downstream.accept(aLong);
+            if (!cancellationWasRequested) {
+                for (long aLong : longs)
+                    downstream.accept(aLong);
+            }
+            else {
+                for (long aLong : longs) {
+                    if (downstream.cancellationRequested()) break;
+                    downstream.accept(aLong);
+                }
+            }
             downstream.end();
         }
 
@@ -482,9 +600,26 @@
     }
 
     /**
+     * Abstract {@link Sink} for implementing sort on long streams.
+     */
+    private static abstract class AbstractDoubleSortingSink extends Sink.ChainedDouble<Double> {
+        protected boolean cancellationWasRequested;
+
+        AbstractDoubleSortingSink(Sink<? super Double> downstream) {
+            super(downstream);
+        }
+
+        @Override
+        public final boolean cancellationRequested() {
+            cancellationWasRequested = true;
+            return false;
+        }
+    }
+
+    /**
      * {@link Sink} for implementing sort on SIZED double streams.
      */
-    private static final class SizedDoubleSortingSink extends Sink.ChainedDouble<Double> {
+    private static final class SizedDoubleSortingSink extends AbstractDoubleSortingSink {
         private double[] array;
         private int offset;
 
@@ -503,8 +638,14 @@
         public void end() {
             Arrays.sort(array, 0, offset);
             downstream.begin(offset);
-            for (int i = 0; i < offset; i++)
-                downstream.accept(array[i]);
+            if (!cancellationWasRequested) {
+                for (int i = 0; i < offset; i++)
+                    downstream.accept(array[i]);
+            }
+            else {
+                for (int i = 0; i < offset && !downstream.cancellationRequested(); i++)
+                    downstream.accept(array[i]);
+            }
             downstream.end();
             array = null;
         }
@@ -518,7 +659,7 @@
     /**
      * {@link Sink} for implementing sort on double streams.
      */
-    private static final class DoubleSortingSink extends Sink.ChainedDouble<Double> {
+    private static final class DoubleSortingSink extends AbstractDoubleSortingSink {
         private SpinedBuffer.OfDouble b;
 
         DoubleSortingSink(Sink<? super Double> sink) {
@@ -537,8 +678,16 @@
             double[] doubles = b.asPrimitiveArray();
             Arrays.sort(doubles);
             downstream.begin(doubles.length);
-            for (double aDouble : doubles)
-                downstream.accept(aDouble);
+            if (!cancellationWasRequested) {
+                for (double aDouble : doubles)
+                    downstream.accept(aDouble);
+            }
+            else {
+                for (double aDouble : doubles) {
+                    if (downstream.cancellationRequested()) break;
+                    downstream.accept(aDouble);
+                }
+            }
             downstream.end();
         }
 
--- a/src/share/classes/javax/swing/JComponent.java	Tue May 13 23:18:27 2014 -0700
+++ b/src/share/classes/javax/swing/JComponent.java	Wed May 14 11:00:21 2014 -0700
@@ -3985,6 +3985,17 @@
          * @since 1.4
          */
         public AccessibleKeyBinding getAccessibleKeyBinding() {
+            // Try to get the linked label's mnemonic if it exists
+            Object o = getClientProperty(JLabel.LABELED_BY_PROPERTY);
+            if (o instanceof Accessible){
+                AccessibleContext ac = ((Accessible) o).getAccessibleContext();
+                if (ac != null){
+                    AccessibleComponent comp = ac.getAccessibleComponent();
+                    if (! (comp instanceof AccessibleExtendedComponent))
+                        return null;
+                    return ((AccessibleExtendedComponent)comp).getAccessibleKeyBinding();
+                }
+            }
             return null;
         }
     } // inner class AccessibleJComponent
--- a/src/share/classes/javax/swing/border/LineBorder.java	Tue May 13 23:18:27 2014 -0700
+++ b/src/share/classes/javax/swing/border/LineBorder.java	Wed May 14 11:00:21 2014 -0700
@@ -133,8 +133,8 @@
             int offs = this.thickness;
             int size = offs + offs;
             if (this.roundedCorners) {
-                int arc = offs + size;
-                outer = new RoundRectangle2D.Float(x, y, width, height, arc, arc);
+                float arc = .2f * offs;
+                outer = new RoundRectangle2D.Float(x, y, width, height, offs, offs);
                 inner = new RoundRectangle2D.Float(x + offs, y + offs, width - size, height - size, arc, arc);
             }
             else {
--- a/src/share/classes/sun/applet/resources/MsgAppletViewer_ja.java	Tue May 13 23:18:27 2014 -0700
+++ b/src/share/classes/sun/applet/resources/MsgAppletViewer_ja.java	Wed May 14 11:00:21 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1996, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1996, 2014, 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
@@ -57,9 +57,9 @@
             {"appletviewer.appletinfo.applet", "-- \u30A2\u30D7\u30EC\u30C3\u30C8\u60C5\u5831\u306A\u3057 --"},
             {"appletviewer.appletinfo.param", "-- \u30D1\u30E9\u30E1\u30FC\u30BF\u60C5\u5831\u306A\u3057 --"},
             {"appletviewer.appletinfo.textframe", "\u30A2\u30D7\u30EC\u30C3\u30C8\u60C5\u5831"},
-            {"appletviewer.appletprint.fail", "\u5370\u5237\u306B\u5931\u6557\u3057\u307E\u3057\u305F\u3002"},
-            {"appletviewer.appletprint.finish", "\u5370\u5237\u304C\u5B8C\u4E86\u3057\u307E\u3057\u305F\u3002"},
-            {"appletviewer.appletprint.cancel", "\u5370\u5237\u304C\u4E2D\u6B62\u3055\u308C\u307E\u3057\u305F\u3002"},
+            {"appletviewer.appletprint.fail", "\u5370\u5237\u304C\u5931\u6557\u3057\u307E\u3057\u305F\u3002"},
+            {"appletviewer.appletprint.finish", "\u5370\u5237\u3092\u7D42\u4E86\u3057\u307E\u3057\u305F\u3002"},
+            {"appletviewer.appletprint.cancel", "\u5370\u5237\u304C\u53D6\u308A\u6D88\u3055\u308C\u307E\u3057\u305F\u3002"},
             {"appletviewer.appletencoding", "\u6587\u5B57\u30A8\u30F3\u30B3\u30FC\u30C7\u30A3\u30F3\u30B0: {0}"},
             {"appletviewer.parse.warning.requiresname", "\u8B66\u544A: <param name=... value=...>\u30BF\u30B0\u306Bname\u5C5E\u6027\u304C\u5FC5\u8981\u3067\u3059\u3002"},
             {"appletviewer.parse.warning.paramoutside", "\u8B66\u544A: <param>\u30BF\u30B0\u304C<applet> ... </applet>\u306E\u5916\u5074\u3067\u3059\u3002"},
@@ -98,7 +98,7 @@
             {"appletioexception.loadclass.throw.notloaded", "\u30AF\u30E9\u30B9\u304C\u30ED\u30FC\u30C9\u3055\u308C\u307E\u305B\u3093: {0}"},
             {"appletclassloader.loadcode.verbose", "{1}\u3092\u53D6\u5F97\u3059\u308B\u305F\u3081\u306E{0}\u3078\u306E\u30B9\u30C8\u30EA\u30FC\u30E0\u3092\u958B\u304D\u307E\u3059"},
             {"appletclassloader.filenotfound", "{0}\u306E\u691C\u7D22\u4E2D\u306B\u30D5\u30A1\u30A4\u30EB\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093"},
-            {"appletclassloader.fileformat", "{0}\u306E\u30ED\u30FC\u30C9\u4E2D\u306B\u30D5\u30A1\u30A4\u30EB\u30FB\u30D5\u30A9\u30FC\u30DE\u30C3\u30C8\u4F8B\u5916\u304C\u767A\u751F\u3057\u307E\u3057\u305F"},
+            {"appletclassloader.fileformat", "{0}\u306E\u30ED\u30FC\u30C9\u4E2D\u306B\u30D5\u30A1\u30A4\u30EB\u5F62\u5F0F\u4F8B\u5916\u304C\u767A\u751F\u3057\u307E\u3057\u305F"},
             {"appletclassloader.fileioexception", "{0}\u306E\u30ED\u30FC\u30C9\u4E2D\u306B\u5165\u51FA\u529B\u4F8B\u5916\u304C\u767A\u751F\u3057\u307E\u3057\u305F"},
             {"appletclassloader.fileexception", "{1}\u306E\u30ED\u30FC\u30C9\u4E2D\u306B{0}\u4F8B\u5916\u304C\u767A\u751F\u3057\u307E\u3057\u305F"},
             {"appletclassloader.filedeath", "{1}\u306E\u30ED\u30FC\u30C9\u4E2D\u306B{0}\u304C\u5F37\u5236\u7D42\u4E86\u3057\u307E\u3057\u305F"},
@@ -132,7 +132,7 @@
             {"appletpanel.notdisposed", "\u30ED\u30FC\u30C9: \u30A2\u30D7\u30EC\u30C3\u30C8\u304C\u7834\u68C4\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002"},
             {"appletpanel.bail", "\u4E2D\u65AD\u6E08: \u7D42\u4E86\u3057\u3066\u3044\u307E\u3059\u3002"},
             {"appletpanel.filenotfound", "{0}\u306E\u691C\u7D22\u4E2D\u306B\u30D5\u30A1\u30A4\u30EB\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093"},
-            {"appletpanel.fileformat", "{0}\u306E\u30ED\u30FC\u30C9\u4E2D\u306B\u30D5\u30A1\u30A4\u30EB\u30FB\u30D5\u30A9\u30FC\u30DE\u30C3\u30C8\u4F8B\u5916\u304C\u767A\u751F\u3057\u307E\u3057\u305F"},
+            {"appletpanel.fileformat", "{0}\u306E\u30ED\u30FC\u30C9\u4E2D\u306B\u30D5\u30A1\u30A4\u30EB\u5F62\u5F0F\u4F8B\u5916\u304C\u767A\u751F\u3057\u307E\u3057\u305F"},
             {"appletpanel.fileioexception", "{0}\u306E\u30ED\u30FC\u30C9\u4E2D\u306B\u5165\u51FA\u529B\u4F8B\u5916\u304C\u767A\u751F\u3057\u307E\u3057\u305F"},
             {"appletpanel.fileexception", "{1}\u306E\u30ED\u30FC\u30C9\u4E2D\u306B{0}\u4F8B\u5916\u304C\u767A\u751F\u3057\u307E\u3057\u305F"},
             {"appletpanel.filedeath", "{1}\u306E\u30ED\u30FC\u30C9\u4E2D\u306B{0}\u304C\u5F37\u5236\u7D42\u4E86\u3057\u307E\u3057\u305F"},
--- a/src/share/classes/sun/applet/resources/MsgAppletViewer_pt_BR.java	Tue May 13 23:18:27 2014 -0700
+++ b/src/share/classes/sun/applet/resources/MsgAppletViewer_pt_BR.java	Wed May 14 11:00:21 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1996, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1996, 2014, 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
@@ -93,7 +93,7 @@
             {"appletviewer.main.nosecmgr", "Advert\u00EAncia: SecurityManager n\u00E3o instalado!"},
             {"appletviewer.main.warning", "Advert\u00EAncia: Nenhum applet iniciado. Certifique-se de que a entrada contenha uma tag <applet>."},
             {"appletviewer.main.warn.prop.overwrite", "Advert\u00EAncia: Substituindo a propriedade do sistema temporariamente a pedido do usu\u00E1rio: chave: {0} valor antigo: {1} valor novo: {2}"},
-            {"appletviewer.main.warn.cantreadprops", "Advert\u00EAncia: N\u00E3o \u00E9 poss\u00EDvel ler o arquivo de propriedades AppletViewer: {0} Usando defaults."},
+            {"appletviewer.main.warn.cantreadprops", "Advert\u00EAncia: N\u00E3o \u00E9 poss\u00EDvel ler o arquivo de propriedades AppletViewer: {0} Usando padr\u00F5es."},
             {"appletioexception.loadclass.throw.interrupted", "carregamento de classe interrompido: {0}"},
             {"appletioexception.loadclass.throw.notloaded", "classe n\u00E3o carregada: {0}"},
             {"appletclassloader.loadcode.verbose", "Fluxo de abertura para: {0} para obter {1}"},
--- a/src/share/classes/sun/applet/resources/MsgAppletViewer_sv.java	Tue May 13 23:18:27 2014 -0700
+++ b/src/share/classes/sun/applet/resources/MsgAppletViewer_sv.java	Wed May 14 11:00:21 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1996, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1996, 2014, 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
@@ -85,7 +85,7 @@
             {"appletviewer.main.prop.store", "Anv\u00E4ndarspecifika egenskaper f\u00F6r AppletViewer"},
             {"appletviewer.main.err.prop.cantread", "Kan inte l\u00E4sa egenskapsfilen: {0}"},
             {"appletviewer.main.err.prop.cantsave", "Kan inte spara egenskapsfilen: {0}"},
-            {"appletviewer.main.warn.nosecmgr", "Varning: s\u00E4kerheten inaktiveras."},
+            {"appletviewer.main.warn.nosecmgr", "Varning! S\u00E4kerheten avaktiveras."},
             {"appletviewer.main.debug.cantfinddebug", "Hittar inte fels\u00F6kningsprogrammet!"},
             {"appletviewer.main.debug.cantfindmain", "Hittar inte huvudmetoden i fels\u00F6kningsprogrammet!"},
             {"appletviewer.main.debug.exceptionindebug", "Undantag i fels\u00F6kningsprogrammet!"},
--- a/src/share/classes/sun/awt/resources/awt_pt_BR.properties	Tue May 13 23:18:27 2014 -0700
+++ b/src/share/classes/sun/awt/resources/awt_pt_BR.properties	Wed May 14 11:00:21 2014 -0700
@@ -44,7 +44,7 @@
 AWT.subtract=Teclado Num\u00E9rico -
 AWT.decimal=Teclado Num\u00E9rico .
 AWT.divide=Teclado Num\u00E9rico /
-AWT.delete=Deletar
+AWT.delete=Excluir
 AWT.numLock=Num Lock
 AWT.scrollLock=Scroll Lock
 AWT.f1=F1
@@ -151,7 +151,7 @@
 AWT.undefined=Indefinido
 
 # Predefined cursor names
-AWT.DefaultCursor=Cursor Default
+AWT.DefaultCursor=Cursor Padr\u00E3o
 AWT.CrosshairCursor=Cursor em Forma de Cruz
 AWT.TextCursor=Cursor de Texto
 AWT.WaitCursor=Cursor em Forma de Ampulheta
@@ -165,9 +165,9 @@
 AWT.EResizeCursor=Cursor de Seta Que Aponta \u00E0 Direita
 AWT.HandCursor=Cursor em Forma de M\u00E3o
 AWT.MoveCursor=Cursor de Movimento
-AWT.DefaultDragCursor=Cursor Default de Arrastar
-AWT.DefaultNoDropCursor=Cursor Default sem Arrastar
-AWT.DefaultDropCursor=Cursor Default de Soltar
+AWT.DefaultDragCursor=Cursor Padr\u00E3o de Arrastar
+AWT.DefaultNoDropCursor=Cursor Padr\u00E3o sem Arrastar
+AWT.DefaultDropCursor=Cursor Padr\u00E3o de Soltar
 
 # Input method related strings
 AWT.CompositionWindowTitle=Janela de Entrada
--- a/src/share/classes/sun/launcher/resources/launcher_de.properties	Tue May 13 23:18:27 2014 -0700
+++ b/src/share/classes/sun/launcher/resources/launcher_de.properties	Wed May 14 11:00:21 2014 -0700
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2007, 2013, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2007, 2014, 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,7 +37,7 @@
 java.launcher.opt.footer     =\    -cp <Klassensuchpfad von Verzeichnissen und ZIP-/JAR-Dateien>\n    -classpath <Klassensuchpfad von Verzeichnissen und ZIP-/JAR-Dateien>\n                  Eine durch {0} getrennte Liste mit Verzeichnissen, JAR-Archiven\n                  und ZIP-Archiven zur Suche nach Klassendateien.\n    -D<name>=<value>\n                  Legt eine Systemeigenschaft fest\n    -verbose:[class|gc|jni]\n                  Aktiviert die Verbose-Ausgabe\n    -version      Druckt Produktversion und beendet das Programm\n    -version:<value>\n                  Erfordert die angegebene Version zur Ausf\u00FChrung\n    -showversion  Druckt Produktversion und f\u00E4hrt fort\n    -jre-restrict-search | -no-jre-restrict-search\n                  Bezieht private JREs des Benutzers in Versionssuche ein bzw. schlie\u00DFt sie aus\n    -? -help      Druckt diese Hilfemeldung\n    -X            Druckt Hilfe zu Nicht-Standardoptionen\n    -ea[:<packagename>...|:<classname>]\n    -enableassertions[:<packagename>...|:<classname>]\n                  Aktiviert Assertionen mit angegebener Granularit\u00E4t\n    -da[:<packagename>...|:<classname>]\n    -disableassertions[:<packagename>...|:<classname>]\n                  Deaktiviert Assertionen mit angegebener Granularit\u00E4t\n    -esa | -enablesystemassertions\n                  Aktiviert Systemassertionen\n    -dsa | -disablesystemassertions\n                  Deaktiviert Systemassertionen\n    -agentlib:<libname>[=<options>]\n                  L\u00E4dt native Agent Library <libname>, z.B. -agentlib:hprof\n                  siehe auch -agentlib:jdwp=help und -agentlib:hprof=help\n    -agentpath:<pathname>[=<options>]\n                  L\u00E4dt native Agent Library nach vollem Pfadnamen\n    -javaagent:<jarpath>[=<options>]\n                  L\u00E4dt Java-Programmiersprachen-Agent, siehe java.lang.instrument\n    -splash:<imagepath>\n                  Zeigt Startbildschirm mit angegebenem Bild\nWeitere Einzelheiten finden Sie unter http://www.oracle.com/technetwork/java/javase/documentation/index.html
 
 # Translators please note do not translate the options themselves
-java.launcher.X.usage=\    -Xmixed           Ausf\u00FChrung im gemischten Modus (Standard)\n    -Xint             Nur Ausf\u00FChrung im interpretierten Modus\n    -Xbootclasspath:<Verzeichnisse und ZIP-/JAR-Dateien durch {0} getrennt>\n                      Legt Suchpfad f\u00FCr Bootstrap-Klassen und Ressourcen fest\n    -Xbootclasspath/a:<Verzeichnisse und ZIP-/JAR-Dateien durch {0} getrennt>\n                      H\u00E4ngt an das Ende des Bootstrap Classpath an\n    -Xbootclasspath/p:<Verzeichnisse und ZIP-/JAR-Dateien durch {0} getrennt>\n                      Stellt Bootstrap Classpath voran\n    -Xdiag            Zeigt zus\u00E4tzliche Diagnosemeldungen an\n    -Xnoclassgc       Deaktiviert Klassen-Garbage Collection\n    -Xincgc           Aktiviert inkrementelle Garbage Collection\n    -Xloggc:<file>    Loggt GC-Status in einer Datei mit Zeitstempeln\n    -Xbatch           Deaktiviert Hintergrundkompilierung\n    -Xms<size>        Legt anf\u00E4ngliche Java Heap-Gr\u00F6\u00DFe fest\n    -Xmx<size>        Legt maximale Java Heap-Gr\u00F6\u00DFe fest\n    -Xss<size>        Legt Java-Thread-Stackgr\u00F6\u00DFe fest\n    -Xprof            Gibt CPU-Profiling-Daten aus\n    -Xfuture          Aktiviert strengste Pr\u00FCfungen, antizipiert zuk\u00FCnftigen Standardwert\n    -Xrs              Reduziert Verwendung von BS-Signalen durch Java/VM (siehe Dokumentation)\n    -Xcheck:jni       F\u00FChrt zus\u00E4tzliche Pr\u00FCfungen f\u00FCr JNI-Funktionen durch\n    -Xshare:off       Kein Versuch, gemeinsame Klassendaten zu verwenden\n    -Xshare:auto      Verwendet gemeinsame Klassendaten, wenn m\u00F6glich (Standard)\n    -Xshare:on        Erfordert die Verwendung gemeinsamer Klassendaten, sonst verl\u00E4uft der Vorgang nicht erfolgreich.\n    -XshowSettings    Zeigt alle Einstellungen und f\u00E4hrt fort\n    -XshowSettings:all\n                      Zeigt alle Einstellungen und f\u00E4hrt fort\n    -XshowSettings:vm Zeigt alle VM-bezogenen Einstellungen und f\u00E4hrt fort\n    -XshowSettings:properties\n                      Zeigt alle Eigenschaftseinstellungen und f\u00E4hrt fort\n    -XshowSettings:locale\n                      Zeigt alle gebietsschemabezogenen Einstellungen und f\u00E4hrt fort\n\nDie -X-Optionen sind keine Standardoptionen und k\u00F6nnen ohne Vorank\u00FCndigung ge\u00E4ndert werden.\n
+java.launcher.X.usage=\    -Xmixed           Ausf\u00FChrung im gemischten Modus (Standard)\n    -Xint             Nur Ausf\u00FChrung im interpretierten Modus\n    -Xbootclasspath:<Verzeichnisse und ZIP-/JAR-Dateien durch {0} getrennt>\n                      Legt Suchpfad f\u00FCr Bootstrap-Klassen und Ressourcen fest\n    -Xbootclasspath/a:<Verzeichnisse und ZIP-/JAR-Dateien durch {0} getrennt>\n                      H\u00E4ngt an das Ende des Bootstrap Classpath an\n    -Xbootclasspath/p:<Verzeichnisse und ZIP-/JAR-Dateien durch {0} getrennt>\n                      Stellt Bootstrap Classpath voran\n    -Xdiag            Zeigt zus\u00E4tzliche Diagnosemeldungen an\n    -Xnoclassgc       Deaktiviert Klassen-Garbage Collection\n    -Xincgc           Aktiviert inkrementelle Garbage Collection\n    -Xloggc:<file>    Loggt GC-Status in einer Datei mit Zeitstempeln\n    -Xbatch           Deaktiviert Hintergrundkompilierung\n    -Xms<size>        Legt anf\u00E4ngliche Java Heap-Gr\u00F6\u00DFe fest\n    -Xmx<size>        Legt maximale Java Heap-Gr\u00F6\u00DFe fest\n    -Xss<size>        Legt Java-Threadstackgr\u00F6\u00DFe fest\n    -Xprof            Gibt CPU-Profiling-Daten aus\n    -Xfuture          Aktiviert strengste Pr\u00FCfungen, antizipiert zuk\u00FCnftigen Standardwert\n    -Xrs              Reduziert Verwendung von BS-Signalen durch Java/VM (siehe Dokumentation)\n    -Xcheck:jni       F\u00FChrt zus\u00E4tzliche Pr\u00FCfungen f\u00FCr JNI-Funktionen durch\n    -Xshare:off       Kein Versuch, gemeinsame Klassendaten zu verwenden\n    -Xshare:auto      Verwendet gemeinsame Klassendaten, wenn m\u00F6glich (Standard)\n    -Xshare:on        Erfordert die Verwendung gemeinsamer Klassendaten, sonst verl\u00E4uft der Vorgang nicht erfolgreich.\n    -XshowSettings    Zeigt alle Einstellungen und f\u00E4hrt fort\n    -XshowSettings:all\n                      Zeigt alle Einstellungen und f\u00E4hrt fort\n    -XshowSettings:vm Zeigt alle VM-bezogenen Einstellungen und f\u00E4hrt fort\n    -XshowSettings:properties\n                      Zeigt alle Eigenschaftseinstellungen und f\u00E4hrt fort\n    -XshowSettings:locale\n                      Zeigt alle gebietsschemabezogenen Einstellungen und f\u00E4hrt fort\n\nDie -X-Optionen sind keine Standardoptionen und k\u00F6nnen ohne Vorank\u00FCndigung ge\u00E4ndert werden.\n
 
 # Translators please note do not translate the options themselves
 java.launcher.X.macosx.usage=\nDie folgenden Optionen sind f\u00FCr Mac OS X spezifisch:\n    -XstartOnFirstThread\n                      f\u00FChrt die main()-Methode f\u00FCr den ersten (AppKit) Thread aus\n    -Xdock:name=<Anwendungsname>"\n                      \u00DCberschreibt den in der Uhr angezeigten Standardanwendungsnamen\n    -Xdock:icon=<Pfad zu Symboldatei>\n                      \u00DCberschreibt das in der Uhr angezeigte Standardsymbol\n\n
--- a/src/share/classes/sun/launcher/resources/launcher_pt_BR.properties	Tue May 13 23:18:27 2014 -0700
+++ b/src/share/classes/sun/launcher/resources/launcher_pt_BR.properties	Wed May 14 11:00:21 2014 -0700
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2007, 2013, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2007, 2014, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -30,17 +30,17 @@
 java.launcher.opt.vmselect   =\    {0}\t  para selecionar a VM "{1}"\n
 java.launcher.opt.hotspot    =\    {0}\t  \u00E9 um sin\u00F4nimo da VM "{1}" [obsoleto]\n
 
-java.launcher.ergo.message1  =\                  A VM default \u00E9 {0}
+java.launcher.ergo.message1  =\                  A VM padr\u00E3o \u00E9 {0}
 java.launcher.ergo.message2  =\                  porque a execu\u00E7\u00E3o est\u00E1 sendo feita em uma m\u00E1quina de classe de servidor.\n
 
 # Translators please note do not translate the options themselves
 java.launcher.opt.footer     =\    -cp <caminho de pesquisa da classe dos diret\u00F3rios e arquivos zip/jar>\n    -classpath <caminho de pesquisa da classe dos diret\u00F3rios e arquivos zip/jar>\n                  Uma lista separada por {0} de diret\u00F3rios, archives JAR\n                  e archives ZIP nos quais ser\u00E3o procurados os arquivos de classe.\n    -D<nome>=<valor>\n                  define uma propriedade do sistema\n    -verbose:[class|gc|jni]\n                  ativa a sa\u00EDda detalhada\n    -version      imprime a vers\u00E3o do produto e sai do programa\n    -version:<valor>\n                  requer a execu\u00E7\u00E3o da vers\u00E3o especificada\n    -showversion  imprime a vers\u00E3o do produto e continua\n    -jre-restrict-search | -no-jre-restrict-search\n                  inclui/exclui JREs privados do usu\u00E1rio na pesquisa de vers\u00E3o\n    -? -help      imprime esta mensagem de ajuda\n    -X            imprime a ajuda sobre op\u00E7\u00F5es n\u00E3o padronizadas\n    -ea[:<nome do pacote>...|:<nome da classe>]\n    -enableassertions[:<nome do pacote>...|:<nome da classe>]\n                  ativa asser\u00E7\u00F5es com granularidade especificada\n    -da[:<nome do pacote>...|:<nome da classe>]\n    -disableassertions[:<nome do pacote>...|:<nome da classe>]\n                  desativa asser\u00E7\u00F5es com granularidade especificada\n    -esa | -enablesystemassertions\n                  ativa asser\u00E7\u00F5es do sistema\n    -dsa | -disablesystemassertions\n                  desativa asser\u00E7\u00F5es do sistema\n    -agentlib:<nome da biblioteca>[=<op\u00E7\u00F5es>]\n                  carrega a biblioteca de agentes nativa <nome da biblioteca>, por exemplo: -agentlib:hprof\n                  consulte tamb\u00E9m: -agentlib:jdwp=help e -agentlib:hprof=help\n    -agentpath:<nome do caminho>[=<op\u00E7\u00F5es>]\n                  carrega a biblioteca de agentes nativa com base no nome do caminho completo\n    -javaagent:<caminho do arquivo jar>[=<op\u00E7\u00F5es>]\n                  carrega o agente da linguagem de programa\u00E7\u00E3o Java; consulte java.lang.instrument\n    -splash:<caminho da imagem>\n                  mostra a tela de abertura com a imagem especificada\nConsulte http://www.oracle.com/technetwork/java/javase/documentation/index.html para obter mais detalhes.
 
 # Translators please note do not translate the options themselves
-java.launcher.X.usage=\    -Xmixed           execu\u00E7\u00E3o no modo misto (default)\n    -Xint             execu\u00E7\u00E3o somente no modo interpretado\n    -Xbootclasspath:<diret\u00F3rios e arquivos zip/jar separados por {0}>\n                      define o caminho de pesquisa para classes e recursos de inicializa\u00E7\u00E3o\n    -Xbootclasspath/a:<diret\u00F3rios e arquivos zip/jar separados por {0}>\n                      anexa no final do caminho da classe de inicializa\u00E7\u00E3o\n    -Xbootclasspath/p:<diret\u00F3rios e arquivos zip/jar separados por {0}>\n                      anexa no in\u00EDcio do caminho da classe de inicializa\u00E7\u00E3o\n    -Xdiag            mostra mensagens de diagn\u00F3stico adicionais\n    -Xnoclassgc       desativa a coleta de lixo da classe\n    -Xincgc           ativa a coleta de lixo incremental\n    -Xloggc:<arquivo>    registra o status do GC status em um arquivo com marca\u00E7\u00F5es de data e hor\u00E1rio\n    -Xbatch           desativa a compila\u00E7\u00E3o em segundo plano\n    -Xms<tamanho>        define o tamanho inicial do heap Java\n    -Xmx<tamanho>        define o tamanho m\u00E1ximo do heap Java\n    -Xss<tamanho>        define o tamanho da pilha de threads java\n    -Xprof            produz dados de perfil da cpu\n    -Xfuture          ativa verifica\u00E7\u00F5es de n\u00EDvel m\u00E1ximo de exig\u00EAncia, prevendo o valor default futuro\n    -Xrs              reduz o uso de sinais do SO pelo(a) Java/VM (consulte a documenta\u00E7\u00E3o)\n    -Xcheck:jni       executa verifica\u00E7\u00F5es adicionais de fun\u00E7\u00F5es da JNI\n    -Xshare:off       n\u00E3o tenta usar dados da classe compartilhada\n    -Xshare:auto      se poss\u00EDvel, usa dados da classe compartilhada (default)\n    -Xshare:on        requer o uso de dados da classe compartilhada, caso contr\u00E1rio haver\u00E1 falha.\n    -XshowSettings    mostra todas as defini\u00E7\u00F5es e continua\n    -XshowSettings:all\n                      mostra todas as defini\u00E7\u00F5es e continua\n    -XshowSettings:vm mostra todas as defini\u00E7\u00F5es relacionadas \u00E0 vm e continua\n    -XshowSettings:properties\n                      mostra todas as defini\u00E7\u00F5es da propriedade e continua\n    -XshowSettings:locale\n                      mostra todas as defini\u00E7\u00F5es relativas \u00E0s configura\u00E7\u00F5es regionais e continua\n\nAs -X options n\u00E3o s\u00E3o padronizadas e est\u00E3o sujeitas a altera\u00E7\u00F5es sem aviso.\n
+java.launcher.X.usage=\    -Xmixed           execu\u00E7\u00E3o no modo misto (padr\u00E3o)\n    -Xint             execu\u00E7\u00E3o somente no modo interpretado\n    -Xbootclasspath:<diret\u00F3rios e arquivos zip/jar separados por {0}>\n                      define o caminho de pesquisa para classes e recursos de inicializa\u00E7\u00E3o\n    -Xbootclasspath/a:<diret\u00F3rios e arquivos zip/jar separados por {0}>\n                      anexa no final do caminho da classe de inicializa\u00E7\u00E3o\n    -Xbootclasspath/p:<diret\u00F3rios e arquivos zip/jar separados por {0}>\n                      anexa no in\u00EDcio do caminho da classe de inicializa\u00E7\u00E3o\n    -Xdiag            mostra mensagens de diagn\u00F3stico adicionais\n    -Xnoclassgc       desativa a coleta de lixo da classe\n    -Xincgc           ativa a coleta de lixo incremental\n    -Xloggc:<arquivo>    registra o status do GC status em um arquivo com marca\u00E7\u00F5es de data e hor\u00E1rio\n    -Xbatch           desativa a compila\u00E7\u00E3o em segundo plano\n    -Xms<tamanho>        define o tamanho inicial do heap Java\n    -Xmx<tamanho>        define o tamanho m\u00E1ximo do heap Java\n    -Xss<tamanho>        define o tamanho da pilha de threads java\n    -Xprof            produz dados de perfil da cpu\n    -Xfuture          ativa verifica\u00E7\u00F5es de n\u00EDvel m\u00E1ximo de exig\u00EAncia, prevendo o valor padr\u00E3o futuro\n    -Xrs              reduz o uso de sinais do SO pelo(a) Java/VM (consulte a documenta\u00E7\u00E3o)\n    -Xcheck:jni       executa verifica\u00E7\u00F5es adicionais de fun\u00E7\u00F5es da JNI\n    -Xshare:off       n\u00E3o tenta usar dados da classe compartilhada\n    -Xshare:auto      se poss\u00EDvel, usa dados da classe compartilhada (padr\u00E3o)\n    -Xshare:on        requer o uso de dados da classe compartilhada, caso contr\u00E1rio haver\u00E1 falha.\n    -XshowSettings    mostra todas as defini\u00E7\u00F5es e continua\n    -XshowSettings:all\n                      mostra todas as defini\u00E7\u00F5es e continua\n    -XshowSettings:vm mostra todas as defini\u00E7\u00F5es relacionadas \u00E0 vm e continua\n    -XshowSettings:properties\n                      mostra todas as defini\u00E7\u00F5es da propriedade e continua\n    -XshowSettings:locale\n                      mostra todas as defini\u00E7\u00F5es relativas \u00E0s configura\u00E7\u00F5es regionais e continua\n\nAs -X options n\u00E3o s\u00E3o padronizadas e est\u00E3o sujeitas a altera\u00E7\u00F5es sem aviso.\n
 
 # Translators please note do not translate the options themselves
-java.launcher.X.macosx.usage=\nAs op\u00E7\u00F5es a seguir s\u00E3o espec\u00EDficas para o Mac OS X:\n    -XstartOnFirstThread\n                      executa o m\u00E9todo main() no primeiro thread (AppKit)\n    -Xdock:name=<nome da aplica\u00E7\u00E3o>"\n                      substitui o nome da aplica\u00E7\u00E3o default exibido no encaixe\n    -Xdock:icon=<caminho para o arquivo do \u00EDcone>\n                      substitui o \u00EDcone exibido no encaixe\n\n
+java.launcher.X.macosx.usage=\nAs op\u00E7\u00F5es a seguir s\u00E3o espec\u00EDficas para o Mac OS X:\n    -XstartOnFirstThread\n                      executa o m\u00E9todo main() no primeiro thread (AppKit)\n    -Xdock:name=<nome da aplica\u00E7\u00E3o>"\n                      substitui o nome da aplica\u00E7\u00E3o padr\u00E3o exibido no encaixe\n    -Xdock:icon=<caminho para o arquivo do \u00EDcone>\n                      substitui o \u00EDcone exibido no encaixe\n\n
 
 java.launcher.cls.error1=Erro: N\u00E3o foi poss\u00EDvel localizar nem carregar a classe principal {0}
 java.launcher.cls.error2=Erro: o m\u00E9todo main n\u00E3o \u00E9 {0} na classe {1}; defina o m\u00E9todo main como:\n   public static void main(String[] args)
--- a/src/share/classes/sun/management/resources/agent_ja.properties	Tue May 13 23:18:27 2014 -0700
+++ b/src/share/classes/sun/management/resources/agent_ja.properties	Wed May 14 11:00:21 2014 -0700
@@ -1,6 +1,6 @@
 #
 #
-# Copyright (c) 2004, 2013, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2004, 2014, 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
@@ -36,7 +36,7 @@
 agent.err.configfile.closed.failed = \u69CB\u6210\u30D5\u30A1\u30A4\u30EB\u3092\u9589\u3058\u308B\u3053\u3068\u304C\u3067\u304D\u307E\u305B\u3093\u3067\u3057\u305F
 agent.err.configfile.access.denied = \u69CB\u6210\u30D5\u30A1\u30A4\u30EB\u3078\u306E\u30A2\u30AF\u30BB\u30B9\u304C\u62D2\u5426\u3055\u308C\u307E\u3057\u305F
 
-agent.err.exportaddress.failed	   = JMX\u30B3\u30CD\u30AF\u30BF\u30FB\u30A2\u30C9\u30EC\u30B9\u306E\u8A08\u6E2C\u30D0\u30C3\u30D5\u30A1\u3078\u306E\u30A8\u30AF\u30B9\u30DD\u30FC\u30C8\u306B\u5931\u6557\u3057\u307E\u3057\u305F
+agent.err.exportaddress.failed	   = JMX\u30B3\u30CD\u30AF\u30BF\u30FB\u30A2\u30C9\u30EC\u30B9\u306E\u8A08\u6E2C\u30D0\u30C3\u30D5\u30A1\u3078\u306E\u30A8\u30AF\u30B9\u30DD\u30FC\u30C8\u304C\u5931\u6557\u3057\u307E\u3057\u305F
 
 agent.err.agentclass.notfound      = \u7BA1\u7406\u30A8\u30FC\u30B8\u30A7\u30F3\u30C8\u30FB\u30AF\u30E9\u30B9\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093
 agent.err.agentclass.failed        = \u7BA1\u7406\u30A8\u30FC\u30B8\u30A7\u30F3\u30C8\u30FB\u30AF\u30E9\u30B9\u304C\u5931\u6557\u3057\u307E\u3057\u305F 
--- a/src/share/classes/sun/misc/InnocuousThread.java	Tue May 13 23:18:27 2014 -0700
+++ b/src/share/classes/sun/misc/InnocuousThread.java	Wed May 14 11:00:21 2014 -0700
@@ -3,22 +3,22 @@
  * 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 GNUNSAFE General Public License version 2 only, as
+ * under the terms of the GNU General Public License version 2 only, as
  * published by the Free Software Foundation.  Oracle designates this
  * particular file as subject to the "Classpath" exception as provided
  * by Oracle in the LICENSE file that accompanied this code.
  *
- * This code is distributed in the hope that it will be useful, but WITHOUNSAFET
+ * 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 PARTICUNSAFELAR PUNSAFERPOSE.  See the GNUNSAFE General Public License
+ * 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 GNUNSAFE General Public License version
+ * 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 UNSAFESA.
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 UNSAFESA
+ * 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.
  */
--- a/src/share/classes/sun/net/InetAddressCachePolicy.java	Tue May 13 23:18:27 2014 -0700
+++ b/src/share/classes/sun/net/InetAddressCachePolicy.java	Wed May 14 11:00:21 2014 -0700
@@ -84,19 +84,31 @@
      * Initialize
      */
     static {
-        Integer tmp = null;
 
-        try {
-            tmp = new Integer(
-              java.security.AccessController.doPrivileged (
-                new PrivilegedAction<String>() {
-                  public String run() {
-                      return Security.getProperty(cachePolicyProp);
-                  }
-              }));
-        } catch (NumberFormatException e) {
-            // ignore
-        }
+        Integer tmp = java.security.AccessController.doPrivileged(
+          new PrivilegedAction<Integer>() {
+            public Integer run() {
+                try {
+                    String tmpString = Security.getProperty(cachePolicyProp);
+                    if (tmpString != null) {
+                        return Integer.valueOf(tmpString);
+                    }
+                } catch (NumberFormatException ignored) {
+                    // Ignore
+                }
+
+                try {
+                    String tmpString = System.getProperty(cachePolicyPropFallback);
+                    if (tmpString != null) {
+                        return Integer.decode(tmpString);
+                    }
+                } catch (NumberFormatException ignored) {
+                    // Ignore
+                }
+                return null;
+            }
+          });
+
         if (tmp != null) {
             cachePolicy = tmp.intValue();
             if (cachePolicy < 0) {
@@ -104,35 +116,36 @@
             }
             propertySet = true;
         } else {
-            tmp = java.security.AccessController.doPrivileged
-                (new sun.security.action.GetIntegerAction(cachePolicyPropFallback));
-            if (tmp != null) {
-                cachePolicy = tmp.intValue();
-                if (cachePolicy < 0) {
-                    cachePolicy = FOREVER;
-                }
-                propertySet = true;
-            } else {
-                /* No properties defined for positive caching. If there is no
-                 * security manager then use the default positive cache value.
-                 */
-                if (System.getSecurityManager() == null) {
-                    cachePolicy = DEFAULT_POSITIVE;
-                }
+            /* No properties defined for positive caching. If there is no
+             * security manager then use the default positive cache value.
+             */
+            if (System.getSecurityManager() == null) {
+                cachePolicy = DEFAULT_POSITIVE;
             }
         }
+        tmp = java.security.AccessController.doPrivileged (
+          new PrivilegedAction<Integer>() {
+            public Integer run() {
+                try {
+                    String tmpString = Security.getProperty(negativeCachePolicyProp);
+                    if (tmpString != null) {
+                        return Integer.valueOf(tmpString);
+                    }
+                } catch (NumberFormatException ignored) {
+                    // Ignore
+                }
 
-        try {
-            tmp = new Integer(
-              java.security.AccessController.doPrivileged (
-                new PrivilegedAction<String>() {
-                  public String run() {
-                      return Security.getProperty(negativeCachePolicyProp);
-                  }
-              }));
-        } catch (NumberFormatException e) {
-            // ignore
-        }
+                try {
+                    String tmpString = System.getProperty(negativeCachePolicyPropFallback);
+                    if (tmpString != null) {
+                        return Integer.decode(tmpString);
+                    }
+                } catch (NumberFormatException ignored) {
+                    // Ignore
+                }
+                return null;
+            }
+          });
 
         if (tmp != null) {
             negativeCachePolicy = tmp.intValue();
@@ -140,16 +153,6 @@
                 negativeCachePolicy = FOREVER;
             }
             propertyNegativeSet = true;
-        } else {
-            tmp = java.security.AccessController.doPrivileged
-                (new sun.security.action.GetIntegerAction(negativeCachePolicyPropFallback));
-            if (tmp != null) {
-                negativeCachePolicy = tmp.intValue();
-                if (negativeCachePolicy < 0) {
-                    negativeCachePolicy = FOREVER;
-                }
-                propertyNegativeSet = true;
-            }
         }
     }
 
--- a/src/share/classes/sun/net/util/IPAddressUtil.java	Tue May 13 23:18:27 2014 -0700
+++ b/src/share/classes/sun/net/util/IPAddressUtil.java	Wed May 14 11:00:21 2014 -0700
@@ -37,89 +37,72 @@
      * @param src a String representing an IPv4 address in standard format
      * @return a byte array representing the IPv4 numeric address
      */
+    @SuppressWarnings("fallthrough")
     public static byte[] textToNumericFormatV4(String src)
     {
-        if (src.length() == 0) {
+        byte[] res = new byte[INADDR4SZ];
+
+        long tmpValue = 0;
+        int currByte = 0;
+
+        int len = src.length();
+        if (len == 0 || len > 15) {
             return null;
         }
-
-        byte[] res = new byte[INADDR4SZ];
-        String[] s = src.split("\\.", -1);
-        long val;
-        try {
-            switch(s.length) {
+        /*
+         * When only one part is given, the value is stored directly in
+         * the network address without any byte rearrangement.
+         *
+         * When a two part address is supplied, the last part is
+         * interpreted as a 24-bit quantity and placed in the right
+         * most three bytes of the network address. This makes the
+         * two part address format convenient for specifying Class A
+         * network addresses as net.host.
+         *
+         * When a three part address is specified, the last part is
+         * interpreted as a 16-bit quantity and placed in the right
+         * most two bytes of the network address. This makes the
+         * three part address format convenient for specifying
+         * Class B net- work addresses as 128.net.host.
+         *
+         * When four parts are specified, each is interpreted as a
+         * byte of data and assigned, from left to right, to the
+         * four bytes of an IPv4 address.
+         *
+         * We determine and parse the leading parts, if any, as single
+         * byte values in one pass directly into the resulting byte[],
+         * then the remainder is treated as a 8-to-32-bit entity and
+         * translated into the remaining bytes in the array.
+         */
+        for (int i = 0; i < len; i++) {
+            char c = src.charAt(i);
+            if (c == '.') {
+                if (tmpValue < 0 || tmpValue > 0xff || currByte == 3) {
+                    return null;
+                }
+                res[currByte++] = (byte) (tmpValue & 0xff);
+                tmpValue = 0;
+            } else {
+                int digit = Character.digit(c, 10);
+                if (digit < 0) {
+                    return null;
+                }
+                tmpValue *= 10;
+                tmpValue += digit;
+            }
+        }
+        if (tmpValue < 0 || tmpValue >= (1L << ((4 - currByte) * 8))) {
+            return null;
+        }
+        switch (currByte) {
+            case 0:
+                res[0] = (byte) ((tmpValue >> 24) & 0xff);
             case 1:
-                /*
-                 * When only one part is given, the value is stored directly in
-                 * the network address without any byte rearrangement.
-                 */
-
-                val = Long.parseLong(s[0]);
-                if (val < 0 || val > 0xffffffffL)
-                    return null;
-                res[0] = (byte) ((val >> 24) & 0xff);
-                res[1] = (byte) (((val & 0xffffff) >> 16) & 0xff);
-                res[2] = (byte) (((val & 0xffff) >> 8) & 0xff);
-                res[3] = (byte) (val & 0xff);
-                break;
+                res[1] = (byte) ((tmpValue >> 16) & 0xff);
             case 2:
-                /*
-                 * When a two part address is supplied, the last part is
-                 * interpreted as a 24-bit quantity and placed in the right
-                 * most three bytes of the network address. This makes the
-                 * two part address format convenient for specifying Class A
-                 * network addresses as net.host.
-                 */
-
-                val = Integer.parseInt(s[0]);
-                if (val < 0 || val > 0xff)
-                    return null;
-                res[0] = (byte) (val & 0xff);
-                val = Integer.parseInt(s[1]);
-                if (val < 0 || val > 0xffffff)
-                    return null;
-                res[1] = (byte) ((val >> 16) & 0xff);
-                res[2] = (byte) (((val & 0xffff) >> 8) &0xff);
-                res[3] = (byte) (val & 0xff);
-                break;
+                res[2] = (byte) ((tmpValue >>  8) & 0xff);
             case 3:
-                /*
-                 * When a three part address is specified, the last part is
-                 * interpreted as a 16-bit quantity and placed in the right
-                 * most two bytes of the network address. This makes the
-                 * three part address format convenient for specifying
-                 * Class B net- work addresses as 128.net.host.
-                 */
-                for (int i = 0; i < 2; i++) {
-                    val = Integer.parseInt(s[i]);
-                    if (val < 0 || val > 0xff)
-                        return null;
-                    res[i] = (byte) (val & 0xff);
-                }
-                val = Integer.parseInt(s[2]);
-                if (val < 0 || val > 0xffff)
-                    return null;
-                res[2] = (byte) ((val >> 8) & 0xff);
-                res[3] = (byte) (val & 0xff);
-                break;
-            case 4:
-                /*
-                 * When four parts are specified, each is interpreted as a
-                 * byte of data and assigned, from left to right, to the
-                 * four bytes of an IPv4 address.
-                 */
-                for (int i = 0; i < 4; i++) {
-                    val = Integer.parseInt(s[i]);
-                    if (val < 0 || val > 0xff)
-                        return null;
-                    res[i] = (byte) (val & 0xff);
-                }
-                break;
-            default:
-                return null;
-            }
-        } catch(NumberFormatException e) {
-            return null;
+                res[3] = (byte) ((tmpValue >>  0) & 0xff);
         }
         return res;
     }
--- a/src/share/classes/sun/rmi/rmic/resources/rmic_ja.properties	Tue May 13 23:18:27 2014 -0700
+++ b/src/share/classes/sun/rmi/rmic/resources/rmic_ja.properties	Wed May 14 11:00:21 2014 -0700
@@ -1,6 +1,6 @@
 #
 #
-# Copyright (c) 1996, 2013, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 1996, 2014, 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
@@ -71,7 +71,7 @@
 generator.env.idl=sun.rmi.rmic.iiop.BatchEnvironment
 generator.env.xprint=sun.rmi.rmic.iiop.BatchEnvironment
 
-rmic.usage=\u4F7F\u7528\u65B9\u6CD5: {0} <options> <class names>\n\n<options>\u306B\u306F\u6B21\u306E\u3082\u306E\u304C\u3042\u308A\u307E\u3059\u3002\n -keep      \u4E2D\u9593\u751F\u6210\u3055\u308C\u305F\u30BD\u30FC\u30B9\u30FB\u30D5\u30A1\u30A4\u30EB\u3092\u524A\u9664\u3057\u306A\u3044\n -keepgenerated("-keep"\u3068\u540C\u3058)\n -v1.1      1.1\u30B9\u30BF\u30D6\u30FB\u30D7\u30ED\u30C8\u30B3\u30EB\u7248\u7528\u306E\u30B9\u30BF\u30D6/\u30B9\u30B1\u30EB\u30C8\u30F3\u3092\u4F5C\u6210\u3059\u308B\n -vcompat   1.1\u30681.2\u306E\u30B9\u30BF\u30D6\u30FB\u30D7\u30ED\u30C8\u30B3\u30EB\u7248\u3068\n                 \u4E92\u63DB\u6027\u306E\u3042\u308B\u30B9\u30BF\u30D6/\u30B9\u30B1\u30EB\u30C8\u30F3\u3092\u4F5C\u6210\u3059\u308B\n -v1.2      (\u30C7\u30D5\u30A9\u30EB\u30C8)1.2\u30B9\u30BF\u30D6\u30FB\u30D7\u30ED\u30C8\u30B3\u30EB\u7248\u5C02\u7528\u306E\u30B9\u30BF\u30D6\u3092\u4F5C\u6210\u3059\u308B\n -iiop      IIOP\u7528\u306E\u30B9\u30BF\u30D6\u3092\u4F5C\u6210\u3059\u308B\u3002\u6307\u5B9A\u3059\u308B\u3068<options>\u306B\u306F\u6B21\u306E\u3082\u306E\u3082\u542B\u307E\u308C\u307E\u3059\u3002\n\n            -always       \u6700\u65B0\u306E\u5834\u5408\u3067\u3082\u30B9\u30BF\u30D6\u3092\u4F5C\u6210\u3059\u308B\n            -alwaysgenerate ("-always"\u3068\u540C\u3058)\n            -nolocalstubs   \u540C\u3058\u30D7\u30ED\u30BB\u30B9\u306B\u3064\u3044\u3066\u6700\u9069\u5316\u3055\u308C\u305F\u30B9\u30BF\u30D6\u306F\u4F5C\u6210\u3057\u306A\u3044\n\n -idl      IDL\u3092\u4F5C\u6210\u3059\u308B\u3002\u6307\u5B9A\u3059\u308B\u3068<options>\u306B\u306F\u6B21\u306E\u3082\u306E\u3082\u542B\u307E\u308C\u307E\u3059\u3002\n\n            -noValueMethods valuetypes\u306B\u5BFE\u3057\u3066\u30E1\u30BD\u30C3\u30C9\u3092\u751F\u6210\u3057\u306A\u3044\n            -always       \u6700\u65B0\u306E\u5834\u5408\u3067\u3082IDL\u3092\u751F\u6210\u3059\u308B\n            -alwaysgenerate ("-always"\u3068\u540C\u3058)\n\n -g        \u30C7\u30D0\u30C3\u30B0\u60C5\u5831\u3092\u751F\u6210\u3059\u308B\n -nowarn     \u8B66\u544A\u3092\u751F\u6210\u3057\u306A\u3044\n -nowrite    \u30B3\u30F3\u30D1\u30A4\u30EB\u3057\u305F\u30AF\u30E9\u30B9\u3092\u30D5\u30A1\u30A4\u30EB\u30FB\u30B7\u30B9\u30C6\u30E0\u306B\u66F8\u304D\u8FBC\u307E\u306A\u3044\n -verbose    \u30B3\u30F3\u30D1\u30A4\u30E9\u306E\u52D5\u4F5C\u306B\u95A2\u3059\u308B\u30E1\u30C3\u30BB\u30FC\u30B8\u3092\u51FA\u529B\u3059\u308B\n -classpath <path>    \u5165\u529B\u30AF\u30E9\u30B9\u30FB\u30D5\u30A1\u30A4\u30EB\u3092\u691C\u7D22\u3059\u308B\u4F4D\u7F6E\u3092\u6307\u5B9A\u3059\u308B\n -bootclasspath<path> \u30D6\u30FC\u30C8\u30B9\u30C8\u30E9\u30C3\u30D7\u30FB\u30AF\u30E9\u30B9\u30FB\u30D5\u30A1\u30A4\u30EB\u306E\u4F4D\u7F6E\u3092\u7F6E\u304D\u63DB\u3048\u308B\n -extdirs<path>     \u30A4\u30F3\u30B9\u30C8\u30FC\u30EB\u6E08\u62E1\u5F35\u6A5F\u80FD\u306E\u4F4D\u7F6E\u3092\u7F6E\u304D\u63DB\u3048\u308B\n -d <directory>      \u751F\u6210\u3055\u308C\u305F\u30AF\u30E9\u30B9\u30FB\u30D5\u30A1\u30A4\u30EB\u3092\u683C\u7D0D\u3059\u308B\u4F4D\u7F6E\u3092\u6307\u5B9A\u3059\u308B\n -J<runtime flag>  java\u30A4\u30F3\u30BF\u30D7\u30EA\u30BF\u306B\u5F15\u6570\u3092\u6E21\u3059\n
+rmic.usage=\u4F7F\u7528\u65B9\u6CD5: {0} <options> <class names>\n\n<options>\u306B\u306F\u6B21\u306E\u3082\u306E\u304C\u3042\u308A\u307E\u3059\u3002\n -keep      \u4E2D\u9593\u751F\u6210\u3055\u308C\u305F\u30BD\u30FC\u30B9\u30FB\u30D5\u30A1\u30A4\u30EB\u3092\u524A\u9664\u3057\u306A\u3044\n -keepgenerated("-keep"\u3068\u540C\u3058)\n -v1.1      1.1\u30B9\u30BF\u30D6\u30FB\u30D7\u30ED\u30C8\u30B3\u30EB\u7248\u7528\u306E\u30B9\u30BF\u30D6/\u30B9\u30B1\u30EB\u30C8\u30F3\u3092\u4F5C\u6210\u3059\u308B(\u975E\u63A8\u5968)\n -vcompat   1.1\u30681.2\u306E\u30B9\u30BF\u30D6\u30FB\u30D7\u30ED\u30C8\u30B3\u30EB\u7248\u3068\n                 \u4E92\u63DB\u6027\u306E\u3042\u308B\u30B9\u30BF\u30D6/\u30B9\u30B1\u30EB\u30C8\u30F3\u3092\u4F5C\u6210\u3059\u308B(\u975E\u63A8\u5968)\n -v1.2      (\u30C7\u30D5\u30A9\u30EB\u30C8)1.2\u30B9\u30BF\u30D6\u30FB\u30D7\u30ED\u30C8\u30B3\u30EB\u7248\u5C02\u7528\u306E\u30B9\u30BF\u30D6\u3092\u4F5C\u6210\u3059\u308B(\u975E\u63A8\u5968)\n -iiop      IIOP\u7528\u306E\u30B9\u30BF\u30D6\u3092\u4F5C\u6210\u3059\u308B\u3002\u6307\u5B9A\u3059\u308B\u3068<options>\u306B\u306F\u6B21\u306E\u3082\u306E\u3082\u542B\u307E\u308C\u307E\u3059\u3002\n\n            -always       \u6700\u65B0\u306E\u5834\u5408\u3067\u3082\u30B9\u30BF\u30D6\u3092\u4F5C\u6210\u3059\u308B\n            -alwaysgenerate ("-always"\u3068\u540C\u3058)\n            -nolocalstubs   \u540C\u3058\u30D7\u30ED\u30BB\u30B9\u306B\u3064\u3044\u3066\u6700\u9069\u5316\u3055\u308C\u305F\u30B9\u30BF\u30D6\u306F\u4F5C\u6210\u3057\u306A\u3044\n\n -idl      IDL\u3092\u4F5C\u6210\u3059\u308B\u3002\u6307\u5B9A\u3059\u308B\u3068<options>\u306B\u306F\u6B21\u306E\u3082\u306E\u3082\u542B\u307E\u308C\u307E\u3059\u3002\n\n            -noValueMethods valuetypes\u306B\u5BFE\u3057\u3066\u30E1\u30BD\u30C3\u30C9\u3092\u751F\u6210\u3057\u306A\u3044\n            -always       \u6700\u65B0\u306E\u5834\u5408\u3067\u3082IDL\u3092\u751F\u6210\u3059\u308B\n            -alwaysgenerate ("-always"\u3068\u540C\u3058)\n\n -g        \u30C7\u30D0\u30C3\u30B0\u60C5\u5831\u3092\u751F\u6210\u3059\u308B\n -nowarn     \u8B66\u544A\u3092\u751F\u6210\u3057\u306A\u3044\n -nowrite    \u30B3\u30F3\u30D1\u30A4\u30EB\u3057\u305F\u30AF\u30E9\u30B9\u3092\u30D5\u30A1\u30A4\u30EB\u30FB\u30B7\u30B9\u30C6\u30E0\u306B\u66F8\u304D\u8FBC\u307E\u306A\u3044\n -verbose    \u30B3\u30F3\u30D1\u30A4\u30E9\u306E\u52D5\u4F5C\u306B\u95A2\u3059\u308B\u30E1\u30C3\u30BB\u30FC\u30B8\u3092\u51FA\u529B\u3059\u308B\n -classpath <path>    \u5165\u529B\u30AF\u30E9\u30B9\u30FB\u30D5\u30A1\u30A4\u30EB\u3092\u691C\u7D22\u3059\u308B\u5834\u6240\u3092\u6307\u5B9A\u3059\u308B\n -bootclasspath<path> \u30D6\u30FC\u30C8\u30B9\u30C8\u30E9\u30C3\u30D7\u30FB\u30AF\u30E9\u30B9\u30FB\u30D5\u30A1\u30A4\u30EB\u306E\u5834\u6240\u3092\u30AA\u30FC\u30D0\u30FC\u30E9\u30A4\u30C9\u3059\u308B\n -extdirs<path>     \u30A4\u30F3\u30B9\u30C8\u30FC\u30EB\u6E08\u62E1\u5F35\u6A5F\u80FD\u306E\u5834\u6240\u3092\u30AA\u30FC\u30D0\u30FC\u30E9\u30A4\u30C9\u3059\u308B\n -d <directory>      \u751F\u6210\u3055\u308C\u305F\u30AF\u30E9\u30B9\u30FB\u30D5\u30A1\u30A4\u30EB\u3092\u683C\u7D0D\u3059\u308B\u5834\u6240\u3092\u6307\u5B9A\u3059\u308B\n -J<runtime flag>  java\u30A4\u30F3\u30BF\u30D7\u30EA\u30BF\u306B\u5F15\u6570\u3092\u6E21\u3059\n
 
 #
 # Generic Messages
@@ -111,6 +111,7 @@
 rmic.must.throw.remoteexception={0}\u306F\u4E0D\u6B63\u306A\u30EA\u30E2\u30FC\u30C8\u30FB\u30A4\u30F3\u30BF\u30D5\u30A7\u30FC\u30B9\u3067\u3059\u3002\u30E1\u30BD\u30C3\u30C9{1}\u306Fjava.rmi.RemoteException\u3092\u30B9\u30ED\u30FC\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002
 rmic.must.only.throw.exception=\u30E1\u30BD\u30C3\u30C9{0}\u306F{1}\u3092\u30B9\u30ED\u30FC\u3059\u308B\u306E\u3067\u4E0D\u6B63\u306A\u30EA\u30E2\u30FC\u30C8\u30FB\u30E1\u30BD\u30C3\u30C9\u5B9F\u88C5\u3067\u3059\u3002\u30EA\u30E2\u30FC\u30C8\u30FB\u30E1\u30BD\u30C3\u30C9\u306E\u5B9F\u88C5\u304C\u30B9\u30ED\u30FC\u3059\u308B\u306E\u306Fjava.lang.Exception\u304B\u305D\u306E\u30B5\u30D6\u30AF\u30E9\u30B9\u306E\u307F\u3067\u3059\u3002
 warn.rmic.tie.found=IIOP "tie"\u306F\u30AF\u30E9\u30B9{0}\u306E\u305F\u3081\u306B\u3042\u308A\u307E\u3059\u3002\n {1}\nPortableRemoteObject.exportObject\u3092\u4F7F\u7528\u3059\u308B\u5834\u5408\u306F\u3053\u306E\u30D5\u30A1\u30A4\u30EB\u3092\u524A\u9664\u3057\u307E\u3059\u3002\u524A\u9664\u3057\u306A\u3044\u3068\u3001\u30B5\u30FC\u30D0\u30FC\u30FB\u30AA\u30D6\u30B8\u30A7\u30AF\u30C8\u306FJRMP\u3067\u306A\u304FIIOP\u306B\u30A8\u30AF\u30B9\u30DD\u30FC\u30C8\u3055\u308C\u307E\u3059\u3002
+rmic.jrmp.stubs.deprecated=\u8B66\u544A: JRMP\u306E\u30B9\u30B1\u30EB\u30C8\u30F3\u3068static\u30B9\u30BF\u30D6\u306E\u751F\u6210\u3068\u4F7F\u7528\u306F\n\u975E\u63A8\u5968\u3067\u3059\u3002\u30B9\u30B1\u30EB\u30C8\u30F3\u306F\u4E0D\u8981\u3067\u3001static\u30B9\u30BF\u30D6\u306F\n\u52D5\u7684\u306B\u751F\u6210\u3055\u308C\u308B\u30B9\u30BF\u30D6\u306B\u5DEE\u3057\u66FF\u3048\u3089\u308C\u307E\u3057\u305F\u3002\u30E6\u30FC\u30B6\u30FC\u306F\n\u30B9\u30B1\u30EB\u30C8\u30F3\u3068static\u30B9\u30BF\u30D6\u3092\u751F\u6210\u3059\u308B\u305F\u3081\u306B{0}\u3092\u4F7F\u7528\u305B\u305A\u306B\u79FB\u884C\u3059\u308B\u3053\u3068\u304C\u3067\u304D\u307E\u3059\u3002\njava.rmi.server.UnicastRemoteObject\u306B\u95A2\u3059\u308B\u30C9\u30AD\u30E5\u30E1\u30F3\u30C8\u3092\u53C2\u7167\u3057\u3066\u304F\u3060\u3055\u3044\u3002
 
 #
 # RMI-IIOP Messages
--- a/src/share/classes/sun/rmi/rmic/resources/rmic_zh_CN.properties	Tue May 13 23:18:27 2014 -0700
+++ b/src/share/classes/sun/rmi/rmic/resources/rmic_zh_CN.properties	Wed May 14 11:00:21 2014 -0700
@@ -1,6 +1,6 @@
 #
 #
-# Copyright (c) 1996, 2013, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 1996, 2014, 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
@@ -71,7 +71,7 @@
 generator.env.idl=sun.rmi.rmic.iiop.BatchEnvironment
 generator.env.xprint=sun.rmi.rmic.iiop.BatchEnvironment
 
-rmic.usage=\u7528\u6CD5: {0} <options> <class names>\n\n\u5176\u4E2D, <options> \u5305\u62EC:\n  -keep          \u4E0D\u5220\u9664\u4E34\u65F6\u751F\u6210\u7684\u6E90\u6587\u4EF6\n  -keepgenerated (\u4E0E "-keep" \u76F8\u540C)\n  -v1.1          \u521B\u5EFA 1.1 \u5B58\u6839\u534F\u8BAE\u7248\u672C\u7684\u5B58\u6839/\u9AA8\u67B6\n  -vcompat       \u521B\u5EFA\u4E0E 1.1 \u548C 1.2 \u5B58\u6839\u534F\u8BAE\u7248\u672C\n                           \u90FD\u517C\u5BB9\u7684\u5B58\u6839/\u9AA8\u67B6\n  -v1.2          (\u9ED8\u8BA4\u503C) \u4EC5\u521B\u5EFA 1.2 \u5B58\u6839\u534F\u8BAE\u7248\u672C\u7684\u5B58\u6839\n  -iiop          \u521B\u5EFA IIOP \u7684\u5B58\u6839\u3002\u5982\u679C\u63D0\u4F9B, <options> \u8FD8\u5305\u62EC:\n\n                   -always           \u521B\u5EFA\u5B58\u6839 (\u5373\u4F7F\u5F53\u524D\u663E\u793A)\n                   -alwaysgenerate   (\u4E0E "-always" \u76F8\u540C)\n                   -nolocalstubs     \u4E0D\u521B\u5EFA\u5BF9\u76F8\u540C\u8FDB\u7A0B\u4F18\u5316\u7684\u5B58\u6839\n\n  -idl           \u521B\u5EFA IDL\u3002\u5982\u679C\u63D0\u4F9B, <options> \u8FD8\u5305\u62EC:\n\n                   -noValueMethods   \u4E0D\u4E3A valuetype \u751F\u6210\u65B9\u6CD5\n                   -always           \u521B\u5EFA IDL (\u5373\u4F7F\u5F53\u524D\u663E\u793A)\n                   -alwaysgenerate   (\u4E0E "-always" \u76F8\u540C)\n\n  -g             \u751F\u6210\u8C03\u8BD5\u4FE1\u606F\n  -nowarn        \u4E0D\u751F\u6210\u4EFB\u4F55\u8B66\u544A\n  -nowrite       \u4E0D\u5C06\u7F16\u8BD1\u7684\u7C7B\u5199\u5165\u6587\u4EF6\u7CFB\u7EDF\n  -verbose       \u8F93\u51FA\u6709\u5173\u7F16\u8BD1\u5668\u6B63\u5728\u6267\u884C\u7684\u64CD\u4F5C\u7684\u6D88\u606F\n  -classpath <path>      \u6307\u5B9A\u67E5\u627E\u8F93\u5165\u7C7B\u6587\u4EF6\u7684\u4F4D\u7F6E\n  -bootclasspath <path>  \u8986\u76D6\u5F15\u5BFC\u7C7B\u6587\u4EF6\u7684\u4F4D\u7F6E\n  -extdirs <path>        \u8986\u76D6\u6240\u5B89\u88C5\u6269\u5C55\u7684\u4F4D\u7F6E\n  -d <directory>         \u6307\u5B9A\u653E\u7F6E\u751F\u6210\u7684\u7C7B\u6587\u4EF6\u7684\u4F4D\u7F6E\n  -J<runtime flag>       \u5C06\u53C2\u6570\u4F20\u9012\u7ED9 java \u89E3\u91CA\u5668\n
+rmic.usage=\u7528\u6CD5: {0} <options> <class names>\n\n\u5176\u4E2D <options> \u5305\u62EC:\n  -keep          \u4E0D\u5220\u9664\u4E34\u65F6\u751F\u6210\u7684\u6E90\u6587\u4EF6\n  -keepgenerated (\u4E0E "-keep" \u76F8\u540C)\n  -v1.1          \u521B\u5EFA 1.1 \u5B58\u6839\u534F\u8BAE\u7248\u672C\u7684\u5B58\u6839/\u9AA8\u67B6 (\u5DF2\u8FC7\u65F6)\n  -vcompat       \u521B\u5EFA\u4E0E 1.1 \u548C 1.2 \u5B58\u6839\u534F\u8BAE\u7248\u672C\n                           \u90FD\u517C\u5BB9\u7684\u5B58\u6839/\u9AA8\u67B6 (\u5DF2\u8FC7\u65F6)\n  -v1.2          (\u9ED8\u8BA4\u503C) \u4EC5\u521B\u5EFA 1.2 \u5B58\u6839\u534F\u8BAE\u7248\u672C\u7684\u5B58\u6839 (\u5DF2\u8FC7\u65F6)\n  -iiop          \u521B\u5EFA IIOP \u7684\u5B58\u6839\u3002\u5982\u679C\u63D0\u4F9B, <options> \u8FD8\u5305\u62EC:\n\n                   -always           \u521B\u5EFA\u5B58\u6839 (\u5373\u4F7F\u5F53\u524D\u663E\u793A)\n                   -alwaysgenerate   (\u4E0E "-always" \u76F8\u540C)\n                   -nolocalstubs     \u4E0D\u521B\u5EFA\u5BF9\u76F8\u540C\u8FDB\u7A0B\u4F18\u5316\u7684\u5B58\u6839\n\n  -idl           \u521B\u5EFA IDL\u3002\u5982\u679C\u63D0\u4F9B, <options> \u8FD8\u5305\u62EC:\n\n                   -noValueMethods   \u4E0D\u4E3A\u503C\u7C7B\u578B\u751F\u6210\u65B9\u6CD5\n                   -always           \u521B\u5EFA IDL (\u5373\u4F7F\u5F53\u524D\u663E\u793A)\n                   -alwaysgenerate   (\u4E0E "-always" \u76F8\u540C)\n\n  -g             \u751F\u6210\u8C03\u8BD5\u4FE1\u606F\n  -nowarn        \u4E0D\u751F\u6210\u4EFB\u4F55\u8B66\u544A\n  -nowrite       \u4E0D\u5C06\u7F16\u8BD1\u7684\u7C7B\u5199\u5165\u6587\u4EF6\u7CFB\u7EDF\n  -verbose       \u8F93\u51FA\u6709\u5173\u7F16\u8BD1\u5668\u6B63\u5728\u6267\u884C\u7684\u64CD\u4F5C\u7684\u6D88\u606F\n  -classpath <path>      \u6307\u5B9A\u67E5\u627E\u8F93\u5165\u7C7B\u6587\u4EF6\u7684\u4F4D\u7F6E\n  -bootclasspath <path>  \u8986\u76D6\u5F15\u5BFC\u7C7B\u6587\u4EF6\u7684\u4F4D\u7F6E\n  -extdirs <path>        \u8986\u76D6\u6240\u5B89\u88C5\u6269\u5C55\u7684\u4F4D\u7F6E\n  -d <directory>         \u6307\u5B9A\u653E\u7F6E\u751F\u6210\u7684\u7C7B\u6587\u4EF6\u7684\u4F4D\u7F6E\n  -J<runtime flag>       \u5C06\u53C2\u6570\u4F20\u9012\u7ED9 java \u89E3\u91CA\u5668\n
 
 #
 # Generic Messages
@@ -111,6 +111,7 @@
 rmic.must.throw.remoteexception={0}\u4E0D\u662F\u6709\u6548\u8FDC\u7A0B\u63A5\u53E3: \u65B9\u6CD5{1}\u5FC5\u987B\u629B\u51FA java.rmi.RemoteException\u3002
 rmic.must.only.throw.exception=\u65B9\u6CD5{0}\u4E0D\u662F\u6709\u6548\u7684\u8FDC\u7A0B\u65B9\u6CD5\u5B9E\u73B0, \u56E0\u4E3A\u5B83\u629B\u51FA\u4E86{1}; \u8FDC\u7A0B\u65B9\u6CD5\u5B9E\u73B0\u53EA\u53EF\u80FD\u629B\u51FA java.lang.Exception \u6216\u5176\u5B50\u7C7B\u3002
 warn.rmic.tie.found=\u5BF9\u4E8E\u7C7B{0}, \u5B58\u5728 IIOP "tie":\n  {1}\n\u5982\u679C\u4F7F\u7528 PortableRemoteObject.exportObject, \u5219\u5E94\u8BE5\u5220\u9664\u6B64\u6587\u4EF6, \u5426\u5219, \u60A8\u7684\u670D\u52A1\u5668\u5BF9\u8C61\u5C06\u4F1A\u5BFC\u51FA\u5230 IIOP \u800C\u975E JRMP\u3002
+rmic.jrmp.stubs.deprecated=\u8B66\u544A: \u4E3A JRMP \u751F\u6210\u548C\u4F7F\u7528\u9AA8\u67B6\u53CA\u9759\u6001\u5B58\u6839\n\u5DF2\u8FC7\u65F6\u3002\u9AA8\u67B6\u4E0D\u518D\u5FC5\u8981, \u800C\u9759\u6001\u5B58\u6839\n\u5DF2\u7531\u52A8\u6001\u751F\u6210\u7684\u5B58\u6839\u53D6\u4EE3\u3002\u5EFA\u8BAE\u7528\u6237\n\u4E0D\u518D\u4F7F\u7528{0}\u6765\u751F\u6210\u9AA8\u67B6\u548C\u9759\u6001\u5B58\u6839\u3002\n\u8BF7\u53C2\u9605 java.rmi.server.UnicastRemoteObject \u7684\u6587\u6863\u3002
 
 #
 # RMI-IIOP Messages
--- a/src/share/classes/sun/security/internal/spec/TlsRsaPremasterSecretParameterSpec.java	Tue May 13 23:18:27 2014 -0700
+++ b/src/share/classes/sun/security/internal/spec/TlsRsaPremasterSecretParameterSpec.java	Wed May 14 11:00:21 2014 -0700
@@ -26,11 +26,11 @@
 package sun.security.internal.spec;
 
 import java.security.spec.AlgorithmParameterSpec;
+import java.security.AccessController;
+import java.security.PrivilegedAction;
 
 /**
- * Parameters for SSL/TLS RSA Premaster secret generation.
- * This class is used by SSL/TLS client to initialize KeyGenerators of the
- * type "TlsRsaPremasterSecret".
+ * Parameters for SSL/TLS RSA premaster secret.
  *
  * <p>Instances of this class are immutable.
  *
@@ -43,90 +43,108 @@
 public class TlsRsaPremasterSecretParameterSpec
         implements AlgorithmParameterSpec {
 
-    private final int majorVersion;
-    private final int minorVersion;
-    private final byte[] encodedSecret;
+    /*
+     * The TLS spec says that the version in the RSA premaster secret must
+     * be the maximum version supported by the client (i.e. the version it
+     * requested in its client hello version). However, we (and other
+     * implementations) used to send the active negotiated version. The
+     * system property below allows to toggle the behavior.
+     */
+    private final static String PROP_NAME =
+                                "com.sun.net.ssl.rsaPreMasterSecretFix";
+
+    /*
+     * Default is "false" (old behavior) for compatibility reasons in
+     * SSLv3/TLSv1.  Later protocols (TLSv1.1+) do not use this property.
+     */
+    private final static boolean rsaPreMasterSecretFix =
+            AccessController.doPrivileged(new PrivilegedAction<Boolean>() {
+                public Boolean run() {
+                    String value = System.getProperty(PROP_NAME);
+                    if (value != null && value.equalsIgnoreCase("true")) {
+                        return Boolean.TRUE;
+                    }
+
+                    return Boolean.FALSE;
+                }
+            });
+
+    private final int clientVersion;
+    private final int serverVersion;
 
     /**
      * Constructs a new TlsRsaPremasterSecretParameterSpec.
-     * <P>
-     * The version numbers will be placed inside the premaster secret to
-     * detect version rollbacks attacks as described in the TLS specification.
-     * Note that they do not indicate the protocol version negotiated for
-     * the handshake.
      *
-     * @param majorVersion the major number of the protocol version
-     * @param minorVersion the minor number of the protocol version
+     * @param clientVersion the version of the TLS protocol by which the
+     *        client wishes to communicate during this session
+     * @param serverVersion the negotiated version of the TLS protocol which
+     *        contains the lower of that suggested by the client in the client
+     *        hello and the highest supported by the server.
      *
-     * @throws IllegalArgumentException if minorVersion or majorVersion are
-     *   negative or larger than 255
+     * @throws IllegalArgumentException if clientVersion or serverVersion are
+     *   negative or larger than (2^16 - 1)
      */
-    public TlsRsaPremasterSecretParameterSpec(int majorVersion,
-            int minorVersion) {
-        this.majorVersion =
-            TlsMasterSecretParameterSpec.checkVersion(majorVersion);
-        this.minorVersion =
-            TlsMasterSecretParameterSpec.checkVersion(minorVersion);
-        this.encodedSecret = null;
+    public TlsRsaPremasterSecretParameterSpec(
+            int clientVersion, int serverVersion) {
+
+        this.clientVersion = checkVersion(clientVersion);
+        this.serverVersion = checkVersion(serverVersion);
     }
 
     /**
-     * Constructs a new TlsRsaPremasterSecretParameterSpec.
-     * <P>
-     * The version numbers will be placed inside the premaster secret to
-     * detect version rollbacks attacks as described in the TLS specification.
-     * Note that they do not indicate the protocol version negotiated for
-     * the handshake.
-     * <P>
-     * Usually, the encoded secret key is a random number that acts as
-     * dummy pre_master_secret to avoid vulnerabilities described by
-     * section 7.4.7.1, RFC 5246.
+     * Returns the version of the TLS protocol by which the client wishes to
+     * communicate during this session.
      *
-     * @param majorVersion the major number of the protocol version
-     * @param minorVersion the minor number of the protocol version
-     * @param encodedSecret the encoded secret key
-     *
-     * @throws IllegalArgumentException if minorVersion or majorVersion are
-     *   negative or larger than 255, or encodedSecret is not exactly 48 bytes.
+     * @return the version of the TLS protocol in ClientHello message
      */
-    public TlsRsaPremasterSecretParameterSpec(int majorVersion,
-            int minorVersion, byte[] encodedSecret) {
-        this.majorVersion =
-            TlsMasterSecretParameterSpec.checkVersion(majorVersion);
-        this.minorVersion =
-            TlsMasterSecretParameterSpec.checkVersion(minorVersion);
-
-        if (encodedSecret == null || encodedSecret.length != 48) {
-            throw new IllegalArgumentException(
-                        "Encoded secret is not exactly 48 bytes");
-        }
-        this.encodedSecret = encodedSecret.clone();
+    public int getClientVersion() {
+        return clientVersion;
     }
 
     /**
-     * Returns the major version.
+     * Returns the negotiated version of the TLS protocol which contains the
+     * lower of that suggested by the client in the client hello and the
+     * highest supported by the server.
      *
-     * @return the major version.
+     * @return the negotiated version of the TLS protocol in ServerHello message
      */
-    public int getMajorVersion() {
-        return majorVersion;
+    public int getServerVersion() {
+        return serverVersion;
     }
 
     /**
-     * Returns the minor version.
+     * Returns the major version used in RSA premaster secret.
      *
-     * @return the minor version.
+     * @return the major version used in RSA premaster secret.
      */
-    public int getMinorVersion() {
-        return minorVersion;
+    public int getMajorVersion() {
+        if (rsaPreMasterSecretFix || clientVersion >= 0x0302) {
+                                                        // 0x0302: TLSv1.1
+            return (clientVersion >>> 8) & 0xFF;
+        }
+
+        return (serverVersion >>> 8) & 0xFF;
     }
 
     /**
-     * Returns the encoded secret.
+     * Returns the minor version used in RSA premaster secret.
      *
-     * @return the encoded secret, may be null if no encoded secret.
+     * @return the minor version used in RSA premaster secret.
      */
-    public byte[] getEncodedSecret() {
-        return encodedSecret == null ? null : encodedSecret.clone();
+    public int getMinorVersion() {
+        if (rsaPreMasterSecretFix || clientVersion >= 0x0302) {
+                                                        // 0x0302: TLSv1.1
+            return clientVersion & 0xFF;
+        }
+
+        return serverVersion & 0xFF;
+    }
+
+    private int checkVersion(int version) {
+        if ((version < 0) || (version > 0xFFFF)) {
+            throw new IllegalArgumentException(
+                        "Version must be between 0 and 65,535");
+        }
+        return version;
     }
 }
--- a/src/share/classes/sun/security/pkcs11/P11RSACipher.java	Tue May 13 23:18:27 2014 -0700
+++ b/src/share/classes/sun/security/pkcs11/P11RSACipher.java	Wed May 14 11:00:21 2014 -0700
@@ -37,6 +37,8 @@
 import static sun.security.pkcs11.TemplateManager.*;
 import sun.security.pkcs11.wrapper.*;
 import static sun.security.pkcs11.wrapper.PKCS11Constants.*;
+import sun.security.internal.spec.TlsRsaPremasterSecretParameterSpec;
+import sun.security.util.KeyUtil;
 
 /**
  * RSA Cipher implementation class. We currently only support
@@ -102,6 +104,12 @@
     // maximum output size. this is the length of the key
     private int outputSize;
 
+    // cipher parameter for TLS RSA premaster secret
+    private AlgorithmParameterSpec spec = null;
+
+    // the source of randomness
+    private SecureRandom random;
+
     P11RSACipher(Token token, String algorithm, long mechanism)
             throws PKCS11Exception {
         super();
@@ -165,8 +173,12 @@
             AlgorithmParameterSpec params, SecureRandom random)
             throws InvalidKeyException, InvalidAlgorithmParameterException {
         if (params != null) {
-            throw new InvalidAlgorithmParameterException
-                ("Parameters not supported");
+            if (!(params instanceof TlsRsaPremasterSecretParameterSpec)) {
+                throw new InvalidAlgorithmParameterException(
+                        "Parameters not supported");
+            }
+            spec = params;
+            this.random = random;   // for TLS RSA premaster secret
         }
         implInit(opmode, key);
     }
@@ -176,8 +188,8 @@
             SecureRandom random)
             throws InvalidKeyException, InvalidAlgorithmParameterException {
         if (params != null) {
-            throw new InvalidAlgorithmParameterException
-                ("Parameters not supported");
+            throw new InvalidAlgorithmParameterException(
+                        "Parameters not supported");
         }
         implInit(opmode, key);
     }
@@ -452,21 +464,101 @@
     protected Key engineUnwrap(byte[] wrappedKey, String algorithm,
             int type) throws InvalidKeyException, NoSuchAlgorithmException {
 
-        // XXX implement unwrap using C_Unwrap() for all keys
-        implInit(Cipher.DECRYPT_MODE, p11Key);
-        if (wrappedKey.length > maxInputSize) {
-            throw new InvalidKeyException("Key is too long for unwrapping");
+        boolean isTlsRsaPremasterSecret =
+                algorithm.equals("TlsRsaPremasterSecret");
+        Exception failover = null;
+
+        SecureRandom secureRandom = random;
+        if (secureRandom == null && isTlsRsaPremasterSecret) {
+            secureRandom = new SecureRandom();
         }
-        implUpdate(wrappedKey, 0, wrappedKey.length);
-        try {
-            byte[] encoded = doFinal();
+
+        // Should C_Unwrap be preferred for non-TLS RSA premaster secret?
+        if (token.supportsRawSecretKeyImport()) {
+            // XXX implement unwrap using C_Unwrap() for all keys
+            implInit(Cipher.DECRYPT_MODE, p11Key);
+            if (wrappedKey.length > maxInputSize) {
+                throw new InvalidKeyException("Key is too long for unwrapping");
+            }
+
+            byte[] encoded = null;
+            implUpdate(wrappedKey, 0, wrappedKey.length);
+            try {
+                encoded = doFinal();
+            } catch (BadPaddingException e) {
+                if (isTlsRsaPremasterSecret) {
+                    failover = e;
+                } else {
+                    throw new InvalidKeyException("Unwrapping failed", e);
+                }
+            } catch (IllegalBlockSizeException e) {
+                // should not occur, handled with length check above
+                throw new InvalidKeyException("Unwrapping failed", e);
+            }
+
+            if (isTlsRsaPremasterSecret) {
+                if (!(spec instanceof TlsRsaPremasterSecretParameterSpec)) {
+                    throw new IllegalStateException(
+                            "No TlsRsaPremasterSecretParameterSpec specified");
+                }
+
+                // polish the TLS premaster secret
+                TlsRsaPremasterSecretParameterSpec psps =
+                        (TlsRsaPremasterSecretParameterSpec)spec;
+                encoded = KeyUtil.checkTlsPreMasterSecretKey(
+                        psps.getClientVersion(), psps.getServerVersion(),
+                        secureRandom, encoded, (failover != null));
+            }
+
             return ConstructKeys.constructKey(encoded, algorithm, type);
-        } catch (BadPaddingException e) {
-            // should not occur
-            throw new InvalidKeyException("Unwrapping failed", e);
-        } catch (IllegalBlockSizeException e) {
-            // should not occur, handled with length check above
-            throw new InvalidKeyException("Unwrapping failed", e);
+        } else {
+            Session s = null;
+            SecretKey secretKey = null;
+            try {
+                try {
+                    s = token.getObjSession();
+                    long keyType = CKK_GENERIC_SECRET;
+                    CK_ATTRIBUTE[] attributes = new CK_ATTRIBUTE[] {
+                            new CK_ATTRIBUTE(CKA_CLASS, CKO_SECRET_KEY),
+                            new CK_ATTRIBUTE(CKA_KEY_TYPE, keyType),
+                        };
+                    attributes = token.getAttributes(
+                            O_IMPORT, CKO_SECRET_KEY, keyType, attributes);
+                    long keyID = token.p11.C_UnwrapKey(s.id(),
+                            new CK_MECHANISM(mechanism), p11Key.keyID,
+                            wrappedKey, attributes);
+                    secretKey = P11Key.secretKey(s, keyID,
+                            algorithm, 48 << 3, attributes);
+                } catch (PKCS11Exception e) {
+                    if (isTlsRsaPremasterSecret) {
+                        failover = e;
+                    } else {
+                        throw new InvalidKeyException("unwrap() failed", e);
+                    }
+                }
+
+                if (isTlsRsaPremasterSecret) {
+                    byte[] replacer = new byte[48];
+                    if (failover == null) {
+                        // Does smart compiler dispose this operation?
+                        secureRandom.nextBytes(replacer);
+                    }
+
+                    TlsRsaPremasterSecretParameterSpec psps =
+                            (TlsRsaPremasterSecretParameterSpec)spec;
+
+                    // Please use the tricky failover and replacer byte array
+                    // as the parameters so that smart compiler won't dispose
+                    // the unused variable .
+                    secretKey = polishPreMasterSecretKey(token, s,
+                            failover, replacer, secretKey,
+                            psps.getClientVersion(), psps.getServerVersion());
+                }
+
+                return secretKey;
+            } finally {
+                token.releaseSession(s);
+            }
         }
     }
 
@@ -475,6 +567,34 @@
         int n = P11KeyFactory.convertKey(token, key, algorithm).length();
         return n;
     }
+
+    private static SecretKey polishPreMasterSecretKey(
+            Token token, Session session,
+            Exception failover, byte[] replacer, SecretKey secretKey,
+            int clientVersion, int serverVersion) {
+
+        if (failover != null) {
+            CK_VERSION version = new CK_VERSION(
+                    (clientVersion >>> 8) & 0xFF, clientVersion & 0xFF);
+            try {
+                CK_ATTRIBUTE[] attributes = token.getAttributes(
+                        O_GENERATE, CKO_SECRET_KEY,
+                        CKK_GENERIC_SECRET, new CK_ATTRIBUTE[0]);
+                long keyID = token.p11.C_GenerateKey(session.id(),
+                    // new CK_MECHANISM(CKM_TLS_PRE_MASTER_KEY_GEN, version),
+                        new CK_MECHANISM(CKM_SSL3_PRE_MASTER_KEY_GEN, version),
+                        attributes);
+                return P11Key.secretKey(session,
+                        keyID, "TlsRsaPremasterSecret", 48 << 3, attributes);
+            } catch (PKCS11Exception e) {
+                throw new ProviderException(
+                        "Could not generate premaster secret", e);
+            }
+        }
+
+        return secretKey;
+    }
+
 }
 
 final class ConstructKeys {
--- a/src/share/classes/sun/security/pkcs11/P11TlsRsaPremasterSecretGenerator.java	Tue May 13 23:18:27 2014 -0700
+++ b/src/share/classes/sun/security/pkcs11/P11TlsRsaPremasterSecretGenerator.java	Wed May 14 11:00:21 2014 -0700
@@ -73,7 +73,7 @@
 
     protected void engineInit(AlgorithmParameterSpec params,
             SecureRandom random) throws InvalidAlgorithmParameterException {
-        if (params instanceof TlsRsaPremasterSecretParameterSpec == false) {
+        if (!(params instanceof TlsRsaPremasterSecretParameterSpec)) {
             throw new InvalidAlgorithmParameterException(MSG);
         }
         this.spec = (TlsRsaPremasterSecretParameterSpec)params;
@@ -83,38 +83,32 @@
         throw new InvalidParameterException(MSG);
     }
 
+    // Only can be used in client side to generate TLS RSA premaster secret.
     protected SecretKey engineGenerateKey() {
         if (spec == null) {
             throw new IllegalStateException
                         ("TlsRsaPremasterSecretGenerator must be initialized");
         }
 
-        byte[] b = spec.getEncodedSecret();
-        if (b == null) {
-            CK_VERSION version = new CK_VERSION(
+        CK_VERSION version = new CK_VERSION(
                         spec.getMajorVersion(), spec.getMinorVersion());
-            Session session = null;
-            try {
-                session = token.getObjSession();
-                CK_ATTRIBUTE[] attributes = token.getAttributes(
-                        O_GENERATE, CKO_SECRET_KEY,
-                        CKK_GENERIC_SECRET, new CK_ATTRIBUTE[0]);
-                long keyID = token.p11.C_GenerateKey(session.id(),
-                        new CK_MECHANISM(mechanism, version), attributes);
-                SecretKey key = P11Key.secretKey(session,
-                        keyID, "TlsRsaPremasterSecret", 48 << 3, attributes);
-                return key;
-            } catch (PKCS11Exception e) {
-                throw new ProviderException(
-                        "Could not generate premaster secret", e);
-            } finally {
-                token.releaseSession(session);
-            }
+        Session session = null;
+        try {
+            session = token.getObjSession();
+            CK_ATTRIBUTE[] attributes = token.getAttributes(
+                    O_GENERATE, CKO_SECRET_KEY,
+                    CKK_GENERIC_SECRET, new CK_ATTRIBUTE[0]);
+            long keyID = token.p11.C_GenerateKey(session.id(),
+                    new CK_MECHANISM(mechanism, version), attributes);
+            SecretKey key = P11Key.secretKey(session,
+                    keyID, "TlsRsaPremasterSecret", 48 << 3, attributes);
+            return key;
+        } catch (PKCS11Exception e) {
+            throw new ProviderException(
+                    "Could not generate premaster secret", e);
+        } finally {
+            token.releaseSession(session);
         }
-
-        // Won't worry, the TlsRsaPremasterSecret will be soon converted to
-        // TlsMasterSecret.
-        return new SecretKeySpec(b, "TlsRsaPremasterSecret");
     }
 
 }
--- a/src/share/classes/sun/security/pkcs11/Token.java	Tue May 13 23:18:27 2014 -0700
+++ b/src/share/classes/sun/security/pkcs11/Token.java	Wed May 14 11:00:21 2014 -0700
@@ -36,6 +36,7 @@
 import sun.security.jca.JCAUtil;
 
 import sun.security.pkcs11.wrapper.*;
+import static sun.security.pkcs11.TemplateManager.*;
 import static sun.security.pkcs11.wrapper.PKCS11Constants.*;
 
 /**
@@ -122,6 +123,9 @@
     private final static CK_MECHANISM_INFO INVALID_MECH =
         new CK_MECHANISM_INFO(0, 0, 0);
 
+    // flag indicating whether the token supports raw secret key material import
+    private Boolean supportsRawSecretKeyImport;
+
     Token(SunPKCS11 provider) throws PKCS11Exception {
         this.provider = provider;
         this.removable = provider.removable;
@@ -160,6 +164,36 @@
         return writeProtected;
     }
 
+    // return whether the token supports raw secret key material import
+    boolean supportsRawSecretKeyImport() {
+        if (supportsRawSecretKeyImport == null) {
+            SecureRandom random = JCAUtil.getSecureRandom();
+            byte[] encoded = new byte[48];
+            random.nextBytes(encoded);
+
+            CK_ATTRIBUTE[] attributes = new CK_ATTRIBUTE[3];
+            attributes[0] = new CK_ATTRIBUTE(CKA_CLASS, CKO_SECRET_KEY);
+            attributes[1] = new CK_ATTRIBUTE(CKA_KEY_TYPE, CKK_GENERIC_SECRET);
+            attributes[2] = new CK_ATTRIBUTE(CKA_VALUE, encoded);
+
+            Session session = null;
+            try {
+                attributes = getAttributes(O_IMPORT,
+                        CKO_SECRET_KEY, CKK_GENERIC_SECRET, attributes);
+                session = getObjSession();
+                long keyID = p11.C_CreateObject(session.id(), attributes);
+
+                supportsRawSecretKeyImport = Boolean.TRUE;
+            } catch (PKCS11Exception e) {
+                supportsRawSecretKeyImport = Boolean.FALSE;
+            } finally {
+                releaseSession(session);
+            }
+        }
+
+        return supportsRawSecretKeyImport;
+    }
+
     // return whether we are logged in
     // uses cached result if current. session is optional and may be null
     boolean isLoggedIn(Session session) throws PKCS11Exception {
--- a/src/share/classes/sun/security/ssl/ByteBufferInputStream.java	Tue May 13 23:18:27 2014 -0700
+++ b/src/share/classes/sun/security/ssl/ByteBufferInputStream.java	Wed May 14 11:00:21 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2014, 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
@@ -60,7 +60,8 @@
         if (bb.remaining() == 0) {
             return -1;
         }
-        return bb.get();
+
+        return (bb.get() & 0xFF);   // need to be in the range 0 to 255
     }
 
     /**
--- a/src/share/classes/sun/security/ssl/EngineInputRecord.java	Tue May 13 23:18:27 2014 -0700
+++ b/src/share/classes/sun/security/ssl/EngineInputRecord.java	Wed May 14 11:00:21 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2014, 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
@@ -109,14 +109,8 @@
             ProtocolVersion recordVersion =
                 ProtocolVersion.valueOf(buf.get(pos + 1), buf.get(pos + 2));
 
-            // Check if too old (currently not possible)
-            // or if the major version does not match.
-            // The actual version negotiation is in the handshaker classes
-            if ((recordVersion.v < ProtocolVersion.MIN.v)
-                    || (recordVersion.major > ProtocolVersion.MAX.major)) {
-                throw new SSLException(
-                    "Unsupported record version " + recordVersion);
-            }
+            // check the record version
+            checkRecordVersion(recordVersion, false);
 
             /*
              * Reasonably sure this is a V3, disable further checks.
@@ -147,18 +141,8 @@
                 ProtocolVersion recordVersion =
                     ProtocolVersion.valueOf(buf.get(pos + 3), buf.get(pos + 4));
 
-                // Check if too old (currently not possible)
-                // or if the major version does not match.
-                // The actual version negotiation is in the handshaker classes
-                if ((recordVersion.v < ProtocolVersion.MIN.v)
-                        || (recordVersion.major > ProtocolVersion.MAX.major)) {
-
-                    // if it's not SSLv2, we're out of here.
-                    if (recordVersion.v != ProtocolVersion.SSL20Hello.v) {
-                        throw new SSLException(
-                            "Unsupported record version " + recordVersion);
-                    }
-                }
+                // check the record version
+                checkRecordVersion(recordVersion, true);
 
                 /*
                  * Client or Server Hello
@@ -406,14 +390,9 @@
 
         ProtocolVersion recordVersion = ProtocolVersion.valueOf(
                 srcBB.get(srcPos + 1), srcBB.get(srcPos + 2));
-        // Check if too old (currently not possible)
-        // or if the major version does not match.
-        // The actual version negotiation is in the handshaker classes
-        if ((recordVersion.v < ProtocolVersion.MIN.v)
-                || (recordVersion.major > ProtocolVersion.MAX.major)) {
-            throw new SSLException(
-                "Unsupported record version " + recordVersion);
-        }
+
+        // check the record version
+        checkRecordVersion(recordVersion, false);
 
         /*
          * It's really application data.  How much to consume?
--- a/src/share/classes/sun/security/ssl/InputRecord.java	Tue May 13 23:18:27 2014 -0700
+++ b/src/share/classes/sun/security/ssl/InputRecord.java	Wed May 14 11:00:21 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1996, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1996, 2014, 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
@@ -534,19 +534,35 @@
     }
 
     /**
+     * Return true if the specified record protocol version is out of the
+     * range of the possible supported versions.
+     */
+    static void checkRecordVersion(ProtocolVersion version,
+            boolean allowSSL20Hello) throws SSLException {
+        // Check if the record version is too old (currently not possible)
+        // or if the major version does not match.
+        //
+        // The actual version negotiation is in the handshaker classes
+        if ((version.v < ProtocolVersion.MIN.v) ||
+            ((version.major & 0xFF) > (ProtocolVersion.MAX.major & 0xFF))) {
+
+            // if it's not SSLv2, we're out of here.
+            if (!allowSSL20Hello ||
+                    (version.v != ProtocolVersion.SSL20Hello.v)) {
+                throw new SSLException("Unsupported record version " + version);
+            }
+        }
+    }
+
+    /**
      * Read a SSL/TLS record. Throw an IOException if the format is invalid.
      */
     private void readV3Record(InputStream s, OutputStream o)
             throws IOException {
         ProtocolVersion recordVersion = ProtocolVersion.valueOf(buf[1], buf[2]);
-        // Check if too old (currently not possible)
-        // or if the major version does not match.
-        // The actual version negotiation is in the handshaker classes
-        if ((recordVersion.v < ProtocolVersion.MIN.v)
-                || (recordVersion.major > ProtocolVersion.MAX.major)) {
-            throw new SSLException(
-                "Unsupported record version " + recordVersion);
-        }
+
+        // check the record version
+        checkRecordVersion(recordVersion, false);
 
         /*
          * Get and check length, then the data.
--- a/src/share/classes/sun/security/ssl/ProtocolVersion.java	Tue May 13 23:18:27 2014 -0700
+++ b/src/share/classes/sun/security/ssl/ProtocolVersion.java	Wed May 14 11:00:21 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2014, 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
@@ -101,7 +101,7 @@
         this.v = v;
         this.name = name;
         major = (byte)(v >>> 8);
-        minor = (byte)(v & 0xff);
+        minor = (byte)(v & 0xFF);
     }
 
     // private
@@ -117,8 +117,8 @@
         } else if (v == SSL20Hello.v) {
             return SSL20Hello;
         } else {
-            int major = (v >>> 8) & 0xff;
-            int minor = v & 0xff;
+            int major = (v >>> 8) & 0xFF;
+            int minor = v & 0xFF;
             return new ProtocolVersion(v, "Unknown-" + major + "." + minor);
         }
     }
@@ -128,10 +128,7 @@
      * numbers. Never throws exceptions.
      */
     public static ProtocolVersion valueOf(int major, int minor) {
-        major &= 0xff;
-        minor &= 0xff;
-        int v = (major << 8) | minor;
-        return valueOf(v);
+        return valueOf(((major & 0xFF) << 8) | (minor & 0xFF));
     }
 
     /**
--- a/src/share/classes/sun/security/ssl/RSAClientKeyExchange.java	Tue May 13 23:18:27 2014 -0700
+++ b/src/share/classes/sun/security/ssl/RSAClientKeyExchange.java	Wed May 14 11:00:21 2014 -0700
@@ -48,23 +48,6 @@
  */
 final class RSAClientKeyExchange extends HandshakeMessage {
 
-    /**
-     * The TLS spec says that the version in the RSA premaster secret must
-     * be the maximum version supported by the client (i.e. the version it
-     * requested in its client hello version). However, we (and other
-     * implementations) used to send the active negotiated version. The
-     * system property below allows to toggle the behavior.
-     */
-    private final static String PROP_NAME =
-                                "com.sun.net.ssl.rsaPreMasterSecretFix";
-
-    /*
-     * Default is "false" (old behavior) for compatibility reasons in
-     * SSLv3/TLSv1.  Later protocols (TLSv1.1+) do not use this property.
-     */
-    private final static boolean rsaPreMasterSecretFix =
-                                Debug.getBooleanProperty(PROP_NAME, false);
-
     /*
      * The following field values were encrypted with the server's public
      * key (or temp key from server key exchange msg) and are presented
@@ -88,22 +71,12 @@
         }
         this.protocolVersion = protocolVersion;
 
-        int major, minor;
-
-        if (rsaPreMasterSecretFix || maxVersion.v >= ProtocolVersion.TLS11.v) {
-            major = maxVersion.major;
-            minor = maxVersion.minor;
-        } else {
-            major = protocolVersion.major;
-            minor = protocolVersion.minor;
-        }
-
         try {
             String s = ((protocolVersion.v >= ProtocolVersion.TLS12.v) ?
                 "SunTls12RsaPremasterSecret" : "SunTlsRsaPremasterSecret");
             KeyGenerator kg = JsseJce.getKeyGenerator(s);
-            kg.init(new TlsRsaPremasterSecretParameterSpec(major, minor),
-                    generator);
+            kg.init(new TlsRsaPremasterSecretParameterSpec(
+                    maxVersion.v, protocolVersion.v), generator);
             preMaster = kg.generateKey();
 
             Cipher cipher = JsseJce.getCipher(JsseJce.CIPHER_RSA_PKCS1);
@@ -138,18 +111,16 @@
             }
         }
 
-        Exception failover = null;
-        byte[] encoded = null;
         try {
             Cipher cipher = JsseJce.getCipher(JsseJce.CIPHER_RSA_PKCS1);
-            // Cannot generate key here, please don't use Cipher.UNWRAP_MODE!
-            cipher.init(Cipher.DECRYPT_MODE, privateKey);
-            encoded = cipher.doFinal(encrypted);
-        } catch (BadPaddingException bpe) {
-            failover = bpe;
-            encoded = null;
-        } catch (IllegalBlockSizeException ibse) {
-            // the message it too big to process with RSA
+            cipher.init(Cipher.UNWRAP_MODE, privateKey,
+                    new TlsRsaPremasterSecretParameterSpec(
+                            maxVersion.v, currentVersion.v),
+                    generator);
+            preMaster = (SecretKey)cipher.unwrap(encrypted,
+                                "TlsRsaPremasterSecret", Cipher.SECRET_KEY);
+        } catch (InvalidKeyException ibk) {
+            // the message is too big to process with RSA
             throw new SSLProtocolException(
                 "Unable to process PreMasterSecret, may be too big");
         } catch (Exception e) {
@@ -160,124 +131,6 @@
             }
             throw new RuntimeException("Could not generate dummy secret", e);
         }
-
-        // polish the premaster secret
-        preMaster = polishPreMasterSecretKey(
-                    currentVersion, maxVersion, generator, encoded, failover);
-    }
-
-    /**
-     * To avoid vulnerabilities described by section 7.4.7.1, RFC 5246,
-     * treating incorrectly formatted message blocks and/or mismatched
-     * version numbers in a manner indistinguishable from correctly
-     * formatted RSA blocks.
-     *
-     * RFC 5246 describes the approach as :
-     *
-     *  1. Generate a string R of 48 random bytes
-     *
-     *  2. Decrypt the message to recover the plaintext M
-     *
-     *  3. If the PKCS#1 padding is not correct, or the length of message
-     *     M is not exactly 48 bytes:
-     *        pre_master_secret = R
-     *     else If ClientHello.client_version <= TLS 1.0, and version
-     *     number check is explicitly disabled:
-     *        premaster secret = M
-     *     else If M[0..1] != ClientHello.client_version:
-     *        premaster secret = R
-     *     else:
-     *        premaster secret = M
-     *
-     * Note that #2 has completed before the call of this method.
-     */
-    private SecretKey polishPreMasterSecretKey(ProtocolVersion currentVersion,
-            ProtocolVersion clientHelloVersion, SecureRandom generator,
-            byte[] encoded, Exception failoverException) {
-
-        this.protocolVersion = clientHelloVersion;
-        if (generator == null) {
-            generator = new SecureRandom();
-        }
-        byte[] random = new byte[48];
-        generator.nextBytes(random);
-
-        if (failoverException == null && encoded != null) {
-            // check the length
-            if (encoded.length != 48) {
-                if (debug != null && Debug.isOn("handshake")) {
-                    System.out.println(
-                        "incorrect length of premaster secret: " +
-                        encoded.length);
-                }
-
-                return generatePreMasterSecret(
-                        clientHelloVersion, random, generator);
-            }
-
-            if (clientHelloVersion.major != encoded[0] ||
-                        clientHelloVersion.minor != encoded[1]) {
-
-                if (clientHelloVersion.v <= ProtocolVersion.TLS10.v &&
-                       currentVersion.major == encoded[0] &&
-                       currentVersion.minor == encoded[1]) {
-                    /*
-                     * For compatibility, we maintain the behavior that the
-                     * version in pre_master_secret can be the negotiated
-                     * version for TLS v1.0 and SSL v3.0.
-                     */
-                    this.protocolVersion = currentVersion;
-                } else {
-                    if (debug != null && Debug.isOn("handshake")) {
-                        System.out.println("Mismatching Protocol Versions, " +
-                            "ClientHello.client_version is " +
-                            clientHelloVersion +
-                            ", while PreMasterSecret.client_version is " +
-                            ProtocolVersion.valueOf(encoded[0], encoded[1]));
-                    }
-
-                    encoded = random;
-                }
-            }
-
-            return generatePreMasterSecret(
-                    clientHelloVersion, encoded, generator);
-        }
-
-        if (debug != null && Debug.isOn("handshake") &&
-                        failoverException != null) {
-            System.out.println("Error decrypting premaster secret:");
-            failoverException.printStackTrace(System.out);
-        }
-
-        return generatePreMasterSecret(clientHelloVersion, random, generator);
-    }
-
-    // generate a premaster secret with the specified version number
-    private static SecretKey generatePreMasterSecret(
-            ProtocolVersion version, byte[] encodedSecret,
-            SecureRandom generator) {
-
-        if (debug != null && Debug.isOn("handshake")) {
-            System.out.println("Generating a random fake premaster secret");
-        }
-
-        try {
-            String s = ((version.v >= ProtocolVersion.TLS12.v) ?
-                "SunTls12RsaPremasterSecret" : "SunTlsRsaPremasterSecret");
-            KeyGenerator kg = JsseJce.getKeyGenerator(s);
-            kg.init(new TlsRsaPremasterSecretParameterSpec(
-                    version.major, version.minor, encodedSecret), generator);
-            return kg.generateKey();
-        } catch (InvalidAlgorithmParameterException |
-                NoSuchAlgorithmException iae) {
-            // unlikely to happen, otherwise, must be a provider exception
-            if (debug != null && Debug.isOn("handshake")) {
-                System.out.println("RSA premaster secret generation error:");
-                iae.printStackTrace(System.out);
-            }
-            throw new RuntimeException("Could not generate dummy secret", iae);
-        }
     }
 
     @Override
--- a/src/share/classes/sun/security/tools/jarsigner/Resources_ja.java	Tue May 13 23:18:27 2014 -0700
+++ b/src/share/classes/sun/security/tools/jarsigner/Resources_ja.java	Wed May 14 11:00:21 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2014, 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
@@ -135,7 +135,10 @@
         {".Unsigned.entries.", "(\u672A\u7F72\u540D\u306E\u30A8\u30F3\u30C8\u30EA)"},
         {"jar.is.unsigned.signatures.missing.or.not.parsable.",
                 "jar\u306F\u7F72\u540D\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002(\u30B7\u30B0\u30CD\u30C1\u30E3\u304C\u898B\u3064\u304B\u3089\u306A\u3044\u304B\u3001\u69CB\u6587\u89E3\u6790\u3067\u304D\u307E\u305B\u3093)"},
+        {"jar.signed.", "jar\u306F\u7F72\u540D\u3055\u308C\u307E\u3057\u305F\u3002"},
+        {"jar.signed.with.signer.errors.", "jar\u306F\u7F72\u540D\u3055\u308C\u307E\u3057\u305F - \u7F72\u540D\u8005\u30A8\u30E9\u30FC\u304C\u3042\u308A\u307E\u3059\u3002"},
         {"jar.verified.", "jar\u304C\u691C\u8A3C\u3055\u308C\u307E\u3057\u305F\u3002"},
+        {"jar.verified.with.signer.errors.", "jar\u306F\u691C\u8A3C\u3055\u308C\u307E\u3057\u305F - \u7F72\u540D\u8005\u30A8\u30E9\u30FC\u304C\u3042\u308A\u307E\u3059\u3002"},
         {"jarsigner.", "jarsigner: "},
         {"signature.filename.must.consist.of.the.following.characters.A.Z.0.9.or.",
                 "\u30B7\u30B0\u30CD\u30C1\u30E3\u306E\u30D5\u30A1\u30A4\u30EB\u540D\u306B\u4F7F\u7528\u3067\u304D\u308B\u6587\u5B57\u306F\u3001A-Z\u30010-9\u3001_\u3001- \u306E\u307F\u3067\u3059\u3002"},
@@ -191,6 +194,7 @@
                 "\u4EE3\u66FF\u7F72\u540D\u30E1\u30AB\u30CB\u30BA\u30E0\u306E\u4F7F\u7528"},
         {"entry.was.signed.on", "\u30A8\u30F3\u30C8\u30EA\u306F{0}\u306B\u7F72\u540D\u3055\u308C\u307E\u3057\u305F"},
         {"Warning.", "\u8B66\u544A: "},
+        {"Error.", "\u30A8\u30E9\u30FC: "},
         {"This.jar.contains.unsigned.entries.which.have.not.been.integrity.checked.",
                 "\u3053\u306Ejar\u306B\u306F\u3001\u6574\u5408\u6027\u30C1\u30A7\u30C3\u30AF\u3092\u3057\u3066\u3044\u306A\u3044\u672A\u7F72\u540D\u306E\u30A8\u30F3\u30C8\u30EA\u304C\u542B\u307E\u308C\u3066\u3044\u307E\u3059\u3002 "},
         {"This.jar.contains.entries.whose.signer.certificate.has.expired.",
@@ -227,6 +231,10 @@
                 "\u7F72\u540D\u8005\u306E\u8A3C\u660E\u66F8\u30C1\u30A7\u30FC\u30F3\u304C\u307E\u3060\u691C\u8A3C\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002"},
         {"This.jar.contains.entries.whose.certificate.chain.is.not.validated.",
                  "\u3053\u306Ejar\u306B\u306F\u3001\u8A3C\u660E\u66F8\u30C1\u30A7\u30FC\u30F3\u304C\u307E\u3060\u691C\u8A3C\u3055\u308C\u3066\u3044\u306A\u3044\u30A8\u30F3\u30C8\u30EA\u304C\u542B\u307E\u308C\u3066\u3044\u307E\u3059\u3002"},
+        {"no.timestamp.signing",
+                "-tsa\u307E\u305F\u306F-tsacert\u304C\u6307\u5B9A\u3055\u308C\u3066\u3044\u306A\u3044\u305F\u3081\u3001\u3053\u306Ejar\u306B\u306F\u30BF\u30A4\u30E0\u30B9\u30BF\u30F3\u30D7\u304C\u4ED8\u52A0\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002\u30BF\u30A4\u30E0\u30B9\u30BF\u30F3\u30D7\u304C\u306A\u3044\u3068\u3001\u7F72\u540D\u8005\u8A3C\u660E\u66F8\u306E\u6709\u52B9\u671F\u9650(%1$tY-%1$tm-%1$td)\u5F8C\u307E\u305F\u306F\u5C06\u6765\u306E\u5931\u52B9\u65E5\u5F8C\u306B\u3001\u30E6\u30FC\u30B6\u30FC\u306F\u3053\u306Ejar\u3092\u691C\u8A3C\u3067\u304D\u306A\u3044\u53EF\u80FD\u6027\u304C\u3042\u308A\u307E\u3059\u3002"},
+        {"no.timestamp.verifying",
+                "\u3053\u306Ejar\u306B\u306F\u3001\u30BF\u30A4\u30E0\u30B9\u30BF\u30F3\u30D7\u304C\u306A\u3044\u7F72\u540D\u304C\u542B\u307E\u308C\u3066\u3044\u307E\u3059\u3002\u30BF\u30A4\u30E0\u30B9\u30BF\u30F3\u30D7\u304C\u306A\u3044\u3068\u3001\u7F72\u540D\u8005\u8A3C\u660E\u66F8\u306E\u6709\u52B9\u671F\u9650(%1$tY-%1$tm-%1$td)\u5F8C\u307E\u305F\u306F\u5C06\u6765\u306E\u5931\u52B9\u65E5\u5F8C\u306B\u3001\u30E6\u30FC\u30B6\u30FC\u306F\u3053\u306Ejar\u3092\u691C\u8A3C\u3067\u304D\u306A\u3044\u53EF\u80FD\u6027\u304C\u3042\u308A\u307E\u3059\u3002"},
         {"Unknown.password.type.", "\u4E0D\u660E\u306A\u30D1\u30B9\u30EF\u30FC\u30C9\u30FB\u30BF\u30A4\u30D7: "},
         {"Cannot.find.environment.variable.",
                 "\u74B0\u5883\u5909\u6570\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093: "},
--- a/src/share/classes/sun/security/tools/jarsigner/Resources_zh_CN.java	Tue May 13 23:18:27 2014 -0700
+++ b/src/share/classes/sun/security/tools/jarsigner/Resources_zh_CN.java	Wed May 14 11:00:21 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2014, 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 @@
         {".keypass.password.password.for.private.key.if.different.",
                 "[-keypass <\u53E3\u4EE4>]           \u79C1\u6709\u5BC6\u94A5\u7684\u53E3\u4EE4 (\u5982\u679C\u4E0D\u540C)"},
         {".certchain.file.name.of.alternative.certchain.file",
-                "[-certchain <\u6587\u4EF6>]         \u66FF\u4EE3 certchain \u6587\u4EF6\u7684\u540D\u79F0"},
+                "[-certchain <\u6587\u4EF6>]         \u66FF\u4EE3\u8BC1\u4E66\u94FE\u6587\u4EF6\u7684\u540D\u79F0"},
         {".sigfile.file.name.of.SF.DSA.file",
                 "[-sigfile <\u6587\u4EF6>]           .SF/.DSA \u6587\u4EF6\u7684\u540D\u79F0"},
         {".signedjar.file.name.of.signed.JAR.file",
@@ -135,7 +135,10 @@
         {".Unsigned.entries.", "(\u672A\u7B7E\u540D\u6761\u76EE)"},
         {"jar.is.unsigned.signatures.missing.or.not.parsable.",
                 "jar \u672A\u7B7E\u540D\u3002(\u7F3A\u5C11\u7B7E\u540D\u6216\u65E0\u6CD5\u89E3\u6790\u7B7E\u540D)"},
+        {"jar.signed.", "jar \u5DF2\u7B7E\u540D\u3002"},
+        {"jar.signed.with.signer.errors.", "jar \u5DF2\u7B7E\u540D, \u4F46\u51FA\u73B0\u7B7E\u540D\u8005\u9519\u8BEF\u3002"},
         {"jar.verified.", "jar \u5DF2\u9A8C\u8BC1\u3002"},
+        {"jar.verified.with.signer.errors.", "jar \u5DF2\u9A8C\u8BC1, \u4F46\u51FA\u73B0\u7B7E\u540D\u8005\u9519\u8BEF\u3002"},
         {"jarsigner.", "jarsigner: "},
         {"signature.filename.must.consist.of.the.following.characters.A.Z.0.9.or.",
                 "\u7B7E\u540D\u6587\u4EF6\u540D\u5FC5\u987B\u5305\u542B\u4EE5\u4E0B\u5B57\u7B26: A-Z, 0-9, _ \u6216 -"},
@@ -191,6 +194,7 @@
                 "\u6B63\u5728\u4F7F\u7528\u66FF\u4EE3\u7684\u7B7E\u540D\u673A\u5236"},
         {"entry.was.signed.on", "\u6761\u76EE\u7684\u7B7E\u540D\u65E5\u671F\u4E3A {0}"},
         {"Warning.", "\u8B66\u544A: "},
+        {"Error.", "\u9519\u8BEF: "},
         {"This.jar.contains.unsigned.entries.which.have.not.been.integrity.checked.",
                 "\u6B64 jar \u5305\u542B\u5C1A\u672A\u8FDB\u884C\u5B8C\u6574\u6027\u68C0\u67E5\u7684\u672A\u7B7E\u540D\u6761\u76EE\u3002 "},
         {"This.jar.contains.entries.whose.signer.certificate.has.expired.",
@@ -227,6 +231,10 @@
                 "\u7B7E\u540D\u8005\u7684\u8BC1\u4E66\u94FE\u672A\u9A8C\u8BC1\u3002"},
         {"This.jar.contains.entries.whose.certificate.chain.is.not.validated.",
                  "\u6B64 jar \u5305\u542B\u8BC1\u4E66\u94FE\u672A\u9A8C\u8BC1\u7684\u6761\u76EE\u3002"},
+        {"no.timestamp.signing",
+                "\u672A\u63D0\u4F9B -tsa \u6216 -tsacert, \u6B64 jar \u6CA1\u6709\u65F6\u95F4\u6233\u3002\u5982\u679C\u6CA1\u6709\u65F6\u95F4\u6233, \u5219\u5728\u7B7E\u540D\u8005\u8BC1\u4E66\u7684\u5230\u671F\u65E5\u671F (%1$tY-%1$tm-%1$td) \u6216\u4EE5\u540E\u7684\u4EFB\u4F55\u64A4\u9500\u65E5\u671F\u4E4B\u540E, \u7528\u6237\u53EF\u80FD\u65E0\u6CD5\u9A8C\u8BC1\u6B64 jar\u3002"},
+        {"no.timestamp.verifying",
+                "\u6B64 jar \u5305\u542B\u7684\u7B7E\u540D\u6CA1\u6709\u65F6\u95F4\u6233\u3002\u5982\u679C\u6CA1\u6709\u65F6\u95F4\u6233, \u5219\u5728\u7B7E\u540D\u8005\u8BC1\u4E66\u7684\u5230\u671F\u65E5\u671F (%1$tY-%1$tm-%1$td) \u6216\u4EE5\u540E\u7684\u4EFB\u4F55\u64A4\u9500\u65E5\u671F\u4E4B\u540E, \u7528\u6237\u53EF\u80FD\u65E0\u6CD5\u9A8C\u8BC1\u6B64 jar\u3002"},
         {"Unknown.password.type.", "\u672A\u77E5\u53E3\u4EE4\u7C7B\u578B: "},
         {"Cannot.find.environment.variable.",
                 "\u627E\u4E0D\u5230\u73AF\u5883\u53D8\u91CF: "},
--- a/src/share/classes/sun/security/tools/keytool/Resources_ja.java	Tue May 13 23:18:27 2014 -0700
+++ b/src/share/classes/sun/security/tools/keytool/Resources_ja.java	Wed May 14 11:00:21 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2014, 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
@@ -348,17 +348,17 @@
         {".PATTERN.printX509Cert",
                 "\u6240\u6709\u8005: {0}\n\u767A\u884C\u8005: {1}\n\u30B7\u30EA\u30A2\u30EB\u756A\u53F7: {2}\n\u6709\u52B9\u671F\u9593\u306E\u958B\u59CB\u65E5: {3}\u7D42\u4E86\u65E5: {4}\n\u8A3C\u660E\u66F8\u306E\u30D5\u30A3\u30F3\u30AC\u30D7\u30EA\u30F3\u30C8:\n\t MD5:  {5}\n\t SHA1: {6}\n\t SHA256: {7}\n\t \u7F72\u540D\u30A2\u30EB\u30B4\u30EA\u30BA\u30E0\u540D: {8}\n\t \u30D0\u30FC\u30B8\u30E7\u30F3: {9}"},
         {"What.is.your.first.and.last.name.",
-                "\u59D3\u540D\u3092\u5165\u529B\u3057\u3066\u304F\u3060\u3055\u3044\u3002"},
+                "\u59D3\u540D\u306F\u4F55\u3067\u3059\u304B\u3002"},
         {"What.is.the.name.of.your.organizational.unit.",
-                "\u7D44\u7E54\u5358\u4F4D\u540D\u3092\u5165\u529B\u3057\u3066\u304F\u3060\u3055\u3044\u3002"},
+                "\u7D44\u7E54\u5358\u4F4D\u540D\u306F\u4F55\u3067\u3059\u304B\u3002"},
         {"What.is.the.name.of.your.organization.",
-                "\u7D44\u7E54\u540D\u3092\u5165\u529B\u3057\u3066\u304F\u3060\u3055\u3044\u3002"},
+                "\u7D44\u7E54\u540D\u306F\u4F55\u3067\u3059\u304B\u3002"},
         {"What.is.the.name.of.your.City.or.Locality.",
-                "\u90FD\u5E02\u540D\u307E\u305F\u306F\u5730\u57DF\u540D\u3092\u5165\u529B\u3057\u3066\u304F\u3060\u3055\u3044\u3002"},
+                "\u90FD\u5E02\u540D\u307E\u305F\u306F\u5730\u57DF\u540D\u306F\u4F55\u3067\u3059\u304B\u3002"},
         {"What.is.the.name.of.your.State.or.Province.",
-                "\u90FD\u9053\u5E9C\u770C\u540D\u3092\u5165\u529B\u3057\u3066\u304F\u3060\u3055\u3044\u3002"},
+                "\u90FD\u9053\u5E9C\u770C\u540D\u307E\u305F\u306F\u5DDE\u540D\u306F\u4F55\u3067\u3059\u304B\u3002"},
         {"What.is.the.two.letter.country.code.for.this.unit.",
-                "\u3053\u306E\u5358\u4F4D\u306B\u8A72\u5F53\u3059\u308B2\u6587\u5B57\u306E\u56FD\u30B3\u30FC\u30C9\u3092\u5165\u529B\u3057\u3066\u304F\u3060\u3055\u3044\u3002"},
+                "\u3053\u306E\u5358\u4F4D\u306B\u8A72\u5F53\u3059\u308B2\u6587\u5B57\u306E\u56FD\u30B3\u30FC\u30C9\u306F\u4F55\u3067\u3059\u304B\u3002"},
         {"Is.name.correct.", "{0}\u3067\u3088\u308D\u3057\u3044\u3067\u3059\u304B\u3002"},
         {"no", "\u3044\u3044\u3048"},
         {"yes", "\u306F\u3044"},
--- a/src/share/classes/sun/security/tools/keytool/Resources_pt_BR.java	Tue May 13 23:18:27 2014 -0700
+++ b/src/share/classes/sun/security/tools/keytool/Resources_pt_BR.java	Wed May 14 11:00:21 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2014, 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
@@ -55,7 +55,7 @@
         {"Changes.an.entry.s.alias",
                 "Altera um alias de entrada"}, //-changealias
         {"Deletes.an.entry",
-                "Deleta uma entrada"}, //-delete
+                "Exclui uma entrada"}, //-delete
         {"Exports.certificate",
                 "Exporta o certificado"}, //-exportcert
         {"Generates.a.key.pair",
--- a/src/share/classes/sun/security/util/KeyUtil.java	Tue May 13 23:18:27 2014 -0700
+++ b/src/share/classes/sun/security/util/KeyUtil.java	Wed May 14 11:00:21 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2014, 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
@@ -32,6 +32,7 @@
 import java.security.interfaces.ECKey;
 import java.security.interfaces.RSAKey;
 import java.security.interfaces.DSAKey;
+import java.security.SecureRandom;
 import java.security.spec.KeySpec;
 import javax.crypto.SecretKey;
 import javax.crypto.interfaces.DHKey;
@@ -157,6 +158,79 @@
     }
 
     /**
+     * Check the format of TLS PreMasterSecret.
+     * <P>
+     * To avoid vulnerabilities described by section 7.4.7.1, RFC 5246,
+     * treating incorrectly formatted message blocks and/or mismatched
+     * version numbers in a manner indistinguishable from correctly
+     * formatted RSA blocks.
+     *
+     * RFC 5246 describes the approach as :
+     *
+     *  1. Generate a string R of 48 random bytes
+     *
+     *  2. Decrypt the message to recover the plaintext M
+     *
+     *  3. If the PKCS#1 padding is not correct, or the length of message
+     *     M is not exactly 48 bytes:
+     *        pre_master_secret = R
+     *     else If ClientHello.client_version <= TLS 1.0, and version
+     *     number check is explicitly disabled:
+     *        premaster secret = M
+     *     else If M[0..1] != ClientHello.client_version:
+     *        premaster secret = R
+     *     else:
+     *        premaster secret = M
+     *
+     * Note that #2 should have completed before the call to this method.
+     *
+     * @param  clientVersion the version of the TLS protocol by which the
+     *         client wishes to communicate during this session
+     * @param  serverVersion the negotiated version of the TLS protocol which
+     *         contains the lower of that suggested by the client in the client
+     *         hello and the highest supported by the server.
+     * @param  encoded the encoded key in its "RAW" encoding format
+     * @param  isFailover whether or not the previous decryption of the
+     *         encrypted PreMasterSecret message run into problem
+     * @return the polished PreMasterSecret key in its "RAW" encoding format
+     */
+    public static byte[] checkTlsPreMasterSecretKey(
+            int clientVersion, int serverVersion, SecureRandom random,
+            byte[] encoded, boolean isFailOver) {
+
+        if (random == null) {
+            random = new SecureRandom();
+        }
+        byte[] replacer = new byte[48];
+        random.nextBytes(replacer);
+
+        if (!isFailOver && (encoded != null)) {
+            // check the length
+            if (encoded.length != 48) {
+                // private, don't need to clone the byte array.
+                return replacer;
+            }
+
+            int encodedVersion =
+                    ((encoded[0] & 0xFF) << 8) | (encoded[1] & 0xFF);
+            if (clientVersion != encodedVersion) {
+                if (clientVersion > 0x0301 ||               // 0x0301: TLSv1
+                       serverVersion != encodedVersion) {
+                    encoded = replacer;
+                }   // Otherwise, For compatibility, we maintain the behavior
+                    // that the version in pre_master_secret can be the
+                    // negotiated version for TLS v1.0 and SSL v3.0.
+            }
+
+            // private, don't need to clone the byte array.
+            return encoded;
+        }
+
+        // private, don't need to clone the byte array.
+        return replacer;
+    }
+
+    /**
      * Returns whether the Diffie-Hellman public key is valid or not.
      *
      * Per RFC 2631 and NIST SP800-56A, the following algorithm is used to
--- a/src/share/classes/sun/tools/jar/resources/jar_es.properties	Tue May 13 23:18:27 2014 -0700
+++ b/src/share/classes/sun/tools/jar/resources/jar_es.properties	Wed May 14 11:00:21 2014 -0700
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 1999, 2014, 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
@@ -45,4 +45,4 @@
 out.inflated=\ inflado: {0}
 out.size=(entrada = {0}) (salida = {1})
 
-usage=Sintaxis: jar {ctxui}[vfmn0Me] [jar-file] [manifest-file] [entry-point] [-C dir] archivos...\nOpciones:\n    -c  crear nuevo archivo\n    -t  crear la tabla de contenido del archivo\n    -x  extraer el archive mencionado (o todos) del archivo\n    -u  actualizar archive existente\n    -v  generar salida detallada de los datos de salida est\u00E1ndar\n    -f  especificar nombre de archive de almacenamiento\n    -m  incluir informaci\u00F3n de manifiesto del archive de manifiesto especificado\n    -n  realizar normalizaci\u00F3n de Pack200 despu\u00E9s de crear un nuevo archivo\n    -e  especificar punto de entrada de la aplicaci\u00F3n para la aplicaci\u00F3n aut\u00F3noma \n        que se incluye dentro de un archive jar ejecutable\n    -0  s\u00F3lo almacenar; no utilizar compresi\u00F3n ZIP\n    -M  no crear un archive de manifiesto para las entradas\n    -i  generar informaci\u00F3n de \u00EDndice para los archives jar especificados\n    -C  cambiar al directorio especificado e incluir el archivo siguiente\nSi alg\u00FAn archivo es un directorio, se procesar\u00E1 de forma recurrente.\nEl nombre del archivo de manifiesto, el nombre del archivo de almacenamiento y el nombre del punto de entrada se\nespecifican en el mismo orden que los indicadores 'm', 'f' y 'e'.\n\nEjemplo 1: para archivar archivos de dos clases en un archivo llamado classes.jar: \n       jar cvf classes.jar Foo.class Bar.class \nEjemplo 2: utilice un archivo de manifiesto existente 'mymanifest' y archive todos los\n           archivos del directorio foo/ en 'classes.jar': \n       jar cvfm classes.jar mymanifest -C foo/ .\n
+usage=Sintaxis: jar {ctxui}[vfmn0Me] [jar-file] [manifest-file] [entry-point] [-C dir] archivos...\nOpciones:\n    -c  crear nuevo archivo\n    -t  crear la tabla de contenido del archivo\n    -x   extraer el archive mencionado (o todos) del archivo\n    -u  actualizar archive existente\n    -v  generar salida detallada de los datos de salida est\u00E1ndar\n    -f  especificar nombre de archive de almacenamiento\n    -m  incluir informaci\u00F3n de manifiesto del archive de manifiesto especificado\n    -n  realizar normalizaci\u00F3n de Pack200 despu\u00E9s de crear un nuevo archivo\n    -e  especificar punto de entrada de la aplicaci\u00F3n para la aplicaci\u00F3n aut\u00F3noma \n        que se incluye dentro de un archive jar ejecutable\n    -0  s\u00F3lo almacenar; no utilizar compresi\u00F3n ZIP\n    -M  no crear un archive de manifiesto para las entradas\n    -i  generar informaci\u00F3n de \u00EDndice para los archives jar especificados\n    -C  cambiar al directorio especificado e incluir el archivo siguiente\nSi alg\u00FAn archivo es un directorio, se procesar\u00E1 de forma recurrente.\nEl nombre del archivo de manifiesto, el nombre del archivo de almacenamiento y el nombre del punto de entrada se\nespecifican en el mismo orden que los indicadores 'm', 'f' y 'e'.\n\nEjemplo 1: para archivar archivos de dos clases en un archivo llamado classes.jar: \n       jar cvf classes.jar Foo.class Bar.class \nEjemplo 2: utilice un archivo de manifiesto existente 'mymanifest' y archive todos los\n           archivos del directorio foo/ en 'classes.jar': \n       jar cvfm classes.jar mymanifest -C foo/ .\n
--- a/src/share/classes/sun/tools/jconsole/resources/messages_ja.properties	Tue May 13 23:18:27 2014 -0700
+++ b/src/share/classes/sun/tools/jconsole/resources/messages_ja.properties	Wed May 14 11:00:21 2014 -0700
@@ -31,7 +31,7 @@
 CPU_USAGE=CPU\u4F7F\u7528\u7387
 CPU_USAGE_FORMAT=CPU\u4F7F\u7528\u7387: {0}%
 CANCEL=\u53D6\u6D88
-CASCADE=\u91CD\u306D\u3066\u8868\u793A(&C)
+CASCADE=\u30AB\u30B9\u30B1\u30FC\u30C9\u8868\u793A(&C)
 CHART_COLON=\u30C1\u30E3\u30FC\u30C8(&C):
 CLASS_PATH=\u30AF\u30E9\u30B9\u30D1\u30B9
 CLASS_NAME=ClassName
@@ -52,7 +52,7 @@
 CONNECT_DIALOG_STATUS_BAR_ACCESSIBLE_NAME=\u30B9\u30C6\u30FC\u30BF\u30B9\u30FB\u30D0\u30FC
 CONNECT_DIALOG_TITLE=JConsole: \u65B0\u898F\u63A5\u7D9A
 CONNECTED_PUNCTUATION_CLICK_TO_DISCONNECT_=\u63A5\u7D9A\u3055\u308C\u3066\u3044\u307E\u3059\u3002\u30AF\u30EA\u30C3\u30AF\u3059\u308B\u3068\u5207\u65AD\u3057\u307E\u3059\u3002
-CONNECTION_FAILED=\u63A5\u7D9A\u306B\u5931\u6557\u3057\u307E\u3057\u305F
+CONNECTION_FAILED=\u63A5\u7D9A\u304C\u5931\u6557\u3057\u307E\u3057\u305F
 CONNECTION=\u63A5\u7D9A(&C)
 CONNECTION_NAME=\u63A5\u7D9A\u540D
 CONNECTION_NAME__DISCONNECTED_={0} (\u5207\u65AD\u6E08)
@@ -88,8 +88,8 @@
 FILE_CHOOSER_FILE_EXISTS_OK_OPTION=\u7F6E\u63DB
 FILE_CHOOSER_FILE_EXISTS_TITLE=\u30D5\u30A1\u30A4\u30EB\u304C\u5B58\u5728\u3057\u3066\u3044\u307E\u3059
 FILE_CHOOSER_SAVED_FILE=<html>\u30D5\u30A1\u30A4\u30EB\u306B\u4FDD\u5B58\u3057\u307E\u3057\u305F:<br>{0}<br>({1}\u30D0\u30A4\u30C8)
-FILE_CHOOSER_SAVE_FAILED_MESSAGE=<html><center>\u30D5\u30A1\u30A4\u30EB\u3078\u306E\u4FDD\u5B58\u306B\u5931\u6557\u3057\u307E\u3057\u305F:<br>{0}<br>{1}
-FILE_CHOOSER_SAVE_FAILED_TITLE=\u4FDD\u5B58\u306B\u5931\u6557\u3057\u307E\u3057\u305F
+FILE_CHOOSER_SAVE_FAILED_MESSAGE=<html><center>\u30D5\u30A1\u30A4\u30EB\u3078\u306E\u4FDD\u5B58\u304C\u5931\u6557\u3057\u307E\u3057\u305F:<br>{0}<br>{1}
+FILE_CHOOSER_SAVE_FAILED_TITLE=\u4FDD\u5B58\u304C\u5931\u6557\u3057\u307E\u3057\u305F
 FREE_PHYSICAL_MEMORY=\u7A7A\u304D\u7269\u7406\u30E1\u30E2\u30EA\u30FC
 FREE_SWAP_SPACE=\u7A7A\u304D\u30B9\u30EF\u30C3\u30D7\u30FB\u30B9\u30DA\u30FC\u30B9
 GARBAGE_COLLECTOR=\u30AC\u30D9\u30FC\u30B8\u30FB\u30B3\u30EC\u30AF\u30BF
@@ -232,7 +232,7 @@
 THREAD_TAB_THREAD_PLOTTER_ACCESSIBLE_NAME=\u30B9\u30EC\u30C3\u30C9\u6570\u306E\u30C1\u30E3\u30FC\u30C8\u3002
 THREAD_TAB_INITIAL_STACK_TRACE_MESSAGE=[\u30B9\u30EC\u30C3\u30C9\u304C\u9078\u629E\u3055\u308C\u3066\u3044\u307E\u305B\u3093]
 THRESHOLD=\u3057\u304D\u3044\u5024
-TILE=\u4E26\u3079\u3066\u8868\u793A(&T)
+TILE=\u30BF\u30A4\u30EB\u8868\u793A(&T)
 TIME_RANGE_COLON=\u6642\u9593\u7BC4\u56F2(&T):
 TIME=\u6642\u9593
 TIME_STAMP=TimeStamp
@@ -250,14 +250,14 @@
 UNREGISTER=\u767B\u9332\u89E3\u9664
 UPTIME=\u7A3C\u50CD\u6642\u9593
 USAGE_THRESHOLD=\u4F7F\u7528\u3057\u304D\u3044\u5024
-REMOTE_TF_USAGE=<b>\u4F7F\u7528\u65B9\u6CD5</b>: &&lt;hostname&&gt;:&&lt;port&&gt;\u307E\u305F\u306Fservice:jmx:&&lt;protocol&&gt;:&&lt;sap&&gt;
+REMOTE_TF_USAGE=<b>\u4F7F\u7528\u65B9\u6CD5</b>: &&lt;hostname&&gt;:&&lt;port&&gt; OR service:jmx:&&lt;protocol&&gt;:&&lt;sap&&gt;
 USED=\u4F7F\u7528\u6E08
 USERNAME_COLON_=\u30E6\u30FC\u30B6\u30FC\u540D(&U):
 USERNAME_ACCESSIBLE_NAME=\u30E6\u30FC\u30B6\u30FC\u540D
 USER_DATA=UserData
 VIRTUAL_MACHINE=\u4EEE\u60F3\u30DE\u30B7\u30F3
 VM_ARGUMENTS=VM\u5F15\u6570
-VMINTERNAL_FRAME_ACCESSIBLE_DESCRIPTION=Java\u4EEE\u60F3\u30DE\u30B7\u30F3\u306E\u30E2\u30CB\u30BF\u30FC\u7528\u306E\u5185\u90E8\u30D5\u30EC\u30FC\u30E0
+VMINTERNAL_FRAME_ACCESSIBLE_DESCRIPTION=Java\u4EEE\u60F3\u30DE\u30B7\u30F3\u306E\u30E2\u30CB\u30BF\u30EA\u30F3\u30B0\u7528\u306E\u5185\u90E8\u30D5\u30EC\u30FC\u30E0
 VALUE=\u5024
 VENDOR=\u30D9\u30F3\u30C0\u30FC
 VERBOSE_OUTPUT=\u8A73\u7D30\u51FA\u529B
@@ -266,9 +266,9 @@
 WINDOW=\u30A6\u30A3\u30F3\u30C9\u30A6(&W)
 WINDOWS=\u30A6\u30A3\u30F3\u30C9\u30A6
 WRITABLE=\u66F8\u8FBC\u307F\u53EF\u80FD
-CONNECTION_FAILED1=\u63A5\u7D9A\u306B\u5931\u6557\u3057\u307E\u3057\u305F: \u518D\u8A66\u884C\u3057\u307E\u3059\u304B\u3002
-CONNECTION_FAILED2={0}\u3078\u306E\u63A5\u7D9A\u304C\u6210\u529F\u3057\u307E\u305B\u3093\u3067\u3057\u305F\u3002<br>\u3082\u3046\u4E00\u5EA6\u8A66\u3057\u307E\u3059\u304B\u3002
-CONNECTION_FAILED_SSL1=\u4FDD\u8B77\u3055\u308C\u305F\u63A5\u7D9A\u306B\u5931\u6557\u3057\u307E\u3057\u305F\u3002\u4FDD\u8B77\u305B\u305A\u306B\u518D\u8A66\u884C\u3057\u307E\u3059\u304B\u3002
+CONNECTION_FAILED1=\u63A5\u7D9A\u304C\u5931\u6557\u3057\u307E\u3057\u305F: \u518D\u8A66\u884C\u3057\u307E\u3059\u304B\u3002
+CONNECTION_FAILED2={0}\u3078\u306E\u63A5\u7D9A\u304C\u6210\u529F\u3057\u307E\u305B\u3093\u3067\u3057\u305F\u3002<br>\u518D\u8A66\u884C\u3057\u307E\u3059\u304B\u3002
+CONNECTION_FAILED_SSL1=\u30BB\u30AD\u30E5\u30A2\u306A\u63A5\u7D9A\u304C\u5931\u6557\u3057\u307E\u3057\u305F\u3002\u975E\u30BB\u30AD\u30E5\u30A2\u3067\u518D\u8A66\u884C\u3057\u307E\u3059\u304B\u3002
 CONNECTION_FAILED_SSL2=SSL\u3092\u4F7F\u7528\u3057\u3066{0}\u306B\u63A5\u7D9A\u3067\u304D\u307E\u305B\u3093\u3002<br>SSL\u306A\u3057\u3067\u63A5\u7D9A\u3057\u307E\u3059\u304B\u3002<br>(\u30E6\u30FC\u30B6\u30FC\u540D\u304A\u3088\u3073\u30D1\u30B9\u30EF\u30FC\u30C9\u306F\u30D7\u30EC\u30FC\u30F3\u30FB\u30C6\u30AD\u30B9\u30C8\u3067\u9001\u4FE1\u3055\u308C\u307E\u3059\u3002)
 CONNECTION_LOST1=\u63A5\u7D9A\u304C\u5931\u308F\u308C\u307E\u3057\u305F: \u518D\u63A5\u7D9A\u3057\u307E\u3059\u304B\u3002
 CONNECTING_TO1={0}\u306B\u63A5\u7D9A\u4E2D
@@ -279,4 +279,4 @@
 KBYTES={0} KB
 PLOT=\u30D7\u30ED\u30C3\u30C8
 VISUALIZE=\u8996\u899A\u5316
-ZZ_USAGE_TEXT=\u4F7F\u7528\u65B9\u6CD5: {0} [ -interval=n ] [ -notile ] [ -pluginpath <path> ] [ -version ] [ connection ... ]\n\n  -interval   \u66F4\u65B0\u9593\u9694\u3092n\u79D2\u306B\u8A2D\u5B9A\u3059\u308B(\u30C7\u30D5\u30A9\u30EB\u30C8\u306F4\u79D2)\n  -notile     \u30A6\u30A3\u30F3\u30C9\u30A6\u3092\u6700\u521D\u306B\u4E26\u3079\u3066\u8868\u793A\u3057\u306A\u3044(2\u3064\u4EE5\u4E0A\u306E\u63A5\u7D9A\u306B\u3064\u3044\u3066)\n  -pluginpath JConsole\u304C\u30D7\u30E9\u30B0\u30A4\u30F3\u3092\u53C2\u7167\u3059\u308B\u305F\u3081\u306B\u4F7F\u7528\u3059\u308B\u30D1\u30B9\u3092\u6307\u5B9A\u3059\u308B\n  -version    \u30D7\u30ED\u30B0\u30E9\u30E0\u30FB\u30D0\u30FC\u30B8\u30E7\u30F3\u3092\u51FA\u529B\u3059\u308B\n\n  connection = pid || host:port || JMX URL (service:jmx:<protocol>://...)\n  pid         \u30BF\u30FC\u30B2\u30C3\u30C8\u30FB\u30D7\u30ED\u30BB\u30B9\u306E\u30D7\u30ED\u30BB\u30B9ID\n  host        \u30EA\u30E2\u30FC\u30C8\u30FB\u30DB\u30B9\u30C8\u540D\u307E\u305F\u306FIP\u30A2\u30C9\u30EC\u30B9\n  port        \u30EA\u30E2\u30FC\u30C8\u63A5\u7D9A\u7528\u306E\u30DD\u30FC\u30C8\u756A\u53F7\n\n  -J          JConsole\u304C\u5B9F\u884C\u4E2D\u306EJava\u4EEE\u60F3\u30DE\u30B7\u30F3\u3078\u306E\n              \u5165\u529B\u5F15\u6570\u3092\u6307\u5B9A\u3059\u308B
+ZZ_USAGE_TEXT=\u4F7F\u7528\u65B9\u6CD5: {0} [ -interval=n ] [ -notile ] [ -pluginpath <path> ] [ -version ] [ connection ... ]\n\n  -interval   \u66F4\u65B0\u9593\u9694\u3092n\u79D2\u306B\u8A2D\u5B9A\u3059\u308B(\u30C7\u30D5\u30A9\u30EB\u30C8\u306F4\u79D2)\n  -notile     \u30A6\u30A3\u30F3\u30C9\u30A6\u3092\u6700\u521D\u306B\u30BF\u30A4\u30EB\u8868\u793A\u3057\u306A\u3044(2\u3064\u4EE5\u4E0A\u306E\u63A5\u7D9A\u306B\u3064\u3044\u3066)\n  -pluginpath JConsole\u304C\u30D7\u30E9\u30B0\u30A4\u30F3\u3092\u53C2\u7167\u3059\u308B\u305F\u3081\u306B\u4F7F\u7528\u3059\u308B\u30D1\u30B9\u3092\u6307\u5B9A\u3059\u308B\n  -version    \u30D7\u30ED\u30B0\u30E9\u30E0\u30FB\u30D0\u30FC\u30B8\u30E7\u30F3\u3092\u51FA\u529B\u3059\u308B\n\n  connection = pid || host:port || JMX URL (service:jmx:<protocol>://...)\n  pid         \u30BF\u30FC\u30B2\u30C3\u30C8\u30FB\u30D7\u30ED\u30BB\u30B9\u306E\u30D7\u30ED\u30BB\u30B9ID\n  host        \u30EA\u30E2\u30FC\u30C8\u30FB\u30DB\u30B9\u30C8\u540D\u307E\u305F\u306FIP\u30A2\u30C9\u30EC\u30B9\n  port        \u30EA\u30E2\u30FC\u30C8\u63A5\u7D9A\u7528\u306E\u30DD\u30FC\u30C8\u756A\u53F7\n\n  -J          JConsole\u304C\u5B9F\u884C\u4E2D\u306EJava\u4EEE\u60F3\u30DE\u30B7\u30F3\u3078\u306E\n              \u5165\u529B\u5F15\u6570\u3092\u6307\u5B9A\u3059\u308B
--- a/src/solaris/classes/java/lang/UNIXProcess.java.solaris	Tue May 13 23:18:27 2014 -0700
+++ b/src/solaris/classes/java/lang/UNIXProcess.java.solaris	Wed May 14 11:00:21 2014 -0700
@@ -25,10 +25,23 @@
 
 package java.lang;
 
-import java.io.*;
+import java.io.BufferedInputStream;
+import java.io.BufferedOutputStream;
+import java.io.FileDescriptor;
+import java.io.FileInputStream;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.util.concurrent.Executors;
+import java.util.concurrent.Executor;
+import java.util.concurrent.ThreadFactory;
 import java.util.concurrent.TimeUnit;
 import java.security.AccessController;
+import static java.security.AccessController.doPrivileged;
 import java.security.PrivilegedAction;
+import java.security.PrivilegedActionException;
+import java.security.PrivilegedExceptionAction;
 
 /* java.lang.Process subclass in the UNIX environment.
  *
@@ -108,14 +121,15 @@
      * - fork(2) and exec(2)
      * - posix_spawn(2)
      *
-     * @param std_fds array of file descriptors.  Indexes 0, 1, and
-     *        2 correspond to standard input, standard output and
-     *        standard error, respectively.  On input, a value of -1
-     *        means to create a pipe to connect child and parent
-     *        processes.  On output, a value which is not -1 is the
-     *        parent pipe fd corresponding to the pipe which has
-     *        been created.  An element of this array is -1 on input
-     *        if and only if it is <em>not</em> -1 on output.
+     * @param fds an array of three file descriptors.
+     *        Indexes 0, 1, and 2 correspond to standard input,
+     *        standard output and standard error, respectively.  On
+     *        input, a value of -1 means to create a pipe to connect
+     *        child and parent processes.  On output, a value which
+     *        is not -1 is the parent pipe fd corresponding to the
+     *        pipe which has been created.  An element of this array
+     *        is -1 on input if and only if it is <em>not</em> -1 on
+     *        output.
      * @return the pid of the subprocess
      */
     private native int forkAndExec(int mode, byte[] helperpath,
@@ -123,15 +137,51 @@
                                    byte[] argBlock, int argc,
                                    byte[] envBlock, int envc,
                                    byte[] dir,
-                                   int[] std_fds,
+                                   int[] fds,
                                    boolean redirectErrorStream)
         throws IOException;
 
+    /**
+     * The thread factory used to create "process reaper" daemon threads.
+     */
+    private static class ProcessReaperThreadFactory implements ThreadFactory {
+        private final static ThreadGroup group = getRootThreadGroup();
+
+        private static ThreadGroup getRootThreadGroup() {
+            return doPrivileged(new PrivilegedAction<ThreadGroup> () {
+                public ThreadGroup run() {
+                    ThreadGroup root = Thread.currentThread().getThreadGroup();
+                    while (root.getParent() != null)
+                        root = root.getParent();
+                    return root;
+                }});
+        }
+
+        public Thread newThread(Runnable grimReaper) {
+            // Our thread stack requirement is quite modest.
+            Thread t = new Thread(group, grimReaper, "process reaper", 32768);
+            t.setDaemon(true);
+            // A small attempt (probably futile) to avoid priority inversion
+            t.setPriority(Thread.MAX_PRIORITY);
+            return t;
+        }
+    }
+
+    /**
+     * The thread pool of "process reaper" daemon threads.
+     */
+    private static final Executor processReaperExecutor =
+        doPrivileged(new PrivilegedAction<Executor>() {
+            public Executor run() {
+                return Executors.newCachedThreadPool
+                    (new ProcessReaperThreadFactory());
+            }});
+
     UNIXProcess(final byte[] prog,
                 final byte[] argBlock, int argc,
                 final byte[] envBlock, int envc,
                 final byte[] dir,
-                final int[] std_fds,
+                final int[] fds,
                 final boolean redirectErrorStream)
     throws IOException {
         pid = forkAndExec(launchMechanism.value,
@@ -140,63 +190,62 @@
                           argBlock, argc,
                           envBlock, envc,
                           dir,
-                          std_fds,
+                          fds,
                           redirectErrorStream);
 
-        java.security.AccessController.doPrivileged(
-        new java.security.PrivilegedAction<Void>() { public Void run() {
-            if (std_fds[0] == -1)
-                stdin_stream = ProcessBuilder.NullOutputStream.INSTANCE;
-            else {
-                FileDescriptor stdin_fd = new FileDescriptor();
-                fdAccess.set(stdin_fd, std_fds[0]);
-                stdin_stream = new BufferedOutputStream(
-                    new FileOutputStream(stdin_fd));
-            }
+        try {
+            doPrivileged(
+                new PrivilegedExceptionAction<Void>() {
+                    public Void run() throws IOException {
+                        initStreams(fds);
+                        return null;
+                    }
+                });
+        } catch (PrivilegedActionException ex) {
+            throw (IOException) ex.getException();
+        }
+    }
 
-            if (std_fds[1] == -1)
-                stdout_stream = ProcessBuilder.NullInputStream.INSTANCE;
-            else {
-                FileDescriptor stdout_fd = new FileDescriptor();
-                fdAccess.set(stdout_fd, std_fds[1]);
-                stdout_inner_stream = new DeferredCloseInputStream(stdout_fd);
-                stdout_stream = new BufferedInputStream(stdout_inner_stream);
-            }
+    void initStreams(int[] fds) throws IOException {
+        if (fds[0] == -1)
+            stdin_stream = ProcessBuilder.NullOutputStream.INSTANCE;
+        else {
+            FileDescriptor stdin_fd = new FileDescriptor();
+            fdAccess.set(stdin_fd, fds[0]);
+            stdin_stream = new BufferedOutputStream(
+                new FileOutputStream(stdin_fd));
+        }
 
-            if (std_fds[2] == -1)
-                stderr_stream = ProcessBuilder.NullInputStream.INSTANCE;
-            else {
-                FileDescriptor stderr_fd = new FileDescriptor();
-                fdAccess.set(stderr_fd, std_fds[2]);
-                stderr_stream = new DeferredCloseInputStream(stderr_fd);
-            }
+        if (fds[1] == -1)
+            stdout_stream = ProcessBuilder.NullInputStream.INSTANCE;
+        else {
+            FileDescriptor stdout_fd = new FileDescriptor();
+            fdAccess.set(stdout_fd, fds[1]);
+            stdout_inner_stream = new DeferredCloseInputStream(stdout_fd);
+            stdout_stream = new BufferedInputStream(stdout_inner_stream);
+        }
 
-            return null; }});
+        if (fds[2] == -1)
+            stderr_stream = ProcessBuilder.NullInputStream.INSTANCE;
+        else {
+            FileDescriptor stderr_fd = new FileDescriptor();
+            fdAccess.set(stderr_fd, fds[2]);
+            stderr_stream = new DeferredCloseInputStream(stderr_fd);
+        }
 
-        /*
-         * For each subprocess forked a corresponding reaper thread
-         * is started.  That thread is the only thread which waits
-         * for the subprocess to terminate and it doesn't hold any
-         * locks while doing so.  This design allows waitFor() and
-         * exitStatus() to be safely executed in parallel (and they
-         * need no native code).
-         */
+        processReaperExecutor.execute(new Runnable() {
+            public void run() {
+                int exitcode = waitForProcessExit(pid);
+                UNIXProcess.this.processExited(exitcode);
+            }});
+    }
 
-        java.security.AccessController.doPrivileged(
-            new java.security.PrivilegedAction<Void>() { public Void run() {
-                Thread t = new Thread("process reaper") {
-                    public void run() {
-                        int res = waitForProcessExit(pid);
-                        synchronized (UNIXProcess.this) {
-                            hasExited = true;
-                            exitcode = res;
-                            UNIXProcess.this.notifyAll();
-                        }
-                    }
-                };
-                t.setDaemon(true);
-                t.start();
-                return null; }});
+    void processExited(int exitcode) {
+        synchronized (this) {
+            this.exitcode = exitcode;
+            hasExited = true;
+            notifyAll();
+        }
     }
 
     public OutputStream getOutputStream() {
--- a/src/solaris/classes/sun/nio/fs/UnixFileSystemProvider.java	Tue May 13 23:18:27 2014 -0700
+++ b/src/solaris/classes/sun/nio/fs/UnixFileSystemProvider.java	Wed May 14 11:00:21 2014 -0700
@@ -375,11 +375,12 @@
         UnixPath dir = UnixPath.toUnixPath(obj);
         dir.checkWrite();
 
-        int mode = UnixFileModeAttribute
-            .toUnixMode(UnixFileModeAttribute.ALL_PERMISSIONS, attrs);
+        int mode = UnixFileModeAttribute.toUnixMode(UnixFileModeAttribute.ALL_PERMISSIONS, attrs);
         try {
             mkdir(dir, mode);
         } catch (UnixException x) {
+            if (x.errno() == EISDIR)
+                throw new FileAlreadyExistsException(dir.toString());
             x.rethrowAsIOException(dir);
         }
     }
--- a/src/solaris/classes/sun/nio/fs/UnixPath.java	Tue May 13 23:18:27 2014 -0700
+++ b/src/solaris/classes/sun/nio/fs/UnixPath.java	Wed May 14 11:00:21 2014 -0700
@@ -482,7 +482,7 @@
     @Override
     public Path normalize() {
         final int count = getNameCount();
-        if (count == 0)
+        if (count == 0 || isEmpty())
             return this;
 
         boolean[] ignore = new boolean[count];      // true => ignore name
--- a/src/solaris/native/sun/awt/awt_util.c	Tue May 13 23:18:27 2014 -0700
+++ b/src/solaris/native/sun/awt/awt_util.c	Wed May 14 11:00:21 2014 -0700
@@ -62,7 +62,7 @@
 #define MIN(a,b) ((a) < (b) ? (a) : (b))
 #endif
 
-void
+jboolean
 awtJNI_ThreadYield(JNIEnv *env) {
 
     static jclass threadClass = NULL;
@@ -76,7 +76,7 @@
         Boolean err = FALSE;
         if (threadClass == NULL) {
             jclass tc = (*env)->FindClass(env, "java/lang/Thread");
-            CHECK_NULL(tc);
+            CHECK_NULL_RETURN(tc, JNI_FALSE);
             threadClass = (*env)->NewGlobalRef(env, tc);
             (*env)->DeleteLocalRef(env, tc);
             if (threadClass != NULL) {
@@ -92,10 +92,11 @@
             err = TRUE;
         }
         if (err) {
-            return;
+            return JNI_FALSE;
         }
     } /* threadClass == NULL*/
 
     (*env)->CallStaticVoidMethod(env, threadClass, yieldMethodID);
     DASSERT(!((*env)->ExceptionOccurred(env)));
+    return JNI_TRUE;
 } /* awtJNI_ThreadYield() */
--- a/src/solaris/native/sun/awt/awt_util.h	Tue May 13 23:18:27 2014 -0700
+++ b/src/solaris/native/sun/awt/awt_util.h	Wed May 14 11:00:21 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1995, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1995, 2014, 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
@@ -78,7 +78,7 @@
     int32_t echoC;
 };
 
-extern void awtJNI_ThreadYield(JNIEnv *env);
+extern jboolean awtJNI_ThreadYield(JNIEnv *env);
 
 /*
  * Functions for accessing fields by name and signature
--- a/src/solaris/native/sun/xawt/XToolkit.c	Tue May 13 23:18:27 2014 -0700
+++ b/src/solaris/native/sun/xawt/XToolkit.c	Wed May 14 11:00:21 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2014, 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,6 +40,7 @@
 #include "awt_Component.h"
 #include "awt_MenuComponent.h"
 #include "awt_Font.h"
+#include "awt_util.h"
 
 #include "sun_awt_X11_XToolkit.h"
 #include "java_awt_SystemColor.h"
@@ -76,6 +77,8 @@
 #ifndef HEADLESS
 
 extern Display* awt_init_Display(JNIEnv *env, jobject this);
+extern void freeNativeStringArray(char **array, long length);
+extern char** stringArrayToNative(JNIEnv *env, jobjectArray array, jsize * ret_length);
 
 struct XFontPeerIDs xFontPeerIDs;
 
@@ -103,9 +106,11 @@
   (JNIEnv *env, jclass clazz)
 {
     jfieldID fid = (*env)->GetStaticFieldID(env, clazz, "numLockMask", "I");
+    CHECK_NULL(fid);
     awt_NumLockMask = (*env)->GetStaticIntField(env, clazz, fid);
     DTRACE_PRINTLN1("awt_NumLockMask = %u", awt_NumLockMask);
     fid = (*env)->GetStaticFieldID(env, clazz, "modLockIsShiftLock", "I");
+    CHECK_NULL(fid);
     awt_ModLockIsShiftLock = (*env)->GetStaticIntField(env, clazz, fid) != 0 ? True : False;
 }
 
@@ -173,21 +178,31 @@
 
 
     componentIDs.x = (*env)->GetFieldID(env, cls, "x", "I");
+    CHECK_NULL(componentIDs.x);
     componentIDs.y = (*env)->GetFieldID(env, cls, "y", "I");
+    CHECK_NULL(componentIDs.y);
     componentIDs.width = (*env)->GetFieldID(env, cls, "width", "I");
+    CHECK_NULL(componentIDs.width);
     componentIDs.height = (*env)->GetFieldID(env, cls, "height", "I");
+    CHECK_NULL(componentIDs.height);
     componentIDs.isPacked = (*env)->GetFieldID(env, cls, "isPacked", "Z");
+    CHECK_NULL(componentIDs.isPacked);
     componentIDs.peer =
       (*env)->GetFieldID(env, cls, "peer", "Ljava/awt/peer/ComponentPeer;");
+    CHECK_NULL(componentIDs.peer);
     componentIDs.background =
       (*env)->GetFieldID(env, cls, "background", "Ljava/awt/Color;");
+    CHECK_NULL(componentIDs.background);
     componentIDs.foreground =
       (*env)->GetFieldID(env, cls, "foreground", "Ljava/awt/Color;");
+    CHECK_NULL(componentIDs.foreground);
     componentIDs.graphicsConfig =
         (*env)->GetFieldID(env, cls, "graphicsConfig",
                            "Ljava/awt/GraphicsConfiguration;");
+    CHECK_NULL(componentIDs.graphicsConfig);
     componentIDs.name =
       (*env)->GetFieldID(env, cls, "name", "Ljava/lang/String;");
+    CHECK_NULL(componentIDs.name);
 
     /* Use _NoClientCode() methods for trusted methods, so that we
      *  know that we are not invoking client code on trusted threads
@@ -195,19 +210,20 @@
     componentIDs.getParent =
       (*env)->GetMethodID(env, cls, "getParent_NoClientCode",
                          "()Ljava/awt/Container;");
+    CHECK_NULL(componentIDs.getParent);
 
     componentIDs.getLocationOnScreen =
       (*env)->GetMethodID(env, cls, "getLocationOnScreen_NoTreeLock",
                          "()Ljava/awt/Point;");
+    CHECK_NULL(componentIDs.getLocationOnScreen);
 
     keyclass = (*env)->FindClass(env, "java/awt/event/KeyEvent");
-    if (JNU_IsNull(env, keyclass)) {
-        return;
-    }
+    CHECK_NULL(keyclass);
 
     componentIDs.isProxyActive =
         (*env)->GetFieldID(env, keyclass, "isProxyActive",
                            "Z");
+    CHECK_NULL(componentIDs.isProxyActive);
 
     componentIDs.appContext =
         (*env)->GetFieldID(env, cls, "appContext",
@@ -339,7 +355,7 @@
 static void     waitForEvents(JNIEnv *, jlong);
 static void     awt_pipe_init();
 static void     processOneEvent(XtInputMask iMask);
-static void     performPoll(JNIEnv *, jlong);
+static Boolean  performPoll(JNIEnv *, jlong);
 static void     wakeUp();
 static void     update_poll_timeout(int timeout_control);
 static uint32_t get_poll_timeout(jlong nextTaskTime);
@@ -608,11 +624,13 @@
  */
 void
 waitForEvents(JNIEnv *env, jlong nextTaskTime) {
-    performPoll(env, nextTaskTime);
-    if ((awt_next_flush_time > 0) && (awtJNI_TimeMillis() >= awt_next_flush_time)) {
-        XFlush(awt_display);
-        awt_last_flush_time = awt_next_flush_time;
-        awt_next_flush_time = 0LL;
+    if (performPoll(env, nextTaskTime)
+          && (awt_next_flush_time > 0)
+          && (awtJNI_TimeMillis() >= awt_next_flush_time)) {
+
+                XFlush(awt_display);
+                awt_last_flush_time = awt_next_flush_time;
+                awt_next_flush_time = 0LL;
     }
 } /* waitForEvents() */
 
@@ -646,7 +664,7 @@
  *
  * The fdAWTPipe will be empty when this returns.
  */
-static void
+static Boolean
 performPoll(JNIEnv *env, jlong nextTaskTime) {
     static Bool pollFdsInited = False;
     static char read_buf[AWT_POLL_BUFSIZE + 1];    /* dummy buf to empty pipe */
@@ -673,7 +691,9 @@
     /* ACTUALLY DO THE POLL() */
     if (timeout == 0) {
         // be sure other threads get a chance
-        awtJNI_ThreadYield(env);
+        if (!awtJNI_ThreadYield(env)) {
+            return FALSE;
+        }
     }
 
     if (tracing) poll_sleep_time = awtJNI_TimeMillis();
@@ -701,7 +721,7 @@
         update_poll_timeout(TIMEOUT_EVENTS);
         PRINT2("performPoll(): TIMEOUT_EVENTS curPollTimeout = %ld \n", curPollTimeout);
     }
-    return;
+    return TRUE;
 
 } /* performPoll() */
 
@@ -856,23 +876,25 @@
     xawt_root_window = get_xawt_root_shell(env);
 
     if ( xawt_root_window == None ) {
+        AWT_UNLOCK();
         JNU_ThrowNullPointerException(env, "AWT root shell is unrealized");
-        AWT_UNLOCK();
         return;
     }
 
     command = (char *) JNU_GetStringPlatformChars(env, jcommand, NULL);
-    c[0] = (char *)command;
-    status = XmbTextListToTextProperty(awt_display, c, 1,
-                                       XStdICCTextStyle, &text_prop);
+    if (command != NULL) {
+        c[0] = (char *)command;
+        status = XmbTextListToTextProperty(awt_display, c, 1,
+                                           XStdICCTextStyle, &text_prop);
 
-    if (status == Success || status > 0) {
-        XSetTextProperty(awt_display, xawt_root_window,
-                         &text_prop, XA_WM_COMMAND);
-        if (text_prop.value != NULL)
-            XFree(text_prop.value);
+        if (status == Success || status > 0) {
+            XSetTextProperty(awt_display, xawt_root_window,
+                             &text_prop, XA_WM_COMMAND);
+            if (text_prop.value != NULL)
+                XFree(text_prop.value);
+        }
+        JNU_ReleaseStringPlatformChars(env, jcommand, command);
     }
-    JNU_ReleaseStringPlatformChars(env, jcommand, command);
     AWT_UNLOCK();
 }
 
@@ -886,96 +908,56 @@
  * name.  It's not!  It's just a plain function.
  */
 JNIEXPORT void JNICALL
-Java_sun_awt_motif_XsessionWMcommand_New(JNIEnv *env, jobjectArray jargv)
+Java_sun_awt_motif_XsessionWMcommand_New(JNIEnv *env, jobjectArray jarray)
 {
-    static const char empty[] = "";
-
-    int argc;
-    const char **cargv;
+    jsize length;
+    char ** array;
     XTextProperty text_prop;
     int status;
-    int i;
     Window xawt_root_window;
 
     AWT_LOCK();
     xawt_root_window = get_xawt_root_shell(env);
 
     if (xawt_root_window == None) {
+      AWT_UNLOCK();
       JNU_ThrowNullPointerException(env, "AWT root shell is unrealized");
-      AWT_UNLOCK();
       return;
     }
 
-    argc = (int)(*env)->GetArrayLength(env, jargv);
-    if (argc == 0) {
-        AWT_UNLOCK();
-        return;
+    array = stringArrayToNative(env, jarray, &length);
+
+    if (array != NULL) {
+        status = XmbTextListToTextProperty(awt_display, array, length,
+                                           XStdICCTextStyle, &text_prop);
+        if (status < 0) {
+            switch (status) {
+            case XNoMemory:
+                JNU_ThrowOutOfMemoryError(env,
+                    "XmbTextListToTextProperty: XNoMemory");
+                break;
+            case XLocaleNotSupported:
+                JNU_ThrowInternalError(env,
+                    "XmbTextListToTextProperty: XLocaleNotSupported");
+                break;
+            case XConverterNotFound:
+                JNU_ThrowNullPointerException(env,
+                    "XmbTextListToTextProperty: XConverterNotFound");
+                break;
+            default:
+                JNU_ThrowInternalError(env,
+                    "XmbTextListToTextProperty: unknown error");
+            }
+        } else {
+            XSetTextProperty(awt_display, xawt_root_window,
+                                 &text_prop, XA_WM_COMMAND);
+        }
+
+        if (text_prop.value != NULL)
+            XFree(text_prop.value);
+
+        freeNativeStringArray(array, length);
     }
-
-    /* array of C strings */
-    cargv = (const char **)calloc(argc, sizeof(char *));
-    if (cargv == NULL) {
-        JNU_ThrowOutOfMemoryError(env, "Unable to allocate cargv");
-        AWT_UNLOCK();
-        return;
-    }
-
-    /* fill C array with platform chars of java strings */
-      for (i = 0; i < argc; ++i) {
-        jstring js;
-        const char *cs;
-
-        cs = NULL;
-        js = (*env)->GetObjectArrayElement(env, jargv, i);
-        if (js != NULL) {
-            cs = JNU_GetStringPlatformChars(env, js, NULL);
-        }
-        if (cs == NULL) {
-            cs = empty;
-        }
-        cargv[i] = cs;
-        (*env)->DeleteLocalRef(env, js);
-    }
-
-    /* grr, X prototype doesn't declare cargv as const, thought it really is */
-    status = XmbTextListToTextProperty(awt_display, (char **)cargv, argc,
-                                       XStdICCTextStyle, &text_prop);
-    if (status < 0) {
-        switch (status) {
-        case XNoMemory:
-            JNU_ThrowOutOfMemoryError(env,
-                "XmbTextListToTextProperty: XNoMemory");
-            break;
-        case XLocaleNotSupported:
-            JNU_ThrowInternalError(env,
-                "XmbTextListToTextProperty: XLocaleNotSupported");
-            break;
-        case XConverterNotFound:
-            JNU_ThrowNullPointerException(env,
-                "XmbTextListToTextProperty: XConverterNotFound");
-            break;
-        default:
-            JNU_ThrowInternalError(env,
-                "XmbTextListToTextProperty: unknown error");
-        }
-    } else {
-
-    XSetTextProperty(awt_display, xawt_root_window,
-                         &text_prop, XA_WM_COMMAND);
-    }
-
-    for (i = 0; i < argc; ++i) {
-        jstring js;
-
-        if (cargv[i] == empty)
-            continue;
-
-        js = (*env)->GetObjectArrayElement(env, jargv, i);
-        JNU_ReleaseStringPlatformChars(env, js, cargv[i]);
-        (*env)->DeleteLocalRef(env, js);
-    }
-    if (text_prop.value != NULL)
-        XFree(text_prop.value);
     AWT_UNLOCK();
 }
 
--- a/src/solaris/native/sun/xawt/XWindow.c	Tue May 13 23:18:27 2014 -0700
+++ b/src/solaris/native/sun/xawt/XWindow.c	Wed May 14 11:00:21 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2002, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2014, 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
@@ -1242,9 +1242,13 @@
 {
    char *ptr = NULL;
    windowID = (*env)->GetFieldID(env, clazz, "window", "J");
+   CHECK_NULL(windowID);
    targetID = (*env)->GetFieldID(env, clazz, "target", "Ljava/awt/Component;");
+   CHECK_NULL(targetID);
    graphicsConfigID = (*env)->GetFieldID(env, clazz, "graphicsConfig", "Lsun/awt/X11GraphicsConfig;");
+   CHECK_NULL(graphicsConfigID);
    drawStateID = (*env)->GetFieldID(env, clazz, "drawState", "I");
+   CHECK_NULL(drawStateID);
    ptr = getenv("_AWT_USE_TYPE4_PATCH");
    if( ptr != NULL && ptr[0] != 0 ) {
        if( strncmp("true", ptr, 4) == 0 ) {
--- a/src/solaris/native/sun/xawt/XlibWrapper.c	Tue May 13 23:18:27 2014 -0700
+++ b/src/solaris/native/sun/xawt/XlibWrapper.c	Wed May 14 11:00:21 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2014, 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
@@ -48,6 +48,7 @@
 #include "utility/rect.h"
 
 #include <X11/XKBlib.h>
+
 #if defined(DEBUG) || defined(INTERNAL_BUILD)
 static jmethodID lockIsHeldMID = NULL;
 
@@ -59,17 +60,94 @@
         lockIsHeldMID =
             (*env)->GetStaticMethodID(env, tkClass,
                                       "isAWTLockHeldByCurrentThread", "()Z");
+        if (lockIsHeldMID == NULL) return;
     }
     if (!(*env)->CallStaticBooleanMethod(env, tkClass, lockIsHeldMID)) {
         JNU_ThrowInternalError(env, "Current thread does not hold AWT_LOCK!");
     }
 }
 
-#define AWT_CHECK_HAVE_LOCK() CheckHaveAWTLock(env)
+#define AWT_CHECK_HAVE_LOCK()                       \
+    do {                                            \
+        CheckHaveAWTLock(env);                      \
+        if ((*env)->ExceptionCheck(env)) {          \
+            return;                                 \
+        }                                           \
+    } while (0);                                    \
+
+#define AWT_CHECK_HAVE_LOCK_RETURN(ret)             \
+    do {                                            \
+        CheckHaveAWTLock(env);                      \
+        if ((*env)->ExceptionCheck(env)) {          \
+            return (ret);                           \
+        }                                           \
+    } while (0);                                    \
+
 #else
 #define AWT_CHECK_HAVE_LOCK()
+#define AWT_CHECK_HAVE_LOCK_RETURN(ret)
 #endif
 
+void freeNativeStringArray(char **array, jsize length) {
+    int i;
+    if (array == NULL) {
+        return;
+    }
+    for (i = 0; i < length; i++) {
+        free(array[i]);
+    }
+    free(array);
+}
+
+char** stringArrayToNative(JNIEnv *env, jobjectArray array, jsize * ret_length) {
+    Bool err = FALSE;
+    char ** strings;
+    int index, str_index = 0;
+    jsize length = (*env)->GetArrayLength(env, array);
+
+    if (length == 0) {
+        return NULL;
+    }
+
+    strings = (char**) calloc(length, sizeof (char*));
+
+    if (strings == NULL) {
+        JNU_ThrowOutOfMemoryError(env, "");
+        return NULL;
+    }
+
+    for (index = 0; index < length; index++) {
+        jstring str = (*env)->GetObjectArrayElement(env, array, index);
+        if (str != NULL) {
+            const char * str_char = JNU_GetStringPlatformChars(env, str, NULL);
+            if (str_char != NULL) {
+                char * dup_str = strdup(str_char);
+                if (dup_str != NULL) {
+                    strings[str_index++] = dup_str;
+                } else {
+                    JNU_ThrowOutOfMemoryError(env, "");
+                    err = TRUE;
+                }
+                JNU_ReleaseStringPlatformChars(env, str, str_char);
+            } else {
+                err = TRUE;
+            }
+            (*env)->DeleteLocalRef(env, str);
+            if (err) {
+                break;
+            }
+        }
+    }
+
+    if (err) {
+        freeNativeStringArray(strings, str_index);
+        strings = NULL;
+        str_index = -1;
+    }
+    *ret_length = str_index;
+
+    return strings;
+}
 
 /*
  * Class:     XlibWrapper
@@ -81,7 +159,7 @@
 (JNIEnv *env, jclass clazz, jlong display_name)
 {
     Display *dp;
-    AWT_CHECK_HAVE_LOCK();
+    AWT_CHECK_HAVE_LOCK_RETURN(0);
     dp  =  XOpenDisplay((char *) jlong_to_ptr(display_name));
 
     return ptr_to_jlong(dp);
@@ -97,7 +175,7 @@
 JNIEXPORT jlong JNICALL
 Java_sun_awt_X11_XlibWrapper_XDisplayString(JNIEnv *env, jclass clazz,
                         jlong display) {
-    AWT_CHECK_HAVE_LOCK();
+    AWT_CHECK_HAVE_LOCK_RETURN(0);
     return ptr_to_jlong(XDisplayString((Display*) jlong_to_ptr(display)));
 }
 
@@ -115,7 +193,7 @@
  */
 JNIEXPORT jlong JNICALL Java_sun_awt_X11_XlibWrapper_DefaultScreen (JNIEnv *env, jclass clazz, jlong display) {
 
-    AWT_CHECK_HAVE_LOCK();
+    AWT_CHECK_HAVE_LOCK_RETURN(0);
     return (jlong) DefaultScreen((Display *) jlong_to_ptr(display));
 }
 
@@ -125,7 +203,7 @@
  * Signature: (JJ)J
  */
 JNIEXPORT jlong JNICALL Java_sun_awt_X11_XlibWrapper_ScreenOfDisplay(JNIEnv *env, jclass clazz, jlong display, jlong screen_number) {
-    AWT_CHECK_HAVE_LOCK();
+    AWT_CHECK_HAVE_LOCK_RETURN(0);
     return ptr_to_jlong(ScreenOfDisplay((Display *) jlong_to_ptr(display),
                                         screen_number));
 }
@@ -136,7 +214,7 @@
  * Signature: (J)I
  */
 JNIEXPORT jint JNICALL Java_sun_awt_X11_XlibWrapper_DoesBackingStore(JNIEnv *env, jclass clazz, jlong screen) {
-    AWT_CHECK_HAVE_LOCK();
+    AWT_CHECK_HAVE_LOCK_RETURN(0);
     return (jint) DoesBackingStore((Screen*) jlong_to_ptr(screen));
 }
 
@@ -148,7 +226,7 @@
 JNIEXPORT jlong JNICALL Java_sun_awt_X11_XlibWrapper_DisplayWidth
 (JNIEnv *env, jclass clazz, jlong display, jlong screen) {
 
-    AWT_CHECK_HAVE_LOCK();
+    AWT_CHECK_HAVE_LOCK_RETURN(0);
     return (jlong) DisplayWidth((Display *) jlong_to_ptr(display),screen);
 
 }
@@ -160,7 +238,7 @@
  */
 JNIEXPORT jlong JNICALL Java_sun_awt_X11_XlibWrapper_DisplayWidthMM
 (JNIEnv *env, jclass clazz, jlong display, jlong screen) {
-    AWT_CHECK_HAVE_LOCK();
+    AWT_CHECK_HAVE_LOCK_RETURN(0);
     return (jlong) DisplayWidthMM((Display *) jlong_to_ptr(display),screen);
 }
 
@@ -172,7 +250,7 @@
 JNIEXPORT jlong JNICALL Java_sun_awt_X11_XlibWrapper_DisplayHeight
 (JNIEnv *env, jclass clazz, jlong display, jlong screen) {
 
-    AWT_CHECK_HAVE_LOCK();
+    AWT_CHECK_HAVE_LOCK_RETURN(0);
     return (jlong) DisplayHeight((Display *) jlong_to_ptr(display),screen);
 }
 /*
@@ -182,7 +260,7 @@
  */
 JNIEXPORT jlong JNICALL Java_sun_awt_X11_XlibWrapper_DisplayHeightMM
 (JNIEnv *env, jclass clazz, jlong display, jlong screen) {
-    AWT_CHECK_HAVE_LOCK();
+    AWT_CHECK_HAVE_LOCK_RETURN(0);
     return (jlong) DisplayHeightMM((Display *) jlong_to_ptr(display),screen);
 }
 
@@ -193,7 +271,7 @@
  */
 JNIEXPORT jlong JNICALL Java_sun_awt_X11_XlibWrapper_RootWindow
 (JNIEnv *env , jclass clazz, jlong display, jlong screen_number) {
-    AWT_CHECK_HAVE_LOCK();
+    AWT_CHECK_HAVE_LOCK_RETURN(0);
     return (jlong) RootWindow((Display *) jlong_to_ptr(display), screen_number);
 }
 
@@ -203,7 +281,7 @@
  */
 JNIEXPORT jint JNICALL Java_sun_awt_X11_XlibWrapper_ScreenCount
 (JNIEnv *env , jclass clazz, jlong display) {
-    AWT_CHECK_HAVE_LOCK();
+    AWT_CHECK_HAVE_LOCK_RETURN(0);
     return ScreenCount((Display *) jlong_to_ptr(display));
 }
 
@@ -218,7 +296,7 @@
    jint x, jint y, jint w, jint h , jint border_width, jint depth,
    jlong wclass, jlong visual, jlong valuemask, jlong attributes)
 {
-    AWT_CHECK_HAVE_LOCK();
+    AWT_CHECK_HAVE_LOCK_RETURN(0);
     return  XCreateWindow((Display *) jlong_to_ptr(display),(Window) window, x, y, w, h,
               border_width, depth, wclass, (Visual *) jlong_to_ptr(visual),
               valuemask, (XSetWindowAttributes *) jlong_to_ptr(attributes));
@@ -360,7 +438,7 @@
 
     Window focusOwner;
     int revert_to;
-    AWT_CHECK_HAVE_LOCK();
+    AWT_CHECK_HAVE_LOCK_RETURN(0);
     XGetInputFocus( (Display *)jlong_to_ptr(display), &focusOwner, &revert_to);
     return focusOwner;
 }
@@ -383,7 +461,7 @@
  jint owner_events, jint event_mask, jint pointer_mode,
  jint keyboard_mode, jlong confine_to, jlong cursor, jlong time)
 {
-    AWT_CHECK_HAVE_LOCK();
+    AWT_CHECK_HAVE_LOCK_RETURN(0);
     return XGrabPointer( (Display *)jlong_to_ptr(display), (Window) window,
              (Bool) owner_events, (unsigned int) event_mask, (int) pointer_mode,
              (int) keyboard_mode, (Window) confine_to, (Cursor) cursor, (Time) time);
@@ -401,7 +479,7 @@
  jint owner_events, jint pointer_mode,
  jint keyboard_mode, jlong time)
 {
-    AWT_CHECK_HAVE_LOCK();
+    AWT_CHECK_HAVE_LOCK_RETURN(0);
     return XGrabKeyboard( (Display *)jlong_to_ptr(display), (Window) window,
               (Bool) owner_events, (int) pointer_mode,
               (int) keyboard_mode, (Time) time);
@@ -474,7 +552,7 @@
 (JNIEnv *env, jclass clazz, jlong display, jlong opcode_rtrn, jlong event_rtrn,
               jlong error_rtrn, jlong major_in_out, jlong minor_in_out)
 {
-    AWT_CHECK_HAVE_LOCK();
+    AWT_CHECK_HAVE_LOCK_RETURN(JNI_FALSE);
     return XkbQueryExtension( (Display *) jlong_to_ptr(display),
                        (int *) jlong_to_ptr(opcode_rtrn),
                        (int *) jlong_to_ptr(event_rtrn),
@@ -485,7 +563,7 @@
 JNIEXPORT jboolean JNICALL Java_sun_awt_X11_XlibWrapper_XkbLibraryVersion
 (JNIEnv *env, jclass clazz, jlong lib_major_in_out, jlong lib_minor_in_out)
 {
-    AWT_CHECK_HAVE_LOCK();
+    AWT_CHECK_HAVE_LOCK_RETURN(JNI_FALSE);
     *((int *)jlong_to_ptr(lib_major_in_out)) =  XkbMajorVersion;
     *((int *)jlong_to_ptr(lib_minor_in_out)) =  XkbMinorVersion;
     return  XkbLibraryVersion((int *)jlong_to_ptr(lib_major_in_out), (int *)jlong_to_ptr(lib_minor_in_out));
@@ -494,7 +572,7 @@
 JNIEXPORT jlong JNICALL Java_sun_awt_X11_XlibWrapper_XkbGetMap
 (JNIEnv *env, jclass clazz, jlong display, jlong which, jlong device_spec)
 {
-    AWT_CHECK_HAVE_LOCK();
+    AWT_CHECK_HAVE_LOCK_RETURN(0);
     return (jlong) XkbGetMap( (Display *) jlong_to_ptr(display),
                               (unsigned int) which,
                               (unsigned int) device_spec);
@@ -502,7 +580,7 @@
 JNIEXPORT jlong JNICALL Java_sun_awt_X11_XlibWrapper_XkbGetUpdatedMap
 (JNIEnv *env, jclass clazz, jlong display, jlong which, jlong xkb)
 {
-    AWT_CHECK_HAVE_LOCK();
+    AWT_CHECK_HAVE_LOCK_RETURN(0);
     return (jlong) XkbGetUpdatedMap( (Display *) jlong_to_ptr(display),
                               (unsigned int) which,
                               (XkbDescPtr) jlong_to_ptr(xkb));
@@ -516,6 +594,7 @@
 JNIEXPORT jboolean JNICALL Java_sun_awt_X11_XlibWrapper_XkbTranslateKeyCode
 (JNIEnv *env, jclass clazz, jlong xkb, jint keycode, jlong mods, jlong mods_rtrn, jlong keysym_rtrn)
 {
+    AWT_CHECK_HAVE_LOCK_RETURN(JNI_FALSE);
     Bool b;
     b = XkbTranslateKeyCode((XkbDescPtr)xkb, (unsigned int)keycode, (unsigned int)mods,
                               (unsigned int *)jlong_to_ptr(mods_rtrn),
@@ -578,7 +657,7 @@
 JNIEXPORT jboolean JNICALL Java_sun_awt_X11_XlibWrapper_XFilterEvent
 (JNIEnv *env, jclass clazz, jlong ptr, jlong window)
 {
-    AWT_CHECK_HAVE_LOCK();
+    AWT_CHECK_HAVE_LOCK_RETURN(JNI_FALSE);
     return (jboolean) XFilterEvent((XEvent *) jlong_to_ptr(ptr), (Window) window);
 }
 
@@ -590,7 +669,7 @@
 JNIEXPORT jboolean JNICALL Java_sun_awt_X11_XlibWrapper_XSupportsLocale
 (JNIEnv *env, jclass clazz)
 {
-    AWT_CHECK_HAVE_LOCK();
+    AWT_CHECK_HAVE_LOCK_RETURN(JNI_FALSE);
     return (jboolean)XSupportsLocale();
 }
 
@@ -607,9 +686,10 @@
 
     if (!JNU_IsNull(env, jstr)) {
         modifier_list = (char *)JNU_GetStringPlatformChars(env, jstr, NULL);
+        CHECK_NULL_RETURN(modifier_list, NULL);
     }
 
-    AWT_CHECK_HAVE_LOCK();
+    AWT_CHECK_HAVE_LOCK_RETURN(NULL);
     if (modifier_list) {
         ret = XSetLocaleModifiers(modifier_list);
         JNU_ReleaseStringPlatformChars(env, jstr, (const char *) modifier_list);
@@ -722,7 +802,7 @@
  jlong src_x, jlong src_y, jlong dest_x_return, jlong dest_y_return,
  jlong child_return)
 {
-    AWT_CHECK_HAVE_LOCK();
+    AWT_CHECK_HAVE_LOCK_RETURN(0);
     return XTranslateCoordinates( (Display *) jlong_to_ptr(display), src_w, dest_w,
                   src_x, src_y,
                   (int *) jlong_to_ptr(dest_x_return),
@@ -733,7 +813,7 @@
 JNIEXPORT jint JNICALL Java_sun_awt_X11_XlibWrapper_XEventsQueued
 (JNIEnv *env, jclass clazz, jlong display, jint mode) {
 
-    AWT_CHECK_HAVE_LOCK();
+    AWT_CHECK_HAVE_LOCK_RETURN(0);
     return XEventsQueued((Display *) jlong_to_ptr(display), mode);
 
 }
@@ -758,6 +838,7 @@
 #else
         cname = (char *) JNU_GetStringPlatformChars(env, jstr, NULL);
 #endif
+        CHECK_NULL(cname);
     } else {
         cname = "";
     }
@@ -814,8 +895,9 @@
     jlong type, jint format, jint mode, jstring value)
 {
     jboolean iscopy;
+    AWT_CHECK_HAVE_LOCK();
     const char * chars = JNU_GetStringPlatformChars(env, value, &iscopy);
-    AWT_CHECK_HAVE_LOCK();
+    CHECK_NULL(chars);
     XChangeProperty((Display*)jlong_to_ptr(display), window, (Atom)property,
                     (Atom)type, format, mode, (unsigned char*)chars, strlen(chars));
     if (iscopy) {
@@ -833,7 +915,7 @@
  jlong long_length, jlong delete, jlong req_type, jlong actual_type,
  jlong actual_format, jlong nitems_ptr, jlong bytes_after, jlong data_ptr)
 {
-    AWT_CHECK_HAVE_LOCK();
+    AWT_CHECK_HAVE_LOCK_RETURN(0);
     return XGetWindowProperty((Display*) jlong_to_ptr(display), window, property, long_offset, long_length,
                   delete, (Atom) req_type, (Atom*) jlong_to_ptr(actual_type),
                   (int *) jlong_to_ptr(actual_format), (unsigned long *) jlong_to_ptr(nitems_ptr),
@@ -857,23 +939,22 @@
     unsigned long nitems;
     unsigned long bytes_after;
     unsigned char * string;
-    jstring res;
-    AWT_CHECK_HAVE_LOCK();
+    jstring res = NULL;
+    AWT_CHECK_HAVE_LOCK_RETURN(NULL);
     status = XGetWindowProperty((Display*)jlong_to_ptr(display), window,
                                 atom, 0, 0xFFFF, False, XA_STRING,
                                 &actual_type, &actual_format, &nitems, &bytes_after,
                                 &string);
+
     if (status != Success || string == NULL) {
-    return NULL;
+        return NULL;
     }
 
-    if (actual_type != XA_STRING || actual_format != 8) {
+    if (actual_type == XA_STRING && actual_format == 8) {
+        res = JNU_NewStringPlatform(env,(char*) string);
+    }
     XFree(string);
-    return NULL;
-    }
-
-    // Memory leak???
-    return JNU_NewStringPlatform(env,(char*) string);
+    return res;
 }
 
 /*
@@ -887,13 +968,15 @@
     char *cname;
     unsigned long atom;
 
+    AWT_CHECK_HAVE_LOCK_RETURN(0);
+
     if (!JNU_IsNull(env, jstr)) {
         cname = (char *)JNU_GetStringPlatformChars(env, jstr, NULL);
+        CHECK_NULL_RETURN(cname, 0);
     } else {
         cname = "";
     }
 
-    AWT_CHECK_HAVE_LOCK();
     atom = XInternAtom((Display *) jlong_to_ptr(display), cname, ife);
 
     if (!JNU_IsNull(env, jstr)) {
@@ -906,7 +989,7 @@
 
 JNIEXPORT jint JNICALL Java_sun_awt_X11_XlibWrapper_XCreateFontCursor
 (JNIEnv *env, jclass clazz, jlong display, jint shape) {
-    AWT_CHECK_HAVE_LOCK();
+    AWT_CHECK_HAVE_LOCK_RETURN(0);
     return XCreateFontCursor((Display *) jlong_to_ptr(display), (int) shape);
 }
 
@@ -919,7 +1002,7 @@
 JNIEXPORT jlong JNICALL Java_sun_awt_X11_XlibWrapper_XCreatePixmapCursor
 (JNIEnv *env , jclass clazz, jlong display, jlong source, jlong mask, jlong fore, jlong back, jint x , jint y) {
 
-    AWT_CHECK_HAVE_LOCK();
+    AWT_CHECK_HAVE_LOCK_RETURN(0);
     return (jlong) XCreatePixmapCursor((Display *) jlong_to_ptr(display), (Pixmap) source, (Pixmap) mask,
                                        (XColor *) jlong_to_ptr(fore), (XColor *) jlong_to_ptr(back), x, y);
 }
@@ -935,7 +1018,7 @@
 
     Status status;
 
-    AWT_CHECK_HAVE_LOCK();
+    AWT_CHECK_HAVE_LOCK_RETURN(JNI_FALSE);
     status  =  XQueryBestCursor((Display *) jlong_to_ptr(display), (Drawable) drawable, width,height,
                                 (unsigned int *) jlong_to_ptr(width_return), (unsigned int *) jlong_to_ptr(height_return));
 
@@ -966,15 +1049,14 @@
 
     Bool b;
 
-    AWT_CHECK_HAVE_LOCK();
+    AWT_CHECK_HAVE_LOCK_RETURN(JNI_FALSE);
     b = XQueryPointer((Display *) jlong_to_ptr(display),
                       (Window) w, (Window *) jlong_to_ptr(root_return), (Window *) jlong_to_ptr(child_return),
                       (int *) jlong_to_ptr(root_x_return), (int *) jlong_to_ptr(root_y_return),
                       (int *) jlong_to_ptr(win_x_return), (int *) jlong_to_ptr(win_y_return),
                       (unsigned int *) jlong_to_ptr(mask_return));
-    if (b == True) return JNI_TRUE;
-    else return JNI_FALSE;
 
+    return b ? JNI_TRUE : JNI_FALSE;
 }
 
 /*
@@ -1042,7 +1124,7 @@
 JNIEXPORT jint JNICALL Java_sun_awt_X11_XlibWrapper_XGetPointerMapping
 (JNIEnv *env, jclass clazz, jlong display, jlong map, jint buttonNumber)
 {
-    AWT_CHECK_HAVE_LOCK();
+    AWT_CHECK_HAVE_LOCK_RETURN(0);
     return XGetPointerMapping((Display*)jlong_to_ptr(display), (unsigned char*) jlong_to_ptr(map), buttonNumber);
 }
 
@@ -1061,31 +1143,26 @@
     if (!JNU_IsNull(env, program)) {
         c_program = (char *)JNU_GetStringPlatformChars(env, program, NULL);
     }
+    CHECK_NULL_RETURN(c_program, NULL);
+
     if (!JNU_IsNull(env, option)) {
         c_option = (char *)JNU_GetStringPlatformChars(env, option, NULL);
     }
 
-    if (c_program == NULL || c_option == NULL) {
-        if (!JNU_IsNull(env, program)) {
-            JNU_ReleaseStringPlatformChars(env, program, (const char *) c_program);
-        }
-        if (!JNU_IsNull(env, option)) {
-            JNU_ReleaseStringPlatformChars(env, option, (const char *) c_option);
-        }
+    if (c_option == NULL) {
+        JNU_ReleaseStringPlatformChars(env, program, (const char *) c_program);
         return NULL;
     }
-    AWT_CHECK_HAVE_LOCK();
+
+    AWT_CHECK_HAVE_LOCK_RETURN(NULL);
     c_res = XGetDefault((Display*)jlong_to_ptr(display), c_program, c_option);
+    // The strings returned by XGetDefault() are owned by Xlib and
+    // should not be modified or freed by the client.
 
-    if (!JNU_IsNull(env, program)) {
-        JNU_ReleaseStringPlatformChars(env, program, (const char *) c_program);
-    }
-    if (!JNU_IsNull(env, option)) {
-        JNU_ReleaseStringPlatformChars(env, option, (const char *) c_option);
-    }
+    JNU_ReleaseStringPlatformChars(env, program, (const char *) c_program);
+    JNU_ReleaseStringPlatformChars(env, option, (const char *) c_option);
 
     if (c_res != NULL) {
-        // Memory leak???
         return JNU_NewStringPlatform(env, c_res);
     } else {
         return NULL;
@@ -1103,7 +1180,7 @@
 {
     XWindowAttributes attrs;
     memset(&attrs, 0, sizeof(attrs));
-    AWT_CHECK_HAVE_LOCK();
+    AWT_CHECK_HAVE_LOCK_RETURN(0);
     XGetWindowAttributes((Display *) jlong_to_ptr(display), window, &attrs);
     return ptr_to_jlong(attrs.screen);
 }
@@ -1116,7 +1193,7 @@
 JNIEXPORT jlong JNICALL Java_sun_awt_X11_XlibWrapper_XScreenNumberOfScreen
 (JNIEnv *env, jclass clazz, jlong screen)
 {
-    AWT_CHECK_HAVE_LOCK();
+    AWT_CHECK_HAVE_LOCK_RETURN(-1);
     if(jlong_to_ptr(screen) == NULL) {
         return -1;
     }
@@ -1131,7 +1208,7 @@
 JNIEXPORT jint JNICALL Java_sun_awt_X11_XlibWrapper_XIconifyWindow
 (JNIEnv *env, jclass clazz, jlong display, jlong window, jlong screenNumber)
 {
-    AWT_CHECK_HAVE_LOCK();
+    AWT_CHECK_HAVE_LOCK_RETURN(0);
     return XIconifyWindow((Display*) jlong_to_ptr(display), window, screenNumber);
 }
 
@@ -1158,6 +1235,7 @@
     unsigned char * str = (unsigned char*) jlong_to_ptr(str_ptr);
     long length = strlen((char*)str);
     jbyteArray res = (*env)->NewByteArray(env, length);
+    CHECK_NULL_RETURN(res, NULL);
     void * storage = malloc(length+1);
     memcpy(storage, str, length+1);
     (*env)->SetByteArrayRegion(env, res, 0, length,
@@ -1174,7 +1252,7 @@
 JNIEXPORT jstring JNICALL Java_sun_awt_X11_XlibWrapper_ServerVendor
 (JNIEnv *env, jclass clazz, jlong display)
 {
-    AWT_CHECK_HAVE_LOCK();
+    AWT_CHECK_HAVE_LOCK_RETURN(NULL);
     return JNU_NewStringPlatform(env, ServerVendor((Display*)jlong_to_ptr(display)));
 }
 /*
@@ -1185,7 +1263,7 @@
 JNIEXPORT jint JNICALL Java_sun_awt_X11_XlibWrapper_VendorRelease
 (JNIEnv *env, jclass clazz, jlong display)
 {
-    AWT_CHECK_HAVE_LOCK();
+    AWT_CHECK_HAVE_LOCK_RETURN(0);
     return VendorRelease((Display*)jlong_to_ptr(display));
 }
 /*
@@ -1203,7 +1281,7 @@
     // second, in which place in the keysymarray is XK_KP_7
     // using XKeycodeToKeysym.
     int kc7;
-    AWT_CHECK_HAVE_LOCK();
+    AWT_CHECK_HAVE_LOCK_RETURN(JNI_FALSE);
     kc7 = XKeysymToKeycode((Display*)jlong_to_ptr(display), XK_KP_7);
     if( !kc7 ) {
         // keycode is not defined. Why, it's a reduced keyboard perhaps:
@@ -1226,7 +1304,7 @@
 (JNIEnv *env, jclass clazz, jlong display)
 {
     int xx;
-    AWT_CHECK_HAVE_LOCK();
+    AWT_CHECK_HAVE_LOCK_RETURN(JNI_FALSE);
     xx = XKeysymToKeycode((Display*)jlong_to_ptr(display), SunXK_F37);
     return (!xx) ? JNI_FALSE : JNI_TRUE;
 }
@@ -1242,7 +1320,7 @@
     int32_t i;
     int32_t kanaCount = 0;
 
-    AWT_CHECK_HAVE_LOCK();
+    AWT_CHECK_HAVE_LOCK_RETURN(JNI_FALSE);
 
     // There's no direct way to determine whether the keyboard has
     // a kana lock key. From available keyboard mapping tables, it looks
@@ -1289,8 +1367,10 @@
 JNIEXPORT jlong JNICALL Java_sun_awt_X11_XlibWrapper_SetToolkitErrorHandler
 (JNIEnv *env, jclass clazz)
 {
-    (*env)->GetJavaVM(env, &jvm);
-    AWT_CHECK_HAVE_LOCK();
+    if ((*env)->GetJavaVM(env, &jvm) < 0) {
+        return 0;
+    }
+    AWT_CHECK_HAVE_LOCK_RETURN(0);
     return ptr_to_jlong(XSetErrorHandler(ToolkitErrorHandler));
 }
 
@@ -1350,28 +1430,14 @@
 JNIEXPORT jint JNICALL Java_sun_awt_X11_XlibWrapper_XInternAtoms
 (JNIEnv *env, jclass clazz, jlong display, jobjectArray names_arr, jboolean only_if_exists, jlong atoms)
 {
-    int length = (*env)->GetArrayLength(env, names_arr);
-    char ** names = (char**)malloc(length*sizeof(char*));
-    jboolean copy;
-    int index, name_index = 0;
-    int status;
-
-    AWT_CHECK_HAVE_LOCK();
-
-    for (index = 0; index < length; index++) {
-        jstring str = (*env)->GetObjectArrayElement(env, names_arr, index);
-        if (!JNU_IsNull(env, str)) {
-            const char * str_char = JNU_GetStringPlatformChars(env, str, NULL);
-            names[name_index++] = strdup(str_char);
-            JNU_ReleaseStringPlatformChars(env, str, str_char);
-            (*env)->DeleteLocalRef(env, str);
-        }
+    int status = 0;
+    AWT_CHECK_HAVE_LOCK_RETURN(0);
+    jsize length;
+    char** names = stringArrayToNative(env, names_arr, &length);
+    if (names) {
+        status = XInternAtoms((Display*)jlong_to_ptr(display), names, length, only_if_exists, (Atom*) jlong_to_ptr(atoms));
+        freeNativeStringArray(names, length);
     }
-    status = XInternAtoms((Display*)jlong_to_ptr(display), names, name_index, only_if_exists, (Atom*) jlong_to_ptr(atoms));
-    for (index = 0; index < length; index++) {
-        free(names[index]);
-    }
-    free(names);
     return status;
 }
 
@@ -1386,7 +1452,7 @@
 (JNIEnv *env, jclass clazz, jlong display, jlong window, jlong attr_ptr)
 {
     jint status;
-    AWT_CHECK_HAVE_LOCK();
+    AWT_CHECK_HAVE_LOCK_RETURN(0);
     memset((XWindowAttributes*) jlong_to_ptr(attr_ptr), 0, sizeof(XWindowAttributes));
     status =  XGetWindowAttributes((Display*)jlong_to_ptr(display), window, (XWindowAttributes*) jlong_to_ptr(attr_ptr));
     return status;
@@ -1404,7 +1470,7 @@
      jlong border_width_return, jlong depth_return)
 {
     jint status;
-    AWT_CHECK_HAVE_LOCK();
+    AWT_CHECK_HAVE_LOCK_RETURN(0);
     status = XGetGeometry((Display *)jlong_to_ptr(display),
                           (Drawable)drawable, (Window *)jlong_to_ptr(root_return),
                           (int *)jlong_to_ptr(x_return), (int *)jlong_to_ptr(y_return),
@@ -1423,7 +1489,7 @@
 JNIEXPORT jint JNICALL Java_sun_awt_X11_XlibWrapper_XGetWMNormalHints
 (JNIEnv *env, jclass clazz, jlong display, jlong window, jlong hints, jlong supplied_return)
 {
-    AWT_CHECK_HAVE_LOCK();
+    AWT_CHECK_HAVE_LOCK_RETURN(0);
     return XGetWMNormalHints((Display*) jlong_to_ptr(display),
                              window,
                              (XSizeHints*) jlong_to_ptr(hints),
@@ -1462,7 +1528,7 @@
 JNIEXPORT jint JNICALL Java_sun_awt_X11_XlibWrapper_XSendEvent
 (JNIEnv *env, jclass clazz, jlong display, jlong window, jboolean propagate, jlong event_mask, jlong event)
 {
-    AWT_CHECK_HAVE_LOCK();
+    AWT_CHECK_HAVE_LOCK_RETURN(0);
     return XSendEvent((Display*) jlong_to_ptr(display),
                       window,
                       propagate==JNI_TRUE?True:False,
@@ -1479,7 +1545,7 @@
 JNIEXPORT jint JNICALL Java_sun_awt_X11_XlibWrapper_XQueryTree
 (JNIEnv *env, jclass clazz, jlong display, jlong window, jlong root_return, jlong parent_return, jlong children_return, jlong nchildren_return)
 {
-    AWT_CHECK_HAVE_LOCK();
+    AWT_CHECK_HAVE_LOCK_RETURN(0);
     return XQueryTree((Display*) jlong_to_ptr(display),
                       window,
                       (Window *) jlong_to_ptr(root_return),
@@ -1524,7 +1590,7 @@
 (JNIEnv *env, jclass clazz, jlong display, jlong vinfo_mask, jlong vinfo_template,
  jlong nitems_return)
 {
-    AWT_CHECK_HAVE_LOCK();
+    AWT_CHECK_HAVE_LOCK_RETURN(0);
     return ptr_to_jlong(XGetVisualInfo((Display*) jlong_to_ptr(display),
                                        (long) vinfo_mask,
                                        (XVisualInfo*) jlong_to_ptr(vinfo_template),
@@ -1534,7 +1600,7 @@
 JNIEXPORT jlong JNICALL Java_sun_awt_X11_XlibWrapper_XAllocSizeHints
   (JNIEnv *env, jclass clazz)
 {
-    AWT_CHECK_HAVE_LOCK();
+    AWT_CHECK_HAVE_LOCK_RETURN(0);
     return ptr_to_jlong(XAllocSizeHints());
 }
 
@@ -1560,7 +1626,7 @@
 (JNIEnv *env, jclass clazz, jlong display , jlong colormap, jlong xcolor) {
 
     Status status;
-    AWT_CHECK_HAVE_LOCK();
+    AWT_CHECK_HAVE_LOCK_RETURN(JNI_FALSE);
     status = XAllocColor((Display *) jlong_to_ptr(display), (Colormap) colormap, (XColor *) jlong_to_ptr(xcolor));
 
     if (status == 0) return JNI_FALSE;
@@ -1575,7 +1641,7 @@
  */
 JNIEXPORT jlong JNICALL Java_sun_awt_X11_XlibWrapper_XCreateBitmapFromData
 (JNIEnv *env, jclass clazz, jlong display, jlong drawable, jlong data, jint width, jint height) {
-    AWT_CHECK_HAVE_LOCK();
+    AWT_CHECK_HAVE_LOCK_RETURN(0);
 
     return (jlong) XCreateBitmapFromData((Display *) jlong_to_ptr(display), (Drawable) drawable,
                                          (char *) jlong_to_ptr(data), width, height);
@@ -1640,7 +1706,7 @@
 JNIEXPORT jlong JNICALL
 Java_sun_awt_X11_XlibWrapper_XGetSelectionOwner(JNIEnv *env, jclass clazz,
                         jlong display, jlong selection) {
-    AWT_CHECK_HAVE_LOCK();
+    AWT_CHECK_HAVE_LOCK_RETURN(0);
     return (jlong)XGetSelectionOwner((Display*)jlong_to_ptr(display), selection);
 }
 
@@ -1655,7 +1721,7 @@
 {
     jstring string = NULL;
     char* name;
-    AWT_CHECK_HAVE_LOCK();
+    AWT_CHECK_HAVE_LOCK_RETURN(NULL);
     name = (char*) XGetAtomName((Display*)jlong_to_ptr(display), atom);
 
     if (name == NULL) {
@@ -1679,21 +1745,21 @@
 JNIEXPORT jlong JNICALL
 Java_sun_awt_X11_XlibWrapper_XMaxRequestSize(JNIEnv *env, jclass clazz,
                          jlong display) {
-    AWT_CHECK_HAVE_LOCK();
+    AWT_CHECK_HAVE_LOCK_RETURN(0);
     return XMaxRequestSize((Display*) jlong_to_ptr(display));
 }
 
 JNIEXPORT jlong JNICALL
 Java_sun_awt_X11_XlibWrapper_XAllocWMHints(JNIEnv *env, jclass clazz)
 {
-    AWT_CHECK_HAVE_LOCK();
+    AWT_CHECK_HAVE_LOCK_RETURN(0);
     return ptr_to_jlong(XAllocWMHints());
 }
 
 JNIEXPORT jlong JNICALL
 Java_sun_awt_X11_XlibWrapper_XCreatePixmap(JNIEnv *env, jclass clazz, jlong display, jlong drawable, jint width, jint height, jint depth)
 {
-    AWT_CHECK_HAVE_LOCK();
+    AWT_CHECK_HAVE_LOCK_RETURN(0);
     return XCreatePixmap((Display*)jlong_to_ptr(display), (Drawable)drawable, width, height, depth);
 }
 JNIEXPORT jlong JNICALL
@@ -1702,7 +1768,7 @@
    jint depth, jint format, jint offset, jlong data, jint width,
    jint height, jint bitmap_pad, jint bytes_per_line)
 {
-    AWT_CHECK_HAVE_LOCK();
+    AWT_CHECK_HAVE_LOCK_RETURN(0);
     return ptr_to_jlong(XCreateImage((Display*) jlong_to_ptr(display), (Visual*) jlong_to_ptr(visual_ptr),
                 depth, format, offset, (char*) jlong_to_ptr(data),
                 width, height, bitmap_pad, bytes_per_line));
@@ -1712,7 +1778,7 @@
   (JNIEnv *env, jclass clazz, jlong display, jlong drawable,
    jlong valuemask, jlong values)
 {
-    AWT_CHECK_HAVE_LOCK();
+    AWT_CHECK_HAVE_LOCK_RETURN(0);
     return ptr_to_jlong(XCreateGC((Display*) jlong_to_ptr(display), (Drawable)drawable, valuemask, (XGCValues*) jlong_to_ptr(values)));
 }
 
@@ -1762,7 +1828,7 @@
     XIconSize** psize = (XIconSize**) jlong_to_ptr(ret_sizes);
     int * pcount = (int *) jlong_to_ptr(ret_count);
     Status res;
-    AWT_CHECK_HAVE_LOCK();
+    AWT_CHECK_HAVE_LOCK_RETURN(0);
     res = XGetIconSizes((Display*) jlong_to_ptr(display), (Window)window, psize, pcount);
     return res;
 }
@@ -1771,7 +1837,7 @@
   (JNIEnv *env, jclass clazz, jlong display, jlong major_version_return,
    jlong minor_version_return)
 {
-    AWT_CHECK_HAVE_LOCK();
+    AWT_CHECK_HAVE_LOCK_RETURN(0);
     return XdbeQueryExtension((Display*) jlong_to_ptr(display), (int *) jlong_to_ptr(major_version_return),
                   (int *) jlong_to_ptr(minor_version_return));
 }
@@ -1784,11 +1850,12 @@
     Boolean bu;
     if (!JNU_IsNull(env, jstr)) {
         cname = (char *)JNU_GetStringPlatformChars(env, jstr, NULL);
+        CHECK_NULL_RETURN(cname, JNI_FALSE);
     } else {
         cname = "";
     }
 
-    AWT_CHECK_HAVE_LOCK();
+    AWT_CHECK_HAVE_LOCK_RETURN(JNI_FALSE);
     bu = XQueryExtension((Display*) jlong_to_ptr(display), cname, (int *) jlong_to_ptr(mop_return),
                 (int *) jlong_to_ptr(feve_return),  (int *) jlong_to_ptr(err_return));
     if (!JNU_IsNull(env, jstr)) {
@@ -1800,7 +1867,7 @@
 JNIEXPORT jboolean JNICALL Java_sun_awt_X11_XlibWrapper_IsKeypadKey
   (JNIEnv *env, jclass clazz, jlong keysym)
 {
-    AWT_CHECK_HAVE_LOCK();
+    AWT_CHECK_HAVE_LOCK_RETURN(JNI_FALSE);
     if(IsKeypadKey(keysym)) {
         return JNI_TRUE;
     }
@@ -1810,7 +1877,7 @@
 JNIEXPORT jlong JNICALL Java_sun_awt_X11_XlibWrapper_XdbeAllocateBackBufferName
   (JNIEnv *env, jclass clazz, jlong display, jlong window, jint swap_action)
 {
-    AWT_CHECK_HAVE_LOCK();
+    AWT_CHECK_HAVE_LOCK_RETURN(0);
     return XdbeAllocateBackBufferName((Display*) jlong_to_ptr(display), (Window) window,
                       (XdbeSwapAction) swap_action);
 }
@@ -1818,28 +1885,28 @@
 JNIEXPORT jint JNICALL Java_sun_awt_X11_XlibWrapper_XdbeDeallocateBackBufferName
   (JNIEnv *env, jclass clazz, jlong display, jlong buffer)
 {
-    AWT_CHECK_HAVE_LOCK();
+    AWT_CHECK_HAVE_LOCK_RETURN(0);
     return XdbeDeallocateBackBufferName((Display*) jlong_to_ptr(display), (XdbeBackBuffer) buffer);
 }
 
 JNIEXPORT jint JNICALL Java_sun_awt_X11_XlibWrapper_XdbeBeginIdiom
   (JNIEnv *env, jclass clazz, jlong display)
 {
-    AWT_CHECK_HAVE_LOCK();
+    AWT_CHECK_HAVE_LOCK_RETURN(0);
     return XdbeBeginIdiom((Display*) jlong_to_ptr(display));
 }
 
 JNIEXPORT jint JNICALL Java_sun_awt_X11_XlibWrapper_XdbeEndIdiom
   (JNIEnv *env, jclass clazz, jlong display)
 {
-    AWT_CHECK_HAVE_LOCK();
+    AWT_CHECK_HAVE_LOCK_RETURN(0);
     return XdbeEndIdiom((Display*) jlong_to_ptr(display));
 }
 
 JNIEXPORT jint JNICALL Java_sun_awt_X11_XlibWrapper_XdbeSwapBuffers
   (JNIEnv *env, jclass clazz, jlong display, jlong swap_info, jint num_windows)
 {
-    AWT_CHECK_HAVE_LOCK();
+    AWT_CHECK_HAVE_LOCK_RETURN(0);
     return XdbeSwapBuffers((Display*) jlong_to_ptr(display), (XdbeSwapInfo *) jlong_to_ptr(swap_info), num_windows);
 }
 JNIEXPORT void JNICALL Java_sun_awt_X11_XlibWrapper_XQueryKeymap
@@ -1854,7 +1921,7 @@
 Java_sun_awt_X11_XlibWrapper_XKeycodeToKeysym(JNIEnv *env, jclass clazz,
                                               jlong display, jint keycode,
                                               jint index) {
-    AWT_CHECK_HAVE_LOCK();
+    AWT_CHECK_HAVE_LOCK_RETURN(0);
     return XKeycodeToKeysym((Display*) jlong_to_ptr(display), (unsigned int)keycode, (int)index);
 }
 
@@ -1862,7 +1929,7 @@
 Java_sun_awt_X11_XlibWrapper_XkbGetEffectiveGroup(JNIEnv *env, jclass clazz,
                                               jlong display) {
     XkbStateRec sr;
-    AWT_CHECK_HAVE_LOCK();
+    AWT_CHECK_HAVE_LOCK_RETURN(0);
     memset(&sr, 0, sizeof(XkbStateRec));
     XkbGetState((Display*) jlong_to_ptr(display), XkbUseCoreKbd, &sr);
 //    printf("-------------------------------------VVVV\n");
@@ -1887,21 +1954,21 @@
 Java_sun_awt_X11_XlibWrapper_XkbKeycodeToKeysym(JNIEnv *env, jclass clazz,
                                               jlong display, jint keycode,
                                               jint group, jint level) {
-    AWT_CHECK_HAVE_LOCK();
+    AWT_CHECK_HAVE_LOCK_RETURN(0);
     return XkbKeycodeToKeysym((Display*) jlong_to_ptr(display), (unsigned int)keycode, (unsigned int)group, (unsigned int)level);
 }
 
 JNIEXPORT jint JNICALL
 Java_sun_awt_X11_XlibWrapper_XKeysymToKeycode(JNIEnv *env, jclass clazz,
                                               jlong display, jlong keysym) {
-    AWT_CHECK_HAVE_LOCK();
+    AWT_CHECK_HAVE_LOCK_RETURN(0);
     return XKeysymToKeycode((Display*) jlong_to_ptr(display), (KeySym)keysym);
 }
 
 JNIEXPORT jlong JNICALL
 Java_sun_awt_X11_XlibWrapper_XGetModifierMapping(JNIEnv *env, jclass clazz,
                                               jlong display) {
-    AWT_CHECK_HAVE_LOCK();
+    AWT_CHECK_HAVE_LOCK_RETURN(0);
     return ptr_to_jlong(XGetModifierMapping((Display*) jlong_to_ptr(display)));
 }
 
@@ -1958,7 +2025,7 @@
                                                      jlong display, jlong ptr) {
     uint32_t timeout = 1;
 
-    AWT_CHECK_HAVE_LOCK();
+    AWT_CHECK_HAVE_LOCK_RETURN(JNI_FALSE);
     exitSecondaryLoop = False;
     while (!exitSecondaryLoop) {
         if (XCheckIfEvent((Display*) jlong_to_ptr(display), (XEvent*) jlong_to_ptr(ptr), secondary_loop_event, NULL)) {
@@ -1996,7 +2063,7 @@
     static jclass stringClass = NULL;
     jclass        stringClassLocal = NULL;
 
-    AWT_CHECK_HAVE_LOCK();
+    AWT_CHECK_HAVE_LOCK_RETURN(NULL);
 
     if (JNU_IsNull(env, stringClass)) {
         stringClassLocal = (*env)->FindClass(env, "java/lang/String");
@@ -2148,7 +2215,7 @@
 {
     jboolean status;
 
-    AWT_CHECK_HAVE_LOCK();
+    AWT_CHECK_HAVE_LOCK_RETURN(JNI_FALSE);
 
     status = XShapeQueryExtension((Display *)jlong_to_ptr(display),
             (int *)jlong_to_ptr(event_base_return), (int *)jlong_to_ptr(error_base_return));
--- a/src/solaris/native/sun/xawt/awt_Desktop.c	Tue May 13 23:18:27 2014 -0700
+++ b/src/solaris/native/sun/xawt/awt_Desktop.c	Wed May 14 11:00:21 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2014, 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,6 +23,7 @@
  * questions.
  */
 
+#include "jni_util.h"
 #include "gtk2_interface.h"
 #include "gnome_interface.h"
 
@@ -65,6 +66,12 @@
     const gchar* url_c;
 
     url_c = (char*)(*env)->GetByteArrayElements(env, url_j, NULL);
+    if (url_c == NULL) {
+        if (!(*env)->ExceptionCheck(env)) {
+            JNU_ThrowOutOfMemoryError(env, 0);
+        }
+        return JNI_FALSE;
+    }
 
     if (gtk_has_been_loaded) {
         fp_gdk_threads_enter();
--- a/src/windows/classes/sun/nio/fs/WindowsFileSystemProvider.java	Tue May 13 23:18:27 2014 -0700
+++ b/src/windows/classes/sun/nio/fs/WindowsFileSystemProvider.java	Wed May 14 11:00:21 2014 -0700
@@ -493,6 +493,14 @@
         try {
             CreateDirectory(dir.getPathForWin32Calls(), sd.address());
         } catch (WindowsException x) {
+            // convert ERROR_ACCESS_DENIED to FileAlreadyExistsException if we can
+            // verify that the directory exists
+            if (x.lastError() == ERROR_ACCESS_DENIED) {
+                try {
+                    if (WindowsFileAttributes.get(dir, false).isDirectory())
+                        throw new FileAlreadyExistsException(dir.toString());
+                } catch (WindowsException ignore) { }
+            }
             x.rethrowAsIOException(dir);
         } finally {
             sd.release();
--- a/src/windows/classes/sun/security/mscapi/RSACipher.java	Tue May 13 23:18:27 2014 -0700
+++ b/src/windows/classes/sun/security/mscapi/RSACipher.java	Wed May 14 11:00:21 2014 -0700
@@ -35,6 +35,8 @@
 import javax.crypto.spec.*;
 
 import sun.security.rsa.RSAKeyFactory;
+import sun.security.internal.spec.TlsRsaPremasterSecretParameterSpec;
+import sun.security.util.KeyUtil;
 
 /**
  * RSA cipher implementation using the Microsoft Crypto API.
@@ -92,9 +94,16 @@
 
     // the public key, if we were initialized using a public key
     private sun.security.mscapi.Key publicKey;
+
     // the private key, if we were initialized using a private key
     private sun.security.mscapi.Key privateKey;
 
+    // cipher parameter for TLS RSA premaster secret
+    private AlgorithmParameterSpec spec = null;
+
+    // the source of randomness
+    private SecureRandom random;
+
     public RSACipher() {
         paddingType = PAD_PKCS1;
     }
@@ -155,8 +164,12 @@
             throws InvalidKeyException, InvalidAlgorithmParameterException {
 
         if (params != null) {
-            throw new InvalidAlgorithmParameterException
-                ("Parameters not supported");
+            if (!(params instanceof TlsRsaPremasterSecretParameterSpec)) {
+                throw new InvalidAlgorithmParameterException(
+                        "Parameters not supported");
+            }
+            spec = params;
+            this.random = random;   // for TLS RSA premaster secret
         }
         init(opmode, key);
     }
@@ -356,39 +369,47 @@
     }
 
     // see JCE spec
-    protected java.security.Key engineUnwrap(byte[] wrappedKey, String algorithm,
+    protected java.security.Key engineUnwrap(byte[] wrappedKey,
+            String algorithm,
             int type) throws InvalidKeyException, NoSuchAlgorithmException {
 
         if (wrappedKey.length > buffer.length) {
             throw new InvalidKeyException("Key is too long for unwrapping");
         }
+
+        boolean isTlsRsaPremasterSecret =
+                algorithm.equals("TlsRsaPremasterSecret");
+        Exception failover = null;
+        byte[] encoded = null;
+
         update(wrappedKey, 0, wrappedKey.length);
-
         try {
-            byte[] encoding = doFinal();
-
-            switch (type) {
-            case Cipher.PUBLIC_KEY:
-                return constructPublicKey(encoding, algorithm);
-
-            case Cipher.PRIVATE_KEY:
-                return constructPrivateKey(encoding, algorithm);
-
-            case Cipher.SECRET_KEY:
-                return constructSecretKey(encoding, algorithm);
-
-            default:
-                throw new InvalidKeyException("Unknown key type " + type);
+            encoded = doFinal();
+        } catch (BadPaddingException e) {
+            if (isTlsRsaPremasterSecret) {
+                failover = e;
+            } else {
+                throw new InvalidKeyException("Unwrapping failed", e);
             }
-
-        } catch (BadPaddingException e) {
-            // should not occur
-            throw new InvalidKeyException("Unwrapping failed", e);
-
         } catch (IllegalBlockSizeException e) {
             // should not occur, handled with length check above
             throw new InvalidKeyException("Unwrapping failed", e);
         }
+
+        if (isTlsRsaPremasterSecret) {
+            if (!(spec instanceof TlsRsaPremasterSecretParameterSpec)) {
+                throw new IllegalStateException(
+                        "No TlsRsaPremasterSecretParameterSpec specified");
+            }
+
+            // polish the TLS premaster secret
+            encoded = KeyUtil.checkTlsPreMasterSecretKey(
+                ((TlsRsaPremasterSecretParameterSpec)spec).getClientVersion(),
+                ((TlsRsaPremasterSecretParameterSpec)spec).getServerVersion(),
+                random, encoded, (failover != null));
+        }
+
+        return constructKey(encoded, algorithm, type);
     }
 
     // see JCE spec
@@ -452,6 +473,22 @@
         return new SecretKeySpec(encodedKey, encodedKeyAlgorithm);
     }
 
+    private static Key constructKey(byte[] encodedKey,
+            String encodedKeyAlgorithm,
+            int keyType) throws InvalidKeyException, NoSuchAlgorithmException {
+
+        switch (keyType) {
+            case Cipher.PUBLIC_KEY:
+                return constructPublicKey(encodedKey, encodedKeyAlgorithm);
+            case Cipher.PRIVATE_KEY:
+                return constructPrivateKey(encodedKey, encodedKeyAlgorithm);
+            case Cipher.SECRET_KEY:
+                return constructSecretKey(encodedKey, encodedKeyAlgorithm);
+            default:
+                throw new InvalidKeyException("Unknown key type " + keyType);
+        }
+    }
+
     /*
      * Encrypt/decrypt a data buffer using Microsoft Crypto API with HCRYPTKEY.
      * It expects and returns ciphertext data in big-endian form.
--- a/src/windows/native/sun/windows/awt_Frame.cpp	Tue May 13 23:18:27 2014 -0700
+++ b/src/windows/native/sun/windows/awt_Frame.cpp	Wed May 14 11:00:21 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1996, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1996, 2014, 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
@@ -173,8 +173,11 @@
             BOOL isEmbeddedInstance = FALSE;
             BOOL isEmbedded = FALSE;
             cls = env->FindClass("sun/awt/EmbeddedFrame");
+
             if (cls) {
                 isEmbeddedInstance = env->IsInstanceOf(target, cls);
+            } else {
+                throw std::bad_alloc();
             }
             INT_PTR handle;
             if (isEmbeddedInstance) {
@@ -189,6 +192,8 @@
             cls = env->FindClass("sun/awt/LightweightFrame");
             if (cls) {
                 isLightweight = env->IsInstanceOf(target, cls);
+            } else {
+                throw std::bad_alloc();
             }
             frame->m_isLightweight = isLightweight;
 
@@ -260,7 +265,11 @@
 
                // for input method windows, use minimal decorations
                inputMethodWindowCls = env->FindClass("sun/awt/im/InputMethodWindow");
-               if ((inputMethodWindowCls != NULL) && env->IsInstanceOf(target, inputMethodWindowCls)) {
+               if (inputMethodWindowCls == NULL) {
+                   throw std::bad_alloc();
+               }
+
+               if (env->IsInstanceOf(target, inputMethodWindowCls)) {
                    //for below-the-spot composition window, use no decoration
                    if (env->GetBooleanField(target, AwtFrame::undecoratedID) == JNI_TRUE){
                         exStyle = 0;
@@ -1611,9 +1620,10 @@
     TRY;
 
     AwtFrame::setExtendedStateMID = env->GetMethodID(cls, "setExtendedState", "(I)V");
+    DASSERT(AwtFrame::setExtendedStateMID);
+    CHECK_NULL(AwtFrame::setExtendedStateMID);
+
     AwtFrame::getExtendedStateMID = env->GetMethodID(cls, "getExtendedState", "()I");
-
-    DASSERT(AwtFrame::setExtendedStateMID);
     DASSERT(AwtFrame::getExtendedStateMID);
 
     CATCH_BAD_ALLOC;
@@ -1787,35 +1797,6 @@
 
 
 /************************************************************************
- * EmbeddedFrame native methods
- */
-
-extern "C" {
-
-/*
- * Class:     sun_awt_EmbeddedFrame
- * Method:    setPeer
- * Signature: (Ljava/awt/peer/ComponentPeer;)V
- */
-JNIEXPORT void JNICALL
-Java_sun_awt_EmbeddedFrame_setPeer(JNIEnv *env, jobject self, jobject lpeer)
-{
-    TRY;
-
-    jclass cls;
-    jfieldID fid;
-
-    cls = env->GetObjectClass(self);
-    fid = env->GetFieldID(cls, "peer", "Ljava/awt/peer/ComponentPeer;");
-    env->SetObjectField(self, fid, lpeer);
-
-    CATCH_BAD_ALLOC;
-}
-
-} /* extern "C" */
-
-
-/************************************************************************
  * WEmbeddedFrame native methods
  */
 
@@ -1833,6 +1814,7 @@
 
     AwtFrame::handleID = env->GetFieldID(cls, "handle", "J");
     DASSERT(AwtFrame::handleID != NULL);
+    CHECK_NULL(AwtFrame::handleID);
 
     AwtFrame::activateEmbeddingTopLevelMID = env->GetMethodID(cls, "activateEmbeddingTopLevel", "()V");
     DASSERT(AwtFrame::activateEmbeddingTopLevelMID != NULL);
--- a/test/com/sun/crypto/provider/TLS/TestPremaster.java	Tue May 13 23:18:27 2014 -0700
+++ b/test/com/sun/crypto/provider/TLS/TestPremaster.java	Wed May 14 11:00:21 2014 -0700
@@ -33,6 +33,7 @@
 
 import javax.crypto.KeyGenerator;
 import javax.crypto.SecretKey;
+import java.util.Formatter;
 
 import sun.security.internal.spec.TlsRsaPremasterSecretParameterSpec;
 
@@ -52,27 +53,51 @@
             System.out.println("OK: " + e);
         }
 
-        test(kg, 3, 0);
-        test(kg, 3, 1);
-        test(kg, 3, 2);
-        test(kg, 4, 0);
+        int[] protocolVersions = {0x0300, 0x0301, 0x0302, 0x0400};
+        for (int clientVersion : protocolVersions) {
+            for (int serverVersion : protocolVersions) {
+                test(kg, clientVersion, serverVersion);
+                if (serverVersion >= clientVersion) {
+                    break;
+                }
+            }
+        }
 
         System.out.println("Done.");
     }
 
-    private static void test(KeyGenerator kg, int major, int minor)
-            throws Exception {
+    private static void test(KeyGenerator kg,
+            int clientVersion, int serverVersion) throws Exception {
 
-        kg.init(new TlsRsaPremasterSecretParameterSpec(major, minor));
+        System.out.printf(
+                "Testing RSA pre-master secret key generation between " +
+                "client (0x%04X) and server(0x%04X)%n",
+                clientVersion, serverVersion);
+        kg.init(new TlsRsaPremasterSecretParameterSpec(
+                                    clientVersion, serverVersion));
+
         SecretKey key = kg.generateKey();
         byte[] encoded = key.getEncoded();
-        if (encoded.length != 48) {
-            throw new Exception("length: " + encoded.length);
-        }
-        if ((encoded[0] != major) || (encoded[1] != minor)) {
-            throw new Exception("version mismatch: "  + encoded[0] +
-                "." + encoded[1]);
-        }
-        System.out.println("OK: " + major + "." + minor);
+        if (encoded != null) {  // raw key material may be not extractable
+            if (encoded.length != 48) {
+                throw new Exception("length: " + encoded.length);
+            }
+            int v = versionOf(encoded[0], encoded[1]);
+            if (clientVersion != v) {
+                if (serverVersion != v || clientVersion >= 0x0302) {
+                    throw new Exception(String.format(
+                        "version mismatch: (0x%04X) rather than (0x%04X) " +
+                        "is used in pre-master secret", v, clientVersion));
+                }
+                System.out.printf("Use compatible version (0x%04X)%n", v);
+            }
+            System.out.println("Passed, version matches!");
+       } else {
+            System.out.println("Raw key material is not extractable");
+       }
+    }
+
+    private static int versionOf(int major, int minor) {
+        return ((major & 0xFF) << 8) | (minor & 0xFF);
     }
 }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/awt/FullScreen/DisplayChangeVITest/DisplayChangeVITest.java	Wed May 14 11:00:21 2014 -0700
@@ -0,0 +1,245 @@
+/*
+ * Copyright (c) 2006, 2014, 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 6366359
+ * @summary Test that we don't crash when changing from 8 to 16/32 bit modes
+ * @author Dmitri.Trembovetski@Sun.COM area=FullScreen
+ * @run main/othervm/timeout=200 DisplayChangeVITest
+ * @run main/othervm/timeout=200 -Dsun.java2d.d3d=false DisplayChangeVITest
+ * @run main/othervm/timeout=200 -Dsun.java2d.opengl=true DisplayChangeVITest
+ */
+
+import java.awt.Color;
+import java.awt.DisplayMode;
+import java.awt.Graphics;
+import java.awt.GraphicsDevice;
+import java.awt.GraphicsEnvironment;
+import java.awt.event.KeyAdapter;
+import java.awt.event.KeyEvent;
+import java.awt.image.BufferedImage;
+import java.awt.image.VolatileImage;
+import java.lang.Exception;
+import java.lang.Thread;
+import java.util.ArrayList;
+import java.util.Random;
+import javax.swing.JFrame;
+
+/**
+ * The test enters fullscreen mode (if it's supported) and then tries
+ * to switch between display moes with different depths and dimensions
+ * while doing both rendering to the screen (via a VolatileImage)
+ * and Swing repainting just to make things more chaotic.
+ *
+ * The procedure is repeated TEST_REPS times (3 by default).
+ *
+ * Don't pay attention to what happens on the screen, it won't be pretty.
+ * If the test doesn't crash or throw exceptions, it passes, otherwise
+ * it fails.
+ */
+public class DisplayChangeVITest extends JFrame implements Runnable {
+
+    private final Random rnd = new Random();
+    private VolatileImage bb;
+    private BufferedImage sprite;
+    private VolatileImage volSprite;
+
+    private static boolean done = false;
+    private static final Object lock = new Object();
+    private static final int TEST_REPS = 3;
+
+    private ArrayList<DisplayMode> dms;
+
+    DisplayChangeVITest() {
+        selectDisplayModes();
+        addKeyListener(new KeyAdapter() {
+            public void keyPressed(KeyEvent e) {
+                if (e.getKeyCode() == KeyEvent.VK_ESCAPE) {
+                    synchronized (lock) {
+                        done = true;
+                    }
+                }
+            }
+        });
+        sprite = new BufferedImage(200, 200, BufferedImage.TYPE_INT_RGB);
+        sprite.getRaster().getDataBuffer();
+        Graphics g = sprite.getGraphics();
+        g.setColor(Color.yellow);
+        g.fillRect(0, 0, sprite.getWidth(), sprite.getHeight());
+    }
+
+    void render(Graphics g) {
+        do {
+            // volatile images validated here
+            initBackbuffer();
+
+            g.setColor(Color.black);
+            g.fillRect(0, 0, getWidth(), getHeight());
+
+            Graphics gg = bb.getGraphics();
+            gg.setColor(new Color(rnd.nextInt(0x00ffffff)));
+            gg.fillRect(0, 0, bb.getWidth(), bb.getHeight());
+            for (int x = 0; x < 10; x++) {
+                gg.drawImage(sprite, x*200, 0, null);
+                gg.drawImage(volSprite, x*200, 500, null);
+            }
+
+            g.drawImage(bb, 0, 0, null);
+        } while (bb.contentsLost());
+    }
+
+    private static void sleep(long msec) {
+        try { Thread.sleep(msec); } catch (InterruptedException e) {}
+    }
+
+    private int reps = 0;
+    public void run() {
+        GraphicsDevice gd = getGraphicsConfiguration().getDevice();
+        if (gd.isDisplayChangeSupported() && dms.size() > 0) {
+            while (!done && reps++ < TEST_REPS) {
+                for (DisplayMode dm : dms) {
+                    System.err.printf("Entering DisplayMode[%dx%dx%d]\n",
+                        dm.getWidth(), dm.getHeight(), dm.getBitDepth());
+                    gd.setDisplayMode(dm);
+
+                    initBackbuffer();
+                    for (int i = 0; i < 10; i++) {
+                        // render to the screen
+                        render(getGraphics());
+                        // ask Swing to repaint
+                        repaint();
+                        sleep(100);
+                    }
+                    sleep(1500);
+                }
+            }
+        } else {
+            System.err.println("Display mode change " +
+                               "not supported. Test passed.");
+        }
+        dispose();
+        synchronized (lock) {
+            done = true;
+            lock.notify();
+        }
+    }
+
+    private void createBackbuffer() {
+        if (bb == null ||
+            bb.getWidth() != getWidth() || bb.getHeight() != getHeight())
+        {
+            bb = createVolatileImage(getWidth(), getHeight());
+        }
+    }
+
+    private void initBackbuffer() {
+        createBackbuffer();
+
+        int res = bb.validate(getGraphicsConfiguration());
+        if (res == VolatileImage.IMAGE_INCOMPATIBLE) {
+            bb = null;
+            createBackbuffer();
+            bb.validate(getGraphicsConfiguration());
+            res = VolatileImage.IMAGE_RESTORED;
+        }
+        if (res == VolatileImage.IMAGE_RESTORED) {
+            Graphics g = bb.getGraphics();
+            g.setColor(new Color(rnd.nextInt(0x00ffffff)));
+            g.fillRect(0, 0, bb.getWidth(), bb.getHeight());
+
+            volSprite = createVolatileImage(100, 100);
+        }
+        volSprite.validate(getGraphicsConfiguration());
+    }
+
+    private void selectDisplayModes() {
+        GraphicsDevice gd =
+            GraphicsEnvironment.getLocalGraphicsEnvironment().
+                getDefaultScreenDevice();
+        dms = new ArrayList<DisplayMode>();
+        DisplayMode dmArray[] = gd.getDisplayModes();
+        boolean found8 = false, found16 = false,
+                found24 = false, found32 = false;
+        for (DisplayMode dm : dmArray) {
+            if (!found8 &&
+                (dm.getBitDepth() == 8 ||
+                 dm.getBitDepth() == DisplayMode.BIT_DEPTH_MULTI)  &&
+                (dm.getWidth() >= 800 && dm.getWidth() < 1024))
+            {
+                dms.add(dm);
+                found8 = true;
+                continue;
+            }
+            if (!found32 &&
+                (dm.getBitDepth() == 32 ||
+                 dm.getBitDepth() == DisplayMode.BIT_DEPTH_MULTI)  &&
+                dm.getWidth() >= 1280)
+            {
+                dms.add(dm);
+                found32 = true;
+                continue;
+            }
+            if (!found16 &&
+               dm.getBitDepth() == 16 &&
+                (dm.getWidth() >= 1024 && dm.getWidth() < 1280))
+            {
+                dms.add(dm);
+                found16 = true;
+                continue;
+            }
+            if (found8 && found16 && found32) {
+                break;
+            }
+        }
+        System.err.println("Found display modes:");
+        for (DisplayMode dm : dms) {
+            System.err.printf("DisplayMode[%dx%dx%d]\n",
+                dm.getWidth(), dm.getHeight(), dm.getBitDepth());
+        }
+    }
+
+    public static void main(String[] args) throws Exception {
+        DisplayChangeVITest test = new DisplayChangeVITest();
+        GraphicsDevice gd =
+            GraphicsEnvironment.getLocalGraphicsEnvironment().
+                getDefaultScreenDevice();
+        if (gd.isFullScreenSupported()) {
+            gd.setFullScreenWindow(test);
+            Thread t = new Thread(test);
+            t.run();
+            synchronized (lock) {
+                while (!done) {
+                    try {
+                        lock.wait(50);
+                    } catch (InterruptedException ex) {
+                        ex.printStackTrace();
+                    }
+                }
+            }
+            System.err.println("Test Passed.");
+        } else {
+            System.err.println("Full screen not supported. Test passed.");
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/net/Inet4Address/DummyNameService.java	Wed May 14 11:00:21 2014 -0700
@@ -0,0 +1,45 @@
+/*
+ * Copyright (c) 2014, 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.
+ */
+
+/*
+ * A simple name service which throws an exception when invoked
+ */
+
+import java.net.UnknownHostException;
+import java.net.InetAddress;
+import sun.net.spi.nameservice.*;
+import java.util.*;
+
+public final class DummyNameService implements NameService {
+
+    public DummyNameService() throws Exception {
+    }
+
+    public InetAddress[] lookupAllHostAddr(String host) throws UnknownHostException {
+        throw new UnknownHostException("Dummy name service");
+    }
+
+    public String getHostByAddr(byte[] addr) throws UnknownHostException {
+        throw new UnknownHostException("Dummy name service");
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/net/Inet4Address/DummyNameServiceDescriptor.java	Wed May 14 11:00:21 2014 -0700
@@ -0,0 +1,54 @@
+/*
+ * Copyright (c) 2014, 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.
+ */
+
+/*
+ * Descriptor for the dummy name service
+ */
+
+import sun.net.spi.nameservice.*;
+
+public final class DummyNameServiceDescriptor implements NameServiceDescriptor {
+
+    /**
+     * Create a new instance of the corresponding name service.
+     */
+    public NameService createNameService() throws Exception {
+        return new DummyNameService();
+    }
+
+    /**
+     * Returns this service provider's name
+     *
+     */
+    public String getProviderName() {
+        return "oracle";
+    }
+
+    /**
+     * Returns this name service type
+     * "dns" "nis" etc
+     */
+    public String getType() {
+        return "dummy";
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/net/Inet4Address/META-INF/services/sun.net.spi.nameservice.NameServiceDescriptor	Wed May 14 11:00:21 2014 -0700
@@ -0,0 +1,22 @@
+# Copyright (c) 2014, 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.
+
+DummyNameServiceDescriptor    # name service provider descriptor
--- a/test/java/net/Inet4Address/textToNumericFormat.java	Tue May 13 23:18:27 2014 -0700
+++ b/test/java/net/Inet4Address/textToNumericFormat.java	Wed May 14 11:00:21 2014 -0700
@@ -25,8 +25,18 @@
  * @test
  * @bug 4749938
  * @summary Bug in the parsing IPv4 literal addresses
+ * @compile -XDignore.symbol.file=true DummyNameService.java DummyNameServiceDescriptor.java
+ * @run main/othervm -Dsun.net.spi.nameservice.provider.1=dummy,oracle textToNumericFormat
 */
 
+/**
+ * We use a dummy name service which throws UHE any time it is called.
+ * We do this because the "good" tests here should parse correctly
+ * without needing to call the name service, and the bad tests will
+ * not parse and then invoke the name service, where we expect
+ * the exception.
+ */
+
 import java.net.InetAddress;
 import java.net.UnknownHostException;
 import java.util.*;
@@ -34,19 +44,25 @@
 public class textToNumericFormat {
 
     public static void main(String[] args) throws UnknownHostException {
-        List goodList = new ArrayList();
-        List badList = new ArrayList();
+        List<String> goodList = new ArrayList<>();
+        List<String> badList = new ArrayList<>();
         String goodAddrs[] = {
                            "224.0.1.0",
                            "238.255.255.255",
-                           "239.255.255.255" };
+                           "239.255.255.255",
+                           "239.255.65535",
+                           "239.16777215",
+                           "4294967295" };
 
         String badAddrs[] = {
                            "238.255.255.2550",
                            "256.255.255.255",
                            "238.255.2550.255",
                            "238.2550.255.255",
-                           "2380.255.255.255"};
+                           "2380.255.255.255",
+                           "239.255.65536",
+                           "239.16777216",
+                           "4294967296" };
 
         for (int i=0; i<goodAddrs.length; i++) {
             try {
--- a/test/java/nio/file/Files/Misc.java	Tue May 13 23:18:27 2014 -0700
+++ b/test/java/nio/file/Files/Misc.java	Wed May 14 11:00:21 2014 -0700
@@ -22,7 +22,7 @@
  */
 
 /* @test
- * @bug 4313887 6838333 8005566
+ * @bug 4313887 6838333 8005566 8032220
  * @summary Unit test for miscellenous methods in java.nio.file.Files
  * @library ..
  */
@@ -76,6 +76,11 @@
             createDirectories(file.resolve("y"));
             throw new RuntimeException("failure expected");
         } catch (IOException x) { }
+
+        // the root directory always exists
+        Path root = Paths.get("/");
+        Files.createDirectories(root);
+        Files.createDirectories(root.toAbsolutePath());
     }
 
     /**
--- a/test/java/nio/file/Path/PathOps.java	Tue May 13 23:18:27 2014 -0700
+++ b/test/java/nio/file/Path/PathOps.java	Wed May 14 11:00:21 2014 -0700
@@ -22,7 +22,7 @@
  */
 
 /* @test
- * @bug 4313887 6838333 6925932 7006126
+ * @bug 4313887 6838333 6925932 7006126 8037945
  * @summary Unit test for java.nio.file.Path path operations
  */
 
@@ -899,6 +899,8 @@
             .normalize("foo");
         test("/foo")
             .normalize("/foo");
+        test("")
+            .normalize("");
         test(".")
             .normalize("");
         test("..")
--- a/test/java/util/Locale/Bug7069824.java	Tue May 13 23:18:27 2014 -0700
+++ b/test/java/util/Locale/Bug7069824.java	Wed May 14 11:00:21 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 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 7069824
+ * @bug 7069824 8042360
  * @summary Verify implementation for Locale matching.
  * @run main Bug7069824
  */
@@ -91,6 +91,17 @@
         String range;
         double weight;
 
+        // Testcase for 8042360
+        range = "en-Latn-1234567890";
+        try {
+            lr = new LanguageRange(range);
+            error = true;
+            System.err.println("    IAE should be thrown for LanguageRange("
+                + range + ").");
+        }
+        catch (IllegalArgumentException ex) {
+        }
+
         range = null;
         try {
             lr = new LanguageRange(range);
--- a/test/java/util/stream/test/org/openjdk/tests/java/util/stream/SortedOpTest.java	Tue May 13 23:18:27 2014 -0700
+++ b/test/java/util/stream/test/org/openjdk/tests/java/util/stream/SortedOpTest.java	Wed May 14 11:00:21 2014 -0700
@@ -26,6 +26,9 @@
 
 import java.util.*;
 import java.util.Spliterators;
+import java.util.concurrent.atomic.AtomicInteger;
+import java.util.function.BiFunction;
+import java.util.function.Consumer;
 import java.util.function.Function;
 import java.util.function.Supplier;
 import java.util.stream.*;
@@ -122,24 +125,33 @@
 
     @Test(groups = { "serialization-hostile" })
     public void testSequentialShortCircuitTerminal() {
-        // The sorted op for sequential evaluation will buffer all elements when accepting
-        // then at the end sort those elements and push those elements downstream
+        // The sorted op for sequential evaluation will buffer all elements when
+        // accepting then at the end sort those elements and push those elements
+        // downstream
+        // A peek operation is added in-between the sorted() and terminal
+        // operation that counts the number of calls to its consumer and
+        // asserts that the number of calls is at most the required quantity
 
         List<Integer> l = Arrays.asList(5, 4, 3, 2, 1);
 
+        Function<Integer, Stream<Integer>> knownSize = i -> assertNCallsOnly(
+                l.stream().sorted(), Stream::peek, i);
+        Function<Integer, Stream<Integer>> unknownSize = i -> assertNCallsOnly
+                (unknownSizeStream(l).sorted(), Stream::peek, i);
+
         // Find
-        assertEquals(l.stream().sorted().findFirst(), Optional.of(1));
-        assertEquals(l.stream().sorted().findAny(), Optional.of(1));
-        assertEquals(unknownSizeStream(l).sorted().findFirst(), Optional.of(1));
-        assertEquals(unknownSizeStream(l).sorted().findAny(), Optional.of(1));
+        assertEquals(knownSize.apply(1).findFirst(), Optional.of(1));
+        assertEquals(knownSize.apply(1).findAny(), Optional.of(1));
+        assertEquals(unknownSize.apply(1).findFirst(), Optional.of(1));
+        assertEquals(unknownSize.apply(1).findAny(), Optional.of(1));
 
         // Match
-        assertEquals(l.stream().sorted().anyMatch(i -> i == 2), true);
-        assertEquals(l.stream().sorted().noneMatch(i -> i == 2), false);
-        assertEquals(l.stream().sorted().allMatch(i -> i == 2), false);
-        assertEquals(unknownSizeStream(l).sorted().anyMatch(i -> i == 2), true);
-        assertEquals(unknownSizeStream(l).sorted().noneMatch(i -> i == 2), false);
-        assertEquals(unknownSizeStream(l).sorted().allMatch(i -> i == 2), false);
+        assertEquals(knownSize.apply(2).anyMatch(i -> i == 2), true);
+        assertEquals(knownSize.apply(2).noneMatch(i -> i == 2), false);
+        assertEquals(knownSize.apply(2).allMatch(i -> i == 2), false);
+        assertEquals(unknownSize.apply(2).anyMatch(i -> i == 2), true);
+        assertEquals(unknownSize.apply(2).noneMatch(i -> i == 2), false);
+        assertEquals(unknownSize.apply(2).allMatch(i -> i == 2), false);
     }
 
     private <T> Stream<T> unknownSizeStream(List<T> l) {
@@ -199,19 +211,24 @@
     public void testIntSequentialShortCircuitTerminal() {
         int[] a = new int[]{5, 4, 3, 2, 1};
 
+        Function<Integer, IntStream> knownSize = i -> assertNCallsOnly(
+                Arrays.stream(a).sorted(), (s, c) -> s.peek(c::accept), i);
+        Function<Integer, IntStream> unknownSize = i -> assertNCallsOnly
+                (unknownSizeIntStream(a).sorted(), (s, c) -> s.peek(c::accept), i);
+
         // Find
-        assertEquals(Arrays.stream(a).sorted().findFirst(), OptionalInt.of(1));
-        assertEquals(Arrays.stream(a).sorted().findAny(), OptionalInt.of(1));
-        assertEquals(unknownSizeIntStream(a).sorted().findFirst(), OptionalInt.of(1));
-        assertEquals(unknownSizeIntStream(a).sorted().findAny(), OptionalInt.of(1));
+        assertEquals(knownSize.apply(1).findFirst(), OptionalInt.of(1));
+        assertEquals(knownSize.apply(1).findAny(), OptionalInt.of(1));
+        assertEquals(unknownSize.apply(1).findFirst(), OptionalInt.of(1));
+        assertEquals(unknownSize.apply(1).findAny(), OptionalInt.of(1));
 
         // Match
-        assertEquals(Arrays.stream(a).sorted().anyMatch(i -> i == 2), true);
-        assertEquals(Arrays.stream(a).sorted().noneMatch(i -> i == 2), false);
-        assertEquals(Arrays.stream(a).sorted().allMatch(i -> i == 2), false);
-        assertEquals(unknownSizeIntStream(a).sorted().anyMatch(i -> i == 2), true);
-        assertEquals(unknownSizeIntStream(a).sorted().noneMatch(i -> i == 2), false);
-        assertEquals(unknownSizeIntStream(a).sorted().allMatch(i -> i == 2), false);
+        assertEquals(knownSize.apply(2).anyMatch(i -> i == 2), true);
+        assertEquals(knownSize.apply(2).noneMatch(i -> i == 2), false);
+        assertEquals(knownSize.apply(2).allMatch(i -> i == 2), false);
+        assertEquals(unknownSize.apply(2).anyMatch(i -> i == 2), true);
+        assertEquals(unknownSize.apply(2).noneMatch(i -> i == 2), false);
+        assertEquals(unknownSize.apply(2).allMatch(i -> i == 2), false);
     }
 
     private IntStream unknownSizeIntStream(int[] a) {
@@ -242,19 +259,24 @@
     public void testLongSequentialShortCircuitTerminal() {
         long[] a = new long[]{5, 4, 3, 2, 1};
 
+        Function<Integer, LongStream> knownSize = i -> assertNCallsOnly(
+                Arrays.stream(a).sorted(), (s, c) -> s.peek(c::accept), i);
+        Function<Integer, LongStream> unknownSize = i -> assertNCallsOnly
+                (unknownSizeLongStream(a).sorted(), (s, c) -> s.peek(c::accept), i);
+
         // Find
-        assertEquals(Arrays.stream(a).sorted().findFirst(), OptionalLong.of(1));
-        assertEquals(Arrays.stream(a).sorted().findAny(), OptionalLong.of(1));
-        assertEquals(unknownSizeLongStream(a).sorted().findFirst(), OptionalLong.of(1));
-        assertEquals(unknownSizeLongStream(a).sorted().findAny(), OptionalLong.of(1));
+        assertEquals(knownSize.apply(1).findFirst(), OptionalLong.of(1));
+        assertEquals(knownSize.apply(1).findAny(), OptionalLong.of(1));
+        assertEquals(unknownSize.apply(1).findFirst(), OptionalLong.of(1));
+        assertEquals(unknownSize.apply(1).findAny(), OptionalLong.of(1));
 
         // Match
-        assertEquals(Arrays.stream(a).sorted().anyMatch(i -> i == 2), true);
-        assertEquals(Arrays.stream(a).sorted().noneMatch(i -> i == 2), false);
-        assertEquals(Arrays.stream(a).sorted().allMatch(i -> i == 2), false);
-        assertEquals(unknownSizeLongStream(a).sorted().anyMatch(i -> i == 2), true);
-        assertEquals(unknownSizeLongStream(a).sorted().noneMatch(i -> i == 2), false);
-        assertEquals(unknownSizeLongStream(a).sorted().allMatch(i -> i == 2), false);
+        assertEquals(knownSize.apply(2).anyMatch(i -> i == 2), true);
+        assertEquals(knownSize.apply(2).noneMatch(i -> i == 2), false);
+        assertEquals(knownSize.apply(2).allMatch(i -> i == 2), false);
+        assertEquals(unknownSize.apply(2).anyMatch(i -> i == 2), true);
+        assertEquals(unknownSize.apply(2).noneMatch(i -> i == 2), false);
+        assertEquals(unknownSize.apply(2).allMatch(i -> i == 2), false);
     }
 
     private LongStream unknownSizeLongStream(long[] a) {
@@ -285,19 +307,24 @@
     public void testDoubleSequentialShortCircuitTerminal() {
         double[] a = new double[]{5.0, 4.0, 3.0, 2.0, 1.0};
 
+        Function<Integer, DoubleStream> knownSize = i -> assertNCallsOnly(
+                Arrays.stream(a).sorted(), (s, c) -> s.peek(c::accept), i);
+        Function<Integer, DoubleStream> unknownSize = i -> assertNCallsOnly
+                (unknownSizeDoubleStream(a).sorted(), (s, c) -> s.peek(c::accept), i);
+
         // Find
-        assertEquals(Arrays.stream(a).sorted().findFirst(), OptionalDouble.of(1));
-        assertEquals(Arrays.stream(a).sorted().findAny(), OptionalDouble.of(1));
-        assertEquals(unknownSizeDoubleStream(a).sorted().findFirst(), OptionalDouble.of(1));
-        assertEquals(unknownSizeDoubleStream(a).sorted().findAny(), OptionalDouble.of(1));
+        assertEquals(knownSize.apply(1).findFirst(), OptionalDouble.of(1));
+        assertEquals(knownSize.apply(1).findAny(), OptionalDouble.of(1));
+        assertEquals(unknownSize.apply(1).findFirst(), OptionalDouble.of(1));
+        assertEquals(unknownSize.apply(1).findAny(), OptionalDouble.of(1));
 
         // Match
-        assertEquals(Arrays.stream(a).sorted().anyMatch(i -> i == 2.0), true);
-        assertEquals(Arrays.stream(a).sorted().noneMatch(i -> i == 2.0), false);
-        assertEquals(Arrays.stream(a).sorted().allMatch(i -> i == 2.0), false);
-        assertEquals(unknownSizeDoubleStream(a).sorted().anyMatch(i -> i == 2.0), true);
-        assertEquals(unknownSizeDoubleStream(a).sorted().noneMatch(i -> i == 2.0), false);
-        assertEquals(unknownSizeDoubleStream(a).sorted().allMatch(i -> i == 2.0), false);
+        assertEquals(knownSize.apply(2).anyMatch(i -> i == 2.0), true);
+        assertEquals(knownSize.apply(2).noneMatch(i -> i == 2.0), false);
+        assertEquals(knownSize.apply(2).allMatch(i -> i == 2.0), false);
+        assertEquals(unknownSize.apply(2).anyMatch(i -> i == 2.0), true);
+        assertEquals(unknownSize.apply(2).noneMatch(i -> i == 2.0), false);
+        assertEquals(unknownSize.apply(2).allMatch(i -> i == 2.0), false);
     }
 
     private DoubleStream unknownSizeDoubleStream(double[] a) {
@@ -321,4 +348,14 @@
         assertSorted(result);
         assertContentsUnordered(data, result);
     }
+
+    /**
+     * Interpose a consumer that asserts it is called at most N times.
+     */
+    <T, S extends BaseStream<T, S>, R> S assertNCallsOnly(S s, BiFunction<S, Consumer<T>, S> pf, int n) {
+        AtomicInteger boxedInt = new AtomicInteger();
+        return pf.apply(s, i -> {
+            assertFalse(boxedInt.incrementAndGet() > n, "Intermediate op called more than " + n + " time(s)");
+        });
+    }
 }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/javax/net/ssl/SSLEngine/IllegalRecordVersion.java	Wed May 14 11:00:21 2014 -0700
@@ -0,0 +1,77 @@
+/*
+ * Copyright (c) 2014, 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.
+ */
+
+// This test case relies on updated static security property, no way to re-use
+// security property in samevm/agentvm mode.
+
+/*
+ * @test
+ * @bug 8042449
+ * @summary Issue for negative byte major record version
+ *
+ * @run main/othervm IllegalRecordVersion
+ */
+
+import javax.net.ssl.*;
+import javax.net.ssl.SSLEngineResult.*;
+import java.io.*;
+import java.security.*;
+import java.nio.*;
+
+public class IllegalRecordVersion {
+
+    public static void main(String args[]) throws Exception {
+        SSLContext context = SSLContext.getDefault();
+
+        SSLEngine cliEngine = context.createSSLEngine();
+        cliEngine.setUseClientMode(true);
+        SSLEngine srvEngine = context.createSSLEngine();
+        srvEngine.setUseClientMode(false);
+
+        SSLSession session = cliEngine.getSession();
+        int netBufferMax = session.getPacketBufferSize();
+        int appBufferMax = session.getApplicationBufferSize();
+
+        ByteBuffer cliToSrv = ByteBuffer.allocateDirect(netBufferMax);
+        ByteBuffer srvIBuff = ByteBuffer.allocateDirect(appBufferMax + 50);
+        ByteBuffer cliOBuff = ByteBuffer.wrap("I'm client".getBytes());
+
+
+        System.out.println("client hello (record version(0xa9, 0xa2))");
+        SSLEngineResult cliRes = cliEngine.wrap(cliOBuff, cliToSrv);
+        System.out.println("Client wrap result: " + cliRes);
+        cliToSrv.flip();
+        if (cliToSrv.limit() > 5) {
+            cliToSrv.put(1, (byte)0xa9);
+            cliToSrv.put(2, (byte)0xa2);
+        }
+
+        try {
+            srvEngine.unwrap(cliToSrv, srvIBuff);
+            throw new Exception(
+                "Cannot catch the unsupported record version issue");
+        } catch (SSLException e) {
+            // get the expected exception
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/javax/swing/JTextField/8036819/bug8036819.java	Wed May 14 11:00:21 2014 -0700
@@ -0,0 +1,132 @@
+/*
+ * Copyright (c) 2014, 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
+ * @library ../../regtesthelpers
+ * @build Util
+ * @bug 8036819
+ * @summary JAB: mnemonics not read for textboxes
+ * @author Vivi An
+ * @run main bug8036819
+ */
+
+import javax.swing.*;
+import javax.swing.event.*;
+import java.awt.event.*;
+import java.awt.*;
+import sun.awt.SunToolkit;
+import javax.accessibility.*;
+
+public class bug8036819 {
+
+    public static volatile Boolean passed = false;
+
+    public static void main(String args[]) throws Throwable {
+        SwingUtilities.invokeAndWait(new Runnable() {
+            public void run() {
+                createAndShowGUI();
+            }
+        });
+
+        SunToolkit toolkit = (SunToolkit) Toolkit.getDefaultToolkit();
+        toolkit.realSync();
+
+        Robot robo = new Robot();
+        robo.setAutoDelay(300);
+
+        // Using mnemonic key to focus on the textfield
+        Util.hitMnemonics(robo, KeyEvent.VK_P);
+        toolkit.realSync();
+
+        if (!passed){
+            throw new RuntimeException("Test failed.");
+        }
+    }
+
+    private static void createAndShowGUI() {
+        JFrame mainFrame = new JFrame("bug 8036819");
+
+        JLabel usernameLabel = new JLabel("Username: ");
+        JTextField usernameField = new JTextField(20);
+        usernameLabel.setDisplayedMnemonic(KeyEvent.VK_U);
+        usernameLabel.setLabelFor(usernameField);
+
+        JLabel pwdLabel = new JLabel("Password: ");
+        JTextField pwdField = new JTextField(20);
+        pwdLabel.setDisplayedMnemonic(KeyEvent.VK_P);
+        pwdLabel.setLabelFor(pwdField);
+
+        pwdField.addKeyListener(
+            new KeyListener(){
+                @Override
+                public void keyPressed(KeyEvent keyEvent) {
+                }
+
+                @Override
+                public void keyTyped(KeyEvent keyEvent) {
+                }
+
+                @Override
+                public void keyReleased(KeyEvent keyEvent){
+                    JComponent comp = (JComponent) pwdField;
+                    AccessibleContext ac = comp.getAccessibleContext();
+                    AccessibleExtendedComponent aec = (AccessibleExtendedComponent)ac.getAccessibleComponent();
+                    AccessibleKeyBinding akb = aec.getAccessibleKeyBinding();
+                    if (akb != null){
+                         int count = akb.getAccessibleKeyBindingCount();
+                        if (count != 1){
+                            passed = false;
+                            return;
+                        }
+
+                        // there is 1 accessible key for the text field
+                        System.out.println("Retrieved AccessibleKeyBinding for textfield " + count);
+
+                        // the key code is KeyEvent.VK_P
+                        Object o = akb.getAccessibleKeyBinding(0);
+                        if (o instanceof KeyStroke){
+                            javax.swing.KeyStroke key = (javax.swing.KeyStroke)o;
+                            System.out.println("keystroke is " + key.getKeyCode());
+                            if (key.getKeyCode() == KeyEvent.VK_P)
+                                passed = true;
+                        }
+                    }
+                }
+            }
+        );
+
+        mainFrame.getContentPane().add(usernameLabel);
+        mainFrame.getContentPane().add(usernameField);
+        mainFrame.getContentPane().add(pwdLabel);
+        mainFrame.getContentPane().add(pwdField);
+
+        mainFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
+        mainFrame.setLayout(new FlowLayout(FlowLayout.LEFT));
+
+        mainFrame.setSize(200, 200);
+        mainFrame.setLocation(200, 200);
+        mainFrame.setVisible(true);
+        mainFrame.toFront();
+    }
+ }
--- a/test/javax/swing/border/Test4252164.java	Tue May 13 23:18:27 2014 -0700
+++ b/test/javax/swing/border/Test4252164.java	Wed May 14 11:00:21 2014 -0700
@@ -23,7 +23,7 @@
 
 /*
  * @test
- * @bug 4252164
+ * @bug 4252164 8041917
  * @summary Tests rounded LineBorder for components
  * @author Sergey Malenkov
  * @run applet/manual=yesno Test4252164.html
--- a/test/javax/swing/text/StyledEditorKit/8016833/bug8016833.java	Tue May 13 23:18:27 2014 -0700
+++ b/test/javax/swing/text/StyledEditorKit/8016833/bug8016833.java	Wed May 14 11:00:21 2014 -0700
@@ -190,9 +190,9 @@
         // not too wide
         assertTrue(out3.getWidth() * 0.8 < out2.getWidth());
         // not too low
-        assertTrue(out3.getY() - (out1.getY() + out2.getHeight()) < 3);
+        assertTrue(out3.getY() - (out1.getY() + out2.getHeight() - 1) < 4);
         // not too high
-        assertTrue(out3.getY() - (out1.getY() + out2.getHeight()) > 0);
+        assertTrue(out3.getY() - (out1.getY() + out2.getHeight() - 1) > 0);
     }
 
     void testStrikthrough() {
@@ -217,7 +217,7 @@
         // not too wide
         assertTrue(out3.getWidth() * 0.8 < out2.getWidth());
         // not too low
-        assertTrue(out3.getY() - (out1.getY() + out2.getHeight()) < 0);
+        assertTrue(out3.getY() - (out1.getY() + out2.getHeight() - 1) < 0);
         // not too high
         assertTrue(out3.getY() - out1.getY() > 1);
     }
--- a/test/sun/security/pkcs11/fips/CipherTest.java	Tue May 13 23:18:27 2014 -0700
+++ b/test/sun/security/pkcs11/fips/CipherTest.java	Wed May 14 11:00:21 2014 -0700
@@ -472,8 +472,21 @@
                 return false;
             }
 
+            // No ECDH-capable certificate in key store. May restructure
+            // this in the future.
+            if (cipherSuite.contains("ECDHE_ECDSA") ||
+                    cipherSuite.contains("ECDH_ECDSA") ||
+                    cipherSuite.contains("ECDH_RSA")) {
+                System.out.println("Skipping unsupported test for " +
+                                    cipherSuite + " of " + protocol);
+                return false;
+            }
+
             // skip SSLv2Hello protocol
-            if (protocol.equals("SSLv2Hello")) {
+            //
+            // skip TLSv1.2 protocol, we have not implement "SunTls12Prf" and
+            // SunTls12RsaPremasterSecret in SunPKCS11 provider
+            if (protocol.equals("SSLv2Hello") || protocol.equals("TLSv1.2")) {
                 System.out.println("Skipping unsupported test for " +
                                     cipherSuite + " of " + protocol);
                 return false;
--- a/test/sun/security/pkcs11/fips/ClientJSSEServerJSSE.java	Tue May 13 23:18:27 2014 -0700
+++ b/test/sun/security/pkcs11/fips/ClientJSSEServerJSSE.java	Wed May 14 11:00:21 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2002, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2014, 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 6313675 6323647
+ * @bug 6313675 6323647 8028192
  * @summary Verify that all ciphersuites work in FIPS mode
  * @library ..
  * @ignore JSSE supported cipher suites are changed with CR 6916074,
@@ -44,9 +44,13 @@
             return;
         }
 
-        if ("sparc".equals(System.getProperty("os.arch")) == false) {
-            // we have not updated other platforms with the proper NSS libraries yet
-            System.out.println("Test currently works only on solaris-sparc, skipping");
+        String arch = System.getProperty("os.arch");
+        if (!("sparc".equals(arch) || "sparcv9".equals(arch))) {
+            // we have not updated other platforms with the proper NSS
+            // libraries yet
+            System.out.println(
+                    "Test currently works only on solaris-sparc " +
+                    "and solaris-sparcv9. Skipping on " + arch);
             return;
         }
 
--- a/test/sun/security/pkcs11/tls/TestPremaster.java	Tue May 13 23:18:27 2014 -0700
+++ b/test/sun/security/pkcs11/tls/TestPremaster.java	Wed May 14 11:00:21 2014 -0700
@@ -34,6 +34,7 @@
 
 import javax.crypto.KeyGenerator;
 import javax.crypto.SecretKey;
+import java.util.Formatter;
 
 import sun.security.internal.spec.TlsRsaPremasterSecretParameterSpec;
 
@@ -59,27 +60,51 @@
             System.out.println("OK: " + e);
         }
 
-        test(kg, 3, 0);
-        test(kg, 3, 1);
-        test(kg, 3, 2);
-        test(kg, 4, 0);
+        int[] protocolVersions = {0x0300, 0x0301, 0x0302, 0x0400};
+        for (int clientVersion : protocolVersions) {
+            for (int serverVersion : protocolVersions) {
+                test(kg, clientVersion, serverVersion);
+                if (serverVersion >= clientVersion) {
+                    break;
+                }
+            }
+        }
 
         System.out.println("Done.");
     }
 
-    private static void test(KeyGenerator kg, int major, int minor)
-            throws Exception {
+    private static void test(KeyGenerator kg,
+            int clientVersion, int serverVersion) throws Exception {
 
-        kg.init(new TlsRsaPremasterSecretParameterSpec(major, minor));
+        System.out.printf(
+                "Testing RSA pre-master secret key generation between " +
+                "client (0x%04X) and server(0x%04X)%n",
+                clientVersion, serverVersion);
+        kg.init(new TlsRsaPremasterSecretParameterSpec(
+                                    clientVersion, serverVersion));
         SecretKey key = kg.generateKey();
         byte[] encoded = key.getEncoded();
-        if (encoded.length != 48) {
-            throw new Exception("length: " + encoded.length);
-        }
-        if ((encoded[0] != major) || (encoded[1] != minor)) {
-            throw new Exception("version mismatch: "  + encoded[0] +
-                "." + encoded[1]);
-        }
-        System.out.println("OK: " + major + "." + minor);
+        if (encoded != null) {  // raw key material may be not extractable
+            if (encoded.length != 48) {
+                throw new Exception("length: " + encoded.length);
+            }
+            int v = versionOf(encoded[0], encoded[1]);
+            if (clientVersion != v) {
+                if (serverVersion != v || clientVersion >= 0x0302) {
+                    throw new Exception(String.format(
+                        "version mismatch: (0x%04X) rather than (0x%04X) " +
+                        "is used in pre-master secret", v, clientVersion));
+                }
+                System.out.printf("Use compatible version (0x%04X)%n", v);
+            }
+            System.out.println("Passed, version matches!");
+       } else {
+            System.out.println("Raw key material is not extractable");
+       }
     }
+
+    private static int versionOf(int major, int minor) {
+        return ((major & 0xFF) << 8) | (minor & 0xFF);
+    }
+
 }