Merge
authorlana
Thu, 18 Feb 2016 13:41:11 -0800
changeset 36010 8fe81891e76c
parent 35957 3e2642f1ca32 (current diff)
parent 36009 2dbdf909ac81 (diff)
child 36011 77231de79e04
child 36126 b0b1bfc7049e
Merge
jdk/make/src/classes/build/tools/buildmetaindex/BuildMetaIndex.java
jdk/src/java.base/share/classes/sun/misc/MetaIndex.java
jdk/src/java.base/share/classes/sun/misc/NativeSignalHandler.java
jdk/src/java.base/share/native/libjava/NativeSignalHandler.c
--- a/jdk/make/Tools.gmk	Thu Feb 18 11:30:16 2016 -0800
+++ b/jdk/make/Tools.gmk	Thu Feb 18 13:41:11 2016 -0800
@@ -41,10 +41,6 @@
 TOOL_ADDJSUM = $(JAVA_SMALL) -cp $(BUILDTOOLS_OUTPUTDIR)/jdk_tools_classes \
     build.tools.addjsum.AddJsum
 
-# The buildmetaindex tool creates a meta-index to make core class loaders lazier.
-TOOL_BUILDMETAINDEX = $(JAVA_SMALL) -cp $(BUILDTOOLS_OUTPUTDIR)/jdk_tools_classes \
-    build.tools.buildmetaindex.BuildMetaIndex
-
 TOOL_COMPILEFONTCONFIG = $(JAVA_SMALL) -cp $(BUILDTOOLS_OUTPUTDIR)/jdk_tools_classes \
     build.tools.compilefontconfig.CompileFontConfig
 
--- a/jdk/make/mapfiles/libjava/mapfile-vers	Thu Feb 18 11:30:16 2016 -0800
+++ b/jdk/make/mapfiles/libjava/mapfile-vers	Thu Feb 18 13:41:11 2016 -0800
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 1997, 2016, 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
@@ -244,10 +244,9 @@
 		Java_java_util_TimeZone_getSystemTimeZoneID;
 		Java_java_util_TimeZone_getSystemGMTOffsetID;
 		Java_java_util_concurrent_atomic_AtomicLong_VMSupportsCS8;
-		Java_sun_misc_NativeSignalHandler_handle0;
-		Java_sun_misc_Signal_findSignal;
-		Java_sun_misc_Signal_handle0;
-		Java_sun_misc_Signal_raise0;
+		Java_jdk_internal_misc_Signal_findSignal0;
+		Java_jdk_internal_misc_Signal_handle0;
+		Java_jdk_internal_misc_Signal_raise0;
               Java_sun_reflect_ConstantPool_getClassAt0;
               Java_sun_reflect_ConstantPool_getClassAtIfLoaded0;
               Java_sun_reflect_ConstantPool_getClassRefIndexAt0;
--- a/jdk/make/mapfiles/libjava/reorder-sparc	Thu Feb 18 11:30:16 2016 -0800
+++ b/jdk/make/mapfiles/libjava/reorder-sparc	Thu Feb 18 13:41:11 2016 -0800
@@ -35,8 +35,6 @@
 text: .text%Java_java_lang_System_setOut0;
 text: .text%Java_java_lang_System_setErr0;
 text: .text%Java_java_lang_System_identityHashCode;
-text: .text%Java_sun_misc_Signal_findSignal;
-text: .text%Java_sun_misc_Signal_handle0;
 text: .text%JNU_NewObjectByName;
 text: .text%Java_java_io_UnixFileSystem_initIDs;
 text: .text%Java_java_io_UnixFileSystem_canonicalize0;
--- a/jdk/make/mapfiles/libjava/reorder-sparcv9	Thu Feb 18 11:30:16 2016 -0800
+++ b/jdk/make/mapfiles/libjava/reorder-sparcv9	Thu Feb 18 13:41:11 2016 -0800
@@ -39,8 +39,6 @@
 text: .text%Java_java_lang_System_setOut0;
 text: .text%Java_java_lang_System_setErr0;
 text: .text%Java_java_lang_System_identityHashCode;
-text: .text%Java_sun_misc_Signal_findSignal;
-text: .text%Java_sun_misc_Signal_handle0;
 text: .text%JNU_NewObjectByName;
 text: .text%Java_java_io_UnixFileSystem_initIDs;
 text: .text%Java_java_io_UnixFileSystem_canonicalize0;
--- a/jdk/make/mapfiles/libjava/reorder-x86	Thu Feb 18 11:30:16 2016 -0800
+++ b/jdk/make/mapfiles/libjava/reorder-x86	Thu Feb 18 13:41:11 2016 -0800
@@ -81,8 +81,6 @@
 text: .text%Java_java_lang_Throwable_getStackTraceDepth;
 text: .text%Java_java_lang_Throwable_getStackTraceElement;
 text: .text%Java_java_lang_System_identityHashCode;
-text: .text%Java_sun_misc_Signal_findSignal;
-text: .text%Java_sun_misc_Signal_handle0;
 text: .text%JNU_NotifyAll;
 # Test LoadFrame
 text: .text%JNU_CallMethodByName;
--- a/jdk/make/src/classes/build/tools/buildmetaindex/BuildMetaIndex.java	Thu Feb 18 11:30:16 2016 -0800
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,398 +0,0 @@
-/*
- * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package build.tools.buildmetaindex;
-
-import java.io.*;
-import java.util.*;
-import java.util.jar.*;
-
-/** Constructs a meta-index of the specified jar files. The meta-index
-    contains prefixes of packages contained in these jars, indexed by
-    the jar file name. It is intended to be consumed by the JVM to
-    allow the boot class loader to be made lazier. For example, when
-    class data sharing is enabled, the presence of the meta-index
-    allows the JVM to skip opening rt.jar if all of the dependent
-    classes of the application are in the shared archive. A similar
-    mechanism could be useful at the application level as well, for
-    example to make the extension class loader lazier.
-
-    <p> The contents of the meta-index file for jre/lib look something
-    like this:
-
-    <PRE>
-% VERSION 2
-# charsets.jar
-sun/
-# jce.jar
-javax/
-! jsse.jar
-sun/
-com/sun/net/
-javax/
-com/sun/security/
-! rt.jar
-org/w3c/
-com/sun/image/
-com/sun/org/
-com/sun/imageio/
-com/sun/accessibility/
-javax/
-...
-    </PRE>
-
-    <p> It is a current invariant of the code in the JVM which
-    consumes the meta-index that the meta-index indexes only jars in
-    one directory. It is acceptable for jars in that directory to not
-    be mentioned in the meta-index. The meta-index is designed more to
-    be able to perform a quick rejection test of the presence of a
-    particular class in a particular jar file than to be a precise
-    index of the contents of the jar.  */
-
-public class BuildMetaIndex {
-    public static void main(String[] args) throws IOException {
-        /* The correct usage of this class is as following:
-         * java BuildMetaIndex -o <meta-index> <a list of jar files>
-         * So the argument length should be at least 3 and the first argument should
-         * be '-o'.
-         */
-        if (args.length < 3 ||
-            !args[0].equals("-o")) {
-            printUsage();
-            System.exit(1);
-        }
-
-        try {
-            PrintStream out = new PrintStream(new FileOutputStream(args[1]));
-            out.println("% VERSION 2");
-            out.println("% WARNING: this file is auto-generated; do not edit");
-            out.println("% UNSUPPORTED: this file and its format may change and/or");
-            out.println("%   may be removed in a future release");
-            for (int i = 2; i < args.length; i++) {
-                String filename = args[i];
-                JarMetaIndex jmi = new JarMetaIndex(filename);
-                HashSet<String> index = jmi.getMetaIndex();
-                if (index == null) {
-                    continue;
-                }
-                /*
-                 * meta-index file plays different role in JVM and JDK side.
-                 * On the JVM side, meta-index file is used to speed up locating the
-                 * class files only while on the JDK side, meta-index file is used to speed
-                 * up the resources file and class file.
-                 * To help the JVM and JDK code to better utilize the information in meta-index
-                 * file, we mark the jar file differently. Here is the current rule we use (See
-                 * JarFileKind.getMarkChar() method. )
-                 * For jar file containing only class file, we put '!' before the jar file name;
-                 * for jar file containing only resources file, we put '@' before the jar file name;
-                 * for jar file containing both resources and class file, we put '#' before the jar name.
-                 * Notice the fact that every jar file contains at least the manifest file, so when
-                 * we say "jar file containing only class file", we don't include that file.
-                 */
-
-                out.println(jmi.getJarFileKind().getMarkerChar() + " " + filename);
-                for (String entry : index) {
-                    out.println(entry);
-                }
-
-            }
-            out.flush();
-            out.close();
-        } catch (FileNotFoundException fnfe) {
-            System.err.println("FileNotFoundException occurred");
-            System.exit(2);
-        }
-    }
-
-    private static void printUsage() {
-        String usage =
-            "BuildMetaIndex is used to generate a meta index file for the jar files\n" +
-            "you specified. The following is its usage:\n" +
-            " java BuildMetaIndex -o <the output meta index file> <a list of jar files> \n" +
-            " You can specify *.jar to refer to all the jar files in the current directory";
-
-        System.err.println(usage);
-    }
-}
-
-enum JarFileKind {
-
-    CLASSONLY ('!'),
-    RESOURCEONLY ('@'),
-    MIXED ('#');
-
-    private char markerChar;
-
-    JarFileKind(char markerChar) {
-        this.markerChar = markerChar;
-    }
-
-    public char getMarkerChar() {
-        return markerChar;
-    }
-}
-
-/*
- * JarMetaIndex associates the jar file with a set of what so called
- * "meta-index" of the jar file. Essentially, the meta-index is a list
- * of class prefixes and the plain files contained in META-INF directory (
- * not include the manifest file itself). This will help sun.misc.URLClassPath
- * to quickly locate the resource file and hotspot VM to locate the class file.
- *
- */
-class JarMetaIndex {
-    private JarFile jar;
-    private volatile HashSet<String> indexSet;
-
-    /*
-     * A hashmap contains a mapping from the prefix string to
-     * a hashset which contains a set of the second level of prefix string.
-     */
-    private HashMap<String, HashSet<String>> knownPrefixMap = new HashMap<>();
-
-    /**
-     * Special value for the HashSet to indicate that there are classes in
-     * the top-level package.
-     */
-    private static final String TOP_LEVEL = "TOP";
-
-    /*
-     * A class for mapping package prefixes to the number of
-     * levels of package elements to include.
-     */
-    static class ExtraLevel {
-        public ExtraLevel(String prefix, int levels) {
-            this.prefix = prefix;
-            this.levels = levels;
-        }
-        String prefix;
-        int levels;
-    }
-
-    /*
-     * A list of the special-cased package names.
-     */
-    private static ArrayList<ExtraLevel> extraLevels = new ArrayList<>();
-
-    static {
-        // The order of these statements is significant,
-        // since we stop looking after the first match.
-
-        // Need more precise information to disambiguate
-        // (illegal) references from applications to
-        // obsolete backported collections classes in
-        // com/sun/java/util
-        extraLevels.add(new ExtraLevel("com/sun/java/util/", Integer.MAX_VALUE));
-        extraLevels.add(new ExtraLevel("com/sun/java/", 4));
-        // Need more information than just first two package
-        // name elements to determine that classes in
-        // deploy.jar are not in rt.jar
-        extraLevels.add(new ExtraLevel("com/sun/", 3));
-        // Need to make sure things in jfr.jar aren't
-        // confused with other com/oracle/** packages
-        extraLevels.add(new ExtraLevel("com/oracle/jrockit", 3));
-    }
-
-
-    /*
-     * We add maximum 5 second level entries to "sun", "jdk", "java" and
-     * "javax" entries. Tune this parameter to get a balance on the
-     * cold start and footprint.
-     */
-    private static final int MAX_PKGS_WITH_KNOWN_PREFIX = 5;
-
-    private JarFileKind jarFileKind;
-
-    JarMetaIndex(String fileName) throws IOException {
-        jar = new JarFile(fileName);
-        knownPrefixMap.put("sun", new HashSet<String>());
-        knownPrefixMap.put("jdk", new HashSet<String>());
-        knownPrefixMap.put("java", new HashSet<String>());
-        knownPrefixMap.put("javax", new HashSet<String>());
-    }
-
-    /* Returns a HashSet contains the meta index string. */
-    HashSet<String> getMetaIndex() {
-        if (indexSet == null) {
-            synchronized(this) {
-                if (indexSet == null) {
-                    indexSet = new HashSet<>();
-                    Enumeration<JarEntry> entries = jar.entries();
-                    boolean containsOnlyClass = true;
-                    boolean containsOnlyResource = true;
-                    while (entries.hasMoreElements()) {
-                        JarEntry entry = entries.nextElement();
-                        String name = entry.getName();
-                        /* We only look at the non-directory entry.
-                           MANIFEST file is also skipped. */
-                        if (entry.isDirectory()
-                            || name.equals("META-INF/MANIFEST.MF")) {
-                            continue;
-                        }
-
-                        /* Once containsOnlyResource or containsOnlyClass
-                           turns to false, no need to check the entry type.
-                        */
-                        if (containsOnlyResource || containsOnlyClass) {
-                            if (name.endsWith(".class")) {
-                                containsOnlyResource = false;
-                            } else {
-                                containsOnlyClass = false;
-                            }
-                        }
-
-                        /* Add the full-qualified name of plain files under
-                           META-INF directory to the indexSet.
-                         */
-                        if (name.startsWith("META-INF")) {
-                            indexSet.add(name);
-                            continue;
-                        }
-
-                        /* Add the prefix name to the knownPrefixMap if the
-                           name starts with any string in the knownPrefix list.
-                        */
-                        if (isPrefixKnown(name)) {
-                            continue;
-                        }
-
-                        String[] pkgElements = name.split("/");
-                        // Last one is the class name; definitely ignoring that
-                        if (pkgElements.length > 2) {
-                            String meta = "";
-
-                            // Default is 2 levels of package elements
-                            int levels = 2;
-
-                            // But for some packages we add more elements
-                            for(ExtraLevel el : extraLevels) {
-                                if (name.startsWith(el.prefix)) {
-                                    levels = el.levels;
-                                    break;
-                                }
-                            }
-                            for (int i = 0; i < levels && i < pkgElements.length - 1; i++) {
-                                meta += pkgElements[i] + "/";
-                            }
-
-                            if (!meta.equals("")) {
-                                indexSet.add(meta);
-                            }
-                        }
-
-                    } // end of "while" loop;
-
-                    // Add the second level package names to the indexSet for
-                    // the predefined names such as "sun", "java" and "javax".
-                    addKnownPrefix();
-
-                    /* Set "jarFileKind" attribute. */
-                    if (containsOnlyClass) {
-                        jarFileKind = JarFileKind.CLASSONLY;
-                    } else if (containsOnlyResource) {
-                        jarFileKind = JarFileKind.RESOURCEONLY;
-                    } else {
-                        jarFileKind = JarFileKind.MIXED;
-                    }
-                }
-            }
-        }
-        return indexSet;
-    }
-
-    /*
-     * Checks to see whether the name starts with a string which is in the predefined
-     * list. If it is among one of the predefined prefixes, add it to the knowPrefixMap
-     * and returns true, otherwise, returns false.
-     * Returns true if the name is in a predefined prefix list. Otherwise, returns false.
-     */
-    boolean isPrefixKnown(String name) {
-        int firstSlashIndex = name.indexOf("/");
-        if (firstSlashIndex == -1) {
-            return false;
-        }
-
-        String firstPkgElement = name.substring(0, firstSlashIndex);
-        HashSet<String> pkgSet = knownPrefixMap.get(firstPkgElement);
-
-        /* The name does not starts with "sun", "java" or "javax". */
-        if (pkgSet == null) {
-            return false;
-        }
-
-        /* Add the second level package name to the corresponding hashset. */
-        int secondSlashIndex = name.indexOf("/", firstSlashIndex+1);
-        if (secondSlashIndex == -1) {
-            pkgSet.add(TOP_LEVEL);
-        } else {
-            String secondPkgElement = name.substring(firstSlashIndex+1, secondSlashIndex);
-            pkgSet.add(secondPkgElement);
-        }
-
-        return true;
-    }
-
-    /*
-     * Adds all the second level package elements for "sun", "java" and "javax"
-     * if the corresponding jar file does not contain more than
-     * MAX_PKGS_WITH_KNOWN_PREFIX such entries.
-     */
-    void addKnownPrefix() {
-        if (indexSet == null) {
-            return;
-        }
-
-        /* Iterate through the hash map, add the second level package names
-         * to the indexSet if has any.
-         */
-        for (String key : knownPrefixMap.keySet()) {
-            HashSet<String> pkgSetStartsWithKey = knownPrefixMap.get(key);
-            int setSize = pkgSetStartsWithKey.size();
-
-            if (setSize == 0) {
-                continue;
-            }
-            if (setSize > JarMetaIndex.MAX_PKGS_WITH_KNOWN_PREFIX ||
-                pkgSetStartsWithKey.contains(TOP_LEVEL)) {
-                 indexSet.add(key + "/");
-            } else {
-                /* If the set contains less than MAX_PKGS_WITH_KNOWN_PREFIX, add
-                 * them to the indexSet of the MetaIndex object.
-                 */
-                for (String secondPkgElement : pkgSetStartsWithKey) {
-                    indexSet.add(key + "/" + secondPkgElement);
-                }
-            }
-        } // end the outer "for"
-    }
-
-    JarFileKind getJarFileKind() {
-        // Build meta index if it hasn't.
-        if (indexSet == null) {
-            indexSet = getMetaIndex();
-        }
-        return jarFileKind;
-    }
-}
--- a/jdk/make/src/classes/build/tools/module/boot.modules	Thu Feb 18 11:30:16 2016 -0800
+++ b/jdk/make/src/classes/build/tools/module/boot.modules	Thu Feb 18 13:41:11 2016 -0800
@@ -19,9 +19,11 @@
 jdk.charsets
 jdk.deploy
 jdk.deploy.osx
-jdk.vm.cds
 jdk.httpserver
 jdk.jfr
+jdk.net
+jdk.vm.cds
+jdk.vm.ci
 jdk.management
 jdk.management.cmm
 jdk.management.resource
@@ -30,4 +32,3 @@
 jdk.security.auth
 jdk.security.jgss
 jdk.snmp
-jdk.vm.ci
--- a/jdk/src/java.base/share/classes/java/lang/Double.java	Thu Feb 18 11:30:16 2016 -0800
+++ b/jdk/src/java.base/share/classes/java/lang/Double.java	Thu Feb 18 13:41:11 2016 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1994, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1994, 2016, 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
@@ -301,7 +301,7 @@
             if(d == 0.0) {
                 answer.append("0.0p0");
             } else {
-                boolean subnormal = (d < DoubleConsts.MIN_NORMAL);
+                boolean subnormal = (d < Double.MIN_NORMAL);
 
                 // Isolate significand bits and OR in a high-order bit
                 // so that the string representation has a known
@@ -329,7 +329,7 @@
                 // exponent (the representation of a subnormal uses
                 // E_min -1).
                 answer.append(subnormal ?
-                              DoubleConsts.MIN_EXPONENT:
+                              Double.MIN_EXPONENT:
                               Math.getExponent(d));
             }
             return answer.toString();
@@ -574,7 +574,7 @@
      * @since 1.8
      */
     public static boolean isFinite(double d) {
-        return Math.abs(d) <= DoubleConsts.MAX_VALUE;
+        return Math.abs(d) <= Double.MAX_VALUE;
     }
 
     /**
--- a/jdk/src/java.base/share/classes/java/lang/Float.java	Thu Feb 18 11:30:16 2016 -0800
+++ b/jdk/src/java.base/share/classes/java/lang/Float.java	Thu Feb 18 13:41:11 2016 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1994, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1994, 2016, 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,8 +26,6 @@
 package java.lang;
 
 import jdk.internal.math.FloatingDecimal;
-import jdk.internal.math.FloatConsts;
-import jdk.internal.math.DoubleConsts;
 import jdk.internal.HotSpotIntrinsicCandidate;
 
 /**
@@ -282,15 +280,15 @@
      * @author Joseph D. Darcy
      */
     public static String toHexString(float f) {
-        if (Math.abs(f) < FloatConsts.MIN_NORMAL
+        if (Math.abs(f) < Float.MIN_NORMAL
             &&  f != 0.0f ) {// float subnormal
             // Adjust exponent to create subnormal double, then
             // replace subnormal double exponent with subnormal float
             // exponent
             String s = Double.toHexString(Math.scalb((double)f,
                                                      /* -1022+126 */
-                                                     DoubleConsts.MIN_EXPONENT-
-                                                     FloatConsts.MIN_EXPONENT));
+                                                     Double.MIN_EXPONENT-
+                                                     Float.MIN_EXPONENT));
             return s.replaceFirst("p-1022$", "p-126");
         }
         else // double string will be the same as float string
@@ -489,7 +487,7 @@
      * @since 1.8
      */
      public static boolean isFinite(float f) {
-        return Math.abs(f) <= FloatConsts.MAX_VALUE;
+        return Math.abs(f) <= Float.MAX_VALUE;
     }
 
     /**
--- a/jdk/src/java.base/share/classes/java/lang/Math.java	Thu Feb 18 11:30:16 2016 -0800
+++ b/jdk/src/java.base/share/classes/java/lang/Math.java	Thu Feb 18 13:41:11 2016 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1994, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1994, 2016, 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
@@ -1476,18 +1476,18 @@
         int exp = getExponent(d);
 
         switch(exp) {
-        case DoubleConsts.MAX_EXPONENT+1:       // NaN or infinity
+        case Double.MAX_EXPONENT + 1:       // NaN or infinity
             return Math.abs(d);
 
-        case DoubleConsts.MIN_EXPONENT-1:       // zero or subnormal
+        case Double.MIN_EXPONENT - 1:       // zero or subnormal
             return Double.MIN_VALUE;
 
         default:
-            assert exp <= DoubleConsts.MAX_EXPONENT && exp >= DoubleConsts.MIN_EXPONENT;
+            assert exp <= Double.MAX_EXPONENT && exp >= Double.MIN_EXPONENT;
 
             // ulp(x) is usually 2^(SIGNIFICAND_WIDTH-1)*(2^ilogb(x))
             exp = exp - (DoubleConsts.SIGNIFICAND_WIDTH-1);
-            if (exp >= DoubleConsts.MIN_EXPONENT) {
+            if (exp >= Double.MIN_EXPONENT) {
                 return powerOfTwoD(exp);
             }
             else {
@@ -1495,7 +1495,7 @@
                 // representation of Double.MIN_VALUE appropriate
                 // number of positions
                 return Double.longBitsToDouble(1L <<
-                (exp - (DoubleConsts.MIN_EXPONENT - (DoubleConsts.SIGNIFICAND_WIDTH-1)) ));
+                (exp - (Double.MIN_EXPONENT - (DoubleConsts.SIGNIFICAND_WIDTH-1)) ));
             }
         }
     }
@@ -1527,26 +1527,25 @@
         int exp = getExponent(f);
 
         switch(exp) {
-        case FloatConsts.MAX_EXPONENT+1:        // NaN or infinity
+        case Float.MAX_EXPONENT+1:        // NaN or infinity
             return Math.abs(f);
 
-        case FloatConsts.MIN_EXPONENT-1:        // zero or subnormal
-            return FloatConsts.MIN_VALUE;
+        case Float.MIN_EXPONENT-1:        // zero or subnormal
+            return Float.MIN_VALUE;
 
         default:
-            assert exp <= FloatConsts.MAX_EXPONENT && exp >= FloatConsts.MIN_EXPONENT;
+            assert exp <= Float.MAX_EXPONENT && exp >= Float.MIN_EXPONENT;
 
             // ulp(x) is usually 2^(SIGNIFICAND_WIDTH-1)*(2^ilogb(x))
             exp = exp - (FloatConsts.SIGNIFICAND_WIDTH-1);
-            if (exp >= FloatConsts.MIN_EXPONENT) {
+            if (exp >= Float.MIN_EXPONENT) {
                 return powerOfTwoF(exp);
-            }
-            else {
+            } else {
                 // return a subnormal result; left shift integer
                 // representation of FloatConsts.MIN_VALUE appropriate
                 // number of positions
                 return Float.intBitsToFloat(1 <<
-                (exp - (FloatConsts.MIN_EXPONENT - (FloatConsts.SIGNIFICAND_WIDTH-1)) ));
+                (exp - (Float.MIN_EXPONENT - (FloatConsts.SIGNIFICAND_WIDTH-1)) ));
             }
         }
     }
@@ -2276,7 +2275,7 @@
         // nonzero value by it would be guaranteed to over or
         // underflow; due to rounding, scaling down takes an
         // additional power of two which is reflected here
-        final int MAX_SCALE = DoubleConsts.MAX_EXPONENT + -DoubleConsts.MIN_EXPONENT +
+        final int MAX_SCALE = Double.MAX_EXPONENT + -Double.MIN_EXPONENT +
                               DoubleConsts.SIGNIFICAND_WIDTH + 1;
         int exp_adjust = 0;
         int scale_increment = 0;
@@ -2345,7 +2344,7 @@
         // nonzero value by it would be guaranteed to over or
         // underflow; due to rounding, scaling down takes an
         // additional power of two which is reflected here
-        final int MAX_SCALE = FloatConsts.MAX_EXPONENT + -FloatConsts.MIN_EXPONENT +
+        final int MAX_SCALE = Float.MAX_EXPONENT + -Float.MIN_EXPONENT +
                               FloatConsts.SIGNIFICAND_WIDTH + 1;
 
         // Make sure scaling factor is in a reasonable range
@@ -2371,7 +2370,7 @@
      * Returns a floating-point power of two in the normal range.
      */
     static double powerOfTwoD(int n) {
-        assert(n >= DoubleConsts.MIN_EXPONENT && n <= DoubleConsts.MAX_EXPONENT);
+        assert(n >= Double.MIN_EXPONENT && n <= Double.MAX_EXPONENT);
         return Double.longBitsToDouble((((long)n + (long)DoubleConsts.EXP_BIAS) <<
                                         (DoubleConsts.SIGNIFICAND_WIDTH-1))
                                        & DoubleConsts.EXP_BIT_MASK);
@@ -2381,7 +2380,7 @@
      * Returns a floating-point power of two in the normal range.
      */
     static float powerOfTwoF(int n) {
-        assert(n >= FloatConsts.MIN_EXPONENT && n <= FloatConsts.MAX_EXPONENT);
+        assert(n >= Float.MIN_EXPONENT && n <= Float.MAX_EXPONENT);
         return Float.intBitsToFloat(((n + FloatConsts.EXP_BIAS) <<
                                      (FloatConsts.SIGNIFICAND_WIDTH-1))
                                     & FloatConsts.EXP_BIT_MASK);
--- a/jdk/src/java.base/share/classes/java/lang/ProcessBuilder.java	Thu Feb 18 11:30:16 2016 -0800
+++ b/jdk/src/java.base/share/classes/java/lang/ProcessBuilder.java	Thu Feb 18 13:41:11 2016 -0800
@@ -553,10 +553,9 @@
          *
          * <p>It will always be true that
          * <pre> {@code
-         * Redirect.DISCARD.file() the filename appropriate for the operating system
+         * Redirect.DISCARD.file() is the filename appropriate for the operating system
          * and may be null &&
-         * Redirect.DISCARD.type() == Redirect.Type.WRITE &&
-         * Redirect.DISCARD.append() == false
+         * Redirect.DISCARD.type() == Redirect.Type.WRITE
          * }</pre>
          * @since 9
          */
--- a/jdk/src/java.base/share/classes/java/lang/invoke/StringConcatFactory.java	Thu Feb 18 11:30:16 2016 -0800
+++ b/jdk/src/java.base/share/classes/java/lang/invoke/StringConcatFactory.java	Thu Feb 18 13:41:11 2016 -0800
@@ -208,11 +208,19 @@
         DUMPER = (dumpPath == null) ? null : ProxyClassesDumper.getInstance(dumpPath);
     }
 
+    /**
+     * Cache key is a composite of:
+     *   - class name, that lets to disambiguate stubs, to avoid excess sharing
+     *   - method type, describing the dynamic arguments for concatenation
+     *   - concat recipe, describing the constants and concat shape
+     */
     private static final class Key {
+        final String className;
         final MethodType mt;
         final Recipe recipe;
 
-        public Key(MethodType mt, Recipe recipe) {
+        public Key(String className, MethodType mt, Recipe recipe) {
+            this.className = className;
             this.mt = mt;
             this.recipe = recipe;
         }
@@ -224,6 +232,7 @@
 
             Key key = (Key) o;
 
+            if (!className.equals(key.className)) return false;
             if (!mt.equals(key.mt)) return false;
             if (!recipe.equals(key.recipe)) return false;
             return true;
@@ -231,7 +240,8 @@
 
         @Override
         public int hashCode() {
-            int result = mt.hashCode();
+            int result = className.hashCode();
+            result = 31 * result + mt.hashCode();
             result = 31 * result + recipe.hashCode();
             return result;
         }
@@ -614,20 +624,20 @@
                     MAX_INDY_CONCAT_ARG_SLOTS);
         }
 
+        String className = getClassName(lookup.lookupClass());
         MethodType mt = adaptType(concatType);
-
         Recipe rec = new Recipe(recipe, constants);
 
         MethodHandle mh;
         if (CACHE_ENABLE) {
-            Key key = new Key(mt, rec);
+            Key key = new Key(className, mt, rec);
             mh = CACHE.get(key);
             if (mh == null) {
-                mh = generate(lookup, mt, rec);
+                mh = generate(lookup, className, mt, rec);
                 CACHE.put(key, mh);
             }
         } else {
-            mh = generate(lookup, mt, rec);
+            mh = generate(lookup, className, mt, rec);
         }
         return new ConstantCallSite(mh.asType(concatType));
     }
@@ -659,15 +669,59 @@
                 : args;
     }
 
