changeset 7874:9d9c4a2bf50f

Merge
author asaha
date Wed, 07 Jan 2015 12:22:36 -0800
parents 1c785101c881 f3be45662150
children 238f0af20f18
files .hgtags src/macosx/native/sun/awt/AWTWindow.m src/share/classes/sun/awt/AWTAccessor.java src/windows/native/java/net/TwoStacksPlainDatagramSocketImpl.c test/ProblemList.txt
diffstat 99 files changed, 1671 insertions(+), 637 deletions(-) [+]
line wrap: on
line diff
--- a/.hgtags	Tue Dec 23 14:01:21 2014 -0800
+++ b/.hgtags	Wed Jan 07 12:22:36 2015 -0800
@@ -546,3 +546,5 @@
 efc8886310cbccb941f826acfad2ad51a2891be5 jdk7u80-b00
 bc7f9d966c1df3748ef9c148eab25976cd065963 jdk7u80-b01
 2590a9c18fdba19086712bb91a28352e9239a2be jdk7u80-b02
+3796111298d5b013e46d5ce49f17c16fc3197be8 jdk7u80-b03
+54acd5cd04856e80a3c7d5d38ef9c7a44d1e215a jdk7u80-b04
--- a/make/java/nio/Makefile	Tue Dec 23 14:01:21 2014 -0800
+++ b/make/java/nio/Makefile	Wed Jan 07 12:22:36 2015 -0800
@@ -380,6 +380,8 @@
      -libpath:$(LIBDIR) java.lib \
      $(OBJDIR)/../../../../sun/java.net/net/$(OBJDIRNAME)/net.lib \
      $(OBJDIR)/../../../java.lang/java/$(OBJDIRNAME)/io_util.obj \
+     $(OBJDIR)/../../../java.lang/java/$(OBJDIRNAME)/io_util_md.obj \
+     $(OBJDIR)/../../../java.lang/java/$(OBJDIRNAME)/canonicalize_md.obj \
      $(OBJDIR)/../../../java.lang/java/$(OBJDIRNAME)/FileDescriptor_md.obj
 endif
 ifeq ($(PLATFORM), linux)
--- a/src/macosx/classes/sun/lwawt/macosx/CPlatformWindow.java	Tue Dec 23 14:01:21 2014 -0800
+++ b/src/macosx/classes/sun/lwawt/macosx/CPlatformWindow.java	Wed Jan 07 12:22:36 2015 -0800
@@ -676,7 +676,7 @@
         final long nsWindowPtr = getNSWindowPtr();
         LWCToolkit lwcToolkit = (LWCToolkit) Toolkit.getDefaultToolkit();
         Window w = DefaultKeyboardFocusManager.getCurrentKeyboardFocusManager().getActiveWindow();
-        if( w != null
+        if( w != null && w.getPeer() != null
                 && ((LWWindowPeer)w.getPeer()).getPeerType() == LWWindowPeer.PeerType.EMBEDDED_FRAME
                 && !lwcToolkit.isApplicationActive()) {
             lwcToolkit.activateApplicationIgnoringOtherApps();
--- a/src/share/classes/com/sun/java/swing/plaf/windows/WindowsRootPaneUI.java	Tue Dec 23 14:01:21 2014 -0800
+++ b/src/share/classes/com/sun/java/swing/plaf/windows/WindowsRootPaneUI.java	Wed Jan 07 12:22:36 2015 -0800
@@ -31,6 +31,8 @@
 import java.awt.KeyEventPostProcessor;
 import java.awt.Window;
 import java.awt.Toolkit;
+
+import sun.awt.AWTAccessor;
 import sun.awt.SunToolkit;
 
 import java.awt.event.ActionEvent;
@@ -133,10 +135,15 @@
                 // window. If this time appears to be greater than the altRelease
                 // event time the event is skipped to avoid unexpected menu
                 // activation. See 7121442.
+                // Also we must ensure that original source of key event belongs
+                // to the same window object as winAncestor. See 8001633.
                 boolean skip = false;
                 Toolkit tk = Toolkit.getDefaultToolkit();
                 if (tk instanceof SunToolkit) {
-                    skip = ev.getWhen() <= ((SunToolkit)tk).getWindowDeactivationTime(winAncestor);
+                    Component originalSource = AWTAccessor.getKeyEventAccessor()
+                            .getOriginalSource(ev);
+                    skip = SunToolkit.getContainingWindow(originalSource) != winAncestor ||
+                            ev.getWhen() <= ((SunToolkit) tk).getWindowDeactivationTime(winAncestor);
                 }
 
                 if (menu != null && !skip) {
--- a/src/share/classes/java/awt/event/KeyEvent.java	Tue Dec 23 14:01:21 2014 -0800
+++ b/src/share/classes/java/awt/event/KeyEvent.java	Wed Jan 07 12:22:36 2015 -0800
@@ -930,6 +930,10 @@
                                                long extendedKeyCode) {
                     ev.extendedKeyCode = extendedKeyCode;
                 }
+
+                public Component getOriginalSource( KeyEvent ev ) {
+                    return ev.originalSource;
+                }
             });
     }
 
@@ -939,6 +943,14 @@
      */
     private static native void initIDs();
 
+    /**
+     * The original event source.
+     *
+     * Event source can be changed during processing, but in some cases
+     * we need to be able to obtain original source.
+     */
+    private Component originalSource;
+
     private KeyEvent(Component source, int id, long when, int modifiers,
                     int keyCode, char keyChar, int keyLocation, boolean isProxyActive) {
         this(source, id, when, modifiers, keyCode, keyChar, keyLocation);
@@ -1023,6 +1035,7 @@
         } else if ((getModifiers() == 0) && (getModifiersEx() != 0)) {
             setOldModifiers();
         }
+        originalSource = source;
     }
 
     /**
--- a/src/share/classes/java/lang/Class.java	Tue Dec 23 14:01:21 2014 -0800
+++ b/src/share/classes/java/lang/Class.java	Wed Jan 07 12:22:36 2015 -0800
@@ -629,6 +629,8 @@
     ClassLoader getClassLoader0() { return classLoader; }
 
     // Initialized in JVM not by private constructor
+    // This field is filtered from reflection access, i.e. getDeclaredField
+    // will throw NoSuchFieldException
     private final ClassLoader classLoader;
 
     /**
@@ -2460,7 +2462,7 @@
     private native String getGenericSignature();
 
     // Generic info repository; lazily initialized
-    private transient ClassRepository genericInfo;
+    private volatile transient ClassRepository genericInfo;
 
     // accessor for factory
     private GenericsFactory getFactory() {
@@ -2470,11 +2472,13 @@
 
     // accessor for generic info repository
     private ClassRepository getGenericInfo() {
+        ClassRepository genericInfo = this.genericInfo;
         // lazily initialize repository if necessary
         if (genericInfo == null) {
             // create and cache generic info repository
             genericInfo = ClassRepository.make(getGenericSignature(),
                                                getFactory());
+            this.genericInfo = genericInfo;
         }
         return genericInfo; //return cached repository
     }
--- a/src/share/classes/java/lang/reflect/AccessibleObject.java	Tue Dec 23 14:01:21 2014 -0800
+++ b/src/share/classes/java/lang/reflect/AccessibleObject.java	Wed Jan 07 12:22:36 2015 -0800
@@ -140,13 +140,6 @@
                 throw new SecurityException("Cannot make a java.lang.Class" +
                                             " constructor accessible");
             }
-        } else if (obj instanceof Field && flag == true) {
-            Field f = (Field)obj;
-            if (f.getDeclaringClass() == Class.class &&
-                f.getName().equals("classLoader")) {
-                throw new SecurityException("Cannot make java.lang.Class.classLoader" +
-                                            " accessible");
-            }
         }
         obj.override = flag;
     }
--- a/src/share/classes/java/security/KeyPairGenerator.java	Tue Dec 23 14:01:21 2014 -0800
+++ b/src/share/classes/java/security/KeyPairGenerator.java	Wed Jan 07 12:22:36 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 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
@@ -33,6 +33,7 @@
 
 import sun.security.jca.*;
 import sun.security.jca.GetInstance.Instance;
+import sun.security.util.Debug;
 
 /**
  * The KeyPairGenerator class is used to generate pairs of
@@ -127,6 +128,11 @@
 
 public abstract class KeyPairGenerator extends KeyPairGeneratorSpi {
 
+    private static final Debug pdebug =
+                        Debug.getInstance("provider", "Provider");
+    private static final boolean skipDebug =
+        Debug.isOn("engine=") && !Debug.isOn("keypairgenerator");
+
     private final String algorithm;
 
     // The provider
@@ -168,6 +174,12 @@
             kpg = new Delegate(spi, algorithm);
         }
         kpg.provider = instance.provider;
+
+        if (!skipDebug && pdebug != null) {
+            pdebug.println("KeyPairGenerator." + algorithm +
+                " algorithm from: " + kpg.provider.getName());
+        }
+
         return kpg;
     }
 
@@ -558,6 +570,11 @@
             provider = instance.provider;
             this.serviceIterator = serviceIterator;
             initType = I_NONE;
+
+            if (!skipDebug && pdebug != null) {
+                pdebug.println("KeyPairGenerator." + algorithm +
+                    " algorithm from: " + provider.getName());
+            }
         }
 
         /**
--- a/src/share/classes/java/security/KeyStore.java	Tue Dec 23 14:01:21 2014 -0800
+++ b/src/share/classes/java/security/KeyStore.java	Wed Jan 07 12:22:36 2015 -0800
@@ -34,6 +34,8 @@
 
 import javax.security.auth.callback.*;
 
+import sun.security.util.Debug;
+
 /**
  * This class represents a storage facility for cryptographic
  * keys and certificates.
@@ -187,6 +189,11 @@
 
 public class KeyStore {
 
+    private static final Debug pdebug =
+                        Debug.getInstance("provider", "Provider");
+    private static final boolean skipDebug =
+        Debug.isOn("engine=") && !Debug.isOn("keystore");
+
     /*
      * Constant to lookup in the Security properties file to determine
      * the default keystore type.
@@ -578,6 +585,11 @@
         this.keyStoreSpi = keyStoreSpi;
         this.provider = provider;
         this.type = type;
+
+        if (!skipDebug && pdebug != null) {
+            pdebug.println("KeyStore." + type.toUpperCase() + " type from: " +
+                this.provider.getName());
+        }
     }
 
     /**
--- a/src/share/classes/java/security/MessageDigest.java	Tue Dec 23 14:01:21 2014 -0800
+++ b/src/share/classes/java/security/MessageDigest.java	Wed Jan 07 12:22:36 2015 -0800
@@ -35,6 +35,8 @@
 
 import java.nio.ByteBuffer;
 
+import sun.security.util.Debug;
+
 /**
  * This MessageDigest class provides applications the functionality of a
  * message digest algorithm, such as SHA-1 or SHA-256.
@@ -103,6 +105,11 @@
 
 public abstract class MessageDigest extends MessageDigestSpi {
 
+    private static final Debug pdebug =
+                        Debug.getInstance("provider", "Provider");
+    private static final boolean skipDebug =
+        Debug.isOn("engine=") && !Debug.isOn("messagedigest");
+
     private String algorithm;
 
     // The state of this digest
@@ -156,18 +163,23 @@
     public static MessageDigest getInstance(String algorithm)
     throws NoSuchAlgorithmException {
         try {
+            MessageDigest md;
             Object[] objs = Security.getImpl(algorithm, "MessageDigest",
                                              (String)null);
             if (objs[0] instanceof MessageDigest) {
-                MessageDigest md = (MessageDigest)objs[0];
-                md.provider = (Provider)objs[1];
-                return md;
+                md = (MessageDigest)objs[0];
             } else {
-                MessageDigest delegate =
-                    new Delegate((MessageDigestSpi)objs[0], algorithm);
-                delegate.provider = (Provider)objs[1];
-                return delegate;
+                md = new Delegate((MessageDigestSpi)objs[0], algorithm);
             }
+            md.provider = (Provider)objs[1];
+
+            if (!skipDebug && pdebug != null) {
+                pdebug.println("MessageDigest." + algorithm +
+                    " algorithm from: " + md.provider.getName());
+            }
+
+            return md;
+
         } catch(NoSuchProviderException e) {
             throw new NoSuchAlgorithmException(algorithm + " not found");
         }
--- a/src/share/classes/java/security/SecureRandom.java	Tue Dec 23 14:01:21 2014 -0800
+++ b/src/share/classes/java/security/SecureRandom.java	Wed Jan 07 12:22:36 2015 -0800
@@ -31,6 +31,7 @@
 
 import sun.security.jca.*;
 import sun.security.jca.GetInstance.Instance;
+import sun.security.util.Debug;
 
 /**
  * This class provides a cryptographically strong random number
@@ -91,6 +92,11 @@
 
 public class SecureRandom extends java.util.Random {
 
+    private static final Debug pdebug =
+                        Debug.getInstance("provider", "Provider");
+    private static final boolean skipDebug =
+        Debug.isOn("engine=") && !Debug.isOn("securerandom");
+
     /**
      * The provider.
      *
@@ -233,6 +239,11 @@
         this.secureRandomSpi = secureRandomSpi;
         this.provider = provider;
         this.algorithm = algorithm;
+
+        if (!skipDebug && pdebug != null) {
+            pdebug.println("SecureRandom." + algorithm +
+                " algorithm from: " + this.provider.getName());
+        }
     }
 
     /**
--- a/src/share/classes/java/security/Signature.java	Tue Dec 23 14:01:21 2014 -0800
+++ b/src/share/classes/java/security/Signature.java	Wed Jan 07 12:22:36 2015 -0800
@@ -121,6 +121,11 @@
     private static final Debug debug =
                         Debug.getInstance("jca", "Signature");
 
+    private static final Debug pdebug =
+                        Debug.getInstance("provider", "Provider");
+    private static final boolean skipDebug =
+        Debug.isOn("engine=") && !Debug.isOn("signature");
+
     /*
      * The algorithm for this signature object.
      * This value is used to map an OID to the particular algorithm.
@@ -450,6 +455,11 @@
             throws InvalidKeyException {
         engineInitVerify(publicKey);
         state = VERIFY;
+
+        if (!skipDebug && pdebug != null) {
+            pdebug.println("Signature." + algorithm +
+                " verification algorithm from: " + this.provider.getName());
+        }
     }
 
     /**
@@ -494,6 +504,11 @@
         PublicKey publicKey = certificate.getPublicKey();
         engineInitVerify(publicKey);
         state = VERIFY;
+
+        if (!skipDebug && pdebug != null) {
+            pdebug.println("Signature." + algorithm +
+                " verification algorithm from: " + this.provider.getName());
+        }
     }
 
     /**
@@ -510,6 +525,11 @@
             throws InvalidKeyException {
         engineInitSign(privateKey);
         state = SIGN;
+
+        if (!skipDebug && pdebug != null) {
+            pdebug.println("Signature." + algorithm +
+                " signing algorithm from: " + this.provider.getName());
+        }
     }
 
     /**
@@ -528,6 +548,11 @@
             throws InvalidKeyException {
         engineInitSign(privateKey, random);
         state = SIGN;
+
+        if (!skipDebug && pdebug != null) {
+            pdebug.println("Signature." + algorithm +
+                " signing algorithm from: " + this.provider.getName());
+        }
     }
 
     /**
--- a/src/share/classes/javax/crypto/Cipher.java	Tue Dec 23 14:01:21 2014 -0800
+++ b/src/share/classes/javax/crypto/Cipher.java	Wed Jan 07 12:22:36 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 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
@@ -156,6 +156,11 @@
     private static final Debug debug =
                         Debug.getInstance("jca", "Cipher");
 
+    private static final Debug pdebug =
+                        Debug.getInstance("provider", "Provider");
+    private static final boolean skipDebug =
+        Debug.isOn("engine=") && !Debug.isOn("cipher");
+
     /**
      * Constant used to initialize cipher to encryption mode.
      */
@@ -1100,6 +1105,21 @@
         }
     }
 
+    private static String getOpmodeString(int opmode) {
+        switch (opmode) {
+            case ENCRYPT_MODE:
+                return "encryption";
+            case DECRYPT_MODE:
+                return "decryption";
+            case WRAP_MODE:
+                return "key wrapping";
+            case UNWRAP_MODE:
+                return "key unwrapping";
+            default:
+                return "";
+        }
+    }
+
     /**
      * Initializes this cipher with a key.
      *
@@ -1219,6 +1239,12 @@
 
         initialized = true;
         this.opmode = opmode;
+
+        if (!skipDebug && pdebug != null) {
+            pdebug.println("Cipher." + transformation + " " +
+                getOpmodeString(opmode) + " algorithm from: " +
+                this.provider.getName());
+        }
     }
 
     /**
@@ -1350,6 +1376,12 @@
 
         initialized = true;
         this.opmode = opmode;
+
+        if (!skipDebug && pdebug != null) {
+            pdebug.println("Cipher." + transformation + " " +
+                getOpmodeString(opmode) + " algorithm from: " +
+                this.provider.getName());
+        }
     }
 
     /**
@@ -1481,6 +1513,12 @@
 
         initialized = true;
         this.opmode = opmode;
+
+        if (!skipDebug && pdebug != null) {
+            pdebug.println("Cipher." + transformation + " " +
+                getOpmodeString(opmode) + " algorithm from: " +
+                this.provider.getName());
+        }
     }
 
     /**
@@ -1659,6 +1697,12 @@
 
         initialized = true;
         this.opmode = opmode;
+
+        if (!skipDebug && pdebug != null) {
+            pdebug.println("Cipher." + transformation + " " +
+                getOpmodeString(opmode) + " algorithm from: " +
+                this.provider.getName());
+        }
     }
 
     /**
--- a/src/share/classes/javax/crypto/KeyAgreement.java	Tue Dec 23 14:01:21 2014 -0800
+++ b/src/share/classes/javax/crypto/KeyAgreement.java	Wed Jan 07 12:22:36 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 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,6 +78,11 @@
     private static final Debug debug =
                         Debug.getInstance("jca", "KeyAgreement");
 
+    private static final Debug pdebug =
+                        Debug.getInstance("provider", "Provider");
+    private static final boolean skipDebug =
+        Debug.isOn("engine=") && !Debug.isOn("keyagreement");
+
     // The provider
     private Provider provider;
 
@@ -467,6 +472,11 @@
                 throw new InvalidKeyException(e);
             }
         }
+
+        if (!skipDebug && pdebug != null) {
+            pdebug.println("KeyAgreement." + algorithm + " algorithm from: " +
+                this.provider.getName());
+        }
     }
 
     /**
@@ -523,6 +533,11 @@
         } else {
             chooseProvider(I_PARAMS, key, params, random);
         }
+
+        if (!skipDebug && pdebug != null) {
+            pdebug.println("KeyAgreement." + algorithm + " algorithm from: " +
+                this.provider.getName());
+        }
     }
 
     /**
--- a/src/share/classes/javax/crypto/KeyGenerator.java	Tue Dec 23 14:01:21 2014 -0800
+++ b/src/share/classes/javax/crypto/KeyGenerator.java	Wed Jan 07 12:22:36 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 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
@@ -33,6 +33,7 @@
 
 import sun.security.jca.*;
 import sun.security.jca.GetInstance.Instance;
+import sun.security.util.Debug;
 
 /**
  * This class provides the functionality of a secret (symmetric) key generator.
@@ -109,6 +110,11 @@
 
 public class KeyGenerator {
 
+    private static final Debug pdebug =
+                        Debug.getInstance("provider", "Provider");
+    private static final boolean skipDebug =
+        Debug.isOn("engine=") && !Debug.isOn("keygenerator");
+
     // see java.security.KeyPairGenerator for failover notes
 
     private final static int I_NONE   = 1;
@@ -146,6 +152,11 @@
         this.spi = keyGenSpi;
         this.provider = provider;
         this.algorithm = algorithm;
+
+        if (!skipDebug && pdebug != null) {
+            pdebug.println("KeyGenerator." + algorithm + " algorithm from: " +
+                this.provider.getName());
+        }
     }
 
     private KeyGenerator(String algorithm) throws NoSuchAlgorithmException {
@@ -158,6 +169,11 @@
             throw new NoSuchAlgorithmException
                 (algorithm + " KeyGenerator not available");
         }
+
+        if (!skipDebug && pdebug != null) {
+            pdebug.println("KeyGenerator." + algorithm + " algorithm from: " +
+                this.provider.getName());
+        }
     }
 
     /**
--- a/src/share/classes/javax/crypto/Mac.java	Tue Dec 23 14:01:21 2014 -0800
+++ b/src/share/classes/javax/crypto/Mac.java	Wed Jan 07 12:22:36 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 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
@@ -77,6 +77,11 @@
     private static final Debug debug =
                         Debug.getInstance("jca", "Mac");
 
+    private static final Debug pdebug =
+                        Debug.getInstance("provider", "Provider");
+    private static final boolean skipDebug =
+        Debug.isOn("engine=") && !Debug.isOn("mac");
+
     // The provider
     private Provider provider;
 
@@ -413,6 +418,11 @@
             throw new InvalidKeyException("init() failed", e);
         }
         initialized = true;
+
+        if (!skipDebug && pdebug != null) {
+            pdebug.println("Mac." + algorithm + " algorithm from: " +
+                this.provider.getName());
+        }
     }
 
     /**
@@ -435,6 +445,11 @@
             chooseProvider(key, params);
         }
         initialized = true;
+
+        if (!skipDebug && pdebug != null) {
+            pdebug.println("Mac." + algorithm + " algorithm from: " +
+                this.provider.getName());
+        }
     }
 
     /**
--- a/src/share/classes/jdk/net/Sockets.java	Tue Dec 23 14:01:21 2014 -0800
+++ b/src/share/classes/jdk/net/Sockets.java	Wed Jan 07 12:22:36 2015 -0800
@@ -370,6 +370,7 @@
         set = new HashSet<>();
         set.add(StandardSocketOptions.SO_RCVBUF);
         set.add(StandardSocketOptions.SO_REUSEADDR);
+        set.add(StandardSocketOptions.IP_TOS);
         set = Collections.unmodifiableSet(set);
         options.put(ServerSocket.class, set);
 
--- a/src/share/classes/sun/awt/AWTAccessor.java	Tue Dec 23 14:01:21 2014 -0800
+++ b/src/share/classes/sun/awt/AWTAccessor.java	Wed Jan 07 12:22:36 2015 -0800
@@ -650,6 +650,11 @@
          * Sets extendedKeyCode field for KeyEvent
          */
         void setExtendedKeyCode(KeyEvent ev, long extendedKeyCode);