-    private static MethodHandle generate(Lookup lookup, MethodType mt, Recipe recipe) throws StringConcatException {
+    private static String getClassName(Class<?> hostClass) throws StringConcatException {
+        /*
+          When cache is enabled, we want to cache as much as we can.
+
+          However, there are two peculiarities:
+
+           a) The generated class should stay within the same package as the
+              host class, to allow Unsafe.defineAnonymousClass access controls
+              to work properly. JDK may choose to fail with IllegalAccessException
+              when accessing a VM anonymous class with non-privileged callers,
+              see JDK-8058575.
+
+           b) If we mark the stub with some prefix, say, derived from the package
+              name because of (a), we can technically use that stub in other packages.
+              But the call stack traces would be extremely puzzling to unsuspecting users
+              and profiling tools: whatever stub wins the race, would be linked in all
+              similar callsites.
+
+           Therefore, we set the class prefix to match the host class package, and use
+           the prefix as the cache key too. This only affects BC_* strategies, and only when
+           cache is enabled.
+         */
+
+        switch (STRATEGY) {
+            case BC_SB:
+            case BC_SB_SIZED:
+            case BC_SB_SIZED_EXACT: {
+                if (CACHE_ENABLE) {
+                    Package pkg = hostClass.getPackage();
+                    return (pkg != null ? pkg.getName().replace('.', '/') + "/" : "") + "Stubs$$StringConcat";
+                } else {
+                    return hostClass.getName().replace('.', '/') + "$$StringConcat";
+                }
+            }
+            case MH_SB_SIZED:
+            case MH_SB_SIZED_EXACT:
+            case MH_INLINE_SIZED_EXACT:
+                // MethodHandle strategies do not need a class name.
+                return "";
+            default:
+                throw new StringConcatException("Concatenation strategy " + STRATEGY + " is not implemented");
+        }
+    }
+
+    private static MethodHandle generate(Lookup lookup, String className, MethodType mt, Recipe recipe) throws StringConcatException {
         try {
             switch (STRATEGY) {
                 case BC_SB:
-                    return BytecodeStringBuilderStrategy.generate(lookup, mt, recipe, Mode.DEFAULT);
+                    return BytecodeStringBuilderStrategy.generate(lookup, className, mt, recipe, Mode.DEFAULT);
                 case BC_SB_SIZED:
-                    return BytecodeStringBuilderStrategy.generate(lookup, mt, recipe, Mode.SIZED);
+                    return BytecodeStringBuilderStrategy.generate(lookup, className, mt, recipe, Mode.SIZED);
                 case BC_SB_SIZED_EXACT:
-                    return BytecodeStringBuilderStrategy.generate(lookup, mt, recipe, Mode.SIZED_EXACT);
+                    return BytecodeStringBuilderStrategy.generate(lookup, className, mt, recipe, Mode.SIZED_EXACT);
                 case MH_SB_SIZED:
                     return MethodHandleStringBuilderStrategy.generate(mt, recipe, Mode.SIZED);
                 case MH_SB_SIZED_EXACT:
@@ -746,19 +800,18 @@
     private static final class BytecodeStringBuilderStrategy {
         static final Unsafe UNSAFE = Unsafe.getUnsafe();
         static final int CLASSFILE_VERSION = 52;
-        static final String NAME_FACTORY = "concat";
-        static final String CLASS_NAME = "java/lang/String$Concat";
+        static final String METHOD_NAME = "concat";
 
         private BytecodeStringBuilderStrategy() {
             // no instantiation
         }
 
-        private static MethodHandle generate(MethodHandles.Lookup lookup, MethodType args, Recipe recipe, Mode mode) throws Exception {
+        private static MethodHandle generate(Lookup lookup, String className, MethodType args, Recipe recipe, Mode mode) throws Exception {
             ClassWriter cw = new ClassWriter(ClassWriter.COMPUTE_MAXS + ClassWriter.COMPUTE_FRAMES);
 
             cw.visit(CLASSFILE_VERSION,
                     ACC_SUPER + ACC_PUBLIC + ACC_FINAL + ACC_SYNTHETIC,
-                    CLASS_NAME,
+                    className,  // Unsafe.defineAnonymousClass would append an unique ID
                     null,
                     "java/lang/Object",
                     null
@@ -766,7 +819,7 @@
 
             MethodVisitor mv = cw.visitMethod(
                     ACC_PUBLIC + ACC_STATIC + ACC_FINAL,
-                    NAME_FACTORY,
+                    METHOD_NAME,
                     args.toMethodDescriptorString(),
                     null,
                     null);
@@ -1045,19 +1098,22 @@
             mv.visitEnd();
             cw.visitEnd();
 
-            Class<?> targetClass = lookup.lookupClass();
-            final byte[] classBytes = cw.toByteArray();
-            final Class<?> innerClass = UNSAFE.defineAnonymousClass(targetClass, classBytes, null);
-
-            if (DUMPER != null) {
-                DUMPER.dumpClass(innerClass.getName(), classBytes);
+            byte[] classBytes = cw.toByteArray();
+            try {
+                Class<?> hostClass = lookup.lookupClass();
+                Class<?> innerClass = UNSAFE.defineAnonymousClass(hostClass, classBytes, null);
+                UNSAFE.ensureClassInitialized(innerClass);
+                dumpIfEnabled(innerClass.getName(), classBytes);
+                return Lookup.IMPL_LOOKUP.findStatic(innerClass, METHOD_NAME, args);
+            } catch (Throwable e) {
+                dumpIfEnabled(className + "$$FAILED", classBytes);
+                throw new StringConcatException("Error while spinning the class", e);
             }
+        }
 
-            try {
-                UNSAFE.ensureClassInitialized(innerClass);
-                return lookup.findStatic(innerClass, NAME_FACTORY, args);
-            } catch (ReflectiveOperationException e) {
-                throw new StringConcatException("Exception finding constructor", e);
+        private static void dumpIfEnabled(String name, byte[] bytes) {
+            if (DUMPER != null) {
+                DUMPER.dumpClass(name, bytes);
             }
         }
 
@@ -1687,7 +1743,7 @@
         private static final Function<Class<?>, MethodHandle> MOST = new Function<Class<?>, MethodHandle>() {
             @Override
             public MethodHandle apply(Class<?> cl) {
-                MethodHandle mhObject = lookupStatic(Lookup.PUBLIC_LOOKUP, String.class, "valueOf", String.class, Object.class);
+                MethodHandle mhObject = lookupStatic(MethodHandles.publicLookup(), String.class, "valueOf", String.class, Object.class);
 
                 // We need the additional conversion here, because String.valueOf(Object) may return null.
                 // String conversion rules in Java state we need to produce "null" String in this case.
@@ -1698,9 +1754,9 @@
                 if (cl == String.class) {
                     return mhObject;
                 } else if (cl == float.class) {
-                    return lookupStatic(Lookup.PUBLIC_LOOKUP, String.class, "valueOf", String.class, float.class);
+                    return lookupStatic(MethodHandles.publicLookup(), String.class, "valueOf", String.class, float.class);
                 } else if (cl == double.class) {
-                    return lookupStatic(Lookup.PUBLIC_LOOKUP, String.class, "valueOf", String.class, double.class);
+                    return lookupStatic(MethodHandles.publicLookup(), String.class, "valueOf", String.class, double.class);
                 } else if (!cl.isPrimitive()) {
                     return mhObjectNoNulls;
                 }
@@ -1719,13 +1775,13 @@
                 }
 
                 if (cl == byte.class || cl == short.class || cl == int.class) {
-                    return lookupStatic(Lookup.PUBLIC_LOOKUP, String.class, "valueOf", String.class, int.class);
+                    return lookupStatic(MethodHandles.publicLookup(), String.class, "valueOf", String.class, int.class);
                 } else if (cl == boolean.class) {
-                    return lookupStatic(Lookup.PUBLIC_LOOKUP, String.class, "valueOf", String.class, boolean.class);
+                    return lookupStatic(MethodHandles.publicLookup(), String.class, "valueOf", String.class, boolean.class);
                 } else if (cl == char.class) {
-                    return lookupStatic(Lookup.PUBLIC_LOOKUP, String.class, "valueOf", String.class, char.class);
+                    return lookupStatic(MethodHandles.publicLookup(), String.class, "valueOf", String.class, char.class);
                 } else if (cl == long.class) {
-                    return lookupStatic(Lookup.PUBLIC_LOOKUP, String.class, "valueOf", String.class, long.class);
+                    return lookupStatic(MethodHandles.publicLookup(), String.class, "valueOf", String.class, long.class);
                 } else {
                     throw new IllegalStateException("Unknown class: " + cl);
                 }
--- a/jdk/src/java.base/share/classes/java/util/Formatter.java	Thu Feb 18 11:30:16 2016 -0800
+++ b/jdk/src/java.base/share/classes/java/util/Formatter.java	Thu Feb 18 13:41:11 2016 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2016, 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
@@ -3440,7 +3440,7 @@
 
                 int exponent  = Math.getExponent(d);
                 boolean subnormal
-                    = (exponent == DoubleConsts.MIN_EXPONENT - 1);
+                    = (exponent == Double.MIN_EXPONENT - 1);
 
                 // If this is subnormal input so normalize (could be faster to
                 // do as integer operation).
@@ -3450,8 +3450,8 @@
                     // Calculate the exponent.  This is not just exponent + 54
                     // since the former is not the normalized exponent.
                     exponent = Math.getExponent(d);
-                    assert exponent >= DoubleConsts.MIN_EXPONENT &&
-                        exponent <= DoubleConsts.MAX_EXPONENT: exponent;
+                    assert exponent >= Double.MIN_EXPONENT &&
+                        exponent <= Double.MAX_EXPONENT: exponent;
                 }
 
                 int precision = 1 + prec*4;
--- a/jdk/src/java.base/share/classes/java/util/SplittableRandom.java	Thu Feb 18 11:30:16 2016 -0800
+++ b/jdk/src/java.base/share/classes/java/util/SplittableRandom.java	Thu Feb 18 13:41:11 2016 -0800
@@ -225,14 +225,13 @@
     private static final AtomicLong defaultGen = new AtomicLong(initialSeed());
 
     private static long initialSeed() {
-        String pp = java.security.AccessController.doPrivileged(
-                new sun.security.action.GetPropertyAction(
-                        "java.util.secureRandomSeed"));
-        if (pp != null && pp.equalsIgnoreCase("true")) {
+        java.security.PrivilegedAction<Boolean> action =
+            () -> Boolean.getBoolean("java.util.secureRandomSeed");
+        if (java.security.AccessController.doPrivileged(action)) {
             byte[] seedBytes = java.security.SecureRandom.getSeed(8);
-            long s = (long)(seedBytes[0]) & 0xffL;
+            long s = (long)seedBytes[0] & 0xffL;
             for (int i = 1; i < 8; ++i)
-                s = (s << 8) | ((long)(seedBytes[i]) & 0xffL);
+                s = (s << 8) | ((long)seedBytes[i] & 0xffL);
             return s;
         }
         return (mix64(System.currentTimeMillis()) ^
--- a/jdk/src/java.base/share/classes/java/util/concurrent/CompletableFuture.java	Thu Feb 18 11:30:16 2016 -0800
+++ b/jdk/src/java.base/share/classes/java/util/concurrent/CompletableFuture.java	Thu Feb 18 13:41:11 2016 -0800
@@ -234,14 +234,13 @@
      * Without precautions, CompletableFutures would be prone to
      * garbage accumulation as chains of Completions build up, each
      * pointing back to its sources. So we null out fields as soon as
-     * possible (see especially method Completion.detach). The
-     * screening checks needed anyway harmlessly ignore null arguments
-     * that may have been obtained during races with threads nulling
-     * out fields.  We also try to unlink fired Completions from
-     * stacks that might never be popped (see method postFire).
-     * Completion fields need not be declared as final or volatile
-     * because they are only visible to other threads upon safe
-     * publication.
+     * possible.  The screening checks needed anyway harmlessly ignore
+     * null arguments that may have been obtained during races with
+     * threads nulling out fields.  We also try to unlink fired
+     * Completions from stacks that might never be popped (see method
+     * postFire).  Completion fields need not be declared as final or
+     * volatile because they are only visible to other threads upon
+     * safe publication.
      */
 
     volatile Object result;       // Either the result or boxed AltResult
@@ -800,6 +799,8 @@
             } catch (Throwable ex) {
                 if (x == null)
                     x = ex;
+                else if (x != ex)
+                    x.addSuppressed(ex);
             }
             completeThrowable(x, r);
         }
--- a/jdk/src/java.base/share/classes/java/util/concurrent/CompletionStage.java	Thu Feb 18 11:30:16 2016 -0800
+++ b/jdk/src/java.base/share/classes/java/util/concurrent/CompletionStage.java	Thu Feb 18 13:41:11 2016 -0800
@@ -46,16 +46,25 @@
  * A stage completes upon termination of its computation, but this may
  * in turn trigger other dependent stages.  The functionality defined
  * in this interface takes only a few basic forms, which expand out to
- * a larger set of methods to capture a range of usage styles: <ul>
+ * a larger set of methods to capture a range of usage styles:
+ *
+ * <ul>
  *
  * <li>The computation performed by a stage may be expressed as a
  * Function, Consumer, or Runnable (using methods with names including
  * <em>apply</em>, <em>accept</em>, or <em>run</em>, respectively)
  * depending on whether it requires arguments and/or produces results.
- * For example, {@code stage.thenApply(x -> square(x)).thenAccept(x ->
- * System.out.print(x)).thenRun(() -> System.out.println())}. An
- * additional form (<em>compose</em>) applies functions of stages
- * themselves, rather than their results.
+ * For example:
+ * <pre> {@code
+ * stage.thenApply(x -> square(x))
+ *      .thenAccept(x -> System.out.print(x))
+ *      .thenRun(() -> System.out.println());}</pre>
+ *
+ * An additional form (<em>compose</em>) allows the construction of
+ * computation pipelines from functions returning completion stages.
+ *
+ * <p>Any argument to a stage's computation is the outcome of a
+ * triggering stage's computation.
  *
  * <li>One stage's execution may be triggered by completion of a
  * single stage, or both of two stages, or either of two stages.
@@ -64,8 +73,7 @@
  * <em>both</em> of two stages may <em>combine</em> their results or
  * effects, using correspondingly named methods. Those triggered by
  * <em>either</em> of two stages make no guarantees about which of the
- * results or effects are used for the dependent stage's
- * computation.
+ * results or effects are used for the dependent stage's computation.
  *
  * <li>Dependencies among stages control the triggering of
  * computations, but do not otherwise guarantee any particular
@@ -80,26 +88,27 @@
  * properties, and might not even support concurrent execution, but
  * are arranged for processing in a way that accommodates asynchrony.
  *
- * <li>Two method forms support processing whether the triggering
- * stage completed normally or exceptionally: Method {@link
- * #whenComplete whenComplete} allows injection of an action
- * regardless of outcome, otherwise preserving the outcome in its
- * completion. Method {@link #handle handle} additionally allows the
- * stage to compute a replacement result that may enable further
- * processing by other dependent stages.  In all other cases, if a
- * stage's computation terminates abruptly with an (unchecked)
- * exception or error, then all dependent stages requiring its
- * completion complete exceptionally as well, with a {@link
- * CompletionException} holding the exception as its cause.  If a
- * stage is dependent on <em>both</em> of two stages, and both
+ * <li>Two method forms ({@link #handle handle} and {@link
+ * #whenComplete whenComplete}) support unconditional computation
+ * whether the triggering stage completed normally or exceptionally.
+ * Method {@link #exceptionally exceptionally} supports computation
+ * only when the triggering stage completes exceptionally, computing a
+ * replacement result, similarly to the java {@code catch} keyword.
+ * In all other cases, if a stage's computation terminates abruptly
+ * with an (unchecked) exception or error, then all dependent stages
+ * requiring its completion complete exceptionally as well, with a
+ * {@link CompletionException} holding the exception as its cause.  If
+ * a stage is dependent on <em>both</em> of two stages, and both
  * complete exceptionally, then the CompletionException may correspond
  * to either one of these exceptions.  If a stage is dependent on
  * <em>either</em> of two others, and only one of them completes
  * exceptionally, no guarantees are made about whether the dependent
  * stage completes normally or exceptionally. In the case of method
  * {@code whenComplete}, when the supplied action itself encounters an
- * exception, then the stage exceptionally completes with this
- * exception if not already completed exceptionally.
+ * exception, then the stage completes exceptionally with this
+ * exception unless the source stage also completed exceptionally, in
+ * which case the exceptional completion from the source stage is
+ * given preference and propagated to the dependent stage.
  *
  * </ul>
  *
@@ -111,6 +120,23 @@
  * value for any other parameter will result in a {@link
  * NullPointerException} being thrown.
  *
+ * <p>Method form {@link #handle handle} is the most general way of
+ * creating a continuation stage, unconditionally performing a
+ * computation that is given both the result and exception (if any) of
+ * the triggering CompletionStage, and computing an arbitrary result.
+ * Method {@link #whenComplete whenComplete} is similar, but preserves
+ * the result of the triggering stage instead of computing a new one.
+ * Because a stage's normal result may be {@code null}, both methods
+ * should have a computation structured thus:
+ *
+ * <pre>{@code (result, exception) -> {
+ *   if (exception == null) {
+ *     // triggering stage completed normally
+ *   } else {
+ *     // triggering stage completed exceptionally
+ *   }
+ * }}</pre>
+ *
  * <p>This interface does not define methods for initially creating,
  * forcibly completing normally or exceptionally, probing completion
  * status or results, or awaiting completion of a stage.
@@ -129,11 +155,15 @@
      * normally, is executed with this stage's result as the argument
      * to the supplied function.
      *
-     * See the {@link CompletionStage} documentation for rules
+     * <p>This method is analogous to
+     * {@link java.util.Optional#map Optional.map} and
+     * {@link java.util.stream.Stream#map Stream.map}.
+     *
+     * <p>See the {@link CompletionStage} documentation for rules
      * covering exceptional completion.
      *
-     * @param fn the function to use to compute the value of
-     * the returned CompletionStage
+     * @param fn the function to use to compute the value of the
+     * returned CompletionStage
      * @param <U> the function's return type
      * @return the new CompletionStage
      */
@@ -148,8 +178,8 @@
      * See the {@link CompletionStage} documentation for rules
      * covering exceptional completion.
      *
-     * @param fn the function to use to compute the value of
-     * the returned CompletionStage
+     * @param fn the function to use to compute the value of the
+     * returned CompletionStage
      * @param <U> the function's return type
      * @return the new CompletionStage
      */
@@ -164,8 +194,8 @@
      * See the {@link CompletionStage} documentation for rules
      * covering exceptional completion.
      *
-     * @param fn the function to use to compute the value of
-     * the returned CompletionStage
+     * @param fn the function to use to compute the value of the
+     * returned CompletionStage
      * @param executor the executor to use for asynchronous execution
      * @param <U> the function's return type
      * @return the new CompletionStage
@@ -269,8 +299,8 @@
      * covering exceptional completion.
      *
      * @param other the other CompletionStage
-     * @param fn the function to use to compute the value of
-     * the returned CompletionStage
+     * @param fn the function to use to compute the value of the
+     * returned CompletionStage
      * @param <U> the type of the other CompletionStage's result
      * @param <V> the function's return type
      * @return the new CompletionStage
@@ -281,16 +311,16 @@
 
     /**
      * Returns a new CompletionStage that, when this and the other
-     * given stage complete normally, is executed using this stage's
-     * default asynchronous execution facility, with the two results
-     * as arguments to the supplied function.
+     * given stage both complete normally, is executed using this
+     * stage's default asynchronous execution facility, with the two
+     * results as arguments to the supplied function.
      *
      * See the {@link CompletionStage} documentation for rules
      * covering exceptional completion.
      *
      * @param other the other CompletionStage
-     * @param fn the function to use to compute the value of
-     * the returned CompletionStage
+     * @param fn the function to use to compute the value of the
+     * returned CompletionStage
      * @param <U> the type of the other CompletionStage's result
      * @param <V> the function's return type
      * @return the new CompletionStage
@@ -301,16 +331,16 @@
 
     /**
      * Returns a new CompletionStage that, when this and the other
-     * given stage complete normally, is executed using the supplied
-     * executor, with the two results as arguments to the supplied
-     * function.
+     * given stage both complete normally, is executed using the
+     * supplied executor, with the two results as arguments to the
+     * supplied function.
      *
      * See the {@link CompletionStage} documentation for rules
      * covering exceptional completion.
      *
      * @param other the other CompletionStage
-     * @param fn the function to use to compute the value of
-     * the returned CompletionStage
+     * @param fn the function to use to compute the value of the
+     * returned CompletionStage
      * @param executor the executor to use for asynchronous execution
      * @param <U> the type of the other CompletionStage's result
      * @param <V> the function's return type
@@ -341,9 +371,12 @@
 
     /**
      * Returns a new CompletionStage that, when this and the other
-     * given stage complete normally, is executed using this stage's
-     * default asynchronous execution facility, with the two results
-     * as arguments to the supplied action.
+     * given stage both complete normally, is executed using this
+     * stage's default asynchronous execution facility, with the two
+     * results as arguments to the supplied action.
+     *
+     * See the {@link CompletionStage} documentation for rules
+     * covering exceptional completion.
      *
      * @param other the other CompletionStage
      * @param action the action to perform before completing the
@@ -357,9 +390,12 @@
 
     /**
      * Returns a new CompletionStage that, when this and the other
-     * given stage complete normally, is executed using the supplied
-     * executor, with the two results as arguments to the supplied
-     * function.
+     * given stage both complete normally, is executed using the
+     * supplied executor, with the two results as arguments to the
+     * supplied action.
+     *
+     * See the {@link CompletionStage} documentation for rules
+     * covering exceptional completion.
      *
      * @param other the other CompletionStage
      * @param action the action to perform before completing the
@@ -389,8 +425,8 @@
                                               Runnable action);
     /**
      * Returns a new CompletionStage that, when this and the other
-     * given stage complete normally, executes the given action using
-     * this stage's default asynchronous execution facility.
+     * given stage both complete normally, executes the given action
+     * using this stage's default asynchronous execution facility.
      *
      * See the {@link CompletionStage} documentation for rules
      * covering exceptional completion.
@@ -405,8 +441,8 @@
 
     /**
      * Returns a new CompletionStage that, when this and the other
-     * given stage complete normally, executes the given action using
-     * the supplied executor.
+     * given stage both complete normally, executes the given action
+     * using the supplied executor.
      *
      * See the {@link CompletionStage} documentation for rules
      * covering exceptional completion.
@@ -429,8 +465,8 @@
      * covering exceptional completion.
      *
      * @param other the other CompletionStage
-     * @param fn the function to use to compute the value of
-     * the returned CompletionStage
+     * @param fn the function to use to compute the value of the
+     * returned CompletionStage
      * @param <U> the function's return type
      * @return the new CompletionStage
      */
@@ -448,8 +484,8 @@
      * covering exceptional completion.
      *
      * @param other the other CompletionStage
-     * @param fn the function to use to compute the value of
-     * the returned CompletionStage
+     * @param fn the function to use to compute the value of the
+     * returned CompletionStage
      * @param <U> the function's return type
      * @return the new CompletionStage
      */
@@ -467,8 +503,8 @@
      * covering exceptional completion.
      *
      * @param other the other CompletionStage
-     * @param fn the function to use to compute the value of
-     * the returned CompletionStage
+     * @param fn the function to use to compute the value of the
+     * returned CompletionStage
      * @param executor the executor to use for asynchronous execution
      * @param <U> the function's return type
      * @return the new CompletionStage
@@ -517,7 +553,7 @@
      * Returns a new CompletionStage that, when either this or the
      * other given stage complete normally, is executed using the
      * supplied executor, with the corresponding result as argument to
-     * the supplied function.
+     * the supplied action.
      *
      * See the {@link CompletionStage} documentation for rules
      * covering exceptional completion.
@@ -585,48 +621,78 @@
          Executor executor);
 
     /**
-     * Returns a new CompletionStage that, when this stage completes
-     * normally, is executed with this stage's result as the argument
-     * to the supplied function.
+     * Returns a new CompletionStage that is completed with the same
+     * value as the CompletionStage returned by the given function.
+     *
+     * <p>When this stage completes normally, the given function is
+     * invoked with this stage's result as the argument, returning
+     * another CompletionStage.  When that stage completes normally,
+     * the CompletionStage returned by this method is completed with
+     * the same value.
      *
-     * See the {@link CompletionStage} documentation for rules
+     * <p>To ensure progress, the supplied function must arrange
+     * eventual completion of its result.
+     *
+     * <p>This method is analogous to
+     * {@link java.util.Optional#flatMap Optional.flatMap} and
+     * {@link java.util.stream.Stream#flatMap Stream.flatMap}.
+     *
+     * <p>See the {@link CompletionStage} documentation for rules
      * covering exceptional completion.
      *
-     * @param fn the function returning a new CompletionStage
+     * @param fn the function to use to compute another CompletionStage
      * @param <U> the type of the returned CompletionStage's result
-     * @return the CompletionStage
+     * @return the new CompletionStage
      */
     public <U> CompletionStage<U> thenCompose
         (Function<? super T, ? extends CompletionStage<U>> fn);
 
     /**
-     * Returns a new CompletionStage that, when this stage completes
-     * normally, is executed using this stage's default asynchronous
-     * execution facility, with this stage's result as the argument to the
-     * supplied function.
+     * Returns a new CompletionStage that is completed with the same
+     * value as the CompletionStage returned by the given function,
+     * executed using this stage's default asynchronous execution
+     * facility.
      *
-     * See the {@link CompletionStage} documentation for rules
+     * <p>When this stage completes normally, the given function is
+     * invoked with this stage's result as the argument, returning
+     * another CompletionStage.  When that stage completes normally,
+     * the CompletionStage returned by this method is completed with
+     * the same value.
+     *
+     * <p>To ensure progress, the supplied function must arrange
+     * eventual completion of its result.
+     *
+     * <p>See the {@link CompletionStage} documentation for rules
      * covering exceptional completion.
      *
-     * @param fn the function returning a new CompletionStage
+     * @param fn the function to use to compute another CompletionStage
      * @param <U> the type of the returned CompletionStage's result
-     * @return the CompletionStage
+     * @return the new CompletionStage
      */
     public <U> CompletionStage<U> thenComposeAsync
         (Function<? super T, ? extends CompletionStage<U>> fn);
 
     /**
-     * Returns a new CompletionStage that, when this stage completes
-     * normally, is executed using the supplied Executor, with this
-     * stage's result as the argument to the supplied function.
+     * Returns a new CompletionStage that is completed with the same
+     * value as the CompletionStage returned by the given function,
+     * executed using the supplied Executor.
      *
-     * See the {@link CompletionStage} documentation for rules
+     * <p>When this stage completes normally, the given function is
+     * invoked with this stage's result as the argument, returning
+     * another CompletionStage.  When that stage completes normally,
+     * the CompletionStage returned by this method is completed with
+     * the same value.
+     *
+     * <p>To ensure progress, the supplied function must arrange
+     * eventual completion of its result.
+     *
+     * <p>See the {@link CompletionStage} documentation for rules
      * covering exceptional completion.
      *
-     * @param fn the function returning a new CompletionStage
+     * @param fn the function to use to compute another CompletionStage
      * @param executor the executor to use for asynchronous execution
      * @param <U> the type of the returned CompletionStage's result
-     * @return the CompletionStage
+     * @return the new CompletionStage
      */
     public <U> CompletionStage<U> thenComposeAsync
         (Function<? super T, ? extends CompletionStage<U>> fn,
@@ -634,78 +700,6 @@
 
     /**
      * Returns a new CompletionStage that, when this stage completes
-     * exceptionally, is executed with this stage's exception as the
-     * argument to the supplied function.  Otherwise, if this stage
-     * completes normally, then the returned stage also completes
-     * normally with the same value.
-     *
-     * @param fn the function to use to compute the value of the
-     * returned CompletionStage if this CompletionStage completed
-     * exceptionally
-     * @return the new CompletionStage
-     */
-    public CompletionStage<T> exceptionally
-        (Function<Throwable, ? extends T> fn);
-
-    /**
-     * Returns a new CompletionStage with the same result or exception as
-     * this stage, that executes the given action when this stage completes.
-     *
-     * <p>When this stage is complete, the given action is invoked
-     * with the result (or {@code null} if none) and the exception (or
-     * {@code null} if none) of this stage as arguments.  The returned
-     * stage is completed when the action returns.  If the supplied
-     * action itself encounters an exception, then the returned stage
-     * exceptionally completes with this exception unless this stage
-     * also completed exceptionally (in which case, the returned stage
-     * exceptionally completes with the original exception).
-     *
-     * @param action the action to perform
-     * @return the new CompletionStage
-     */
-    public CompletionStage<T> whenComplete
-        (BiConsumer<? super T, ? super Throwable> action);
-
-    /**
-     * Returns a new CompletionStage with the same result or exception as
-     * this stage, that executes the given action using this stage's
-     * default asynchronous execution facility when this stage completes.
-     *
-     * <p>When this stage is complete, the given action is invoked with the
-     * result (or {@code null} if none) and the exception (or {@code null}
-     * if none) of this stage as arguments.  The returned stage is completed
-     * when the action returns.  If the supplied action itself encounters an
-     * exception, then the returned stage exceptionally completes with this
-     * exception unless this stage also completed exceptionally.
-     *
-     * @param action the action to perform
-     * @return the new CompletionStage
-     */
-    public CompletionStage<T> whenCompleteAsync
-        (BiConsumer<? super T, ? super Throwable> action);
-
-    /**
-     * Returns a new CompletionStage with the same result or exception as
-     * this stage, that executes the given action using the supplied
-     * Executor when this stage completes.
-     *
-     * <p>When this stage is complete, the given action is invoked with the
-     * result (or {@code null} if none) and the exception (or {@code null}
-     * if none) of this stage as arguments.  The returned stage is completed
-     * when the action returns.  If the supplied action itself encounters an
-     * exception, then the returned stage exceptionally completes with this
-     * exception unless this stage also completed exceptionally.
-     *
-     * @param action the action to perform
-     * @param executor the executor to use for asynchronous execution
-     * @return the new CompletionStage
-     */
-    public CompletionStage<T> whenCompleteAsync
-        (BiConsumer<? super T, ? super Throwable> action,
-         Executor executor);
-
-    /**
-     * Returns a new CompletionStage that, when this stage completes
      * either normally or exceptionally, is executed with this stage's
      * result and exception as arguments to the supplied function.
      *
@@ -763,6 +757,100 @@
          Executor executor);
 
     /**
+     * Returns a new CompletionStage with the same result or exception as
+     * this stage, that executes the given action when this stage completes.
+     *
+     * <p>When this stage is complete, the given action is invoked
+     * with the result (or {@code null} if none) and the exception (or
+     * {@code null} if none) of this stage as arguments.  The returned
+     * stage is completed when the action returns.
+     *
+     * <p>Unlike method {@link #handle handle},
+     * this method is not designed to translate completion outcomes,
+     * so the supplied action should not throw an exception. However,
+     * if it does, the following rules apply: if this stage completed
+     * normally but the supplied action throws an exception, then the
+     * returned stage completes exceptionally with the supplied
+     * action's exception. Or, if this stage completed exceptionally
+     * and the supplied action throws an exception, then the returned
+     * stage completes exceptionally with this stage's exception.
+     *
+     * @param action the action to perform
+     * @return the new CompletionStage
+     */
+    public CompletionStage<T> whenComplete
+        (BiConsumer<? super T, ? super Throwable> action);
+
+    /**
+     * Returns a new CompletionStage with the same result or exception as
+     * this stage, that executes the given action using this stage's
+     * default asynchronous execution facility when this stage completes.
+     *
+     * <p>When this stage is complete, the given action is invoked with the
+     * result (or {@code null} if none) and the exception (or {@code null}
+     * if none) of this stage as arguments.  The returned stage is completed
+     * when the action returns.
+     *
+     * <p>Unlike method {@link #handleAsync(BiFunction) handleAsync},
+     * this method is not designed to translate completion outcomes,
+     * so the supplied action should not throw an exception. However,
+     * if it does, the following rules apply: If this stage completed
+     * normally but the supplied action throws an exception, then the
+     * returned stage completes exceptionally with the supplied
+     * action's exception. Or, if this stage completed exceptionally
+     * and the supplied action throws an exception, then the returned
+     * stage completes exceptionally with this stage's exception.
+     *
+     * @param action the action to perform
+     * @return the new CompletionStage
+     */
+    public CompletionStage<T> whenCompleteAsync
+        (BiConsumer<? super T, ? super Throwable> action);
+
+    /**
+     * Returns a new CompletionStage with the same result or exception as
+     * this stage, that executes the given action using the supplied
+     * Executor when this stage completes.
+     *
+     * <p>When this stage is complete, the given action is invoked with the
+     * result (or {@code null} if none) and the exception (or {@code null}
+     * if none) of this stage as arguments.  The returned stage is completed
+     * when the action returns.
+     *
+     * <p>Unlike method {@link #handleAsync(BiFunction,Executor) handleAsync},
+     * this method is not designed to translate completion outcomes,
+     * so the supplied action should not throw an exception. However,
+     * if it does, the following rules apply: If this stage completed
+     * normally but the supplied action throws an exception, then the
+     * returned stage completes exceptionally with the supplied
+     * action's exception. Or, if this stage completed exceptionally
+     * and the supplied action throws an exception, then the returned
+     * stage completes exceptionally with this stage's exception.
+     *
+     * @param action the action to perform
+     * @param executor the executor to use for asynchronous execution
+     * @return the new CompletionStage
+     */
+    public CompletionStage<T> whenCompleteAsync
+        (BiConsumer<? super T, ? super Throwable> action,
+         Executor executor);
+
+    /**
+     * Returns a new CompletionStage that, when this stage completes
+     * exceptionally, is executed with this stage's exception as the
+     * argument to the supplied function.  Otherwise, if this stage
+     * completes normally, then the returned stage also completes
+     * normally with the same value.
+     *
+     * @param fn the function to use to compute the value of the
+     * returned CompletionStage if this CompletionStage completed
+     * exceptionally
+     * @return the new CompletionStage
+     */
+    public CompletionStage<T> exceptionally
+        (Function<Throwable, ? extends T> fn);
+
+    /**
      * Returns a {@link CompletableFuture} maintaining the same
      * completion properties as this stage. If this stage is already a
      * CompletableFuture, this method may return this stage itself.
--- a/jdk/src/java.base/share/classes/java/util/concurrent/Exchanger.java	Thu Feb 18 11:30:16 2016 -0800
+++ b/jdk/src/java.base/share/classes/java/util/concurrent/Exchanger.java	Thu Feb 18 13:41:11 2016 -0800
@@ -155,8 +155,8 @@
      * a value that is enough for common platforms.  Additionally,
      * extra care elsewhere is taken to avoid other false/unintended
      * sharing and to enhance locality, including adding padding (via
-     * jdk.internal.vm.annotation.Contended) to Nodes, embedding "bound" as an Exchanger
-     * field, and reworking some park/unpark mechanics compared to
+     * @Contended) to Nodes, embedding "bound" as an Exchanger field,
+     * and reworking some park/unpark mechanics compared to
      * LockSupport versions.
      *
      * The arena starts out with only one used slot. We expand the
@@ -304,8 +304,7 @@
 
     /**
      * Nodes hold partially exchanged data, plus other per-thread
-     * bookkeeping. Padded via @jdk.internal.vm.annotation.Contended to reduce memory
-     * contention.
+     * bookkeeping. Padded via @Contended to reduce memory contention.
      */
     @jdk.internal.vm.annotation.Contended static final class Node {
         int index;              // Arena index
--- a/jdk/src/java.base/share/classes/java/util/concurrent/ForkJoinPool.java	Thu Feb 18 11:30:16 2016 -0800
+++ b/jdk/src/java.base/share/classes/java/util/concurrent/ForkJoinPool.java	Thu Feb 18 13:41:11 2016 -0800
@@ -818,8 +818,9 @@
         final ForkJoinPool pool;   // the containing pool (may be null)
         final ForkJoinWorkerThread owner; // owning thread or null if shared
         volatile Thread parker;    // == owner during call to park; else null
-        volatile ForkJoinTask<?> currentJoin;  // task being joined in awaitJoin
-        @jdk.internal.vm.annotation.Contended("group2") // separate from other fields
+        volatile ForkJoinTask<?> currentJoin; // task being joined in awaitJoin
+
+        @jdk.internal.vm.annotation.Contended("group2") // segregate
         volatile ForkJoinTask<?> currentSteal; // nonnull when running some task
 
         WorkQueue(ForkJoinPool pool, ForkJoinWorkerThread owner) {
--- a/jdk/src/java.base/share/classes/java/util/concurrent/ForkJoinTask.java	Thu Feb 18 11:30:16 2016 -0800
+++ b/jdk/src/java.base/share/classes/java/util/concurrent/ForkJoinTask.java	Thu Feb 18 13:41:11 2016 -0800
@@ -541,16 +541,16 @@
     }
 
     /**
-     * Returns a rethrowable exception for the given task, if
-     * available. To provide accurate stack traces, if the exception
-     * was not thrown by the current thread, we try to create a new
-     * exception of the same type as the one thrown, but with the
-     * recorded exception as its cause. If there is no such
-     * constructor, we instead try to use a no-arg constructor,
-     * followed by initCause, to the same effect. If none of these
-     * apply, or any fail due to other exceptions, we return the
-     * recorded exception, which is still correct, although it may
-     * contain a misleading stack trace.
+     * Returns a rethrowable exception for this task, if available.
+     * To provide accurate stack traces, if the exception was not
+     * thrown by the current thread, we try to create a new exception
+     * of the same type as the one thrown, but with the recorded
+     * exception as its cause. If there is no such constructor, we
+     * instead try to use a no-arg constructor, followed by initCause,
+     * to the same effect. If none of these apply, or any fail due to
+     * other exceptions, we return the recorded exception, which is
+     * still correct, although it may contain a misleading stack
+     * trace.
      *
      * @return the exception, or null if none
      */
@@ -572,26 +572,20 @@
         if (e == null || (ex = e.ex) == null)
             return null;
         if (e.thrower != Thread.currentThread().getId()) {
-            Class<? extends Throwable> ec = ex.getClass();
             try {
                 Constructor<?> noArgCtor = null;
-                Constructor<?>[] cs = ec.getConstructors();// public ctors only
-                for (int i = 0; i < cs.length; ++i) {
-                    Constructor<?> c = cs[i];
+                // public ctors only
+                for (Constructor<?> c : ex.getClass().getConstructors()) {
                     Class<?>[] ps = c.getParameterTypes();
                     if (ps.length == 0)
                         noArgCtor = c;
-                    else if (ps.length == 1 && ps[0] == Throwable.class) {
-                        Throwable wx = (Throwable)c.newInstance(ex);
-                        return (wx == null) ? ex : wx;
-                    }
+                    else if (ps.length == 1 && ps[0] == Throwable.class)
+                        return (Throwable)c.newInstance(ex);
                 }
                 if (noArgCtor != null) {
-                    Throwable wx = (Throwable)(noArgCtor.newInstance());
-                    if (wx != null) {
-                        wx.initCause(ex);
-                        return wx;
-                    }
+                    Throwable wx = (Throwable)noArgCtor.newInstance();
+                    wx.initCause(ex);
+                    return wx;
                 }
             } catch (Exception ignore) {
             }
--- a/jdk/src/java.base/share/classes/java/util/concurrent/ThreadLocalRandom.java	Thu Feb 18 11:30:16 2016 -0800
+++ b/jdk/src/java.base/share/classes/java/util/concurrent/ThreadLocalRandom.java	Thu Feb 18 13:41:11 2016 -0800
@@ -134,14 +134,13 @@
     private static final AtomicLong seeder = new AtomicLong(initialSeed());
 
     private static long initialSeed() {
-        String pp = java.security.AccessController.doPrivileged(
-                new sun.security.action.GetPropertyAction(
-                        "java.util.secureRandomSeed"));
-        if (pp != null && pp.equalsIgnoreCase("true")) {
+        java.security.PrivilegedAction<Boolean> action =
+            () -> Boolean.getBoolean("java.util.secureRandomSeed");
+        if (java.security.AccessController.doPrivileged(action)) {
             byte[] seedBytes = java.security.SecureRandom.getSeed(8);
-            long s = (long)(seedBytes[0]) & 0xffL;
+            long s = (long)seedBytes[0] & 0xffL;
             for (int i = 1; i < 8; ++i)
-                s = (s << 8) | ((long)(seedBytes[i]) & 0xffL);
+                s = (s << 8) | ((long)seedBytes[i] & 0xffL);
             return s;
         }
         return (mix64(System.currentTimeMillis()) ^
--- a/jdk/src/java.base/share/classes/java/util/concurrent/atomic/Striped64.java	Thu Feb 18 11:30:16 2016 -0800
+++ b/jdk/src/java.base/share/classes/java/util/concurrent/atomic/Striped64.java	Thu Feb 18 13:41:11 2016 -0800
@@ -55,13 +55,13 @@
      * accessed directly by subclasses.
      *
      * Table entries are of class Cell; a variant of AtomicLong padded
-     * (via @jdk.internal.vm.annotation.Contended) to reduce cache contention. Padding
-     * is overkill for most Atomics because they are usually
-     * irregularly scattered in memory and thus don't interfere much
-     * with each other. But Atomic objects residing in arrays will
-     * tend to be placed adjacent to each other, and so will most
-     * often share cache lines (with a huge negative performance
-     * impact) without this precaution.
+     * (via @Contended) to reduce cache contention. Padding is
+     * overkill for most Atomics because they are usually irregularly
+     * scattered in memory and thus don't interfere much with each
+     * other. But Atomic objects residing in arrays will tend to be
+     * placed adjacent to each other, and so will most often share
+     * cache lines (with a huge negative performance impact) without
+     * this precaution.
      *
      * In part because Cells are relatively large, we avoid creating
      * them until they are needed.  When there is no contention, all
--- a/jdk/src/java.base/share/classes/java/util/zip/ZipEntry.java	Thu Feb 18 11:30:16 2016 -0800
+++ b/jdk/src/java.base/share/classes/java/util/zip/ZipEntry.java	Thu Feb 18 13:41:11 2016 -0800
@@ -227,12 +227,12 @@
         if (year < 0) {
             this.xdostime = DOSTIME_BEFORE_1980;
         } else {
-            this.xdostime = (year << 25 |
+            this.xdostime = ((year << 25 |
                 time.getMonthValue() << 21 |
                 time.getDayOfMonth() << 16 |
                 time.getHour() << 11 |
                 time.getMinute() << 5 |
-                time.getSecond() >> 1)
+                time.getSecond() >> 1) & 0xffffffffL)
                 + ((long)(((time.getSecond() & 0x1) * 1000) +
                       time.getNano() / 1000_000) << 32);
         }
--- a/jdk/src/java.base/share/classes/javax/net/ssl/SSLEngine.java	Thu Feb 18 11:30:16 2016 -0800
+++ b/jdk/src/java.base/share/classes/javax/net/ssl/SSLEngine.java	Thu Feb 18 13:41:11 2016 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2016, 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
@@ -875,10 +875,11 @@
      * created, all enabled cipher suites support a minimum quality of
      * service.  Thus, in some environments this value might be empty.
      * <P>
-     * Even if a suite has been enabled, it might never be used.  (For
-     * example, the peer does not support it, the requisite
-     * certificates/private keys for the suite are not available, or an
-     * anonymous suite is enabled but authentication is required.)
+     * Note that even if a suite is enabled, it may never be used. This
+     * can occur if the peer does not support it, or its use is restricted,
+     * or the requisite certificates (and private keys) for the suite are
+     * not available, or an anonymous suite is enabled but authentication
+     * is required.
      *
      * @return  an array of cipher suite names
      * @see     #getSupportedCipherSuites()
@@ -920,6 +921,11 @@
     /**
      * Returns the names of the protocol versions which are currently
      * enabled for use with this {@code SSLEngine}.
+     * <P>
+     * Note that even if a protocol is enabled, it may never be used.
+     * This can occur if the peer does not support the protocol, or its
+     * use is restricted, or there are no enabled cipher suites supported
+     * by the protocol.
      *
      * @return  an array of protocols
      * @see     #setEnabledProtocols(String [])
--- a/jdk/src/java.base/share/classes/javax/net/ssl/SSLServerSocket.java	Thu Feb 18 11:30:16 2016 -0800
+++ b/jdk/src/java.base/share/classes/javax/net/ssl/SSLServerSocket.java	Thu Feb 18 13:41:11 2016 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2016, 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
@@ -190,12 +190,11 @@
      * default guarantees a minimum quality of service in all enabled
      * cipher suites.
      * <P>
-     * There are several reasons why an enabled cipher suite might
-     * not actually be used.  For example:  the server socket might
-     * not have appropriate private keys available to it or the cipher
-     * suite might be anonymous, precluding the use of client authentication,
-     * while the server socket has been told to require that sort of
-     * authentication.
+     * Note that even if a suite is enabled, it may never be used. This
+     * can occur if the peer does not support it, or its use is restricted,
+     * or the requisite certificates (and private keys) for the suite are
+     * not available, or an anonymous suite is enabled but authentication
+     * is required.
      *
      * @return an array of cipher suites enabled
      * @see #getSupportedCipherSuites()
@@ -258,6 +257,11 @@
     /**
      * Returns the names of the protocols which are currently
      * enabled for use by the newly accepted connections.
+     * <P>
+     * Note that even if a protocol is enabled, it may never be used.
+     * This can occur if the peer does not support the protocol, or its
+     * use is restricted, or there are no enabled cipher suites supported
+     * by the protocol.
      *
      * @return an array of protocol names
      * @see #getSupportedProtocols()
--- a/jdk/src/java.base/share/classes/javax/net/ssl/SSLSocket.java	Thu Feb 18 11:30:16 2016 -0800
+++ b/jdk/src/java.base/share/classes/javax/net/ssl/SSLSocket.java	Thu Feb 18 13:41:11 2016 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2016, 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
@@ -279,10 +279,11 @@
      * created, all enabled cipher suites support a minimum quality of
      * service.  Thus, in some environments this value might be empty.
      * <P>
-     * Even if a suite has been enabled, it might never be used.  (For
-     * example, the peer does not support it, the requisite certificates
-     * (and private keys) for the suite are not available, or an
-     * anonymous suite is enabled but authentication is required.
+     * Note that even if a suite is enabled, it may never be used. This
+     * can occur if the peer does not support it, or its use is restricted,
+     * or the requisite certificates (and private keys) for the suite are
+     * not available, or an anonymous suite is enabled but authentication
+     * is required.
      *
      * @return an array of cipher suite names
      * @see #getSupportedCipherSuites()
@@ -324,6 +325,12 @@
     /**
      * Returns the names of the protocol versions which are currently
      * enabled for use on this connection.
+     * <P>
+     * Note that even if a protocol is enabled, it may never be used.
+     * This can occur if the peer does not support the protocol, or its
+     * use is restricted, or there are no enabled cipher suites supported
+     * by the protocol.
+     *
      * @see #setEnabledProtocols(String [])
      * @return an array of protocols
      */
--- a/jdk/src/java.base/share/classes/jdk/internal/math/DoubleConsts.java	Thu Feb 18 11:30:16 2016 -0800
+++ b/jdk/src/java.base/share/classes/jdk/internal/math/DoubleConsts.java	Thu Feb 18 13:41:11 2016 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2016, 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,7 +27,7 @@
 
 /**
  * This class contains additional constants documenting limits of the
- * <code>double</code> type.
+ * {@code double} type.
  *
  * @author Joseph D. Darcy
  */
@@ -38,69 +38,38 @@
      */
     private DoubleConsts() {}
 
-    public static final double POSITIVE_INFINITY = java.lang.Double.POSITIVE_INFINITY;
-    public static final double NEGATIVE_INFINITY = java.lang.Double.NEGATIVE_INFINITY;
-    public static final double NaN = java.lang.Double.NaN;
-    public static final double MAX_VALUE = java.lang.Double.MAX_VALUE;
-    public static final double MIN_VALUE = java.lang.Double.MIN_VALUE;
-
-    /**
-     * A constant holding the smallest positive normal value of type
-     * <code>double</code>, 2<sup>-1022</sup>.  It is equal to the
-     * value returned by
-     * <code>Double.longBitsToDouble(0x0010000000000000L)</code>.
-     *
-     * @since 1.5
-     */
-    public static final double  MIN_NORMAL      = 2.2250738585072014E-308;
-
-
     /**
      * The number of logical bits in the significand of a
-     * <code>double</code> number, including the implicit bit.
+     * {@code double} number, including the implicit bit.
      */
     public static final int SIGNIFICAND_WIDTH   = 53;
 
     /**
-     * Maximum exponent a finite <code>double</code> number may have.
-     * It is equal to the value returned by
-     * <code>Math.ilogb(Double.MAX_VALUE)</code>.
-     */
-    public static final int     MAX_EXPONENT    = 1023;
-
-    /**
-     * Minimum exponent a normalized <code>double</code> number may
-     * have.  It is equal to the value returned by
-     * <code>Math.ilogb(Double.MIN_NORMAL)</code>.
-     */
-    public static final int     MIN_EXPONENT    = -1022;
-
-    /**
-     * The exponent the smallest positive <code>double</code>
+     * The exponent the smallest positive {@code double}
      * subnormal value would have if it could be normalized..
      */
-    public static final int     MIN_SUB_EXPONENT = MIN_EXPONENT -
+    public static final int     MIN_SUB_EXPONENT = Double.MIN_EXPONENT -
                                                    (SIGNIFICAND_WIDTH - 1);
 
     /**
-     * Bias used in representing a <code>double</code> exponent.
+     * Bias used in representing a {@code double} exponent.
      */
     public static final int     EXP_BIAS        = 1023;
 
     /**
-     * Bit mask to isolate the sign bit of a <code>double</code>.
+     * Bit mask to isolate the sign bit of a {@code double}.
      */
     public static final long    SIGN_BIT_MASK   = 0x8000000000000000L;
 
     /**
      * Bit mask to isolate the exponent field of a
-     * <code>double</code>.
+     * {@code double}.
      */
     public static final long    EXP_BIT_MASK    = 0x7FF0000000000000L;
 
     /**
      * Bit mask to isolate the significand field of a
-     * <code>double</code>.
+     * {@code double}.
      */
     public static final long    SIGNIF_BIT_MASK = 0x000FFFFFFFFFFFFFL;
 
--- a/jdk/src/java.base/share/classes/jdk/internal/math/FloatConsts.java	Thu Feb 18 11:30:16 2016 -0800
+++ b/jdk/src/java.base/share/classes/jdk/internal/math/FloatConsts.java	Thu Feb 18 13:41:11 2016 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2016, 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,7 +27,7 @@
 
 /**
  * This class contains additional constants documenting limits of the
- * <code>float</code> type.
+ * {@code float} type.
  *
  * @author Joseph D. Darcy
  */
@@ -38,65 +38,38 @@
      */
     private FloatConsts() {}
 
-    public static final float POSITIVE_INFINITY = java.lang.Float.POSITIVE_INFINITY;
-    public static final float NEGATIVE_INFINITY = java.lang.Float.NEGATIVE_INFINITY;
-    public static final float NaN = java.lang.Float.NaN;
-    public static final float MAX_VALUE = java.lang.Float.MAX_VALUE;
-    public static final float MIN_VALUE = java.lang.Float.MIN_VALUE;
-
-    /**
-     * A constant holding the smallest positive normal value of type
-     * <code>float</code>, 2<sup>-126</sup>.  It is equal to the value
-     * returned by <code>Float.intBitsToFloat(0x00800000)</code>.
-     */
-    public static final float   MIN_NORMAL      = 1.17549435E-38f;
-
     /**
      * The number of logical bits in the significand of a
-     * <code>float</code> number, including the implicit bit.
+     * {@code float} number, including the implicit bit.
      */
     public static final int SIGNIFICAND_WIDTH   = 24;
 
     /**
-     * Maximum exponent a finite <code>float</code> number may have.
-     * It is equal to the value returned by
-     * <code>Math.ilogb(Float.MAX_VALUE)</code>.
-     */
-    public static final int     MAX_EXPONENT    = 127;
-
-    /**
-     * Minimum exponent a normalized <code>float</code> number may
-     * have.  It is equal to the value returned by
-     * <code>Math.ilogb(Float.MIN_NORMAL)</code>.
-     */
-    public static final int     MIN_EXPONENT    = -126;
-
-    /**
-     * The exponent the smallest positive <code>float</code> subnormal
+     * The exponent the smallest positive {@code float} subnormal
      * value would have if it could be normalized.
      */
-    public static final int     MIN_SUB_EXPONENT = MIN_EXPONENT -
+    public static final int     MIN_SUB_EXPONENT = Float.MIN_EXPONENT -
                                                    (SIGNIFICAND_WIDTH - 1);
 
     /**
-     * Bias used in representing a <code>float</code> exponent.
+     * Bias used in representing a {@code float} exponent.
      */
     public static final int     EXP_BIAS        = 127;
 
     /**
-     * Bit mask to isolate the sign bit of a <code>float</code>.
+     * Bit mask to isolate the sign bit of a {@code float}.
      */
     public static final int     SIGN_BIT_MASK   = 0x80000000;
 
     /**
      * Bit mask to isolate the exponent field of a
-     * <code>float</code>.
+     * {@code float}.
      */
     public static final int     EXP_BIT_MASK    = 0x7F800000;
 
     /**
      * Bit mask to isolate the significand field of a
-     * <code>float</code>.
+     * {@code float}.
      */
     public static final int     SIGNIF_BIT_MASK = 0x007FFFFF;
 
--- a/jdk/src/java.base/share/classes/jdk/internal/math/FloatingDecimal.java	Thu Feb 18 11:30:16 2016 -0800
+++ b/jdk/src/java.base/share/classes/jdk/internal/math/FloatingDecimal.java	Thu Feb 18 13:41:11 2016 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1996, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1996, 2016, 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
@@ -2377,8 +2377,8 @@
 
                 // Float calculations
                 int floatBits = isNegative ? FloatConsts.SIGN_BIT_MASK : 0;
-                if (exponent >= FloatConsts.MIN_EXPONENT) {
-                    if (exponent > FloatConsts.MAX_EXPONENT) {
+                if (exponent >= Float.MIN_EXPONENT) {
+                    if (exponent > Float.MAX_EXPONENT) {
                         // Float.POSITIVE_INFINITY
                         floatBits |= FloatConsts.EXP_BIT_MASK;
                     } else {
@@ -2409,12 +2409,12 @@
                 float fValue = Float.intBitsToFloat(floatBits);
 
                 // Check for overflow and update exponent accordingly.
-                if (exponent > DoubleConsts.MAX_EXPONENT) {         // Infinite result
+                if (exponent > Double.MAX_EXPONENT) {         // Infinite result
                     // overflow to properly signed infinity
                     return isNegative ? A2BC_NEGATIVE_INFINITY : A2BC_POSITIVE_INFINITY;
                 } else {  // Finite return value
-                    if (exponent <= DoubleConsts.MAX_EXPONENT && // (Usually) normal result
-                            exponent >= DoubleConsts.MIN_EXPONENT) {
+                    if (exponent <= Double.MAX_EXPONENT && // (Usually) normal result
+                            exponent >= Double.MIN_EXPONENT) {
 
                         // The result returned in this block cannot be a
                         // zero or subnormal; however after the
@@ -2434,7 +2434,7 @@
                                 (DoubleConsts.SIGNIF_BIT_MASK & significand);
 
                     } else {  // Subnormal or zero
-                        // (exponent < DoubleConsts.MIN_EXPONENT)
+                        // (exponent < Double.MIN_EXPONENT)
 
                         if (exponent < (DoubleConsts.MIN_SUB_EXPONENT - 1)) {
                             // No way to round back to nonzero value
@@ -2474,7 +2474,7 @@
                             // Now, discard the bits
                             significand = significand >> bitsDiscarded;
 
-                            significand = ((((long) (DoubleConsts.MIN_EXPONENT - 1) + // subnorm exp.
+                            significand = ((((long) (Double.MIN_EXPONENT - 1) + // subnorm exp.
                                     (long) DoubleConsts.EXP_BIAS) <<
                                     (DoubleConsts.SIGNIFICAND_WIDTH - 1))
                                     & DoubleConsts.EXP_BIT_MASK) |
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/src/java.base/share/classes/jdk/internal/misc/Signal.java	Thu Feb 18 13:41:11 2016 -0800
@@ -0,0 +1,284 @@
+/*
+ * Copyright (c) 1998, 2016, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package jdk.internal.misc;
+
+import java.util.Hashtable;
+import java.util.Objects;
+
+/**
+ * This class provides ANSI/ISO C signal support. A Java program can register
+ * signal handlers for the current process. There are two restrictions:
+ * <ul>
+ * <li>
+ * Java code cannot register a handler for signals that are already used
+ * by the Java VM implementation. The <code>Signal.handle</code>
+ * function raises an <code>IllegalArgumentException</code> if such an attempt
+ * is made.
+ * <li>
+ * When <code>Signal.handle</code> is called, the VM internally registers a
+ * special C signal handler. There is no way to force the Java signal handler
+ * to run synchronously before the C signal handler returns. Instead, when the
+ * VM receives a signal, the special C signal handler creates a new thread
+ * (at priority <code>Thread.MAX_PRIORITY</code>) to
+ * run the registered Java signal handler. The C signal handler immediately
+ * returns. Note that because the Java signal handler runs in a newly created
+ * thread, it may not actually be executed until some time after the C signal
+ * handler returns.
+ * </ul>
+ * <p>
+ * Signal objects are created based on their names. For example:
+ * <blockquote><pre>
+ * new Signal("INT");
+ * </pre></blockquote>
+ * constructs a signal object corresponding to <code>SIGINT</code>, which is
+ * typically produced when the user presses <code>Ctrl-C</code> at the command line.
+ * The <code>Signal</code> constructor throws <code>IllegalArgumentException</code>
+ * when it is passed an unknown signal.
+ * <p>
+ * This is an example of how Java code handles <code>SIGINT</code>:
+ * <blockquote><pre>
+ * Signal.Handler handler = new Signal.Handler () {
+ *     public void handle(Signal sig) {
+ *       ... // handle SIGINT
+ *     }
+ * };
+ * Signal.handle(new Signal("INT"), handler);
+ * </pre></blockquote>
+ *
+ * @since    9
+ */
+public final class Signal {
+    private static Hashtable<Signal, Signal.Handler> handlers = new Hashtable<>(4);
+    private static Hashtable<Integer, Signal> signals = new Hashtable<>(4);
+
+    private int number;
+    private String name;
+
+    /* Returns the signal number */
+    public int getNumber() {
+        return number;
+    }
+
+    /**
+     * Returns the signal name.
+     *
+     * @return the name of the signal.
+     * @see jdk.internal.misc.Signal#Signal(String name)
+     */
+    public String getName() {
+        return name;
+    }
+
+    /**
+     * Compares the equality of two <code>Signal</code> objects.
+     *
+     * @param other the object to compare with.
+     * @return whether two <code>Signal</code> objects are equal.
+     */
+    public boolean equals(Object other) {
+        if (this == other) {
+            return true;
+        }
+        if (other == null || !(other instanceof Signal)) {
+            return false;
+        }
+        Signal other1 = (Signal)other;
+        return name.equals(other1.name) && (number == other1.number);
+    }
+
+    /**
+     * Returns a hashcode for this Signal.
+     *
+     * @return  a hash code value for this object.
+     */
+    public int hashCode() {
+        return number;
+    }
+
+    /**
+     * Returns a string representation of this signal. For example, "SIGINT"
+     * for an object constructed using <code>new Signal ("INT")</code>.
+     *
+     * @return a string representation of the signal
+     */
+    public String toString() {
+        return "SIG" + name;
+    }
+
+    /**
+     * Constructs a signal from its name.
+     *
+     * @param name the name of the signal.
+     * @exception IllegalArgumentException unknown signal
+     * @see jdk.internal.misc.Signal#getName()
+     */
+    public Signal(String name) {
+        Objects.requireNonNull(name, "name");
+        // Signal names are the short names;
+        // the "SIG" prefix is not used for compatibility with previous JDKs
+        if (name.startsWith("SIG")) {
+            throw new IllegalArgumentException("Unknown signal: " + name);
+        }
+        this.name = name;
+        number = findSignal0(name);
+        if (number < 0) {
+            throw new IllegalArgumentException("Unknown signal: " + name);
+        }
+    }
+
+    /**
+     * Registers a signal handler.
+     *
+     * @param sig a signal
+     * @param handler the handler to be registered with the given signal.
+     * @return the old handler
+     * @exception IllegalArgumentException the signal is in use by the VM
+     * @see jdk.internal.misc.Signal#raise(Signal sig)
+     * @see jdk.internal.misc.Signal.Handler
+     * @see jdk.internal.misc.Signal.Handler#SIG_DFL
+     * @see jdk.internal.misc.Signal.Handler#SIG_IGN
+     */
+    public static synchronized Signal.Handler handle(Signal sig,
+                                                    Signal.Handler handler)
+        throws IllegalArgumentException {
+        Objects.requireNonNull(sig, "sig");
+        Objects.requireNonNull(handler, "handler");
+        long newH = (handler instanceof NativeHandler) ?
+                      ((NativeHandler)handler).getHandler() : 2;
+        long oldH = handle0(sig.number, newH);
+        if (oldH == -1) {
+            throw new IllegalArgumentException
+                ("Signal already used by VM or OS: " + sig);
+        }
+        signals.put(sig.number, sig);
+        synchronized (handlers) {
+            Signal.Handler oldHandler = handlers.get(sig);
+            handlers.remove(sig);
+            if (newH == 2) {
+                handlers.put(sig, handler);
+            }
+            if (oldH == 0) {
+                return Signal.Handler.SIG_DFL;
+            } else if (oldH == 1) {
+                return Signal.Handler.SIG_IGN;
+            } else if (oldH == 2) {
+                return oldHandler;
+            } else {
+                return new NativeHandler(oldH);
+            }
+        }
+    }
+
+    /**
+     * Raises a signal in the current process.
+     *
+     * @param sig a signal
+     * @see jdk.internal.misc.Signal#handle(Signal sig, Signal.Handler handler)
+     */
+    public static void raise(Signal sig) throws IllegalArgumentException {
+        Objects.requireNonNull(sig, "sig");
+        if (handlers.get(sig) == null) {
+            throw new IllegalArgumentException("Unhandled signal: " + sig);
+        }
+        raise0(sig.number);
+    }
+
+    /* Called by the VM to execute Java signal handlers. */
+    private static void dispatch(final int number) {
+        final Signal sig = signals.get(number);
+        final Signal.Handler handler = handlers.get(sig);
+
+        Runnable runnable = new Runnable () {
+            public void run() {
+              // Don't bother to reset the priority. Signal handler will
+              // run at maximum priority inherited from the VM signal
+              // dispatch thread.
+              // Thread.currentThread().setPriority(Thread.NORM_PRIORITY);
+                handler.handle(sig);
+            }
+        };
+        if (handler != null) {
+            new Thread(null, runnable, sig + " handler", 0, false).start();
+        }
+    }
+
+    /* Find the signal number, given a name. Returns -1 for unknown signals. */
+    private static native int findSignal0(String sigName);
+    /* Registers a native signal handler, and returns the old handler.
+     * Handler values:
+     *   0     default handler
+     *   1     ignore the signal
+     *   2     call back to Signal.dispatch
+     *   other arbitrary native signal handlers
+     */
+    private static native long handle0(int sig, long nativeH);
+    /* Raise a given signal number */
+    private static native void raise0(int sig);
+
+    /**
+     * This is the signal handler interface expected in <code>Signal.handle</code>.
+     */
+    public interface Handler {
+
+        /**
+         * The default signal handler
+         */
+        public static final Signal.Handler SIG_DFL = new NativeHandler(0);
+        /**
+         * Ignore the signal
+         */
+        public static final Signal.Handler SIG_IGN = new NativeHandler(1);
+
+        /**
+         * Handle the given signal
+         *
+         * @param sig a signal object
+         */
+        public void handle(Signal sig);
+    }
+
+
+    /*
+     * A package-private class implementing a signal handler in native code.
+     */
+    static final class NativeHandler implements Signal.Handler {
+
+        private final long handler;
+
+        long getHandler() {
+            return handler;
+        }
+
+        NativeHandler(long handler) {
+            this.handler = handler;
+        }
+
+        public void handle(Signal sig) {
+            throw new UnsupportedOperationException("invoking native signal handle not supported");
+        }
+    }
+
+}
--- a/jdk/src/java.base/share/classes/sun/misc/JarIndex.java	Thu Feb 18 11:30:16 2016 -0800
+++ b/jdk/src/java.base/share/classes/sun/misc/JarIndex.java	Thu Feb 18 13:41:11 2016 -0800
@@ -106,31 +106,11 @@
     /**
      * Returns the jar index, or <code>null</code> if none.
      *
-     * This single parameter version of the method is retained
-     * for binary compatibility with earlier releases.
-     *
      * @param jar the JAR file to get the index from.
      * @exception IOException if an I/O error has occurred.
      */
     public static JarIndex getJarIndex(JarFile jar) throws IOException {
-        return getJarIndex(jar, null);
-    }
-
-    /**
-     * Returns the jar index, or <code>null</code> if none.
-     *
-     * @param jar the JAR file to get the index from.
-     * @exception IOException if an I/O error has occurred.
-     */
-    public static JarIndex getJarIndex(JarFile jar, MetaIndex metaIndex) throws IOException {
         JarIndex index = null;
-        /* If metaIndex is not null, check the meta index to see
-           if META-INF/INDEX.LIST is contained in jar file or not.
-        */
-        if (metaIndex != null &&
-            !metaIndex.mayContain(INDEX_NAME)) {
-            return null;
-        }
         JarEntry e = jar.getJarEntry(INDEX_NAME);
         // if found, then load the index
         if (e != null) {
--- a/jdk/src/java.base/share/classes/sun/misc/Launcher.java	Thu Feb 18 11:30:16 2016 -0800
+++ b/jdk/src/java.base/share/classes/sun/misc/Launcher.java	Thu Feb 18 13:41:11 2016 -0800
@@ -319,21 +319,7 @@
                             if (bootClassPath == null)
                                 return new URL[0];
                             // Skip empty path in boot class path i.e. not default to use CWD
-                            File[] classPath = getClassPath(bootClassPath, false);
-                            int len = classPath.length;
-                            Set<File> seenDirs = new HashSet<File>();
-                            for (int i = 0; i < len; i++) {
-                                File curEntry = classPath[i];
-                                // Negative test used to properly handle
-                                // nonexistent jars on boot class path
-                                if (!curEntry.isDirectory()) {
-                                    curEntry = curEntry.getParentFile();
-                                }
-                                if (curEntry != null && seenDirs.add(curEntry)) {
-                                    MetaIndex.registerDirectory(curEntry);
-                                }
-                            }
-                            return pathToURLs(classPath);
+                            return pathToURLs(getClassPath(bootClassPath, false));
                         }
                     }
                 );
--- a/jdk/src/java.base/share/classes/sun/misc/MetaIndex.java	Thu Feb 18 11:30:16 2016 -0800
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,274 +0,0 @@
-/*
- * Copyright (c) 2005, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package sun.misc;
-
-import java.io.BufferedReader;
-import java.io.FileReader;
-import java.io.File;
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-/*
- * MetaIndex is intended to decrease startup time (in particular cold
- * start, when files are not yet in the disk cache) by providing a
- * quick reject mechanism for probes into jar files. The on-disk
- * representation of the meta-index is a flat text file with per-jar
- * entries indicating (generally speaking) prefixes of package names
- * contained in the jar. As an example, here is an edited excerpt of
- * the meta-index generated for jre/lib in the current build:
- *
-<PRE>
-% VERSION 1
-# charsets.jar
-sun/
-# jce.jar
-javax/
-! jsse.jar
-sun/
-com/sun/net/
-javax/
-com/sun/security/
-@ resources.jar
-com/sun/xml/
-com/sun/rowset/
-com/sun/org/
-sun/
-com/sun/imageio/
-javax/
-com/sun/java/swing/
-META-INF/services/
-com/sun/java/util/jar/pack/
-com/sun/corba/
-com/sun/jndi/
-! rt.jar
-org/w3c/
-com/sun/imageio/
-javax/
-java/
-sun/
-...
-</PRE>
- * <p> A few notes about the design of the meta-index:
- *
- * <UL>
- *
- * <LI> It contains entries for multiple jar files. This is
- * intentional, to reduce the number of disk accesses that need to be
- * performed during startup.
- *
- * <LI> It is only intended to act as a fast reject mechanism to
- * prevent application and other classes from forcing all jar files on
- * the boot and extension class paths to be opened. It is not intended
- * as a precise index of the contents of the jar.
- *
- * <LI> It should be as small as possible to reduce the amount of time
- * required to parse it during startup. For example, adding on the
- * secondary package element to java/ and javax/ packages
- * ("javax/swing/", for example) causes the meta-index to grow
- * significantly. This is why substrings of the packages have been
- * chosen as the principal contents.
- *
- * <LI> It is versioned, and optional, to prevent strong dependencies
- * between the JVM and JDK. It is also potentially applicable to more
- * than just the boot and extension class paths.
- *
- * <LI> Precisely speaking, it plays different role in JVM and J2SE
- * side.  On the JVM side, meta-index file is used to speed up locating the
- * class files only while on the J2SE side, meta-index file is used to speed
- * up the resources file & class file.
- * To help the JVM and J2SE code to better utilize the information in meta-index
- * file, we mark the jar file differently. Here is the current rule we use.
- * For jar file containing only class file, we put '!' before the jar file name;
- * for jar file containing only resources file, we put '@' before the jar file name;
- * for jar file containing both resources and class file, we put '#' before the
- * jar name.
- * Notice the fact that every jar file contains at least the manifest file, so when
- * we say "jar file containing only class file", we don't include that file.
- *
- * </UL>
- *
- * <p> To avoid changing the behavior of the current application
- * loader and other loaders, the current MetaIndex implementation in
- * the JDK requires that the directory containing the meta-index be
- * registered with the MetaIndex class before construction of the
- * associated URLClassPath. This prevents the need for automatic
- * searching for the meta-index in the URLClassPath code and potential
- * changes in behavior for non-core ClassLoaders.
- *
- * This class depends on make/tools/MetaIndex/BuildMetaIndex.java and
- * is used principally by sun.misc.URLClassPath.
- */
-
-public class MetaIndex {
-    // Maps jar file names in registered directories to meta-indices
-    private static volatile Map<File, MetaIndex> jarMap;
-
-    // List of contents of this meta-index
-    private String[] contents;
-
-    // Indicate whether the coresponding jar file is a pure class jar file or not
-    private boolean isClassOnlyJar;
-
-    //----------------------------------------------------------------------
-    // Registration of directories (which can cause parsing of the
-    // meta-index file if it is present), and fetching of parsed
-    // meta-indices
-    // jarMap is not strictly thread-safe when the meta index mechanism
-    // is extended for user-provided jar files in future.
-
-    public static MetaIndex forJar(File jar) {
-        return getJarMap().get(jar);
-    }
-
-    // 'synchronized' is added to protect the jarMap from being modified
-    // by multiple threads.
-    public static synchronized void registerDirectory(File dir) {
-        // Note that this does not currently check to see whether the
-        // directory has previously been registered, since the meta-index
-        // in a particular directory creates multiple entries in the
-        // jarMap. If this mechanism is extended beyond the boot and
-        // extension class paths (for example, automatically searching for
-        // meta-index files in directories containing jars which have been
-        // explicitly opened) then this code should be generalized.
-        //
-        // This method must be called from a privileged context.
-        File indexFile = new File(dir, "meta-index");
-        if (indexFile.exists()) {
-            try {
-                BufferedReader reader = new BufferedReader(new FileReader(indexFile));
-                String line = null;
-                String curJarName = null;
-                boolean isCurJarContainClassOnly = false;
-                List<String> contents = new ArrayList<String>();
-                Map<File, MetaIndex> map = getJarMap();
-
-                /* Convert dir into canonical form. */
-                dir = dir.getCanonicalFile();
-                /* Note: The first line should contain the version of
-                 * the meta-index file. We have to match the right version
-                 * before trying to parse this file. */
-                line = reader.readLine();
-                if (line == null ||
-                    !line.equals("% VERSION 2")) {
-                    reader.close();
-                    return;
-                }
-                while ((line = reader.readLine()) != null) {
-                    switch (line.charAt(0)) {
-                    case '!':
-                    case '#':
-                    case '@': {
-                        // Store away current contents, if any
-                        if ((curJarName != null) && (contents.size() > 0)) {
-                            map.put(new File(dir, curJarName),
-                                    new MetaIndex(contents,
-                                                  isCurJarContainClassOnly));
-
-                            contents.clear();
-                        }
-                        // Fetch new current jar file name
-                        curJarName = line.substring(2);
-                        if (line.charAt(0) == '!') {
-                            isCurJarContainClassOnly = true;
-                        } else if (isCurJarContainClassOnly) {
-                            isCurJarContainClassOnly = false;
-                        }
-
-                        break;
-                    }
-                    case '%':
-                        break;
-                    default: {
-                        contents.add(line);
-                    }
-                    }
-                }
-                // Store away current contents, if any
-                if ((curJarName != null) && (contents.size() > 0)) {
-                    map.put(new File(dir, curJarName),
-                            new MetaIndex(contents, isCurJarContainClassOnly));
-                }
-
-                reader.close();
-
-            } catch (IOException e) {
-                // Silently fail for now (similar behavior to elsewhere in
-                // extension and core loaders)
-            }
-        }
-    }
-
-    //----------------------------------------------------------------------
-    // Public APIs
-    //
-
-    public boolean mayContain(String entry) {
-        // Ask non-class file from class only jar returns false
-        // This check is important to avoid some class only jar
-        // files such as rt.jar are opened for resource request.
-        if  (isClassOnlyJar && !entry.endsWith(".class")){
-            return false;
-        }
-
-        String[] conts = contents;
-        for (int i = 0; i < conts.length; i++) {
-            if (entry.startsWith(conts[i])) {
-                return true;
-            }
-        }
-        return false;
-    }
-
-
-    //----------------------------------------------------------------------
-    // Implementation only below this point
-    // @IllegalArgumentException if entries is null.
-    private MetaIndex(List<String> entries, boolean isClassOnlyJar)
-        throws IllegalArgumentException {
-        if (entries == null) {
-            throw new IllegalArgumentException();
-        }
-
-        contents = entries.toArray(new String[0]);
-        this.isClassOnlyJar = isClassOnlyJar;
-    }
-
-    private static Map<File, MetaIndex> getJarMap() {
-        if (jarMap == null) {
-            synchronized (MetaIndex.class) {
-                if (jarMap == null) {
-                    jarMap = new HashMap<File, MetaIndex>();
-                }
-            }
-        }
-        assert jarMap != null;
-        return jarMap;
-    }
-}
--- a/jdk/src/java.base/share/classes/sun/misc/NativeSignalHandler.java	Thu Feb 18 11:30:16 2016 -0800
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,47 +0,0 @@
-/*
- * Copyright (c) 1998, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package sun.misc;
-
-/* A package-private class implementing a signal handler in native code. */
-
-final class NativeSignalHandler implements SignalHandler {
-
-    private final long handler;
-
-    long getHandler() {
-        return handler;
-    }
-
-    NativeSignalHandler(long handler) {
-        this.handler = handler;
-    }
-
-    public void handle(Signal sig) {
-        handle0(sig.getNumber(), handler);
-    }
-
-    private static native void handle0(int number, long handler);
-}
--- a/jdk/src/java.base/share/classes/sun/misc/Signal.java	Thu Feb 18 11:30:16 2016 -0800
+++ b/jdk/src/java.base/share/classes/sun/misc/Signal.java	Thu Feb 18 13:41:11 2016 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2016, 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
@@ -24,7 +24,8 @@
  */
 
 package sun.misc;
-import java.util.Hashtable;
+
+import java.util.Objects;
 
 /**
  * This class provides ANSI/ISO C signal support. A Java program can register
@@ -68,19 +69,17 @@
  *
  * @author   Sheng Liang
  * @author   Bill Shannon
- * @see      sun.misc.SignalHandler
+ * @see     sun.misc.SignalHandler
  * @since    1.2
  */
 public final class Signal {
-    private static Hashtable<Signal,SignalHandler> handlers = new Hashtable<>(4);
-    private static Hashtable<Integer,Signal> signals = new Hashtable<>(4);
 
-    private int number;
-    private String name;
+    // Delegate to jdk.internal.misc.Signal.
+    private final jdk.internal.misc.Signal iSignal;
 
     /* Returns the signal number */
     public int getNumber() {
-        return number;
+        return iSignal.getNumber();
     }
 
     /**
@@ -90,7 +89,7 @@
      * @see sun.misc.Signal#Signal(String name)
      */
     public String getName() {
-        return name;
+        return iSignal.getName();
     }
 
     /**
@@ -107,7 +106,7 @@
             return false;
         }
         Signal other1 = (Signal)other;
-        return name.equals(other1.name) && (number == other1.number);
+        return iSignal.equals(other1.iSignal);
     }
 
     /**
@@ -116,7 +115,7 @@
      * @return  a hash code value for this object.
      */
     public int hashCode() {
-        return number;
+        return getNumber();
     }
 
     /**
@@ -126,7 +125,7 @@
      * @return a string representation of the signal
      */
     public String toString() {
-        return "SIG" + name;
+        return iSignal.toString();
     }
 
     /**
@@ -137,11 +136,7 @@
      * @see sun.misc.Signal#getName()
      */
     public Signal(String name) {
-        number = findSignal(name);
-        this.name = name;
-        if (number < 0) {
-            throw new IllegalArgumentException("Unknown signal: " + name);
-        }
+        iSignal = new jdk.internal.misc.Signal(name);
     }
 
     /**
@@ -159,30 +154,9 @@
     public static synchronized SignalHandler handle(Signal sig,
                                                     SignalHandler handler)
         throws IllegalArgumentException {
-        long newH = (handler instanceof NativeSignalHandler) ?
-                      ((NativeSignalHandler)handler).getHandler() : 2;
-        long oldH = handle0(sig.number, newH);
-        if (oldH == -1) {
-            throw new IllegalArgumentException
-                ("Signal already used by VM or OS: " + sig);
-        }
-        signals.put(sig.number, sig);
-        synchronized (handlers) {
-            SignalHandler oldHandler = handlers.get(sig);
-            handlers.remove(sig);
-            if (newH == 2) {
-                handlers.put(sig, handler);
-            }
-            if (oldH == 0) {
-                return SignalHandler.SIG_DFL;
-            } else if (oldH == 1) {
-                return SignalHandler.SIG_IGN;
-            } else if (oldH == 2) {
-                return oldHandler;
-            } else {
-                return new NativeSignalHandler(oldH);
-            }
-        }
+        jdk.internal.misc.Signal.Handler oldHandler = jdk.internal.misc.Signal.handle(sig.iSignal,
+                InternalMiscHandler.of(sig, handler));
+        return SunMiscHandler.of(sig.iSignal, oldHandler);
     }
 
     /**
@@ -192,41 +166,70 @@
      * @see sun.misc.Signal#handle(Signal sig, SignalHandler handler)
      */
     public static void raise(Signal sig) throws IllegalArgumentException {
-        if (handlers.get(sig) == null) {
-            throw new IllegalArgumentException("Unhandled signal: " + sig);
-        }
-        raise0(sig.number);
+        jdk.internal.misc.Signal.raise(sig.iSignal);
     }
 
-    /* Called by the VM to execute Java signal handlers. */
-    private static void dispatch(final int number) {
-        final Signal sig = signals.get(number);
-        final SignalHandler handler = handlers.get(sig);
+    /*
+     * Wrapper class to proxy a SignalHandler to a jdk.internal.misc.Signal.Handler.
+     */
+    static final class InternalMiscHandler implements jdk.internal.misc.Signal.Handler {
+        private final SignalHandler handler;
+        private final Signal signal;
 
-        Runnable runnable = new Runnable () {
-            public void run() {
-              // Don't bother to reset the priority. Signal handler will
-              // run at maximum priority inherited from the VM signal
-              // dispatch thread.
-              // Thread.currentThread().setPriority(Thread.NORM_PRIORITY);
-                handler.handle(sig);
+        static jdk.internal.misc.Signal.Handler of(Signal signal, SignalHandler handler) {
+            if (handler == SignalHandler.SIG_DFL) {
+                return jdk.internal.misc.Signal.Handler.SIG_DFL;
+            } else if (handler == SignalHandler.SIG_IGN) {
+                return jdk.internal.misc.Signal.Handler.SIG_IGN;
+            } else if (handler instanceof SunMiscHandler) {
+                return ((SunMiscHandler)handler).iHandler;
+            } else {
+                return new InternalMiscHandler(signal, handler);
             }
-        };
-        if (handler != null) {
-            new Thread(null, runnable, sig + " handler", 0, false).start();
+        }
+
+        private InternalMiscHandler(Signal signal, SignalHandler handler) {
+            this.handler = handler;
+            this.signal = signal;
+        }
+
+        @Override
+        public void handle(jdk.internal.misc.Signal ignore) {
+            handler.handle(signal);
         }
     }
 
-    /* Find the signal number, given a name. Returns -1 for unknown signals. */
-    private static native int findSignal(String sigName);
-    /* Registers a native signal handler, and returns the old handler.
-     * Handler values:
-     *   0     default handler
-     *   1     ignore the signal
-     *   2     call back to Signal.dispatch
-     *   other arbitrary native signal handlers
+    /*
+     * Wrapper class to proxy a jdk.internal.misc.Signal.Handler to a SignalHandler.
      */
-    private static native long handle0(int sig, long nativeH);
-    /* Raise a given signal number */
-    private static native void raise0(int sig);
+    static final class SunMiscHandler implements SignalHandler {
+        private final jdk.internal.misc.Signal iSignal;
+        private final jdk.internal.misc.Signal.Handler iHandler;
+
+        static SignalHandler of(jdk.internal.misc.Signal signal, jdk.internal.misc.Signal.Handler handler) {
+            if (handler == jdk.internal.misc.Signal.Handler.SIG_DFL) {
+                return SignalHandler.SIG_DFL;
+            } else if (handler == jdk.internal.misc.Signal.Handler.SIG_IGN) {
+                return SignalHandler.SIG_IGN;
+            } else if (handler instanceof InternalMiscHandler) {
+                return ((InternalMiscHandler) handler).handler;
+            } else {
+                return new SunMiscHandler(signal, handler);
+            }
+        }
+
+        SunMiscHandler(jdk.internal.misc.Signal iSignal, jdk.internal.misc.Signal.Handler iHandler) {
+            this.iSignal = iSignal;
+            this.iHandler = iHandler;
+        }
+
+        @Override
+        public void handle(Signal sig) {
+            iHandler.handle(iSignal);
+        }
+
+        public String toString() {
+            return iHandler.toString();
+        }
+    }
 }
--- a/jdk/src/java.base/share/classes/sun/misc/SignalHandler.java	Thu Feb 18 11:30:16 2016 -0800
+++ b/jdk/src/java.base/share/classes/sun/misc/SignalHandler.java	Thu Feb 18 13:41:11 2016 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2016, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -39,11 +39,13 @@
     /**
      * The default signal handler
      */
-    public static final SignalHandler SIG_DFL = new NativeSignalHandler(0);
+    public static final SignalHandler SIG_DFL =
+            new Signal.SunMiscHandler(null, jdk.internal.misc.Signal.Handler.SIG_DFL);
     /**
      * Ignore the signal
      */
-    public static final SignalHandler SIG_IGN = new NativeSignalHandler(1);
+    public static final SignalHandler SIG_IGN =
+            new Signal.SunMiscHandler(null, jdk.internal.misc.Signal.Handler.SIG_IGN);
 
     /**
      * Handle the given signal
--- a/jdk/src/java.base/share/classes/sun/misc/URLClassPath.java	Thu Feb 18 11:30:16 2016 -0800
+++ b/jdk/src/java.base/share/classes/sun/misc/URLClassPath.java	Thu Feb 18 13:41:11 2016 -0800
@@ -620,7 +620,6 @@
         private JarFile jar;
         private URL csu;
         private JarIndex index;
-        private MetaIndex metaIndex;
         private URLStreamHandler handler;
         private HashMap<String, Loader> lmap;
         private boolean closed = false;
@@ -640,32 +639,7 @@
             handler = jarHandler;
             lmap = loaderMap;
 
-            if (!isOptimizable(url)) {
-                ensureOpen();
-            } else {
-                 String fileName = url.getFile();
-                if (fileName != null) {
-                    fileName = ParseUtil.decode(fileName);
-                    File f = new File(fileName);
-                    metaIndex = MetaIndex.forJar(f);
-                    // If the meta index is found but the file is not
-                    // installed, set metaIndex to null. A typical
-                    // senario is charsets.jar which won't be installed
-                    // when the user is running in certain locale environment.
-                    // The side effect of null metaIndex will cause
-                    // ensureOpen get called so that IOException is thrown.
-                    if (metaIndex != null && !f.exists()) {
-                        metaIndex = null;
-                    }
-                }
-
-                // metaIndex is null when either there is no such jar file
-                // entry recorded in meta-index file or such jar file is
-                // missing in JRE. See bug 6340399.
-                if (metaIndex == null) {
-                    ensureOpen();
-                }
-            }
+            ensureOpen();
         }
 
         @Override
@@ -699,7 +673,7 @@
                                 }
 
                                 jar = getJarFile(csu);
-                                index = JarIndex.getJarIndex(jar, metaIndex);
+                                index = JarIndex.getJarIndex(jar);
                                 if (index != null) {
                                     String[] jarfiles = index.getJarFiles();
                                 // Add all the dependent URLs to the lmap so that loaders
@@ -854,12 +828,6 @@
          * Returns the JAR Resource for the specified name.
          */
         Resource getResource(final String name, boolean check) {
-            if (metaIndex != null) {
-                if (!metaIndex.mayContain(name)) {
-                    return null;
-                }
-            }
-
             try {
                 ensureOpen();
             } catch (IOException e) {
@@ -1002,10 +970,6 @@
                 return null;
             }
 
-            if (metaIndex != null) {
-                return null;
-            }
-
             ensureOpen();
 
             if (SharedSecrets.javaUtilJarAccess().jarFileHasClassPathAttribute(jar)) { // Only get manifest when necessary
--- a/jdk/src/java.base/share/classes/sun/security/pkcs12/PKCS12KeyStore.java	Thu Feb 18 11:30:16 2016 -0800
+++ b/jdk/src/java.base/share/classes/sun/security/pkcs12/PKCS12KeyStore.java	Thu Feb 18 13:41:11 2016 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2016, 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
@@ -394,19 +394,19 @@
 
             // decode secret key
             } else {
-                SecretKeyFactory sKeyFactory =
-                    SecretKeyFactory.getInstance(keyAlgo);
                 byte[] keyBytes = in.getOctetString();
                 SecretKeySpec secretKeySpec =
                     new SecretKeySpec(keyBytes, keyAlgo);
 
                 // Special handling required for PBE: needs a PBEKeySpec
                 if (keyAlgo.startsWith("PBE")) {
+                    SecretKeyFactory sKeyFactory =
+                        SecretKeyFactory.getInstance(keyAlgo);
                     KeySpec pbeKeySpec =
                         sKeyFactory.getKeySpec(secretKeySpec, PBEKeySpec.class);
                     key = sKeyFactory.generateSecret(pbeKeySpec);
                 } else {
-                    key = sKeyFactory.generateSecret(secretKeySpec);
+                    key = secretKeySpec;
                 }
 
                 if (debug != null) {
--- a/jdk/src/java.base/share/classes/sun/security/util/KeyUtil.java	Thu Feb 18 11:30:16 2016 -0800
+++ b/jdk/src/java.base/share/classes/sun/security/util/KeyUtil.java	Thu Feb 18 13:41:11 2016 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2016, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -32,6 +32,7 @@
 import java.security.interfaces.ECKey;
 import java.security.interfaces.RSAKey;
 import java.security.interfaces.DSAKey;
+import java.security.interfaces.DSAParams;
 import java.security.SecureRandom;
 import java.security.spec.KeySpec;
 import javax.crypto.SecretKey;
@@ -87,7 +88,8 @@
             size = pubk.getParams().getOrder().bitLength();
         } else if (key instanceof DSAKey) {
             DSAKey pubk = (DSAKey)key;
-            size = pubk.getParams().getP().bitLength();
+            DSAParams params = pubk.getParams();    // params can be null
+            size = (params != null) ? params.getP().bitLength() : -1;
         } else if (key instanceof DHKey) {
             DHKey pubk = (DHKey)key;
             size = pubk.getParams().getP().bitLength();
--- a/jdk/src/java.base/share/conf/security/java.security	Thu Feb 18 11:30:16 2016 -0800
+++ b/jdk/src/java.base/share/conf/security/java.security	Thu Feb 18 13:41:11 2016 -0800
@@ -549,7 +549,8 @@
 #   jdk.certpath.disabledAlgorithms=MD2, DSA, RSA keySize < 2048
 #
 #
-jdk.certpath.disabledAlgorithms=MD2, MD5, RSA keySize < 1024
+jdk.certpath.disabledAlgorithms=MD2, MD5, RSA keySize < 1024, \
+    DSA keySize < 1024
 
 # Algorithm restrictions for Secure Socket Layer/Transport Layer Security
 # (SSL/TLS/DTLS) processing
--- a/jdk/src/java.base/share/native/libjava/NativeSignalHandler.c	Thu Feb 18 11:30:16 2016 -0800
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,40 +0,0 @@
-/*
- * Copyright (c) 1998, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-#include <signal.h>
-#include <stdlib.h>
-
-#include <jni.h>
-#include <jlong.h>
-#include "sun_misc_NativeSignalHandler.h"
-
-typedef void (*sig_handler_t)(jint, void *, void *);
-
-JNIEXPORT void JNICALL
-Java_sun_misc_NativeSignalHandler_handle0(JNIEnv *env, jclass cls, jint sig, jlong f)
-{
-    /* We've lost the siginfo and context */
-    (*(sig_handler_t)jlong_to_ptr(f))(sig, NULL, NULL);
-}
--- a/jdk/src/java.base/share/native/libjava/Signal.c	Thu Feb 18 11:30:16 2016 -0800
+++ b/jdk/src/java.base/share/native/libjava/Signal.c	Thu Feb 18 13:41:11 2016 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2016, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -30,13 +30,18 @@
 #include <jvm.h>
 #include <jni_util.h>
 #include <jlong.h>
-#include "sun_misc_Signal.h"
+#include "jdk_internal_misc_Signal.h"
 
 JNIEXPORT jint JNICALL
-Java_sun_misc_Signal_findSignal(JNIEnv *env, jclass cls, jstring name)
+Java_jdk_internal_misc_Signal_findSignal0(JNIEnv *env, jclass cls, jstring name)
 {
     jint res;
-    const char *cname = (*env)->GetStringUTFChars(env, name, 0);
+    const char *cname;
+    if (name == NULL) {
+        JNU_ThrowNullPointerException(env, "name");
+        return 0;
+    }
+    cname = (*env)->GetStringUTFChars(env, name, 0);
     if (cname == NULL) {
         /* out of memory thrown */
         return 0;
@@ -47,13 +52,13 @@
 }
 
 JNIEXPORT jlong JNICALL
-Java_sun_misc_Signal_handle0(JNIEnv *env, jclass cls, jint sig, jlong handler)
+Java_jdk_internal_misc_Signal_handle0(JNIEnv *env, jclass cls, jint sig, jlong handler)
 {
     return ptr_to_jlong(JVM_RegisterSignal(sig, jlong_to_ptr(handler)));
 }
 
 JNIEXPORT void JNICALL
-Java_sun_misc_Signal_raise0(JNIEnv *env, jclass cls, jint sig)
+Java_jdk_internal_misc_Signal_raise0(JNIEnv *env, jclass cls, jint sig)
 {
     JVM_RaiseSignal(sig);
 }
--- a/jdk/src/java.base/share/native/libjava/System.c	Thu Feb 18 11:30:16 2016 -0800
+++ b/jdk/src/java.base/share/native/libjava/System.c	Thu Feb 18 13:41:11 2016 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1994, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1994, 2016, 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
@@ -114,7 +114,7 @@
 #define VENDOR_URL_BUG "http://bugreport.java.com/bugreport/"
 #endif
 
-#define JAVA_MAX_SUPPORTED_VERSION 52
+#define JAVA_MAX_SUPPORTED_VERSION 53
 #define JAVA_MAX_SUPPORTED_MINOR_VERSION 0
 
 #ifdef JAVA_SPECIFICATION_VENDOR /* Third party may NOT overwrite this. */
--- a/jdk/src/java.base/unix/classes/java/lang/Terminator.java	Thu Feb 18 11:30:16 2016 -0800
+++ b/jdk/src/java.base/unix/classes/java/lang/Terminator.java	Thu Feb 18 13:41:11 2016 -0800
@@ -25,8 +25,7 @@
 
 package java.lang;
 
-import sun.misc.Signal;
-import sun.misc.SignalHandler;
+import jdk.internal.misc.Signal;
 
 
 /**
@@ -39,7 +38,7 @@
 
 class Terminator {
 
-    private static SignalHandler handler = null;
+    private static Signal.Handler handler = null;
 
     /* Invocations of setup and teardown are already synchronized
      * on the shutdown lock, so no further synchronization is needed here
@@ -47,7 +46,7 @@
 
     static void setup() {
         if (handler != null) return;
-        SignalHandler sh = new SignalHandler() {
+        Signal.Handler sh = new Signal.Handler() {
             public void handle(Signal sig) {
                 Shutdown.exit(sig.getNumber() + 0200);
             }
--- a/jdk/src/java.base/windows/classes/java/lang/Terminator.java	Thu Feb 18 11:30:16 2016 -0800
+++ b/jdk/src/java.base/windows/classes/java/lang/Terminator.java	Thu Feb 18 13:41:11 2016 -0800
@@ -25,8 +25,7 @@
 
 package java.lang;
 
-import sun.misc.Signal;
-import sun.misc.SignalHandler;
+import jdk.internal.misc.Signal;
 
 
 /**
@@ -39,7 +38,7 @@
 
 class Terminator {
 
-    private static SignalHandler handler = null;
+    private static Signal.Handler handler = null;
 
     /* Invocations of setup and teardown are already synchronized
      * on the shutdown lock, so no further synchronization is needed here
@@ -47,7 +46,7 @@
 
     static void setup() {
         if (handler != null) return;
-        SignalHandler sh = new SignalHandler() {
+        Signal.Handler sh = new Signal.Handler() {
             public void handle(Signal sig) {
                 Shutdown.exit(sig.getNumber() + 0200);
             }
--- a/jdk/src/java.desktop/share/classes/javax/imageio/spi/ServiceRegistry.java	Thu Feb 18 11:30:16 2016 -0800
+++ b/jdk/src/java.desktop/share/classes/javax/imageio/spi/ServiceRegistry.java	Thu Feb 18 13:41:11 2016 -0800
@@ -759,7 +759,7 @@
         this.category = category;
     }
 
-    public boolean registerServiceProvider(Object provider) {
+    public synchronized boolean registerServiceProvider(Object provider) {
         Object oprovider = map.get(provider.getClass());
         boolean present =  oprovider != null;
 
@@ -781,7 +781,7 @@
      *
      * @return true if the provider was previously registered.
      */
-    public boolean deregisterServiceProvider(Object provider) {
+    public synchronized boolean deregisterServiceProvider(Object provider) {
         Object oprovider = map.get(provider.getClass());
 
         if (provider == oprovider) {
@@ -797,22 +797,23 @@
         return false;
     }
 
-    public boolean contains(Object provider) {
+    public synchronized boolean contains(Object provider) {
         Object oprovider = map.get(provider.getClass());
         return oprovider == provider;
     }
 
-    public boolean setOrdering(Object firstProvider,
-                               Object secondProvider) {
+    public synchronized boolean setOrdering(Object firstProvider,
+                                            Object secondProvider) {
         return poset.setOrdering(firstProvider, secondProvider);
     }
 
-    public boolean unsetOrdering(Object firstProvider,
-                                 Object secondProvider) {
+    public synchronized boolean unsetOrdering(Object firstProvider,
+                                              Object secondProvider) {
         return poset.unsetOrdering(firstProvider, secondProvider);
     }
 
-    public Iterator<Object> getServiceProviders(boolean useOrdering) {
+    public synchronized Iterator<Object> getServiceProviders
+                                         (boolean useOrdering) {
         if (useOrdering) {
             return poset.iterator();
         } else {
@@ -821,11 +822,12 @@
     }
 
     @SuppressWarnings("unchecked")
-    public <T> T getServiceProviderByClass(Class<T> providerClass) {
+    public synchronized <T> T getServiceProviderByClass
+                              (Class<T> providerClass) {
         return (T)map.get(providerClass);
     }
 
-    public void clear() {
+    public synchronized void clear() {
         Iterator<Object> iter = map.values().iterator();
         while (iter.hasNext()) {
             Object provider = iter.next();
@@ -839,7 +841,7 @@
         poset.clear();
     }
 
-    public void finalize() {
+    public synchronized void finalize() {
         clear();
     }
 }
--- a/jdk/src/java.desktop/share/classes/sun/java2d/SunGraphics2D.java	Thu Feb 18 11:30:16 2016 -0800
+++ b/jdk/src/java.desktop/share/classes/sun/java2d/SunGraphics2D.java	Thu Feb 18 13:41:11 2016 -0800
@@ -3118,8 +3118,7 @@
                 invalidateTransform();
             }
             return result;
-        } else if (resolutionVariantHint != SunHints.INTVAL_RESOLUTION_VARIANT_BASE
-                   && (img instanceof MultiResolutionImage)) {
+        } else if (img instanceof MultiResolutionImage) {
             // get scaled destination image size
 
             int width = img.getWidth(observer);
--- a/jdk/src/java.desktop/share/classes/sun/java2d/marlin/FloatMath.java	Thu Feb 18 11:30:16 2016 -0800
+++ b/jdk/src/java.desktop/share/classes/sun/java2d/marlin/FloatMath.java	Thu Feb 18 13:41:11 2016 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2016, 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
@@ -24,7 +24,6 @@
  */
 package sun.java2d.marlin;
 
-import jdk.internal.math.DoubleConsts;
 import jdk.internal.math.FloatConsts;
 
 /**
@@ -210,14 +209,4 @@
         }
         return intpart - 1;
     }
-
-    /**
-     * Returns a floating-point power of two in the normal range.
-     */
-    static double powerOfTwoD(int n) {
-        assert (n >= DoubleConsts.MIN_EXPONENT && n <= DoubleConsts.MAX_EXPONENT);
-        return Double.longBitsToDouble((((long) n + (long) DoubleConsts.EXP_BIAS)
-                << (DoubleConsts.SIGNIFICAND_WIDTH - 1))
-                & DoubleConsts.EXP_BIT_MASK);
-    }
 }
--- a/jdk/src/java.desktop/share/classes/sun/java2d/marlin/Renderer.java	Thu Feb 18 11:30:16 2016 -0800
+++ b/jdk/src/java.desktop/share/classes/sun/java2d/marlin/Renderer.java	Thu Feb 18 13:41:11 2016 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2007, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2007, 2016, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -40,7 +40,7 @@
     private static final int ALL_BUT_LSB = 0xfffffffe;
     private static final int ERR_STEP_MAX = 0x7fffffff; // = 2^31 - 1
 
-    private static final double POWER_2_TO_32 = FloatMath.powerOfTwoD(32);
+    private static final double POWER_2_TO_32 = 0x1.0p32;
 
     // use float to make tosubpix methods faster (no int to float conversion)
     public static final float f_SUBPIXEL_POSITIONS_X
--- a/jdk/src/java.desktop/unix/classes/sun/awt/X11/XBaseWindow.java	Thu Feb 18 11:30:16 2016 -0800
+++ b/jdk/src/java.desktop/unix/classes/sun/awt/X11/XBaseWindow.java	Thu Feb 18 13:41:11 2016 -0800
@@ -79,7 +79,6 @@
 
     static enum InitialiseState {
         INITIALISING,
-        NOT_INITIALISED,
         INITIALISED,
         FAILED_INITIALISATION
     };
@@ -122,7 +121,6 @@
      */
     void instantPreInit(XCreateWindowParams params) {
         state_lock = new StateLock();
-        initialising = InitialiseState.NOT_INITIALISED;
     }
 
     /**
@@ -131,7 +129,6 @@
      */
     void preInit(XCreateWindowParams params) {
         state_lock = new StateLock();
-        initialising = InitialiseState.NOT_INITIALISED;
         embedded = Boolean.TRUE.equals(params.get(EMBEDDED));
         visible = Boolean.TRUE.equals(params.get(VISIBLE));
 
@@ -223,7 +220,6 @@
                       return false;
                   }
                   return true;
-              case NOT_INITIALISED:
               case FAILED_INITIALISATION:
                   return false;
               default:
--- a/jdk/src/java.desktop/unix/classes/sun/awt/X11GraphicsConfig.java	Thu Feb 18 11:30:16 2016 -0800
+++ b/jdk/src/java.desktop/unix/classes/sun/awt/X11GraphicsConfig.java	Thu Feb 18 13:41:11 2016 -0800
@@ -452,8 +452,12 @@
     public VolatileImage createBackBufferImage(Component target,
                                                long backBuffer)
     {
+        // it is possible for the component to have size 0x0, adjust it to
+        // be at least 1x1 to avoid IAE
+        int w = Math.max(1, target.getWidth());
+        int h = Math.max(1, target.getHeight());
         return new SunVolatileImage(target,
-                                    target.getWidth(), target.getHeight(),
+                                    w, h,
                                     Long.valueOf(backBuffer));
     }
 
--- a/jdk/src/java.desktop/windows/classes/sun/awt/windows/WToolkit.java	Thu Feb 18 11:30:16 2016 -0800
+++ b/jdk/src/java.desktop/windows/classes/sun/awt/windows/WToolkit.java	Thu Feb 18 13:41:11 2016 -0800
@@ -641,10 +641,21 @@
             GraphicsEnvironment.getLocalGraphicsEnvironment();
         return ge.getXResolution();
     }
+
     @Override
-    protected native int getScreenWidth();
+    protected int getScreenWidth() {
+        return GraphicsEnvironment.getLocalGraphicsEnvironment()
+                .getDefaultScreenDevice().getDefaultConfiguration()
+                .getBounds().width;
+    }
+
     @Override
-    protected native int getScreenHeight();
+    protected int getScreenHeight() {
+        return GraphicsEnvironment.getLocalGraphicsEnvironment()
+                .getDefaultScreenDevice().getDefaultConfiguration()
+                .getBounds().height;
+    }
+
     private native Insets getScreenInsets(int screen);
 
 
--- a/jdk/src/java.desktop/windows/classes/sun/java2d/opengl/WGLGraphicsConfig.java	Thu Feb 18 11:30:16 2016 -0800
+++ b/jdk/src/java.desktop/windows/classes/sun/java2d/opengl/WGLGraphicsConfig.java	Thu Feb 18 13:41:11 2016 -0800
@@ -323,8 +323,12 @@
     @Override
     public VolatileImage createBackBuffer(WComponentPeer peer) {
         Component target = (Component)peer.getTarget();
+        // it is possible for the component to have size 0x0, adjust it to
+        // be at least 1x1 to avoid IAE
+        int w = Math.max(1, target.getWidth());
+        int h = Math.max(1, target.getHeight());
         return new SunVolatileImage(target,
-                                    target.getWidth(), target.getHeight(),
+                                    w, h,
                                     Boolean.TRUE);
     }
 
--- a/jdk/src/java.desktop/windows/native/libawt/windows/awt_TextArea.cpp	Thu Feb 18 11:30:16 2016 -0800
+++ b/jdk/src/java.desktop/windows/native/libawt/windows/awt_TextArea.cpp	Thu Feb 18 13:41:11 2016 -0800
@@ -73,10 +73,7 @@
 }
 
 void AwtTextArea::EditSetSel(CHARRANGE &cr) {
-    // Fix for 5003402: added restoring/hiding selection to enable automatic scrolling
-    SendMessage(EM_HIDESELECTION, FALSE, TRUE);
     SendMessage(EM_EXSETSEL, 0, reinterpret_cast<LPARAM>(&cr));
-    SendMessage(EM_HIDESELECTION, TRUE, TRUE);
     // 6417581: force expected drawing
     if (IS_WINVISTA && cr.cpMin == cr.cpMax) {
         ::InvalidateRect(GetHWnd(), NULL, TRUE);
--- a/jdk/src/java.desktop/windows/native/libawt/windows/awt_Toolkit.cpp	Thu Feb 18 11:30:16 2016 -0800
+++ b/jdk/src/java.desktop/windows/native/libawt/windows/awt_Toolkit.cpp	Thu Feb 18 13:41:11 2016 -0800
@@ -2347,53 +2347,6 @@
 
 /*
  * Class:     sun_awt_windows_WToolkit
- * Method:    getScreenWidth
- * Signature: ()I
- */
-JNIEXPORT jint JNICALL
-Java_sun_awt_windows_WToolkit_getScreenWidth(JNIEnv *env, jobject self)
-{
-    TRY;
-
-    int width = ::GetSystemMetrics(SM_CXSCREEN);
-
-    if (!Devices::GetInstance()) {
-        Devices::UpdateInstance(env);
-    }
-    Devices::InstanceAccess devices;
-    AwtWin32GraphicsDevice *device = devices->GetDevice(
-                        AwtWin32GraphicsDevice::GetDefaultDeviceIndex());
-
-    return (device == NULL) ? width : device->ScaleDownX(width);
-    CATCH_BAD_ALLOC_RET(0);
-}
-
-/*
- * Class:     sun_awt_windows_WToolkit
- * Method:    getScreenHeight
- * Signature: ()I
- */
-JNIEXPORT jint JNICALL
-Java_sun_awt_windows_WToolkit_getScreenHeight(JNIEnv *env, jobject self)
-{
-    TRY;
-
-    int height = ::GetSystemMetrics(SM_CYSCREEN);
-
-    if (!Devices::GetInstance()) {
-        Devices::UpdateInstance(env);
-    }
-    Devices::InstanceAccess devices;
-    AwtWin32GraphicsDevice *device = devices->GetDevice(
-                        AwtWin32GraphicsDevice::GetDefaultDeviceIndex());
-
-    return (device == NULL) ? height : device->ScaleDownY(height);
-
-    CATCH_BAD_ALLOC_RET(0);
-}
-
-/*
- * Class:     sun_awt_windows_WToolkit
  * Method:    getSreenInsets
  * Signature: (I)Ljava/awt/Insets;
  */
--- a/jdk/src/java.desktop/windows/native/libawt/windows/awt_Window.cpp	Thu Feb 18 11:30:16 2016 -0800
+++ b/jdk/src/java.desktop/windows/native/libawt/windows/awt_Window.cpp	Thu Feb 18 13:41:11 2016 -0800
@@ -382,6 +382,9 @@
     if (wp->flags & SWP_HIDEWINDOW) {
         EnableTranslucency(FALSE);
     }
+    if (wp->flags & SWP_SHOWWINDOW) {
+        EnableTranslucency(TRUE);
+    }
 
     return mrDoDefault;
 }
--- a/jdk/src/java.security.jgss/share/classes/javax/security/auth/kerberos/KerberosTicket.java	Thu Feb 18 11:30:16 2016 -0800
+++ b/jdk/src/java.security.jgss/share/classes/javax/security/auth/kerberos/KerberosTicket.java	Thu Feb 18 13:41:11 2016 -0800
@@ -64,6 +64,9 @@
  * other regular service tickets. A ticket granting ticket is just a
  * special case of a more generalized service ticket.
  *
+ * @implNote The JAAS login module in the JDK reference implementation destroys
+ * all tickets after logout.
+ *
  * @see javax.security.auth.Subject
  * @see javax.security.auth.PrivateCredentialPermission
  * @see javax.security.auth.login.LoginContext
@@ -335,7 +338,7 @@
     /**
      * Returns the client principal associated with this ticket.
      *
-     * @return the client principal.
+     * @return the client principal, or {@code null} if destroyed.
      */
     public final KerberosPrincipal getClient() {
         return client;
@@ -344,7 +347,7 @@
     /**
      * Returns the service principal associated with this ticket.
      *
-     * @return the service principal.
+     * @return the service principal, or {@code null} if destroyed.
      */
     public final KerberosPrincipal getServer() {
         return server;
@@ -355,6 +358,7 @@
      * is always a {@link EncryptionKey} object.
      *
      * @return the session key.
+     * @throws IllegalStateException if this ticket is destroyed
      */
     public final SecretKey getSessionKey() {
         if (destroyed) {
@@ -370,6 +374,7 @@
      *
      * @return the key type of the session key associated with this
      * ticket.
+     * @throws IllegalStateException if this ticket is destroyed
      *
      * @see #getSessionKey()
      */
@@ -383,10 +388,11 @@
     /**
      * Determines if this ticket is forwardable.
      *
-     * @return true if this ticket is forwardable, false if not.
+     * @return true if this ticket is forwardable, or false if not forwardable
+     * or destroyed.
      */
     public final boolean isForwardable() {
-        return flags[FORWARDABLE_TICKET_FLAG];
+        return flags == null? false: flags[FORWARDABLE_TICKET_FLAG];
     }
 
     /**
@@ -395,38 +401,41 @@
      *
      * @return true if this ticket had been forwarded or was issued based on
      * authentication involving a forwarded ticket-granting ticket,
-     * false otherwise.
+     * or false otherwise or destroyed.
      */
     public final boolean isForwarded() {
-        return flags[FORWARDED_TICKET_FLAG];
+        return flags == null? false: flags[FORWARDED_TICKET_FLAG];
     }
 
     /**
      * Determines if this ticket is proxiable.
      *
-     * @return true if this ticket is proxiable, false if not.
+     * @return true if this ticket is proxiable, or false if not proxiable
+     * or destroyed.
      */
     public final boolean isProxiable() {
-        return flags[PROXIABLE_TICKET_FLAG];
+        return flags == null? false: flags[PROXIABLE_TICKET_FLAG];
     }
 
     /**
      * Determines is this ticket is a proxy-ticket.
      *
-     * @return true if this ticket is a proxy-ticket, false if not.
+     * @return true if this ticket is a proxy-ticket, or false if not
+     * a proxy-ticket or destroyed.
      */
     public final boolean isProxy() {
-        return flags[PROXY_TICKET_FLAG];
+        return flags == null? false: flags[PROXY_TICKET_FLAG];
     }
 
 
     /**
      * Determines is this ticket is post-dated.
      *
-     * @return true if this ticket is post-dated, false if not.
+     * @return true if this ticket is post-dated, or false if not post-dated
+     * or destroyed.
      */
     public final boolean isPostdated() {
-        return flags[POSTDATED_TICKET_FLAG];
+        return flags == null? false: flags[POSTDATED_TICKET_FLAG];
     }
 
     /**
@@ -434,10 +443,11 @@
      * refresh} method can be called, assuming the validity period for
      * renewing is not already over.
      *
-     * @return true if this ticket is renewable, false if not.
+     * @return true if this ticket is renewable, or false if not renewable
+     * or destroyed.
      */
     public final boolean isRenewable() {
-        return flags[RENEWABLE_TICKET_FLAG];
+        return flags == null? false: flags[RENEWABLE_TICKET_FLAG];
     }
 
     /**
@@ -445,10 +455,10 @@
      * protocol, and not issued based on some ticket-granting ticket.
      *
      * @return true if this ticket was issued using the Kerberos AS-Exchange
-     * protocol, false if not.
+     * protocol, or false if not issued this way or destroyed.
      */
     public final boolean isInitial() {
-        return flags[INITIAL_TICKET_FLAG];
+        return flags == null? false: flags[INITIAL_TICKET_FLAG];
     }
 
     /**
@@ -456,7 +466,8 @@
      * returned array indicates the value for the corresponding bit in the
      * ASN.1 BitString that represents the ticket flags.
      *
-     * @return the flags associated with this ticket.
+     * @return the flags associated with this ticket, or {@code null}
+     * if destroyed.
      */
     public final boolean[]  getFlags() {
         return (flags == null? null: flags.clone());
@@ -466,7 +477,8 @@
      * Returns the time that the client was authenticated.
      *
      * @return the time that the client was authenticated
-     *         or null if not set.
+     *         or {@code null} if the field is not set or
+     *         this ticket is destroyed.
      */
     public final java.util.Date getAuthTime() {
         return (authTime == null) ? null : (Date)authTime.clone();
@@ -476,7 +488,8 @@
      * Returns the start time for this ticket's validity period.
      *
      * @return the start time for this ticket's validity period
-     *         or null if not set.
+     *         or {@code null} if the field is not set or
+     *         this ticket is destroyed.
      */
     public final java.util.Date getStartTime() {
         return (startTime == null) ? null : (Date)startTime.clone();
@@ -485,17 +498,19 @@
     /**
      * Returns the expiration time for this ticket's validity period.
      *
-     * @return the expiration time for this ticket's validity period.
+     * @return the expiration time for this ticket's validity period,
+     * or {@code null} if destroyed.
      */
     public final java.util.Date getEndTime() {
-        return (Date) endTime.clone();
+        return (endTime == null) ? null : (Date) endTime.clone();
     }
 
     /**
      * Returns the latest expiration time for this ticket, including all
      * renewals. This will return a null value for non-renewable tickets.
      *
-     * @return the latest expiration time for this ticket.
+     * @return the latest expiration time for this ticket, or {@code null}
+     * if destroyed.
      */
     public final java.util.Date getRenewTill() {
         return (renewTill == null) ? null: (Date)renewTill.clone();
@@ -504,8 +519,8 @@
     /**
      * Returns a list of addresses from where the ticket can be used.
      *
-     * @return ths list of addresses or null, if the field was not
-     * provided.
+     * @return the list of addresses, or {@code null} if the field was not
+     * provided or this ticket is destroyed.
      */
     public final java.net.InetAddress[] getClientAddresses() {
         return (clientAddresses == null) ? null: clientAddresses.clone();
@@ -514,7 +529,9 @@
     /**
      * Returns an ASN.1 encoding of the entire ticket.
      *
-     * @return an ASN.1 encoding of the entire ticket.
+     * @return an ASN.1 encoding of the entire ticket. A new byte
+     * array is returned each time this method is called.
+     * @throws IllegalStateException if this ticket is destroyed
      */
     public final byte[] getEncoded() {
         if (destroyed) {
@@ -523,9 +540,14 @@
         return asn1Encoding.clone();
     }
 
-    /** Determines if this ticket is still current.  */
+    /**
+     * Determines if this ticket is still current.
+     *
+     * @return true if this ticket is still current, or false if not current
+     * or destroyed.
+     */
     public boolean isCurrent() {
-        return (System.currentTimeMillis() <= getEndTime().getTime());
+        return endTime == null? false: (System.currentTimeMillis() <= endTime.getTime());
     }
 
     /**
@@ -540,6 +562,7 @@
      * threads that might access this and try to renew it at the same
      * time.
      *
+     * @throws IllegalStateException if this ticket is destroyed
      * @throws RefreshFailedException if the ticket is not renewable, or
      * the latest allowable renew time has passed, or the KDC returns some
      * error.
--- a/jdk/src/jdk.jcmd/share/classes/sun/tools/jcmd/Arguments.java	Thu Feb 18 11:30:16 2016 -0800
+++ b/jdk/src/jdk.jcmd/share/classes/sun/tools/jcmd/Arguments.java	Thu Feb 18 13:41:11 2016 -0800
@@ -119,7 +119,7 @@
         System.out.println("  If the pid is 0, commands will be sent to all Java processes.   ");
         System.out.println("  The main class argument will be used to match (either partially ");
         System.out.println("  or fully) the class used to start Java.                         ");
-        System.out.println("  If no options are given, lists Java processes (same as -p).     ");
+        System.out.println("  If no options are given, lists Java processes (same as -l).     ");
         System.out.println("                                                                  ");
         System.out.println("  PerfCounter.print display the counters exposed by this process  ");
         System.out.println("  -f  read and execute commands from the file                     ");
--- a/jdk/test/ProblemList.txt	Thu Feb 18 11:30:16 2016 -0800
+++ b/jdk/test/ProblemList.txt	Thu Feb 18 13:41:11 2016 -0800
@@ -308,9 +308,6 @@
 # 8074580
 sun/security/pkcs11/rsa/TestKeyPairGenerator.java               generic-all
 
-# 8146387
-javax/net/ssl/SSLSession/SessionCacheSizeTests.java windows-all,solaris-all
-
 ############################################################################
 
 # jdk_sound
--- a/jdk/test/TEST.groups	Thu Feb 18 11:30:16 2016 -0800
+++ b/jdk/test/TEST.groups	Thu Feb 18 13:41:11 2016 -0800
@@ -54,8 +54,7 @@
     -com/sun/crypto/provider/Cipher \
     :jdk_text \
     :core_tools \
-    :jdk_other \
-    :jdk_svc
+    :jdk_other
 
 tier3 = \
     :jdk_rmi \
--- a/jdk/test/com/sun/jndi/ldap/LdapTimeoutTest.java	Thu Feb 18 11:30:16 2016 -0800
+++ b/jdk/test/com/sun/jndi/ldap/LdapTimeoutTest.java	Thu Feb 18 13:41:11 2016 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2016, 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,7 +26,6 @@
  * @run main/othervm LdapTimeoutTest
  * @bug 7094377 8000487 6176036 7056489
  * @summary Timeout tests for ldap
- * @key intermittent
  */
 
 import java.net.Socket;
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/awt/LightweightComponent/LightweightEventTest/LightweightEventTest.java	Thu Feb 18 13:41:11 2016 -0800
@@ -0,0 +1,304 @@
+/*
+ * Copyright (c) 2016 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
+ * @summary Test of mouse move messages to lightweight components
+ * @library ../../regtesthelpers
+ * @build Util
+ * @compile LightweightEventTest.java
+ * @run main LightweightEventTest
+ */
+import java.awt.BorderLayout;
+import java.awt.Button;
+import java.awt.Color;
+import java.awt.Component;
+import java.awt.Container;
+import java.awt.Dimension;
+import java.awt.FontMetrics;
+import java.awt.Frame;
+import java.awt.Graphics;
+import java.awt.Insets;
+import java.awt.Point;
+import java.awt.Rectangle;
+import java.awt.Robot;
+import java.awt.AWTException;
+import java.awt.event.MouseAdapter;
+import java.awt.event.MouseEvent;
+import javax.swing.SwingUtilities;
+import test.java.awt.regtesthelpers.Util;
+
+
+/*
+There are 3 steps to this test :
+1. Two frames are created one with heavy weight component and
+   another with light weight component. Each frame has a centrally placed
+   button
+2. Mouse is dragged along diagonals of each window using Robot object
+3. Events are noted for mouse in and out of frames & buttons and asserted
+*/
+
+public class LightweightEventTest {
+
+    private static EventBug HeavyComponent;
+    private static EventBug LightComponent;
+    private static Robot testRobot;
+
+    public static void main(String[] args) throws Throwable {
+
+        SwingUtilities.invokeAndWait(new Runnable() {
+            @Override
+            public void run() {
+                constructTestUI();
+            }
+        });
+
+        try {
+            testRobot = new Robot();
+        } catch (AWTException ex) {
+            throw new RuntimeException("Could not initiate a drag operation");
+        }
+
+        testRobot.waitForIdle();
+
+        // Method performing auto test operation
+        boolean result = test();
+
+        disposeTestUI();
+
+        if (result == false) {
+            throw new RuntimeException("Test FAILED!");
+        }
+    }
+
+    private static boolean test() {
+        // Test events for HeavyComponent
+        Point loc = HeavyComponent.getLocationOnScreen();
+        Dimension size = HeavyComponent.getSize();
+
+        Util.mouseMove(testRobot,
+                new Point((int) loc.x + 4, (int) loc.y + 4),
+                new Point((int) loc.x + size.width, (int) loc.y + size.height));
+
+        testRobot.waitForIdle();
+
+        boolean HeavyComponentAssert = HeavyComponent.assertEvents(2, 1);
+
+        // Test events for LightComponent
+        loc = LightComponent.getLocationOnScreen();
+        size = LightComponent.getSize();
+
+        Util.mouseMove(testRobot,
+                new Point((int) loc.x + 4, (int) loc.y + 4),
+                new Point((int) loc.x + size.width, (int) loc.y + size.height));
+
+        testRobot.waitForIdle();
+
+        boolean LightComponentAssert = LightComponent.assertEvents(2, 1);
+
+        return (HeavyComponentAssert && LightComponentAssert);
+    }
+
+    private static void constructTestUI() {
+        // here, create the items that will be tested for correct behavior
+        HeavyComponent = new EventBug();
+        Button b = (Button) HeavyComponent.add("Center", new Button("Heavy"));
+
+        LightComponent = new EventBug();
+        BorderedLabel b1 = (BorderedLabel) LightComponent.add("Center",
+                new BorderedLabel("Lite"));
+
+        HeavyComponent.addListeners(b);
+        LightComponent.addListeners(b1);
+
+        LightComponent.setLocation(200, 0);
+        HeavyComponent.setVisible(true);
+        LightComponent.setVisible(true);
+    }
+
+    private static void disposeTestUI() {
+        HeavyComponent.setVisible(false);
+        LightComponent.setVisible(false);
+
+        HeavyComponent.dispose();
+        LightComponent.dispose();
+    }
+}
+
+/*
+ * Lightweight component
+ */
+class BorderedLabel extends Component {
+
+    boolean superIsButton = false;
+    String labelString;
+
+    BorderedLabel(String labelString) {
+        this.labelString = labelString;
+
+        Component thisComponent = this;
+        superIsButton = (thisComponent instanceof Button);
+        if (superIsButton) {
+            ((Button) thisComponent).setLabel(labelString);
+        }
+    }
+
+    @Override
+    public Dimension getMinimumSize() {
+        Dimension minSize = new Dimension();
+
+        if (superIsButton) {
+            minSize = super.getMinimumSize();
+        } else {
+
+            Graphics g = getGraphics();
+            FontMetrics metrics = g.getFontMetrics();
+
+            minSize.width = metrics.stringWidth(labelString) + 14;
+            minSize.height = metrics.getMaxAscent()
+                    + metrics.getMaxDescent() + 9;
+
+            g.dispose();
+            g = null;
+        }
+        return minSize;
+    }
+
+    @Override
+    public Dimension getPreferredSize() {
+        Dimension prefSize;
+        if (superIsButton) {
+            prefSize = super.getPreferredSize();
+        } else {
+            prefSize = getMinimumSize();
+        }
+        return prefSize;
+    }
+
+    @Override
+    public void paint(Graphics g) {
+
+        super.paint(g);
+        Rectangle bounds = getBounds();
+        if (superIsButton) {
+            return;
+        }
+        Dimension size = getSize();
+        Color oldColor = g.getColor();
+
+        // draw border
+        g.setColor(getBackground());
+        g.fill3DRect(0, 0, size.width, size.height, false);
+        g.fill3DRect(3, 3, size.width - 6, size.height - 6, true);
+
+        // draw text
+        FontMetrics metrics = g.getFontMetrics();
+        int centerX = size.width / 2;
+        int centerY = size.height / 2;
+        int textX = centerX - (metrics.stringWidth(labelString) / 2);
+        int textY = centerY
+                + ((metrics.getMaxAscent() + metrics.getMaxDescent()) / 2);
+        g.setColor(getForeground());
+        g.drawString(labelString, textX, textY);
+
+        g.setColor(oldColor);
+    }
+} // class BorderedLabel
+
+class EventBug extends Container {
+
+    Frame testFrame;
+    int frameEnters = 0;
+    int frameExits = 0;
+    int buttonEnters = 0;
+    int buttonExits = 0;
+
+    public EventBug() {
+        super();
+        testFrame = new Frame();
+        testFrame.setLayout(new BorderLayout());
+        this.setLayout(new BorderLayout());
+        testFrame.add("Center", this);
+        testFrame.pack();
+        testFrame.setVisible(true);
+    }
+
+    @Override
+    public Dimension getPreferredSize() {
+        return new Dimension(100, 100);
+    }
+
+    @Override
+    public Insets getInsets() {
+        return new Insets(20, 20, 20, 20);
+    }
+
+    public boolean assertEvents(int expectedFrameEnterEvents,
+            int expectedButtonEnterEvents) {
+        return (frameEnters == expectedFrameEnterEvents)
+                && (buttonEnters == expectedButtonEnterEvents);
+    }
+
+    // Forward to the Window
+    @Override
+    public void setLocation(int x, int y) {
+        testFrame.setLocation(x, y);
+    }
+
+    @Override
+    public void setVisible(boolean b) {
+        testFrame.setVisible(b);
+    }
+
+    public void dispose() {
+        testFrame.dispose();
+    }
+
+    // Add listeners to Frame and button
+    public void addListeners(Component b) {
+        b.setName("Button");
+        b.addMouseListener(new MouseAdapter() {
+            @Override
+            public void mouseEntered(MouseEvent e) {
+                buttonEnters++;
+            }
+
+            @Override
+            public void mouseExited(MouseEvent e) {
+                buttonExits++;
+            }
+
+        });
+        testFrame.addMouseListener(new MouseAdapter() {
+            @Override
+            public void mouseEntered(MouseEvent e) {
+                frameEnters++;
+            }
+
+            @Override
+            public void mouseExited(MouseEvent e) {
+                frameExits++;
+            }
+        });
+    }
+} // class EventBug
--- a/jdk/test/java/awt/Mouse/TitleBarDoubleClick/TitleBarDoubleClick.java	Thu Feb 18 11:30:16 2016 -0800
+++ b/jdk/test/java/awt/Mouse/TitleBarDoubleClick/TitleBarDoubleClick.java	Thu Feb 18 13:41:11 2016 -0800
@@ -71,7 +71,6 @@
             frame.addMouseListener(this);
             frame.addWindowListener(this);
             frame.setVisible(true);
-            Util.waitForIdle(robot);
     }// start()
 
     // Move the mouse into the title bar and double click to maximize the
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/awt/Paint/ComponentIsNotDrawnAfterRemoveAddTest/ComponentIsNotDrawnAfterRemoveAddTest.java	Thu Feb 18 13:41:11 2016 -0800
@@ -0,0 +1,187 @@
+/*
+ * Copyright (c) 2016, 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 8139581
+   @summary AWT components are not drawn after removal and addition to a container
+   @author Anton Litvinov
+ */
+
+import java.awt.Button;
+import java.awt.Color;
+import java.awt.Canvas;
+import java.awt.Frame;
+import java.awt.Graphics;
+import java.awt.Panel;
+import java.util.ArrayList;
+
+public class ComponentIsNotDrawnAfterRemoveAddTest {
+    private final Frame frame;
+    private final Panel panel;
+    private final ArrayList<Testable> compList = new ArrayList<Testable>();
+
+    public ComponentIsNotDrawnAfterRemoveAddTest() {
+        frame = new Frame("ComponentIsNotDrawnAfterRemoveAddTest");
+        frame.setSize(500, 500);
+        frame.setLocation(200, 200);
+        frame.setLayout(null);
+        frame.setBackground(Color.RED);
+
+        panel = new Panel();
+        panel.setLayout(null);
+        panel.setBounds(25, 100, 455, 295);
+        panel.setBackground(Color.GREEN);
+
+        for (int i = 0; i < 10; i++) {
+            TestCanvas canv1 = new TestCanvas();
+            canv1.setBounds(i * 45 + 5, 15, 30 + i, 30 + i);
+            panel.add(canv1);
+            compList.add(canv1);
+
+            TestButton btn1 = new TestButton();
+            btn1.setBounds(i * 45 + 5, 60, 30 + i, 30 + i);
+            panel.add(btn1);
+            compList.add(btn1);
+
+            TestCanvas canv2 = new TestCanvas();
+            canv2.setBounds(i * 45 + 5, 105, 30 + i, 30 + i);
+            panel.add(canv2);
+            compList.add(canv2);
+
+            TestButton btn2 = new TestButton();
+            btn2.setBounds(i * 45 + 5, 150, 30 + i, 30 + i);
+            panel.add(btn2);
+            compList.add(btn2);
+
+            TestCanvas canv3 = new TestCanvas();
+            canv3.setBounds(i * 45 + 5, 195, 30 + i, 30 + i);
+            panel.add(canv3);
+            compList.add(canv3);
+
+            TestButton btn3 = new TestButton();
+            btn3.setBounds(i * 45 + 5, 240, 30 + i, 30 + i);
+            panel.add(btn3);
+            compList.add(btn3);
+        }
+
+        frame.add(panel);
+        frame.setVisible(true);
+    }
+
+    private void runTest() {
+        try {
+            doSleep(1500);
+            checkTestableComponents();
+
+            for (int i = 0; i < 5; i++) {
+                System.err.println(String.format("Test iteration #%d:", i));
+
+                frame.remove(panel);
+                frame.invalidate();
+                frame.validate();
+                frame.add(panel);
+
+                doSleep(1500);
+                checkTestableComponents();
+            }
+        } finally {
+            frame.dispose();
+        }
+    }
+
+    private void doSleep(long millis) {
+        try {
+            Thread.sleep(millis);
+        } catch (InterruptedException ie) {
+            ie.printStackTrace();
+        }
+    }
+
+    private void checkTestableComponents() throws RuntimeException {
+        int notDrawnCompsCount = 0;
+        for (Testable comp : compList) {
+            if (!comp.wasPaintCalled()) {
+                notDrawnCompsCount++;
+            } else {
+                comp.resetPaintCalledFlag();
+            }
+        }
+        if (notDrawnCompsCount > 0) {
+            throw new RuntimeException(String.format(
+                "'paint' method of %d components was not called.", notDrawnCompsCount));
+        }
+    }
+
+    private interface Testable {
+        boolean wasPaintCalled();
+        void resetPaintCalledFlag();
+    }
+
+    private static class TestCanvas extends Canvas implements Testable {
+        private volatile boolean paintWasCalled = false;
+
+        @Override
+        public void paint(Graphics g) {
+            paintWasCalled = true;
+            super.paint(g);
+            g.setColor(Color.BLUE);
+            g.fillRect(0, 0, getWidth(), getHeight());
+        }
+
+        @Override
+        public boolean wasPaintCalled() {
+            return paintWasCalled;
+        }
+
+        @Override
+        public void resetPaintCalledFlag() {
+            paintWasCalled = false;
+        }
+    }
+
+    private static class TestButton extends Button implements Testable {
+        private volatile boolean paintWasCalled = false;
+
+        @Override
+        public void paint(Graphics g) {
+            paintWasCalled = true;
+            super.paint(g);
+            g.setColor(Color.YELLOW);
+            g.fillRect(0, 0, 15, 15);
+        }
+
+        @Override
+        public boolean wasPaintCalled() {
+            return paintWasCalled;
+        }
+
+        @Override
+        public void resetPaintCalledFlag() {
+            paintWasCalled = false;
+        }
+    }
+
+    public static void main(String[] args) {
+        new ComponentIsNotDrawnAfterRemoveAddTest().runTest();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/awt/TextArea/TextAreaScrolling/TextAreaScrolling.java	Thu Feb 18 13:41:11 2016 -0800
@@ -0,0 +1,107 @@
+/*
+ * Copyright (c) 2016, 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 6180449
+ @summary TextArea scrolls to its left when selecting the text from the end.
+ @run main TextAreaScrolling
+ */
+
+import java.awt.Frame;
+import java.awt.Point;
+import java.awt.Rectangle;
+import java.awt.Robot;
+import java.awt.TextArea;
+import java.awt.event.InputEvent;
+
+public class TextAreaScrolling {
+    Frame mainFrame;
+    TextArea textArea;
+    Robot robot;
+
+    TextAreaScrolling() {
+        mainFrame = new Frame();
+        mainFrame.setSize(200, 200);
+        mainFrame.setLocation(200, 200);
+
+        textArea = new TextArea();
+        textArea.setText("1234 5678");
+        textArea.setSelectionStart(3);
+        textArea.setSelectionStart(4);
+        mainFrame.add(textArea);
+        mainFrame.setVisible(true);
+        textArea.requestFocusInWindow();
+
+        try {
+            robot = new Robot();
+            robot.setAutoWaitForIdle(true);
+        } catch (Exception ex) {
+            dispose();
+            System.exit(0);
+            throw new RuntimeException("Robot Creation Failed");
+        }
+    }
+
+    public void dispose() {
+        if (mainFrame != null) {
+            mainFrame.dispose();
+        }
+    }
+
+    public void performTest() {
+        Point loc = textArea.getLocationOnScreen();
+        Rectangle textAreaBounds = new Rectangle();
+        textArea.getBounds(textAreaBounds);
+
+        // Move mouse at center in first row of TextArea.
+        robot.mouseMove(loc.x + textAreaBounds.width / 2, loc.y + 5);
+
+        // Perform selection by scrolling to left from end of char sequence.
+        robot.mousePress(InputEvent.BUTTON1_MASK);
+        robot.mouseMove(textAreaBounds.x - 5, loc.y + 5);
+        robot.mouseRelease(InputEvent.BUTTON1_MASK);
+
+        // Perform double click on beginning word of TextArea
+        robot.mouseMove(loc.x + 5, loc.y + 5);
+        robot.mousePress(InputEvent.BUTTON1_MASK);
+        robot.mouseRelease(InputEvent.BUTTON1_MASK);
+        robot.delay(100);
+        robot.mousePress(InputEvent.BUTTON1_MASK);
+        robot.mouseRelease(InputEvent.BUTTON1_MASK);
+        robot.delay(100);
+
+        if (textArea.getSelectedText().contentEquals("5678")) {
+            dispose();
+            throw new RuntimeException ("TextArea over scrolled towards left"
+                + "Expected selected text: '1234 ' and for mac '1234'"
+                + "Actual selected text: 5678");
+        }
+    }
+
+    public static void main(String argv[]) throws RuntimeException {
+        TextAreaScrolling test = new TextAreaScrolling();
+        test.performTest();
+        test.dispose();
+    }
+}
--- a/jdk/test/java/awt/Toolkit/GetSizeTest/GetScreenSizeTest.java	Thu Feb 18 11:30:16 2016 -0800
+++ b/jdk/test/java/awt/Toolkit/GetSizeTest/GetScreenSizeTest.java	Thu Feb 18 13:41:11 2016 -0800
@@ -23,7 +23,7 @@
 
 /*
   @test
-  @bug 8144074 8145785
+  @bug 8144074 8145785 8149151
   @summary Crash while getting screen size during Toolkit initialisation
   @run main/othervm GetScreenSizeTest
 */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/awt/image/multiresolution/MultiDisplayTest/MultiDisplayTest.html	Thu Feb 18 13:41:11 2016 -0800
@@ -0,0 +1,62 @@
+<!--
+ Copyright (c) 2016, 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>
+<head>
+<title> MultiDisplayTest </title>
+</head>
+<body>
+<applet code="MultiDisplayTest.class" width=100 height=30></applet>
+
+This test is for OS X or Windows only.
+For other OSes please simply push "Pass".
+
+The test requires two-display configuration, where
+
+- 1st display is operating in HiDPI mode;
+- 2nd display is non-HiDPI.
+
+In other cases please simply push "Pass".
+
+
+To run test please push "Start".
+
+Then drag parent / child to different displays and check
+that the proper image is shown for every window
+(must be "black 1x" for non-HiDPI and "blue 2x" for HiDPI).
+
+Please try to drag both parent and child,
+do it fast several times and check if no artefacts occur.
+
+Try to switch display resolution (high to low and back).
+
+For Mac OS X please check also the behavior for
+translucent windows appearing on the 2nd (non-active) display
+and Mission Control behavior.
+
+Close the windows.
+
+In case if no issues occur please push "Pass", otherwise "Fail".
+
+</body>
+</html>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/awt/image/multiresolution/MultiDisplayTest/MultiDisplayTest.java	Thu Feb 18 13:41:11 2016 -0800
@@ -0,0 +1,147 @@
+/*
+ * Copyright (c) 2016, 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 8142861 8143062 8147016
+  @summary Check if multiresolution image behaves properly
+           on HiDPI + non-HiDPI display pair.
+  @author a.stepanov
+  @library /lib/testlibrary
+  @build jdk.testlibrary.OSInfo
+  @run applet/manual=yesno MultiDisplayTest.html
+*/
+
+
+import java.applet.Applet;
+import java.awt.*;
+import java.awt.event.*;
+import java.awt.image.*;
+import jdk.testlibrary.OSInfo;
+
+
+public class MultiDisplayTest extends Applet {
+
+    private static final int W = 200, H = 200;
+
+    private static final BaseMultiResolutionImage IMG =
+        new BaseMultiResolutionImage(new BufferedImage[]{
+        generateImage(1, Color.BLACK), generateImage(2, Color.BLUE)});
+
+    private static boolean checkOS() {
+        OSInfo.OSType os = OSInfo.getOSType();
+        return (os.equals(OSInfo.OSType.WINDOWS) ||
+            os.equals(OSInfo.OSType.MACOSX));
+    }
+
+    public void init() { this.setLayout(new BorderLayout()); }
+
+    public void start() {
+
+        Button b = new Button("Start");
+        b.setEnabled(checkOS());
+
+        b.addActionListener(new ActionListener() {
+            @Override
+            public void actionPerformed(ActionEvent e) {
+
+                ParentFrame p = new ParentFrame();
+                new ChildDialog(p);
+            }
+        });
+
+        add(b, BorderLayout.CENTER);
+
+        validate();
+        setVisible(true);
+    }
+
+
+    private static BufferedImage generateImage(int scale, Color c) {
+
+        BufferedImage image = new BufferedImage(
+            scale * W, scale * H, BufferedImage.TYPE_INT_RGB);
+        Graphics g = image.getGraphics();
+        g.setColor(c);
+        g.fillRect(0, 0, scale * W, scale * H);
+
+        g.setColor(Color.WHITE);
+        Font f = g.getFont();
+        g.setFont(new Font(f.getName(), Font.BOLD, scale * 48));
+        g.drawChars((scale + "X").toCharArray(), 0, 2, scale * W / 2, scale * H / 2);
+
+        return image;
+    }
+
+    private static class ParentFrame extends Frame {
+
+        public ParentFrame() {
+            EventQueue.invokeLater(this::CreateUI);
+        }
+
+        private void CreateUI() {
+
+            addWindowListener(new WindowAdapter() {
+                @Override
+                public void windowClosing(WindowEvent e) { dispose(); }
+            });
+            setSize(W, H);
+            setLocation(50, 50);
+            setTitle("parent");
+            setResizable(false);
+            setVisible(true);
+        }
+
+        @Override
+        public void paint(Graphics gr) {
+            gr.drawImage(IMG, 0, 0, this);
+        }
+    }
+
+    private static class ChildDialog extends Dialog {
+
+        public ChildDialog(Frame f) {
+            super(f);
+            EventQueue.invokeLater(this::CreateUI);
+        }
+
+        private void CreateUI() {
+
+            addWindowListener(new WindowAdapter() {
+                @Override
+                public void windowClosing(WindowEvent e) { dispose(); }
+            });
+            setSize(W, H);
+            setTitle("child");
+            setResizable(false);
+            setModal(true);
+            setVisible(true);
+        }
+
+        @Override
+        public void paint(Graphics gr) {
+            gr.drawImage(IMG, 0, 0, this);
+        }
+    }
+}
--- a/jdk/test/java/lang/ClassLoader/deadlock/TestCrossDelegate.sh	Thu Feb 18 11:30:16 2016 -0800
+++ b/jdk/test/java/lang/ClassLoader/deadlock/TestCrossDelegate.sh	Thu Feb 18 13:41:11 2016 -0800
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2009, 2013, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2009, 2016, 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
@@ -106,7 +106,7 @@
 # run test
 ${TESTJAVA}${FS}bin${FS}java \
         ${TESTVMOPTS} \
-        -verbose:class -XX:+TraceClassLoading -cp . \
+        -verbose:class -Xlog:classload -cp . \
         -Dtest.classes=${TESTCLASSES} \
         Starter cross
 # -XX:+UnlockDiagnosticVMOptions -XX:+UnsyncloadClass \
--- a/jdk/test/java/lang/ClassLoader/deadlock/TestOneWayDelegate.sh	Thu Feb 18 11:30:16 2016 -0800
+++ b/jdk/test/java/lang/ClassLoader/deadlock/TestOneWayDelegate.sh	Thu Feb 18 13:41:11 2016 -0800
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2009, 2013, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2009, 2016, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -102,7 +102,7 @@
 # run test
 ${TESTJAVA}${FS}bin${FS}java \
         ${TESTVMOPTS} \
-        -verbose:class -XX:+TraceClassLoading -cp . \
+        -verbose:class -Xlog:classload -cp . \
         -Dtest.classes=${TESTCLASSES} \
         Starter one-way
 # -XX:+UnlockDiagnosticVMOptions -XX:+UnsyncloadClass \
--- a/jdk/test/java/lang/ProcessHandle/InfoTest.java	Thu Feb 18 11:30:16 2016 -0800
+++ b/jdk/test/java/lang/ProcessHandle/InfoTest.java	Thu Feb 18 13:41:11 2016 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2016, 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
@@ -53,7 +53,6 @@
  * @run testng InfoTest
  * @summary Functions of ProcessHandle.Info
  * @author Roger Riggs
- * @key intermittent
  */
 
 public class InfoTest {
--- a/jdk/test/java/lang/instrument/appendToClassLoaderSearch/ClassUnloadTest.sh	Thu Feb 18 11:30:16 2016 -0800
+++ b/jdk/test/java/lang/instrument/appendToClassLoaderSearch/ClassUnloadTest.sh	Thu Feb 18 13:41:11 2016 -0800
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2005, 2016, 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
@@ -80,5 +80,5 @@
 
 # Finally we run the test
 (cd "${TESTCLASSES}"; \
-  $JAVA ${TESTVMOPTS} -Xverify:none -XX:+TraceClassUnloading \
+  $JAVA ${TESTVMOPTS} -Xverify:none -Xlog:classunload \
     -javaagent:ClassUnloadTest.jar ClassUnloadTest "${OTHERDIR}" Bar.jar)
--- a/jdk/test/java/lang/ref/ReferenceEnqueuePending.java	Thu Feb 18 11:30:16 2016 -0800
+++ b/jdk/test/java/lang/ref/ReferenceEnqueuePending.java	Thu Feb 18 13:41:11 2016 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2016, 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
@@ -94,35 +94,52 @@
         }
 
         // Do a final collection to discover and process all
-        // Reference objects created above, allowing enough time
+        // Reference objects created above, allowing some time
         // for the ReferenceHandler thread to queue the References.
         forceGc(100);
         forceGc(100);
 
         // Verify that all WeakReference objects ended up queued.
-        checkResult(refQueue, obj, iterations-1);
+        checkResult(refQueue, iterations-1);
+
+        // Ensure the final weaky is live but won't be enqueued during
+        // result checking, by ensuring its referent remains live.
+        // This eliminates behavior changes resulting from different
+        // compiler optimizations.
+        Reference.reachabilityFence(weaky);
+        Reference.reachabilityFence(obj);
+
         System.out.println("Test passed.");
     }
 
+    private static NumberedWeakReference waitForReference(ReferenceQueue<Integer> queue) {
+        try {
+            return (NumberedWeakReference) queue.remove(30000); // 30sec
+        } catch (InterruptedException ie) {
+            return null;
+        }
+    }
+
     private static void checkResult(ReferenceQueue<Integer> queue,
-                                    Integer obj,
                                     int expected) {
         if (debug) {
             System.out.println("Reading the queue");
         }
 
         // Empty the queue and record numbers into a[];
-        NumberedWeakReference weakRead = (NumberedWeakReference) queue.poll();
+        NumberedWeakReference weakRead = waitForReference(queue);
         int length = 0;
         while (weakRead != null) {
             a[length++] = weakRead.number;
-            weakRead = (NumberedWeakReference) queue.poll();
+            if (length < expected) {
+                weakRead = waitForReference(queue);
+            } else {            // Check for unexpected extra entries.
+                weakRead = (NumberedWeakReference) queue.poll();
+            }
         }
         if (debug) {
             System.out.println("Reference Queue had " + length + " elements");
         }
-        // Use the last Reference object of those created above, so as to keep it "alive".
-        System.out.println("I must write " + obj + " to prevent compiler optimizations.");
 
 
         // verify the queued references: all but the last Reference object
--- a/jdk/test/java/net/Inet6Address/serialize/Inet6AddressSerializationTest.java	Thu Feb 18 11:30:16 2016 -0800
+++ b/jdk/test/java/net/Inet6Address/serialize/Inet6AddressSerializationTest.java	Thu Feb 18 13:41:11 2016 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -42,7 +42,6 @@
  * @test
  * @bug 8007373
  * @summary jdk7 backward compatibility serialization problem
- * @key intermittent
  */
 
 public class Inet6AddressSerializationTest {
--- a/jdk/test/java/net/SocketPermission/SocketPermissionTest.java	Thu Feb 18 11:30:16 2016 -0800
+++ b/jdk/test/java/net/SocketPermission/SocketPermissionTest.java	Thu Feb 18 13:41:11 2016 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2016, 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,7 +26,6 @@
  * @bug 8047031
  * @summary SocketPermission tests for legacy socket types
  * @run testng/othervm SocketPermissionTest
- * @key intermittent
  */
 import java.io.IOException;
 import java.net.DatagramPacket;
--- a/jdk/test/java/util/Formatter/Basic-X.java.template	Thu Feb 18 11:30:16 2016 -0800
+++ b/jdk/test/java/util/Formatter/Basic-X.java.template	Thu Feb 18 13:41:11 2016 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2016, 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
@@ -35,9 +35,6 @@
 import java.math.BigInteger;
 import java.text.DateFormatSymbols;
 import java.util.*;
-#if[double]
-import jdk.internal.math.DoubleConsts;
-#end[double]
 
 import static java.util.Calendar.*;
 #if[datetime]
@@ -1359,12 +1356,12 @@
         test("%.1a", "-0x1.0p0", -1.0);
         test("%.11a", "0x1.80000000000p1", 3.0);
         test("%.1a", "0x1.8p1", 3.0);
-        test("%.11a", "0x1.00000000000p-1022", DoubleConsts.MIN_NORMAL);
-        test("%.1a", "0x1.0p-1022", DoubleConsts.MIN_NORMAL);
+        test("%.11a", "0x1.00000000000p-1022", Double.MIN_NORMAL);
+        test("%.1a", "0x1.0p-1022", Double.MIN_NORMAL);
         test("%.11a", "0x1.00000000000p-1022",
-             Math.nextDown(DoubleConsts.MIN_NORMAL));
+             Math.nextDown(Double.MIN_NORMAL));
         test("%.1a", "0x1.0p-1022",
-             Math.nextDown(DoubleConsts.MIN_NORMAL));
+             Math.nextDown(Double.MIN_NORMAL));
         test("%.11a", "0x1.ffffffffffep-1023", 0x0.fffffffffffp-1022);
         test("%.1a", "0x1.0p-1022", 0x0.fffffffffffp-1022);
         test("%.30a", "0x0.000000000000100000000000000000p-1022", Double.MIN_VALUE);
--- a/jdk/test/java/util/Formatter/Basic.java	Thu Feb 18 11:30:16 2016 -0800
+++ b/jdk/test/java/util/Formatter/Basic.java	Thu Feb 18 13:41:11 2016 -0800
@@ -28,7 +28,7 @@
  *      6344623 6369500 6534606 6282094 6286592 6476425 5063507 6469160 6476168
  *      8059175
  *
- * @modules java.base/jdk.internal.math
+ * @modules java.base
  * @run shell/timeout=240 Basic.sh
  */
 
--- a/jdk/test/java/util/Formatter/BasicBigDecimal.java	Thu Feb 18 11:30:16 2016 -0800
+++ b/jdk/test/java/util/Formatter/BasicBigDecimal.java	Thu Feb 18 13:41:11 2016 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -36,9 +36,6 @@
 import java.text.DateFormatSymbols;
 import java.util.*;
 
-
-
-
 import static java.util.Calendar.*;
 
 
@@ -1156,7 +1153,6 @@
 
         val = new BigDecimal(BigInteger.ZERO, 6);
         test("%.4f", "0.0000", val);
-
         val = new BigDecimal(BigInteger.ZERO, -6);
         test("%.4f", "0.0000", val);
 
--- a/jdk/test/java/util/Formatter/BasicBigInteger.java	Thu Feb 18 11:30:16 2016 -0800
+++ b/jdk/test/java/util/Formatter/BasicBigInteger.java	Thu Feb 18 13:41:11 2016 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -36,9 +36,6 @@
 import java.text.DateFormatSymbols;
 import java.util.*;
 
-
-
-
 import static java.util.Calendar.*;
 
 
@@ -1660,6 +1657,10 @@
 
 
 
+
+
+
+
         //---------------------------------------------------------------------
         // %t
         //
--- a/jdk/test/java/util/Formatter/BasicBoolean.java	Thu Feb 18 11:30:16 2016 -0800
+++ b/jdk/test/java/util/Formatter/BasicBoolean.java	Thu Feb 18 13:41:11 2016 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -36,9 +36,6 @@
 import java.text.DateFormatSymbols;
 import java.util.*;
 
-
-
-
 import static java.util.Calendar.*;
 
 
@@ -1660,6 +1657,10 @@
 
 
 
+
+
+
+
         //---------------------------------------------------------------------
         // %t
         //
--- a/jdk/test/java/util/Formatter/BasicBooleanObject.java	Thu Feb 18 11:30:16 2016 -0800
+++ b/jdk/test/java/util/Formatter/BasicBooleanObject.java	Thu Feb 18 13:41:11 2016 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -36,9 +36,6 @@
 import java.text.DateFormatSymbols;
 import java.util.*;
 
-
-
-
 import static java.util.Calendar.*;
 
 
@@ -1660,6 +1657,10 @@
 
 
 
+
+
+
+
         //---------------------------------------------------------------------
         // %t
         //
--- a/jdk/test/java/util/Formatter/BasicByte.java	Thu Feb 18 11:30:16 2016 -0800
+++ b/jdk/test/java/util/Formatter/BasicByte.java	Thu Feb 18 13:41:11 2016 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -36,9 +36,6 @@
 import java.text.DateFormatSymbols;
 import java.util.*;
 
-
-
-
 import static java.util.Calendar.*;
 
 
@@ -1660,6 +1657,10 @@
 
 
 
+
+
+
+
         //---------------------------------------------------------------------
         // %t
         //
--- a/jdk/test/java/util/Formatter/BasicByteObject.java	Thu Feb 18 11:30:16 2016 -0800
+++ b/jdk/test/java/util/Formatter/BasicByteObject.java	Thu Feb 18 13:41:11 2016 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -36,9 +36,6 @@
 import java.text.DateFormatSymbols;
 import java.util.*;
 
-
-
-
 import static java.util.Calendar.*;
 
 
@@ -1660,6 +1657,10 @@
 
 
 
+
+
+
+
         //---------------------------------------------------------------------
         // %t
         //
--- a/jdk/test/java/util/Formatter/BasicChar.java	Thu Feb 18 11:30:16 2016 -0800
+++ b/jdk/test/java/util/Formatter/BasicChar.java	Thu Feb 18 13:41:11 2016 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -36,9 +36,6 @@
 import java.text.DateFormatSymbols;
 import java.util.*;
 
-
-
-
 import static java.util.Calendar.*;
 
 
@@ -1660,6 +1657,10 @@
 
 
 
+
+
+
+
         //---------------------------------------------------------------------
         // %t
         //
--- a/jdk/test/java/util/Formatter/BasicCharObject.java	Thu Feb 18 11:30:16 2016 -0800
+++ b/jdk/test/java/util/Formatter/BasicCharObject.java	Thu Feb 18 13:41:11 2016 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -36,9 +36,6 @@
 import java.text.DateFormatSymbols;
 import java.util.*;
 
-
-
-
 import static java.util.Calendar.*;
 
 
@@ -1660,6 +1657,10 @@
 
 
 
+
+
+
+
         //---------------------------------------------------------------------
         // %t
         //
--- a/jdk/test/java/util/Formatter/BasicDateTime.java	Thu Feb 18 11:30:16 2016 -0800
+++ b/jdk/test/java/util/Formatter/BasicDateTime.java	Thu Feb 18 13:41:11 2016 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -36,9 +36,6 @@
 import java.text.DateFormatSymbols;
 import java.util.*;
 
-
-
-
 import static java.util.Calendar.*;
 
 import static java.util.SimpleTimeZone.*;
@@ -1660,6 +1657,10 @@
 
 
 
+
+
+
+
         //---------------------------------------------------------------------
         // %t
         //
--- a/jdk/test/java/util/Formatter/BasicDouble.java	Thu Feb 18 11:30:16 2016 -0800
+++ b/jdk/test/java/util/Formatter/BasicDouble.java	Thu Feb 18 13:41:11 2016 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -36,9 +36,6 @@
 import java.text.DateFormatSymbols;
 import java.util.*;
 
-import jdk.internal.math.DoubleConsts;
-
-
 import static java.util.Calendar.*;
 
 
@@ -1359,12 +1356,12 @@
         test("%.1a", "-0x1.0p0", -1.0);
         test("%.11a", "0x1.80000000000p1", 3.0);
         test("%.1a", "0x1.8p1", 3.0);
-        test("%.11a", "0x1.00000000000p-1022", DoubleConsts.MIN_NORMAL);
-        test("%.1a", "0x1.0p-1022", DoubleConsts.MIN_NORMAL);
+        test("%.11a", "0x1.00000000000p-1022", Double.MIN_NORMAL);
+        test("%.1a", "0x1.0p-1022", Double.MIN_NORMAL);
         test("%.11a", "0x1.00000000000p-1022",
-             Math.nextDown(DoubleConsts.MIN_NORMAL));
+             Math.nextDown(Double.MIN_NORMAL));
         test("%.1a", "0x1.0p-1022",
-             Math.nextDown(DoubleConsts.MIN_NORMAL));
+             Math.nextDown(Double.MIN_NORMAL));
         test("%.11a", "0x1.ffffffffffep-1023", 0x0.fffffffffffp-1022);
         test("%.1a", "0x1.0p-1022", 0x0.fffffffffffp-1022);
         test("%.30a", "0x0.000000000000100000000000000000p-1022", Double.MIN_VALUE);
--- a/jdk/test/java/util/Formatter/BasicDoubleObject.java	Thu Feb 18 11:30:16 2016 -0800
+++ b/jdk/test/java/util/Formatter/BasicDoubleObject.java	Thu Feb 18 13:41:11 2016 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -36,9 +36,6 @@
 import java.text.DateFormatSymbols;
 import java.util.*;
 
-
-
-
 import static java.util.Calendar.*;
 
 
@@ -1174,6 +1171,10 @@
 
 
 
+
+
+
+
         //---------------------------------------------------------------------
         // %f - float, double, Double, BigDecimal
         //---------------------------------------------------------------------
--- a/jdk/test/java/util/Formatter/BasicFloat.java	Thu Feb 18 11:30:16 2016 -0800
+++ b/jdk/test/java/util/Formatter/BasicFloat.java	Thu Feb 18 13:41:11 2016 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -36,9 +36,6 @@
 import java.text.DateFormatSymbols;
 import java.util.*;
 
-
-
-
 import static java.util.Calendar.*;
 
 
@@ -1157,6 +1154,10 @@
 
 
 
+
+
+
+
         //---------------------------------------------------------------------
         // %f - float
         //---------------------------------------------------------------------
--- a/jdk/test/java/util/Formatter/BasicFloatObject.java	Thu Feb 18 11:30:16 2016 -0800
+++ b/jdk/test/java/util/Formatter/BasicFloatObject.java	Thu Feb 18 13:41:11 2016 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -36,9 +36,6 @@
 import java.text.DateFormatSymbols;
 import java.util.*;
 
-
-
-
 import static java.util.Calendar.*;
 
 
@@ -1190,6 +1187,10 @@
 
 
 
+
+
+
+
         //---------------------------------------------------------------------
         // %g
         //
--- a/jdk/test/java/util/Formatter/BasicInt.java	Thu Feb 18 11:30:16 2016 -0800
+++ b/jdk/test/java/util/Formatter/BasicInt.java	Thu Feb 18 13:41:11 2016 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -36,9 +36,6 @@
 import java.text.DateFormatSymbols;
 import java.util.*;
 
-
-
-
 import static java.util.Calendar.*;
 
 
@@ -1660,6 +1657,10 @@
 
 
 
+
+
+
+
         //---------------------------------------------------------------------
         // %t
         //
--- a/jdk/test/java/util/Formatter/BasicIntObject.java	Thu Feb 18 11:30:16 2016 -0800
+++ b/jdk/test/java/util/Formatter/BasicIntObject.java	Thu Feb 18 13:41:11 2016 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -36,9 +36,6 @@
 import java.text.DateFormatSymbols;
 import java.util.*;
 
-
-
-
 import static java.util.Calendar.*;
 
 
@@ -1660,6 +1657,10 @@
 
 
 
+
+
+
+
         //---------------------------------------------------------------------
         // %t
         //
--- a/jdk/test/java/util/Formatter/BasicLong.java	Thu Feb 18 11:30:16 2016 -0800
+++ b/jdk/test/java/util/Formatter/BasicLong.java	Thu Feb 18 13:41:11 2016 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -36,9 +36,6 @@
 import java.text.DateFormatSymbols;
 import java.util.*;
 
-
-
-
 import static java.util.Calendar.*;
 
 
@@ -1660,6 +1657,10 @@
 
 
 
+
+
+
+
         //---------------------------------------------------------------------
         // %t
         //
--- a/jdk/test/java/util/Formatter/BasicLongObject.java	Thu Feb 18 11:30:16 2016 -0800
+++ b/jdk/test/java/util/Formatter/BasicLongObject.java	Thu Feb 18 13:41:11 2016 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -36,9 +36,6 @@
 import java.text.DateFormatSymbols;
 import java.util.*;
 
-
-
-
 import static java.util.Calendar.*;
 
 
@@ -1660,6 +1657,10 @@
 
 
 
+
+
+
+
         //---------------------------------------------------------------------
         // %t
         //
--- a/jdk/test/java/util/Formatter/BasicShort.java	Thu Feb 18 11:30:16 2016 -0800
+++ b/jdk/test/java/util/Formatter/BasicShort.java	Thu Feb 18 13:41:11 2016 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -36,9 +36,6 @@
 import java.text.DateFormatSymbols;
 import java.util.*;
 
-
-
-
 import static java.util.Calendar.*;
 
 
@@ -1660,6 +1657,10 @@
 
 
 
+
+
+
+
         //---------------------------------------------------------------------
         // %t
         //
--- a/jdk/test/java/util/Formatter/BasicShortObject.java	Thu Feb 18 11:30:16 2016 -0800
+++ b/jdk/test/java/util/Formatter/BasicShortObject.java	Thu Feb 18 13:41:11 2016 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -36,9 +36,6 @@
 import java.text.DateFormatSymbols;
 import java.util.*;
 
-
-
-
 import static java.util.Calendar.*;
 
 
@@ -1660,6 +1657,10 @@
 
 
 
+
+
+
+
         //---------------------------------------------------------------------
         // %t
         //
--- a/jdk/test/java/util/concurrent/ConcurrentQueues/RemovePollRace.java	Thu Feb 18 11:30:16 2016 -0800
+++ b/jdk/test/java/util/concurrent/ConcurrentQueues/RemovePollRace.java	Thu Feb 18 13:41:11 2016 -0800
@@ -121,12 +121,16 @@
         final int SPINS = 5;
         final AtomicLong removes = new AtomicLong(0);
         final AtomicLong polls = new AtomicLong(0);
-        final int adderCount =
-            Math.max(1, Runtime.getRuntime().availableProcessors() / 4);
-        final int removerCount =
-            Math.max(1, Runtime.getRuntime().availableProcessors() / 4);
+
+        // We need at least 3 threads, but we don't want to use too
+        // many on massively multi-core systems.
+        final int cpus = Runtime.getRuntime().availableProcessors();
+        final int threadsToUse = Math.max(3, Math.min(cpus, 16));
+        final int adderCount = threadsToUse / 3;
+        final int removerCount = adderCount;
         final int pollerCount = removerCount;
         final int threadCount = adderCount + removerCount + pollerCount;
+
         final CountDownLatch startingGate = new CountDownLatch(1);
         final CountDownLatch addersDone = new CountDownLatch(adderCount);
         final Runnable remover = new Runnable() {
--- a/jdk/test/java/util/concurrent/ExecutorCompletionService/ExecutorCompletionServiceLoops.java	Thu Feb 18 11:30:16 2016 -0800
+++ b/jdk/test/java/util/concurrent/ExecutorCompletionService/ExecutorCompletionServiceLoops.java	Thu Feb 18 13:41:11 2016 -0800
@@ -61,13 +61,13 @@
             max = Integer.parseInt(args[0]);
 
         System.out.println("Warmup...");
-        oneTest( base );
+        oneTest(base);
         Thread.sleep(100);
         print = true;
 
         for (int i = 1; i <= max; i += (i+1) >>> 1) {
             System.out.print("n: " + i * base);
-            oneTest(i * base );
+            oneTest(i * base);
             Thread.sleep(100);
         }
         pool.shutdown();
--- a/jdk/test/java/util/concurrent/Phaser/Basic.java	Thu Feb 18 11:30:16 2016 -0800
+++ b/jdk/test/java/util/concurrent/Phaser/Basic.java	Thu Feb 18 13:41:11 2016 -0800
@@ -34,7 +34,6 @@
 /*
  * @test
  * @bug 6445158
- * @key intermittent
  * @summary Basic tests for Phaser
  * @author Chris Hegarty
  * @modules java.management
--- a/jdk/test/java/util/concurrent/tck/CompletableFutureTest.java	Thu Feb 18 11:30:16 2016 -0800
+++ b/jdk/test/java/util/concurrent/tck/CompletableFutureTest.java	Thu Feb 18 13:41:11 2016 -0800
@@ -1067,11 +1067,10 @@
 
         checkCompletedWithWrappedException(g, ex1);
         checkCompletedExceptionally(f, ex1);
-        // oops... temporarily disabled
-//         if (testImplementationDetails) {
-//             assertEquals(1, ex1.getSuppressed().length);
-//             assertSame(ex2, ex1.getSuppressed()[0]);
-//         }
+        if (testImplementationDetails) {
+            assertEquals(1, ex1.getSuppressed().length);
+            assertSame(ex2, ex1.getSuppressed()[0]);
+        }
         assertEquals(1, a.get());
     }}
 
--- a/jdk/test/java/util/zip/ConstructDeflaterInput.java	Thu Feb 18 11:30:16 2016 -0800
+++ b/jdk/test/java/util/zip/ConstructDeflaterInput.java	Thu Feb 18 13:41:11 2016 -0800
@@ -23,7 +23,7 @@
 
 /**
  * @test
- * @bug 4679743
+ * @bug 4679743 8148624
  * @summary Test parts of DeflaterInputStream code that don't really do I/O.
  */
 
@@ -41,10 +41,10 @@
         }
     }
 
+    private static MyDeflater def = new MyDeflater();
     public static void realMain(String[] args) throws Throwable {
         ByteArrayInputStream bais = new ByteArrayInputStream(
             "hello, world".getBytes());
-        MyDeflater def = new MyDeflater();
         DeflaterInputStream dis = null;
         byte[] b = new byte[512];
 
--- a/jdk/test/java/util/zip/ConstructInflaterOutput.java	Thu Feb 18 11:30:16 2016 -0800
+++ b/jdk/test/java/util/zip/ConstructInflaterOutput.java	Thu Feb 18 13:41:11 2016 -0800
@@ -23,7 +23,7 @@
 
 /**
  * @test
- * @bug 4679743
+ * @bug 4679743 8148624
  * @summary Test parts of InflaterOutputStream code that don't really do I/O.
  */
 
@@ -41,9 +41,10 @@
         }
     }
 
+    private static MyInflater inf = new MyInflater();
+
     public static void realMain(String[] args) throws Throwable {
         ByteArrayOutputStream baos = new ByteArrayOutputStream();
-        MyInflater inf = new MyInflater();
         InflaterOutputStream ios = null;
         byte[] b = new byte[512];
 
--- a/jdk/test/java/util/zip/TestLocalTime.java	Thu Feb 18 11:30:16 2016 -0800
+++ b/jdk/test/java/util/zip/TestLocalTime.java	Thu Feb 18 13:41:11 2016 -0800
@@ -23,7 +23,7 @@
 
 /*
  * @test
- * @bug 8075526
+ * @bug 8075526 8135108
  * @key intermittent
  * @summary Test timestamp via ZipEntry.get/setTimeLocal()
  */
@@ -41,6 +41,7 @@
         try {
             LocalDateTime ldt = LocalDateTime.now();
             test(getBytes(ldt), ldt);    // now
+
             ldt = ldt.withYear(1968); test(getBytes(ldt), ldt);
             ldt = ldt.withYear(1970); test(getBytes(ldt), ldt);
             ldt = ldt.withYear(1982); test(getBytes(ldt), ldt);
@@ -55,6 +56,13 @@
             testWithTZ(tz, ldt.withYear(2037));
             testWithTZ(tz, ldt.withYear(2100));
             testWithTZ(tz, ldt.withYear(2106));
+
+            // for #8135108
+            ldt = LocalDateTime.of(2100, 12, 06, 12, 34, 34, 973);
+            test(getBytes(ldt), ldt);
+            ldt = LocalDateTime.of(2106, 12, 06, 12, 34, 34, 973);
+            test(getBytes(ldt), ldt);
+
         } finally {
             TimeZone.setDefault(tz0);
         }
--- a/jdk/test/javax/imageio/plugins/shared/BitDepth.java	Thu Feb 18 11:30:16 2016 -0800
+++ b/jdk/test/javax/imageio/plugins/shared/BitDepth.java	Thu Feb 18 13:41:11 2016 -0800
@@ -35,7 +35,11 @@
 import java.awt.image.BufferedImage;
 import java.io.File;
 import java.io.IOException;
+import java.util.Iterator;
 import javax.imageio.ImageIO;
+import javax.imageio.ImageTypeSpecifier;
+import javax.imageio.ImageWriter;
+import javax.imageio.stream.ImageOutputStream;
 
 public class BitDepth {
 
@@ -114,15 +118,15 @@
 
     private int width = 80;
     private int height = 80;
-    private String[] format = { "png", "jpeg", "tif", "bmp", "gif" };
+    private String[] formats = { "png", "jpeg", "tiff", "bmp", "gif" };
 
     public BitDepth(String[] args) throws IOException {
         if (args.length > 0) {
-            format = args;
+            formats = args;
         }
 
-        for (int i = 0; i < format.length; i++) {
-            testFormat(format[i]);
+        for (String format : formats) {
+            testFormat(format);
         }
     }
 
@@ -130,11 +134,7 @@
 
         boolean allOK = true;
 
-        for (int i = 0; i < biRGBTypes.length; i++) {
-
-            int type = biRGBTypes[i];
-
-
+        for (int type : biRGBTypes) {
             // TODO: remove the following 'if' block after the 8147448 fix
             if ( format.toLowerCase().equals("bmp") && (
                 (type == BufferedImage.TYPE_INT_ARGB       ) ||
@@ -148,10 +148,12 @@
                 continue;
             }
 
-
             System.out.println("Testing " + format +
                                " writer for type " + biTypeNames[type]);
             File f = testWriteRGB(format, type);
+            if (f == null)
+                continue;
+
             boolean ok = testReadRGB(f);
             if (ok) {
                 f.delete();
@@ -159,8 +161,6 @@
             allOK = allOK && ok;
         }
 
-
-
         if (format.equals("png")) {
             System.out.println("Testing png writer for black stripe");
             boolean ok = testPNGByteBinary();
@@ -191,13 +191,22 @@
         g.setColor(blue);
         g.fillRect(50, 50, 20, 20);
 
+        ImageTypeSpecifier spec = new ImageTypeSpecifier(bi);
+        Iterator<ImageWriter> writers = ImageIO.getImageWriters(spec, format);
         File file = new File("BitDepth_" + biTypeNames[type] + "." + format);
-        try {
-            ImageIO.write(bi, format, file);
-        } catch (RuntimeException re) {
-            System.out.println("Can't write a type "
-                               + biTypeNames[type] +
-                               " BufferedImage!");
+        if (!writers.hasNext()) {
+            System.out.println("\tNo writers available for type " + biTypeNames[type]
+                               + " BufferedImage!");
+        } else {
+            ImageWriter writer = writers.next();
+            try (ImageOutputStream out = ImageIO.createImageOutputStream(file)) {
+                writer.setOutput(out);
+                writer.write(bi);
+            } catch (Exception e) {
+                System.out.println("\tCan't write a type " +  biTypeNames[type]
+                           + " BufferedImage!");
+                return null;
+            }
         }
 
         return file;
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/javax/imageio/plugins/tiff/TIFFTagSetTest.java	Thu Feb 18 13:41:11 2016 -0800
@@ -0,0 +1,367 @@
+/*
+ * Copyright (c) 2016, 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     8145780
+ * @author  a.stepanov
+ * @summary Some checks for TIFFTag, TIFFTagSet
+ * @run     main TIFFTagSetTest
+ */
+
+
+import javax.imageio.plugins.tiff.*;
+
+import java.lang.reflect.Method;
+import java.util.*;
+
+
+public class TIFFTagSetTest {
+
+    public static class TestSet extends TIFFTagSet {
+
+        public static final TIFFTagSet SOME_SET =
+            new TIFFTagSet(new ArrayList<TIFFTag>());
+
+        private static TestSet theInstance = null;
+
+        public static final int TAG_NUM_1  = 0;
+        public static final int TAG_NUM_2  = 666;
+        public static final int TAG_NUM_3  = Integer.MAX_VALUE;
+
+        public static final String TAG_NAME_1  = "tag-1";
+        public static final String TAG_NAME_2  = "tag-2";
+        public static final String TAG_NAME_3  = "tag-3";
+
+        public static final int VALUE_1 = 123;
+        public static final int VALUE_2 = 321;
+
+        public static final String VALUE_NAME_1 = "value-1";
+        public static final String VALUE_NAME_2 = "value-2";
+
+        public static final int VALUE_COUNT = 500;
+
+
+        static class Tag1 extends TIFFTag {
+            public Tag1() {
+                super(TAG_NAME_1,
+                      TAG_NUM_1,
+                      1 << TIFF_SHORT | 1 << TIFF_LONG,
+                      VALUE_COUNT);
+            }
+        }
+
+        static class Tag2 extends TIFFTag {
+            public Tag2() {
+                super(TAG_NAME_2,
+                      TAG_NUM_2,
+                      1 << TIFF_DOUBLE);
+
+                addValueName(VALUE_1, VALUE_NAME_1);
+                addValueName(VALUE_2, VALUE_NAME_2);
+            }
+        }
+
+        static class Tag3 extends TIFFTag {
+            public Tag3() {
+                super(TAG_NAME_3,
+                      TAG_NUM_3,
+                      SOME_SET);
+            }
+        }
+
+        private static List<TIFFTag> tags;
+
+        private static void initTags() {
+
+            tags = new ArrayList<TIFFTag>();
+
+            tags.add(new TestSet.Tag1());
+            tags.add(new TestSet.Tag2());
+            tags.add(new TestSet.Tag3());
+        }
+
+        private TestSet() { super(tags); }
+
+        public synchronized static TestSet getInstance() {
+
+            if (theInstance == null) {
+                initTags();
+                theInstance = new TestSet();
+                tags = null;
+            }
+            return theInstance;
+        }
+    }
+
+
+    private static void checkEq(String what, Object v, Object ref) {
+        if (v == null) {
+            throw new RuntimeException(what + " is null");
+        } else if (!v.equals(ref)) {
+            throw new RuntimeException("invalid " + what +
+                ", expected: " + ref + ", got: " + v);
+        }
+    }
+
+
+
+
+    private final String className;
+    public TIFFTagSetTest(String cName) { className = cName; }
+
+    public void testNamesNumbers() throws ReflectiveOperationException {
+
+        Class<?> c = Class.forName(className);
+
+        Method getInstance = c.getMethod("getInstance", new Class[]{});
+        Object o = getInstance.invoke(new Object[]{});
+
+        TIFFTagSet tagSet = (TIFFTagSet) o;
+        SortedSet tagNames   = tagSet.getTagNames();
+        SortedSet tagNumbers = tagSet.getTagNumbers();
+
+        int nTagNames = tagNames.size();
+        if (nTagNames != tagNumbers.size()) {
+            throw new RuntimeException("Error: unequal sizes for tag names set "
+                    + "and tag numbers set");
+        }
+        System.out.println("\n" + nTagNames + " tag names/numbers\n");
+
+        for (final Iterator itName = tagNames.iterator(); itName.hasNext(); ) {
+
+            String tagName = (String) itName.next();
+            // just in case
+            if (tagName == null) {
+                throw new RuntimeException("null tag name");
+            }
+
+            TIFFTag tagByName = tagSet.getTag(tagName);
+            System.out.println(
+                "name/number: \t" + tagName + "/" + tagByName.getNumber());
+            checkEq("tag name", tagByName.getName(), tagName);
+            TIFFTag tagByNum = tagSet.getTag(tagByName.getNumber());
+            checkEq("tag name", tagByNum.getName(), tagName);
+
+            if (tagByName.isIFDPointer() &&
+               !tagByName.isDataTypeOK(TIFFTag.TIFF_IFD_POINTER)) {
+                throw new RuntimeException("Error: " + tagName +
+                    "must be an IFD pointer");
+            }
+        }
+        System.out.println("");
+
+        for (final Iterator itNum = tagNumbers.iterator(); itNum.hasNext(); ) {
+
+            int tagNum = (int) itNum.next();
+            // just in case
+            if (tagNum < 0) {
+                throw new RuntimeException("negative tag number");
+            }
+            TIFFTag tagByNum = tagSet.getTag(tagNum);
+
+            System.out.println(
+                "number/name: \t" + tagNum + "/" + tagByNum.getName());
+            checkEq("tag number", tagByNum.getNumber(), tagNum);
+            TIFFTag tagByName = tagSet.getTag(tagByNum.getName());
+            checkEq("tag number", tagByName.getNumber(), tagNum);
+        }
+
+        System.out.println("");
+    }
+
+
+    private static void testUserDefTagSet() {
+
+        TIFFTagSet set = TestSet.getInstance();
+
+        SortedSet tagNames = set.getTagNames();
+        checkEq("tagNames set size", tagNames.size(), 3);
+        if (! (tagNames.contains(TestSet.TAG_NAME_1) &&
+               tagNames.contains(TestSet.TAG_NAME_2) &&
+               tagNames.contains(TestSet.TAG_NAME_3)) ) {
+            throw new RuntimeException("invalid tag names");
+        }
+
+        SortedSet tagNumbers = set.getTagNumbers();
+        checkEq("tagNumbers set size", tagNumbers.size(), 3);
+        if (! (tagNumbers.contains(TestSet.TAG_NUM_1) &&
+               tagNumbers.contains(TestSet.TAG_NUM_2) &&
+               tagNumbers.contains(TestSet.TAG_NUM_3)) ) {
+            throw new RuntimeException("invalid tag numbers");
+        }
+
+        TIFFTag t1 = set.getTag(TestSet.TAG_NUM_1),
+                t2 = set.getTag(TestSet.TAG_NUM_2),
+                t3 = set.getTag(TestSet.TAG_NUM_3);
+
+        checkEq(TestSet.TAG_NAME_1 + " name", t1.getName(), TestSet.TAG_NAME_1);
+        checkEq(TestSet.TAG_NAME_2 + " name", t2.getName(), TestSet.TAG_NAME_2);
+        checkEq(TestSet.TAG_NAME_3 + " name", t3.getName(), TestSet.TAG_NAME_3);
+
+        // check count
+        // was set
+        checkEq(TestSet.TAG_NAME_1 + " count",
+            t1.getCount(),  TestSet.VALUE_COUNT);
+        // undefined
+        checkEq(TestSet.TAG_NAME_2 + " count", t2.getCount(), -1);
+        // see docs for constructor TIFFTag(String, int, TIFFTagSet)
+        checkEq(TestSet.TAG_NAME_3 + " count", t3.getCount(),  1);
+
+        // check datatypes
+        checkEq(TestSet.TAG_NAME_1 + " datatypes", t1.getDataTypes(),
+            1 << TIFFTag.TIFF_SHORT | 1 << TIFFTag.TIFF_LONG);
+        boolean ok =  t1.isDataTypeOK(TIFFTag.TIFF_SHORT)  &&
+                      t1.isDataTypeOK(TIFFTag.TIFF_LONG)   &&
+                     !t1.isDataTypeOK(TIFFTag.TIFF_DOUBLE) &&
+                     !t1.isDataTypeOK(TIFFTag.TIFF_IFD_POINTER);
+        if (!ok) { throw new RuntimeException(TestSet.TAG_NAME_1 + ": " +
+            "isDataTypeOK check failed"); }
+        checkEq(TestSet.TAG_NAME_1 + ".isIFDPointer()", t1.isIFDPointer(), false);
+
+        checkEq(TestSet.TAG_NAME_2 + " datatypes", t2.getDataTypes(),
+            1 << TIFFTag.TIFF_DOUBLE);
+        ok = !t2.isDataTypeOK(TIFFTag.TIFF_SHORT)  &&
+             !t2.isDataTypeOK(TIFFTag.TIFF_LONG)   &&
+              t2.isDataTypeOK(TIFFTag.TIFF_DOUBLE) &&
+             !t2.isDataTypeOK(TIFFTag.TIFF_IFD_POINTER);
+        if (!ok) { throw new RuntimeException(TestSet.TAG_NAME_2 + ": " +
+            "isDataTypeOK check failed"); }
+        checkEq(TestSet.TAG_NAME_2 + ".isIFDPointer()", t2.isIFDPointer(), false);
+
+        // see docs for constructor TIFFTag(String, int, TIFFTagSet)
+        checkEq(TestSet.TAG_NAME_3 + " datatypes", t3.getDataTypes(),
+            1 << TIFFTag.TIFF_LONG | 1 << TIFFTag.TIFF_IFD_POINTER);
+        ok = !t3.isDataTypeOK(TIFFTag.TIFF_SHORT)  &&
+              t3.isDataTypeOK(TIFFTag.TIFF_LONG)   &&
+             !t3.isDataTypeOK(TIFFTag.TIFF_DOUBLE) &&
+              t3.isDataTypeOK(TIFFTag.TIFF_IFD_POINTER);
+        if (!ok) { throw new RuntimeException(TestSet.TAG_NAME_3 + ": " +
+            "isDataTypeOK check failed"); }
+        checkEq(TestSet.TAG_NAME_3 + ".isIFDPointer()", t3.isIFDPointer(), true);
+
+        // check value names
+        checkEq(TestSet.TAG_NAME_1 + ".hasValueNames()",
+            t1.hasValueNames(), false);
+        checkEq(TestSet.TAG_NAME_2 + ".hasValueNames()",
+            t2.hasValueNames(), true);
+        checkEq(TestSet.TAG_NAME_3 + ".hasValueNames()",
+            t3.hasValueNames(), false);
+
+        if (t1.getNamedValues() != null && t3.getNamedValues() != null) {
+            throw new RuntimeException(TestSet.TAG_NAME_1 + " and " +
+                TestSet.TAG_NAME_3 + " must have null value names arrays");
+        }
+
+        checkEq("number of " + TestSet.TAG_NAME_2 + " values",
+            t2.getNamedValues().length, 2);
+        checkEq("name of value " + TestSet.VALUE_1,
+            t2.getValueName(TestSet.VALUE_1), TestSet.VALUE_NAME_1);
+        checkEq("name of value " + TestSet.VALUE_2,
+            t2.getValueName(TestSet.VALUE_2), TestSet.VALUE_NAME_2);
+
+        // check tag sets
+        if (!(t1.getTagSet() == null && t2.getTagSet() == null) &&
+              t3.getTagSet().equals(TestSet.SOME_SET)) {
+            throw new RuntimeException("invalid containing tag set");
+        }
+    }
+
+    private static void checkArgs() {
+
+        boolean ok = false;
+        try {
+            TIFFTag t = new TIFFTag(null, 0, 1 << TIFFTag.TIFF_LONG);
+        } catch (Exception e) {
+            ok = true;
+        }
+        if (!ok) {
+            throw new RuntimeException("null names should not be allowed");
+        }
+
+        ok = false;
+        try {
+            TIFFTag t = new TIFFTag("abc", -1, 1 << TIFFTag.TIFF_LONG);
+        } catch (Exception e) {
+            ok = true;
+        }
+        if (!ok) {
+            throw new RuntimeException("negative numbers should not be allowed");
+        }
+
+        ok = false;
+        try {
+            TIFFTag t = new TIFFTag("abc", 666, ~0x3fff);
+        } catch (Exception e) {
+            ok = true;
+        }
+        if (!ok) {
+            throw new RuntimeException("disallowed data types were set");
+        }
+
+        ok = false;
+        try {
+            TIFFTag.getSizeOfType(TIFFTag.MIN_DATATYPE - 1);
+        } catch (Exception e) {
+            ok = true;
+        }
+        if (!ok) { throw new RuntimeException(
+            "missing data types check for getSizeOfType()"); }
+
+        ok = false;
+        try {
+            TIFFTag.getSizeOfType(TIFFTag.MAX_DATATYPE + 1);
+        } catch (Exception e) {
+            ok = true;
+        }
+        if (!ok) { throw new RuntimeException(
+            "missing data types check for getSizeOfType()"); }
+
+    }
+
+
+    public static void main(String[] args) throws ReflectiveOperationException {
+
+        String classNames[] = {"BaselineTIFFTagSet",
+                               "ExifGPSTagSet",
+                               "ExifInteroperabilityTagSet",
+                               "ExifParentTIFFTagSet",
+                               "ExifTIFFTagSet",
+                               "FaxTIFFTagSet",
+                               "GeoTIFFTagSet"};
+
+        for (String cn: classNames) {
+            System.out.println("Testing " + cn + ":");
+            (new TIFFTagSetTest(
+                "javax.imageio.plugins.tiff." + cn)).testNamesNumbers();
+        }
+
+        System.out.println("\nTesting user-defined tag set:");
+        testUserDefTagSet();
+        (new TIFFTagSetTest("TIFFTagSetTest$TestSet")).testNamesNumbers();
+
+        System.out.println("\nSome additional argument checks...");
+        checkArgs();
+        System.out.println("done");
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/javax/imageio/spi/ServiceRegistrySyncTest.java	Thu Feb 18 13:41:11 2016 -0800
@@ -0,0 +1,131 @@
+/*
+ * Copyright (c) 2016, 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     8022640
+ * @summary Test verifies whether ServiceProvider API's of
+ *          ServiceRegistry are safe for concurrent access.
+ * @run     main ServiceRegistrySyncTest
+ */
+
+import java.io.File;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Locale;
+import javax.imageio.spi.ImageInputStreamSpi;
+import javax.imageio.spi.ServiceRegistry;
+import javax.imageio.stream.ImageInputStream;
+
+public class ServiceRegistrySyncTest {
+    public static void main(String[] args) throws InterruptedException {
+
+        final ArrayList<Class<?>> services = new ArrayList<Class<?>>();
+        services.add(ImageInputStreamSpi.class);
+
+        final ServiceRegistry reg = new ServiceRegistry(services.iterator());
+
+        //create new thread for Registerer and Consumer Class
+        Thread registerer = new Thread(new Registerer(reg));
+        Thread consumer = new Thread(new Consumer(reg));
+
+        //run both registerer and consumer thread parallely
+        registerer.start();
+        consumer.start();
+    }
+
+    static class Consumer implements Runnable {
+        private final ServiceRegistry reg;
+        boolean go = true;
+        int duration;
+        long start, end;
+
+        public Consumer(ServiceRegistry r) {
+            reg = r;
+            //set 5000ms duration to run the test
+            duration = 5000;
+        }
+
+        @Override
+        public void run() {
+            start = System.currentTimeMillis();
+            end = start + duration;
+            while (start < end) {
+                //access the ServiceProvider API
+                reg.getServiceProviders(ImageInputStreamSpi.class, true);
+                start = System.currentTimeMillis();
+            }
+        }
+    }
+
+    static class Registerer implements Runnable {
+        private final ServiceRegistry reg;
+        boolean go = true;
+        int duration;
+        long start, end;
+
+        public Registerer(ServiceRegistry r) {
+            reg = r;
+            //set 5000ms duration to run the test
+            duration = 5000;
+        }
+
+        @Override
+        public void run() {
+            final int N = 20;
+
+            MyService[] services = new MyService[N];
+            for (int i = 0; i < N; i++) {
+                services[i] = new MyService();
+            }
+            start = System.currentTimeMillis();
+            end = start + duration;
+            while (start < end) {
+                //access the ServiceProvider API's
+                for (int i = 0; i < N; i++) {
+                    reg.registerServiceProvider(services[i]);
+                }
+                for (int i = 0; i < N; i++) {
+                    reg.deregisterServiceProvider(services[i]);
+                }
+                start = System.currentTimeMillis();
+            }
+        }
+    }
+}
+
+class MyService extends ImageInputStreamSpi {
+    public MyService() {
+    }
+
+    @Override
+    public String getDescription(Locale locale) {
+        return null;
+    }
+
+    @Override
+    public ImageInputStream createInputStreamInstance
+        (Object input, boolean useCache, File cacheDir) throws IOException {
+        return null;
+    }
+}
--- a/jdk/test/javax/net/ssl/SSLSession/SessionCacheSizeTests.java	Thu Feb 18 11:30:16 2016 -0800
+++ b/jdk/test/javax/net/ssl/SSLSession/SessionCacheSizeTests.java	Thu Feb 18 13:41:11 2016 -0800
@@ -31,7 +31,6 @@
  * @bug 4366807
  * @summary Need new APIs to get/set session timeout and session cache size.
  * @run main/othervm SessionCacheSizeTests
- * @key intermittent
  */
 
 import java.io.*;
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/javax/net/ssl/TLSv12/DisabledShortDSAKeys.java	Thu Feb 18 13:41:11 2016 -0800
@@ -0,0 +1,441 @@
+/*
+ * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+// SunJSSE does not support dynamic system properties, no way to re-use
+// system properties in samevm/agentvm mode.
+
+/*
+ * @test
+ * @bug 8139565
+ * @summary Restrict certificates with DSA keys less than 1024 bits
+ *
+ * @run main/othervm DisabledShortDSAKeys PKIX TLSv1.2
+ * @run main/othervm DisabledShortDSAKeys SunX509 TLSv1.2
+ * @run main/othervm DisabledShortDSAKeys PKIX TLSv1.1
+ * @run main/othervm DisabledShortDSAKeys SunX509 TLSv1.1
+ * @run main/othervm DisabledShortDSAKeys PKIX TLSv1
+ * @run main/othervm DisabledShortDSAKeys SunX509 TLSv1
+ * @run main/othervm DisabledShortDSAKeys PKIX SSLv3
+ * @run main/othervm DisabledShortDSAKeys SunX509 SSLv3
+ */
+
+import java.net.*;
+import java.util.*;
+import java.io.*;
+import javax.net.ssl.*;
+import java.security.Security;
+import java.security.KeyStore;
+import java.security.KeyFactory;
+import java.security.cert.Certificate;
+import java.security.cert.CertificateFactory;
+import java.security.spec.*;
+import java.security.interfaces.*;
+import java.util.Base64;
+
+
+public class DisabledShortDSAKeys {
+
+    /*
+     * =============================================================
+     * Set the various variables needed for the tests, then
+     * specify what tests to run on each side.
+     */
+
+    /*
+     * Should we run the client or server in a separate thread?
+     * Both sides can throw exceptions, but do you have a preference
+     * as to which side should be the main thread.
+     */
+    static boolean separateServerThread = true;
+
+    /*
+     * Where do we find the keystores?
+     */
+    // Certificates and key used in the test.
+    static String trustedCertStr =
+        "-----BEGIN CERTIFICATE-----\n" +
+        "MIIDDjCCAs2gAwIBAgIJAO5/hbm1ByJOMAkGByqGSM44BAMwHzELMAkGA1UEBhMC\n" +
+        "VVMxEDAOBgNVBAoTB0V4YW1wbGUwHhcNMTYwMjE2MDQzNTQ2WhcNMzcwMTI2MDQz\n" +
+        "NTQ2WjAfMQswCQYDVQQGEwJVUzEQMA4GA1UEChMHRXhhbXBsZTCCAbgwggEsBgcq\n" +
+        "hkjOOAQBMIIBHwKBgQC4aSK8nBYdWJtuBkz6yoDyjZnNuGFSpDmx1ggKpLpcnPuw\n" +
+        "YKAbUhqdYhZtaIqQ4aO0T1ZS/HuOM0zvddnMUidFNX3RUvDkvdD/JYOnjqzCm+xW\n" +
+        "U0NFuPHZdapQY5KFk3ugkqZpHLY1StZbu0qugZOZjbBOMwB7cHAbMDuVpEr8DQIV\n" +
+        "AOi+ig+h3okFbWEE9MztiI2+DqNrAoGBAKh2EZbuWU9NoHglhVzfDUoz8CeyW6W6\n" +
+        "rUZuIOQsjWaYOeRPWX0UVAGq9ykIOfamEpurKt4H8ge/pHaL9iazJjonMHOXG12A\n" +
+        "0lALsMDGv22zVaJzXjOBvdPzc87opr0LIVgHASKOcDYjsICKNYPlS2cL3MJoD+bj\n" +
+        "NAR67b90VBbEA4GFAAKBgQCGrkRp2tdj2mZF7Qz0tO6p3xSysbEfN6QZxOJYPTvM\n" +
+        "yIYfLV9Yoy7XaRd/mCpJo/dqmsZMzowtyi+u+enuVpOLKiq/lyCktL+xUzZAjLT+\n" +
+        "9dafHlS1wR3pDSa1spo9xTEi4Ff/DQDHcdGalBxSXX/UdRtSecIYAp5/fkt3QZ5v\n" +
+        "0aOBkTCBjjAdBgNVHQ4EFgQUX4qbP5PgBx1J8BJ8qEgfoKVLSnQwTwYDVR0jBEgw\n" +
+        "RoAUX4qbP5PgBx1J8BJ8qEgfoKVLSnShI6QhMB8xCzAJBgNVBAYTAlVTMRAwDgYD\n" +
+        "VQQKEwdFeGFtcGxlggkA7n+FubUHIk4wDwYDVR0TAQH/BAUwAwEB/zALBgNVHQ8E\n" +
+        "BAMCAgQwCQYHKoZIzjgEAwMwADAtAhUAkr5bINXyy/McAx6qwhb6r0/QJUgCFFUP\n" +
+        "CZokA4/NqJIgq8ThpTQAE8SB\n" +
+        "-----END CERTIFICATE-----";
+
+    static String targetCertStr =
+        "-----BEGIN CERTIFICATE-----\n" +
+        "MIICUjCCAhGgAwIBAgIJAIiDrs/4W8rtMAkGByqGSM44BAMwHzELMAkGA1UEBhMC\n" +
+        "VVMxEDAOBgNVBAoTB0V4YW1wbGUwHhcNMTYwMjE2MDQzNTQ2WhcNMzUxMTAzMDQz\n" +
+        "NTQ2WjA5MQswCQYDVQQGEwJVUzEQMA4GA1UECgwHRXhhbXBsZTEYMBYGA1UEAwwP\n" +
+        "d3d3LmV4YW1wbGUuY29tMIHwMIGoBgcqhkjOOAQBMIGcAkEAs6A0p3TysTtVXGSv\n" +
+        "ThR/8GHpbL49KyWRJBMIlmLc5jl/wxJgnL1t07p4YTOEa6ecyTFos04Z8n2GARmp\n" +
+        "zYlUywIVAJLDcf4JXhZbguRFSQdWwWhZkh+LAkBLCzh3Xvpmc/5CDqU+QHqDcuSk\n" +
+        "5B8+ZHaHRi2KQ00ejilpF2qZpW5JdHe4m3Pggh0MIuaAGX+leM4JKlnObj14A0MA\n" +
+        "AkAYb+DYlFgStFhF1ip7rFzY8K6i/3ellkXI2umI/XVwxUQTHSlk5nFOep5Dfzm9\n" +
+        "pADJwuSe1qGHsHB5LpMZPVpto4GEMIGBMAkGA1UdEwQCMAAwCwYDVR0PBAQDAgPo\n" +
+        "MB0GA1UdDgQWBBT8nsFyccF4q1dtpWE1dkNK5UiXtTAfBgNVHSMEGDAWgBRfips/\n" +
+        "k+AHHUnwEnyoSB+gpUtKdDAnBgNVHSUEIDAeBggrBgEFBQcDAQYIKwYBBQUHAwIG\n" +
+        "CCsGAQUFBwMDMAkGByqGSM44BAMDMAAwLQIUIcIlxpIwaZXdpMC+U076unR1Mp8C\n" +
+        "FQCD/NE8O0xwq57nwFfp7tUvUHYMMA==\n" +
+        "-----END CERTIFICATE-----";
+
+    // Private key in the format of PKCS#8, key size is 512 bits.
+    static String targetPrivateKey =
+        "MIHGAgEAMIGoBgcqhkjOOAQBMIGcAkEAs6A0p3TysTtVXGSvThR/8GHpbL49KyWR\n" +
+        "JBMIlmLc5jl/wxJgnL1t07p4YTOEa6ecyTFos04Z8n2GARmpzYlUywIVAJLDcf4J\n" +
+        "XhZbguRFSQdWwWhZkh+LAkBLCzh3Xvpmc/5CDqU+QHqDcuSk5B8+ZHaHRi2KQ00e\n" +
+        "jilpF2qZpW5JdHe4m3Pggh0MIuaAGX+leM4JKlnObj14BBYCFHB2Wek2g5hpNj5y\n" +
+        "RQfCc6CFO0dv";
+
+    static char passphrase[] = "passphrase".toCharArray();
+
+    /*
+     * Is the server ready to serve?
+     */
+    volatile static boolean serverReady = false;
+
+    /*
+     * Turn on SSL debugging?
+     */
+    static boolean debug = false;
+
+    /*
+     * Define the server side of the test.
+     *
+     * If the server prematurely exits, serverReady will be set to true
+     * to avoid infinite hangs.
+     */
+    void doServerSide() throws Exception {
+        SSLContext context = generateSSLContext(null, targetCertStr,
+                                            targetPrivateKey);
+        SSLServerSocketFactory sslssf = context.getServerSocketFactory();
+        SSLServerSocket sslServerSocket =
+            (SSLServerSocket)sslssf.createServerSocket(serverPort);
+        serverPort = sslServerSocket.getLocalPort();
+
+        /*
+         * Signal Client, we're ready for his connect.
+         */
+        serverReady = true;
+
+        try (SSLSocket sslSocket = (SSLSocket)sslServerSocket.accept()) {
+            try (InputStream sslIS = sslSocket.getInputStream()) {
+                sslIS.read();
+            }
+
+            throw new Exception(
+                    "DSA keys shorter than 1024 bits should be disabled");
+        } catch (SSLHandshakeException sslhe) {
+            // the expected exception, ignore
+        }
+    }
+
+    /*
+     * Define the client side of the test.
+     *
+     * If the server prematurely exits, serverReady will be set to true
+     * to avoid infinite hangs.
+     */
+    void doClientSide() throws Exception {
+
+        /*
+         * Wait for server to get started.
+         */
+        while (!serverReady) {
+            Thread.sleep(50);
+        }
+
+        SSLContext context = generateSSLContext(trustedCertStr, null, null);
+        SSLSocketFactory sslsf = context.getSocketFactory();
+
+        try (SSLSocket sslSocket =
+            (SSLSocket)sslsf.createSocket("localhost", serverPort)) {
+
+            // only enable the target protocol
+            sslSocket.setEnabledProtocols(new String[] {enabledProtocol});
+
+            // enable a block cipher
+            sslSocket.setEnabledCipherSuites(
+                new String[] {"TLS_DHE_DSS_WITH_AES_128_CBC_SHA"});
+
+            try (OutputStream sslOS = sslSocket.getOutputStream()) {
+                sslOS.write('B');
+                sslOS.flush();
+            }
+
+            throw new Exception(
+                    "DSA keys shorter than 1024 bits should be disabled");
+        } catch (SSLHandshakeException sslhe) {
+            // the expected exception, ignore
+        }
+    }
+
+    /*
+     * =============================================================
+     * The remainder is just support stuff
+     */
+    private static String tmAlgorithm;        // trust manager
+    private static String enabledProtocol;    // the target protocol
+
+    private static void parseArguments(String[] args) {
+        tmAlgorithm = args[0];
+        enabledProtocol = args[1];
+    }
+
+    private static SSLContext generateSSLContext(String trustedCertStr,
+            String keyCertStr, String keySpecStr) throws Exception {
+
+        // generate certificate from cert string
+        CertificateFactory cf = CertificateFactory.getInstance("X.509");
+
+        // create a key store
+        KeyStore ks = KeyStore.getInstance("JKS");
+        ks.load(null, null);
+
+        // import the trused cert
+        Certificate trusedCert = null;
+        ByteArrayInputStream is = null;
+        if (trustedCertStr != null) {
+            is = new ByteArrayInputStream(trustedCertStr.getBytes());
+            trusedCert = cf.generateCertificate(is);
+            is.close();
+
+            ks.setCertificateEntry("DSA Export Signer", trusedCert);
+        }
+
+        if (keyCertStr != null) {
+            // generate the private key.
+            PKCS8EncodedKeySpec priKeySpec = new PKCS8EncodedKeySpec(
+                                Base64.getMimeDecoder().decode(keySpecStr));
+            KeyFactory kf = KeyFactory.getInstance("DSA");
+            DSAPrivateKey priKey =
+                    (DSAPrivateKey)kf.generatePrivate(priKeySpec);
+
+            // generate certificate chain
+            is = new ByteArrayInputStream(keyCertStr.getBytes());
+            Certificate keyCert = cf.generateCertificate(is);
+            is.close();
+
+            Certificate[] chain = null;
+            if (trusedCert != null) {
+                chain = new Certificate[2];
+                chain[0] = keyCert;
+                chain[1] = trusedCert;
+            } else {
+                chain = new Certificate[1];
+                chain[0] = keyCert;
+            }
+
+            // import the key entry.
+            ks.setKeyEntry("Whatever", priKey, passphrase, chain);
+        }
+
+        // create SSL context
+        TrustManagerFactory tmf = TrustManagerFactory.getInstance(tmAlgorithm);
+        tmf.init(ks);
+
+        SSLContext ctx = SSLContext.getInstance("TLS");
+        if (keyCertStr != null && !keyCertStr.isEmpty()) {
+            KeyManagerFactory kmf = KeyManagerFactory.getInstance("NewSunX509");
+            kmf.init(ks, passphrase);
+
+            ctx.init(kmf.getKeyManagers(), tmf.getTrustManagers(), null);
+            ks = null;
+        } else {
+            ctx.init(null, tmf.getTrustManagers(), null);
+        }
+
+        return ctx;
+    }
+
+
+    // use any free port by default
+    volatile int serverPort = 0;
+
+    volatile Exception serverException = null;
+    volatile Exception clientException = null;
+
+    public static void main(String[] args) throws Exception {
+        if (debug)
+            System.setProperty("javax.net.debug", "all");
+
+        /*
+         * Get the customized arguments.
+         */
+        parseArguments(args);
+
+        /*
+         * Start the tests.
+         */
+        new DisabledShortDSAKeys();
+    }
+
+    Thread clientThread = null;
+    Thread serverThread = null;
+
+    /*
+     * Primary constructor, used to drive remainder of the test.
+     *
+     * Fork off the other side, then do your work.
+     */
+    DisabledShortDSAKeys() throws Exception {
+        Exception startException = null;
+        try {
+            if (separateServerThread) {
+                startServer(true);
+                startClient(false);
+            } else {
+                startClient(true);
+                startServer(false);
+            }
+        } catch (Exception e) {
+            startException = e;
+        }
+
+        /*
+         * Wait for other side to close down.
+         */
+        if (separateServerThread) {
+            if (serverThread != null) {
+                serverThread.join();
+            }
+        } else {
+            if (clientThread != null) {
+                clientThread.join();
+            }
+        }
+
+        /*
+         * When we get here, the test is pretty much over.
+         * Which side threw the error?
+         */
+        Exception local;
+        Exception remote;
+
+        if (separateServerThread) {
+            remote = serverException;
+            local = clientException;
+        } else {
+            remote = clientException;
+            local = serverException;
+        }
+
+        Exception exception = null;
+
+        /*
+         * Check various exception conditions.
+         */
+        if ((local != null) && (remote != null)) {
+            // If both failed, return the curthread's exception.
+            local.initCause(remote);
+            exception = local;
+        } else if (local != null) {
+            exception = local;
+        } else if (remote != null) {
+            exception = remote;
+        } else if (startException != null) {
+            exception = startException;
+        }
+
+        /*
+         * If there was an exception *AND* a startException,
+         * output it.
+         */
+        if (exception != null) {
+            if (exception != startException && startException != null) {
+                exception.addSuppressed(startException);
+            }
+            throw exception;
+        }
+
+        // Fall-through: no exception to throw!
+    }
+
+    void startServer(boolean newThread) throws Exception {
+        if (newThread) {
+            serverThread = new Thread() {
+                public void run() {
+                    try {
+                        doServerSide();
+                    } catch (Exception e) {
+                        /*
+                         * Our server thread just died.
+                         *
+                         * Release the client, if not active already...
+                         */
+                        System.err.println("Server died...");
+                        serverReady = true;
+                        serverException = e;
+                    }
+                }
+            };
+            serverThread.start();
+        } else {
+            try {
+                doServerSide();
+            } catch (Exception e) {
+                serverException = e;
+            } finally {
+                serverReady = true;
+            }
+        }
+    }
+
+    void startClient(boolean newThread) throws Exception {
+        if (newThread) {
+            clientThread = new Thread() {
+                public void run() {
+                    try {
+                        doClientSide();
+                    } catch (Exception e) {
+                        /*
+                         * Our client thread just died.
+                         */
+                        System.err.println("Client died...");
+                        clientException = e;
+                    }
+                }
+            };
+            clientThread.start();
+        } else {
+            try {
+                doClientSide();
+            } catch (Exception e) {
+                clientException = e;
+            }
+        }
+    }
+}
--- a/jdk/test/javax/security/auth/kerberos/KerberosTixDateTest.java	Thu Feb 18 11:30:16 2016 -0800
+++ b/jdk/test/javax/security/auth/kerberos/KerberosTixDateTest.java	Thu Feb 18 13:41:11 2016 -0800
@@ -23,18 +23,21 @@
 
 /*
  * @test
- * @bug 6659990
- * @summary test the immutability of the Date fields in KerberosTicket class.
+ * @bug 6659990 8147772
+ * @summary test the immutability of the Date fields in KerberosTicket class,
+ *          serialization, and behavior after being destroyed.
  */
 
 /*
  * Must setup KDC and Kerberos configuration file
  */
 
-import java.net.InetAddress;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+import java.lang.reflect.Modifier;
 import java.util.Date;
 import java.io.*;
-import javax.security.auth.kerberos.KerberosKey;
+import javax.security.auth.RefreshFailedException;
 import javax.security.auth.kerberos.KerberosPrincipal;
 import javax.security.auth.kerberos.KerberosTicket;
 import java.util.Base64;
@@ -78,6 +81,7 @@
 
         testDateImmutability(t, originalTime);
         testS11nCompatibility(t); // S11n: Serialization
+        testDestroy(t);
     }
 
     private static void checkTime(KerberosTicket kt, long timeValue) {
@@ -140,4 +144,30 @@
 
         System.out.println("S11nCompatibility Test Passed");
     }
+
+    private static void testDestroy(KerberosTicket t) throws Exception {
+        t.destroy();
+        if (!t.isDestroyed()) {
+            throw new RuntimeException("ticket should have been destroyed");
+        }
+        // Although these methods are meaningless, they can be called
+        for (Method m: KerberosTicket.class.getDeclaredMethods()) {
+            if (Modifier.isPublic(m.getModifiers())
+                    && m.getParameterCount() == 0) {
+                System.out.println("Testing " + m.getName() + "...");
+                try {
+                    m.invoke(t);
+                } catch (InvocationTargetException e) {
+                    Throwable cause = e.getCause();
+                    if (cause instanceof RefreshFailedException ||
+                            cause instanceof IllegalStateException) {
+                        // this is OK
+                    } else {
+                        throw e;
+                    }
+                }
+            }
+        }
+        System.out.println("Destroy Test Passed");
+    }
 }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/javax/swing/JDialog/Transparency/TransparencyTest.java	Thu Feb 18 13:41:11 2016 -0800
@@ -0,0 +1,119 @@
+/*
+ * Copyright (c) 2016, 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 8062946
+ @summary Verify Transparency upon iconify/deiconify sequence
+ @run main TransparencyTest
+ */
+import java.awt.Color;
+import java.awt.Point;
+import java.awt.Robot;
+import javax.swing.JDialog;
+import javax.swing.JFrame;
+import javax.swing.SwingUtilities;
+
+public class TransparencyTest {
+
+    private static JFrame frame;
+    private static JDialog dialog;
+    private static JDialog backgroundDialog;
+    private static final int WIDTH = 250;
+    private static final int HEIGHT = 250;
+    private static final float OPACITY = 0.60f;
+    private static Point dlgPos;
+
+    public static void createAndShowGUI() {
+        frame = new JFrame("JFrame");
+        frame.setSize(WIDTH, HEIGHT);
+        frame.setLocation(100, 300);
+
+        dialog = new JDialog(frame, false);
+        dialog.setSize(250, 250);
+        dialog.setUndecorated(true);
+        dialog.setLocation(400, 300);
+        dlgPos = dialog.getLocation();
+        backgroundDialog = new JDialog(frame, false);
+        backgroundDialog.setSize(250, 250);
+        backgroundDialog.getContentPane().setBackground(Color.red);
+        backgroundDialog.setLocation(dlgPos.x, dlgPos.y);
+
+        frame.setVisible(true);
+        backgroundDialog.setVisible(true);
+        dialog.setVisible(true);
+    }
+
+    public static void main(String[] args) throws Exception {
+
+        Robot robot = new Robot();
+        // create a GUI
+        SwingUtilities.invokeAndWait(new Runnable() {
+
+            @Override
+            public void run() {
+                createAndShowGUI();
+            }
+        });
+        robot.waitForIdle();
+        Color opaque = robot.getPixelColor(dlgPos.x + 100, dlgPos.y + 100);
+
+        // set Dialog Opacity
+        SwingUtilities.invokeAndWait(new Runnable() {
+
+            @Override
+            public void run() {
+                dialog.setOpacity(OPACITY);
+            }
+        });
+        robot.waitForIdle();
+
+        // iconify frame
+        SwingUtilities.invokeAndWait(new Runnable() {
+
+            @Override
+            public void run() {
+                frame.setExtendedState(JFrame.ICONIFIED);
+            }
+        });
+        robot.waitForIdle();
+
+        // deiconify frame
+        SwingUtilities.invokeAndWait(new Runnable() {
+
+            @Override
+            public void run() {
+                frame.setExtendedState(JFrame.NORMAL);
+            }
+        });
+        robot.waitForIdle();
+
+        Color transparent = robot.getPixelColor(dlgPos.x + 100, dlgPos.y + 100);
+        if (transparent.equals(opaque)) {
+            frame.dispose();
+            throw new RuntimeException("JDialog transparency lost "
+                    + "upon iconify/deiconify sequence");
+        }
+        frame.dispose();
+    }
+}
--- a/jdk/test/sun/jvmstat/perfdata/PrologSanity/PrologSizeSanityCheck.java	Thu Feb 18 11:30:16 2016 -0800
+++ b/jdk/test/sun/jvmstat/perfdata/PrologSanity/PrologSizeSanityCheck.java	Thu Feb 18 13:41:11 2016 -0800
@@ -25,7 +25,7 @@
  * @test
  * @bug 4990825
  * @modules jdk.jvmstat/sun.jvmstat.monitor
- * @run main/othervm -XX:+UsePerfData -XX:PerfDataMemorySize=64k PrologSizeSanityCheck
+ * @run main/othervm -XX:+UsePerfData PrologSizeSanityCheck
  * @summary prolog size and overflow sanity checks
  */
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/sun/misc/SunMiscSignalTest.java	Thu Feb 18 13:41:11 2016 -0800
@@ -0,0 +1,398 @@
+/*
+ * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Objects;
+import java.util.concurrent.Semaphore;
+import java.util.concurrent.TimeUnit;
+
+import org.testng.Assert;
+import org.testng.TestNG;
+import org.testng.annotations.Test;
+import org.testng.annotations.BeforeSuite;
+import org.testng.annotations.DataProvider;
+
+import jdk.test.lib.Platform;
+import jdk.test.lib.Utils;
+
+import sun.misc.Signal;
+import sun.misc.SignalHandler;
+
+/*
+ * @test
+ * @library /test/lib/share/classes
+ * @build jdk.test.lib.Platform jdk.test.lib.Utils
+ * @run testng/othervm -Xrs -DXrs=true SunMiscSignalTest
+ * @run testng/othervm SunMiscSignalTest
+ * @summary sun.misc.Signal test
+ */
+
+@Test
+public class SunMiscSignalTest {
+
+    // Set to true to enable additional debug output
+    static boolean debug = true;
+
+    // True to test while running with -Xrs
+    static boolean RUNNING_WITH_Xrs = Boolean.getBoolean("Xrs");
+
+    /**
+     * Print a debug message if enabled.
+     *
+     * @param format the format
+     * @param args   the arguments
+     */
+    static void printf(String format, Object... args) {
+        if (debug) {
+            System.out.printf("    " + format, args);
+        }
+    }
+
+    enum IsSupported {NO, YES}
+
+    enum CanRegister {NO, YES}
+
+    enum CanRaise {NO, YES}
+
+    enum Invoked {NO, YES}
+
+    enum RestrictedSignals {NORMAL, XRS}
+
+    @BeforeSuite
+    static void setup() {
+        System.out.printf("-Xrs: %s%n", RUNNING_WITH_Xrs);
+    }
+
+    // Provider of signals to be tested with variations for -Xrs and
+    // platform dependencies
+    // -Xrs restricted signals signals the VM will not handle SIGINT, SIGTERM, SIGHUP and others
+    @DataProvider(name = "supportedSignals")
+    static Object[][] supportedSignals() {
+        RestrictedSignals rs = RUNNING_WITH_Xrs ? RestrictedSignals.XRS : RestrictedSignals.NORMAL;
+        CanRegister registerXrs = RUNNING_WITH_Xrs ? CanRegister.NO : CanRegister.YES;
+        CanRaise raiseXrs = RUNNING_WITH_Xrs ? CanRaise.NO : CanRaise.YES;
+        Invoked invokedXrs = RUNNING_WITH_Xrs ? Invoked.NO : Invoked.YES;
+
+        Object[][] commonSignals = new Object[][]{
+                {"INT",  IsSupported.YES, registerXrs, raiseXrs, invokedXrs},
+                {"TERM", IsSupported.YES, registerXrs, raiseXrs, invokedXrs},
+                {"ABRT", IsSupported.YES, CanRegister.YES, CanRaise.YES, invokedXrs},
+        };
+
+        Object[][] posixSignals = {
+                {"HUP",  IsSupported.YES, registerXrs, raiseXrs, invokedXrs},
+                {"QUIT", IsSupported.YES, CanRegister.NO, CanRaise.NO, Invoked.NO},
+                {"BUS",  IsSupported.YES, CanRegister.YES, CanRaise.YES, invokedXrs},
+                {"USR1", IsSupported.YES, CanRegister.YES, CanRaise.YES, invokedXrs},
+                {"USR2", IsSupported.YES, CanRegister.YES, CanRaise.YES, invokedXrs},
+                {"PIPE", IsSupported.YES, CanRegister.YES, CanRaise.YES, invokedXrs},
+                {"ALRM", IsSupported.YES, CanRegister.YES, CanRaise.YES, invokedXrs},
+                {"CHLD", IsSupported.YES, CanRegister.YES, CanRaise.YES, invokedXrs},
+                {"CONT", IsSupported.YES, CanRegister.YES, CanRaise.YES, invokedXrs},
+                {"TSTP", IsSupported.YES, CanRegister.YES, CanRaise.YES, invokedXrs},
+                {"TTIN", IsSupported.YES, CanRegister.YES, CanRaise.YES, invokedXrs},
+                {"TTOU", IsSupported.YES, CanRegister.YES, CanRaise.YES, invokedXrs},
+                {"URG",  IsSupported.YES, CanRegister.YES, CanRaise.YES, invokedXrs},
+                {"XCPU", IsSupported.YES, CanRegister.YES, CanRaise.YES, invokedXrs},
+                {"XFSZ", IsSupported.YES, CanRegister.YES, CanRaise.YES, invokedXrs},
+                {"VTALRM", IsSupported.YES, CanRegister.YES, CanRaise.YES, invokedXrs},
+                {"PROF", IsSupported.YES, CanRegister.YES, CanRaise.YES, invokedXrs},
+                {"WINCH", IsSupported.YES, CanRegister.YES, CanRaise.YES, invokedXrs},
+                {"IO",   IsSupported.YES, CanRegister.YES, CanRaise.YES, invokedXrs},
+                {"SYS",   IsSupported.YES, CanRegister.YES, CanRaise.YES, invokedXrs},
+        };
+
+        Object[][] windowsSignals = {
+                {"HUP",  IsSupported.NO, CanRegister.NO, CanRaise.NO, Invoked.NO},
+                {"QUIT", IsSupported.NO, CanRegister.NO, CanRaise.NO, Invoked.NO},
+                {"BUS",  IsSupported.NO, CanRegister.NO, CanRaise.NO, Invoked.NO},
+                {"USR1", IsSupported.NO, CanRegister.NO, CanRaise.NO, Invoked.NO},
+                {"USR2", IsSupported.NO, CanRegister.NO, CanRaise.NO, Invoked.NO},
+                {"PIPE", IsSupported.NO, CanRegister.NO, CanRaise.NO, Invoked.NO},
+                {"ALRM", IsSupported.NO, CanRegister.NO, CanRaise.NO, Invoked.NO},
+                {"CHLD", IsSupported.NO, CanRegister.NO, CanRaise.NO, Invoked.NO},
+                {"CONT", IsSupported.NO, CanRegister.NO, CanRaise.NO, Invoked.NO},
+                {"TSTP", IsSupported.NO, CanRegister.NO, CanRaise.NO, Invoked.NO},
+                {"TTIN", IsSupported.NO, CanRegister.NO, CanRaise.NO, Invoked.NO},
+                {"TTOU", IsSupported.NO, CanRegister.NO, CanRaise.NO, Invoked.NO},
+                {"URG",  IsSupported.NO, CanRegister.NO, CanRaise.NO, Invoked.NO},
+                {"XCPU", IsSupported.NO, CanRegister.NO, CanRaise.NO, Invoked.NO},
+                {"XFSZ", IsSupported.NO, CanRegister.NO, CanRaise.NO, Invoked.NO},
+                {"VTALRM", IsSupported.NO, CanRegister.NO, CanRaise.NO, Invoked.NO},
+                {"PROF", IsSupported.NO, CanRegister.NO, CanRaise.NO, Invoked.NO},
+                {"WINCH", IsSupported.NO, CanRegister.NO, CanRaise.NO, Invoked.NO},
+                {"IO",   IsSupported.NO, CanRegister.NO, CanRaise.NO, Invoked.NO},
+                {"SYS",  IsSupported.NO, CanRegister.NO, CanRaise.NO, Invoked.NO},
+        };
+
+        return concatArrays(commonSignals, (Platform.isWindows() ? windowsSignals : posixSignals));
+    }
+
+    // Provider of invalid signal names
+    @DataProvider(name = "invalidSunMiscSignalNames")
+    Object[][] invalidSunMiscSignalNames() {
+        return new Object[][]{
+                {""},
+                {"I"},
+                {"SIG"},
+                {"SIGabc"},
+                {"SIGINT"},     // prefix not allowed
+                {"abc"},
+        };
+    }
+
+    static Object[][] concatArrays(Object[][]... arrays) {
+        int l = 0;
+        for (Object[][] a : arrays) {
+            l += a.length;
+        }
+
+        Object[][] newArray = new Object[l][];
+        l = 0;
+        for (int i = 0; i < arrays.length; i++) {
+            System.arraycopy(arrays[i], 0, newArray, l, arrays[i].length);
+            l += arrays[i].length;
+        }
+
+        return newArray;
+    }
+
+    /**
+     * Quick verification of supported signals using sun.misc.Signal.
+     *
+     * @param name the signal name
+     * @throws InterruptedException would be an error if thrown
+     */
+    @Test(dataProvider = "supportedSignals")
+    static void testSunMisc(String name, IsSupported supported, CanRegister register,
+                            CanRaise raise, Invoked invoked) throws InterruptedException {
+        Handler h = new Handler();
+        SignalHandler orig = null;
+        Signal signal = null;
+        try {
+            signal = new Signal(name);
+            Assert.assertEquals(supported, IsSupported.YES, "Unexpected support for " + name);
+
+            Assert.assertEquals(signal.getName(), name, "getName() mismatch, ");
+
+            Assert.assertEquals(signal.toString(), "SIG" + name, "toString() mismatch, ");
+
+            try {
+                SignalHandler old = Signal.handle(signal, h);
+                Assert.assertEquals(CanRegister.YES, register, "Unexpected handle succeeded " + name);
+                try {
+                    Signal.raise(signal);
+                    Assert.assertEquals(CanRaise.YES, raise, "Unexpected raise success for " + name);
+                    Invoked inv = h.semaphore().tryAcquire(Utils.adjustTimeout(100L),
+                            TimeUnit.MILLISECONDS) ? Invoked.YES : Invoked.NO;
+                    Assert.assertEquals(inv, invoked, "handler not invoked;");
+                } catch (IllegalArgumentException uoe3) {
+                    Assert.assertNotEquals(CanRaise.YES, raise, "raise failed for " + name +
+                            ": " + uoe3.getMessage());
+                }
+            } catch (IllegalArgumentException uoe2) {
+                Assert.assertNotEquals(CanRegister.YES, register, "handle failed for: " + name +
+                        ": " + uoe2.getMessage());
+            }
+        } catch (IllegalArgumentException uoe) {
+            Assert.assertNotEquals(IsSupported.YES, supported, "Support missing for " + name +
+                    ": " + uoe.getMessage());
+            return;
+        } finally {
+            // Restore original signal handler
+            if (orig != null && signal != null) {
+                Signal.handle(signal, orig);
+            }
+        }
+    }
+
+    // Test Signal is equal to itself and not equals to others
+    @Test(dataProvider = "supportedSignals")
+    static void testEquals(String name, IsSupported supported, CanRegister register,
+                           CanRaise raise, Invoked invoked) {
+        Object[][] data = supportedSignals();
+        for (int i = 0; i < data.length; i++) {
+            IsSupported otherSupported = (IsSupported) data[i][1];
+            if (supported == IsSupported.NO || otherSupported == IsSupported.NO) {
+                continue;
+            }
+            String otherName = (String) data[i][0];
+
+            Signal sig1 = new Signal(name);
+            Signal sig2 = new Signal(otherName);
+            if (name.equals(otherName)) {
+                Assert.assertEquals(sig1, sig2, "Equals failed; ");
+                Assert.assertEquals(sig1.hashCode(), sig2.hashCode(), "HashCode wrong; ");
+            } else {
+                Assert.assertNotEquals(sig1, sig2, "NotEquals failed; ");
+                Assert.assertNotEquals(sig1.hashCode(), sig2.hashCode(), "HashCode wrong; ");
+            }
+        }
+    }
+
+    @Test(dataProvider = "invalidSunMiscSignalNames")
+    static void testSunMiscIAE(String name) {
+        try {
+            new Signal(name);
+            Assert.fail("Should have thrown IAE for signal: " + name);
+        } catch (IllegalArgumentException iae) {
+            Assert.assertEquals(iae.getMessage(), "Unknown signal: " + name, "getMessage() incorrect; ");
+        }
+    }
+
+    // Note: JDK 8 did not check/throw NPE, passing null resulted in a segv
+    @Test(expectedExceptions = NullPointerException.class)
+    static void nullSignal() {
+        new Signal(null);
+    }
+
+    // Test expected exception when raising a signal when no handler defined
+    @Test(expectedExceptions = IllegalArgumentException.class)
+    static void testRaiseNoConsumer() {
+        Signal signal = new Signal("INT");
+        SignalHandler orig = null;
+        try {
+            Signal.handle(signal, SignalHandler.SIG_DFL);
+            Signal.raise(signal);
+        }  finally {
+            // Restore original signal handler
+            if (orig != null && signal != null) {
+                Signal.handle(signal, orig);
+            }
+        }
+    }
+
+    /**
+     * The thread that runs the handler for sun.misc.Signal should be a
+     * Daemon thread.
+     */
+    @Test
+    static void isDaemonThread() throws InterruptedException {
+        if (RUNNING_WITH_Xrs) {
+            return;
+        }
+        Handler handler = new Handler();
+        Signal signal = new Signal("INT");
+        Signal.handle(signal, handler);
+        Signal.raise(signal);
+        boolean handled = handler.semaphore()
+                .tryAcquire(Utils.adjustTimeout(100L), TimeUnit.MILLISECONDS);
+        Assert.assertEquals(handled, !RUNNING_WITH_Xrs,
+                "raising s.m.Signal did not get a callback;");
+
+        Assert.assertTrue(handler.wasDaemon(), "Thread.isDaemon running the handler; ");
+    }
+
+    // Check that trying to invoke SIG_DFL.handle throws UnsupportedOperationException.
+    @Test(expectedExceptions = UnsupportedOperationException.class)
+    static void cannotHandleSIGDFL() {
+        Signal signal = new Signal("INT");
+        Assert.assertNotNull(SignalHandler.SIG_DFL, "SIG_DFL null; ");
+        SignalHandler.SIG_DFL.handle(signal);
+    }
+
+    // Check that trying to invoke SIG_IGN.handle throws UnsupportedOperationException.
+    @Test(expectedExceptions = UnsupportedOperationException.class)
+    static void cannotHandleSIGIGN() {
+        Signal signal = new Signal("INT");
+        Assert.assertNotNull(SignalHandler.SIG_IGN, "SIG_IGN null; ");
+        SignalHandler.SIG_IGN.handle(signal);
+    }
+
+    // Check that setting a Signal handler returns the previous handler.
+    @Test()
+    static void checkLastHandler() {
+        if (RUNNING_WITH_Xrs) {
+            return;
+        }
+        Signal signal = new Signal("TERM");
+        Handler h1 = new Handler();
+        Handler h2 = new Handler();
+        SignalHandler orig = Signal.handle(signal, h1);
+
+        try {
+            SignalHandler prev = Signal.handle(signal, h2);
+            Assert.assertSame(prev, h1, "prev handler mismatch");
+
+            prev = Signal.handle(signal, h1);
+            Assert.assertSame(prev, h2, "prev handler mismatch");
+        } finally {
+            if (orig != null && signal != null) {
+                Signal.handle(signal, orig);
+            }
+        }
+    }
+
+    /**
+     * Test Handler, a SignalHandler for Signal notifications.
+     * Signals a semaphore when invoked and records whether
+     * the thread calling the Handler was a daemon.
+     */
+    static class Handler implements SignalHandler {
+        // A semaphore to check for accept being called
+        Semaphore sema = new Semaphore(0);
+
+        Boolean wasDaemon = null;
+
+        Semaphore semaphore() {
+            return sema;
+        }
+
+        synchronized Boolean wasDaemon() {
+            return wasDaemon;
+        }
+
+        /**
+         * Releases the semaphore when called as SignalHandler.handle.
+         *
+         * @param signal the Signal that occurred
+         */
+        @Override
+        public void handle(Signal signal) {
+            synchronized (this) {
+                wasDaemon = Thread.currentThread().isDaemon();
+            }
+            sema.release();
+            printf("sun.misc.handle sig: %s, num: %d%n", signal.getName(), signal.getNumber());
+        }
+
+        public String toString() {
+            return "Handler: sem: " + sema.getQueueLength() +
+                    ", wasDaemon: " + Objects.toString(wasDaemon());
+        }
+    }
+
+    // Main can be used to run the tests from the command line with only testng.jar.
+    @SuppressWarnings("raw_types")
+    @Test(enabled = false)
+    public static void main(String[] args) {
+        Class<?>[] testclass = {SunMiscSignalTest.class};
+        TestNG testng = new TestNG();
+        testng.setTestClasses(testclass);
+        testng.run();
+    }
+
+}
--- a/jdk/test/sun/nio/cs/FindDecoderBugs.java	Thu Feb 18 11:30:16 2016 -0800
+++ b/jdk/test/sun/nio/cs/FindDecoderBugs.java	Thu Feb 18 13:41:11 2016 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2008, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2008, 2016, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -29,7 +29,7 @@
  * @build jdk.testlibrary.*
  * @run main/timeout=1800 FindDecoderBugs
  * @author Martin Buchholz
- * @key intermittent randomness
+ * @key randomness
  */
 
 import java.util.*;
--- a/jdk/test/sun/nio/cs/FindEncoderBugs.java	Thu Feb 18 11:30:16 2016 -0800
+++ b/jdk/test/sun/nio/cs/FindEncoderBugs.java	Thu Feb 18 13:41:11 2016 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2008, 2016, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -29,7 +29,7 @@
  * @build jdk.testlibrary.*
  * @run main/timeout=1200 FindEncoderBugs
  * @author Martin Buchholz
- * @key randomness intermittent
+ * @key randomness
  */
 
 import java.util.*;
--- a/jdk/test/sun/security/mscapi/ShortRSAKey1024.sh	Thu Feb 18 11:30:16 2016 -0800
+++ b/jdk/test/sun/security/mscapi/ShortRSAKey1024.sh	Thu Feb 18 13:41:11 2016 -0800
@@ -1,7 +1,7 @@
 #!/bin/sh
 
 #
-# Copyright (c) 2012, 2015, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2012, 2016, 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
@@ -31,7 +31,6 @@
 # @run shell ShortRSAKey1024.sh 1024
 # @run shell ShortRSAKey1024.sh 768
 # @run shell ShortRSAKey1024.sh 512
-# @key intermittent
 
 # set a few environment variables so that the shell-script can run stand-alone
 # in the source directory
--- a/jdk/test/sun/security/mscapi/SignUsingSHA2withRSA.sh	Thu Feb 18 11:30:16 2016 -0800
+++ b/jdk/test/sun/security/mscapi/SignUsingSHA2withRSA.sh	Thu Feb 18 13:41:11 2016 -0800
@@ -1,7 +1,7 @@
 #!/bin/sh
 
 #
-# Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -29,7 +29,6 @@
 # @requires os.family == "windows"
 # @run shell SignUsingSHA2withRSA.sh
 # @summary Support SHA256 (and higher) in SunMSCAPI
-# @key intermittent
 
 # set a few environment variables so that the shell-script can run stand-alone
 # in the source directory
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/sun/security/pkcs12/P12SecretKey.java	Thu Feb 18 13:41:11 2016 -0800
@@ -0,0 +1,87 @@
+/*
+ * Copyright (c) 2016, 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 8149411
+ * @summary Get AES key from keystore (uses SecretKeySpec not SecretKeyFactory)
+ */
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileOutputStream;
+import java.security.KeyStore;
+import java.security.cert.CertificateException;
+import java.util.Arrays;
+
+import javax.crypto.KeyGenerator;
+import javax.crypto.SecretKey;
+
+public class P12SecretKey {
+
+    private static final String ALIAS = "alias";
+
+    public static void main(String[] args) throws Exception {
+        P12SecretKey testp12 = new P12SecretKey();
+        String keystoreType = "pkcs12";
+        if (args != null && args.length > 0) {
+            keystoreType = args[0];
+        }
+        testp12.run(keystoreType);
+    }
+
+    private void run(String keystoreType) throws Exception {
+        char[] pw = "password".toCharArray();
+        KeyStore ks = KeyStore.getInstance(keystoreType);
+        ks.load(null, pw);
+
+        KeyGenerator kg = KeyGenerator.getInstance("AES");
+        kg.init(128);
+        SecretKey key = kg.generateKey();
+
+        KeyStore.SecretKeyEntry ske = new KeyStore.SecretKeyEntry(key);
+        KeyStore.ProtectionParameter kspp = new KeyStore.PasswordProtection(pw);
+        ks.setEntry(ALIAS, ske, kspp);
+
+        File ksFile = File.createTempFile("test", ".test");
+        try (FileOutputStream fos = new FileOutputStream(ksFile)) {
+            ks.store(fos, pw);
+            fos.flush();
+        }
+
+        // now see if we can get it back
+        try (FileInputStream fis = new FileInputStream(ksFile)) {
+            KeyStore ks2 = KeyStore.getInstance(keystoreType);
+            ks2.load(fis, pw);
+            KeyStore.Entry entry = ks2.getEntry(ALIAS, kspp);
+            SecretKey keyIn = ((KeyStore.SecretKeyEntry)entry).getSecretKey();
+            if (Arrays.equals(key.getEncoded(), keyIn.getEncoded())) {
+                System.err.println("OK: worked just fine with " + keystoreType +
+                                   " keystore");
+            } else {
+                System.err.println("ERROR: keys are NOT equal after storing in "
+                                   + keystoreType + " keystore");
+            }
+        }
+    }
+}
--- a/jdk/test/sun/tools/jcmd/usage.out	Thu Feb 18 11:30:16 2016 -0800
+++ b/jdk/test/sun/tools/jcmd/usage.out	Thu Feb 18 13:41:11 2016 -0800
@@ -7,7 +7,7 @@
   If the pid is 0, commands will be sent to all Java processes.   
   The main class argument will be used to match (either partially 
   or fully) the class used to start Java.                         
-  If no options are given, lists Java processes (same as -p).     
+  If no options are given, lists Java processes (same as -l).     
                                                                   
   PerfCounter.print display the counters exposed by this process  
   -f  read and execute commands from the file