+
+        /**
+         * Gets original source for KeyEvent
+         */
+        Component getOriginalSource(KeyEvent ev);
     }
 
     /**
--- a/src/share/classes/sun/awt/datatransfer/DataTransferer.java	Tue Dec 23 14:01:21 2014 -0800
+++ b/src/share/classes/sun/awt/datatransfer/DataTransferer.java	Wed Jan 07 12:22:36 2015 -0800
@@ -1365,6 +1365,15 @@
         // bytes and dump them into a byte array. For text flavors, decode back
         // to a String and recur to reencode according to the requested format.
         } else if (flavor.isRepresentationClassInputStream()) {
+
+            // Workaround to JDK-8024061: Exception thrown when drag and drop
+            //      between two components is executed quickly.
+            // and JDK-8065098:  JColorChooser no longer supports drag and drop
+            //      between two JVM instances
+            if (!(obj instanceof InputStream)) {
+                return new byte[0];
+            }
+
             InputStream is = (InputStream)obj;
             boolean eof = false;
             int avail = is.available();
--- a/src/share/classes/sun/awt/dnd/SunDropTargetContextPeer.java	Tue Dec 23 14:01:21 2014 -0800
+++ b/src/share/classes/sun/awt/dnd/SunDropTargetContextPeer.java	Wed Jan 07 12:22:36 2015 -0800
@@ -239,13 +239,6 @@
 
         if (localTransferable != null) {
             return localTransferable.getTransferData(df);
-        } else if (df.isMimeTypeEqual(DataFlavor.javaJVMLocalObjectMimeType)) {
-            // Workaround to JDK-8024061: Exception thrown when drag and drop
-            //      between two components is executed quickly.
-            // It is expected localTransferable is not null if javaJVMLocalObjectMimeType
-            // is used. Executing further results in ClassCastException, so null is
-            // returned here as no transfer data is available in this case.
-            return null;
         }
 
         if (dropStatus != STATUS_ACCEPT || dropComplete) {
--- a/src/share/classes/sun/net/www/http/HttpClient.java	Tue Dec 23 14:01:21 2014 -0800
+++ b/src/share/classes/sun/net/www/http/HttpClient.java	Wed Jan 07 12:22:36 2015 -0800
@@ -643,9 +643,10 @@
             cachedHttpClient = false;
             if (!failedOnce && requests != null) {
                 failedOnce = true;
-                if (getRequestMethod().equals("CONNECT") ||
-                    (httpuc.getRequestMethod().equals("POST") &&
-                    (!retryPostProp || streaming))) {
+                if (getRequestMethod().equals("CONNECT")
+                    || streaming
+                    || (httpuc.getRequestMethod().equals("POST")
+                        && !retryPostProp)) {
                     // do not retry the request
                 }  else {
                     // try once more
@@ -755,9 +756,10 @@
             } else if (nread != 8) {
                 if (!failedOnce && requests != null) {
                     failedOnce = true;
-                    if (getRequestMethod().equals("CONNECT") ||
-                        (httpuc.getRequestMethod().equals("POST") &&
-                        (!retryPostProp || streaming))) {
+                    if (getRequestMethod().equals("CONNECT")
+                        || streaming
+                        || (httpuc.getRequestMethod().equals("POST")
+                            && !retryPostProp)) {
                         // do not retry the request
                     } else {
                         closeServer();
--- a/src/share/classes/sun/reflect/BootstrapConstructorAccessorImpl.java	Tue Dec 23 14:01:21 2014 -0800
+++ b/src/share/classes/sun/reflect/BootstrapConstructorAccessorImpl.java	Wed Jan 07 12:22:36 2015 -0800
@@ -32,7 +32,7 @@
     bootstrapping. */
 
 class BootstrapConstructorAccessorImpl extends ConstructorAccessorImpl {
-    private Constructor constructor;
+    private final Constructor constructor;
 
     BootstrapConstructorAccessorImpl(Constructor c) {
         this.constructor = c;
--- a/src/share/classes/sun/reflect/InstantiationExceptionConstructorAccessorImpl.java	Tue Dec 23 14:01:21 2014 -0800
+++ b/src/share/classes/sun/reflect/InstantiationExceptionConstructorAccessorImpl.java	Wed Jan 07 12:22:36 2015 -0800
@@ -33,7 +33,7 @@
 
 class InstantiationExceptionConstructorAccessorImpl
     extends ConstructorAccessorImpl {
-    private String message;
+    private final String message;
 
     InstantiationExceptionConstructorAccessorImpl(String message) {
         this.message = message;
--- a/src/share/classes/sun/reflect/Label.java	Tue Dec 23 14:01:21 2014 -0800
+++ b/src/share/classes/sun/reflect/Label.java	Wed Jan 07 12:22:36 2015 -0800
@@ -48,10 +48,10 @@
         }
         // This won't work for more than one assembler anyway, so this is
         // unnecessary
-        ClassFileAssembler asm;
-        short instrBCI;
-        short patchBCI;
-        int   stackDepth;
+        final ClassFileAssembler asm;
+        final short instrBCI;
+        final short patchBCI;
+        final int   stackDepth;
     }
     private List/*<PatchInfo>*/ patches = new ArrayList();
 
--- a/src/share/classes/sun/reflect/NativeConstructorAccessorImpl.java	Tue Dec 23 14:01:21 2014 -0800
+++ b/src/share/classes/sun/reflect/NativeConstructorAccessorImpl.java	Wed Jan 07 12:22:36 2015 -0800
@@ -31,7 +31,7 @@
     afterward, switches to bytecode-based implementation */
 
 class NativeConstructorAccessorImpl extends ConstructorAccessorImpl {
-    private Constructor c;
+    private final Constructor c;
     private DelegatingConstructorAccessorImpl parent;
     private int numInvocations;
 
--- a/src/share/classes/sun/reflect/NativeMethodAccessorImpl.java	Tue Dec 23 14:01:21 2014 -0800
+++ b/src/share/classes/sun/reflect/NativeMethodAccessorImpl.java	Wed Jan 07 12:22:36 2015 -0800
@@ -31,7 +31,7 @@
     switches to bytecode-based implementation */
 
 class NativeMethodAccessorImpl extends MethodAccessorImpl {
-    private Method method;
+    private final Method method;
     private DelegatingMethodAccessorImpl parent;
     private int numInvocations;
 
--- a/src/share/classes/sun/reflect/Reflection.java	Tue Dec 23 14:01:21 2014 -0800
+++ b/src/share/classes/sun/reflect/Reflection.java	Wed Jan 07 12:22:36 2015 -0800
@@ -47,6 +47,7 @@
         map.put(Reflection.class,
             new String[] {"fieldFilterMap", "methodFilterMap"});
         map.put(System.class, new String[] {"security"});
+        map.put(Class.class, new String[] {"classLoader"});
         fieldFilterMap = map;
 
         methodFilterMap = new HashMap<Class,String[]>();
--- a/src/share/classes/sun/reflect/ReflectionFactory.java	Tue Dec 23 14:01:21 2014 -0800
+++ b/src/share/classes/sun/reflect/ReflectionFactory.java	Wed Jan 07 12:22:36 2015 -0800
@@ -48,9 +48,9 @@
 public class ReflectionFactory {
 
     private static boolean initted = false;
-    private static Permission reflectionFactoryAccessPerm
+    private static final Permission reflectionFactoryAccessPerm
         = new RuntimePermission("reflectionFactoryAccess");
-    private static ReflectionFactory soleInstance = new ReflectionFactory();
+    private static final ReflectionFactory soleInstance = new ReflectionFactory();
     // Provides access to package-private mechanisms in java.lang.reflect
     private static volatile LangReflectAccess langReflectAccess;
 
--- a/src/share/classes/sun/reflect/SignatureIterator.java	Tue Dec 23 14:01:21 2014 -0800
+++ b/src/share/classes/sun/reflect/SignatureIterator.java	Wed Jan 07 12:22:36 2015 -0800
@@ -28,7 +28,7 @@
 /** Assists in iterating down a method's signature */
 
 public class SignatureIterator {
-    private String sig;
+    private final String sig;
     private int idx;
 
     public SignatureIterator(String sig) {
--- a/src/share/classes/sun/reflect/generics/factory/CoreReflectionFactory.java	Tue Dec 23 14:01:21 2014 -0800
+++ b/src/share/classes/sun/reflect/generics/factory/CoreReflectionFactory.java	Wed Jan 07 12:22:36 2015 -0800
@@ -45,8 +45,8 @@
  * core reflection (java.lang.reflect).
  */
 public class CoreReflectionFactory implements GenericsFactory {
-    private GenericDeclaration decl;
-    private Scope scope;
+    private final GenericDeclaration decl;
+    private final Scope scope;
 
     private CoreReflectionFactory(GenericDeclaration d, Scope s) {
         decl = d;
--- a/src/share/classes/sun/reflect/generics/reflectiveObjects/GenericArrayTypeImpl.java	Tue Dec 23 14:01:21 2014 -0800
+++ b/src/share/classes/sun/reflect/generics/reflectiveObjects/GenericArrayTypeImpl.java	Wed Jan 07 12:22:36 2015 -0800
@@ -34,7 +34,7 @@
  */
 public class GenericArrayTypeImpl
     implements GenericArrayType {
-    private Type genericComponentType;
+    private final Type genericComponentType;
 
     // private constructor enforces use of static factory
     private GenericArrayTypeImpl(Type ct) {
--- a/src/share/classes/sun/reflect/generics/reflectiveObjects/LazyReflectiveObjectGenerator.java	Tue Dec 23 14:01:21 2014 -0800
+++ b/src/share/classes/sun/reflect/generics/reflectiveObjects/LazyReflectiveObjectGenerator.java	Wed Jan 07 12:22:36 2015 -0800
@@ -40,7 +40,7 @@
  *
 */
 public abstract class LazyReflectiveObjectGenerator {
-    private GenericsFactory factory; // cached factory
+    private final GenericsFactory factory; // cached factory
 
     protected LazyReflectiveObjectGenerator(GenericsFactory f) {
         factory = f;
--- a/src/share/classes/sun/reflect/generics/reflectiveObjects/ParameterizedTypeImpl.java	Tue Dec 23 14:01:21 2014 -0800
+++ b/src/share/classes/sun/reflect/generics/reflectiveObjects/ParameterizedTypeImpl.java	Wed Jan 07 12:22:36 2015 -0800
@@ -38,9 +38,9 @@
 /** Implementing class for ParameterizedType interface. */
 
 public class ParameterizedTypeImpl implements ParameterizedType {
-    private Type[] actualTypeArguments;
-    private Class<?>  rawType;
-    private Type   ownerType;
+    private final Type[] actualTypeArguments;
+    private final Class<?>  rawType;
+    private final Type   ownerType;
 
     private ParameterizedTypeImpl(Class<?> rawType,
                                   Type[] actualTypeArguments,
--- a/src/share/classes/sun/reflect/generics/repository/AbstractRepository.java	Tue Dec 23 14:01:21 2014 -0800
+++ b/src/share/classes/sun/reflect/generics/repository/AbstractRepository.java	Wed Jan 07 12:22:36 2015 -0800
@@ -40,9 +40,9 @@
 
     // A factory used to produce reflective objects. Provided when the
     //repository is created. Will vary across implementations.
-    private GenericsFactory factory;
+    private final GenericsFactory factory;
 
-    private T tree; // the AST for the generic type info
+    private final T tree; // the AST for the generic type info
 
     //accessors
     private GenericsFactory getFactory() { return factory;}
--- a/src/share/classes/sun/reflect/generics/repository/ClassRepository.java	Tue Dec 23 14:01:21 2014 -0800
+++ b/src/share/classes/sun/reflect/generics/repository/ClassRepository.java	Wed Jan 07 12:22:36 2015 -0800
@@ -40,8 +40,8 @@
  */
 public class ClassRepository extends GenericDeclRepository<ClassSignature> {
 
-    private Type superclass; // caches the generic superclass info
-    private Type[] superInterfaces; // caches the generic superinterface info
+    private volatile Type superclass; // caches the generic superclass info
+    private volatile Type[] superInterfaces; // caches the generic superinterface info
 
  // private, to enforce use of static factory
     private ClassRepository(String rawSig, GenericsFactory f) {
@@ -78,17 +78,20 @@
  */
 
     public Type getSuperclass(){
+        Type superclass = this.superclass;
         if (superclass == null) { // lazily initialize superclass
             Reifier r = getReifier(); // obtain visitor
             // Extract superclass subtree from AST and reify
             getTree().getSuperclass().accept(r);
             // extract result from visitor and cache it
             superclass = r.getResult();
+            this.superclass = superclass;
             }
         return superclass; // return cached result
     }
 
     public Type[] getSuperInterfaces(){
+        Type[] superInterfaces = this.superInterfaces;
         if (superInterfaces == null) { // lazily initialize super interfaces
             // first, extract super interface subtree(s) from AST
             TypeTree[] ts  = getTree().getSuperInterfaces();
@@ -102,6 +105,7 @@
                 sis[i] = r.getResult();
             }
             superInterfaces = sis; // cache overall result
+            this.superInterfaces = superInterfaces;
         }
         return superInterfaces.clone(); // return cached result
     }
--- a/src/share/classes/sun/reflect/generics/repository/GenericDeclRepository.java	Tue Dec 23 14:01:21 2014 -0800
+++ b/src/share/classes/sun/reflect/generics/repository/GenericDeclRepository.java	Wed Jan 07 12:22:36 2015 -0800
@@ -42,7 +42,7 @@
 public abstract class GenericDeclRepository<S extends Signature>
     extends AbstractRepository<S> {
 
-    private TypeVariable[] typeParams; // caches the formal type parameters
+    private volatile TypeVariable[] typeParams; // caches the formal type parameters
 
     protected GenericDeclRepository(String rawSig, GenericsFactory f) {
         super(rawSig, f);
@@ -65,6 +65,7 @@
      * @return the formal type parameters of this generic declaration
      */
     public TypeVariable/*<?>*/[] getTypeParameters(){
+        TypeVariable[] typeParams = this.typeParams;
         if (typeParams == null) { // lazily initialize type parameters
             // first, extract type parameter subtree(s) from AST
             FormalTypeParameter[] ftps = getTree().getFormalTypeParameters();
@@ -78,6 +79,7 @@
                 tps[i] = (TypeVariable<?>) r.getResult();
             }
             typeParams = tps; // cache overall result
+            this.typeParams = typeParams;
         }
         return typeParams.clone(); // return cached result
     }
--- a/src/share/classes/sun/reflect/generics/scope/AbstractScope.java	Tue Dec 23 14:01:21 2014 -0800
+++ b/src/share/classes/sun/reflect/generics/scope/AbstractScope.java	Wed Jan 07 12:22:36 2015 -0800
@@ -41,8 +41,8 @@
 public abstract class AbstractScope<D extends GenericDeclaration>
     implements Scope {
 
-    private D recvr; // the declaration whose scope this instance represents
-    private Scope enclosingScope; // the enclosing scope of this scope
+    private final D recvr; // the declaration whose scope this instance represents
+    private volatile Scope enclosingScope; // the enclosing scope of this scope
 
     /**
      * Constructor. Takes a reflective object whose scope the newly
@@ -71,7 +71,11 @@
      * @return the enclosing scope
      */
     protected Scope getEnclosingScope(){
-        if (enclosingScope == null) {enclosingScope = computeEnclosingScope();}
+        Scope enclosingScope = this.enclosingScope;
+        if (enclosingScope == null) {
+            enclosingScope = computeEnclosingScope();
+            this.enclosingScope = enclosingScope;
+        }
         return enclosingScope;
     }
 
--- a/src/share/classes/sun/reflect/generics/scope/DummyScope.java	Tue Dec 23 14:01:21 2014 -0800
+++ b/src/share/classes/sun/reflect/generics/scope/DummyScope.java	Wed Jan 07 12:22:36 2015 -0800
@@ -38,7 +38,7 @@
 public class DummyScope implements Scope {
     // Caches the unique instance of this class; instances contain no data
     // so we can use the singleton pattern
-    private static DummyScope singleton = new DummyScope();
+    private static final DummyScope singleton = new DummyScope();
 
     // constructor is private to enforce use of factory method
     private DummyScope(){}
--- a/src/share/classes/sun/reflect/generics/tree/ArrayTypeSignature.java	Tue Dec 23 14:01:21 2014 -0800
+++ b/src/share/classes/sun/reflect/generics/tree/ArrayTypeSignature.java	Wed Jan 07 12:22:36 2015 -0800
@@ -28,7 +28,7 @@
 import sun.reflect.generics.visitor.TypeTreeVisitor;
 
 public class ArrayTypeSignature implements FieldTypeSignature {
-    private TypeSignature componentType;
+    private final TypeSignature componentType;
 
     private ArrayTypeSignature(TypeSignature ct) {componentType = ct;}
 
--- a/src/share/classes/sun/reflect/generics/tree/BooleanSignature.java	Tue Dec 23 14:01:21 2014 -0800
+++ b/src/share/classes/sun/reflect/generics/tree/BooleanSignature.java	Wed Jan 07 12:22:36 2015 -0800
@@ -29,7 +29,7 @@
 
 /** AST that represents the type boolean. */
 public class BooleanSignature implements BaseType {
-    private static BooleanSignature singleton = new BooleanSignature();
+    private static final BooleanSignature singleton = new BooleanSignature();
 
     private BooleanSignature(){}
 
--- a/src/share/classes/sun/reflect/generics/tree/BottomSignature.java	Tue Dec 23 14:01:21 2014 -0800
+++ b/src/share/classes/sun/reflect/generics/tree/BottomSignature.java	Wed Jan 07 12:22:36 2015 -0800
@@ -28,7 +28,7 @@
 import sun.reflect.generics.visitor.TypeTreeVisitor;
 
 public class BottomSignature implements FieldTypeSignature {
-    private static BottomSignature singleton = new BottomSignature();
+    private static final BottomSignature singleton = new BottomSignature();
 
     private BottomSignature(){}
 
--- a/src/share/classes/sun/reflect/generics/tree/ByteSignature.java	Tue Dec 23 14:01:21 2014 -0800
+++ b/src/share/classes/sun/reflect/generics/tree/ByteSignature.java	Wed Jan 07 12:22:36 2015 -0800
@@ -29,7 +29,7 @@
 
 /** AST that represents the type byte. */
 public class ByteSignature implements BaseType {
-    private static ByteSignature singleton = new ByteSignature();
+    private static final ByteSignature singleton = new ByteSignature();
 
     private ByteSignature(){}
 
--- a/src/share/classes/sun/reflect/generics/tree/CharSignature.java	Tue Dec 23 14:01:21 2014 -0800
+++ b/src/share/classes/sun/reflect/generics/tree/CharSignature.java	Wed Jan 07 12:22:36 2015 -0800
@@ -29,7 +29,7 @@
 
 /** AST that represents the type char. */
 public class CharSignature implements BaseType {
-    private static CharSignature singleton = new CharSignature();
+    private static final CharSignature singleton = new CharSignature();
 
     private CharSignature(){}
 
--- a/src/share/classes/sun/reflect/generics/tree/ClassSignature.java	Tue Dec 23 14:01:21 2014 -0800
+++ b/src/share/classes/sun/reflect/generics/tree/ClassSignature.java	Wed Jan 07 12:22:36 2015 -0800
@@ -28,9 +28,9 @@
 import sun.reflect.generics.visitor.Visitor;
 
 public class ClassSignature implements Signature {
-    private FormalTypeParameter[] formalTypeParams;
-    private ClassTypeSignature superclass;
-    private ClassTypeSignature[] superInterfaces;
+    private final FormalTypeParameter[] formalTypeParams;
+    private final ClassTypeSignature superclass;
+    private final ClassTypeSignature[] superInterfaces;
 
     private ClassSignature(FormalTypeParameter[] ftps,
                                       ClassTypeSignature sc,
--- a/src/share/classes/sun/reflect/generics/tree/ClassTypeSignature.java	Tue Dec 23 14:01:21 2014 -0800
+++ b/src/share/classes/sun/reflect/generics/tree/ClassTypeSignature.java	Wed Jan 07 12:22:36 2015 -0800
@@ -33,7 +33,7 @@
  * AST representing class types.
  */
 public class ClassTypeSignature implements FieldTypeSignature {
-    private List<SimpleClassTypeSignature> path;
+    private final List<SimpleClassTypeSignature> path;
 
 
     private ClassTypeSignature(List<SimpleClassTypeSignature> p) {
--- a/src/share/classes/sun/reflect/generics/tree/DoubleSignature.java	Tue Dec 23 14:01:21 2014 -0800
+++ b/src/share/classes/sun/reflect/generics/tree/DoubleSignature.java	Wed Jan 07 12:22:36 2015 -0800
@@ -29,7 +29,7 @@
 
 /** AST that represents the type double. */
 public class DoubleSignature implements BaseType {
-    private static DoubleSignature singleton = new DoubleSignature();
+    private static final DoubleSignature singleton = new DoubleSignature();
 
     private DoubleSignature(){}
 
--- a/src/share/classes/sun/reflect/generics/tree/FloatSignature.java	Tue Dec 23 14:01:21 2014 -0800
+++ b/src/share/classes/sun/reflect/generics/tree/FloatSignature.java	Wed Jan 07 12:22:36 2015 -0800
@@ -29,7 +29,7 @@
 
 /** AST that represents the type float. */
 public class FloatSignature implements BaseType {
-    private static FloatSignature singleton = new FloatSignature();
+    private static final FloatSignature singleton = new FloatSignature();
 
     private FloatSignature(){}
 
--- a/src/share/classes/sun/reflect/generics/tree/FormalTypeParameter.java	Tue Dec 23 14:01:21 2014 -0800
+++ b/src/share/classes/sun/reflect/generics/tree/FormalTypeParameter.java	Wed Jan 07 12:22:36 2015 -0800
@@ -29,8 +29,8 @@
 
 /** AST that represents a formal type parameter. */
 public class FormalTypeParameter implements TypeTree {
-    private String name;
-    private FieldTypeSignature[] bounds;
+    private final String name;
+    private final FieldTypeSignature[] bounds;
 
     private FormalTypeParameter(String n, FieldTypeSignature[] bs) {
         name = n;
--- a/src/share/classes/sun/reflect/generics/tree/IntSignature.java	Tue Dec 23 14:01:21 2014 -0800
+++ b/src/share/classes/sun/reflect/generics/tree/IntSignature.java	Wed Jan 07 12:22:36 2015 -0800
@@ -29,7 +29,7 @@
 
 /** AST that represents the type int. */
 public class IntSignature implements BaseType {
-    private static IntSignature singleton = new IntSignature();
+    private static final IntSignature singleton = new IntSignature();
 
     private IntSignature(){}
 
--- a/src/share/classes/sun/reflect/generics/tree/LongSignature.java	Tue Dec 23 14:01:21 2014 -0800
+++ b/src/share/classes/sun/reflect/generics/tree/LongSignature.java	Wed Jan 07 12:22:36 2015 -0800
@@ -29,7 +29,7 @@
 
 /** AST that represents the type long. */
 public class LongSignature implements BaseType {
-    private static LongSignature singleton = new LongSignature();
+    private static final LongSignature singleton = new LongSignature();
 
     private LongSignature(){}
 
--- a/src/share/classes/sun/reflect/generics/tree/MethodTypeSignature.java	Tue Dec 23 14:01:21 2014 -0800
+++ b/src/share/classes/sun/reflect/generics/tree/MethodTypeSignature.java	Wed Jan 07 12:22:36 2015 -0800
@@ -28,10 +28,10 @@
 import sun.reflect.generics.visitor.Visitor;
 
 public class MethodTypeSignature implements Signature {
-    private FormalTypeParameter[] formalTypeParams;
-    private TypeSignature[] parameterTypes;
-    private ReturnType returnType;
-    private FieldTypeSignature[] exceptionTypes;
+    private final FormalTypeParameter[] formalTypeParams;
+    private final TypeSignature[] parameterTypes;
+    private final ReturnType returnType;
+    private final FieldTypeSignature[] exceptionTypes;
 
     private MethodTypeSignature(FormalTypeParameter[] ftps,
                                 TypeSignature[] pts,
--- a/src/share/classes/sun/reflect/generics/tree/ShortSignature.java	Tue Dec 23 14:01:21 2014 -0800
+++ b/src/share/classes/sun/reflect/generics/tree/ShortSignature.java	Wed Jan 07 12:22:36 2015 -0800
@@ -29,7 +29,7 @@
 
 /** AST that represents the type short. */
 public class ShortSignature implements BaseType {
-    private static ShortSignature singleton = new ShortSignature();
+    private static final ShortSignature singleton = new ShortSignature();
 
     private ShortSignature(){}
 
--- a/src/share/classes/sun/reflect/generics/tree/SimpleClassTypeSignature.java	Tue Dec 23 14:01:21 2014 -0800
+++ b/src/share/classes/sun/reflect/generics/tree/SimpleClassTypeSignature.java	Wed Jan 07 12:22:36 2015 -0800
@@ -28,9 +28,9 @@
 import sun.reflect.generics.visitor.TypeTreeVisitor;
 
 public class SimpleClassTypeSignature implements FieldTypeSignature {
-    private boolean dollar;
-    private String name;
-    private TypeArgument[] typeArgs;
+    private final boolean dollar;
+    private final String name;
+    private final TypeArgument[] typeArgs;
 
     private SimpleClassTypeSignature(String n, boolean dollar, TypeArgument[] tas) {
         name = n;
--- a/src/share/classes/sun/reflect/generics/tree/TypeVariableSignature.java	Tue Dec 23 14:01:21 2014 -0800
+++ b/src/share/classes/sun/reflect/generics/tree/TypeVariableSignature.java	Wed Jan 07 12:22:36 2015 -0800
@@ -28,7 +28,7 @@
 import sun.reflect.generics.visitor.TypeTreeVisitor;
 
 public class TypeVariableSignature implements FieldTypeSignature {
-    private String identifier;
+    private final String identifier;
 
     private TypeVariableSignature(String id) {identifier = id;}
 
--- a/src/share/classes/sun/reflect/generics/tree/VoidDescriptor.java	Tue Dec 23 14:01:21 2014 -0800
+++ b/src/share/classes/sun/reflect/generics/tree/VoidDescriptor.java	Wed Jan 07 12:22:36 2015 -0800
@@ -30,7 +30,7 @@
 
 /** AST that represents the pseudo-type void. */
 public class VoidDescriptor implements ReturnType {
-    private static VoidDescriptor singleton = new VoidDescriptor();
+    private static final VoidDescriptor singleton = new VoidDescriptor();
 
     private VoidDescriptor(){}
 
--- a/src/share/classes/sun/reflect/misc/MethodUtil.java	Tue Dec 23 14:01:21 2014 -0800
+++ b/src/share/classes/sun/reflect/misc/MethodUtil.java	Wed Jan 07 12:22:36 2015 -0800
@@ -80,9 +80,9 @@
  * Create a trampoline class.
  */
 public final class MethodUtil extends SecureClassLoader {
-    private static String MISC_PKG = "sun.reflect.misc.";
-    private static String TRAMPOLINE = MISC_PKG + "Trampoline";
-    private static Method bounce = getTrampoline();
+    private static final String MISC_PKG = "sun.reflect.misc.";
+    private static final String TRAMPOLINE = MISC_PKG + "Trampoline";
+    private static final Method bounce = getTrampoline();
 
     private MethodUtil() {
         super();
--- a/src/share/classes/sun/security/util/Debug.java	Tue Dec 23 14:01:21 2014 -0800
+++ b/src/share/classes/sun/security/util/Debug.java	Wed Jan 07 12:22:36 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 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
@@ -96,7 +96,15 @@
         System.err.println("codebase=<URL>");
         System.err.println("              only dump output if specified codebase");
         System.err.println("              is being checked");
-
+        System.err.println();
+        System.err.println("The following can be used with provider:");
+        System.err.println();
+        System.err.println("engine=<engines>");
+        System.err.println("              only dump output for the specified list");
+        System.err.println("              of JCA engines. Supported values:");
+        System.err.println("              Cipher, KeyAgreement, KeyGenerator,");
+        System.err.println("              KeyPairGenerator, KeyStore, Mac,");
+        System.err.println("              MessageDigest, SecureRandom, Signature.");
         System.err.println();
         System.err.println("Note: Separate multiple options with a comma");
         System.exit(0);
--- a/src/share/native/java/io/io_util.c	Tue Dec 23 14:01:21 2014 -0800
+++ b/src/share/native/java/io/io_util.c	Wed Jan 07 12:22:36 2015 -0800
@@ -214,13 +214,17 @@
 throwFileNotFoundException(JNIEnv *env, jstring path)
 {
     char buf[256];
-    jint n;
+    size_t n;
     jobject x;
     jstring why = NULL;
 
-    n = JVM_GetLastErrorString(buf, sizeof(buf));
+    n = getLastErrorString(buf, sizeof(buf));
     if (n > 0) {
+#ifdef WIN32
+        why = (*env)->NewStringUTF(env, buf);
+#else
         why = JNU_NewStringPlatform(env, buf);
+#endif
     }
     x = JNU_NewObjectByName(env,
                             "java/io/FileNotFoundException",
--- a/src/share/native/java/io/io_util.h	Tue Dec 23 14:01:21 2014 -0800
+++ b/src/share/native/java/io/io_util.h	Wed Jan 07 12:22:36 2015 -0800
@@ -54,7 +54,7 @@
                 jint len, jboolean append, jfieldID fid);
 void fileOpen(JNIEnv *env, jobject this, jstring path, jfieldID fid, int flags);
 void throwFileNotFoundException(JNIEnv *env, jstring path);
-
+size_t getLastErrorString(char *buf, size_t len);
 
 /*
  * Macros for managing platform strings.  The typical usage pattern is:
--- a/src/share/native/sun/security/jgss/wrapper/GSSLibStub.c	Tue Dec 23 14:01:21 2014 -0800
+++ b/src/share/native/sun/security/jgss/wrapper/GSSLibStub.c	Wed Jan 07 12:22:36 2015 -0800
@@ -26,6 +26,7 @@
 #include "sun_security_jgss_wrapper_GSSLibStub.h"
 #include "NativeUtil.h"
 #include "NativeFunc.h"
+#include "jlong.h"
 
 /* Constants for indicating what type of info is needed for inqueries */
 const int TYPE_CRED_NAME = 10;
@@ -75,14 +76,14 @@
                                                      jclass jcls,
                                                      jbyteArray jbytes) {
   gss_OID cOid;
-  int i, len;
+  unsigned int i, len;
   jbyte* bytes;
   jthrowable gssEx;
   jboolean found;
 
   if (jbytes != NULL) {
     found = JNI_FALSE;
-    len = (*env)->GetArrayLength(env, jbytes) - 2;
+    len = (unsigned int)((*env)->GetArrayLength(env, jbytes) - 2);
     bytes = (*env)->GetByteArrayElements(env, jbytes, NULL);
     if (bytes != NULL) {
       for (i = 0; i < ftab->mechs->count; i++) {
@@ -98,9 +99,9 @@
     }
     if (found != JNI_TRUE) {
       checkStatus(env, NULL, GSS_S_BAD_MECH, 0, "[GSSLibStub_getMechPtr]");
-      return NULL;
-    } else return cOid;
-  } else return GSS_C_NO_OID;
+      return ptr_to_jlong(NULL);
+    } else return ptr_to_jlong(cOid);
+  } else return ptr_to_jlong(GSS_C_NO_OID);
 }
 
 
@@ -244,7 +245,7 @@
 
   if (ftab->inquireNamesForMech != NULL) {
 
-  mech = (gss_OID) (*env)->GetLongField(env, jobj, FID_GSSLibStub_pMech);
+  mech = (gss_OID)jlong_to_ptr((*env)->GetLongField(env, jobj, FID_GSSLibStub_pMech));
   nameTypes = GSS_C_NO_OID_SET;
 
   /* gss_inquire_names_for_mech(...) => N/A */
@@ -273,7 +274,7 @@
   OM_uint32 minor, major;
   gss_name_t nameHdl;
 
-  nameHdl = (gss_name_t) pName;
+  nameHdl = (gss_name_t) jlong_to_ptr(pName);
 
   sprintf(debugBuf, "[GSSLibStub_releaseName] %ld", (long) pName);
   debug(env, debugBuf);
@@ -319,7 +320,7 @@
   resetGSSBuffer(env, jnameVal, &nameVal);
 
   checkStatus(env, jobj, major, minor, "[GSSLibStub_importName]");
-  return (jlong) nameHdl;
+  return ptr_to_jlong(nameHdl);
 }
 
 
@@ -339,8 +340,8 @@
   int isEqual;
 
   isEqual = 0;
-  nameHdl1 = (gss_name_t) pName1;
-  nameHdl2 = (gss_name_t) pName2;
+  nameHdl1 = (gss_name_t) jlong_to_ptr(pName1);
+  nameHdl2 = (gss_name_t) jlong_to_ptr(pName2);
 
   sprintf(debugBuf, "[GSSLibStub_compareName] %ld %ld", (long) pName1,
     (long) pName2);
@@ -370,12 +371,12 @@
   gss_name_t nameHdl, mnNameHdl;
   gss_OID mech;
 
-  nameHdl = (gss_name_t) pName;
+  nameHdl = (gss_name_t) jlong_to_ptr(pName);
   sprintf(debugBuf, "[GSSLibStub_canonicalizeName] %ld", (long) pName);
   debug(env, debugBuf);
 
   if (nameHdl != GSS_C_NO_NAME) {
-    mech = (gss_OID) (*env)->GetLongField(env, jobj, FID_GSSLibStub_pMech);
+    mech = (gss_OID) jlong_to_ptr((*env)->GetLongField(env, jobj, FID_GSSLibStub_pMech));
     mnNameHdl = GSS_C_NO_NAME;
 
     /* gss_canonicalize_name(...) may return GSS_S_BAD_NAMETYPE,
@@ -391,7 +392,7 @@
     checkStatus(env, jobj, major, minor, "[GSSLibStub_canonicalizeName]");
   } else mnNameHdl = GSS_C_NO_NAME;
 
-  return (jlong) mnNameHdl;
+  return ptr_to_jlong(mnNameHdl);
 }
 
 /*
@@ -408,7 +409,7 @@
   gss_buffer_desc outBuf;
   jbyteArray jresult;
 
-  nameHdl = (gss_name_t) pName;
+  nameHdl = (gss_name_t) jlong_to_ptr(pName);
   sprintf(debugBuf, "[GSSLibStub_exportName] %ld", (long) pName);
   debug(env, debugBuf);
 
@@ -420,16 +421,16 @@
   if (major == GSS_S_NAME_NOT_MN) {
     debug(env, "[GSSLibStub_exportName] canonicalize and re-try");
 
-    mNameHdl = (gss_name_t)
+    mNameHdl = (gss_name_t)jlong_to_ptr(
         Java_sun_security_jgss_wrapper_GSSLibStub_canonicalizeName
-                                        (env, jobj, pName);
+                                        (env, jobj, pName));
     /* return immediately if an exception has occurred */
     if ((*env)->ExceptionCheck(env)) {
       return NULL;
     }
     major = (*ftab->exportName)(&minor, mNameHdl, &outBuf);
     Java_sun_security_jgss_wrapper_GSSLibStub_releaseName
-                                        (env, jobj, (jlong) mNameHdl);
+                                        (env, jobj, ptr_to_jlong(mNameHdl));
     /* return immediately if an exception has occurred */
     if ((*env)->ExceptionCheck(env)) {
       return NULL;
@@ -460,7 +461,7 @@
   jobject jtype;
   jobjectArray jresult;
 
-  nameHdl = (gss_name_t) pName;
+  nameHdl = (gss_name_t) jlong_to_ptr(pName);
   sprintf(debugBuf, "[GSSLibStub_displayName] %ld", (long) pName);
   debug(env, debugBuf);
 
@@ -512,10 +513,10 @@
   debug(env, "[GSSLibStub_acquireCred]");
 
 
-  mech = (gss_OID) (*env)->GetLongField(env, jobj, FID_GSSLibStub_pMech);
+  mech = (gss_OID) jlong_to_ptr((*env)->GetLongField(env, jobj, FID_GSSLibStub_pMech));
   mechs = newGSSOIDSet(env, mech);
   credUsage = (gss_cred_usage_t) usage;
-  nameHdl = (gss_name_t) pName;
+  nameHdl = (gss_name_t) jlong_to_ptr(pName);
   credHdl = GSS_C_NO_CREDENTIAL;
 
   sprintf(debugBuf, "[GSSLibStub_acquireCred] pName=%ld, usage=%d",
@@ -534,7 +535,7 @@
   debug(env, debugBuf);
 
   checkStatus(env, jobj, major, minor, "[GSSLibStub_acquireCred]");
-  return (jlong) credHdl;
+  return ptr_to_jlong(credHdl);
 }
 
 /*
@@ -550,9 +551,9 @@
   OM_uint32 minor, major;
   gss_cred_id_t credHdl;
 
-  credHdl = (gss_cred_id_t) pCred;
+  credHdl = (gss_cred_id_t) jlong_to_ptr(pCred);
 
-  sprintf(debugBuf, "[GSSLibStub_releaseCred] %ld", pCred);
+  sprintf(debugBuf, "[GSSLibStub_releaseCred] %ld", (long int)pCred);
   debug(env, debugBuf);
 
   if (credHdl != GSS_C_NO_CREDENTIAL) {
@@ -562,7 +563,7 @@
 
     checkStatus(env, jobj, major, minor, "[GSSLibStub_releaseCred]");
   }
-  return (jlong) credHdl;
+  return ptr_to_jlong(credHdl);
 }
 
 /*
@@ -570,7 +571,7 @@
  */
 void inquireCred(JNIEnv *env, jobject jobj, gss_cred_id_t pCred,
                  jint type, void *result) {
-  OM_uint32 minor, major;
+  OM_uint32 minor, major=GSS_C_QOP_DEFAULT;
   OM_uint32 routineErr;
   gss_cred_id_t credHdl;
 
@@ -617,9 +618,9 @@
   gss_name_t nameHdl;
   gss_cred_id_t credHdl;
 
-  credHdl = (gss_cred_id_t) pCred;
+  credHdl = (gss_cred_id_t) jlong_to_ptr(pCred);
 
-  sprintf(debugBuf, "[GSSLibStub_getCredName] %ld", pCred);
+  sprintf(debugBuf, "[GSSLibStub_getCredName] %ld", (long int)pCred);
   debug(env, debugBuf);
 
   nameHdl = GSS_C_NO_NAME;
@@ -633,7 +634,7 @@
   sprintf(debugBuf, "[GSSLibStub_getCredName] pName=%ld", (long) nameHdl);
   debug(env, debugBuf);
 
-  return (jlong) nameHdl;
+  return ptr_to_jlong(nameHdl);
 }
 
 /*
@@ -649,9 +650,9 @@
   gss_cred_id_t credHdl;
   OM_uint32 lifetime;
 
-  credHdl = (gss_cred_id_t) pCred;
+  credHdl = (gss_cred_id_t) jlong_to_ptr(pCred);
 
-  sprintf(debugBuf, "[GSSLibStub_getCredTime] %ld", pCred);
+  sprintf(debugBuf, "[GSSLibStub_getCredTime] %ld", (long int)pCred);
   debug(env, debugBuf);
 
   lifetime = 0;
@@ -677,9 +678,9 @@
   gss_cred_usage_t usage;
   gss_cred_id_t credHdl;
 
-  credHdl = (gss_cred_id_t) pCred;
+  credHdl = (gss_cred_id_t) jlong_to_ptr(pCred);
 
-  sprintf(debugBuf, "[GSSLibStub_getCredUsage] %ld", pCred);
+  sprintf(debugBuf, "[GSSLibStub_getCredUsage] %ld", (long int)pCred);
   debug(env, debugBuf);
 
   inquireCred(env, jobj, credHdl, TYPE_CRED_USAGE, &usage);
@@ -738,13 +739,13 @@
     return NULL;
   }
 
-  mech2 = (gss_OID) (*env)->GetLongField(env, jobj, FID_GSSLibStub_pMech);
+  mech2 = (gss_OID) jlong_to_ptr((*env)->GetLongField(env, jobj, FID_GSSLibStub_pMech));
 
   if (sameMech(env, mech, mech2) == JNI_TRUE) {
     /* mech match - return the context object */
     return (*env)->NewObject(env, CLS_NativeGSSContext,
                                  MID_NativeGSSContext_ctor,
-                                 (jlong) contextHdl, jobj);
+                                 ptr_to_jlong(contextHdl), jobj);
   } else {
     /* mech mismatch - clean up then return null */
     major = (*ftab->deleteSecContext)(&minor, &contextHdl, GSS_C_NO_BUFFER);
@@ -784,11 +785,11 @@
 */
   debug(env, "[GSSLibStub_initContext]");
 
-  credHdl = (gss_cred_id_t) pCred;
-  contextHdl = (gss_ctx_id_t)
-    (*env)->GetLongField(env, jcontextSpi, FID_NativeGSSContext_pContext);
-  targetName = (gss_name_t) pName;
-  mech = (gss_OID) (*env)->GetLongField(env, jobj, FID_GSSLibStub_pMech);
+  credHdl = (gss_cred_id_t) jlong_to_ptr(pCred);
+  contextHdl = (gss_ctx_id_t) jlong_to_ptr(
+    (*env)->GetLongField(env, jcontextSpi, FID_NativeGSSContext_pContext));
+  targetName = (gss_name_t) jlong_to_ptr(pName);
+  mech = (gss_OID) jlong_to_ptr((*env)->GetLongField(env, jobj, FID_GSSLibStub_pMech));
   flags = (OM_uint32) (*env)->GetIntField(env, jcontextSpi,
                                           FID_NativeGSSContext_flags);
   time = getGSSTime((*env)->GetIntField(env, jcontextSpi,
@@ -821,7 +822,7 @@
   if (GSS_ERROR(major) == GSS_S_COMPLETE) {
     /* update member values if needed */
     (*env)->SetLongField(env, jcontextSpi, FID_NativeGSSContext_pContext,
-                        (jlong) contextHdl);
+                        ptr_to_jlong(contextHdl));
     (*env)->SetIntField(env, jcontextSpi, FID_NativeGSSContext_flags, aFlags);
     sprintf(debugBuf, "[GSSLibStub_initContext] set flags=0x%x", aFlags);
     debug(env, debugBuf);
@@ -879,7 +880,7 @@
   OM_uint32 aFlags;
   OM_uint32 aTime;
   gss_cred_id_t delCred;
-  jobject jsrcName;
+  jobject jsrcName=GSS_C_NO_NAME;
   jobject jdelCred;
   jobject jMech;
   jbyteArray jresult;
@@ -889,9 +890,9 @@
 
   debug(env, "[GSSLibStub_acceptContext]");
 
-  contextHdl = (gss_ctx_id_t)
-    (*env)->GetLongField(env, jcontextSpi, FID_NativeGSSContext_pContext);
-  credHdl = (gss_cred_id_t) pCred;
+  contextHdl = (gss_ctx_id_t)jlong_to_ptr(
+    (*env)->GetLongField(env, jcontextSpi, FID_NativeGSSContext_pContext));
+  credHdl = (gss_cred_id_t) jlong_to_ptr(pCred);
   initGSSBuffer(env, jinToken, &inToken);
   cb = getGSSCB(env, jcb);
   srcName = GSS_C_NO_NAME;
@@ -922,7 +923,7 @@
   if (GSS_ERROR(major) == GSS_S_COMPLETE) {
     /* update member values if needed */
     (*env)->SetLongField(env, jcontextSpi, FID_NativeGSSContext_pContext,
-                        (jlong) contextHdl);
+                        ptr_to_jlong(contextHdl));
     sprintf(debugBuf, "[GSSLibStub_acceptContext] set pContext=%ld",
             (long)contextHdl);
     debug(env, debugBuf);
@@ -940,7 +941,7 @@
                               NULL, NULL);
       jtargetName = (*env)->NewObject(env, CLS_GSSNameElement,
                                 MID_GSSNameElement_ctor,
-                                (jlong) targetName, jobj);
+                                ptr_to_jlong(targetName), jobj);
 
       /* return immediately if an exception has occurred */
       if ((*env)->ExceptionCheck(env)) {
@@ -955,7 +956,7 @@
     if (srcName != GSS_C_NO_NAME) {
       jsrcName = (*env)->NewObject(env, CLS_GSSNameElement,
                                    MID_GSSNameElement_ctor,
-                                   (jlong) srcName, jobj);
+                                   ptr_to_jlong(srcName), jobj);
       /* return immediately if an exception has occurred */
       if ((*env)->ExceptionCheck(env)) {
         return NULL;
@@ -981,7 +982,7 @@
       if (delCred != GSS_C_NO_CREDENTIAL) {
         jdelCred = (*env)->NewObject(env, CLS_GSSCredElement,
                                      MID_GSSCredElement_ctor,
-                                     (jlong) delCred, jsrcName, jMech);
+                                     ptr_to_jlong(delCred), jsrcName, jMech);
         /* return immediately if an exception has occurred */
         if ((*env)->ExceptionCheck(env)) {
           return NULL;
@@ -1031,7 +1032,7 @@
   jlong result[6];
   jlongArray jresult;
 
-  contextHdl = (gss_ctx_id_t) pContext;
+  contextHdl = (gss_ctx_id_t) jlong_to_ptr(pContext);
 
   sprintf(debugBuf, "[GSSLibStub_inquireContext] %ld", (long)contextHdl);
   debug(env, debugBuf);
@@ -1051,8 +1052,8 @@
                                                 (long)targetName);
   debug(env, debugBuf);
 
-  result[0] = (jlong) srcName;
-  result[1] = (jlong) targetName;
+  result[0] = ptr_to_jlong(srcName);
+  result[1] = ptr_to_jlong(targetName);
   result[2] = (jlong) isInitiator;
   result[3] = (jlong) isEstablished;
   result[4] = (jlong) flags;
@@ -1081,9 +1082,9 @@
   gss_OID mech;
   gss_ctx_id_t contextHdl;
 
-  contextHdl = (gss_ctx_id_t) pContext;
+  contextHdl = (gss_ctx_id_t) jlong_to_ptr(pContext);
 
-  sprintf(debugBuf, "[GSSLibStub_getContextMech] %ld", pContext);
+  sprintf(debugBuf, "[GSSLibStub_getContextMech] %ld", (long int)pContext);
   debug(env, debugBuf);
 
   major = (*ftab->inquireContext)(&minor, contextHdl, NULL, NULL,
@@ -1111,7 +1112,7 @@
   gss_name_t nameHdl;
   gss_ctx_id_t contextHdl;
 
-  contextHdl = (gss_ctx_id_t) pContext;
+  contextHdl = (gss_ctx_id_t) jlong_to_ptr(pContext);
 
   sprintf(debugBuf, "[GSSLibStub_getContextName] %ld, isSrc=%d",
           (long)contextHdl, isSrc);
@@ -1129,13 +1130,13 @@
   checkStatus(env, jobj, major, minor, "[GSSLibStub_inquireContextAll]");
   /* return immediately if an exception has occurred */
   if ((*env)->ExceptionCheck(env)) {
-    return (long)NULL;
+    return ptr_to_jlong(NULL);
   }
 
   sprintf(debugBuf, "[GSSLibStub_getContextName] pName=%ld", (long) nameHdl);
   debug(env, debugBuf);
 
-  return (jlong) nameHdl;
+  return ptr_to_jlong(nameHdl);
 }
 
 /*
@@ -1151,7 +1152,7 @@
   gss_ctx_id_t contextHdl;
   OM_uint32 time;
 
-  contextHdl = (gss_ctx_id_t) pContext;
+  contextHdl = (gss_ctx_id_t) jlong_to_ptr(pContext);
   sprintf(debugBuf, "[GSSLibStub_getContextTime] %ld", (long)contextHdl);
   debug(env, debugBuf);
 
@@ -1180,17 +1181,17 @@
   OM_uint32 minor, major;
   gss_ctx_id_t contextHdl;
 
-  contextHdl = (gss_ctx_id_t) pContext;
+  contextHdl = (gss_ctx_id_t) jlong_to_ptr(pContext);
   sprintf(debugBuf, "[GSSLibStub_deleteContext] %ld", (long)contextHdl);
   debug(env, debugBuf);
 
-  if (contextHdl == GSS_C_NO_CONTEXT) return GSS_C_NO_CONTEXT;
+  if (contextHdl == GSS_C_NO_CONTEXT) return ptr_to_jlong(GSS_C_NO_CONTEXT);
 
   /* gss_delete_sec_context(...) => GSS_S_NO_CONTEXT(!) */
   major = (*ftab->deleteSecContext)(&minor, &contextHdl, GSS_C_NO_BUFFER);
 
   checkStatus(env, jobj, major, minor, "[GSSLibStub_deleteContext]");
-  return (jlong) contextHdl;
+  return (jlong) ptr_to_jlong(contextHdl);
 }
 
 /*
@@ -1211,7 +1212,7 @@
   OM_uint32 outSize, maxInSize;
   gss_qop_t qop;
 
-  contextHdl = (gss_ctx_id_t) pContext;
+  contextHdl = (gss_ctx_id_t) jlong_to_ptr(pContext);
   sprintf(debugBuf, "[GSSLibStub_wrapSizeLimit] %ld", (long)contextHdl);
   debug(env, debugBuf);
 
@@ -1244,7 +1245,7 @@
   gss_buffer_desc interProcToken;
   jbyteArray jresult;
 
-  contextHdl = (gss_ctx_id_t) pContext;
+  contextHdl = (gss_ctx_id_t) jlong_to_ptr(pContext);
   sprintf(debugBuf, "[GSSLibStub_exportContext] %ld", (long)contextHdl);
   debug(env, debugBuf);
 
@@ -1281,7 +1282,7 @@
   gss_buffer_desc msgToken;
   jbyteArray jresult;
 
-  contextHdl = (gss_ctx_id_t) pContext;
+  contextHdl = (gss_ctx_id_t) jlong_to_ptr(pContext);
   sprintf(debugBuf, "[GSSLibStub_getMic] %ld", (long)contextHdl);
   debug(env, debugBuf);
 
@@ -1290,7 +1291,7 @@
     checkStatus(env, jobj, GSS_S_CONTEXT_EXPIRED, 0, "[GSSLibStub_getMic]");
     return NULL;
   }
-  contextHdl = (gss_ctx_id_t) pContext;
+  contextHdl = (gss_ctx_id_t) jlong_to_ptr(pContext);
   qop = (gss_qop_t) jqop;
   initGSSBuffer(env, jmsg, &msg);
 
@@ -1326,7 +1327,7 @@
   gss_buffer_desc msgToken;
   gss_qop_t qop;
 
-  contextHdl = (gss_ctx_id_t) pContext;
+  contextHdl = (gss_ctx_id_t) jlong_to_ptr(pContext);
   sprintf(debugBuf, "[GSSLibStub_verifyMic] %ld", (long)contextHdl);
   debug(env, debugBuf);
 
@@ -1376,7 +1377,7 @@
   gss_ctx_id_t contextHdl;
   jbyteArray jresult;
 
-  contextHdl = (gss_ctx_id_t) pContext;
+  contextHdl = (gss_ctx_id_t) jlong_to_ptr(pContext);
   sprintf(debugBuf, "[GSSLibStub_wrap] %ld", (long)contextHdl);
   debug(env, debugBuf);
 
@@ -1427,7 +1428,7 @@
   gss_qop_t qop;
   jbyteArray jresult;
 
-  contextHdl = (gss_ctx_id_t) pContext;
+  contextHdl = (gss_ctx_id_t) jlong_to_ptr(pContext);
   sprintf(debugBuf, "[GSSLibStub_unwrap] %ld", (long)contextHdl);
   debug(env, debugBuf);
 
--- a/src/share/native/sun/security/jgss/wrapper/NativeUtil.c	Tue Dec 23 14:01:21 2014 -0800
+++ b/src/share/native/sun/security/jgss/wrapper/NativeUtil.c	Wed Jan 07 12:22:36 2015 -0800
@@ -25,6 +25,7 @@
 
 #include "NativeUtil.h"
 #include "NativeFunc.h"
+#include "jlong.h"
 
 const int JAVA_DUPLICATE_TOKEN_CODE = 19; /* DUPLICATE_TOKEN */
 const int JAVA_OLD_TOKEN_CODE = 20; /* OLD_TOKEN */
@@ -412,7 +413,7 @@
   OM_uint32 result;
 
   /* special handle values equal to JAVA_MAX */
-  if (jtime == JAVA_MAX) {
+  if (jtime == (jint)JAVA_MAX) {
     result = GSS_C_INDEFINITE;
   } else {
     result = jtime;
@@ -482,7 +483,7 @@
 
   messageContext = 0;
   if (jstub != NULL) {
-    mech = (gss_OID) (*env)->GetLongField(env, jstub, FID_GSSLibStub_pMech);
+    mech = (gss_OID) jlong_to_ptr((*env)->GetLongField(env, jstub, FID_GSSLibStub_pMech));
   } else {
     mech = GSS_C_NO_OID;
   }
--- a/src/share/native/sun/security/pkcs11/wrapper/p11_convert.c	Tue Dec 23 14:01:21 2014 -0800
+++ b/src/share/native/sun/security/pkcs11/wrapper/p11_convert.c	Wed Jan 07 12:22:36 2015 -0800
@@ -422,6 +422,7 @@
     jfieldID jFieldID;
     jlong jType;
     jobject jPValue;
+    memset(&ckAttribute, 0, sizeof(CK_ATTRIBUTE));
 
     // TBD: what if jAttribute == NULL?!
 
@@ -1577,6 +1578,7 @@
     CK_RSA_PKCS_PSS_PARAMS ckParam;
     jfieldID fieldID;
     jlong jHashAlg, jMgf, jSLen;
+    memset(&ckParam, 0, sizeof(CK_RSA_PKCS_PSS_PARAMS));
 
     /* get hashAlg */
     jRsaPkcsPssParamsClass = (*env)->FindClass(env, CLASS_RSA_PKCS_PSS_PARAMS);
@@ -1617,6 +1619,7 @@
     jfieldID fieldID;
     jlong jLong;
     jobject jSharedData, jPublicData;
+    memset(&ckParam, 0, sizeof(CK_ECDH1_DERIVE_PARAMS));
 
     /* get kdf */
     jEcdh1DeriveParamsClass = (*env)->FindClass(env, CLASS_ECDH1_DERIVE_PARAMS);
@@ -1663,6 +1666,7 @@
     jfieldID fieldID;
     jlong jKdf, jPrivateDataLen, jPrivateData;
     jobject jSharedData, jPublicData, jPublicData2;
+    memset(&ckParam, 0, sizeof(CK_ECDH2_DERIVE_PARAMS));
 
     /* get kdf */
     jEcdh2DeriveParamsClass = (*env)->FindClass(env, CLASS_ECDH2_DERIVE_PARAMS);
--- a/src/share/native/sun/security/pkcs11/wrapper/p11_crypt.c	Tue Dec 23 14:01:21 2014 -0800
+++ b/src/share/native/sun/security/pkcs11/wrapper/p11_crypt.c	Wed Jan 07 12:22:36 2015 -0800
@@ -180,14 +180,14 @@
     ckSessionHandle = jLongToCKULong(jSessionHandle);
 
     if (directIn != 0) {
-      inBufP = (CK_BYTE_PTR) directIn;
+      inBufP = (CK_BYTE_PTR) jlong_to_ptr(directIn);
     } else {
       inBufP = (*env)->GetPrimitiveArrayCritical(env, jIn, NULL);
       if (inBufP == NULL) { return 0; }
     }
 
     if (directOut != 0) {
-      outBufP = (CK_BYTE_PTR) directOut;
+      outBufP = (CK_BYTE_PTR) jlong_to_ptr(directOut);
     } else {
       outBufP = (*env)->GetPrimitiveArrayCritical(env, jOut, NULL);
       if (outBufP == NULL) {
@@ -249,7 +249,7 @@
     ckSessionHandle = jLongToCKULong(jSessionHandle);
 
     if (directOut != 0) {
-      outBufP = (CK_BYTE_PTR) directOut;
+      outBufP = (CK_BYTE_PTR) jlong_to_ptr(directOut);
     } else {
       outBufP = (*env)->GetPrimitiveArrayCritical(env, jOut, NULL);
       if (outBufP == NULL) { return 0; }
@@ -401,14 +401,14 @@
     ckSessionHandle = jLongToCKULong(jSessionHandle);
 
     if (directIn != 0) {
-      inBufP = (CK_BYTE_PTR) directIn;
+      inBufP = (CK_BYTE_PTR) jlong_to_ptr(directIn);
     } else {
       inBufP = (*env)->GetPrimitiveArrayCritical(env, jIn, NULL);
       if (inBufP == NULL) { return 0; }
     }
 
     if (directOut != 0) {
-      outBufP = (CK_BYTE_PTR) directOut;
+      outBufP = (CK_BYTE_PTR) jlong_to_ptr(directOut);
     } else {
       outBufP = (*env)->GetPrimitiveArrayCritical(env, jOut, NULL);
       if (outBufP == NULL) {
@@ -465,7 +465,7 @@
     ckSessionHandle = jLongToCKULong(jSessionHandle);
 
     if (directOut != 0) {
-      outBufP = (CK_BYTE_PTR) directOut;
+      outBufP = (CK_BYTE_PTR) jlong_to_ptr(directOut);
     } else {
       outBufP = (*env)->GetPrimitiveArrayCritical(env, jOut, NULL);
       if (outBufP == NULL) { return 0; }
--- a/src/share/native/sun/security/pkcs11/wrapper/p11_digest.c	Tue Dec 23 14:01:21 2014 -0800
+++ b/src/share/native/sun/security/pkcs11/wrapper/p11_digest.c	Wed Jan 07 12:22:36 2015 -0800
@@ -51,6 +51,7 @@
 #include <stdlib.h>
 #include <string.h>
 #include <assert.h>
+#include "jlong.h"
 
 #include "sun_security_pkcs11_wrapper_PKCS11.h"
 
@@ -178,7 +179,7 @@
     ckSessionHandle = jLongToCKULong(jSessionHandle);
 
     if (directIn != 0) {
-        rv = (*ckpFunctions->C_DigestUpdate)(ckSessionHandle, (CK_BYTE_PTR)directIn, jInLen);
+        rv = (*ckpFunctions->C_DigestUpdate)(ckSessionHandle, (CK_BYTE_PTR)jlong_to_ptr(directIn), jInLen);
         ckAssertReturnValueOK(env, rv);
         return;
     }
--- a/src/share/native/sun/security/pkcs11/wrapper/p11_general.c	Tue Dec 23 14:01:21 2014 -0800
+++ b/src/share/native/sun/security/pkcs11/wrapper/p11_general.c	Wed Jan 07 12:22:36 2015 -0800
@@ -250,10 +250,12 @@
 (JNIEnv *env, jobject obj)
 {
     CK_INFO ckLibInfo;
-    jobject jInfoObject;
+    jobject jInfoObject=NULL;
     CK_RV rv;
+    CK_FUNCTION_LIST_PTR ckpFunctions;
+    memset(&ckLibInfo, 0, sizeof(CK_INFO));
 
-    CK_FUNCTION_LIST_PTR ckpFunctions = getFunctionList(env, obj);
+    ckpFunctions = getFunctionList(env, obj);
     if (ckpFunctions == NULL) { return NULL; }
 
     rv = (*ckpFunctions->C_GetInfo)(&ckLibInfo);
@@ -381,7 +383,7 @@
 {
     CK_SLOT_ID ckSlotID;
     CK_SLOT_INFO ckSlotInfo;
-    jobject jSlotInfoObject;
+    jobject jSlotInfoObject=NULL;
     CK_RV rv;
 
     CK_FUNCTION_LIST_PTR ckpFunctions = getFunctionList(env, obj);
@@ -393,7 +395,7 @@
     if (ckAssertReturnValueOK(env, rv) == CK_ASSERT_OK) {
         jSlotInfoObject = ckSlotInfoPtrToJSlotInfo(env, &ckSlotInfo);
     }
-    return jSlotInfoObject ;
+    return jSlotInfoObject;
 }
 
 /*
--- a/src/share/native/sun/security/pkcs11/wrapper/p11_sessmgmt.c	Tue Dec 23 14:01:21 2014 -0800
+++ b/src/share/native/sun/security/pkcs11/wrapper/p11_sessmgmt.c	Wed Jan 07 12:22:36 2015 -0800
@@ -256,7 +256,7 @@
 {
     CK_SESSION_HANDLE ckSessionHandle;
     CK_SESSION_INFO ckSessionInfo;
-    jobject jSessionInfo;
+    jobject jSessionInfo=NULL;
     CK_RV rv;
 
     CK_FUNCTION_LIST_PTR ckpFunctions = getFunctionList(env, obj);
--- a/src/share/native/sun/security/pkcs11/wrapper/p11_sign.c	Tue Dec 23 14:01:21 2014 -0800
+++ b/src/share/native/sun/security/pkcs11/wrapper/p11_sign.c	Wed Jan 07 12:22:36 2015 -0800
@@ -51,6 +51,7 @@
 #include <stdlib.h>
 #include <string.h>
 #include <assert.h>
+#include "jlong.h"
 
 #include "sun_security_pkcs11_wrapper_PKCS11.h"
 
@@ -198,7 +199,7 @@
     ckSessionHandle = jLongToCKULong(jSessionHandle);
 
     if (directIn != 0) {
-        rv = (*ckpFunctions->C_SignUpdate)(ckSessionHandle, (CK_BYTE_PTR)directIn, jInLen);
+        rv = (*ckpFunctions->C_SignUpdate)(ckSessionHandle, (CK_BYTE_PTR) jlong_to_ptr(directIn), jInLen);
         ckAssertReturnValueOK(env, rv);
         return;
     }
@@ -262,7 +263,7 @@
 
     ckSessionHandle = jLongToCKULong(jSessionHandle);
 
-    if ((jExpectedLength > 0) && (jExpectedLength < ckSignatureLength)) {
+    if ((jExpectedLength > 0) && ((CK_ULONG)jExpectedLength < ckSignatureLength)) {
         ckSignatureLength = jExpectedLength;
     }
 
@@ -496,7 +497,7 @@
     ckSessionHandle = jLongToCKULong(jSessionHandle);
 
     if (directIn != 0) {
-        rv = (*ckpFunctions->C_VerifyUpdate)(ckSessionHandle, (CK_BYTE_PTR)directIn, jInLen);
+        rv = (*ckpFunctions->C_VerifyUpdate)(ckSessionHandle, (CK_BYTE_PTR)jlong_to_ptr(directIn), jInLen);
         ckAssertReturnValueOK(env, rv);
         return;
     }
--- a/src/share/native/sun/security/pkcs11/wrapper/p11_util.c	Tue Dec 23 14:01:21 2014 -0800
+++ b/src/share/native/sun/security/pkcs11/wrapper/p11_util.c	Wed Jan 07 12:22:36 2015 -0800
@@ -106,7 +106,7 @@
     if (moduleData == NULL) {
         return ;
     }
-    (*env)->SetLongField(env, pkcs11Implementation, pNativeDataID, (jlong)moduleData);
+    (*env)->SetLongField(env, pkcs11Implementation, pNativeDataID, ptr_to_jlong(moduleData));
 }
 
 
@@ -120,7 +120,7 @@
         return NULL;
     }
     jData = (*env)->GetLongField(env, pkcs11Implementation, pNativeDataID);
-    return (ModuleData*)jData;
+    return (ModuleData*)jlong_to_ptr(jData);
 }
 
 CK_FUNCTION_LIST_PTR getFunctionList(JNIEnv *env, jobject pkcs11Implementation) {
--- a/src/solaris/classes/java/lang/UNIXProcess.java.bsd	Tue Dec 23 14:01:21 2014 -0800
+++ b/src/solaris/classes/java/lang/UNIXProcess.java.bsd	Wed Jan 07 12:22:36 2015 -0800
@@ -35,6 +35,7 @@
 import java.io.InputStream;
 import java.io.OutputStream;
 import java.util.Arrays;
+import java.util.Locale;
 import java.util.concurrent.Executors;
 import java.util.concurrent.Executor;
 import java.util.concurrent.ThreadFactory;
@@ -99,7 +100,7 @@
                     "jdk.lang.Process.launchMechanism", "posix_spawn");
 
                 try {
-                    return LaunchMechanism.valueOf(s.toUpperCase());
+                    return LaunchMechanism.valueOf(s.toUpperCase(Locale.ENGLISH));
                 } catch (IllegalArgumentException e) {
                     throw new Error(s + " is not a supported " +
                         "process launch mechanism on this platform.");
--- a/src/solaris/classes/java/lang/UNIXProcess.java.linux	Tue Dec 23 14:01:21 2014 -0800
+++ b/src/solaris/classes/java/lang/UNIXProcess.java.linux	Wed Jan 07 12:22:36 2015 -0800
@@ -35,6 +35,7 @@
 import java.io.InputStream;
 import java.io.OutputStream;
 import java.util.Arrays;
+import java.util.Locale;
 import java.util.concurrent.Executors;
 import java.util.concurrent.Executor;
 import java.util.concurrent.ThreadFactory;
@@ -100,7 +101,7 @@
                     "jdk.lang.Process.launchMechanism", "vfork");
 
                 try {
-                    return LaunchMechanism.valueOf(s.toUpperCase());
+                    return LaunchMechanism.valueOf(s.toUpperCase(Locale.ENGLISH));
                 } catch (IllegalArgumentException e) {
                     throw new Error(s + " is not a supported " +
                         "process launch mechanism on this platform.");
--- a/src/solaris/classes/java/lang/UNIXProcess.java.solaris	Tue Dec 23 14:01:21 2014 -0800
+++ b/src/solaris/classes/java/lang/UNIXProcess.java.solaris	Wed Jan 07 12:22:36 2015 -0800
@@ -26,6 +26,7 @@
 package java.lang;
 
 import java.io.*;
+import java.util.Locale;
 import java.security.AccessController;
 import java.security.PrivilegedAction;
 
@@ -89,7 +90,7 @@
                     "jdk.lang.Process.launchMechanism", "fork");
 
                 try {
-                    return LaunchMechanism.valueOf(s.toUpperCase());
+                    return LaunchMechanism.valueOf(s.toUpperCase(Locale.ENGLISH));
                 } catch (IllegalArgumentException e) {
                     throw new Error(s + " is not a supported " +
                         "process launch mechanism on this platform.");
--- a/src/solaris/classes/sun/awt/X11/XRootWindow.java	Tue Dec 23 14:01:21 2014 -0800
+++ b/src/solaris/classes/sun/awt/X11/XRootWindow.java	Wed Jan 07 12:22:36 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2005, 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
@@ -46,7 +46,8 @@
     }
 
     private XRootWindow() {
-        super(new XCreateWindowParams(new Object[] {DELAYED, Boolean.TRUE}));
+        super(new XCreateWindowParams(new Object[] { DELAYED, Boolean.TRUE,
+                                                     EVENT_MASK, XConstants.StructureNotifyMask }));
     }
 
     public void postInit(XCreateWindowParams params){
--- a/src/solaris/classes/sun/awt/X11/XToolkit.java	Tue Dec 23 14:01:21 2014 -0800
+++ b/src/solaris/classes/sun/awt/X11/XToolkit.java	Wed Jan 07 12:22:36 2015 -0800
@@ -2291,9 +2291,7 @@
 
     private static XEventDispatcher oops_waiter;
     private static boolean oops_updated;
-    private static boolean oops_failed;
-    private XAtom oops;
-    private static final long WORKAROUND_SLEEP = 100;
+    private static boolean oops_move;
 
     /**
      * @inheritDoc
@@ -2304,51 +2302,34 @@
         if (oops_waiter == null) {
             oops_waiter = new XEventDispatcher() {
                     public void dispatchEvent(XEvent e) {
-                        if (e.get_type() == XConstants.SelectionNotify) {
-                            XSelectionEvent pe = e.get_xselection();
-                            if (pe.get_property() == oops.getAtom()) {
-                                oops_updated = true;
-                                awtLockNotifyAll();
-                            } else if (pe.get_selection() == XAtom.get("WM_S0").getAtom() &&
-                                       pe.get_target() == XAtom.get("VERSION").getAtom() &&
-                                       pe.get_property() == 0 &&
-                                       XlibWrapper.XGetSelectionOwner(getDisplay(), XAtom.get("WM_S0").getAtom()) == 0)
-                            {
-                                // WM forgot to acquire selection  or there is no WM
-                                oops_failed = true;
-                                awtLockNotifyAll();
-                            }
-
+                        if (e.get_type() == XConstants.ConfigureNotify) {
+                            // OOPS ConfigureNotify event catched
+                            oops_updated = true;
+                            awtLockNotifyAll();
                         }
                     }
                 };
         }
 
-        if (oops == null) {
-            oops = XAtom.get("OOPS");
-        }
-
         awtLock();
         try {
             addEventDispatcher(win.getWindow(), oops_waiter);
 
             oops_updated = false;
-            oops_failed = false;
-            // Wait for selection notify for oops on win
             long event_number = getEventNumber();
-            XAtom atom = XAtom.get("WM_S0");
-            eventLog.finer("WM_S0 selection owner {0}", XlibWrapper.XGetSelectionOwner(getDisplay(), atom.getAtom()));
-            XlibWrapper.XConvertSelection(getDisplay(), atom.getAtom(),
-                                          XAtom.get("VERSION").getAtom(), oops.getAtom(),
-                                          win.getWindow(), XConstants.CurrentTime);
+            // Generate OOPS ConfigureNotify event
+            XlibWrapper.XMoveWindow(getDisplay(), win.getWindow(), oops_move ? 0 : 1, 0);
+            // Change win position each time to avoid system optimization
+            oops_move = !oops_move;
             XSync();
 
 
-            eventLog.finer("Requested OOPS");
+            eventLog.finer("Generated OOPS ConfigureNotify event");
 
             long start = System.currentTimeMillis();
-            while (!oops_updated && !oops_failed) {
+            while (!oops_updated) {
                 try {
+                    // Wait for OOPS ConfigureNotify event
                     awtLockWait(timeout);
                 } catch (InterruptedException e) {
                     throw new RuntimeException(e);
@@ -2359,20 +2340,8 @@
                     throw new OperationTimedOut(Long.toString(System.currentTimeMillis() - start));
                 }
             }
-            if (oops_failed && getEventNumber() - event_number == 1) {
-                // If selection update failed we can simply wait some time
-                // hoping some events will arrive
-                awtUnlock();
-                eventLog.finest("Emergency sleep");
-                try {
-                    Thread.sleep(WORKAROUND_SLEEP);
-                } catch (InterruptedException ie) {
-                    throw new RuntimeException(ie);
-                } finally {
-                    awtLock();
-                }
-            }
-            return getEventNumber() - event_number > 2;
+            // Don't take into account OOPS ConfigureNotify event
+            return getEventNumber() - event_number > 1;
         } finally {
             removeEventDispatcher(win.getWindow(), oops_waiter);
             eventLog.finer("Exiting syncNativeQueue");
--- a/src/solaris/native/java/io/io_util_md.c	Tue Dec 23 14:01:21 2014 -0800
+++ b/src/solaris/native/java/io/io_util_md.c	Wed Jan 07 12:22:36 2015 -0800
@@ -118,3 +118,18 @@
         JNU_ThrowIOExceptionWithLastError(env, "close failed");
     }
 }
+
+size_t
+getLastErrorString(char *buf, size_t len)
+{
+    if (errno == 0 || len < 1) return 0;
+
+    const char *err = strerror(errno);
+    size_t n = strlen(err);
+    if (n >= len)
+        n = len - 1;
+
+    strncpy(buf, err, n);
+    buf[n] = '\0';
+    return n;
+}
--- a/src/solaris/native/sun/awt/awt_util.h	Tue Dec 23 14:01:21 2014 -0800
+++ b/src/solaris/native/sun/awt/awt_util.h	Wed Jan 07 12:22:36 2015 -0800
@@ -115,6 +115,8 @@
 
 extern int xerror_ignore_bad_window(Display *dpy, XErrorEvent *err);
 
+Window get_xawt_root_shell(JNIEnv *env);
+
 #endif /* !HEADLESS */
 
 #ifndef INTERSECTS
--- a/src/solaris/native/sun/security/pkcs11/j2secmod_md.c	Tue Dec 23 14:01:21 2014 -0800
+++ b/src/solaris/native/sun/security/pkcs11/j2secmod_md.c	Wed Jan 07 12:22:36 2015 -0800
@@ -34,7 +34,7 @@
 #include "j2secmod.h"
 
 void *findFunction(JNIEnv *env, jlong jHandle, const char *functionName) {
-    void *hModule = (void*)jHandle;
+    void *hModule = (void*)jlong_to_ptr(jHandle);
     void *fAddress = dlsym(hModule, functionName);
     if (fAddress == NULL) {
         char errorMessage[256];
@@ -53,7 +53,7 @@
     void *hModule = dlopen(libName, RTLD_NOLOAD);
     dprintf2("-handle for %s: %u\n", libName, hModule);
     (*env)->ReleaseStringUTFChars(env, jLibName, libName);
-    return (jlong)hModule;
+    return ptr_to_jlong(hModule);
 }
 
 JNIEXPORT jlong JNICALL Java_sun_security_pkcs11_Secmod_nssLoadLibrary
@@ -72,5 +72,5 @@
         return 0;
     }
 
-    return (jlong)hModule;
+    return ptr_to_jlong(hModule);
 }
--- a/src/solaris/native/sun/security/pkcs11/wrapper/p11_md.c	Tue Dec 23 14:01:21 2014 -0800
+++ b/src/solaris/native/sun/security/pkcs11/wrapper/p11_md.c	Wed Jan 07 12:22:36 2015 -0800
@@ -79,7 +79,7 @@
 {
     void *hModule;
     char *error;
-    CK_C_GetFunctionList C_GetFunctionList;
+    CK_C_GetFunctionList C_GetFunctionList=NULL;
     CK_RV rv;
     ModuleData *moduleData;
     jobject globalPKCS11ImplementationReference;
--- a/src/solaris/native/sun/xawt/XlibWrapper.c	Tue Dec 23 14:01:21 2014 -0800
+++ b/src/solaris/native/sun/xawt/XlibWrapper.c	Wed Jan 07 12:22:36 2015 -0800
@@ -1942,10 +1942,14 @@
  * Toolkit thread to process PropertyNotify or SelectionNotify events.
  */
 static Bool
-secondary_loop_event(Display* dpy, XEvent* event, char* arg) {
-    return (event->type == SelectionNotify ||
-            event->type == SelectionClear  ||
-            event->type == PropertyNotify) ? True : False;
+secondary_loop_event(Display* dpy, XEvent* event, XPointer xawt_root_window) {
+    return (
+                event->type == SelectionNotify ||
+                event->type == SelectionClear  ||
+                event->type == PropertyNotify  ||
+                (event->type == ConfigureNotify
+                    && event->xany.window == *(Window*) xawt_root_window)
+            ) ? True : False;
 }
 
 
@@ -1956,8 +1960,11 @@
 
     AWT_CHECK_HAVE_LOCK();
     exitSecondaryLoop = False;
+    Window xawt_root_window = get_xawt_root_shell(env);
+
     while (!exitSecondaryLoop) {
-        if (XCheckIfEvent((Display*) jlong_to_ptr(display), (XEvent*) jlong_to_ptr(ptr), secondary_loop_event, NULL)) {
+        if (XCheckIfEvent((Display*) jlong_to_ptr(display),
+                (XEvent*) jlong_to_ptr(ptr), secondary_loop_event, (XPointer) &xawt_root_window)) {
             return JNI_TRUE;
         }
         timeout = (timeout < AWT_SECONDARY_LOOP_TIMEOUT) ? (timeout << 1) : AWT_SECONDARY_LOOP_TIMEOUT;
--- a/src/windows/lib/tzmappings	Tue Dec 23 14:01:21 2014 -0800
+++ b/src/windows/lib/tzmappings	Wed Jan 07 12:22:36 2015 -0800
@@ -137,8 +137,8 @@
 Central Standard Time:36,37::America/Chicago:
 Eastern:38,39::America/New_York:
 Eastern Standard Time:38,39::America/New_York:
-E. Europe:4,5:BY:Europe/Minsk:
-E. Europe Standard Time:4,5:BY:Europe/Minsk:
+E. Europe:4,5::EET:
+E. Europe Standard Time:4,5::EET:
 Egypt:4,68::Africa/Cairo:
 Egypt Standard Time:4,68::Africa/Cairo:
 South Africa:4,69::Africa/Harare:
@@ -192,5 +192,11 @@
 Kaliningrad Standard Time:925,925:RU:Europe/Kaliningrad:
 Turkey Standard Time:926,926::Asia/Istanbul:
 Bahia Standard Time:927,927::America/Bahia:
-Western Brazilian Standard Time:928,928:BR:America/Rio_Branco:
-Armenian Standard Time:929,929:AM:Asia/Yerevan:
+Libya Standard Time:928,928:LY:Africa/Tripoli:
+Belarus Standard Time:929,929:BY:Europe/Minsk:
+Line Islands Standard Time:930,930::Pacific/Kiritimati:
+Russia Time Zone 10:931,931::Asia/Srednekolymsk:
+Russia Time Zone 11:932,932::Asia/Anadyr:
+Russia Time Zone 3:933,933::Europe/Samara:
+Western Brazilian Standard Time:934,934:BR:America/Rio_Branco:
+Armenian Standard Time:935,935:AM:Asia/Yerevan:
--- a/src/windows/native/java/io/io_util_md.c	Tue Dec 23 14:01:21 2014 -0800
+++ b/src/windows/native/java/io/io_util_md.c	Wed Jan 07 12:22:36 2015 -0800
@@ -29,6 +29,7 @@
 #include "io_util.h"
 #include "io_util_md.h"
 #include <stdio.h>
+#include <windows.h>
 
 #include <wchar.h>
 #include <io.h>
@@ -589,3 +590,77 @@
     }
     return long_to_jlong(pos.QuadPart);
 }
+
+size_t
+getLastErrorString(char *utf8_jvmErrorMsg, size_t cbErrorMsg)
+{
+    size_t n = 0;
+    if (cbErrorMsg > 0) {
+        BOOLEAN noError = FALSE;
+        WCHAR *utf16_osErrorMsg = (WCHAR *)malloc(cbErrorMsg*sizeof(WCHAR));
+        if (utf16_osErrorMsg == NULL) {
+            // OOM accident
+            strncpy(utf8_jvmErrorMsg, "Out of memory", cbErrorMsg);
+            // truncate if too long
+            utf8_jvmErrorMsg[cbErrorMsg - 1] = '\0';
+            n = strlen(utf8_jvmErrorMsg);
+        } else {
+            DWORD errval = GetLastError();
+            if (errval != 0) {
+                // WIN32 error
+                n = (size_t)FormatMessageW(
+                    FORMAT_MESSAGE_FROM_SYSTEM|FORMAT_MESSAGE_IGNORE_INSERTS,
+                    NULL,
+                    errval,
+                    0,
+                    utf16_osErrorMsg,
+                    (DWORD)cbErrorMsg,
+                    NULL);
+                if (n > 3) {
+                    // Drop final '.', CR, LF
+                    if (utf16_osErrorMsg[n - 1] == L'\n') --n;
+                    if (utf16_osErrorMsg[n - 1] == L'\r') --n;
+                    if (utf16_osErrorMsg[n - 1] == L'.') --n;
+                    utf16_osErrorMsg[n] = L'\0';
+                }
+            } else if (errno != 0) {
+                // C runtime error that has no corresponding WIN32 error code
+                const WCHAR *rtError = _wcserror(errno);
+                if (rtError != NULL) {
+                    wcsncpy(utf16_osErrorMsg, rtError, cbErrorMsg);
+                    // truncate if too long
+                    utf16_osErrorMsg[cbErrorMsg - 1] = L'\0';
+                    n = wcslen(utf16_osErrorMsg);
+                }
+            } else
+                noError = TRUE; //OS has no error to report
+
+            if (!noError) {
+                if (n > 0) {
+                    n = WideCharToMultiByte(
+                        CP_UTF8,
+                        0,
+                        utf16_osErrorMsg,
+                        n,
+                        utf8_jvmErrorMsg,
+                        cbErrorMsg,
+                        NULL,
+                        NULL);
+
+                    // no way to die
+                    if (n > 0)
+                        utf8_jvmErrorMsg[min(cbErrorMsg - 1, n)] = '\0';
+                }
+
+                if (n <= 0) {
+                    strncpy(utf8_jvmErrorMsg, "Secondary error while OS message extraction", cbErrorMsg);
+                    // truncate if too long
+                    utf8_jvmErrorMsg[cbErrorMsg - 1] = '\0';
+                    n = strlen(utf8_jvmErrorMsg);
+                }
+            }
+            free(utf16_osErrorMsg);
+        }
+    }
+    return n;
+}
--- a/src/windows/native/java/lang/ProcessImpl_md.c	Tue Dec 23 14:01:21 2014 -0800
+++ b/src/windows/native/java/lang/ProcessImpl_md.c	Wed Jan 07 12:22:36 2015 -0800
@@ -112,20 +112,70 @@
     return newFlag;
 }
 
+/* We have THREE locales in action:
+ * 1. Thread default locale - dictates UNICODE-to-8bit conversion
+ * 2. System locale that defines the message localization
+ * 3. The file name locale
+ * Each locale could be an extended locale, that means that text cannot be
+ * mapped to 8bit sequence without multibyte encoding.
+ * VM is ready for that, if text is UTF-8.
+ * Here we make the work right from the beginning.
+ */
+size_t os_error_message(int errnum, WCHAR* utf16_OSErrorMsg, size_t maxMsgLength) {
+    size_t n = (size_t)FormatMessageW(
+            FORMAT_MESSAGE_FROM_SYSTEM|FORMAT_MESSAGE_IGNORE_INSERTS,
+            NULL,
+            (DWORD)errnum,
+            0,
+            utf16_OSErrorMsg,
+            (DWORD)maxMsgLength,
+            NULL);
+    if (n > 3) {
+        // Drop final '.', CR, LF
+        if (utf16_OSErrorMsg[n - 1] == L'\n') --n;
+        if (utf16_OSErrorMsg[n - 1] == L'\r') --n;
+        if (utf16_OSErrorMsg[n - 1] == L'.') --n;
+        utf16_OSErrorMsg[n] = L'\0';
+    }
+    return n;
+}
+
+#define MESSAGE_LENGTH (256 + 100)
+#define ARRAY_SIZE(x) (sizeof(x)/sizeof(*x))
+
 static void
-win32Error(JNIEnv *env, const char *functionName)
+win32Error(JNIEnv *env, const WCHAR *functionName)
 {
-    static const char * const format = "%s error=%d, %s";
-    static const char * const fallbackFormat = "%s failed, error=%d";
-    char buf[256];
-    char errmsg[sizeof(buf) + 100];
-    const int errnum = GetLastError();
-    const int n = JVM_GetLastErrorString(buf, sizeof(buf));
-    if (n > 0)
-        sprintf(errmsg, format, functionName, errnum, buf);
-    else
-        sprintf(errmsg, fallbackFormat, functionName, errnum);
-    JNU_ThrowIOException(env, errmsg);
+    WCHAR utf16_OSErrorMsg[MESSAGE_LENGTH - 100];
+    WCHAR utf16_javaMessage[MESSAGE_LENGTH];
+    /*Good suggestion about 2-bytes-per-symbol in localized error reports*/
+    char  utf8_javaMessage[MESSAGE_LENGTH*2];
+    const int errnum = (int)GetLastError();
+    int n = os_error_message(errnum, utf16_OSErrorMsg, ARRAY_SIZE(utf16_OSErrorMsg));
+    n = (n > 0)
+        ? swprintf(utf16_javaMessage, MESSAGE_LENGTH, L"%s error=%d, %s", functionName, errnum, utf16_OSErrorMsg)
+        : swprintf(utf16_javaMessage, MESSAGE_LENGTH, L"%s failed, error=%d", functionName, errnum);
+
+    if (n > 0) /*terminate '\0' is not a part of conversion procedure*/
+        n = WideCharToMultiByte(
+            CP_UTF8,
+            0,
+            utf16_javaMessage,
+            n, /*by creation n <= MESSAGE_LENGTH*/
+            utf8_javaMessage,
+            MESSAGE_LENGTH*2,
+            NULL,
+            NULL);
+
+    /*no way to die*/
+    {
+        const char *errorMessage = "Secondary error while OS message extraction";
+        if (n > 0) {
+            utf8_javaMessage[min(MESSAGE_LENGTH*2 - 1, n)] = '\0';
+            errorMessage = utf8_javaMessage;
+        }
+        JNU_ThrowIOException(env, errorMessage);
+    }
 }
 
 static void
@@ -193,7 +243,7 @@
                      instead of 'Everybody' access */
             PIPE_SIZE))
         {
-            win32Error(env, "CreatePipe");
+            win32Error(env, L"CreatePipe");
             return FALSE;
         } else {
             /* [thisProcessEnd] has no the inherit flag because
@@ -349,7 +399,7 @@
                         &si,              /* (in)  startup information */
                         &pi))             /* (out) process information */
                     {
-                        win32Error(env, "CreateProcess");
+                        win32Error(env, L"CreateProcess");
                     } else {
                         closeSafely(pi.hThread);
                         ret = (jlong)pi.hProcess;
@@ -410,7 +460,7 @@
 {
     DWORD exit_code;
     if (GetExitCodeProcess((HANDLE) handle, &exit_code) == 0)
-        win32Error(env, "GetExitCodeProcess");
+        win32Error(env, L"GetExitCodeProcess");
     return exit_code;
 }
 
@@ -431,7 +481,7 @@
                                FALSE,    /* Wait for ANY event */
                                INFINITE) /* Wait forever */
         == WAIT_FAILED)
-        win32Error(env, "WaitForMultipleObjects");
+        win32Error(env, L"WaitForMultipleObjects");
 }
 
 JNIEXPORT void JNICALL
--- a/src/windows/native/sun/windows/awt_Component.cpp	Tue Dec 23 14:01:21 2014 -0800
+++ b/src/windows/native/sun/windows/awt_Component.cpp	Wed Jan 07 12:22:36 2015 -0800
@@ -3523,8 +3523,12 @@
     if (ops == SAVE) {
         transTable.put(reinterpret_cast<void*>(static_cast<INT_PTR>(wkey)),
                        reinterpret_cast<void*>(static_cast<INT_PTR>(translation)));
-        deadKeyFlagTable.put(reinterpret_cast<void*>(static_cast<INT_PTR>(wkey)),
-                       reinterpret_cast<void*>(static_cast<INT_PTR>(deadKeyFlag)));
+        if (deadKeyFlag) {
+            deadKeyFlagTable.put(reinterpret_cast<void*>(static_cast<INT_PTR>(wkey)),
+                         reinterpret_cast<void*>(static_cast<INT_PTR>(deadKeyFlag)));
+        } else {
+            deadKeyFlagTable.remove(reinterpret_cast<void*>(static_cast<INT_PTR>(wkey)));
+        }
     }
 
     isDeadKey = deadKeyFlag;
--- a/test/ProblemList.txt	Tue Dec 23 14:01:21 2014 -0800
+++ b/test/ProblemList.txt	Wed Jan 07 12:22:36 2015 -0800
@@ -387,9 +387,6 @@
 # Filed 6986875
 sun/tools/jps/jps-Vvml.sh                                       generic-all
 
-# Filed 6979016
-sun/tools/jconsole/ResourceCheckTest.sh                         generic-all
-
 # 7132203
 sun/jvmstat/monitor/MonitoredVm/CR6672135.java                  generic-all
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/awt/Frame/DisposeStressTest/DisposeStressTest.html	Wed Jan 07 12:22:36 2015 -0800
@@ -0,0 +1,21 @@
+<html>
+<!--  
+  @test
+  @bug 4051487 4145670
+  @summary Tests that disposing of an empty Frame or a Frame with a MenuBar
+           while it is being created does not crash the VM.
+  @author dpm area=Threads
+  @run applet/timeout=7200 DisposeStressTest.html
+  -->
+<head>
+<title>DisposeStressTest</title>
+</head>
+<body>
+
+<h1>DisposeStressTest<br>Bug ID: 4051487, 4145670</h1>
+
+<p> This is an AUTOMATIC test, simply wait for completion </p>
+
+<APPLET CODE="DisposeStressTest.class" WIDTH=200 HEIGHT=200></APPLET>
+</body>
+</html>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/awt/Frame/DisposeStressTest/DisposeStressTest.java	Wed Jan 07 12:22:36 2015 -0800
@@ -0,0 +1,247 @@
+/*
+ * 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
+  @bug 4051487 4145670 8062021
+  @summary Tests that disposing of an empty Frame or a Frame with a MenuBar
+           while it is being created does not crash the VM.
+  @author dpm area=Threads
+  @run applet/timeout=7200 DisposeStressTest.html
+*/
+
+// Note there is no @ in front of test above.  This is so that the
+//  harness will not mistake this file as a test file.  It should
+//  only see the html file as a test file. (the harness runs all
+//  valid test files, so it would run this test twice if this file
+//  were valid as well as the html file.)
+// Also, note the area= after Your Name in the author tag.  Here, you
+//  should put which functional area the test falls in.  See the
+//  AWT-core home page -> test areas and/or -> AWT team  for a list of
+//  areas.
+// Note also the 'DisposeStressTest.html' in the run tag.  This should
+//  be changed to the name of the test.
+
+
+/**
+ * DisposeStressTest.java
+ *
+ * summary:
+ */
+
+import java.applet.Applet;
+import java.awt.*;
+
+
+//Automated tests should run as applet tests if possible because they
+// get their environments cleaned up, including AWT threads, any
+// test created threads, and any system resources used by the test
+// such as file descriptors.  (This is normally not a problem as
+// main tests usually run in a separate VM, however on some platforms
+// such as the Mac, separate VMs are not possible and non-applet
+// tests will cause problems).  Also, you don't have to worry about
+// synchronisation stuff in Applet tests they way you do in main
+// tests...
+
+
+public class DisposeStressTest extends Applet
+ {
+   //Declare things used in the test, like buttons and labels here
+
+   public void init()
+    {
+      //Create instructions for the user here, as well as set up
+      // the environment -- set the layout manager, add buttons,
+      // etc.
+
+      this.setLayout (new BorderLayout ());
+
+      String[] instructions =
+       {
+         "This is an AUTOMATIC test",
+         "simply wait until it is done"
+       };
+      Sysout.createDialog( );
+      Sysout.printInstructions( instructions );
+
+    }//End  init()
+
+   public void start ()
+    {
+        for (int i = 0; i < 1000; i++) {
+            Frame f = new Frame();
+            f.setBounds(10, 10, 10, 10);
+            f.show();
+            f.dispose();
+
+            Frame f2 = new Frame();
+            f2.setBounds(10, 10, 100, 100);
+            MenuBar bar = new MenuBar();
+            Menu menu = new Menu();
+            menu.add(new MenuItem("foo"));
+            bar.add(menu);
+            f2.setMenuBar(bar);
+            f2.show();
+            f2.dispose();
+        }
+    }// start()
+
+ }// class DisposeStressTest
+
+
+/****************************************************
+ Standard Test Machinery
+ DO NOT modify anything below -- it's a standard
+  chunk of code whose purpose is to make user
+  interaction uniform, and thereby make it simpler
+  to read and understand someone else's test.
+ ****************************************************/
+
+/**
+ This is part of the standard test machinery.
+ It creates a dialog (with the instructions), and is the interface
+  for sending text messages to the user.
+ To print the instructions, send an array of strings to Sysout.createDialog
+  WithInstructions method.  Put one line of instructions per array entry.
+ To display a message for the tester to see, simply call Sysout.println
+  with the string to be displayed.
+ This mimics System.out.println but works within the test harness as well
+  as standalone.
+ */
+
+class Sysout
+ {
+   private static TestDialog dialog;
+
+   public static void createDialogWithInstructions( String[] instructions )
+    {
+      dialog = new TestDialog( new Frame(), "Instructions" );
+      dialog.printInstructions( instructions );
+      dialog.show();
+      println( "Any messages for the tester will display here." );
+    }
+
+   public static void createDialog( )
+    {
+      dialog = new TestDialog( new Frame(), "Instructions" );
+      String[] defInstr = { "Instructions will appear here. ", "" } ;
+      dialog.printInstructions( defInstr );
+      dialog.show();
+      println( "Any messages for the tester will display here." );
+    }
+
+
+   public static void printInstructions( String[] instructions )
+    {
+      dialog.printInstructions( instructions );
+    }
+
+
+   public static void println( String messageIn )
+    {
+      dialog.displayMessage( messageIn );
+    }
+
+ }// Sysout  class
+
+/**
+  This is part of the standard test machinery.  It provides a place for the
+   test instructions to be displayed, and a place for interactive messages
+   to the user to be displayed.
+  To have the test instructions displayed, see Sysout.
+  To have a message to the user be displayed, see Sysout.
+  Do not call anything in this dialog directly.
+  */
+class TestDialog extends Dialog
+ {
+
+   TextArea instructionsText;
+   TextArea messageText;
+   int maxStringLength = 80;
+
+   //DO NOT call this directly, go through Sysout
+   public TestDialog( Frame frame, String name )
+    {
+      super( frame, name );
+      int scrollBoth = TextArea.SCROLLBARS_BOTH;
+      instructionsText = new TextArea( "", 15, maxStringLength, scrollBoth );
+      add( "North", instructionsText );
+
+      messageText = new TextArea( "", 5, maxStringLength, scrollBoth );
+      add("South", messageText);
+
+      pack();
+
+      show();
+    }// TestDialog()
+
+   //DO NOT call this directly, go through Sysout
+   public void printInstructions( String[] instructions )
+    {
+      //Clear out any current instructions
+      instructionsText.setText( "" );
+
+      //Go down array of instruction strings
+
+      String printStr, remainingStr;
+      for( int i=0; i < instructions.length; i++ )
+       {
+         //chop up each into pieces maxSringLength long
+         remainingStr = instructions[ i ];
+         while( remainingStr.length() > 0 )
+          {
+            //if longer than max then chop off first max chars to print
+            if( remainingStr.length() >= maxStringLength )
+             {
+               //Try to chop on a word boundary
+               int posOfSpace = remainingStr.
+                  lastIndexOf( ' ', maxStringLength - 1 );
+
+               if( posOfSpace <= 0 ) posOfSpace = maxStringLength - 1;
+
+               printStr = remainingStr.substring( 0, posOfSpace + 1 );
+               remainingStr = remainingStr.substring( posOfSpace + 1 );
+             }
+            //else just print
+            else
+             {
+               printStr = remainingStr;
+               remainingStr = "";
+             }
+
+            instructionsText.append( printStr + "\n" );
+
+          }// while
+
+       }// for
+
+    }//printInstructions()
+
+   //DO NOT call this directly, go through Sysout
+   public void displayMessage( String messageIn )
+    {
+      messageText.append( messageIn + "\n" );
+    }
+
+ }// TestDialog  class
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/awt/event/KeyEvent/DeadKey/DeadKeySystemAssertionDialog.java	Wed Jan 07 12:22:36 2015 -0800
@@ -0,0 +1,65 @@
+/*
+ * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import java.awt.Frame;
+import java.awt.Robot;
+import java.awt.TextField;
+import java.awt.Toolkit;
+import java.awt.event.KeyEvent;
+import sun.awt.SunToolkit;
+/*
+ * @test
+ * @bug 8013849
+ * @summary Awt assert on Hashtable.cpp:124
+ * @author alexandr.scherbatiy area=awt.event
+ * @run main/timeout=5 DeadKeySystemAssertionDialog
+ */
+
+public class DeadKeySystemAssertionDialog {
+
+    public static void main(String[] args) throws Exception {
+
+        SunToolkit toolkit = (SunToolkit) Toolkit.getDefaultToolkit();
+        Frame frame = new Frame();
+        frame.setSize(300, 200);
+
+        TextField textField = new TextField();
+        frame.add(textField);
+
+        frame.setVisible(true);
+        toolkit.realSync();
+
+        textField.requestFocus();
+        toolkit.realSync();
+
+        // Check that the system assertion dialog does not block Java
+        Robot robot = new Robot();
+        robot.setAutoDelay(50);
+        robot.keyPress(KeyEvent.VK_A);
+        robot.keyRelease(KeyEvent.VK_A);
+        toolkit.realSync();
+
+        frame.setVisible(false);
+        frame.dispose();
+    }
+}
--- a/test/java/awt/regtesthelpers/process/ProcessCommunicator.java	Tue Dec 23 14:01:21 2014 -0800
+++ b/test/java/awt/regtesthelpers/process/ProcessCommunicator.java	Wed Jan 07 12:22:36 2015 -0800
@@ -81,7 +81,7 @@
     public static ProcessResults executeChildProcess(final Class classToExecute,
                            final String [] args)
     {
-        return executeChildProcess(classToExecute, " ", args);
+        return executeChildProcess(classToExecute, System.getProperty("java.class.path"), args);
     }
 
     /**
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/lang/Class/getDeclaredField/ClassDeclaredFieldsTest.java	Wed Jan 07 12:22:36 2015 -0800
@@ -0,0 +1,205 @@
+/*
+ * 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.
+ */
+
+import java.lang.reflect.Field;
+import java.lang.reflect.ReflectPermission;
+import java.security.CodeSource;
+import java.security.Permission;
+import java.security.PermissionCollection;
+import java.security.Permissions;
+import java.security.Policy;
+import java.security.ProtectionDomain;
+import java.util.Arrays;
+import java.util.Enumeration;
+import java.util.concurrent.atomic.AtomicBoolean;
+
+/**
+ * @test
+ * @bug 8065552
+ * @summary test that all fields returned by getDeclaredFields() can be
+ *          set accessible if the right permission is granted; this test
+ *          also verifies that Class.classLoader final private field is
+ *          hidden from reflection access.
+ * @run main/othervm ClassDeclaredFieldsTest UNSECURE
+ * @run main/othervm ClassDeclaredFieldsTest SECURE
+ *
+ * @author danielfuchs
+ */
+public class ClassDeclaredFieldsTest {
+
+    // Test with or without a security manager
+    public static enum TestCase {
+        UNSECURE, SECURE;
+        public void run() throws Exception {
+            System.out.println("Running test case: " + name());
+            Configure.setUp(this);
+            test(this);
+        }
+    }
+    /**
+     * @param args the command line arguments
+     */
+    public static void main(String[] args) throws Exception {
+        System.out.println(System.getProperty("java.version"));
+        if (args == null || args.length == 0) {
+            args = new String[] { "SECURE" };
+        } else if (args.length != 1) {
+            throw new IllegalArgumentException("Only one arg expected: "
+                    + Arrays.asList(args));
+        }
+        TestCase.valueOf(args[0]).run();
+    }
+
+    static void test(TestCase test) {
+        for (Field f : Class.class.getDeclaredFields()) {
+            f.setAccessible(true);
+            System.out.println("Field "+f.getName()+" is now accessible.");
+            if (f.getName().equals("classLoader")) {
+                throw new RuntimeException("Found "+f.getName()+" field!");
+            }
+        }
+        try {
+            Class.class.getDeclaredField("classLoader");
+            throw new RuntimeException("Expected NoSuchFieldException for"
+                    + " 'classLoader' field not raised");
+        } catch(NoSuchFieldException x) {
+            System.out.println("Got expected exception: " + x);
+        }
+        System.out.println("Passed "+test);
+    }
+
+    // A helper class to configure the security manager for the test,
+    // and bypass it when needed.
+    static class Configure {
+        static Policy policy = null;
+        static final ThreadLocal<AtomicBoolean> allowAll = new ThreadLocal<AtomicBoolean>() {
+            @Override
+            protected AtomicBoolean initialValue() {
+                return  new AtomicBoolean(false);
+            }
+        };
+        static void setUp(TestCase test) {
+            switch (test) {
+                case SECURE:
+                    if (policy == null && System.getSecurityManager() != null) {
+                        throw new IllegalStateException("SecurityManager already set");
+                    } else if (policy == null) {
+                        policy = new SimplePolicy(TestCase.SECURE, allowAll);
+                        Policy.setPolicy(policy);
+                        System.setSecurityManager(new SecurityManager());
+                    }
+                    if (System.getSecurityManager() == null) {
+                        throw new IllegalStateException("No SecurityManager.");
+                    }
+                    if (policy == null) {
+                        throw new IllegalStateException("policy not configured");
+                    }
+                    break;
+                case UNSECURE:
+                    if (System.getSecurityManager() != null) {
+                        throw new IllegalStateException("SecurityManager already set");
+                    }
+                    break;
+                default:
+                    throw new InternalError("No such testcase: " + test);
+            }
+        }
+        static void doPrivileged(Runnable run) {
+            allowAll.get().set(true);
+            try {
+                run.run();
+            } finally {
+                allowAll.get().set(false);
+            }
+        }
+    }
+
+    // A Helper class to build a set of permissions.
+    final static class PermissionsBuilder {
+        final Permissions perms;
+        public PermissionsBuilder() {
+            this(new Permissions());
+        }
+        public PermissionsBuilder(Permissions perms) {
+            this.perms = perms;
+        }
+        public PermissionsBuilder add(Permission p) {
+            perms.add(p);
+            return this;
+        }
+        public PermissionsBuilder addAll(PermissionCollection col) {
+            if (col != null) {
+                for (Enumeration<Permission> e = col.elements(); e.hasMoreElements(); ) {
+                    perms.add(e.nextElement());
+                }
+            }
+            return this;
+        }
+        public Permissions toPermissions() {
+            final PermissionsBuilder builder = new PermissionsBuilder();
+            builder.addAll(perms);
+            return builder.perms;
+        }
+    }
+
+    // Policy for the test...
+    public static class SimplePolicy extends Policy {
+
+        final Permissions permissions;
+        final Permissions allPermissions;
+        final ThreadLocal<AtomicBoolean> allowAll; // actually: this should be in a thread locale
+        public SimplePolicy(TestCase test, ThreadLocal<AtomicBoolean> allowAll) {
+            this.allowAll = allowAll;
+            // we don't actually need any permission to create our
+            // FileHandlers because we're passing invalid parameters
+            // which will make the creation fail...
+            permissions = new Permissions();
+            permissions.add(new RuntimePermission("accessDeclaredMembers"));
+            permissions.add(new ReflectPermission("suppressAccessChecks"));
+
+            // these are used for configuring the test itself...
+            allPermissions = new Permissions();
+            allPermissions.add(new java.security.AllPermission());
+
+        }
+
+        @Override
+        public boolean implies(ProtectionDomain domain, Permission permission) {
+            if (allowAll.get().get()) return allPermissions.implies(permission);
+            return permissions.implies(permission);
+        }
+
+        @Override
+        public PermissionCollection getPermissions(CodeSource codesource) {
+            return new PermissionsBuilder().addAll(allowAll.get().get()
+                    ? allPermissions : permissions).toPermissions();
+        }
+
+        @Override
+        public PermissionCollection getPermissions(ProtectionDomain domain) {
+            return new PermissionsBuilder().addAll(allowAll.get().get()
+                    ? allPermissions : permissions).toPermissions();
+        }
+    }
+
+}
--- a/test/java/lang/ProcessBuilder/Basic.java	Tue Dec 23 14:01:21 2014 -0800
+++ b/test/java/lang/ProcessBuilder/Basic.java	Wed Jan 07 12:22:36 2015 -0800
@@ -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
@@ -26,10 +26,11 @@
  * @bug 4199068 4738465 4937983 4930681 4926230 4931433 4932663 4986689
  *      5026830 5023243 5070673 4052517 4811767 6192449 6397034 6413313
  *      6464154 6523983 6206031 4960438 6631352 6631966 6850957 6850958
- *      4947220 7018606 7034570
+ *      4947220 7018606 7034570 8047340
  * @summary Basic tests for Process and Environment Variable code
  * @run main/othervm/timeout=300 Basic
  * @run main/othervm/timeout=300 -Djdk.lang.Process.launchMechanism=fork Basic
+ * @run main/othervm/timeout=300 -DTurkeyTest Basic
  * @author Martin Buchholz
  */
 
@@ -1083,6 +1084,11 @@
     }
 
     private static void realMain(String[] args) throws Throwable {
+        if (System.getProperty("TurkeyTest") != null) {
+            // static initializer test, set this early.
+            System.out.println("Testing with Turkish locale.");
+            Locale.setDefault(new Locale("tr", ""));
+        }
         if (Windows.is())
             System.out.println("This appears to be a Windows system.");
         if (Unix.is())
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/lang/reflect/Generics/ThreadSafety.java	Wed Jan 07 12:22:36 2015 -0800
@@ -0,0 +1,129 @@
+/*
+ * Copyright 2014 Google Inc.  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 8062771 8016236
+ * @summary Test publication of Class objects via a data race
+ * @run testng ThreadSafety
+ */
+
+import java.net.URL;
+import java.net.URLClassLoader;
+import java.util.Collections;
+import java.util.concurrent.BrokenBarrierException;
+import java.util.concurrent.Callable;
+import java.util.concurrent.CyclicBarrier;
+import java.util.concurrent.ExecutionException;
+import java.util.concurrent.ExecutorService;
+import java.util.concurrent.Executors;
+import java.util.concurrent.Future;
+import java.util.concurrent.TimeoutException;
+import static java.util.concurrent.TimeUnit.SECONDS;
+import static org.testng.Assert.*;
+import org.testng.annotations.Test;
+
+/**
+ * A test resulting from an attempt to repro this failure (in guice):
+ *
+ * java.lang.NullPointerException
+ *   at sun.reflect.generics.visitor.Reifier.visitClassTypeSignature(Reifier.java:125)
+ *   at sun.reflect.generics.tree.ClassTypeSignature.accept(ClassTypeSignature.java:49)
+ *   at sun.reflect.generics.repository.ClassRepository.getSuperclass(ClassRepository.java:84)
+ *   at java.lang.Class.getGenericSuperclass(Class.java:692)
+ *   at com.google.inject.TypeLiteral.getSuperclassTypeParameter(TypeLiteral.java:99)
+ *   at com.google.inject.TypeLiteral.<init>(TypeLiteral.java:79)
+ *
+ * However, as one would expect with thread safety problems in reflection, these
+ * are very hard to reproduce.  This very test has never been observed to fail,
+ * but a similar test has been observed to fail about once in 2000 executions
+ * (about once every 6 CPU-hours), in jdk7 only.  It appears to be fixed in jdk8+ by:
+ *
+ * 8016236: Class.getGenericInterfaces performance improvement.
+ * (by making Class.genericInfo volatile)
+ */
+public class ThreadSafety {
+    public static class EmptyClass {
+        public static class EmptyGenericSuperclass<T> {}
+        public static class EmptyGenericSubclass<T> extends EmptyGenericSuperclass<T> {}
+    }
+
+    /** published via data race */
+    private Class<?> racyClass = Object.class;
+
+    private URL[] urls = ((URLClassLoader) ThreadSafety.class.getClassLoader()).getURLs();
+
+    private Class<?> createNewEmptyGenericSubclassClass() throws Exception {
+        URLClassLoader ucl = new URLClassLoader(urls, null);
+        return Class.forName("ThreadSafety$EmptyClass$EmptyGenericSubclass", true, ucl);
+    }
+
+    @Test
+    public void testRacy_getGenericSuperclass() throws Exception {
+        final int nThreads = 10;
+        final int iterations = 30;
+        final int timeout = 10;
+        final CyclicBarrier newCycle = new CyclicBarrier(nThreads);
+        final Callable<Void> task = new Callable<Void>() {
+            public Void call() throws Exception {
+                for (int i = 0; i < iterations; i++) {
+                    final int threadId;
+                    try {
+                        threadId = newCycle.await(timeout, SECONDS);
+                    } catch (BrokenBarrierException e) {
+                        return null;
+                    }
+                    for (int j = 0; j < iterations; j++) {
+                        // one thread publishes the class object via a data
+                        // race, for the other threads to consume.
+                        if (threadId == 0) {
+                            racyClass = createNewEmptyGenericSubclassClass();
+                        } else {
+                            racyClass.getGenericSuperclass();
+                        }
+                    }
+                }
+                return null;
+            }};
+
+        final ExecutorService pool = Executors.newFixedThreadPool(nThreads);
+        try {
+            for (Future<Void> future :
+                     pool.invokeAll(Collections.nCopies(nThreads, task))) {
+                try {
+                    future.get(iterations * timeout, SECONDS);
+                } catch (ExecutionException e) {
+                    // ignore "collateral damage"
+                    if (!(e.getCause() instanceof BrokenBarrierException)
+                        &&
+                        !(e.getCause() instanceof TimeoutException)) {
+                        throw e;
+                    }
+                }
+            }
+        } finally {
+            pool.shutdownNow();
+            assertTrue(pool.awaitTermination(2 * timeout, SECONDS));
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/javax/swing/JColorChooser/8065098/JColorChooserDnDTest.java	Wed Jan 07 12:22:36 2015 -0800
@@ -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.
+ */
+import javax.swing.BorderFactory;
+import javax.swing.JColorChooser;
+import javax.swing.JFrame;
+import javax.swing.JPanel;
+import javax.swing.SwingUtilities;
+
+/*
+ * @bug 8065098
+ * @summary JColorChooser no longer supports drag and drop
+ *     between two JVM instances
+ */
+public class JColorChooserDnDTest {
+
+    public static void main(String[] args) {
+        SwingUtilities.invokeLater(new Runnable() {
+
+            @Override
+            public void run() {
+                JFrame frame = new JFrame();
+                frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
+                JPanel panel = new JPanel();
+                JColorChooser colorChooser = new JColorChooser();
+                colorChooser.setDragEnabled(true);
+                panel.setBorder(BorderFactory.createTitledBorder("JColorChoosers"));
+                panel.add(colorChooser);
+                frame.setContentPane(panel);
+                frame.pack();
+                frame.setVisible(true);
+            }
+        });
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/javax/swing/JColorChooser/8065098/bug8065098.html	Wed Jan 07 12:22:36 2015 -0800
@@ -0,0 +1,40 @@
+<!--
+ 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.
+-->
+
+<html>
+    <body>
+        1. Compile the java test JColorChooserDnDTest.java: 
+            > <path-to-the-tested-jdk>/bin/javac JColorChooserDnDTest.java
+        2. Run the first instance of the java test: 
+            > <path-to-the-tested-jdk>/bin/java JColorChooserDnDTest
+        3. Select a color in the color chooser
+        4. Run the second instance of the java test: 
+            > <path-to-the-tested-jdk>/bin/java JColorChooserDnDTest
+        5. Drag and drop the selected color from the first color chooser
+           preview panel to the second color chooser preview panel
+        6. If the color is dragged to the second color chooser then the test passes.
+
+    <applet width="500" height="1" code="bug8065098.class">
+    </applet>        
+</body>
+</html>
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/javax/swing/JColorChooser/8065098/bug8065098.java	Wed Jan 07 12:22:36 2015 -0800
@@ -0,0 +1,34 @@
+/*
+ * 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.
+ */
+import javax.swing.JApplet;
+
+/*
+ * @test
+ * @bug 8065098
+ * @summary JColorChooser no longer supports drag and drop
+ *     between two JVM instances
+ * @run applet/manual=yesno bug8065098.html
+ */
+public class bug8065098 extends JApplet {
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/javax/swing/plaf/windows/WindowsRootPaneUI/AltKeyProccessingNPETest/AltKeyProccessingNPETest.java	Wed Jan 07 12:22:36 2015 -0800
@@ -0,0 +1,65 @@
+/*
+ * 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
+   @bug 8001633
+   @summary Wrong alt processing during switching between windows
+   @author mikhail.cherkasov@oracle.com
+   @run main AltKeyProccessingNPETest
+*/
+import sun.awt.SunToolkit;
+
+import java.awt.*;
+import java.awt.event.KeyEvent;
+import javax.swing.UIManager;
+
+public class AltKeyProccessingNPETest {
+
+    private static Robot robot;
+
+    public static void initRobot() throws AWTException {
+        robot = new Robot();
+        robot.setAutoDelay(100);
+    }
+
+    public static void sync() {
+        SunToolkit toolkit = (SunToolkit) Toolkit.getDefaultToolkit();
+        toolkit.realSync();
+    }
+
+    public static void main(String args[]) throws Exception {
+
+        initRobot();
+
+        UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
+
+        Frame frame = new Frame();
+        frame.setSize(400,400);
+        frame.setVisible(true);
+
+        sync();
+
+        robot.keyPress(KeyEvent.VK_ALT);
+        robot.keyRelease(KeyEvent.VK_ALT);
+    }
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/jdk/net/Sockets/SupportedOptions.java	Wed Jan 07 12:22:36 2015 -0800
@@ -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.
+ */
+
+/*
+ * @test
+ * @bug 8062744
+ * @run main SupportedOptions
+ */
+
+import java.net.*;
+import java.io.IOException;
+import jdk.net.*;
+
+public class SupportedOptions {
+
+    public static void main(String[] args) throws Exception {
+        if (!Sockets.supportedOptions(ServerSocket.class)
+              .contains(StandardSocketOptions.IP_TOS)) {
+            throw new RuntimeException("Test failed");
+        }
+        // Now set the option
+        ServerSocket ss = new ServerSocket();
+        Sockets.setOption(ss, java.net.StandardSocketOptions.IP_TOS, 128);
+    }
+}
--- a/test/sun/awt/dnd/8024061/bug8024061.java	Tue Dec 23 14:01:21 2014 -0800
+++ b/test/sun/awt/dnd/8024061/bug8024061.java	Wed Jan 07 12:22:36 2015 -0800
@@ -277,9 +277,6 @@
                     try {
                         Transferable t = dtde.getTransferable();
                         Object data = t.getTransferData(DropObjectFlavor);
-                        if (data != null) {
-                            throw new Exception("getTransferData returned non-null");
-                        }
                     } catch (Exception e) {
                         dragEnterException = e;
                         e.printStackTrace();
--- a/test/sun/net/www/http/HttpClient/StreamingRetry.java	Tue Dec 23 14:01:21 2014 -0800
+++ b/test/sun/net/www/http/HttpClient/StreamingRetry.java	Wed Jan 07 12:22:36 2015 -0800
@@ -23,8 +23,8 @@
 
 /*
  * @test
- * @bug 6672144
- * @summary HttpURLConnection.getInputStream sends POST request after failed chunked send
+ * @bug 6672144 8050983
+ * @summary Do not retry failed request with a streaming body.
  */
 
 import java.net.HttpURLConnection;
@@ -33,6 +33,7 @@
 import java.io.IOException;
 import java.io.InputStream;
 import java.io.OutputStream;
+import static java.lang.System.out;
 
 public class StreamingRetry implements Runnable {
     static final int ACCEPT_TIMEOUT = 20 * 1000; // 20 seconds
@@ -43,11 +44,17 @@
     }
 
     void instanceMain() throws IOException {
-        test();
+        out.println("Test with default method");
+        test(null);
+        out.println("Test with POST method");
+        test("POST");
+        out.println("Test with PUT method");
+        test("PUT");
+
         if (failed > 0) throw new RuntimeException("Some tests failed");
     }
 
-    void test() throws IOException {
+    void test(String method) throws IOException {
         ss = new ServerSocket(0);
         ss.setSoTimeout(ACCEPT_TIMEOUT);
         int port = ss.getLocalPort();
@@ -58,6 +65,8 @@
             URL url = new URL("http://localhost:" + port + "/");
             HttpURLConnection uc = (HttpURLConnection) url.openConnection();
             uc.setDoOutput(true);
+            if (method != null)
+                uc.setRequestMethod(method);
             uc.setChunkedStreamingMode(4096);
             OutputStream os = uc.getOutputStream();
             os.write("Hello there".getBytes());
@@ -79,7 +88,7 @@
             ss.close();
             fail("The server shouldn't accept a second connection");
          } catch (IOException e) {
-            //OK, the clien will close the server socket if successfull
+            //OK, the client will close the server socket if successful
         }
     }
 
--- a/test/sun/tools/jconsole/ResourceCheckTest.java	Tue Dec 23 14:01:21 2014 -0800
+++ b/test/sun/tools/jconsole/ResourceCheckTest.java	Wed Jan 07 12:22:36 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2004, 2007, 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
@@ -27,377 +27,134 @@
  *  This isn't the test case: ResourceCheckTest.sh is.
  *  Refer to ResourceCheckTest.sh when running this test.
  *
- *  @bug 5008856 5023573 5024917 5062569
+ *  @bug 5008856 5023573 5024917 5062569 7172176
  *  @summary 'missing resource key' error for key = "Operating system"
  */
 
-import java.awt.event.KeyEvent;
+import java.lang.reflect.Field;
+import java.lang.reflect.Modifier;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+import java.util.Locale;
+import java.util.ResourceBundle;
 
+import sun.tools.jconsole.Messages;
 import sun.tools.jconsole.Resources;
 
+/*
+ * Ensures that there is a one-to-one mapping between constants in the
+ * Message class and the keys in the sun.tools.jconsole.resources.messages
+ * bundle.
+ *
+ * An error will be thrown if there is a:
+ *
+ * - key in the resource bundle that doesn't have a public static field with
+ *   the same name in the Message class.
+ *
+ * - public static field in the Message class that doesn't have a key with
+ *   the same name in the resource bundle.
+ *
+ * - message with a mnemonic identifier(&) for which a mnemonic can't
+ *   be looked up using Resources#getMnemonicInt().
+ *
+ */
 public class ResourceCheckTest {
+    private static final String MISSING_RESOURCE_KEY_PREFIX = "missing message for";
+    private static final String RESOURCE_BUNDLE = "sun.tools.jconsole.resources.messages";
+    private static final String NEW_LINE = String.format("%n");
 
-    public static void main(String[] args){
-        Object [][] testData = {
-            {"<", "", "", "", ""},
-            {"<<", "", "", "", ""},
-            {">", "", "", "", ""},
-            {" 1 day", "", "", "", ""},
-            {" 1 hour", "", "", "", ""},
-            {" 1 min", "", "", "", ""},
-            {" 1 month", "", "", "", ""},
-            {" 1 year", "", "", "", ""},
-            {" 2 hours", "", "", "", ""},
-            {" 3 hours", "", "", "", ""},
-            {" 3 months", "", "", "", ""},
-            {" 5 min", "", "", "", ""},
-            {" 6 hours", "", "", "", ""},
-            {" 6 months", "", "", "", ""},
-            {" 7 days", "", "", "", ""},
-            {"10 min", "", "", "", ""},
-            {"12 hours", "", "", "", ""},
-            {"30 min", "", "", "", ""},
-            {"ACTION", "", "", "", ""},
-            {"ACTION_INFO", "", "", "", ""},
-            {"All", "", "", "", ""},
-            {"Architecture", "", "", "", ""},
-            {"Attribute", "", "", "", ""},
-            {"Attribute value", "", "", "", ""},
-            {"Attribute values", "", "", "", ""},
-            {"Attributes", "", "", "", ""},
-            {"Blank", "", "", "", ""},
-            {"BlockedCount WaitedCount", "BlockedCount", "WaitedCount", "", ""},
-            {"Boot class path", "", "", "", ""},
-            {"BorderedComponent.moreOrLessButton.toolTip", "", "", "", ""},
-            {"Close", "", "", "", ""},
-            {"CPU Usage", "", "", "", ""},
-            {"CPUUsageFormat","PhonyPercentage", "", "", ""},
-            {"Cancel", "", "", "", ""},
-            {"Cascade", "", "", "", ""},
-            {"Cascade.mnemonic", "", "", "", ""},
-            {"Chart:", "", "", "", ""},
-            {"Chart:.mnemonic", "", "", "", ""},
-            {"ClassTab.infoLabelFormat", "LoadedCount", "UnloadedCount", "TotalCount", ""},
-            {"ClassTab.loadedClassesPlotter.accessibleName", "", "", "", ""},
-            {"Class path", "", "", "", ""},
-            {"Classes", "", "", "", ""},
-            {"ClassName", "", "", "", ""},
-            {"Column.Name", "", "", "", ""},
-            {"Column.PID", "", "", "", ""},
-            {"Committed", "", "", "", ""},
-            {"Committed memory", "", "", "", ""},
-            {"Committed virtual memory", "", "", "", ""},
-            {"Compiler", "", "", "", ""},
-            {"Connect...", "", "", "", ""},
-            {"Connect", "", "", "", ""},
-            {"Connect.mnemonic", "", "", "", ""},
-            {"ConnectDialog.connectButton.toolTip", "", "", "", ""},
-            {"ConnectDialog.accessibleDescription", "", "", "", ""},
-            {"ConnectDialog.masthead.accessibleName", "", "", "", ""},
-            {"ConnectDialog.masthead.title", "", "", "", ""},
-            {"ConnectDialog.statusBar.accessibleName", "", "", "", ""},
-            {"ConnectDialog.title", "", "", "", ""},
-            {"Connected. Click to disconnect.", "", "", "", ""},
-            {"connectingTo1", "PhonyConnectionName", "", "", ""},
-            {"connectingTo2", "PhonyConnectionName", "", "", ""},
-            {"connectionFailed1", "", "", "", ""},
-            {"connectionFailed2", "PhonyConnectionName", "", "", ""},
-            {"connectionLost1", "", "", "", ""},
-            {"connectionLost2", "PhonyConnectionName", "", "", ""},
-            {"Connection failed", "", "", "", ""},
-            {"Connection", "", "", "", ""},
-            {"Connection.mnemonic", "", "", "", ""},
-            {"Connection name", "", "", "", ""},
-            {"ConnectionName (disconnected)", "Phony", "Phony", "", ""},
-            {"Constructor", "", "", "", ""},
-            {"Create", "Phony", "Phony", "", ""},
-            {"Current classes loaded", "", "", "", ""},
-            {"Current heap size", "", "", "", ""},
-            {"Current value", "PhonyValue", "", "", ""},
-            {"Daemon threads", "", "", "", ""},
-            {"deadlockAllTab", "", "", "", ""},
-            {"deadlockTab", "", "", "", ""},
-            {"deadlockTabN", "PhonyInt", "", "", ""},
-            {"Description", "", "", "", ""},
-            {"Descriptor", "", "", "", ""},
-            {"Details", "", "", "", ""},
-            {"Detect Deadlock", "", "", "", ""},
-            {"Detect Deadlock.mnemonic", "", "", "", ""},
-            {"Detect Deadlock.toolTip", "", "", "", ""},
-            {"Dimension is not supported:", "", "", "", ""},
-            {"Discard chart", "", "", "", ""},
-            {"Disconnected. Click to connect.", "", "", "", ""},
-            {"Double click to expand/collapse", "", "", "", ""},
-            {"Double click to visualize", "", "", "", ""},
-            {"DurationDaysHoursMinutes", 0, 13, 54, ""},
-            {"DurationDaysHoursMinutes", 1, 13, 54, ""},
-            {"DurationDaysHoursMinutes", 2, 13, 54, ""},
-            {"DurationDaysHoursMinutes", 1024, 13, 45, ""},
-            {"DurationHoursMinutes", 0, 13, "", ""},
-            {"DurationHoursMinutes", 1, 0, "", ""},
-            {"DurationHoursMinutes", 1, 1, "", ""},
-            {"DurationHoursMinutes", 2, 42, "", ""},
-            {"DurationMinutes", 0, "", "", ""},
-            {"DurationMinutes", 1, "", "", ""},
-            {"DurationMinutes", 2, "", "", ""},
-            {"DurationSeconds", 0, "", "", ""},
-            {"DurationSeconds", 1, "", "", ""},
-            {"DurationSeconds", 2, "", "", ""},
-            {"Empty array", "", "", "", ""},
-            {"Error", "", "", "", ""},
-            {"Error: MBeans already exist", "", "", "", ""},
-            {"Error: MBeans do not exist", "", "", "", ""},
-            {"Event", "", "", "", ""},
-            {"Exit", "", "", "", ""},
-            {"Exit.mnemonic", "", "", "", ""},
-            {"expand", "", "", "", ""},
-            {"Fail to load plugin", "", "", "", ""},
-            {"FileChooser.fileExists.cancelOption", "", "", "", ""},
-            {"FileChooser.fileExists.message", "PhonyFileName", "", "", ""},
-            {"FileChooser.fileExists.okOption", "", "", "", ""},
-            {"FileChooser.fileExists.title", "", "", "", ""},
-            {"FileChooser.savedFile", "PhonyFilePath", "PhonyFileSize", "", ""},
-            {"FileChooser.saveFailed.message", "PhonyFilePath", "PhonyMessage", "", ""},
-            {"FileChooser.saveFailed.title", "", "", "", ""},
-            {"Free physical memory", "", "", "", ""},
-            {"Free swap space", "", "", "", ""},
-            {"Garbage collector", "", "", "", ""},
-            {"GC time", "", "", "", ""},
-            {"GC time details", 54, "Phony", 11, ""},
-            {"GcInfo", "Phony", -1, 768, ""},
-            {"GcInfo", "Phony", 0, 768, ""},
-            {"GcInfo", "Phony", 1, 768, ""},
-            {"Heap", "", "", "", ""},
-            {"Heap Memory Usage", "", "", "", ""},
-            {"Help.AboutDialog.accessibleDescription", "", "", "", ""},
-            {"Help.AboutDialog.jConsoleVersion", "DummyVersion", "", "", ""},
-            {"Help.AboutDialog.javaVersion", "DummyVersion", "", "", ""},
-            {"Help.AboutDialog.masthead.accessibleName", "", "", "", ""},
-            {"Help.AboutDialog.masthead.title", "", "", "", ""},
-            {"Help.AboutDialog.title", "", "", "", ""},
-            {"Help.AboutDialog.userGuideLink", "DummyMessage", "", "", ""},
-            {"Help.AboutDialog.userGuideLink.mnemonic", "", "", "", ""},
-            {"Help.AboutDialog.userGuideLink.url", "DummyURL", "", "", ""},
-            {"HelpMenu.About.title", "", "", "", ""},
-            {"HelpMenu.About.title.mnemonic", "", "", "", ""},
-            {"HelpMenu.UserGuide.title", "", "", "", ""},
-            {"HelpMenu.UserGuide.title.mnemonic", "", "", "", ""},
-            {"HelpMenu.title", "", "", "", ""},
-            {"HelpMenu.title.mnemonic", "", "", "", ""},
-            {"Hotspot MBeans...", "", "", "", ""},
-            {"Hotspot MBeans....mnemonic", "", "", "", ""},
-            {"Hotspot MBeans.dialog.accessibleDescription", "", "", "", ""},
-            {"Impact", "", "", "", ""},
-            {"Info", "", "", "", ""},
-            {"INFO", "", "", "", ""},
-            {"Invalid plugin path", "", "", "", ""},
-            {"Invalid URL", "", "", "", ""},
-            {"Is", "", "", "", ""},
-            {"Java Monitoring & Management Console", "", "", "", ""},
-            {"Java Virtual Machine", "", "", "", ""},
-            {"JConsole: ", "", "", "", ""},
-            {"JConsole.accessibleDescription", "", "", "", ""},
-            {"JConsole version", "PhonyVersion", "", "", ""},
-            {"JIT compiler", "", "", "", ""},
-            {"Library path", "", "", "", ""},
-            {"Live Threads", "", "", "", ""},
-            {"Loaded", "", "", "", ""},
-            {"Local Process:", "", "", "", ""},
-            {"Local Process:.mnemonic", "", "", "", ""},
-            {"Manage Hotspot MBeans in: ", "", "", "", ""},
-            {"Management Not Enabled", "", "", "", ""},
-            {"Management Will Be Enabled", "", "", "", ""},
-            {"Masthead.font", "", "", "", ""},
-            {"Max", "", "", "", ""},
-            {"Max", "", "", "", ""},
-            {"Maximum heap size", "", "", "", ""},
-            {"MBeanAttributeInfo", "", "", "", ""},
-            {"MBeanInfo", "", "", "", ""},
-            {"MBeanNotificationInfo", "", "", "", ""},
-            {"MBeanOperationInfo", "", "", "", ""},
-            {"MBeans", "", "", "", ""},
-            {"MBeansTab.clearNotificationsButton", "", "", "", ""},
-            {"MBeansTab.clearNotificationsButton.mnemonic", "", "", "", ""},
-            {"MBeansTab.clearNotificationsButton.toolTip", "", "", "", ""},
-            {"MBeansTab.compositeNavigationMultiple", 0, 0, "", ""},
-            {"MBeansTab.compositeNavigationSingle", "", "", "", ""},
-            {"MBeansTab.refreshAttributesButton", "", "", "", ""},
-            {"MBeansTab.refreshAttributesButton.mnemonic", "", "", "", ""},
-            {"MBeansTab.refreshAttributesButton.toolTip", "", "", "", ""},
-            {"MBeansTab.subscribeNotificationsButton", "", "", "", ""},
-            {"MBeansTab.subscribeNotificationsButton.mnemonic", "", "", "", ""},
-            {"MBeansTab.subscribeNotificationsButton.toolTip", "", "", "", ""},
-            {"MBeansTab.tabularNavigationMultiple", 0, 0, "", ""},
-            {"MBeansTab.tabularNavigationSingle", "", "", "", ""},
-            {"MBeansTab.unsubscribeNotificationsButton", "", "", "", ""},
-            {"MBeansTab.unsubscribeNotificationsButton.mnemonic", "", "", "", ""},
-            {"MBeansTab.unsubscribeNotificationsButton.toolTip", "", "", "", ""},
-            {"Memory", "", "", "", ""},
-            {"MemoryPoolLabel", "PhonyMemoryPool", "", "", ""},
-            {"MemoryTab.heapPlotter.accessibleName", "", "", "", ""},
-            {"MemoryTab.infoLabelFormat", "UsedCount", "CommittedCount", "MaxCount", ""},
-            {"MemoryTab.nonHeapPlotter.accessibleName", "", "", "", ""},
-            {"MemoryTab.poolChart.aboveThreshold", "Threshold", "", "", ""},
-            {"MemoryTab.poolChart.accessibleName", "", "", "", ""},
-            {"MemoryTab.poolChart.belowThreshold", "Threshold", "", "", ""},
-            {"MemoryTab.poolPlotter.accessibleName", "PhonyMemoryPool", "", "", ""},
-            {"Message", "", "", "", ""},
-            {"Method successfully invoked", "", "", "", ""},
-            {"Monitor locked", "", "", "", ""},
-            {"Minimize All", "", "", "", ""},
-            {"Minimize All.mnemonic", "", "", "", ""},
-            {"Name", "", "", "", ""},
-            {"Name and Build", "PhonyName", "PhonyBuild", "", ""},
-            {"Name Build and Mode", "PhonyName", "PhonyBuild", "PhonyMode", ""},
-            {"Name State", "PhonyName", "PhonyState", "", ""},
-            {"Name State LockName", "PhonyName", "PhonyState", "PhonyLock", ""},
-            {"Name State LockName LockOwner", "PhonyName", "PhonyState", "PhonyLock", "PhonyOwner"},
-            {"New Connection...", "", "", "", ""},
-            {"New Connection....mnemonic", "", "", "", ""},
-            {"No deadlock detected", "", "", "", ""},
-            {"Non-Heap", "", "", "", ""},
-            {"Non-Heap Memory Usage", "", "", "", ""},
-            {"Notification", "", "", "", ""},
-            {"Notification buffer", "", "", "", ""},
-            {"Notifications", "", "", "", ""},
-            {"NotifTypes", "", "", "", ""},
-            {"Number of Loaded Classes", "", "", "", ""},
-            {"Number of processors", "", "", "", ""},
-            {"Number of Threads", "", "", "", ""},
-            {"ObjectName", "", "", "", ""},
-            {"Operating System", "", "", "", ""},
-            {"Operation", "", "", "", ""},
-            {"Operation invocation", "", "", "", ""},
-            {"Operation return value", "", "", "", ""},
-            {"Operations", "", "", "", ""},
-            {"Overview", "", "", "", ""},
-            {"OverviewPanel.plotter.accessibleName", "PhonyPlotter", "", "", ""},
-            {"Parameter", "", "", "", ""},
-            {"Password: ", "", "", "", ""},
-            {"Password: .mnemonic", "", "", "", ""},
-            {"Password.accessibleName", "", "", "", ""},
-            {"Peak", "", "", "", ""},
-            {"Perform GC", "", "", "", ""},
-            {"Perform GC.mnemonic", "", "", "", ""},
-            {"Perform GC.toolTip", "", "", "", ""},
-            {"Plotter.accessibleName", "", "", "", ""},
-            {"Plotter.accessibleName.keyAndValue", "Key", "Value", "", ""},
-            {"Plotter.accessibleName.noData", "", "", "", ""},
-            {"Plotter.saveAsMenuItem", "", "", "", ""},
-            {"Plotter.saveAsMenuItem.mnemonic", "", "", "", ""},
-            {"Plotter.timeRangeMenu", "", "", "", ""},
-            {"Plotter.timeRangeMenu.mnemonic", "", "", "", ""},
-            {"plot", "", "", "", ""},
-            {"Problem adding listener", "", "", "", ""},
-            {"Problem displaying MBean", "", "", "", ""},
-            {"Problem invoking", "", "", "", ""},
-            {"Problem removing listener", "", "", "", ""},
-            {"Problem setting attribute", "", "", "", ""},
-            {"Process CPU time", "", "", "", ""},
-            {"Readable", "", "", "", ""},
-            {"Reconnect", "", "", "", ""},
-            {"Remote Process:", "", "", "", ""},
-            {"Remote Process:.mnemonic", "", "", "", ""},
-            {"Remote Process.textField.accessibleName", "", "", "", ""},
-            {"remoteTF.usage", "", "", "", ""},
-            {"Restore All", "", "", "", ""},
-            {"Restore All.mnemonic", "", "", "", ""},
-            {"ReturnType", "", "", "", ""},
-            {"SeqNum", "", "", "", ""},
-            {"Size Bytes", 512, "", "", ""},
-            {"Size Gb", 512, "", "", ""},
-            {"Size Kb", 512, "", "", ""},
-            {"Size Mb", 512, "", "", ""},
-            {"Source", "", "", "", ""},
-            {"Stack trace", "", "", "", ""},
-            {"SummaryTab.headerDateTimeFormat", "", "", "", ""},
-            {"SummaryTab.pendingFinalization.label", "", "", "", ""},
-            {"SummaryTab.pendingFinalization.value", "ObjectCount", "", "", ""},
-            {"SummaryTab.tabName", "", "", "", ""},
-            {"SummaryTab.vmVersion",  "VMName", "VMVersion", "", ""},
-            {"ThreadTab.infoLabelFormat", "LiveCount", "PeakCount", "TotalCount", ""},
-            {"ThreadTab.threadInfo.accessibleName", "", "", "", ""},
-            {"ThreadTab.threadPlotter.accessibleName", "", "", "", ""},
-            {"Threads", "", "", "", ""},
-            {"Threshold", "", "", "", ""},
-            {"Tile", "", "", "", ""},
-            {"Tile.mnemonic", "", "", "", ""},
-            {"Time", "", "", "", ""},
-            {"Time Range:", "", "", "", ""},
-            {"Time Range:.mnemonic", "", "", "", ""},
-            {"TimeStamp", "", "", "", ""},
-            {"Total classes loaded", "", "", "", ""},
-            {"Total classes unloaded", "", "", "", ""},
-            {"Total compile time", "", "", "", ""},
-            {"Total Loaded", "", "", "", ""},
-            {"Total physical memory", "", "", "", ""},
-            {"Total swap space", "", "", "", ""},
-            {"Total threads started", "", "", "", ""},
-            {"Type", "", "", "", ""},
-            {"Unavailable", "", "", "", ""},
-            {"UNKNOWN", "", "", "", ""},
-            {"Unregister", "", "", "", ""},
-            {"Uptime", "", "", "", ""},
-            {"Usage Threshold", "", "", "", ""},
-            {"Used", "", "", "", ""},
-            {"Username: ", "", "", "", ""},
-            {"Username: .mnemonic", "", "", "", ""},
-            {"Username.accessibleName", "", "", "", ""},
-            {"UserData", "", "", "", ""},
-            {"Value", "", "", "", ""},
-            {"Vendor", "", "", "", ""},
-            {"Verbose Output", "", "", "", ""},
-            {"Verbose Output.toolTip", "", "", "", ""},
-            {"visualize", "", "", "", ""},
-            {"VM", "", "", "", ""},
-            {"VMInternalFrame.accessibleDescription", "", "", "", ""},
-            {"VM arguments", "", "", "", ""},
-            {"Virtual Machine", "", "", "", ""},
-            {"Window", "", "", "", ""},
-            {"Window.mnemonic", "", "", "", ""},
-            {"Writable", "", "", "", ""},
-            {"zz usage text", "PhonyName", "", "", ""},
-        };
-        //boolean verbose = false;
-        boolean verbose = true;
-
-        long badLookups = 0;
-        System.out.println("Start...");
-        for (int ii = 0; ii < testData.length; ii++) {
-            String key = (String)testData[ii][0];
-
-            if (key.endsWith(".mnemonic")) {
-                String baseKey = key.substring(0, key.length() - ".mnemonic".length());
-                int mnemonic = Resources.getMnemonicInt(baseKey);
-                if (mnemonic == 0) {
-                    badLookups++;
-                    System.out.println("****lookup failed for key = " + key);
+    public static void main(String... args) {
+        List<String> errors = new ArrayList<>();
+        // Ensure that all Message fields have a corresponding key/value
+        // in the resource bundle and that mnemonics can be looked
+        // up where applicable.
+        ResourceBundle rb = ResourceBundle.getBundle(RESOURCE_BUNDLE);
+        for (Field field : Messages.class.getFields()) {
+            if (isResourceKeyField(field)) {
+                String resourceKey = field.getName();
+                String message = readField(field);
+                if (message.startsWith(MISSING_RESOURCE_KEY_PREFIX)) {
+                    errors.add("Can't find message (and perhaps mnemonic) for "
+                            + Messages.class.getSimpleName() + "."
+                            + resourceKey + " in resource bundle.");
                 } else {
-                    if (verbose) {
-                        System.out.println("    mnemonic: " + KeyEvent.getKeyText(mnemonic));
+                    String resourceMessage = rb.getString(resourceKey);
+                    if (hasMnemonicIdentifier(resourceMessage)) {
+                        int mi = Resources.getMnemonicInt(message);
+                        if (mi == 0) {
+                            errors.add("Could not look up mnemonic for message '"
+                                    + message + "'.");
+                        }
                     }
                 }
-                continue;
-            }
-
-            String ss = Resources.getText(key,
-                                          testData[ii][1],
-                                          testData[ii][2],
-                                          testData[ii][3],
-                                          testData[ii][4]);
-            if (ss.startsWith("missing resource key")) {
-                badLookups++;
-                System.out.println("****lookup failed for key = " + key);
-            } else {
-                if (verbose) {
-                    System.out.println("  " + ss);
-                }
             }
         }
-        if (badLookups > 0) {
-            throw new Error ("Resource lookup failed " + badLookups +
-                             " time(s); Test failed");
+
+        // Ensure that there is Message class field for every resource key.
+        for (String key : Collections.list(rb.getKeys())) {
+            try {
+                Messages.class.getField(key);
+            } catch (NoSuchFieldException nfe) {
+                errors.add("Can't find static field ("
+                        + Messages.class.getSimpleName() + "." + key
+                        + ") matching '" + key
+                        + "' in resource bundle. Unused message?");
+            }
         }
-        System.out.println("...Finished.");
+
+        if (errors.size() > 0) {
+            throwError(errors);
+        }
+    }
+
+    private static String readField(Field field) {
+        try {
+            return (String) field.get(null);
+        } catch (IllegalArgumentException | IllegalAccessException e) {
+            throw new Error("Could not access field " + field.getName()
+                    + " when trying to read resource message.");
+        }
+    }
+
+    private static boolean isResourceKeyField(Field field) {
+        int modifiers = field.getModifiers();
+        return Modifier.isPublic(modifiers) && Modifier.isStatic(modifiers);
+    }
+
+    private static boolean hasMnemonicIdentifier(String s) {
+        for (int i = 0; i < s.length() - 1; i++) {
+            if (s.charAt(i) == '&') {
+                if (s.charAt(i + 1) != '&') {
+                    return true;
+                } else {
+                    i++;
+                }
+            }
+        }
+        return false;
+    }
+
+    private static void throwError(List<String> errors) {
+        StringBuffer buffer = new StringBuffer();
+        buffer.append("Found ");
+        buffer.append(errors.size());
+        buffer.append(" error(s) when checking one-to-one mapping ");
+        buffer.append("between Message and resource bundle keys in ");
+        buffer.append(RESOURCE_BUNDLE);
+        buffer.append(" with ");
+        buffer.append(Locale.getDefault());
+        buffer.append(" locale.");
+        buffer.append(NEW_LINE);
+        int errorIndex = 1;
+        for (String error : errors) {
+            buffer.append("Error ");
+            buffer.append(errorIndex);
+            buffer.append(": ");
+            buffer.append(error);
+            buffer.append(NEW_LINE);
+            errorIndex++;
+        }
+        throw new Error(buffer.toString());
     }
 }
--- a/test/sun/tools/jconsole/ResourceCheckTest.sh	Tue Dec 23 14:01:21 2014 -0800
+++ b/test/sun/tools/jconsole/ResourceCheckTest.sh	Wed Jan 07 12:22:36 2015 -0800
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2004, 2007, 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
@@ -54,7 +54,7 @@
 
 OS=`uname -s`
 case "$OS" in
-   SunOS | Linux )
+   SunOS | Linux | Darwin)
       PATHSEP=":"
       ;;