Merge
authordsamersoff
Mon, 17 Aug 2015 12:45:16 +0300
changeset 32416 702b81d3cd39
parent 32415 24c214d2ccba (current diff)
parent 32224 dae855d05f6c (diff)
child 32417 6859107fc6c3
Merge
hotspot/agent/src/share/classes/sun/jvm/hotspot/gc/g1/G1Allocator.java
jaxp/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/Version.java
jaxp/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xslt/Process.java
jaxp/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/impl/Version.java
jaxp/test/javax/xml/jaxp/internaltest/javax/xml/common/bug6979306/Bug6979306Test.java
--- a/.hgtags	Thu Apr 09 12:29:31 2015 +0200
+++ b/.hgtags	Mon Aug 17 12:45:16 2015 +0300
@@ -318,3 +318,4 @@
 9b3a9d72f07b40c648de79961679f42283af1bb5 jdk9-b73
 7c577fda1855d03c04546694d514678f596508c9 jdk9-b74
 f55df5cfe11c97e4b58998b76f5bd00a73cde12d jdk9-b75
+eeea9adfd1e3d075ef82148c00a4847a1aab4d26 jdk9-b76
--- a/.hgtags-top-repo	Thu Apr 09 12:29:31 2015 +0200
+++ b/.hgtags-top-repo	Mon Aug 17 12:45:16 2015 +0300
@@ -318,3 +318,4 @@
 4c2cbaae528bce970dabbb5676005d379357f4b6 jdk9-b73
 57f3134853ecdd4a3ee2d4d26f22ba981d653d79 jdk9-b74
 8fd6eeb878606e39c908f12535f34ebbfd225a4a jdk9-b75
+d82072b699b880a1f647a5e2d7c0f86cec958941 jdk9-b76
--- a/corba/.hgtags	Thu Apr 09 12:29:31 2015 +0200
+++ b/corba/.hgtags	Mon Aug 17 12:45:16 2015 +0300
@@ -318,3 +318,4 @@
 29096b78d93b01a2f8882509cd40755e3d6b8cd9 jdk9-b73
 622fe934e351e89107edf3c667d6b57f543f58f1 jdk9-b74
 960b56805abd8460598897481820bd6a75f979e7 jdk9-b75
+d8126bc88fa5cd1ae4e44d86a4b1280ca1c9e2aa jdk9-b76
--- a/hotspot/.hgtags	Thu Apr 09 12:29:31 2015 +0200
+++ b/hotspot/.hgtags	Mon Aug 17 12:45:16 2015 +0300
@@ -478,3 +478,4 @@
 e37d432868be0aa7cb5e0f3d7caff1e825d8ead3 jdk9-b73
 fff6b54e9770ac4c12c2fb4cab5aa7672affa4bd jdk9-b74
 2f354281e9915275693c4e519a959b8a6f22d3a3 jdk9-b75
+0bc8d1656d6f2b1fdfe803c1305a108bb9939f35 jdk9-b76
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/SAGetopt.java	Mon Aug 17 12:45:16 2015 +0300
@@ -0,0 +1,162 @@
+/*
+ * Copyright (c) 2015, 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.
+ *
+ */
+
+package sun.jvm.hotspot;
+
+import java.util.Arrays;
+import java.util.List;
+
+public class SAGetopt {
+
+    private String[] _argv;
+
+    private int _optind;    // index in arguments array
+    private int _optopt;    // index within an argument
+    private String _optarg; // last option argument
+    private boolean _optreset; // special handling of first call
+
+    public SAGetopt(String[] args) {
+        _argv  = args;
+        _optind   = 0;
+        _optopt   = 1;
+        _optarg   = null;
+        _optreset = true;
+    }
+
+    public String getOptarg() {
+        return _optarg;
+    }
+
+    public int getOptind() {
+        return _optind;
+    }
+
+    private void extractOptarg(String opt) {
+        // Argument expected
+        if (_optind > _argv.length) {
+            throw new RuntimeException("Not enough arguments for '" + opt + "'");
+        }
+
+        if (! _argv[_optind].isEmpty() && _argv[_optind].charAt(0) == '-') {
+            throw new RuntimeException("Argument is expected for '" + opt + "'");
+        }
+
+        _optarg = _argv[_optind];
+        _optind += 1;
+    }
+
+    private String processLongOptions(String carg, String[] longOptStr) {
+        List<String> los = Arrays.asList(longOptStr);
+        String[] ca = carg.split("=", 2);
+
+        if (los.contains(ca[0])) {
+            if (ca.length > 1) {
+                throw new RuntimeException("Argument is not expected for '" + ca[0] + "'");
+            }
+            return carg;
+        }
+
+        if (los.contains(ca[0] + "=")) {
+            if (ca.length > 1) {
+                // GNU style options --file=name
+                _optarg = ca[1];
+            }
+            else {
+                // Mixed style options --file name
+                extractOptarg(ca[0]);
+            }
+
+            return ca[0];
+        }
+
+        throw new RuntimeException("Invalid option '" + ca[0] + "'");
+    }
+
+    public String next(String optStr, String[] longOptStr) {
+
+        if (_optind >= _argv.length || _argv[_optind] == null) {
+            // All arguments processed
+            return null;
+        }
+
+        String carg = _argv[_optind];
+        _optarg = null;
+
+        if (_optreset) {
+            // End of option batch like '-abc' reached, expect option to start from '-'
+
+            if (carg.isEmpty() || carg.charAt(0) != '-' || carg.equals("--")) {
+                // Stop processing on -- or first non-option argument;
+                return null;
+            }
+
+            if (carg.startsWith("--")) {
+                // Handle long options, it can't be combined so it's simple
+                if (longOptStr == null || longOptStr.length == 0) {
+                    // No long options expected, stop options processing
+                    return null;
+                }
+                ++ _optind;
+
+                // at this point carg contains at least one character besides --
+                carg = carg.substring(2);
+                return processLongOptions(carg, longOptStr);
+            }
+
+            if (optStr == null || optStr.length() == 0) {
+                // No short options
+                return null;
+            }
+
+            // At this point carg[0] contains '-'
+            _optreset = false;
+            _optopt = 1;
+        }
+
+        char ch = carg.charAt(_optopt);
+
+        // adjust pointer to next character
+        _optopt += 1;
+
+        // Okay, ready to process options like
+        // -abc -d bla -ef
+
+        int chIndex = optStr.indexOf(ch);
+        if (chIndex == -1) {
+            throw new RuntimeException("Invalid option '" + ch + "'");
+        }
+
+        if (_optopt >= carg.length()) {
+            _optind += 1;
+            _optreset = true;
+        }
+
+        if (chIndex < optStr.length()-1 && optStr.charAt(chIndex+1) == ':') {
+            // Argument expected
+            extractOptarg(String.valueOf(ch));
+        }
+
+        return String.valueOf(ch);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/SALauncher.java	Mon Aug 17 12:45:16 2015 +0300
@@ -0,0 +1,359 @@
+/*
+ * Copyright (c) 2015, 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.
+ *
+ */
+
+package sun.jvm.hotspot;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+
+import sun.jvm.hotspot.tools.JStack;
+import sun.jvm.hotspot.tools.JMap;
+import sun.jvm.hotspot.tools.JInfo;
+
+public class SALauncher {
+
+    private static boolean launcherHelp() {
+        System.out.println("    clhsdb       \tcommand line debugger");
+        System.out.println("    hsdb         \tui debugger");
+        System.out.println("    jstack --help\tto get more information");
+        System.out.println("    jmap   --help\tto get more information");
+        System.out.println("    jinfo  --help\tto get more information");
+        return false;
+    }
+
+    private static boolean commonHelp() {
+        // --pid <pid>
+        // --exe <exe>
+        // --core <core>
+        System.out.println("    --exe\texecutable image name");
+        System.out.println("    --core\tpath to coredump");
+        System.out.println("    --pid\tpid of process to attach");
+        return false;
+    }
+
+    private static boolean jinfoHelp() {
+        // --flags -> -flags
+        // --sysprops -> -sysprops
+        System.out.println("    --flags\tto print VM flags");
+        System.out.println("    --sysprops\tto print Java System properties");
+        System.out.println("    <no option>\tto print both of the above");
+        return commonHelp();
+    }
+
+    private static boolean jmapHelp() {
+        // --heap -> -heap
+        // --binaryheap -> -heap:format=b
+        // --histo -> -histo
+        // --clstats -> -clstats
+        // --finalizerinfo -> -finalizerinfo
+
+        System.out.println("    <no option>\tto print same info as Solaris pmap");
+        System.out.println("    --heap\tto print java heap summary");
+        System.out.println("    --binaryheap\tto dump java heap in hprof binary format");
+        System.out.println("    --histo\tto print histogram of java object heap");
+        System.out.println("    --clstats\tto print class loader statistics");
+        System.out.println("    --finalizerinfo\tto print information on objects awaiting finalization");
+        return commonHelp();
+    }
+
+    private static boolean jstackHelp() {
+        // --locks -> -l
+        // --mixed -> -m
+        System.out.println("    --locks\tto print java.util.concurrent locks");
+        System.out.println("    --mixed\tto print both java and native frames (mixed mode)");
+        return commonHelp();
+    }
+
+    private static boolean toolHelp(String toolName) {
+        if (toolName.equals("jstack")) {
+            return jstackHelp();
+        }
+        if (toolName.equals("jinfo")) {
+            return jinfoHelp();
+        }
+        if (toolName.equals("jmap")) {
+            return jmapHelp();
+        }
+        if (toolName.equals("hsdb") || toolName.equals("clhsdb")) {
+            return commonHelp();
+        }
+        return launcherHelp();
+    }
+
+    private static void runCLHSDB(String[] oldArgs) {
+        SAGetopt sg = new SAGetopt(oldArgs);
+        String[] longOpts = {"exe=", "core=", "pid="};
+
+        ArrayList<String> newArgs = new ArrayList();
+        String exeORpid = null;
+        String core = null;
+        String s = null;
+
+        while((s = sg.next(null, longOpts)) != null) {
+            if (s.equals("exe")) {
+                exeORpid = sg.getOptarg();
+                continue;
+            }
+            if (s.equals("core")) {
+                core = sg.getOptarg();
+                continue;
+            }
+            if (s.equals("pid")) {
+                exeORpid = sg.getOptarg();
+                continue;
+            }
+        }
+
+        if (exeORpid != null) {
+            newArgs.add(exeORpid);
+            if (core != null) {
+                newArgs.add(core);
+            }
+        }
+        CLHSDB.main(newArgs.toArray(new String[newArgs.size()]));
+    }
+
+    private static void runHSDB(String[] oldArgs) {
+        SAGetopt sg = new SAGetopt(oldArgs);
+        String[] longOpts = {"exe=", "core=", "pid="};
+
+        ArrayList<String> newArgs = new ArrayList();
+        String exeORpid = null;
+        String core = null;
+        String s = null;
+
+        while((s = sg.next(null, longOpts)) != null) {
+            if (s.equals("exe")) {
+                exeORpid = sg.getOptarg();
+                continue;
+            }
+            if (s.equals("core")) {
+                core = sg.getOptarg();
+                continue;
+            }
+            if (s.equals("pid")) {
+                exeORpid = sg.getOptarg();
+                continue;
+            }
+        }
+
+        if (exeORpid != null) {
+            newArgs.add(exeORpid);
+            if (core != null) {
+                newArgs.add(core);
+            }
+        }
+        HSDB.main(newArgs.toArray(new String[newArgs.size()]));
+    }
+
+    private static void runJSTACK(String[] oldArgs) {
+        SAGetopt sg = new SAGetopt(oldArgs);
+        String[] longOpts = {"exe=", "core=", "pid=",
+                                 "mixed", "locks"};
+
+        ArrayList<String> newArgs = new ArrayList();
+        String exeORpid = null;
+        String core = null;
+        String s = null;
+
+        while((s = sg.next(null, longOpts)) != null) {
+            if (s.equals("exe")) {
+                exeORpid = sg.getOptarg();
+                continue;
+            }
+            if (s.equals("core")) {
+                core = sg.getOptarg();
+                continue;
+            }
+            if (s.equals("pid")) {
+                exeORpid = sg.getOptarg();
+                continue;
+            }
+            if (s.equals("mixed")) {
+                newArgs.add("-m");
+                continue;
+            }
+            if (s.equals("locks")) {
+                newArgs.add("-l");
+                continue;
+            }
+        }
+
+        if (exeORpid != null) {
+            newArgs.add(exeORpid);
+            if (core != null) {
+                newArgs.add(core);
+            }
+        }
+
+        JStack.main(newArgs.toArray(new String[newArgs.size()]));
+    }
+
+    private static void runJMAP(String[] oldArgs) {
+        SAGetopt sg = new SAGetopt(oldArgs);
+        String[] longOpts = {"exe=", "core=", "pid=",
+              "heap", "binaryheap", "histo", "clstats", "finalizerinfo"};
+
+        ArrayList<String> newArgs = new ArrayList();
+        String exeORpid = null;
+        String core = null;
+        String s = null;
+
+        while((s = sg.next(null, longOpts)) != null) {
+            if (s.equals("exe")) {
+                exeORpid = sg.getOptarg();
+                continue;
+            }
+            if (s.equals("core")) {
+                core = sg.getOptarg();
+                continue;
+            }
+            if (s.equals("pid")) {
+                exeORpid = sg.getOptarg();
+                continue;
+            }
+            if (s.equals("heap")) {
+                newArgs.add("-heap");
+                continue;
+            }
+            if (s.equals("binaryheap")) {
+                newArgs.add("-heap:format=b");
+                continue;
+            }
+            if (s.equals("histo")) {
+                newArgs.add("-histo");
+                continue;
+            }
+            if (s.equals("clstats")) {
+                newArgs.add("-clstats");
+                continue;
+            }
+            if (s.equals("finalizerinfo")) {
+                newArgs.add("-finalizerinfo");
+                continue;
+            }
+        }
+
+        if (exeORpid != null) {
+            newArgs.add(exeORpid);
+            if (core != null) {
+                newArgs.add(core);
+            }
+        }
+
+        JMap.main(newArgs.toArray(new String[newArgs.size()]));
+    }
+
+    private static void runJINFO(String[] oldArgs) {
+        SAGetopt sg = new SAGetopt(oldArgs);
+        String[] longOpts = {"exe=", "core=", "pid=",
+                                     "flags", "sysprops"};
+
+        ArrayList<String> newArgs = new ArrayList();
+        String exeORpid = null;
+        String core = null;
+        String s = null;
+
+        while((s = sg.next(null, longOpts)) != null) {
+            if (s.equals("exe")) {
+                exeORpid = sg.getOptarg();
+                continue;
+            }
+            if (s.equals("core")) {
+                core = sg.getOptarg();
+                continue;
+            }
+            if (s.equals("pid")) {
+                exeORpid = sg.getOptarg();
+                continue;
+            }
+            if (s.equals("flags")) {
+                newArgs.add("-flags");
+                continue;
+            }
+            if (s.equals("sysprops")) {
+                newArgs.add("-sysprops");
+                continue;
+            }
+        }
+
+        if (exeORpid != null) {
+            newArgs.add(exeORpid);
+            if (core != null) {
+                newArgs.add(core);
+            }
+        }
+
+        JInfo.main(newArgs.toArray(new String[newArgs.size()]));
+    }
+
+    public static void main(String[] args) {
+        // Provide a help
+        if (args.length == 0) {
+            launcherHelp();
+            return;
+        }
+        // No arguments imply help for jstack, jmap, jinfo but launch clhsdb and hsdb
+        if (args.length == 1 && !args[0].equals("clhsdb") && !args[0].equals("hsdb")) {
+            toolHelp(args[0]);
+            return;
+        }
+
+        for (String arg : args) {
+            if (arg.equals("-h") || arg.equals("-help") || arg.equals("--help")) {
+                toolHelp(args[0]);
+                return;
+            }
+        }
+
+        String[] oldArgs = Arrays.copyOfRange(args, 1, args.length);
+
+        // Run SA interactive mode
+        if (args[0].equals("clhsdb")) {
+            runCLHSDB(oldArgs);
+            return;
+        }
+
+        if (args[0].equals("hsdb")) {
+            runHSDB(oldArgs);
+            return;
+        }
+
+        // Run SA tmtools mode
+        if (args[0].equals("jstack")) {
+            runJSTACK(oldArgs);
+            return;
+        }
+
+        if (args[0].equals("jmap")) {
+            runJMAP(oldArgs);
+            return;
+        }
+
+        if (args[0].equals("jinfo")) {
+            runJINFO(oldArgs);
+            return;
+        }
+    }
+}
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/aarch64/AARCH64ThreadContext.java	Thu Apr 09 12:29:31 2015 +0200
+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/aarch64/AARCH64ThreadContext.java	Mon Aug 17 12:45:16 2015 +0300
@@ -37,6 +37,21 @@
 public abstract class AARCH64ThreadContext implements ThreadContext {
     // Taken from /usr/include/asm/sigcontext.h on Linux/AARCH64.
 
+    //  /*
+    //   * Signal context structure - contains all info to do with the state
+    //   * before the signal handler was invoked.
+    //   */
+    // struct sigcontext {
+    //         __u64 fault_address;
+    //         /* AArch64 registers */
+    //          __u64 regs[31];
+    //          __u64 sp;
+    //          __u64 pc;
+    //          __u64 pstate;
+    //          /* 4K reserved for FP/SIMD state and future expansion */
+    //          __u8 __reserved[4096] __attribute__((__aligned__(16)));
+    //  };
+
     // NOTE: the indices for the various registers must be maintained as
     // listed across various operating systems. However, only a small
     // subset of the registers' values are guaranteed to be present (and
@@ -78,8 +93,9 @@
     public static final int LR = 30;
     public static final int SP = 31;
     public static final int PC = 32;
+    public static final int PSTATE = 33;
 
-    public static final int NPRGREG = 33;
+    public static final int NPRGREG = 34;
 
     private long[] data;
 
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/gc/g1/G1Allocator.java	Thu Apr 09 12:29:31 2015 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,40 +0,0 @@
-package sun.jvm.hotspot.gc.g1;
-
-import java.util.Observable;
-import java.util.Observer;
-
-import sun.jvm.hotspot.debugger.Address;
-import sun.jvm.hotspot.runtime.VM;
-import sun.jvm.hotspot.runtime.VMObject;
-import sun.jvm.hotspot.types.CIntegerField;
-import sun.jvm.hotspot.types.Type;
-import sun.jvm.hotspot.types.TypeDataBase;
-
-public class G1Allocator extends VMObject {
-
-  //size_t _summary_bytes_used;
-  static private CIntegerField summaryBytesUsedField;
-
-  static {
-    VM.registerVMInitializedObserver(new Observer() {
-      public void update(Observable o, Object data) {
-        initialize(VM.getVM().getTypeDataBase());
-      }
-    });
-  }
-
-  static private synchronized void initialize(TypeDataBase db) {
-    Type type = db.lookupType("G1Allocator");
-
-    summaryBytesUsedField = type.getCIntegerField("_summary_bytes_used");
-  }
-
-  public long getSummaryBytes() {
-    return summaryBytesUsedField.getValue(addr);
-  }
-
-  public G1Allocator(Address addr) {
-    super(addr);
-
-  }
-}
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/gc/g1/G1CollectedHeap.java	Thu Apr 09 12:29:31 2015 +0200
+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/gc/g1/G1CollectedHeap.java	Mon Aug 17 12:45:16 2015 +0300
@@ -36,6 +36,7 @@
 import sun.jvm.hotspot.runtime.VM;
 import sun.jvm.hotspot.runtime.VMObjectFactory;
 import sun.jvm.hotspot.types.AddressField;
+import sun.jvm.hotspot.types.CIntegerField;
 import sun.jvm.hotspot.types.Type;
 import sun.jvm.hotspot.types.TypeDataBase;
 
@@ -46,8 +47,8 @@
     static private long hrmFieldOffset;
     // MemRegion _g1_reserved;
     static private long g1ReservedFieldOffset;
-    // G1Allocator* _allocator
-    static private AddressField g1Allocator;
+    // size_t _summary_bytes_used;
+    static private CIntegerField summaryBytesUsedField;
     // G1MonitoringSupport* _g1mm;
     static private AddressField g1mmField;
     // HeapRegionSet _old_set;
@@ -67,7 +68,7 @@
         Type type = db.lookupType("G1CollectedHeap");
 
         hrmFieldOffset = type.getField("_hrm").getOffset();
-        g1Allocator = type.getAddressField("_allocator");
+        summaryBytesUsedField = type.getCIntegerField("_summary_bytes_used");
         g1mmField = type.getAddressField("_g1mm");
         oldSetFieldOffset = type.getField("_old_set").getOffset();
         humongousSetFieldOffset = type.getField("_humongous_set").getOffset();
@@ -78,7 +79,7 @@
     }
 
     public long used() {
-        return allocator().getSummaryBytes();
+        return summaryBytesUsedField.getValue(addr);
     }
 
     public long n_regions() {
@@ -96,11 +97,6 @@
         return (G1MonitoringSupport) VMObjectFactory.newObject(G1MonitoringSupport.class, g1mmAddr);
     }
 
-    public G1Allocator allocator() {
-        Address g1AllocatorAddr = g1Allocator.getValue(addr);
-        return (G1Allocator) VMObjectFactory.newObject(G1Allocator.class, g1AllocatorAddr);
-    }
-
     public HeapRegionSetBase oldSet() {
         Address oldSetAddr = addr.addOffsetTo(oldSetFieldOffset);
         return (HeapRegionSetBase) VMObjectFactory.newObject(HeapRegionSetBase.class,
--- a/hotspot/src/cpu/aarch64/vm/aarch64.ad	Thu Apr 09 12:29:31 2015 +0200
+++ b/hotspot/src/cpu/aarch64/vm/aarch64.ad	Mon Aug 17 12:45:16 2015 +0300
@@ -2167,8 +2167,12 @@
     return 0;            // Self copy, no move.
   }
 
+  bool is64 = (src_lo & 1) == 0 && src_lo + 1 == src_hi &&
+              (dst_lo & 1) == 0 && dst_lo + 1 == dst_hi;
+  int src_offset = ra_->reg2offset(src_lo);
+  int dst_offset = ra_->reg2offset(dst_lo);
+
   if (bottom_type()->isa_vect() != NULL) {
-    uint len = 4;
     uint ireg = ideal_reg();
     assert(ireg == Op_VecD || ireg == Op_VecX, "must be 64 bit or 128 bit vector");
     if (cbuf) {
@@ -2176,334 +2180,115 @@
       assert((src_lo_rc != rc_int && dst_lo_rc != rc_int), "sanity");
       if (src_lo_rc == rc_stack && dst_lo_rc == rc_stack) {
         // stack->stack
-        int src_offset = ra_->reg2offset(src_lo);
-        int dst_offset = ra_->reg2offset(dst_lo);
         assert((src_offset & 7) && (dst_offset & 7), "unaligned stack offset");
-        len = 8;
         if (ireg == Op_VecD) {
-          __ ldr(rscratch1, Address(sp, src_offset));
-          __ str(rscratch1, Address(sp, dst_offset));
+          __ unspill(rscratch1, true, src_offset);
+          __ spill(rscratch1, true, dst_offset);
         } else {
-          if (src_offset < 512) {
-            __ ldp(rscratch1, rscratch2, Address(sp, src_offset));
-          } else {
-            __ ldr(rscratch1, Address(sp, src_offset));
-            __ ldr(rscratch2, Address(sp, src_offset+4));
-            len += 4;
-          }
-          if (dst_offset < 512) {
-            __ stp(rscratch1, rscratch2, Address(sp, dst_offset));
-          } else {
-            __ str(rscratch1, Address(sp, dst_offset));
-            __ str(rscratch2, Address(sp, dst_offset+4));
-            len += 4;
-          }
+          __ spill_copy128(src_offset, dst_offset);
         }
       } else if (src_lo_rc == rc_float && dst_lo_rc == rc_float) {
-        __ orr(as_FloatRegister(Matcher::_regEncode[dst_lo]),
+        __ mov(as_FloatRegister(Matcher::_regEncode[dst_lo]),
                ireg == Op_VecD ? __ T8B : __ T16B,
-               as_FloatRegister(Matcher::_regEncode[src_lo]),
                as_FloatRegister(Matcher::_regEncode[src_lo]));
       } else if (src_lo_rc == rc_float && dst_lo_rc == rc_stack) {
-        __ str(as_FloatRegister(Matcher::_regEncode[src_lo]),
-               ireg == Op_VecD ? __ D : __ Q,
-               Address(sp, ra_->reg2offset(dst_lo)));
+        __ spill(as_FloatRegister(Matcher::_regEncode[src_lo]),
+                       ireg == Op_VecD ? __ D : __ Q,
+                       ra_->reg2offset(dst_lo));
       } else if (src_lo_rc == rc_stack && dst_lo_rc == rc_float) {
-        __ ldr(as_FloatRegister(Matcher::_regEncode[dst_lo]),
-               ireg == Op_VecD ? __ D : __ Q,
-               Address(sp, ra_->reg2offset(src_lo)));
+        __ unspill(as_FloatRegister(Matcher::_regEncode[dst_lo]),
+                       ireg == Op_VecD ? __ D : __ Q,
+                       ra_->reg2offset(src_lo));
       } else {
         ShouldNotReachHere();
       }
-    } else if (st) {
-      if (src_lo_rc == rc_stack && dst_lo_rc == rc_stack) {
-        // stack->stack
-        int src_offset = ra_->reg2offset(src_lo);
-        int dst_offset = ra_->reg2offset(dst_lo);
-        if (ireg == Op_VecD) {
-          st->print("ldr  rscratch1, [sp, #%d]", src_offset);
-          st->print("str  rscratch1, [sp, #%d]", dst_offset);
+    }
+  } else if (cbuf) {
+    MacroAssembler _masm(cbuf);
+    switch (src_lo_rc) {
+    case rc_int:
+      if (dst_lo_rc == rc_int) {  // gpr --> gpr copy
+        if (is64) {
+            __ mov(as_Register(Matcher::_regEncode[dst_lo]),
+                   as_Register(Matcher::_regEncode[src_lo]));
         } else {
-          if (src_offset < 512) {
-            st->print("ldp  rscratch1, rscratch2, [sp, #%d]", src_offset);
-          } else {
-            st->print("ldr  rscratch1, [sp, #%d]", src_offset);
-            st->print("\nldr  rscratch2, [sp, #%d]", src_offset+4);
-          }
-          if (dst_offset < 512) {
-            st->print("\nstp  rscratch1, rscratch2, [sp, #%d]", dst_offset);
-          } else {
-            st->print("\nstr  rscratch1, [sp, #%d]", dst_offset);
-            st->print("\nstr  rscratch2, [sp, #%d]", dst_offset+4);
-          }
-        }
-        st->print("\t# vector spill, stack to stack");
-      } else if (src_lo_rc == rc_float && dst_lo_rc == rc_float) {
-        st->print("mov  %s, %s\t# vector spill, reg to reg",
-                   Matcher::regName[dst_lo], Matcher::regName[src_lo]);
-      } else if (src_lo_rc == rc_float && dst_lo_rc == rc_stack) {
-        st->print("str  %s, [sp, #%d]\t# vector spill, reg to stack",
-                   Matcher::regName[src_lo], ra_->reg2offset(dst_lo));
-      } else if (src_lo_rc == rc_stack && dst_lo_rc == rc_float) {
-        st->print("ldr  %s, [sp, #%d]\t# vector spill, stack to reg",
-                   Matcher::regName[dst_lo], ra_->reg2offset(src_lo));
-      }
-    }
-    return len;
-  }
-
-  switch (src_lo_rc) {
-  case rc_int:
-    if (dst_lo_rc == rc_int) {  // gpr --> gpr copy
-      if (((src_lo & 1) == 0 && src_lo + 1 == src_hi) &&
-          (dst_lo & 1) == 0 && dst_lo + 1 == dst_hi) {
-          // 64 bit
-        if (cbuf) {
-          MacroAssembler _masm(cbuf);
-          __ mov(as_Register(Matcher::_regEncode[dst_lo]),
-                 as_Register(Matcher::_regEncode[src_lo]));
-        } else if (st) {
-          st->print("mov  %s, %s\t# shuffle",
-                    Matcher::regName[dst_lo],
-                    Matcher::regName[src_lo]);
-        }
-      } else {
-        // 32 bit
-        if (cbuf) {
-          MacroAssembler _masm(cbuf);
-          __ movw(as_Register(Matcher::_regEncode[dst_lo]),
-                  as_Register(Matcher::_regEncode[src_lo]));
-        } else if (st) {
-          st->print("movw  %s, %s\t# shuffle",
-                    Matcher::regName[dst_lo],
-                    Matcher::regName[src_lo]);
+            MacroAssembler _masm(cbuf);
+            __ movw(as_Register(Matcher::_regEncode[dst_lo]),
+                    as_Register(Matcher::_regEncode[src_lo]));
         }
-      }
-    } else if (dst_lo_rc == rc_float) { // gpr --> fpr copy
-      if (((src_lo & 1) == 0 && src_lo + 1 == src_hi) &&
-          (dst_lo & 1) == 0 && dst_lo + 1 == dst_hi) {
-          // 64 bit
-        if (cbuf) {
-          MacroAssembler _masm(cbuf);
-          __ fmovd(as_FloatRegister(Matcher::_regEncode[dst_lo]),
-                   as_Register(Matcher::_regEncode[src_lo]));
-        } else if (st) {
-          st->print("fmovd  %s, %s\t# shuffle",
-                    Matcher::regName[dst_lo],
-                    Matcher::regName[src_lo]);
-        }
-      } else {
-        // 32 bit
-        if (cbuf) {
-          MacroAssembler _masm(cbuf);
-          __ fmovs(as_FloatRegister(Matcher::_regEncode[dst_lo]),
-                   as_Register(Matcher::_regEncode[src_lo]));
-        } else if (st) {
-          st->print("fmovs  %s, %s\t# shuffle",
-                    Matcher::regName[dst_lo],
-                    Matcher::regName[src_lo]);
-        }
-      }
-    } else {                    // gpr --> stack spill
-      assert(dst_lo_rc == rc_stack, "spill to bad register class");
-      int dst_offset = ra_->reg2offset(dst_lo);
-      if (((src_lo & 1) == 0 && src_lo + 1 == src_hi) &&
-          (dst_lo & 1) == 0 && dst_lo + 1 == dst_hi) {
-          // 64 bit
-        if (cbuf) {
-          MacroAssembler _masm(cbuf);
-          __ str(as_Register(Matcher::_regEncode[src_lo]),
-                 Address(sp, dst_offset));
-        } else if (st) {
-          st->print("str  %s, [sp, #%d]\t# spill",
-                    Matcher::regName[src_lo],
-                    dst_offset);
-        }
-      } else {
-        // 32 bit
-        if (cbuf) {
-          MacroAssembler _masm(cbuf);
-          __ strw(as_Register(Matcher::_regEncode[src_lo]),
-                 Address(sp, dst_offset));
-        } else if (st) {
-          st->print("strw  %s, [sp, #%d]\t# spill",
-                    Matcher::regName[src_lo],
-                    dst_offset);
-        }
-      }
-    }
-    return 4;
-  case rc_float:
-    if (dst_lo_rc == rc_int) {  // fpr --> gpr copy
-      if (((src_lo & 1) == 0 && src_lo + 1 == src_hi) &&
-          (dst_lo & 1) == 0 && dst_lo + 1 == dst_hi) {
-          // 64 bit
-        if (cbuf) {
-          MacroAssembler _masm(cbuf);
-          __ fmovd(as_Register(Matcher::_regEncode[dst_lo]),
-                   as_FloatRegister(Matcher::_regEncode[src_lo]));
-        } else if (st) {
-          st->print("fmovd  %s, %s\t# shuffle",
-                    Matcher::regName[dst_lo],
-                    Matcher::regName[src_lo]);
+      } else if (dst_lo_rc == rc_float) { // gpr --> fpr copy
+        if (is64) {
+            __ fmovd(as_FloatRegister(Matcher::_regEncode[dst_lo]),
+                     as_Register(Matcher::_regEncode[src_lo]));
+        } else {
+            __ fmovs(as_FloatRegister(Matcher::_regEncode[dst_lo]),
+                     as_Register(Matcher::_regEncode[src_lo]));
         }
-      } else {
-        // 32 bit
-        if (cbuf) {
-          MacroAssembler _masm(cbuf);
-          __ fmovs(as_Register(Matcher::_regEncode[dst_lo]),
-                   as_FloatRegister(Matcher::_regEncode[src_lo]));
-        } else if (st) {
-          st->print("fmovs  %s, %s\t# shuffle",
-                    Matcher::regName[dst_lo],
-                    Matcher::regName[src_lo]);
-        }
-      }
-    } else if (dst_lo_rc == rc_float) { // fpr --> fpr copy
-      if (((src_lo & 1) == 0 && src_lo + 1 == src_hi) &&
-          (dst_lo & 1) == 0 && dst_lo + 1 == dst_hi) {
-          // 64 bit
-        if (cbuf) {
-          MacroAssembler _masm(cbuf);
-          __ fmovd(as_FloatRegister(Matcher::_regEncode[dst_lo]),
-                   as_FloatRegister(Matcher::_regEncode[src_lo]));
-        } else if (st) {
-          st->print("fmovd  %s, %s\t# shuffle",
-                    Matcher::regName[dst_lo],
-                    Matcher::regName[src_lo]);
-        }
-      } else {
-        // 32 bit
-        if (cbuf) {
-          MacroAssembler _masm(cbuf);
-          __ fmovs(as_FloatRegister(Matcher::_regEncode[dst_lo]),
-                   as_FloatRegister(Matcher::_regEncode[src_lo]));
-        } else if (st) {
-          st->print("fmovs  %s, %s\t# shuffle",
-                    Matcher::regName[dst_lo],
-                    Matcher::regName[src_lo]);
-        }
-      }
-    } else {                    // fpr --> stack spill
-      assert(dst_lo_rc == rc_stack, "spill to bad register class");
-      int dst_offset = ra_->reg2offset(dst_lo);
-      if (((src_lo & 1) == 0 && src_lo + 1 == src_hi) &&
-          (dst_lo & 1) == 0 && dst_lo + 1 == dst_hi) {
-          // 64 bit
-        if (cbuf) {
-          MacroAssembler _masm(cbuf);
-          __ strd(as_FloatRegister(Matcher::_regEncode[src_lo]),
-                 Address(sp, dst_offset));
-        } else if (st) {
-          st->print("strd  %s, [sp, #%d]\t# spill",
-                    Matcher::regName[src_lo],
-                    dst_offset);
-        }
-      } else {
-        // 32 bit
-        if (cbuf) {
-          MacroAssembler _masm(cbuf);
-          __ strs(as_FloatRegister(Matcher::_regEncode[src_lo]),
-                 Address(sp, dst_offset));
-        } else if (st) {
-          st->print("strs  %s, [sp, #%d]\t# spill",
-                    Matcher::regName[src_lo],
-                    dst_offset);
-        }
+      } else {                    // gpr --> stack spill
+        assert(dst_lo_rc == rc_stack, "spill to bad register class");
+        __ spill(as_Register(Matcher::_regEncode[src_lo]), is64, dst_offset);
       }
-    }
-    return 4;
-  case rc_stack:
-    int src_offset = ra_->reg2offset(src_lo);
-    if (dst_lo_rc == rc_int) {  // stack --> gpr load
-      if (((src_lo & 1) == 0 && src_lo + 1 == src_hi) &&
-          (dst_lo & 1) == 0 && dst_lo + 1 == dst_hi) {
-          // 64 bit
-        if (cbuf) {
-          MacroAssembler _masm(cbuf);
-          __ ldr(as_Register(Matcher::_regEncode[dst_lo]),
-                 Address(sp, src_offset));
-        } else if (st) {
-          st->print("ldr  %s, [sp, %d]\t# restore",
-                    Matcher::regName[dst_lo],
-                    src_offset);
+      break;
+    case rc_float:
+      if (dst_lo_rc == rc_int) {  // fpr --> gpr copy
+        if (is64) {
+            __ fmovd(as_Register(Matcher::_regEncode[dst_lo]),
+                     as_FloatRegister(Matcher::_regEncode[src_lo]));
+        } else {
+            __ fmovs(as_Register(Matcher::_regEncode[dst_lo]),
+                     as_FloatRegister(Matcher::_regEncode[src_lo]));
         }
-      } else {
-        // 32 bit
-        if (cbuf) {
-          MacroAssembler _masm(cbuf);
-          __ ldrw(as_Register(Matcher::_regEncode[dst_lo]),
-                  Address(sp, src_offset));
-        } else if (st) {
-          st->print("ldr  %s, [sp, %d]\t# restore",
-                    Matcher::regName[dst_lo],
-                   src_offset);
-        }
-      }
-      return 4;
-    } else if (dst_lo_rc == rc_float) { // stack --> fpr load
-      if (((src_lo & 1) == 0 && src_lo + 1 == src_hi) &&
-          (dst_lo & 1) == 0 && dst_lo + 1 == dst_hi) {
-          // 64 bit
-        if (cbuf) {
-          MacroAssembler _masm(cbuf);
-          __ ldrd(as_FloatRegister(Matcher::_regEncode[dst_lo]),
-                 Address(sp, src_offset));
-        } else if (st) {
-          st->print("ldrd  %s, [sp, %d]\t# restore",
-                    Matcher::regName[dst_lo],
-                    src_offset);
+      } else if (dst_lo_rc == rc_float) { // fpr --> fpr copy
+          if (cbuf) {
+            __ fmovd(as_FloatRegister(Matcher::_regEncode[dst_lo]),
+                     as_FloatRegister(Matcher::_regEncode[src_lo]));
+        } else {
+            __ fmovs(as_FloatRegister(Matcher::_regEncode[dst_lo]),
+                     as_FloatRegister(Matcher::_regEncode[src_lo]));
         }
-      } else {
-        // 32 bit
-        if (cbuf) {
-          MacroAssembler _masm(cbuf);
-          __ ldrs(as_FloatRegister(Matcher::_regEncode[dst_lo]),
-                  Address(sp, src_offset));
-        } else if (st) {
-          st->print("ldrs  %s, [sp, %d]\t# restore",
-                    Matcher::regName[dst_lo],
-                   src_offset);
-        }
+      } else {                    // fpr --> stack spill
+        assert(dst_lo_rc == rc_stack, "spill to bad register class");
+        __ spill(as_FloatRegister(Matcher::_regEncode[src_lo]),
+                 is64 ? __ D : __ S, dst_offset);
       }
-      return 4;
-    } else {                    // stack --> stack copy
-      assert(dst_lo_rc == rc_stack, "spill to bad register class");
-      int dst_offset = ra_->reg2offset(dst_lo);
-      if (((src_lo & 1) == 0 && src_lo + 1 == src_hi) &&
-          (dst_lo & 1) == 0 && dst_lo + 1 == dst_hi) {
-          // 64 bit
-        if (cbuf) {
-          MacroAssembler _masm(cbuf);
-          __ ldr(rscratch1, Address(sp, src_offset));
-          __ str(rscratch1, Address(sp, dst_offset));
-        } else if (st) {
-          st->print("ldr  rscratch1, [sp, %d]\t# mem-mem spill",
-                    src_offset);
-          st->print("\n\t");
-          st->print("str  rscratch1, [sp, %d]",
-                    dst_offset);
-        }
-      } else {
-        // 32 bit
-        if (cbuf) {
-          MacroAssembler _masm(cbuf);
-          __ ldrw(rscratch1, Address(sp, src_offset));
-          __ strw(rscratch1, Address(sp, dst_offset));
-        } else if (st) {
-          st->print("ldrw  rscratch1, [sp, %d]\t# mem-mem spill",
-                    src_offset);
-          st->print("\n\t");
-          st->print("strw  rscratch1, [sp, %d]",
-                    dst_offset);
-        }
+      break;
+    case rc_stack:
+      if (dst_lo_rc == rc_int) {  // stack --> gpr load
+        __ unspill(as_Register(Matcher::_regEncode[dst_lo]), is64, src_offset);
+      } else if (dst_lo_rc == rc_float) { // stack --> fpr load
+        __ unspill(as_FloatRegister(Matcher::_regEncode[dst_lo]),
+                   is64 ? __ D : __ S, src_offset);
+      } else {                    // stack --> stack copy
+        assert(dst_lo_rc == rc_stack, "spill to bad register class");
+        __ unspill(rscratch1, is64, src_offset);
+        __ spill(rscratch1, is64, dst_offset);
       }
-      return 8;
+      break;
+    default:
+      assert(false, "bad rc_class for spill");
+      ShouldNotReachHere();
     }
   }
 
-  assert(false," bad rc_class for spill ");
-  Unimplemented();
+  if (st) {
+    st->print("spill ");
+    if (src_lo_rc == rc_stack) {
+      st->print("[sp, #%d] -> ", ra_->reg2offset(src_lo));
+    } else {
+      st->print("%s -> ", Matcher::regName[src_lo]);
+    }
+    if (dst_lo_rc == rc_stack) {
+      st->print("[sp, #%d]", ra_->reg2offset(dst_lo));
+    } else {
+      st->print("%s", Matcher::regName[dst_lo]);
+    }
+    if (bottom_type()->isa_vect() != NULL) {
+      st->print("\t# vector spill size = %d", ideal_reg()==Op_VecD ? 64:128);
+    } else {
+      st->print("\t# spill size = %d", is64 ? 64:32);
+    }
+  }
+
   return 0;
 
 }
@@ -2522,7 +2307,7 @@
 }
 
 uint MachSpillCopyNode::size(PhaseRegAlloc *ra_) const {
-  return implementation(NULL, ra_, true, NULL);
+  return MachNode::size(ra_);
 }
 
 //=============================================================================
--- a/hotspot/src/cpu/aarch64/vm/assembler_aarch64.hpp	Thu Apr 09 12:29:31 2015 +0200
+++ b/hotspot/src/cpu/aarch64/vm/assembler_aarch64.hpp	Mon Aug 17 12:45:16 2015 +0300
@@ -1896,7 +1896,7 @@
  public:
 
   enum SIMD_Arrangement {
-       T8B, T16B, T4H, T8H, T2S, T4S, T1D, T2D
+       T8B, T16B, T4H, T8H, T2S, T4S, T1D, T2D, T1Q
   };
 
   enum SIMD_RegVariant {
@@ -2225,14 +2225,16 @@
     f(0b001111, 15, 10), rf(Vn, 5), rf(Xd, 0);
   }
 
-  // We do not handle the 1Q arrangement.
   void pmull(FloatRegister Vd, SIMD_Arrangement Ta, FloatRegister Vn, FloatRegister Vm, SIMD_Arrangement Tb) {
     starti;
-    assert(Ta == T8H && (Tb == T8B || Tb == T16B), "Invalid Size specifier");
-    f(0, 31), f(Tb & 1, 30), f(0b001110001, 29, 21), rf(Vm, 16), f(0b111000, 15, 10);
-    rf(Vn, 5), rf(Vd, 0);
+    assert((Ta == T1Q && (Tb == T1D || Tb == T2D)) ||
+           (Ta == T8H && (Tb == T8B || Tb == T16B)), "Invalid Size specifier");
+    int size = (Ta == T1Q) ? 0b11 : 0b00;
+    f(0, 31), f(Tb & 1, 30), f(0b001110, 29, 24), f(size, 23, 22);
+    f(1, 21), rf(Vm, 16), f(0b111000, 15, 10), rf(Vn, 5), rf(Vd, 0);
   }
   void pmull2(FloatRegister Vd, SIMD_Arrangement Ta, FloatRegister Vn, FloatRegister Vm, SIMD_Arrangement Tb) {
+    assert(Tb == T2D || Tb == T16B, "pmull2 assumes T2D or T16B as the second size specifier");
     pmull(Vd, Ta, Vn, Vm, Tb);
   }
 
@@ -2245,15 +2247,6 @@
     f(0b100001010010, 21, 10), rf(Vn, 5), rf(Vd, 0);
   }
 
-  void rev32(FloatRegister Vd, SIMD_Arrangement T, FloatRegister Vn)
-  {
-    starti;
-    assert(T <= T8H, "must be one of T8B, T16B, T4H, T8H");
-    f(0, 31), f((int)T & 1, 30), f(0b101110, 29, 24);
-    f(T <= T16B ? 0b00 : 0b01, 23, 22), f(0b100000000010, 21, 10);
-    rf(Vn, 5), rf(Vd, 0);
-  }
-
   void dup(FloatRegister Vd, SIMD_Arrangement T, Register Xs)
   {
     starti;
@@ -2290,6 +2283,57 @@
 
 #undef INSN
 
+  // Table vector lookup
+#define INSN(NAME, op)                                                                                       \
+  void NAME(FloatRegister Vd, SIMD_Arrangement T, FloatRegister Vn, unsigned registers, FloatRegister Vm) {  \
+    starti;                                                                                                  \
+    assert(T == T8B || T == T16B, "invalid arrangement");                                                    \
+    assert(0 < registers && registers <= 4, "invalid number of registers");                                  \
+    f(0, 31), f((int)T & 1, 30), f(0b001110000, 29, 21), rf(Vm, 16), f(0, 15);                               \
+    f(registers - 1, 14, 13), f(op, 12),f(0b00, 11, 10), rf(Vn, 5), rf(Vd, 0);                               \
+  }
+
+  INSN(tbl, 0);
+  INSN(tbx, 1);
+
+#undef INSN
+
+#define INSN(NAME, U, opcode)                                                       \
+  void NAME(FloatRegister Vd, SIMD_Arrangement T, FloatRegister Vn) {               \
+       starti;                                                                      \
+       assert((ASSERTION), MSG);                                                    \
+       f(0, 31), f((int)T & 1, 30), f(U, 29), f(0b01110, 28, 24);                   \
+       f((int)(T >> 1), 23, 22), f(0b10000, 21, 17), f(opcode, 16, 12);             \
+       f(0b10, 11, 10), rf(Vn, 5), rf(Vd, 0);                                       \
+ }
+
+#define MSG "invalid arrangement"
+
+#define ASSERTION (T == T8B || T == T16B || T == T4H || T == T8H || T == T2S || T == T4S)
+  INSN(rev64, 0, 0b00000);
+#undef ASSERTION
+
+#define ASSERTION (T == T8B || T == T16B || T == T4H || T == T8H)
+  INSN(rev32, 1, 0b00000);
+#undef ASSERTION
+
+#define ASSERTION (T == T8B || T == T16B)
+  INSN(rev16, 0, 0b00001);
+#undef ASSERTION
+
+#undef MSG
+
+#undef INSN
+
+void ext(FloatRegister Vd, SIMD_Arrangement T, FloatRegister Vn, FloatRegister Vm, int index)
+  {
+    starti;
+    assert(T == T8B || T == T16B, "invalid arrangement");
+    assert((T == T8B && index <= 0b0111) || (T == T16B && index <= 0b1111), "Invalid index value");
+    f(0, 31), f((int)T & 1, 30), f(0b101110000, 29, 21);
+    rf(Vm, 16), f(0, 15), f(index, 14, 11);
+    f(0, 10), rf(Vn, 5), rf(Vd, 0);
+  }
 
 /* Simulator extensions to the ISA
 
--- a/hotspot/src/cpu/aarch64/vm/macroAssembler_aarch64.cpp	Thu Apr 09 12:29:31 2015 +0200
+++ b/hotspot/src/cpu/aarch64/vm/macroAssembler_aarch64.cpp	Mon Aug 17 12:45:16 2015 +0300
@@ -2009,6 +2009,14 @@
   }
 }
 
+void MacroAssembler::sub(Register Rd, Register Rn, RegisterOrConstant decrement) {
+  if (decrement.is_register()) {
+    sub(Rd, Rn, decrement.as_register());
+  } else {
+    sub(Rd, Rn, decrement.as_constant());
+  }
+}
+
 void MacroAssembler::reinit_heapbase()
 {
   if (UseCompressedOops) {
@@ -2307,6 +2315,28 @@
   }
 }
 
+Address MacroAssembler::spill_address(int size, int offset, Register tmp)
+{
+  assert(offset >= 0, "spill to negative address?");
+  // Offset reachable ?
+  //   Not aligned - 9 bits signed offset
+  //   Aligned - 12 bits unsigned offset shifted
+  Register base = sp;
+  if ((offset & (size-1)) && offset >= (1<<8)) {
+    add(tmp, base, offset & ((1<<12)-1));
+    base = tmp;
+    offset &= -1<<12;
+  }
+
+  if (offset >= (1<<12) * size) {
+    add(tmp, base, offset & (((1<<12)-1)<<12));
+    base = tmp;
+    offset &= ~(((1<<12)-1)<<12);
+  }
+
+  return Address(base, offset);
+}
+
 /**
  * Multiply 64 bit by 64 bit first loop.
  */
--- a/hotspot/src/cpu/aarch64/vm/macroAssembler_aarch64.hpp	Thu Apr 09 12:29:31 2015 +0200
+++ b/hotspot/src/cpu/aarch64/vm/macroAssembler_aarch64.hpp	Mon Aug 17 12:45:16 2015 +0300
@@ -464,10 +464,21 @@
     mov(dst, (long)i);
   }
 
+  void mov(Register dst, RegisterOrConstant src) {
+    if (src.is_register())
+      mov(dst, src.as_register());
+    else
+      mov(dst, src.as_constant());
+  }
+
   void movptr(Register r, uintptr_t imm64);
 
   void mov(FloatRegister Vd, SIMD_Arrangement T, u_int32_t imm32);
 
+  void mov(FloatRegister Vd, SIMD_Arrangement T, FloatRegister Vn) {
+    orr(Vd, T, Vn, Vn);
+  }
+
   // macro instructions for accessing and updating floating point
   // status register
   //
@@ -1045,6 +1056,7 @@
 
   void add(Register Rd, Register Rn, RegisterOrConstant increment);
   void addw(Register Rd, Register Rn, RegisterOrConstant increment);
+  void sub(Register Rd, Register Rn, RegisterOrConstant decrement);
 
   void adrp(Register reg1, const Address &dest, unsigned long &byte_offset);
 
@@ -1161,6 +1173,46 @@
   // Uses rscratch2.
   Address offsetted_address(Register r, Register r1, Address::extend ext,
                             int offset, int size);
+
+private:
+  // Returns an address on the stack which is reachable with a ldr/str of size
+  // Uses rscratch2 if the address is not directly reachable
+  Address spill_address(int size, int offset, Register tmp=rscratch2);
+
+public:
+  void spill(Register Rx, bool is64, int offset) {
+    if (is64) {
+      str(Rx, spill_address(8, offset));
+    } else {
+      strw(Rx, spill_address(4, offset));
+    }
+  }
+  void spill(FloatRegister Vx, SIMD_RegVariant T, int offset) {
+    str(Vx, T, spill_address(1 << (int)T, offset));
+  }
+  void unspill(Register Rx, bool is64, int offset) {
+    if (is64) {
+      ldr(Rx, spill_address(8, offset));
+    } else {
+      ldrw(Rx, spill_address(4, offset));
+    }
+  }
+  void unspill(FloatRegister Vx, SIMD_RegVariant T, int offset) {
+    ldr(Vx, T, spill_address(1 << (int)T, offset));
+  }
+  void spill_copy128(int src_offset, int dst_offset,
+                     Register tmp1=rscratch1, Register tmp2=rscratch2) {
+    if (src_offset < 512 && (src_offset & 7) == 0 &&
+        dst_offset < 512 && (dst_offset & 7) == 0) {
+      ldp(tmp1, tmp2, Address(sp, src_offset));
+      stp(tmp1, tmp2, Address(sp, dst_offset));
+    } else {
+      unspill(tmp1, true, src_offset);
+      spill(tmp1, true, dst_offset);
+      unspill(tmp1, true, src_offset+8);
+      spill(tmp1, true, dst_offset+8);
+    }
+  }
 };
 
 #ifdef ASSERT
--- a/hotspot/src/cpu/aarch64/vm/stubGenerator_aarch64.cpp	Thu Apr 09 12:29:31 2015 +0200
+++ b/hotspot/src/cpu/aarch64/vm/stubGenerator_aarch64.cpp	Mon Aug 17 12:45:16 2015 +0300
@@ -120,10 +120,8 @@
   // we save r19-r28 which Java uses as scratch registers and C
   // expects to be callee-save
   //
-  // we don't save any FP registers since only v8-v15 are callee-save
-  // (strictly only the f and d components) and Java uses them as
-  // callee-save. v0-v7 are arg registers and C treats v16-v31 as
-  // volatile (as does Java?)
+  // we save the bottom 64 bits of each value stored in v8-v15; it is
+  // the responsibility of the caller to preserve larger values.
   //
   // so the stub frame looks like this when we enter Java code
   //
@@ -131,14 +129,14 @@
   //     [ argument word n      ]
   //      ...
   // -27 [ argument word 1      ]
-  // -26 [ saved d15            ] <--- sp_after_call
-  // -25 [ saved d14            ]
-  // -24 [ saved d13            ]
-  // -23 [ saved d12            ]
-  // -22 [ saved d11            ]
-  // -21 [ saved d10            ]
-  // -20 [ saved d9             ]
-  // -19 [ saved d8             ]
+  // -26 [ saved v15            ] <--- sp_after_call
+  // -25 [ saved v14            ]
+  // -24 [ saved v13            ]
+  // -23 [ saved v12            ]
+  // -22 [ saved v11            ]
+  // -21 [ saved v10            ]
+  // -20 [ saved v9             ]
+  // -19 [ saved v8             ]
   // -18 [ saved r28            ]
   // -17 [ saved r27            ]
   // -16 [ saved r26            ]
@@ -2437,6 +2435,137 @@
     return start;
   }
 
+  /**
+   *  Arguments:
+   *
+   *  Input:
+   *  c_rarg0   - current state address
+   *  c_rarg1   - H key address
+   *  c_rarg2   - data address
+   *  c_rarg3   - number of blocks
+   *
+   *  Output:
+   *  Updated state at c_rarg0
+   */
+  address generate_ghash_processBlocks() {
+    __ align(CodeEntryAlignment);
+    Label L_ghash_loop, L_exit;
+
+    StubCodeMark mark(this, "StubRoutines", "ghash_processBlocks");
+    address start = __ pc();
+
+    Register state   = c_rarg0;
+    Register subkeyH = c_rarg1;
+    Register data    = c_rarg2;
+    Register blocks  = c_rarg3;
+
+    FloatRegister vzr = v30;
+    __ eor(vzr, __ T16B, vzr, vzr); // zero register
+
+    __ mov(v26, __ T16B, 1);
+    __ mov(v27, __ T16B, 63);
+    __ mov(v28, __ T16B, 62);
+    __ mov(v29, __ T16B, 57);
+
+    __ ldrq(v6, Address(state));
+    __ ldrq(v16, Address(subkeyH));
+
+    __ ext(v0, __ T16B, v6, v6, 0x08);
+    __ ext(v1, __ T16B, v16, v16, 0x08);
+    __ eor(v16, __ T16B, v16, v1);
+
+    __ bind(L_ghash_loop);
+
+    __ ldrq(v2, Address(__ post(data, 0x10)));
+    __ rev64(v2, __ T16B, v2); // swap data
+
+    __ ext(v6, __ T16B, v0, v0, 0x08);
+    __ eor(v6, __ T16B, v6, v2);
+    __ ext(v2, __ T16B, v6, v6, 0x08);
+
+    __ pmull2(v7, __ T1Q, v2, v1, __ T2D);  // A1*B1
+    __ eor(v6, __ T16B, v6, v2);
+    __ pmull(v5,  __ T1Q, v2, v1, __ T1D);  // A0*B0
+    __ pmull(v20, __ T1Q, v6, v16, __ T1D);  // (A1 + A0)(B1 + B0)
+
+    __ ext(v21, __ T16B, v5, v7, 0x08);
+    __ eor(v18, __ T16B, v7, v5); // A1*B1 xor A0*B0
+    __ eor(v20, __ T16B, v20, v21);
+    __ eor(v20, __ T16B, v20, v18);
+
+    // Registers pair <v7:v5> holds the result of carry-less multiplication
+    __ ins(v7, __ D, v20, 0, 1);
+    __ ins(v5, __ D, v20, 1, 0);
+
+    // Result of the multiplication is shifted by one bit position
+    // [X3:X2:X1:X0] = [X3:X2:X1:X0] << 1
+    __ ushr(v18, __ T2D, v5, -63 & 63);
+    __ ins(v25, __ D, v18, 1, 0);
+    __ ins(v25, __ D, vzr, 0, 0);
+    __ ushl(v5, __ T2D, v5, v26);
+    __ orr(v5, __ T16B, v5, v25);
+
+    __ ushr(v19, __ T2D, v7, -63 & 63);
+    __ ins(v19, __ D, v19, 1, 0);
+    __ ins(v19, __ D, v18, 0, 1);
+    __ ushl(v7, __ T2D, v7, v26);
+    __ orr(v6, __ T16B, v7, v19);
+
+    __ ins(v24, __ D, v5, 0, 1);
+
+    // A = X0 << 63
+    __ ushl(v21, __ T2D, v5, v27);
+
+    // A = X0 << 62
+    __ ushl(v22, __ T2D, v5, v28);
+
+    // A = X0 << 57
+    __ ushl(v23, __ T2D, v5, v29);
+
+    // D = X1^A^B^C
+    __ eor(v21, __ T16B, v21, v22);
+    __ eor(v21, __ T16B, v21, v23);
+    __ eor(v21, __ T16B, v21, v24);
+    __ ins(v5, __ D, v21, 1, 0);
+
+    // [E1:E0] = [D:X0] >> 1
+    __ ushr(v20, __ T2D, v5, -1 & 63);
+    __ ushl(v18, __ T2D, v5, v27);
+    __ ext(v25, __ T16B, v18, vzr, 0x08);
+    __ orr(v19, __ T16B, v20, v25);
+
+    __ eor(v7, __ T16B, v5, v19);
+
+    // [F1:F0] = [D:X0] >> 2
+    __ ushr(v20, __ T2D, v5, -2 & 63);
+    __ ushl(v18, __ T2D, v5, v28);
+    __ ins(v25, __ D, v18, 0, 1);
+    __ orr(v19, __ T16B, v20, v25);
+
+    __ eor(v7, __ T16B, v7, v19);
+
+    // [G1:G0] = [D:X0] >> 7
+    __ ushr(v20, __ T2D, v5, -7 & 63);
+    __ ushl(v18, __ T2D, v5, v29);
+    __ ins(v25, __ D, v18, 0, 1);
+    __ orr(v19, __ T16B, v20, v25);
+
+    // [H1:H0] = [D^E1^F1^G1:X0^E0^F0^G0]
+    __ eor(v7, __ T16B, v7, v19);
+
+    // Result = [H1:H0]^[X3:X2]
+    __ eor(v0, __ T16B, v7, v6);
+
+    __ subs(blocks, blocks, 1);
+    __ cbnz(blocks, L_ghash_loop);
+
+    __ ext(v1, __ T16B, v0, v0, 0x08);
+    __ st1(v1, __ T16B, state);
+    __ ret(lr);
+
+    return start;
+  }
+
   // Continuation point for throwing of implicit exceptions that are
   // not handled in the current activation. Fabricates an exception
   // oop and initiates normal exception dispatching in this
@@ -2544,6 +2673,828 @@
     return stub->entry_point();
   }
 
+  class MontgomeryMultiplyGenerator : public MacroAssembler {
+
+    Register Pa_base, Pb_base, Pn_base, Pm_base, inv, Rlen, Ra, Rb, Rm, Rn,
+      Pa, Pb, Pn, Pm, Rhi_ab, Rlo_ab, Rhi_mn, Rlo_mn, t0, t1, t2, Ri, Rj;
+
+    RegSet _toSave;
+    bool _squaring;
+
+  public:
+    MontgomeryMultiplyGenerator (Assembler *as, bool squaring)
+      : MacroAssembler(as->code()), _squaring(squaring) {
+
+      // Register allocation
+
+      Register reg = c_rarg0;
+      Pa_base = reg;       // Argument registers
+      if (squaring)
+        Pb_base = Pa_base;
+      else
+        Pb_base = ++reg;
+      Pn_base = ++reg;
+      Rlen= ++reg;
+      inv = ++reg;
+      Pm_base = ++reg;
+
+                          // Working registers:
+      Ra =  ++reg;        // The current digit of a, b, n, and m.
+      Rb =  ++reg;
+      Rm =  ++reg;
+      Rn =  ++reg;
+
+      Pa =  ++reg;        // Pointers to the current/next digit of a, b, n, and m.
+      Pb =  ++reg;
+      Pm =  ++reg;
+      Pn =  ++reg;
+
+      t0 =  ++reg;        // Three registers which form a
+      t1 =  ++reg;        // triple-precision accumuator.
+      t2 =  ++reg;
+
+      Ri =  ++reg;        // Inner and outer loop indexes.
+      Rj =  ++reg;
+
+      Rhi_ab = ++reg;     // Product registers: low and high parts
+      Rlo_ab = ++reg;     // of a*b and m*n.
+      Rhi_mn = ++reg;
+      Rlo_mn = ++reg;
+
+      // r19 and up are callee-saved.
+      _toSave = RegSet::range(r19, reg) + Pm_base;
+    }
+
+  private:
+    void save_regs() {
+      push(_toSave, sp);
+    }
+
+    void restore_regs() {
+      pop(_toSave, sp);
+    }
+
+    template <typename T>
+    void unroll_2(Register count, T block) {
+      Label loop, end, odd;
+      tbnz(count, 0, odd);
+      cbz(count, end);
+      align(16);
+      bind(loop);
+      (this->*block)();
+      bind(odd);
+      (this->*block)();
+      subs(count, count, 2);
+      br(Assembler::GT, loop);
+      bind(end);
+    }
+
+    template <typename T>
+    void unroll_2(Register count, T block, Register d, Register s, Register tmp) {
+      Label loop, end, odd;
+      tbnz(count, 0, odd);
+      cbz(count, end);
+      align(16);
+      bind(loop);
+      (this->*block)(d, s, tmp);
+      bind(odd);
+      (this->*block)(d, s, tmp);
+      subs(count, count, 2);
+      br(Assembler::GT, loop);
+      bind(end);
+    }
+
+    void pre1(RegisterOrConstant i) {
+      block_comment("pre1");
+      // Pa = Pa_base;
+      // Pb = Pb_base + i;
+      // Pm = Pm_base;
+      // Pn = Pn_base + i;
+      // Ra = *Pa;
+      // Rb = *Pb;
+      // Rm = *Pm;
+      // Rn = *Pn;
+      ldr(Ra, Address(Pa_base));
+      ldr(Rb, Address(Pb_base, i, Address::uxtw(LogBytesPerWord)));
+      ldr(Rm, Address(Pm_base));
+      ldr(Rn, Address(Pn_base, i, Address::uxtw(LogBytesPerWord)));
+      lea(Pa, Address(Pa_base));
+      lea(Pb, Address(Pb_base, i, Address::uxtw(LogBytesPerWord)));
+      lea(Pm, Address(Pm_base));
+      lea(Pn, Address(Pn_base, i, Address::uxtw(LogBytesPerWord)));
+
+      // Zero the m*n result.
+      mov(Rhi_mn, zr);
+      mov(Rlo_mn, zr);
+    }
+
+    // The core multiply-accumulate step of a Montgomery
+    // multiplication.  The idea is to schedule operations as a
+    // pipeline so that instructions with long latencies (loads and
+    // multiplies) have time to complete before their results are
+    // used.  This most benefits in-order implementations of the
+    // architecture but out-of-order ones also benefit.
+    void step() {
+      block_comment("step");
+      // MACC(Ra, Rb, t0, t1, t2);
+      // Ra = *++Pa;
+      // Rb = *--Pb;
+      umulh(Rhi_ab, Ra, Rb);
+      mul(Rlo_ab, Ra, Rb);
+      ldr(Ra, pre(Pa, wordSize));
+      ldr(Rb, pre(Pb, -wordSize));
+      acc(Rhi_mn, Rlo_mn, t0, t1, t2); // The pending m*n from the
+                                       // previous iteration.
+      // MACC(Rm, Rn, t0, t1, t2);
+      // Rm = *++Pm;
+      // Rn = *--Pn;
+      umulh(Rhi_mn, Rm, Rn);
+      mul(Rlo_mn, Rm, Rn);
+      ldr(Rm, pre(Pm, wordSize));
+      ldr(Rn, pre(Pn, -wordSize));
+      acc(Rhi_ab, Rlo_ab, t0, t1, t2);
+    }
+
+    void post1() {
+      block_comment("post1");
+
+      // MACC(Ra, Rb, t0, t1, t2);
+      // Ra = *++Pa;
+      // Rb = *--Pb;
+      umulh(Rhi_ab, Ra, Rb);
+      mul(Rlo_ab, Ra, Rb);
+      acc(Rhi_mn, Rlo_mn, t0, t1, t2);  // The pending m*n
+      acc(Rhi_ab, Rlo_ab, t0, t1, t2);
+
+      // *Pm = Rm = t0 * inv;
+      mul(Rm, t0, inv);
+      str(Rm, Address(Pm));
+
+      // MACC(Rm, Rn, t0, t1, t2);
+      // t0 = t1; t1 = t2; t2 = 0;
+      umulh(Rhi_mn, Rm, Rn);
+
+#ifndef PRODUCT
+      // assert(m[i] * n[0] + t0 == 0, "broken Montgomery multiply");
+      {
+        mul(Rlo_mn, Rm, Rn);
+        add(Rlo_mn, t0, Rlo_mn);
+        Label ok;
+        cbz(Rlo_mn, ok); {
+          stop("broken Montgomery multiply");
+        } bind(ok);
+      }
+#endif
+      // We have very carefully set things up so that
+      // m[i]*n[0] + t0 == 0 (mod b), so we don't have to calculate
+      // the lower half of Rm * Rn because we know the result already:
+      // it must be -t0.  t0 + (-t0) must generate a carry iff
+      // t0 != 0.  So, rather than do a mul and an adds we just set
+      // the carry flag iff t0 is nonzero.
+      //
+      // mul(Rlo_mn, Rm, Rn);
+      // adds(zr, t0, Rlo_mn);
+      subs(zr, t0, 1); // Set carry iff t0 is nonzero
+      adcs(t0, t1, Rhi_mn);
+      adc(t1, t2, zr);
+      mov(t2, zr);
+    }
+
+    void pre2(RegisterOrConstant i, RegisterOrConstant len) {
+      block_comment("pre2");
+      // Pa = Pa_base + i-len;
+      // Pb = Pb_base + len;
+      // Pm = Pm_base + i-len;
+      // Pn = Pn_base + len;
+
+      if (i.is_register()) {
+        sub(Rj, i.as_register(), len);
+      } else {
+        mov(Rj, i.as_constant());
+        sub(Rj, Rj, len);
+      }
+      // Rj == i-len
+
+      lea(Pa, Address(Pa_base, Rj, Address::uxtw(LogBytesPerWord)));
+      lea(Pb, Address(Pb_base, len, Address::uxtw(LogBytesPerWord)));
+      lea(Pm, Address(Pm_base, Rj, Address::uxtw(LogBytesPerWord)));
+      lea(Pn, Address(Pn_base, len, Address::uxtw(LogBytesPerWord)));
+
+      // Ra = *++Pa;
+      // Rb = *--Pb;
+      // Rm = *++Pm;
+      // Rn = *--Pn;
+      ldr(Ra, pre(Pa, wordSize));
+      ldr(Rb, pre(Pb, -wordSize));
+      ldr(Rm, pre(Pm, wordSize));
+      ldr(Rn, pre(Pn, -wordSize));
+
+      mov(Rhi_mn, zr);
+      mov(Rlo_mn, zr);
+    }
+
+    void post2(RegisterOrConstant i, RegisterOrConstant len) {
+      block_comment("post2");
+      if (i.is_constant()) {
+        mov(Rj, i.as_constant()-len.as_constant());
+      } else {
+        sub(Rj, i.as_register(), len);
+      }
+
+      adds(t0, t0, Rlo_mn); // The pending m*n, low part
+
+      // As soon as we know the least significant digit of our result,
+      // store it.
+      // Pm_base[i-len] = t0;
+      str(t0, Address(Pm_base, Rj, Address::uxtw(LogBytesPerWord)));
+
+      // t0 = t1; t1 = t2; t2 = 0;
+      adcs(t0, t1, Rhi_mn); // The pending m*n, high part
+      adc(t1, t2, zr);
+      mov(t2, zr);
+    }
+
+    // A carry in t0 after Montgomery multiplication means that we
+    // should subtract multiples of n from our result in m.  We'll
+    // keep doing that until there is no carry.
+    void normalize(RegisterOrConstant len) {
+      block_comment("normalize");
+      // while (t0)
+      //   t0 = sub(Pm_base, Pn_base, t0, len);
+      Label loop, post, again;
+      Register cnt = t1, i = t2; // Re-use registers; we're done with them now
+      cbz(t0, post); {
+        bind(again); {
+          mov(i, zr);
+          mov(cnt, len);
+          ldr(Rm, Address(Pm_base, i, Address::uxtw(LogBytesPerWord)));
+          ldr(Rn, Address(Pn_base, i, Address::uxtw(LogBytesPerWord)));
+          subs(zr, zr, zr); // set carry flag, i.e. no borrow
+          align(16);
+          bind(loop); {
+            sbcs(Rm, Rm, Rn);
+            str(Rm, Address(Pm_base, i, Address::uxtw(LogBytesPerWord)));
+            add(i, i, 1);
+            ldr(Rm, Address(Pm_base, i, Address::uxtw(LogBytesPerWord)));
+            ldr(Rn, Address(Pn_base, i, Address::uxtw(LogBytesPerWord)));
+            sub(cnt, cnt, 1);
+          } cbnz(cnt, loop);
+          sbc(t0, t0, zr);
+        } cbnz(t0, again);
+      } bind(post);
+    }
+
+    // Move memory at s to d, reversing words.
+    //    Increments d to end of copied memory
+    //    Destroys tmp1, tmp2
+    //    Preserves len
+    //    Leaves s pointing to the address which was in d at start
+    void reverse(Register d, Register s, Register len, Register tmp1, Register tmp2) {
+      assert(tmp1 < r19 && tmp2 < r19, "register corruption");
+
+      lea(s, Address(s, len, Address::uxtw(LogBytesPerWord)));
+      mov(tmp1, len);
+      unroll_2(tmp1, &MontgomeryMultiplyGenerator::reverse1, d, s, tmp2);
+      sub(s, d, len, ext::uxtw, LogBytesPerWord);
+    }
+    // where
+    void reverse1(Register d, Register s, Register tmp) {
+      ldr(tmp, pre(s, -wordSize));
+      ror(tmp, tmp, 32);
+      str(tmp, post(d, wordSize));
+    }
+
+    void step_squaring() {
+      // An extra ACC
+      step();
+      acc(Rhi_ab, Rlo_ab, t0, t1, t2);
+    }
+
+    void last_squaring(RegisterOrConstant i) {
+      Label dont;
+      // if ((i & 1) == 0) {
+      tbnz(i.as_register(), 0, dont); {
+        // MACC(Ra, Rb, t0, t1, t2);
+        // Ra = *++Pa;
+        // Rb = *--Pb;
+        umulh(Rhi_ab, Ra, Rb);
+        mul(Rlo_ab, Ra, Rb);
+        acc(Rhi_ab, Rlo_ab, t0, t1, t2);
+      } bind(dont);
+    }
+
+    void extra_step_squaring() {
+      acc(Rhi_mn, Rlo_mn, t0, t1, t2);  // The pending m*n
+
+      // MACC(Rm, Rn, t0, t1, t2);
+      // Rm = *++Pm;
+      // Rn = *--Pn;
+      umulh(Rhi_mn, Rm, Rn);
+      mul(Rlo_mn, Rm, Rn);
+      ldr(Rm, pre(Pm, wordSize));
+      ldr(Rn, pre(Pn, -wordSize));
+    }
+
+    void post1_squaring() {
+      acc(Rhi_mn, Rlo_mn, t0, t1, t2);  // The pending m*n
+
+      // *Pm = Rm = t0 * inv;
+      mul(Rm, t0, inv);
+      str(Rm, Address(Pm));
+
+      // MACC(Rm, Rn, t0, t1, t2);
+      // t0 = t1; t1 = t2; t2 = 0;
+      umulh(Rhi_mn, Rm, Rn);
+
+#ifndef PRODUCT
+      // assert(m[i] * n[0] + t0 == 0, "broken Montgomery multiply");
+      {
+        mul(Rlo_mn, Rm, Rn);
+        add(Rlo_mn, t0, Rlo_mn);
+        Label ok;
+        cbz(Rlo_mn, ok); {
+          stop("broken Montgomery multiply");
+        } bind(ok);
+      }
+#endif
+      // We have very carefully set things up so that
+      // m[i]*n[0] + t0 == 0 (mod b), so we don't have to calculate
+      // the lower half of Rm * Rn because we know the result already:
+      // it must be -t0.  t0 + (-t0) must generate a carry iff
+      // t0 != 0.  So, rather than do a mul and an adds we just set
+      // the carry flag iff t0 is nonzero.
+      //
+      // mul(Rlo_mn, Rm, Rn);
+      // adds(zr, t0, Rlo_mn);
+      subs(zr, t0, 1); // Set carry iff t0 is nonzero
+      adcs(t0, t1, Rhi_mn);
+      adc(t1, t2, zr);
+      mov(t2, zr);
+    }
+
+    void acc(Register Rhi, Register Rlo,
+             Register t0, Register t1, Register t2) {
+      adds(t0, t0, Rlo);
+      adcs(t1, t1, Rhi);
+      adc(t2, t2, zr);
+    }
+
+  public:
+    /**
+     * Fast Montgomery multiplication.  The derivation of the
+     * algorithm is in A Cryptographic Library for the Motorola
+     * DSP56000, Dusse and Kaliski, Proc. EUROCRYPT 90, pp. 230-237.
+     *
+     * Arguments:
+     *
+     * Inputs for multiplication:
+     *   c_rarg0   - int array elements a
+     *   c_rarg1   - int array elements b
+     *   c_rarg2   - int array elements n (the modulus)
+     *   c_rarg3   - int length
+     *   c_rarg4   - int inv
+     *   c_rarg5   - int array elements m (the result)
+     *
+     * Inputs for squaring:
+     *   c_rarg0   - int array elements a
+     *   c_rarg1   - int array elements n (the modulus)
+     *   c_rarg2   - int length
+     *   c_rarg3   - int inv
+     *   c_rarg4   - int array elements m (the result)
+     *
+     */
+    address generate_multiply() {
+      Label argh, nothing;
+      bind(argh);
+      stop("MontgomeryMultiply total_allocation must be <= 8192");
+
+      align(CodeEntryAlignment);
+      address entry = pc();
+
+      cbzw(Rlen, nothing);
+
+      enter();
+
+      // Make room.
+      cmpw(Rlen, 512);
+      br(Assembler::HI, argh);
+      sub(Ra, sp, Rlen, ext::uxtw, exact_log2(4 * sizeof (jint)));
+      andr(sp, Ra, -2 * wordSize);
+
+      lsrw(Rlen, Rlen, 1);  // length in longwords = len/2
+
+      {
+        // Copy input args, reversing as we go.  We use Ra as a
+        // temporary variable.
+        reverse(Ra, Pa_base, Rlen, t0, t1);
+        if (!_squaring)
+          reverse(Ra, Pb_base, Rlen, t0, t1);
+        reverse(Ra, Pn_base, Rlen, t0, t1);
+      }
+
+      // Push all call-saved registers and also Pm_base which we'll need
+      // at the end.
+      save_regs();
+
+#ifndef PRODUCT
+      // assert(inv * n[0] == -1UL, "broken inverse in Montgomery multiply");
+      {
+        ldr(Rn, Address(Pn_base, 0));
+        mul(Rlo_mn, Rn, inv);
+        cmp(Rlo_mn, -1);
+        Label ok;
+        br(EQ, ok); {
+          stop("broken inverse in Montgomery multiply");
+        } bind(ok);
+      }
+#endif
+
+      mov(Pm_base, Ra);
+
+      mov(t0, zr);
+      mov(t1, zr);
+      mov(t2, zr);
+
+      block_comment("for (int i = 0; i < len; i++) {");
+      mov(Ri, zr); {
+        Label loop, end;
+        cmpw(Ri, Rlen);
+        br(Assembler::GE, end);
+
+        bind(loop);
+        pre1(Ri);
+
+        block_comment("  for (j = i; j; j--) {"); {
+          movw(Rj, Ri);
+          unroll_2(Rj, &MontgomeryMultiplyGenerator::step);
+        } block_comment("  } // j");
+
+        post1();
+        addw(Ri, Ri, 1);
+        cmpw(Ri, Rlen);
+        br(Assembler::LT, loop);
+        bind(end);
+        block_comment("} // i");
+      }
+
+      block_comment("for (int i = len; i < 2*len; i++) {");
+      mov(Ri, Rlen); {
+        Label loop, end;
+        cmpw(Ri, Rlen, Assembler::LSL, 1);
+        br(Assembler::GE, end);
+
+        bind(loop);
+        pre2(Ri, Rlen);
+
+        block_comment("  for (j = len*2-i-1; j; j--) {"); {
+          lslw(Rj, Rlen, 1);
+          subw(Rj, Rj, Ri);
+          subw(Rj, Rj, 1);
+          unroll_2(Rj, &MontgomeryMultiplyGenerator::step);
+        } block_comment("  } // j");
+
+        post2(Ri, Rlen);
+        addw(Ri, Ri, 1);
+        cmpw(Ri, Rlen, Assembler::LSL, 1);
+        br(Assembler::LT, loop);
+        bind(end);
+      }
+      block_comment("} // i");
+
+      normalize(Rlen);
+
+      mov(Ra, Pm_base);  // Save Pm_base in Ra
+      restore_regs();  // Restore caller's Pm_base
+
+      // Copy our result into caller's Pm_base
+      reverse(Pm_base, Ra, Rlen, t0, t1);
+
+      leave();
+      bind(nothing);
+      ret(lr);
+
+      return entry;
+    }
+    // In C, approximately:
+
+    // void
+    // montgomery_multiply(unsigned long Pa_base[], unsigned long Pb_base[],
+    //                     unsigned long Pn_base[], unsigned long Pm_base[],
+    //                     unsigned long inv, int len) {
+    //   unsigned long t0 = 0, t1 = 0, t2 = 0; // Triple-precision accumulator
+    //   unsigned long *Pa, *Pb, *Pn, *Pm;
+    //   unsigned long Ra, Rb, Rn, Rm;
+
+    //   int i;
+
+    //   assert(inv * Pn_base[0] == -1UL, "broken inverse in Montgomery multiply");
+
+    //   for (i = 0; i < len; i++) {
+    //     int j;
+
+    //     Pa = Pa_base;
+    //     Pb = Pb_base + i;
+    //     Pm = Pm_base;
+    //     Pn = Pn_base + i;
+
+    //     Ra = *Pa;
+    //     Rb = *Pb;
+    //     Rm = *Pm;
+    //     Rn = *Pn;
+
+    //     int iters = i;
+    //     for (j = 0; iters--; j++) {
+    //       assert(Ra == Pa_base[j] && Rb == Pb_base[i-j], "must be");
+    //       MACC(Ra, Rb, t0, t1, t2);
+    //       Ra = *++Pa;
+    //       Rb = *--Pb;
+    //       assert(Rm == Pm_base[j] && Rn == Pn_base[i-j], "must be");
+    //       MACC(Rm, Rn, t0, t1, t2);
+    //       Rm = *++Pm;
+    //       Rn = *--Pn;
+    //     }
+
+    //     assert(Ra == Pa_base[i] && Rb == Pb_base[0], "must be");
+    //     MACC(Ra, Rb, t0, t1, t2);
+    //     *Pm = Rm = t0 * inv;
+    //     assert(Rm == Pm_base[i] && Rn == Pn_base[0], "must be");
+    //     MACC(Rm, Rn, t0, t1, t2);
+
+    //     assert(t0 == 0, "broken Montgomery multiply");
+
+    //     t0 = t1; t1 = t2; t2 = 0;
+    //   }
+
+    //   for (i = len; i < 2*len; i++) {
+    //     int j;
+
+    //     Pa = Pa_base + i-len;
+    //     Pb = Pb_base + len;
+    //     Pm = Pm_base + i-len;
+    //     Pn = Pn_base + len;
+
+    //     Ra = *++Pa;
+    //     Rb = *--Pb;
+    //     Rm = *++Pm;
+    //     Rn = *--Pn;
+
+    //     int iters = len*2-i-1;
+    //     for (j = i-len+1; iters--; j++) {
+    //       assert(Ra == Pa_base[j] && Rb == Pb_base[i-j], "must be");
+    //       MACC(Ra, Rb, t0, t1, t2);
+    //       Ra = *++Pa;
+    //       Rb = *--Pb;
+    //       assert(Rm == Pm_base[j] && Rn == Pn_base[i-j], "must be");
+    //       MACC(Rm, Rn, t0, t1, t2);
+    //       Rm = *++Pm;
+    //       Rn = *--Pn;
+    //     }
+
+    //     Pm_base[i-len] = t0;
+    //     t0 = t1; t1 = t2; t2 = 0;
+    //   }
+
+    //   while (t0)
+    //     t0 = sub(Pm_base, Pn_base, t0, len);
+    // }
+
+    /**
+     * Fast Montgomery squaring.  This uses asymptotically 25% fewer
+     * multiplies than Montgomery multiplication so it should be up to
+     * 25% faster.  However, its loop control is more complex and it
+     * may actually run slower on some machines.
+     *
+     * Arguments:
+     *
+     * Inputs:
+     *   c_rarg0   - int array elements a
+     *   c_rarg1   - int array elements n (the modulus)
+     *   c_rarg2   - int length
+     *   c_rarg3   - int inv
+     *   c_rarg4   - int array elements m (the result)
+     *
+     */
+    address generate_square() {
+      Label argh;
+      bind(argh);
+      stop("MontgomeryMultiply total_allocation must be <= 8192");
+
+      align(CodeEntryAlignment);
+      address entry = pc();
+
+      enter();
+
+      // Make room.
+      cmpw(Rlen, 512);
+      br(Assembler::HI, argh);
+      sub(Ra, sp, Rlen, ext::uxtw, exact_log2(4 * sizeof (jint)));
+      andr(sp, Ra, -2 * wordSize);
+
+      lsrw(Rlen, Rlen, 1);  // length in longwords = len/2
+
+      {
+        // Copy input args, reversing as we go.  We use Ra as a
+        // temporary variable.
+        reverse(Ra, Pa_base, Rlen, t0, t1);
+        reverse(Ra, Pn_base, Rlen, t0, t1);
+      }
+
+      // Push all call-saved registers and also Pm_base which we'll need
+      // at the end.
+      save_regs();
+
+      mov(Pm_base, Ra);
+
+      mov(t0, zr);
+      mov(t1, zr);
+      mov(t2, zr);
+
+      block_comment("for (int i = 0; i < len; i++) {");
+      mov(Ri, zr); {
+        Label loop, end;
+        bind(loop);
+        cmp(Ri, Rlen);
+        br(Assembler::GE, end);
+
+        pre1(Ri);
+
+        block_comment("for (j = (i+1)/2; j; j--) {"); {
+          add(Rj, Ri, 1);
+          lsr(Rj, Rj, 1);
+          unroll_2(Rj, &MontgomeryMultiplyGenerator::step_squaring);
+        } block_comment("  } // j");
+
+        last_squaring(Ri);
+
+        block_comment("  for (j = i/2; j; j--) {"); {
+          lsr(Rj, Ri, 1);
+          unroll_2(Rj, &MontgomeryMultiplyGenerator::extra_step_squaring);
+        } block_comment("  } // j");
+
+        post1_squaring();
+        add(Ri, Ri, 1);
+        cmp(Ri, Rlen);
+        br(Assembler::LT, loop);
+
+        bind(end);
+        block_comment("} // i");
+      }
+
+      block_comment("for (int i = len; i < 2*len; i++) {");
+      mov(Ri, Rlen); {
+        Label loop, end;
+        bind(loop);
+        cmp(Ri, Rlen, Assembler::LSL, 1);
+        br(Assembler::GE, end);
+
+        pre2(Ri, Rlen);
+
+        block_comment("  for (j = (2*len-i-1)/2; j; j--) {"); {
+          lsl(Rj, Rlen, 1);
+          sub(Rj, Rj, Ri);
+          sub(Rj, Rj, 1);
+          lsr(Rj, Rj, 1);
+          unroll_2(Rj, &MontgomeryMultiplyGenerator::step_squaring);
+        } block_comment("  } // j");
+
+        last_squaring(Ri);
+
+        block_comment("  for (j = (2*len-i)/2; j; j--) {"); {
+          lsl(Rj, Rlen, 1);
+          sub(Rj, Rj, Ri);
+          lsr(Rj, Rj, 1);
+          unroll_2(Rj, &MontgomeryMultiplyGenerator::extra_step_squaring);
+        } block_comment("  } // j");
+
+        post2(Ri, Rlen);
+        add(Ri, Ri, 1);
+        cmp(Ri, Rlen, Assembler::LSL, 1);
+
+        br(Assembler::LT, loop);
+        bind(end);
+        block_comment("} // i");
+      }
+
+      normalize(Rlen);
+
+      mov(Ra, Pm_base);  // Save Pm_base in Ra
+      restore_regs();  // Restore caller's Pm_base
+
+      // Copy our result into caller's Pm_base
+      reverse(Pm_base, Ra, Rlen, t0, t1);
+
+      leave();
+      ret(lr);
+
+      return entry;
+    }
+    // In C, approximately:
+
+    // void
+    // montgomery_square(unsigned long Pa_base[], unsigned long Pn_base[],
+    //                   unsigned long Pm_base[], unsigned long inv, int len) {
+    //   unsigned long t0 = 0, t1 = 0, t2 = 0; // Triple-precision accumulator
+    //   unsigned long *Pa, *Pb, *Pn, *Pm;
+    //   unsigned long Ra, Rb, Rn, Rm;
+
+    //   int i;
+
+    //   assert(inv * Pn_base[0] == -1UL, "broken inverse in Montgomery multiply");
+
+    //   for (i = 0; i < len; i++) {
+    //     int j;
+
+    //     Pa = Pa_base;
+    //     Pb = Pa_base + i;
+    //     Pm = Pm_base;
+    //     Pn = Pn_base + i;
+
+    //     Ra = *Pa;
+    //     Rb = *Pb;
+    //     Rm = *Pm;
+    //     Rn = *Pn;
+
+    //     int iters = (i+1)/2;
+    //     for (j = 0; iters--; j++) {
+    //       assert(Ra == Pa_base[j] && Rb == Pa_base[i-j], "must be");
+    //       MACC2(Ra, Rb, t0, t1, t2);
+    //       Ra = *++Pa;
+    //       Rb = *--Pb;
+    //       assert(Rm == Pm_base[j] && Rn == Pn_base[i-j], "must be");
+    //       MACC(Rm, Rn, t0, t1, t2);
+    //       Rm = *++Pm;
+    //       Rn = *--Pn;
+    //     }
+    //     if ((i & 1) == 0) {
+    //       assert(Ra == Pa_base[j], "must be");
+    //       MACC(Ra, Ra, t0, t1, t2);
+    //     }
+    //     iters = i/2;
+    //     assert(iters == i-j, "must be");
+    //     for (; iters--; j++) {
+    //       assert(Rm == Pm_base[j] && Rn == Pn_base[i-j], "must be");
+    //       MACC(Rm, Rn, t0, t1, t2);
+    //       Rm = *++Pm;
+    //       Rn = *--Pn;
+    //     }
+
+    //     *Pm = Rm = t0 * inv;
+    //     assert(Rm == Pm_base[i] && Rn == Pn_base[0], "must be");
+    //     MACC(Rm, Rn, t0, t1, t2);
+
+    //     assert(t0 == 0, "broken Montgomery multiply");
+
+    //     t0 = t1; t1 = t2; t2 = 0;
+    //   }
+
+    //   for (i = len; i < 2*len; i++) {
+    //     int start = i-len+1;
+    //     int end = start + (len - start)/2;
+    //     int j;
+
+    //     Pa = Pa_base + i-len;
+    //     Pb = Pa_base + len;
+    //     Pm = Pm_base + i-len;
+    //     Pn = Pn_base + len;
+
+    //     Ra = *++Pa;
+    //     Rb = *--Pb;
+    //     Rm = *++Pm;
+    //     Rn = *--Pn;
+
+    //     int iters = (2*len-i-1)/2;
+    //     assert(iters == end-start, "must be");
+    //     for (j = start; iters--; j++) {
+    //       assert(Ra == Pa_base[j] && Rb == Pa_base[i-j], "must be");
+    //       MACC2(Ra, Rb, t0, t1, t2);
+    //       Ra = *++Pa;
+    //       Rb = *--Pb;
+    //       assert(Rm == Pm_base[j] && Rn == Pn_base[i-j], "must be");
+    //       MACC(Rm, Rn, t0, t1, t2);
+    //       Rm = *++Pm;
+    //       Rn = *--Pn;
+    //     }
+    //     if ((i & 1) == 0) {
+    //       assert(Ra == Pa_base[j], "must be");
+    //       MACC(Ra, Ra, t0, t1, t2);
+    //     }
+    //     iters =  (2*len-i)/2;
+    //     assert(iters == len-j, "must be");
+    //     for (; iters--; j++) {
+    //       assert(Rm == Pm_base[j] && Rn == Pn_base[i-j], "must be");
+    //       MACC(Rm, Rn, t0, t1, t2);
+    //       Rm = *++Pm;
+    //       Rn = *--Pn;
+    //     }
+    //     Pm_base[i-len] = t0;
+    //     t0 = t1; t1 = t2; t2 = 0;
+    //   }
+
+    //   while (t0)
+    //     t0 = sub(Pm_base, Pn_base, t0, len);
+    // }
+  };
+
   // Initialization
   void generate_initial() {
     // Generate initial stubs and initializes the entry points
@@ -2603,7 +3554,26 @@
       StubRoutines::_multiplyToLen = generate_multiplyToLen();
     }
 
+    if (UseMontgomeryMultiplyIntrinsic) {
+      StubCodeMark mark(this, "StubRoutines", "montgomeryMultiply");
+      MontgomeryMultiplyGenerator g(_masm, /*squaring*/false);
+      StubRoutines::_montgomeryMultiply = g.generate_multiply();
+    }
+
+    if (UseMontgomerySquareIntrinsic) {
+      StubCodeMark mark(this, "StubRoutines", "montgomerySquare");
+      MontgomeryMultiplyGenerator g(_masm, /*squaring*/true);
+      // We use generate_multiply() rather than generate_square()
+      // because it's faster for the sizes of modulus we care about.
+      StubRoutines::_montgomerySquare = g.generate_multiply();
+    }
+
 #ifndef BUILTIN_SIM
+    // generate GHASH intrinsics code
+    if (UseGHASHIntrinsics) {
+      StubRoutines::_ghash_processBlocks = generate_ghash_processBlocks();
+    }
+
     if (UseAESIntrinsics) {
       StubRoutines::_aescrypt_encryptBlock = generate_aescrypt_encryptBlock();
       StubRoutines::_aescrypt_decryptBlock = generate_aescrypt_decryptBlock();
--- a/hotspot/src/cpu/aarch64/vm/vm_version_aarch64.cpp	Thu Apr 09 12:29:31 2015 +0200
+++ b/hotspot/src/cpu/aarch64/vm/vm_version_aarch64.cpp	Mon Aug 17 12:45:16 2015 +0300
@@ -45,6 +45,10 @@
 #define HWCAP_AES   (1<<3)
 #endif
 
+#ifndef HWCAP_PMULL
+#define HWCAP_PMULL (1<<4)
+#endif
+
 #ifndef HWCAP_SHA1
 #define HWCAP_SHA1  (1<<5)
 #endif
@@ -190,11 +194,6 @@
     }
   }
 
-  if (UseGHASHIntrinsics) {
-    warning("GHASH intrinsics are not available on this CPU");
-    FLAG_SET_DEFAULT(UseGHASHIntrinsics, false);
-  }
-
   if (FLAG_IS_DEFAULT(UseCRC32Intrinsics)) {
     UseCRC32Intrinsics = true;
   }
@@ -232,7 +231,7 @@
     }
   } else if (UseSHA256Intrinsics) {
     warning("Intrinsics for SHA-224 and SHA-256 crypto hash functions not available on this CPU.");
-    FLAG_SET_DEFAULT(UseSHA1Intrinsics, false);
+    FLAG_SET_DEFAULT(UseSHA256Intrinsics, false);
   }
 
   if (UseSHA512Intrinsics) {
@@ -244,6 +243,15 @@
     FLAG_SET_DEFAULT(UseSHA, false);
   }
 
+  if (auxv & HWCAP_PMULL) {
+    if (FLAG_IS_DEFAULT(UseGHASHIntrinsics)) {
+      FLAG_SET_DEFAULT(UseGHASHIntrinsics, true);
+    }
+  } else if (UseGHASHIntrinsics) {
+    warning("GHASH intrinsics are not available on this CPU");
+    FLAG_SET_DEFAULT(UseGHASHIntrinsics, false);
+  }
+
   // This machine allows unaligned memory accesses
   if (FLAG_IS_DEFAULT(UseUnalignedAccesses)) {
     FLAG_SET_DEFAULT(UseUnalignedAccesses, true);
@@ -261,6 +269,13 @@
     UsePopCountInstruction = true;
   }
 
+  if (FLAG_IS_DEFAULT(UseMontgomeryMultiplyIntrinsic)) {
+    UseMontgomeryMultiplyIntrinsic = true;
+  }
+  if (FLAG_IS_DEFAULT(UseMontgomerySquareIntrinsic)) {
+    UseMontgomerySquareIntrinsic = true;
+  }
+
 #ifdef COMPILER2
   if (FLAG_IS_DEFAULT(OptoScheduling)) {
     OptoScheduling = true;
--- a/hotspot/src/os/aix/vm/os_aix.cpp	Thu Apr 09 12:29:31 2015 +0200
+++ b/hotspot/src/os/aix/vm/os_aix.cpp	Mon Aug 17 12:45:16 2015 +0300
@@ -1550,6 +1550,13 @@
   LoadedLibraries::print(st);
 }
 
+void os::get_summary_os_info(char* buf, size_t buflen) {
+  // There might be something more readable than uname results for AIX.
+  struct utsname name;
+  uname(&name);
+  snprintf(buf, buflen, "%s %s", name.release, name.version);
+}
+
 void os::print_os_info(outputStream* st) {
   st->print("OS:");
 
@@ -1654,6 +1661,17 @@
   }
 }
 
+// Get a string for the cpuinfo that is a summary of the cpu type
+void os::get_summary_cpu_info(char* buf, size_t buflen) {
+  // This looks good
+  os::Aix::cpuinfo_t ci;
+  if (os::Aix::get_cpuinfo(&ci)) {
+    strncpy(buf, ci.version, buflen);
+  } else {
+    strncpy(buf, "AIX", buflen);
+  }
+}
+
 void os::pd_print_cpu_info(outputStream* st, char* buf, size_t buflen) {
 }
 
--- a/hotspot/src/os/bsd/vm/os_bsd.cpp	Thu Apr 09 12:29:31 2015 +0200
+++ b/hotspot/src/os/bsd/vm/os_bsd.cpp	Mon Aug 17 12:45:16 2015 +0300
@@ -1600,24 +1600,6 @@
   return dlsym(handle, name);
 }
 
-
-static bool _print_ascii_file(const char* filename, outputStream* st) {
-  int fd = ::open(filename, O_RDONLY);
-  if (fd == -1) {
-    return false;
-  }
-
-  char buf[32];
-  int bytes;
-  while ((bytes = ::read(fd, buf, sizeof(buf))) > 0) {
-    st->print_raw(buf, bytes);
-  }
-
-  ::close(fd);
-
-  return true;
-}
-
 int _print_dll_info_cb(const char * name, address base_address, address top_address, void * param) {
   outputStream * out = (outputStream *) param;
   out->print_cr(PTR_FORMAT " \t%s", base_address, name);
@@ -1678,15 +1660,38 @@
 #endif
 }
 
+void os::get_summary_os_info(char* buf, size_t buflen) {
+  // These buffers are small because we want this to be brief
+  // and not use a lot of stack while generating the hs_err file.
+  char os[100];
+  size_t size = sizeof(os);
+  int mib_kern[] = { CTL_KERN, KERN_OSTYPE };
+  if (sysctl(mib_kern, 2, os, &size, NULL, 0) < 0) {
+#ifdef __APPLE__
+      strncpy(os, "Darwin", sizeof(os));
+#elif __OpenBSD__
+      strncpy(os, "OpenBSD", sizeof(os));
+#else
+      strncpy(os, "BSD", sizeof(os));
+#endif
+  }
+
+  char release[100];
+  size = sizeof(release);
+  int mib_release[] = { CTL_KERN, KERN_OSRELEASE };
+  if (sysctl(mib_release, 2, release, &size, NULL, 0) < 0) {
+      // if error, leave blank
+      strncpy(release, "", sizeof(release));
+  }
+  snprintf(buf, buflen, "%s %s", os, release);
+}
+
 void os::print_os_info_brief(outputStream* st) {
-  st->print("Bsd");
-
   os::Posix::print_uname_info(st);
 }
 
 void os::print_os_info(outputStream* st) {
   st->print("OS:");
-  st->print("Bsd");
 
   os::Posix::print_uname_info(st);
 
@@ -1699,6 +1704,33 @@
   // Nothing to do for now.
 }
 
+void os::get_summary_cpu_info(char* buf, size_t buflen) {
+  unsigned int mhz;
+  size_t size = sizeof(mhz);
+  int mib[] = { CTL_HW, HW_CPU_FREQ };
+  if (sysctl(mib, 2, &mhz, &size, NULL, 0) < 0) {
+    mhz = 1;  // looks like an error but can be divided by
+  } else {
+    mhz /= 1000000;  // reported in millions
+  }
+
+  char model[100];
+  size = sizeof(model);
+  int mib_model[] = { CTL_HW, HW_MODEL };
+  if (sysctl(mib_model, 2, model, &size, NULL, 0) < 0) {
+    strncpy(model, cpu_arch, sizeof(model));
+  }
+
+  char machine[100];
+  size = sizeof(machine);
+  int mib_machine[] = { CTL_HW, HW_MACHINE };
+  if (sysctl(mib_machine, 2, machine, &size, NULL, 0) < 0) {
+      strncpy(machine, "", sizeof(machine));
+  }
+
+  snprintf(buf, buflen, "%s %s %d MHz", model, machine, mhz);
+}
+
 void os::print_memory_info(outputStream* st) {
 
   st->print("Memory:");
@@ -1709,11 +1741,6 @@
   st->print("(" UINT64_FORMAT "k free)",
             os::available_memory() >> 10);
   st->cr();
-
-  // meminfo
-  st->print("\n/proc/meminfo:\n");
-  _print_ascii_file("/proc/meminfo", st);
-  st->cr();
 }
 
 void os::print_siginfo(outputStream* st, void* siginfo) {
--- a/hotspot/src/os/linux/vm/os_linux.cpp	Thu Apr 09 12:29:31 2015 +0200
+++ b/hotspot/src/os/linux/vm/os_linux.cpp	Mon Aug 17 12:45:16 2015 +0300
@@ -2043,31 +2043,96 @@
 // Searching for the debian_version file is the last resort.  It contains
 // an informative string like "6.0.6" or "wheezy/sid". Because of this
 // "Debian " is printed before the contents of the debian_version file.
+
+const char* distro_files[] = {
+  "/etc/oracle-release",
+  "/etc/mandriva-release",
+  "/etc/mandrake-release",
+  "/etc/sun-release",
+  "/etc/redhat-release",
+  "/etc/lsb-release",
+  "/etc/SuSE-release",
+  "/etc/turbolinux-release",
+  "/etc/gentoo-release",
+  "/etc/ltib-release",
+  "/etc/angstrom-version",
+  "/etc/system-release",
+  "/etc/os-release",
+  NULL };
+
 void os::Linux::print_distro_info(outputStream* st) {
-  if (!_print_ascii_file("/etc/oracle-release", st) &&
-      !_print_ascii_file("/etc/mandriva-release", st) &&
-      !_print_ascii_file("/etc/mandrake-release", st) &&
-      !_print_ascii_file("/etc/sun-release", st) &&
-      !_print_ascii_file("/etc/redhat-release", st) &&
-      !_print_ascii_file("/etc/lsb-release", st) &&
-      !_print_ascii_file("/etc/SuSE-release", st) &&
-      !_print_ascii_file("/etc/turbolinux-release", st) &&
-      !_print_ascii_file("/etc/gentoo-release", st) &&
-      !_print_ascii_file("/etc/ltib-release", st) &&
-      !_print_ascii_file("/etc/angstrom-version", st) &&
-      !_print_ascii_file("/etc/system-release", st) &&
-      !_print_ascii_file("/etc/os-release", st)) {
-
-    if (file_exists("/etc/debian_version")) {
-      st->print("Debian ");
-      _print_ascii_file("/etc/debian_version", st);
-    } else {
-      st->print("Linux");
+  for (int i = 0;; i++) {
+    const char* file = distro_files[i];
+    if (file == NULL) {
+      break;  // done
     }
+    // If file prints, we found it.
+    if (_print_ascii_file(file, st)) {
+      return;
+    }
+  }
+
+  if (file_exists("/etc/debian_version")) {
+    st->print("Debian ");
+    _print_ascii_file("/etc/debian_version", st);
+  } else {
+    st->print("Linux");
   }
   st->cr();
 }
 
+static void parse_os_info(char* distro, size_t length, const char* file) {
+  FILE* fp = fopen(file, "r");
+  if (fp != NULL) {
+    char buf[256];
+    // get last line of the file.
+    while (fgets(buf, sizeof(buf), fp)) { }
+    // Edit out extra stuff in expected ubuntu format
+    if (strstr(buf, "DISTRIB_DESCRIPTION=") != NULL) {
+      char* ptr = strstr(buf, "\"");  // the name is in quotes
+      if (ptr != NULL) {
+        ptr++; // go beyond first quote
+        char* nl = strchr(ptr, '\"');
+        if (nl != NULL) *nl = '\0';
+        strncpy(distro, ptr, length);
+      } else {
+        ptr = strstr(buf, "=");
+        ptr++; // go beyond equals then
+        char* nl = strchr(ptr, '\n');
+        if (nl != NULL) *nl = '\0';
+        strncpy(distro, ptr, length);
+      }
+    } else {
+      // if not in expected Ubuntu format, print out whole line minus \n
+      char* nl = strchr(buf, '\n');
+      if (nl != NULL) *nl = '\0';
+      strncpy(distro, buf, length);
+    }
+    // close distro file
+    fclose(fp);
+  }
+}
+
+void os::get_summary_os_info(char* buf, size_t buflen) {
+  for (int i = 0;; i++) {
+    const char* file = distro_files[i];
+    if (file == NULL) {
+      break; // ran out of distro_files
+    }
+    if (file_exists(file)) {
+      parse_os_info(buf, buflen, file);
+      return;
+    }
+  }
+  // special case for debian
+  if (file_exists("/etc/debian_version")) {
+    strncpy(buf, "Debian ", buflen);
+    parse_os_info(&buf[7], buflen-7, "/etc/debian_version");
+  } else {
+    strncpy(buf, "Linux", buflen);
+  }
+}
+
 void os::Linux::print_libversion_info(outputStream* st) {
   // libc, pthread
   st->print("libc:");
@@ -2150,6 +2215,48 @@
   }
 }
 
+const char* search_string = IA32_ONLY("model name") AMD64_ONLY("model name")
+                            IA64_ONLY("") SPARC_ONLY("cpu")
+                            ARM32_ONLY("Processor") PPC_ONLY("Processor") AARCH64_ONLY("Processor");
+
+// Parses the cpuinfo file for string representing the model name.
+void os::get_summary_cpu_info(char* cpuinfo, size_t length) {
+  FILE* fp = fopen("/proc/cpuinfo", "r");
+  if (fp != NULL) {
+    while (!feof(fp)) {
+      char buf[256];
+      if (fgets(buf, sizeof(buf), fp)) {
+        char* start = strstr(buf, search_string);
+        if (start != NULL) {
+          char *ptr = start + strlen(search_string);
+          char *end = buf + strlen(buf);
+          while (ptr != end) {
+             // skip whitespace and colon for the rest of the name.
+             if (*ptr != ' ' && *ptr != '\t' && *ptr != ':') {
+               break;
+             }
+             ptr++;
+          }
+          if (ptr != end) {
+            // reasonable string, get rid of newline and keep the rest
+            char* nl = strchr(buf, '\n');
+            if (nl != NULL) *nl = '\0';
+            strncpy(cpuinfo, ptr, length);
+            fclose(fp);
+            return;
+          }
+        }
+      }
+    }
+    fclose(fp);
+  }
+  // cpuinfo not found or parsing failed, just print generic string.  The entire
+  // /proc/cpuinfo file will be printed later in the file (or enough of it for x86)
+  strncpy(cpuinfo, IA32_ONLY("x86_32") AMD64_ONLY("x86_32")
+                   IA64_ONLY("IA64") SPARC_ONLY("sparcv9")
+                   ARM32_ONLY("ARM") PPC_ONLY("PPC64") AARCH64_ONLY("AArch64"), length);
+}
+
 void os::print_siginfo(outputStream* st, void* siginfo) {
   const siginfo_t* si = (const siginfo_t*)siginfo;
 
--- a/hotspot/src/os/posix/vm/os_posix.cpp	Thu Apr 09 12:29:31 2015 +0200
+++ b/hotspot/src/os/posix/vm/os_posix.cpp	Mon Aug 17 12:45:16 2015 +0300
@@ -236,6 +236,15 @@
   st->cr();
 }
 
+#ifndef PRODUCT
+bool os::get_host_name(char* buf, size_t buflen) {
+  struct utsname name;
+  uname(&name);
+  jio_snprintf(buf, buflen, "%s", name.nodename);
+  return true;
+}
+#endif // PRODUCT
+
 bool os::has_allocatable_memory_limit(julong* limit) {
   struct rlimit rlim;
   int getrlimit_res = getrlimit(RLIMIT_AS, &rlim);
@@ -1070,7 +1079,7 @@
   return ret == 0;
 }
 
-bool PosixSemaphore::timedwait(const struct timespec ts) {
+bool PosixSemaphore::timedwait(struct timespec ts) {
   while (true) {
     int result = sem_timedwait(&_semaphore, &ts);
     if (result == 0) {
--- a/hotspot/src/os/solaris/vm/os_solaris.cpp	Thu Apr 09 12:29:31 2015 +0200
+++ b/hotspot/src/os/solaris/vm/os_solaris.cpp	Mon Aug 17 12:45:16 2015 +0300
@@ -1971,6 +1971,26 @@
   st->cr();
 }
 
+void os::get_summary_os_info(char* buf, size_t buflen) {
+  strncpy(buf, "Solaris", buflen);  // default to plain solaris
+  FILE* fp = fopen("/etc/release", "r");
+  if (fp != NULL) {
+    char tmp[256];
+    // Only get the first line and chop out everything but the os name.
+    if (fgets(tmp, sizeof(tmp), fp)) {
+      char* ptr = tmp;
+      // skip past whitespace characters
+      while (*ptr != '\0' && (*ptr == ' ' || *ptr == '\t' || *ptr == '\n')) ptr++;
+      if (*ptr != '\0') {
+        char* nl = strchr(ptr, '\n');
+        if (nl != NULL) *nl = '\0';
+        strncpy(buf, ptr, buflen);
+      }
+    }
+    fclose(fp);
+  }
+}
+
 void os::Solaris::print_libversion_info(outputStream* st) {
   st->print("  (T2 libthread)");
   st->cr();
@@ -1998,6 +2018,22 @@
   return status;
 }
 
+void os::get_summary_cpu_info(char* buf, size_t buflen) {
+  // Get MHz with system call. We don't seem to already have this.
+  processor_info_t stats;
+  processorid_t id = getcpuid();
+  int clock = 0;
+  if (processor_info(id, &stats) != -1) {
+    clock = stats.pi_clock;  // pi_processor_type isn't more informative than below
+  }
+#ifdef AMD64
+  snprintf(buf, buflen, "x86 64 bit %d MHz", clock);
+#else
+  // must be sparc
+  snprintf(buf, buflen, "Sparcv9 64 bit %d MHz", clock);
+#endif
+}
+
 void os::pd_print_cpu_info(outputStream* st, char* buf, size_t buflen) {
   // Nothing to do for now.
 }
--- a/hotspot/src/os/windows/vm/os_windows.cpp	Thu Apr 09 12:29:31 2015 +0200
+++ b/hotspot/src/os/windows/vm/os_windows.cpp	Mon Aug 17 12:45:16 2015 +0300
@@ -1593,6 +1593,21 @@
   return result;
 }
 
+#ifndef PRODUCT
+bool os::get_host_name(char* buf, size_t buflen) {
+  DWORD size = (DWORD)buflen;
+  return (GetComputerNameEx(ComputerNameDnsHostname, buf, &size) == TRUE);
+}
+#endif // PRODUCT
+
+void os::get_summary_os_info(char* buf, size_t buflen) {
+  stringStream sst(buf, buflen);
+  os::win32::print_windows_version(&sst);
+  // chop off newline character
+  char* nl = strchr(buf, '\n');
+  if (nl != NULL) *nl = '\0';
+}
+
 void os::print_os_info_brief(outputStream* st) {
   os::print_os_info(st);
 }
@@ -1600,15 +1615,14 @@
 void os::print_os_info(outputStream* st) {
 #ifdef ASSERT
   char buffer[1024];
-  DWORD size = sizeof(buffer);
-  st->print(" HostName: ");
-  if (GetComputerNameEx(ComputerNameDnsHostname, buffer, &size)) {
-    st->print("%s", buffer);
+  st->print("HostName: ");
+  if (get_host_name(buffer, sizeof(buffer))) {
+    st->print("%s ", buffer);
   } else {
-    st->print("N/A");
+    st->print("N/A ");
   }
 #endif
-  st->print(" OS:");
+  st->print("OS:");
   os::win32::print_windows_version(st);
 }
 
@@ -1738,6 +1752,23 @@
   // Nothing to do for now.
 }
 
+void os::get_summary_cpu_info(char* buf, size_t buflen) {
+  HKEY key;
+  DWORD status = RegOpenKey(HKEY_LOCAL_MACHINE,
+               "HARDWARE\\DESCRIPTION\\System\\CentralProcessor\\0", &key);
+  if (status == ERROR_SUCCESS) {
+    DWORD size = (DWORD)buflen;
+    status = RegQueryValueEx(key, "ProcessorNameString", NULL, NULL, (byte*)buf, &size);
+    if (status != ERROR_SUCCESS) {
+        strncpy(buf, "## __CPU__", buflen);
+    }
+    RegCloseKey(key);
+  } else {
+    // Put generic cpu info to return
+    strncpy(buf, "## __CPU__", buflen);
+  }
+}
+
 void os::print_memory_info(outputStream* st) {
   st->print("Memory:");
   st->print(" %dk page", os::vm_page_size()>>10);
--- a/hotspot/src/share/vm/c1/c1_Compiler.cpp	Thu Apr 09 12:29:31 2015 +0200
+++ b/hotspot/src/share/vm/c1/c1_Compiler.cpp	Mon Aug 17 12:45:16 2015 +0300
@@ -99,6 +99,164 @@
   return buffer_blob;
 }
 
+bool Compiler::is_intrinsic_supported(methodHandle method) {
+  vmIntrinsics::ID id = method->intrinsic_id();
+  assert(id != vmIntrinsics::_none, "must be a VM intrinsic");
+
+  if (method->is_synchronized()) {
+    // C1 does not support intrinsification of synchronized methods.
+    return false;
+  }
+
+  switch (id) {
+  case vmIntrinsics::_compareAndSwapLong:
+    if (!VM_Version::supports_cx8()) return false;
+    break;
+  case vmIntrinsics::_getAndAddInt:
+    if (!VM_Version::supports_atomic_getadd4()) return false;
+    break;
+  case vmIntrinsics::_getAndAddLong:
+    if (!VM_Version::supports_atomic_getadd8()) return false;
+    break;
+  case vmIntrinsics::_getAndSetInt:
+    if (!VM_Version::supports_atomic_getset4()) return false;
+    break;
+  case vmIntrinsics::_getAndSetLong:
+    if (!VM_Version::supports_atomic_getset8()) return false;
+    break;
+  case vmIntrinsics::_getAndSetObject:
+#ifdef _LP64
+    if (!UseCompressedOops && !VM_Version::supports_atomic_getset8()) return false;
+    if (UseCompressedOops && !VM_Version::supports_atomic_getset4()) return false;
+#else
+    if (!VM_Version::supports_atomic_getset4()) return false;
+#endif
+    break;
+  case vmIntrinsics::_arraycopy:
+  case vmIntrinsics::_currentTimeMillis:
+  case vmIntrinsics::_nanoTime:
+  case vmIntrinsics::_Reference_get:
+    // Use the intrinsic version of Reference.get() so that the value in
+    // the referent field can be registered by the G1 pre-barrier code.
+    // Also to prevent commoning reads from this field across safepoint
+    // since GC can change its value.
+  case vmIntrinsics::_loadFence:
+  case vmIntrinsics::_storeFence:
+  case vmIntrinsics::_fullFence:
+  case vmIntrinsics::_floatToRawIntBits:
+  case vmIntrinsics::_intBitsToFloat:
+  case vmIntrinsics::_doubleToRawLongBits:
+  case vmIntrinsics::_longBitsToDouble:
+  case vmIntrinsics::_getClass:
+  case vmIntrinsics::_isInstance:
+  case vmIntrinsics::_currentThread:
+  case vmIntrinsics::_dabs:
+  case vmIntrinsics::_dsqrt:
+  case vmIntrinsics::_dsin:
+  case vmIntrinsics::_dcos:
+  case vmIntrinsics::_dtan:
+  case vmIntrinsics::_dlog:
+  case vmIntrinsics::_dlog10:
+  case vmIntrinsics::_dexp:
+  case vmIntrinsics::_dpow:
+  case vmIntrinsics::_getObject:
+  case vmIntrinsics::_getBoolean:
+  case vmIntrinsics::_getByte:
+  case vmIntrinsics::_getShort:
+  case vmIntrinsics::_getChar:
+  case vmIntrinsics::_getInt:
+  case vmIntrinsics::_getLong:
+  case vmIntrinsics::_getFloat:
+  case vmIntrinsics::_getDouble:
+  case vmIntrinsics::_putObject:
+  case vmIntrinsics::_putBoolean:
+  case vmIntrinsics::_putByte:
+  case vmIntrinsics::_putShort:
+  case vmIntrinsics::_putChar:
+  case vmIntrinsics::_putInt:
+  case vmIntrinsics::_putLong:
+  case vmIntrinsics::_putFloat:
+  case vmIntrinsics::_putDouble:
+  case vmIntrinsics::_getObjectVolatile:
+  case vmIntrinsics::_getBooleanVolatile:
+  case vmIntrinsics::_getByteVolatile:
+  case vmIntrinsics::_getShortVolatile:
+  case vmIntrinsics::_getCharVolatile:
+  case vmIntrinsics::_getIntVolatile:
+  case vmIntrinsics::_getLongVolatile:
+  case vmIntrinsics::_getFloatVolatile:
+  case vmIntrinsics::_getDoubleVolatile:
+  case vmIntrinsics::_putObjectVolatile:
+  case vmIntrinsics::_putBooleanVolatile:
+  case vmIntrinsics::_putByteVolatile:
+  case vmIntrinsics::_putShortVolatile:
+  case vmIntrinsics::_putCharVolatile:
+  case vmIntrinsics::_putIntVolatile:
+  case vmIntrinsics::_putLongVolatile:
+  case vmIntrinsics::_putFloatVolatile:
+  case vmIntrinsics::_putDoubleVolatile:
+  case vmIntrinsics::_getByte_raw:
+  case vmIntrinsics::_getShort_raw:
+  case vmIntrinsics::_getChar_raw:
+  case vmIntrinsics::_getInt_raw:
+  case vmIntrinsics::_getLong_raw:
+  case vmIntrinsics::_getFloat_raw:
+  case vmIntrinsics::_getDouble_raw:
+  case vmIntrinsics::_putByte_raw:
+  case vmIntrinsics::_putShort_raw:
+  case vmIntrinsics::_putChar_raw:
+  case vmIntrinsics::_putInt_raw:
+  case vmIntrinsics::_putLong_raw:
+  case vmIntrinsics::_putFloat_raw:
+  case vmIntrinsics::_putDouble_raw:
+  case vmIntrinsics::_putOrderedObject:
+  case vmIntrinsics::_putOrderedInt:
+  case vmIntrinsics::_putOrderedLong:
+  case vmIntrinsics::_getShortUnaligned:
+  case vmIntrinsics::_getCharUnaligned:
+  case vmIntrinsics::_getIntUnaligned:
+  case vmIntrinsics::_getLongUnaligned:
+  case vmIntrinsics::_putShortUnaligned:
+  case vmIntrinsics::_putCharUnaligned:
+  case vmIntrinsics::_putIntUnaligned:
+  case vmIntrinsics::_putLongUnaligned:
+  case vmIntrinsics::_checkIndex:
+  case vmIntrinsics::_updateCRC32:
+  case vmIntrinsics::_updateBytesCRC32:
+  case vmIntrinsics::_updateByteBufferCRC32:
+  case vmIntrinsics::_compareAndSwapInt:
+  case vmIntrinsics::_compareAndSwapObject:
+#ifdef TRACE_HAVE_INTRINSICS
+  case vmIntrinsics::_classID:
+  case vmIntrinsics::_threadID:
+  case vmIntrinsics::_counterTime:
+#endif
+    break;
+  default:
+    return false; // Intrinsics not on the previous list are not available.
+  }
+
+  return true;
+}
+
+bool Compiler::is_intrinsic_disabled_by_flag(methodHandle method) {
+  vmIntrinsics::ID id = method->intrinsic_id();
+  assert(id != vmIntrinsics::_none, "must be a VM intrinsic");
+
+  if (vmIntrinsics::is_disabled_by_flags(id)) {
+    return true;
+  }
+
+  if (!InlineNatives && id != vmIntrinsics::_Reference_get) {
+    return true;
+  }
+
+  if (!InlineClassNatives && id == vmIntrinsics::_getClass) {
+    return true;
+  }
+
+  return false;
+}
 
 void Compiler::compile_method(ciEnv* env, ciMethod* method, int entry_bci) {
   BufferBlob* buffer_blob = CompilerThread::current()->get_buffer_blob();
@@ -117,3 +275,7 @@
 void Compiler::print_timers() {
   Compilation::print_timers();
 }
+
+bool Compiler::is_intrinsic_available(methodHandle method, methodHandle compilation_context) {
+  return is_intrinsic_supported(method) && !is_intrinsic_disabled_by_flag(method);
+}
--- a/hotspot/src/share/vm/c1/c1_Compiler.hpp	Thu Apr 09 12:29:31 2015 +0200
+++ b/hotspot/src/share/vm/c1/c1_Compiler.hpp	Mon Aug 17 12:45:16 2015 +0300
@@ -55,6 +55,18 @@
   // Print compilation timers and statistics
   virtual void print_timers();
 
+  // Check the availability of an intrinsic for 'method' given a compilation context.
+  // The compilation context is needed to support per-method usage of the
+  // DisableIntrinsic flag. However, as C1 ignores the DisableIntrinsic flag, it
+  // ignores the compilation context.
+  virtual bool is_intrinsic_available(methodHandle method, methodHandle compilation_context);
+
+  // Check if the C1 compiler supports an intrinsic for 'method'.
+  virtual bool is_intrinsic_supported(methodHandle method);
+
+  // Processing of command-line flags specific to the C1 compiler.
+  virtual bool is_intrinsic_disabled_by_flag(methodHandle method);
+
   // Size of the code buffer
   static int code_buffer_size();
 };
--- a/hotspot/src/share/vm/c1/c1_GraphBuilder.cpp	Thu Apr 09 12:29:31 2015 +0200
+++ b/hotspot/src/share/vm/c1/c1_GraphBuilder.cpp	Mon Aug 17 12:45:16 2015 +0300
@@ -3372,231 +3372,85 @@
   return NULL;
 }
 
-
-bool GraphBuilder::try_inline_intrinsics(ciMethod* callee) {
-  if (callee->is_synchronized()) {
-    // We don't currently support any synchronized intrinsics
-    return false;
-  }
-
-  // callee seems like a good candidate
-  // determine id
+void GraphBuilder::build_graph_for_intrinsic(ciMethod* callee) {
   vmIntrinsics::ID id = callee->intrinsic_id();
-  if (!InlineNatives && id != vmIntrinsics::_Reference_get) {
-    // InlineNatives does not control Reference.get
-    INLINE_BAILOUT("intrinsic method inlining disabled");
+  assert(id != vmIntrinsics::_none, "must be a VM intrinsic");
+
+  // Some intrinsics need special IR nodes.
+  switch(id) {
+  case vmIntrinsics::_getObject          : append_unsafe_get_obj(callee, T_OBJECT,  false); return;
+  case vmIntrinsics::_getBoolean         : append_unsafe_get_obj(callee, T_BOOLEAN, false); return;
+  case vmIntrinsics::_getByte            : append_unsafe_get_obj(callee, T_BYTE,    false); return;
+  case vmIntrinsics::_getShort           : append_unsafe_get_obj(callee, T_SHORT,   false); return;
+  case vmIntrinsics::_getChar            : append_unsafe_get_obj(callee, T_CHAR,    false); return;
+  case vmIntrinsics::_getInt             : append_unsafe_get_obj(callee, T_INT,     false); return;
+  case vmIntrinsics::_getLong            : append_unsafe_get_obj(callee, T_LONG,    false); return;
+  case vmIntrinsics::_getFloat           : append_unsafe_get_obj(callee, T_FLOAT,   false); return;
+  case vmIntrinsics::_getDouble          : append_unsafe_get_obj(callee, T_DOUBLE,  false); return;
+  case vmIntrinsics::_putObject          : append_unsafe_put_obj(callee, T_OBJECT,  false); return;
+  case vmIntrinsics::_putBoolean         : append_unsafe_put_obj(callee, T_BOOLEAN, false); return;
+  case vmIntrinsics::_putByte            : append_unsafe_put_obj(callee, T_BYTE,    false); return;
+  case vmIntrinsics::_putShort           : append_unsafe_put_obj(callee, T_SHORT,   false); return;
+  case vmIntrinsics::_putChar            : append_unsafe_put_obj(callee, T_CHAR,    false); return;
+  case vmIntrinsics::_putInt             : append_unsafe_put_obj(callee, T_INT,     false); return;
+  case vmIntrinsics::_putLong            : append_unsafe_put_obj(callee, T_LONG,    false); return;
+  case vmIntrinsics::_putFloat           : append_unsafe_put_obj(callee, T_FLOAT,   false); return;
+  case vmIntrinsics::_putDouble          : append_unsafe_put_obj(callee, T_DOUBLE,  false); return;
+  case vmIntrinsics::_getShortUnaligned  : append_unsafe_get_obj(callee, T_SHORT,   false); return;
+  case vmIntrinsics::_getCharUnaligned   : append_unsafe_get_obj(callee, T_CHAR,    false); return;
+  case vmIntrinsics::_getIntUnaligned    : append_unsafe_get_obj(callee, T_INT,     false); return;
+  case vmIntrinsics::_getLongUnaligned   : append_unsafe_get_obj(callee, T_LONG,    false); return;
+  case vmIntrinsics::_putShortUnaligned  : append_unsafe_put_obj(callee, T_SHORT,   false); return;
+  case vmIntrinsics::_putCharUnaligned   : append_unsafe_put_obj(callee, T_CHAR,    false); return;
+  case vmIntrinsics::_putIntUnaligned    : append_unsafe_put_obj(callee, T_INT,     false); return;
+  case vmIntrinsics::_putLongUnaligned   : append_unsafe_put_obj(callee, T_LONG,    false); return;
+  case vmIntrinsics::_getObjectVolatile  : append_unsafe_get_obj(callee, T_OBJECT,  true); return;
+  case vmIntrinsics::_getBooleanVolatile : append_unsafe_get_obj(callee, T_BOOLEAN, true); return;
+  case vmIntrinsics::_getByteVolatile    : append_unsafe_get_obj(callee, T_BYTE,    true); return;
+  case vmIntrinsics::_getShortVolatile   : append_unsafe_get_obj(callee, T_SHORT,   true); return;
+  case vmIntrinsics::_getCharVolatile    : append_unsafe_get_obj(callee, T_CHAR,    true); return;
+  case vmIntrinsics::_getIntVolatile     : append_unsafe_get_obj(callee, T_INT,     true); return;
+  case vmIntrinsics::_getLongVolatile    : append_unsafe_get_obj(callee, T_LONG,    true); return;
+  case vmIntrinsics::_getFloatVolatile   : append_unsafe_get_obj(callee, T_FLOAT,   true); return;
+  case vmIntrinsics::_getDoubleVolatile  : append_unsafe_get_obj(callee, T_DOUBLE,  true); return;
+  case vmIntrinsics::_putObjectVolatile  : append_unsafe_put_obj(callee, T_OBJECT,  true); return;
+  case vmIntrinsics::_putBooleanVolatile : append_unsafe_put_obj(callee, T_BOOLEAN, true); return;
+  case vmIntrinsics::_putByteVolatile    : append_unsafe_put_obj(callee, T_BYTE,    true); return;
+  case vmIntrinsics::_putShortVolatile   : append_unsafe_put_obj(callee, T_SHORT,   true); return;
+  case vmIntrinsics::_putCharVolatile    : append_unsafe_put_obj(callee, T_CHAR,    true); return;
+  case vmIntrinsics::_putIntVolatile     : append_unsafe_put_obj(callee, T_INT,     true); return;
+  case vmIntrinsics::_putLongVolatile    : append_unsafe_put_obj(callee, T_LONG,    true); return;
+  case vmIntrinsics::_putFloatVolatile   : append_unsafe_put_obj(callee, T_FLOAT,   true); return;
+  case vmIntrinsics::_putDoubleVolatile  : append_unsafe_put_obj(callee, T_DOUBLE,  true); return;
+  case vmIntrinsics::_getByte_raw        : append_unsafe_get_raw(callee, T_BYTE  ); return;
+  case vmIntrinsics::_getShort_raw       : append_unsafe_get_raw(callee, T_SHORT ); return;
+  case vmIntrinsics::_getChar_raw        : append_unsafe_get_raw(callee, T_CHAR  ); return;
+  case vmIntrinsics::_getInt_raw         : append_unsafe_get_raw(callee, T_INT   ); return;
+  case vmIntrinsics::_getLong_raw        : append_unsafe_get_raw(callee, T_LONG  ); return;
+  case vmIntrinsics::_getFloat_raw       : append_unsafe_get_raw(callee, T_FLOAT ); return;
+  case vmIntrinsics::_getDouble_raw      : append_unsafe_get_raw(callee, T_DOUBLE); return;
+  case vmIntrinsics::_putByte_raw        : append_unsafe_put_raw(callee, T_BYTE  ); return;
+  case vmIntrinsics::_putShort_raw       : append_unsafe_put_raw(callee, T_SHORT ); return;
+  case vmIntrinsics::_putChar_raw        : append_unsafe_put_raw(callee, T_CHAR  ); return;
+  case vmIntrinsics::_putInt_raw         : append_unsafe_put_raw(callee, T_INT   ); return;
+  case vmIntrinsics::_putLong_raw        : append_unsafe_put_raw(callee, T_LONG  ); return;
+  case vmIntrinsics::_putFloat_raw       : append_unsafe_put_raw(callee, T_FLOAT ); return;
+  case vmIntrinsics::_putDouble_raw      : append_unsafe_put_raw(callee, T_DOUBLE);  return;
+  case vmIntrinsics::_putOrderedObject   : append_unsafe_put_obj(callee, T_OBJECT,  true); return;
+  case vmIntrinsics::_putOrderedInt      : append_unsafe_put_obj(callee, T_INT,     true); return;
+  case vmIntrinsics::_putOrderedLong     : append_unsafe_put_obj(callee, T_LONG,    true); return;
+  case vmIntrinsics::_compareAndSwapLong:
+  case vmIntrinsics::_compareAndSwapInt:
+  case vmIntrinsics::_compareAndSwapObject: append_unsafe_CAS(callee); return;
+  case vmIntrinsics::_getAndAddInt:
+  case vmIntrinsics::_getAndAddLong      : append_unsafe_get_and_set_obj(callee, true); return;
+  case vmIntrinsics::_getAndSetInt       :
+  case vmIntrinsics::_getAndSetLong      :
+  case vmIntrinsics::_getAndSetObject    : append_unsafe_get_and_set_obj(callee, false); return;
+  default:
+    break;
   }
-  bool preserves_state = false;
-  bool cantrap = true;
-  switch (id) {
-    case vmIntrinsics::_arraycopy:
-      if (!InlineArrayCopy) return false;
-      break;
-
-#ifdef TRACE_HAVE_INTRINSICS
-    case vmIntrinsics::_classID:
-    case vmIntrinsics::_threadID:
-      preserves_state = true;
-      cantrap = true;
-      break;
-
-    case vmIntrinsics::_counterTime:
-      preserves_state = true;
-      cantrap = false;
-      break;
-#endif
-
-    case vmIntrinsics::_currentTimeMillis:
-    case vmIntrinsics::_nanoTime:
-      preserves_state = true;
-      cantrap = false;
-      break;
-
-    case vmIntrinsics::_floatToRawIntBits   :
-    case vmIntrinsics::_intBitsToFloat      :
-    case vmIntrinsics::_doubleToRawLongBits :
-    case vmIntrinsics::_longBitsToDouble    :
-      if (!InlineMathNatives) return false;
-      preserves_state = true;
-      cantrap = false;
-      break;
-
-    case vmIntrinsics::_getClass      :
-    case vmIntrinsics::_isInstance    :
-      if (!InlineClassNatives) return false;
-      preserves_state = true;
-      break;
-
-    case vmIntrinsics::_currentThread :
-      if (!InlineThreadNatives) return false;
-      preserves_state = true;
-      cantrap = false;
-      break;
-
-    case vmIntrinsics::_dabs          : // fall through
-    case vmIntrinsics::_dsqrt         : // fall through
-    case vmIntrinsics::_dsin          : // fall through
-    case vmIntrinsics::_dcos          : // fall through
-    case vmIntrinsics::_dtan          : // fall through
-    case vmIntrinsics::_dlog          : // fall through
-    case vmIntrinsics::_dlog10        : // fall through
-    case vmIntrinsics::_dexp          : // fall through
-    case vmIntrinsics::_dpow          : // fall through
-      if (!InlineMathNatives) return false;
-      cantrap = false;
-      preserves_state = true;
-      break;
-
-    // Use special nodes for Unsafe instructions so we can more easily
-    // perform an address-mode optimization on the raw variants
-    case vmIntrinsics::_getObject : return append_unsafe_get_obj(callee, T_OBJECT,  false);
-    case vmIntrinsics::_getBoolean: return append_unsafe_get_obj(callee, T_BOOLEAN, false);
-    case vmIntrinsics::_getByte   : return append_unsafe_get_obj(callee, T_BYTE,    false);
-    case vmIntrinsics::_getShort  : return append_unsafe_get_obj(callee, T_SHORT,   false);
-    case vmIntrinsics::_getChar   : return append_unsafe_get_obj(callee, T_CHAR,    false);
-    case vmIntrinsics::_getInt    : return append_unsafe_get_obj(callee, T_INT,     false);
-    case vmIntrinsics::_getLong   : return append_unsafe_get_obj(callee, T_LONG,    false);
-    case vmIntrinsics::_getFloat  : return append_unsafe_get_obj(callee, T_FLOAT,   false);
-    case vmIntrinsics::_getDouble : return append_unsafe_get_obj(callee, T_DOUBLE,  false);
-
-    case vmIntrinsics::_putObject : return append_unsafe_put_obj(callee, T_OBJECT,  false);
-    case vmIntrinsics::_putBoolean: return append_unsafe_put_obj(callee, T_BOOLEAN, false);
-    case vmIntrinsics::_putByte   : return append_unsafe_put_obj(callee, T_BYTE,    false);
-    case vmIntrinsics::_putShort  : return append_unsafe_put_obj(callee, T_SHORT,   false);
-    case vmIntrinsics::_putChar   : return append_unsafe_put_obj(callee, T_CHAR,    false);
-    case vmIntrinsics::_putInt    : return append_unsafe_put_obj(callee, T_INT,     false);
-    case vmIntrinsics::_putLong   : return append_unsafe_put_obj(callee, T_LONG,    false);
-    case vmIntrinsics::_putFloat  : return append_unsafe_put_obj(callee, T_FLOAT,   false);
-    case vmIntrinsics::_putDouble : return append_unsafe_put_obj(callee, T_DOUBLE,  false);
-
-    case vmIntrinsics::_getShortUnaligned  :
-      return UseUnalignedAccesses ? append_unsafe_get_obj(callee, T_SHORT,   false) : false;
-    case vmIntrinsics::_getCharUnaligned   :
-      return UseUnalignedAccesses ? append_unsafe_get_obj(callee, T_CHAR,    false) : false;
-    case vmIntrinsics::_getIntUnaligned    :
-      return UseUnalignedAccesses ? append_unsafe_get_obj(callee, T_INT,     false) : false;
-    case vmIntrinsics::_getLongUnaligned   :
-      return UseUnalignedAccesses ? append_unsafe_get_obj(callee, T_LONG,    false) : false;
-
-    case vmIntrinsics::_putShortUnaligned  :
-      return UseUnalignedAccesses ? append_unsafe_put_obj(callee, T_SHORT,   false) : false;
-    case vmIntrinsics::_putCharUnaligned   :
-      return UseUnalignedAccesses ? append_unsafe_put_obj(callee, T_CHAR,    false) : false;
-    case vmIntrinsics::_putIntUnaligned    :
-      return UseUnalignedAccesses ? append_unsafe_put_obj(callee, T_INT,     false) : false;
-    case vmIntrinsics::_putLongUnaligned   :
-      return UseUnalignedAccesses ? append_unsafe_put_obj(callee, T_LONG,    false) : false;
-
-    case vmIntrinsics::_getObjectVolatile : return append_unsafe_get_obj(callee, T_OBJECT,  true);
-    case vmIntrinsics::_getBooleanVolatile: return append_unsafe_get_obj(callee, T_BOOLEAN, true);
-    case vmIntrinsics::_getByteVolatile   : return append_unsafe_get_obj(callee, T_BYTE,    true);
-    case vmIntrinsics::_getShortVolatile  : return append_unsafe_get_obj(callee, T_SHORT,   true);
-    case vmIntrinsics::_getCharVolatile   : return append_unsafe_get_obj(callee, T_CHAR,    true);
-    case vmIntrinsics::_getIntVolatile    : return append_unsafe_get_obj(callee, T_INT,     true);
-    case vmIntrinsics::_getLongVolatile   : return append_unsafe_get_obj(callee, T_LONG,    true);
-    case vmIntrinsics::_getFloatVolatile  : return append_unsafe_get_obj(callee, T_FLOAT,   true);
-    case vmIntrinsics::_getDoubleVolatile : return append_unsafe_get_obj(callee, T_DOUBLE,  true);
-
-    case vmIntrinsics::_putObjectVolatile : return append_unsafe_put_obj(callee, T_OBJECT,  true);
-    case vmIntrinsics::_putBooleanVolatile: return append_unsafe_put_obj(callee, T_BOOLEAN, true);
-    case vmIntrinsics::_putByteVolatile   : return append_unsafe_put_obj(callee, T_BYTE,    true);
-    case vmIntrinsics::_putShortVolatile  : return append_unsafe_put_obj(callee, T_SHORT,   true);
-    case vmIntrinsics::_putCharVolatile   : return append_unsafe_put_obj(callee, T_CHAR,    true);
-    case vmIntrinsics::_putIntVolatile    : return append_unsafe_put_obj(callee, T_INT,     true);
-    case vmIntrinsics::_putLongVolatile   : return append_unsafe_put_obj(callee, T_LONG,    true);
-    case vmIntrinsics::_putFloatVolatile  : return append_unsafe_put_obj(callee, T_FLOAT,   true);
-    case vmIntrinsics::_putDoubleVolatile : return append_unsafe_put_obj(callee, T_DOUBLE,  true);
-
-    case vmIntrinsics::_getByte_raw   : return append_unsafe_get_raw(callee, T_BYTE);
-    case vmIntrinsics::_getShort_raw  : return append_unsafe_get_raw(callee, T_SHORT);
-    case vmIntrinsics::_getChar_raw   : return append_unsafe_get_raw(callee, T_CHAR);
-    case vmIntrinsics::_getInt_raw    : return append_unsafe_get_raw(callee, T_INT);
-    case vmIntrinsics::_getLong_raw   : return append_unsafe_get_raw(callee, T_LONG);
-    case vmIntrinsics::_getFloat_raw  : return append_unsafe_get_raw(callee, T_FLOAT);
-    case vmIntrinsics::_getDouble_raw : return append_unsafe_get_raw(callee, T_DOUBLE);
-
-    case vmIntrinsics::_putByte_raw   : return append_unsafe_put_raw(callee, T_BYTE);
-    case vmIntrinsics::_putShort_raw  : return append_unsafe_put_raw(callee, T_SHORT);
-    case vmIntrinsics::_putChar_raw   : return append_unsafe_put_raw(callee, T_CHAR);
-    case vmIntrinsics::_putInt_raw    : return append_unsafe_put_raw(callee, T_INT);
-    case vmIntrinsics::_putLong_raw   : return append_unsafe_put_raw(callee, T_LONG);
-    case vmIntrinsics::_putFloat_raw  : return append_unsafe_put_raw(callee, T_FLOAT);
-    case vmIntrinsics::_putDouble_raw : return append_unsafe_put_raw(callee, T_DOUBLE);
-
-    case vmIntrinsics::_checkIndex    :
-      if (!InlineNIOCheckIndex) return false;
-      preserves_state = true;
-      break;
-    case vmIntrinsics::_putOrderedObject : return append_unsafe_put_obj(callee, T_OBJECT,  true);
-    case vmIntrinsics::_putOrderedInt    : return append_unsafe_put_obj(callee, T_INT,     true);
-    case vmIntrinsics::_putOrderedLong   : return append_unsafe_put_obj(callee, T_LONG,    true);
-
-    case vmIntrinsics::_compareAndSwapLong:
-      if (!VM_Version::supports_cx8()) return false;
-      // fall through
-    case vmIntrinsics::_compareAndSwapInt:
-    case vmIntrinsics::_compareAndSwapObject:
-      append_unsafe_CAS(callee);
-      return true;
-
-    case vmIntrinsics::_getAndAddInt:
-      if (!VM_Version::supports_atomic_getadd4()) {
-        return false;
-      }
-      return append_unsafe_get_and_set_obj(callee, true);
-    case vmIntrinsics::_getAndAddLong:
-      if (!VM_Version::supports_atomic_getadd8()) {
-        return false;
-      }
-      return append_unsafe_get_and_set_obj(callee, true);
-    case vmIntrinsics::_getAndSetInt:
-      if (!VM_Version::supports_atomic_getset4()) {
-        return false;
-      }
-      return append_unsafe_get_and_set_obj(callee, false);
-    case vmIntrinsics::_getAndSetLong:
-      if (!VM_Version::supports_atomic_getset8()) {
-        return false;
-      }
-      return append_unsafe_get_and_set_obj(callee, false);
-    case vmIntrinsics::_getAndSetObject:
-#ifdef _LP64
-      if (!UseCompressedOops && !VM_Version::supports_atomic_getset8()) {
-        return false;
-      }
-      if (UseCompressedOops && !VM_Version::supports_atomic_getset4()) {
-        return false;
-      }
-#else
-      if (!VM_Version::supports_atomic_getset4()) {
-        return false;
-      }
-#endif
-      return append_unsafe_get_and_set_obj(callee, false);
-
-    case vmIntrinsics::_Reference_get:
-      // Use the intrinsic version of Reference.get() so that the value in
-      // the referent field can be registered by the G1 pre-barrier code.
-      // Also to prevent commoning reads from this field across safepoint
-      // since GC can change its value.
-      preserves_state = true;
-      break;
-
-    case vmIntrinsics::_updateCRC32:
-    case vmIntrinsics::_updateBytesCRC32:
-    case vmIntrinsics::_updateByteBufferCRC32:
-      if (!UseCRC32Intrinsics) return false;
-      cantrap = false;
-      preserves_state = true;
-      break;
-
-    case vmIntrinsics::_loadFence :
-    case vmIntrinsics::_storeFence:
-    case vmIntrinsics::_fullFence :
-      break;
-
-    default                       : return false; // do not inline
-  }
+
   // create intrinsic node
   const bool has_receiver = !callee->is_static();
   ValueType* result_type = as_ValueType(callee->return_type());
@@ -3621,8 +3475,10 @@
     }
   }
 
-  Intrinsic* result = new Intrinsic(result_type, id, args, has_receiver, state_before,
-                                    preserves_state, cantrap);
+  Intrinsic* result = new Intrinsic(result_type, callee->intrinsic_id(),
+                                    args, has_receiver, state_before,
+                                    vmIntrinsics::preserves_state(id),
+                                    vmIntrinsics::can_trap(id));
   // append instruction & push result
   Value value = append_split(result);
   if (result_type != voidType) push(result_type, value);
@@ -3630,8 +3486,22 @@
   if (callee != method() && profile_return() && result_type->is_object_kind()) {
     profile_return_type(result, callee);
   }
-
-  // done
+}
+
+bool GraphBuilder::try_inline_intrinsics(ciMethod* callee) {
+  // For calling is_intrinsic_available we need to transition to
+  // the '_thread_in_vm' state because is_intrinsic_available()
+  // does not accesses critical VM-internal data.
+  if (!_compilation->compiler()->is_intrinsic_available(callee->get_Method(), NULL)) {
+    if (!InlineNatives) {
+      // Return false and also set message that the inlining of
+      // intrinsics has been disabled in general.
+      INLINE_BAILOUT("intrinsic method inlining disabled");
+    } else {
+      return false;
+    }
+  }
+  build_graph_for_intrinsic(callee);
   return true;
 }
 
@@ -4224,58 +4094,46 @@
   _scope_data = scope_data()->parent();
 }
 
-bool GraphBuilder::append_unsafe_get_obj(ciMethod* callee, BasicType t, bool is_volatile) {
-  if (InlineUnsafeOps) {
-    Values* args = state()->pop_arguments(callee->arg_size());
-    null_check(args->at(0));
-    Instruction* offset = args->at(2);
+void GraphBuilder::append_unsafe_get_obj(ciMethod* callee, BasicType t, bool is_volatile) {
+  Values* args = state()->pop_arguments(callee->arg_size());
+  null_check(args->at(0));
+  Instruction* offset = args->at(2);
 #ifndef _LP64
-    offset = append(new Convert(Bytecodes::_l2i, offset, as_ValueType(T_INT)));
+  offset = append(new Convert(Bytecodes::_l2i, offset, as_ValueType(T_INT)));
 #endif
-    Instruction* op = append(new UnsafeGetObject(t, args->at(1), offset, is_volatile));
-    push(op->type(), op);
-    compilation()->set_has_unsafe_access(true);
-  }
-  return InlineUnsafeOps;
+  Instruction* op = append(new UnsafeGetObject(t, args->at(1), offset, is_volatile));
+  push(op->type(), op);
+  compilation()->set_has_unsafe_access(true);
 }
 
 
-bool GraphBuilder::append_unsafe_put_obj(ciMethod* callee, BasicType t, bool is_volatile) {
-  if (InlineUnsafeOps) {
-    Values* args = state()->pop_arguments(callee->arg_size());
-    null_check(args->at(0));
-    Instruction* offset = args->at(2);
+void GraphBuilder::append_unsafe_put_obj(ciMethod* callee, BasicType t, bool is_volatile) {
+  Values* args = state()->pop_arguments(callee->arg_size());
+  null_check(args->at(0));
+  Instruction* offset = args->at(2);
 #ifndef _LP64
-    offset = append(new Convert(Bytecodes::_l2i, offset, as_ValueType(T_INT)));
+  offset = append(new Convert(Bytecodes::_l2i, offset, as_ValueType(T_INT)));
 #endif
-    Instruction* op = append(new UnsafePutObject(t, args->at(1), offset, args->at(3), is_volatile));
-    compilation()->set_has_unsafe_access(true);
-    kill_all();
-  }
-  return InlineUnsafeOps;
+  Instruction* op = append(new UnsafePutObject(t, args->at(1), offset, args->at(3), is_volatile));
+  compilation()->set_has_unsafe_access(true);
+  kill_all();
 }
 
 
-bool GraphBuilder::append_unsafe_get_raw(ciMethod* callee, BasicType t) {
-  if (InlineUnsafeOps) {
-    Values* args = state()->pop_arguments(callee->arg_size());
-    null_check(args->at(0));
-    Instruction* op = append(new UnsafeGetRaw(t, args->at(1), false));
-    push(op->type(), op);
-    compilation()->set_has_unsafe_access(true);
-  }
-  return InlineUnsafeOps;
+void GraphBuilder::append_unsafe_get_raw(ciMethod* callee, BasicType t) {
+  Values* args = state()->pop_arguments(callee->arg_size());
+  null_check(args->at(0));
+  Instruction* op = append(new UnsafeGetRaw(t, args->at(1), false));
+  push(op->type(), op);
+  compilation()->set_has_unsafe_access(true);
 }
 
 
-bool GraphBuilder::append_unsafe_put_raw(ciMethod* callee, BasicType t) {
-  if (InlineUnsafeOps) {
-    Values* args = state()->pop_arguments(callee->arg_size());
-    null_check(args->at(0));
-    Instruction* op = append(new UnsafePutRaw(t, args->at(1), args->at(2)));
-    compilation()->set_has_unsafe_access(true);
-  }
-  return InlineUnsafeOps;
+void GraphBuilder::append_unsafe_put_raw(ciMethod* callee, BasicType t) {
+  Values* args = state()->pop_arguments(callee->arg_size());
+  null_check(args->at(0));
+  Instruction* op = append(new UnsafePutRaw(t, args->at(1), args->at(2)));
+  compilation()->set_has_unsafe_access(true);
 }
 
 
@@ -4352,21 +4210,18 @@
   }
 }
 
-bool GraphBuilder::append_unsafe_get_and_set_obj(ciMethod* callee, bool is_add) {
-  if (InlineUnsafeOps) {
-    Values* args = state()->pop_arguments(callee->arg_size());
-    BasicType t = callee->return_type()->basic_type();
-    null_check(args->at(0));
-    Instruction* offset = args->at(2);
+void GraphBuilder::append_unsafe_get_and_set_obj(ciMethod* callee, bool is_add) {
+  Values* args = state()->pop_arguments(callee->arg_size());
+  BasicType t = callee->return_type()->basic_type();
+  null_check(args->at(0));
+  Instruction* offset = args->at(2);
 #ifndef _LP64
-    offset = append(new Convert(Bytecodes::_l2i, offset, as_ValueType(T_INT)));
+  offset = append(new Convert(Bytecodes::_l2i, offset, as_ValueType(T_INT)));
 #endif
-    Instruction* op = append(new UnsafeGetAndSetObject(t, args->at(1), offset, args->at(3), is_add));
-    compilation()->set_has_unsafe_access(true);
-    kill_all();
-    push(op->type(), op);
-  }
-  return InlineUnsafeOps;
+  Instruction* op = append(new UnsafeGetAndSetObject(t, args->at(1), offset, args->at(3), is_add));
+  compilation()->set_has_unsafe_access(true);
+  kill_all();
+  push(op->type(), op);
 }
 
 #ifndef PRODUCT
--- a/hotspot/src/share/vm/c1/c1_GraphBuilder.hpp	Thu Apr 09 12:29:31 2015 +0200
+++ b/hotspot/src/share/vm/c1/c1_GraphBuilder.hpp	Mon Aug 17 12:45:16 2015 +0300
@@ -339,6 +339,8 @@
   void inline_sync_entry(Value lock, BlockBegin* sync_handler);
   void fill_sync_handler(Value lock, BlockBegin* sync_handler, bool default_handler = false);
 
+  void build_graph_for_intrinsic(ciMethod* callee);
+
   // inliners
   bool try_inline(           ciMethod* callee, bool holder_known, Bytecodes::Code bc = Bytecodes::_illegal, Value receiver = NULL);
   bool try_inline_intrinsics(ciMethod* callee);
@@ -364,12 +366,12 @@
   void pop_scope();
   void pop_scope_for_jsr();
 
-  bool append_unsafe_get_obj(ciMethod* callee, BasicType t, bool is_volatile);
-  bool append_unsafe_put_obj(ciMethod* callee, BasicType t, bool is_volatile);
-  bool append_unsafe_get_raw(ciMethod* callee, BasicType t);
-  bool append_unsafe_put_raw(ciMethod* callee, BasicType t);
+  void append_unsafe_get_obj(ciMethod* callee, BasicType t, bool is_volatile);
+  void append_unsafe_put_obj(ciMethod* callee, BasicType t, bool is_volatile);
+  void append_unsafe_get_raw(ciMethod* callee, BasicType t);
+  void append_unsafe_put_raw(ciMethod* callee, BasicType t);
   void append_unsafe_CAS(ciMethod* callee);
-  bool append_unsafe_get_and_set_obj(ciMethod* callee, bool is_add);
+  void append_unsafe_get_and_set_obj(ciMethod* callee, bool is_add);
 
   void print_inlining(ciMethod* callee, const char* msg = NULL, bool success = true);
 
--- a/hotspot/src/share/vm/c1/c1_ValueType.cpp	Thu Apr 09 12:29:31 2015 +0200
+++ b/hotspot/src/share/vm/c1/c1_ValueType.cpp	Mon Aug 17 12:45:16 2015 +0300
@@ -153,7 +153,19 @@
     case T_FLOAT  : return new FloatConstant (value.as_float ());
     case T_DOUBLE : return new DoubleConstant(value.as_double());
     case T_ARRAY  : // fall through (ciConstant doesn't have an array accessor)
-    case T_OBJECT : return new ObjectConstant(value.as_object());
+    case T_OBJECT : {
+      // TODO: Common the code with GraphBuilder::load_constant?
+      ciObject* obj = value.as_object();
+      if (obj->is_null_object())
+        return objectNull;
+      if (obj->is_loaded()) {
+        if (obj->is_array())
+          return new ArrayConstant(obj->as_array());
+        else if (obj->is_instance())
+          return new InstanceConstant(obj->as_instance());
+      }
+      return new ObjectConstant(obj);
+    }
   }
   ShouldNotReachHere();
   return illegalType;
--- a/hotspot/src/share/vm/classfile/javaClasses.cpp	Thu Apr 09 12:29:31 2015 +0200
+++ b/hotspot/src/share/vm/classfile/javaClasses.cpp	Mon Aug 17 12:45:16 2015 +0300
@@ -809,6 +809,22 @@
   return name;
 }
 
+// Returns the Java name for this Java mirror (Resource allocated)
+// See Klass::external_name().
+// For primitive type Java mirrors, its type name is returned.
+const char* java_lang_Class::as_external_name(oop java_class) {
+  assert(java_lang_Class::is_instance(java_class), "must be a Class object");
+  const char* name = NULL;
+  if (is_primitive(java_class)) {
+    name = type2name(primitive_type(java_class));
+  } else {
+    name = as_Klass(java_class)->external_name();
+  }
+  if (name == NULL) {
+    name = "<null>";
+  }
+  return name;
+}
 
 Klass* java_lang_Class::array_klass(oop java_class) {
   Klass* k = ((Klass*)java_class->metadata_field(_array_klass_offset));
@@ -1468,6 +1484,19 @@
 
 };
 
+Symbol* get_source_file_name(InstanceKlass* holder, int version) {
+  // Find the specific ik version that contains this source_file_name_index
+  // via the previous versions list, but use the current version's
+  // constant pool to look it up.  The previous version's index has been
+  // merged for the current constant pool.
+  InstanceKlass* ik = holder->get_klass_version(version);
+  // This version has been cleaned up.
+  if (ik == NULL) return NULL;
+  int source_file_name_index = ik->source_file_name_index();
+  return (source_file_name_index == 0) ?
+      (Symbol*)NULL : holder->constants()->symbol_at(source_file_name_index);
+}
+
 // Print stack trace element to resource allocated buffer
 char* java_lang_Throwable::print_stack_element_to_buffer(Handle mirror,
                                   int method_id, int version, int bci, int cpref) {
@@ -1484,17 +1513,11 @@
   char* method_name = sym->as_C_string();
   buf_len += (int)strlen(method_name);
 
-  // Use specific ik version as a holder since the mirror might
-  // refer to version that is now obsolete and no longer accessible
-  // via the previous versions list.
-  holder = holder->get_klass_version(version);
   char* source_file_name = NULL;
-  if (holder != NULL) {
-    Symbol* source = holder->source_file_name();
-    if (source != NULL) {
-      source_file_name = source->as_C_string();
-      buf_len += (int)strlen(source_file_name);
-    }
+  Symbol* source = get_source_file_name(holder, version);
+  if (source != NULL) {
+    source_file_name = source->as_C_string();
+    buf_len += (int)strlen(source_file_name);
   }
 
   // Allocate temporary buffer with extra space for formatting and line number
@@ -1909,12 +1932,7 @@
     java_lang_StackTraceElement::set_lineNumber(element(), -1);
   } else {
     // Fill in source file name and line number.
-    // Use specific ik version as a holder since the mirror might
-    // refer to version that is now obsolete and no longer accessible
-    // via the previous versions list.
-    holder = holder->get_klass_version(version);
-    assert(holder != NULL, "sanity check");
-    Symbol* source = holder->source_file_name();
+    Symbol* source = get_source_file_name(holder, version);
     if (ShowHiddenFrames && source == NULL)
       source = vmSymbols::unknown_class_name();
     oop filename = StringTable::intern(source, CHECK_0);
--- a/hotspot/src/share/vm/classfile/javaClasses.hpp	Thu Apr 09 12:29:31 2015 +0200
+++ b/hotspot/src/share/vm/classfile/javaClasses.hpp	Mon Aug 17 12:45:16 2015 +0300
@@ -276,6 +276,7 @@
   }
   static Symbol* as_signature(oop java_class, bool intern_if_not_found, TRAPS);
   static void print_signature(oop java_class, outputStream *st);
+  static const char* as_external_name(oop java_class);
   // Testing
   static bool is_instance(oop obj);
 
--- a/hotspot/src/share/vm/classfile/verificationType.cpp	Thu Apr 09 12:29:31 2015 +0200
+++ b/hotspot/src/share/vm/classfile/verificationType.cpp	Mon Aug 17 12:45:16 2015 +0300
@@ -86,7 +86,7 @@
     VerificationType comp_this = get_component(context, CHECK_false);
     VerificationType comp_from = from.get_component(context, CHECK_false);
     if (!comp_this.is_bogus() && !comp_from.is_bogus()) {
-      return comp_this.is_assignable_from(comp_from, context,
+      return comp_this.is_component_assignable_from(comp_from, context,
                                           from_field_is_protected, CHECK_false);
     }
   }
--- a/hotspot/src/share/vm/classfile/verificationType.hpp	Thu Apr 09 12:29:31 2015 +0200
+++ b/hotspot/src/share/vm/classfile/verificationType.hpp	Mon Aug 17 12:45:16 2015 +0300
@@ -297,6 +297,26 @@
     }
   }
 
+  // Check to see if one array component type is assignable to another.
+  // Same as is_assignable_from() except int primitives must be identical.
+  bool is_component_assignable_from(
+      const VerificationType& from, ClassVerifier* context,
+      bool from_field_is_protected, TRAPS) const {
+    if (equals(from) || is_bogus()) {
+      return true;
+    } else {
+      switch(_u._data) {
+        case Boolean:
+        case Byte:
+        case Char:
+        case Short:
+          return false;
+        default:
+          return is_assignable_from(from, context, from_field_is_protected, CHECK_false);
+      }
+    }
+  }
+
   VerificationType get_component(ClassVerifier* context, TRAPS) const;
 
   int dimensions() const {
--- a/hotspot/src/share/vm/classfile/vmSymbols.cpp	Thu Apr 09 12:29:31 2015 +0200
+++ b/hotspot/src/share/vm/classfile/vmSymbols.cpp	Mon Aug 17 12:45:16 2015 +0300
@@ -324,6 +324,319 @@
   return vmIntrinsics::_none;
 }
 
+bool vmIntrinsics::preserves_state(vmIntrinsics::ID id) {
+  assert(id != vmIntrinsics::_none, "must be a VM intrinsic");
+  switch(id) {
+#ifdef TRACE_HAVE_INTRINSICS
+  case vmIntrinsics::_classID:
+  case vmIntrinsics::_threadID:
+  case vmIntrinsics::_counterTime:
+#endif
+  case vmIntrinsics::_currentTimeMillis:
+  case vmIntrinsics::_nanoTime:
+  case vmIntrinsics::_floatToRawIntBits:
+  case vmIntrinsics::_intBitsToFloat:
+  case vmIntrinsics::_doubleToRawLongBits:
+  case vmIntrinsics::_longBitsToDouble:
+  case vmIntrinsics::_getClass:
+  case vmIntrinsics::_isInstance:
+  case vmIntrinsics::_currentThread:
+  case vmIntrinsics::_dabs:
+  case vmIntrinsics::_dsqrt:
+  case vmIntrinsics::_dsin:
+  case vmIntrinsics::_dcos:
+  case vmIntrinsics::_dtan:
+  case vmIntrinsics::_dlog:
+  case vmIntrinsics::_dlog10:
+  case vmIntrinsics::_dexp:
+  case vmIntrinsics::_dpow:
+  case vmIntrinsics::_checkIndex:
+  case vmIntrinsics::_Reference_get:
+  case vmIntrinsics::_updateCRC32:
+  case vmIntrinsics::_updateBytesCRC32:
+  case vmIntrinsics::_updateByteBufferCRC32:
+    return true;
+  default:
+    return false;
+  }
+}
+
+bool vmIntrinsics::can_trap(vmIntrinsics::ID id) {
+  assert(id != vmIntrinsics::_none, "must be a VM intrinsic");
+  switch(id) {
+#ifdef TRACE_HAVE_INTRINSICS
+  case vmIntrinsics::_counterTime:
+#endif
+  case vmIntrinsics::_currentTimeMillis:
+  case vmIntrinsics::_nanoTime:
+  case vmIntrinsics::_floatToRawIntBits:
+  case vmIntrinsics::_intBitsToFloat:
+  case vmIntrinsics::_doubleToRawLongBits:
+  case vmIntrinsics::_longBitsToDouble:
+  case vmIntrinsics::_currentThread:
+  case vmIntrinsics::_dabs:
+  case vmIntrinsics::_dsqrt:
+  case vmIntrinsics::_dsin:
+  case vmIntrinsics::_dcos:
+  case vmIntrinsics::_dtan:
+  case vmIntrinsics::_dlog:
+  case vmIntrinsics::_dlog10:
+  case vmIntrinsics::_dexp:
+  case vmIntrinsics::_dpow:
+  case vmIntrinsics::_updateCRC32:
+  case vmIntrinsics::_updateBytesCRC32:
+  case vmIntrinsics::_updateByteBufferCRC32:
+    return false;
+  default:
+    return true;
+  }
+}
+
+bool vmIntrinsics::does_virtual_dispatch(vmIntrinsics::ID id) {
+  assert(id != vmIntrinsics::_none, "must be a VM intrinsic");
+  switch(id) {
+  case vmIntrinsics::_hashCode:
+  case vmIntrinsics::_clone:
+    return true;
+    break;
+  default:
+    return false;
+  }
+}
+
+int vmIntrinsics::predicates_needed(vmIntrinsics::ID id) {
+  assert(id != vmIntrinsics::_none, "must be a VM intrinsic");
+  switch (id) {
+  case vmIntrinsics::_cipherBlockChaining_encryptAESCrypt:
+  case vmIntrinsics::_cipherBlockChaining_decryptAESCrypt:
+    return 1;
+  case vmIntrinsics::_digestBase_implCompressMB:
+    return 3;
+  default:
+    return 0;
+  }
+}
+
+bool vmIntrinsics::is_disabled_by_flags(vmIntrinsics::ID id) {
+  assert(id != vmIntrinsics::_none, "must be a VM intrinsic");
+  switch (id) {
+  case vmIntrinsics::_isInstance:
+  case vmIntrinsics::_isAssignableFrom:
+  case vmIntrinsics::_getModifiers:
+  case vmIntrinsics::_isInterface:
+  case vmIntrinsics::_isArray:
+  case vmIntrinsics::_isPrimitive:
+  case vmIntrinsics::_getSuperclass:
+  case vmIntrinsics::_Class_cast:
+  case vmIntrinsics::_getLength:
+  case vmIntrinsics::_newArray:
+    if (!InlineClassNatives) return true;
+    break;
+  case vmIntrinsics::_currentThread:
+  case vmIntrinsics::_isInterrupted:
+    if (!InlineThreadNatives) return true;
+    break;
+  case vmIntrinsics::_floatToRawIntBits:
+  case vmIntrinsics::_intBitsToFloat:
+  case vmIntrinsics::_doubleToRawLongBits:
+  case vmIntrinsics::_longBitsToDouble:
+  case vmIntrinsics::_dabs:
+  case vmIntrinsics::_dsqrt:
+  case vmIntrinsics::_dsin:
+  case vmIntrinsics::_dcos:
+  case vmIntrinsics::_dtan:
+  case vmIntrinsics::_dlog:
+  case vmIntrinsics::_dexp:
+  case vmIntrinsics::_dpow:
+  case vmIntrinsics::_dlog10:
+  case vmIntrinsics::_datan2:
+  case vmIntrinsics::_min:
+  case vmIntrinsics::_max:
+  case vmIntrinsics::_floatToIntBits:
+  case vmIntrinsics::_doubleToLongBits:
+    if (!InlineMathNatives) return true;
+    break;
+  case vmIntrinsics::_arraycopy:
+    if (!InlineArrayCopy) return true;
+    break;
+  case vmIntrinsics::_updateCRC32:
+  case vmIntrinsics::_updateBytesCRC32:
+  case vmIntrinsics::_updateByteBufferCRC32:
+    if (!UseCRC32Intrinsics) return true;
+    break;
+  case vmIntrinsics::_getObject:
+  case vmIntrinsics::_getBoolean:
+  case vmIntrinsics::_getByte:
+  case vmIntrinsics::_getShort:
+  case vmIntrinsics::_getChar:
+  case vmIntrinsics::_getInt:
+  case vmIntrinsics::_getLong:
+  case vmIntrinsics::_getFloat:
+  case vmIntrinsics::_getDouble:
+  case vmIntrinsics::_putObject:
+  case vmIntrinsics::_putBoolean:
+  case vmIntrinsics::_putByte:
+  case vmIntrinsics::_putShort:
+  case vmIntrinsics::_putChar:
+  case vmIntrinsics::_putInt:
+  case vmIntrinsics::_putLong:
+  case vmIntrinsics::_putFloat:
+  case vmIntrinsics::_putDouble:
+  case vmIntrinsics::_getObjectVolatile:
+  case vmIntrinsics::_getBooleanVolatile:
+  case vmIntrinsics::_getByteVolatile:
+  case vmIntrinsics::_getShortVolatile:
+  case vmIntrinsics::_getCharVolatile:
+  case vmIntrinsics::_getIntVolatile:
+  case vmIntrinsics::_getLongVolatile:
+  case vmIntrinsics::_getFloatVolatile:
+  case vmIntrinsics::_getDoubleVolatile:
+  case vmIntrinsics::_putObjectVolatile:
+  case vmIntrinsics::_putBooleanVolatile:
+  case vmIntrinsics::_putByteVolatile:
+  case vmIntrinsics::_putShortVolatile:
+  case vmIntrinsics::_putCharVolatile:
+  case vmIntrinsics::_putIntVolatile:
+  case vmIntrinsics::_putLongVolatile:
+  case vmIntrinsics::_putFloatVolatile:
+  case vmIntrinsics::_putDoubleVolatile:
+  case vmIntrinsics::_getByte_raw:
+  case vmIntrinsics::_getShort_raw:
+  case vmIntrinsics::_getChar_raw:
+  case vmIntrinsics::_getInt_raw:
+  case vmIntrinsics::_getLong_raw:
+  case vmIntrinsics::_getFloat_raw:
+  case vmIntrinsics::_getDouble_raw:
+  case vmIntrinsics::_putByte_raw:
+  case vmIntrinsics::_putShort_raw:
+  case vmIntrinsics::_putChar_raw:
+  case vmIntrinsics::_putInt_raw:
+  case vmIntrinsics::_putLong_raw:
+  case vmIntrinsics::_putFloat_raw:
+  case vmIntrinsics::_putDouble_raw:
+  case vmIntrinsics::_putOrderedObject:
+  case vmIntrinsics::_putOrderedLong:
+  case vmIntrinsics::_putOrderedInt:
+  case vmIntrinsics::_getAndAddInt:
+  case vmIntrinsics::_getAndAddLong:
+  case vmIntrinsics::_getAndSetInt:
+  case vmIntrinsics::_getAndSetLong:
+  case vmIntrinsics::_getAndSetObject:
+    if (!InlineUnsafeOps) return true;
+    break;
+  case vmIntrinsics::_getShortUnaligned:
+  case vmIntrinsics::_getCharUnaligned:
+  case vmIntrinsics::_getIntUnaligned:
+  case vmIntrinsics::_getLongUnaligned:
+  case vmIntrinsics::_putShortUnaligned:
+  case vmIntrinsics::_putCharUnaligned:
+  case vmIntrinsics::_putIntUnaligned:
+  case vmIntrinsics::_putLongUnaligned:
+  case vmIntrinsics::_allocateInstance:
+  case vmIntrinsics::_getAddress_raw:
+  case vmIntrinsics::_putAddress_raw:
+    if (!InlineUnsafeOps || !UseUnalignedAccesses) return true;
+    break;
+  case vmIntrinsics::_hashCode:
+    if (!InlineObjectHash) return true;
+    break;
+  case vmIntrinsics::_aescrypt_encryptBlock:
+  case vmIntrinsics::_aescrypt_decryptBlock:
+    if (!UseAESIntrinsics) return true;
+    break;
+  case vmIntrinsics::_cipherBlockChaining_encryptAESCrypt:
+  case vmIntrinsics::_cipherBlockChaining_decryptAESCrypt:
+    if (!UseAESIntrinsics) return true;
+    break;
+  case vmIntrinsics::_sha_implCompress:
+    if (!UseSHA1Intrinsics) return true;
+    break;
+  case vmIntrinsics::_sha2_implCompress:
+    if (!UseSHA256Intrinsics) return true;
+    break;
+  case vmIntrinsics::_sha5_implCompress:
+    if (!UseSHA512Intrinsics) return true;
+    break;
+  case vmIntrinsics::_digestBase_implCompressMB:
+    if (!(UseSHA1Intrinsics || UseSHA256Intrinsics || UseSHA512Intrinsics)) return true;
+    break;
+  case vmIntrinsics::_ghash_processBlocks:
+    if (!UseGHASHIntrinsics) return true;
+    break;
+  case vmIntrinsics::_updateBytesCRC32C:
+  case vmIntrinsics::_updateDirectByteBufferCRC32C:
+    if (!UseCRC32CIntrinsics) return true;
+    break;
+  case vmIntrinsics::_copyMemory:
+    if (!InlineArrayCopy || !InlineUnsafeOps) return true;
+    break;
+#ifdef COMPILER1
+  case vmIntrinsics::_checkIndex:
+    if (!InlineNIOCheckIndex) return true;
+    break;
+#endif // COMPILER1
+#ifdef COMPILER2
+  case vmIntrinsics::_clone:
+  case vmIntrinsics::_copyOf:
+  case vmIntrinsics::_copyOfRange:
+    // These intrinsics use both the objectcopy and the arraycopy
+    // intrinsic mechanism.
+    if (!InlineObjectCopy || !InlineArrayCopy) return true;
+    break;
+  case vmIntrinsics::_compareTo:
+     if (!SpecialStringCompareTo) return true;
+     break;
+  case vmIntrinsics::_indexOf:
+    if (!SpecialStringIndexOf) return true;
+    break;
+  case vmIntrinsics::_equals:
+    if (!SpecialStringEquals) return true;
+    break;
+  case vmIntrinsics::_equalsC:
+    if (!SpecialArraysEquals) return true;
+    break;
+  case vmIntrinsics::_encodeISOArray:
+    if (!SpecialEncodeISOArray) return true;
+    break;
+  case vmIntrinsics::_getCallerClass:
+    if (!InlineReflectionGetCallerClass) return true;
+    break;
+  case vmIntrinsics::_multiplyToLen:
+      if (!UseMultiplyToLenIntrinsic) return true;
+      break;
+  case vmIntrinsics::_squareToLen:
+    if (!UseSquareToLenIntrinsic) return true;
+    break;
+  case vmIntrinsics::_mulAdd:
+    if (!UseMulAddIntrinsic) return true;
+    break;
+  case vmIntrinsics::_montgomeryMultiply:
+    if (!UseMontgomeryMultiplyIntrinsic) return true;
+    break;
+  case vmIntrinsics::_montgomerySquare:
+    if (!UseMontgomerySquareIntrinsic) return true;
+    break;
+  case vmIntrinsics::_addExactI:
+  case vmIntrinsics::_addExactL:
+  case vmIntrinsics::_decrementExactI:
+  case vmIntrinsics::_decrementExactL:
+  case vmIntrinsics::_incrementExactI:
+  case vmIntrinsics::_incrementExactL:
+  case vmIntrinsics::_multiplyExactI:
+  case vmIntrinsics::_multiplyExactL:
+  case vmIntrinsics::_negateExactI:
+  case vmIntrinsics::_negateExactL:
+  case vmIntrinsics::_subtractExactI:
+  case vmIntrinsics::_subtractExactL:
+    if (!UseMathExactIntrinsics || !InlineMathNatives) return true;
+    break;
+#endif // COMPILER2
+  default:
+    return false;
+  }
+
+  return false;
+}
 
 #define VM_INTRINSIC_INITIALIZE(id, klass, name, sig, flags) #id "\0"
 static const char* vm_intrinsic_name_bodies =
--- a/hotspot/src/share/vm/classfile/vmSymbols.hpp	Thu Apr 09 12:29:31 2015 +0200
+++ b/hotspot/src/share/vm/classfile/vmSymbols.hpp	Mon Aug 17 12:45:16 2015 +0300
@@ -1368,6 +1368,26 @@
 
   // Raw conversion:
   static ID for_raw_conversion(BasicType src, BasicType dest);
+
+  // The methods below provide information related to compiling intrinsics.
+
+  // (1) Information needed by the C1 compiler.
+
+  static bool preserves_state(vmIntrinsics::ID id);
+  static bool can_trap(vmIntrinsics::ID id);
+
+  // (2) Information needed by the C2 compiler.
+
+  // Returns true if the intrinsic for method 'method' will perform a virtual dispatch.
+  static bool does_virtual_dispatch(vmIntrinsics::ID id);
+  // A return value larger than 0 indicates that the intrinsic for method
+  // 'method' requires predicated logic.
+  static int predicates_needed(vmIntrinsics::ID id);
+
+  // Returns true if an intrinsic is disabled by command-line flags and
+  // false otherwise. Implements functionality common to the C1
+  // and the C2 compiler.
+  static bool is_disabled_by_flags(vmIntrinsics::ID id);
 };
 
 #endif // SHARE_VM_CLASSFILE_VMSYMBOLS_HPP
--- a/hotspot/src/share/vm/compiler/abstractCompiler.hpp	Thu Apr 09 12:29:31 2015 +0200
+++ b/hotspot/src/share/vm/compiler/abstractCompiler.hpp	Mon Aug 17 12:45:16 2015 +0300
@@ -66,6 +66,58 @@
   virtual bool supports_osr   ()                 { return true; }
   virtual bool can_compile_method(methodHandle method)  { return true; }
 
+  // Determine if the current compiler provides an intrinsic
+  // for method 'method'. An intrinsic is available if:
+  //  - the intrinsic is enabled (by using the appropriate command-line flag) and
+  //  - the platform on which the VM is running supports the intrinsic
+  //    (i.e., the platform provides the instructions necessary for the compiler
+  //    to generate the intrinsic code).
+  //
+  // The second parameter, 'compilation_context', is needed to implement functionality
+  // related to the DisableIntrinsic command-line flag. The DisableIntrinsic flag can
+  // be used to prohibit the C2 compiler (but not the C1 compiler) to use an intrinsic.
+  // There are three ways to disable an intrinsic using the DisableIntrinsic flag:
+  //
+  // (1) -XX:DisableIntrinsic=_hashCode,_getClass
+  //     Disables intrinsification of _hashCode and _getClass globally
+  //     (i.e., the intrinsified version the methods will not be used at all).
+  // (2) -XX:CompileCommand=option,aClass::aMethod,ccstr,DisableIntrinsic,_hashCode
+  //     Disables intrinsification of _hashCode if it is called from
+  //     aClass::aMethod (but not for any other call site of _hashCode)
+  // (3) -XX:CompileCommand=option,java.lang.ref.Reference::get,ccstr,DisableIntrinsic,_Reference_get
+  //     Some methods are not compiled by C2. Instead, the C2 compiler
+  //     returns directly the intrinsified version of these methods.
+  //     The command above forces C2 to compile _Reference_get, but
+  //     allows using the intrinsified version of _Reference_get at all
+  //     other call sites.
+  //
+  // From the modes above, (1) disable intrinsics globally, (2) and (3)
+  // disable intrinsics on a per-method basis. In cases (2) and (3) the
+  // compilation context is aClass::aMethod and java.lang.ref.Reference::get,
+  // respectively.
+  virtual bool is_intrinsic_available(methodHandle method, methodHandle compilation_context) {
+    return false;
+  }
+
+  // Determines if an intrinsic is supported by the compiler, that is,
+  // the compiler provides the instructions necessary to generate
+  // the intrinsic code for method 'method'.
+  //
+  // The 'is_intrinsic_supported' method is a white list, that is,
+  // by default no intrinsics are supported by a compiler except
+  // the ones listed in the method. Overriding methods should conform
+  // to this behavior.
+  virtual bool is_intrinsic_supported(methodHandle method) {
+    return false;
+  }
+
+  // Implements compiler-specific processing of command-line flags.
+  // Processing of command-line flags common to all compilers is implemented
+  // in vmIntrinsicss::is_disabled_by_flag.
+  virtual bool is_intrinsic_disabled_by_flag(methodHandle method) {
+    return false;
+  }
+
   // Compiler type queries.
   bool is_c1()                                   { return _type == c1; }
   bool is_c2()                                   { return _type == c2; }
--- a/hotspot/src/share/vm/compiler/compileBroker.cpp	Thu Apr 09 12:29:31 2015 +0200
+++ b/hotspot/src/share/vm/compiler/compileBroker.cpp	Mon Aug 17 12:45:16 2015 +0300
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2015, 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
@@ -345,6 +345,14 @@
   }
 }
 
+// RedefineClasses support
+void CompileTask::metadata_do(void f(Metadata*)) {
+  f(method());
+  if (hot_method() != NULL && hot_method() != method()) {
+    f(hot_method());
+  }
+}
+
 // ------------------------------------------------------------------
 // CompileTask::print_line_on_error
 //
@@ -660,6 +668,11 @@
  * Get the next CompileTask from a CompileQueue
  */
 CompileTask* CompileQueue::get() {
+  // save methods from RedefineClasses across safepoint
+  // across MethodCompileQueue_lock below.
+  methodHandle save_method;
+  methodHandle save_hot_method;
+
   MutexLocker locker(MethodCompileQueue_lock);
   // If _first is NULL we have no more compile jobs. There are two reasons for
   // having no compile jobs: First, we compiled everything we wanted. Second,
@@ -693,6 +706,12 @@
     No_Safepoint_Verifier nsv;
     task = CompilationPolicy::policy()->select_task(this);
   }
+
+  // Save method pointers across unlock safepoint.  The task is removed from
+  // the compilation queue, which is walked during RedefineClasses.
+  save_method = methodHandle(task->method());
+  save_hot_method = methodHandle(task->hot_method());
+
   remove(task);
   purge_stale_tasks(); // may temporarily release MCQ lock
   return task;
--- a/hotspot/src/share/vm/compiler/compileBroker.hpp	Thu Apr 09 12:29:31 2015 +0200
+++ b/hotspot/src/share/vm/compiler/compileBroker.hpp	Mon Aug 17 12:45:16 2015 +0300
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2015, 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,6 +80,7 @@
 
   int          compile_id() const                { return _compile_id; }
   Method*      method() const                    { return _method; }
+  Method*      hot_method() const                { return _hot_method; }
   int          osr_bci() const                   { return _osr_bci; }
   bool         is_complete() const               { return _is_complete; }
   bool         is_blocking() const               { return _is_blocking; }
@@ -108,6 +109,9 @@
   bool         is_free() const                   { return _is_free; }
   void         set_is_free(bool val)             { _is_free = val; }
 
+  // RedefineClasses support
+  void         metadata_do(void f(Metadata*));
+
 private:
   static void  print_compilation_impl(outputStream* st, Method* method, int compile_id, int comp_level,
                                       bool is_osr_method = false, int osr_bci = -1, bool is_blocking = false,
--- a/hotspot/src/share/vm/gc/cms/parCardTableModRefBS.cpp	Thu Apr 09 12:29:31 2015 +0200
+++ b/hotspot/src/share/vm/gc/cms/parCardTableModRefBS.cpp	Mon Aug 17 12:45:16 2015 +0300
@@ -36,10 +36,11 @@
 #include "runtime/orderAccess.inline.hpp"
 #include "runtime/vmThread.hpp"
 
-void CardTableModRefBS::non_clean_card_iterate_parallel_work(Space* sp, MemRegion mr,
-                                                             OopsInGenClosure* cl,
-                                                             CardTableRS* ct,
-                                                             uint n_threads) {
+void CardTableModRefBSForCTRS::
+non_clean_card_iterate_parallel_work(Space* sp, MemRegion mr,
+                                     OopsInGenClosure* cl,
+                                     CardTableRS* ct,
+                                     uint n_threads) {
   assert(n_threads > 0, "expected n_threads > 0");
   assert(n_threads <= ParallelGCThreads,
          err_msg("n_threads: %u > ParallelGCThreads: %u", n_threads, ParallelGCThreads));
@@ -81,7 +82,7 @@
 }
 
 void
-CardTableModRefBS::
+CardTableModRefBSForCTRS::
 process_stride(Space* sp,
                MemRegion used,
                jint stride, int n_strides,
@@ -170,7 +171,7 @@
 #endif
 
 void
-CardTableModRefBS::
+CardTableModRefBSForCTRS::
 process_chunk_boundaries(Space* sp,
                          DirtyCardToOopClosure* dcto_cl,
                          MemRegion chunk_mr,
@@ -426,7 +427,7 @@
 #undef NOISY
 
 void
-CardTableModRefBS::
+CardTableModRefBSForCTRS::
 get_LNC_array_for_space(Space* sp,
                         jbyte**& lowest_non_clean,
                         uintptr_t& lowest_non_clean_base_chunk_index,
--- a/hotspot/src/share/vm/gc/g1/concurrentMark.cpp	Thu Apr 09 12:29:31 2015 +0200
+++ b/hotspot/src/share/vm/gc/g1/concurrentMark.cpp	Mon Aug 17 12:45:16 2015 +0300
@@ -403,14 +403,6 @@
   _saved_index = -1;
 }
 
-void CMMarkStack::oops_do(OopClosure* f) {
-  assert(_saved_index == _index,
-         err_msg("saved index: %d index: %d", _saved_index, _index));
-  for (int i = 0; i < _index; i += 1) {
-    f->do_oop(&_base[i]);
-  }
-}
-
 CMRootRegions::CMRootRegions() :
   _young_list(NULL), _cm(NULL), _scan_in_progress(false),
   _should_abort(false),  _next_survivor(NULL) { }
@@ -2717,53 +2709,26 @@
 }
 
 #ifndef PRODUCT
-enum VerifyNoCSetOopsPhase {
-  VerifyNoCSetOopsStack,
-  VerifyNoCSetOopsQueues
-};
-
-class VerifyNoCSetOopsClosure : public OopClosure, public ObjectClosure  {
+class VerifyNoCSetOops VALUE_OBJ_CLASS_SPEC {
 private:
   G1CollectedHeap* _g1h;
-  VerifyNoCSetOopsPhase _phase;
+  const char* _phase;
   int _info;
 
-  const char* phase_str() {
-    switch (_phase) {
-    case VerifyNoCSetOopsStack:         return "Stack";
-    case VerifyNoCSetOopsQueues:        return "Queue";
-    default:                            ShouldNotReachHere();
-    }
-    return NULL;
-  }
-
-  void do_object_work(oop obj) {
+public:
+  VerifyNoCSetOops(const char* phase, int info = -1) :
+    _g1h(G1CollectedHeap::heap()),
+    _phase(phase),
+    _info(info)
+  { }
+
+  void operator()(oop obj) const {
+    guarantee(obj->is_oop(),
+              err_msg("Non-oop " PTR_FORMAT ", phase: %s, info: %d",
+                      p2i(obj), _phase, _info));
     guarantee(!_g1h->obj_in_cs(obj),
               err_msg("obj: " PTR_FORMAT " in CSet, phase: %s, info: %d",
-                      p2i((void*) obj), phase_str(), _info));
-  }
-
-public:
-  VerifyNoCSetOopsClosure() : _g1h(G1CollectedHeap::heap()) { }
-
-  void set_phase(VerifyNoCSetOopsPhase phase, int info = -1) {
-    _phase = phase;
-    _info = info;
-  }
-
-  virtual void do_oop(oop* p) {
-    oop obj = oopDesc::load_decode_heap_oop(p);
-    do_object_work(obj);
-  }
-
-  virtual void do_oop(narrowOop* p) {
-    // We should not come across narrow oops while scanning marking
-    // stacks
-    ShouldNotReachHere();
-  }
-
-  virtual void do_object(oop obj) {
-    do_object_work(obj);
+                      p2i(obj), _phase, _info));
   }
 };
 
@@ -2773,17 +2738,13 @@
     return;
   }
 
-  VerifyNoCSetOopsClosure cl;
-
   // Verify entries on the global mark stack
-  cl.set_phase(VerifyNoCSetOopsStack);
-  _markStack.oops_do(&cl);
+  _markStack.iterate(VerifyNoCSetOops("Stack"));
 
   // Verify entries on the task queues
-  for (uint i = 0; i < _max_worker_id; i += 1) {
-    cl.set_phase(VerifyNoCSetOopsQueues, i);
+  for (uint i = 0; i < _max_worker_id; ++i) {
     CMTaskQueue* queue = _task_queues->queue(i);
-    queue->oops_do(&cl);
+    queue->iterate(VerifyNoCSetOops("Queue", i));
   }
 
   // Verify the global finger
@@ -2806,7 +2767,7 @@
 
   // Verify the task fingers
   assert(parallel_marking_threads() <= _max_worker_id, "sanity");
-  for (int i = 0; i < (int) parallel_marking_threads(); i += 1) {
+  for (uint i = 0; i < parallel_marking_threads(); ++i) {
     CMTask* task = _tasks[i];
     HeapWord* task_finger = task->finger();
     if (task_finger != NULL && task_finger < _heap_end) {
--- a/hotspot/src/share/vm/gc/g1/concurrentMark.hpp	Thu Apr 09 12:29:31 2015 +0200
+++ b/hotspot/src/share/vm/gc/g1/concurrentMark.hpp	Mon Aug 17 12:45:16 2015 +0300
@@ -246,9 +246,10 @@
   // Make sure that we have not added any entries to the stack during GC.
   void note_end_of_gc();
 
-  // iterate over the oops in the mark stack, up to the bound recorded via
-  // the call above.
-  void oops_do(OopClosure* f);
+  // Apply fn to each oop in the mark stack, up to the bound recorded
+  // via one of the above "note" functions.  The mark stack must not
+  // be modified while iterating.
+  template<typename Fn> void iterate(Fn fn);
 };
 
 class ForceOverflowSettings VALUE_OBJ_CLASS_SPEC {
--- a/hotspot/src/share/vm/gc/g1/concurrentMark.inline.hpp	Thu Apr 09 12:29:31 2015 +0200
+++ b/hotspot/src/share/vm/gc/g1/concurrentMark.inline.hpp	Mon Aug 17 12:45:16 2015 +0300
@@ -223,6 +223,15 @@
 
 #undef check_mark
 
+template<typename Fn>
+inline void CMMarkStack::iterate(Fn fn) {
+  assert(_saved_index == _index,
+         err_msg("saved index: %d index: %d", _saved_index, _index));
+  for (int i = 0; i < _index; ++i) {
+    fn(_base[i]);
+  }
+}
+
 inline void CMTask::push(oop obj) {
   HeapWord* objAddr = (HeapWord*) obj;
   assert(_g1h->is_in_g1_reserved(objAddr), "invariant");
--- a/hotspot/src/share/vm/gc/g1/g1Allocator.hpp	Thu Apr 09 12:29:31 2015 +0200
+++ b/hotspot/src/share/vm/gc/g1/g1Allocator.hpp	Mon Aug 17 12:45:16 2015 +0300
@@ -39,13 +39,8 @@
 protected:
   G1CollectedHeap* _g1h;
 
-  // Outside of GC pauses, the number of bytes used in all regions other
-  // than the current allocation region.
-  size_t _summary_bytes_used;
-
 public:
-  G1Allocator(G1CollectedHeap* heap) :
-    _g1h(heap), _summary_bytes_used(0) { }
+  G1Allocator(G1CollectedHeap* heap) : _g1h(heap) { }
 
   static G1Allocator* create_allocator(G1CollectedHeap* g1h);
 
@@ -59,32 +54,13 @@
   virtual MutatorAllocRegion*    mutator_alloc_region(AllocationContext_t context) = 0;
   virtual SurvivorGCAllocRegion* survivor_gc_alloc_region(AllocationContext_t context) = 0;
   virtual OldGCAllocRegion*      old_gc_alloc_region(AllocationContext_t context) = 0;
-  virtual size_t                 used() = 0;
+  virtual size_t                 used_in_alloc_regions() = 0;
   virtual bool                   is_retained_old_region(HeapRegion* hr) = 0;
 
   void                           reuse_retained_old_region(EvacuationInfo& evacuation_info,
                                                            OldGCAllocRegion* old,
                                                            HeapRegion** retained);
 
-  size_t used_unlocked() const {
-    return _summary_bytes_used;
-  }
-
-  void increase_used(size_t bytes) {
-    _summary_bytes_used += bytes;
-  }
-
-  void decrease_used(size_t bytes) {
-    assert(_summary_bytes_used >= bytes,
-           err_msg("invariant: _summary_bytes_used: " SIZE_FORMAT " should be >= bytes: " SIZE_FORMAT,
-               _summary_bytes_used, bytes));
-    _summary_bytes_used -= bytes;
-  }
-
-  void set_used(size_t bytes) {
-    _summary_bytes_used = bytes;
-  }
-
   virtual HeapRegion* new_heap_region(uint hrs_index,
                                       G1BlockOffsetSharedArray* sharedOffsetArray,
                                       MemRegion mr) {
@@ -133,10 +109,10 @@
     return &_old_gc_alloc_region;
   }
 
-  virtual size_t used() {
+  virtual size_t used_in_alloc_regions() {
     assert(Heap_lock->owner() != NULL,
            "Should be owned on this thread's behalf.");
-    size_t result = _summary_bytes_used;
+    size_t result = 0;
 
     // Read only once in case it is set to NULL concurrently
     HeapRegion* hr = mutator_alloc_region(AllocationContext::current())->get();
--- a/hotspot/src/share/vm/gc/g1/g1CollectedHeap.cpp	Thu Apr 09 12:29:31 2015 +0200
+++ b/hotspot/src/share/vm/gc/g1/g1CollectedHeap.cpp	Mon Aug 17 12:45:16 2015 +0300
@@ -632,7 +632,7 @@
   check_bitmaps("Humongous Region Allocation", first_hr);
 
   assert(first_hr->used() == word_size * HeapWordSize, "invariant");
-  _allocator->increase_used(first_hr->used());
+  increase_used(first_hr->used());
   _humongous_set.add(first_hr);
 
   return new_obj;
@@ -998,7 +998,7 @@
     if ((prev_last_region != NULL) && (start_region == prev_last_region)) {
       start_address = start_region->end();
       if (start_address > last_address) {
-        _allocator->increase_used(word_size * HeapWordSize);
+        increase_used(word_size * HeapWordSize);
         start_region->set_top(last_address + 1);
         continue;
       }
@@ -1012,7 +1012,7 @@
     if (!_hrm.allocate_containing_regions(curr_range, &commits)) {
       return false;
     }
-    _allocator->increase_used(word_size * HeapWordSize);
+    increase_used(word_size * HeapWordSize);
     if (commits != 0) {
       ergo_verbose1(ErgoHeapSizing,
                     "attempt heap expansion",
@@ -1104,7 +1104,7 @@
     if (start_address != bottom_address) {
       size_t fill_size = pointer_delta(start_address, bottom_address);
       G1CollectedHeap::fill_with_objects(bottom_address, fill_size);
-      _allocator->increase_used(fill_size * HeapWordSize);
+      increase_used(fill_size * HeapWordSize);
     }
   }
 }
@@ -1917,7 +1917,6 @@
   _ref_processor_cm(NULL),
   _ref_processor_stw(NULL),
   _bot_shared(NULL),
-  _evac_failure_scan_stack(NULL),
   _cg1r(NULL),
   _g1mm(NULL),
   _refine_cte_cl(NULL),
@@ -1930,6 +1929,7 @@
   _free_regions_coming(false),
   _young_list(new YoungList(this)),
   _gc_time_stamp(0),
+  _summary_bytes_used(0),
   _survivor_plab_stats(YoungPLABSize, PLABWeight),
   _old_plab_stats(OldPLABSize, PLABWeight),
   _expand_heap_after_alloc_failure(true),
@@ -2204,6 +2204,11 @@
 
   G1StringDedup::initialize();
 
+  _preserved_objs = NEW_C_HEAP_ARRAY(OopAndMarkOopStack, ParallelGCThreads, mtGC);
+  for (uint i = 0; i < ParallelGCThreads; i++) {
+    new (&_preserved_objs[i]) OopAndMarkOopStack();
+  }
+
   return JNI_OK;
 }
 
@@ -2371,7 +2376,7 @@
 
 // Computes the sum of the storage used by the various regions.
 size_t G1CollectedHeap::used() const {
-  size_t result = _allocator->used();
+  size_t result = _summary_bytes_used + _allocator->used_in_alloc_regions();
   if (_archive_allocator != NULL) {
     result += _archive_allocator->used();
   }
@@ -2379,7 +2384,7 @@
 }
 
 size_t G1CollectedHeap::used_unlocked() const {
-  return _allocator->used_unlocked();
+  return _summary_bytes_used;
 }
 
 class SumUsedClosure: public HeapRegionClosure {
@@ -3376,7 +3381,7 @@
 
   // Print the per-region information.
   st->cr();
-  st->print_cr("Heap Regions: (Y=young(eden), SU=young(survivor), "
+  st->print_cr("Heap Regions: (E=young(eden), S=young(survivor), O=old, "
                "HS=humongous(starts), HC=humongous(continues), "
                "CS=collection set, F=free, A=archive, TS=gc time stamp, "
                "PTAMS=previous top-at-mark-start, "
@@ -4102,7 +4107,7 @@
         _young_list->reset_auxilary_lists();
 
         if (evacuation_failed()) {
-          _allocator->set_used(recalculate_used());
+          set_used(recalculate_used());
           if (_archive_allocator != NULL) {
             _archive_allocator->clear_used();
           }
@@ -4114,7 +4119,7 @@
         } else {
           // The "used" of the the collection set have already been subtracted
           // when they were freed.  Add in the bytes evacuated.
-          _allocator->increase_used(g1_policy()->bytes_copied_during_gc());
+          increase_used(g1_policy()->bytes_copied_during_gc());
         }
 
         if (collector_state()->during_initial_mark_pause()) {
@@ -4255,21 +4260,6 @@
   return true;
 }
 
-void G1CollectedHeap::init_for_evac_failure(OopsInHeapRegionClosure* cl) {
-  _drain_in_progress = false;
-  set_evac_failure_closure(cl);
-  _evac_failure_scan_stack = new (ResourceObj::C_HEAP, mtGC) GrowableArray<oop>(40, true);
-}
-
-void G1CollectedHeap::finalize_for_evac_failure() {
-  assert(_evac_failure_scan_stack != NULL &&
-         _evac_failure_scan_stack->length() == 0,
-         "Postcondition");
-  assert(!_drain_in_progress, "Postcondition");
-  delete _evac_failure_scan_stack;
-  _evac_failure_scan_stack = NULL;
-}
-
 void G1CollectedHeap::remove_self_forwarding_pointers() {
   double remove_self_forwards_start = os::elapsedTime();
 
@@ -4277,104 +4267,30 @@
   workers()->run_task(&rsfp_task);
 
   // Now restore saved marks, if any.
-  assert(_objs_with_preserved_marks.size() ==
-            _preserved_marks_of_objs.size(), "Both or none.");
-  while (!_objs_with_preserved_marks.is_empty()) {
-    oop obj = _objs_with_preserved_marks.pop();
-    markOop m = _preserved_marks_of_objs.pop();
-    obj->set_mark(m);
-  }
-  _objs_with_preserved_marks.clear(true);
-  _preserved_marks_of_objs.clear(true);
+  for (uint i = 0; i < ParallelGCThreads; i++) {
+    OopAndMarkOopStack& cur = _preserved_objs[i];
+    while (!cur.is_empty()) {
+      OopAndMarkOop elem = cur.pop();
+      elem.set_mark();
+    }
+    cur.clear(true);
+  }
 
   g1_policy()->phase_times()->record_evac_fail_remove_self_forwards((os::elapsedTime() - remove_self_forwards_start) * 1000.0);
 }
 
-void G1CollectedHeap::push_on_evac_failure_scan_stack(oop obj) {
-  _evac_failure_scan_stack->push(obj);
-}
-
-void G1CollectedHeap::drain_evac_failure_scan_stack() {
-  assert(_evac_failure_scan_stack != NULL, "precondition");
-
-  while (_evac_failure_scan_stack->length() > 0) {
-     oop obj = _evac_failure_scan_stack->pop();
-     _evac_failure_closure->set_region(heap_region_containing(obj));
-     obj->oop_iterate_backwards(_evac_failure_closure);
-  }
-}
-
-oop
-G1CollectedHeap::handle_evacuation_failure_par(G1ParScanThreadState* _par_scan_state,
-                                               oop old) {
-  assert(obj_in_cs(old),
-         err_msg("obj: " PTR_FORMAT " should still be in the CSet",
-                 p2i(old)));
-  markOop m = old->mark();
-  oop forward_ptr = old->forward_to_atomic(old);
-  if (forward_ptr == NULL) {
-    // Forward-to-self succeeded.
-    assert(_par_scan_state != NULL, "par scan state");
-    OopsInHeapRegionClosure* cl = _par_scan_state->evac_failure_closure();
-    uint queue_num = _par_scan_state->queue_num();
-
+void G1CollectedHeap::preserve_mark_during_evac_failure(uint queue_num, oop obj, markOop m) {
+  if (!_evacuation_failed) {
     _evacuation_failed = true;
-    _evacuation_failed_info_array[queue_num].register_copy_failure(old->size());
-    if (_evac_failure_closure != cl) {
-      MutexLockerEx x(EvacFailureStack_lock, Mutex::_no_safepoint_check_flag);
-      assert(!_drain_in_progress,
-             "Should only be true while someone holds the lock.");
-      // Set the global evac-failure closure to the current thread's.
-      assert(_evac_failure_closure == NULL, "Or locking has failed.");
-      set_evac_failure_closure(cl);
-      // Now do the common part.
-      handle_evacuation_failure_common(old, m);
-      // Reset to NULL.
-      set_evac_failure_closure(NULL);
-    } else {
-      // The lock is already held, and this is recursive.
-      assert(_drain_in_progress, "This should only be the recursive case.");
-      handle_evacuation_failure_common(old, m);
-    }
-    return old;
-  } else {
-    // Forward-to-self failed. Either someone else managed to allocate
-    // space for this object (old != forward_ptr) or they beat us in
-    // self-forwarding it (old == forward_ptr).
-    assert(old == forward_ptr || !obj_in_cs(forward_ptr),
-           err_msg("obj: " PTR_FORMAT " forwarded to: " PTR_FORMAT " "
-                   "should not be in the CSet",
-                   p2i(old), p2i(forward_ptr)));
-    return forward_ptr;
-  }
-}
-
-void G1CollectedHeap::handle_evacuation_failure_common(oop old, markOop m) {
-  preserve_mark_if_necessary(old, m);
-
-  HeapRegion* r = heap_region_containing(old);
-  if (!r->evacuation_failed()) {
-    r->set_evacuation_failed(true);
-    _hr_printer.evac_failure(r);
-  }
-
-  push_on_evac_failure_scan_stack(old);
-
-  if (!_drain_in_progress) {
-    // prevent recursion in copy_to_survivor_space()
-    _drain_in_progress = true;
-    drain_evac_failure_scan_stack();
-    _drain_in_progress = false;
-  }
-}
-
-void G1CollectedHeap::preserve_mark_if_necessary(oop obj, markOop m) {
-  assert(evacuation_failed(), "Oversaving!");
+  }
+
+  _evacuation_failed_info_array[queue_num].register_copy_failure(obj->size());
+
   // We want to call the "for_promotion_failure" version only in the
   // case of a promotion failure.
   if (m->must_be_preserved_for_promotion_failure(obj)) {
-    _objs_with_preserved_marks.push(obj);
-    _preserved_marks_of_objs.push(m);
+    OopAndMarkOop elem(obj, m);
+    _preserved_objs[queue_num].push(elem);
   }
 }
 
@@ -4450,14 +4366,7 @@
       mark_object(obj);
     }
   }
-
-  if (barrier == G1BarrierEvac) {
-    _par_scan_state->update_rs(_from, p, _worker_id);
-  }
-}
-
-template void G1ParCopyClosure<G1BarrierEvac, G1MarkNone>::do_oop_work(oop* p);
-template void G1ParCopyClosure<G1BarrierEvac, G1MarkNone>::do_oop_work(narrowOop* p);
+}
 
 class G1ParEvacuateFollowersClosure : public VoidClosure {
 protected:
@@ -4597,9 +4506,6 @@
       ReferenceProcessor*             rp = _g1h->ref_processor_stw();
 
       G1ParScanThreadState            pss(_g1h, worker_id, rp);
-      G1ParScanHeapEvacFailureClosure evac_failure_cl(_g1h, &pss, rp);
-
-      pss.set_evac_failure_closure(&evac_failure_cl);
 
       bool only_young = _g1h->collector_state()->gcs_are_young();
 
@@ -5269,9 +5175,6 @@
     G1STWIsAliveClosure is_alive(_g1h);
 
     G1ParScanThreadState            pss(_g1h, worker_id, NULL);
-    G1ParScanHeapEvacFailureClosure evac_failure_cl(_g1h, &pss, NULL);
-
-    pss.set_evac_failure_closure(&evac_failure_cl);
 
     G1ParScanExtRootClosure        only_copy_non_heap_cl(_g1h, &pss, NULL);
 
@@ -5368,10 +5271,6 @@
     HandleMark   hm;
 
     G1ParScanThreadState            pss(_g1h, worker_id, NULL);
-    G1ParScanHeapEvacFailureClosure evac_failure_cl(_g1h, &pss, NULL);
-
-    pss.set_evac_failure_closure(&evac_failure_cl);
-
     assert(pss.queue_is_empty(), "both queue and overflow should be empty");
 
     G1ParScanExtRootClosure        only_copy_non_heap_cl(_g1h, &pss, NULL);
@@ -5476,15 +5375,11 @@
 
   // Use only a single queue for this PSS.
   G1ParScanThreadState            pss(this, 0, NULL);
+  assert(pss.queue_is_empty(), "pre-condition");
 
   // We do not embed a reference processor in the copying/scanning
   // closures while we're actually processing the discovered
   // reference objects.
-  G1ParScanHeapEvacFailureClosure evac_failure_cl(this, &pss, NULL);
-
-  pss.set_evac_failure_closure(&evac_failure_cl);
-
-  assert(pss.queue_is_empty(), "pre-condition");
 
   G1ParScanExtRootClosure        only_copy_non_heap_cl(this, &pss, NULL);
 
@@ -5590,8 +5485,6 @@
 
   const uint n_workers = workers()->active_workers();
 
-  init_for_evac_failure(NULL);
-
   assert(dirty_card_queue_set().completed_buffers_num() == 0, "Should be empty");
   double start_par_time_sec = os::elapsedTime();
   double end_par_time_sec;
@@ -5655,8 +5548,6 @@
 
   purge_code_root_memory();
 
-  finalize_for_evac_failure();
-
   if (evacuation_failed()) {
     remove_self_forwarding_pointers();
 
@@ -5745,7 +5636,7 @@
 }
 
 void G1CollectedHeap::decrement_summary_bytes(size_t bytes) {
-  _allocator->decrease_used(bytes);
+  decrease_used(bytes);
 }
 
 class G1ParCleanupCTTask : public AbstractGangTask {
@@ -6395,6 +6286,21 @@
   _hrm.remove_all_free_regions();
 }
 
+void G1CollectedHeap::increase_used(size_t bytes) {
+  _summary_bytes_used += bytes;
+}
+
+void G1CollectedHeap::decrease_used(size_t bytes) {
+  assert(_summary_bytes_used >= bytes,
+         err_msg("invariant: _summary_bytes_used: " SIZE_FORMAT " should be >= bytes: " SIZE_FORMAT,
+                 _summary_bytes_used, bytes));
+  _summary_bytes_used -= bytes;
+}
+
+void G1CollectedHeap::set_used(size_t bytes) {
+  _summary_bytes_used = bytes;
+}
+
 class RebuildRegionSetsClosure : public HeapRegionClosure {
 private:
   bool            _free_list_only;
@@ -6463,15 +6369,15 @@
   heap_region_iterate(&cl);
 
   if (!free_list_only) {
-    _allocator->set_used(cl.total_used());
+    set_used(cl.total_used());
     if (_archive_allocator != NULL) {
       _archive_allocator->clear_used();
     }
   }
-  assert(_allocator->used_unlocked() == recalculate_used(),
-         err_msg("inconsistent _allocator->used_unlocked(), "
+  assert(used_unlocked() == recalculate_used(),
+         err_msg("inconsistent used_unlocked(), "
                  "value: " SIZE_FORMAT " recalculated: " SIZE_FORMAT,
-                 _allocator->used_unlocked(), recalculate_used()));
+                 used_unlocked(), recalculate_used()));
 }
 
 void G1CollectedHeap::set_refine_cte_cl_concurrency(bool concurrent) {
@@ -6511,7 +6417,7 @@
   assert(alloc_region->is_eden(), "all mutator alloc regions should be eden");
 
   g1_policy()->add_region_to_incremental_cset_lhs(alloc_region);
-  _allocator->increase_used(allocated_bytes);
+  increase_used(allocated_bytes);
   _hr_printer.retire(alloc_region);
   // We update the eden sizes here, when the region is retired,
   // instead of when it's allocated, since this is the point that its
--- a/hotspot/src/share/vm/gc/g1/g1CollectedHeap.hpp	Thu Apr 09 12:29:31 2015 +0200
+++ b/hotspot/src/share/vm/gc/g1/g1CollectedHeap.hpp	Mon Aug 17 12:45:16 2015 +0300
@@ -251,6 +251,15 @@
   // Class that handles the different kinds of allocations.
   G1Allocator* _allocator;
 
+  // Outside of GC pauses, the number of bytes used in all regions other
+  // than the current allocation region(s).
+  size_t _summary_bytes_used;
+
+  void increase_used(size_t bytes);
+  void decrease_used(size_t bytes);
+
+  void set_used(size_t bytes);
+
   // Class that handles archive allocation ranges.
   G1ArchiveAllocator* _archive_allocator;
 
@@ -858,44 +867,27 @@
   // forwarding pointers to themselves.  Reset them.
   void remove_self_forwarding_pointers();
 
-  // Together, these store an object with a preserved mark, and its mark value.
-  Stack<oop, mtGC>     _objs_with_preserved_marks;
-  Stack<markOop, mtGC> _preserved_marks_of_objs;
+  struct OopAndMarkOop {
+   private:
+    oop _o;
+    markOop _m;
+   public:
+    OopAndMarkOop(oop obj, markOop m) : _o(obj), _m(m) {
+    }
+
+    void set_mark() {
+      _o->set_mark(_m);
+    }
+  };
+
+  typedef Stack<OopAndMarkOop,mtGC> OopAndMarkOopStack;
+  // Stores marks with the corresponding oop that we need to preserve during evacuation
+  // failure.
+  OopAndMarkOopStack*  _preserved_objs;
 
   // Preserve the mark of "obj", if necessary, in preparation for its mark
   // word being overwritten with a self-forwarding-pointer.
-  void preserve_mark_if_necessary(oop obj, markOop m);
-
-  // The stack of evac-failure objects left to be scanned.
-  GrowableArray<oop>*    _evac_failure_scan_stack;
-  // The closure to apply to evac-failure objects.
-
-  OopsInHeapRegionClosure* _evac_failure_closure;
-  // Set the field above.
-  void
-  set_evac_failure_closure(OopsInHeapRegionClosure* evac_failure_closure) {
-    _evac_failure_closure = evac_failure_closure;
-  }
-
-  // Push "obj" on the scan stack.
-  void push_on_evac_failure_scan_stack(oop obj);
-  // Process scan stack entries until the stack is empty.
-  void drain_evac_failure_scan_stack();
-  // True iff an invocation of "drain_scan_stack" is in progress; to
-  // prevent unnecessary recursion.
-  bool _drain_in_progress;
-
-  // Do any necessary initialization for evacuation-failure handling.
-  // "cl" is the closure that will be used to process evac-failure
-  // objects.
-  void init_for_evac_failure(OopsInHeapRegionClosure* cl);
-  // Do any necessary cleanup for evacuation-failure handling data
-  // structures.
-  void finalize_for_evac_failure();
-
-  // An attempt to evacuate "obj" has failed; take necessary steps.
-  oop handle_evacuation_failure_par(G1ParScanThreadState* _par_scan_state, oop obj);
-  void handle_evacuation_failure_common(oop obj, markOop m);
+  void preserve_mark_during_evac_failure(uint queue, oop obj, markOop m);
 
 #ifndef PRODUCT
   // Support for forcing evacuation failures. Analogous to
--- a/hotspot/src/share/vm/gc/g1/g1OopClosures.hpp	Thu Apr 09 12:29:31 2015 +0200
+++ b/hotspot/src/share/vm/gc/g1/g1OopClosures.hpp	Mon Aug 17 12:45:16 2015 +0300
@@ -111,7 +111,6 @@
 
 enum G1Barrier {
   G1BarrierNone,
-  G1BarrierEvac,
   G1BarrierKlass
 };
 
@@ -148,8 +147,6 @@
 // We use a separate closure to handle references during evacuation
 // failure processing.
 
-typedef G1ParCopyClosure<G1BarrierEvac, G1MarkNone> G1ParScanHeapEvacFailureClosure;
-
 class FilterIntoCSClosure: public ExtendedOopClosure {
   G1CollectedHeap* _g1;
   OopClosure* _oc;
--- a/hotspot/src/share/vm/gc/g1/g1ParScanThreadState.cpp	Thu Apr 09 12:29:31 2015 +0200
+++ b/hotspot/src/share/vm/gc/g1/g1ParScanThreadState.cpp	Mon Aug 17 12:45:16 2015 +0300
@@ -144,8 +144,6 @@
 #endif // ASSERT
 
 void G1ParScanThreadState::trim_queue() {
-  assert(_evac_failure_cl != NULL, "not set");
-
   StarTask ref;
   do {
     // Drain the overflow stack first, so other threads can steal.
@@ -222,7 +220,7 @@
       if (obj_ptr == NULL) {
         // This will either forward-to-self, or detect that someone else has
         // installed a forwarding pointer.
-        return _g1h->handle_evacuation_failure_par(this, old);
+        return handle_evacuation_failure_par(old, old_mark);
       }
     }
   }
@@ -236,7 +234,7 @@
     // Doing this after all the allocation attempts also tests the
     // undo_allocation() method too.
     _g1_par_allocator->undo_allocation(dest_state, obj_ptr, word_sz, context);
-    return _g1h->handle_evacuation_failure_par(this, old);
+    return handle_evacuation_failure_par(old, old_mark);
   }
 #endif // !PRODUCT
 
@@ -301,3 +299,36 @@
     return forward_ptr;
   }
 }
+
+oop G1ParScanThreadState::handle_evacuation_failure_par(oop old, markOop m) {
+  assert(_g1h->obj_in_cs(old),
+         err_msg("Object " PTR_FORMAT " should be in the CSet", p2i(old)));
+
+  oop forward_ptr = old->forward_to_atomic(old);
+  if (forward_ptr == NULL) {
+    // Forward-to-self succeeded. We are the "owner" of the object.
+    HeapRegion* r = _g1h->heap_region_containing(old);
+
+    if (!r->evacuation_failed()) {
+      r->set_evacuation_failed(true);
+     _g1h->hr_printer()->evac_failure(r);
+    }
+
+    _g1h->preserve_mark_during_evac_failure(_queue_num, old, m);
+
+    _scanner.set_region(r);
+    old->oop_iterate_backwards(&_scanner);
+
+    return old;
+  } else {
+    // Forward-to-self failed. Either someone else managed to allocate
+    // space for this object (old != forward_ptr) or they beat us in
+    // self-forwarding it (old == forward_ptr).
+    assert(old == forward_ptr || !_g1h->obj_in_cs(forward_ptr),
+           err_msg("Object " PTR_FORMAT " forwarded to: " PTR_FORMAT " "
+                   "should not be in the CSet",
+                   p2i(old), p2i(forward_ptr)));
+    return forward_ptr;
+  }
+}
+
--- a/hotspot/src/share/vm/gc/g1/g1ParScanThreadState.hpp	Thu Apr 09 12:29:31 2015 +0200
+++ b/hotspot/src/share/vm/gc/g1/g1ParScanThreadState.hpp	Mon Aug 17 12:45:16 2015 +0300
@@ -54,8 +54,6 @@
   uint              _tenuring_threshold;
   G1ParScanClosure  _scanner;
 
-  OopsInHeapRegionClosure*      _evac_failure_cl;
-
   int  _hash_seed;
   uint _queue_num;
 
@@ -114,12 +112,6 @@
     }
   }
 
-  void set_evac_failure_closure(OopsInHeapRegionClosure* evac_failure_cl) {
-    _evac_failure_cl = evac_failure_cl;
-  }
-
-  OopsInHeapRegionClosure* evac_failure_closure() { return _evac_failure_cl; }
-
   int* hash_seed() { return &_hash_seed; }
   uint queue_num() { return _queue_num; }
 
@@ -211,6 +203,9 @@
   void trim_queue();
 
   inline void steal_and_trim_queue(RefToScanQueueSet *task_queues);
+
+  // An attempt to evacuate "obj" has failed; take necessary steps.
+  oop handle_evacuation_failure_par(oop obj, markOop m);
 };
 
 #endif // SHARE_VM_GC_G1_G1PARSCANTHREADSTATE_HPP
--- a/hotspot/src/share/vm/gc/g1/g1_globals.hpp	Thu Apr 09 12:29:31 2015 +0200
+++ b/hotspot/src/share/vm/gc/g1/g1_globals.hpp	Mon Aug 17 12:45:16 2015 +0300
@@ -252,12 +252,12 @@
           "Percentage (0-100) of the heap size to use as default "          \
           " maximum young gen size.")                                       \
           range(0, 100)                                                     \
-          constraint(G1MaxNewSizePercentConstraintFunc)                     \
+          constraint(G1MaxNewSizePercentConstraintFunc,AfterErgo)           \
                                                                             \
   experimental(uintx, G1NewSizePercent, 5,                                  \
           "Percentage (0-100) of the heap size to use as default "          \
           "minimum young gen size.")                                        \
-          constraint(G1NewSizePercentConstraintFunc)                        \
+          constraint(G1NewSizePercentConstraintFunc,AfterErgo)              \
                                                                             \
   experimental(uintx, G1MixedGCLiveThresholdPercent, 85,                    \
           "Threshold for regions to be considered for inclusion in the "    \
--- a/hotspot/src/share/vm/gc/g1/vmStructs_g1.hpp	Thu Apr 09 12:29:31 2015 +0200
+++ b/hotspot/src/share/vm/gc/g1/vmStructs_g1.hpp	Mon Aug 17 12:45:16 2015 +0300
@@ -45,13 +45,11 @@
   nonstatic_field(HeapRegionManager, _regions,          G1HeapRegionTable)    \
   nonstatic_field(HeapRegionManager, _num_committed,    uint)                 \
                                                                               \
-  nonstatic_field(G1Allocator,     _summary_bytes_used, size_t)               \
-                                                                              \
+  nonstatic_field(G1CollectedHeap, _summary_bytes_used, size_t)               \
   nonstatic_field(G1CollectedHeap, _hrm,                HeapRegionManager)    \
   nonstatic_field(G1CollectedHeap, _g1mm,               G1MonitoringSupport*) \
   nonstatic_field(G1CollectedHeap, _old_set,            HeapRegionSetBase)    \
   nonstatic_field(G1CollectedHeap, _humongous_set,      HeapRegionSetBase)    \
-  nonstatic_field(G1CollectedHeap, _allocator,          G1Allocator*)         \
                                                                               \
   nonstatic_field(G1MonitoringSupport, _eden_committed,     size_t)           \
   nonstatic_field(G1MonitoringSupport, _eden_used,          size_t)           \
@@ -78,12 +76,10 @@
   declare_toplevel_type(HeapRegionSetBase)                                    \
   declare_toplevel_type(HeapRegionSetCount)                                   \
   declare_toplevel_type(G1MonitoringSupport)                                  \
-  declare_toplevel_type(G1Allocator)                                          \
                                                                               \
   declare_toplevel_type(G1CollectedHeap*)                                     \
   declare_toplevel_type(HeapRegion*)                                          \
   declare_toplevel_type(G1MonitoringSupport*)                                 \
-  declare_toplevel_type(G1Allocator*)                                         \
 
 
 #endif // SHARE_VM_GC_G1_VMSTRUCTS_G1_HPP
--- a/hotspot/src/share/vm/gc/parallel/cardTableExtension.cpp	Thu Apr 09 12:29:31 2015 +0200
+++ b/hotspot/src/share/vm/gc/parallel/cardTableExtension.cpp	Mon Aug 17 12:45:16 2015 +0300
@@ -40,7 +40,6 @@
   PSYoungGen*         _young_gen;
   CardTableExtension* _card_table;
   HeapWord*           _unmarked_addr;
-  jbyte*              _unmarked_card;
 
  protected:
   template <class T> void do_oop_work(T* p) {
@@ -50,7 +49,6 @@
       // Don't overwrite the first missing card mark
       if (_unmarked_addr == NULL) {
         _unmarked_addr = (HeapWord*)p;
-        _unmarked_card = _card_table->byte_for(p);
       }
     }
   }
--- a/hotspot/src/share/vm/gc/serial/defNewGeneration.cpp	Thu Apr 09 12:29:31 2015 +0200
+++ b/hotspot/src/share/vm/gc/serial/defNewGeneration.cpp	Mon Aug 17 12:45:16 2015 +0300
@@ -623,7 +623,7 @@
   {
     // DefNew needs to run with n_threads == 0, to make sure the serial
     // version of the card table scanning code is used.
-    // See: CardTableModRefBS::non_clean_card_iterate_possibly_parallel.
+    // See: CardTableModRefBSForCTRS::non_clean_card_iterate_possibly_parallel.
     StrongRootsScope srs(0);
 
     gch->gen_process_roots(&srs,
--- a/hotspot/src/share/vm/gc/shared/cardTableModRefBS.cpp	Thu Apr 09 12:29:31 2015 +0200
+++ b/hotspot/src/share/vm/gc/shared/cardTableModRefBS.cpp	Mon Aug 17 12:45:16 2015 +0300
@@ -24,22 +24,12 @@
 
 #include "precompiled.hpp"
 #include "gc/shared/cardTableModRefBS.inline.hpp"
-#include "gc/shared/cardTableRS.hpp"
 #include "gc/shared/collectedHeap.hpp"
 #include "gc/shared/genCollectedHeap.hpp"
-#include "gc/shared/space.hpp"
 #include "gc/shared/space.inline.hpp"
-#include "memory/allocation.inline.hpp"
-#include "memory/universe.hpp"
 #include "memory/virtualspace.hpp"
-#include "runtime/java.hpp"
-#include "runtime/mutexLocker.hpp"
 #include "services/memTracker.hpp"
 #include "utilities/macros.hpp"
-#ifdef COMPILER1
-#include "c1/c1_LIR.hpp"
-#include "c1/c1_LIRGenerator.hpp"
-#endif
 
 // This kind of "BarrierSet" allows a "CollectedHeap" to detect and
 // enumerate ref fields that have been modified (since the last
@@ -68,12 +58,7 @@
   _committed(NULL),
   _cur_covered_regions(0),
   _byte_map(NULL),
-  byte_map_base(NULL),
-  // LNC functionality
-  _lowest_non_clean(NULL),
-  _lowest_non_clean_chunk_size(NULL),
-  _lowest_non_clean_base_chunk_index(NULL),
-  _last_LNC_resizing_collection(NULL)
+  byte_map_base(NULL)
 {
   assert((uintptr_t(_whole_heap.start())  & (card_size - 1))  == 0, "heap must start at card boundary");
   assert((uintptr_t(_whole_heap.end()) & (card_size - 1))  == 0, "heap must end at card boundary");
@@ -130,25 +115,6 @@
                             !ExecMem, "card table last card");
   *guard_card = last_card;
 
-  _lowest_non_clean =
-    NEW_C_HEAP_ARRAY(CardArr, _max_covered_regions, mtGC);
-  _lowest_non_clean_chunk_size =
-    NEW_C_HEAP_ARRAY(size_t, _max_covered_regions, mtGC);
-  _lowest_non_clean_base_chunk_index =
-    NEW_C_HEAP_ARRAY(uintptr_t, _max_covered_regions, mtGC);
-  _last_LNC_resizing_collection =
-    NEW_C_HEAP_ARRAY(int, _max_covered_regions, mtGC);
-  if (_lowest_non_clean == NULL
-      || _lowest_non_clean_chunk_size == NULL
-      || _lowest_non_clean_base_chunk_index == NULL
-      || _last_LNC_resizing_collection == NULL)
-    vm_exit_during_initialization("couldn't allocate an LNC array.");
-  for (int i = 0; i < _max_covered_regions; i++) {
-    _lowest_non_clean[i] = NULL;
-    _lowest_non_clean_chunk_size[i] = 0;
-    _last_LNC_resizing_collection[i] = -1;
-  }
-
   if (TraceCardTableModRefBS) {
     gclog_or_tty->print_cr("CardTableModRefBS::CardTableModRefBS: ");
     gclog_or_tty->print_cr("  "
@@ -171,22 +137,6 @@
     delete[] _committed;
     _committed = NULL;
   }
-  if (_lowest_non_clean) {
-    FREE_C_HEAP_ARRAY(CardArr, _lowest_non_clean);
-    _lowest_non_clean = NULL;
-  }
-  if (_lowest_non_clean_chunk_size) {
-    FREE_C_HEAP_ARRAY(size_t, _lowest_non_clean_chunk_size);
-    _lowest_non_clean_chunk_size = NULL;
-  }
-  if (_lowest_non_clean_base_chunk_index) {
-    FREE_C_HEAP_ARRAY(uintptr_t, _lowest_non_clean_base_chunk_index);
-    _lowest_non_clean_base_chunk_index = NULL;
-  }
-  if (_last_LNC_resizing_collection) {
-    FREE_C_HEAP_ARRAY(int, _last_LNC_resizing_collection);
-    _last_LNC_resizing_collection = NULL;
-  }
 }
 
 int CardTableModRefBS::find_covering_region_by_base(HeapWord* base) {
@@ -437,32 +387,6 @@
 }
 
 
-void CardTableModRefBS::non_clean_card_iterate_possibly_parallel(Space* sp,
-                                                                 MemRegion mr,
-                                                                 OopsInGenClosure* cl,
-                                                                 CardTableRS* ct,
-                                                                 uint n_threads) {
-  if (!mr.is_empty()) {
-    if (n_threads > 0) {
-#if INCLUDE_ALL_GCS
-      non_clean_card_iterate_parallel_work(sp, mr, cl, ct, n_threads);
-#else  // INCLUDE_ALL_GCS
-      fatal("Parallel gc not supported here.");
-#endif // INCLUDE_ALL_GCS
-    } else {
-      // clear_cl finds contiguous dirty ranges of cards to process and clear.
-
-      // This is the single-threaded version used by DefNew.
-      const bool parallel = false;
-
-      DirtyCardToOopClosure* dcto_cl = sp->new_dcto_cl(cl, precision(), cl->gen_boundary(), parallel);
-      ClearNoncleanCardWrapper clear_cl(dcto_cl, ct, parallel);
-
-      clear_cl.do_MemRegion(mr);
-    }
-  }
-}
-
 void CardTableModRefBS::dirty_MemRegion(MemRegion mr) {
   assert((HeapWord*)align_size_down((uintptr_t)mr.start(), HeapWordSize) == mr.start(), "Unaligned start");
   assert((HeapWord*)align_size_up  ((uintptr_t)mr.end(),   HeapWordSize) == mr.end(),   "Unaligned end"  );
@@ -623,15 +547,3 @@
                p2i(_byte_map), p2i(_byte_map + _byte_map_size), p2i(byte_map_base));
 }
 
-bool CardTableModRefBSForCTRS::card_will_be_scanned(jbyte cv) {
-  return
-    CardTableModRefBS::card_will_be_scanned(cv) ||
-    _rs->is_prev_nonclean_card_val(cv);
-};
-
-bool CardTableModRefBSForCTRS::card_may_have_been_dirty(jbyte cv) {
-  return
-    cv != clean_card &&
-    (CardTableModRefBS::card_may_have_been_dirty(cv) ||
-     CardTableRS::youngergen_may_have_been_dirty(cv));
-};
--- a/hotspot/src/share/vm/gc/shared/cardTableModRefBS.hpp	Thu Apr 09 12:29:31 2015 +0200
+++ b/hotspot/src/share/vm/gc/shared/cardTableModRefBS.hpp	Mon Aug 17 12:45:16 2015 +0300
@@ -40,23 +40,9 @@
 // Closures used to scan dirty cards should take these
 // considerations into account.
 
-class Generation;
-class OopsInGenClosure;
-class DirtyCardToOopClosure;
-class ClearNoncleanCardWrapper;
-class CardTableRS;
-
 class CardTableModRefBS: public ModRefBarrierSet {
   // Some classes get to look at some private stuff.
-  friend class BytecodeInterpreter;
   friend class VMStructs;
-  friend class CardTableRS;
-  friend class CheckForUnmarkedOops; // Needs access to raw card bytes.
-  friend class SharkBuilder;
-#ifndef PRODUCT
-  // For debugging.
-  friend class GuaranteeNotModClosure;
-#endif
  protected:
 
   enum CardValues {
@@ -75,24 +61,6 @@
   // a word's worth (row) of clean card values
   static const intptr_t clean_card_row = (intptr_t)(-1);
 
-  // dirty and precleaned are equivalent wrt younger_refs_iter.
-  static bool card_is_dirty_wrt_gen_iter(jbyte cv) {
-    return cv == dirty_card || cv == precleaned_card;
-  }
-
-  // Returns "true" iff the value "cv" will cause the card containing it
-  // to be scanned in the current traversal.  May be overridden by
-  // subtypes.
-  virtual bool card_will_be_scanned(jbyte cv) {
-    return CardTableModRefBS::card_is_dirty_wrt_gen_iter(cv);
-  }
-
-  // Returns "true" iff the value "cv" may have represented a dirty card at
-  // some point.
-  virtual bool card_may_have_been_dirty(jbyte cv) {
-    return card_is_dirty_wrt_gen_iter(cv);
-  }
-
   // The declaration order of these const fields is important; see the
   // constructor before changing.
   const MemRegion _whole_heap;       // the region covered by the card table
@@ -174,20 +142,6 @@
     return byte_for(p) + 1;
   }
 
-  // Iterate over the portion of the card-table which covers the given
-  // region mr in the given space and apply cl to any dirty sub-regions
-  // of mr. Clears the dirty cards as they are processed.
-  void non_clean_card_iterate_possibly_parallel(Space* sp, MemRegion mr,
-                                                OopsInGenClosure* cl, CardTableRS* ct,
-                                                uint n_threads);
-
- private:
-  // Work method used to implement non_clean_card_iterate_possibly_parallel()
-  // above in the parallel case.
-  void non_clean_card_iterate_parallel_work(Space* sp, MemRegion mr,
-                                            OopsInGenClosure* cl, CardTableRS* ct,
-                                            uint n_threads);
-
  protected:
   // Dirty the bytes corresponding to "mr" (not all of which must be
   // covered.)
@@ -197,65 +151,6 @@
   // all of which must be covered.)
   void clear_MemRegion(MemRegion mr);
 
-  // *** Support for parallel card scanning.
-
-  // This is an array, one element per covered region of the card table.
-  // Each entry is itself an array, with one element per chunk in the
-  // covered region.  Each entry of these arrays is the lowest non-clean
-  // card of the corresponding chunk containing part of an object from the
-  // previous chunk, or else NULL.
-  typedef jbyte*  CardPtr;
-  typedef CardPtr* CardArr;
-  CardArr* _lowest_non_clean;
-  size_t*  _lowest_non_clean_chunk_size;
-  uintptr_t* _lowest_non_clean_base_chunk_index;
-  int* _last_LNC_resizing_collection;
-
-  // Initializes "lowest_non_clean" to point to the array for the region
-  // covering "sp", and "lowest_non_clean_base_chunk_index" to the chunk
-  // index of the corresponding to the first element of that array.
-  // Ensures that these arrays are of sufficient size, allocating if necessary.
-  // May be called by several threads concurrently.
-  void get_LNC_array_for_space(Space* sp,
-                               jbyte**& lowest_non_clean,
-                               uintptr_t& lowest_non_clean_base_chunk_index,
-                               size_t& lowest_non_clean_chunk_size);
-
-  // Returns the number of chunks necessary to cover "mr".
-  size_t chunks_to_cover(MemRegion mr) {
-    return (size_t)(addr_to_chunk_index(mr.last()) -
-                    addr_to_chunk_index(mr.start()) + 1);
-  }
-
-  // Returns the index of the chunk in a stride which
-  // covers the given address.
-  uintptr_t addr_to_chunk_index(const void* addr) {
-    uintptr_t card = (uintptr_t) byte_for(addr);
-    return card / ParGCCardsPerStrideChunk;
-  }
-
-  // Apply cl, which must either itself apply dcto_cl or be dcto_cl,
-  // to the cards in the stride (of n_strides) within the given space.
-  void process_stride(Space* sp,
-                      MemRegion used,
-                      jint stride, int n_strides,
-                      OopsInGenClosure* cl,
-                      CardTableRS* ct,
-                      jbyte** lowest_non_clean,
-                      uintptr_t lowest_non_clean_base_chunk_index,
-                      size_t lowest_non_clean_chunk_size);
-
-  // Makes sure that chunk boundaries are handled appropriately, by
-  // adjusting the min_done of dcto_cl, and by using a special card-table
-  // value to indicate how min_done should be set.
-  void process_chunk_boundaries(Space* sp,
-                                DirtyCardToOopClosure* dcto_cl,
-                                MemRegion chunk_mr,
-                                MemRegion used,
-                                jbyte** lowest_non_clean,
-                                uintptr_t lowest_non_clean_base_chunk_index,
-                                size_t    lowest_non_clean_chunk_size);
-
 public:
   // Constants
   enum SomePublicConstants {
@@ -436,34 +331,5 @@
   static const BarrierSet::Name value = BarrierSet::CardTableModRef;
 };
 
-class CardTableRS;
-
-// A specialization for the CardTableRS gen rem set.
-class CardTableModRefBSForCTRS: public CardTableModRefBS {
-  CardTableRS* _rs;
-protected:
-  bool card_will_be_scanned(jbyte cv);
-  bool card_may_have_been_dirty(jbyte cv);
-public:
-  CardTableModRefBSForCTRS(MemRegion whole_heap) :
-    CardTableModRefBS(
-      whole_heap,
-      // Concrete tag should be BarrierSet::CardTableForRS.
-      // That will presently break things in a bunch of places though.
-      // The concrete tag is used as a dispatch key in many places, and
-      // CardTableForRS does not correctly dispatch in some of those
-      // uses. This will be addressed as part of a reorganization of the
-      // BarrierSet hierarchy.
-      BarrierSet::FakeRtti(BarrierSet::CardTableModRef, 0).add_tag(BarrierSet::CardTableForRS))
-    {}
-
-  void set_CTRS(CardTableRS* rs) { _rs = rs; }
-};
-
-template<>
-struct BarrierSet::GetName<CardTableModRefBSForCTRS> {
-  static const BarrierSet::Name value = BarrierSet::CardTableForRS;
-};
-
 
 #endif // SHARE_VM_GC_SHARED_CARDTABLEMODREFBS_HPP
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/hotspot/src/share/vm/gc/shared/cardTableModRefBSForCTRS.cpp	Mon Aug 17 12:45:16 2015 +0300
@@ -0,0 +1,129 @@
+/*
+ * Copyright (c) 2015, 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.
+ *
+ */
+
+#include "precompiled.hpp"
+#include "gc/shared/cardTableModRefBS.inline.hpp"
+#include "gc/shared/cardTableRS.hpp"
+#include "memory/allocation.inline.hpp"
+#include "gc/shared/space.inline.hpp"
+
+CardTableModRefBSForCTRS::CardTableModRefBSForCTRS(MemRegion whole_heap) :
+  CardTableModRefBS(
+    whole_heap,
+    // Concrete tag should be BarrierSet::CardTableForRS.
+    // That will presently break things in a bunch of places though.
+    // The concrete tag is used as a dispatch key in many places, and
+    // CardTableForRS does not correctly dispatch in some of those
+    // uses. This will be addressed as part of a reorganization of the
+    // BarrierSet hierarchy.
+    BarrierSet::FakeRtti(BarrierSet::CardTableModRef, 0).add_tag(BarrierSet::CardTableForRS)),
+  // LNC functionality
+  _lowest_non_clean(NULL),
+  _lowest_non_clean_chunk_size(NULL),
+  _lowest_non_clean_base_chunk_index(NULL),
+  _last_LNC_resizing_collection(NULL)
+{ }
+
+void CardTableModRefBSForCTRS::initialize() {
+  CardTableModRefBS::initialize();
+  _lowest_non_clean =
+    NEW_C_HEAP_ARRAY(CardArr, _max_covered_regions, mtGC);
+  _lowest_non_clean_chunk_size =
+    NEW_C_HEAP_ARRAY(size_t, _max_covered_regions, mtGC);
+  _lowest_non_clean_base_chunk_index =
+    NEW_C_HEAP_ARRAY(uintptr_t, _max_covered_regions, mtGC);
+  _last_LNC_resizing_collection =
+    NEW_C_HEAP_ARRAY(int, _max_covered_regions, mtGC);
+  if (_lowest_non_clean == NULL
+      || _lowest_non_clean_chunk_size == NULL
+      || _lowest_non_clean_base_chunk_index == NULL
+      || _last_LNC_resizing_collection == NULL)
+    vm_exit_during_initialization("couldn't allocate an LNC array.");
+  for (int i = 0; i < _max_covered_regions; i++) {
+    _lowest_non_clean[i] = NULL;
+    _lowest_non_clean_chunk_size[i] = 0;
+    _last_LNC_resizing_collection[i] = -1;
+  }
+}
+
+CardTableModRefBSForCTRS::~CardTableModRefBSForCTRS() {
+  if (_lowest_non_clean) {
+    FREE_C_HEAP_ARRAY(CardArr, _lowest_non_clean);
+    _lowest_non_clean = NULL;
+  }
+  if (_lowest_non_clean_chunk_size) {
+    FREE_C_HEAP_ARRAY(size_t, _lowest_non_clean_chunk_size);
+    _lowest_non_clean_chunk_size = NULL;
+  }
+  if (_lowest_non_clean_base_chunk_index) {
+    FREE_C_HEAP_ARRAY(uintptr_t, _lowest_non_clean_base_chunk_index);
+    _lowest_non_clean_base_chunk_index = NULL;
+  }
+  if (_last_LNC_resizing_collection) {
+    FREE_C_HEAP_ARRAY(int, _last_LNC_resizing_collection);
+    _last_LNC_resizing_collection = NULL;
+  }
+}
+
+bool CardTableModRefBSForCTRS::card_will_be_scanned(jbyte cv) {
+  return
+    card_is_dirty_wrt_gen_iter(cv) ||
+    _rs->is_prev_nonclean_card_val(cv);
+}
+
+bool CardTableModRefBSForCTRS::card_may_have_been_dirty(jbyte cv) {
+  return
+    cv != clean_card &&
+    (card_is_dirty_wrt_gen_iter(cv) ||
+     CardTableRS::youngergen_may_have_been_dirty(cv));
+}
+
+void CardTableModRefBSForCTRS::non_clean_card_iterate_possibly_parallel(
+  Space* sp,
+  MemRegion mr,
+  OopsInGenClosure* cl,
+  CardTableRS* ct,
+  uint n_threads)
+{
+  if (!mr.is_empty()) {
+    if (n_threads > 0) {
+#if INCLUDE_ALL_GCS
+      non_clean_card_iterate_parallel_work(sp, mr, cl, ct, n_threads);
+#else  // INCLUDE_ALL_GCS
+      fatal("Parallel gc not supported here.");
+#endif // INCLUDE_ALL_GCS
+    } else {
+      // clear_cl finds contiguous dirty ranges of cards to process and clear.
+
+      // This is the single-threaded version used by DefNew.
+      const bool parallel = false;
+
+      DirtyCardToOopClosure* dcto_cl = sp->new_dcto_cl(cl, precision(), cl->gen_boundary(), parallel);
+      ClearNoncleanCardWrapper clear_cl(dcto_cl, ct, parallel);
+
+      clear_cl.do_MemRegion(mr);
+    }
+  }
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/hotspot/src/share/vm/gc/shared/cardTableModRefBSForCTRS.hpp	Mon Aug 17 12:45:16 2015 +0300
@@ -0,0 +1,143 @@
+/*
+ * Copyright (c) 2015, 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.
+ *
+ */
+
+#ifndef SHARE_VM_GC_SHARED_CARDTABLEMODREFBSFORCTRS_HPP
+#define SHARE_VM_GC_SHARED_CARDTABLEMODREFBSFORCTRS_HPP
+
+#include "gc/shared/cardTableModRefBS.hpp"
+
+class CardTableRS;
+class DirtyCardToOopClosure;
+class OopsInGenClosure;
+
+// A specialization for the CardTableRS gen rem set.
+class CardTableModRefBSForCTRS: public CardTableModRefBS {
+  friend class CardTableRS;
+
+public:
+  CardTableModRefBSForCTRS(MemRegion whole_heap);
+  ~CardTableModRefBSForCTRS();
+
+  virtual void initialize();
+
+  void set_CTRS(CardTableRS* rs) { _rs = rs; }
+
+private:
+  CardTableRS* _rs;
+
+  // *** Support for parallel card scanning.
+
+  // dirty and precleaned are equivalent wrt younger_refs_iter.
+  static bool card_is_dirty_wrt_gen_iter(jbyte cv) {
+    return cv == dirty_card || cv == precleaned_card;
+  }
+
+  // Returns "true" iff the value "cv" will cause the card containing it
+  // to be scanned in the current traversal.  May be overridden by
+  // subtypes.
+  bool card_will_be_scanned(jbyte cv);
+
+  // Returns "true" iff the value "cv" may have represented a dirty card at
+  // some point.
+  bool card_may_have_been_dirty(jbyte cv);
+
+  // Iterate over the portion of the card-table which covers the given
+  // region mr in the given space and apply cl to any dirty sub-regions
+  // of mr. Clears the dirty cards as they are processed.
+  void non_clean_card_iterate_possibly_parallel(Space* sp, MemRegion mr,
+                                                OopsInGenClosure* cl, CardTableRS* ct,
+                                                uint n_threads);
+
+  // Work method used to implement non_clean_card_iterate_possibly_parallel()
+  // above in the parallel case.
+  void non_clean_card_iterate_parallel_work(Space* sp, MemRegion mr,
+                                            OopsInGenClosure* cl, CardTableRS* ct,
+                                            uint n_threads);
+
+  // This is an array, one element per covered region of the card table.
+  // Each entry is itself an array, with one element per chunk in the
+  // covered region.  Each entry of these arrays is the lowest non-clean
+  // card of the corresponding chunk containing part of an object from the
+  // previous chunk, or else NULL.
+  typedef jbyte*  CardPtr;
+  typedef CardPtr* CardArr;
+  CardArr* _lowest_non_clean;
+  size_t*  _lowest_non_clean_chunk_size;
+  uintptr_t* _lowest_non_clean_base_chunk_index;
+  int* _last_LNC_resizing_collection;
+
+  // Initializes "lowest_non_clean" to point to the array for the region
+  // covering "sp", and "lowest_non_clean_base_chunk_index" to the chunk
+  // index of the corresponding to the first element of that array.
+  // Ensures that these arrays are of sufficient size, allocating if necessary.
+  // May be called by several threads concurrently.
+  void get_LNC_array_for_space(Space* sp,
+                               jbyte**& lowest_non_clean,
+                               uintptr_t& lowest_non_clean_base_chunk_index,
+                               size_t& lowest_non_clean_chunk_size);
+
+  // Returns the number of chunks necessary to cover "mr".
+  size_t chunks_to_cover(MemRegion mr) {
+    return (size_t)(addr_to_chunk_index(mr.last()) -
+                    addr_to_chunk_index(mr.start()) + 1);
+  }
+
+  // Returns the index of the chunk in a stride which
+  // covers the given address.
+  uintptr_t addr_to_chunk_index(const void* addr) {
+    uintptr_t card = (uintptr_t) byte_for(addr);
+    return card / ParGCCardsPerStrideChunk;
+  }
+
+  // Apply cl, which must either itself apply dcto_cl or be dcto_cl,
+  // to the cards in the stride (of n_strides) within the given space.
+  void process_stride(Space* sp,
+                      MemRegion used,
+                      jint stride, int n_strides,
+                      OopsInGenClosure* cl,
+                      CardTableRS* ct,
+                      jbyte** lowest_non_clean,
+                      uintptr_t lowest_non_clean_base_chunk_index,
+                      size_t lowest_non_clean_chunk_size);
+
+  // Makes sure that chunk boundaries are handled appropriately, by
+  // adjusting the min_done of dcto_cl, and by using a special card-table
+  // value to indicate how min_done should be set.
+  void process_chunk_boundaries(Space* sp,
+                                DirtyCardToOopClosure* dcto_cl,
+                                MemRegion chunk_mr,
+                                MemRegion used,
+                                jbyte** lowest_non_clean,
+                                uintptr_t lowest_non_clean_base_chunk_index,
+                                size_t    lowest_non_clean_chunk_size);
+
+};
+
+template<>
+struct BarrierSet::GetName<CardTableModRefBSForCTRS> {
+  static const BarrierSet::Name value = BarrierSet::CardTableForRS;
+};
+
+#endif // include guard
+
--- a/hotspot/src/share/vm/gc/shared/cardTableRS.cpp	Thu Apr 09 12:29:31 2015 +0200
+++ b/hotspot/src/share/vm/gc/shared/cardTableRS.cpp	Mon Aug 17 12:45:16 2015 +0300
@@ -240,7 +240,7 @@
 // cur-younger-gen                ==> cur_younger_gen
 // cur_youngergen_and_prev_nonclean_card ==> no change.
 void CardTableRS::write_ref_field_gc_par(void* field, oop new_val) {
-  jbyte* entry = ct_bs()->byte_for(field);
+  jbyte* entry = _ct_bs->byte_for(field);
   do {
     jbyte entry_val = *entry;
     // We put this first because it's probably the most common case.
@@ -398,10 +398,10 @@
   jbyte* cur_entry = byte_for(used.start());
   jbyte* limit = byte_after(used.last());
   while (cur_entry < limit) {
-    if (*cur_entry == CardTableModRefBS::clean_card) {
+    if (*cur_entry == clean_card_val()) {
       jbyte* first_dirty = cur_entry+1;
       while (first_dirty < limit &&
-             *first_dirty == CardTableModRefBS::clean_card) {
+             *first_dirty == clean_card_val()) {
         first_dirty++;
       }
       // If the first object is a regular object, and it has a
@@ -418,7 +418,7 @@
               !boundary_obj->is_typeArray()) {
             guarantee(cur_entry > byte_for(used.start()),
                       "else boundary would be boundary_block");
-            if (*byte_for(boundary_block) != CardTableModRefBS::clean_card) {
+            if (*byte_for(boundary_block) != clean_card_val()) {
               begin = boundary_block + s->block_size(boundary_block);
               start_block = begin;
             }
--- a/hotspot/src/share/vm/gc/shared/cardTableRS.hpp	Thu Apr 09 12:29:31 2015 +0200
+++ b/hotspot/src/share/vm/gc/shared/cardTableRS.hpp	Mon Aug 17 12:45:16 2015 +0300
@@ -25,7 +25,7 @@
 #ifndef SHARE_VM_GC_SHARED_CARDTABLERS_HPP
 #define SHARE_VM_GC_SHARED_CARDTABLERS_HPP
 
-#include "gc/shared/cardTableModRefBS.hpp"
+#include "gc/shared/cardTableModRefBSForCTRS.hpp"
 #include "gc/shared/genRemSet.hpp"
 #include "memory/memRegion.hpp"
 
@@ -42,16 +42,16 @@
   friend class ClearNoncleanCardWrapper;
 
   static jbyte clean_card_val() {
-    return CardTableModRefBS::clean_card;
+    return CardTableModRefBSForCTRS::clean_card;
   }
 
   static intptr_t clean_card_row() {
-    return CardTableModRefBS::clean_card_row;
+    return CardTableModRefBSForCTRS::clean_card_row;
   }
 
   static bool
   card_is_dirty_wrt_gen_iter(jbyte cv) {
-    return CardTableModRefBS::card_is_dirty_wrt_gen_iter(cv);
+    return CardTableModRefBSForCTRS::card_is_dirty_wrt_gen_iter(cv);
   }
 
   CardTableModRefBSForCTRS* _ct_bs;
@@ -61,17 +61,17 @@
   void verify_space(Space* s, HeapWord* gen_start);
 
   enum ExtendedCardValue {
-    youngergen_card   = CardTableModRefBS::CT_MR_BS_last_reserved + 1,
+    youngergen_card   = CardTableModRefBSForCTRS::CT_MR_BS_last_reserved + 1,
     // These are for parallel collection.
     // There are three P (parallel) youngergen card values.  In general, this
     // needs to be more than the number of generations (including the perm
     // gen) that might have younger_refs_do invoked on them separately.  So
     // if we add more gens, we have to add more values.
-    youngergenP1_card  = CardTableModRefBS::CT_MR_BS_last_reserved + 2,
-    youngergenP2_card  = CardTableModRefBS::CT_MR_BS_last_reserved + 3,
-    youngergenP3_card  = CardTableModRefBS::CT_MR_BS_last_reserved + 4,
+    youngergenP1_card  = CardTableModRefBSForCTRS::CT_MR_BS_last_reserved + 2,
+    youngergenP2_card  = CardTableModRefBSForCTRS::CT_MR_BS_last_reserved + 3,
+    youngergenP3_card  = CardTableModRefBSForCTRS::CT_MR_BS_last_reserved + 4,
     cur_youngergen_and_prev_nonclean_card =
-      CardTableModRefBS::CT_MR_BS_last_reserved + 5
+      CardTableModRefBSForCTRS::CT_MR_BS_last_reserved + 5
   };
 
   // An array that contains, for each generation, the card table value last
@@ -107,7 +107,7 @@
   // *** GenRemSet functions.
   CardTableRS* as_CardTableRS() { return this; }
 
-  CardTableModRefBS* ct_bs() { return _ct_bs; }
+  CardTableModRefBSForCTRS* ct_bs() { return _ct_bs; }
 
   // Override.
   void prepare_for_younger_refs_iterate(bool parallel);
@@ -147,7 +147,7 @@
   void invalidate_or_clear(Generation* old_gen);
 
   static uintx ct_max_alignment_constraint() {
-    return CardTableModRefBS::ct_max_alignment_constraint();
+    return CardTableModRefBSForCTRS::ct_max_alignment_constraint();
   }
 
   jbyte* byte_for(void* p)     { return _ct_bs->byte_for(p); }
--- a/hotspot/src/share/vm/gc/shared/taskqueue.hpp	Thu Apr 09 12:29:31 2015 +0200
+++ b/hotspot/src/share/vm/gc/shared/taskqueue.hpp	Mon Aug 17 12:45:16 2015 +0300
@@ -295,8 +295,9 @@
   // Delete any resource associated with the queue.
   ~GenericTaskQueue();
 
-  // apply the closure to all elements in the task queue
-  void oops_do(OopClosure* f);
+  // Apply fn to each element in the task queue.  The queue must not
+  // be modified while iterating.
+  template<typename Fn> void iterate(Fn fn);
 
 private:
   // Element array.
--- a/hotspot/src/share/vm/gc/shared/taskqueue.inline.hpp	Thu Apr 09 12:29:31 2015 +0200
+++ b/hotspot/src/share/vm/gc/shared/taskqueue.inline.hpp	Mon Aug 17 12:45:16 2015 +0300
@@ -259,20 +259,14 @@
 }
 
 template<class E, MEMFLAGS F, unsigned int N>
-inline void GenericTaskQueue<E, F, N>::oops_do(OopClosure* f) {
-  // tty->print_cr("START OopTaskQueue::oops_do");
+template<class Fn>
+inline void GenericTaskQueue<E, F, N>::iterate(Fn fn) {
   uint iters = size();
   uint index = _bottom;
   for (uint i = 0; i < iters; ++i) {
     index = decrement_index(index);
-    // tty->print_cr("  doing entry %d," INTPTR_T " -> " INTPTR_T,
-    //            index, &_elems[index], _elems[index]);
-    E* t = (E*)&_elems[index];      // cast away volatility
-    oop* p = (oop*)t;
-    assert((*t)->is_oop_or_null(), err_msg("Expected an oop or NULL at " PTR_FORMAT, p2i(*t)));
-    f->do_oop(p);
+    fn(const_cast<E&>(_elems[index])); // cast away volatility
   }
-  // tty->print_cr("END OopTaskQueue::oops_do");
 }
 
 
--- a/hotspot/src/share/vm/memory/universe.cpp	Thu Apr 09 12:29:31 2015 +0200
+++ b/hotspot/src/share/vm/memory/universe.cpp	Mon Aug 17 12:45:16 2015 +0300
@@ -56,6 +56,7 @@
 #include "prims/jvmtiRedefineClassesTrace.hpp"
 #include "runtime/arguments.hpp"
 #include "runtime/atomic.inline.hpp"
+#include "runtime/commandLineFlagConstraintList.hpp"
 #include "runtime/deoptimization.hpp"
 #include "runtime/fprofiler.hpp"
 #include "runtime/handles.inline.hpp"
@@ -656,6 +657,11 @@
 
   Metaspace::global_initialize();
 
+  // Checks 'AfterMemoryInit' constraints.
+  if (!CommandLineFlagConstraintList::check_constraints(CommandLineFlagConstraint::AfterMemoryInit)) {
+    return JNI_EINVAL;
+  }
+
   // Create memory for metadata.  Must be after initializing heap for
   // DumpSharedSpaces.
   ClassLoaderData::init_null_class_loader_data();
--- a/hotspot/src/share/vm/oops/oop.hpp	Thu Apr 09 12:29:31 2015 +0200
+++ b/hotspot/src/share/vm/oops/oop.hpp	Mon Aug 17 12:45:16 2015 +0300
@@ -200,7 +200,6 @@
 
   // Access to fields in a instanceOop through these methods.
   oop obj_field(int offset) const;
-  volatile oop obj_field_volatile(int offset) const;
   void obj_field_put(int offset, oop value);
   void obj_field_put_raw(int offset, oop value);
   void obj_field_put_volatile(int offset, oop value);
--- a/hotspot/src/share/vm/oops/oop.inline.hpp	Thu Apr 09 12:29:31 2015 +0200
+++ b/hotspot/src/share/vm/oops/oop.inline.hpp	Mon Aug 17 12:45:16 2015 +0300
@@ -284,11 +284,7 @@
     load_decode_heap_oop(obj_field_addr<narrowOop>(offset)) :
     load_decode_heap_oop(obj_field_addr<oop>(offset));
 }
-inline volatile oop oopDesc::obj_field_volatile(int offset) const {
-  volatile oop value = obj_field(offset);
-  OrderAccess::acquire();
-  return value;
-}
+
 inline void oopDesc::obj_field_put(int offset, oop value) {
   UseCompressedOops ? oop_store(obj_field_addr<narrowOop>(offset), value) :
                       oop_store(obj_field_addr<oop>(offset),       value);
--- a/hotspot/src/share/vm/opto/c2_globals.hpp	Thu Apr 09 12:29:31 2015 +0200
+++ b/hotspot/src/share/vm/opto/c2_globals.hpp	Mon Aug 17 12:45:16 2015 +0300
@@ -659,7 +659,7 @@
           "0 for no aliasing, 1 for oop/field/static/array split, "         \
           "2 for class split, 3 for unique instances")                      \
           range(0, 3)                                                       \
-          constraint(AliasLevelConstraintFunc)                              \
+          constraint(AliasLevelConstraintFunc,AfterErgo)                    \
                                                                             \
   develop(bool, VerifyAliases, false,                                       \
           "perform extra checks on the results of alias analysis")          \
--- a/hotspot/src/share/vm/opto/c2compiler.cpp	Thu Apr 09 12:29:31 2015 +0200
+++ b/hotspot/src/share/vm/opto/c2compiler.cpp	Mon Aug 17 12:45:16 2015 +0300
@@ -79,7 +79,6 @@
   return OptoRuntime::generate(thread->env());
 }
 
-
 void C2Compiler::initialize() {
   // The first compiler thread that gets here will initialize the
   // small amount of global state (and runtime stubs) that C2 needs.
@@ -154,11 +153,361 @@
   }
 }
 
-
 void C2Compiler::print_timers() {
   Compile::print_timers();
 }
 
+bool C2Compiler::is_intrinsic_available(methodHandle method, methodHandle compilation_context) {
+  // Assume a non-virtual dispatch. A virtual dispatch is
+  // possible for only a limited set of available intrinsics whereas
+  // a non-virtual dispatch is possible for all available intrinsics.
+  return is_intrinsic_supported(method, false) &&
+         !is_intrinsic_disabled_by_flag(method, compilation_context);
+}
+
+bool C2Compiler::is_intrinsic_supported(methodHandle method, bool is_virtual) {
+  vmIntrinsics::ID id = method->intrinsic_id();
+  assert(id != vmIntrinsics::_none, "must be a VM intrinsic");
+
+  if (id < vmIntrinsics::FIRST_ID || id >= vmIntrinsics::LAST_COMPILER_INLINE) {
+    return false;
+  }
+
+  // Only Object.hashCode and Object.clone intrinsics implement also a virtual
+  // dispatch because calling both methods is expensive but both methods are
+  // frequently overridden. All other intrinsics implement only a non-virtual
+  // dispatch.
+  if (is_virtual) {
+    switch (id) {
+    case vmIntrinsics::_hashCode:
+    case vmIntrinsics::_clone:
+      break;
+    default:
+      return false;
+    }
+  }
+
+  switch (id) {
+  case vmIntrinsics::_compareTo:
+    if (!Matcher::match_rule_supported(Op_StrComp)) return false;
+    break;
+  case vmIntrinsics::_equals:
+    if (!Matcher::match_rule_supported(Op_StrEquals)) return false;
+    break;
+  case vmIntrinsics::_equalsC:
+    if (!Matcher::match_rule_supported(Op_AryEq)) return false;
+    break;
+  case vmIntrinsics::_copyMemory:
+    if (StubRoutines::unsafe_arraycopy() == NULL) return false;
+    break;
+  case vmIntrinsics::_encodeISOArray:
+    if (!Matcher::match_rule_supported(Op_EncodeISOArray)) return false;
+    break;
+  case vmIntrinsics::_bitCount_i:
+    if (!Matcher::match_rule_supported(Op_PopCountI)) return false;
+    break;
+  case vmIntrinsics::_bitCount_l:
+    if (!Matcher::match_rule_supported(Op_PopCountL)) return false;
+    break;
+  case vmIntrinsics::_numberOfLeadingZeros_i:
+    if (!Matcher::match_rule_supported(Op_CountLeadingZerosI)) return false;
+    break;
+  case vmIntrinsics::_numberOfLeadingZeros_l:
+    if (!Matcher::match_rule_supported(Op_CountLeadingZerosL)) return false;
+    break;
+  case vmIntrinsics::_numberOfTrailingZeros_i:
+    if (!Matcher::match_rule_supported(Op_CountTrailingZerosI)) return false;
+    break;
+  case vmIntrinsics::_numberOfTrailingZeros_l:
+    if (!Matcher::match_rule_supported(Op_CountTrailingZerosL)) return false;
+    break;
+  case vmIntrinsics::_reverseBytes_c:
+    if (!Matcher::match_rule_supported(Op_ReverseBytesUS)) return false;
+    break;
+  case vmIntrinsics::_reverseBytes_s:
+    if (!Matcher::match_rule_supported(Op_ReverseBytesS)) return false;
+    break;
+  case vmIntrinsics::_reverseBytes_i:
+    if (!Matcher::match_rule_supported(Op_ReverseBytesI)) return false;
+    break;
+  case vmIntrinsics::_reverseBytes_l:
+    if (!Matcher::match_rule_supported(Op_ReverseBytesL)) return false;
+    break;
+  case vmIntrinsics::_compareAndSwapObject:
+#ifdef _LP64
+    if (!UseCompressedOops && !Matcher::match_rule_supported(Op_CompareAndSwapP)) return false;
+#endif
+    break;
+  case vmIntrinsics::_compareAndSwapLong:
+    if (!Matcher::match_rule_supported(Op_CompareAndSwapL)) return false;
+    break;
+  case vmIntrinsics::_getAndAddInt:
+    if (!Matcher::match_rule_supported(Op_GetAndAddI)) return false;
+    break;
+  case vmIntrinsics::_getAndAddLong:
+    if (!Matcher::match_rule_supported(Op_GetAndAddL)) return false;
+    break;
+  case vmIntrinsics::_getAndSetInt:
+    if (!Matcher::match_rule_supported(Op_GetAndSetI)) return false;
+    break;
+  case vmIntrinsics::_getAndSetLong:
+    if (!Matcher::match_rule_supported(Op_GetAndSetL)) return false;
+    break;
+  case vmIntrinsics::_getAndSetObject:
+#ifdef _LP64
+    if (!UseCompressedOops && !Matcher::match_rule_supported(Op_GetAndSetP)) return false;
+    if (UseCompressedOops && !Matcher::match_rule_supported(Op_GetAndSetN)) return false;
+    break;
+#else
+    if (!Matcher::match_rule_supported(Op_GetAndSetP)) return false;
+    break;
+#endif
+  case vmIntrinsics::_incrementExactI:
+  case vmIntrinsics::_addExactI:
+    if (!Matcher::match_rule_supported(Op_OverflowAddI)) return false;
+    break;
+  case vmIntrinsics::_incrementExactL:
+  case vmIntrinsics::_addExactL:
+    if (!Matcher::match_rule_supported(Op_OverflowAddL)) return false;
+    break;
+  case vmIntrinsics::_decrementExactI:
+  case vmIntrinsics::_subtractExactI:
+    if (!Matcher::match_rule_supported(Op_OverflowSubI)) return false;
+    break;
+  case vmIntrinsics::_decrementExactL:
+  case vmIntrinsics::_subtractExactL:
+    if (!Matcher::match_rule_supported(Op_OverflowSubL)) return false;
+    break;
+  case vmIntrinsics::_negateExactI:
+    if (!Matcher::match_rule_supported(Op_OverflowSubI)) return false;
+    break;
+  case vmIntrinsics::_negateExactL:
+    if (!Matcher::match_rule_supported(Op_OverflowSubL)) return false;
+    break;
+  case vmIntrinsics::_multiplyExactI:
+    if (!Matcher::match_rule_supported(Op_OverflowMulI)) return false;
+    break;
+  case vmIntrinsics::_multiplyExactL:
+    if (!Matcher::match_rule_supported(Op_OverflowMulL)) return false;
+    break;
+  case vmIntrinsics::_getCallerClass:
+    if (SystemDictionary::reflect_CallerSensitive_klass() == NULL) return false;
+    break;
+  case vmIntrinsics::_hashCode:
+  case vmIntrinsics::_identityHashCode:
+  case vmIntrinsics::_getClass:
+  case vmIntrinsics::_dsin:
+  case vmIntrinsics::_dcos:
+  case vmIntrinsics::_dtan:
+  case vmIntrinsics::_dabs:
+  case vmIntrinsics::_datan2:
+  case vmIntrinsics::_dsqrt:
+  case vmIntrinsics::_dexp:
+  case vmIntrinsics::_dlog:
+  case vmIntrinsics::_dlog10:
+  case vmIntrinsics::_dpow:
+  case vmIntrinsics::_min:
+  case vmIntrinsics::_max:
+  case vmIntrinsics::_arraycopy:
+  case vmIntrinsics::_indexOf:
+  case vmIntrinsics::_getObject:
+  case vmIntrinsics::_getBoolean:
+  case vmIntrinsics::_getByte:
+  case vmIntrinsics::_getShort:
+  case vmIntrinsics::_getChar:
+  case vmIntrinsics::_getInt:
+  case vmIntrinsics::_getLong:
+  case vmIntrinsics::_getFloat:
+  case vmIntrinsics::_getDouble:
+  case vmIntrinsics::_putObject:
+  case vmIntrinsics::_putBoolean:
+  case vmIntrinsics::_putByte:
+  case vmIntrinsics::_putShort:
+  case vmIntrinsics::_putChar:
+  case vmIntrinsics::_putInt:
+  case vmIntrinsics::_putLong:
+  case vmIntrinsics::_putFloat:
+  case vmIntrinsics::_putDouble:
+  case vmIntrinsics::_getByte_raw:
+  case vmIntrinsics::_getShort_raw:
+  case vmIntrinsics::_getChar_raw:
+  case vmIntrinsics::_getInt_raw:
+  case vmIntrinsics::_getLong_raw:
+  case vmIntrinsics::_getFloat_raw:
+  case vmIntrinsics::_getDouble_raw:
+  case vmIntrinsics::_getAddress_raw:
+  case vmIntrinsics::_putByte_raw:
+  case vmIntrinsics::_putShort_raw:
+  case vmIntrinsics::_putChar_raw:
+  case vmIntrinsics::_putInt_raw:
+  case vmIntrinsics::_putLong_raw:
+  case vmIntrinsics::_putFloat_raw:
+  case vmIntrinsics::_putDouble_raw:
+  case vmIntrinsics::_putAddress_raw:
+  case vmIntrinsics::_getObjectVolatile:
+  case vmIntrinsics::_getBooleanVolatile:
+  case vmIntrinsics::_getByteVolatile:
+  case vmIntrinsics::_getShortVolatile:
+  case vmIntrinsics::_getCharVolatile:
+  case vmIntrinsics::_getIntVolatile:
+  case vmIntrinsics::_getLongVolatile:
+  case vmIntrinsics::_getFloatVolatile:
+  case vmIntrinsics::_getDoubleVolatile:
+  case vmIntrinsics::_putObjectVolatile:
+  case vmIntrinsics::_putBooleanVolatile:
+  case vmIntrinsics::_putByteVolatile:
+  case vmIntrinsics::_putShortVolatile:
+  case vmIntrinsics::_putCharVolatile:
+  case vmIntrinsics::_putIntVolatile:
+  case vmIntrinsics::_putLongVolatile:
+  case vmIntrinsics::_putFloatVolatile:
+  case vmIntrinsics::_putDoubleVolatile:
+  case vmIntrinsics::_getShortUnaligned:
+  case vmIntrinsics::_getCharUnaligned:
+  case vmIntrinsics::_getIntUnaligned:
+  case vmIntrinsics::_getLongUnaligned:
+  case vmIntrinsics::_putShortUnaligned:
+  case vmIntrinsics::_putCharUnaligned:
+  case vmIntrinsics::_putIntUnaligned:
+  case vmIntrinsics::_putLongUnaligned:
+  case vmIntrinsics::_compareAndSwapInt:
+  case vmIntrinsics::_putOrderedObject:
+  case vmIntrinsics::_putOrderedInt:
+  case vmIntrinsics::_putOrderedLong:
+  case vmIntrinsics::_loadFence:
+  case vmIntrinsics::_storeFence:
+  case vmIntrinsics::_fullFence:
+  case vmIntrinsics::_currentThread:
+  case vmIntrinsics::_isInterrupted:
+#ifdef TRACE_HAVE_INTRINSICS
+  case vmIntrinsics::_classID:
+  case vmIntrinsics::_threadID:
+  case vmIntrinsics::_counterTime:
+#endif
+  case vmIntrinsics::_currentTimeMillis:
+  case vmIntrinsics::_nanoTime:
+  case vmIntrinsics::_allocateInstance:
+  case vmIntrinsics::_newArray:
+  case vmIntrinsics::_getLength:
+  case vmIntrinsics::_copyOf:
+  case vmIntrinsics::_copyOfRange:
+  case vmIntrinsics::_clone:
+  case vmIntrinsics::_isAssignableFrom:
+  case vmIntrinsics::_isInstance:
+  case vmIntrinsics::_getModifiers:
+  case vmIntrinsics::_isInterface:
+  case vmIntrinsics::_isArray:
+  case vmIntrinsics::_isPrimitive:
+  case vmIntrinsics::_getSuperclass:
+  case vmIntrinsics::_getClassAccessFlags:
+  case vmIntrinsics::_floatToRawIntBits:
+  case vmIntrinsics::_floatToIntBits:
+  case vmIntrinsics::_intBitsToFloat:
+  case vmIntrinsics::_doubleToRawLongBits:
+  case vmIntrinsics::_doubleToLongBits:
+  case vmIntrinsics::_longBitsToDouble:
+  case vmIntrinsics::_Reference_get:
+  case vmIntrinsics::_Class_cast:
+  case vmIntrinsics::_aescrypt_encryptBlock:
+  case vmIntrinsics::_aescrypt_decryptBlock:
+  case vmIntrinsics::_cipherBlockChaining_encryptAESCrypt:
+  case vmIntrinsics::_cipherBlockChaining_decryptAESCrypt:
+  case vmIntrinsics::_sha_implCompress:
+  case vmIntrinsics::_sha2_implCompress:
+  case vmIntrinsics::_sha5_implCompress:
+  case vmIntrinsics::_digestBase_implCompressMB:
+  case vmIntrinsics::_multiplyToLen:
+  case vmIntrinsics::_squareToLen:
+  case vmIntrinsics::_mulAdd:
+  case vmIntrinsics::_montgomeryMultiply:
+  case vmIntrinsics::_montgomerySquare:
+  case vmIntrinsics::_ghash_processBlocks:
+  case vmIntrinsics::_updateCRC32:
+  case vmIntrinsics::_updateBytesCRC32:
+  case vmIntrinsics::_updateByteBufferCRC32:
+  case vmIntrinsics::_updateBytesCRC32C:
+  case vmIntrinsics::_updateDirectByteBufferCRC32C:
+  case vmIntrinsics::_profileBoolean:
+  case vmIntrinsics::_isCompileConstant:
+    break;
+  default:
+    return false;
+  }
+  return true;
+}
+
+bool C2Compiler::is_intrinsic_disabled_by_flag(methodHandle method, methodHandle compilation_context) {
+  vmIntrinsics::ID id = method->intrinsic_id();
+  assert(id != vmIntrinsics::_none, "must be a VM intrinsic");
+
+  if (vmIntrinsics::is_disabled_by_flags(method->intrinsic_id())) {
+    return true;
+  }
+
+  // Check if the intrinsic corresponding to 'method' has been disabled on
+  // the command line by using the DisableIntrinsic flag (either globally
+  // or on a per-method level, see src/share/vm/compiler/abstractCompiler.hpp
+  // for details).
+  // Usually, the compilation context is the caller of the method 'method'.
+  // The only case when for a non-recursive method 'method' the compilation context
+  // is not the caller of the 'method' (but it is the method itself) is
+  // java.lang.ref.Referene::get.
+  // For java.lang.ref.Reference::get, the intrinsic version is used
+  // instead of the C2-compiled version so that the value in the referent
+  // field can be registered by the G1 pre-barrier code. The intrinsified
+  // version of Reference::get also adds a memory barrier to prevent
+  // commoning reads from the referent field across safepoint since GC
+  // can change the referent field's value. See Compile::Compile()
+  // in src/share/vm/opto/compile.cpp for more details.
+  ccstr disable_intr = NULL;
+  if ((DisableIntrinsic[0] != '\0' && strstr(DisableIntrinsic, vmIntrinsics::name_at(id)) != NULL) ||
+      (!compilation_context.is_null() &&
+       CompilerOracle::has_option_value(compilation_context, "DisableIntrinsic", disable_intr) &&
+       strstr(disable_intr, vmIntrinsics::name_at(id)) != NULL)
+  ) {
+    return true;
+  }
+
+  // -XX:-InlineNatives disables nearly all intrinsics except the ones listed in
+  // the following switch statement.
+  if (!InlineNatives) {
+    switch (id) {
+    case vmIntrinsics::_indexOf:
+    case vmIntrinsics::_compareTo:
+    case vmIntrinsics::_equals:
+    case vmIntrinsics::_equalsC:
+    case vmIntrinsics::_getAndAddInt:
+    case vmIntrinsics::_getAndAddLong:
+    case vmIntrinsics::_getAndSetInt:
+    case vmIntrinsics::_getAndSetLong:
+    case vmIntrinsics::_getAndSetObject:
+    case vmIntrinsics::_loadFence:
+    case vmIntrinsics::_storeFence:
+    case vmIntrinsics::_fullFence:
+    case vmIntrinsics::_Reference_get:
+      break;
+    default:
+      return true;
+    }
+  }
+
+  if (!InlineUnsafeOps) {
+    switch (id) {
+    case vmIntrinsics::_loadFence:
+    case vmIntrinsics::_storeFence:
+    case vmIntrinsics::_fullFence:
+    case vmIntrinsics::_compareAndSwapObject:
+    case vmIntrinsics::_compareAndSwapLong:
+    case vmIntrinsics::_compareAndSwapInt:
+      return true;
+    default:
+      return false;
+    }
+  }
+
+  return false;
+}
+
 int C2Compiler::initial_code_buffer_size() {
   assert(SegmentedCodeCache, "Should be only used with a segmented code cache");
   return Compile::MAX_inst_size + Compile::MAX_locs_size + initial_const_capacity;
--- a/hotspot/src/share/vm/opto/c2compiler.hpp	Thu Apr 09 12:29:31 2015 +0200
+++ b/hotspot/src/share/vm/opto/c2compiler.hpp	Mon Aug 17 12:45:16 2015 +0300
@@ -36,7 +36,6 @@
 
   // Name
   const char *name() { return "C2"; }
-
   void initialize();
 
   // Compilation entry point for methods
@@ -52,6 +51,26 @@
   // Print compilation timers and statistics
   void print_timers();
 
+  // Check the availability of an intrinsic for 'method' given a compilation context.
+  virtual bool is_intrinsic_available(methodHandle method, methodHandle compilation_context);
+
+  // Return true if the intrinsification of a method supported by the compiler
+  // assuming a non-virtual dispatch. Return false otherwise.
+  virtual bool is_intrinsic_supported(methodHandle method) {
+    return is_intrinsic_supported(method, false);
+  }
+
+  // Check if the compiler supports an intrinsic for 'method' given the
+  // the dispatch mode specified by the 'is_virtual' parameter.
+  virtual bool is_intrinsic_supported(methodHandle method, bool is_virtual);
+
+  // Processing of command-line flags specific to the C2 compiler.
+  virtual bool is_intrinsic_disabled_by_flag(methodHandle method) {
+    return is_intrinsic_disabled_by_flag(method, NULL);
+  }
+
+  virtual bool is_intrinsic_disabled_by_flag(methodHandle method, methodHandle compilation_context);
+
   // Initial size of the code buffer (may be increased at runtime)
   static int initial_code_buffer_size();
 };
--- a/hotspot/src/share/vm/opto/library_call.cpp	Thu Apr 09 12:29:31 2015 +0200
+++ b/hotspot/src/share/vm/opto/library_call.cpp	Mon Aug 17 12:45:16 2015 +0300
@@ -31,6 +31,7 @@
 #include "oops/objArrayKlass.hpp"
 #include "opto/addnode.hpp"
 #include "opto/arraycopynode.hpp"
+#include "opto/c2compiler.hpp"
 #include "opto/callGenerator.hpp"
 #include "opto/castnode.hpp"
 #include "opto/cfgnode.hpp"
@@ -305,330 +306,40 @@
   bool inline_isCompileConstant();
 };
 
-
 //---------------------------make_vm_intrinsic----------------------------
 CallGenerator* Compile::make_vm_intrinsic(ciMethod* m, bool is_virtual) {
   vmIntrinsics::ID id = m->intrinsic_id();
   assert(id != vmIntrinsics::_none, "must be a VM intrinsic");
 
-  ccstr disable_intr = NULL;
-
-  if ((DisableIntrinsic[0] != '\0'
-       && strstr(DisableIntrinsic, vmIntrinsics::name_at(id)) != NULL) ||
-      (method_has_option_value("DisableIntrinsic", disable_intr)
-       && strstr(disable_intr, vmIntrinsics::name_at(id)) != NULL)) {
-    // disabled by a user request on the command line:
-    // example: -XX:DisableIntrinsic=_hashCode,_getClass
-    return NULL;
-  }
-
   if (!m->is_loaded()) {
-    // do not attempt to inline unloaded methods
-    return NULL;
-  }
-
-  // Only a few intrinsics implement a virtual dispatch.
-  // They are expensive calls which are also frequently overridden.
-  if (is_virtual) {
-    switch (id) {
-    case vmIntrinsics::_hashCode:
-    case vmIntrinsics::_clone:
-      // OK, Object.hashCode and Object.clone intrinsics come in both flavors
-      break;
-    default:
-      return NULL;
-    }
-  }
-
-  // -XX:-InlineNatives disables nearly all intrinsics:
-  if (!InlineNatives) {
-    switch (id) {
-    case vmIntrinsics::_indexOf:
-    case vmIntrinsics::_compareTo:
-    case vmIntrinsics::_equals:
-    case vmIntrinsics::_equalsC:
-    case vmIntrinsics::_getAndAddInt:
-    case vmIntrinsics::_getAndAddLong:
-    case vmIntrinsics::_getAndSetInt:
-    case vmIntrinsics::_getAndSetLong:
-    case vmIntrinsics::_getAndSetObject:
-    case vmIntrinsics::_loadFence:
-    case vmIntrinsics::_storeFence:
-    case vmIntrinsics::_fullFence:
-      break;  // InlineNatives does not control String.compareTo
-    case vmIntrinsics::_Reference_get:
-      break;  // InlineNatives does not control Reference.get
-    default:
-      return NULL;
-    }
-  }
-
-  int predicates = 0;
-  bool does_virtual_dispatch = false;
-
-  switch (id) {
-  case vmIntrinsics::_compareTo:
-    if (!SpecialStringCompareTo)  return NULL;
-    if (!Matcher::match_rule_supported(Op_StrComp))  return NULL;
-    break;
-  case vmIntrinsics::_indexOf:
-    if (!SpecialStringIndexOf)  return NULL;
-    break;
-  case vmIntrinsics::_equals:
-    if (!SpecialStringEquals)  return NULL;
-    if (!Matcher::match_rule_supported(Op_StrEquals))  return NULL;
-    break;
-  case vmIntrinsics::_equalsC:
-    if (!SpecialArraysEquals)  return NULL;
-    if (!Matcher::match_rule_supported(Op_AryEq))  return NULL;
-    break;
-  case vmIntrinsics::_arraycopy:
-    if (!InlineArrayCopy)  return NULL;
-    break;
-  case vmIntrinsics::_copyMemory:
-    if (StubRoutines::unsafe_arraycopy() == NULL)  return NULL;
-    if (!InlineArrayCopy)  return NULL;
-    break;
-  case vmIntrinsics::_hashCode:
-    if (!InlineObjectHash)  return NULL;
-    does_virtual_dispatch = true;
-    break;
-  case vmIntrinsics::_clone:
-    does_virtual_dispatch = true;
-  case vmIntrinsics::_copyOf:
-  case vmIntrinsics::_copyOfRange:
-    if (!InlineObjectCopy)  return NULL;
-    // These also use the arraycopy intrinsic mechanism:
-    if (!InlineArrayCopy)  return NULL;
-    break;
-  case vmIntrinsics::_encodeISOArray:
-    if (!SpecialEncodeISOArray)  return NULL;
-    if (!Matcher::match_rule_supported(Op_EncodeISOArray))  return NULL;
-    break;
-  case vmIntrinsics::_checkIndex:
-    // We do not intrinsify this.  The optimizer does fine with it.
+    // Do not attempt to inline unloaded methods.
     return NULL;
-
-  case vmIntrinsics::_getCallerClass:
-    if (!InlineReflectionGetCallerClass)  return NULL;
-    if (SystemDictionary::reflect_CallerSensitive_klass() == NULL)  return NULL;
-    break;
-
-  case vmIntrinsics::_bitCount_i:
-    if (!Matcher::match_rule_supported(Op_PopCountI)) return NULL;
-    break;
-
-  case vmIntrinsics::_bitCount_l:
-    if (!Matcher::match_rule_supported(Op_PopCountL)) return NULL;
-    break;
-
-  case vmIntrinsics::_numberOfLeadingZeros_i:
-    if (!Matcher::match_rule_supported(Op_CountLeadingZerosI)) return NULL;
-    break;
-
-  case vmIntrinsics::_numberOfLeadingZeros_l:
-    if (!Matcher::match_rule_supported(Op_CountLeadingZerosL)) return NULL;
-    break;
-
-  case vmIntrinsics::_numberOfTrailingZeros_i:
-    if (!Matcher::match_rule_supported(Op_CountTrailingZerosI)) return NULL;
-    break;
-
-  case vmIntrinsics::_numberOfTrailingZeros_l:
-    if (!Matcher::match_rule_supported(Op_CountTrailingZerosL)) return NULL;
-    break;
-
-  case vmIntrinsics::_reverseBytes_c:
-    if (!Matcher::match_rule_supported(Op_ReverseBytesUS)) return NULL;
-    break;
-  case vmIntrinsics::_reverseBytes_s:
-    if (!Matcher::match_rule_supported(Op_ReverseBytesS))  return NULL;
-    break;
-  case vmIntrinsics::_reverseBytes_i:
-    if (!Matcher::match_rule_supported(Op_ReverseBytesI))  return NULL;
-    break;
-  case vmIntrinsics::_reverseBytes_l:
-    if (!Matcher::match_rule_supported(Op_ReverseBytesL))  return NULL;
-    break;
-
-  case vmIntrinsics::_Reference_get:
-    // Use the intrinsic version of Reference.get() so that the value in
-    // the referent field can be registered by the G1 pre-barrier code.
-    // Also add memory barrier to prevent commoning reads from this field
-    // across safepoint since GC can change it value.
-    break;
-
-  case vmIntrinsics::_compareAndSwapObject:
-#ifdef _LP64
-    if (!UseCompressedOops && !Matcher::match_rule_supported(Op_CompareAndSwapP)) return NULL;
-#endif
-    break;
-
-  case vmIntrinsics::_compareAndSwapLong:
-    if (!Matcher::match_rule_supported(Op_CompareAndSwapL)) return NULL;
-    break;
-
-  case vmIntrinsics::_getAndAddInt:
-    if (!Matcher::match_rule_supported(Op_GetAndAddI)) return NULL;
-    break;
-
-  case vmIntrinsics::_getAndAddLong:
-    if (!Matcher::match_rule_supported(Op_GetAndAddL)) return NULL;
-    break;
-
-  case vmIntrinsics::_getAndSetInt:
-    if (!Matcher::match_rule_supported(Op_GetAndSetI)) return NULL;
-    break;
-
-  case vmIntrinsics::_getAndSetLong:
-    if (!Matcher::match_rule_supported(Op_GetAndSetL)) return NULL;
-    break;
-
-  case vmIntrinsics::_getAndSetObject:
-#ifdef _LP64
-    if (!UseCompressedOops && !Matcher::match_rule_supported(Op_GetAndSetP)) return NULL;
-    if (UseCompressedOops && !Matcher::match_rule_supported(Op_GetAndSetN)) return NULL;
-    break;
-#else
-    if (!Matcher::match_rule_supported(Op_GetAndSetP)) return NULL;
-    break;
-#endif
-
-  case vmIntrinsics::_aescrypt_encryptBlock:
-  case vmIntrinsics::_aescrypt_decryptBlock:
-    if (!UseAESIntrinsics) return NULL;
-    break;
-
-  case vmIntrinsics::_multiplyToLen:
-    if (!UseMultiplyToLenIntrinsic) return NULL;
-    break;
-
-  case vmIntrinsics::_squareToLen:
-    if (!UseSquareToLenIntrinsic) return NULL;
-    break;
-
-  case vmIntrinsics::_mulAdd:
-    if (!UseMulAddIntrinsic) return NULL;
-    break;
-
-  case vmIntrinsics::_montgomeryMultiply:
-     if (!UseMontgomeryMultiplyIntrinsic) return NULL;
-    break;
-  case vmIntrinsics::_montgomerySquare:
-     if (!UseMontgomerySquareIntrinsic) return NULL;
-    break;
-
-  case vmIntrinsics::_cipherBlockChaining_encryptAESCrypt:
-  case vmIntrinsics::_cipherBlockChaining_decryptAESCrypt:
-    if (!UseAESIntrinsics) return NULL;
-    // these two require the predicated logic
-    predicates = 1;
-    break;
-
-  case vmIntrinsics::_sha_implCompress:
-    if (!UseSHA1Intrinsics) return NULL;
-    break;
-
-  case vmIntrinsics::_sha2_implCompress:
-    if (!UseSHA256Intrinsics) return NULL;
-    break;
-
-  case vmIntrinsics::_sha5_implCompress:
-    if (!UseSHA512Intrinsics) return NULL;
-    break;
-
-  case vmIntrinsics::_digestBase_implCompressMB:
-    if (!(UseSHA1Intrinsics || UseSHA256Intrinsics || UseSHA512Intrinsics)) return NULL;
-    predicates = 3;
-    break;
-
-  case vmIntrinsics::_ghash_processBlocks:
-    if (!UseGHASHIntrinsics) return NULL;
-    break;
-
-  case vmIntrinsics::_updateCRC32:
-  case vmIntrinsics::_updateBytesCRC32:
-  case vmIntrinsics::_updateByteBufferCRC32:
-    if (!UseCRC32Intrinsics) return NULL;
-    break;
-
-  case vmIntrinsics::_updateBytesCRC32C:
-  case vmIntrinsics::_updateDirectByteBufferCRC32C:
-    if (!UseCRC32CIntrinsics) return NULL;
-    break;
-
-  case vmIntrinsics::_incrementExactI:
-  case vmIntrinsics::_addExactI:
-    if (!Matcher::match_rule_supported(Op_OverflowAddI) || !UseMathExactIntrinsics) return NULL;
-    break;
-  case vmIntrinsics::_incrementExactL:
-  case vmIntrinsics::_addExactL:
-    if (!Matcher::match_rule_supported(Op_OverflowAddL) || !UseMathExactIntrinsics) return NULL;
-    break;
-  case vmIntrinsics::_decrementExactI:
-  case vmIntrinsics::_subtractExactI:
-    if (!Matcher::match_rule_supported(Op_OverflowSubI) || !UseMathExactIntrinsics) return NULL;
-    break;
-  case vmIntrinsics::_decrementExactL:
-  case vmIntrinsics::_subtractExactL:
-    if (!Matcher::match_rule_supported(Op_OverflowSubL) || !UseMathExactIntrinsics) return NULL;
-    break;
-  case vmIntrinsics::_negateExactI:
-    if (!Matcher::match_rule_supported(Op_OverflowSubI) || !UseMathExactIntrinsics) return NULL;
-    break;
-  case vmIntrinsics::_negateExactL:
-    if (!Matcher::match_rule_supported(Op_OverflowSubL) || !UseMathExactIntrinsics) return NULL;
-    break;
-  case vmIntrinsics::_multiplyExactI:
-    if (!Matcher::match_rule_supported(Op_OverflowMulI) || !UseMathExactIntrinsics) return NULL;
-    break;
-  case vmIntrinsics::_multiplyExactL:
-    if (!Matcher::match_rule_supported(Op_OverflowMulL) || !UseMathExactIntrinsics) return NULL;
-    break;
-
-  case vmIntrinsics::_getShortUnaligned:
-  case vmIntrinsics::_getCharUnaligned:
-  case vmIntrinsics::_getIntUnaligned:
-  case vmIntrinsics::_getLongUnaligned:
-  case vmIntrinsics::_putShortUnaligned:
-  case vmIntrinsics::_putCharUnaligned:
-  case vmIntrinsics::_putIntUnaligned:
-  case vmIntrinsics::_putLongUnaligned:
-    if (!UseUnalignedAccesses) return NULL;
-    break;
-
- default:
+  }
+
+  C2Compiler* compiler = (C2Compiler*)CompileBroker::compiler(CompLevel_full_optimization);
+  bool is_available = false;
+
+  {
+    // For calling is_intrinsic_supported and is_intrinsic_disabled_by_flag
+    // the compiler must transition to '_thread_in_vm' state because both
+    // methods access VM-internal data.
+    VM_ENTRY_MARK;
+    methodHandle mh(THREAD, m->get_Method());
+    methodHandle ct(THREAD, method()->get_Method());
+    is_available = compiler->is_intrinsic_supported(mh, is_virtual) &&
+                   !compiler->is_intrinsic_disabled_by_flag(mh, ct);
+  }
+
+  if (is_available) {
     assert(id <= vmIntrinsics::LAST_COMPILER_INLINE, "caller responsibility");
     assert(id != vmIntrinsics::_Object_init && id != vmIntrinsics::_invoke, "enum out of order?");
-    break;
-  }
-
-  // -XX:-InlineClassNatives disables natives from the Class class.
-  // The flag applies to all reflective calls, notably Array.newArray
-  // (visible to Java programmers as Array.newInstance).
-  if (m->holder()->name() == ciSymbol::java_lang_Class() ||
-      m->holder()->name() == ciSymbol::java_lang_reflect_Array()) {
-    if (!InlineClassNatives)  return NULL;
-  }
-
-  // -XX:-InlineThreadNatives disables natives from the Thread class.
-  if (m->holder()->name() == ciSymbol::java_lang_Thread()) {
-    if (!InlineThreadNatives)  return NULL;
-  }
-
-  // -XX:-InlineMathNatives disables natives from the Math,Float and Double classes.
-  if (m->holder()->name() == ciSymbol::java_lang_Math() ||
-      m->holder()->name() == ciSymbol::java_lang_Float() ||
-      m->holder()->name() == ciSymbol::java_lang_Double()) {
-    if (!InlineMathNatives)  return NULL;
-  }
-
-  // -XX:-InlineUnsafeOps disables natives from the Unsafe class.
-  if (m->holder()->name() == ciSymbol::sun_misc_Unsafe()) {
-    if (!InlineUnsafeOps)  return NULL;
-  }
-
-  return new LibraryIntrinsic(m, is_virtual, predicates, does_virtual_dispatch, (vmIntrinsics::ID) id);
+    return new LibraryIntrinsic(m, is_virtual,
+                                vmIntrinsics::predicates_needed(id),
+                                vmIntrinsics::does_virtual_dispatch(id),
+                                (vmIntrinsics::ID) id);
+  } else {
+    return NULL;
+  }
 }
 
 //----------------------register_library_intrinsics-----------------------
@@ -812,7 +523,6 @@
   case vmIntrinsics::_getLong:                  return inline_unsafe_access(!is_native_ptr, !is_store, T_LONG,    !is_volatile);
   case vmIntrinsics::_getFloat:                 return inline_unsafe_access(!is_native_ptr, !is_store, T_FLOAT,   !is_volatile);
   case vmIntrinsics::_getDouble:                return inline_unsafe_access(!is_native_ptr, !is_store, T_DOUBLE,  !is_volatile);
-
   case vmIntrinsics::_putObject:                return inline_unsafe_access(!is_native_ptr,  is_store, T_OBJECT,  !is_volatile);
   case vmIntrinsics::_putBoolean:               return inline_unsafe_access(!is_native_ptr,  is_store, T_BOOLEAN, !is_volatile);
   case vmIntrinsics::_putByte:                  return inline_unsafe_access(!is_native_ptr,  is_store, T_BYTE,    !is_volatile);
--- a/hotspot/src/share/vm/prims/jvmtiTagMap.cpp	Thu Apr 09 12:29:31 2015 +0200
+++ b/hotspot/src/share/vm/prims/jvmtiTagMap.cpp	Mon Aug 17 12:45:16 2015 +0300
@@ -2824,7 +2824,7 @@
   if (klass->oop_is_instance()) {
     InstanceKlass* ik = InstanceKlass::cast(klass);
 
-    // ignore the class if it's has been initialized yet
+    // Ignore the class if it hasn't been initialized yet
     if (!ik->is_linked()) {
       return true;
     }
--- a/hotspot/src/share/vm/prims/whitebox.cpp	Thu Apr 09 12:29:31 2015 +0200
+++ b/hotspot/src/share/vm/prims/whitebox.cpp	Mon Aug 17 12:45:16 2015 +0300
@@ -528,6 +528,24 @@
   return mh->queued_for_compilation();
 WB_END
 
+WB_ENTRY(jboolean, WB_IsIntrinsicAvailable(JNIEnv* env, jobject o, jobject method, jobject compilation_context, jint compLevel))
+  if (compLevel < CompLevel_none || compLevel > CompLevel_highest_tier) {
+    return false; // Intrinsic is not available on a non-existent compilation level.
+  }
+  jmethodID method_id, compilation_context_id;
+  method_id = reflected_method_to_jmid(thread, env, method);
+  CHECK_JNI_EXCEPTION_(env, JNI_FALSE);
+  methodHandle mh(THREAD, Method::checked_resolve_jmethod_id(method_id));
+  if (compilation_context != NULL) {
+    compilation_context_id = reflected_method_to_jmid(thread, env, compilation_context);
+    CHECK_JNI_EXCEPTION_(env, JNI_FALSE);
+    methodHandle cch(THREAD, Method::checked_resolve_jmethod_id(compilation_context_id));
+    return CompileBroker::compiler(compLevel)->is_intrinsic_available(mh, cch);
+  } else {
+    return CompileBroker::compiler(compLevel)->is_intrinsic_available(mh, NULL);
+  }
+WB_END
+
 WB_ENTRY(jint, WB_GetMethodCompilationLevel(JNIEnv* env, jobject o, jobject method, jboolean is_osr))
   jmethodID jmid = reflected_method_to_jmid(thread, env, method);
   CHECK_JNI_EXCEPTION_(env, CompLevel_none);
@@ -1477,14 +1495,17 @@
 #endif // INCLUDE_NMT
   {CC"deoptimizeFrames",   CC"(Z)I",                  (void*)&WB_DeoptimizeFrames  },
   {CC"deoptimizeAll",      CC"()V",                   (void*)&WB_DeoptimizeAll     },
-  {CC"deoptimizeMethod0",   CC"(Ljava/lang/reflect/Executable;Z)I",
-                                                      (void*)&WB_DeoptimizeMethod  },
+    {CC"deoptimizeMethod0",   CC"(Ljava/lang/reflect/Executable;Z)I",
+                                                        (void*)&WB_DeoptimizeMethod  },
   {CC"isMethodCompiled0",   CC"(Ljava/lang/reflect/Executable;Z)Z",
                                                       (void*)&WB_IsMethodCompiled  },
   {CC"isMethodCompilable0", CC"(Ljava/lang/reflect/Executable;IZ)Z",
                                                       (void*)&WB_IsMethodCompilable},
   {CC"isMethodQueuedForCompilation0",
       CC"(Ljava/lang/reflect/Executable;)Z",          (void*)&WB_IsMethodQueuedForCompilation},
+  {CC"isIntrinsicAvailable0",
+      CC"(Ljava/lang/reflect/Executable;Ljava/lang/reflect/Executable;I)Z",
+                                                      (void*)&WB_IsIntrinsicAvailable},
   {CC"makeMethodNotCompilable0",
       CC"(Ljava/lang/reflect/Executable;IZ)V",        (void*)&WB_MakeMethodNotCompilable},
   {CC"testSetDontInlineMethod0",
--- a/hotspot/src/share/vm/runtime/arguments.cpp	Thu Apr 09 12:29:31 2015 +0200
+++ b/hotspot/src/share/vm/runtime/arguments.cpp	Mon Aug 17 12:45:16 2015 +0300
@@ -788,9 +788,11 @@
   st->print_cr("VM Arguments:");
   if (num_jvm_flags() > 0) {
     st->print("jvm_flags: "); print_jvm_flags_on(st);
+    st->cr();
   }
   if (num_jvm_args() > 0) {
     st->print("jvm_args: "); print_jvm_args_on(st);
+    st->cr();
   }
   st->print_cr("java_command: %s", java_command() ? java_command() : "<unknown>");
   if (_java_class_path != NULL) {
@@ -800,12 +802,32 @@
   st->print_cr("Launcher Type: %s", _sun_java_launcher);
 }
 
+void Arguments::print_summary_on(outputStream* st) {
+  // Print the command line.  Environment variables that are helpful for
+  // reproducing the problem are written later in the hs_err file.
+  // flags are from setting file
+  if (num_jvm_flags() > 0) {
+    st->print_raw("Settings File: ");
+    print_jvm_flags_on(st);
+    st->cr();
+  }
+  // args are the command line and environment variable arguments.
+  st->print_raw("Command Line: ");
+  if (num_jvm_args() > 0) {
+    print_jvm_args_on(st);
+  }
+  // this is the classfile and any arguments to the java program
+  if (java_command() != NULL) {
+    st->print("%s", java_command());
+  }
+  st->cr();
+}
+
 void Arguments::print_jvm_flags_on(outputStream* st) {
   if (_num_jvm_flags > 0) {
     for (int i=0; i < _num_jvm_flags; i++) {
       st->print("%s ", _jvm_flags_array[i]);
     }
-    st->cr();
   }
 }
 
@@ -814,7 +836,6 @@
     for (int i=0; i < _num_jvm_args; i++) {
       st->print("%s ", _jvm_args_array[i]);
     }
-    st->cr();
   }
 }
 
@@ -1205,32 +1226,6 @@
   }
 }
 
-/**
- * Returns the minimum number of compiler threads needed to run the JVM. The following
- * configurations are possible.
- *
- * 1) The JVM is build using an interpreter only. As a result, the minimum number of
- *    compiler threads is 0.
- * 2) The JVM is build using the compiler(s) and tiered compilation is disabled. As
- *    a result, either C1 or C2 is used, so the minimum number of compiler threads is 1.
- * 3) The JVM is build using the compiler(s) and tiered compilation is enabled. However,
- *    the option "TieredStopAtLevel < CompLevel_full_optimization". As a result, only
- *    C1 can be used, so the minimum number of compiler threads is 1.
- * 4) The JVM is build using the compilers and tiered compilation is enabled. The option
- *    'TieredStopAtLevel = CompLevel_full_optimization' (the default value). As a result,
- *    the minimum number of compiler threads is 2.
- */
-int Arguments::get_min_number_of_compiler_threads() {
-#if !defined(COMPILER1) && !defined(COMPILER2) && !defined(SHARK)
-  return 0;   // case 1
-#else
-  if (!TieredCompilation || (TieredStopAtLevel < CompLevel_full_optimization)) {
-    return 1; // case 2 or case 3
-  }
-  return 2;   // case 4 (tiered)
-#endif
-}
-
 #if INCLUDE_ALL_GCS
 static void disable_adaptive_size_policy(const char* collector_name) {
   if (UseAdaptiveSizePolicy) {
@@ -2178,10 +2173,6 @@
     status = false;
   }
 
-  int min_number_of_compiler_threads = get_min_number_of_compiler_threads();
-  // The default CICompilerCount's value is CI_COMPILER_COUNT.
-  assert(min_number_of_compiler_threads <= CI_COMPILER_COUNT, "minimum should be less or equal default number");
-
   if (!FLAG_IS_DEFAULT(CICompilerCount) && !FLAG_IS_DEFAULT(CICompilerCountPerCPU) && CICompilerCountPerCPU) {
     warning("The VM option CICompilerCountPerCPU overrides CICompilerCount.");
   }
@@ -3989,10 +3980,10 @@
   return JNI_OK;
 }
 
-// Any custom code post the final range and constraint check
+// Any custom code post the 'CommandLineFlagConstraint::AfterErgo' constraint check
 // can be done here. We pass a flag that specifies whether
 // the check passed successfully
-void Arguments::post_final_range_and_constraint_check(bool check_passed) {
+void Arguments::post_after_ergo_constraint_check(bool check_passed) {
   // This does not set the flag itself, but stores the value in a safe place for later usage.
   _min_heap_free_ratio = MinHeapFreeRatio;
   _max_heap_free_ratio = MaxHeapFreeRatio;
--- a/hotspot/src/share/vm/runtime/arguments.hpp	Thu Apr 09 12:29:31 2015 +0200
+++ b/hotspot/src/share/vm/runtime/arguments.hpp	Mon Aug 17 12:45:16 2015 +0300
@@ -445,9 +445,6 @@
   static char*  SharedArchivePath;
 
  public:
-  // Tiered
-  static int  get_min_number_of_compiler_threads();
-
   // Scale compile thresholds
   // Returns threshold scaled with CompileThresholdScaling
   static intx scaled_compile_threshold(intx threshold, double scale);
@@ -466,8 +463,8 @@
   static jint apply_ergo();
   // Adjusts the arguments after the OS have adjusted the arguments
   static jint adjust_after_os();
-  // Set any arguments that need to be set after the final range and constraint check
-  static void post_final_range_and_constraint_check(bool check_passed);
+  // Set any arguments that need to be set after the 'CommandLineFlagConstraint::AfterErgo' constraint check
+  static void post_after_ergo_constraint_check(bool check_passed);
 
   static void set_gc_specific_flags();
   static inline bool gc_selected(); // whether a gc has been selected
@@ -495,6 +492,7 @@
 
   // print jvm_flags, jvm_args and java_command
   static void print_on(outputStream* st);
+  static void print_summary_on(outputStream* st);
 
   // convenient methods to obtain / print jvm_flags and jvm_args
   static const char* jvm_flags()           { return build_resource_string(_jvm_flags_array, _num_jvm_flags); }
--- a/hotspot/src/share/vm/runtime/commandLineFlagConstraintList.cpp	Thu Apr 09 12:29:31 2015 +0200
+++ b/hotspot/src/share/vm/runtime/commandLineFlagConstraintList.cpp	Mon Aug 17 12:45:16 2015 +0300
@@ -39,7 +39,9 @@
 
 public:
   // the "name" argument must be a string literal
-  CommandLineFlagConstraint_bool(const char* name, CommandLineFlagConstraintFunc_bool func) : CommandLineFlagConstraint(name) {
+  CommandLineFlagConstraint_bool(const char* name,
+                                 CommandLineFlagConstraintFunc_bool func,
+                                 ConstraintType type) : CommandLineFlagConstraint(name, type) {
     _constraint=func;
   }
 
@@ -53,7 +55,9 @@
 
 public:
   // the "name" argument must be a string literal
-  CommandLineFlagConstraint_int(const char* name, CommandLineFlagConstraintFunc_int func) : CommandLineFlagConstraint(name) {
+  CommandLineFlagConstraint_int(const char* name,
+                                CommandLineFlagConstraintFunc_int func,
+                                ConstraintType type) : CommandLineFlagConstraint(name, type) {
     _constraint=func;
   }
 
@@ -67,7 +71,9 @@
 
 public:
   // the "name" argument must be a string literal
-  CommandLineFlagConstraint_intx(const char* name, CommandLineFlagConstraintFunc_intx func) : CommandLineFlagConstraint(name) {
+  CommandLineFlagConstraint_intx(const char* name,
+                                 CommandLineFlagConstraintFunc_intx func,
+                                 ConstraintType type) : CommandLineFlagConstraint(name, type) {
     _constraint=func;
   }
 
@@ -81,7 +87,9 @@
 
 public:
   // the "name" argument must be a string literal
-  CommandLineFlagConstraint_uint(const char* name, CommandLineFlagConstraintFunc_uint func) : CommandLineFlagConstraint(name) {
+  CommandLineFlagConstraint_uint(const char* name,
+                                 CommandLineFlagConstraintFunc_uint func,
+                                 ConstraintType type) : CommandLineFlagConstraint(name, type) {
     _constraint=func;
   }
 
@@ -95,7 +103,9 @@
 
 public:
   // the "name" argument must be a string literal
-  CommandLineFlagConstraint_uintx(const char* name, CommandLineFlagConstraintFunc_uintx func) : CommandLineFlagConstraint(name) {
+  CommandLineFlagConstraint_uintx(const char* name,
+                                  CommandLineFlagConstraintFunc_uintx func,
+                                  ConstraintType type) : CommandLineFlagConstraint(name, type) {
     _constraint=func;
   }
 
@@ -109,7 +119,9 @@
 
 public:
   // the "name" argument must be a string literal
-  CommandLineFlagConstraint_uint64_t(const char* name, CommandLineFlagConstraintFunc_uint64_t func) : CommandLineFlagConstraint(name) {
+  CommandLineFlagConstraint_uint64_t(const char* name,
+                                     CommandLineFlagConstraintFunc_uint64_t func,
+                                     ConstraintType type) : CommandLineFlagConstraint(name, type) {
     _constraint=func;
   }
 
@@ -123,7 +135,9 @@
 
 public:
   // the "name" argument must be a string literal
-  CommandLineFlagConstraint_size_t(const char* name, CommandLineFlagConstraintFunc_size_t func) : CommandLineFlagConstraint(name) {
+  CommandLineFlagConstraint_size_t(const char* name,
+                                   CommandLineFlagConstraintFunc_size_t func,
+                                   ConstraintType type) : CommandLineFlagConstraint(name, type) {
     _constraint=func;
   }
 
@@ -137,7 +151,9 @@
 
 public:
   // the "name" argument must be a string literal
-  CommandLineFlagConstraint_double(const char* name, CommandLineFlagConstraintFunc_double func) : CommandLineFlagConstraint(name) {
+  CommandLineFlagConstraint_double(const char* name,
+                                   CommandLineFlagConstraintFunc_double func,
+                                   ConstraintType type) : CommandLineFlagConstraint(name, type) {
     _constraint=func;
   }
 
@@ -162,29 +178,29 @@
 void emit_constraint_double(const char* /*name*/)     { /* NOP */ }
 
 // CommandLineFlagConstraint emitting code functions if function argument is provided
-void emit_constraint_bool(const char* name, CommandLineFlagConstraintFunc_bool func) {
-  CommandLineFlagConstraintList::add(new CommandLineFlagConstraint_bool(name, func));
+void emit_constraint_bool(const char* name, CommandLineFlagConstraintFunc_bool func, CommandLineFlagConstraint::ConstraintType type) {
+  CommandLineFlagConstraintList::add(new CommandLineFlagConstraint_bool(name, func, type));
 }
-void emit_constraint_int(const char* name, CommandLineFlagConstraintFunc_int func) {
-  CommandLineFlagConstraintList::add(new CommandLineFlagConstraint_int(name, func));
+void emit_constraint_int(const char* name, CommandLineFlagConstraintFunc_int func, CommandLineFlagConstraint::ConstraintType type) {
+  CommandLineFlagConstraintList::add(new CommandLineFlagConstraint_int(name, func, type));
 }
-void emit_constraint_intx(const char* name, CommandLineFlagConstraintFunc_intx func) {
-  CommandLineFlagConstraintList::add(new CommandLineFlagConstraint_intx(name, func));
+void emit_constraint_intx(const char* name, CommandLineFlagConstraintFunc_intx func, CommandLineFlagConstraint::ConstraintType type) {
+  CommandLineFlagConstraintList::add(new CommandLineFlagConstraint_intx(name, func, type));
 }
-void emit_constraint_uint(const char* name, CommandLineFlagConstraintFunc_uint func) {
-  CommandLineFlagConstraintList::add(new CommandLineFlagConstraint_uint(name, func));
+void emit_constraint_uint(const char* name, CommandLineFlagConstraintFunc_uint func, CommandLineFlagConstraint::ConstraintType type) {
+  CommandLineFlagConstraintList::add(new CommandLineFlagConstraint_uint(name, func, type));
 }
-void emit_constraint_uintx(const char* name, CommandLineFlagConstraintFunc_uintx func) {
-  CommandLineFlagConstraintList::add(new CommandLineFlagConstraint_uintx(name, func));
+void emit_constraint_uintx(const char* name, CommandLineFlagConstraintFunc_uintx func, CommandLineFlagConstraint::ConstraintType type) {
+  CommandLineFlagConstraintList::add(new CommandLineFlagConstraint_uintx(name, func, type));
 }
-void emit_constraint_uint64_t(const char* name, CommandLineFlagConstraintFunc_uint64_t func) {
-  CommandLineFlagConstraintList::add(new CommandLineFlagConstraint_uint64_t(name, func));
+void emit_constraint_uint64_t(const char* name, CommandLineFlagConstraintFunc_uint64_t func, CommandLineFlagConstraint::ConstraintType type) {
+  CommandLineFlagConstraintList::add(new CommandLineFlagConstraint_uint64_t(name, func, type));
 }
-void emit_constraint_size_t(const char* name, CommandLineFlagConstraintFunc_size_t func) {
-  CommandLineFlagConstraintList::add(new CommandLineFlagConstraint_size_t(name, func));
+void emit_constraint_size_t(const char* name, CommandLineFlagConstraintFunc_size_t func, CommandLineFlagConstraint::ConstraintType type) {
+  CommandLineFlagConstraintList::add(new CommandLineFlagConstraint_size_t(name, func, type));
 }
-void emit_constraint_double(const char* name, CommandLineFlagConstraintFunc_double func) {
-  CommandLineFlagConstraintList::add(new CommandLineFlagConstraint_double(name, func));
+void emit_constraint_double(const char* name, CommandLineFlagConstraintFunc_double func, CommandLineFlagConstraint::ConstraintType type) {
+  CommandLineFlagConstraintList::add(new CommandLineFlagConstraint_double(name, func, type));
 }
 
 // Generate code to call emit_constraint_xxx function
@@ -201,16 +217,17 @@
 #define EMIT_CONSTRAINT_LP64_PRODUCT_FLAG(type, name, value, doc) ); emit_constraint_##type(#name
 
 // Generate func argument to pass into emit_constraint_xxx functions
-#define EMIT_CONSTRAINT_CHECK(func)                               , func
+#define EMIT_CONSTRAINT_CHECK(func, type)                               , func, CommandLineFlagConstraint::type
 
 // the "name" argument must be a string literal
-#define INITIAL_CONTRAINTS_SIZE 16
+#define INITIAL_CONSTRAINTS_SIZE 16
 GrowableArray<CommandLineFlagConstraint*>* CommandLineFlagConstraintList::_constraints = NULL;
+CommandLineFlagConstraint::ConstraintType CommandLineFlagConstraintList::_validating_type = CommandLineFlagConstraint::AtParse;
 
 // Check the ranges of all flags that have them or print them out and exit if requested
 void CommandLineFlagConstraintList::init(void) {
 
-  _constraints = new (ResourceObj::C_HEAP, mtInternal) GrowableArray<CommandLineFlagConstraint*>(INITIAL_CONTRAINTS_SIZE, true);
+  _constraints = new (ResourceObj::C_HEAP, mtInternal) GrowableArray<CommandLineFlagConstraint*>(INITIAL_CONSTRAINTS_SIZE, true);
 
   emit_constraint_no(NULL RUNTIME_FLAGS(EMIT_CONSTRAINT_DEVELOPER_FLAG,
                                         EMIT_CONSTRAINT_PD_DEVELOPER_FLAG,
@@ -273,14 +290,89 @@
 #endif // INCLUDE_ALL_GCS
 }
 
-CommandLineFlagConstraint* CommandLineFlagConstraintList::find(const char* name) {
+// Find constraints by name and return only if found constraint's type is equal or lower than current validating type.
+CommandLineFlagConstraint* CommandLineFlagConstraintList::find_if_needs_check(const char* name) {
   CommandLineFlagConstraint* found = NULL;
   for (int i=0; i<length(); i++) {
     CommandLineFlagConstraint* constraint = at(i);
-    if (strcmp(constraint->name(), name) == 0) {
+    if ((strcmp(constraint->name(), name) == 0) &&
+        (constraint->type() <= _validating_type)) {
       found = constraint;
       break;
     }
   }
   return found;
 }
+
+// Check constraints for specific constraint type.
+bool CommandLineFlagConstraintList::check_constraints(CommandLineFlagConstraint::ConstraintType type) {
+//#define PRINT_CONSTRAINTS_SIZES
+#ifdef PRINT_CONSTRAINTS_SIZES
+  {
+    size_t size_constraints = sizeof(CommandLineFlagConstraintList);
+    for (int i=0; i<length(); i++) {
+      size_constraints += sizeof(CommandLineFlagConstraint);
+      CommandLineFlagConstraint* constraint = at(i);
+      const char* name = constraint->name();
+      Flag* flag = Flag::find_flag(name, strlen(name), true, true);
+      if (flag->is_bool()) {
+        size_constraints += sizeof(CommandLineFlagConstraintFunc_bool);
+        size_constraints += sizeof(CommandLineFlagConstraint*);
+      } else if (flag->is_intx()) {
+        size_constraints += sizeof(CommandLineFlagConstraintFunc_intx);
+        size_constraints += sizeof(CommandLineFlagConstraint*);
+      } else if (flag->is_uintx()) {
+        size_constraints += sizeof(CommandLineFlagConstraintFunc_uintx);
+        size_constraints += sizeof(CommandLineFlagConstraint*);
+      } else if (flag->is_uint64_t()) {
+        size_constraints += sizeof(CommandLineFlagConstraintFunc_uint64_t);
+        size_constraints += sizeof(CommandLineFlagConstraint*);
+      } else if (flag->is_size_t()) {
+        size_constraints += sizeof(CommandLineFlagConstraintFunc_size_t);
+        size_constraints += sizeof(CommandLineFlagConstraint*);
+      } else if (flag->is_double()) {
+        size_constraints += sizeof(CommandLineFlagConstraintFunc_double);
+        size_constraints += sizeof(CommandLineFlagConstraint*);
+      }
+    }
+    fprintf(stderr, "Size of %d constraints: " SIZE_FORMAT " bytes\n",
+            length(), size_constraints);
+  }
+#endif // PRINT_CONSTRAINTS_SIZES
+
+  // Skip if we already checked.
+  if (type < _validating_type) {
+    return true;
+  }
+  _validating_type = type;
+
+  bool status = true;
+  for (int i=0; i<length(); i++) {
+    CommandLineFlagConstraint* constraint = at(i);
+    if (type != constraint->type()) continue;
+    const char*name = constraint->name();
+    Flag* flag = Flag::find_flag(name, strlen(name), true, true);
+    if (flag != NULL) {
+      if (flag->is_bool()) {
+        bool value = flag->get_bool();
+        if (constraint->apply_bool(&value, true) != Flag::SUCCESS) status = false;
+      } else if (flag->is_intx()) {
+        intx value = flag->get_intx();
+        if (constraint->apply_intx(&value, true) != Flag::SUCCESS) status = false;
+      } else if (flag->is_uintx()) {
+        uintx value = flag->get_uintx();
+        if (constraint->apply_uintx(&value, true) != Flag::SUCCESS) status = false;
+      } else if (flag->is_uint64_t()) {
+        uint64_t value = flag->get_uint64_t();
+        if (constraint->apply_uint64_t(&value, true) != Flag::SUCCESS) status = false;
+      } else if (flag->is_size_t()) {
+        size_t value = flag->get_size_t();
+        if (constraint->apply_size_t(&value, true) != Flag::SUCCESS) status = false;
+      } else if (flag->is_double()) {
+        double value = flag->get_double();
+        if (constraint->apply_double(&value, true) != Flag::SUCCESS) status = false;
+      }
+    }
+  }
+  return status;
+}
--- a/hotspot/src/share/vm/runtime/commandLineFlagConstraintList.hpp	Thu Apr 09 12:29:31 2015 +0200
+++ b/hotspot/src/share/vm/runtime/commandLineFlagConstraintList.hpp	Mon Aug 17 12:45:16 2015 +0300
@@ -49,13 +49,27 @@
 typedef Flag::Error (*CommandLineFlagConstraintFunc_double)(bool verbose, double* value);
 
 class CommandLineFlagConstraint : public CHeapObj<mtInternal> {
+public:
+  // During VM initialization, constraint validation will be done order of ConstraintType.
+  enum ConstraintType {
+    // Will be validated during argument processing (Arguments::parse_argument).
+    AtParse         = 0,
+    // Will be validated by CommandLineFlags::check_constraints_of_after_ergo().
+    AfterErgo      = 1,
+    // Will be validated by CommandLineFlags::check_constraints_of_after_memory_init().
+    AfterMemoryInit = 2
+  };
+
 private:
   const char* _name;
+  ConstraintType _validate_type;
+
 public:
   // the "name" argument must be a string literal
-  CommandLineFlagConstraint(const char* name) { _name=name; };
+  CommandLineFlagConstraint(const char* name, ConstraintType type) { _name=name; _validate_type=type; };
   ~CommandLineFlagConstraint() {};
-  const char* name() { return _name; }
+  const char* name() const { return _name; }
+  ConstraintType type() const { return _validate_type; }
   virtual Flag::Error apply_bool(bool* value, bool verbose = true) { ShouldNotReachHere(); return Flag::ERR_OTHER; };
   virtual Flag::Error apply_int(int* value, bool verbose = true) { ShouldNotReachHere(); return Flag::ERR_OTHER; };
   virtual Flag::Error apply_intx(intx* value, bool verbose = true) { ShouldNotReachHere(); return Flag::ERR_OTHER; };
@@ -69,12 +83,17 @@
 class CommandLineFlagConstraintList : public AllStatic {
 private:
   static GrowableArray<CommandLineFlagConstraint*>* _constraints;
+  // Latest constraint validation type.
+  static CommandLineFlagConstraint::ConstraintType _validating_type;
 public:
   static void init();
   static int length() { return (_constraints != NULL) ? _constraints->length() : 0; }
   static CommandLineFlagConstraint* at(int i) { return (_constraints != NULL) ? _constraints->at(i) : NULL; }
-  static CommandLineFlagConstraint* find(const char* name);
+  static CommandLineFlagConstraint* find_if_needs_check(const char* name);
   static void add(CommandLineFlagConstraint* constraint) { _constraints->append(constraint); }
+  // True if 'AfterErgo' or later constraint functions are validated.
+  static bool validated_after_ergo() { return _validating_type >= CommandLineFlagConstraint::AfterErgo; };
+  static bool check_constraints(CommandLineFlagConstraint::ConstraintType type);
 };
 
 #endif /* SHARE_VM_RUNTIME_COMMANDLINEFLAGCONSTRAINTLIST_HPP */
--- a/hotspot/src/share/vm/runtime/commandLineFlagConstraintsCompiler.cpp	Thu Apr 09 12:29:31 2015 +0200
+++ b/hotspot/src/share/vm/runtime/commandLineFlagConstraintsCompiler.cpp	Mon Aug 17 12:45:16 2015 +0300
@@ -29,16 +29,57 @@
 #include "utilities/defaultStream.hpp"
 
 Flag::Error AliasLevelConstraintFunc(bool verbose, intx* value) {
-  if (CommandLineFlags::finishedInitializing() == true) {
-    if ((*value <= 1) && (Arguments::mode() == Arguments::_comp)) {
-      if (verbose == true) {
-        jio_fprintf(defaultStream::error_stream(),
-                  "AliasLevel (" INTX_FORMAT ") is not compatible "
-                  "with -Xcomp \n",
-                  *value);
-      }
-      return Flag::VIOLATES_CONSTRAINT;
+  if ((*value <= 1) && (Arguments::mode() == Arguments::_comp)) {
+    if (verbose == true) {
+      jio_fprintf(defaultStream::error_stream(),
+                "AliasLevel (" INTX_FORMAT ") is not compatible "
+                "with -Xcomp \n",
+                *value);
     }
+    return Flag::VIOLATES_CONSTRAINT;
+  } else {
+    return Flag::SUCCESS;
   }
-  return Flag::SUCCESS;
 }
+
+/**
+ * Validate the minimum number of compiler threads needed to run the
+ * JVM. The following configurations are possible.
+ *
+ * 1) The JVM is build using an interpreter only. As a result, the minimum number of
+ *    compiler threads is 0.
+ * 2) The JVM is build using the compiler(s) and tiered compilation is disabled. As
+ *    a result, either C1 or C2 is used, so the minimum number of compiler threads is 1.
+ * 3) The JVM is build using the compiler(s) and tiered compilation is enabled. However,
+ *    the option "TieredStopAtLevel < CompLevel_full_optimization". As a result, only
+ *    C1 can be used, so the minimum number of compiler threads is 1.
+ * 4) The JVM is build using the compilers and tiered compilation is enabled. The option
+ *    'TieredStopAtLevel = CompLevel_full_optimization' (the default value). As a result,
+ *    the minimum number of compiler threads is 2.
+ */
+Flag::Error CICompilerCountConstraintFunc(bool verbose, intx* value) {
+  int min_number_of_compiler_threads = 0;
+#if !defined(COMPILER1) && !defined(COMPILER2) && !defined(SHARK)
+  // case 1
+#else
+  if (!TieredCompilation || (TieredStopAtLevel < CompLevel_full_optimization)) {
+    min_number_of_compiler_threads = 1; // case 2 or case 3
+  } else {
+    min_number_of_compiler_threads = 2;   // case 4 (tiered)
+  }
+#endif
+
+  // The default CICompilerCount's value is CI_COMPILER_COUNT.
+  assert(min_number_of_compiler_threads <= CI_COMPILER_COUNT, "minimum should be less or equal default number");
+
+  if (*value < (intx)min_number_of_compiler_threads) {
+    if (verbose == true) {
+      jio_fprintf(defaultStream::error_stream(),
+                  "CICompilerCount=" INTX_FORMAT " must be at least %d \n",
+                  *value, min_number_of_compiler_threads);
+    }
+    return Flag::VIOLATES_CONSTRAINT;
+  } else {
+    return Flag::SUCCESS;
+  }
+}
--- a/hotspot/src/share/vm/runtime/commandLineFlagConstraintsCompiler.hpp	Thu Apr 09 12:29:31 2015 +0200
+++ b/hotspot/src/share/vm/runtime/commandLineFlagConstraintsCompiler.hpp	Mon Aug 17 12:45:16 2015 +0300
@@ -36,4 +36,6 @@
 
 Flag::Error AliasLevelConstraintFunc(bool verbose, intx* value);
 
+Flag::Error CICompilerCountConstraintFunc(bool verbose, intx* value);
+
 #endif /* SHARE_VM_RUNTIME_COMMANDLINEFLAGCONSTRAINTSCOMPILER_HPP */
--- a/hotspot/src/share/vm/runtime/commandLineFlagConstraintsGC.cpp	Thu Apr 09 12:29:31 2015 +0200
+++ b/hotspot/src/share/vm/runtime/commandLineFlagConstraintsGC.cpp	Mon Aug 17 12:45:16 2015 +0300
@@ -30,6 +30,9 @@
 
 #if INCLUDE_ALL_GCS
 #include "gc/g1/g1_globals.hpp"
+#include "gc/g1/heapRegionBounds.inline.hpp"
+#include "gc/parallel/parallelScavengeHeap.hpp"
+#include "gc/shared/plab.hpp"
 #endif // INCLUDE_ALL_GCS
 #ifdef COMPILER1
 #include "c1/c1_globals.hpp"
@@ -38,8 +41,49 @@
 #include "opto/c2_globals.hpp"
 #endif // COMPILER2
 
+static Flag::Error MinPLABSizeBounds(const char* name, bool verbose, size_t* value) {
+#if INCLUDE_ALL_GCS
+  if ((UseConcMarkSweepGC || UseG1GC) && (*value < PLAB::min_size())) {
+    if (verbose == true) {
+      jio_fprintf(defaultStream::error_stream(),
+                  "%s (" SIZE_FORMAT ") must be greater than "
+                  "ergonomic PLAB minimum size (" SIZE_FORMAT ")\n",
+                  name, *value, PLAB::min_size());
+    }
+    return Flag::VIOLATES_CONSTRAINT;
+  }
+#endif // INCLUDE_ALL_GCS
+  return Flag::SUCCESS;
+}
+
+static Flag::Error MaxPLABSizeBounds(const char* name, bool verbose, size_t* value) {
+#if INCLUDE_ALL_GCS
+  if ((UseConcMarkSweepGC || UseG1GC) && (*value > PLAB::max_size())) {
+    if (verbose == true) {
+      jio_fprintf(defaultStream::error_stream(),
+                  "%s (" SIZE_FORMAT ") must be less than "
+                  "ergonomic PLAB maximum size (" SIZE_FORMAT ")\n",
+                  name, *value, PLAB::max_size());
+    }
+    return Flag::VIOLATES_CONSTRAINT;
+  }
+#endif // INCLUDE_ALL_GCS
+  return Flag::SUCCESS;
+}
+
+static Flag::Error MinMaxPLABSizeBounds(const char* name, bool verbose, size_t* value) {
+  if (MinPLABSizeBounds(name, verbose, value) == Flag::SUCCESS) {
+    return MaxPLABSizeBounds(name, verbose, value);
+  }
+  return Flag::VIOLATES_CONSTRAINT;
+}
+
+Flag::Error YoungPLABSizeConstraintFunc(bool verbose, size_t* value) {
+  return MinMaxPLABSizeBounds("YoungPLABSize", verbose, value);
+}
+
 Flag::Error MinHeapFreeRatioConstraintFunc(bool verbose, uintx* value) {
-  if ((CommandLineFlags::finishedInitializing()) && (*value > MaxHeapFreeRatio)) {
+  if (*value > MaxHeapFreeRatio) {
     if (verbose == true) {
       jio_fprintf(defaultStream::error_stream(),
                   "MinHeapFreeRatio (" UINTX_FORMAT ") must be less than or "
@@ -53,7 +97,7 @@
 }
 
 Flag::Error MaxHeapFreeRatioConstraintFunc(bool verbose, uintx* value) {
-  if ((CommandLineFlags::finishedInitializing()) && (*value < MinHeapFreeRatio)) {
+  if (*value < MinHeapFreeRatio) {
     if (verbose == true) {
       jio_fprintf(defaultStream::error_stream(),
                   "MaxHeapFreeRatio (" UINTX_FORMAT ") must be greater than or "
@@ -67,7 +111,7 @@
 }
 
 Flag::Error MinMetaspaceFreeRatioConstraintFunc(bool verbose, uintx* value) {
-  if ((CommandLineFlags::finishedInitializing()) && (*value > MaxMetaspaceFreeRatio)) {
+  if (*value > MaxMetaspaceFreeRatio) {
     if (verbose == true) {
       jio_fprintf(defaultStream::error_stream(),
                   "MinMetaspaceFreeRatio (" UINTX_FORMAT ") must be less than or "
@@ -81,7 +125,7 @@
 }
 
 Flag::Error MaxMetaspaceFreeRatioConstraintFunc(bool verbose, uintx* value) {
-  if ((CommandLineFlags::finishedInitializing()) && (*value < MinMetaspaceFreeRatio)) {
+  if (*value < MinMetaspaceFreeRatio) {
     if (verbose == true) {
       jio_fprintf(defaultStream::error_stream(),
                   "MaxMetaspaceFreeRatio (" UINTX_FORMAT ") must be greater than or "
@@ -106,7 +150,7 @@
 Flag::Error InitialTenuringThresholdConstraintFunc(bool verbose, uintx* value) {
   UseConcMarkSweepGCWorkaroundIfNeeded(*value, MaxTenuringThreshold);
 
-  if ((CommandLineFlags::finishedInitializing()) && (*value > MaxTenuringThreshold)) {
+  if (*value > MaxTenuringThreshold) {
     if (verbose == true) {
       jio_fprintf(defaultStream::error_stream(),
                   "InitialTenuringThreshold (" UINTX_FORMAT ") must be less than or "
@@ -122,7 +166,7 @@
 Flag::Error MaxTenuringThresholdConstraintFunc(bool verbose, uintx* value) {
   UseConcMarkSweepGCWorkaroundIfNeeded(InitialTenuringThreshold, *value);
 
-  if ((CommandLineFlags::finishedInitializing()) && (*value < InitialTenuringThreshold)) {
+  if (*value < InitialTenuringThreshold) {
     if (verbose == true) {
       jio_fprintf(defaultStream::error_stream(),
                   "MaxTenuringThreshold (" UINTX_FORMAT ") must be greater than or "
@@ -136,9 +180,8 @@
 }
 
 #if INCLUDE_ALL_GCS
-
 Flag::Error G1NewSizePercentConstraintFunc(bool verbose, uintx* value) {
-  if ((CommandLineFlags::finishedInitializing()) && (*value > G1MaxNewSizePercent)) {
+  if (*value > G1MaxNewSizePercent) {
     if (verbose == true) {
       jio_fprintf(defaultStream::error_stream(),
                   "G1NewSizePercent (" UINTX_FORMAT ") must be less than or "
@@ -152,7 +195,7 @@
 }
 
 Flag::Error G1MaxNewSizePercentConstraintFunc(bool verbose, uintx* value) {
-  if ((CommandLineFlags::finishedInitializing()) && (*value < G1NewSizePercent)) {
+  if (*value < G1NewSizePercent) {
     if (verbose == true) {
       jio_fprintf(defaultStream::error_stream(),
                   "G1MaxNewSizePercent (" UINTX_FORMAT ") must be greater than or "
@@ -168,7 +211,7 @@
 #endif // INCLUDE_ALL_GCS
 
 Flag::Error CMSOldPLABMinConstraintFunc(bool verbose, size_t* value) {
-  if ((CommandLineFlags::finishedInitializing()) && (*value > CMSOldPLABMax)) {
+  if (*value > CMSOldPLABMax) {
     if (verbose == true) {
       jio_fprintf(defaultStream::error_stream(),
                   "CMSOldPLABMin (" SIZE_FORMAT ") must be less than or "
@@ -182,7 +225,7 @@
 }
 
 Flag::Error CMSPrecleanDenominatorConstraintFunc(bool verbose, uintx* value) {
-  if ((CommandLineFlags::finishedInitializing()) && (*value <= CMSPrecleanNumerator)) {
+  if (*value <= CMSPrecleanNumerator) {
     if (verbose == true) {
       jio_fprintf(defaultStream::error_stream(),
                   "CMSPrecleanDenominator (" UINTX_FORMAT ") must be strickly greater than "
@@ -196,7 +239,7 @@
 }
 
 Flag::Error CMSPrecleanNumeratorConstraintFunc(bool verbose, uintx* value) {
-  if ((CommandLineFlags::finishedInitializing()) && (*value > (CMSPrecleanDenominator - 1))) {
+  if (*value > (CMSPrecleanDenominator - 1)) {
     if (verbose == true) {
       jio_fprintf(defaultStream::error_stream(),
                   "CMSPrecleanNumerator (" UINTX_FORMAT ") must be less than or "
@@ -210,25 +253,23 @@
 }
 
 Flag::Error SurvivorAlignmentInBytesConstraintFunc(bool verbose, intx* value) {
-  if (CommandLineFlags::finishedInitializing()) {
-    if (*value != 0) {
-      if (!is_power_of_2(*value)) {
-        if (verbose == true) {
-          jio_fprintf(defaultStream::error_stream(),
-                    "SurvivorAlignmentInBytes (" INTX_FORMAT ") must be power of 2\n",
-                    *value);
-        }
-        return Flag::VIOLATES_CONSTRAINT;
+  if (*value != 0) {
+    if (!is_power_of_2(*value)) {
+      if (verbose == true) {
+        jio_fprintf(defaultStream::error_stream(),
+                  "SurvivorAlignmentInBytes (" INTX_FORMAT ") must be power of 2\n",
+                  *value);
       }
-      if (*value < ObjectAlignmentInBytes) {
-        if (verbose == true) {
-          jio_fprintf(defaultStream::error_stream(),
-                    "SurvivorAlignmentInBytes (" INTX_FORMAT ") must be greater than or "
-                    "equal to ObjectAlignmentInBytes (" INTX_FORMAT ") \n",
-                    *value, ObjectAlignmentInBytes);
-        }
-        return Flag::VIOLATES_CONSTRAINT;
+      return Flag::VIOLATES_CONSTRAINT;
+    }
+    if (*value < ObjectAlignmentInBytes) {
+      if (verbose == true) {
+        jio_fprintf(defaultStream::error_stream(),
+                  "SurvivorAlignmentInBytes (" INTX_FORMAT ") must be greater than or "
+                  "equal to ObjectAlignmentInBytes (" INTX_FORMAT ")\n",
+                  *value, ObjectAlignmentInBytes);
       }
+      return Flag::VIOLATES_CONSTRAINT;
     }
   }
   return Flag::SUCCESS;
--- a/hotspot/src/share/vm/runtime/commandLineFlagConstraintsGC.hpp	Thu Apr 09 12:29:31 2015 +0200
+++ b/hotspot/src/share/vm/runtime/commandLineFlagConstraintsGC.hpp	Mon Aug 17 12:45:16 2015 +0300
@@ -34,6 +34,8 @@
  * an appropriate error value.
  */
 
+Flag::Error YoungPLABSizeConstraintFunc(bool verbose, size_t* value);
+
 Flag::Error MinHeapFreeRatioConstraintFunc(bool verbose, uintx* value);
 Flag::Error MaxHeapFreeRatioConstraintFunc(bool verbose, uintx* value);
 
--- a/hotspot/src/share/vm/runtime/commandLineFlagRangeList.cpp	Thu Apr 09 12:29:31 2015 +0200
+++ b/hotspot/src/share/vm/runtime/commandLineFlagRangeList.cpp	Mon Aug 17 12:45:16 2015 +0300
@@ -365,3 +365,63 @@
     st->print("[                           ...                           ]");
   }
 }
+
+bool CommandLineFlagRangeList::check_ranges() {
+//#define PRINT_RANGES_SIZES
+#ifdef PRINT_RANGES_SIZES
+  {
+    size_t size_ranges = sizeof(CommandLineFlagRangeList);
+    for (int i=0; i<length(); i++) {
+      size_ranges += sizeof(CommandLineFlagRange);
+      CommandLineFlagRange* range = at(i);
+      const char* name = range->name();
+      Flag* flag = Flag::find_flag(name, strlen(name), true, true);
+      if (flag->is_intx()) {
+        size_ranges += 2*sizeof(intx);
+        size_ranges += sizeof(CommandLineFlagRange*);
+      } else if (flag->is_uintx()) {
+        size_ranges += 2*sizeof(uintx);
+        size_ranges += sizeof(CommandLineFlagRange*);
+      } else if (flag->is_uint64_t()) {
+        size_ranges += 2*sizeof(uint64_t);
+        size_ranges += sizeof(CommandLineFlagRange*);
+      } else if (flag->is_size_t()) {
+        size_ranges += 2*sizeof(size_t);
+        size_ranges += sizeof(CommandLineFlagRange*);
+      } else if (flag->is_double()) {
+        size_ranges += 2*sizeof(double);
+        size_ranges += sizeof(CommandLineFlagRange*);
+      }
+    }
+    fprintf(stderr, "Size of %d ranges: " SIZE_FORMAT " bytes\n",
+            length(), size_ranges);
+  }
+#endif // PRINT_RANGES_SIZES
+
+  // Check ranges.
+  bool status = true;
+  for (int i=0; i<length(); i++) {
+    CommandLineFlagRange* range = at(i);
+    const char* name = range->name();
+    Flag* flag = Flag::find_flag(name, strlen(name), true, true);
+    if (flag != NULL) {
+      if (flag->is_intx()) {
+        intx value = flag->get_intx();
+        if (range->check_intx(value, true) != Flag::SUCCESS) status = false;
+      } else if (flag->is_uintx()) {
+        uintx value = flag->get_uintx();
+        if (range->check_uintx(value, true) != Flag::SUCCESS) status = false;
+      } else if (flag->is_uint64_t()) {
+        uint64_t value = flag->get_uint64_t();
+        if (range->check_uint64_t(value, true) != Flag::SUCCESS) status = false;
+      } else if (flag->is_size_t()) {
+        size_t value = flag->get_size_t();
+        if (range->check_size_t(value, true) != Flag::SUCCESS) status = false;
+      } else if (flag->is_double()) {
+        double value = flag->get_double();
+        if (range->check_double(value, true) != Flag::SUCCESS) status = false;
+      }
+    }
+  }
+  return status;
+}
--- a/hotspot/src/share/vm/runtime/commandLineFlagRangeList.hpp	Thu Apr 09 12:29:31 2015 +0200
+++ b/hotspot/src/share/vm/runtime/commandLineFlagRangeList.hpp	Mon Aug 17 12:45:16 2015 +0300
@@ -66,6 +66,8 @@
   static CommandLineFlagRange* find(const char* name);
   static void add(CommandLineFlagRange* range) { _ranges->append(range); }
   static void print(const char* name, outputStream* st, bool unspecified = false);
+  // Check the final values of all flags for ranges.
+  static bool check_ranges();
 };
 
 #endif // SHARE_VM_RUNTIME_COMMANDLINEFLAGRANGELIST_HPP
--- a/hotspot/src/share/vm/runtime/globals.cpp	Thu Apr 09 12:29:31 2015 +0200
+++ b/hotspot/src/share/vm/runtime/globals.cpp	Mon Aug 17 12:45:16 2015 +0300
@@ -770,7 +770,7 @@
 
 static Flag::Error apply_constraint_and_check_range_bool(const char* name, bool* new_value, bool verbose = true) {
   Flag::Error status = Flag::SUCCESS;
-  CommandLineFlagConstraint* constraint = CommandLineFlagConstraintList::find(name);
+  CommandLineFlagConstraint* constraint = CommandLineFlagConstraintList::find_if_needs_check(name);
   if (constraint != NULL) {
     status = constraint->apply_bool(new_value, verbose);
   }
@@ -789,7 +789,7 @@
   Flag* result = Flag::find_flag(name, len);
   if (result == NULL) return Flag::INVALID_FLAG;
   if (!result->is_bool()) return Flag::WRONG_FORMAT;
-  Flag::Error check = apply_constraint_and_check_range_bool(name, value, !CommandLineFlags::finishedInitializing());
+  Flag::Error check = apply_constraint_and_check_range_bool(name, value, !CommandLineFlagConstraintList::validated_after_ergo());
   if (check != Flag::SUCCESS) return check;
   bool old_value = result->get_bool();
   trace_flag_changed<EventBooleanFlagChanged, bool>(name, old_value, *value, origin);
@@ -817,7 +817,7 @@
     range_status = range->check_int(*new_value, verbose);
   }
   Flag::Error constraint_status = Flag::SUCCESS;
-  CommandLineFlagConstraint* constraint = CommandLineFlagConstraintList::find(name);
+  CommandLineFlagConstraint* constraint = CommandLineFlagConstraintList::find_if_needs_check(name);
   if (constraint != NULL) {
     constraint_status = constraint->apply_int(new_value, verbose);
   }
@@ -836,7 +836,7 @@
   Flag* result = Flag::find_flag(name, len);
   if (result == NULL) return Flag::INVALID_FLAG;
   if (!result->is_int()) return Flag::WRONG_FORMAT;
-  Flag::Error check = apply_constraint_and_check_range_int(name, value, !CommandLineFlags::finishedInitializing());
+  Flag::Error check = apply_constraint_and_check_range_int(name, value, !CommandLineFlagConstraintList::validated_after_ergo());
   if (check != Flag::SUCCESS) return check;
   int old_value = result->get_int();
   trace_flag_changed<EventIntFlagChanged, s4>(name, old_value, *value, origin);
@@ -862,7 +862,7 @@
     range_status = range->check_uint(*new_value, verbose);
   }
   Flag::Error constraint_status = Flag::SUCCESS;
-  CommandLineFlagConstraint* constraint = CommandLineFlagConstraintList::find(name);
+  CommandLineFlagConstraint* constraint = CommandLineFlagConstraintList::find_if_needs_check(name);
   if (constraint != NULL) {
     constraint_status = constraint->apply_uint(new_value, verbose);
   }
@@ -881,7 +881,7 @@
   Flag* result = Flag::find_flag(name, len);
   if (result == NULL) return Flag::INVALID_FLAG;
   if (!result->is_uint()) return Flag::WRONG_FORMAT;
-  Flag::Error check = apply_constraint_and_check_range_uint(name, value, !CommandLineFlags::finishedInitializing());
+  Flag::Error check = apply_constraint_and_check_range_uint(name, value, !CommandLineFlagConstraintList::validated_after_ergo());
   if (check != Flag::SUCCESS) return check;
   uint old_value = result->get_uint();
   trace_flag_changed<EventUnsignedIntFlagChanged, u4>(name, old_value, *value, origin);
@@ -915,7 +915,7 @@
     range_status = range->check_intx(*new_value, verbose);
   }
   Flag::Error constraint_status = Flag::SUCCESS;
-  CommandLineFlagConstraint* constraint = CommandLineFlagConstraintList::find(name);
+  CommandLineFlagConstraint* constraint = CommandLineFlagConstraintList::find_if_needs_check(name);
   if (constraint != NULL) {
     constraint_status = constraint->apply_intx(new_value, verbose);
   }
@@ -926,7 +926,7 @@
   Flag* result = Flag::find_flag(name, len);
   if (result == NULL) return Flag::INVALID_FLAG;
   if (!result->is_intx()) return Flag::WRONG_FORMAT;
-  Flag::Error check = apply_constraint_and_check_range_intx(name, value, !CommandLineFlags::finishedInitializing());
+  Flag::Error check = apply_constraint_and_check_range_intx(name, value, !CommandLineFlagConstraintList::validated_after_ergo());
   if (check != Flag::SUCCESS) return check;
   intx old_value = result->get_intx();
   trace_flag_changed<EventLongFlagChanged, intx>(name, old_value, *value, origin);
@@ -962,7 +962,7 @@
     range_status = range->check_uintx(*new_value, verbose);
   }
   Flag::Error constraint_status = Flag::SUCCESS;
-  CommandLineFlagConstraint* constraint = CommandLineFlagConstraintList::find(name);
+  CommandLineFlagConstraint* constraint = CommandLineFlagConstraintList::find_if_needs_check(name);
   if (constraint != NULL) {
     constraint_status = constraint->apply_uintx(new_value, verbose);
   }
@@ -973,7 +973,7 @@
   Flag* result = Flag::find_flag(name, len);
   if (result == NULL) return Flag::INVALID_FLAG;
   if (!result->is_uintx()) return Flag::WRONG_FORMAT;
-  Flag::Error check = apply_constraint_and_check_range_uintx(name, value, !CommandLineFlags::finishedInitializing());
+  Flag::Error check = apply_constraint_and_check_range_uintx(name, value, !CommandLineFlagConstraintList::validated_after_ergo());
   if (check != Flag::SUCCESS) return check;
   uintx old_value = result->get_uintx();
   trace_flag_changed<EventUnsignedLongFlagChanged, u8>(name, old_value, *value, origin);
@@ -1009,7 +1009,7 @@
     range_status = range->check_uint64_t(*new_value, verbose);
   }
   Flag::Error constraint_status = Flag::SUCCESS;
-  CommandLineFlagConstraint* constraint = CommandLineFlagConstraintList::find(name);
+  CommandLineFlagConstraint* constraint = CommandLineFlagConstraintList::find_if_needs_check(name);
   if (constraint != NULL) {
     constraint_status = constraint->apply_uint64_t(new_value, verbose);
   }
@@ -1020,7 +1020,7 @@
   Flag* result = Flag::find_flag(name, len);
   if (result == NULL) return Flag::INVALID_FLAG;
   if (!result->is_uint64_t()) return Flag::WRONG_FORMAT;
-  Flag::Error check = apply_constraint_and_check_range_uint64_t(name, value, !CommandLineFlags::finishedInitializing());
+  Flag::Error check = apply_constraint_and_check_range_uint64_t(name, value, !CommandLineFlagConstraintList::validated_after_ergo());
   if (check != Flag::SUCCESS) return check;
   uint64_t old_value = result->get_uint64_t();
   trace_flag_changed<EventUnsignedLongFlagChanged, u8>(name, old_value, *value, origin);
@@ -1056,7 +1056,7 @@
     range_status = range->check_size_t(*new_value, verbose);
   }
   Flag::Error constraint_status = Flag::SUCCESS;
-  CommandLineFlagConstraint* constraint = CommandLineFlagConstraintList::find(name);
+  CommandLineFlagConstraint* constraint = CommandLineFlagConstraintList::find_if_needs_check(name);
   if (constraint != NULL) {
     constraint_status = constraint->apply_size_t(new_value, verbose);
   }
@@ -1067,7 +1067,7 @@
   Flag* result = Flag::find_flag(name, len);
   if (result == NULL) return Flag::INVALID_FLAG;
   if (!result->is_size_t()) return Flag::WRONG_FORMAT;
-  Flag::Error check = apply_constraint_and_check_range_size_t(name, value, !CommandLineFlags::finishedInitializing());
+  Flag::Error check = apply_constraint_and_check_range_size_t(name, value, !CommandLineFlagConstraintList::validated_after_ergo());
   if (check != Flag::SUCCESS) return check;
   size_t old_value = result->get_size_t();
   trace_flag_changed<EventUnsignedLongFlagChanged, u8>(name, old_value, *value, origin);
@@ -1103,7 +1103,7 @@
     range_status = range->check_double(*new_value, verbose);
   }
   Flag::Error constraint_status = Flag::SUCCESS;
-  CommandLineFlagConstraint* constraint = CommandLineFlagConstraintList::find(name);
+  CommandLineFlagConstraint* constraint = CommandLineFlagConstraintList::find_if_needs_check(name);
   if (constraint != NULL) {
     constraint_status = constraint->apply_double(new_value, verbose);
   }
@@ -1114,7 +1114,7 @@
   Flag* result = Flag::find_flag(name, len);
   if (result == NULL) return Flag::INVALID_FLAG;
   if (!result->is_double()) return Flag::WRONG_FORMAT;
-  Flag::Error check = apply_constraint_and_check_range_double(name, value, !CommandLineFlags::finishedInitializing());
+  Flag::Error check = apply_constraint_and_check_range_double(name, value, !CommandLineFlagConstraintList::validated_after_ergo());
   if (check != Flag::SUCCESS) return check;
   double old_value = result->get_double();
   trace_flag_changed<EventDoubleFlagChanged, double>(name, old_value, *value, origin);
@@ -1127,7 +1127,7 @@
 Flag::Error CommandLineFlagsEx::doubleAtPut(CommandLineFlagWithType flag, double value, Flag::Flags origin) {
   Flag* faddr = address_of_flag(flag);
   guarantee(faddr != NULL && faddr->is_double(), "wrong flag type");
-  Flag::Error check = apply_constraint_and_check_range_double(faddr->_name, &value, !CommandLineFlags::finishedInitializing());
+  Flag::Error check = apply_constraint_and_check_range_double(faddr->_name, &value);
   if (check != Flag::SUCCESS) return check;
   trace_flag_changed<EventDoubleFlagChanged, double>(faddr->_name, faddr->get_double(), value, origin);
   faddr->set_double(value);
@@ -1210,129 +1210,6 @@
   FREE_C_HEAP_ARRAY(Flag*, array);
 }
 
-bool CommandLineFlags::_finished_initializing = false;
-
-bool CommandLineFlags::check_all_ranges_and_constraints() {
-
-//#define PRINT_RANGES_AND_CONSTRAINTS_SIZES
-#ifdef PRINT_RANGES_AND_CONSTRAINTS_SIZES
-  {
-    size_t size_ranges = sizeof(CommandLineFlagRangeList);
-    for (int i=0; i<CommandLineFlagRangeList::length(); i++) {
-      size_ranges += sizeof(CommandLineFlagRange);
-      CommandLineFlagRange* range = CommandLineFlagRangeList::at(i);
-      const char* name = range->name();
-      Flag* flag = Flag::find_flag(name, strlen(name), true, true);
-      if (flag->is_intx()) {
-        size_ranges += 2*sizeof(intx);
-        size_ranges += sizeof(CommandLineFlagRange*);
-      } else if (flag->is_uintx()) {
-        size_ranges += 2*sizeof(uintx);
-        size_ranges += sizeof(CommandLineFlagRange*);
-      } else if (flag->is_uint64_t()) {
-        size_ranges += 2*sizeof(uint64_t);
-        size_ranges += sizeof(CommandLineFlagRange*);
-      } else if (flag->is_size_t()) {
-        size_ranges += 2*sizeof(size_t);
-        size_ranges += sizeof(CommandLineFlagRange*);
-      } else if (flag->is_double()) {
-        size_ranges += 2*sizeof(double);
-        size_ranges += sizeof(CommandLineFlagRange*);
-      }
-    }
-    fprintf(stderr, "Size of %d ranges: " SIZE_FORMAT " bytes\n",
-            CommandLineFlagRangeList::length(), size_ranges);
-  }
-  {
-    size_t size_constraints = sizeof(CommandLineFlagConstraintList);
-    for (int i=0; i<CommandLineFlagConstraintList::length(); i++) {
-      size_constraints += sizeof(CommandLineFlagConstraint);
-      CommandLineFlagConstraint* constraint = CommandLineFlagConstraintList::at(i);
-      const char* name = constraint->name();
-      Flag* flag = Flag::find_flag(name, strlen(name), true, true);
-      if (flag->is_bool()) {
-        size_constraints += sizeof(CommandLineFlagConstraintFunc_bool);
-        size_constraints += sizeof(CommandLineFlagConstraint*);
-      } else if (flag->is_intx()) {
-        size_constraints += sizeof(CommandLineFlagConstraintFunc_intx);
-        size_constraints += sizeof(CommandLineFlagConstraint*);
-      } else if (flag->is_uintx()) {
-        size_constraints += sizeof(CommandLineFlagConstraintFunc_uintx);
-        size_constraints += sizeof(CommandLineFlagConstraint*);
-      } else if (flag->is_uint64_t()) {
-        size_constraints += sizeof(CommandLineFlagConstraintFunc_uint64_t);
-        size_constraints += sizeof(CommandLineFlagConstraint*);
-      } else if (flag->is_size_t()) {
-        size_constraints += sizeof(CommandLineFlagConstraintFunc_size_t);
-        size_constraints += sizeof(CommandLineFlagConstraint*);
-      } else if (flag->is_double()) {
-        size_constraints += sizeof(CommandLineFlagConstraintFunc_double);
-        size_constraints += sizeof(CommandLineFlagConstraint*);
-      }
-    }
-    fprintf(stderr, "Size of %d constraints: " SIZE_FORMAT " bytes\n",
-            CommandLineFlagConstraintList::length(), size_constraints);
-  }
-#endif // PRINT_RANGES_AND_CONSTRAINTS_SIZES
-
-  _finished_initializing = true;
-
-  bool status = true;
-  for (int i=0; i<CommandLineFlagRangeList::length(); i++) {
-    CommandLineFlagRange* range = CommandLineFlagRangeList::at(i);
-    const char* name = range->name();
-    Flag* flag = Flag::find_flag(name, strlen(name), true, true);
-    if (flag != NULL) {
-      if (flag->is_intx()) {
-        intx value = flag->get_intx();
-        if (range->check_intx(value, true) != Flag::SUCCESS) status = false;
-      } else if (flag->is_uintx()) {
-        uintx value = flag->get_uintx();
-        if (range->check_uintx(value, true) != Flag::SUCCESS) status = false;
-      } else if (flag->is_uint64_t()) {
-        uint64_t value = flag->get_uint64_t();
-        if (range->check_uint64_t(value, true) != Flag::SUCCESS) status = false;
-      } else if (flag->is_size_t()) {
-        size_t value = flag->get_size_t();
-        if (range->check_size_t(value, true) != Flag::SUCCESS) status = false;
-      } else if (flag->is_double()) {
-        double value = flag->get_double();
-        if (range->check_double(value, true) != Flag::SUCCESS) status = false;
-      }
-    }
-  }
-  for (int i=0; i<CommandLineFlagConstraintList::length(); i++) {
-    CommandLineFlagConstraint* constraint = CommandLineFlagConstraintList::at(i);
-    const char*name = constraint->name();
-    Flag* flag = Flag::find_flag(name, strlen(name), true, true);
-    if (flag != NULL) {
-      if (flag->is_bool()) {
-        bool value = flag->get_bool();
-        if (constraint->apply_bool(&value, true) != Flag::SUCCESS) status = false;
-      } else if (flag->is_intx()) {
-        intx value = flag->get_intx();
-        if (constraint->apply_intx(&value, true) != Flag::SUCCESS) status = false;
-      } else if (flag->is_uintx()) {
-        uintx value = flag->get_uintx();
-        if (constraint->apply_uintx(&value, true) != Flag::SUCCESS) status = false;
-      } else if (flag->is_uint64_t()) {
-        uint64_t value = flag->get_uint64_t();
-        if (constraint->apply_uint64_t(&value, true) != Flag::SUCCESS) status = false;
-      } else if (flag->is_size_t()) {
-        size_t value = flag->get_size_t();
-        if (constraint->apply_size_t(&value, true) != Flag::SUCCESS) status = false;
-      } else if (flag->is_double()) {
-        double value = flag->get_double();
-        if (constraint->apply_double(&value, true) != Flag::SUCCESS) status = false;
-      }
-    }
-  }
-
-  Arguments::post_final_range_and_constraint_check(status);
-
-  return status;
-}
-
 #ifndef PRODUCT
 
 void CommandLineFlags::verify() {
--- a/hotspot/src/share/vm/runtime/globals.hpp	Thu Apr 09 12:29:31 2015 +0200
+++ b/hotspot/src/share/vm/runtime/globals.hpp	Mon Aug 17 12:45:16 2015 +0300
@@ -450,7 +450,6 @@
 
 
 class CommandLineFlags {
-  static bool _finished_initializing;
 public:
   static Flag::Error boolAt(const char* name, size_t len, bool* value, bool allow_locked = false, bool return_flag = false);
   static Flag::Error boolAt(const char* name, bool* value, bool allow_locked = false, bool return_flag = false)      { return boolAt(name, strlen(name), value, allow_locked, return_flag); }
@@ -506,12 +505,6 @@
   // printRanges will print out flags type, name and range values as expected by -XX:+PrintFlagsRanges
   static void printFlags(outputStream* out, bool withComments, bool printRanges = false);
 
-  // Returns true if all flags have their final values set (ready for ranges and constraint check)
-  static bool finishedInitializing() { return _finished_initializing; }
-
-  // Check the final values of all flags for ranges and constraints
-  static bool check_all_ranges_and_constraints();
-
   static void verify() PRODUCT_RETURN;
 };
 
@@ -640,7 +633,7 @@
   lp64_product(intx, ObjectAlignmentInBytes, 8,                             \
           "Default object alignment in bytes, 8 is minimum")                \
           range(8, 256)                                                     \
-          constraint(ObjectAlignmentInBytesConstraintFunc)                  \
+          constraint(ObjectAlignmentInBytesConstraintFunc,AtParse)          \
                                                                             \
   product(bool, AssumeMP, false,                                            \
           "Instruct the VM to assume multiple processors are available")    \
@@ -1286,7 +1279,7 @@
                                                                             \
   experimental(intx, SyncVerbose, 0, "(Unstable)")                          \
                                                                             \
-  product(bool, InlineNotify, true, "intrinsify subset of notify" )         \
+  diagnostic(bool, InlineNotify, true, "intrinsify subset of notify")       \
                                                                             \
   experimental(intx, ClearFPUAtPark, 0, "(Unsafe, Unstable)")               \
                                                                             \
@@ -1396,7 +1389,7 @@
   product(intx, ContendedPaddingWidth, 128,                                 \
           "How many bytes to pad the fields/classes marked @Contended with")\
           range(0, 8192)                                                    \
-          constraint(ContendedPaddingWidthConstraintFunc)                   \
+          constraint(ContendedPaddingWidthConstraintFunc,AtParse)           \
                                                                             \
   product(bool, EnableContended, true,                                      \
           "Enable @Contended annotation support")                           \
@@ -1597,6 +1590,7 @@
                                                                             \
   product(size_t, YoungPLABSize, 4096,                                      \
           "Size of young gen promotion LAB's (in HeapWords)")               \
+          constraint(YoungPLABSizeConstraintFunc,AfterMemoryInit)           \
                                                                             \
   product(size_t, OldPLABSize, 1024,                                        \
           "Size of old gen promotion LAB's (in HeapWords), or Number        \
@@ -1735,7 +1729,7 @@
           "Minimum size of CMS gen promotion LAB caches per worker "        \
           "per block size")                                                 \
           range(1, max_uintx)                                               \
-          constraint(CMSOldPLABMinConstraintFunc)                           \
+          constraint(CMSOldPLABMinConstraintFunc,AfterErgo)                 \
                                                                             \
   product(uintx, CMSOldPLABNumRefills, 4,                                   \
           "Nominal number of refills of CMS gen promotion LAB cache "       \
@@ -1931,13 +1925,13 @@
           "CMSPrecleanNumerator:CMSPrecleanDenominator yields convergence " \
           "ratio")                                                          \
           range(1, max_uintx)                                               \
-          constraint(CMSPrecleanDenominatorConstraintFunc)                  \
+          constraint(CMSPrecleanDenominatorConstraintFunc,AfterErgo)        \
                                                                             \
   product(uintx, CMSPrecleanNumerator, 2,                                   \
           "CMSPrecleanNumerator:CMSPrecleanDenominator yields convergence " \
           "ratio")                                                          \
           range(0, max_uintx-1)                                             \
-          constraint(CMSPrecleanNumeratorConstraintFunc)                    \
+          constraint(CMSPrecleanNumeratorConstraintFunc,AfterErgo)          \
                                                                             \
   product(bool, CMSPrecleanRefLists1, true,                                 \
           "Preclean ref lists during (initial) preclean phase")             \
@@ -2649,8 +2643,8 @@
   /* because of overflow issue                                   */         \
   product(intx, CICompilerCount, CI_COMPILER_COUNT,                         \
           "Number of compiler threads to run")                              \
-          range((intx)Arguments::get_min_number_of_compiler_threads(),      \
-                max_jint)                                                   \
+          range(0, max_jint)                                                \
+          constraint(CICompilerCountConstraintFunc, AtParse)                \
                                                                             \
   product(intx, CompilationPolicyChoice, 0,                                 \
           "which compilation policy (0-3)")                                 \
@@ -3361,14 +3355,14 @@
           " For most GCs this applies to the old generation. In G1 and"     \
           " ParallelGC it applies to the whole heap.")                      \
           range(0, 100)                                                     \
-          constraint(MinHeapFreeRatioConstraintFunc)                        \
+          constraint(MinHeapFreeRatioConstraintFunc,AfterErgo)              \
                                                                             \
   manageable(uintx, MaxHeapFreeRatio, 70,                                   \
           "The maximum percentage of heap free after GC to avoid shrinking."\
           " For most GCs this applies to the old generation. In G1 and"     \
           " ParallelGC it applies to the whole heap.")                      \
           range(0, 100)                                                     \
-          constraint(MaxHeapFreeRatioConstraintFunc)                        \
+          constraint(MaxHeapFreeRatioConstraintFunc,AfterErgo)              \
                                                                             \
   product(intx, SoftRefLRUPolicyMSPerMB, 1000,                              \
           "Number of milliseconds per MB of free space in the heap")        \
@@ -3383,13 +3377,13 @@
           "The maximum percentage of Metaspace free after GC to avoid "     \
           "shrinking")                                                      \
           range(0, 100)                                                     \
-          constraint(MaxMetaspaceFreeRatioConstraintFunc)                   \
+          constraint(MaxMetaspaceFreeRatioConstraintFunc,AfterErgo)         \
                                                                             \
   product(uintx, MinMetaspaceFreeRatio,    40,                              \
           "The minimum percentage of Metaspace free after GC to avoid "     \
           "expansion")                                                      \
           range(0, 99)                                                      \
-          constraint(MinMetaspaceFreeRatioConstraintFunc)                   \
+          constraint(MinMetaspaceFreeRatioConstraintFunc,AfterErgo)         \
                                                                             \
   product(size_t, MaxMetaspaceExpansion, ScaleForWordSize(4*M),             \
           "The maximum expansion of Metaspace without full GC (in bytes)")  \
@@ -3407,12 +3401,12 @@
   product(uintx, MaxTenuringThreshold,    15,                               \
           "Maximum value for tenuring threshold")                           \
           range(0, markOopDesc::max_age + 1)                                \
-          constraint(MaxTenuringThresholdConstraintFunc)                    \
+          constraint(MaxTenuringThresholdConstraintFunc,AfterErgo)          \
                                                                             \
   product(uintx, InitialTenuringThreshold,    7,                            \
           "Initial value for tenuring threshold")                           \
           range(0, markOopDesc::max_age + 1)                                \
-          constraint(InitialTenuringThresholdConstraintFunc)                \
+          constraint(InitialTenuringThresholdConstraintFunc,AfterErgo)      \
                                                                             \
   product(uintx, TargetSurvivorRatio,    50,                                \
           "Desired percentage of survivor space used after scavenge")       \
@@ -4090,7 +4084,7 @@
                                                                             \
   experimental(intx, SurvivorAlignmentInBytes, 0,                           \
            "Default survivor space alignment in bytes")                     \
-           constraint(SurvivorAlignmentInBytesConstraintFunc)               \
+           constraint(SurvivorAlignmentInBytesConstraintFunc,AfterErgo)     \
                                                                             \
   product(bool , AllowNonVirtualCalls, false,                               \
           "Obey the ACC_SUPER flag and allow invokenonvirtual calls")       \
@@ -4194,7 +4188,7 @@
 // Only materialize src code for range checking when required, ignore otherwise
 #define IGNORE_RANGE(a, b)
 // Only materialize src code for contraint checking when required, ignore otherwise
-#define IGNORE_CONSTRAINT(func)
+#define IGNORE_CONSTRAINT(func,type)
 
 RUNTIME_FLAGS(DECLARE_DEVELOPER_FLAG, \
               DECLARE_PD_DEVELOPER_FLAG, \
--- a/hotspot/src/share/vm/runtime/mutexLocker.cpp	Thu Apr 09 12:29:31 2015 +0200
+++ b/hotspot/src/share/vm/runtime/mutexLocker.cpp	Mon Aug 17 12:45:16 2015 +0300
@@ -83,7 +83,6 @@
 Monitor* DirtyCardQ_CBL_mon           = NULL;
 Mutex*   Shared_DirtyCardQ_lock       = NULL;
 Mutex*   ParGCRareEvent_lock          = NULL;
-Mutex*   EvacFailureStack_lock        = NULL;
 Mutex*   DerivedPointerTableGC_lock   = NULL;
 Mutex*   Compile_lock                 = NULL;
 Monitor* MethodCompileQueue_lock      = NULL;
@@ -201,7 +200,6 @@
     def(OldSets_lock               , Mutex  , leaf     ,   true,  Monitor::_safepoint_check_never);
     def(RootRegionScan_lock        , Monitor, leaf     ,   true,  Monitor::_safepoint_check_never);
     def(MMUTracker_lock            , Mutex  , leaf     ,   true,  Monitor::_safepoint_check_never);
-    def(EvacFailureStack_lock      , Mutex  , nonleaf  ,   true,  Monitor::_safepoint_check_never);
 
     def(StringDedupQueue_lock      , Monitor, leaf,        true,  Monitor::_safepoint_check_never);
     def(StringDedupTable_lock      , Mutex  , leaf,        true,  Monitor::_safepoint_check_never);
--- a/hotspot/src/share/vm/runtime/mutexLocker.hpp	Thu Apr 09 12:29:31 2015 +0200
+++ b/hotspot/src/share/vm/runtime/mutexLocker.hpp	Mon Aug 17 12:45:16 2015 +0300
@@ -87,7 +87,6 @@
                                                  // non-Java threads.
                                                  // (see option ExplicitGCInvokesConcurrent)
 extern Mutex*   ParGCRareEvent_lock;             // Synchronizes various (rare) parallel GC ops.
-extern Mutex*   EvacFailureStack_lock;           // guards the evac failure scan stack
 extern Mutex*   Compile_lock;                    // a lock held when Compilation is updating code (used to block CodeCache traversal, CHA updates, etc)
 extern Monitor* MethodCompileQueue_lock;         // a lock held when method compilations are enqueued, dequeued
 extern Monitor* CompileThread_lock;              // a lock held by compile threads during compilation system initialization
--- a/hotspot/src/share/vm/runtime/os.cpp	Thu Apr 09 12:29:31 2015 +0200
+++ b/hotspot/src/share/vm/runtime/os.cpp	Mon Aug 17 12:45:16 2015 +0300
@@ -843,6 +843,28 @@
   pd_print_cpu_info(st, buf, buflen);
 }
 
+// Print a one line string summarizing the cpu, number of cores, memory, and operating system version
+void os::print_summary_info(outputStream* st, char* buf, size_t buflen) {
+  st->print("Host: ");
+#ifndef PRODUCT
+  if (get_host_name(buf, buflen)) {
+    st->print("%s, ", buf);
+  }
+#endif // PRODUCT
+  get_summary_cpu_info(buf, buflen);
+  st->print("%s, ", buf);
+  size_t mem = physical_memory()/G;
+  if (mem == 0) {  // for low memory systems
+    mem = physical_memory()/M;
+    st->print("%d cores, %dM, ", processor_count(), mem);
+  } else {
+    st->print("%d cores, %dG, ", processor_count(), mem);
+  }
+  get_summary_os_info(buf, buflen);
+  st->print_raw(buf);
+  st->cr();
+}
+
 void os::print_date_and_time(outputStream *st, char* buf, size_t buflen) {
   const int secs_per_day  = 86400;
   const int secs_per_hour = 3600;
@@ -850,12 +872,19 @@
 
   time_t tloc;
   (void)time(&tloc);
-  st->print("time: %s", ctime(&tloc));  // ctime adds newline.
+  char* timestring = ctime(&tloc);  // ctime adds newline.
+  // edit out the newline
+  char* nl = strchr(timestring, '\n');
+  if (nl != NULL) {
+    *nl = '\0';
+  }
 
   struct tm tz;
   if (localtime_pd(&tloc, &tz) != NULL) {
     ::strftime(buf, buflen, "%Z", &tz);
-    st->print_cr("timezone: %s", buf);
+    st->print("Time: %s %s", timestring, buf);
+  } else {
+    st->print("Time: %s", timestring);
   }
 
   double t = os::elapsedTime();
@@ -872,7 +901,7 @@
   int elmins = (eltime - day_secs - hour_secs) / secs_per_min;
   int minute_secs = elmins * secs_per_min;
   int elsecs = (eltime - day_secs - hour_secs - minute_secs);
-  st->print_cr("elapsed time: %d seconds (%dd %dh %dm %ds)", eltime, eldays, elhours, elmins, elsecs);
+  st->print_cr(" elapsed time: %d seconds (%dd %dh %dm %ds)", eltime, eldays, elhours, elmins, elsecs);
 }
 
 // moved from debug.cpp (used to be find()) but still called from there
--- a/hotspot/src/share/vm/runtime/os.hpp	Thu Apr 09 12:29:31 2015 +0200
+++ b/hotspot/src/share/vm/runtime/os.hpp	Mon Aug 17 12:45:16 2015 +0300
@@ -150,6 +150,11 @@
 
   static size_t page_size_for_region(size_t region_size, size_t min_pages, bool must_be_aligned);
 
+  // Get summary strings for system information in buffer provided
+  static bool  get_host_name(char* buf, size_t buflen) PRODUCT_RETURN_(return false;);  // true if available
+  static void  get_summary_cpu_info(char* buf, size_t buflen);
+  static void  get_summary_os_info(char* buf, size_t buflen);
+
  public:
   static void init(void);                      // Called before command line parsing
   static void init_before_ergo(void);          // Called after command line parsing
@@ -590,6 +595,7 @@
   static void print_os_info_brief(outputStream* st);
   static void print_cpu_info(outputStream* st, char* buf, size_t buflen);
   static void pd_print_cpu_info(outputStream* st, char* buf, size_t buflen);
+  static void print_summary_info(outputStream* st, char* buf, size_t buflen);
   static void print_memory_info(outputStream* st);
   static void print_dll_info(outputStream* st);
   static void print_environment_variables(outputStream* st, const char** env_list);
--- a/hotspot/src/share/vm/runtime/thread.cpp	Thu Apr 09 12:29:31 2015 +0200
+++ b/hotspot/src/share/vm/runtime/thread.cpp	Mon Aug 17 12:45:16 2015 +0300
@@ -52,6 +52,8 @@
 #include "runtime/arguments.hpp"
 #include "runtime/atomic.inline.hpp"
 #include "runtime/biasedLocking.hpp"
+#include "runtime/commandLineFlagConstraintList.hpp"
+#include "runtime/commandLineFlagRangeList.hpp"
 #include "runtime/deoptimization.hpp"
 #include "runtime/fprofiler.hpp"
 #include "runtime/frame.inline.hpp"
@@ -2739,6 +2741,9 @@
     if (ct->env() != NULL) {
       ct->env()->metadata_do(f);
     }
+    if (ct->task() != NULL) {
+      ct->task()->metadata_do(f);
+    }
   }
 }
 
@@ -3319,8 +3324,15 @@
   jint ergo_result = Arguments::apply_ergo();
   if (ergo_result != JNI_OK) return ergo_result;
 
-  // Final check of all arguments after ergonomics which may change values.
-  if (!CommandLineFlags::check_all_ranges_and_constraints()) {
+  // Final check of all ranges after ergonomics which may change values.
+  if (!CommandLineFlagRangeList::check_ranges()) {
+    return JNI_EINVAL;
+  }
+
+  // Final check of all 'AfterErgo' constraints after ergonomics which may change values.
+  bool constraint_result = CommandLineFlagConstraintList::check_constraints(CommandLineFlagConstraint::AfterErgo);
+  Arguments::post_after_ergo_constraint_check(constraint_result);
+  if (!constraint_result) {
     return JNI_EINVAL;
   }
 
--- a/hotspot/src/share/vm/runtime/vframe.cpp	Thu Apr 09 12:29:31 2015 +0200
+++ b/hotspot/src/share/vm/runtime/vframe.cpp	Mon Aug 17 12:45:16 2015 +0300
@@ -148,8 +148,7 @@
   if (obj.not_null()) {
     st->print("\t- %s <" INTPTR_FORMAT "> ", lock_state, (address)obj());
     if (obj->klass() == SystemDictionary::Class_klass()) {
-      Klass* target_klass = java_lang_Class::as_Klass(obj());
-      st->print_cr("(a java.lang.Class for %s)", InstanceKlass::cast(target_klass)->external_name());
+      st->print_cr("(a java.lang.Class for %s)", java_lang_Class::as_external_name(obj()));
     } else {
       Klass* k = obj->klass();
       st->print_cr("(a %s)", k->external_name());
--- a/hotspot/src/share/vm/services/heapDumper.cpp	Thu Apr 09 12:29:31 2015 +0200
+++ b/hotspot/src/share/vm/services/heapDumper.cpp	Mon Aug 17 12:45:16 2015 +0300
@@ -899,6 +899,11 @@
   assert(klass->oop_is_instance(), "not an InstanceKlass");
   InstanceKlass* ik = (InstanceKlass*)klass;
 
+  // Ignore the class if it hasn't been initialized yet
+  if (!ik->is_linked()) {
+    return;
+  }
+
   writer->write_u1(HPROF_GC_CLASS_DUMP);
 
   // class ID
--- a/hotspot/src/share/vm/shark/sharkBuilder.cpp	Thu Apr 09 12:29:31 2015 +0200
+++ b/hotspot/src/share/vm/shark/sharkBuilder.cpp	Mon Aug 17 12:45:16 2015 +0300
@@ -25,6 +25,8 @@
 
 #include "precompiled.hpp"
 #include "ci/ciMethod.hpp"
+#include "gc/shared/barrierSet.hpp"
+#include "gc/shared/cardTableModRefBS.hpp"
 #include "memory/resourceArea.hpp"
 #include "oops/method.hpp"
 #include "runtime/os.hpp"
@@ -442,7 +444,7 @@
     Unimplemented();
 
   CreateStore(
-    LLVMValue::jbyte_constant(CardTableModRefBS::dirty_card),
+    LLVMValue::jbyte_constant(CardTableModRefBS::dirty_card_val()),
     CreateIntToPtr(
       CreateAdd(
         LLVMValue::intptr_constant(
--- a/hotspot/src/share/vm/shark/sharkBuilder.hpp	Thu Apr 09 12:29:31 2015 +0200
+++ b/hotspot/src/share/vm/shark/sharkBuilder.hpp	Mon Aug 17 12:45:16 2015 +0300
@@ -27,8 +27,6 @@
 #define SHARE_VM_SHARK_SHARKBUILDER_HPP
 
 #include "ci/ciType.hpp"
-#include "gc/shared/barrierSet.hpp"
-#include "gc/shared/cardTableModRefBS.hpp"
 #include "shark/llvmHeaders.hpp"
 #include "shark/llvmValue.hpp"
 #include "shark/sharkCodeBuffer.hpp"
@@ -38,6 +36,8 @@
 #include "utilities/debug.hpp"
 #include "utilities/sizes.hpp"
 
+class BarrierSet;
+
 class SharkBuilder : public llvm::IRBuilder<> {
   friend class SharkCompileInvariants;
 
--- a/hotspot/src/share/vm/utilities/vmError.cpp	Thu Apr 09 12:29:31 2015 +0200
+++ b/hotspot/src/share/vm/utilities/vmError.cpp	Mon Aug 17 12:45:16 2015 +0300
@@ -306,6 +306,30 @@
 #endif // ZERO
 }
 
+void VMError::print_oom_reasons(outputStream* st) {
+  st->print_cr("# Possible reasons:");
+  st->print_cr("#   The system is out of physical RAM or swap space");
+  st->print_cr("#   In 32 bit mode, the process size limit was hit");
+  st->print_cr("# Possible solutions:");
+  st->print_cr("#   Reduce memory load on the system");
+  st->print_cr("#   Increase physical memory or swap space");
+  st->print_cr("#   Check if swap backing store is full");
+  st->print_cr("#   Use 64 bit Java on a 64 bit OS");
+  st->print_cr("#   Decrease Java heap size (-Xmx/-Xms)");
+  st->print_cr("#   Decrease number of Java threads");
+  st->print_cr("#   Decrease Java thread stack sizes (-Xss)");
+  st->print_cr("#   Set larger code cache with -XX:ReservedCodeCacheSize=");
+  st->print_cr("# This output file may be truncated or incomplete.");
+}
+
+const char* VMError::gc_mode() {
+  if (UseG1GC)            return "g1 gc";
+  if (UseParallelGC)      return "parallel gc";
+  if (UseConcMarkSweepGC) return "concurrent mark sweep gc";
+  if (UseSerialGC)        return "serial gc";
+  return "ERROR in GC mode";
+}
+
 // This is the main function to report a fatal error. Only one thread can
 // call this function, so we don't need to worry about MT-safety. But it's
 // possible that the error handler itself may crash or die on an internal
@@ -358,21 +382,21 @@
 
   // test secondary error handling. Test it twice, to test that resetting
   // error handler after a secondary crash works.
-  STEP(11, "(test secondary crash 1)")
+  STEP(20, "(test secondary crash 1)")
     if (_verbose && TestCrashInErrorHandler != 0) {
       st->print_cr("Will crash now (TestCrashInErrorHandler=%d)...",
         TestCrashInErrorHandler);
       controlled_crash(TestCrashInErrorHandler);
     }
 
-  STEP(12, "(test secondary crash 2)")
+  STEP(30, "(test secondary crash 2)")
     if (_verbose && TestCrashInErrorHandler != 0) {
       st->print_cr("Will crash now (TestCrashInErrorHandler=%d)...",
         TestCrashInErrorHandler);
       controlled_crash(TestCrashInErrorHandler);
     }
 
-  STEP(13, "(test safefetch in error handler)")
+  STEP(40, "(test safefetch in error handler)")
     // test whether it is safe to use SafeFetch32 in Crash Handler. Test twice
     // to test that resetting the signal handler works correctly.
     if (_verbose && TestSafeFetchInErrorHandler) {
@@ -393,7 +417,7 @@
     }
 #endif // PRODUCT
 
-  STEP(15, "(printing type of error)")
+  STEP(50, "(printing type of error)")
 
      switch(_id) {
        case OOM_MALLOC_ERROR:
@@ -418,19 +442,7 @@
          }
          // In error file give some solutions
          if (_verbose) {
-           st->print_cr("# Possible reasons:");
-           st->print_cr("#   The system is out of physical RAM or swap space");
-           st->print_cr("#   In 32 bit mode, the process size limit was hit");
-           st->print_cr("# Possible solutions:");
-           st->print_cr("#   Reduce memory load on the system");
-           st->print_cr("#   Increase physical memory or swap space");
-           st->print_cr("#   Check if swap backing store is full");
-           st->print_cr("#   Use 64 bit Java on a 64 bit OS");
-           st->print_cr("#   Decrease Java heap size (-Xmx/-Xms)");
-           st->print_cr("#   Decrease number of Java threads");
-           st->print_cr("#   Decrease Java thread stack sizes (-Xss)");
-           st->print_cr("#   Set larger code cache with -XX:ReservedCodeCacheSize=");
-           st->print_cr("# This output file may be truncated or incomplete.");
+           print_oom_reasons(st);
          } else {
            return;  // that's enough for the screen
          }
@@ -440,7 +452,7 @@
          break;
      }
 
-  STEP(20, "(printing exception/signal name)")
+  STEP(60, "(printing exception/signal name)")
 
      st->print_cr("#");
      st->print("#  ");
@@ -470,14 +482,14 @@
        }
      }
 
-  STEP(30, "(printing current thread and pid)")
+  STEP(70, "(printing current thread and pid)")
 
      // process id, thread id
      st->print(", pid=%d", os::current_process_id());
      st->print(", tid=" INTPTR_FORMAT, os::current_thread_id());
      st->cr();
 
-  STEP(40, "(printing error message)")
+  STEP(80, "(printing error message)")
 
      if (should_report_bug(_id)) {  // already printed the message.
        // error message
@@ -488,7 +500,7 @@
        }
     }
 
-  STEP(50, "(printing Java version string)")
+  STEP(90, "(printing Java version string)")
 
      // VM version
      st->print_cr("#");
@@ -498,15 +510,18 @@
      const char* runtime_version = JDK_Version::runtime_version() != NULL ?
                                   JDK_Version::runtime_version() : "";
      st->print_cr("# JRE version: %s (%s) (build %s)", runtime_name, buf, runtime_version);
-     st->print_cr("# Java VM: %s (%s %s %s %s)",
+     // This is the long version with some default settings added
+     st->print_cr("# Java VM: %s (%s, %s%s%s, %s, %s)",
                    Abstract_VM_Version::vm_name(),
                    Abstract_VM_Version::vm_release(),
                    Abstract_VM_Version::vm_info_string(),
-                   Abstract_VM_Version::vm_platform_string(),
-                   UseCompressedOops ? "compressed oops" : ""
+                   TieredCompilation ? ", tiered" : "",
+                   UseCompressedOops ? ", compressed oops" : "",
+                   gc_mode(),
+                   Abstract_VM_Version::vm_platform_string()
                  );
 
-  STEP(60, "(printing problematic frame)")
+  STEP(100, "(printing problematic frame)")
 
      // Print current frame if we have a context (i.e. it's a crash)
      if (_context) {
@@ -517,7 +532,8 @@
        st->cr();
        st->print_cr("#");
      }
-  STEP(63, "(printing core file information)")
+
+  STEP(110, "(printing core file information)")
     st->print("# ");
     if (CreateCoredumpOnCrash) {
       if (coredump_status) {
@@ -531,13 +547,42 @@
     st->cr();
     st->print_cr("#");
 
-  STEP(65, "(printing bug submit message)")
+  STEP(120, "(printing bug submit message)")
 
      if (should_report_bug(_id) && _verbose) {
        print_bug_submit_message(st, _thread);
      }
 
-  STEP(70, "(printing thread)" )
+  STEP(130, "(printing summary)" )
+
+     if (_verbose) {
+       st->cr();
+       st->print_cr("---------------  S U M M A R Y ------------");
+       st->cr();
+     }
+
+  STEP(140, "(printing VM option summary)" )
+
+     if (_verbose) {
+       // VM options
+       Arguments::print_summary_on(st);
+       st->cr();
+     }
+
+  STEP(150, "(printing summary machine and OS info)")
+
+     if (_verbose) {
+       os::print_summary_info(st, buf, sizeof(buf));
+     }
+
+
+  STEP(160, "(printing date and time)" )
+
+     if (_verbose) {
+       os::print_date_and_time(st, buf, sizeof(buf));
+     }
+
+  STEP(170, "(printing thread)" )
 
      if (_verbose) {
        st->cr();
@@ -545,7 +590,7 @@
        st->cr();
      }
 
-  STEP(80, "(printing current thread)" )
+  STEP(180, "(printing current thread)" )
 
      // current thread
      if (_verbose) {
@@ -559,31 +604,20 @@
        st->cr();
      }
 
-  STEP(90, "(printing siginfo)" )
+  STEP(190, "(printing current compile task)" )
 
-     // signal no, signal code, address that caused the fault
-     if (_verbose && _siginfo) {
-       os::print_siginfo(st, _siginfo);
-       st->cr();
+     if (_verbose && _thread && _thread->is_Compiler_thread()) {
+        CompilerThread* t = (CompilerThread*)_thread;
+        if (t->task()) {
+           st->cr();
+           st->print_cr("Current CompileTask:");
+           t->task()->print_line_on_error(st, buf, sizeof(buf));
+           st->cr();
+        }
      }
 
-  STEP(100, "(printing registers, top of stack, instructions near pc)")
 
-     // registers, top of stack, instructions near pc
-     if (_verbose && _context) {
-       os::print_context(st, _context);
-       st->cr();
-     }
-
-  STEP(105, "(printing register info)")
-
-     // decode register contents if possible
-     if (_verbose && _context && Universe::is_fully_initialized()) {
-       os::print_register_info(st, _context);
-       st->cr();
-     }
-
-  STEP(110, "(printing stack bounds)" )
+  STEP(200, "(printing stack bounds)" )
 
      if (_verbose) {
        st->print("Stack: ");
@@ -614,7 +648,7 @@
        st->cr();
      }
 
-  STEP(120, "(printing native stack)" )
+  STEP(210, "(printing native stack)" )
 
    if (_verbose) {
      if (os::platform_print_native_stack(st, _context, buf, sizeof(buf))) {
@@ -628,13 +662,13 @@
      }
    }
 
-  STEP(130, "(printing Java stack)" )
+  STEP(220, "(printing Java stack)" )
 
      if (_verbose && _thread && _thread->is_Java_thread()) {
        print_stack_trace(st, (JavaThread*)_thread, buf, sizeof(buf));
      }
 
-  STEP(135, "(printing target Java thread stack)" )
+  STEP(230, "(printing target Java thread stack)" )
 
      // printing Java thread stack trace if it is involved in GC crash
      if (_verbose && _thread && (_thread->is_Named_thread())) {
@@ -645,7 +679,32 @@
        }
      }
 
-  STEP(140, "(printing VM operation)" )
+  STEP(240, "(printing siginfo)" )
+
+     // signal no, signal code, address that caused the fault
+     if (_verbose && _siginfo) {
+       st->cr();
+       os::print_siginfo(st, _siginfo);
+       st->cr();
+     }
+
+  STEP(250, "(printing register info)")
+
+     // decode register contents if possible
+     if (_verbose && _context && Universe::is_fully_initialized()) {
+       os::print_register_info(st, _context);
+       st->cr();
+     }
+
+  STEP(260, "(printing registers, top of stack, instructions near pc)")
+
+     // registers, top of stack, instructions near pc
+     if (_verbose && _context) {
+       os::print_context(st, _context);
+       st->cr();
+     }
+
+  STEP(270, "(printing VM operation)" )
 
      if (_verbose && _thread && _thread->is_VM_thread()) {
         VMThread* t = (VMThread*)_thread;
@@ -657,19 +716,7 @@
         }
      }
 
-  STEP(150, "(printing current compile task)" )
-
-     if (_verbose && _thread && _thread->is_Compiler_thread()) {
-        CompilerThread* t = (CompilerThread*)_thread;
-        if (t->task()) {
-           st->cr();
-           st->print_cr("Current CompileTask:");
-           t->task()->print_line_on_error(st, buf, sizeof(buf));
-           st->cr();
-        }
-     }
-
-  STEP(160, "(printing process)" )
+  STEP(280, "(printing process)" )
 
      if (_verbose) {
        st->cr();
@@ -677,7 +724,7 @@
        st->cr();
      }
 
-  STEP(170, "(printing all threads)" )
+  STEP(290, "(printing all threads)" )
 
      // all threads
      if (_verbose && _thread) {
@@ -685,7 +732,7 @@
        st->cr();
      }
 
-  STEP(175, "(printing VM state)" )
+  STEP(300, "(printing VM state)" )
 
      if (_verbose) {
        // Safepoint state
@@ -707,7 +754,7 @@
        st->cr();
      }
 
-  STEP(180, "(printing owned locks on error)" )
+  STEP(310, "(printing owned locks on error)" )
 
      // mutexes/monitors that currently have an owner
      if (_verbose) {
@@ -715,7 +762,7 @@
        st->cr();
      }
 
-  STEP(182, "(printing number of OutOfMemoryError and StackOverflow exceptions)")
+  STEP(320, "(printing number of OutOfMemoryError and StackOverflow exceptions)")
 
      if (_verbose && Exceptions::has_exception_counts()) {
        st->print_cr("OutOfMemory and StackOverflow Exception counts:");
@@ -723,7 +770,7 @@
        st->cr();
      }
 
-  STEP(185, "(printing compressed oops mode")
+  STEP(330, "(printing compressed oops mode")
 
      if (_verbose && UseCompressedOops) {
        Universe::print_compressed_oops_mode(st);
@@ -733,7 +780,7 @@
        st->cr();
      }
 
-  STEP(190, "(printing heap information)" )
+  STEP(340, "(printing heap information)" )
 
      if (_verbose && Universe::is_fully_initialized()) {
        Universe::heap()->print_on_error(st);
@@ -743,7 +790,7 @@
        st->cr();
      }
 
-  STEP(195, "(printing code cache information)" )
+  STEP(350, "(printing code cache information)" )
 
      if (_verbose && Universe::is_fully_initialized()) {
        // print code cache information before vm abort
@@ -751,14 +798,14 @@
        st->cr();
      }
 
-  STEP(200, "(printing ring buffers)" )
+  STEP(360, "(printing ring buffers)" )
 
      if (_verbose) {
        Events::print_all(st);
        st->cr();
      }
 
-  STEP(205, "(printing dynamic libraries)" )
+  STEP(370, "(printing dynamic libraries)" )
 
      if (_verbose) {
        // dynamic libraries, or memory map
@@ -766,7 +813,7 @@
        st->cr();
      }
 
-  STEP(210, "(printing VM options)" )
+  STEP(380, "(printing VM options)" )
 
      if (_verbose) {
        // VM options
@@ -774,33 +821,33 @@
        st->cr();
      }
 
-  STEP(215, "(printing warning if internal testing API used)" )
+  STEP(390, "(printing warning if internal testing API used)" )
 
      if (WhiteBox::used()) {
        st->print_cr("Unsupported internal testing APIs have been used.");
        st->cr();
      }
 
-  STEP(220, "(printing environment variables)" )
+  STEP(400, "(printing all environment variables)" )
 
      if (_verbose) {
        os::print_environment_variables(st, env_list);
        st->cr();
      }
 
-  STEP(225, "(printing signal handlers)" )
+  STEP(410, "(printing signal handlers)" )
 
      if (_verbose) {
        os::print_signal_handlers(st, buf, sizeof(buf));
        st->cr();
      }
 
-  STEP(228, "(Native Memory Tracking)" )
+  STEP(420, "(Native Memory Tracking)" )
      if (_verbose) {
        MemTracker::error_report(st);
      }
 
-  STEP(230, "" )
+  STEP(430, "(printing system)" )
 
      if (_verbose) {
        st->cr();
@@ -808,48 +855,39 @@
        st->cr();
      }
 
-  STEP(240, "(printing OS information)" )
+  STEP(440, "(printing OS information)" )
 
      if (_verbose) {
        os::print_os_info(st);
        st->cr();
      }
 
-  STEP(250, "(printing CPU info)" )
+  STEP(450, "(printing CPU info)" )
      if (_verbose) {
        os::print_cpu_info(st, buf, sizeof(buf));
        st->cr();
      }
 
-  STEP(260, "(printing memory info)" )
+  STEP(460, "(printing memory info)" )
 
      if (_verbose) {
        os::print_memory_info(st);
        st->cr();
      }
 
-  STEP(270, "(printing internal vm info)" )
+  STEP(470, "(printing internal vm info)" )
 
      if (_verbose) {
        st->print_cr("vm_info: %s", Abstract_VM_Version::internal_vm_info_string());
        st->cr();
      }
 
-  STEP(280, "(printing date and time)" )
-
-     if (_verbose) {
-       os::print_date_and_time(st, buf, sizeof(buf));
-       st->cr();
-     }
-
-#ifndef PRODUCT
   // print a defined marker to show that error handling finished correctly.
-  STEP(290, "(printing end marker)" )
+  STEP(480, "(printing end marker)" )
 
      if (_verbose) {
        st->print_cr("END.");
      }
-#endif
 
   END
 
--- a/hotspot/src/share/vm/utilities/vmError.hpp	Thu Apr 09 12:29:31 2015 +0200
+++ b/hotspot/src/share/vm/utilities/vmError.hpp	Mon Aug 17 12:45:16 2015 +0300
@@ -89,6 +89,9 @@
   static void print_stack_trace(outputStream* st, JavaThread* jt,
                                 char* buf, int buflen, bool verbose = false);
 
+  static const char* gc_mode();
+  static void print_oom_reasons(outputStream* st);
+
   // accessor
   const char* message() const    { return _message; }
   const char* detail_msg() const { return _detail_msg; }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/hotspot/test/compiler/arguments/CheckCICompilerCount.java	Mon Aug 17 12:45:16 2015 +0300
@@ -0,0 +1,135 @@
+/*
+ * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import jdk.test.lib.*;
+
+/*
+ * @test CheckCheckCICompilerCount
+ * @bug 8130858
+ * @summary Check that correct range of values for CICompilerCount are allowed depending on whether tiered is enabled or not
+ * @library /testlibrary
+ * @modules java.base/sun.misc
+ *          java.management
+ * @run main CheckCICompilerCount
+ */
+
+public class CheckCICompilerCount {
+    private static final String[][] NON_TIERED_ARGUMENTS = {
+        {
+            "-XX:-TieredCompilation",
+            "-XX:+PrintFlagsFinal",
+            "-XX:CICompilerCount=0",
+            "-version"
+        },
+        {
+            "-XX:-TieredCompilation",
+            "-XX:+PrintFlagsFinal",
+            "-XX:CICompilerCount=1",
+            "-version"
+        }
+    };
+
+    private static final String[][] NON_TIERED_EXPECTED_OUTPUTS = {
+        {
+            "CICompilerCount=0 must be at least 1",
+            "Improperly specified VM option 'CICompilerCount=0'"
+        },
+        {
+            "intx CICompilerCount                          := 1                                   {product}"
+        }
+    };
+
+    private static final int[] NON_TIERED_EXIT = {
+        1,
+        0
+    };
+
+    private static final String[][] TIERED_ARGUMENTS = {
+        {
+            "-XX:+TieredCompilation",
+            "-XX:+PrintFlagsFinal",
+            "-XX:CICompilerCount=1",
+            "-version"
+        },
+        {
+            "-XX:+TieredCompilation",
+            "-XX:+PrintFlagsFinal",
+            "-XX:CICompilerCount=2",
+            "-version"
+        }
+    };
+
+    private static final String[][] TIERED_EXPECTED_OUTPUTS = {
+        {
+            "CICompilerCount=1 must be at least 2",
+            "Improperly specified VM option 'CICompilerCount=1'"
+        },
+        {
+            "intx CICompilerCount                          := 2                                   {product}"
+        }
+    };
+
+    private static final int[] TIERED_EXIT = {
+        1,
+        0
+    };
+
+    private static void verifyValidOption(String[] arguments, String[] expected_outputs, int exit, boolean tiered) throws Exception {
+        ProcessBuilder pb;
+        OutputAnalyzer out;
+
+        pb = ProcessTools.createJavaProcessBuilder(arguments);
+        out = new OutputAnalyzer(pb.start());
+
+        try {
+            out.shouldHaveExitValue(exit);
+            for (String expected_output : expected_outputs) {
+                out.shouldContain(expected_output);
+            }
+        } catch (RuntimeException e) {
+            // Check if tiered compilation is available in this JVM
+            // Version. Throw exception only if it is available.
+            if (!(tiered && out.getOutput().contains("TieredCompilation is disabled in this release."))) {
+                throw new RuntimeException(e);
+            }
+        }
+    }
+
+    public static void main(String[] args) throws Exception {
+        if (NON_TIERED_ARGUMENTS.length != NON_TIERED_EXPECTED_OUTPUTS.length || NON_TIERED_ARGUMENTS.length != NON_TIERED_EXIT.length) {
+            throw new RuntimeException("Test is set up incorrectly: length of arguments, expected outputs and exit codes in non-tiered mode of operation do not match.");
+        }
+
+        if (TIERED_ARGUMENTS.length != TIERED_EXPECTED_OUTPUTS.length || TIERED_ARGUMENTS.length != TIERED_EXIT.length) {
+            throw new RuntimeException("Test is set up incorrectly: length of arguments, expected outputs and exit codes in tiered mode of operation do not match.");
+        }
+
+        for (int i = 0; i < NON_TIERED_ARGUMENTS.length; i++) {
+            verifyValidOption(NON_TIERED_ARGUMENTS[i], NON_TIERED_EXPECTED_OUTPUTS[i], NON_TIERED_EXIT[i], false);
+        }
+
+        for (int i = 0; i < TIERED_ARGUMENTS.length; i++) {
+            verifyValidOption(TIERED_ARGUMENTS[i], TIERED_EXPECTED_OUTPUTS[i], TIERED_EXIT[i], true);
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/hotspot/test/compiler/intrinsics/IntrinsicAvailableTest.java	Mon Aug 17 12:45:16 2015 +0300
@@ -0,0 +1,126 @@
+/*
+ * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+import java.lang.reflect.Executable;
+import java.util.concurrent.Callable;
+import java.util.Objects;
+/*
+ * @test
+ * @bug 8130832
+ * @library /testlibrary /../../test/lib /compiler/whitebox /compiler/testlibrary
+ * @build IntrinsicAvailableTest
+ * @run main ClassFileInstaller sun.hotspot.WhiteBox
+ *                              sun.hotspot.WhiteBox$WhiteBoxPermission
+ * @run main/othervm -Xbootclasspath/a:.
+ *                   -XX:+UnlockDiagnosticVMOptions
+ *                   -XX:+WhiteBoxAPI
+ *                   -XX:+UseCRC32Intrinsics
+ *                   IntrinsicAvailableTest
+ * @run main/othervm -Xbootclasspath/a:.
+ *                   -XX:+UnlockDiagnosticVMOptions
+ *                   -XX:+WhiteBoxAPI
+ *                   -XX:-UseCRC32Intrinsics
+ *                   IntrinsicAvailableTest
+ */
+public class IntrinsicAvailableTest extends CompilerWhiteBoxTest {
+    protected String VMName;
+
+    public IntrinsicAvailableTest(IntrinsicAvailableTestTestCase testCase) {
+        super(testCase);
+        VMName = System.getProperty("java.vm.name");
+    }
+
+    public static class IntrinsicAvailableTestTestCase implements TestCase {
+
+        public String name() {
+            return "IntrinsicAvailableTestTestCase";
+        }
+
+        public Executable getExecutable() {
+            // Using a single method to test the
+            // WhiteBox.isIntrinsicAvailable(Executable method, int compLevel)
+            // call for the compilation level corresponding to both the C1 and C2
+            // compiler keeps the current test simple.
+            //
+            // The tested method is java.util.zip.CRC32.update(int, int) because
+            // both C1 and C2 define an intrinsic for the method and
+            // the UseCRC32Intrinsics flag can be used to enable/disable
+            // intrinsification of the method in both product and fastdebug
+            // builds.
+            try {
+                return Class.forName("java.util.zip.CRC32").getDeclaredMethod("update", int.class, int.class);
+            } catch (NoSuchMethodException e) {
+                throw new RuntimeException("Test bug, method unavailable. " + e);
+            } catch (ClassNotFoundException e) {
+                throw new RuntimeException("Test bug, class unavailable. " + e);
+            }
+        }
+
+        public Callable<Integer> getCallable() {
+            return null;
+        }
+
+        public boolean isOsr() {
+            return false;
+        }
+
+    }
+
+    protected void checkIntrinsicForCompilationLevel(Executable method, int compLevel) throws Exception {
+        boolean intrinsicEnabled = Boolean.valueOf(getVMOption("UseCRC32Intrinsics"));
+        boolean intrinsicAvailable = WHITE_BOX.isIntrinsicAvailable(method,
+                                                                    compLevel);
+
+        String intrinsicEnabledMessage = intrinsicEnabled ? "enabled" : "disabled";
+        String intrinsicAvailableMessage = intrinsicAvailable ? "available" : "not available";
+
+        if (intrinsicEnabled == intrinsicAvailable) {
+            System.out.println("Expected result: intrinsic for java.util.zip.CRC32.update() is " +
+                               intrinsicEnabledMessage + " and intrinsic is " + intrinsicAvailableMessage +
+                               " at compilation level " + compLevel);
+        } else {
+            throw new RuntimeException("Unexpected result: intrinsic for java.util.zip.CRC32.update() is " +
+                                       intrinsicEnabledMessage + " but intrinsic is " + intrinsicAvailableMessage +
+                                       " at compilation level " + compLevel);
+        }
+    }
+
+    protected boolean isServerVM() {
+        return VMName.toLowerCase().contains("server");
+    }
+
+    public void test() throws Exception {
+        Executable intrinsicMethod = testCase.getExecutable();
+        if (isServerVM()) {
+            if (TIERED_COMPILATION) {
+                checkIntrinsicForCompilationLevel(intrinsicMethod, COMP_LEVEL_SIMPLE);
+            }
+            checkIntrinsicForCompilationLevel(intrinsicMethod, COMP_LEVEL_FULL_OPTIMIZATION);
+        } else {
+            checkIntrinsicForCompilationLevel(intrinsicMethod, COMP_LEVEL_SIMPLE);
+        }
+    }
+
+    public static void main(String args[]) throws Exception {
+        new IntrinsicAvailableTest(new IntrinsicAvailableTestTestCase()).test();
+    }
+}
--- a/hotspot/test/compiler/intrinsics/mathexact/sanity/IntrinsicBase.java	Thu Apr 09 12:29:31 2015 +0200
+++ b/hotspot/test/compiler/intrinsics/mathexact/sanity/IntrinsicBase.java	Mon Aug 17 12:45:16 2015 +0300
@@ -67,7 +67,7 @@
                     compileAtLevel(CompilerWhiteBoxTest.COMP_LEVEL_SIMPLE);
                 }
 
-                if (!isIntrinsicSupported()) {
+                if (!isIntrinsicAvailable()) {
                     expectedIntrinsicCount = 0;
                 }
                 break;
@@ -114,7 +114,11 @@
         }
     }
 
-    protected abstract boolean isIntrinsicSupported();
+    // An intrinsic is available if:
+    // - the intrinsic is enabled (by using the appropriate command-line flag) and
+    // - the intrinsic is supported by the VM (i.e., the platform on which the VM is
+    //   running provides the instructions necessary for the VM to generate the intrinsic).
+    protected abstract boolean isIntrinsicAvailable();
 
     protected abstract String getIntrinsicId();
 
@@ -123,14 +127,20 @@
     }
 
     static class IntTest extends IntrinsicBase {
+
+        protected boolean isIntrinsicAvailable; // The tested intrinsic is available on the current platform.
+
         protected IntTest(MathIntrinsic.IntIntrinsic testCase) {
             super(testCase);
+            // Only the C2 compiler intrinsifies exact math methods
+            // so check if the intrinsics are available with C2.
+            isIntrinsicAvailable = WHITE_BOX.isIntrinsicAvailable(testCase.getTestMethod(),
+                                                                  COMP_LEVEL_FULL_OPTIMIZATION);
         }
 
         @Override
-        protected boolean isIntrinsicSupported() {
-            return isServerVM() && Boolean.valueOf(useMathExactIntrinsics)
-                && (Platform.isX86() || Platform.isX64() || Platform.isAArch64());
+        protected boolean isIntrinsicAvailable() {
+            return isIntrinsicAvailable;
         }
 
         @Override
@@ -140,14 +150,20 @@
     }
 
     static class LongTest extends IntrinsicBase {
+
+        protected boolean isIntrinsicAvailable; // The tested intrinsic is available on the current platform.
+
         protected LongTest(MathIntrinsic.LongIntrinsic testCase) {
             super(testCase);
+            // Only the C2 compiler intrinsifies exact math methods
+            // so check if the intrinsics are available with C2.
+            isIntrinsicAvailable = WHITE_BOX.isIntrinsicAvailable(testCase.getTestMethod(),
+                                                                  COMP_LEVEL_FULL_OPTIMIZATION);
         }
 
         @Override
-        protected boolean isIntrinsicSupported() {
-            return isServerVM() && Boolean.valueOf(useMathExactIntrinsics) &&
-                (Platform.isX64() || Platform.isPPC() || Platform.isAArch64());
+        protected boolean isIntrinsicAvailable() {
+            return isIntrinsicAvailable;
         }
 
         @Override
--- a/hotspot/test/compiler/intrinsics/mathexact/sanity/MathIntrinsic.java	Thu Apr 09 12:29:31 2015 +0200
+++ b/hotspot/test/compiler/intrinsics/mathexact/sanity/MathIntrinsic.java	Mon Aug 17 12:45:16 2015 +0300
@@ -29,11 +29,21 @@
     enum IntIntrinsic implements CompilerWhiteBoxTest.TestCase {
         Add {
             @Override
+            Executable testMethod() throws NoSuchMethodException, ClassNotFoundException {
+                return Class.forName("java.lang.Math").getDeclaredMethod("addExact", int.class, int.class);
+            }
+
+            @Override
             Object execMathMethod() {
                 return intR = Math.addExact(int1, int2);
             }
         },
-        Subtract {
+       Subtract {
+            @Override
+            Executable testMethod() throws NoSuchMethodException, ClassNotFoundException {
+                return Class.forName("java.lang.Math").getDeclaredMethod("subtractExact", int.class, int.class);
+            }
+
             @Override
             Object execMathMethod() {
                 return intR = Math.subtractExact(int1, int2);
@@ -41,34 +51,66 @@
         },
         Multiply {
             @Override
+            Executable testMethod() throws NoSuchMethodException, ClassNotFoundException {
+                return Class.forName("java.lang.Math").getDeclaredMethod("multiplyExact", int.class, int.class);
+            }
+
+            @Override
             Object execMathMethod() {
                 return intR = Math.multiplyExact(int1, int2);
             }
         },
         Increment {
             @Override
+            Executable testMethod() throws NoSuchMethodException, ClassNotFoundException {
+                return Class.forName("java.lang.Math").getDeclaredMethod("incrementExact", int.class);
+            }
+
+            @Override
             Object execMathMethod() {
                 return intR = Math.incrementExact(int1);
             }
         },
         Decrement {
             @Override
+            Executable testMethod() throws NoSuchMethodException, ClassNotFoundException {
+                return Class.forName("java.lang.Math").getDeclaredMethod("decrementExact", int.class);
+            }
+
+            @Override
             Object execMathMethod() {
                 return intR = Math.decrementExact(int1);
             }
         },
         Negate {
             @Override
+            Executable testMethod() throws NoSuchMethodException, ClassNotFoundException {
+                return Class.forName("java.lang.Math").getDeclaredMethod("negateExact", int.class);
+            }
+
+            @Override
             Object execMathMethod() {
                 return intR = Math.negateExact(int1);
             }
         };
+
         protected int int1;
         protected int int2;
         protected int intR;
 
+        abstract Executable testMethod() throws NoSuchMethodException, ClassNotFoundException;
         abstract Object execMathMethod();
 
+        public Executable getTestMethod() {
+            try {
+                return testMethod();
+            } catch (NoSuchMethodException e) {
+                throw new RuntimeException("Test bug, no such method: " + e);
+            } catch (ClassNotFoundException e) {
+                throw new RuntimeException("Test bug, no such class: " + e);
+            }
+        }
+
         @Override
         public Executable getExecutable() {
             try {
@@ -93,36 +135,66 @@
     enum LongIntrinsic implements CompilerWhiteBoxTest.TestCase {
         Add {
             @Override
+            Executable testMethod() throws NoSuchMethodException, ClassNotFoundException {
+                return Class.forName("java.lang.Math").getDeclaredMethod("addExact", long.class, long.class);
+            }
+
+            @Override
             Object execMathMethod() {
                 return longR = Math.addExact(long1, long2);
             }
         },
         Subtract {
             @Override
+            Executable testMethod() throws NoSuchMethodException, ClassNotFoundException {
+                return Class.forName("java.lang.Math").getDeclaredMethod("subtractExact", long.class, long.class);
+            }
+
+            @Override
             Object execMathMethod() {
                 return longR = Math.subtractExact(long1, long2);
             }
         },
         Multiply {
             @Override
+            Executable testMethod() throws NoSuchMethodException, ClassNotFoundException {
+                return Class.forName("java.lang.Math").getDeclaredMethod("multiplyExact", long.class, long.class);
+            }
+
+            @Override
             Object execMathMethod() {
                 return longR = Math.multiplyExact(long1, long2);
             }
         },
         Increment {
             @Override
+            Executable testMethod() throws NoSuchMethodException, ClassNotFoundException {
+                return Class.forName("java.lang.Math").getDeclaredMethod("incrementExact", long.class);
+            }
+
+            @Override
             Object execMathMethod() {
                 return longR = Math.incrementExact(long1);
             }
         },
         Decrement {
             @Override
+            Executable testMethod() throws NoSuchMethodException, ClassNotFoundException {
+                return Class.forName("java.lang.Math").getDeclaredMethod("decrementExact", long.class);
+            }
+
+            @Override
             Object execMathMethod() {
                 return longR = Math.decrementExact(long1);
             }
         },
         Negate {
             @Override
+            Executable testMethod() throws NoSuchMethodException, ClassNotFoundException {
+                return Class.forName("java.lang.Math").getDeclaredMethod("negateExact", long.class);
+            }
+
+            @Override
             Object execMathMethod() {
                 return longR = Math.negateExact(long1);
             }
@@ -131,8 +203,19 @@
         protected long long2;
         protected long longR;
 
+        abstract Executable testMethod() throws NoSuchMethodException, ClassNotFoundException;
         abstract Object execMathMethod();
 
+        public Executable getTestMethod() {
+            try {
+                return testMethod();
+            } catch (NoSuchMethodException e) {
+                throw new RuntimeException("Test bug, no such method: " + e);
+            } catch (ClassNotFoundException e) {
+                throw new RuntimeException("Test bug, no such class: " + e);
+            }
+        }
+
         @Override
         public Executable getExecutable() {
             try {
--- a/hotspot/test/gc/g1/TestLargePageUseForAuxMemory.java	Thu Apr 09 12:29:31 2015 +0200
+++ b/hotspot/test/gc/g1/TestLargePageUseForAuxMemory.java	Mon Aug 17 12:45:16 2015 +0300
@@ -94,29 +94,47 @@
         output.shouldHaveExitValue(0);
     }
 
+    private static long gcd(long x, long y) {
+        while (x > 0) {
+            long t = x;
+            x = y % x;
+            y = t;
+        }
+        return y;
+    }
+
+    private static long lcm(long x, long y) {
+        return x * (y / gcd(x, y));
+    }
+
     public static void main(String[] args) throws Exception {
         if (!Platform.isDebugBuild()) {
             System.out.println("Skip tests on non-debug builds because the required option TracePageSizes is a debug-only option.");
             return;
         }
 
+        // Size that a single card covers.
+        final int cardSize = 512;
         WhiteBox wb = WhiteBox.getWhiteBox();
         smallPageSize = wb.getVMPageSize();
         largePageSize = wb.getVMLargePageSize();
         allocGranularity = wb.getVMAllocationGranularity();
+        final long heapAlignment = lcm(cardSize * smallPageSize, largePageSize);
 
         if (largePageSize == 0) {
             System.out.println("Skip tests because large page support does not seem to be available on this platform.");
             return;
         }
+        if (largePageSize == smallPageSize) {
+            System.out.println("Skip tests because large page support does not seem to be available on this platform." +
+                               "Small and large page size are the same.");
+            return;
+        }
 
         // To get large pages for the card table etc. we need at least a 1G heap (with 4k page size).
         // 32 bit systems will have problems reserving such an amount of contiguous space, so skip the
         // test there.
         if (!Platform.is32bit()) {
-            // Size that a single card covers.
-            final int cardSize = 512;
-
             final long heapSizeForCardTableUsingLargePages = largePageSize * cardSize;
             final long heapSizeDiffForCardTable = Math.max(Math.max(allocGranularity * cardSize, HEAP_REGION_SIZE), largePageSize);
 
@@ -131,7 +149,8 @@
         // everywhere.
         final int bitmapTranslationFactor = 8 * 8; // ObjectAlignmentInBytes * BitsPerByte
         final long heapSizeForBitmapUsingLargePages = largePageSize * bitmapTranslationFactor;
-        final long heapSizeDiffForBitmap = Math.max(Math.max(allocGranularity * bitmapTranslationFactor, HEAP_REGION_SIZE), largePageSize);
+        final long heapSizeDiffForBitmap = Math.max(Math.max(allocGranularity * bitmapTranslationFactor, HEAP_REGION_SIZE),
+                                                    Math.max(largePageSize, heapAlignment));
 
         Asserts.assertGT(heapSizeForBitmapUsingLargePages, heapSizeDiffForBitmap,
                          "To test we would require to use an invalid heap size");
--- a/hotspot/test/runtime/CompressedOops/ObjectAlignment.java	Thu Apr 09 12:29:31 2015 +0200
+++ b/hotspot/test/runtime/CompressedOops/ObjectAlignment.java	Mon Aug 17 12:45:16 2015 +0300
@@ -48,7 +48,6 @@
                 .shouldHaveExitValue(1);
 
             testObjectAlignment(-1)
-                .shouldContain("must be power of 2")
                 .shouldContain("outside the allowed range")
                 .shouldHaveExitValue(1);
 
@@ -75,4 +74,4 @@
                                                                   "-version");
         return new OutputAnalyzer(pb.start());
     }
-}
\ No newline at end of file
+}
--- a/hotspot/test/runtime/ErrorHandling/CreateCoredumpOnCrash.java	Thu Apr 09 12:29:31 2015 +0200
+++ b/hotspot/test/runtime/ErrorHandling/CreateCoredumpOnCrash.java	Mon Aug 17 12:45:16 2015 +0300
@@ -38,7 +38,7 @@
 public class CreateCoredumpOnCrash {
     private static class Crasher {
         public static void main(String[] args) {
-            Utils.getUnsafe().getInt(0);
+            Utils.getUnsafe().putInt(0L, 0);
         }
     }
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/hotspot/test/runtime/RedefineTests/RedefineRunningMethodsWithBacktrace.java	Mon Aug 17 12:45:16 2015 +0300
@@ -0,0 +1,193 @@
+/*
+ * Copyright (c) 2015, 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 8087315
+ * @summary Get old method's stack trace elements after GC
+ * @library /testlibrary
+ * @modules java.compiler
+ *          java.instrument
+ *          jdk.jartool/sun.tools.jar
+ * @build RedefineClassHelper
+ * @run main RedefineClassHelper
+ * @run main/othervm -javaagent:redefineagent.jar RedefineRunningMethodsWithBacktrace
+ */
+
+import static jdk.test.lib.Asserts.*;
+
+public class RedefineRunningMethodsWithBacktrace {
+
+    public static String newB =
+                "class RedefineRunningMethodsWithBacktrace$B {" +
+                "   static int count1 = 0;" +
+                "   static int count2 = 0;" +
+                "   public static volatile boolean stop = false;" +
+                "  static void localSleep() { " +
+                "    try{ " +
+                "      Thread.currentThread().sleep(10);" +
+                "    } catch(InterruptedException ie) { " +
+                "    } " +
+                " } " +
+                "   public static void infinite() { " +
+                "       System.out.println(\"infinite called\");" +
+                "   }" +
+                "   public static void throwable() { " +
+                "       throw new RuntimeException(\"throwable called\");" +
+                "   }" +
+                "}";
+
+    public static String evenNewerB =
+                "class RedefineRunningMethodsWithBacktrace$B {" +
+                "   static int count1 = 0;" +
+                "   static int count2 = 0;" +
+                "   public static volatile boolean stop = false;" +
+                "  static void localSleep() { " +
+                "    try{ " +
+                "      Thread.currentThread().sleep(1);" +
+                "    } catch(InterruptedException ie) { " +
+                "    } " +
+                " } " +
+                "   public static void infinite() { }" +
+                "   public static void throwable() { " +
+                "       throw new RuntimeException(\"throwable called\");" +
+                "   }" +
+                "}";
+
+    static class B {
+        static int count1 = 0;
+        static int count2 = 0;
+        public static volatile boolean stop = false;
+        static void localSleep() {
+            try {
+                Thread.currentThread().sleep(10);//sleep for 10 ms
+            } catch(InterruptedException ie) {
+            }
+        }
+
+        public static void infinite() {
+            while (!stop) { count1++; localSleep(); }
+        }
+        public static void throwable() {
+            // add some stuff to the original constant pool
+            String s1 = new String ("string1");
+            String s2 = new String ("string2");
+            String s3 = new String ("string3");
+            String s4 = new String ("string4");
+            String s5 = new String ("string5");
+            String s6 = new String ("string6");
+            String s7 = new String ("string7");
+            String s8 = new String ("string8");
+            String s9 = new String ("string9");
+            String s10 = new String ("string10");
+            String s11 = new String ("string11");
+            String s12 = new String ("string12");
+            String s13 = new String ("string13");
+            String s14 = new String ("string14");
+            String s15 = new String ("string15");
+            String s16 = new String ("string16");
+            String s17 = new String ("string17");
+            String s18 = new String ("string18");
+            String s19 = new String ("string19");
+            throw new RuntimeException("throwable called");
+        }
+    }
+
+    private static void touchRedefinedMethodInBacktrace(Throwable throwable) {
+        System.out.println("touchRedefinedMethodInBacktrace: ");
+        throwable.printStackTrace();  // this actually crashes with the bug in
+                                      // java_lang_StackTraceElement::create()
+
+        // Make sure that we can convert the backtrace, which is referring to
+        // the redefined method, to a  StrackTraceElement[] without crashing.
+        StackTraceElement[] stackTrace = throwable.getStackTrace();
+        for (int i = 0; i < stackTrace.length; i++) {
+            StackTraceElement frame = stackTrace[i];
+            assertNotNull(frame.getClassName(),
+              "\nTest failed: trace[" + i + "].getClassName() returned null");
+            assertNotNull(frame.getMethodName(),
+              "\nTest failed: trace[" + i + "].getMethodName() returned null");
+        }
+    }
+
+    private static Throwable getThrowableInB() {
+        Throwable t = null;
+        try {
+            B.throwable();
+        } catch (Exception e) {
+            t = e;
+            // Don't print here because Throwable will cache the constructed stacktrace
+            // e.printStackTrace();
+        }
+        return t;
+    }
+
+
+    public static void main(String[] args) throws Exception {
+
+        new Thread() {
+            public void run() {
+                B.infinite();
+            }
+        }.start();
+
+        Throwable t1 = getThrowableInB();
+
+        RedefineClassHelper.redefineClass(B.class, newB);
+
+        System.gc();
+
+        Throwable t2 = getThrowableInB();
+
+        B.infinite();
+
+        for (int i = 0; i < 20 ; i++) {
+            String s = new String("some garbage");
+            System.gc();
+        }
+
+        RedefineClassHelper.redefineClass(B.class, evenNewerB);
+        System.gc();
+
+        Throwable t3 = getThrowableInB();
+
+        for (int i = 0; i < 20 ; i++) {
+            B.infinite();
+            String s = new String("some garbage");
+            System.gc();
+        }
+
+        touchRedefinedMethodInBacktrace(t1);
+        touchRedefinedMethodInBacktrace(t2);
+        touchRedefinedMethodInBacktrace(t3);
+
+        // purge should clean everything up.
+        B.stop = true;
+
+        for (int i = 0; i < 20 ; i++) {
+            B.infinite();
+            String s = new String("some garbage");
+            System.gc();
+        }
+    }
+}
--- a/hotspot/test/runtime/contended/Options.java	Thu Apr 09 12:29:31 2015 +0200
+++ b/hotspot/test/runtime/contended/Options.java	Mon Aug 17 12:45:16 2015 +0300
@@ -55,7 +55,6 @@
         output = new OutputAnalyzer(pb.start());
         output.shouldContain("ContendedPaddingWidth");
         output.shouldContain("outside the allowed range");
-        output.shouldContain("must be a multiple of 8");
         output.shouldHaveExitValue(1);
 
         pb = ProcessTools.createJavaProcessBuilder("-XX:ContendedPaddingWidth=0", "-version");
@@ -90,7 +89,6 @@
         output = new OutputAnalyzer(pb.start());
         output.shouldContain("ContendedPaddingWidth");
         output.shouldContain("outside the allowed range");
-        output.shouldContain("must be a multiple of 8");
         output.shouldHaveExitValue(1);
 
         pb = ProcessTools.createJavaProcessBuilder("-XX:ContendedPaddingWidth=8200", "-version"); // 8192+8 = 8200
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/hotspot/test/runtime/verifier/PrimIntArray.java	Mon Aug 17 12:45:16 2015 +0300
@@ -0,0 +1,55 @@
+/*
+ * Copyright (c) 2015, 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 8129895
+ * @summary Throw VerifyError when checking assignability of primitive arrays
+ * that are not identical.  For example, [I is not assignable to [B.
+ * @compile primArray.jasm
+ * @compile primArray49.jasm
+ * @run main/othervm -Xverify:all PrimIntArray
+ */
+
+// Test that an int[] is not assignable to byte[].
+public class PrimIntArray {
+
+    public static void main(String args[]) throws Throwable {
+        System.out.println("Regression test for bug 8129895");
+
+        try {
+            Class newClass = Class.forName("primArray");
+            throw new RuntimeException("Expected VerifyError exception not thrown with new verifier");
+        } catch (java.lang.VerifyError e) {
+            System.out.println("Test PrimIntArray passed with new verifier");
+        }
+
+        try {
+            Class newClass = Class.forName("primArray49");
+            throw new RuntimeException("Expected VerifyError exception not thrown by old verifier");
+        } catch (java.lang.VerifyError e) {
+            System.out.println("Test PrimIntArray passed with old verifier");
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/hotspot/test/runtime/verifier/primArray.jasm	Mon Aug 17 12:45:16 2015 +0300
@@ -0,0 +1,46 @@
+/*
+ * Copyright (c) 2015, 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.
+ *
+ */
+
+// Method castToByteArray() tries to return an array of ints when an array
+// of bytes is expected.
+super class primArray
+version 52:0
+{
+
+    public Method "<init>":"()V"
+    stack 1 locals 1
+    {
+        aload_0;
+        invokespecial Method java/lang/Object."<init>":"()V";
+        return;
+    }
+
+    public static Method castToByteArray:"([I)[B"
+        stack 1 locals 1
+    {
+        aload_0;
+        areturn;
+    }
+
+} // end Class primArray
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/hotspot/test/runtime/verifier/primArray49.jasm	Mon Aug 17 12:45:16 2015 +0300
@@ -0,0 +1,46 @@
+/*
+ * Copyright (c) 2015, 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.
+ *
+ */
+
+// Method castToByteArray() tries to return an array of ints when an array
+// of bytes is expected.
+super class primArray49
+version 49:0
+{
+
+    public Method "<init>":"()V"
+    stack 1 locals 1
+    {
+        aload_0;
+        invokespecial Method java/lang/Object."<init>":"()V";
+        return;
+    }
+
+    public static Method castToByteArray:"([I)[B"
+        stack 1 locals 1
+    {
+        aload_0;
+        areturn;
+    }
+
+} // end Class primArray49
--- a/hotspot/test/serviceability/sa/TestStackTrace.java	Thu Apr 09 12:29:31 2015 +0200
+++ b/hotspot/test/serviceability/sa/TestStackTrace.java	Mon Aug 17 12:45:16 2015 +0300
@@ -34,7 +34,6 @@
  * @test
  * @library /../../test/lib/share/classes
  * @library /testlibrary
- * @ignore 8129971
  * @build jdk.test.lib.*
  * @build jdk.test.lib.apps.*
  * @run main TestStackTrace
--- a/hotspot/test/testlibrary/jdk/test/lib/InMemoryJavaCompiler.java	Thu Apr 09 12:29:31 2015 +0200
+++ b/hotspot/test/testlibrary/jdk/test/lib/InMemoryJavaCompiler.java	Mon Aug 17 12:45:16 2015 +0300
@@ -31,11 +31,9 @@
 import java.util.Arrays;
 
 import javax.tools.ForwardingJavaFileManager;
-import javax.tools.ForwardingJavaFileManager;
 import javax.tools.FileObject;
 import javax.tools.JavaCompiler;
 import javax.tools.JavaCompiler.CompilationTask;
-import javax.tools.JavaFileManager;
 import javax.tools.JavaFileObject;
 import javax.tools.JavaFileObject.Kind;
 import javax.tools.SimpleJavaFileObject;
--- a/hotspot/test/testlibrary/jdk/test/lib/Platform.java	Thu Apr 09 12:29:31 2015 +0200
+++ b/hotspot/test/testlibrary/jdk/test/lib/Platform.java	Mon Aug 17 12:45:16 2015 +0300
@@ -24,7 +24,6 @@
 package jdk.test.lib;
 
 import java.util.regex.Pattern;
-import jdk.test.lib.Utils;
 
 public class Platform {
     private static final String osName      = System.getProperty("os.name");
--- a/hotspot/test/testlibrary/jdk/test/lib/ProcessTools.java	Thu Apr 09 12:29:31 2015 +0200
+++ b/hotspot/test/testlibrary/jdk/test/lib/ProcessTools.java	Mon Aug 17 12:45:16 2015 +0300
@@ -27,8 +27,6 @@
 import java.io.IOException;
 import java.lang.management.ManagementFactory;
 import java.lang.management.RuntimeMXBean;
-import java.lang.reflect.Field;
-import java.lang.reflect.Method;
 import java.util.ArrayList;
 import java.util.Collections;
 import java.util.List;
--- a/hotspot/test/testlibrary/jdk/test/lib/Utils.java	Thu Apr 09 12:29:31 2015 +0200
+++ b/hotspot/test/testlibrary/jdk/test/lib/Utils.java	Mon Aug 17 12:45:16 2015 +0300
@@ -24,9 +24,6 @@
 package jdk.test.lib;
 
 import static jdk.test.lib.Asserts.assertTrue;
-import java.io.BufferedReader;
-import java.io.File;
-import java.io.FileReader;
 import java.io.IOException;
 import java.lang.reflect.Field;
 import java.net.InetAddress;
@@ -58,12 +55,12 @@
     public static final String NEW_LINE = System.getProperty("line.separator");
 
     /**
-     * Returns the value of 'test.vm.opts'system property.
+     * Returns the value of 'test.vm.opts' system property.
      */
     public static final String VM_OPTIONS = System.getProperty("test.vm.opts", "").trim();
 
     /**
-     * Returns the value of 'test.java.opts'system property.
+     * Returns the value of 'test.java.opts' system property.
      */
     public static final String JAVA_OPTIONS = System.getProperty("test.java.opts", "").trim();
 
@@ -129,7 +126,7 @@
     /**
      * Returns the default JTReg arguments for a jvm running a test.
      * This is the combination of JTReg arguments test.vm.opts and test.java.opts.
-     * @return An array of options, or an empty array if no opptions.
+     * @return An array of options, or an empty array if no options.
      */
     public static String[] getTestJavaOpts() {
         List<String> opts = new ArrayList<String>();
@@ -276,7 +273,7 @@
      * 12254 /tmp/jdk8/tl/jdk/JTwork/classes/com/sun/tools/attach/Application.jar
      *
      * @param key A regular expression to search for.
-     * @return The found pid, or -1 if Enot found.
+     * @return The found pid, or -1 if not found.
      * @throws Exception If multiple matching jvms are found.
      */
     public static int tryFindJvmPid(String key) throws Throwable {
@@ -392,7 +389,7 @@
      * @param condition, a condition to wait for
      * @param timeout a time in milliseconds to wait for condition to be true
      * specifying -1 will wait forever
-     * @return condition value, to determine if wait was successfull
+     * @return condition value, to determine if wait was successful
      */
     public static final boolean waitForCondition(BooleanSupplier condition,
             long timeout) {
@@ -406,7 +403,7 @@
      * @param timeout a time in milliseconds to wait for condition to be true,
      * specifying -1 will wait forever
      * @param sleepTime a time to sleep value in milliseconds
-     * @return condition value, to determine if wait was successfull
+     * @return condition value, to determine if wait was successful
      */
     public static final boolean waitForCondition(BooleanSupplier condition,
             long timeout, long sleepTime) {
--- a/jaxp/.hgtags	Thu Apr 09 12:29:31 2015 +0200
+++ b/jaxp/.hgtags	Mon Aug 17 12:45:16 2015 +0300
@@ -318,3 +318,4 @@
 be5efc34a43bdd982d1cbe11cb2f6d6a060dde60 jdk9-b73
 eadcb2b55cd1daf77625813aad0f6f3967b1528a jdk9-b74
 16b5e696f948cd8aa9b3afdb686ddffd48bd17a8 jdk9-b75
+36801a89a04201b59874ec776ffe85d6253c9ab5 jdk9-b76
--- a/jaxp/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/Version.java	Thu Apr 09 12:29:31 2015 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,155 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2003-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: Version.java,v 1.1.2.1 2005/08/01 02:11:19 jeffsuttor Exp $
- */
-package com.sun.org.apache.xalan.internal;
-
-/**
- * Administrative class to keep track of the version number of
- * the Xalan release.
- * <P>This class implements the upcoming standard of having
- * org.apache.project-name.Version.getVersion() be a standard way
- * to get version information.  This class will replace the older
- * com.sun.org.apache.xalan.internal.processor.Version class.</P>
- * <P>See also: com/sun/org/apache/xalan/internal/res/XSLTInfo.properties for
- * information about the version of the XSLT spec we support.</P>
- * @xsl.usage general
- */
-public class Version
-{
-
-  /**
-   * Get the basic version string for the current Xalan release.
-   * Version String formatted like
-   * <CODE>"<B>Xalan</B> <B>Java</B> v.r[.dd| <B>D</B>nn]"</CODE>.
-   *
-   * Futurework: have this read version info from jar manifest.
-   *
-   * @return String denoting our current version
-   */
-  public static String getVersion()
-  {
-     return getProduct()+" "+getImplementationLanguage()+" "
-           +getMajorVersionNum()+"."+getReleaseVersionNum()+"."
-           +( (getDevelopmentVersionNum() > 0) ?
-               ("D"+getDevelopmentVersionNum()) : (""+getMaintenanceVersionNum()));
-  }
-
-  /**
-   * Print the processor version to the command line.
-   *
-   * @param argv command line arguments, unused.
-   */
-  public static void _main(String argv[])
-  {
-    System.out.println(getVersion());
-  }
-
-  /**
-   * Name of product: Xalan.
-   */
-  public static String getProduct()
-  {
-    return "Xalan";
-  }
-
-  /**
-   * Implementation Language: Java.
-   */
-  public static String getImplementationLanguage()
-  {
-    return "Java";
-  }
-
-
-  /**
-   * Major version number.
-   * Version number. This changes only when there is a
-   *          significant, externally apparent enhancement from
-   *          the previous release. 'n' represents the n'th
-   *          version.
-   *
-   *          Clients should carefully consider the implications
-   *          of new versions as external interfaces and behaviour
-   *          may have changed.
-   */
-  public static int getMajorVersionNum()
-  {
-    return 2;
-
-  }
-
-  /**
-   * Release Number.
-   * Release number. This changes when:
-   *            -  a new set of functionality is to be added, eg,
-   *               implementation of a new W3C specification.
-   *            -  API or behaviour change.
-   *            -  its designated as a reference release.
-   */
-  public static int getReleaseVersionNum()
-  {
-    return 7;
-  }
-
-  /**
-   * Maintenance Drop Number.
-   * Optional identifier used to designate maintenance
-   *          drop applied to a specific release and contains
-   *          fixes for defects reported. It maintains compatibility
-   *          with the release and contains no API changes.
-   *          When missing, it designates the final and complete
-   *          development drop for a release.
-   */
-  public static int getMaintenanceVersionNum()
-  {
-    return 0;
-  }
-
-  /**
-   * Development Drop Number.
-   * Optional identifier designates development drop of
-   *          a specific release. D01 is the first development drop
-   *          of a new release.
-   *
-   *          Development drops are works in progress towards a
-   *          compeleted, final release. A specific development drop
-   *          may not completely implement all aspects of a new
-   *          feature, which may take several development drops to
-   *          complete. At the point of the final drop for the
-   *          release, the D suffix will be omitted.
-   *
-   *          Each 'D' drops can contain functional enhancements as
-   *          well as defect fixes. 'D' drops may not be as stable as
-   *          the final releases.
-   */
-  public static int getDevelopmentVersionNum()
-  {
-    try {
-        if ((new String("")).length() == 0)
-          return 0;
-        else
-          return Integer.parseInt("");
-    } catch (NumberFormatException nfe) {
-           return 0;
-    }
-  }
-}
--- a/jaxp/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xslt/Process.java	Thu Apr 09 12:29:31 2015 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1226 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: Process.java,v 1.2.4.2 2005/09/15 18:21:57 jeffsuttor Exp $
- */
-package com.sun.org.apache.xalan.internal.xslt;
-
-import java.io.FileOutputStream;
-import java.io.FileWriter;
-import java.io.PrintWriter;
-import java.io.StringReader;
-import java.util.Properties;
-import java.util.ResourceBundle;
-import java.util.Vector;
-
-import javax.xml.XMLConstants;
-import javax.xml.parsers.DocumentBuilder;
-import javax.xml.parsers.DocumentBuilderFactory;
-import javax.xml.parsers.ParserConfigurationException;
-import javax.xml.transform.OutputKeys;
-import javax.xml.transform.Source;
-import javax.xml.transform.Templates;
-import javax.xml.transform.Transformer;
-import javax.xml.transform.TransformerConfigurationException;
-import javax.xml.transform.TransformerException;
-import javax.xml.transform.TransformerFactory;
-import javax.xml.transform.TransformerFactoryConfigurationError;
-import javax.xml.transform.URIResolver;
-import javax.xml.transform.dom.DOMResult;
-import javax.xml.transform.dom.DOMSource;
-import javax.xml.transform.sax.SAXResult;
-import javax.xml.transform.sax.SAXSource;
-import javax.xml.transform.sax.SAXTransformerFactory;
-import javax.xml.transform.sax.TransformerHandler;
-import javax.xml.transform.stream.StreamResult;
-import javax.xml.transform.stream.StreamSource;
-
-import com.sun.org.apache.xalan.internal.Version;
-import com.sun.org.apache.xalan.internal.res.XSLMessages;
-import com.sun.org.apache.xalan.internal.res.XSLTErrorResources;
-import com.sun.org.apache.xalan.internal.utils.ObjectFactory;
-import com.sun.org.apache.xalan.internal.utils.ConfigurationError;
-import com.sun.org.apache.xalan.internal.utils.SecuritySupport;
-
-//J2SE does not support Xalan interpretive
-/*
-import com.sun.org.apache.xalan.internal.trace.PrintTraceListener;
-import com.sun.org.apache.xalan.internal.trace.TraceManager;
-import com.sun.org.apache.xalan.internal.transformer.XalanProperties;
-*/
-
-import com.sun.org.apache.xml.internal.utils.DefaultErrorHandler;
-
-import org.w3c.dom.Document;
-import org.w3c.dom.Node;
-
-import org.xml.sax.ContentHandler;
-import org.xml.sax.EntityResolver;
-import org.xml.sax.InputSource;
-import org.xml.sax.XMLReader;
-import org.xml.sax.helpers.XMLReaderFactory;
-
-/**
- * The main() method handles the Xalan command-line interface.
- * @xsl.usage general
- */
-public class Process
-{
-  /**
-   * Prints argument options.
-   *
-   * @param resbundle Resource bundle
-   */
-  protected static void printArgOptions(ResourceBundle resbundle)
-  {
-    System.out.println(resbundle.getString("xslProc_option"));  //"xslproc options: ");
-    System.out.println("\n\t\t\t" + resbundle.getString("xslProc_common_options") + "\n");
-    System.out.println(resbundle.getString("optionXSLTC"));  //"    [-XSLTC (use XSLTC for transformation)]
-    System.out.println(resbundle.getString("optionIN"));  //"    [-IN inputXMLURL]");
-    System.out.println(resbundle.getString("optionXSL"));  //"   [-XSL XSLTransformationURL]");
-    System.out.println(resbundle.getString("optionOUT"));  //"   [-OUT outputFileName]");
-
-    // System.out.println(resbundle.getString("optionE")); //"   [-E (Do not expand entity refs)]");
-    System.out.println(resbundle.getString("optionV"));  //"   [-V (Version info)]");
-
-    // System.out.println(resbundle.getString("optionVALIDATE")); //"   [-VALIDATE (Set whether validation occurs.  Validation is off by default.)]");
-    System.out.println(resbundle.getString("optionEDUMP"));  //"   [-EDUMP {optional filename} (Do stackdump on error.)]");
-    System.out.println(resbundle.getString("optionXML"));  //"   [-XML (Use XML formatter and add XML header.)]");
-    System.out.println(resbundle.getString("optionTEXT"));  //"   [-TEXT (Use simple Text formatter.)]");
-    System.out.println(resbundle.getString("optionHTML"));  //"   [-HTML (Use HTML formatter.)]");
-    System.out.println(resbundle.getString("optionPARAM"));  //"   [-PARAM name expression (Set a stylesheet parameter)]");
-
-    System.out.println(resbundle.getString("optionMEDIA"));
-    System.out.println(resbundle.getString("optionFLAVOR"));
-    System.out.println(resbundle.getString("optionDIAG"));
-    System.out.println(resbundle.getString("optionURIRESOLVER"));  //"   [-URIRESOLVER full class name (URIResolver to be used to resolve URIs)]");
-    System.out.println(resbundle.getString("optionENTITYRESOLVER"));  //"   [-ENTITYRESOLVER full class name (EntityResolver to be used to resolve entities)]");
-    waitForReturnKey(resbundle);
-    System.out.println(resbundle.getString("optionCONTENTHANDLER"));  //"   [-CONTENTHANDLER full class name (ContentHandler to be used to serialize output)]");
-    System.out.println(resbundle.getString("optionSECUREPROCESSING")); //"   [-SECURE (set the secure processing feature to true)]");
-
-    // J2SE does not support Xalan interpretive
-    /*
-    System.out.println("\n\t\t\t" + resbundle.getString("xslProc_xalan_options") + "\n");
-
-    System.out.println(resbundle.getString("optionQC"));  //"   [-QC (Quiet Pattern Conflicts Warnings)]");
-
-    // System.out.println(resbundle.getString("optionQ"));  //"   [-Q  (Quiet Mode)]"); // sc 28-Feb-01 commented out
-    System.out.println(resbundle.getString("optionTT"));  //"   [-TT (Trace the templates as they are being called.)]");
-    System.out.println(resbundle.getString("optionTG"));  //"   [-TG (Trace each generation event.)]");
-    System.out.println(resbundle.getString("optionTS"));  //"   [-TS (Trace each selection event.)]");
-    System.out.println(resbundle.getString("optionTTC"));  //"   [-TTC (Trace the template children as they are being processed.)]");
-    System.out.println(resbundle.getString("optionTCLASS"));  //"   [-TCLASS (TraceListener class for trace extensions.)]");
-    System.out.println(resbundle.getString("optionLINENUMBERS")); //"   [-L use line numbers]"
-    System.out.println(resbundle.getString("optionINCREMENTAL"));
-    System.out.println(resbundle.getString("optionNOOPTIMIMIZE"));
-    System.out.println(resbundle.getString("optionRL"));
-    */
-
-    System.out.println("\n\t\t\t" + resbundle.getString("xslProc_xsltc_options") + "\n");
-    System.out.println(resbundle.getString("optionXO"));
-    waitForReturnKey(resbundle);
-    System.out.println(resbundle.getString("optionXD"));
-    System.out.println(resbundle.getString("optionXJ"));
-    System.out.println(resbundle.getString("optionXP"));
-    System.out.println(resbundle.getString("optionXN"));
-    System.out.println(resbundle.getString("optionXX"));
-    System.out.println(resbundle.getString("optionXT"));
-  }
-
-  /**
-   * Command line interface to transform an XML document according to
-   * the instructions found in an XSL stylesheet.
-   * <p>The Process class provides basic functionality for
-   * performing transformations from the command line.  To see a
-   * list of arguments supported, call with zero arguments.</p>
-   * <p>To set stylesheet parameters from the command line, use
-   * <code>-PARAM name expression</code>. If you want to set the
-   * parameter to a string value, simply pass the string value
-   * as-is, and it will be interpreted as a string.  (Note: if
-   * the value has spaces in it, you may need to quote it depending
-   * on your shell environment).</p>
-   *
-   * @param argv Input parameters from command line
-   */
-  // J2SE does not support Xalan interpretive
-  // main -> _main
-  public static void _main(String argv[])
-  {
-
-    // Runtime.getRuntime().traceMethodCalls(false); // turns Java tracing off
-    boolean doStackDumpOnError = false;
-    boolean setQuietMode = false;
-    boolean doDiag = false;
-    String msg = null;
-    boolean isSecureProcessing = false;
-
-    // Runtime.getRuntime().traceMethodCalls(false);
-    // Runtime.getRuntime().traceInstructions(false);
-
-    /**
-     * The default diagnostic writer...
-     */
-    java.io.PrintWriter diagnosticsWriter = new PrintWriter(System.err, true);
-    java.io.PrintWriter dumpWriter = diagnosticsWriter;
-    ResourceBundle resbundle =
-      (SecuritySupport.getResourceBundle(
-        com.sun.org.apache.xml.internal.utils.res.XResourceBundle.ERROR_RESOURCES));
-    String flavor = "s2s";
-
-    if (argv.length < 1)
-    {
-      printArgOptions(resbundle);
-    }
-    else
-    {
-        // J2SE does not support Xalan interpretive
-        // false -> true
-        boolean useXSLTC = true;
-      for (int i = 0; i < argv.length; i++)
-      {
-        if ("-XSLTC".equalsIgnoreCase(argv[i]))
-        {
-          useXSLTC = true;
-        }
-      }
-
-      TransformerFactory tfactory;
-      if (useXSLTC)
-      {
-         String key = "javax.xml.transform.TransformerFactory";
-         String value = "com.sun.org.apache.xalan.internal.xsltc.trax.TransformerFactoryImpl";
-         Properties props = System.getProperties();
-         props.put(key, value);
-         System.setProperties(props);
-      }
-
-      try
-      {
-        tfactory = TransformerFactory.newInstance();
-        tfactory.setErrorListener(new DefaultErrorHandler());
-      }
-      catch (TransformerFactoryConfigurationError pfe)
-      {
-        pfe.printStackTrace(dumpWriter);
-//      "XSL Process was not successful.");
-        msg = XSLMessages.createMessage(
-            XSLTErrorResources.ER_NOT_SUCCESSFUL, null);
-        diagnosticsWriter.println(msg);
-
-        tfactory = null;  // shut up compiler
-
-        doExit(msg);
-      }
-
-      boolean formatOutput = false;
-      boolean useSourceLocation = false;
-      String inFileName = null;
-      String outFileName = null;
-      String dumpFileName = null;
-      String xslFileName = null;
-      String treedumpFileName = null;
-      // J2SE does not support Xalan interpretive
-      /*
-      PrintTraceListener tracer = null;
-      */
-      String outputType = null;
-      String media = null;
-      Vector params = new Vector();
-      boolean quietConflictWarnings = false;
-      URIResolver uriResolver = null;
-      EntityResolver entityResolver = null;
-      ContentHandler contentHandler = null;
-      int recursionLimit=-1;
-
-      for (int i = 0; i < argv.length; i++)
-      {
-        if ("-XSLTC".equalsIgnoreCase(argv[i]))
-        {
-          // The -XSLTC option has been processed.
-        }
-        // J2SE does not support Xalan interpretive
-        /*
-        else if ("-TT".equalsIgnoreCase(argv[i]))
-        {
-          if (!useXSLTC)
-          {
-            if (null == tracer)
-              tracer = new PrintTraceListener(diagnosticsWriter);
-
-            tracer.m_traceTemplates = true;
-          }
-          else
-            printInvalidXSLTCOption("-TT");
-
-          // tfactory.setTraceTemplates(true);
-        }
-        else if ("-TG".equalsIgnoreCase(argv[i]))
-        {
-          if (!useXSLTC)
-          {
-            if (null == tracer)
-              tracer = new PrintTraceListener(diagnosticsWriter);
-
-            tracer.m_traceGeneration = true;
-          }
-          else
-            printInvalidXSLTCOption("-TG");
-
-          // tfactory.setTraceSelect(true);
-        }
-        else if ("-TS".equalsIgnoreCase(argv[i]))
-        {
-          if (!useXSLTC)
-          {
-            if (null == tracer)
-              tracer = new PrintTraceListener(diagnosticsWriter);
-
-            tracer.m_traceSelection = true;
-          }
-          else
-            printInvalidXSLTCOption("-TS");
-
-          // tfactory.setTraceTemplates(true);
-        }
-        else if ("-TTC".equalsIgnoreCase(argv[i]))
-        {
-          if (!useXSLTC)
-          {
-            if (null == tracer)
-              tracer = new PrintTraceListener(diagnosticsWriter);
-
-            tracer.m_traceElements = true;
-          }
-          else
-            printInvalidXSLTCOption("-TTC");
-
-          // tfactory.setTraceTemplateChildren(true);
-        }
-        */
-        else if ("-INDENT".equalsIgnoreCase(argv[i]))
-        {
-          int indentAmount;
-
-          if (((i + 1) < argv.length) && (argv[i + 1].charAt(0) != '-'))
-          {
-            indentAmount = Integer.parseInt(argv[++i]);
-          }
-          else
-          {
-            indentAmount = 0;
-          }
-
-          // TBD:
-          // xmlProcessorLiaison.setIndent(indentAmount);
-        }
-        else if ("-IN".equalsIgnoreCase(argv[i]))
-        {
-          if (i + 1 < argv.length && argv[i + 1].charAt(0) != '-')
-            inFileName = argv[++i];
-          else
-            System.err.println(
-              XSLMessages.createMessage(
-                XSLTErrorResources.ER_MISSING_ARG_FOR_OPTION,
-                new Object[]{ "-IN" }));  //"Missing argument for);
-        }
-        else if ("-MEDIA".equalsIgnoreCase(argv[i]))
-        {
-          if (i + 1 < argv.length)
-            media = argv[++i];
-          else
-            System.err.println(
-              XSLMessages.createMessage(
-                XSLTErrorResources.ER_MISSING_ARG_FOR_OPTION,
-                new Object[]{ "-MEDIA" }));  //"Missing argument for);
-        }
-        else if ("-OUT".equalsIgnoreCase(argv[i]))
-        {
-          if (i + 1 < argv.length && argv[i + 1].charAt(0) != '-')
-            outFileName = argv[++i];
-          else
-            System.err.println(
-              XSLMessages.createMessage(
-                XSLTErrorResources.ER_MISSING_ARG_FOR_OPTION,
-                new Object[]{ "-OUT" }));  //"Missing argument for);
-        }
-        else if ("-XSL".equalsIgnoreCase(argv[i]))
-        {
-          if (i + 1 < argv.length && argv[i + 1].charAt(0) != '-')
-            xslFileName = argv[++i];
-          else
-            System.err.println(
-              XSLMessages.createMessage(
-                XSLTErrorResources.ER_MISSING_ARG_FOR_OPTION,
-                new Object[]{ "-XSL" }));  //"Missing argument for);
-        }
-        else if ("-FLAVOR".equalsIgnoreCase(argv[i]))
-        {
-          if (i + 1 < argv.length)
-          {
-            flavor = argv[++i];
-          }
-          else
-            System.err.println(
-              XSLMessages.createMessage(
-                XSLTErrorResources.ER_MISSING_ARG_FOR_OPTION,
-                new Object[]{ "-FLAVOR" }));  //"Missing argument for);
-        }
-        else if ("-PARAM".equalsIgnoreCase(argv[i]))
-        {
-          if (i + 2 < argv.length)
-          {
-            String name = argv[++i];
-
-            params.addElement(name);
-
-            String expression = argv[++i];
-
-            params.addElement(expression);
-          }
-          else
-            System.err.println(
-              XSLMessages.createMessage(
-                XSLTErrorResources.ER_MISSING_ARG_FOR_OPTION,
-                new Object[]{ "-PARAM" }));  //"Missing argument for);
-        }
-        else if ("-E".equalsIgnoreCase(argv[i]))
-        {
-
-          // TBD:
-          // xmlProcessorLiaison.setShouldExpandEntityRefs(false);
-        }
-        else if ("-V".equalsIgnoreCase(argv[i]))
-        {
-          diagnosticsWriter.println(resbundle.getString("version")  //">>>>>>> Xalan Version "
-                                    + Version.getVersion() + ", " +
-
-          /* xmlProcessorLiaison.getParserDescription()+ */
-          resbundle.getString("version2"));  // "<<<<<<<");
-        }
-        // J2SE does not support Xalan interpretive
-        /*
-        else if ("-QC".equalsIgnoreCase(argv[i]))
-        {
-          if (!useXSLTC)
-            quietConflictWarnings = true;
-          else
-            printInvalidXSLTCOption("-QC");
-        }
-        */
-        else if ("-Q".equalsIgnoreCase(argv[i]))
-        {
-          setQuietMode = true;
-        }
-        else if ("-DIAG".equalsIgnoreCase(argv[i]))
-        {
-          doDiag = true;
-        }
-        else if ("-XML".equalsIgnoreCase(argv[i]))
-        {
-          outputType = "xml";
-        }
-        else if ("-TEXT".equalsIgnoreCase(argv[i]))
-        {
-          outputType = "text";
-        }
-        else if ("-HTML".equalsIgnoreCase(argv[i]))
-        {
-          outputType = "html";
-        }
-        else if ("-EDUMP".equalsIgnoreCase(argv[i]))
-        {
-          doStackDumpOnError = true;
-
-          if (((i + 1) < argv.length) && (argv[i + 1].charAt(0) != '-'))
-          {
-            dumpFileName = argv[++i];
-          }
-        }
-        else if ("-URIRESOLVER".equalsIgnoreCase(argv[i]))
-        {
-          if (i + 1 < argv.length)
-          {
-            try
-            {
-              uriResolver = (URIResolver) ObjectFactory.newInstance(argv[++i], true);
-
-              tfactory.setURIResolver(uriResolver);
-            }
-            catch (ConfigurationError cnfe)
-            {
-                msg = XSLMessages.createMessage(
-                    XSLTErrorResources.ER_CLASS_NOT_FOUND_FOR_OPTION,
-                    new Object[]{ "-URIResolver" });
-              System.err.println(msg);
-              doExit(msg);
-            }
-          }
-          else
-          {
-            msg = XSLMessages.createMessage(
-                    XSLTErrorResources.ER_MISSING_ARG_FOR_OPTION,
-                    new Object[]{ "-URIResolver" });  //"Missing argument for);
-            System.err.println(msg);
-            doExit(msg);
-          }
-        }
-        else if ("-ENTITYRESOLVER".equalsIgnoreCase(argv[i]))
-        {
-          if (i + 1 < argv.length)
-          {
-            try
-            {
-              entityResolver = (EntityResolver) ObjectFactory.newInstance(argv[++i], true);
-            }
-            catch (ConfigurationError cnfe)
-            {
-                msg = XSLMessages.createMessage(
-                    XSLTErrorResources.ER_CLASS_NOT_FOUND_FOR_OPTION,
-                    new Object[]{ "-EntityResolver" });
-              System.err.println(msg);
-              doExit(msg);
-            }
-          }
-          else
-          {
-//            "Missing argument for);
-              msg = XSLMessages.createMessage(
-                    XSLTErrorResources.ER_MISSING_ARG_FOR_OPTION,
-                    new Object[]{ "-EntityResolver" });
-            System.err.println(msg);
-            doExit(msg);
-          }
-        }
-        else if ("-CONTENTHANDLER".equalsIgnoreCase(argv[i]))
-        {
-          if (i + 1 < argv.length)
-          {
-            try
-            {
-              contentHandler = (ContentHandler) ObjectFactory.newInstance(argv[++i], true);
-            }
-            catch (ConfigurationError cnfe)
-            {
-                msg = XSLMessages.createMessage(
-                    XSLTErrorResources.ER_CLASS_NOT_FOUND_FOR_OPTION,
-                    new Object[]{ "-ContentHandler" });
-              System.err.println(msg);
-              doExit(msg);
-            }
-          }
-          else
-          {
-//            "Missing argument for);
-              msg = XSLMessages.createMessage(
-                    XSLTErrorResources.ER_MISSING_ARG_FOR_OPTION,
-                    new Object[]{ "-ContentHandler" });
-            System.err.println(msg);
-            doExit(msg);
-          }
-        }
-        // J2SE does not support Xalan interpretive
-        /*
-        else if ("-L".equalsIgnoreCase(argv[i]))
-        {
-          if (!useXSLTC)
-            tfactory.setAttribute(XalanProperties.SOURCE_LOCATION, Boolean.TRUE);
-          else
-            printInvalidXSLTCOption("-L");
-        }
-        else if ("-INCREMENTAL".equalsIgnoreCase(argv[i]))
-        {
-          if (!useXSLTC)
-            tfactory.setAttribute
-              ("http://xml.apache.org/xalan/features/incremental",
-               java.lang.Boolean.TRUE);
-          else
-            printInvalidXSLTCOption("-INCREMENTAL");
-        }
-        else if ("-NOOPTIMIZE".equalsIgnoreCase(argv[i]))
-        {
-          // Default is true.
-          //
-          // %REVIEW% We should have a generalized syntax for negative
-          // switches...  and probably should accept the inverse even
-          // if it is the default.
-          if (!useXSLTC)
-            tfactory.setAttribute
-              ("http://xml.apache.org/xalan/features/optimize",
-               java.lang.Boolean.FALSE);
-          else
-            printInvalidXSLTCOption("-NOOPTIMIZE");
-        }
-        else if ("-RL".equalsIgnoreCase(argv[i]))
-        {
-          if (!useXSLTC)
-          {
-            if (i + 1 < argv.length)
-              recursionLimit = Integer.parseInt(argv[++i]);
-            else
-              System.err.println(
-                XSLMessages.createMessage(
-                  XSLTErrorResources.ER_MISSING_ARG_FOR_OPTION,
-                  new Object[]{ "-rl" }));  //"Missing argument for);
-          }
-          else
-          {
-            if (i + 1 < argv.length && argv[i + 1].charAt(0) != '-')
-             i++;
-
-            printInvalidXSLTCOption("-RL");
-          }
-        }
-        */
-        // Generate the translet class and optionally specify the name
-        // of the translet class.
-        else if ("-XO".equalsIgnoreCase(argv[i]))
-        {
-          if (useXSLTC)
-          {
-            if (i + 1 < argv.length && argv[i+1].charAt(0) != '-')
-            {
-              tfactory.setAttribute("generate-translet", "true");
-              tfactory.setAttribute("translet-name", argv[++i]);
-            }
-            else
-              tfactory.setAttribute("generate-translet", "true");
-          }
-          else
-          {
-            if (i + 1 < argv.length && argv[i + 1].charAt(0) != '-')
-             i++;
-            printInvalidXalanOption("-XO");
-          }
-        }
-        // Specify the destination directory for the translet classes.
-        else if ("-XD".equalsIgnoreCase(argv[i]))
-        {
-          if (useXSLTC)
-          {
-            if (i + 1 < argv.length && argv[i+1].charAt(0) != '-')
-              tfactory.setAttribute("destination-directory", argv[++i]);
-            else
-              System.err.println(
-                XSLMessages.createMessage(
-                  XSLTErrorResources.ER_MISSING_ARG_FOR_OPTION,
-                  new Object[]{ "-XD" }));  //"Missing argument for);
-
-          }
-          else
-          {
-            if (i + 1 < argv.length && argv[i + 1].charAt(0) != '-')
-             i++;
-
-            printInvalidXalanOption("-XD");
-          }
-        }
-        // Specify the jar file name which the translet classes are packaged into.
-        else if ("-XJ".equalsIgnoreCase(argv[i]))
-        {
-          if (useXSLTC)
-          {
-            if (i + 1 < argv.length && argv[i+1].charAt(0) != '-')
-            {
-              tfactory.setAttribute("generate-translet", "true");
-              tfactory.setAttribute("jar-name", argv[++i]);
-            }
-            else
-              System.err.println(
-                XSLMessages.createMessage(
-                  XSLTErrorResources.ER_MISSING_ARG_FOR_OPTION,
-                  new Object[]{ "-XJ" }));  //"Missing argument for);
-          }
-          else
-          {
-            if (i + 1 < argv.length && argv[i + 1].charAt(0) != '-')
-             i++;
-
-            printInvalidXalanOption("-XJ");
-          }
-
-        }
-        // Specify the package name prefix for the generated translet classes.
-        else if ("-XP".equalsIgnoreCase(argv[i]))
-        {
-          if (useXSLTC)
-          {
-            if (i + 1 < argv.length && argv[i+1].charAt(0) != '-')
-              tfactory.setAttribute("package-name", argv[++i]);
-            else
-              System.err.println(
-                XSLMessages.createMessage(
-                  XSLTErrorResources.ER_MISSING_ARG_FOR_OPTION,
-                  new Object[]{ "-XP" }));  //"Missing argument for);
-          }
-          else
-          {
-            if (i + 1 < argv.length && argv[i + 1].charAt(0) != '-')
-             i++;
-
-            printInvalidXalanOption("-XP");
-          }
-
-        }
-        // Enable template inlining.
-        else if ("-XN".equalsIgnoreCase(argv[i]))
-        {
-          if (useXSLTC)
-          {
-            tfactory.setAttribute("enable-inlining", "true");
-          }
-          else
-            printInvalidXalanOption("-XN");
-        }
-        // Turns on additional debugging message output
-        else if ("-XX".equalsIgnoreCase(argv[i]))
-        {
-          if (useXSLTC)
-          {
-            tfactory.setAttribute("debug", "true");
-          }
-          else
-            printInvalidXalanOption("-XX");
-        }
-        // Create the Transformer from the translet if the translet class is newer
-        // than the stylesheet.
-        else if ("-XT".equalsIgnoreCase(argv[i]))
-        {
-          if (useXSLTC)
-          {
-            tfactory.setAttribute("auto-translet", "true");
-          }
-          else
-            printInvalidXalanOption("-XT");
-        }
-        else if ("-SECURE".equalsIgnoreCase(argv[i]))
-        {
-          isSecureProcessing = true;
-          try
-          {
-            tfactory.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, true);
-          }
-          catch (TransformerConfigurationException e) {}
-        }
-        else
-          System.err.println(
-            XSLMessages.createMessage(
-              XSLTErrorResources.ER_INVALID_OPTION, new Object[]{ argv[i] }));  //"Invalid argument:);
-      }
-
-      // Print usage instructions if no xml and xsl file is specified in the command line
-      if (inFileName == null && xslFileName == null)
-      {
-          msg = resbundle.getString("xslProc_no_input");
-        System.err.println(msg);
-        doExit(msg);
-      }
-
-      // Note that there are usage cases for calling us without a -IN arg
-      // The main XSL transformation occurs here!
-      try
-      {
-        long start = System.currentTimeMillis();
-
-        if (null != dumpFileName)
-        {
-          dumpWriter = new PrintWriter(new FileWriter(dumpFileName));
-        }
-
-        Templates stylesheet = null;
-
-        if (null != xslFileName)
-        {
-          if (flavor.equals("d2d"))
-          {
-
-            // Parse in the xml data into a DOM
-            DocumentBuilderFactory dfactory =
-              DocumentBuilderFactory.newInstance();
-
-            dfactory.setNamespaceAware(true);
-
-            if (isSecureProcessing)
-            {
-              try
-              {
-                dfactory.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, true);
-              }
-              catch (ParserConfigurationException pce) {}
-            }
-
-            DocumentBuilder docBuilder = dfactory.newDocumentBuilder();
-            Node xslDOM = docBuilder.parse(new InputSource(xslFileName));
-
-            stylesheet = tfactory.newTemplates(new DOMSource(xslDOM,
-                    xslFileName));
-          }
-          else
-          {
-            // System.out.println("Calling newTemplates: "+xslFileName);
-            stylesheet = tfactory.newTemplates(new StreamSource(xslFileName));
-            // System.out.println("Done calling newTemplates: "+xslFileName);
-          }
-        }
-
-        PrintWriter resultWriter;
-        StreamResult strResult;
-
-        if (null != outFileName)
-        {
-          strResult = new StreamResult(new FileOutputStream(outFileName));
-          // One possible improvement might be to ensure this is
-          //  a valid URI before setting the systemId, but that
-          //  might have subtle changes that pre-existing users
-          //  might notice; we can think about that later -sc r1.46
-          strResult.setSystemId(outFileName);
-        }
-        else
-        {
-          strResult = new StreamResult(System.out);
-          // We used to default to incremental mode in this case.
-          // We've since decided that since the -INCREMENTAL switch is
-          // available, that default is probably not necessary nor
-          // necessarily a good idea.
-        }
-
-        SAXTransformerFactory stf = (SAXTransformerFactory) tfactory;
-
-        // J2SE does not support Xalan interpretive
-        /*
-                // This is currently controlled via TransformerFactoryImpl.
-        if (!useXSLTC && useSourceLocation)
-           stf.setAttribute(XalanProperties.SOURCE_LOCATION, Boolean.TRUE);
-        */
-
-        // Did they pass in a stylesheet, or should we get it from the
-        // document?
-        if (null == stylesheet)
-        {
-          Source source =
-            stf.getAssociatedStylesheet(new StreamSource(inFileName), media,
-                                        null, null);
-
-          if (null != source)
-            stylesheet = tfactory.newTemplates(source);
-          else
-          {
-            if (null != media)
-              throw new TransformerException(XSLMessages.createMessage(XSLTErrorResources.ER_NO_STYLESHEET_IN_MEDIA, new Object[]{inFileName, media})); //"No stylesheet found in: "
-                                            // + inFileName + ", media="
-                                            // + media);
-            else
-              throw new TransformerException(XSLMessages.createMessage(XSLTErrorResources.ER_NO_STYLESHEET_PI, new Object[]{inFileName})); //"No xml-stylesheet PI found in: "
-                                             //+ inFileName);
-          }
-        }
-
-        if (null != stylesheet)
-        {
-          Transformer transformer = flavor.equals("th") ? null : stylesheet.newTransformer();
-          transformer.setErrorListener(new DefaultErrorHandler());
-
-          // Override the output format?
-          if (null != outputType)
-          {
-            transformer.setOutputProperty(OutputKeys.METHOD, outputType);
-          }
-
-          // J2SE does not support Xalan interpretive
-          /*
-          if (transformer instanceof com.sun.org.apache.xalan.internal.transformer.TransformerImpl)
-          {
-            com.sun.org.apache.xalan.internal.transformer.TransformerImpl impl = (com.sun.org.apache.xalan.internal.transformer.TransformerImpl)transformer;
-            TraceManager tm = impl.getTraceManager();
-
-            if (null != tracer)
-              tm.addTraceListener(tracer);
-
-            impl.setQuietConflictWarnings(quietConflictWarnings);
-
-                        // This is currently controlled via TransformerFactoryImpl.
-            if (useSourceLocation)
-              impl.setProperty(XalanProperties.SOURCE_LOCATION, Boolean.TRUE);
-
-            if(recursionLimit>0)
-              impl.setRecursionLimit(recursionLimit);
-
-            // sc 28-Feb-01 if we re-implement this, please uncomment helpmsg in printArgOptions
-            // impl.setDiagnosticsOutput( setQuietMode ? null : diagnosticsWriter );
-          }
-          */
-
-          int nParams = params.size();
-
-          for (int i = 0; i < nParams; i += 2)
-          {
-            transformer.setParameter((String) params.elementAt(i),
-                                     (String) params.elementAt(i + 1));
-          }
-
-          if (uriResolver != null)
-            transformer.setURIResolver(uriResolver);
-
-          if (null != inFileName)
-          {
-            if (flavor.equals("d2d"))
-            {
-
-              // Parse in the xml data into a DOM
-              DocumentBuilderFactory dfactory =
-                DocumentBuilderFactory.newInstance();
-
-              dfactory.setCoalescing(true);
-              dfactory.setNamespaceAware(true);
-
-              if (isSecureProcessing)
-              {
-                try
-                {
-                  dfactory.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, true);
-                }
-                catch (ParserConfigurationException pce) {}
-              }
-
-              DocumentBuilder docBuilder = dfactory.newDocumentBuilder();
-
-              if (entityResolver != null)
-                docBuilder.setEntityResolver(entityResolver);
-
-              Node xmlDoc = docBuilder.parse(new InputSource(inFileName));
-              Document doc = docBuilder.newDocument();
-              org.w3c.dom.DocumentFragment outNode =
-                doc.createDocumentFragment();
-
-              transformer.transform(new DOMSource(xmlDoc, inFileName),
-                                    new DOMResult(outNode));
-
-              // Now serialize output to disk with identity transformer
-              Transformer serializer = stf.newTransformer();
-              serializer.setErrorListener(new DefaultErrorHandler());
-
-              Properties serializationProps =
-                stylesheet.getOutputProperties();
-
-              serializer.setOutputProperties(serializationProps);
-
-              if (contentHandler != null)
-              {
-                SAXResult result = new SAXResult(contentHandler);
-
-                serializer.transform(new DOMSource(outNode), result);
-              }
-              else
-                serializer.transform(new DOMSource(outNode), strResult);
-            }
-            else if (flavor.equals("th"))
-            {
-              for (int i = 0; i < 1; i++) // Loop for diagnosing bugs with inconsistent behavior
-              {
-              // System.out.println("Testing the TransformerHandler...");
-
-              XMLReader reader = null;
-
-              // Use JAXP1.1 ( if possible )
-              try
-              {
-                javax.xml.parsers.SAXParserFactory factory =
-                  javax.xml.parsers.SAXParserFactory.newInstance();
-
-                factory.setNamespaceAware(true);
-
-                if (isSecureProcessing)
-                {
-                  try
-                  {
-                    factory.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, true);
-                  }
-                  catch (org.xml.sax.SAXException se) {}
-                }
-
-                javax.xml.parsers.SAXParser jaxpParser =
-                  factory.newSAXParser();
-
-                reader = jaxpParser.getXMLReader();
-              }
-              catch (javax.xml.parsers.ParserConfigurationException ex)
-              {
-                throw new org.xml.sax.SAXException(ex);
-              }
-              catch (javax.xml.parsers.FactoryConfigurationError ex1)
-              {
-                throw new org.xml.sax.SAXException(ex1.toString());
-              }
-              catch (NoSuchMethodError ex2){}
-              catch (AbstractMethodError ame){}
-
-              if (null == reader)
-              {
-                reader = XMLReaderFactory.createXMLReader();
-              }
-
-              // J2SE does not support Xalan interpretive
-              /*
-              if (!useXSLTC)
-                stf.setAttribute(com.sun.org.apache.xalan.internal.processor.TransformerFactoryImpl.FEATURE_INCREMENTAL,
-                   Boolean.TRUE);
-              */
-
-              TransformerHandler th = stf.newTransformerHandler(stylesheet);
-
-              reader.setContentHandler(th);
-              reader.setDTDHandler(th);
-
-              if(th instanceof org.xml.sax.ErrorHandler)
-                reader.setErrorHandler((org.xml.sax.ErrorHandler)th);
-
-              try
-              {
-                reader.setProperty(
-                  "http://xml.org/sax/properties/lexical-handler", th);
-              }
-              catch (org.xml.sax.SAXNotRecognizedException e){}
-              catch (org.xml.sax.SAXNotSupportedException e){}
-              try
-              {
-                reader.setFeature("http://xml.org/sax/features/namespace-prefixes",
-                                  true);
-              } catch (org.xml.sax.SAXException se) {}
-
-              th.setResult(strResult);
-
-              reader.parse(new InputSource(inFileName));
-              }
-            }
-            else
-            {
-              if (entityResolver != null)
-              {
-                XMLReader reader = null;
-
-                // Use JAXP1.1 ( if possible )
-                try
-                {
-                  javax.xml.parsers.SAXParserFactory factory =
-                    javax.xml.parsers.SAXParserFactory.newInstance();
-
-                  factory.setNamespaceAware(true);
-
-                  if (isSecureProcessing)
-                  {
-                    try
-                    {
-                      factory.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, true);
-                    }
-                    catch (org.xml.sax.SAXException se) {}
-                  }
-
-                  javax.xml.parsers.SAXParser jaxpParser =
-                    factory.newSAXParser();
-
-                  reader = jaxpParser.getXMLReader();
-                }
-                catch (javax.xml.parsers.ParserConfigurationException ex)
-                {
-                  throw new org.xml.sax.SAXException(ex);
-                }
-                catch (javax.xml.parsers.FactoryConfigurationError ex1)
-                {
-                  throw new org.xml.sax.SAXException(ex1.toString());
-                }
-                catch (NoSuchMethodError ex2){}
-                catch (AbstractMethodError ame){}
-
-                if (null == reader)
-                {
-                  reader = XMLReaderFactory.createXMLReader();
-                }
-
-                reader.setEntityResolver(entityResolver);
-
-                if (contentHandler != null)
-                {
-                  SAXResult result = new SAXResult(contentHandler);
-
-                  transformer.transform(
-                    new SAXSource(reader, new InputSource(inFileName)),
-                    result);
-                }
-                else
-                {
-                  transformer.transform(
-                    new SAXSource(reader, new InputSource(inFileName)),
-                    strResult);
-                }
-              }
-              else if (contentHandler != null)
-              {
-                SAXResult result = new SAXResult(contentHandler);
-
-                transformer.transform(new StreamSource(inFileName), result);
-              }
-              else
-              {
-                // System.out.println("Starting transform");
-                transformer.transform(new StreamSource(inFileName),
-                                      strResult);
-                // System.out.println("Done with transform");
-              }
-            }
-          }
-          else
-          {
-            StringReader reader =
-              new StringReader("<?xml version=\"1.0\"?> <doc/>");
-
-            transformer.transform(new StreamSource(reader), strResult);
-          }
-        }
-        else
-        {
-//          "XSL Process was not successful.");
-            msg = XSLMessages.createMessage(
-                XSLTErrorResources.ER_NOT_SUCCESSFUL, null);
-          diagnosticsWriter.println(msg);
-          doExit(msg);
-        }
-
-        // close output streams
-        if (null != outFileName && strResult!=null)
-        {
-          java.io.OutputStream out = strResult.getOutputStream();
-          java.io.Writer writer = strResult.getWriter();
-          try
-          {
-            if (out != null) out.close();
-            if (writer != null) writer.close();
-          }
-          catch(java.io.IOException ie) {}
-        }
-
-        long stop = System.currentTimeMillis();
-        long millisecondsDuration = stop - start;
-
-        if (doDiag)
-        {
-                Object[] msgArgs = new Object[]{ inFileName, xslFileName, new Long(millisecondsDuration) };
-            msg = XSLMessages.createMessage("diagTiming", msgArgs);
-                diagnosticsWriter.println('\n');
-                diagnosticsWriter.println(msg);
-        }
-
-      }
-      catch (Throwable throwable)
-      {
-        while (throwable
-               instanceof com.sun.org.apache.xml.internal.utils.WrappedRuntimeException)
-        {
-          throwable =
-            ((com.sun.org.apache.xml.internal.utils.WrappedRuntimeException) throwable).getException();
-        }
-
-        if ((throwable instanceof NullPointerException)
-                || (throwable instanceof ClassCastException))
-          doStackDumpOnError = true;
-
-        diagnosticsWriter.println();
-
-        if (doStackDumpOnError)
-          throwable.printStackTrace(dumpWriter);
-        else
-        {
-          DefaultErrorHandler.printLocation(diagnosticsWriter, throwable);
-          diagnosticsWriter.println(
-            XSLMessages.createMessage(XSLTErrorResources.ER_XSLT_ERROR, null)
-            + " (" + throwable.getClass().getName() + "): "
-            + throwable.getMessage());
-        }
-
-        // diagnosticsWriter.println(XSLMessages.createMessage(XSLTErrorResources.ER_NOT_SUCCESSFUL, null)); //"XSL Process was not successful.");
-        if (null != dumpFileName)
-        {
-          dumpWriter.close();
-        }
-
-        doExit(throwable.getMessage());
-      }
-
-      if (null != dumpFileName)
-      {
-        dumpWriter.close();
-      }
-
-      if (null != diagnosticsWriter)
-      {
-
-        // diagnosticsWriter.close();
-      }
-
-      // if(!setQuietMode)
-      //  diagnosticsWriter.println(resbundle.getString("xsldone")); //"Xalan: done");
-      // else
-      // diagnosticsWriter.println("");  //"Xalan: done");
-    }
-  }
-
-  /** It is _much_ easier to debug under VJ++ if I can set a single breakpoint
-   * before this blows itself out of the water...
-   * (I keep checking this in, it keeps vanishing. Grr!)
-   * */
-  static void doExit(String msg)
-  {
-    throw new RuntimeException(msg);
-  }
-
-  /**
-   * Wait for a return key to continue
-   *
-   * @param resbundle The resource bundle
-   */
-  private static void waitForReturnKey(ResourceBundle resbundle)
-  {
-    System.out.println(resbundle.getString("xslProc_return_to_continue"));
-    try
-    {
-      while (System.in.read() != '\n');
-    }
-    catch (java.io.IOException e) { }
-  }
-
-  /**
-   * Print a message if an option cannot be used with -XSLTC.
-   *
-   * @param option The option String
-   */
-  private static void printInvalidXSLTCOption(String option)
-  {
-    System.err.println(XSLMessages.createMessage("xslProc_invalid_xsltc_option", new Object[]{option}));
-  }
-
-  /**
-   * Print a message if an option can only be used with -XSLTC.
-   *
-   * @param option The option String
-   */
-  private static void printInvalidXalanOption(String option)
-  {
-    System.err.println(XSLMessages.createMessage("xslProc_invalid_xalan_option", new Object[]{option}));
-  }
-}
--- a/jaxp/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/impl/Version.java	Thu Apr 09 12:29:31 2015 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,101 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999-2002 The Apache Software Foundation.  All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xerces" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, International
- * Business Machines, Inc., http://www.apache.org.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-
-package com.sun.org.apache.xerces.internal.impl;
-
-/**
- * This class defines the version number of the parser.
- *
- */
-public class Version {
-
-    //
-    // Data
-    //
-
-    /** Version string.
-     * @deprecated  getVersion() should be used instead.  */
-    public static final String fVersion = getVersion();
-
-    private static final String fImmutableVersion = "Xerces-J 2.7.1";
-
-    // public methods
-
-    /* Print out the version information.
-     * @return the version of the parser.
-     */
-    public static String getVersion() {
-        return fImmutableVersion;
-    } // getVersion():  String
-
-    //
-    // MAIN
-    //
-
-    /**
-     * Prints out the version number to System.out. This is needed
-     * for the build system.
-     */
-    public static void main(String argv[]) {
-        System.out.println(fVersion);
-    }
-
-} // class Version
--- a/jaxp/test/javax/xml/jaxp/internaltest/javax/xml/common/bug6979306/Bug6979306Test.java	Thu Apr 09 12:29:31 2015 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,43 +0,0 @@
-/*
- * Copyright (c) 2014, 2015, 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
- * @modules java.xml/com.sun.org.apache.xerces.internal.impl
- *          java.xml/com.sun.org.apache.xalan.internal
- * @bug 6979306
- * @summary Test JAXP component version.
- */
-
-import org.testng.annotations.Test;
-
-public class Bug6979306Test {
-
-    @Test
-    public void test() {
-        String[] input = {};
-        com.sun.org.apache.xerces.internal.impl.Version.main(input);
-        com.sun.org.apache.xalan.internal.Version._main(input);
-    }
-
-}
--- a/jaxp/test/javax/xml/jaxp/internaltest/javax/xml/transform/cli/CLITest.java	Thu Apr 09 12:29:31 2015 +0200
+++ b/jaxp/test/javax/xml/jaxp/internaltest/javax/xml/transform/cli/CLITest.java	Mon Aug 17 12:45:16 2015 +0300
@@ -23,7 +23,7 @@
 
 /*
  * @test
- * @modules java.xml/com.sun.org.apache.xalan.internal.xslt
+ * @modules java.xml/com.sun.org.apache.xml.internal.utils
  * @summary Test internal transform CLI.
  */
 
@@ -37,7 +37,7 @@
         try {
             String[] args = new String[] { "-XSLTC", "-XSL", getClass().getResource("tigertest.xsl").toString(), "-IN",
                     getClass().getResource("tigertest-in.xml").toString(), };
-            com.sun.org.apache.xalan.internal.xslt.Process._main(args);
+            ProcessXSLT.main(args);
         } catch (Exception e) {
             Assert.fail(e.getMessage());
         }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jaxp/test/javax/xml/jaxp/internaltest/javax/xml/transform/cli/ProcessXSLT.java	Mon Aug 17 12:45:16 2015 +0300
@@ -0,0 +1,913 @@
+/*
+ * reserved comment block
+ * DO NOT REMOVE OR ALTER!
+ */
+/*
+ * Copyright 1999-2004 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+/*
+ * $Id: Process.java,v 1.2.4.2 2005/09/15 18:21:57 jeffsuttor Exp $
+ */
+
+// This file is a copied and modified version of
+// com/sun/org/apache/xalan/internal/xslt/Process.java
+// which has been modified to only use public exported APIs.
+// The only adherence is with
+// com.sun.org.apache.xml.internal.utils.DefaultErrorHandler
+// which we try to instantiate using reflection, as that class
+// can do a better job at reporting error location.
+// We however don't have a hard dependency on it. We will use
+// our own ErrorHandler if the default one is not accessible.
+//
+import java.io.FileOutputStream;
+import java.io.FileWriter;
+import java.io.PrintWriter;
+import java.io.StringReader;
+import java.util.Properties;
+
+import javax.xml.XMLConstants;
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+import javax.xml.parsers.ParserConfigurationException;
+import javax.xml.transform.OutputKeys;
+import javax.xml.transform.Source;
+import javax.xml.transform.Templates;
+import javax.xml.transform.Transformer;
+import javax.xml.transform.TransformerConfigurationException;
+import javax.xml.transform.TransformerException;
+import javax.xml.transform.TransformerFactory;
+import javax.xml.transform.TransformerFactoryConfigurationError;
+import javax.xml.transform.URIResolver;
+import javax.xml.transform.dom.DOMResult;
+import javax.xml.transform.dom.DOMSource;
+import javax.xml.transform.sax.SAXResult;
+import javax.xml.transform.sax.SAXSource;
+import javax.xml.transform.sax.SAXTransformerFactory;
+import javax.xml.transform.sax.TransformerHandler;
+import javax.xml.transform.stream.StreamResult;
+import javax.xml.transform.stream.StreamSource;
+import java.lang.reflect.Constructor;
+import java.lang.reflect.Method;
+import java.util.ArrayList;
+import java.util.List;
+import javax.xml.transform.ErrorListener;
+import javax.xml.transform.SourceLocator;
+
+import org.w3c.dom.Document;
+import org.w3c.dom.Node;
+
+import org.xml.sax.ContentHandler;
+import org.xml.sax.EntityResolver;
+import org.xml.sax.ErrorHandler;
+import org.xml.sax.InputSource;
+import org.xml.sax.SAXException;
+import org.xml.sax.SAXParseException;
+import org.xml.sax.XMLReader;
+import org.xml.sax.helpers.XMLReaderFactory;
+
+/**
+ * The main() method handles the Xalan command-line interface.
+ */
+public class ProcessXSLT
+{
+
+    /**
+     * Prints argument options.
+     *
+     */
+    protected static void printArgOptions() {
+        System.out.println("xslproc options: ");
+        System.out.println("\n\t\t\t" + "-Common Options-" + "\n");
+        System.out.println("   [-XSLTC (use XSLTC for transformation)]");  //"    [-XSLTC (use XSLTC for transformation)]
+        System.out.println("   [-IN inputXMLURL]");  //"    [-IN inputXMLURL]");
+        System.out.println("   [-XSL XSLTransformationURL]");  //"   [-XSL XSLTransformationURL]");
+        System.out.println("   [-OUT outputFileName]");  //"   [-OUT outputFileName]");
+
+        System.out.println("   [-E (Do not expand entity refs)]");  //"   [-V (Version info)]");
+
+        System.out.println("   [-EDUMP {optional filename} (Do stackdump on error.)]");  //"   [-EDUMP {optional filename} (Do stackdump on error.)]");
+        System.out.println("   [-XML (Use XML formatter and add XML header.)]");  //"   [-XML (Use XML formatter and add XML header.)]");
+        System.out.println("   [-TEXT (Use simple Text formatter.)]");  //"   [-TEXT (Use simple Text formatter.)]");
+        System.out.println("   [-HTML (Use HTML formatter.)]");  //"   [-HTML (Use HTML formatter.)]");
+        System.out.println( "   [-PARAM name expression (Set a stylesheet parameter)]");  //"   [-PARAM name expression (Set a stylesheet parameter)]");
+
+        System.out.println("   [-MEDIA mediaType (use media attribute to find stylesheet associated with a document.)]");
+        System.out.println("   [-FLAVOR flavorName (Explicitly use s2s=SAX or d2d=DOM to do transform.)] ");
+        System.out.println("   [-DIAG (Print overall milliseconds transform took.)]");
+        System.out.println("   [-URIRESOLVER full class name (URIResolver to be used to resolve URIs)]");  //"   [-URIRESOLVER full class name (URIResolver to be used to resolve URIs)]");
+        System.out.println("   [-ENTITYRESOLVER full class name (EntityResolver to be used to resolve entities)]");  //"   [-ENTITYRESOLVER full class name (EntityResolver to be used to resolve entities)]");
+        waitForReturnKey();
+        System.out.println("   [-CONTENTHANDLER full class name (ContentHandler to be used to serialize output)]");  //"   [-CONTENTHANDLER full class name (ContentHandler to be used to serialize output)]");
+        System.out.println("   [-SECURE (set the secure processing feature to true.)]"); //"   [-SECURE (set the secure processing feature to true)]");
+
+
+        System.out.println("\n\t\t\t"+  "-Options for XSLTC-" + "\n");
+        System.out.println("   [-XO [transletName] (assign the name to the generated translet)]");
+        waitForReturnKey();
+        System.out.println("   [-XD destinationDirectory (specify a destination directory for translet)]");
+        System.out.println("   [-XJ jarfile (packages translet classes into a jar file of name <jarfile>)]");
+        System.out.println("   [-XP package (specifies a package name prefix for all generated translet classes)]");
+        System.out.println("   [-XN (enables template inlining)]");
+        System.out.println("   [-XX (turns on additional debugging message output)]");
+        System.out.println("   [-XT (use translet to transform if possible)]");
+    }
+
+  /**
+   * Command line interface to transform an XML document according to
+   * the instructions found in an XSL stylesheet.
+   * <p>The Process class provides basic functionality for
+   * performing transformations from the command line.  To see a
+   * list of arguments supported, call with zero arguments.</p>
+   * <p>To set stylesheet parameters from the command line, use
+   * <code>-PARAM name expression</code>. If you want to set the
+   * parameter to a string value, simply pass the string value
+   * as-is, and it will be interpreted as a string.  (Note: if
+   * the value has spaces in it, you may need to quote it depending
+   * on your shell environment).</p>
+   *
+   * @param argv Input parameters from command line
+   */
+    public static void main(String argv[]) {
+
+        // Runtime.getRuntime().traceMethodCalls(false); // turns Java tracing off
+        boolean doStackDumpOnError = false;
+        boolean doDiag = false;
+        boolean setQuietMode = false;
+        String msg = null;
+        boolean isSecureProcessing = false;
+
+        // Runtime.getRuntime().traceMethodCalls(false);
+        // Runtime.getRuntime().traceInstructions(false);
+        /**
+         * The default diagnostic writer...
+         */
+        java.io.PrintWriter diagnosticsWriter = new PrintWriter(System.err, true);
+        java.io.PrintWriter dumpWriter = diagnosticsWriter;
+        String flavor = "s2s";
+
+        if (argv.length < 1) {
+            printArgOptions();
+        } else {
+             // J2SE does not support Xalan interpretive
+            // false -> true
+            boolean useXSLTC = true;
+            for (int i = 0; i < argv.length; i++) {
+                if ("-XSLTC".equalsIgnoreCase(argv[i])) {
+                    useXSLTC = true;
+                }
+            }
+
+            TransformerFactory tfactory;
+            if (useXSLTC) {
+                String key = "javax.xml.transform.TransformerFactory";
+                String value = "com.sun.org.apache.xalan.internal.xsltc.trax.TransformerFactoryImpl";
+                Properties props = System.getProperties();
+                props.put(key, value);
+                System.setProperties(props);
+            }
+
+            try {
+                tfactory = TransformerFactory.newInstance();
+                tfactory.setErrorListener(createDefaultErrorListener());
+            } catch (TransformerFactoryConfigurationError pfe) {
+                pfe.printStackTrace(dumpWriter);
+                //      "XSL Process was not successful.");
+                msg = "XSL Process was not successful.";
+                diagnosticsWriter.println(msg);
+
+                tfactory = null;  // shut up compiler
+
+                doExit(msg);
+            }
+
+            boolean formatOutput = false;
+            boolean useSourceLocation = false;
+            String inFileName = null;
+            String outFileName = null;
+            String dumpFileName = null;
+            String xslFileName = null;
+            String treedumpFileName = null;
+            String outputType = null;
+            String media = null;
+            List<String> params = new ArrayList<>();
+            boolean quietConflictWarnings = false;
+            URIResolver uriResolver = null;
+            EntityResolver entityResolver = null;
+            ContentHandler contentHandler = null;
+            int recursionLimit = -1;
+
+            for (int i = 0; i < argv.length; i++) {
+                if ("-XSLTC".equalsIgnoreCase(argv[i])) {
+                    // The -XSLTC option has been processed.
+                } // J2SE does not support Xalan interpretive
+                else if ("-INDENT".equalsIgnoreCase(argv[i])) {
+                    int indentAmount;
+
+                    if (((i + 1) < argv.length) && (argv[i + 1].charAt(0) != '-')) {
+                        indentAmount = Integer.parseInt(argv[++i]);
+                    } else {
+                        indentAmount = 0;
+                    }
+
+                } else if ("-IN".equalsIgnoreCase(argv[i])) {
+                    if (i + 1 < argv.length && argv[i + 1].charAt(0) != '-') {
+                        inFileName = argv[++i];
+                    } else {
+                        System.err.println("Missing argument for -IN");
+                    }
+                } else if ("-MEDIA".equalsIgnoreCase(argv[i])) {
+                    if (i + 1 < argv.length) {
+                        media = argv[++i];
+                    } else {
+                        System.err.println("Missing argument for -MEDIA");  //"Missing argument for);
+                    }
+                } else if ("-OUT".equalsIgnoreCase(argv[i])) {
+                    if (i + 1 < argv.length && argv[i + 1].charAt(0) != '-') {
+                        outFileName = argv[++i];
+                    } else {
+                        System.err.println("Missing argument for -OUT");  //"Missing argument for);
+                    }
+                } else if ("-XSL".equalsIgnoreCase(argv[i])) {
+                    if (i + 1 < argv.length && argv[i + 1].charAt(0) != '-') {
+                        xslFileName = argv[++i];
+                    } else {
+                        System.err.println("Missing argument for -XSL");  //"Missing argument for);
+                    }
+                } else if ("-FLAVOR".equalsIgnoreCase(argv[i])) {
+                    if (i + 1 < argv.length) {
+                        flavor = argv[++i];
+                    } else {
+                        System.err.println("Missing argument for -FLAVOR");  //"Missing argument for);
+                    }
+                } else if ("-PARAM".equalsIgnoreCase(argv[i])) {
+                    if (i + 2 < argv.length) {
+                        String name = argv[++i];
+
+                        params.add(name);
+
+                        String expression = argv[++i];
+
+                        params.add(expression);
+                    } else {
+                        System.err.println("Missing argument for -PARAM");  //"Missing argument for);
+                    }
+                } else if ("-E".equalsIgnoreCase(argv[i])) {
+
+                } else if ("-V".equalsIgnoreCase(argv[i])) {
+                    diagnosticsWriter.println(">>>>>>> Java Version "
+                            + System.getProperty("java.version") + ", "
+                            + /* xmlProcessorLiaison.getParserDescription()+ */ "<<<<<<<");
+                } // J2SE does not support Xalan interpretive
+                /*
+                 else if ("-QC".equalsIgnoreCase(argv[i]))
+                 {
+                 if (!useXSLTC)
+                 quietConflictWarnings = true;
+                 else
+                 printInvalidXSLTCOption("-QC");
+                 }
+                 */ else if ("-Q".equalsIgnoreCase(argv[i])) {
+                    setQuietMode = true;
+                } else if ("-DIAG".equalsIgnoreCase(argv[i])) {
+                    doDiag = true;
+                } else if ("-XML".equalsIgnoreCase(argv[i])) {
+                    outputType = "xml";
+                } else if ("-TEXT".equalsIgnoreCase(argv[i])) {
+                    outputType = "text";
+                } else if ("-HTML".equalsIgnoreCase(argv[i])) {
+                    outputType = "html";
+                } else if ("-EDUMP".equalsIgnoreCase(argv[i])) {
+                    doStackDumpOnError = true;
+
+                    if (((i + 1) < argv.length) && (argv[i + 1].charAt(0) != '-')) {
+                        dumpFileName = argv[++i];
+                    }
+                } else if ("-URIRESOLVER".equalsIgnoreCase(argv[i])) {
+                    if (i + 1 < argv.length) {
+                        try {
+                            Class<?> uriResolverClass = Class.forName(argv[++i]);
+                            Constructor<?> ctor = uriResolverClass.getConstructor();
+                            ctor.setAccessible(true);
+                            uriResolver = (URIResolver) ctor.newInstance();
+
+                            tfactory.setURIResolver(uriResolver);
+                        } catch (Throwable cnfe) {
+                            msg = "Class not found for option -URIResolver";
+                            System.err.println(msg);
+                            doExit(msg);
+                        }
+                    } else {
+                        msg = "Missing argument for -URIResolver";
+                        System.err.println(msg);  //"Missing argument for);
+                        doExit(msg);
+                    }
+                } else if ("-ENTITYRESOLVER".equalsIgnoreCase(argv[i])) {
+                    if (i + 1 < argv.length) {
+                        try {
+                            Class<?> entityResolverClass = Class.forName(argv[++i]);
+                            Constructor<?> ctor = entityResolverClass.getConstructor();
+                            ctor.setAccessible(true);
+                            entityResolver = (EntityResolver) ctor.newInstance();
+                        } catch (Throwable cnfe) {
+                            msg = "Class not found for option -EntityResolver";
+                            System.err.println(msg);
+                            doExit(msg);
+                        }
+                    } else {
+                        //            "Missing argument for);
+                        msg = "Missing argument for -EntityResolver";
+                        System.err.println(msg);
+                        doExit(msg);
+                    }
+                } else if ("-CONTENTHANDLER".equalsIgnoreCase(argv[i])) {
+                    if (i + 1 < argv.length) {
+                        try {
+                            Class<?> contentHandlerClass = Class.forName(argv[++i]);
+                            Constructor<?> ctor = contentHandlerClass.getConstructor();
+                            ctor.setAccessible(true);
+                            contentHandler = (ContentHandler) ctor.newInstance();
+                        } catch (Throwable cnfe) {
+                            msg = "Class not found for option -ContentHandler";
+                            System.err.println(msg);
+                            doExit(msg);
+                        }
+                    } else {
+                        //            "Missing argument for);
+                        msg = "Missing argument for -ContentHandler";
+                        System.err.println(msg);
+                        doExit(msg);
+                    }
+                } else if ("-XO".equalsIgnoreCase(argv[i])) {
+                    if (useXSLTC) {
+                        if (i + 1 < argv.length && argv[i + 1].charAt(0) != '-') {
+                            tfactory.setAttribute("generate-translet", "true");
+                            tfactory.setAttribute("translet-name", argv[++i]);
+                        } else {
+                            tfactory.setAttribute("generate-translet", "true");
+                        }
+                    } else {
+                        if (i + 1 < argv.length && argv[i + 1].charAt(0) != '-') {
+                            i++;
+                        }
+                        printInvalidXalanOption("-XO");
+                    }
+                } // Specify the destination directory for the translet classes.
+                else if ("-XD".equalsIgnoreCase(argv[i])) {
+                    if (useXSLTC) {
+                        if (i + 1 < argv.length && argv[i + 1].charAt(0) != '-') {
+                            tfactory.setAttribute("destination-directory", argv[++i]);
+                        } else {
+                            System.err.println("Missing argument for -XD");  //"Missing argument for);
+                        }
+                    } else {
+                        if (i + 1 < argv.length && argv[i + 1].charAt(0) != '-') {
+                            i++;
+                        }
+
+                        printInvalidXalanOption("-XD");
+                    }
+                } // Specify the jar file name which the translet classes are packaged into.
+                else if ("-XJ".equalsIgnoreCase(argv[i])) {
+                    if (useXSLTC) {
+                        if (i + 1 < argv.length && argv[i + 1].charAt(0) != '-') {
+                            tfactory.setAttribute("generate-translet", "true");
+                            tfactory.setAttribute("jar-name", argv[++i]);
+                        } else {
+                            System.err.println("Missing argument for -XJ");  //"Missing argument for);
+                        }
+                    } else {
+                        if (i + 1 < argv.length && argv[i + 1].charAt(0) != '-') {
+                            i++;
+                        }
+
+                        printInvalidXalanOption("-XJ");
+                    }
+
+                } // Specify the package name prefix for the generated translet classes.
+                else if ("-XP".equalsIgnoreCase(argv[i])) {
+                    if (useXSLTC) {
+                        if (i + 1 < argv.length && argv[i + 1].charAt(0) != '-') {
+                            tfactory.setAttribute("package-name", argv[++i]);
+                        } else {
+                            System.err.println("Missing argument for -XP");  //"Missing argument for);
+                        }
+                    } else {
+                        if (i + 1 < argv.length && argv[i + 1].charAt(0) != '-') {
+                            i++;
+                        }
+
+                        printInvalidXalanOption("-XP");
+                    }
+
+                } // Enable template inlining.
+                else if ("-XN".equalsIgnoreCase(argv[i])) {
+                    if (useXSLTC) {
+                        tfactory.setAttribute("enable-inlining", "true");
+                    } else {
+                        printInvalidXalanOption("-XN");
+                    }
+                } // Turns on additional debugging message output
+                else if ("-XX".equalsIgnoreCase(argv[i])) {
+                    if (useXSLTC) {
+                        tfactory.setAttribute("debug", "true");
+                    } else {
+                        printInvalidXalanOption("-XX");
+                    }
+                } // Create the Transformer from the translet if the translet class is newer
+                // than the stylesheet.
+                else if ("-XT".equalsIgnoreCase(argv[i])) {
+                    if (useXSLTC) {
+                        tfactory.setAttribute("auto-translet", "true");
+                    } else {
+                        printInvalidXalanOption("-XT");
+                    }
+                } else if ("-SECURE".equalsIgnoreCase(argv[i])) {
+                    isSecureProcessing = true;
+                    try {
+                        tfactory.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, true);
+                    } catch (TransformerConfigurationException e) {
+                    }
+                } else {
+                    System.err.println("Invalid argument: " + argv[i]);  //"Invalid argument:);
+                }
+            }
+
+            // Print usage instructions if no xml and xsl file is specified in the command line
+            if (inFileName == null && xslFileName == null) {
+                msg = "Error: No stylesheet or input xml is specified. Run this command without any option for usage instructions.";
+                System.err.println(msg);
+                doExit(msg);
+            }
+
+      // Note that there are usage cases for calling us without a -IN arg
+            // The main XSL transformation occurs here!
+            try {
+                long start = System.currentTimeMillis();
+
+                if (null != dumpFileName) {
+                    dumpWriter = new PrintWriter(new FileWriter(dumpFileName));
+                }
+
+                Templates stylesheet = null;
+
+                if (null != xslFileName) {
+                    if (flavor.equals("d2d")) {
+
+                        // Parse in the xml data into a DOM
+                        DocumentBuilderFactory dfactory
+                                = DocumentBuilderFactory.newInstance();
+
+                        dfactory.setNamespaceAware(true);
+
+                        if (isSecureProcessing) {
+                            try {
+                                dfactory.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, true);
+                            } catch (ParserConfigurationException pce) {
+                            }
+                        }
+
+                        DocumentBuilder docBuilder = dfactory.newDocumentBuilder();
+                        Node xslDOM = docBuilder.parse(new InputSource(xslFileName));
+
+                        stylesheet = tfactory.newTemplates(new DOMSource(xslDOM,
+                                xslFileName));
+                    } else {
+                        // System.out.println("Calling newTemplates: "+xslFileName);
+                        stylesheet = tfactory.newTemplates(new StreamSource(xslFileName));
+                        // System.out.println("Done calling newTemplates: "+xslFileName);
+                    }
+                }
+
+                PrintWriter resultWriter;
+                StreamResult strResult;
+
+                if (null != outFileName) {
+                    strResult = new StreamResult(new FileOutputStream(outFileName));
+                    // One possible improvement might be to ensure this is
+                    //  a valid URI before setting the systemId, but that
+                    //  might have subtle changes that pre-existing users
+                    //  might notice; we can think about that later -sc r1.46
+                    strResult.setSystemId(outFileName);
+                } else {
+                    strResult = new StreamResult(System.out);
+                    // We used to default to incremental mode in this case.
+                    // We've since decided that since the -INCREMENTAL switch is
+                    // available, that default is probably not necessary nor
+                    // necessarily a good idea.
+                }
+
+                SAXTransformerFactory stf = (SAXTransformerFactory) tfactory;
+
+                // Did they pass in a stylesheet, or should we get it from the
+                // document?
+                if (null == stylesheet) {
+                    Source source
+                            = stf.getAssociatedStylesheet(new StreamSource(inFileName), media,
+                                    null, null);
+
+                    if (null != source) {
+                        stylesheet = tfactory.newTemplates(source);
+                    } else {
+                        if (null != media) {
+                            throw new TransformerException("No stylesheet found in:  "
+                                    + inFileName + ", media=" + media); //"No stylesheet found in: "
+                        } // + inFileName + ", media="
+                        // + media);
+                        else {
+                            throw new TransformerException("No xml-stylesheet PI found in: " + inFileName); //"No xml-stylesheet PI found in: "
+                        }                                             //+ inFileName);
+                    }
+                }
+
+                if (null != stylesheet) {
+                    Transformer transformer = flavor.equals("th") ? null : stylesheet.newTransformer();
+                    transformer.setErrorListener(createDefaultErrorListener());
+
+                    // Override the output format?
+                    if (null != outputType) {
+                        transformer.setOutputProperty(OutputKeys.METHOD, outputType);
+                    }
+
+                    int nParams = params.size();
+
+                    for (int i = 0; i < nParams; i += 2) {
+                        transformer.setParameter((String) params.get(i),
+                                (String) params.get(i + 1));
+                    }
+
+                    if (uriResolver != null) {
+                        transformer.setURIResolver(uriResolver);
+                    }
+
+                    if (null != inFileName) {
+                        if (flavor.equals("d2d")) {
+
+                            // Parse in the xml data into a DOM
+                            DocumentBuilderFactory dfactory
+                                    = DocumentBuilderFactory.newInstance();
+
+                            dfactory.setCoalescing(true);
+                            dfactory.setNamespaceAware(true);
+
+                            if (isSecureProcessing) {
+                                try {
+                                    dfactory.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, true);
+                                } catch (ParserConfigurationException pce) {
+                                }
+                            }
+
+                            DocumentBuilder docBuilder = dfactory.newDocumentBuilder();
+
+                            if (entityResolver != null) {
+                                docBuilder.setEntityResolver(entityResolver);
+                            }
+
+                            Node xmlDoc = docBuilder.parse(new InputSource(inFileName));
+                            Document doc = docBuilder.newDocument();
+                            org.w3c.dom.DocumentFragment outNode
+                                    = doc.createDocumentFragment();
+
+                            transformer.transform(new DOMSource(xmlDoc, inFileName),
+                                    new DOMResult(outNode));
+
+                            // Now serialize output to disk with identity transformer
+                            Transformer serializer = stf.newTransformer();
+                            serializer.setErrorListener(createDefaultErrorListener());
+
+                            Properties serializationProps
+                                    = stylesheet.getOutputProperties();
+
+                            serializer.setOutputProperties(serializationProps);
+
+                            if (contentHandler != null) {
+                                SAXResult result = new SAXResult(contentHandler);
+
+                                serializer.transform(new DOMSource(outNode), result);
+                            } else {
+                                serializer.transform(new DOMSource(outNode), strResult);
+                            }
+                        } else if (flavor.equals("th")) {
+                            for (int i = 0; i < 1; i++) // Loop for diagnosing bugs with inconsistent behavior
+                            {
+                                // System.out.println("Testing the TransformerHandler...");
+
+                                XMLReader reader = null;
+
+                                // Use JAXP1.1 ( if possible )
+                                try {
+                                    javax.xml.parsers.SAXParserFactory factory
+                                            = javax.xml.parsers.SAXParserFactory.newInstance();
+
+                                    factory.setNamespaceAware(true);
+
+                                    if (isSecureProcessing) {
+                                        try {
+                                            factory.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, true);
+                                        } catch (org.xml.sax.SAXException se) {
+                                        }
+                                    }
+
+                                    javax.xml.parsers.SAXParser jaxpParser
+                                            = factory.newSAXParser();
+
+                                    reader = jaxpParser.getXMLReader();
+                                } catch (javax.xml.parsers.ParserConfigurationException ex) {
+                                    throw new org.xml.sax.SAXException(ex);
+                                } catch (javax.xml.parsers.FactoryConfigurationError ex1) {
+                                    throw new org.xml.sax.SAXException(ex1.toString());
+                                } catch (NoSuchMethodError ex2) {
+                                } catch (AbstractMethodError ame) {
+                                }
+
+                                if (null == reader) {
+                                    reader = XMLReaderFactory.createXMLReader();
+                                }
+
+                                TransformerHandler th = stf.newTransformerHandler(stylesheet);
+
+                                reader.setContentHandler(th);
+                                reader.setDTDHandler(th);
+
+                                if (th instanceof org.xml.sax.ErrorHandler) {
+                                    reader.setErrorHandler((org.xml.sax.ErrorHandler) th);
+                                }
+
+                                try {
+                                    reader.setProperty(
+                                            "http://xml.org/sax/properties/lexical-handler", th);
+                                } catch (org.xml.sax.SAXNotRecognizedException e) {
+                                } catch (org.xml.sax.SAXNotSupportedException e) {
+                                }
+                                try {
+                                    reader.setFeature("http://xml.org/sax/features/namespace-prefixes",
+                                            true);
+                                } catch (org.xml.sax.SAXException se) {
+                                }
+
+                                th.setResult(strResult);
+
+                                reader.parse(new InputSource(inFileName));
+                            }
+                        } else {
+                            if (entityResolver != null) {
+                                XMLReader reader = null;
+
+                                // Use JAXP1.1 ( if possible )
+                                try {
+                                    javax.xml.parsers.SAXParserFactory factory
+                                            = javax.xml.parsers.SAXParserFactory.newInstance();
+
+                                    factory.setNamespaceAware(true);
+
+                                    if (isSecureProcessing) {
+                                        try {
+                                            factory.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, true);
+                                        } catch (org.xml.sax.SAXException se) {
+                                        }
+                                    }
+
+                                    javax.xml.parsers.SAXParser jaxpParser
+                                            = factory.newSAXParser();
+
+                                    reader = jaxpParser.getXMLReader();
+                                } catch (javax.xml.parsers.ParserConfigurationException ex) {
+                                    throw new org.xml.sax.SAXException(ex);
+                                } catch (javax.xml.parsers.FactoryConfigurationError ex1) {
+                                    throw new org.xml.sax.SAXException(ex1.toString());
+                                } catch (NoSuchMethodError ex2) {
+                                } catch (AbstractMethodError ame) {
+                                }
+
+                                if (null == reader) {
+                                    reader = XMLReaderFactory.createXMLReader();
+                                }
+
+                                reader.setEntityResolver(entityResolver);
+
+                                if (contentHandler != null) {
+                                    SAXResult result = new SAXResult(contentHandler);
+
+                                    transformer.transform(
+                                            new SAXSource(reader, new InputSource(inFileName)),
+                                            result);
+                                } else {
+                                    transformer.transform(
+                                            new SAXSource(reader, new InputSource(inFileName)),
+                                            strResult);
+                                }
+                            } else if (contentHandler != null) {
+                                SAXResult result = new SAXResult(contentHandler);
+
+                                transformer.transform(new StreamSource(inFileName), result);
+                            } else {
+                                // System.out.println("Starting transform");
+                                transformer.transform(new StreamSource(inFileName),
+                                        strResult);
+                                // System.out.println("Done with transform");
+                            }
+                        }
+                    } else {
+                        StringReader reader
+                                = new StringReader("<?xml version=\"1.0\"?> <doc/>");
+
+                        transformer.transform(new StreamSource(reader), strResult);
+                    }
+                } else {
+                    //          "XSL Process was not successful.");
+                    msg = "XSL Process was not successful.";
+                    diagnosticsWriter.println(msg);
+                    doExit(msg);
+                }
+
+                // close output streams
+                if (null != outFileName && strResult != null) {
+                    java.io.OutputStream out = strResult.getOutputStream();
+                    java.io.Writer writer = strResult.getWriter();
+                    try {
+                        if (out != null) {
+                            out.close();
+                        }
+                        if (writer != null) {
+                            writer.close();
+                        }
+                    } catch (java.io.IOException ie) {
+                    }
+                }
+
+                long stop = System.currentTimeMillis();
+                long millisecondsDuration = stop - start;
+
+                if (doDiag) {
+                    msg = " --------- Transform of " + inFileName + " via "
+                            + xslFileName + " took " + millisecondsDuration + " ms";
+                    diagnosticsWriter.println('\n');
+                    diagnosticsWriter.println(msg);
+                }
+
+            } catch (Throwable throwable) {
+                doStackDumpOnError = true;
+
+                diagnosticsWriter.println();
+
+                if (doStackDumpOnError) {
+                    throwable.printStackTrace(dumpWriter);
+                } else {
+                    printLocation(diagnosticsWriter, throwable);
+                    diagnosticsWriter.println("Unexpected exception: " + throwable);
+                }
+
+                // diagnosticsWriter.println(XSLMessages.createMessage(XSLTErrorResources.ER_NOT_SUCCESSFUL, null)); //"XSL Process was not successful.");
+                if (null != dumpFileName) {
+                    dumpWriter.close();
+                }
+
+                doExit(throwable.getMessage());
+            }
+
+            if (null != dumpFileName) {
+                dumpWriter.close();
+            }
+
+            if (null != diagnosticsWriter) {
+
+                // diagnosticsWriter.close();
+            }
+
+            // if(!setQuietMode)
+            //  diagnosticsWriter.println(resbundle.getString("xsldone")); //"Xalan: done");
+            // else
+            // diagnosticsWriter.println("");  //"Xalan: done");
+        }
+    }
+
+    /**
+     * It is _much_ easier to debug under VJ++ if I can set a single breakpoint
+     * before this blows itself out of the water... (I keep checking this in, it
+     * keeps vanishing. Grr!)
+     *
+     */
+    static void doExit(String msg) {
+        throw new RuntimeException(msg);
+    }
+
+    /**
+     * Wait for a return key to continue
+     *
+     * @param resbundle The resource bundle
+     */
+    private static void waitForReturnKey() {
+        System.out.println("(press <return> to continue)");
+        try {
+            while (System.in.read() != '\n');
+        } catch (java.io.IOException e) {
+        }
+    }
+
+    /**
+     * Print a message if an option cannot be used with -XSLTC.
+     *
+     * @param option The option String
+     */
+    private static void printInvalidXSLTCOption(String option) {
+        System.err.println("The option " + option + " is not supported in XSLTC mode.");
+    }
+
+    /**
+     * Print a message if an option can only be used with -XSLTC.
+     *
+     * @param option The option String
+     */
+    private static void printInvalidXalanOption(String option) {
+        System.err.println("The option " + option + " can only be used with -XSLTC.");
+    }
+
+    static class DummyErrorListenerHandler implements ErrorHandler, ErrorListener {
+        @Override
+        public void warning(SAXParseException exception) throws SAXException {
+            System.err.println("WARNING: " + exception);
+        }
+        @Override
+        public void error(SAXParseException exception) throws SAXException {
+            throw exception;
+        }
+        @Override
+        public void fatalError(SAXParseException exception) throws SAXException {
+            throw exception;
+        }
+        @Override
+        public void warning(TransformerException exception) throws TransformerException {
+            System.err.println("WARNING: " + exception);
+        }
+        @Override
+        public void error(TransformerException exception) throws TransformerException {
+            throw exception;
+        }
+        @Override
+        public void fatalError(TransformerException exception) throws TransformerException {
+            throw exception;
+        }
+    }
+
+    static ErrorListener createDefaultErrorListener() {
+        try {
+            Class<?> errorHandler =
+                    Class.forName("com.sun.org.apache.xml.internal.utils.DefaultErrorHandler");
+            Constructor<?> ctor = errorHandler.getConstructor();
+            return (ErrorListener) ctor.newInstance();
+        } catch (Throwable r) {
+            return new DummyErrorListenerHandler();
+        }
+    }
+
+    private static void printLocation(PrintWriter diagnosticsWriter, Throwable throwable) {
+        try {
+            Class<?> errorHandler =
+                    Class.forName("com.sun.org.apache.xml.internal.utils.DefaultErrorHandler");
+            Method m = errorHandler.getMethod("printLocation", PrintWriter.class, Throwable.class);
+            m.invoke(null, diagnosticsWriter, throwable);
+        } catch (Throwable t) {
+            SourceLocator locator = null;
+            Throwable cause = throwable;
+
+            // Try to find the locator closest to the cause.
+            do {
+                if (cause instanceof TransformerException) {
+                    SourceLocator causeLocator = ((TransformerException) cause).getLocator();
+                    if (null != causeLocator) {
+                        locator = causeLocator;
+                    }
+                    cause = ((TransformerException) cause).getCause();
+                } else if (cause instanceof SAXException) {
+                    cause = ((SAXException) cause).getException();
+                } else {
+                    cause = cause.getCause();
+                }
+            } while (null != cause);
+
+            if (null != locator) {
+                // m_pw.println("Parser fatal error: "+exception.getMessage());
+                String id = (null != locator.getPublicId())
+                        ? locator.getPublicId()
+                        : (null != locator.getSystemId())
+                                ? locator.getSystemId() : "SystemId Unknown"; //"SystemId Unknown";
+
+                diagnosticsWriter.print(id + "; " + "line: " + locator.getLineNumber()
+                        + "; column: " + locator.getColumnNumber() + "; ");
+            }
+            diagnosticsWriter.print("(" + throwable + ": unknown location)");
+        }
+    }
+
+}
--- a/jaxws/.hgtags	Thu Apr 09 12:29:31 2015 +0200
+++ b/jaxws/.hgtags	Mon Aug 17 12:45:16 2015 +0300
@@ -321,3 +321,4 @@
 285939df908721cdb2b18a119638114306b8dca7 jdk9-b73
 6232472e51418757f7b2bf05332678ea78096e6b jdk9-b74
 086bcd5e4a531a350c84668c8dc019461588ee3d jdk9-b75
+55bb88306dc57d07f2c854803465f6d9a7eb4aba jdk9-b76
--- a/jdk/.hgtags	Thu Apr 09 12:29:31 2015 +0200
+++ b/jdk/.hgtags	Mon Aug 17 12:45:16 2015 +0300
@@ -319,3 +319,4 @@
 6dd82d2e4a104f4d204b2890f33ef11ec3e3f8d0 jdk9-b74
 4dd09cb5f7c2a2a23a9958ea7a602dd74d5709b2 jdk9-b75
 4526c0da8fb362eebd7e88f4d44e86858cf9b80b jdk9-b76
+7fd081100f48828431e7c1bff65c906ee759069b jdk9-b77
--- a/jdk/make/launcher/Launcher-jdk.scripting.nashorn.gmk	Thu Apr 09 12:29:31 2015 +0200
+++ b/jdk/make/launcher/Launcher-jdk.scripting.nashorn.gmk	Mon Aug 17 12:45:16 2015 +0300
@@ -26,5 +26,5 @@
 include LauncherCommon.gmk
 
 $(eval $(call SetupLauncher,jjs, \
-    -DJAVA_ARGS='{ "-J-ms8m"$(COMMA) "jdk.nashorn.tools.Shell"$(COMMA) }'))
+    -DJAVA_ARGS='{ "-J-ms8m"$(COMMA) "jdk.nashorn.tools.jjs.Main"$(COMMA) }'))
 
--- a/jdk/make/lib/NioLibraries.gmk	Thu Apr 09 12:29:31 2015 +0200
+++ b/jdk/make/lib/NioLibraries.gmk	Mon Aug 17 12:45:16 2015 +0300
@@ -24,6 +24,7 @@
 #
 
 BUILD_LIBNIO_SRC := \
+    $(JDK_TOPDIR)/src/java.base/share/native/libnio \
     $(JDK_TOPDIR)/src/java.base/share/native/libnio/ch \
     $(JDK_TOPDIR)/src/java.base/$(OPENJDK_TARGET_OS_TYPE)/native/libnio \
     $(sort $(wildcard \
--- a/jdk/make/lib/SoundLibraries.gmk	Thu Apr 09 12:29:31 2015 +0200
+++ b/jdk/make/lib/SoundLibraries.gmk	Mon Aug 17 12:45:16 2015 +0300
@@ -123,9 +123,6 @@
     CFLAGS := $(CFLAGS_JDKLIB) \
         $(LIBJSOUND_CFLAGS), \
     CXXFLAGS := $(CXXFLAGS_JDKLIB) $(LIBJSOUND_CFLAGS), \
-    DISABLED_WARNINGS_clang := implicit-function-declaration \
-        deprecated-writable-strings, \
-    WARNINGS_AS_ERRORS_clang := false, \
     MAPFILE := $(JDK_TOPDIR)/make/mapfiles/libjsound/mapfile-vers, \
     LDFLAGS := $(LDFLAGS_JDKLIB) \
         $(call SET_SHARED_LIBRARY_ORIGIN), \
@@ -171,7 +168,6 @@
           -DUSE_PORTS=TRUE \
           -DUSE_PLATFORM_MIDI_OUT=TRUE \
           -DUSE_PLATFORM_MIDI_IN=TRUE, \
-      DISABLED_WARNINGS_gcc := parentheses, \
       MAPFILE := $(JDK_TOPDIR)/make/mapfiles/libjsoundalsa/mapfile-vers, \
       LDFLAGS := $(LDFLAGS_JDKLIB) \
           $(call SET_SHARED_LIBRARY_ORIGIN), \
--- a/jdk/make/mapfiles/libnio/mapfile-linux	Thu Apr 09 12:29:31 2015 +0200
+++ b/jdk/make/mapfiles/libnio/mapfile-linux	Mon Aug 17 12:45:16 2015 +0300
@@ -25,6 +25,7 @@
 
 SUNWprivate_1.1 {
 	global:
+                JNI_OnLoad;
                 Java_java_nio_MappedByteBuffer_force0;
                 Java_java_nio_MappedByteBuffer_isLoaded0;
                 Java_java_nio_MappedByteBuffer_load0;
--- a/jdk/make/mapfiles/libnio/mapfile-macosx	Thu Apr 09 12:29:31 2015 +0200
+++ b/jdk/make/mapfiles/libnio/mapfile-macosx	Mon Aug 17 12:45:16 2015 +0300
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2001, 2015, 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
@@ -25,6 +25,7 @@
 
 SUNWprivate_1.1 {
 	global:
+                JNI_OnLoad;
                 Java_java_nio_MappedByteBuffer_force0;
                 Java_java_nio_MappedByteBuffer_isLoaded0;
                 Java_java_nio_MappedByteBuffer_load0;
--- a/jdk/make/mapfiles/libnio/mapfile-solaris	Thu Apr 09 12:29:31 2015 +0200
+++ b/jdk/make/mapfiles/libnio/mapfile-solaris	Mon Aug 17 12:45:16 2015 +0300
@@ -25,6 +25,7 @@
 
 SUNWprivate_1.1 {
 	global:
+                JNI_OnLoad;
                 Java_java_nio_MappedByteBuffer_force0;
                 Java_java_nio_MappedByteBuffer_isLoaded0;
                 Java_java_nio_MappedByteBuffer_load0;
--- a/jdk/src/java.base/share/classes/java/lang/RuntimePermission.java	Thu Apr 09 12:29:31 2015 +0200
+++ b/jdk/src/java.base/share/classes/java/lang/RuntimePermission.java	Mon Aug 17 12:45:16 2015 +0300
@@ -31,22 +31,19 @@
 import java.util.StringTokenizer;
 
 /**
- * This class is for runtime permissions. A RuntimePermission
- * contains a name (also referred to as a "target name") but
- * no actions list; you either have the named permission
- * or you don't.
- *
- * <P>
+ * This class is for runtime permissions. A {@code RuntimePermission}
+ * contains a name (also referred to as a "target name") but no actions
+ * list; you either have the named permission or you don't.
+ * <p>
  * The target name is the name of the runtime permission (see below). The
  * naming convention follows the  hierarchical property naming convention.
- * Also, an asterisk
- * may appear at the end of the name, following a ".", or by itself, to
- * signify a wildcard match. For example: "loadLibrary.*" and "*" signify a
- * wildcard match, while "*loadLibrary" and "a*b" do not.
- * <P>
- * The following table lists all the possible RuntimePermission target names,
- * and for each provides a description of what the permission allows
- * and a discussion of the risks of granting code the permission.
+ * Also, an asterisk may appear at the end of the name, following a ".",
+ * or by itself, to signify a wildcard match. For example: "loadLibrary.*"
+ * and "*" signify a wildcard match, while "*loadLibrary" and "a*b" do not.
+ * <p>
+ * The following table lists the standard {@code RuntimePermission}
+ * target names, and for each provides a description of what the permission
+ * allows and a discussion of the risks of granting code the permission.
  *
  * <table border=1 cellpadding=5 summary="permission target name,
  *  what the target allows,and associated risks">
@@ -353,6 +350,10 @@
  * </tr>
  * </table>
  *
+ * @implNote
+ * Implementations may define additional target names, but should use naming
+ * conventions such as reverse domain name notation to avoid name clashes.
+ *
  * @see java.security.BasicPermission
  * @see java.security.Permission
  * @see java.security.Permissions
--- a/jdk/src/java.base/share/classes/java/nio/Buffer.java	Thu Apr 09 12:29:31 2015 +0200
+++ b/jdk/src/java.base/share/classes/java/nio/Buffer.java	Mon Aug 17 12:45:16 2015 +0300
@@ -96,10 +96,10 @@
  * capacity values:
  *
  * <blockquote>
- *     <tt>0</tt> <tt>&lt;=</tt>
- *     <i>mark</i> <tt>&lt;=</tt>
- *     <i>position</i> <tt>&lt;=</tt>
- *     <i>limit</i> <tt>&lt;=</tt>
+ *     {@code 0} {@code <=}
+ *     <i>mark</i> {@code <=}
+ *     <i>position</i> {@code <=}
+ *     <i>limit</i> {@code <=}
  *     <i>capacity</i>
  * </blockquote>
  *
@@ -229,7 +229,7 @@
      *         The new buffer's capacity, in $type$s
      *
      * @throws  IllegalArgumentException
-     *          If the <tt>capacity</tt> is a negative integer
+     *          If the {@code capacity} is a negative integer
      */
     static IllegalArgumentException createCapacityException(int capacity) {
         assert capacity < 0 : "capacity expected to be negative";
@@ -266,7 +266,7 @@
      * @return  This buffer
      *
      * @throws  IllegalArgumentException
-     *          If the preconditions on <tt>newPosition</tt> do not hold
+     *          If the preconditions on {@code newPosition} do not hold
      */
     public Buffer position(int newPosition) {
         if (newPosition > limit | newPosition < 0)
@@ -319,7 +319,7 @@
      * @return  This buffer
      *
      * @throws  IllegalArgumentException
-     *          If the preconditions on <tt>newLimit</tt> do not hold
+     *          If the preconditions on {@code newLimit} do not hold
      */
     public Buffer limit(int newLimit) {
         if (newLimit > capacity | newLimit < 0)
@@ -468,7 +468,7 @@
      * Tells whether there are any elements between the current position and
      * the limit.
      *
-     * @return  <tt>true</tt> if, and only if, there is at least one element
+     * @return  {@code true} if, and only if, there is at least one element
      *          remaining in this buffer
      */
     public final boolean hasRemaining() {
@@ -478,7 +478,7 @@
     /**
      * Tells whether or not this buffer is read-only.
      *
-     * @return  <tt>true</tt> if, and only if, this buffer is read-only
+     * @return  {@code true} if, and only if, this buffer is read-only
      */
     public abstract boolean isReadOnly();
 
@@ -486,11 +486,11 @@
      * Tells whether or not this buffer is backed by an accessible
      * array.
      *
-     * <p> If this method returns <tt>true</tt> then the {@link #array() array}
+     * <p> If this method returns {@code true} then the {@link #array() array}
      * and {@link #arrayOffset() arrayOffset} methods may safely be invoked.
      * </p>
      *
-     * @return  <tt>true</tt> if, and only if, this buffer
+     * @return  {@code true} if, and only if, this buffer
      *          is backed by an array and is not read-only
      *
      * @since 1.6
@@ -529,7 +529,7 @@
      * element of the buffer&nbsp;&nbsp;<i>(optional operation)</i>.
      *
      * <p> If this buffer is backed by an array then buffer position <i>p</i>
-     * corresponds to array index <i>p</i>&nbsp;+&nbsp;<tt>arrayOffset()</tt>.
+     * corresponds to array index <i>p</i>&nbsp;+&nbsp;{@code arrayOffset()}.
      *
      * <p> Invoke the {@link #hasArray hasArray} method before invoking this
      * method in order to ensure that this buffer has an accessible backing
@@ -552,7 +552,7 @@
      * Tells whether or not this buffer is
      * <a href="ByteBuffer.html#direct"><i>direct</i></a>.
      *
-     * @return  <tt>true</tt> if, and only if, this buffer is direct
+     * @return  {@code true} if, and only if, this buffer is direct
      *
      * @since 1.6
      */
--- a/jdk/src/java.base/share/classes/java/nio/ByteOrder.java	Thu Apr 09 12:29:31 2015 +0200
+++ b/jdk/src/java.base/share/classes/java/nio/ByteOrder.java	Mon Aug 17 12:45:16 2015 +0300
@@ -75,9 +75,9 @@
     /**
      * Constructs a string describing this object.
      *
-     * <p> This method returns the string <tt>"BIG_ENDIAN"</tt> for {@link
-     * #BIG_ENDIAN} and <tt>"LITTLE_ENDIAN"</tt> for {@link #LITTLE_ENDIAN}.
-     * </p>
+     * <p> This method returns the string
+     * {@code "BIG_ENDIAN"} for {@link #BIG_ENDIAN} and
+     * {@code "LITTLE_ENDIAN"} for {@link #LITTLE_ENDIAN}.
      *
      * @return  The specified string
      */
--- a/jdk/src/java.base/share/classes/java/nio/MappedByteBuffer.java	Thu Apr 09 12:29:31 2015 +0200
+++ b/jdk/src/java.base/share/classes/java/nio/MappedByteBuffer.java	Mon Aug 17 12:45:16 2015 +0300
@@ -116,10 +116,10 @@
      * Tells whether or not this buffer's content is resident in physical
      * memory.
      *
-     * <p> A return value of <tt>true</tt> implies that it is highly likely
+     * <p> A return value of {@code true} implies that it is highly likely
      * that all of the data in this buffer is resident in physical memory and
      * may therefore be accessed without incurring any virtual-memory page
-     * faults or I/O operations.  A return value of <tt>false</tt> does not
+     * faults or I/O operations.  A return value of {@code false} does not
      * necessarily imply that the buffer's content is not resident in physical
      * memory.
      *
@@ -127,7 +127,7 @@
      * underlying operating system may have paged out some of the buffer's data
      * by the time that an invocation of this method returns.  </p>
      *
-     * @return  <tt>true</tt> if it is likely that this buffer's content
+     * @return  {@code true} if it is likely that this buffer's content
      *          is resident in physical memory
      */
     public final boolean isLoaded() {
--- a/jdk/src/java.base/share/classes/java/nio/X-Buffer-bin.java.template	Thu Apr 09 12:29:31 2015 +0200
+++ b/jdk/src/java.base/share/classes/java/nio/X-Buffer-bin.java.template	Mon Aug 17 12:45:16 2015 +0300
@@ -78,7 +78,7 @@
      * @return  The $type$ value at the given index
      *
      * @throws  IndexOutOfBoundsException
-     *          If <tt>index</tt> is negative
+     *          If {@code index} is negative
      *          or not smaller than the buffer's limit,
      *          minus $nbytesButOne$
      */
@@ -100,7 +100,7 @@
      * @return  This buffer
      *
      * @throws  IndexOutOfBoundsException
-     *          If <tt>index</tt> is negative
+     *          If {@code index} is negative
      *          or not smaller than the buffer's limit,
      *          minus $nbytesButOne$
      *
--- a/jdk/src/java.base/share/classes/java/nio/X-Buffer.java.template	Thu Apr 09 12:29:31 2015 +0200
+++ b/jdk/src/java.base/share/classes/java/nio/X-Buffer.java.template	Mon Aug 17 12:45:16 2015 +0300
@@ -133,7 +133,7 @@
  * <h2> Access to binary data </h2>
  *
  * <p> This class defines methods for reading and writing values of all other
- * primitive types, except <tt>boolean</tt>.  Primitive values are translated
+ * primitive types, except {@code boolean}.  Primitive values are translated
  * to (or from) sequences of bytes according to the buffer's current byte
  * order, which may be retrieved and modified via the {@link #order order}
  * methods.  Specific byte orders are represented by instances of the {@link
@@ -151,8 +151,8 @@
  *  void  {@link #putFloat(float) putFloat(float f)}
  *  void  {@link #putFloat(int,float) putFloat(int index, float f)}</pre></blockquote>
  *
- * <p> Corresponding methods are defined for the types <tt>char</tt>,
- * <tt>short</tt>, <tt>int</tt>, <tt>long</tt>, and <tt>double</tt>.  The index
+ * <p> Corresponding methods are defined for the types {@code char,
+ * short, int, long}, and {@code double}.  The index
  * parameters of the absolute <i>get</i> and <i>put</i> methods are in terms of
  * bytes rather than of the type being read or written.
  *
@@ -167,8 +167,7 @@
  * #asFloatBuffer() asFloatBuffer} method, for example, creates an instance of
  * the {@link FloatBuffer} class that is backed by the byte buffer upon which
  * the method is invoked.  Corresponding view-creation methods are defined for
- * the types <tt>char</tt>, <tt>short</tt>, <tt>int</tt>, <tt>long</tt>, and
- * <tt>double</tt>.
+ * the types {@code char, short, int, long}, and {@code double}.
  *
  * <p> View buffers have three important advantages over the families of
  * type-specific <i>get</i> and <i>put</i> methods described above:
@@ -196,7 +195,7 @@
  *
  * <p> Like a byte buffer, $a$ $type$ buffer is either <a
  * href="ByteBuffer.html#direct"><i>direct</i> or <i>non-direct</i></a>.  A
- * $type$ buffer created via the <tt>wrap</tt> methods of this class will
+ * $type$ buffer created via the {@code wrap} methods of this class will
  * be non-direct.  $A$ $type$ buffer created as a view of a byte buffer will
  * be direct if, and only if, the byte buffer itself is direct.  Whether or not
  * $a$ $type$ buffer is direct may be determined by invoking the {@link
@@ -208,7 +207,7 @@
  *
  * <p> This class implements the {@link CharSequence} interface so that
  * character buffers may be used wherever character sequences are accepted, for
- * example in the regular-expression package <tt>{@link java.util.regex}</tt>.
+ * example in the regular-expression package {@link java.util.regex}.
  * </p>
  *
 #end[char]
@@ -306,7 +305,7 @@
      * @return  The new $type$ buffer
      *
      * @throws  IllegalArgumentException
-     *          If the <tt>capacity</tt> is a negative integer
+     *          If the {@code capacity} is a negative integer
      */
     public static $Type$Buffer allocateDirect(int capacity) {
         return new Direct$Type$Buffer(capacity);
@@ -335,7 +334,7 @@
      * @return  The new $type$ buffer
      *
      * @throws  IllegalArgumentException
-     *          If the <tt>capacity</tt> is a negative integer
+     *          If the {@code capacity} is a negative integer
      */
     public static $Type$Buffer allocate(int capacity) {
         if (capacity < 0)
@@ -349,8 +348,8 @@
      * <p> The new buffer will be backed by the given $type$ array;
      * that is, modifications to the buffer will cause the array to be modified
      * and vice versa.  The new buffer's capacity will be
-     * <tt>array.length</tt>, its position will be <tt>offset</tt>, its limit
-     * will be <tt>offset + length</tt>, its mark will be undefined, and its
+     * {@code array.length}, its position will be {@code offset}, its limit
+     * will be {@code offset + length}, its mark will be undefined, and its
      * byte order will be
 #if[byte]
      * {@link ByteOrder#BIG_ENDIAN BIG_ENDIAN}.
@@ -366,19 +365,19 @@
      *
      * @param  offset
      *         The offset of the subarray to be used; must be non-negative and
-     *         no larger than <tt>array.length</tt>.  The new buffer's position
+     *         no larger than {@code array.length}.  The new buffer's position
      *         will be set to this value.
      *
      * @param  length
      *         The length of the subarray to be used;
      *         must be non-negative and no larger than
-     *         <tt>array.length - offset</tt>.
-     *         The new buffer's limit will be set to <tt>offset + length</tt>.
+     *         {@code array.length - offset}.
+     *         The new buffer's limit will be set to {@code offset + length}.
      *
      * @return  The new $type$ buffer
      *
      * @throws  IndexOutOfBoundsException
-     *          If the preconditions on the <tt>offset</tt> and <tt>length</tt>
+     *          If the preconditions on the {@code offset} and {@code length}
      *          parameters do not hold
      */
     public static $Type$Buffer wrap($type$[] array,
@@ -397,7 +396,7 @@
      * <p> The new buffer will be backed by the given $type$ array;
      * that is, modifications to the buffer will cause the array to be modified
      * and vice versa.  The new buffer's capacity and limit will be
-     * <tt>array.length</tt>, its position will be zero, its mark will be
+     * {@code array.length}, its position will be zero, its mark will be
      * undefined, and its byte order will be
 #if[byte]
      * {@link ByteOrder#BIG_ENDIAN BIG_ENDIAN}.
@@ -458,8 +457,8 @@
      *
      * <p> The content of the new, read-only buffer will be the content of the
      * given character sequence.  The buffer's capacity will be
-     * <tt>csq.length()</tt>, its position will be <tt>start</tt>, its limit
-     * will be <tt>end</tt>, and its mark will be undefined.  </p>
+     * {@code csq.length()}, its position will be {@code start}, its limit
+     * will be {@code end}, and its mark will be undefined.  </p>
      *
      * @param  csq
      *         The character sequence from which the new character buffer is to
@@ -467,19 +466,19 @@
      *
      * @param  start
      *         The index of the first character to be used;
-     *         must be non-negative and no larger than <tt>csq.length()</tt>.
+     *         must be non-negative and no larger than {@code csq.length()}.
      *         The new buffer's position will be set to this value.
      *
      * @param  end
      *         The index of the character following the last character to be
-     *         used; must be no smaller than <tt>start</tt> and no larger
-     *         than <tt>csq.length()</tt>.
+     *         used; must be no smaller than {@code start} and no larger
+     *         than {@code csq.length()}.
      *         The new buffer's limit will be set to this value.
      *
      * @return  The new character buffer
      *
      * @throws  IndexOutOfBoundsException
-     *          If the preconditions on the <tt>start</tt> and <tt>end</tt>
+     *          If the preconditions on the {@code start} and {@code end}
      *          parameters do not hold
      */
     public static CharBuffer wrap(CharSequence csq, int start, int end) {
@@ -495,7 +494,7 @@
      *
      * <p> The content of the new, read-only buffer will be the content of the
      * given character sequence.  The new buffer's capacity and limit will be
-     * <tt>csq.length()</tt>, its position will be zero, and its mark will be
+     * {@code csq.length()}, its position will be zero, and its mark will be
      * undefined.  </p>
      *
      * @param  csq
@@ -624,7 +623,7 @@
      * @return  The $type$ at the given index
      *
      * @throws  IndexOutOfBoundsException
-     *          If <tt>index</tt> is negative
+     *          If {@code index} is negative
      *          or not smaller than the buffer's limit
      */
     public abstract $type$ get(int index);
@@ -657,7 +656,7 @@
      * @return  This buffer
      *
      * @throws  IndexOutOfBoundsException
-     *          If <tt>index</tt> is negative
+     *          If {@code index} is negative
      *          or not smaller than the buffer's limit
      *
      * @throws  ReadOnlyBufferException
@@ -674,17 +673,17 @@
      * <p> This method transfers $type$s from this buffer into the given
      * destination array.  If there are fewer $type$s remaining in the
      * buffer than are required to satisfy the request, that is, if
-     * <tt>length</tt>&nbsp;<tt>&gt;</tt>&nbsp;<tt>remaining()</tt>, then no
+     * {@code length}&nbsp;{@code >}&nbsp;{@code remaining()}, then no
      * $type$s are transferred and a {@link BufferUnderflowException} is
      * thrown.
      *
-     * <p> Otherwise, this method copies <tt>length</tt> $type$s from this
+     * <p> Otherwise, this method copies {@code length} $type$s from this
      * buffer into the given array, starting at the current position of this
      * buffer and at the given offset in the array.  The position of this
-     * buffer is then incremented by <tt>length</tt>.
+     * buffer is then incremented by {@code length}.
      *
      * <p> In other words, an invocation of this method of the form
-     * <tt>src.get(dst,&nbsp;off,&nbsp;len)</tt> has exactly the same effect as
+     * <code>src.get(dst,&nbsp;off,&nbsp;len)</code> has exactly the same effect as
      * the loop
      *
      * <pre>{@code
@@ -701,21 +700,21 @@
      * @param  offset
      *         The offset within the array of the first $type$ to be
      *         written; must be non-negative and no larger than
-     *         <tt>dst.length</tt>
+     *         {@code dst.length}
      *
      * @param  length
      *         The maximum number of $type$s to be written to the given
      *         array; must be non-negative and no larger than
-     *         <tt>dst.length - offset</tt>
+     *         {@code dst.length - offset}
      *
      * @return  This buffer
      *
      * @throws  BufferUnderflowException
-     *          If there are fewer than <tt>length</tt> $type$s
+     *          If there are fewer than {@code length} $type$s
      *          remaining in this buffer
      *
      * @throws  IndexOutOfBoundsException
-     *          If the preconditions on the <tt>offset</tt> and <tt>length</tt>
+     *          If the preconditions on the {@code offset} and {@code length}
      *          parameters do not hold
      */
     public $Type$Buffer get($type$[] dst, int offset, int length) {
@@ -733,7 +732,7 @@
      *
      * <p> This method transfers $type$s from this buffer into the given
      * destination array.  An invocation of this method of the form
-     * <tt>src.get(a)</tt> behaves in exactly the same way as the invocation
+     * {@code src.get(a)} behaves in exactly the same way as the invocation
      *
      * <pre>
      *     src.get(a, 0, a.length) </pre>
@@ -744,7 +743,7 @@
      * @return  This buffer
      *
      * @throws  BufferUnderflowException
-     *          If there are fewer than <tt>length</tt> $type$s
+     *          If there are fewer than {@code length} $type$s
      *          remaining in this buffer
      */
     public $Type$Buffer get($type$[] dst) {
@@ -760,17 +759,17 @@
      * <p> This method transfers the $type$s remaining in the given source
      * buffer into this buffer.  If there are more $type$s remaining in the
      * source buffer than in this buffer, that is, if
-     * <tt>src.remaining()</tt>&nbsp;<tt>&gt;</tt>&nbsp;<tt>remaining()</tt>,
+     * {@code src.remaining()}&nbsp;{@code >}&nbsp;{@code remaining()},
      * then no $type$s are transferred and a {@link
      * BufferOverflowException} is thrown.
      *
      * <p> Otherwise, this method copies
-     * <i>n</i>&nbsp;=&nbsp;<tt>src.remaining()</tt> $type$s from the given
+     * <i>n</i>&nbsp;=&nbsp;{@code src.remaining()} $type$s from the given
      * buffer into this buffer, starting at each buffer's current position.
      * The positions of both buffers are then incremented by <i>n</i>.
      *
      * <p> In other words, an invocation of this method of the form
-     * <tt>dst.put(src)</tt> has exactly the same effect as the loop
+     * {@code dst.put(src)} has exactly the same effect as the loop
      *
      * <pre>
      *     while (src.hasRemaining())
@@ -814,17 +813,17 @@
      * <p> This method transfers $type$s into this buffer from the given
      * source array.  If there are more $type$s to be copied from the array
      * than remain in this buffer, that is, if
-     * <tt>length</tt>&nbsp;<tt>&gt;</tt>&nbsp;<tt>remaining()</tt>, then no
+     * {@code length}&nbsp;{@code >}&nbsp;{@code remaining()}, then no
      * $type$s are transferred and a {@link BufferOverflowException} is
      * thrown.
      *
-     * <p> Otherwise, this method copies <tt>length</tt> $type$s from the
+     * <p> Otherwise, this method copies {@code length} $type$s from the
      * given array into this buffer, starting at the given offset in the array
      * and at the current position of this buffer.  The position of this buffer
-     * is then incremented by <tt>length</tt>.
+     * is then incremented by {@code length}.
      *
      * <p> In other words, an invocation of this method of the form
-     * <tt>dst.put(src,&nbsp;off,&nbsp;len)</tt> has exactly the same effect as
+     * <code>dst.put(src,&nbsp;off,&nbsp;len)</code> has exactly the same effect as
      * the loop
      *
      * <pre>{@code
@@ -840,12 +839,12 @@
      *
      * @param  offset
      *         The offset within the array of the first $type$ to be read;
-     *         must be non-negative and no larger than <tt>array.length</tt>
+     *         must be non-negative and no larger than {@code array.length}
      *
      * @param  length
      *         The number of $type$s to be read from the given array;
      *         must be non-negative and no larger than
-     *         <tt>array.length - offset</tt>
+     *         {@code array.length - offset}
      *
      * @return  This buffer
      *
@@ -853,7 +852,7 @@
      *          If there is insufficient space in this buffer
      *
      * @throws  IndexOutOfBoundsException
-     *          If the preconditions on the <tt>offset</tt> and <tt>length</tt>
+     *          If the preconditions on the {@code offset} and {@code length}
      *          parameters do not hold
      *
      * @throws  ReadOnlyBufferException
@@ -874,7 +873,7 @@
      *
      * <p> This method transfers the entire content of the given source
      * $type$ array into this buffer.  An invocation of this method of the
-     * form <tt>dst.put(a)</tt> behaves in exactly the same way as the
+     * form {@code dst.put(a)} behaves in exactly the same way as the
      * invocation
      *
      * <pre>
@@ -903,18 +902,18 @@
      * <p> This method transfers $type$s from the given string into this
      * buffer.  If there are more $type$s to be copied from the string than
      * remain in this buffer, that is, if
-     * <tt>end&nbsp;-&nbsp;start</tt>&nbsp;<tt>&gt;</tt>&nbsp;<tt>remaining()</tt>,
+     * <code>end&nbsp;-&nbsp;start</code>&nbsp;{@code >}&nbsp;{@code remaining()},
      * then no $type$s are transferred and a {@link
      * BufferOverflowException} is thrown.
      *
      * <p> Otherwise, this method copies
-     * <i>n</i>&nbsp;=&nbsp;<tt>end</tt>&nbsp;-&nbsp;<tt>start</tt> $type$s
+     * <i>n</i>&nbsp;=&nbsp;{@code end}&nbsp;-&nbsp;{@code start} $type$s
      * from the given string into this buffer, starting at the given
-     * <tt>start</tt> index and at the current position of this buffer.  The
+     * {@code start} index and at the current position of this buffer.  The
      * position of this buffer is then incremented by <i>n</i>.
      *
      * <p> In other words, an invocation of this method of the form
-     * <tt>dst.put(src,&nbsp;start,&nbsp;end)</tt> has exactly the same effect
+     * <code>dst.put(src,&nbsp;start,&nbsp;end)</code> has exactly the same effect
      * as the loop
      *
      * <pre>{@code
@@ -931,12 +930,12 @@
      * @param  start
      *         The offset within the string of the first $type$ to be read;
      *         must be non-negative and no larger than
-     *         <tt>string.length()</tt>
+     *         {@code string.length()}
      *
      * @param  end
      *         The offset within the string of the last $type$ to be read,
      *         plus one; must be non-negative and no larger than
-     *         <tt>string.length()</tt>
+     *         {@code string.length()}
      *
      * @return  This buffer
      *
@@ -944,7 +943,7 @@
      *          If there is insufficient space in this buffer
      *
      * @throws  IndexOutOfBoundsException
-     *          If the preconditions on the <tt>start</tt> and <tt>end</tt>
+     *          If the preconditions on the {@code start} and {@code end}
      *          parameters do not hold
      *
      * @throws  ReadOnlyBufferException
@@ -966,7 +965,7 @@
      *
      * <p> This method transfers the entire content of the given source string
      * into this buffer.  An invocation of this method of the form
-     * <tt>dst.put(s)</tt> behaves in exactly the same way as the invocation
+     * {@code dst.put(s)} behaves in exactly the same way as the invocation
      *
      * <pre>
      *     dst.put(s, 0, s.length()) </pre>
@@ -995,11 +994,11 @@
      * Tells whether or not this buffer is backed by an accessible $type$
      * array.
      *
-     * <p> If this method returns <tt>true</tt> then the {@link #array() array}
+     * <p> If this method returns {@code true} then the {@link #array() array}
      * and {@link #arrayOffset() arrayOffset} methods may safely be invoked.
      * </p>
      *
-     * @return  <tt>true</tt> if, and only if, this buffer
+     * @return  {@code true} if, and only if, this buffer
      *          is backed by an array and is not read-only
      */
     public final boolean hasArray() {
@@ -1038,7 +1037,7 @@
      * element of the buffer&nbsp;&nbsp;<i>(optional operation)</i>.
      *
      * <p> If this buffer is backed by an array then buffer position <i>p</i>
-     * corresponds to array index <i>p</i>&nbsp;+&nbsp;<tt>arrayOffset()</tt>.
+     * corresponds to array index <i>p</i>&nbsp;+&nbsp;{@code arrayOffset()}.
      *
      * <p> Invoke the {@link #hasArray hasArray} method before invoking this
      * method in order to ensure that this buffer has an accessible backing
@@ -1166,11 +1165,11 @@
      *
      * <p> The $type$s between the buffer's current position and its limit,
      * if any, are copied to the beginning of the buffer.  That is, the
-     * $type$ at index <i>p</i>&nbsp;=&nbsp;<tt>position()</tt> is copied
+     * $type$ at index <i>p</i>&nbsp;=&nbsp;{@code position()} is copied
      * to index zero, the $type$ at index <i>p</i>&nbsp;+&nbsp;1 is copied
      * to index one, and so forth until the $type$ at index
-     * <tt>limit()</tt>&nbsp;-&nbsp;1 is copied to index
-     * <i>n</i>&nbsp;=&nbsp;<tt>limit()</tt>&nbsp;-&nbsp;<tt>1</tt>&nbsp;-&nbsp;<i>p</i>.
+     * {@code limit()}&nbsp;-&nbsp;1 is copied to index
+     * <i>n</i>&nbsp;=&nbsp;{@code limit()}&nbsp;-&nbsp;{@code 1}&nbsp;-&nbsp;<i>p</i>.
      * The buffer's position is then set to <i>n+1</i> and its limit is set to
      * its capacity.  The mark, if defined, is discarded.
      *
@@ -1183,7 +1182,7 @@
      *
      * <p> Invoke this method after writing data from a buffer in case the
      * write was incomplete.  The following loop, for example, copies bytes
-     * from one channel to another via the buffer <tt>buf</tt>:
+     * from one channel to another via the buffer {@code buf}:
      *
      * <blockquote><pre>{@code
      *   buf.clear();          // Prepare buffer for use
@@ -1206,7 +1205,7 @@
     /**
      * Tells whether or not this $type$ buffer is direct.
      *
-     * @return  <tt>true</tt> if, and only if, this buffer is direct
+     * @return  {@code true} if, and only if, this buffer is direct
      */
     public abstract boolean isDirect();
 
@@ -1239,8 +1238,8 @@
      * Returns the current hash code of this buffer.
      *
      * <p> The hash code of a $type$ buffer depends only upon its remaining
-     * elements; that is, upon the elements from <tt>position()</tt> up to, and
-     * including, the element at <tt>limit()</tt>&nbsp;-&nbsp;<tt>1</tt>.
+     * elements; that is, upon the elements from {@code position()} up to, and
+     * including, the element at {@code limit()}&nbsp;-&nbsp;{@code 1}.
      *
      * <p> Because buffer hash codes are content-dependent, it is inadvisable
      * to use buffers as keys in hash maps or similar data structures unless it
@@ -1289,7 +1288,7 @@
      *
      * @param  ob  The object to which this buffer is to be compared
      *
-     * @return  <tt>true</tt> if, and only if, this buffer is equal to the
+     * @return  {@code true} if, and only if, this buffer is equal to the
      *           given object
      */
     public boolean equals(Object ob) {
@@ -1368,7 +1367,7 @@
      *
      * <p> The first character of the resulting string will be the character at
      * this buffer's position, while the last character will be the character
-     * at index <tt>limit()</tt>&nbsp;-&nbsp;1.  Invoking this method does not
+     * at index {@code limit()}&nbsp;-&nbsp;1.  Invoking this method does not
      * change the buffer's position. </p>
      *
      * @return  The specified string
@@ -1388,7 +1387,7 @@
      * <p> When viewed as a character sequence, the length of a character
      * buffer is simply the number of characters between the position
      * (inclusive) and the limit (exclusive); that is, it is equivalent to
-     * <tt>remaining()</tt>. </p>
+     * {@code remaining()}. </p>
      *
      * @return  The length of this character buffer
      */
@@ -1402,13 +1401,13 @@
      *
      * @param  index
      *         The index of the character to be read, relative to the position;
-     *         must be non-negative and smaller than <tt>remaining()</tt>
+     *         must be non-negative and smaller than {@code remaining()}
      *
      * @return  The character at index
-     *          <tt>position()&nbsp;+&nbsp;index</tt>
+     *          <code>position()&nbsp;+&nbsp;index</code>
      *
      * @throws  IndexOutOfBoundsException
-     *          If the preconditions on <tt>index</tt> do not hold
+     *          If the preconditions on {@code index} do not hold
      */
     public final char charAt(int index) {
         return get(position() + checkIndex(index, 1));
@@ -1422,26 +1421,26 @@
      * content of this buffer is mutable then modifications to one buffer will
      * cause the other to be modified.  The new buffer's capacity will be that
      * of this buffer, its position will be
-     * <tt>position()</tt>&nbsp;+&nbsp;<tt>start</tt>, and its limit will be
-     * <tt>position()</tt>&nbsp;+&nbsp;<tt>end</tt>.  The new buffer will be
+     * {@code position()}&nbsp;+&nbsp;{@code start}, and its limit will be
+     * {@code position()}&nbsp;+&nbsp;{@code end}.  The new buffer will be
      * direct if, and only if, this buffer is direct, and it will be read-only
      * if, and only if, this buffer is read-only.  </p>
      *
      * @param  start
      *         The index, relative to the current position, of the first
      *         character in the subsequence; must be non-negative and no larger
-     *         than <tt>remaining()</tt>
+     *         than {@code remaining()}
      *
      * @param  end
      *         The index, relative to the current position, of the character
      *         following the last character in the subsequence; must be no
-     *         smaller than <tt>start</tt> and no larger than
-     *         <tt>remaining()</tt>
+     *         smaller than {@code start} and no larger than
+     *         {@code remaining()}
      *
      * @return  The new character buffer
      *
      * @throws  IndexOutOfBoundsException
-     *          If the preconditions on <tt>start</tt> and <tt>end</tt>
+     *          If the preconditions on {@code start} and {@code end}
      *          do not hold
      */
     public abstract CharBuffer subSequence(int start, int end);
@@ -1453,21 +1452,21 @@
      * Appends the specified character sequence  to this
      * buffer&nbsp;&nbsp;<i>(optional operation)</i>.
      *
-     * <p> An invocation of this method of the form <tt>dst.append(csq)</tt>
+     * <p> An invocation of this method of the form {@code dst.append(csq)}
      * behaves in exactly the same way as the invocation
      *
      * <pre>
      *     dst.put(csq.toString()) </pre>
      *
-     * <p> Depending on the specification of <tt>toString</tt> for the
-     * character sequence <tt>csq</tt>, the entire sequence may not be
+     * <p> Depending on the specification of {@code toString} for the
+     * character sequence {@code csq}, the entire sequence may not be
      * appended.  For instance, invoking the {@link $Type$Buffer#toString()
      * toString} method of a character buffer will return a subsequence whose
      * content depends upon the buffer's position and limit.
      *
      * @param  csq
-     *         The character sequence to append.  If <tt>csq</tt> is
-     *         <tt>null</tt>, then the four characters <tt>"null"</tt> are
+     *         The character sequence to append.  If {@code csq} is
+     *         {@code null}, then the four characters {@code "null"} are
      *         appended to this character buffer.
      *
      * @return  This buffer
@@ -1491,8 +1490,8 @@
      * Appends a subsequence of the  specified character sequence  to this
      * buffer&nbsp;&nbsp;<i>(optional operation)</i>.
      *
-     * <p> An invocation of this method of the form <tt>dst.append(csq, start,
-     * end)</tt> when <tt>csq</tt> is not <tt>null</tt>, behaves in exactly the
+     * <p> An invocation of this method of the form {@code dst.append(csq, start,
+     * end)} when {@code csq} is not {@code null}, behaves in exactly the
      * same way as the invocation
      *
      * <pre>
@@ -1500,9 +1499,9 @@
      *
      * @param  csq
      *         The character sequence from which a subsequence will be
-     *         appended.  If <tt>csq</tt> is <tt>null</tt>, then characters
-     *         will be appended as if <tt>csq</tt> contained the four
-     *         characters <tt>"null"</tt>.
+     *         appended.  If {@code csq} is {@code null}, then characters
+     *         will be appended as if {@code csq} contained the four
+     *         characters {@code "null"}.
      *
      * @return  This buffer
      *
@@ -1510,9 +1509,9 @@
      *          If there is insufficient space in this buffer
      *
      * @throws  IndexOutOfBoundsException
-     *          If <tt>start</tt> or <tt>end</tt> are negative, <tt>start</tt>
-     *          is greater than <tt>end</tt>, or <tt>end</tt> is greater than
-     *          <tt>csq.length()</tt>
+     *          If {@code start} or {@code end} are negative, {@code start}
+     *          is greater than {@code end}, or {@code end} is greater than
+     *          {@code csq.length()}
      *
      * @throws  ReadOnlyBufferException
      *          If this buffer is read-only
@@ -1528,7 +1527,7 @@
      * Appends the specified $type$  to this
      * buffer&nbsp;&nbsp;<i>(optional operation)</i>.
      *
-     * <p> An invocation of this method of the form <tt>dst.append($x$)</tt>
+     * <p> An invocation of this method of the form {@code dst.append($x$)}
      * behaves in exactly the same way as the invocation
      *
      * <pre>
@@ -1562,7 +1561,7 @@
      * Retrieves this buffer's byte order.
      *
      * <p> The byte order of $a$ $type$ buffer created by allocation or by
-     * wrapping an existing <tt>$type$</tt> array is the {@link
+     * wrapping an existing {@code $type$} array is the {@link
      * ByteOrder#nativeOrder native order} of the underlying
      * hardware.  The byte order of $a$ $type$ buffer created as a <a
      * href="ByteBuffer.html#views">view</a> of a byte buffer is that of the
--- a/jdk/src/java.base/share/classes/java/nio/channels/AsynchronousByteChannel.java	Thu Apr 09 12:29:31 2015 +0200
+++ b/jdk/src/java.base/share/classes/java/nio/channels/AsynchronousByteChannel.java	Mon Aug 17 12:45:16 2015 +0300
@@ -70,13 +70,13 @@
      * {@code 0} without initiating an I/O operation.
      *
      * <p> Suppose that a byte sequence of length <i>n</i> is read, where
-     * <tt>0</tt>&nbsp;<tt>&lt;</tt>&nbsp;<i>n</i>&nbsp;<tt>&lt;=</tt>&nbsp;<i>r</i>.
+     * {@code 0}&nbsp;{@code <}&nbsp;<i>n</i>&nbsp;{@code <=}&nbsp;<i>r</i>.
      * This byte sequence will be transferred into the buffer so that the first
      * byte in the sequence is at index <i>p</i> and the last byte is at index
-     * <i>p</i>&nbsp;<tt>+</tt>&nbsp;<i>n</i>&nbsp;<tt>-</tt>&nbsp;<tt>1</tt>,
+     * <i>p</i>&nbsp;{@code +}&nbsp;<i>n</i>&nbsp;{@code -}&nbsp;{@code 1},
      * where <i>p</i> is the buffer's position at the moment the read is
      * performed. Upon completion the buffer's position will be equal to
-     * <i>p</i>&nbsp;<tt>+</tt>&nbsp;<i>n</i>; its limit will not have changed.
+     * <i>p</i>&nbsp;{@code +}&nbsp;<i>n</i>; its limit will not have changed.
      *
      * <p> Buffers are not safe for use by multiple concurrent threads so care
      * should be taken to not access the buffer until the operation has
@@ -151,13 +151,13 @@
      * {@code 0} without initiating an I/O operation.
      *
      * <p> Suppose that a byte sequence of length <i>n</i> is written, where
-     * <tt>0</tt>&nbsp;<tt>&lt;</tt>&nbsp;<i>n</i>&nbsp;<tt>&lt;=</tt>&nbsp;<i>r</i>.
+     * {@code 0}&nbsp;{@code <}&nbsp;<i>n</i>&nbsp;{@code <=}&nbsp;<i>r</i>.
      * This byte sequence will be transferred from the buffer starting at index
      * <i>p</i>, where <i>p</i> is the buffer's position at the moment the
      * write is performed; the index of the last byte written will be
-     * <i>p</i>&nbsp;<tt>+</tt>&nbsp;<i>n</i>&nbsp;<tt>-</tt>&nbsp;<tt>1</tt>.
+     * <i>p</i>&nbsp;{@code +}&nbsp;<i>n</i>&nbsp;{@code -}&nbsp;{@code 1}.
      * Upon completion the buffer's position will be equal to
-     * <i>p</i>&nbsp;<tt>+</tt>&nbsp;<i>n</i>; its limit will not have changed.
+     * <i>p</i>&nbsp;{@code +}&nbsp;<i>n</i>; its limit will not have changed.
      *
      * <p> Buffers are not safe for use by multiple concurrent threads so care
      * should be taken to not access the buffer until the operation has
--- a/jdk/src/java.base/share/classes/java/nio/channels/AsynchronousServerSocketChannel.java	Thu Apr 09 12:29:31 2015 +0200
+++ b/jdk/src/java.base/share/classes/java/nio/channels/AsynchronousServerSocketChannel.java	Mon Aug 17 12:45:16 2015 +0300
@@ -41,7 +41,7 @@
  * by invoking the {@link #bind(SocketAddress,int) bind} method. Once bound,
  * the {@link #accept(Object,CompletionHandler) accept} method
  * is used to initiate the accepting of connections to the channel's socket.
- * An attempt to invoke the <tt>accept</tt> method on an unbound channel will
+ * An attempt to invoke the {@code accept} method on an unbound channel will
  * cause a {@link NotYetBoundException} to be thrown.
  *
  * <p> Channels of this type are safe for use by multiple concurrent threads
@@ -122,13 +122,13 @@
      * java.nio.channels.spi.AsynchronousChannelProvider#openAsynchronousServerSocketChannel
      * openAsynchronousServerSocketChannel} method on the {@link
      * java.nio.channels.spi.AsynchronousChannelProvider} object that created
-     * the given group. If the group parameter is <tt>null</tt> then the
+     * the given group. If the group parameter is {@code null} then the
      * resulting channel is created by the system-wide default provider, and
      * bound to the <em>default group</em>.
      *
      * @param   group
      *          The group to which the newly constructed channel should be bound,
-     *          or <tt>null</tt> for the default group
+     *          or {@code null} for the default group
      *
      * @return  A new asynchronous server socket channel
      *
@@ -176,7 +176,7 @@
      * </pre></blockquote>
      *
      * @param   local
-     *          The local address to bind the socket, or <tt>null</tt> to bind
+     *          The local address to bind the socket, or {@code null} to bind
      *          to an automatically assigned socket address
      *
      * @return  This channel
--- a/jdk/src/java.base/share/classes/java/nio/channels/AsynchronousSocketChannel.java	Thu Apr 09 12:29:31 2015 +0200
+++ b/jdk/src/java.base/share/classes/java/nio/channels/AsynchronousSocketChannel.java	Mon Aug 17 12:45:16 2015 +0300
@@ -452,11 +452,11 @@
      * at the moment that the read is attempted.
      *
      * <p> Suppose that a byte sequence of length <i>n</i> is read, where
-     * <tt>0</tt>&nbsp;<tt>&lt;</tt>&nbsp;<i>n</i>&nbsp;<tt>&lt;=</tt>&nbsp;<i>r</i>.
-     * Up to the first <tt>dsts[offset].remaining()</tt> bytes of this sequence
-     * are transferred into buffer <tt>dsts[offset]</tt>, up to the next
-     * <tt>dsts[offset+1].remaining()</tt> bytes are transferred into buffer
-     * <tt>dsts[offset+1]</tt>, and so forth, until the entire byte sequence
+     * {@code 0}&nbsp;{@code <}&nbsp;<i>n</i>&nbsp;{@code <=}&nbsp;<i>r</i>.
+     * Up to the first {@code dsts[offset].remaining()} bytes of this sequence
+     * are transferred into buffer {@code dsts[offset]}, up to the next
+     * {@code dsts[offset+1].remaining()} bytes are transferred into buffer
+     * {@code dsts[offset+1]}, and so forth, until the entire byte sequence
      * is transferred into the given buffers.  As many bytes as possible are
      * transferred into each buffer, hence the final position of each updated
      * buffer, except the last updated buffer, is guaranteed to be equal to
@@ -606,11 +606,11 @@
      * at the moment that the write is attempted.
      *
      * <p> Suppose that a byte sequence of length <i>n</i> is written, where
-     * <tt>0</tt>&nbsp;<tt>&lt;</tt>&nbsp;<i>n</i>&nbsp;<tt>&lt;=</tt>&nbsp;<i>r</i>.
-     * Up to the first <tt>srcs[offset].remaining()</tt> bytes of this sequence
-     * are written from buffer <tt>srcs[offset]</tt>, up to the next
-     * <tt>srcs[offset+1].remaining()</tt> bytes are written from buffer
-     * <tt>srcs[offset+1]</tt>, and so forth, until the entire byte sequence is
+     * {@code 0}&nbsp;{@code <}&nbsp;<i>n</i>&nbsp;{@code <=}&nbsp;<i>r</i>.
+     * Up to the first {@code srcs[offset].remaining()} bytes of this sequence
+     * are written from buffer {@code srcs[offset]}, up to the next
+     * {@code srcs[offset+1].remaining()} bytes are written from buffer
+     * {@code srcs[offset+1]}, and so forth, until the entire byte sequence is
      * written.  As many bytes as possible are written from each buffer, hence
      * the final position of each updated buffer, except the last updated
      * buffer, is guaranteed to be equal to that buffer's limit. The underlying
--- a/jdk/src/java.base/share/classes/java/nio/channels/Channel.java	Thu Apr 09 12:29:31 2015 +0200
+++ b/jdk/src/java.base/share/classes/java/nio/channels/Channel.java	Mon Aug 17 12:45:16 2015 +0300
@@ -58,7 +58,7 @@
     /**
      * Tells whether or not this channel is open.
      *
-     * @return <tt>true</tt> if, and only if, this channel is open
+     * @return {@code true} if, and only if, this channel is open
      */
     public boolean isOpen();
 
--- a/jdk/src/java.base/share/classes/java/nio/channels/DatagramChannel.java	Thu Apr 09 12:29:31 2015 +0200
+++ b/jdk/src/java.base/share/classes/java/nio/channels/DatagramChannel.java	Mon Aug 17 12:45:16 2015 +0300
@@ -187,8 +187,8 @@
      * operations.
      *
      * <p> Datagram channels support reading and writing, so this method
-     * returns <tt>(</tt>{@link SelectionKey#OP_READ} <tt>|</tt>&nbsp;{@link
-     * SelectionKey#OP_WRITE}<tt>)</tt>.  </p>
+     * returns {@code (}{@link SelectionKey#OP_READ} {@code |}&nbsp;{@link
+     * SelectionKey#OP_WRITE}{@code )}.
      *
      * @return  The valid-operation set
      */
@@ -341,7 +341,7 @@
      * copied into the given byte buffer and its source address is returned.
      * If this channel is in non-blocking mode and a datagram is not
      * immediately available then this method immediately returns
-     * <tt>null</tt>.
+     * {@code null}.
      *
      * <p> The datagram is transferred into the given byte buffer starting at
      * its current position, as if by a regular {@link
@@ -371,7 +371,7 @@
      *         The buffer into which the datagram is to be transferred
      *
      * @return  The datagram's source address,
-     *          or <tt>null</tt> if this channel is in non-blocking mode
+     *          or {@code null} if this channel is in non-blocking mode
      *          and no datagram was immediately available
      *
      * @throws  ClosedChannelException
--- a/jdk/src/java.base/share/classes/java/nio/channels/FileChannel.java	Thu Apr 09 12:29:31 2015 +0200
+++ b/jdk/src/java.base/share/classes/java/nio/channels/FileChannel.java	Mon Aug 17 12:45:16 2015 +0300
@@ -63,7 +63,7 @@
  *
  *   <li><p> A region of a file may be {@link #map <i>mapped</i>}
  *   directly into memory; for large files this is often much more efficient
- *   than invoking the usual <tt>read</tt> or <tt>write</tt> methods.
+ *   than invoking the usual {@code read} or {@code write} methods.
  *   </p></li>
  *
  *   <li><p> Updates made to a file may be {@link #force <i>forced
@@ -107,10 +107,10 @@
  * existing {@link java.io.FileInputStream#getChannel FileInputStream}, {@link
  * java.io.FileOutputStream#getChannel FileOutputStream}, or {@link
  * java.io.RandomAccessFile#getChannel RandomAccessFile} object by invoking
- * that object's <tt>getChannel</tt> method, which returns a file channel that
+ * that object's {@code getChannel} method, which returns a file channel that
  * is connected to the same underlying file. Where the file channel is obtained
  * from an existing stream or random access file then the state of the file
- * channel is intimately connected to that of the object whose <tt>getChannel</tt>
+ * channel is intimately connected to that of the object whose {@code getChannel}
  * method returned the channel.  Changing the channel's position, whether
  * explicitly or by reading or writing bytes, will change the file position of
  * the originating object, and vice versa. Changing the file's length via the
@@ -128,14 +128,14 @@
  * writing.  Finally, a channel obtained via the {@link
  * java.io.RandomAccessFile#getChannel getChannel} method of a {@link
  * java.io.RandomAccessFile} instance will be open for reading if the instance
- * was created with mode <tt>"r"</tt> and will be open for reading and writing
- * if the instance was created with mode <tt>"rw"</tt>.
+ * was created with mode {@code "r"} and will be open for reading and writing
+ * if the instance was created with mode {@code "rw"}.
  *
  * <a name="append-mode"></a><p> A file channel that is open for writing may be in
  * <i>append mode</i>, for example if it was obtained from a file-output stream
  * that was created by invoking the {@link
  * java.io.FileOutputStream#FileOutputStream(java.io.File,boolean)
- * FileOutputStream(File,boolean)} constructor and passing <tt>true</tt> for
+ * FileOutputStream(File,boolean)} constructor and passing {@code true} for
  * the second parameter.  In this mode each invocation of a relative write
  * operation first advances the position to the end of the file and then writes
  * the requested data.  Whether the advancement of the position and the writing
@@ -516,10 +516,10 @@
      * <p> If the file does not reside on a local device then no such guarantee
      * is made.
      *
-     * <p> The <tt>metaData</tt> parameter can be used to limit the number of
+     * <p> The {@code metaData} parameter can be used to limit the number of
      * I/O operations that this method is required to perform.  Passing
-     * <tt>false</tt> for this parameter indicates that only updates to the
-     * file's content need be written to storage; passing <tt>true</tt>
+     * {@code false} for this parameter indicates that only updates to the
+     * file's content need be written to storage; passing {@code true}
      * indicates that updates to both the file's content and metadata must be
      * written, which generally requires at least one more I/O operation.
      * Whether this parameter actually has any effect is dependent upon the
@@ -540,7 +540,7 @@
      * force changes made to the buffer's content to be written.  </p>
      *
      * @param   metaData
-     *          If <tt>true</tt> then this method is required to force changes
+     *          If {@code true} then this method is required to force changes
      *          to both the file's content and metadata to be written to
      *          storage; otherwise, it need only force content changes to be
      *          written
@@ -557,14 +557,14 @@
      * Transfers bytes from this channel's file to the given writable byte
      * channel.
      *
-     * <p> An attempt is made to read up to <tt>count</tt> bytes starting at
-     * the given <tt>position</tt> in this channel's file and write them to the
+     * <p> An attempt is made to read up to {@code count} bytes starting at
+     * the given {@code position} in this channel's file and write them to the
      * target channel.  An invocation of this method may or may not transfer
      * all of the requested bytes; whether or not it does so depends upon the
      * natures and states of the channels.  Fewer than the requested number of
      * bytes are transferred if this channel's file contains fewer than
-     * <tt>count</tt> bytes starting at the given <tt>position</tt>, or if the
-     * target channel is non-blocking and it has fewer than <tt>count</tt>
+     * {@code count} bytes starting at the given {@code position}, or if the
+     * target channel is non-blocking and it has fewer than {@code count}
      * bytes free in its output buffer.
      *
      * <p> This method does not modify this channel's position.  If the given
@@ -624,14 +624,14 @@
      * Transfers bytes into this channel's file from the given readable byte
      * channel.
      *
-     * <p> An attempt is made to read up to <tt>count</tt> bytes from the
+     * <p> An attempt is made to read up to {@code count} bytes from the
      * source channel and write them to this channel's file starting at the
-     * given <tt>position</tt>.  An invocation of this method may or may not
+     * given {@code position}.  An invocation of this method may or may not
      * transfer all of the requested bytes; whether or not it does so depends
      * upon the natures and states of the channels.  Fewer than the requested
      * number of bytes will be transferred if the source channel has fewer than
-     * <tt>count</tt> bytes remaining, or if the source channel is non-blocking
-     * and has fewer than <tt>count</tt> bytes immediately available in its
+     * {@code count} bytes remaining, or if the source channel is non-blocking
+     * and has fewer than {@code count} bytes immediately available in its
      * input buffer.
      *
      * <p> This method does not modify this channel's position.  If the given
@@ -704,7 +704,7 @@
      *         The file position at which the transfer is to begin;
      *         must be non-negative
      *
-     * @return  The number of bytes read, possibly zero, or <tt>-1</tt> if the
+     * @return  The number of bytes read, possibly zero, or {@code -1} if the
      *          given position is greater than or equal to the file's current
      *          size
      *
@@ -855,7 +855,7 @@
      *
      * <p> The {@link MappedByteBuffer <i>mapped byte buffer</i>}
      * returned by this method will have a position of zero and a limit and
-     * capacity of <tt>size</tt>; its mark will be undefined.  The buffer and
+     * capacity of {@code size}; its mark will be undefined.  The buffer and
      * the mapping that it represents will remain valid until the buffer itself
      * is garbage-collected.
      *
@@ -895,11 +895,11 @@
      * @return  The mapped byte buffer
      *
      * @throws NonReadableChannelException
-     *         If the <tt>mode</tt> is {@link MapMode#READ_ONLY READ_ONLY} but
+     *         If the {@code mode} is {@link MapMode#READ_ONLY READ_ONLY} but
      *         this channel was not opened for reading
      *
      * @throws NonWritableChannelException
-     *         If the <tt>mode</tt> is {@link MapMode#READ_WRITE READ_WRITE} or
+     *         If the {@code mode} is {@link MapMode#READ_WRITE READ_WRITE} or
      *         {@link MapMode#PRIVATE PRIVATE} but this channel was not opened
      *         for both reading and writing
      *
@@ -936,7 +936,7 @@
      * will be thrown immediately; the thread's interrupt status will not be
      * changed.
      *
-     * <p> The region specified by the <tt>position</tt> and <tt>size</tt>
+     * <p> The region specified by the {@code position} and {@code size}
      * parameters need not be contained within, or even overlap, the actual
      * underlying file.  Lock regions are fixed in size; if a locked region
      * initially contains the end of the file and the file grows beyond the
@@ -963,12 +963,12 @@
      *
      * @param  size
      *         The size of the locked region; must be non-negative, and the sum
-     *         <tt>position</tt>&nbsp;+&nbsp;<tt>size</tt> must be non-negative
+     *         {@code position}&nbsp;+&nbsp;{@code size} must be non-negative
      *
      * @param  shared
-     *         <tt>true</tt> to request a shared lock, in which case this
+     *         {@code true} to request a shared lock, in which case this
      *         channel must be open for reading (and possibly writing);
-     *         <tt>false</tt> to request an exclusive lock, in which case this
+     *         {@code false} to request an exclusive lock, in which case this
      *         channel must be open for writing (and possibly reading)
      *
      * @return  A lock object representing the newly-acquired lock
@@ -994,11 +994,11 @@
      *          region
      *
      * @throws  NonReadableChannelException
-     *          If <tt>shared</tt> is <tt>true</tt> this channel was not
+     *          If {@code shared} is {@code true} this channel was not
      *          opened for reading
      *
      * @throws  NonWritableChannelException
-     *          If <tt>shared</tt> is <tt>false</tt> but this channel was not
+     *          If {@code shared} is {@code false} but this channel was not
      *          opened for writing
      *
      * @throws  IOException
@@ -1014,7 +1014,7 @@
     /**
      * Acquires an exclusive lock on this channel's file.
      *
-     * <p> An invocation of this method of the form <tt>fc.lock()</tt> behaves
+     * <p> An invocation of this method of the form {@code fc.lock()} behaves
      * in exactly the same way as the invocation
      *
      * <pre>
@@ -1060,10 +1060,10 @@
      * immediately, either having acquired a lock on the requested region or
      * having failed to do so.  If it fails to acquire a lock because an
      * overlapping lock is held by another program then it returns
-     * <tt>null</tt>.  If it fails to acquire a lock for any other reason then
+     * {@code null}.  If it fails to acquire a lock for any other reason then
      * an appropriate exception is thrown.
      *
-     * <p> The region specified by the <tt>position</tt> and <tt>size</tt>
+     * <p> The region specified by the {@code position} and {@code size}
      * parameters need not be contained within, or even overlap, the actual
      * underlying file.  Lock regions are fixed in size; if a locked region
      * initially contains the end of the file and the file grows beyond the
@@ -1090,14 +1090,14 @@
      *
      * @param  size
      *         The size of the locked region; must be non-negative, and the sum
-     *         <tt>position</tt>&nbsp;+&nbsp;<tt>size</tt> must be non-negative
+     *         {@code position}&nbsp;+&nbsp;{@code size} must be non-negative
      *
      * @param  shared
-     *         <tt>true</tt> to request a shared lock,
-     *         <tt>false</tt> to request an exclusive lock
+     *         {@code true} to request a shared lock,
+     *         {@code false} to request an exclusive lock
      *
      * @return  A lock object representing the newly-acquired lock,
-     *          or <tt>null</tt> if the lock could not be acquired
+     *          or {@code null} if the lock could not be acquired
      *          because another program holds an overlapping lock
      *
      * @throws  IllegalArgumentException
@@ -1125,14 +1125,14 @@
     /**
      * Attempts to acquire an exclusive lock on this channel's file.
      *
-     * <p> An invocation of this method of the form <tt>fc.tryLock()</tt>
+     * <p> An invocation of this method of the form {@code fc.tryLock()}
      * behaves in exactly the same way as the invocation
      *
      * <pre>
      *     fc.{@link #tryLock(long,long,boolean) tryLock}(0L, Long.MAX_VALUE, false) </pre>
      *
      * @return  A lock object representing the newly-acquired lock,
-     *          or <tt>null</tt> if the lock could not be acquired
+     *          or {@code null} if the lock could not be acquired
      *          because another program holds an overlapping lock
      *
      * @throws  ClosedChannelException
--- a/jdk/src/java.base/share/classes/java/nio/channels/FileLock.java	Thu Apr 09 12:29:31 2015 +0200
+++ b/jdk/src/java.base/share/classes/java/nio/channels/FileLock.java	Mon Aug 17 12:45:16 2015 +0300
@@ -136,11 +136,11 @@
      *
      * @param  size
      *         The size of the locked region; must be non-negative, and the sum
-     *         <tt>position</tt>&nbsp;+&nbsp;<tt>size</tt> must be non-negative
+     *         {@code position}&nbsp;+&nbsp;{@code size} must be non-negative
      *
      * @param  shared
-     *         <tt>true</tt> if this lock is shared,
-     *         <tt>false</tt> if it is exclusive
+     *         {@code true} if this lock is shared,
+     *         {@code false} if it is exclusive
      *
      * @throws IllegalArgumentException
      *         If the preconditions on the parameters do not hold
@@ -173,11 +173,11 @@
      *
      * @param  size
      *         The size of the locked region; must be non-negative, and the sum
-     *         <tt>position</tt>&nbsp;+&nbsp;<tt>size</tt> must be non-negative
+     *         {@code position}&nbsp;+&nbsp;{@code size} must be non-negative
      *
      * @param  shared
-     *         <tt>true</tt> if this lock is shared,
-     *         <tt>false</tt> if it is exclusive
+     *         {@code true} if this lock is shared,
+     *         {@code false} if it is exclusive
      *
      * @throws IllegalArgumentException
      *         If the preconditions on the parameters do not hold
@@ -254,8 +254,8 @@
     /**
      * Tells whether this lock is shared.
      *
-     * @return <tt>true</tt> if lock is shared,
-     *         <tt>false</tt> if it is exclusive
+     * @return {@code true} if lock is shared,
+     *         {@code false} if it is exclusive
      */
     public final boolean isShared() {
         return shared;
@@ -269,7 +269,7 @@
      * @param   size
      *          The size of the lock range
      *
-     * @return  <tt>true</tt> if, and only if, this lock and the given lock
+     * @return  {@code true} if, and only if, this lock and the given lock
      *          range overlap by at least one byte
      */
     public final boolean overlaps(long position, long size) {
@@ -286,7 +286,7 @@
      * <p> A lock object remains valid until it is released or the associated
      * file channel is closed, whichever comes first.  </p>
      *
-     * @return  <tt>true</tt> if, and only if, this lock is valid
+     * @return  {@code true} if, and only if, this lock is valid
      */
     public abstract boolean isValid();
 
--- a/jdk/src/java.base/share/classes/java/nio/channels/GatheringByteChannel.java	Thu Apr 09 12:29:31 2015 +0200
+++ b/jdk/src/java.base/share/classes/java/nio/channels/GatheringByteChannel.java	Mon Aug 17 12:45:16 2015 +0300
@@ -66,11 +66,11 @@
      * at the moment that this method is invoked.
      *
      * <p> Suppose that a byte sequence of length <i>n</i> is written, where
-     * <tt>0</tt>&nbsp;<tt>&lt;=</tt>&nbsp;<i>n</i>&nbsp;<tt>&lt;=</tt>&nbsp;<i>r</i>.
-     * Up to the first <tt>srcs[offset].remaining()</tt> bytes of this sequence
-     * are written from buffer <tt>srcs[offset]</tt>, up to the next
-     * <tt>srcs[offset+1].remaining()</tt> bytes are written from buffer
-     * <tt>srcs[offset+1]</tt>, and so forth, until the entire byte sequence is
+     * {@code 0}&nbsp;{@code <=}&nbsp;<i>n</i>&nbsp;{@code <=}&nbsp;<i>r</i>.
+     * Up to the first {@code srcs[offset].remaining()} bytes of this sequence
+     * are written from buffer {@code srcs[offset]}, up to the next
+     * {@code srcs[offset+1].remaining()} bytes are written from buffer
+     * {@code srcs[offset+1]}, and so forth, until the entire byte sequence is
      * written.  As many bytes as possible are written from each buffer, hence
      * the final position of each updated buffer, except the last updated
      * buffer, is guaranteed to be equal to that buffer's limit.
@@ -92,17 +92,17 @@
      * @param  offset
      *         The offset within the buffer array of the first buffer from
      *         which bytes are to be retrieved; must be non-negative and no
-     *         larger than <tt>srcs.length</tt>
+     *         larger than {@code srcs.length}
      *
      * @param  length
      *         The maximum number of buffers to be accessed; must be
      *         non-negative and no larger than
-     *         <tt>srcs.length</tt>&nbsp;-&nbsp;<tt>offset</tt>
+     *         {@code srcs.length}&nbsp;-&nbsp;{@code offset}
      *
      * @return  The number of bytes written, possibly zero
      *
      * @throws  IndexOutOfBoundsException
-     *          If the preconditions on the <tt>offset</tt> and <tt>length</tt>
+     *          If the preconditions on the {@code offset} and {@code length}
      *          parameters do not hold
      *
      * @throws  NonWritableChannelException
@@ -131,7 +131,7 @@
     /**
      * Writes a sequence of bytes to this channel from the given buffers.
      *
-     * <p> An invocation of this method of the form <tt>c.write(srcs)</tt>
+     * <p> An invocation of this method of the form {@code c.write(srcs)}
      * behaves in exactly the same manner as the invocation
      *
      * <blockquote><pre>
--- a/jdk/src/java.base/share/classes/java/nio/channels/InterruptibleChannel.java	Thu Apr 09 12:29:31 2015 +0200
+++ b/jdk/src/java.base/share/classes/java/nio/channels/InterruptibleChannel.java	Mon Aug 17 12:45:16 2015 +0300
@@ -54,7 +54,7 @@
  *
  * <p> A channel supports asynchronous closing and interruption if, and only
  * if, it implements this interface.  This can be tested at runtime, if
- * necessary, via the <tt>instanceof</tt> operator.
+ * necessary, via the {@code instanceof} operator.
  *
  *
  * @author Mark Reinhold
--- a/jdk/src/java.base/share/classes/java/nio/channels/ReadableByteChannel.java	Thu Apr 09 12:29:31 2015 +0200
+++ b/jdk/src/java.base/share/classes/java/nio/channels/ReadableByteChannel.java	Mon Aug 17 12:45:16 2015 +0300
@@ -52,16 +52,16 @@
      *
      * <p> An attempt is made to read up to <i>r</i> bytes from the channel,
      * where <i>r</i> is the number of bytes remaining in the buffer, that is,
-     * <tt>dst.remaining()</tt>, at the moment this method is invoked.
+     * {@code dst.remaining()}, at the moment this method is invoked.
      *
      * <p> Suppose that a byte sequence of length <i>n</i> is read, where
-     * <tt>0</tt>&nbsp;<tt>&lt;=</tt>&nbsp;<i>n</i>&nbsp;<tt>&lt;=</tt>&nbsp;<i>r</i>.
+     * {@code 0}&nbsp;{@code <=}&nbsp;<i>n</i>&nbsp;{@code <=}&nbsp;<i>r</i>.
      * This byte sequence will be transferred into the buffer so that the first
      * byte in the sequence is at index <i>p</i> and the last byte is at index
-     * <i>p</i>&nbsp;<tt>+</tt>&nbsp;<i>n</i>&nbsp;<tt>-</tt>&nbsp;<tt>1</tt>,
+     * <i>p</i>&nbsp;{@code +}&nbsp;<i>n</i>&nbsp;{@code -}&nbsp;{@code 1},
      * where <i>p</i> is the buffer's position at the moment this method is
      * invoked.  Upon return the buffer's position will be equal to
-     * <i>p</i>&nbsp;<tt>+</tt>&nbsp;<i>n</i>; its limit will not have changed.
+     * <i>p</i>&nbsp;{@code +}&nbsp;<i>n</i>; its limit will not have changed.
      *
      * <p> A read operation might not fill the buffer, and in fact it might not
      * read any bytes at all.  Whether or not it does so depends upon the
@@ -81,7 +81,7 @@
      * @param  dst
      *         The buffer into which bytes are to be transferred
      *
-     * @return  The number of bytes read, possibly zero, or <tt>-1</tt> if the
+     * @return  The number of bytes read, possibly zero, or {@code -1} if the
      *          channel has reached end-of-stream
      *
      * @throws  NonReadableChannelException
--- a/jdk/src/java.base/share/classes/java/nio/channels/ScatteringByteChannel.java	Thu Apr 09 12:29:31 2015 +0200
+++ b/jdk/src/java.base/share/classes/java/nio/channels/ScatteringByteChannel.java	Mon Aug 17 12:45:16 2015 +0300
@@ -66,11 +66,11 @@
      * at the moment that this method is invoked.
      *
      * <p> Suppose that a byte sequence of length <i>n</i> is read, where
-     * <tt>0</tt>&nbsp;<tt>&lt;=</tt>&nbsp;<i>n</i>&nbsp;<tt>&lt;=</tt>&nbsp;<i>r</i>.
-     * Up to the first <tt>dsts[offset].remaining()</tt> bytes of this sequence
-     * are transferred into buffer <tt>dsts[offset]</tt>, up to the next
-     * <tt>dsts[offset+1].remaining()</tt> bytes are transferred into buffer
-     * <tt>dsts[offset+1]</tt>, and so forth, until the entire byte sequence
+     * {@code 0}&nbsp;{@code <=}&nbsp;<i>n</i>&nbsp;{@code <=}&nbsp;<i>r</i>.
+     * Up to the first {@code dsts[offset].remaining()} bytes of this sequence
+     * are transferred into buffer {@code dsts[offset]}, up to the next
+     * {@code dsts[offset+1].remaining()} bytes are transferred into buffer
+     * {@code dsts[offset+1]}, and so forth, until the entire byte sequence
      * is transferred into the given buffers.  As many bytes as possible are
      * transferred into each buffer, hence the final position of each updated
      * buffer, except the last updated buffer, is guaranteed to be equal to
@@ -87,18 +87,18 @@
      * @param  offset
      *         The offset within the buffer array of the first buffer into
      *         which bytes are to be transferred; must be non-negative and no
-     *         larger than <tt>dsts.length</tt>
+     *         larger than {@code dsts.length}
      *
      * @param  length
      *         The maximum number of buffers to be accessed; must be
      *         non-negative and no larger than
-     *         <tt>dsts.length</tt>&nbsp;-&nbsp;<tt>offset</tt>
+     *         {@code dsts.length}&nbsp;-&nbsp;{@code offset}
      *
      * @return The number of bytes read, possibly zero,
-     *         or <tt>-1</tt> if the channel has reached end-of-stream
+     *         or {@code -1} if the channel has reached end-of-stream
      *
      * @throws  IndexOutOfBoundsException
-     *          If the preconditions on the <tt>offset</tt> and <tt>length</tt>
+     *          If the preconditions on the {@code offset} and {@code length}
      *          parameters do not hold
      *
      * @throws  NonReadableChannelException
@@ -126,7 +126,7 @@
     /**
      * Reads a sequence of bytes from this channel into the given buffers.
      *
-     * <p> An invocation of this method of the form <tt>c.read(dsts)</tt>
+     * <p> An invocation of this method of the form {@code c.read(dsts)}
      * behaves in exactly the same manner as the invocation
      *
      * <blockquote><pre>
@@ -136,7 +136,7 @@
      *         The buffers into which bytes are to be transferred
      *
      * @return The number of bytes read, possibly zero,
-     *         or <tt>-1</tt> if the channel has reached end-of-stream
+     *         or {@code -1} if the channel has reached end-of-stream
      *
      * @throws  NonReadableChannelException
      *          If this channel was not opened for reading
--- a/jdk/src/java.base/share/classes/java/nio/channels/SelectableChannel.java	Thu Apr 09 12:29:31 2015 +0200
+++ b/jdk/src/java.base/share/classes/java/nio/channels/SelectableChannel.java	Mon Aug 17 12:45:16 2015 +0300
@@ -132,7 +132,7 @@
      * of its keys have been cancelled.  A channel may also remain registered
      * for some time after it is closed.  </p>
      *
-     * @return <tt>true</tt> if, and only if, this channel is registered
+     * @return {@code true} if, and only if, this channel is registered
      */
     public abstract boolean isRegistered();
     //
@@ -146,7 +146,7 @@
      *          The selector
      *
      * @return  The key returned when this channel was last registered with the
-     *          given selector, or <tt>null</tt> if this channel is not
+     *          given selector, or {@code null} if this channel is not
      *          currently registered with that selector
      */
     public abstract SelectionKey keyFor(Selector sel);
@@ -159,16 +159,16 @@
      *
      * <p> If this channel is currently registered with the given selector then
      * the selection key representing that registration is returned.  The key's
-     * interest set will have been changed to <tt>ops</tt>, as if by invoking
+     * interest set will have been changed to {@code ops}, as if by invoking
      * the {@link SelectionKey#interestOps(int) interestOps(int)} method.  If
-     * the <tt>att</tt> argument is not <tt>null</tt> then the key's attachment
+     * the {@code att} argument is not {@code null} then the key's attachment
      * will have been set to that value.  A {@link CancelledKeyException} will
      * be thrown if the key has already been cancelled.
      *
      * <p> Otherwise this channel has not yet been registered with the given
      * selector, so it is registered and the resulting new key is returned.
-     * The key's initial interest set will be <tt>ops</tt> and its attachment
-     * will be <tt>att</tt>.
+     * The key's initial interest set will be {@code ops} and its attachment
+     * will be {@code att}.
      *
      * <p> This method may be invoked at any time.  If this method is invoked
      * while another invocation of this method or of the {@link
@@ -189,7 +189,7 @@
      *         The interest set for the resulting key
      *
      * @param  att
-     *         The attachment for the resulting key; may be <tt>null</tt>
+     *         The attachment for the resulting key; may be {@code null}
      *
      * @throws  ClosedChannelException
      *          If this channel is closed
@@ -209,7 +209,7 @@
      *          but the corresponding key has already been cancelled
      *
      * @throws  IllegalArgumentException
-     *          If a bit in the <tt>ops</tt> set does not correspond to an
+     *          If a bit in the {@code ops} set does not correspond to an
      *          operation that is supported by this channel, that is, if
      *          {@code set & ~validOps() != 0}
      *
@@ -235,13 +235,13 @@
      *
      * <p> An invocation of this convenience method of the form
      *
-     * <blockquote><tt>sc.register(sel, ops)</tt></blockquote>
+     * <blockquote>{@code sc.register(sel, ops)}</blockquote>
      *
      * behaves in exactly the same way as the invocation
      *
-     * <blockquote><tt>sc.{@link
+     * <blockquote>{@code sc.}{@link
      * #register(java.nio.channels.Selector,int,java.lang.Object)
-     * register}(sel, ops, null)</tt></blockquote>
+     * register(sel, ops, null)}</blockquote>
      *
      * @param  sel
      *         The selector with which this channel is to be registered
@@ -267,7 +267,7 @@
      *          but the corresponding key has already been cancelled
      *
      * @throws  IllegalArgumentException
-     *          If a bit in <tt>ops</tt> does not correspond to an operation
+     *          If a bit in {@code ops} does not correspond to an operation
      *          that is supported by this channel, that is, if {@code set &
      *          ~validOps() != 0}
      *
@@ -296,8 +296,8 @@
      * of the {@link #register(Selector, int) register} method is in progress
      * then it will first block until the other operation is complete. </p>
      *
-     * @param  block  If <tt>true</tt> then this channel will be placed in
-     *                blocking mode; if <tt>false</tt> then it will be placed
+     * @param  block  If {@code true} then this channel will be placed in
+     *                blocking mode; if {@code false} then it will be placed
      *                non-blocking mode
      *
      * @return  This selectable channel
@@ -306,7 +306,7 @@
      *          If this channel is closed
      *
      * @throws  IllegalBlockingModeException
-     *          If <tt>block</tt> is <tt>true</tt> and this channel is
+     *          If {@code block} is {@code true} and this channel is
      *          registered with one or more selectors
      *
      * @throws IOException
@@ -327,7 +327,7 @@
      * <p> If this channel is closed then the value returned by this method is
      * not specified. </p>
      *
-     * @return <tt>true</tt> if, and only if, this channel is in blocking mode
+     * @return {@code true} if, and only if, this channel is in blocking mode
      */
     public abstract boolean isBlocking();
 
--- a/jdk/src/java.base/share/classes/java/nio/channels/SelectionKey.java	Thu Apr 09 12:29:31 2015 +0200
+++ b/jdk/src/java.base/share/classes/java/nio/channels/SelectionKey.java	Mon Aug 17 12:45:16 2015 +0300
@@ -139,7 +139,7 @@
      * <p> A key is valid upon creation and remains so until it is cancelled,
      * its channel is closed, or its selector is closed.  </p>
      *
-     * @return  <tt>true</tt> if, and only if, this key is valid
+     * @return  {@code true} if, and only if, this key is valid
      */
     public abstract boolean isValid();
 
@@ -218,11 +218,11 @@
      * Operation-set bit for read operations.
      *
      * <p> Suppose that a selection key's interest set contains
-     * <tt>OP_READ</tt> at the start of a <a
+     * {@code OP_READ} at the start of a <a
      * href="Selector.html#selop">selection operation</a>.  If the selector
      * detects that the corresponding channel is ready for reading, has reached
      * end-of-stream, has been remotely shut down for further reading, or has
-     * an error pending, then it will add <tt>OP_READ</tt> to the key's
+     * an error pending, then it will add {@code OP_READ} to the key's
      * ready-operation set and add the key to its selected-key&nbsp;set.  </p>
      */
     public static final int OP_READ = 1 << 0;
@@ -231,11 +231,11 @@
      * Operation-set bit for write operations.
      *
      * <p> Suppose that a selection key's interest set contains
-     * <tt>OP_WRITE</tt> at the start of a <a
+     * {@code OP_WRITE} at the start of a <a
      * href="Selector.html#selop">selection operation</a>.  If the selector
      * detects that the corresponding channel is ready for writing, has been
      * remotely shut down for further writing, or has an error pending, then it
-     * will add <tt>OP_WRITE</tt> to the key's ready set and add the key to its
+     * will add {@code OP_WRITE} to the key's ready set and add the key to its
      * selected-key&nbsp;set.  </p>
      */
     public static final int OP_WRITE = 1 << 2;
@@ -244,11 +244,11 @@
      * Operation-set bit for socket-connect operations.
      *
      * <p> Suppose that a selection key's interest set contains
-     * <tt>OP_CONNECT</tt> at the start of a <a
+     * {@code OP_CONNECT} at the start of a <a
      * href="Selector.html#selop">selection operation</a>.  If the selector
      * detects that the corresponding socket channel is ready to complete its
      * connection sequence, or has an error pending, then it will add
-     * <tt>OP_CONNECT</tt> to the key's ready set and add the key to its
+     * {@code OP_CONNECT} to the key's ready set and add the key to its
      * selected-key&nbsp;set.  </p>
      */
     public static final int OP_CONNECT = 1 << 3;
@@ -257,11 +257,11 @@
      * Operation-set bit for socket-accept operations.
      *
      * <p> Suppose that a selection key's interest set contains
-     * <tt>OP_ACCEPT</tt> at the start of a <a
+     * {@code OP_ACCEPT} at the start of a <a
      * href="Selector.html#selop">selection operation</a>.  If the selector
      * detects that the corresponding server-socket channel is ready to accept
      * another connection, or has an error pending, then it will add
-     * <tt>OP_ACCEPT</tt> to the key's ready set and add the key to its
+     * {@code OP_ACCEPT} to the key's ready set and add the key to its
      * selected-key&nbsp;set.  </p>
      */
     public static final int OP_ACCEPT = 1 << 4;
@@ -269,7 +269,7 @@
     /**
      * Tests whether this key's channel is ready for reading.
      *
-     * <p> An invocation of this method of the form <tt>k.isReadable()</tt>
+     * <p> An invocation of this method of the form {@code k.isReadable()}
      * behaves in exactly the same way as the expression
      *
      * <blockquote><pre>{@code
@@ -277,9 +277,9 @@
      * }</pre></blockquote>
      *
      * <p> If this key's channel does not support read operations then this
-     * method always returns <tt>false</tt>.  </p>
+     * method always returns {@code false}.  </p>
      *
-     * @return  <tt>true</tt> if, and only if,
+     * @return  {@code true} if, and only if,
                 {@code readyOps() & OP_READ} is nonzero
      *
      * @throws  CancelledKeyException
@@ -292,7 +292,7 @@
     /**
      * Tests whether this key's channel is ready for writing.
      *
-     * <p> An invocation of this method of the form <tt>k.isWritable()</tt>
+     * <p> An invocation of this method of the form {@code k.isWritable()}
      * behaves in exactly the same way as the expression
      *
      * <blockquote><pre>{@code
@@ -300,9 +300,9 @@
      * }</pre></blockquote>
      *
      * <p> If this key's channel does not support write operations then this
-     * method always returns <tt>false</tt>.  </p>
+     * method always returns {@code false}.  </p>
      *
-     * @return  <tt>true</tt> if, and only if,
+     * @return  {@code true} if, and only if,
      *          {@code readyOps() & OP_WRITE} is nonzero
      *
      * @throws  CancelledKeyException
@@ -316,7 +316,7 @@
      * Tests whether this key's channel has either finished, or failed to
      * finish, its socket-connection operation.
      *
-     * <p> An invocation of this method of the form <tt>k.isConnectable()</tt>
+     * <p> An invocation of this method of the form {@code k.isConnectable()}
      * behaves in exactly the same way as the expression
      *
      * <blockquote><pre>{@code
@@ -324,9 +324,9 @@
      * }</pre></blockquote>
      *
      * <p> If this key's channel does not support socket-connect operations
-     * then this method always returns <tt>false</tt>.  </p>
+     * then this method always returns {@code false}.  </p>
      *
-     * @return  <tt>true</tt> if, and only if,
+     * @return  {@code true} if, and only if,
      *          {@code readyOps() & OP_CONNECT} is nonzero
      *
      * @throws  CancelledKeyException
@@ -340,7 +340,7 @@
      * Tests whether this key's channel is ready to accept a new socket
      * connection.
      *
-     * <p> An invocation of this method of the form <tt>k.isAcceptable()</tt>
+     * <p> An invocation of this method of the form {@code k.isAcceptable()}
      * behaves in exactly the same way as the expression
      *
      * <blockquote><pre>{@code
@@ -348,9 +348,9 @@
      * }</pre></blockquote>
      *
      * <p> If this key's channel does not support socket-accept operations then
-     * this method always returns <tt>false</tt>.  </p>
+     * this method always returns {@code false}.  </p>
      *
-     * @return  <tt>true</tt> if, and only if,
+     * @return  {@code true} if, and only if,
      *          {@code readyOps() & OP_ACCEPT} is nonzero
      *
      * @throws  CancelledKeyException
@@ -376,13 +376,13 @@
      * <p> An attached object may later be retrieved via the {@link #attachment()
      * attachment} method.  Only one object may be attached at a time; invoking
      * this method causes any previous attachment to be discarded.  The current
-     * attachment may be discarded by attaching <tt>null</tt>.  </p>
+     * attachment may be discarded by attaching {@code null}.  </p>
      *
      * @param  ob
-     *         The object to be attached; may be <tt>null</tt>
+     *         The object to be attached; may be {@code null}
      *
      * @return  The previously-attached object, if any,
-     *          otherwise <tt>null</tt>
+     *          otherwise {@code null}
      */
     public final Object attach(Object ob) {
         return attachmentUpdater.getAndSet(this, ob);
@@ -392,7 +392,7 @@
      * Retrieves the current attachment.
      *
      * @return  The object currently attached to this key,
-     *          or <tt>null</tt> if there is no attachment
+     *          or {@code null} if there is no attachment
      */
     public final Object attachment() {
         return attachment;
--- a/jdk/src/java.base/share/classes/java/nio/channels/Selector.java	Thu Apr 09 12:29:31 2015 +0200
+++ b/jdk/src/java.base/share/classes/java/nio/channels/Selector.java	Mon Aug 17 12:45:16 2015 +0300
@@ -230,7 +230,7 @@
     /**
      * Tells whether or not this selector is open.
      *
-     * @return <tt>true</tt> if, and only if, this selector is open
+     * @return {@code true} if, and only if, this selector is open
      */
     public abstract boolean isOpen();
 
@@ -309,7 +309,7 @@
      * <p> This method does not offer real-time guarantees: It schedules the
      * timeout as if by invoking the {@link Object#wait(long)} method. </p>
      *
-     * @param  timeout  If positive, block for up to <tt>timeout</tt>
+     * @param  timeout  If positive, block for up to {@code timeout}
      *                  milliseconds, more or less, while waiting for a
      *                  channel to become ready; if zero, block indefinitely;
      *                  must not be negative
--- a/jdk/src/java.base/share/classes/java/nio/channels/ServerSocketChannel.java	Thu Apr 09 12:29:31 2015 +0200
+++ b/jdk/src/java.base/share/classes/java/nio/channels/ServerSocketChannel.java	Mon Aug 17 12:45:16 2015 +0300
@@ -223,7 +223,7 @@
      * Accepts a connection made to this channel's socket.
      *
      * <p> If this channel is in non-blocking mode then this method will
-     * immediately return <tt>null</tt> if there are no pending connections.
+     * immediately return {@code null} if there are no pending connections.
      * Otherwise it will block indefinitely until a new connection is available
      * or an I/O error occurs.
      *
@@ -239,7 +239,7 @@
      * java.lang.SecurityManager#checkAccept checkAccept} method.  </p>
      *
      * @return  The socket channel for the new connection,
-     *          or <tt>null</tt> if this channel is in non-blocking mode
+     *          or {@code null} if this channel is in non-blocking mode
      *          and no connection is available to be accepted
      *
      * @throws  ClosedChannelException
--- a/jdk/src/java.base/share/classes/java/nio/channels/SocketChannel.java	Thu Apr 09 12:29:31 2015 +0200
+++ b/jdk/src/java.base/share/classes/java/nio/channels/SocketChannel.java	Mon Aug 17 12:45:16 2015 +0300
@@ -58,7 +58,7 @@
  * If the input side of a socket is shut down by one thread while another
  * thread is blocked in a read operation on the socket's channel, then the read
  * operation in the blocked thread will complete without reading any bytes and
- * will return <tt>-1</tt>.  If the output side of a socket is shut down by one
+ * will return {@code -1}.  If the output side of a socket is shut down by one
  * thread while another thread is blocked in a write operation on the socket's
  * channel, then the blocked thread will receive an {@link
  * AsynchronousCloseException}.
@@ -150,7 +150,7 @@
      *
      * <p> This convenience method works as if by invoking the {@link #open()}
      * method, invoking the {@link #connect(SocketAddress) connect} method upon
-     * the resulting socket channel, passing it <tt>remote</tt>, and then
+     * the resulting socket channel, passing it {@code remote}, and then
      * returning that channel.  </p>
      *
      * @param  remote
@@ -204,9 +204,9 @@
      * operations.
      *
      * <p> Socket channels support connecting, reading, and writing, so this
-     * method returns <tt>(</tt>{@link SelectionKey#OP_CONNECT}
-     * <tt>|</tt>&nbsp;{@link SelectionKey#OP_READ} <tt>|</tt>&nbsp;{@link
-     * SelectionKey#OP_WRITE}<tt>)</tt>.  </p>
+     * method returns {@code (}{@link SelectionKey#OP_CONNECT}
+     * {@code |}&nbsp;{@link SelectionKey#OP_READ} {@code |}&nbsp;{@link
+     * SelectionKey#OP_WRITE}{@code )}.
      *
      * @return  The valid-operation set
      */
@@ -304,7 +304,7 @@
     /**
      * Tells whether or not this channel's network socket is connected.
      *
-     * @return  <tt>true</tt> if, and only if, this channel's network socket
+     * @return  {@code true} if, and only if, this channel's network socket
      *          is {@link #isOpen open} and connected
      */
     public abstract boolean isConnected();
@@ -313,7 +313,7 @@
      * Tells whether or not a connection operation is in progress on this
      * channel.
      *
-     * @return  <tt>true</tt> if, and only if, a connection operation has been
+     * @return  {@code true} if, and only if, a connection operation has been
      *          initiated on this channel but not yet completed by invoking the
      *          {@link #finishConnect finishConnect} method
      */
@@ -325,8 +325,8 @@
      * <p> If this channel is in non-blocking mode then an invocation of this
      * method initiates a non-blocking connection operation.  If the connection
      * is established immediately, as can happen with a local connection, then
-     * this method returns <tt>true</tt>.  Otherwise this method returns
-     * <tt>false</tt> and the connection operation must later be completed by
+     * this method returns {@code true}.  Otherwise this method returns
+     * {@code false} and the connection operation must later be completed by
      * invoking the {@link #finishConnect finishConnect} method.
      *
      * <p> If this channel is in blocking mode then an invocation of this
@@ -349,8 +349,8 @@
      * @param  remote
      *         The remote address to which this channel is to be connected
      *
-     * @return  <tt>true</tt> if a connection was established,
-     *          <tt>false</tt> if this channel is in non-blocking mode
+     * @return  {@code true} if a connection was established,
+     *          {@code false} if this channel is in non-blocking mode
      *          and the connection operation is in progress
      *
      * @throws  AlreadyConnectedException
@@ -400,11 +400,11 @@
      * {@link java.io.IOException} to be thrown.
      *
      * <p> If this channel is already connected then this method will not block
-     * and will immediately return <tt>true</tt>.  If this channel is in
-     * non-blocking mode then this method will return <tt>false</tt> if the
+     * and will immediately return {@code true}.  If this channel is in
+     * non-blocking mode then this method will return {@code false} if the
      * connection process is not yet complete.  If this channel is in blocking
      * mode then this method will block until the connection either completes
-     * or fails, and will always either return <tt>true</tt> or throw a checked
+     * or fails, and will always either return {@code true} or throw a checked
      * exception describing the failure.
      *
      * <p> This method may be invoked at any time.  If a read or write
@@ -414,7 +414,7 @@
      * invocation of this method throws a checked exception, then the channel
      * will be closed.  </p>
      *
-     * @return  <tt>true</tt> if, and only if, this channel's socket is now
+     * @return  {@code true} if, and only if, this channel's socket is now
      *          connected
      *
      * @throws  NoConnectionPendingException
--- a/jdk/src/java.base/share/classes/java/nio/channels/WritableByteChannel.java	Thu Apr 09 12:29:31 2015 +0200
+++ b/jdk/src/java.base/share/classes/java/nio/channels/WritableByteChannel.java	Mon Aug 17 12:45:16 2015 +0300
@@ -54,16 +54,16 @@
      *
      * <p> An attempt is made to write up to <i>r</i> bytes to the channel,
      * where <i>r</i> is the number of bytes remaining in the buffer, that is,
-     * <tt>src.remaining()</tt>, at the moment this method is invoked.
+     * {@code src.remaining()}, at the moment this method is invoked.
      *
      * <p> Suppose that a byte sequence of length <i>n</i> is written, where
-     * <tt>0</tt>&nbsp;<tt>&lt;=</tt>&nbsp;<i>n</i>&nbsp;<tt>&lt;=</tt>&nbsp;<i>r</i>.
+     * {@code 0}&nbsp;{@code <=}&nbsp;<i>n</i>&nbsp;{@code <=}&nbsp;<i>r</i>.
      * This byte sequence will be transferred from the buffer starting at index
      * <i>p</i>, where <i>p</i> is the buffer's position at the moment this
      * method is invoked; the index of the last byte written will be
-     * <i>p</i>&nbsp;<tt>+</tt>&nbsp;<i>n</i>&nbsp;<tt>-</tt>&nbsp;<tt>1</tt>.
+     * <i>p</i>&nbsp;{@code +}&nbsp;<i>n</i>&nbsp;{@code -}&nbsp;{@code 1}.
      * Upon return the buffer's position will be equal to
-     * <i>p</i>&nbsp;<tt>+</tt>&nbsp;<i>n</i>; its limit will not have changed.
+     * <i>p</i>&nbsp;{@code +}&nbsp;<i>n</i>; its limit will not have changed.
      *
      * <p> Unless otherwise specified, a write operation will return only after
      * writing all of the <i>r</i> requested bytes.  Some types of channels,
--- a/jdk/src/java.base/share/classes/java/nio/channels/package-info.java	Thu Apr 09 12:29:31 2015 +0200
+++ b/jdk/src/java.base/share/classes/java/nio/channels/package-info.java	Mon Aug 17 12:45:16 2015 +0300
@@ -32,29 +32,29 @@
  *
  * <blockquote><table cellspacing=1 cellpadding=0 summary="Lists channels and their descriptions">
  * <tr><th align="left">Channels</th><th align="left">Description</th></tr>
- * <tr><td valign=top><tt><i>{@link java.nio.channels.Channel}</i></tt></td>
+ * <tr><td valign=top><i>{@link java.nio.channels.Channel}</i></td>
  *     <td>A nexus for I/O operations</td></tr>
- * <tr><td valign=top><tt>&nbsp;&nbsp;<i>{@link java.nio.channels.ReadableByteChannel}</i></tt></td>
+ * <tr><td valign=top>&nbsp;&nbsp;<i>{@link java.nio.channels.ReadableByteChannel}</i></td>
  *     <td>Can read into a buffer</td></tr>
- * <tr><td valign=top><tt>&nbsp;&nbsp;&nbsp;&nbsp;<i>{@link java.nio.channels.ScatteringByteChannel}&nbsp;&nbsp;</i></tt></td>
+ * <tr><td valign=top>&nbsp;&nbsp;&nbsp;&nbsp;<i>{@link java.nio.channels.ScatteringByteChannel}&nbsp;&nbsp;</i></td>
  *     <td>Can read into a sequence of&nbsp;buffers</td></tr>
- * <tr><td valign=top><tt>&nbsp;&nbsp;<i>{@link java.nio.channels.WritableByteChannel}</i></tt></td>
+ * <tr><td valign=top>&nbsp;&nbsp;<i>{@link java.nio.channels.WritableByteChannel}</i></td>
  *     <td>Can write from a buffer</td></tr>
- * <tr><td valign=top><tt>&nbsp;&nbsp;&nbsp;&nbsp;<i>{@link java.nio.channels.GatheringByteChannel}</i></tt></td>
+ * <tr><td valign=top>&nbsp;&nbsp;&nbsp;&nbsp;<i>{@link java.nio.channels.GatheringByteChannel}</i></td>
  *     <td>Can write from a sequence of&nbsp;buffers</td></tr>
- * <tr><td valign=top><tt>&nbsp;&nbsp;<i>{@link java.nio.channels.ByteChannel}</i></tt></td>
+ * <tr><td valign=top>&nbsp;&nbsp;<i>{@link java.nio.channels.ByteChannel}</i></td>
  *     <td>Can read/write to/from a&nbsp;buffer</td></tr>
- * <tr><td valign=top><tt>&nbsp;&nbsp;&nbsp;&nbsp;<i>{@link java.nio.channels.SeekableByteChannel}</i></tt></td>
+ * <tr><td valign=top>&nbsp;&nbsp;&nbsp;&nbsp;<i>{@link java.nio.channels.SeekableByteChannel}</i></td>
  *     <td>A {@code ByteChannel} connected to an entity that contains a variable-length sequence of bytes</td></tr>
- * <tr><td valign=top><tt>&nbsp;&nbsp;<i>{@link java.nio.channels.AsynchronousChannel}</i></tt></td>
+ * <tr><td valign=top>&nbsp;&nbsp;<i>{@link java.nio.channels.AsynchronousChannel}</i></td>
  *     <td>Supports asynchronous I/O operations.</td></tr>
- * <tr><td valign=top><tt>&nbsp;&nbsp;&nbsp;&nbsp;<i>{@link java.nio.channels.AsynchronousByteChannel}</i></tt></td>
+ * <tr><td valign=top>&nbsp;&nbsp;&nbsp;&nbsp;<i>{@link java.nio.channels.AsynchronousByteChannel}</i></td>
  *     <td>Can read and write bytes asynchronously</td></tr>
- * <tr><td valign=top><tt>&nbsp;&nbsp;<i>{@link java.nio.channels.NetworkChannel}</i></tt></td>
+ * <tr><td valign=top>&nbsp;&nbsp;<i>{@link java.nio.channels.NetworkChannel}</i></td>
  *     <td>A channel to a network socket</td></tr>
- * <tr><td valign=top><tt>&nbsp;&nbsp;&nbsp;&nbsp;<i>{@link java.nio.channels.MulticastChannel}</i></tt></td>
+ * <tr><td valign=top>&nbsp;&nbsp;&nbsp;&nbsp;<i>{@link java.nio.channels.MulticastChannel}</i></td>
  *     <td>Can join Internet Protocol (IP) multicast groups</td></tr>
- * <tr><td valign=top><tt>{@link java.nio.channels.Channels}</tt></td>
+ * <tr><td valign=top>{@link java.nio.channels.Channels}</td>
  *     <td>Utility methods for channel/stream interoperation</td></tr>
  * </table></blockquote>
  *
@@ -99,8 +99,8 @@
  * Internet Protocol (IP) multicast groups.
  *
  * <p> The {@link java.nio.channels.Channels} utility class defines static methods
- * that support the interoperation of the stream classes of the <tt>{@link
- * java.io}</tt> package with the channel classes of this package.  An appropriate
+ * that support the interoperation of the stream classes of the {@link
+ * java.io} package with the channel classes of this package.  An appropriate
  * channel can be constructed from an {@link java.io.InputStream} or an {@link
  * java.io.OutputStream}, and conversely an {@link java.io.InputStream} or an
  * {@link java.io.OutputStream} can be constructed from a channel.  A {@link
@@ -111,11 +111,11 @@
  *
  * <blockquote><table cellspacing=1 cellpadding=0 summary="Lists file channels and their descriptions">
  * <tr><th align="left">File channels</th><th align="left">Description</th></tr>
- * <tr><td valign=top><tt>{@link java.nio.channels.FileChannel}</tt></td>
+ * <tr><td valign=top>{@link java.nio.channels.FileChannel}</td>
  *     <td>Reads, writes, maps, and manipulates files</td></tr>
- * <tr><td valign=top><tt>{@link java.nio.channels.FileLock}</tt></td>
+ * <tr><td valign=top>{@link java.nio.channels.FileLock}</td>
  *     <td>A lock on a (region of a) file</td></tr>
- * <tr><td valign=top><tt>{@link java.nio.MappedByteBuffer}&nbsp;&nbsp;</tt></td>
+ * <tr><td valign=top>{@link java.nio.MappedByteBuffer}&nbsp;&nbsp;</td>
  *     <td>A direct byte buffer mapped to a region of a&nbsp;file</td></tr>
  * </table></blockquote>
  *
@@ -133,30 +133,30 @@
  * java.nio.channels.FileChannel#open open} methods, or by invoking the {@code
  * getChannel} method of a {@link java.io.FileInputStream}, {@link
  * java.io.FileOutputStream}, or {@link java.io.RandomAccessFile} to return a
- * file channel connected to the same underlying file as the <tt>{@link java.io}</tt>
+ * file channel connected to the same underlying file as the {@link java.io}
  * class.
  *
  * <a name="multiplex"></a>
  * <blockquote><table cellspacing=1 cellpadding=0 summary="Lists multiplexed, non-blocking channels and their descriptions">
  * <tr><th align="left">Multiplexed, non-blocking I/O</th><th align="left"><p>Description</th></tr>
- * <tr><td valign=top><tt>{@link java.nio.channels.SelectableChannel}</tt></td>
+ * <tr><td valign=top>{@link java.nio.channels.SelectableChannel}</td>
  *     <td>A channel that can be multiplexed</td></tr>
- * <tr><td valign=top><tt>&nbsp;&nbsp;{@link java.nio.channels.DatagramChannel}</tt></td>
+ * <tr><td valign=top>&nbsp;&nbsp;{@link java.nio.channels.DatagramChannel}</td>
  *     <td>A channel to a datagram-oriented socket</td></tr>
- * <tr><td valign=top><tt>&nbsp;&nbsp;{@link java.nio.channels.Pipe.SinkChannel}</tt></td>
+ * <tr><td valign=top>&nbsp;&nbsp;{@link java.nio.channels.Pipe.SinkChannel}</td>
  *     <td>The write end of a pipe</td></tr>
- * <tr><td valign=top><tt>&nbsp;&nbsp;{@link java.nio.channels.Pipe.SourceChannel}</tt></td>
+ * <tr><td valign=top>&nbsp;&nbsp;{@link java.nio.channels.Pipe.SourceChannel}</td>
  *     <td>The read end of a pipe</td></tr>
- * <tr><td valign=top><tt>&nbsp;&nbsp;{@link java.nio.channels.ServerSocketChannel}&nbsp;&nbsp;</tt></td>
+ * <tr><td valign=top>&nbsp;&nbsp;{@link java.nio.channels.ServerSocketChannel}&nbsp;&nbsp;</td>
  *     <td>A channel to a stream-oriented listening socket</td></tr>
- * <tr><td valign=top><tt>&nbsp;&nbsp;{@link java.nio.channels.SocketChannel}</tt></td>
+ * <tr><td valign=top>&nbsp;&nbsp;{@link java.nio.channels.SocketChannel}</td>
  *     <td>A channel for a stream-oriented connecting socket</td></tr>
- * <tr><td valign=top><tt>{@link java.nio.channels.Selector}</tt></td>
+ * <tr><td valign=top>{@link java.nio.channels.Selector}</td>
  *     <td>A multiplexor of selectable channels</td></tr>
- * <tr><td valign=top><tt>{@link java.nio.channels.SelectionKey}</tt></td>
+ * <tr><td valign=top>{@link java.nio.channels.SelectionKey}</td>
  *     <td>A token representing the registration <br> of a channel
  *     with&nbsp;a&nbsp;selector</td></tr>
- * <tr><td valign=top><tt>{@link java.nio.channels.Pipe}</tt></td>
+ * <tr><td valign=top>{@link java.nio.channels.Pipe}</td>
  *     <td>Two channels that form a unidirectional&nbsp;pipe</td></tr>
  * </table></blockquote>
  *
@@ -194,18 +194,18 @@
  *
  * <p> This package defines selectable-channel classes corresponding to the {@link
  * java.net.DatagramSocket}, {@link java.net.ServerSocket}, and {@link
- * java.net.Socket} classes defined in the <tt>{@link java.net}</tt> package.
+ * java.net.Socket} classes defined in the {@link java.net} package.
  * Minor changes to these classes have been made in order to support sockets that
  * are associated with channels.  This package also defines a simple class that
  * implements unidirectional pipes.  In all cases, a new selectable channel is
- * created by invoking the static <tt>open</tt> method of the corresponding class.
+ * created by invoking the static {@code open} method of the corresponding class.
  * If a channel needs an associated socket then a socket will be created as a side
  * effect of this operation.
  *
  * <p> The implementation of selectors, selectable channels, and selection keys
  * can be replaced by "plugging in" an alternative definition or instance of the
- * {@link java.nio.channels.spi.SelectorProvider} class defined in the <tt>{@link
- * java.nio.channels.spi}</tt> package.  It is not expected that many developers
+ * {@link java.nio.channels.spi.SelectorProvider} class defined in the {@link
+ * java.nio.channels.spi} package.  It is not expected that many developers
  * will actually make use of this facility; it is provided primarily so that
  * sophisticated users can take advantage of operating-system-specific
  * I/O-multiplexing mechanisms when very high performance is required.
@@ -215,8 +215,8 @@
  * java.nio.channels.spi.AbstractInterruptibleChannel}, {@link
  * java.nio.channels.spi.AbstractSelectableChannel}, {@link
  * java.nio.channels.spi.AbstractSelectionKey}, and {@link
- * java.nio.channels.spi.AbstractSelector} classes in the <tt>{@link
- * java.nio.channels.spi}</tt> package.  When defining a custom selector provider,
+ * java.nio.channels.spi.AbstractSelector} classes in the {@link
+ * java.nio.channels.spi} package.  When defining a custom selector provider,
  * only the {@link java.nio.channels.spi.AbstractSelector} and {@link
  * java.nio.channels.spi.AbstractSelectionKey} classes should be subclassed
  * directly; custom channel classes should extend the appropriate {@link
@@ -226,15 +226,15 @@
  *
  * <blockquote><table cellspacing=1 cellpadding=0 summary="Lists asynchronous channels and their descriptions">
  * <tr><th align="left">Asynchronous I/O</th><th align="left">Description</th></tr>
- * <tr><td valign=top><tt>{@link java.nio.channels.AsynchronousFileChannel}</tt></td>
+ * <tr><td valign=top>{@link java.nio.channels.AsynchronousFileChannel}</td>
  *     <td>An asynchronous channel for reading, writing, and manipulating a file</td></tr>
- * <tr><td valign=top><tt>{@link java.nio.channels.AsynchronousSocketChannel}</tt></td>
+ * <tr><td valign=top>{@link java.nio.channels.AsynchronousSocketChannel}</td>
  *     <td>An asynchronous channel to a stream-oriented connecting socket</td></tr>
- * <tr><td valign=top><tt>{@link java.nio.channels.AsynchronousServerSocketChannel}&nbsp;&nbsp;</tt></td>
+ * <tr><td valign=top>{@link java.nio.channels.AsynchronousServerSocketChannel}&nbsp;&nbsp;</td>
  *     <td>An asynchronous channel to a stream-oriented listening socket</td></tr>
- * <tr><td valign=top><tt>{@link java.nio.channels.CompletionHandler}</tt></td>
+ * <tr><td valign=top>{@link java.nio.channels.CompletionHandler}</td>
  *     <td>A handler for consuming the result of an asynchronous operation</td></tr>
- * <tr><td valign=top><tt>{@link java.nio.channels.AsynchronousChannelGroup}</tt></td>
+ * <tr><td valign=top>{@link java.nio.channels.AsynchronousChannelGroup}</td>
  *     <td>A grouping of asynchronous channels for the purpose of resource sharing</td></tr>
  * </table></blockquote>
  *
@@ -272,13 +272,13 @@
  * <p> As with selectors, the implementation of asynchronous channels can be
  * replaced by "plugging in" an alternative definition or instance of the {@link
  * java.nio.channels.spi.AsynchronousChannelProvider} class defined in the
- * <tt>{@link java.nio.channels.spi}</tt> package.  It is not expected that many
+ * {@link java.nio.channels.spi} package.  It is not expected that many
  * developers will actually make use of this facility; it is provided primarily
  * so that sophisticated users can take advantage of operating-system-specific
  * asynchronous I/O mechanisms when very high performance is required.
  *
  * <hr width="80%">
- * <p> Unless otherwise noted, passing a <tt>null</tt> argument to a constructor
+ * <p> Unless otherwise noted, passing a {@code null} argument to a constructor
  * or method in any class or interface in this package will cause a {@link
  * java.lang.NullPointerException NullPointerException} to be thrown.
  *
--- a/jdk/src/java.base/share/classes/java/nio/channels/spi/AbstractInterruptibleChannel.java	Thu Apr 09 12:29:31 2015 +0200
+++ b/jdk/src/java.base/share/classes/java/nio/channels/spi/AbstractInterruptibleChannel.java	Mon Aug 17 12:45:16 2015 +0300
@@ -46,7 +46,7 @@
  * before and after, respectively, invoking an I/O operation that might block
  * indefinitely.  In order to ensure that the {@link #end end} method is always
  * invoked, these methods should be used within a
- * <tt>try</tt>&nbsp;...&nbsp;<tt>finally</tt> block:
+ * {@code try}&nbsp;...&nbsp;{@code finally} block:
  *
  * <blockquote><pre>
  * boolean completed = false;
@@ -58,11 +58,11 @@
  *     end(completed);
  * }</pre></blockquote>
  *
- * <p> The <tt>completed</tt> argument to the {@link #end end} method tells
+ * <p> The {@code completed} argument to the {@link #end end} method tells
  * whether or not the I/O operation actually completed, that is, whether it had
  * any effect that would be visible to the invoker.  In the case of an
  * operation that reads bytes, for example, this argument should be
- * <tt>true</tt> if, and only if, some bytes were actually transferred into the
+ * {@code true} if, and only if, some bytes were actually transferred into the
  * invoker's target buffer.
  *
  * <p> A concrete channel class must also implement the {@link
@@ -148,7 +148,7 @@
      * Marks the beginning of an I/O operation that might block indefinitely.
      *
      * <p> This method should be invoked in tandem with the {@link #end end}
-     * method, using a <tt>try</tt>&nbsp;...&nbsp;<tt>finally</tt> block as
+     * method, using a {@code try}&nbsp;...&nbsp;{@code finally} block as
      * shown <a href="#be">above</a>, in order to implement asynchronous
      * closing and interruption for this channel.  </p>
      */
@@ -177,12 +177,12 @@
      * Marks the end of an I/O operation that might block indefinitely.
      *
      * <p> This method should be invoked in tandem with the {@link #begin
-     * begin} method, using a <tt>try</tt>&nbsp;...&nbsp;<tt>finally</tt> block
+     * begin} method, using a {@code try}&nbsp;...&nbsp;{@code finally} block
      * as shown <a href="#be">above</a>, in order to implement asynchronous
      * closing and interruption for this channel.  </p>
      *
      * @param  completed
-     *         <tt>true</tt> if, and only if, the I/O operation completed
+     *         {@code true} if, and only if, the I/O operation completed
      *         successfully, that is, had some effect that would be visible to
      *         the operation's invoker
      *
--- a/jdk/src/java.base/share/classes/java/nio/channels/spi/AbstractSelectableChannel.java	Thu Apr 09 12:29:31 2015 +0200
+++ b/jdk/src/java.base/share/classes/java/nio/channels/spi/AbstractSelectableChannel.java	Mon Aug 17 12:45:16 2015 +0300
@@ -305,8 +305,8 @@
      * changing the blocking mode.  This method is only invoked if the new mode
      * is different from the current mode.  </p>
      *
-     * @param  block  If <tt>true</tt> then this channel will be placed in
-     *                blocking mode; if <tt>false</tt> then it will be placed
+     * @param  block  If {@code true} then this channel will be placed in
+     *                blocking mode; if {@code false} then it will be placed
      *                non-blocking mode
      *
      * @throws IOException
--- a/jdk/src/java.base/share/classes/java/nio/channels/spi/AbstractSelector.java	Thu Apr 09 12:29:31 2015 +0200
+++ b/jdk/src/java.base/share/classes/java/nio/channels/spi/AbstractSelector.java	Mon Aug 17 12:45:16 2015 +0300
@@ -43,7 +43,7 @@
  * after, respectively, invoking an I/O operation that might block
  * indefinitely.  In order to ensure that the {@link #end end} method is always
  * invoked, these methods should be used within a
- * <tt>try</tt>&nbsp;...&nbsp;<tt>finally</tt> block:
+ * {@code try}&nbsp;...&nbsp;{@code finally} block:
  *
  * <blockquote><pre>
  * try {
@@ -197,7 +197,7 @@
      * Marks the beginning of an I/O operation that might block indefinitely.
      *
      * <p> This method should be invoked in tandem with the {@link #end end}
-     * method, using a <tt>try</tt>&nbsp;...&nbsp;<tt>finally</tt> block as
+     * method, using a {@code try}&nbsp;...&nbsp;{@code finally} block as
      * shown <a href="#be">above</a>, in order to implement interruption for
      * this selector.
      *
@@ -223,7 +223,7 @@
      * Marks the end of an I/O operation that might block indefinitely.
      *
      * <p> This method should be invoked in tandem with the {@link #begin begin}
-     * method, using a <tt>try</tt>&nbsp;...&nbsp;<tt>finally</tt> block as
+     * method, using a {@code try}&nbsp;...&nbsp;{@code finally} block as
      * shown <a href="#be">above</a>, in order to implement interruption for
      * this selector.  </p>
      */
--- a/jdk/src/java.base/share/classes/java/nio/channels/spi/AsynchronousChannelProvider.java	Thu Apr 09 12:29:31 2015 +0200
+++ b/jdk/src/java.base/share/classes/java/nio/channels/spi/AsynchronousChannelProvider.java	Mon Aug 17 12:45:16 2015 +0300
@@ -64,7 +64,7 @@
      *
      * @throws  SecurityException
      *          If a security manager has been installed and it denies
-     *          {@link RuntimePermission}<tt>("asynchronousChannelProvider")</tt>
+     *          {@link RuntimePermission}{@code ("asynchronousChannelProvider")}
      */
     protected AsynchronousChannelProvider() {
         this(checkPermission());
@@ -137,7 +137,7 @@
      * <ol>
      *
      *   <li><p> If the system property
-     *   <tt>java.nio.channels.spi.AsynchronousChannelProvider</tt> is defined
+     *   {@code java.nio.channels.spi.AsynchronousChannelProvider} is defined
      *   then it is taken to be the fully-qualified name of a concrete provider class.
      *   The class is loaded and instantiated; if this process fails then an
      *   unspecified error is thrown.  </p></li>
@@ -145,8 +145,8 @@
      *   <li><p> If a provider class has been installed in a jar file that is
      *   visible to the system class loader, and that jar file contains a
      *   provider-configuration file named
-     *   <tt>java.nio.channels.spi.AsynchronousChannelProvider</tt> in the resource
-     *   directory <tt>META-INF/services</tt>, then the first class name
+     *   {@code java.nio.channels.spi.AsynchronousChannelProvider} in the resource
+     *   directory {@code META-INF/services}, then the first class name
      *   specified in that file is taken.  The class is loaded and
      *   instantiated; if this process fails then an unspecified error is
      *   thrown.  </p></li>
--- a/jdk/src/java.base/share/classes/java/nio/channels/spi/SelectorProvider.java	Thu Apr 09 12:29:31 2015 +0200
+++ b/jdk/src/java.base/share/classes/java/nio/channels/spi/SelectorProvider.java	Mon Aug 17 12:45:16 2015 +0300
@@ -46,7 +46,7 @@
  * #provider() provider} method.  The first invocation of that method will locate
  * the default provider as specified below.
  *
- * <p> The system-wide default provider is used by the static <tt>open</tt>
+ * <p> The system-wide default provider is used by the static {@code open}
  * methods of the {@link java.nio.channels.DatagramChannel#open
  * DatagramChannel}, {@link java.nio.channels.Pipe#open Pipe}, {@link
  * java.nio.channels.Selector#open Selector}, {@link
@@ -54,7 +54,7 @@
  * java.nio.channels.SocketChannel#open SocketChannel} classes.  It is also
  * used by the {@link java.lang.System#inheritedChannel System.inheritedChannel()}
  * method. A program may make use of a provider other than the default provider
- * by instantiating that provider and then directly invoking the <tt>open</tt>
+ * by instantiating that provider and then directly invoking the {@code open}
  * methods defined in this class.
  *
  * <p> All of the methods in this class are safe for use by multiple concurrent
@@ -84,7 +84,7 @@
      *
      * @throws  SecurityException
      *          If a security manager has been installed and it denies
-     *          {@link RuntimePermission}<tt>("selectorProvider")</tt>
+     *          {@link RuntimePermission}{@code ("selectorProvider")}
      */
     protected SelectorProvider() {
         this(checkPermission());
@@ -142,7 +142,7 @@
      * <ol>
      *
      *   <li><p> If the system property
-     *   <tt>java.nio.channels.spi.SelectorProvider</tt> is defined then it is
+     *   {@code java.nio.channels.spi.SelectorProvider} is defined then it is
      *   taken to be the fully-qualified name of a concrete provider class.
      *   The class is loaded and instantiated; if this process fails then an
      *   unspecified error is thrown.  </p></li>
@@ -150,8 +150,8 @@
      *   <li><p> If a provider class has been installed in a jar file that is
      *   visible to the system class loader, and that jar file contains a
      *   provider-configuration file named
-     *   <tt>java.nio.channels.spi.SelectorProvider</tt> in the resource
-     *   directory <tt>META-INF/services</tt>, then the first class name
+     *   {@code java.nio.channels.spi.SelectorProvider} in the resource
+     *   directory {@code META-INF/services}, then the first class name
      *   specified in that file is taken.  The class is loaded and
      *   instantiated; if this process fails then an unspecified error is
      *   thrown.  </p></li>
@@ -305,14 +305,14 @@
      * returned. Subsequent invocations of this method return the same
      * channel. </p>
      *
-     * @return  The inherited channel, if any, otherwise <tt>null</tt>.
+     * @return  The inherited channel, if any, otherwise {@code null}.
      *
      * @throws  IOException
      *          If an I/O error occurs
      *
      * @throws  SecurityException
      *          If a security manager has been installed and it denies
-     *          {@link RuntimePermission}<tt>("inheritedChannel")</tt>
+     *          {@link RuntimePermission}{@code ("inheritedChannel")}
      *
      * @since 1.5
      */
--- a/jdk/src/java.base/share/classes/java/nio/charset/Charset-X-Coder.java.template	Thu Apr 09 12:29:31 2015 +0200
+++ b/jdk/src/java.base/share/classes/java/nio/charset/Charset-X-Coder.java.template	Mon Aug 17 12:45:16 2015 +0300
@@ -55,12 +55,12 @@
  *   has not been used before; </p></li>
  *
  *   <li><p> Invoke the {@link #$code$ $code$} method zero or more times, as
- *   long as additional input may be available, passing <tt>false</tt> for the
- *   <tt>endOfInput</tt> argument and filling the input buffer and flushing the
+ *   long as additional input may be available, passing {@code false} for the
+ *   {@code endOfInput} argument and filling the input buffer and flushing the
  *   output buffer between invocations; </p></li>
  *
  *   <li><p> Invoke the {@link #$code$ $code$} method one final time, passing
- *   <tt>true</tt> for the <tt>endOfInput</tt> argument; and then </p></li>
+ *   {@code true} for the {@code endOfInput} argument; and then </p></li>
  *
  *   <li><p> Invoke the {@link #flush flush} method so that the $coder$ can
  *   flush any internal state to the output buffer. </p></li>
@@ -175,7 +175,7 @@
      *         $otype$s that will be produced for each input $itype$
      *
      * @param  replacement
-     *         The initial replacement; must not be <tt>null</tt>, must have
+     *         The initial replacement; must not be {@code null}, must have
      *         non-zero length, must not be longer than max$ItypesPerOtype$,
      *         and must be {@linkplain #isLegalReplacement legal}
      *
@@ -248,7 +248,7 @@
      * Returns this $coder$'s replacement value.
      *
      * @return  This $coder$'s current replacement,
-     *          which is never <tt>null</tt> and is never empty
+     *          which is never {@code null} and is never empty
      */
     public final $replType$ replacement() {
 #if[decoder]
@@ -267,7 +267,7 @@
      * replacement is acceptable.  </p>
      *
      * @param  newReplacement  The new replacement; must not be
-     *         <tt>null</tt>, must have non-zero length,
+     *         {@code null}, must have non-zero length,
 #if[decoder]
      *         and must not be longer than the value returned by the
      *         {@link #max$ItypesPerOtype$() max$ItypesPerOtype$} method
@@ -332,7 +332,7 @@
      *
      * @param  repl  The byte array to be tested
      *
-     * @return  <tt>true</tt> if, and only if, the given byte array
+     * @return  {@code true} if, and only if, the given byte array
      *          is a legal replacement value for this encoder
      */
     public boolean isLegalReplacement(byte[] repl) {
@@ -358,7 +358,7 @@
     /**
      * Returns this $coder$'s current action for malformed-input errors.
      *
-     * @return The current malformed-input action, which is never <tt>null</tt>
+     * @return The current malformed-input action, which is never {@code null}
      */
     public CodingErrorAction malformedInputAction() {
         return malformedInputAction;
@@ -370,7 +370,7 @@
      * <p> This method invokes the {@link #implOnMalformedInput
      * implOnMalformedInput} method, passing the new action.  </p>
      *
-     * @param  newAction  The new action; must not be <tt>null</tt>
+     * @param  newAction  The new action; must not be {@code null}
      *
      * @return  This $coder$
      *
@@ -400,7 +400,7 @@
      * Returns this $coder$'s current action for unmappable-character errors.
      *
      * @return The current unmappable-character action, which is never
-     *         <tt>null</tt>
+     *         {@code null}
      */
     public CodingErrorAction unmappableCharacterAction() {
         return unmappableCharacterAction;
@@ -412,7 +412,7 @@
      * <p> This method invokes the {@link #implOnUnmappableCharacter
      * implOnUnmappableCharacter} method, passing the new action.  </p>
      *
-     * @param  newAction  The new action; must not be <tt>null</tt>
+     * @param  newAction  The new action; must not be {@code null}
      *
      * @return  This $coder$
      *
@@ -521,16 +521,16 @@
      * operation then care should be taken to preserve any $itype$s remaining
      * in the input buffer so that they are available to the next invocation.
      *
-     * <p> The <tt>endOfInput</tt> parameter advises this method as to whether
+     * <p> The {@code endOfInput} parameter advises this method as to whether
      * the invoker can provide further input beyond that contained in the given
      * input buffer.  If there is a possibility of providing additional input
-     * then the invoker should pass <tt>false</tt> for this parameter; if there
+     * then the invoker should pass {@code false} for this parameter; if there
      * is no possibility of providing further input then the invoker should
-     * pass <tt>true</tt>.  It is not erroneous, and in fact it is quite
-     * common, to pass <tt>false</tt> in one invocation and later discover that
+     * pass {@code true}.  It is not erroneous, and in fact it is quite
+     * common, to pass {@code false} in one invocation and later discover that
      * no further input was actually available.  It is critical, however, that
      * the final invocation of this method in a sequence of invocations always
-     * pass <tt>true</tt> so that any remaining un$code$d input will be treated
+     * pass {@code true} so that any remaining un$code$d input will be treated
      * as being malformed.
      *
      * <p> This method works by invoking the {@link #$code$Loop $code$Loop}
@@ -545,7 +545,7 @@
      *         The output $otype$ buffer
      *
      * @param  endOfInput
-     *         <tt>true</tt> if, and only if, the invoker can provide no
+     *         {@code true} if, and only if, the invoker can provide no
      *         additional input $itype$s beyond those in the given buffer
      *
      * @return  A coder-result object describing the reason for termination
@@ -553,9 +553,9 @@
      * @throws  IllegalStateException
      *          If $a$ $coding$ operation is already in progress and the previous
      *          step was an invocation neither of the {@link #reset reset}
-     *          method, nor of this method with a value of <tt>false</tt> for
-     *          the <tt>endOfInput</tt> parameter, nor of this method with a
-     *          value of <tt>true</tt> for the <tt>endOfInput</tt> parameter
+     *          method, nor of this method with a value of {@code false} for
+     *          the {@code endOfInput} parameter, nor of this method with a
+     *          value of {@code true} for the {@code endOfInput} parameter
      *          but a return value indicating an incomplete $coding$ operation
      *
      * @throws  CoderMalfunctionError
@@ -659,7 +659,7 @@
      *          invocation neither of the {@link #flush flush} method nor of
      *          the three-argument {@link
      *          #$code$($Itype$Buffer,$Otype$Buffer,boolean) $code$} method
-     *          with a value of <tt>true</tt> for the <tt>endOfInput</tt>
+     *          with a value of {@code true} for the {@code endOfInput}
      *          parameter
      */
     public final CoderResult flush($Otype$Buffer out) {
@@ -824,10 +824,10 @@
      * Tells whether or not this decoder implements an auto-detecting charset.
      *
      * <p> The default implementation of this method always returns
-     * <tt>false</tt>; it should be overridden by auto-detecting decoders to
-     * return <tt>true</tt>.  </p>
+     * {@code false}; it should be overridden by auto-detecting decoders to
+     * return {@code true}.  </p>
      *
-     * @return  <tt>true</tt> if, and only if, this decoder implements an
+     * @return  {@code true} if, and only if, this decoder implements an
      *          auto-detecting charset
      */
     public boolean isAutoDetecting() {
@@ -840,21 +840,21 @@
      *
      * <p> If this decoder implements an auto-detecting charset then at a
      * single point during a decoding operation this method may start returning
-     * <tt>true</tt> to indicate that a specific charset has been detected in
+     * {@code true} to indicate that a specific charset has been detected in
      * the input byte sequence.  Once this occurs, the {@link #detectedCharset
      * detectedCharset} method may be invoked to retrieve the detected charset.
      *
-     * <p> That this method returns <tt>false</tt> does not imply that no bytes
+     * <p> That this method returns {@code false} does not imply that no bytes
      * have yet been decoded.  Some auto-detecting decoders are capable of
      * decoding some, or even all, of an input byte sequence without fixing on
      * a particular charset.
      *
      * <p> The default implementation of this method always throws an {@link
      * UnsupportedOperationException}; it should be overridden by
-     * auto-detecting decoders to return <tt>true</tt> once the input charset
+     * auto-detecting decoders to return {@code true} once the input charset
      * has been determined.  </p>
      *
-     * @return  <tt>true</tt> if, and only if, this decoder has detected a
+     * @return  {@code true} if, and only if, this decoder has detected a
      *          specific charset
      *
      * @throws  UnsupportedOperationException
@@ -880,7 +880,7 @@
      * auto-detecting decoders to return the appropriate value.  </p>
      *
      * @return  The charset detected by this auto-detecting decoder,
-     *          or <tt>null</tt> if the charset has not yet been determined
+     *          or {@code null} if the charset has not yet been determined
      *
      * @throws  IllegalStateException
      *          If insufficient bytes have been read to determine a charset
@@ -920,7 +920,7 @@
     /**
      * Tells whether or not this encoder can encode the given character.
      *
-     * <p> This method returns <tt>false</tt> if the given character is a
+     * <p> This method returns {@code false} if the given character is a
      * surrogate character; such characters can be interpreted only when they
      * are members of a pair consisting of a high surrogate followed by a low
      * surrogate.  The {@link #canEncode(java.lang.CharSequence)
@@ -937,7 +937,7 @@
      * @param   c
      *          The given character
      *
-     * @return  <tt>true</tt> if, and only if, this encoder can encode
+     * @return  {@code true} if, and only if, this encoder can encode
      *          the given character
      *
      * @throws  IllegalStateException
@@ -954,7 +954,7 @@
      * Tells whether or not this encoder can encode the given character
      * sequence.
      *
-     * <p> If this method returns <tt>false</tt> for a particular character
+     * <p> If this method returns {@code false} for a particular character
      * sequence then more information about why the sequence cannot be encoded
      * may be obtained by performing a full <a href="#steps">encoding
      * operation</a>.
@@ -968,7 +968,7 @@
      * @param   cs
      *          The given character sequence
      *
-     * @return  <tt>true</tt> if, and only if, this encoder can encode
+     * @return  {@code true} if, and only if, this encoder can encode
      *          the given character without throwing any exceptions and without
      *          performing any replacements
      *
--- a/jdk/src/java.base/share/classes/java/nio/charset/Charset.java	Thu Apr 09 12:29:31 2015 +0200
+++ b/jdk/src/java.base/share/classes/java/nio/charset/Charset.java	Mon Aug 17 12:45:16 2015 +0300
@@ -73,29 +73,29 @@
  *
  * <ul>
  *
- *   <li> The uppercase letters <tt>'A'</tt> through <tt>'Z'</tt>
- *        (<tt>'&#92;u0041'</tt>&nbsp;through&nbsp;<tt>'&#92;u005a'</tt>),
+ *   <li> The uppercase letters {@code 'A'} through {@code 'Z'}
+ *        (<code>'&#92;u0041'</code>&nbsp;through&nbsp;<code>'&#92;u005a'</code>),
  *
- *   <li> The lowercase letters <tt>'a'</tt> through <tt>'z'</tt>
- *        (<tt>'&#92;u0061'</tt>&nbsp;through&nbsp;<tt>'&#92;u007a'</tt>),
+ *   <li> The lowercase letters {@code 'a'} through {@code 'z'}
+ *        (<code>'&#92;u0061'</code>&nbsp;through&nbsp;<code>'&#92;u007a'</code>),
  *
- *   <li> The digits <tt>'0'</tt> through <tt>'9'</tt>
- *        (<tt>'&#92;u0030'</tt>&nbsp;through&nbsp;<tt>'&#92;u0039'</tt>),
+ *   <li> The digits {@code '0'} through {@code '9'}
+ *        (<code>'&#92;u0030'</code>&nbsp;through&nbsp;<code>'&#92;u0039'</code>),
  *
- *   <li> The dash character <tt>'-'</tt>
- *        (<tt>'&#92;u002d'</tt>,&nbsp;<small>HYPHEN-MINUS</small>),
+ *   <li> The dash character {@code '-'}
+ *        (<code>'&#92;u002d'</code>,&nbsp;<small>HYPHEN-MINUS</small>),
  *
- *   <li> The plus character <tt>'+'</tt>
- *        (<tt>'&#92;u002b'</tt>,&nbsp;<small>PLUS SIGN</small>),
+ *   <li> The plus character {@code '+'}
+ *        (<code>'&#92;u002b'</code>,&nbsp;<small>PLUS SIGN</small>),
  *
- *   <li> The period character <tt>'.'</tt>
- *        (<tt>'&#92;u002e'</tt>,&nbsp;<small>FULL STOP</small>),
+ *   <li> The period character {@code '.'}
+ *        (<code>'&#92;u002e'</code>,&nbsp;<small>FULL STOP</small>),
  *
- *   <li> The colon character <tt>':'</tt>
- *        (<tt>'&#92;u003a'</tt>,&nbsp;<small>COLON</small>), and
+ *   <li> The colon character {@code ':'}
+ *        (<code>'&#92;u003a'</code>,&nbsp;<small>COLON</small>), and
  *
- *   <li> The underscore character <tt>'_'</tt>
- *        (<tt>'&#92;u005f'</tt>,&nbsp;<small>LOW&nbsp;LINE</small>).
+ *   <li> The underscore character {@code '_'}
+ *        (<code>'&#92;u005f'</code>,&nbsp;<small>LOW&nbsp;LINE</small>).
  *
  * </ul>
  *
@@ -115,7 +115,7 @@
  * <p><a name="hn">Some charsets have an <i>historical name</i> that is defined for
  * compatibility with previous versions of the Java platform.</a>  A charset's
  * historical name is either its canonical name or one of its aliases.  The
- * historical name is returned by the <tt>getEncoding()</tt> methods of the
+ * historical name is returned by the {@code getEncoding()} methods of the
  * {@link java.io.InputStreamReader#getEncoding InputStreamReader} and {@link
  * java.io.OutputStreamWriter#getEncoding OutputStreamWriter} classes.
  *
@@ -128,7 +128,7 @@
  * than one registry name then its canonical name must be the MIME-preferred
  * name and the other names in the registry must be valid aliases.  If a
  * supported charset is not listed in the IANA registry then its canonical name
- * must begin with one of the strings <tt>"X-"</tt> or <tt>"x-"</tt>.
+ * must begin with one of the strings {@code "X-"} or {@code "x-"}.
  *
  * <p> The IANA charset registry does change over time, and so the canonical
  * name and the aliases of a particular charset may also change over time.  To
@@ -148,53 +148,53 @@
  *
  * <blockquote><table width="80%" summary="Description of standard charsets">
  * <tr><th align="left">Charset</th><th align="left">Description</th></tr>
- * <tr><td valign=top><tt>US-ASCII</tt></td>
- *     <td>Seven-bit ASCII, a.k.a. <tt>ISO646-US</tt>,
+ * <tr><td valign=top>{@code US-ASCII}</td>
+ *     <td>Seven-bit ASCII, a.k.a. {@code ISO646-US},
  *         a.k.a. the Basic Latin block of the Unicode character set</td></tr>
- * <tr><td valign=top><tt>ISO-8859-1&nbsp;&nbsp;</tt></td>
- *     <td>ISO Latin Alphabet No. 1, a.k.a. <tt>ISO-LATIN-1</tt></td></tr>
- * <tr><td valign=top><tt>UTF-8</tt></td>
+ * <tr><td valign=top><code>ISO-8859-1&nbsp;&nbsp;</code></td>
+ *     <td>ISO Latin Alphabet No. 1, a.k.a. {@code ISO-LATIN-1}</td></tr>
+ * <tr><td valign=top>{@code UTF-8}</td>
  *     <td>Eight-bit UCS Transformation Format</td></tr>
- * <tr><td valign=top><tt>UTF-16BE</tt></td>
+ * <tr><td valign=top>{@code UTF-16BE}</td>
  *     <td>Sixteen-bit UCS Transformation Format,
  *         big-endian byte&nbsp;order</td></tr>
- * <tr><td valign=top><tt>UTF-16LE</tt></td>
+ * <tr><td valign=top>{@code UTF-16LE}</td>
  *     <td>Sixteen-bit UCS Transformation Format,
  *         little-endian byte&nbsp;order</td></tr>
- * <tr><td valign=top><tt>UTF-16</tt></td>
+ * <tr><td valign=top>{@code UTF-16}</td>
  *     <td>Sixteen-bit UCS Transformation Format,
  *         byte&nbsp;order identified by an optional byte-order mark</td></tr>
  * </table></blockquote>
  *
- * <p> The <tt>UTF-8</tt> charset is specified by <a
+ * <p> The {@code UTF-8} charset is specified by <a
  * href="http://www.ietf.org/rfc/rfc2279.txt"><i>RFC&nbsp;2279</i></a>; the
  * transformation format upon which it is based is specified in
  * Amendment&nbsp;2 of ISO&nbsp;10646-1 and is also described in the <a
  * href="http://www.unicode.org/unicode/standard/standard.html"><i>Unicode
  * Standard</i></a>.
  *
- * <p> The <tt>UTF-16</tt> charsets are specified by <a
+ * <p> The {@code UTF-16} charsets are specified by <a
  * href="http://www.ietf.org/rfc/rfc2781.txt"><i>RFC&nbsp;2781</i></a>; the
  * transformation formats upon which they are based are specified in
  * Amendment&nbsp;1 of ISO&nbsp;10646-1 and are also described in the <a
  * href="http://www.unicode.org/unicode/standard/standard.html"><i>Unicode
  * Standard</i></a>.
  *
- * <p> The <tt>UTF-16</tt> charsets use sixteen-bit quantities and are
+ * <p> The {@code UTF-16} charsets use sixteen-bit quantities and are
  * therefore sensitive to byte order.  In these encodings the byte order of a
  * stream may be indicated by an initial <i>byte-order mark</i> represented by
- * the Unicode character <tt>'&#92;uFEFF'</tt>.  Byte-order marks are handled
+ * the Unicode character <code>'&#92;uFEFF'</code>.  Byte-order marks are handled
  * as follows:
  *
  * <ul>
  *
- *   <li><p> When decoding, the <tt>UTF-16BE</tt> and <tt>UTF-16LE</tt>
+ *   <li><p> When decoding, the {@code UTF-16BE} and {@code UTF-16LE}
  *   charsets interpret the initial byte-order marks as a <small>ZERO-WIDTH
  *   NON-BREAKING SPACE</small>; when encoding, they do not write
  *   byte-order marks. </p></li>
 
  *
- *   <li><p> When decoding, the <tt>UTF-16</tt> charset interprets the
+ *   <li><p> When decoding, the {@code UTF-16} charset interprets the
  *   byte-order mark at the beginning of the input stream to indicate the
  *   byte-order of the stream but defaults to big-endian if there is no
  *   byte-order mark; when encoding, it uses big-endian byte order and writes
@@ -247,9 +247,9 @@
  * character-encoding scheme then the corresponding charset is usually
  * named for the coded character set; otherwise a charset is usually named
  * for the encoding scheme and, possibly, the locale of the coded
- * character sets that it supports.  Hence <tt>US-ASCII</tt> is both the
+ * character sets that it supports.  Hence {@code US-ASCII} is both the
  * name of a coded character set and of the charset that encodes it, while
- * <tt>EUC-JP</tt> is the name of the charset that encodes the
+ * {@code EUC-JP} is the name of the charset that encodes the
  * JIS&nbsp;X&nbsp;0201, JIS&nbsp;X&nbsp;0208, and JIS&nbsp;X&nbsp;0212
  * coded character sets for the Japanese language.
  *
@@ -495,14 +495,14 @@
      *         The name of the requested charset; may be either
      *         a canonical name or an alias
      *
-     * @return  <tt>true</tt> if, and only if, support for the named charset
+     * @return  {@code true} if, and only if, support for the named charset
      *          is available in the current Java virtual machine
      *
      * @throws IllegalCharsetNameException
      *         If the given charset name is illegal
      *
      * @throws  IllegalArgumentException
-     *          If the given <tt>charsetName</tt> is null
+     *          If the given {@code charsetName} is null
      */
     public static boolean isSupported(String charsetName) {
         return (lookup(charsetName) != null);
@@ -521,7 +521,7 @@
      *          If the given charset name is illegal
      *
      * @throws  IllegalArgumentException
-     *          If the given <tt>charsetName</tt> is null
+     *          If the given {@code charsetName} is null
      *
      * @throws  UnsupportedCharsetException
      *          If no support for the named charset is available
@@ -692,7 +692,7 @@
      * href="http://www.iana.org/assignments/character-sets">IANA Charset
      * Registry</a>.
      *
-     * @return  <tt>true</tt> if, and only if, this charset is known by its
+     * @return  {@code true} if, and only if, this charset is known by its
      *          implementor to be registered with the IANA
      */
     public final boolean isRegistered() {
@@ -732,15 +732,15 @@
      * <p> Every charset contains itself.
      *
      * <p> This method computes an approximation of the containment relation:
-     * If it returns <tt>true</tt> then the given charset is known to be
-     * contained by this charset; if it returns <tt>false</tt>, however, then
+     * If it returns {@code true} then the given charset is known to be
+     * contained by this charset; if it returns {@code false}, however, then
      * it is not necessarily the case that the given charset is not contained
      * in this charset.
      *
      * @param   cs
      *          The given charset
      *
-     * @return  <tt>true</tt> if the given charset is contained in this charset
+     * @return  {@code true} if the given charset is contained in this charset
      */
     public abstract boolean contains(Charset cs);
 
@@ -770,9 +770,9 @@
      * input byte sequence.  Such charsets do not support encoding because
      * there is no way to determine which encoding should be used on output.
      * Implementations of such charsets should override this method to return
-     * <tt>false</tt>. </p>
+     * {@code false}. </p>
      *
-     * @return  <tt>true</tt> if, and only if, this charset supports encoding
+     * @return  {@code true} if, and only if, this charset supports encoding
      */
     public boolean canEncode() {
         return true;
@@ -782,7 +782,7 @@
      * Convenience method that decodes bytes in this charset into Unicode
      * characters.
      *
-     * <p> An invocation of this method upon a charset <tt>cs</tt> returns the
+     * <p> An invocation of this method upon a charset {@code cs} returns the
      * same result as the expression
      *
      * <pre>
@@ -818,7 +818,7 @@
      * Convenience method that encodes Unicode characters into bytes in this
      * charset.
      *
-     * <p> An invocation of this method upon a charset <tt>cs</tt> returns the
+     * <p> An invocation of this method upon a charset {@code cs} returns the
      * same result as the expression
      *
      * <pre>
@@ -853,7 +853,7 @@
     /**
      * Convenience method that encodes a string into bytes in this charset.
      *
-     * <p> An invocation of this method upon a charset <tt>cs</tt> returns the
+     * <p> An invocation of this method upon a charset {@code cs} returns the
      * same result as the expression
      *
      * <pre>
@@ -898,7 +898,7 @@
      * <p> Two charsets are equal if, and only if, they have the same canonical
      * names.  A charset is never equal to any other type of object.  </p>
      *
-     * @return  <tt>true</tt> if, and only if, this charset is equal to the
+     * @return  {@code true} if, and only if, this charset is equal to the
      *          given object
      */
     public final boolean equals(Object ob) {
--- a/jdk/src/java.base/share/classes/java/nio/charset/CoderResult.java	Thu Apr 09 12:29:31 2015 +0200
+++ b/jdk/src/java.base/share/classes/java/nio/charset/CoderResult.java	Mon Aug 17 12:45:16 2015 +0300
@@ -46,24 +46,24 @@
  *   processed, or there is insufficient input and additional input is
  *   required.  This condition is represented by the unique result object
  *   {@link #UNDERFLOW}, whose {@link #isUnderflow() isUnderflow} method
- *   returns <tt>true</tt>.  </p></li>
+ *   returns {@code true}.  </p></li>
  *
  *   <li><p> <i>Overflow</i> is reported when there is insufficient room
  *   remaining in the output buffer.  This condition is represented by the
  *   unique result object {@link #OVERFLOW}, whose {@link #isOverflow()
- *   isOverflow} method returns <tt>true</tt>.  </p></li>
+ *   isOverflow} method returns {@code true}.  </p></li>
  *
  *   <li><p> A <i>malformed-input error</i> is reported when a sequence of
  *   input units is not well-formed.  Such errors are described by instances of
  *   this class whose {@link #isMalformed() isMalformed} method returns
- *   <tt>true</tt> and whose {@link #length() length} method returns the length
+ *   {@code true} and whose {@link #length() length} method returns the length
  *   of the malformed sequence.  There is one unique instance of this class for
  *   all malformed-input errors of a given length.  </p></li>
  *
  *   <li><p> An <i>unmappable-character error</i> is reported when a sequence
  *   of input units denotes a character that cannot be represented in the
  *   output charset.  Such errors are described by instances of this class
- *   whose {@link #isUnmappable() isUnmappable} method returns <tt>true</tt> and
+ *   whose {@link #isUnmappable() isUnmappable} method returns {@code true} and
  *   whose {@link #length() length} method returns the length of the input
  *   sequence denoting the unmappable character.  There is one unique instance
  *   of this class for all unmappable-character errors of a given length.
@@ -71,9 +71,9 @@
  *
  * </ul>
  *
- * <p> For convenience, the {@link #isError() isError} method returns <tt>true</tt>
+ * <p> For convenience, the {@link #isError() isError} method returns {@code true}
  * for result objects that describe malformed-input and unmappable-character
- * errors but <tt>false</tt> for those that describe underflow or overflow
+ * errors but {@code false} for those that describe underflow or overflow
  * conditions.  </p>
  *
  *
@@ -114,7 +114,7 @@
     /**
      * Tells whether or not this object describes an underflow condition.
      *
-     * @return  <tt>true</tt> if, and only if, this object denotes underflow
+     * @return  {@code true} if, and only if, this object denotes underflow
      */
     public boolean isUnderflow() {
         return (type == CR_UNDERFLOW);
@@ -123,7 +123,7 @@
     /**
      * Tells whether or not this object describes an overflow condition.
      *
-     * @return  <tt>true</tt> if, and only if, this object denotes overflow
+     * @return  {@code true} if, and only if, this object denotes overflow
      */
     public boolean isOverflow() {
         return (type == CR_OVERFLOW);
@@ -132,7 +132,7 @@
     /**
      * Tells whether or not this object describes an error condition.
      *
-     * @return  <tt>true</tt> if, and only if, this object denotes either a
+     * @return  {@code true} if, and only if, this object denotes either a
      *          malformed-input error or an unmappable-character error
      */
     public boolean isError() {
@@ -142,7 +142,7 @@
     /**
      * Tells whether or not this object describes a malformed-input error.
      *
-     * @return  <tt>true</tt> if, and only if, this object denotes a
+     * @return  {@code true} if, and only if, this object denotes a
      *          malformed-input error
      */
     public boolean isMalformed() {
@@ -153,7 +153,7 @@
      * Tells whether or not this object describes an unmappable-character
      * error.
      *
-     * @return  <tt>true</tt> if, and only if, this object denotes an
+     * @return  {@code true} if, and only if, this object denotes an
      *          unmappable-character error
      */
     public boolean isUnmappable() {
@@ -168,7 +168,7 @@
      *
      * @throws  UnsupportedOperationException
      *          If this object does not describe an error condition, that is,
-     *          if the {@link #isError() isError} does not return <tt>true</tt>
+     *          if the {@link #isError() isError} does not return {@code true}
      */
     public int length() {
         if (!isError())
--- a/jdk/src/java.base/share/classes/java/nio/charset/package-info.java	Thu Apr 09 12:29:31 2015 +0200
+++ b/jdk/src/java.base/share/classes/java/nio/charset/package-info.java	Mon Aug 17 12:45:16 2015 +0300
@@ -74,10 +74,10 @@
  *
  * <p> Support for new charsets can be made available via the
  * interface defined in the {@link
- * java.nio.charset.spi.CharsetProvider} class in the <tt>{@link
- * java.nio.charset.spi}</tt> package.
+ * java.nio.charset.spi.CharsetProvider} class in the {@link
+ * java.nio.charset.spi} package.
  *
- * <p> Unless otherwise noted, passing a <tt>null</tt> argument to a
+ * <p> Unless otherwise noted, passing a {@code null} argument to a
  * constructor or method in any class or interface in this package
  * will cause a {@link java.lang.NullPointerException
  * NullPointerException} to be thrown.
--- a/jdk/src/java.base/share/classes/java/nio/charset/spi/CharsetProvider.java	Thu Apr 09 12:29:31 2015 +0200
+++ b/jdk/src/java.base/share/classes/java/nio/charset/spi/CharsetProvider.java	Mon Aug 17 12:45:16 2015 +0300
@@ -42,13 +42,13 @@
  * loader}.
  *
  * <p> A charset provider identifies itself with a provider-configuration file
- * named <tt>java.nio.charset.spi.CharsetProvider</tt> in the resource
- * directory <tt>META-INF/services</tt>.  The file should contain a list of
+ * named {@code java.nio.charset.spi.CharsetProvider} in the resource
+ * directory {@code META-INF/services}.  The file should contain a list of
  * fully-qualified concrete charset-provider class names, one per line.  A line
- * is terminated by any one of a line feed (<tt>'\n'</tt>), a carriage return
- * (<tt>'\r'</tt>), or a carriage return followed immediately by a line feed.
+ * is terminated by any one of a line feed ({@code '\n'}), a carriage return
+ * ({@code '\r'}), or a carriage return followed immediately by a line feed.
  * Space and tab characters surrounding each name, as well as blank lines, are
- * ignored.  The comment character is <tt>'#'</tt> (<tt>'&#92;u0023'</tt>); on
+ * ignored.  The comment character is {@code '#'} (<code>'&#92;u0023'</code>); on
  * each line all characters following the first comment character are ignored.
  * The file must be encoded in UTF-8.
  *
@@ -83,7 +83,7 @@
      *
      * @throws  SecurityException
      *          If a security manager has been installed and it denies
-     *          {@link RuntimePermission}<tt>("charsetProvider")</tt>
+     *          {@link RuntimePermission}{@code ("charsetProvider")}
      */
     protected CharsetProvider() {
         this(checkPermission());
@@ -107,7 +107,7 @@
      *         a canonical name or an alias
      *
      * @return  A charset object for the named charset,
-     *          or <tt>null</tt> if the named charset
+     *          or {@code null} if the named charset
      *          is not supported by this provider
      */
     public abstract Charset charsetForName(String charsetName);
--- a/jdk/src/java.base/share/classes/java/nio/exceptions	Thu Apr 09 12:29:31 2015 +0200
+++ b/jdk/src/java.base/share/classes/java/nio/exceptions	Mon Aug 17 12:45:16 2015 +0300
@@ -56,5 +56,5 @@
 
 gen ReadOnlyBufferException "
  * Unchecked exception thrown when a content-mutation method such as
- * <tt>put</tt> or <tt>compact</tt> is invoked upon a read-only buffer." \
+ * <code>put</code> or <code>compact</code> is invoked upon a read-only buffer." \
  -1210063976496234090L
--- a/jdk/src/java.base/share/classes/java/nio/file/FileSystem.java	Thu Apr 09 12:29:31 2015 +0200
+++ b/jdk/src/java.base/share/classes/java/nio/file/FileSystem.java	Mon Aug 17 12:45:16 2015 +0300
@@ -202,7 +202,7 @@
      *
      * <p> In the case of the default provider, and a security manager is
      * installed, the security manager is invoked to check {@link
-     * RuntimePermission}<tt>("getFileStoreAttributes")</tt>. If denied, then
+     * RuntimePermission}{@code ("getFileStoreAttributes")}. If denied, then
      * no file stores are returned by the iterator. In addition, the security
      * manager's {@link SecurityManager#checkRead(String)} method is invoked to
      * check read access to the file store's <em>top-most</em> directory. If
@@ -334,19 +334,19 @@
      *   character extension</td>
      * </tr>
      * <tr>
-     *   <td><tt>&#47;home&#47;*&#47;*</tt>
-     *   <td>Matches <tt>&#47;home&#47;gus&#47;data</tt> on UNIX platforms</td>
+     *   <td><code>&#47;home&#47;*&#47;*</code>
+     *   <td>Matches <code>&#47;home&#47;gus&#47;data</code> on UNIX platforms</td>
      * </tr>
      * <tr>
-     *   <td><tt>&#47;home&#47;**</tt>
-     *   <td>Matches <tt>&#47;home&#47;gus</tt> and
-     *   <tt>&#47;home&#47;gus&#47;data</tt> on UNIX platforms</td>
+     *   <td><code>&#47;home&#47;**</code>
+     *   <td>Matches <code>&#47;home&#47;gus</code> and
+     *   <code>&#47;home&#47;gus&#47;data</code> on UNIX platforms</td>
      * </tr>
      * <tr>
-     *   <td><tt>C:&#92;&#92;*</tt>
-     *   <td>Matches <tt>C:&#92;foo</tt> and <tt>C:&#92;bar</tt> on the Windows
+     *   <td><code>C:&#92;&#92;*</code>
+     *   <td>Matches <code>C:&#92;foo</code> and <code>C:&#92;bar</code> on the Windows
      *   platform (note that the backslash is escaped; as a string literal in the
-     *   Java Language the pattern would be <tt>"C:&#92;&#92;&#92;&#92;*"</tt>) </td>
+     *   Java Language the pattern would be <code>"C:&#92;&#92;&#92;&#92;*"</code>) </td>
      * </tr>
      *
      * </table>
@@ -390,7 +390,7 @@
      *   character is used to separate the subpatterns. Groups cannot be nested.
      *   </p></li>
      *
-     *   <li><p> Leading period<tt>&#47;</tt>dot characters in file name are
+     *   <li><p> Leading period<code>&#47;</code>dot characters in file name are
      *   treated as regular characters in match operations. For example,
      *   the {@code "*"} glob pattern matches file name {@code ".login"}.
      *   The {@link Files#isHidden} method may be used to test whether a file
--- a/jdk/src/java.base/share/classes/java/nio/file/FileSystems.java	Thu Apr 09 12:29:31 2015 +0200
+++ b/jdk/src/java.base/share/classes/java/nio/file/FileSystems.java	Mon Aug 17 12:45:16 2015 +0300
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2007, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2007, 2015, 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
@@ -321,9 +321,12 @@
         String scheme = uri.getScheme();
 
         // check installed providers
-        for (FileSystemProvider provider: FileSystemProvider.installedProviders()) {
+        for (FileSystemProvider provider : FileSystemProvider.installedProviders()) {
             if (scheme.equalsIgnoreCase(provider.getScheme())) {
-                return provider.newFileSystem(uri, env);
+                try {
+                    return provider.newFileSystem(uri, env);
+                } catch (UnsupportedOperationException uoe) {
+                }
             }
         }
 
@@ -331,9 +334,12 @@
         if (loader != null) {
             ServiceLoader<FileSystemProvider> sl = ServiceLoader
                 .load(FileSystemProvider.class, loader);
-            for (FileSystemProvider provider: sl) {
+            for (FileSystemProvider provider : sl) {
                 if (scheme.equalsIgnoreCase(provider.getScheme())) {
-                    return provider.newFileSystem(uri, env);
+                    try {
+                        return provider.newFileSystem(uri, env);
+                    } catch (UnsupportedOperationException uoe) {
+                    }
                 }
             }
         }
--- a/jdk/src/java.base/share/classes/java/nio/file/Files.java	Thu Apr 09 12:29:31 2015 +0200
+++ b/jdk/src/java.base/share/classes/java/nio/file/Files.java	Mon Aug 17 12:45:16 2015 +0300
@@ -1033,7 +1033,7 @@
      *          if an I/O error occurs
      * @throws  SecurityException
      *          In the case of the default provider, and a security manager
-     *          is installed, it denies {@link LinkPermission}<tt>("symbolic")</tt>
+     *          is installed, it denies {@link LinkPermission}{@code ("symbolic")}
      *          or its {@link SecurityManager#checkWrite(String) checkWrite}
      *          method denies write access to the path of the symbolic link.
      */
@@ -1078,7 +1078,7 @@
      *          if an I/O error occurs
      * @throws  SecurityException
      *          In the case of the default provider, and a security manager
-     *          is installed, it denies {@link LinkPermission}<tt>("hard")</tt>
+     *          is installed, it denies {@link LinkPermission}{@code ("hard")}
      *          or its {@link SecurityManager#checkWrite(String) checkWrite}
      *          method denies write access to either the link or the
      *          existing file.
@@ -1455,8 +1455,8 @@
      *          In the case of the default provider, and a security manager is
      *          installed, the {@link SecurityManager#checkRead(String) checkRead}
      *          method is invoked to check read access to the file, and in
-     *          addition it checks {@link RuntimePermission}<tt>
-     *          ("getFileStoreAttributes")</tt>
+     *          addition it checks
+     *          {@link RuntimePermission}{@code ("getFileStoreAttributes")}
      */
     public static FileStore getFileStore(Path path) throws IOException {
         return provider(path).getFileStore(path);
@@ -1995,7 +1995,8 @@
      *          if an I/O error occurs
      * @throws  SecurityException
      *          In the case of the default provider, a security manager is
-     *          installed, and it denies {@link RuntimePermission}<tt>("accessUserInformation")</tt>
+     *          installed, and it denies
+     *          {@link RuntimePermission}{@code ("accessUserInformation")}
      *          or its {@link SecurityManager#checkRead(String) checkRead} method
      *          denies read access to the file.
      */
@@ -2032,7 +2033,8 @@
      *          if an I/O error occurs
      * @throws  SecurityException
      *          In the case of the default provider, and a security manager is
-     *          installed, it denies {@link RuntimePermission}<tt>("accessUserInformation")</tt>
+     *          installed, it denies
+     *          {@link RuntimePermission}{@code ("accessUserInformation")}
      *          or its {@link SecurityManager#checkWrite(String) checkWrite}
      *          method denies write access to the file.
      */
@@ -2069,7 +2071,8 @@
      *          if an I/O error occurs
      * @throws  SecurityException
      *          In the case of the default provider, and a security manager is
-     *          installed, it denies {@link RuntimePermission}<tt>("accessUserInformation")</tt>
+     *          installed, it denies
+     *          {@link RuntimePermission}{@code ("accessUserInformation")}
      *          or its {@link SecurityManager#checkRead(String) checkRead} method
      *          denies read access to the file.
      */
@@ -2112,7 +2115,8 @@
      *          if an I/O error occurs
      * @throws  SecurityException
      *          In the case of the default provider, and a security manager is
-     *          installed, it denies {@link RuntimePermission}<tt>("accessUserInformation")</tt>
+     *          installed, it denies
+     *          {@link RuntimePermission}{@code ("accessUserInformation")}
      *          or its {@link SecurityManager#checkWrite(String) checkWrite}
      *          method denies write access to the file.
      *
@@ -3835,7 +3839,9 @@
             // Obtaining the size from the FileChannel is much faster
             // than obtaining using path.toFile().length()
             long length = fc.size();
-            if (length <= Integer.MAX_VALUE) {
+            // FileChannel.size() may in certain circumstances return zero
+            // for a non-zero length file so disallow this case.
+            if (length > 0 && length <= Integer.MAX_VALUE) {
                 Spliterator<String> s = new FileChannelLinesSpliterator(fc, cs, 0, (int) length);
                 return StreamSupport.stream(s, false)
                         .onClose(Files.asUncheckedRunnable(fc));
--- a/jdk/src/java.base/share/classes/java/nio/file/InvalidPathException.java	Thu Apr 09 12:29:31 2015 +0200
+++ b/jdk/src/java.base/share/classes/java/nio/file/InvalidPathException.java	Mon Aug 17 12:45:16 2015 +0300
@@ -46,13 +46,13 @@
      * @param  input   the input string
      * @param  reason  a string explaining why the input was rejected
      * @param  index   the index at which the error occurred,
-     *                 or <tt>-1</tt> if the index is not known
+     *                 or {@code -1} if the index is not known
      *
      * @throws  NullPointerException
-     *          if either the input or reason strings are <tt>null</tt>
+     *          if either the input or reason strings are {@code null}
      *
      * @throws  IllegalArgumentException
-     *          if the error index is less than <tt>-1</tt>
+     *          if the error index is less than {@code -1}
      */
     public InvalidPathException(String input, String reason, int index) {
         super(reason);
@@ -66,13 +66,13 @@
 
     /**
      * Constructs an instance from the given input string and reason.  The
-     * resulting object will have an error index of <tt>-1</tt>.
+     * resulting object will have an error index of {@code -1}.
      *
      * @param  input   the input string
      * @param  reason  a string explaining why the input was rejected
      *
      * @throws  NullPointerException
-     *          if either the input or reason strings are <tt>null</tt>
+     *          if either the input or reason strings are {@code null}
      */
     public InvalidPathException(String input, String reason) {
         this(input, reason, -1);
@@ -98,7 +98,7 @@
 
     /**
      * Returns an index into the input string of the position at which the
-     * error occurred, or <tt>-1</tt> if this position is not known.
+     * error occurred, or {@code -1} if this position is not known.
      *
      * @return  the error index
      */
@@ -109,8 +109,8 @@
     /**
      * Returns a string describing the error.  The resulting string
      * consists of the reason string followed by a colon character
-     * (<tt>':'</tt>), a space, and the input string.  If the error index is
-     * defined then the string <tt>" at index "</tt> followed by the index, in
+     * ({@code ':'}), a space, and the input string.  If the error index is
+     * defined then the string {@code " at index "} followed by the index, in
      * decimal, is inserted after the reason string and before the colon
      * character.
      *
--- a/jdk/src/java.base/share/classes/java/nio/file/Path.java	Thu Apr 09 12:29:31 2015 +0200
+++ b/jdk/src/java.base/share/classes/java/nio/file/Path.java	Mon Aug 17 12:45:16 2015 +0300
@@ -480,7 +480,8 @@
      * <p> For any two {@link #normalize normalized} paths <i>p</i> and
      * <i>q</i>, where <i>q</i> does not have a root component,
      * <blockquote>
-     *   <i>p</i><tt>.relativize(</tt><i>p</i><tt>.resolve(</tt><i>q</i><tt>)).equals(</tt><i>q</i><tt>)</tt>
+     *   <i>p</i>{@code .relativize(}<i>p</i>
+     *   {@code .resolve(}<i>q</i>{@code )).equals(}<i>q</i>{@code )}
      * </blockquote>
      *
      * <p> When symbolic links are supported, then whether the resulting path,
@@ -525,9 +526,9 @@
      * <p> The default provider provides a similar <em>round-trip</em> guarantee
      * to the {@link java.io.File} class. For a given {@code Path} <i>p</i> it
      * is guaranteed that
-     * <blockquote><tt>
-     * {@link Paths#get(URI) Paths.get}(</tt><i>p</i><tt>.toUri()).equals(</tt><i>p</i>
-     * <tt>.{@link #toAbsolutePath() toAbsolutePath}())</tt>
+     * <blockquote>
+     * {@link Paths#get(URI) Paths.get}{@code (}<i>p</i>{@code .toUri()).equals(}<i>p</i>
+     * {@code .}{@link #toAbsolutePath() toAbsolutePath}{@code ())}
      * </blockquote>
      * so long as the original {@code Path}, the {@code URI}, and the new {@code
      * Path} are all created in (possibly different invocations of) the same
--- a/jdk/src/java.base/share/classes/java/nio/file/Paths.java	Thu Apr 09 12:29:31 2015 +0200
+++ b/jdk/src/java.base/share/classes/java/nio/file/Paths.java	Mon Aug 17 12:45:16 2015 +0300
@@ -103,9 +103,9 @@
      * <p> The default provider provides a similar <em>round-trip</em> guarantee
      * to the {@link java.io.File} class. For a given {@code Path} <i>p</i> it
      * is guaranteed that
-     * <blockquote><tt>
-     * Paths.get(</tt><i>p</i><tt>.{@link Path#toUri() toUri}()).equals(</tt>
-     * <i>p</i><tt>.{@link Path#toAbsolutePath() toAbsolutePath}())</tt>
+     * <blockquote>{@code
+     * Paths.get(}<i>p</i>{@code .}{@link Path#toUri() toUri}{@code ()).equals(}
+     * <i>p</i>{@code .}{@link Path#toAbsolutePath() toAbsolutePath}{@code ())}
      * </blockquote>
      * so long as the original {@code Path}, the {@code URI}, and the new {@code
      * Path} are all created in (possibly different invocations of) the same
--- a/jdk/src/java.base/share/classes/java/nio/file/attribute/AclFileAttributeView.java	Thu Apr 09 12:29:31 2015 +0200
+++ b/jdk/src/java.base/share/classes/java/nio/file/attribute/AclFileAttributeView.java	Mon Aug 17 12:45:16 2015 +0300
@@ -165,7 +165,7 @@
      *          if an I/O error occurs
      * @throws  SecurityException
      *          In the case of the default provider, a security manager is
-     *          installed, and it denies {@link RuntimePermission}<tt>("accessUserInformation")</tt>
+     *          installed, and it denies {@link RuntimePermission}{@code ("accessUserInformation")}
      *          or its {@link SecurityManager#checkRead(String) checkRead} method
      *          denies read access to the file.
      */
@@ -201,7 +201,7 @@
      *          if an I/O error occurs or the ACL is invalid
      * @throws  SecurityException
      *          In the case of the default provider, a security manager is
-     *          installed, it denies {@link RuntimePermission}<tt>("accessUserInformation")</tt>
+     *          installed, it denies {@link RuntimePermission}{@code ("accessUserInformation")}
      *          or its {@link SecurityManager#checkWrite(String) checkWrite}
      *          method denies write access to the file.
      */
--- a/jdk/src/java.base/share/classes/java/nio/file/attribute/FileOwnerAttributeView.java	Thu Apr 09 12:29:31 2015 +0200
+++ b/jdk/src/java.base/share/classes/java/nio/file/attribute/FileOwnerAttributeView.java	Mon Aug 17 12:45:16 2015 +0300
@@ -69,7 +69,7 @@
      * @throws  SecurityException
      *          In the case of the default provider, a security manager is
      *          installed, and it denies {@link
-     *          RuntimePermission}<tt>("accessUserInformation")</tt> or its
+     *          RuntimePermission}{@code ("accessUserInformation")} or its
      *          {@link SecurityManager#checkRead(String) checkRead} method
      *          denies read access to the file.
      */
@@ -93,7 +93,7 @@
      * @throws  SecurityException
      *          In the case of the default provider, a security manager is
      *          installed, and it denies {@link
-     *          RuntimePermission}<tt>("accessUserInformation")</tt> or its
+     *          RuntimePermission}{@code ("accessUserInformation")} or its
      *          {@link SecurityManager#checkWrite(String) checkWrite} method
      *          denies write access to the file.
      */
--- a/jdk/src/java.base/share/classes/java/nio/file/attribute/PosixFileAttributeView.java	Thu Apr 09 12:29:31 2015 +0200
+++ b/jdk/src/java.base/share/classes/java/nio/file/attribute/PosixFileAttributeView.java	Mon Aug 17 12:45:16 2015 +0300
@@ -149,7 +149,8 @@
      * @throws  IOException                {@inheritDoc}
      * @throws  SecurityException
      *          In the case of the default provider, a security manager is
-     *          installed, and it denies {@link RuntimePermission}<tt>("accessUserInformation")</tt>
+     *          installed, and it denies
+     *          {@link RuntimePermission}{@code ("accessUserInformation")}
      *          or its {@link SecurityManager#checkRead(String) checkRead} method
      *          denies read access to the file.
      */
@@ -169,7 +170,8 @@
      *          if an I/O error occurs
      * @throws  SecurityException
      *          In the case of the default provider, a security manager is
-     *          installed, and it denies {@link RuntimePermission}<tt>("accessUserInformation")</tt>
+     *          installed, and it denies
+     *          {@link RuntimePermission}{@code ("accessUserInformation")}
      *          or its {@link SecurityManager#checkWrite(String) checkWrite}
      *          method denies write access to the file.
      */
@@ -185,7 +187,8 @@
      *          if an I/O error occurs
      * @throws  SecurityException
      *          In the case of the default provider, and a security manager is
-     *          installed, it denies {@link RuntimePermission}<tt>("accessUserInformation")</tt>
+     *          installed, it denies
+     *          {@link RuntimePermission}{@code ("accessUserInformation")}
      *          or its {@link SecurityManager#checkWrite(String) checkWrite}
      *          method denies write access to the file.
      */
--- a/jdk/src/java.base/share/classes/java/nio/file/attribute/UserDefinedFileAttributeView.java	Thu Apr 09 12:29:31 2015 +0200
+++ b/jdk/src/java.base/share/classes/java/nio/file/attribute/UserDefinedFileAttributeView.java	Mon Aug 17 12:45:16 2015 +0300
@@ -89,7 +89,7 @@
      * @throws  SecurityException
      *          In the case of the default provider, a security manager is
      *          installed, and it denies {@link
-     *          RuntimePermission}<tt>("accessUserDefinedAttributes")</tt>
+     *          RuntimePermission}{@code ("accessUserDefinedAttributes")}
      *          or its {@link SecurityManager#checkRead(String) checkRead} method
      *          denies read access to the file.
      */
@@ -110,7 +110,7 @@
      * @throws  SecurityException
      *          In the case of the default provider, a security manager is
      *          installed, and it denies {@link
-     *          RuntimePermission}<tt>("accessUserDefinedAttributes")</tt>
+     *          RuntimePermission}{@code ("accessUserDefinedAttributes")}
      *          or its {@link SecurityManager#checkRead(String) checkRead} method
      *          denies read access to the file.
      */
@@ -156,7 +156,7 @@
      * @throws  SecurityException
      *          In the case of the default provider, a security manager is
      *          installed, and it denies {@link
-     *          RuntimePermission}<tt>("accessUserDefinedAttributes")</tt>
+     *          RuntimePermission}{@code ("accessUserDefinedAttributes")}
      *          or its {@link SecurityManager#checkRead(String) checkRead} method
      *          denies read access to the file.
      *
@@ -206,7 +206,7 @@
      * @throws  SecurityException
      *          In the case of the default provider, a security manager is
      *          installed, and it denies {@link
-     *          RuntimePermission}<tt>("accessUserDefinedAttributes")</tt>
+     *          RuntimePermission}{@code ("accessUserDefinedAttributes")}
      *          or its {@link SecurityManager#checkWrite(String) checkWrite}
      *          method denies write access to the file.
      */
@@ -223,7 +223,7 @@
      * @throws  SecurityException
      *          In the case of the default provider, a security manager is
      *          installed, and it denies {@link
-     *          RuntimePermission}<tt>("accessUserDefinedAttributes")</tt>
+     *          RuntimePermission}{@code ("accessUserDefinedAttributes")}
      *          or its {@link SecurityManager#checkWrite(String) checkWrite}
      *          method denies write access to the file.
      */
--- a/jdk/src/java.base/share/classes/java/nio/file/attribute/UserPrincipalLookupService.java	Thu Apr 09 12:29:31 2015 +0200
+++ b/jdk/src/java.base/share/classes/java/nio/file/attribute/UserPrincipalLookupService.java	Mon Aug 17 12:45:16 2015 +0300
@@ -72,7 +72,8 @@
      *          if an I/O error occurs
      * @throws  SecurityException
      *          In the case of the default provider, and a security manager is
-     *          installed, it checks {@link RuntimePermission}<tt>("lookupUserInformation")</tt>
+     *          installed, it checks
+     *          {@link RuntimePermission}{@code ("lookupUserInformation")}
      */
     public abstract UserPrincipal lookupPrincipalByName(String name)
         throws IOException;
@@ -97,7 +98,8 @@
      *          if an I/O error occurs
      * @throws  SecurityException
      *          In the case of the default provider, and a security manager is
-     *          installed, it checks {@link RuntimePermission}<tt>("lookupUserInformation")</tt>
+     *          installed, it checks
+     *          {@link RuntimePermission}{@code ("lookupUserInformation")}
      */
     public abstract GroupPrincipal lookupPrincipalByGroupName(String group)
         throws IOException;
--- a/jdk/src/java.base/share/classes/java/nio/file/attribute/UserPrincipalNotFoundException.java	Thu Apr 09 12:29:31 2015 +0200
+++ b/jdk/src/java.base/share/classes/java/nio/file/attribute/UserPrincipalNotFoundException.java	Mon Aug 17 12:45:16 2015 +0300
@@ -54,7 +54,7 @@
 
     /**
      * Returns the user principal name if this exception was created with the
-     * user principal name that was not found, otherwise <tt>null</tt>.
+     * user principal name that was not found, otherwise {@code null}.
      *
      * @return  the user principal name or {@code null}
      */
--- a/jdk/src/java.base/share/classes/java/nio/file/attribute/package-info.java	Thu Apr 09 12:29:31 2015 +0200
+++ b/jdk/src/java.base/share/classes/java/nio/file/attribute/package-info.java	Mon Aug 17 12:45:16 2015 +0300
@@ -28,23 +28,23 @@
  *
  * <blockquote><table cellspacing=1 cellpadding=0 summary="Attribute views">
  * <tr><th align="left">Attribute views</th><th align="left">Description</th></tr>
- * <tr><td valign=top><tt><i>{@link java.nio.file.attribute.AttributeView}</i></tt></td>
+ * <tr><td valign=top><i>{@link java.nio.file.attribute.AttributeView}</i></td>
  *     <td>Can read or update non-opaque values associated with objects in a file system</td></tr>
- * <tr><td valign=top><tt>&nbsp;&nbsp;<i>{@link java.nio.file.attribute.FileAttributeView}</i></tt></td>
+ * <tr><td valign=top>&nbsp;&nbsp;<i>{@link java.nio.file.attribute.FileAttributeView}</i></td>
  *     <td>Can read or update file attributes</td></tr>
- * <tr><td valign=top><tt>&nbsp;&nbsp;&nbsp;&nbsp;<i>{@link java.nio.file.attribute.BasicFileAttributeView}&nbsp;&nbsp;</i></tt></td>
+ * <tr><td valign=top>&nbsp;&nbsp;&nbsp;&nbsp;<i>{@link java.nio.file.attribute.BasicFileAttributeView}&nbsp;&nbsp;</i></td>
  *     <td>Can read or update a basic set of file attributes</td></tr>
- * <tr><td valign=top><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<i>{@link java.nio.file.attribute.PosixFileAttributeView}&nbsp;&nbsp;</i></tt></td>
+ * <tr><td valign=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<i>{@link java.nio.file.attribute.PosixFileAttributeView}&nbsp;&nbsp;</i></td>
  *     <td>Can read or update POSIX defined file attributes</td></tr>
- * <tr><td valign=top><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<i>{@link java.nio.file.attribute.DosFileAttributeView}&nbsp;&nbsp;</i></tt></td>
+ * <tr><td valign=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<i>{@link java.nio.file.attribute.DosFileAttributeView}&nbsp;&nbsp;</i></td>
  *     <td>Can read or update FAT file attributes</td></tr>
- * <tr><td valign=top><tt>&nbsp;&nbsp;&nbsp;&nbsp;<i>{@link java.nio.file.attribute.FileOwnerAttributeView}&nbsp;&nbsp;</i></tt></td>
+ * <tr><td valign=top>&nbsp;&nbsp;&nbsp;&nbsp;<i>{@link java.nio.file.attribute.FileOwnerAttributeView}&nbsp;&nbsp;</i></td>
  *     <td>Can read or update the owner of a file</td></tr>
- * <tr><td valign=top><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<i>{@link java.nio.file.attribute.AclFileAttributeView}&nbsp;&nbsp;</i></tt></td>
+ * <tr><td valign=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<i>{@link java.nio.file.attribute.AclFileAttributeView}&nbsp;&nbsp;</i></td>
  *     <td>Can read or update Access Control Lists</td></tr>
- * <tr><td valign=top><tt>&nbsp;&nbsp;&nbsp;&nbsp;<i>{@link java.nio.file.attribute.UserDefinedFileAttributeView}&nbsp;&nbsp;</i></tt></td>
+ * <tr><td valign=top>&nbsp;&nbsp;&nbsp;&nbsp;<i>{@link java.nio.file.attribute.UserDefinedFileAttributeView}&nbsp;&nbsp;</i></td>
  *     <td>Can read or update user-defined file attributes</td></tr>
- * <tr><td valign=top><tt>&nbsp;&nbsp;<i>{@link java.nio.file.attribute.FileStoreAttributeView}</i></tt></td>
+ * <tr><td valign=top>&nbsp;&nbsp;<i>{@link java.nio.file.attribute.FileStoreAttributeView}</i></td>
  *     <td>Can read or update file system attributes</td></tr>
  * </table></blockquote>
  *
@@ -100,7 +100,7 @@
  * </ul>
  *
  *
- * <p> Unless otherwise noted, passing a <tt>null</tt> argument to a constructor
+ * <p> Unless otherwise noted, passing a {@code null} argument to a constructor
  * or method in any class or interface in this package will cause a {@link
  * java.lang.NullPointerException NullPointerException} to be thrown.
  *
--- a/jdk/src/java.base/share/classes/java/nio/file/spi/FileSystemProvider.java	Thu Apr 09 12:29:31 2015 +0200
+++ b/jdk/src/java.base/share/classes/java/nio/file/spi/FileSystemProvider.java	Mon Aug 17 12:45:16 2015 +0300
@@ -102,7 +102,7 @@
      *
      * @throws  SecurityException
      *          If a security manager has been installed and it denies
-     *          {@link RuntimePermission}<tt>("fileSystemProvider")</tt>
+     *          {@link RuntimePermission}{@code ("fileSystemProvider")}
      */
     protected FileSystemProvider() {
         this(checkPermission());
@@ -644,7 +644,7 @@
      *          if an I/O error occurs
      * @throws  SecurityException
      *          In the case of the default provider, and a security manager
-     *          is installed, it denies {@link LinkPermission}<tt>("symbolic")</tt>
+     *          is installed, it denies {@link LinkPermission}{@code ("symbolic")}
      *          or its {@link SecurityManager#checkWrite(String) checkWrite}
      *          method denies write access to the path of the symbolic link.
      */
@@ -677,7 +677,7 @@
      *          if an I/O error occurs
      * @throws  SecurityException
      *          In the case of the default provider, and a security manager
-     *          is installed, it denies {@link LinkPermission}<tt>("hard")</tt>
+     *          is installed, it denies {@link LinkPermission}{@code ("hard")}
      *          or its {@link SecurityManager#checkWrite(String) checkWrite}
      *          method denies write access to either the  link or the
      *          existing file.
@@ -902,8 +902,8 @@
      *          In the case of the default provider, and a security manager is
      *          installed, the {@link SecurityManager#checkRead(String) checkRead}
      *          method is invoked to check read access to the file, and in
-     *          addition it checks {@link RuntimePermission}<tt>
-     *          ("getFileStoreAttributes")</tt>
+     *          addition it checks
+     *          {@link RuntimePermission}{@code ("getFileStoreAttributes")}
      */
     public abstract FileStore getFileStore(Path path) throws IOException;
 
--- a/jdk/src/java.base/share/classes/java/nio/file/spi/FileTypeDetector.java	Thu Apr 09 12:29:31 2015 +0200
+++ b/jdk/src/java.base/share/classes/java/nio/file/spi/FileTypeDetector.java	Mon Aug 17 12:45:16 2015 +0300
@@ -62,7 +62,7 @@
      *
      * @throws  SecurityException
      *          If a security manager has been installed and it denies
-     *          {@link RuntimePermission}<tt>("fileTypeDetector")</tt>
+     *          {@link RuntimePermission}{@code ("fileTypeDetector")}
      */
     protected FileTypeDetector() {
         this(checkPermission());
--- a/jdk/src/java.base/share/classes/java/nio/file/spi/package-info.java	Thu Apr 09 12:29:31 2015 +0200
+++ b/jdk/src/java.base/share/classes/java/nio/file/spi/package-info.java	Mon Aug 17 12:45:16 2015 +0300
@@ -24,12 +24,12 @@
  */
 
 /**
- * Service-provider classes for the <tt>{@link java.nio.file}</tt> package.
+ * Service-provider classes for the {@link java.nio.file} package.
  *
  * <p> Only developers who are defining new file system providers or file type
  * detectors should need to make direct use of this package.  </p>
  *
- * <p> Unless otherwise noted, passing a <tt>null</tt> argument to a constructor
+ * <p> Unless otherwise noted, passing a {@code null} argument to a constructor
  * or method in any class or interface in this package will cause a {@link
  * java.lang.NullPointerException NullPointerException} to be thrown.
  *
--- a/jdk/src/java.base/share/classes/java/nio/package-info.java	Thu Apr 09 12:29:31 2015 +0200
+++ b/jdk/src/java.base/share/classes/java/nio/package-info.java	Mon Aug 17 12:45:16 2015 +0300
@@ -52,7 +52,7 @@
  *
  *  </ul>
  *
- * <p> The <tt>java.nio</tt> package defines the buffer classes, which
+ * <p> The {@code java.nio} package defines the buffer classes, which
  * are used throughout the NIO APIs.  The charset API is defined in
  * the {@link java.nio.charset} package, and the channel and selector
  * APIs are defined in the {@link java.nio.channels} package.  Each of
@@ -64,26 +64,26 @@
  *
  * <blockquote><table cellspacing=1 cellpadding=0 summary="Description of the various buffers">
  *   <tr><th align="left">Buffers</th><th align="left">Description</th></tr>
- *   <tr><td valign=top><tt>{@link java.nio.Buffer}</tt></td>
+ *   <tr><td valign=top>{@link java.nio.Buffer}</td>
  *       <td>Position, limit, and capacity;
  *           <br>clear, flip, rewind, and mark/reset</td></tr>
- *   <tr><td valign=top><tt>&nbsp;&nbsp;{@link java.nio.ByteBuffer}</tt></td>
+ *   <tr><td valign=top>&nbsp;&nbsp;{@link java.nio.ByteBuffer}</td>
  *       <td>Get/put, compact, views; allocate,&nbsp;wrap</td></tr>
- *   <tr><td valign=top><tt>&nbsp;&nbsp;&nbsp;&nbsp;{@link java.nio.MappedByteBuffer}&nbsp;&nbsp;</tt></td>
+ *   <tr><td valign=top>&nbsp;&nbsp;&nbsp;&nbsp;{@link java.nio.MappedByteBuffer}&nbsp;&nbsp;</td>
  *       <td>A byte buffer mapped to a file</td></tr>
- *   <tr><td valign=top><tt>&nbsp;&nbsp;{@link java.nio.CharBuffer}</tt></td>
+ *   <tr><td valign=top>&nbsp;&nbsp;{@link java.nio.CharBuffer}</td>
  *       <td>Get/put, compact; allocate,&nbsp;wrap</td></tr>
- *   <tr><td valign=top><tt>&nbsp;&nbsp;{@link java.nio.DoubleBuffer}</tt></td>
+ *   <tr><td valign=top>&nbsp;&nbsp;{@link java.nio.DoubleBuffer}</td>
  *       <td>&nbsp;&nbsp;&nbsp;&nbsp;'&nbsp;'</td></tr>
- *   <tr><td valign=top><tt>&nbsp;&nbsp;{@link java.nio.FloatBuffer}</tt></td>
+ *   <tr><td valign=top>&nbsp;&nbsp;{@link java.nio.FloatBuffer}</td>
  *       <td>&nbsp;&nbsp;&nbsp;&nbsp;'&nbsp;'</td></tr>
- *   <tr><td valign=top><tt>&nbsp;&nbsp;{@link java.nio.IntBuffer}</tt></td>
+ *   <tr><td valign=top>&nbsp;&nbsp;{@link java.nio.IntBuffer}</td>
  *       <td>&nbsp;&nbsp;&nbsp;&nbsp;'&nbsp;'</td></tr>
- *   <tr><td valign=top><tt>&nbsp;&nbsp;{@link java.nio.LongBuffer}</tt></td>
+ *   <tr><td valign=top>&nbsp;&nbsp;{@link java.nio.LongBuffer}</td>
  *       <td>&nbsp;&nbsp;&nbsp;&nbsp;'&nbsp;'</td></tr>
- *   <tr><td valign=top><tt>&nbsp;&nbsp;{@link java.nio.ShortBuffer}</tt></td>
+ *   <tr><td valign=top>&nbsp;&nbsp;{@link java.nio.ShortBuffer}</td>
  *       <td>&nbsp;&nbsp;&nbsp;&nbsp;'&nbsp;'</td></tr>
- *   <tr><td valign=top><tt>{@link java.nio.ByteOrder}</tt></td>
+ *   <tr><td valign=top>{@link java.nio.ByteOrder}</td>
  *       <td>Typesafe enumeration for&nbsp;byte&nbsp;orders</td></tr>
  * </table></blockquote>
  *
@@ -129,7 +129,7 @@
  *
  * </ul>
  *
- * <p> Unless otherwise noted, passing a <tt>null</tt> argument to a
+ * <p> Unless otherwise noted, passing a {@code null} argument to a
  * constructor or method in any class or interface in this package
  * will cause a {@link java.lang.NullPointerException
  * NullPointerException} to be thrown.
--- a/jdk/src/java.base/share/classes/java/security/SecurityPermission.java	Thu Apr 09 12:29:31 2015 +0200
+++ b/jdk/src/java.base/share/classes/java/security/SecurityPermission.java	Mon Aug 17 12:45:16 2015 +0300
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2015, 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,19 +31,19 @@
 import java.util.StringTokenizer;
 
 /**
- * This class is for security permissions.
- * A SecurityPermission contains a name (also referred to as a "target name")
- * but no actions list; you either have the named permission
- * or you don't.
- * <P>
- * The target name is the name of a security configuration parameter (see below).
- * Currently the SecurityPermission object is used to guard access
- * to the Policy, Security, Provider, Signer, and Identity
+ * This class is for security permissions. A {@code SecurityPermission}
+ * contains a name (also referred to as a "target name") but no actions list;
+ * you either have the named permission or you don't.
+ * <p>
+ * The target name is the name of a security configuration parameter
+ * (see below). Currently the {@code SecurityPermission} object is used to
+ * guard access to the {@link AccessControlContext}, {@link Policy},
+ * {@link Provider}, {@link Security}, {@link Signer}, and {@link Identity}
  * objects.
- * <P>
- * The following table lists all the possible SecurityPermission target names,
- * and for each provides a description of what the permission allows
- * and a discussion of the risks of granting code the permission.
+ * <p>
+ * The following table lists the standard {@code SecurityPermission}
+ * target names, and for each provides a description of what the permission
+ * allows and a discussion of the risks of granting code the permission.
  *
  * <table border=1 cellpadding=5 summary="target name,what the permission allows, and associated risks">
  * <tr>
@@ -299,6 +299,10 @@
  *
  * </table>
  *
+ * @implNote
+ * Implementations may define additional target names, but should use naming
+ * conventions such as reverse domain name notation to avoid name clashes.
+ *
  * @see java.security.BasicPermission
  * @see java.security.Permission
  * @see java.security.Permissions
--- a/jdk/src/java.base/share/classes/java/util/AbstractCollection.java	Thu Apr 09 12:29:31 2015 +0200
+++ b/jdk/src/java.base/share/classes/java/util/AbstractCollection.java	Mon Aug 17 12:45:16 2015 +0300
@@ -26,23 +26,23 @@
 package java.util;
 
 /**
- * This class provides a skeletal implementation of the <tt>Collection</tt>
+ * This class provides a skeletal implementation of the {@code Collection}
  * interface, to minimize the effort required to implement this interface. <p>
  *
  * To implement an unmodifiable collection, the programmer needs only to
- * extend this class and provide implementations for the <tt>iterator</tt> and
- * <tt>size</tt> methods.  (The iterator returned by the <tt>iterator</tt>
- * method must implement <tt>hasNext</tt> and <tt>next</tt>.)<p>
+ * extend this class and provide implementations for the {@code iterator} and
+ * {@code size} methods.  (The iterator returned by the {@code iterator}
+ * method must implement {@code hasNext} and {@code next}.)<p>
  *
  * To implement a modifiable collection, the programmer must additionally
- * override this class's <tt>add</tt> method (which otherwise throws an
- * <tt>UnsupportedOperationException</tt>), and the iterator returned by the
- * <tt>iterator</tt> method must additionally implement its <tt>remove</tt>
+ * override this class's {@code add} method (which otherwise throws an
+ * {@code UnsupportedOperationException}), and the iterator returned by the
+ * {@code iterator} method must additionally implement its {@code remove}
  * method.<p>
  *
  * The programmer should generally provide a void (no argument) and
- * <tt>Collection</tt> constructor, as per the recommendation in the
- * <tt>Collection</tt> interface specification.<p>
+ * {@code Collection} constructor, as per the recommendation in the
+ * {@code Collection} interface specification.<p>
  *
  * The documentation for each non-abstract method in this class describes its
  * implementation in detail.  Each of these methods may be overridden if
@@ -81,7 +81,7 @@
      * {@inheritDoc}
      *
      * @implSpec
-     * This implementation returns <tt>size() == 0</tt>.
+     * This implementation returns {@code size() == 0}.
      */
     public boolean isEmpty() {
         return size() == 0;
@@ -255,7 +255,7 @@
      *
      * @implSpec
      * This implementation always throws an
-     * <tt>UnsupportedOperationException</tt>.
+     * {@code UnsupportedOperationException}.
      *
      * @throws UnsupportedOperationException {@inheritDoc}
      * @throws ClassCastException            {@inheritDoc}
@@ -276,8 +276,8 @@
      * from the collection using the iterator's remove method.
      *
      * <p>Note that this implementation throws an
-     * <tt>UnsupportedOperationException</tt> if the iterator returned by this
-     * collection's iterator method does not implement the <tt>remove</tt>
+     * {@code UnsupportedOperationException} if the iterator returned by this
+     * collection's iterator method does not implement the {@code remove}
      * method and this collection contains the specified object.
      *
      * @throws UnsupportedOperationException {@inheritDoc}
@@ -314,7 +314,7 @@
      * This implementation iterates over the specified collection,
      * checking each element returned by the iterator in turn to see
      * if it's contained in this collection.  If all elements are so
-     * contained <tt>true</tt> is returned, otherwise <tt>false</tt>.
+     * contained {@code true} is returned, otherwise {@code false}.
      *
      * @throws ClassCastException            {@inheritDoc}
      * @throws NullPointerException          {@inheritDoc}
@@ -335,7 +335,7 @@
      * each object returned by the iterator to this collection, in turn.
      *
      * <p>Note that this implementation will throw an
-     * <tt>UnsupportedOperationException</tt> unless <tt>add</tt> is
+     * {@code UnsupportedOperationException} unless {@code add} is
      * overridden (assuming the specified collection is non-empty).
      *
      * @throws UnsupportedOperationException {@inheritDoc}
@@ -361,11 +361,11 @@
      * This implementation iterates over this collection, checking each
      * element returned by the iterator in turn to see if it's contained
      * in the specified collection.  If it's so contained, it's removed from
-     * this collection with the iterator's <tt>remove</tt> method.
+     * this collection with the iterator's {@code remove} method.
      *
      * <p>Note that this implementation will throw an
-     * <tt>UnsupportedOperationException</tt> if the iterator returned by the
-     * <tt>iterator</tt> method does not implement the <tt>remove</tt> method
+     * {@code UnsupportedOperationException} if the iterator returned by the
+     * {@code iterator} method does not implement the {@code remove} method
      * and this collection contains one or more elements in common with the
      * specified collection.
      *
@@ -396,11 +396,11 @@
      * This implementation iterates over this collection, checking each
      * element returned by the iterator in turn to see if it's contained
      * in the specified collection.  If it's not so contained, it's removed
-     * from this collection with the iterator's <tt>remove</tt> method.
+     * from this collection with the iterator's {@code remove} method.
      *
      * <p>Note that this implementation will throw an
-     * <tt>UnsupportedOperationException</tt> if the iterator returned by the
-     * <tt>iterator</tt> method does not implement the <tt>remove</tt> method
+     * {@code UnsupportedOperationException} if the iterator returned by the
+     * {@code iterator} method does not implement the {@code remove} method
      * and this collection contains one or more elements not present in the
      * specified collection.
      *
@@ -429,14 +429,14 @@
      *
      * @implSpec
      * This implementation iterates over this collection, removing each
-     * element using the <tt>Iterator.remove</tt> operation.  Most
+     * element using the {@code Iterator.remove} operation.  Most
      * implementations will probably choose to override this method for
      * efficiency.
      *
      * <p>Note that this implementation will throw an
-     * <tt>UnsupportedOperationException</tt> if the iterator returned by this
-     * collection's <tt>iterator</tt> method does not implement the
-     * <tt>remove</tt> method and this collection is non-empty.
+     * {@code UnsupportedOperationException} if the iterator returned by this
+     * collection's {@code iterator} method does not implement the
+     * {@code remove} method and this collection is non-empty.
      *
      * @throws UnsupportedOperationException {@inheritDoc}
      */
@@ -455,8 +455,8 @@
      * Returns a string representation of this collection.  The string
      * representation consists of a list of the collection's elements in the
      * order they are returned by its iterator, enclosed in square brackets
-     * (<tt>"[]"</tt>).  Adjacent elements are separated by the characters
-     * <tt>", "</tt> (comma and space).  Elements are converted to strings as
+     * ({@code "[]"}).  Adjacent elements are separated by the characters
+     * {@code ", "} (comma and space).  Elements are converted to strings as
      * by {@link String#valueOf(Object)}.
      *
      * @return a string representation of this collection
--- a/jdk/src/java.base/share/classes/java/util/AbstractMap.java	Thu Apr 09 12:29:31 2015 +0200
+++ b/jdk/src/java.base/share/classes/java/util/AbstractMap.java	Mon Aug 17 12:45:16 2015 +0300
@@ -27,24 +27,24 @@
 import java.util.Map.Entry;
 
 /**
- * This class provides a skeletal implementation of the <tt>Map</tt>
+ * This class provides a skeletal implementation of the {@code Map}
  * interface, to minimize the effort required to implement this interface.
  *
  * <p>To implement an unmodifiable map, the programmer needs only to extend this
- * class and provide an implementation for the <tt>entrySet</tt> method, which
+ * class and provide an implementation for the {@code entrySet} method, which
  * returns a set-view of the map's mappings.  Typically, the returned set
- * will, in turn, be implemented atop <tt>AbstractSet</tt>.  This set should
- * not support the <tt>add</tt> or <tt>remove</tt> methods, and its iterator
- * should not support the <tt>remove</tt> method.
+ * will, in turn, be implemented atop {@code AbstractSet}.  This set should
+ * not support the {@code add} or {@code remove} methods, and its iterator
+ * should not support the {@code remove} method.
  *
  * <p>To implement a modifiable map, the programmer must additionally override
- * this class's <tt>put</tt> method (which otherwise throws an
- * <tt>UnsupportedOperationException</tt>), and the iterator returned by
- * <tt>entrySet().iterator()</tt> must additionally implement its
- * <tt>remove</tt> method.
+ * this class's {@code put} method (which otherwise throws an
+ * {@code UnsupportedOperationException}), and the iterator returned by
+ * {@code entrySet().iterator()} must additionally implement its
+ * {@code remove} method.
  *
  * <p>The programmer should generally provide a void (no argument) and map
- * constructor, as per the recommendation in the <tt>Map</tt> interface
+ * constructor, as per the recommendation in the {@code Map} interface
  * specification.
  *
  * <p>The documentation for each non-abstract method in this class describes its
@@ -79,7 +79,7 @@
      * {@inheritDoc}
      *
      * @implSpec
-     * This implementation returns <tt>entrySet().size()</tt>.
+     * This implementation returns {@code entrySet().size()}.
      */
     public int size() {
         return entrySet().size();
@@ -89,7 +89,7 @@
      * {@inheritDoc}
      *
      * @implSpec
-     * This implementation returns <tt>size() == 0</tt>.
+     * This implementation returns {@code size() == 0}.
      */
     public boolean isEmpty() {
         return size() == 0;
@@ -99,10 +99,10 @@
      * {@inheritDoc}
      *
      * @implSpec
-     * This implementation iterates over <tt>entrySet()</tt> searching
+     * This implementation iterates over {@code entrySet()} searching
      * for an entry with the specified value.  If such an entry is found,
-     * <tt>true</tt> is returned.  If the iteration terminates without
-     * finding such an entry, <tt>false</tt> is returned.  Note that this
+     * {@code true} is returned.  If the iteration terminates without
+     * finding such an entry, {@code false} is returned.  Note that this
      * implementation requires linear time in the size of the map.
      *
      * @throws ClassCastException   {@inheritDoc}
@@ -130,10 +130,10 @@
      * {@inheritDoc}
      *
      * @implSpec
-     * This implementation iterates over <tt>entrySet()</tt> searching
+     * This implementation iterates over {@code entrySet()} searching
      * for an entry with the specified key.  If such an entry is found,
-     * <tt>true</tt> is returned.  If the iteration terminates without
-     * finding such an entry, <tt>false</tt> is returned.  Note that this
+     * {@code true} is returned.  If the iteration terminates without
+     * finding such an entry, {@code false} is returned.  Note that this
      * implementation requires linear time in the size of the map; many
      * implementations will override this method.
      *
@@ -162,10 +162,10 @@
      * {@inheritDoc}
      *
      * @implSpec
-     * This implementation iterates over <tt>entrySet()</tt> searching
+     * This implementation iterates over {@code entrySet()} searching
      * for an entry with the specified key.  If such an entry is found,
      * the entry's value is returned.  If the iteration terminates without
-     * finding such an entry, <tt>null</tt> is returned.  Note that this
+     * finding such an entry, {@code null} is returned.  Note that this
      * implementation requires linear time in the size of the map; many
      * implementations will override this method.
      *
@@ -198,7 +198,7 @@
      *
      * @implSpec
      * This implementation always throws an
-     * <tt>UnsupportedOperationException</tt>.
+     * {@code UnsupportedOperationException}.
      *
      * @throws UnsupportedOperationException {@inheritDoc}
      * @throws ClassCastException            {@inheritDoc}
@@ -213,18 +213,18 @@
      * {@inheritDoc}
      *
      * @implSpec
-     * This implementation iterates over <tt>entrySet()</tt> searching for an
+     * This implementation iterates over {@code entrySet()} searching for an
      * entry with the specified key.  If such an entry is found, its value is
-     * obtained with its <tt>getValue</tt> operation, the entry is removed
+     * obtained with its {@code getValue} operation, the entry is removed
      * from the collection (and the backing map) with the iterator's
-     * <tt>remove</tt> operation, and the saved value is returned.  If the
-     * iteration terminates without finding such an entry, <tt>null</tt> is
+     * {@code remove} operation, and the saved value is returned.  If the
+     * iteration terminates without finding such an entry, {@code null} is
      * returned.  Note that this implementation requires linear time in the
      * size of the map; many implementations will override this method.
      *
      * <p>Note that this implementation throws an
-     * <tt>UnsupportedOperationException</tt> if the <tt>entrySet</tt>
-     * iterator does not support the <tt>remove</tt> method and this map
+     * {@code UnsupportedOperationException} if the {@code entrySet}
+     * iterator does not support the {@code remove} method and this map
      * contains a mapping for the specified key.
      *
      * @throws UnsupportedOperationException {@inheritDoc}
@@ -264,12 +264,12 @@
      *
      * @implSpec
      * This implementation iterates over the specified map's
-     * <tt>entrySet()</tt> collection, and calls this map's <tt>put</tt>
+     * {@code entrySet()} collection, and calls this map's {@code put}
      * operation once for each entry returned by the iteration.
      *
      * <p>Note that this implementation throws an
-     * <tt>UnsupportedOperationException</tt> if this map does not support
-     * the <tt>put</tt> operation and the specified map is nonempty.
+     * {@code UnsupportedOperationException} if this map does not support
+     * the {@code put} operation and the specified map is nonempty.
      *
      * @throws UnsupportedOperationException {@inheritDoc}
      * @throws ClassCastException            {@inheritDoc}
@@ -285,11 +285,11 @@
      * {@inheritDoc}
      *
      * @implSpec
-     * This implementation calls <tt>entrySet().clear()</tt>.
+     * This implementation calls {@code entrySet().clear()}.
      *
      * <p>Note that this implementation throws an
-     * <tt>UnsupportedOperationException</tt> if the <tt>entrySet</tt>
-     * does not support the <tt>clear</tt> operation.
+     * {@code UnsupportedOperationException} if the {@code entrySet}
+     * does not support the {@code clear} operation.
      *
      * @throws UnsupportedOperationException {@inheritDoc}
      */
@@ -314,10 +314,10 @@
      * @implSpec
      * This implementation returns a set that subclasses {@link AbstractSet}.
      * The subclass's iterator method returns a "wrapper object" over this
-     * map's <tt>entrySet()</tt> iterator.  The <tt>size</tt> method
-     * delegates to this map's <tt>size</tt> method and the
-     * <tt>contains</tt> method delegates to this map's
-     * <tt>containsKey</tt> method.
+     * map's {@code entrySet()} iterator.  The {@code size} method
+     * delegates to this map's {@code size} method and the
+     * {@code contains} method delegates to this map's
+     * {@code containsKey} method.
      *
      * <p>The set is created the first time this method is called,
      * and returned in response to all subsequent calls.  No synchronization
@@ -371,10 +371,10 @@
      * @implSpec
      * This implementation returns a collection that subclasses {@link
      * AbstractCollection}.  The subclass's iterator method returns a
-     * "wrapper object" over this map's <tt>entrySet()</tt> iterator.
-     * The <tt>size</tt> method delegates to this map's <tt>size</tt>
-     * method and the <tt>contains</tt> method delegates to this map's
-     * <tt>containsValue</tt> method.
+     * "wrapper object" over this map's {@code entrySet()} iterator.
+     * The {@code size} method delegates to this map's {@code size}
+     * method and the {@code contains} method delegates to this map's
+     * {@code containsValue} method.
      *
      * <p>The collection is created the first time this method is called, and
      * returned in response to all subsequent calls.  No synchronization is
@@ -429,25 +429,25 @@
 
     /**
      * Compares the specified object with this map for equality.  Returns
-     * <tt>true</tt> if the given object is also a map and the two maps
-     * represent the same mappings.  More formally, two maps <tt>m1</tt> and
-     * <tt>m2</tt> represent the same mappings if
-     * <tt>m1.entrySet().equals(m2.entrySet())</tt>.  This ensures that the
-     * <tt>equals</tt> method works properly across different implementations
-     * of the <tt>Map</tt> interface.
+     * {@code true} if the given object is also a map and the two maps
+     * represent the same mappings.  More formally, two maps {@code m1} and
+     * {@code m2} represent the same mappings if
+     * {@code m1.entrySet().equals(m2.entrySet())}.  This ensures that the
+     * {@code equals} method works properly across different implementations
+     * of the {@code Map} interface.
      *
      * @implSpec
      * This implementation first checks if the specified object is this map;
-     * if so it returns <tt>true</tt>.  Then, it checks if the specified
+     * if so it returns {@code true}.  Then, it checks if the specified
      * object is a map whose size is identical to the size of this map; if
-     * not, it returns <tt>false</tt>.  If so, it iterates over this map's
-     * <tt>entrySet</tt> collection, and checks that the specified map
+     * not, it returns {@code false}.  If so, it iterates over this map's
+     * {@code entrySet} collection, and checks that the specified map
      * contains each mapping that this map contains.  If the specified map
-     * fails to contain such a mapping, <tt>false</tt> is returned.  If the
-     * iteration completes, <tt>true</tt> is returned.
+     * fails to contain such a mapping, {@code false} is returned.  If the
+     * iteration completes, {@code true} is returned.
      *
      * @param o object to be compared for equality with this map
-     * @return <tt>true</tt> if the specified object is equal to this map
+     * @return {@code true} if the specified object is equal to this map
      */
     public boolean equals(Object o) {
         if (o == this)
@@ -483,13 +483,13 @@
     /**
      * Returns the hash code value for this map.  The hash code of a map is
      * defined to be the sum of the hash codes of each entry in the map's
-     * <tt>entrySet()</tt> view.  This ensures that <tt>m1.equals(m2)</tt>
-     * implies that <tt>m1.hashCode()==m2.hashCode()</tt> for any two maps
-     * <tt>m1</tt> and <tt>m2</tt>, as required by the general contract of
+     * {@code entrySet()} view.  This ensures that {@code m1.equals(m2)}
+     * implies that {@code m1.hashCode()==m2.hashCode()} for any two maps
+     * {@code m1} and {@code m2}, as required by the general contract of
      * {@link Object#hashCode}.
      *
      * @implSpec
-     * This implementation iterates over <tt>entrySet()</tt>, calling
+     * This implementation iterates over {@code entrySet()}, calling
      * {@link Map.Entry#hashCode hashCode()} on each element (entry) in the
      * set, and adding up the results.
      *
@@ -508,10 +508,10 @@
     /**
      * Returns a string representation of this map.  The string representation
      * consists of a list of key-value mappings in the order returned by the
-     * map's <tt>entrySet</tt> view's iterator, enclosed in braces
-     * (<tt>"{}"</tt>).  Adjacent mappings are separated by the characters
-     * <tt>", "</tt> (comma and space).  Each key-value mapping is rendered as
-     * the key followed by an equals sign (<tt>"="</tt>) followed by the
+     * map's {@code entrySet} view's iterator, enclosed in braces
+     * ({@code "{}"}).  Adjacent mappings are separated by the characters
+     * {@code ", "} (comma and space).  Each key-value mapping is rendered as
+     * the key followed by an equals sign ({@code "="}) followed by the
      * associated value.  Keys and values are converted to strings as by
      * {@link String#valueOf(Object)}.
      *
@@ -538,7 +538,7 @@
     }
 
     /**
-     * Returns a shallow copy of this <tt>AbstractMap</tt> instance: the keys
+     * Returns a shallow copy of this {@code AbstractMap} instance: the keys
      * and values themselves are not cloned.
      *
      * @return a shallow copy of this map
@@ -570,11 +570,11 @@
 
     /**
      * An Entry maintaining a key and a value.  The value may be
-     * changed using the <tt>setValue</tt> method.  This class
+     * changed using the {@code setValue} method.  This class
      * facilitates the process of building custom map
      * implementations. For example, it may be convenient to return
-     * arrays of <tt>SimpleEntry</tt> instances in method
-     * <tt>Map.entrySet().toArray</tt>.
+     * arrays of {@code SimpleEntry} instances in method
+     * {@code Map.entrySet().toArray}.
      *
      * @since 1.6
      */
@@ -689,7 +689,7 @@
         /**
          * Returns a String representation of this map entry.  This
          * implementation returns the string representation of this
-         * entry's key followed by the equals character ("<tt>=</tt>")
+         * entry's key followed by the equals character ("{@code =}")
          * followed by the string representation of this entry's value.
          *
          * @return a String representation of this map entry
@@ -702,7 +702,7 @@
 
     /**
      * An Entry maintaining an immutable key and value.  This class
-     * does not support method <tt>setValue</tt>.  This class may be
+     * does not support method {@code setValue}.  This class may be
      * convenient in methods that return thread-safe snapshots of
      * key-value mappings.
      *
@@ -760,7 +760,7 @@
         /**
          * Replaces the value corresponding to this entry with the specified
          * value (optional operation).  This implementation simply throws
-         * <tt>UnsupportedOperationException</tt>, as this class implements
+         * {@code UnsupportedOperationException}, as this class implements
          * an <i>immutable</i> map entry.
          *
          * @param value new value to be stored in this entry
@@ -820,7 +820,7 @@
         /**
          * Returns a String representation of this map entry.  This
          * implementation returns the string representation of this
-         * entry's key followed by the equals character ("<tt>=</tt>")
+         * entry's key followed by the equals character ("{@code =}")
          * followed by the string representation of this entry's value.
          *
          * @return a String representation of this map entry
--- a/jdk/src/java.base/share/classes/java/util/AbstractSequentialList.java	Thu Apr 09 12:29:31 2015 +0200
+++ b/jdk/src/java.base/share/classes/java/util/AbstractSequentialList.java	Mon Aug 17 12:45:16 2015 +0300
@@ -26,31 +26,31 @@
 package java.util;
 
 /**
- * This class provides a skeletal implementation of the <tt>List</tt>
+ * This class provides a skeletal implementation of the {@code List}
  * interface to minimize the effort required to implement this interface
  * backed by a "sequential access" data store (such as a linked list).  For
- * random access data (such as an array), <tt>AbstractList</tt> should be used
+ * random access data (such as an array), {@code AbstractList} should be used
  * in preference to this class.<p>
  *
- * This class is the opposite of the <tt>AbstractList</tt> class in the sense
- * that it implements the "random access" methods (<tt>get(int index)</tt>,
- * <tt>set(int index, E element)</tt>, <tt>add(int index, E element)</tt> and
- * <tt>remove(int index)</tt>) on top of the list's list iterator, instead of
+ * This class is the opposite of the {@code AbstractList} class in the sense
+ * that it implements the "random access" methods ({@code get(int index)},
+ * {@code set(int index, E element)}, {@code add(int index, E element)} and
+ * {@code remove(int index)}) on top of the list's list iterator, instead of
  * the other way around.<p>
  *
  * To implement a list the programmer needs only to extend this class and
- * provide implementations for the <tt>listIterator</tt> and <tt>size</tt>
+ * provide implementations for the {@code listIterator} and {@code size}
  * methods.  For an unmodifiable list, the programmer need only implement the
- * list iterator's <tt>hasNext</tt>, <tt>next</tt>, <tt>hasPrevious</tt>,
- * <tt>previous</tt> and <tt>index</tt> methods.<p>
+ * list iterator's {@code hasNext}, {@code next}, {@code hasPrevious},
+ * {@code previous} and {@code index} methods.<p>
  *
  * For a modifiable list the programmer should additionally implement the list
- * iterator's <tt>set</tt> method.  For a variable-size list the programmer
- * should additionally implement the list iterator's <tt>remove</tt> and
- * <tt>add</tt> methods.<p>
+ * iterator's {@code set} method.  For a variable-size list the programmer
+ * should additionally implement the list iterator's {@code remove} and
+ * {@code add} methods.<p>
  *
  * The programmer should generally provide a void (no argument) and collection
- * constructor, as per the recommendation in the <tt>Collection</tt> interface
+ * constructor, as per the recommendation in the {@code Collection} interface
  * specification.<p>
  *
  * This class is a member of the
@@ -78,8 +78,8 @@
      * Returns the element at the specified position in this list.
      *
      * <p>This implementation first gets a list iterator pointing to the
-     * indexed element (with <tt>listIterator(index)</tt>).  Then, it gets
-     * the element using <tt>ListIterator.next</tt> and returns it.
+     * indexed element (with {@code listIterator(index)}).  Then, it gets
+     * the element using {@code ListIterator.next} and returns it.
      *
      * @throws IndexOutOfBoundsException {@inheritDoc}
      */
@@ -96,13 +96,13 @@
      * specified element (optional operation).
      *
      * <p>This implementation first gets a list iterator pointing to the
-     * indexed element (with <tt>listIterator(index)</tt>).  Then, it gets
-     * the current element using <tt>ListIterator.next</tt> and replaces it
-     * with <tt>ListIterator.set</tt>.
+     * indexed element (with {@code listIterator(index)}).  Then, it gets
+     * the current element using {@code ListIterator.next} and replaces it
+     * with {@code ListIterator.set}.
      *
      * <p>Note that this implementation will throw an
-     * <tt>UnsupportedOperationException</tt> if the list iterator does not
-     * implement the <tt>set</tt> operation.
+     * {@code UnsupportedOperationException} if the list iterator does not
+     * implement the {@code set} operation.
      *
      * @throws UnsupportedOperationException {@inheritDoc}
      * @throws ClassCastException            {@inheritDoc}
@@ -128,12 +128,12 @@
      * indices).
      *
      * <p>This implementation first gets a list iterator pointing to the
-     * indexed element (with <tt>listIterator(index)</tt>).  Then, it
-     * inserts the specified element with <tt>ListIterator.add</tt>.
+     * indexed element (with {@code listIterator(index)}).  Then, it
+     * inserts the specified element with {@code ListIterator.add}.
      *
      * <p>Note that this implementation will throw an
-     * <tt>UnsupportedOperationException</tt> if the list iterator does not
-     * implement the <tt>add</tt> operation.
+     * {@code UnsupportedOperationException} if the list iterator does not
+     * implement the {@code add} operation.
      *
      * @throws UnsupportedOperationException {@inheritDoc}
      * @throws ClassCastException            {@inheritDoc}
@@ -156,12 +156,12 @@
      * list.
      *
      * <p>This implementation first gets a list iterator pointing to the
-     * indexed element (with <tt>listIterator(index)</tt>).  Then, it removes
-     * the element with <tt>ListIterator.remove</tt>.
+     * indexed element (with {@code listIterator(index)}).  Then, it removes
+     * the element with {@code ListIterator.remove}.
      *
      * <p>Note that this implementation will throw an
-     * <tt>UnsupportedOperationException</tt> if the list iterator does not
-     * implement the <tt>remove</tt> operation.
+     * {@code UnsupportedOperationException} if the list iterator does not
+     * implement the {@code remove} operation.
      *
      * @throws UnsupportedOperationException {@inheritDoc}
      * @throws IndexOutOfBoundsException     {@inheritDoc}
@@ -193,14 +193,14 @@
      *
      * <p>This implementation gets an iterator over the specified collection and
      * a list iterator over this list pointing to the indexed element (with
-     * <tt>listIterator(index)</tt>).  Then, it iterates over the specified
+     * {@code listIterator(index)}).  Then, it iterates over the specified
      * collection, inserting the elements obtained from the iterator into this
-     * list, one at a time, using <tt>ListIterator.add</tt> followed by
-     * <tt>ListIterator.next</tt> (to skip over the added element).
+     * list, one at a time, using {@code ListIterator.add} followed by
+     * {@code ListIterator.next} (to skip over the added element).
      *
      * <p>Note that this implementation will throw an
-     * <tt>UnsupportedOperationException</tt> if the list iterator returned by
-     * the <tt>listIterator</tt> method does not implement the <tt>add</tt>
+     * {@code UnsupportedOperationException} if the list iterator returned by
+     * the {@code listIterator} method does not implement the {@code add}
      * operation.
      *
      * @throws UnsupportedOperationException {@inheritDoc}
@@ -243,7 +243,7 @@
      * sequence).
      *
      * @param  index index of first element to be returned from the list
-     *         iterator (by a call to the <code>next</code> method)
+     *         iterator (by a call to the {@code next} method)
      * @return a list iterator over the elements in this list (in proper
      *         sequence)
      * @throws IndexOutOfBoundsException {@inheritDoc}
--- a/jdk/src/java.base/share/classes/java/util/AbstractSet.java	Thu Apr 09 12:29:31 2015 +0200
+++ b/jdk/src/java.base/share/classes/java/util/AbstractSet.java	Mon Aug 17 12:45:16 2015 +0300
@@ -26,20 +26,20 @@
 package java.util;
 
 /**
- * This class provides a skeletal implementation of the <tt>Set</tt>
+ * This class provides a skeletal implementation of the {@code Set}
  * interface to minimize the effort required to implement this
  * interface. <p>
  *
  * The process of implementing a set by extending this class is identical
  * to that of implementing a Collection by extending AbstractCollection,
  * except that all of the methods and constructors in subclasses of this
- * class must obey the additional constraints imposed by the <tt>Set</tt>
+ * class must obey the additional constraints imposed by the {@code Set}
  * interface (for instance, the add method must not permit addition of
  * multiple instances of an object to a set).<p>
  *
  * Note that this class does not override any of the implementations from
- * the <tt>AbstractCollection</tt> class.  It merely adds implementations
- * for <tt>equals</tt> and <tt>hashCode</tt>.<p>
+ * the {@code AbstractCollection} class.  It merely adds implementations
+ * for {@code equals} and {@code hashCode}.<p>
  *
  * This class is a member of the
  * <a href="{@docRoot}/../technotes/guides/collections/index.html">
@@ -67,20 +67,20 @@
 
     /**
      * Compares the specified object with this set for equality.  Returns
-     * <tt>true</tt> if the given object is also a set, the two sets have
+     * {@code true} if the given object is also a set, the two sets have
      * the same size, and every member of the given set is contained in
-     * this set.  This ensures that the <tt>equals</tt> method works
-     * properly across different implementations of the <tt>Set</tt>
+     * this set.  This ensures that the {@code equals} method works
+     * properly across different implementations of the {@code Set}
      * interface.<p>
      *
      * This implementation first checks if the specified object is this
-     * set; if so it returns <tt>true</tt>.  Then, it checks if the
+     * set; if so it returns {@code true}.  Then, it checks if the
      * specified object is a set whose size is identical to the size of
      * this set; if not, it returns false.  If so, it returns
-     * <tt>containsAll((Collection) o)</tt>.
+     * {@code containsAll((Collection) o)}.
      *
      * @param o object to be compared for equality with this set
-     * @return <tt>true</tt> if the specified object is equal to this set
+     * @return {@code true} if the specified object is equal to this set
      */
     public boolean equals(Object o) {
         if (o == this)
@@ -103,14 +103,14 @@
     /**
      * Returns the hash code value for this set.  The hash code of a set is
      * defined to be the sum of the hash codes of the elements in the set,
-     * where the hash code of a <tt>null</tt> element is defined to be zero.
-     * This ensures that <tt>s1.equals(s2)</tt> implies that
-     * <tt>s1.hashCode()==s2.hashCode()</tt> for any two sets <tt>s1</tt>
-     * and <tt>s2</tt>, as required by the general contract of
+     * where the hash code of a {@code null} element is defined to be zero.
+     * This ensures that {@code s1.equals(s2)} implies that
+     * {@code s1.hashCode()==s2.hashCode()} for any two sets {@code s1}
+     * and {@code s2}, as required by the general contract of
      * {@link Object#hashCode}.
      *
      * <p>This implementation iterates over the set, calling the
-     * <tt>hashCode</tt> method on each element in the set, and adding up
+     * {@code hashCode} method on each element in the set, and adding up
      * the results.
      *
      * @return the hash code value for this set
@@ -136,24 +136,24 @@
      * the two sets.
      *
      * <p>This implementation determines which is the smaller of this set
-     * and the specified collection, by invoking the <tt>size</tt>
+     * and the specified collection, by invoking the {@code size}
      * method on each.  If this set has fewer elements, then the
      * implementation iterates over this set, checking each element
      * returned by the iterator in turn to see if it is contained in
      * the specified collection.  If it is so contained, it is removed
-     * from this set with the iterator's <tt>remove</tt> method.  If
+     * from this set with the iterator's {@code remove} method.  If
      * the specified collection has fewer elements, then the
      * implementation iterates over the specified collection, removing
      * from this set each element returned by the iterator, using this
-     * set's <tt>remove</tt> method.
+     * set's {@code remove} method.
      *
      * <p>Note that this implementation will throw an
-     * <tt>UnsupportedOperationException</tt> if the iterator returned by the
-     * <tt>iterator</tt> method does not implement the <tt>remove</tt> method.
+     * {@code UnsupportedOperationException} if the iterator returned by the
+     * {@code iterator} method does not implement the {@code remove} method.
      *
      * @param  c collection containing elements to be removed from this set
-     * @return <tt>true</tt> if this set changed as a result of the call
-     * @throws UnsupportedOperationException if the <tt>removeAll</tt> operation
+     * @return {@code true} if this set changed as a result of the call
+     * @throws UnsupportedOperationException if the {@code removeAll} operation
      *         is not supported by this set
      * @throws ClassCastException if the class of an element of this set
      *         is incompatible with the specified collection
--- a/jdk/src/java.base/share/classes/java/util/ArrayList.java	Thu Apr 09 12:29:31 2015 +0200
+++ b/jdk/src/java.base/share/classes/java/util/ArrayList.java	Mon Aug 17 12:45:16 2015 +0300
@@ -294,7 +294,7 @@
      * Returns {@code true} if this list contains the specified element.
      * More formally, returns {@code true} if and only if this list contains
      * at least one element {@code e} such that
-     * <tt>(o==null&nbsp;?&nbsp;e==null&nbsp;:&nbsp;o.equals(e))</tt>.
+     * {@code Objects.equals(o, e)}.
      *
      * @param o element whose presence in this list is to be tested
      * @return {@code true} if this list contains the specified element
@@ -307,7 +307,7 @@
      * Returns the index of the first occurrence of the specified element
      * in this list, or -1 if this list does not contain the element.
      * More formally, returns the lowest index {@code i} such that
-     * <tt>(o==null&nbsp;?&nbsp;get(i)==null&nbsp;:&nbsp;o.equals(get(i)))</tt>,
+     * {@code Objects.equals(o, get(i))},
      * or -1 if there is no such index.
      */
     public int indexOf(Object o) {
@@ -327,7 +327,7 @@
      * Returns the index of the last occurrence of the specified element
      * in this list, or -1 if this list does not contain the element.
      * More formally, returns the highest index {@code i} such that
-     * <tt>(o==null&nbsp;?&nbsp;get(i)==null&nbsp;:&nbsp;o.equals(get(i)))</tt>,
+     * {@code Objects.equals(o, get(i))},
      * or -1 if there is no such index.
      */
     public int lastIndexOf(Object o) {
@@ -511,7 +511,7 @@
      * if it is present.  If the list does not contain the element, it is
      * unchanged.  More formally, removes the element with the lowest index
      * {@code i} such that
-     * <tt>(o==null&nbsp;?&nbsp;get(i)==null&nbsp;:&nbsp;o.equals(get(i)))</tt>
+     * {@code Objects.equals(o, get(i))}
      * (if such an element exists).  Returns {@code true} if this list
      * contained the specified element (or equivalently, if this list
      * changed as a result of the call).
--- a/jdk/src/java.base/share/classes/java/util/Arrays.java	Thu Apr 09 12:29:31 2015 +0200
+++ b/jdk/src/java.base/share/classes/java/util/Arrays.java	Mon Aug 17 12:45:16 2015 +0300
@@ -1772,10 +1772,10 @@
      * @param a the array to be searched
      * @param key the value to be searched for
      * @return index of the search key, if it is contained in the array;
-     *         otherwise, <tt>(-(<i>insertion point</i>) - 1)</tt>.  The
+     *         otherwise, <code>(-(<i>insertion point</i>) - 1)</code>.  The
      *         <i>insertion point</i> is defined as the point at which the
      *         key would be inserted into the array: the index of the first
-     *         element greater than the key, or <tt>a.length</tt> if all
+     *         element greater than the key, or {@code a.length} if all
      *         elements in the array are less than the specified key.  Note
      *         that this guarantees that the return value will be &gt;= 0 if
      *         and only if the key is found.
@@ -1802,11 +1802,11 @@
      * @param key the value to be searched for
      * @return index of the search key, if it is contained in the array
      *         within the specified range;
-     *         otherwise, <tt>(-(<i>insertion point</i>) - 1)</tt>.  The
+     *         otherwise, <code>(-(<i>insertion point</i>) - 1)</code>.  The
      *         <i>insertion point</i> is defined as the point at which the
      *         key would be inserted into the array: the index of the first
      *         element in the range greater than the key,
-     *         or <tt>toIndex</tt> if all
+     *         or {@code toIndex} if all
      *         elements in the range are less than the specified key.  Note
      *         that this guarantees that the return value will be &gt;= 0 if
      *         and only if the key is found.
@@ -1853,10 +1853,10 @@
      * @param a the array to be searched
      * @param key the value to be searched for
      * @return index of the search key, if it is contained in the array;
-     *         otherwise, <tt>(-(<i>insertion point</i>) - 1)</tt>.  The
+     *         otherwise, <code>(-(<i>insertion point</i>) - 1)</code>.  The
      *         <i>insertion point</i> is defined as the point at which the
      *         key would be inserted into the array: the index of the first
-     *         element greater than the key, or <tt>a.length</tt> if all
+     *         element greater than the key, or {@code a.length} if all
      *         elements in the array are less than the specified key.  Note
      *         that this guarantees that the return value will be &gt;= 0 if
      *         and only if the key is found.
@@ -1883,11 +1883,11 @@
      * @param key the value to be searched for
      * @return index of the search key, if it is contained in the array
      *         within the specified range;
-     *         otherwise, <tt>(-(<i>insertion point</i>) - 1)</tt>.  The
+     *         otherwise, <code>(-(<i>insertion point</i>) - 1)</code>.  The
      *         <i>insertion point</i> is defined as the point at which the
      *         key would be inserted into the array: the index of the first
      *         element in the range greater than the key,
-     *         or <tt>toIndex</tt> if all
+     *         or {@code toIndex} if all
      *         elements in the range are less than the specified key.  Note
      *         that this guarantees that the return value will be &gt;= 0 if
      *         and only if the key is found.
@@ -1934,10 +1934,10 @@
      * @param a the array to be searched
      * @param key the value to be searched for
      * @return index of the search key, if it is contained in the array;
-     *         otherwise, <tt>(-(<i>insertion point</i>) - 1)</tt>.  The
+     *         otherwise, <code>(-(<i>insertion point</i>) - 1)</code>.  The
      *         <i>insertion point</i> is defined as the point at which the
      *         key would be inserted into the array: the index of the first
-     *         element greater than the key, or <tt>a.length</tt> if all
+     *         element greater than the key, or {@code a.length} if all
      *         elements in the array are less than the specified key.  Note
      *         that this guarantees that the return value will be &gt;= 0 if
      *         and only if the key is found.
@@ -1964,11 +1964,11 @@
      * @param key the value to be searched for
      * @return index of the search key, if it is contained in the array
      *         within the specified range;
-     *         otherwise, <tt>(-(<i>insertion point</i>) - 1)</tt>.  The
+     *         otherwise, <code>(-(<i>insertion point</i>) - 1)</code>.  The
      *         <i>insertion point</i> is defined as the point at which the
      *         key would be inserted into the array: the index of the first
      *         element in the range greater than the key,
-     *         or <tt>toIndex</tt> if all
+     *         or {@code toIndex} if all
      *         elements in the range are less than the specified key.  Note
      *         that this guarantees that the return value will be &gt;= 0 if
      *         and only if the key is found.
@@ -2015,10 +2015,10 @@
      * @param a the array to be searched
      * @param key the value to be searched for
      * @return index of the search key, if it is contained in the array;
-     *         otherwise, <tt>(-(<i>insertion point</i>) - 1)</tt>.  The
+     *         otherwise, <code>(-(<i>insertion point</i>) - 1)</code>.  The
      *         <i>insertion point</i> is defined as the point at which the
      *         key would be inserted into the array: the index of the first
-     *         element greater than the key, or <tt>a.length</tt> if all
+     *         element greater than the key, or {@code a.length} if all
      *         elements in the array are less than the specified key.  Note
      *         that this guarantees that the return value will be &gt;= 0 if
      *         and only if the key is found.
@@ -2045,11 +2045,11 @@
      * @param key the value to be searched for
      * @return index of the search key, if it is contained in the array
      *         within the specified range;
-     *         otherwise, <tt>(-(<i>insertion point</i>) - 1)</tt>.  The
+     *         otherwise, <code>(-(<i>insertion point</i>) - 1)</code>.  The
      *         <i>insertion point</i> is defined as the point at which the
      *         key would be inserted into the array: the index of the first
      *         element in the range greater than the key,
-     *         or <tt>toIndex</tt> if all
+     *         or {@code toIndex} if all
      *         elements in the range are less than the specified key.  Note
      *         that this guarantees that the return value will be &gt;= 0 if
      *         and only if the key is found.
@@ -2096,10 +2096,10 @@
      * @param a the array to be searched
      * @param key the value to be searched for
      * @return index of the search key, if it is contained in the array;
-     *         otherwise, <tt>(-(<i>insertion point</i>) - 1)</tt>.  The
+     *         otherwise, <code>(-(<i>insertion point</i>) - 1)</code>.  The
      *         <i>insertion point</i> is defined as the point at which the
      *         key would be inserted into the array: the index of the first
-     *         element greater than the key, or <tt>a.length</tt> if all
+     *         element greater than the key, or {@code a.length} if all
      *         elements in the array are less than the specified key.  Note
      *         that this guarantees that the return value will be &gt;= 0 if
      *         and only if the key is found.
@@ -2126,11 +2126,11 @@
      * @param key the value to be searched for
      * @return index of the search key, if it is contained in the array
      *         within the specified range;
-     *         otherwise, <tt>(-(<i>insertion point</i>) - 1)</tt>.  The
+     *         otherwise, <code>(-(<i>insertion point</i>) - 1)</code>.  The
      *         <i>insertion point</i> is defined as the point at which the
      *         key would be inserted into the array: the index of the first
      *         element in the range greater than the key,
-     *         or <tt>toIndex</tt> if all
+     *         or {@code toIndex} if all
      *         elements in the range are less than the specified key.  Note
      *         that this guarantees that the return value will be &gt;= 0 if
      *         and only if the key is found.
@@ -2178,10 +2178,10 @@
      * @param a the array to be searched
      * @param key the value to be searched for
      * @return index of the search key, if it is contained in the array;
-     *         otherwise, <tt>(-(<i>insertion point</i>) - 1)</tt>.  The
+     *         otherwise, <code>(-(<i>insertion point</i>) - 1)</code>.  The
      *         <i>insertion point</i> is defined as the point at which the
      *         key would be inserted into the array: the index of the first
-     *         element greater than the key, or <tt>a.length</tt> if all
+     *         element greater than the key, or {@code a.length} if all
      *         elements in the array are less than the specified key.  Note
      *         that this guarantees that the return value will be &gt;= 0 if
      *         and only if the key is found.
@@ -2209,11 +2209,11 @@
      * @param key the value to be searched for
      * @return index of the search key, if it is contained in the array
      *         within the specified range;
-     *         otherwise, <tt>(-(<i>insertion point</i>) - 1)</tt>.  The
+     *         otherwise, <code>(-(<i>insertion point</i>) - 1)</code>.  The
      *         <i>insertion point</i> is defined as the point at which the
      *         key would be inserted into the array: the index of the first
      *         element in the range greater than the key,
-     *         or <tt>toIndex</tt> if all
+     *         or {@code toIndex} if all
      *         elements in the range are less than the specified key.  Note
      *         that this guarantees that the return value will be &gt;= 0 if
      *         and only if the key is found.
@@ -2269,10 +2269,10 @@
      * @param a the array to be searched
      * @param key the value to be searched for
      * @return index of the search key, if it is contained in the array;
-     *         otherwise, <tt>(-(<i>insertion point</i>) - 1)</tt>. The
+     *         otherwise, <code>(-(<i>insertion point</i>) - 1)</code>. The
      *         <i>insertion point</i> is defined as the point at which the
      *         key would be inserted into the array: the index of the first
-     *         element greater than the key, or <tt>a.length</tt> if all
+     *         element greater than the key, or {@code a.length} if all
      *         elements in the array are less than the specified key. Note
      *         that this guarantees that the return value will be &gt;= 0 if
      *         and only if the key is found.
@@ -2300,11 +2300,11 @@
      * @param key the value to be searched for
      * @return index of the search key, if it is contained in the array
      *         within the specified range;
-     *         otherwise, <tt>(-(<i>insertion point</i>) - 1)</tt>. The
+     *         otherwise, <code>(-(<i>insertion point</i>) - 1)</code>. The
      *         <i>insertion point</i> is defined as the point at which the
      *         key would be inserted into the array: the index of the first
      *         element in the range greater than the key,
-     *         or <tt>toIndex</tt> if all
+     *         or {@code toIndex} if all
      *         elements in the range are less than the specified key. Note
      *         that this guarantees that the return value will be &gt;= 0 if
      *         and only if the key is found.
@@ -2366,10 +2366,10 @@
      * @param a the array to be searched
      * @param key the value to be searched for
      * @return index of the search key, if it is contained in the array;
-     *         otherwise, <tt>(-(<i>insertion point</i>) - 1)</tt>.  The
+     *         otherwise, <code>(-(<i>insertion point</i>) - 1)</code>.  The
      *         <i>insertion point</i> is defined as the point at which the
      *         key would be inserted into the array: the index of the first
-     *         element greater than the key, or <tt>a.length</tt> if all
+     *         element greater than the key, or {@code a.length} if all
      *         elements in the array are less than the specified key.  Note
      *         that this guarantees that the return value will be &gt;= 0 if
      *         and only if the key is found.
@@ -2404,11 +2404,11 @@
      * @param key the value to be searched for
      * @return index of the search key, if it is contained in the array
      *         within the specified range;
-     *         otherwise, <tt>(-(<i>insertion point</i>) - 1)</tt>.  The
+     *         otherwise, <code>(-(<i>insertion point</i>) - 1)</code>.  The
      *         <i>insertion point</i> is defined as the point at which the
      *         key would be inserted into the array: the index of the first
      *         element in the range greater than the key,
-     *         or <tt>toIndex</tt> if all
+     *         or {@code toIndex} if all
      *         elements in the range are less than the specified key.  Note
      *         that this guarantees that the return value will be &gt;= 0 if
      *         and only if the key is found.
@@ -2464,13 +2464,13 @@
      * @param a the array to be searched
      * @param key the value to be searched for
      * @param c the comparator by which the array is ordered.  A
-     *        <tt>null</tt> value indicates that the elements'
+     *        {@code null} value indicates that the elements'
      *        {@linkplain Comparable natural ordering} should be used.
      * @return index of the search key, if it is contained in the array;
-     *         otherwise, <tt>(-(<i>insertion point</i>) - 1)</tt>.  The
+     *         otherwise, <code>(-(<i>insertion point</i>) - 1)</code>.  The
      *         <i>insertion point</i> is defined as the point at which the
      *         key would be inserted into the array: the index of the first
-     *         element greater than the key, or <tt>a.length</tt> if all
+     *         element greater than the key, or {@code a.length} if all
      *         elements in the array are less than the specified key.  Note
      *         that this guarantees that the return value will be &gt;= 0 if
      *         and only if the key is found.
@@ -2503,15 +2503,15 @@
      * @param toIndex the index of the last element (exclusive) to be searched
      * @param key the value to be searched for
      * @param c the comparator by which the array is ordered.  A
-     *        <tt>null</tt> value indicates that the elements'
+     *        {@code null} value indicates that the elements'
      *        {@linkplain Comparable natural ordering} should be used.
      * @return index of the search key, if it is contained in the array
      *         within the specified range;
-     *         otherwise, <tt>(-(<i>insertion point</i>) - 1)</tt>.  The
+     *         otherwise, <code>(-(<i>insertion point</i>) - 1)</code>.  The
      *         <i>insertion point</i> is defined as the point at which the
      *         key would be inserted into the array: the index of the first
      *         element in the range greater than the key,
-     *         or <tt>toIndex</tt> if all
+     *         or {@code toIndex} if all
      *         elements in the range are less than the specified key.  Note
      *         that this guarantees that the return value will be &gt;= 0 if
      *         and only if the key is found.
@@ -2557,16 +2557,16 @@
     // Equality Testing
 
     /**
-     * Returns <tt>true</tt> if the two specified arrays of longs are
+     * Returns {@code true} if the two specified arrays of longs are
      * <i>equal</i> to one another.  Two arrays are considered equal if both
      * arrays contain the same number of elements, and all corresponding pairs
      * of elements in the two arrays are equal.  In other words, two arrays
      * are equal if they contain the same elements in the same order.  Also,
-     * two array references are considered equal if both are <tt>null</tt>.
+     * two array references are considered equal if both are {@code null}.
      *
      * @param a one array to be tested for equality
      * @param a2 the other array to be tested for equality
-     * @return <tt>true</tt> if the two arrays are equal
+     * @return {@code true} if the two arrays are equal
      */
     public static boolean equals(long[] a, long[] a2) {
         if (a==a2)
@@ -2586,16 +2586,16 @@
     }
 
     /**
-     * Returns <tt>true</tt> if the two specified arrays of ints are
+     * Returns {@code true} if the two specified arrays of ints are
      * <i>equal</i> to one another.  Two arrays are considered equal if both
      * arrays contain the same number of elements, and all corresponding pairs
      * of elements in the two arrays are equal.  In other words, two arrays
      * are equal if they contain the same elements in the same order.  Also,
-     * two array references are considered equal if both are <tt>null</tt>.
+     * two array references are considered equal if both are {@code null}.
      *
      * @param a one array to be tested for equality
      * @param a2 the other array to be tested for equality
-     * @return <tt>true</tt> if the two arrays are equal
+     * @return {@code true} if the two arrays are equal
      */
     public static boolean equals(int[] a, int[] a2) {
         if (a==a2)
@@ -2615,16 +2615,16 @@
     }
 
     /**
-     * Returns <tt>true</tt> if the two specified arrays of shorts are
+     * Returns {@code true} if the two specified arrays of shorts are
      * <i>equal</i> to one another.  Two arrays are considered equal if both
      * arrays contain the same number of elements, and all corresponding pairs
      * of elements in the two arrays are equal.  In other words, two arrays
      * are equal if they contain the same elements in the same order.  Also,
-     * two array references are considered equal if both are <tt>null</tt>.
+     * two array references are considered equal if both are {@code null}.
      *
      * @param a one array to be tested for equality
      * @param a2 the other array to be tested for equality
-     * @return <tt>true</tt> if the two arrays are equal
+     * @return {@code true} if the two arrays are equal
      */
     public static boolean equals(short[] a, short a2[]) {
         if (a==a2)
@@ -2644,16 +2644,16 @@
     }
 
     /**
-     * Returns <tt>true</tt> if the two specified arrays of chars are
+     * Returns {@code true} if the two specified arrays of chars are
      * <i>equal</i> to one another.  Two arrays are considered equal if both
      * arrays contain the same number of elements, and all corresponding pairs
      * of elements in the two arrays are equal.  In other words, two arrays
      * are equal if they contain the same elements in the same order.  Also,
-     * two array references are considered equal if both are <tt>null</tt>.
+     * two array references are considered equal if both are {@code null}.
      *
      * @param a one array to be tested for equality
      * @param a2 the other array to be tested for equality
-     * @return <tt>true</tt> if the two arrays are equal
+     * @return {@code true} if the two arrays are equal
      */
     @HotSpotIntrinsicCandidate
     public static boolean equals(char[] a, char[] a2) {
@@ -2674,16 +2674,16 @@
     }
 
     /**
-     * Returns <tt>true</tt> if the two specified arrays of bytes are
+     * Returns {@code true} if the two specified arrays of bytes are
      * <i>equal</i> to one another.  Two arrays are considered equal if both
      * arrays contain the same number of elements, and all corresponding pairs
      * of elements in the two arrays are equal.  In other words, two arrays
      * are equal if they contain the same elements in the same order.  Also,
-     * two array references are considered equal if both are <tt>null</tt>.
+     * two array references are considered equal if both are {@code null}.
      *
      * @param a one array to be tested for equality
      * @param a2 the other array to be tested for equality
-     * @return <tt>true</tt> if the two arrays are equal
+     * @return {@code true} if the two arrays are equal
      */
     public static boolean equals(byte[] a, byte[] a2) {
         if (a==a2)
@@ -2703,16 +2703,16 @@
     }
 
     /**
-     * Returns <tt>true</tt> if the two specified arrays of booleans are
+     * Returns {@code true} if the two specified arrays of booleans are
      * <i>equal</i> to one another.  Two arrays are considered equal if both
      * arrays contain the same number of elements, and all corresponding pairs
      * of elements in the two arrays are equal.  In other words, two arrays
      * are equal if they contain the same elements in the same order.  Also,
-     * two array references are considered equal if both are <tt>null</tt>.
+     * two array references are considered equal if both are {@code null}.
      *
      * @param a one array to be tested for equality
      * @param a2 the other array to be tested for equality
-     * @return <tt>true</tt> if the two arrays are equal
+     * @return {@code true} if the two arrays are equal
      */
     public static boolean equals(boolean[] a, boolean[] a2) {
         if (a==a2)
@@ -2732,21 +2732,21 @@
     }
 
     /**
-     * Returns <tt>true</tt> if the two specified arrays of doubles are
+     * Returns {@code true} if the two specified arrays of doubles are
      * <i>equal</i> to one another.  Two arrays are considered equal if both
      * arrays contain the same number of elements, and all corresponding pairs
      * of elements in the two arrays are equal.  In other words, two arrays
      * are equal if they contain the same elements in the same order.  Also,
-     * two array references are considered equal if both are <tt>null</tt>.
-     *
-     * Two doubles <tt>d1</tt> and <tt>d2</tt> are considered equal if:
-     * <pre>    <tt>new Double(d1).equals(new Double(d2))</tt></pre>
-     * (Unlike the <tt>==</tt> operator, this method considers
-     * <tt>NaN</tt> equals to itself, and 0.0d unequal to -0.0d.)
+     * two array references are considered equal if both are {@code null}.
+     *
+     * Two doubles {@code d1} and {@code d2} are considered equal if:
+     * <pre>    {@code new Double(d1).equals(new Double(d2))}</pre>
+     * (Unlike the {@code ==} operator, this method considers
+     * {@code NaN} equals to itself, and 0.0d unequal to -0.0d.)
      *
      * @param a one array to be tested for equality
      * @param a2 the other array to be tested for equality
-     * @return <tt>true</tt> if the two arrays are equal
+     * @return {@code true} if the two arrays are equal
      * @see Double#equals(Object)
      */
     public static boolean equals(double[] a, double[] a2) {
@@ -2767,21 +2767,21 @@
     }
 
     /**
-     * Returns <tt>true</tt> if the two specified arrays of floats are
+     * Returns {@code true} if the two specified arrays of floats are
      * <i>equal</i> to one another.  Two arrays are considered equal if both
      * arrays contain the same number of elements, and all corresponding pairs
      * of elements in the two arrays are equal.  In other words, two arrays
      * are equal if they contain the same elements in the same order.  Also,
-     * two array references are considered equal if both are <tt>null</tt>.
-     *
-     * Two floats <tt>f1</tt> and <tt>f2</tt> are considered equal if:
-     * <pre>    <tt>new Float(f1).equals(new Float(f2))</tt></pre>
-     * (Unlike the <tt>==</tt> operator, this method considers
-     * <tt>NaN</tt> equals to itself, and 0.0f unequal to -0.0f.)
+     * two array references are considered equal if both are {@code null}.
+     *
+     * Two floats {@code f1} and {@code f2} are considered equal if:
+     * <pre>    {@code new Float(f1).equals(new Float(f2))}</pre>
+     * (Unlike the {@code ==} operator, this method considers
+     * {@code NaN} equals to itself, and 0.0f unequal to -0.0f.)
      *
      * @param a one array to be tested for equality
      * @param a2 the other array to be tested for equality
-     * @return <tt>true</tt> if the two arrays are equal
+     * @return {@code true} if the two arrays are equal
      * @see Float#equals(Object)
      */
     public static boolean equals(float[] a, float[] a2) {
@@ -2802,18 +2802,19 @@
     }
 
     /**
-     * Returns <tt>true</tt> if the two specified arrays of Objects are
+     * Returns {@code true} if the two specified arrays of Objects are
      * <i>equal</i> to one another.  The two arrays are considered equal if
      * both arrays contain the same number of elements, and all corresponding
-     * pairs of elements in the two arrays are equal.  Two objects <tt>e1</tt>
-     * and <tt>e2</tt> are considered <i>equal</i> if <tt>(e1==null ? e2==null
-     * : e1.equals(e2))</tt>.  In other words, the two arrays are equal if
+     * pairs of elements in the two arrays are equal.  Two objects {@code e1}
+     * and {@code e2} are considered <i>equal</i> if
+     * {@code Objects.equals(e1, e2)}.
+     * In other words, the two arrays are equal if
      * they contain the same elements in the same order.  Also, two array
-     * references are considered equal if both are <tt>null</tt>.
+     * references are considered equal if both are {@code null}.
      *
      * @param a one array to be tested for equality
      * @param a2 the other array to be tested for equality
-     * @return <tt>true</tt> if the two arrays are equal
+     * @return {@code true} if the two arrays are equal
      */
     public static boolean equals(Object[] a, Object[] a2) {
         if (a==a2)
@@ -2852,8 +2853,8 @@
     /**
      * Assigns the specified long value to each element of the specified
      * range of the specified array of longs.  The range to be filled
-     * extends from index <tt>fromIndex</tt>, inclusive, to index
-     * <tt>toIndex</tt>, exclusive.  (If <tt>fromIndex==toIndex</tt>, the
+     * extends from index {@code fromIndex}, inclusive, to index
+     * {@code toIndex}, exclusive.  (If {@code fromIndex==toIndex}, the
      * range to be filled is empty.)
      *
      * @param a the array to be filled
@@ -2862,9 +2863,9 @@
      * @param toIndex the index of the last element (exclusive) to be
      *        filled with the specified value
      * @param val the value to be stored in all elements of the array
-     * @throws IllegalArgumentException if <tt>fromIndex &gt; toIndex</tt>
-     * @throws ArrayIndexOutOfBoundsException if <tt>fromIndex &lt; 0</tt> or
-     *         <tt>toIndex &gt; a.length</tt>
+     * @throws IllegalArgumentException if {@code fromIndex > toIndex}
+     * @throws ArrayIndexOutOfBoundsException if {@code fromIndex < 0} or
+     *         {@code toIndex > a.length}
      */
     public static void fill(long[] a, int fromIndex, int toIndex, long val) {
         rangeCheck(a.length, fromIndex, toIndex);
@@ -2887,8 +2888,8 @@
     /**
      * Assigns the specified int value to each element of the specified
      * range of the specified array of ints.  The range to be filled
-     * extends from index <tt>fromIndex</tt>, inclusive, to index
-     * <tt>toIndex</tt>, exclusive.  (If <tt>fromIndex==toIndex</tt>, the
+     * extends from index {@code fromIndex}, inclusive, to index
+     * {@code toIndex}, exclusive.  (If {@code fromIndex==toIndex}, the
      * range to be filled is empty.)
      *
      * @param a the array to be filled
@@ -2897,9 +2898,9 @@
      * @param toIndex the index of the last element (exclusive) to be
      *        filled with the specified value
      * @param val the value to be stored in all elements of the array
-     * @throws IllegalArgumentException if <tt>fromIndex &gt; toIndex</tt>
-     * @throws ArrayIndexOutOfBoundsException if <tt>fromIndex &lt; 0</tt> or
-     *         <tt>toIndex &gt; a.length</tt>
+     * @throws IllegalArgumentException if {@code fromIndex > toIndex}
+     * @throws ArrayIndexOutOfBoundsException if {@code fromIndex < 0} or
+     *         {@code toIndex > a.length}
      */
     public static void fill(int[] a, int fromIndex, int toIndex, int val) {
         rangeCheck(a.length, fromIndex, toIndex);
@@ -2922,8 +2923,8 @@
     /**
      * Assigns the specified short value to each element of the specified
      * range of the specified array of shorts.  The range to be filled
-     * extends from index <tt>fromIndex</tt>, inclusive, to index
-     * <tt>toIndex</tt>, exclusive.  (If <tt>fromIndex==toIndex</tt>, the
+     * extends from index {@code fromIndex}, inclusive, to index
+     * {@code toIndex}, exclusive.  (If {@code fromIndex==toIndex}, the
      * range to be filled is empty.)
      *
      * @param a the array to be filled
@@ -2932,9 +2933,9 @@
      * @param toIndex the index of the last element (exclusive) to be
      *        filled with the specified value
      * @param val the value to be stored in all elements of the array
-     * @throws IllegalArgumentException if <tt>fromIndex &gt; toIndex</tt>
-     * @throws ArrayIndexOutOfBoundsException if <tt>fromIndex &lt; 0</tt> or
-     *         <tt>toIndex &gt; a.length</tt>
+     * @throws IllegalArgumentException if {@code fromIndex > toIndex}
+     * @throws ArrayIndexOutOfBoundsException if {@code fromIndex < 0} or
+     *         {@code toIndex > a.length}
      */
     public static void fill(short[] a, int fromIndex, int toIndex, short val) {
         rangeCheck(a.length, fromIndex, toIndex);
@@ -2957,8 +2958,8 @@
     /**
      * Assigns the specified char value to each element of the specified
      * range of the specified array of chars.  The range to be filled
-     * extends from index <tt>fromIndex</tt>, inclusive, to index
-     * <tt>toIndex</tt>, exclusive.  (If <tt>fromIndex==toIndex</tt>, the
+     * extends from index {@code fromIndex}, inclusive, to index
+     * {@code toIndex}, exclusive.  (If {@code fromIndex==toIndex}, the
      * range to be filled is empty.)
      *
      * @param a the array to be filled
@@ -2967,9 +2968,9 @@
      * @param toIndex the index of the last element (exclusive) to be
      *        filled with the specified value
      * @param val the value to be stored in all elements of the array
-     * @throws IllegalArgumentException if <tt>fromIndex &gt; toIndex</tt>
-     * @throws ArrayIndexOutOfBoundsException if <tt>fromIndex &lt; 0</tt> or
-     *         <tt>toIndex &gt; a.length</tt>
+     * @throws IllegalArgumentException if {@code fromIndex > toIndex}
+     * @throws ArrayIndexOutOfBoundsException if {@code fromIndex < 0} or
+     *         {@code toIndex > a.length}
      */
     public static void fill(char[] a, int fromIndex, int toIndex, char val) {
         rangeCheck(a.length, fromIndex, toIndex);
@@ -2992,8 +2993,8 @@
     /**
      * Assigns the specified byte value to each element of the specified
      * range of the specified array of bytes.  The range to be filled
-     * extends from index <tt>fromIndex</tt>, inclusive, to index
-     * <tt>toIndex</tt>, exclusive.  (If <tt>fromIndex==toIndex</tt>, the
+     * extends from index {@code fromIndex}, inclusive, to index
+     * {@code toIndex}, exclusive.  (If {@code fromIndex==toIndex}, the
      * range to be filled is empty.)
      *
      * @param a the array to be filled
@@ -3002,9 +3003,9 @@
      * @param toIndex the index of the last element (exclusive) to be
      *        filled with the specified value
      * @param val the value to be stored in all elements of the array
-     * @throws IllegalArgumentException if <tt>fromIndex &gt; toIndex</tt>
-     * @throws ArrayIndexOutOfBoundsException if <tt>fromIndex &lt; 0</tt> or
-     *         <tt>toIndex &gt; a.length</tt>
+     * @throws IllegalArgumentException if {@code fromIndex > toIndex}
+     * @throws ArrayIndexOutOfBoundsException if {@code fromIndex < 0} or
+     *         {@code toIndex > a.length}
      */
     public static void fill(byte[] a, int fromIndex, int toIndex, byte val) {
         rangeCheck(a.length, fromIndex, toIndex);
@@ -3027,8 +3028,8 @@
     /**
      * Assigns the specified boolean value to each element of the specified
      * range of the specified array of booleans.  The range to be filled
-     * extends from index <tt>fromIndex</tt>, inclusive, to index
-     * <tt>toIndex</tt>, exclusive.  (If <tt>fromIndex==toIndex</tt>, the
+     * extends from index {@code fromIndex}, inclusive, to index
+     * {@code toIndex}, exclusive.  (If {@code fromIndex==toIndex}, the
      * range to be filled is empty.)
      *
      * @param a the array to be filled
@@ -3037,9 +3038,9 @@
      * @param toIndex the index of the last element (exclusive) to be
      *        filled with the specified value
      * @param val the value to be stored in all elements of the array
-     * @throws IllegalArgumentException if <tt>fromIndex &gt; toIndex</tt>
-     * @throws ArrayIndexOutOfBoundsException if <tt>fromIndex &lt; 0</tt> or
-     *         <tt>toIndex &gt; a.length</tt>
+     * @throws IllegalArgumentException if {@code fromIndex > toIndex}
+     * @throws ArrayIndexOutOfBoundsException if {@code fromIndex < 0} or
+     *         {@code toIndex > a.length}
      */
     public static void fill(boolean[] a, int fromIndex, int toIndex,
                             boolean val) {
@@ -3063,8 +3064,8 @@
     /**
      * Assigns the specified double value to each element of the specified
      * range of the specified array of doubles.  The range to be filled
-     * extends from index <tt>fromIndex</tt>, inclusive, to index
-     * <tt>toIndex</tt>, exclusive.  (If <tt>fromIndex==toIndex</tt>, the
+     * extends from index {@code fromIndex}, inclusive, to index
+     * {@code toIndex}, exclusive.  (If {@code fromIndex==toIndex}, the
      * range to be filled is empty.)
      *
      * @param a the array to be filled
@@ -3073,9 +3074,9 @@
      * @param toIndex the index of the last element (exclusive) to be
      *        filled with the specified value
      * @param val the value to be stored in all elements of the array
-     * @throws IllegalArgumentException if <tt>fromIndex &gt; toIndex</tt>
-     * @throws ArrayIndexOutOfBoundsException if <tt>fromIndex &lt; 0</tt> or
-     *         <tt>toIndex &gt; a.length</tt>
+     * @throws IllegalArgumentException if {@code fromIndex > toIndex}
+     * @throws ArrayIndexOutOfBoundsException if {@code fromIndex < 0} or
+     *         {@code toIndex > a.length}
      */
     public static void fill(double[] a, int fromIndex, int toIndex,double val){
         rangeCheck(a.length, fromIndex, toIndex);
@@ -3098,8 +3099,8 @@
     /**
      * Assigns the specified float value to each element of the specified
      * range of the specified array of floats.  The range to be filled
-     * extends from index <tt>fromIndex</tt>, inclusive, to index
-     * <tt>toIndex</tt>, exclusive.  (If <tt>fromIndex==toIndex</tt>, the
+     * extends from index {@code fromIndex}, inclusive, to index
+     * {@code toIndex}, exclusive.  (If {@code fromIndex==toIndex}, the
      * range to be filled is empty.)
      *
      * @param a the array to be filled
@@ -3108,9 +3109,9 @@
      * @param toIndex the index of the last element (exclusive) to be
      *        filled with the specified value
      * @param val the value to be stored in all elements of the array
-     * @throws IllegalArgumentException if <tt>fromIndex &gt; toIndex</tt>
-     * @throws ArrayIndexOutOfBoundsException if <tt>fromIndex &lt; 0</tt> or
-     *         <tt>toIndex &gt; a.length</tt>
+     * @throws IllegalArgumentException if {@code fromIndex > toIndex}
+     * @throws ArrayIndexOutOfBoundsException if {@code fromIndex < 0} or
+     *         {@code toIndex > a.length}
      */
     public static void fill(float[] a, int fromIndex, int toIndex, float val) {
         rangeCheck(a.length, fromIndex, toIndex);
@@ -3135,8 +3136,8 @@
     /**
      * Assigns the specified Object reference to each element of the specified
      * range of the specified array of Objects.  The range to be filled
-     * extends from index <tt>fromIndex</tt>, inclusive, to index
-     * <tt>toIndex</tt>, exclusive.  (If <tt>fromIndex==toIndex</tt>, the
+     * extends from index {@code fromIndex}, inclusive, to index
+     * {@code toIndex}, exclusive.  (If {@code fromIndex==toIndex}, the
      * range to be filled is empty.)
      *
      * @param a the array to be filled
@@ -3145,9 +3146,9 @@
      * @param toIndex the index of the last element (exclusive) to be
      *        filled with the specified value
      * @param val the value to be stored in all elements of the array
-     * @throws IllegalArgumentException if <tt>fromIndex &gt; toIndex</tt>
-     * @throws ArrayIndexOutOfBoundsException if <tt>fromIndex &lt; 0</tt> or
-     *         <tt>toIndex &gt; a.length</tt>
+     * @throws IllegalArgumentException if {@code fromIndex > toIndex}
+     * @throws ArrayIndexOutOfBoundsException if {@code fromIndex < 0} or
+     *         {@code toIndex > a.length}
      * @throws ArrayStoreException if the specified value is not of a
      *         runtime type that can be stored in the specified array
      */
@@ -3164,7 +3165,7 @@
      * so the copy has the specified length.  For all indices that are
      * valid in both the original array and the copy, the two arrays will
      * contain identical values.  For any indices that are valid in the
-     * copy but not the original, the copy will contain <tt>null</tt>.
+     * copy but not the original, the copy will contain {@code null}.
      * Such indices will exist if and only if the specified length
      * is greater than that of the original array.
      * The resulting array is of exactly the same class as the original array.
@@ -3174,8 +3175,8 @@
      * @param newLength the length of the copy to be returned
      * @return a copy of the original array, truncated or padded with nulls
      *     to obtain the specified length
-     * @throws NegativeArraySizeException if <tt>newLength</tt> is negative
-     * @throws NullPointerException if <tt>original</tt> is null
+     * @throws NegativeArraySizeException if {@code newLength} is negative
+     * @throws NullPointerException if {@code original} is null
      * @since 1.6
      */
     @SuppressWarnings("unchecked")
@@ -3188,10 +3189,10 @@
      * so the copy has the specified length.  For all indices that are
      * valid in both the original array and the copy, the two arrays will
      * contain identical values.  For any indices that are valid in the
-     * copy but not the original, the copy will contain <tt>null</tt>.
+     * copy but not the original, the copy will contain {@code null}.
      * Such indices will exist if and only if the specified length
      * is greater than that of the original array.
-     * The resulting array is of the class <tt>newType</tt>.
+     * The resulting array is of the class {@code newType}.
      *
      * @param <U> the class of the objects in the original array
      * @param <T> the class of the objects in the returned array
@@ -3200,11 +3201,11 @@
      * @param newType the class of the copy to be returned
      * @return a copy of the original array, truncated or padded with nulls
      *     to obtain the specified length
-     * @throws NegativeArraySizeException if <tt>newLength</tt> is negative
-     * @throws NullPointerException if <tt>original</tt> is null
+     * @throws NegativeArraySizeException if {@code newLength} is negative
+     * @throws NullPointerException if {@code original} is null
      * @throws ArrayStoreException if an element copied from
-     *     <tt>original</tt> is not of a runtime type that can be stored in
-     *     an array of class <tt>newType</tt>
+     *     {@code original} is not of a runtime type that can be stored in
+     *     an array of class {@code newType}
      * @since 1.6
      */
     @HotSpotIntrinsicCandidate
@@ -3223,7 +3224,7 @@
      * so the copy has the specified length.  For all indices that are
      * valid in both the original array and the copy, the two arrays will
      * contain identical values.  For any indices that are valid in the
-     * copy but not the original, the copy will contain <tt>(byte)0</tt>.
+     * copy but not the original, the copy will contain {@code (byte)0}.
      * Such indices will exist if and only if the specified length
      * is greater than that of the original array.
      *
@@ -3231,8 +3232,8 @@
      * @param newLength the length of the copy to be returned
      * @return a copy of the original array, truncated or padded with zeros
      *     to obtain the specified length
-     * @throws NegativeArraySizeException if <tt>newLength</tt> is negative
-     * @throws NullPointerException if <tt>original</tt> is null
+     * @throws NegativeArraySizeException if {@code newLength} is negative
+     * @throws NullPointerException if {@code original} is null
      * @since 1.6
      */
     public static byte[] copyOf(byte[] original, int newLength) {
@@ -3247,7 +3248,7 @@
      * so the copy has the specified length.  For all indices that are
      * valid in both the original array and the copy, the two arrays will
      * contain identical values.  For any indices that are valid in the
-     * copy but not the original, the copy will contain <tt>(short)0</tt>.
+     * copy but not the original, the copy will contain {@code (short)0}.
      * Such indices will exist if and only if the specified length
      * is greater than that of the original array.
      *
@@ -3255,8 +3256,8 @@
      * @param newLength the length of the copy to be returned
      * @return a copy of the original array, truncated or padded with zeros
      *     to obtain the specified length
-     * @throws NegativeArraySizeException if <tt>newLength</tt> is negative
-     * @throws NullPointerException if <tt>original</tt> is null
+     * @throws NegativeArraySizeException if {@code newLength} is negative
+     * @throws NullPointerException if {@code original} is null
      * @since 1.6
      */
     public static short[] copyOf(short[] original, int newLength) {
@@ -3271,7 +3272,7 @@
      * so the copy has the specified length.  For all indices that are
      * valid in both the original array and the copy, the two arrays will
      * contain identical values.  For any indices that are valid in the
-     * copy but not the original, the copy will contain <tt>0</tt>.
+     * copy but not the original, the copy will contain {@code 0}.
      * Such indices will exist if and only if the specified length
      * is greater than that of the original array.
      *
@@ -3279,8 +3280,8 @@
      * @param newLength the length of the copy to be returned
      * @return a copy of the original array, truncated or padded with zeros
      *     to obtain the specified length
-     * @throws NegativeArraySizeException if <tt>newLength</tt> is negative
-     * @throws NullPointerException if <tt>original</tt> is null
+     * @throws NegativeArraySizeException if {@code newLength} is negative
+     * @throws NullPointerException if {@code original} is null
      * @since 1.6
      */
     public static int[] copyOf(int[] original, int newLength) {
@@ -3295,7 +3296,7 @@
      * so the copy has the specified length.  For all indices that are
      * valid in both the original array and the copy, the two arrays will
      * contain identical values.  For any indices that are valid in the
-     * copy but not the original, the copy will contain <tt>0L</tt>.
+     * copy but not the original, the copy will contain {@code 0L}.
      * Such indices will exist if and only if the specified length
      * is greater than that of the original array.
      *
@@ -3303,8 +3304,8 @@
      * @param newLength the length of the copy to be returned
      * @return a copy of the original array, truncated or padded with zeros
      *     to obtain the specified length
-     * @throws NegativeArraySizeException if <tt>newLength</tt> is negative
-     * @throws NullPointerException if <tt>original</tt> is null
+     * @throws NegativeArraySizeException if {@code newLength} is negative
+     * @throws NullPointerException if {@code original} is null
      * @since 1.6
      */
     public static long[] copyOf(long[] original, int newLength) {
@@ -3319,7 +3320,7 @@
      * so the copy has the specified length.  For all indices that are valid
      * in both the original array and the copy, the two arrays will contain
      * identical values.  For any indices that are valid in the copy but not
-     * the original, the copy will contain <tt>'\\u000'</tt>.  Such indices
+     * the original, the copy will contain {@code '\\u000'}.  Such indices
      * will exist if and only if the specified length is greater than that of
      * the original array.
      *
@@ -3327,8 +3328,8 @@
      * @param newLength the length of the copy to be returned
      * @return a copy of the original array, truncated or padded with null characters
      *     to obtain the specified length
-     * @throws NegativeArraySizeException if <tt>newLength</tt> is negative
-     * @throws NullPointerException if <tt>original</tt> is null
+     * @throws NegativeArraySizeException if {@code newLength} is negative
+     * @throws NullPointerException if {@code original} is null
      * @since 1.6
      */
     public static char[] copyOf(char[] original, int newLength) {
@@ -3343,7 +3344,7 @@
      * so the copy has the specified length.  For all indices that are
      * valid in both the original array and the copy, the two arrays will
      * contain identical values.  For any indices that are valid in the
-     * copy but not the original, the copy will contain <tt>0f</tt>.
+     * copy but not the original, the copy will contain {@code 0f}.
      * Such indices will exist if and only if the specified length
      * is greater than that of the original array.
      *
@@ -3351,8 +3352,8 @@
      * @param newLength the length of the copy to be returned
      * @return a copy of the original array, truncated or padded with zeros
      *     to obtain the specified length
-     * @throws NegativeArraySizeException if <tt>newLength</tt> is negative
-     * @throws NullPointerException if <tt>original</tt> is null
+     * @throws NegativeArraySizeException if {@code newLength} is negative
+     * @throws NullPointerException if {@code original} is null
      * @since 1.6
      */
     public static float[] copyOf(float[] original, int newLength) {
@@ -3367,7 +3368,7 @@
      * so the copy has the specified length.  For all indices that are
      * valid in both the original array and the copy, the two arrays will
      * contain identical values.  For any indices that are valid in the
-     * copy but not the original, the copy will contain <tt>0d</tt>.
+     * copy but not the original, the copy will contain {@code 0d}.
      * Such indices will exist if and only if the specified length
      * is greater than that of the original array.
      *
@@ -3375,8 +3376,8 @@
      * @param newLength the length of the copy to be returned
      * @return a copy of the original array, truncated or padded with zeros
      *     to obtain the specified length
-     * @throws NegativeArraySizeException if <tt>newLength</tt> is negative
-     * @throws NullPointerException if <tt>original</tt> is null
+     * @throws NegativeArraySizeException if {@code newLength} is negative
+     * @throws NullPointerException if {@code original} is null
      * @since 1.6
      */
     public static double[] copyOf(double[] original, int newLength) {
@@ -3387,11 +3388,11 @@
     }
 
     /**
-     * Copies the specified array, truncating or padding with <tt>false</tt> (if necessary)
+     * Copies the specified array, truncating or padding with {@code false} (if necessary)
      * so the copy has the specified length.  For all indices that are
      * valid in both the original array and the copy, the two arrays will
      * contain identical values.  For any indices that are valid in the
-     * copy but not the original, the copy will contain <tt>false</tt>.
+     * copy but not the original, the copy will contain {@code false}.
      * Such indices will exist if and only if the specified length
      * is greater than that of the original array.
      *
@@ -3399,8 +3400,8 @@
      * @param newLength the length of the copy to be returned
      * @return a copy of the original array, truncated or padded with false elements
      *     to obtain the specified length
-     * @throws NegativeArraySizeException if <tt>newLength</tt> is negative
-     * @throws NullPointerException if <tt>original</tt> is null
+     * @throws NegativeArraySizeException if {@code newLength} is negative
+     * @throws NullPointerException if {@code original} is null
      * @since 1.6
      */
     public static boolean[] copyOf(boolean[] original, int newLength) {
@@ -3412,17 +3413,17 @@
 
     /**
      * Copies the specified range of the specified array into a new array.
-     * The initial index of the range (<tt>from</tt>) must lie between zero
-     * and <tt>original.length</tt>, inclusive.  The value at
-     * <tt>original[from]</tt> is placed into the initial element of the copy
-     * (unless <tt>from == original.length</tt> or <tt>from == to</tt>).
+     * The initial index of the range ({@code from}) must lie between zero
+     * and {@code original.length}, inclusive.  The value at
+     * {@code original[from]} is placed into the initial element of the copy
+     * (unless {@code from == original.length} or {@code from == to}).
      * Values from subsequent elements in the original array are placed into
      * subsequent elements in the copy.  The final index of the range
-     * (<tt>to</tt>), which must be greater than or equal to <tt>from</tt>,
-     * may be greater than <tt>original.length</tt>, in which case
-     * <tt>null</tt> is placed in all elements of the copy whose index is
-     * greater than or equal to <tt>original.length - from</tt>.  The length
-     * of the returned array will be <tt>to - from</tt>.
+     * ({@code to}), which must be greater than or equal to {@code from},
+     * may be greater than {@code original.length}, in which case
+     * {@code null} is placed in all elements of the copy whose index is
+     * greater than or equal to {@code original.length - from}.  The length
+     * of the returned array will be {@code to - from}.
      * <p>
      * The resulting array is of exactly the same class as the original array.
      *
@@ -3435,8 +3436,8 @@
      *     truncated or padded with nulls to obtain the required length
      * @throws ArrayIndexOutOfBoundsException if {@code from < 0}
      *     or {@code from > original.length}
-     * @throws IllegalArgumentException if <tt>from &gt; to</tt>
-     * @throws NullPointerException if <tt>original</tt> is null
+     * @throws IllegalArgumentException if {@code from > to}
+     * @throws NullPointerException if {@code original} is null
      * @since 1.6
      */
     @SuppressWarnings("unchecked")
@@ -3446,18 +3447,18 @@
 
     /**
      * Copies the specified range of the specified array into a new array.
-     * The initial index of the range (<tt>from</tt>) must lie between zero
-     * and <tt>original.length</tt>, inclusive.  The value at
-     * <tt>original[from]</tt> is placed into the initial element of the copy
-     * (unless <tt>from == original.length</tt> or <tt>from == to</tt>).
+     * The initial index of the range ({@code from}) must lie between zero
+     * and {@code original.length}, inclusive.  The value at
+     * {@code original[from]} is placed into the initial element of the copy
+     * (unless {@code from == original.length} or {@code from == to}).
      * Values from subsequent elements in the original array are placed into
      * subsequent elements in the copy.  The final index of the range
-     * (<tt>to</tt>), which must be greater than or equal to <tt>from</tt>,
-     * may be greater than <tt>original.length</tt>, in which case
-     * <tt>null</tt> is placed in all elements of the copy whose index is
-     * greater than or equal to <tt>original.length - from</tt>.  The length
-     * of the returned array will be <tt>to - from</tt>.
-     * The resulting array is of the class <tt>newType</tt>.
+     * ({@code to}), which must be greater than or equal to {@code from},
+     * may be greater than {@code original.length}, in which case
+     * {@code null} is placed in all elements of the copy whose index is
+     * greater than or equal to {@code original.length - from}.  The length
+     * of the returned array will be {@code to - from}.
+     * The resulting array is of the class {@code newType}.
      *
      * @param <U> the class of the objects in the original array
      * @param <T> the class of the objects in the returned array
@@ -3470,11 +3471,11 @@
      *     truncated or padded with nulls to obtain the required length
      * @throws ArrayIndexOutOfBoundsException if {@code from < 0}
      *     or {@code from > original.length}
-     * @throws IllegalArgumentException if <tt>from &gt; to</tt>
-     * @throws NullPointerException if <tt>original</tt> is null
+     * @throws IllegalArgumentException if {@code from > to}
+     * @throws NullPointerException if {@code original} is null
      * @throws ArrayStoreException if an element copied from
-     *     <tt>original</tt> is not of a runtime type that can be stored in
-     *     an array of class <tt>newType</tt>.
+     *     {@code original} is not of a runtime type that can be stored in
+     *     an array of class {@code newType}.
      * @since 1.6
      */
     @HotSpotIntrinsicCandidate
@@ -3493,17 +3494,17 @@
 
     /**
      * Copies the specified range of the specified array into a new array.
-     * The initial index of the range (<tt>from</tt>) must lie between zero
-     * and <tt>original.length</tt>, inclusive.  The value at
-     * <tt>original[from]</tt> is placed into the initial element of the copy
-     * (unless <tt>from == original.length</tt> or <tt>from == to</tt>).
+     * The initial index of the range ({@code from}) must lie between zero
+     * and {@code original.length}, inclusive.  The value at
+     * {@code original[from]} is placed into the initial element of the copy
+     * (unless {@code from == original.length} or {@code from == to}).
      * Values from subsequent elements in the original array are placed into
      * subsequent elements in the copy.  The final index of the range
-     * (<tt>to</tt>), which must be greater than or equal to <tt>from</tt>,
-     * may be greater than <tt>original.length</tt>, in which case
-     * <tt>(byte)0</tt> is placed in all elements of the copy whose index is
-     * greater than or equal to <tt>original.length - from</tt>.  The length
-     * of the returned array will be <tt>to - from</tt>.
+     * ({@code to}), which must be greater than or equal to {@code from},
+     * may be greater than {@code original.length}, in which case
+     * {@code (byte)0} is placed in all elements of the copy whose index is
+     * greater than or equal to {@code original.length - from}.  The length
+     * of the returned array will be {@code to - from}.
      *
      * @param original the array from which a range is to be copied
      * @param from the initial index of the range to be copied, inclusive
@@ -3513,8 +3514,8 @@
      *     truncated or padded with zeros to obtain the required length
      * @throws ArrayIndexOutOfBoundsException if {@code from < 0}
      *     or {@code from > original.length}
-     * @throws IllegalArgumentException if <tt>from &gt; to</tt>
-     * @throws NullPointerException if <tt>original</tt> is null
+     * @throws IllegalArgumentException if {@code from > to}
+     * @throws NullPointerException if {@code original} is null
      * @since 1.6
      */
     public static byte[] copyOfRange(byte[] original, int from, int to) {
@@ -3529,17 +3530,17 @@
 
     /**
      * Copies the specified range of the specified array into a new array.
-     * The initial index of the range (<tt>from</tt>) must lie between zero
-     * and <tt>original.length</tt>, inclusive.  The value at
-     * <tt>original[from]</tt> is placed into the initial element of the copy
-     * (unless <tt>from == original.length</tt> or <tt>from == to</tt>).
+     * The initial index of the range ({@code from}) must lie between zero
+     * and {@code original.length}, inclusive.  The value at
+     * {@code original[from]} is placed into the initial element of the copy
+     * (unless {@code from == original.length} or {@code from == to}).
      * Values from subsequent elements in the original array are placed into
      * subsequent elements in the copy.  The final index of the range
-     * (<tt>to</tt>), which must be greater than or equal to <tt>from</tt>,
-     * may be greater than <tt>original.length</tt>, in which case
-     * <tt>(short)0</tt> is placed in all elements of the copy whose index is
-     * greater than or equal to <tt>original.length - from</tt>.  The length
-     * of the returned array will be <tt>to - from</tt>.
+     * ({@code to}), which must be greater than or equal to {@code from},
+     * may be greater than {@code original.length}, in which case
+     * {@code (short)0} is placed in all elements of the copy whose index is
+     * greater than or equal to {@code original.length - from}.  The length
+     * of the returned array will be {@code to - from}.
      *
      * @param original the array from which a range is to be copied
      * @param from the initial index of the range to be copied, inclusive
@@ -3549,8 +3550,8 @@
      *     truncated or padded with zeros to obtain the required length
      * @throws ArrayIndexOutOfBoundsException if {@code from < 0}
      *     or {@code from > original.length}
-     * @throws IllegalArgumentException if <tt>from &gt; to</tt>
-     * @throws NullPointerException if <tt>original</tt> is null
+     * @throws IllegalArgumentException if {@code from > to}
+     * @throws NullPointerException if {@code original} is null
      * @since 1.6
      */
     public static short[] copyOfRange(short[] original, int from, int to) {
@@ -3565,17 +3566,17 @@
 
     /**
      * Copies the specified range of the specified array into a new array.
-     * The initial index of the range (<tt>from</tt>) must lie between zero
-     * and <tt>original.length</tt>, inclusive.  The value at
-     * <tt>original[from]</tt> is placed into the initial element of the copy
-     * (unless <tt>from == original.length</tt> or <tt>from == to</tt>).
+     * The initial index of the range ({@code from}) must lie between zero
+     * and {@code original.length}, inclusive.  The value at
+     * {@code original[from]} is placed into the initial element of the copy
+     * (unless {@code from == original.length} or {@code from == to}).
      * Values from subsequent elements in the original array are placed into
      * subsequent elements in the copy.  The final index of the range
-     * (<tt>to</tt>), which must be greater than or equal to <tt>from</tt>,
-     * may be greater than <tt>original.length</tt>, in which case
-     * <tt>0</tt> is placed in all elements of the copy whose index is
-     * greater than or equal to <tt>original.length - from</tt>.  The length
-     * of the returned array will be <tt>to - from</tt>.
+     * ({@code to}), which must be greater than or equal to {@code from},
+     * may be greater than {@code original.length}, in which case
+     * {@code 0} is placed in all elements of the copy whose index is
+     * greater than or equal to {@code original.length - from}.  The length
+     * of the returned array will be {@code to - from}.
      *
      * @param original the array from which a range is to be copied
      * @param from the initial index of the range to be copied, inclusive
@@ -3585,8 +3586,8 @@
      *     truncated or padded with zeros to obtain the required length
      * @throws ArrayIndexOutOfBoundsException if {@code from < 0}
      *     or {@code from > original.length}
-     * @throws IllegalArgumentException if <tt>from &gt; to</tt>
-     * @throws NullPointerException if <tt>original</tt> is null
+     * @throws IllegalArgumentException if {@code from > to}
+     * @throws NullPointerException if {@code original} is null
      * @since 1.6
      */
     public static int[] copyOfRange(int[] original, int from, int to) {
@@ -3601,17 +3602,17 @@
 
     /**
      * Copies the specified range of the specified array into a new array.
-     * The initial index of the range (<tt>from</tt>) must lie between zero
-     * and <tt>original.length</tt>, inclusive.  The value at
-     * <tt>original[from]</tt> is placed into the initial element of the copy
-     * (unless <tt>from == original.length</tt> or <tt>from == to</tt>).
+     * The initial index of the range ({@code from}) must lie between zero
+     * and {@code original.length}, inclusive.  The value at
+     * {@code original[from]} is placed into the initial element of the copy
+     * (unless {@code from == original.length} or {@code from == to}).
      * Values from subsequent elements in the original array are placed into
      * subsequent elements in the copy.  The final index of the range
-     * (<tt>to</tt>), which must be greater than or equal to <tt>from</tt>,
-     * may be greater than <tt>original.length</tt>, in which case
-     * <tt>0L</tt> is placed in all elements of the copy whose index is
-     * greater than or equal to <tt>original.length - from</tt>.  The length
-     * of the returned array will be <tt>to - from</tt>.
+     * ({@code to}), which must be greater than or equal to {@code from},
+     * may be greater than {@code original.length}, in which case
+     * {@code 0L} is placed in all elements of the copy whose index is
+     * greater than or equal to {@code original.length - from}.  The length
+     * of the returned array will be {@code to - from}.
      *
      * @param original the array from which a range is to be copied
      * @param from the initial index of the range to be copied, inclusive
@@ -3621,8 +3622,8 @@
      *     truncated or padded with zeros to obtain the required length
      * @throws ArrayIndexOutOfBoundsException if {@code from < 0}
      *     or {@code from > original.length}
-     * @throws IllegalArgumentException if <tt>from &gt; to</tt>
-     * @throws NullPointerException if <tt>original</tt> is null
+     * @throws IllegalArgumentException if {@code from > to}
+     * @throws NullPointerException if {@code original} is null
      * @since 1.6
      */
     public static long[] copyOfRange(long[] original, int from, int to) {
@@ -3637,17 +3638,17 @@
 
     /**
      * Copies the specified range of the specified array into a new array.
-     * The initial index of the range (<tt>from</tt>) must lie between zero
-     * and <tt>original.length</tt>, inclusive.  The value at
-     * <tt>original[from]</tt> is placed into the initial element of the copy
-     * (unless <tt>from == original.length</tt> or <tt>from == to</tt>).
+     * The initial index of the range ({@code from}) must lie between zero
+     * and {@code original.length}, inclusive.  The value at
+     * {@code original[from]} is placed into the initial element of the copy
+     * (unless {@code from == original.length} or {@code from == to}).
      * Values from subsequent elements in the original array are placed into
      * subsequent elements in the copy.  The final index of the range
-     * (<tt>to</tt>), which must be greater than or equal to <tt>from</tt>,
-     * may be greater than <tt>original.length</tt>, in which case
-     * <tt>'\\u000'</tt> is placed in all elements of the copy whose index is
-     * greater than or equal to <tt>original.length - from</tt>.  The length
-     * of the returned array will be <tt>to - from</tt>.
+     * ({@code to}), which must be greater than or equal to {@code from},
+     * may be greater than {@code original.length}, in which case
+     * {@code '\\u000'} is placed in all elements of the copy whose index is
+     * greater than or equal to {@code original.length - from}.  The length
+     * of the returned array will be {@code to - from}.
      *
      * @param original the array from which a range is to be copied
      * @param from the initial index of the range to be copied, inclusive
@@ -3657,8 +3658,8 @@
      *     truncated or padded with null characters to obtain the required length
      * @throws ArrayIndexOutOfBoundsException if {@code from < 0}
      *     or {@code from > original.length}
-     * @throws IllegalArgumentException if <tt>from &gt; to</tt>
-     * @throws NullPointerException if <tt>original</tt> is null
+     * @throws IllegalArgumentException if {@code from > to}
+     * @throws NullPointerException if {@code original} is null
      * @since 1.6
      */
     public static char[] copyOfRange(char[] original, int from, int to) {
@@ -3673,17 +3674,17 @@
 
     /**
      * Copies the specified range of the specified array into a new array.
-     * The initial index of the range (<tt>from</tt>) must lie between zero
-     * and <tt>original.length</tt>, inclusive.  The value at
-     * <tt>original[from]</tt> is placed into the initial element of the copy
-     * (unless <tt>from == original.length</tt> or <tt>from == to</tt>).
+     * The initial index of the range ({@code from}) must lie between zero
+     * and {@code original.length}, inclusive.  The value at
+     * {@code original[from]} is placed into the initial element of the copy
+     * (unless {@code from == original.length} or {@code from == to}).
      * Values from subsequent elements in the original array are placed into
      * subsequent elements in the copy.  The final index of the range
-     * (<tt>to</tt>), which must be greater than or equal to <tt>from</tt>,
-     * may be greater than <tt>original.length</tt>, in which case
-     * <tt>0f</tt> is placed in all elements of the copy whose index is
-     * greater than or equal to <tt>original.length - from</tt>.  The length
-     * of the returned array will be <tt>to - from</tt>.
+     * ({@code to}), which must be greater than or equal to {@code from},
+     * may be greater than {@code original.length}, in which case
+     * {@code 0f} is placed in all elements of the copy whose index is
+     * greater than or equal to {@code original.length - from}.  The length
+     * of the returned array will be {@code to - from}.
      *
      * @param original the array from which a range is to be copied
      * @param from the initial index of the range to be copied, inclusive
@@ -3693,8 +3694,8 @@
      *     truncated or padded with zeros to obtain the required length
      * @throws ArrayIndexOutOfBoundsException if {@code from < 0}
      *     or {@code from > original.length}
-     * @throws IllegalArgumentException if <tt>from &gt; to</tt>
-     * @throws NullPointerException if <tt>original</tt> is null
+     * @throws IllegalArgumentException if {@code from > to}
+     * @throws NullPointerException if {@code original} is null
      * @since 1.6
      */
     public static float[] copyOfRange(float[] original, int from, int to) {
@@ -3709,17 +3710,17 @@
 
     /**
      * Copies the specified range of the specified array into a new array.
-     * The initial index of the range (<tt>from</tt>) must lie between zero
-     * and <tt>original.length</tt>, inclusive.  The value at
-     * <tt>original[from]</tt> is placed into the initial element of the copy
-     * (unless <tt>from == original.length</tt> or <tt>from == to</tt>).
+     * The initial index of the range ({@code from}) must lie between zero
+     * and {@code original.length}, inclusive.  The value at
+     * {@code original[from]} is placed into the initial element of the copy
+     * (unless {@code from == original.length} or {@code from == to}).
      * Values from subsequent elements in the original array are placed into
      * subsequent elements in the copy.  The final index of the range
-     * (<tt>to</tt>), which must be greater than or equal to <tt>from</tt>,
-     * may be greater than <tt>original.length</tt>, in which case
-     * <tt>0d</tt> is placed in all elements of the copy whose index is
-     * greater than or equal to <tt>original.length - from</tt>.  The length
-     * of the returned array will be <tt>to - from</tt>.
+     * ({@code to}), which must be greater than or equal to {@code from},
+     * may be greater than {@code original.length}, in which case
+     * {@code 0d} is placed in all elements of the copy whose index is
+     * greater than or equal to {@code original.length - from}.  The length
+     * of the returned array will be {@code to - from}.
      *
      * @param original the array from which a range is to be copied
      * @param from the initial index of the range to be copied, inclusive
@@ -3729,8 +3730,8 @@
      *     truncated or padded with zeros to obtain the required length
      * @throws ArrayIndexOutOfBoundsException if {@code from < 0}
      *     or {@code from > original.length}
-     * @throws IllegalArgumentException if <tt>from &gt; to</tt>
-     * @throws NullPointerException if <tt>original</tt> is null
+     * @throws IllegalArgumentException if {@code from > to}
+     * @throws NullPointerException if {@code original} is null
      * @since 1.6
      */
     public static double[] copyOfRange(double[] original, int from, int to) {
@@ -3745,17 +3746,17 @@
 
     /**
      * Copies the specified range of the specified array into a new array.
-     * The initial index of the range (<tt>from</tt>) must lie between zero
-     * and <tt>original.length</tt>, inclusive.  The value at
-     * <tt>original[from]</tt> is placed into the initial element of the copy
-     * (unless <tt>from == original.length</tt> or <tt>from == to</tt>).
+     * The initial index of the range ({@code from}) must lie between zero
+     * and {@code original.length}, inclusive.  The value at
+     * {@code original[from]} is placed into the initial element of the copy
+     * (unless {@code from == original.length} or {@code from == to}).
      * Values from subsequent elements in the original array are placed into
      * subsequent elements in the copy.  The final index of the range
-     * (<tt>to</tt>), which must be greater than or equal to <tt>from</tt>,
-     * may be greater than <tt>original.length</tt>, in which case
-     * <tt>false</tt> is placed in all elements of the copy whose index is
-     * greater than or equal to <tt>original.length - from</tt>.  The length
-     * of the returned array will be <tt>to - from</tt>.
+     * ({@code to}), which must be greater than or equal to {@code from},
+     * may be greater than {@code original.length}, in which case
+     * {@code false} is placed in all elements of the copy whose index is
+     * greater than or equal to {@code original.length - from}.  The length
+     * of the returned array will be {@code to - from}.
      *
      * @param original the array from which a range is to be copied
      * @param from the initial index of the range to be copied, inclusive
@@ -3765,8 +3766,8 @@
      *     truncated or padded with false elements to obtain the required length
      * @throws ArrayIndexOutOfBoundsException if {@code from < 0}
      *     or {@code from > original.length}
-     * @throws IllegalArgumentException if <tt>from &gt; to</tt>
-     * @throws NullPointerException if <tt>original</tt> is null
+     * @throws IllegalArgumentException if {@code from > to}
+     * @throws NullPointerException if {@code original} is null
      * @since 1.6
      */
     public static boolean[] copyOfRange(boolean[] original, int from, int to) {
@@ -3902,18 +3903,18 @@
 
     /**
      * Returns a hash code based on the contents of the specified array.
-     * For any two <tt>long</tt> arrays <tt>a</tt> and <tt>b</tt>
-     * such that <tt>Arrays.equals(a, b)</tt>, it is also the case that
-     * <tt>Arrays.hashCode(a) == Arrays.hashCode(b)</tt>.
+     * For any two {@code long} arrays {@code a} and {@code b}
+     * such that {@code Arrays.equals(a, b)}, it is also the case that
+     * {@code Arrays.hashCode(a) == Arrays.hashCode(b)}.
      *
      * <p>The value returned by this method is the same value that would be
-     * obtained by invoking the {@link List#hashCode() <tt>hashCode</tt>}
+     * obtained by invoking the {@link List#hashCode() hashCode}
      * method on a {@link List} containing a sequence of {@link Long}
-     * instances representing the elements of <tt>a</tt> in the same order.
-     * If <tt>a</tt> is <tt>null</tt>, this method returns 0.
+     * instances representing the elements of {@code a} in the same order.
+     * If {@code a} is {@code null}, this method returns 0.
      *
      * @param a the array whose hash value to compute
-     * @return a content-based hash code for <tt>a</tt>
+     * @return a content-based hash code for {@code a}
      * @since 1.5
      */
     public static int hashCode(long a[]) {
@@ -3931,18 +3932,18 @@
 
     /**
      * Returns a hash code based on the contents of the specified array.
-     * For any two non-null <tt>int</tt> arrays <tt>a</tt> and <tt>b</tt>
-     * such that <tt>Arrays.equals(a, b)</tt>, it is also the case that
-     * <tt>Arrays.hashCode(a) == Arrays.hashCode(b)</tt>.
+     * For any two non-null {@code int} arrays {@code a} and {@code b}
+     * such that {@code Arrays.equals(a, b)}, it is also the case that
+     * {@code Arrays.hashCode(a) == Arrays.hashCode(b)}.
      *
      * <p>The value returned by this method is the same value that would be
-     * obtained by invoking the {@link List#hashCode() <tt>hashCode</tt>}
+     * obtained by invoking the {@link List#hashCode() hashCode}
      * method on a {@link List} containing a sequence of {@link Integer}
-     * instances representing the elements of <tt>a</tt> in the same order.
-     * If <tt>a</tt> is <tt>null</tt>, this method returns 0.
+     * instances representing the elements of {@code a} in the same order.
+     * If {@code a} is {@code null}, this method returns 0.
      *
      * @param a the array whose hash value to compute
-     * @return a content-based hash code for <tt>a</tt>
+     * @return a content-based hash code for {@code a}
      * @since 1.5
      */
     public static int hashCode(int a[]) {
@@ -3958,18 +3959,18 @@
 
     /**
      * Returns a hash code based on the contents of the specified array.
-     * For any two <tt>short</tt> arrays <tt>a</tt> and <tt>b</tt>
-     * such that <tt>Arrays.equals(a, b)</tt>, it is also the case that
-     * <tt>Arrays.hashCode(a) == Arrays.hashCode(b)</tt>.
+     * For any two {@code short} arrays {@code a} and {@code b}
+     * such that {@code Arrays.equals(a, b)}, it is also the case that
+     * {@code Arrays.hashCode(a) == Arrays.hashCode(b)}.
      *
      * <p>The value returned by this method is the same value that would be
-     * obtained by invoking the {@link List#hashCode() <tt>hashCode</tt>}
+     * obtained by invoking the {@link List#hashCode() hashCode}
      * method on a {@link List} containing a sequence of {@link Short}
-     * instances representing the elements of <tt>a</tt> in the same order.
-     * If <tt>a</tt> is <tt>null</tt>, this method returns 0.
+     * instances representing the elements of {@code a} in the same order.
+     * If {@code a} is {@code null}, this method returns 0.
      *
      * @param a the array whose hash value to compute
-     * @return a content-based hash code for <tt>a</tt>
+     * @return a content-based hash code for {@code a}
      * @since 1.5
      */
     public static int hashCode(short a[]) {
@@ -3985,18 +3986,18 @@
 
     /**
      * Returns a hash code based on the contents of the specified array.
-     * For any two <tt>char</tt> arrays <tt>a</tt> and <tt>b</tt>
-     * such that <tt>Arrays.equals(a, b)</tt>, it is also the case that
-     * <tt>Arrays.hashCode(a) == Arrays.hashCode(b)</tt>.
+     * For any two {@code char} arrays {@code a} and {@code b}
+     * such that {@code Arrays.equals(a, b)}, it is also the case that
+     * {@code Arrays.hashCode(a) == Arrays.hashCode(b)}.
      *
      * <p>The value returned by this method is the same value that would be
-     * obtained by invoking the {@link List#hashCode() <tt>hashCode</tt>}
+     * obtained by invoking the {@link List#hashCode() hashCode}
      * method on a {@link List} containing a sequence of {@link Character}
-     * instances representing the elements of <tt>a</tt> in the same order.
-     * If <tt>a</tt> is <tt>null</tt>, this method returns 0.
+     * instances representing the elements of {@code a} in the same order.
+     * If {@code a} is {@code null}, this method returns 0.
      *
      * @param a the array whose hash value to compute
-     * @return a content-based hash code for <tt>a</tt>
+     * @return a content-based hash code for {@code a}
      * @since 1.5
      */
     public static int hashCode(char a[]) {
@@ -4012,18 +4013,18 @@
 
     /**
      * Returns a hash code based on the contents of the specified array.
-     * For any two <tt>byte</tt> arrays <tt>a</tt> and <tt>b</tt>
-     * such that <tt>Arrays.equals(a, b)</tt>, it is also the case that
-     * <tt>Arrays.hashCode(a) == Arrays.hashCode(b)</tt>.
+     * For any two {@code byte} arrays {@code a} and {@code b}
+     * such that {@code Arrays.equals(a, b)}, it is also the case that
+     * {@code Arrays.hashCode(a) == Arrays.hashCode(b)}.
      *
      * <p>The value returned by this method is the same value that would be
-     * obtained by invoking the {@link List#hashCode() <tt>hashCode</tt>}
+     * obtained by invoking the {@link List#hashCode() hashCode}
      * method on a {@link List} containing a sequence of {@link Byte}
-     * instances representing the elements of <tt>a</tt> in the same order.
-     * If <tt>a</tt> is <tt>null</tt>, this method returns 0.
+     * instances representing the elements of {@code a} in the same order.
+     * If {@code a} is {@code null}, this method returns 0.
      *
      * @param a the array whose hash value to compute
-     * @return a content-based hash code for <tt>a</tt>
+     * @return a content-based hash code for {@code a}
      * @since 1.5
      */
     public static int hashCode(byte a[]) {
@@ -4039,18 +4040,18 @@
 
     /**
      * Returns a hash code based on the contents of the specified array.
-     * For any two <tt>boolean</tt> arrays <tt>a</tt> and <tt>b</tt>
-     * such that <tt>Arrays.equals(a, b)</tt>, it is also the case that
-     * <tt>Arrays.hashCode(a) == Arrays.hashCode(b)</tt>.
+     * For any two {@code boolean} arrays {@code a} and {@code b}
+     * such that {@code Arrays.equals(a, b)}, it is also the case that
+     * {@code Arrays.hashCode(a) == Arrays.hashCode(b)}.
      *
      * <p>The value returned by this method is the same value that would be
-     * obtained by invoking the {@link List#hashCode() <tt>hashCode</tt>}
+     * obtained by invoking the {@link List#hashCode() hashCode}
      * method on a {@link List} containing a sequence of {@link Boolean}
-     * instances representing the elements of <tt>a</tt> in the same order.
-     * If <tt>a</tt> is <tt>null</tt>, this method returns 0.
+     * instances representing the elements of {@code a} in the same order.
+     * If {@code a} is {@code null}, this method returns 0.
      *
      * @param a the array whose hash value to compute
-     * @return a content-based hash code for <tt>a</tt>
+     * @return a content-based hash code for {@code a}
      * @since 1.5
      */
     public static int hashCode(boolean a[]) {
@@ -4066,18 +4067,18 @@
 
     /**
      * Returns a hash code based on the contents of the specified array.
-     * For any two <tt>float</tt> arrays <tt>a</tt> and <tt>b</tt>
-     * such that <tt>Arrays.equals(a, b)</tt>, it is also the case that
-     * <tt>Arrays.hashCode(a) == Arrays.hashCode(b)</tt>.
+     * For any two {@code float} arrays {@code a} and {@code b}
+     * such that {@code Arrays.equals(a, b)}, it is also the case that
+     * {@code Arrays.hashCode(a) == Arrays.hashCode(b)}.
      *
      * <p>The value returned by this method is the same value that would be
-     * obtained by invoking the {@link List#hashCode() <tt>hashCode</tt>}
+     * obtained by invoking the {@link List#hashCode() hashCode}
      * method on a {@link List} containing a sequence of {@link Float}
-     * instances representing the elements of <tt>a</tt> in the same order.
-     * If <tt>a</tt> is <tt>null</tt>, this method returns 0.
+     * instances representing the elements of {@code a} in the same order.
+     * If {@code a} is {@code null}, this method returns 0.
      *
      * @param a the array whose hash value to compute
-     * @return a content-based hash code for <tt>a</tt>
+     * @return a content-based hash code for {@code a}
      * @since 1.5
      */
     public static int hashCode(float a[]) {
@@ -4093,18 +4094,18 @@
 
     /**
      * Returns a hash code based on the contents of the specified array.
-     * For any two <tt>double</tt> arrays <tt>a</tt> and <tt>b</tt>
-     * such that <tt>Arrays.equals(a, b)</tt>, it is also the case that
-     * <tt>Arrays.hashCode(a) == Arrays.hashCode(b)</tt>.
+     * For any two {@code double} arrays {@code a} and {@code b}
+     * such that {@code Arrays.equals(a, b)}, it is also the case that
+     * {@code Arrays.hashCode(a) == Arrays.hashCode(b)}.
      *
      * <p>The value returned by this method is the same value that would be
-     * obtained by invoking the {@link List#hashCode() <tt>hashCode</tt>}
+     * obtained by invoking the {@link List#hashCode() hashCode}
      * method on a {@link List} containing a sequence of {@link Double}
-     * instances representing the elements of <tt>a</tt> in the same order.
-     * If <tt>a</tt> is <tt>null</tt>, this method returns 0.
+     * instances representing the elements of {@code a} in the same order.
+     * If {@code a} is {@code null}, this method returns 0.
      *
      * @param a the array whose hash value to compute
-     * @return a content-based hash code for <tt>a</tt>
+     * @return a content-based hash code for {@code a}
      * @since 1.5
      */
     public static int hashCode(double a[]) {
@@ -4127,16 +4128,16 @@
      * element,  either directly or indirectly through one or more levels of
      * arrays.
      *
-     * <p>For any two arrays <tt>a</tt> and <tt>b</tt> such that
-     * <tt>Arrays.equals(a, b)</tt>, it is also the case that
-     * <tt>Arrays.hashCode(a) == Arrays.hashCode(b)</tt>.
+     * <p>For any two arrays {@code a} and {@code b} such that
+     * {@code Arrays.equals(a, b)}, it is also the case that
+     * {@code Arrays.hashCode(a) == Arrays.hashCode(b)}.
      *
      * <p>The value returned by this method is equal to the value that would
-     * be returned by <tt>Arrays.asList(a).hashCode()</tt>, unless <tt>a</tt>
-     * is <tt>null</tt>, in which case <tt>0</tt> is returned.
+     * be returned by {@code Arrays.asList(a).hashCode()}, unless {@code a}
+     * is {@code null}, in which case {@code 0} is returned.
      *
      * @param a the array whose content-based hash code to compute
-     * @return a content-based hash code for <tt>a</tt>
+     * @return a content-based hash code for {@code a}
      * @see #deepHashCode(Object[])
      * @since 1.5
      */
@@ -4161,23 +4162,23 @@
      * one or more levels of arrays.  The behavior of such an invocation is
      * undefined.
      *
-     * <p>For any two arrays <tt>a</tt> and <tt>b</tt> such that
-     * <tt>Arrays.deepEquals(a, b)</tt>, it is also the case that
-     * <tt>Arrays.deepHashCode(a) == Arrays.deepHashCode(b)</tt>.
+     * <p>For any two arrays {@code a} and {@code b} such that
+     * {@code Arrays.deepEquals(a, b)}, it is also the case that
+     * {@code Arrays.deepHashCode(a) == Arrays.deepHashCode(b)}.
      *
      * <p>The computation of the value returned by this method is similar to
      * that of the value returned by {@link List#hashCode()} on a list
-     * containing the same elements as <tt>a</tt> in the same order, with one
-     * difference: If an element <tt>e</tt> of <tt>a</tt> is itself an array,
-     * its hash code is computed not by calling <tt>e.hashCode()</tt>, but as
-     * by calling the appropriate overloading of <tt>Arrays.hashCode(e)</tt>
-     * if <tt>e</tt> is an array of a primitive type, or as by calling
-     * <tt>Arrays.deepHashCode(e)</tt> recursively if <tt>e</tt> is an array
-     * of a reference type.  If <tt>a</tt> is <tt>null</tt>, this method
+     * containing the same elements as {@code a} in the same order, with one
+     * difference: If an element {@code e} of {@code a} is itself an array,
+     * its hash code is computed not by calling {@code e.hashCode()}, but as
+     * by calling the appropriate overloading of {@code Arrays.hashCode(e)}
+     * if {@code e} is an array of a primitive type, or as by calling
+     * {@code Arrays.deepHashCode(e)} recursively if {@code e} is an array
+     * of a reference type.  If {@code a} is {@code null}, this method
      * returns 0.
      *
      * @param a the array whose deep-content-based hash code to compute
-     * @return a deep-content-based hash code for <tt>a</tt>
+     * @return a deep-content-based hash code for {@code a}
      * @see #hashCode(Object[])
      * @since 1.5
      */
@@ -4217,28 +4218,28 @@
     }
 
     /**
-     * Returns <tt>true</tt> if the two specified arrays are <i>deeply
+     * Returns {@code true} if the two specified arrays are <i>deeply
      * equal</i> to one another.  Unlike the {@link #equals(Object[],Object[])}
      * method, this method is appropriate for use with nested arrays of
      * arbitrary depth.
      *
      * <p>Two array references are considered deeply equal if both
-     * are <tt>null</tt>, or if they refer to arrays that contain the same
+     * are {@code null}, or if they refer to arrays that contain the same
      * number of elements and all corresponding pairs of elements in the two
      * arrays are deeply equal.
      *
-     * <p>Two possibly <tt>null</tt> elements <tt>e1</tt> and <tt>e2</tt> are
+     * <p>Two possibly {@code null} elements {@code e1} and {@code e2} are
      * deeply equal if any of the following conditions hold:
      * <ul>
-     *    <li> <tt>e1</tt> and <tt>e2</tt> are both arrays of object reference
-     *         types, and <tt>Arrays.deepEquals(e1, e2) would return true</tt>
-     *    <li> <tt>e1</tt> and <tt>e2</tt> are arrays of the same primitive
+     *    <li> {@code e1} and {@code e2} are both arrays of object reference
+     *         types, and {@code Arrays.deepEquals(e1, e2) would return true}
+     *    <li> {@code e1} and {@code e2} are arrays of the same primitive
      *         type, and the appropriate overloading of
-     *         <tt>Arrays.equals(e1, e2)</tt> would return true.
-     *    <li> <tt>e1 == e2</tt>
-     *    <li> <tt>e1.equals(e2)</tt> would return true.
+     *         {@code Arrays.equals(e1, e2)} would return true.
+     *    <li> {@code e1 == e2}
+     *    <li> {@code e1.equals(e2)} would return true.
      * </ul>
-     * Note that this definition permits <tt>null</tt> elements at any depth.
+     * Note that this definition permits {@code null} elements at any depth.
      *
      * <p>If either of the specified arrays contain themselves as elements
      * either directly or indirectly through one or more levels of arrays,
@@ -4246,7 +4247,7 @@
      *
      * @param a1 one array to be tested for equality
      * @param a2 the other array to be tested for equality
-     * @return <tt>true</tt> if the two arrays are equal
+     * @return {@code true} if the two arrays are equal
      * @see #equals(Object[],Object[])
      * @see Objects#deepEquals(Object, Object)
      * @since 1.5
@@ -4307,14 +4308,14 @@
     /**
      * Returns a string representation of the contents of the specified array.
      * The string representation consists of a list of the array's elements,
-     * enclosed in square brackets (<tt>"[]"</tt>).  Adjacent elements are
-     * separated by the characters <tt>", "</tt> (a comma followed by a
+     * enclosed in square brackets ({@code "[]"}).  Adjacent elements are
+     * separated by the characters {@code ", "} (a comma followed by a
      * space).  Elements are converted to strings as by
-     * <tt>String.valueOf(long)</tt>.  Returns <tt>"null"</tt> if <tt>a</tt>
-     * is <tt>null</tt>.
+     * {@code String.valueOf(long)}.  Returns {@code "null"} if {@code a}
+     * is {@code null}.
      *
      * @param a the array whose string representation to return
-     * @return a string representation of <tt>a</tt>
+     * @return a string representation of {@code a}
      * @since 1.5
      */
     public static String toString(long[] a) {
@@ -4337,14 +4338,14 @@
     /**
      * Returns a string representation of the contents of the specified array.
      * The string representation consists of a list of the array's elements,
-     * enclosed in square brackets (<tt>"[]"</tt>).  Adjacent elements are
-     * separated by the characters <tt>", "</tt> (a comma followed by a
+     * enclosed in square brackets ({@code "[]"}).  Adjacent elements are
+     * separated by the characters {@code ", "} (a comma followed by a
      * space).  Elements are converted to strings as by
-     * <tt>String.valueOf(int)</tt>.  Returns <tt>"null"</tt> if <tt>a</tt> is
-     * <tt>null</tt>.
+     * {@code String.valueOf(int)}.  Returns {@code "null"} if {@code a} is
+     * {@code null}.
      *
      * @param a the array whose string representation to return
-     * @return a string representation of <tt>a</tt>
+     * @return a string representation of {@code a}
      * @since 1.5
      */
     public static String toString(int[] a) {
@@ -4367,14 +4368,14 @@
     /**
      * Returns a string representation of the contents of the specified array.
      * The string representation consists of a list of the array's elements,
-     * enclosed in square brackets (<tt>"[]"</tt>).  Adjacent elements are
-     * separated by the characters <tt>", "</tt> (a comma followed by a
+     * enclosed in square brackets ({@code "[]"}).  Adjacent elements are
+     * separated by the characters {@code ", "} (a comma followed by a
      * space).  Elements are converted to strings as by
-     * <tt>String.valueOf(short)</tt>.  Returns <tt>"null"</tt> if <tt>a</tt>
-     * is <tt>null</tt>.
+     * {@code String.valueOf(short)}.  Returns {@code "null"} if {@code a}
+     * is {@code null}.
      *
      * @param a the array whose string representation to return
-     * @return a string representation of <tt>a</tt>
+     * @return a string representation of {@code a}
      * @since 1.5
      */
     public static String toString(short[] a) {
@@ -4397,14 +4398,14 @@
     /**
      * Returns a string representation of the contents of the specified array.
      * The string representation consists of a list of the array's elements,
-     * enclosed in square brackets (<tt>"[]"</tt>).  Adjacent elements are
-     * separated by the characters <tt>", "</tt> (a comma followed by a
+     * enclosed in square brackets ({@code "[]"}).  Adjacent elements are
+     * separated by the characters {@code ", "} (a comma followed by a
      * space).  Elements are converted to strings as by
-     * <tt>String.valueOf(char)</tt>.  Returns <tt>"null"</tt> if <tt>a</tt>
-     * is <tt>null</tt>.
+     * {@code String.valueOf(char)}.  Returns {@code "null"} if {@code a}
+     * is {@code null}.
      *
      * @param a the array whose string representation to return
-     * @return a string representation of <tt>a</tt>
+     * @return a string representation of {@code a}
      * @since 1.5
      */
     public static String toString(char[] a) {
@@ -4427,14 +4428,14 @@
     /**
      * Returns a string representation of the contents of the specified array.
      * The string representation consists of a list of the array's elements,
-     * enclosed in square brackets (<tt>"[]"</tt>).  Adjacent elements
-     * are separated by the characters <tt>", "</tt> (a comma followed
+     * enclosed in square brackets ({@code "[]"}).  Adjacent elements
+     * are separated by the characters {@code ", "} (a comma followed
      * by a space).  Elements are converted to strings as by
-     * <tt>String.valueOf(byte)</tt>.  Returns <tt>"null"</tt> if
-     * <tt>a</tt> is <tt>null</tt>.
+     * {@code String.valueOf(byte)}.  Returns {@code "null"} if
+     * {@code a} is {@code null}.
      *
      * @param a the array whose string representation to return
-     * @return a string representation of <tt>a</tt>
+     * @return a string representation of {@code a}
      * @since 1.5
      */
     public static String toString(byte[] a) {
@@ -4457,14 +4458,14 @@
     /**
      * Returns a string representation of the contents of the specified array.
      * The string representation consists of a list of the array's elements,
-     * enclosed in square brackets (<tt>"[]"</tt>).  Adjacent elements are
-     * separated by the characters <tt>", "</tt> (a comma followed by a
+     * enclosed in square brackets ({@code "[]"}).  Adjacent elements are
+     * separated by the characters {@code ", "} (a comma followed by a
      * space).  Elements are converted to strings as by
-     * <tt>String.valueOf(boolean)</tt>.  Returns <tt>"null"</tt> if
-     * <tt>a</tt> is <tt>null</tt>.
+     * {@code String.valueOf(boolean)}.  Returns {@code "null"} if
+     * {@code a} is {@code null}.
      *
      * @param a the array whose string representation to return
-     * @return a string representation of <tt>a</tt>
+     * @return a string representation of {@code a}
      * @since 1.5
      */
     public static String toString(boolean[] a) {
@@ -4487,14 +4488,14 @@
     /**
      * Returns a string representation of the contents of the specified array.
      * The string representation consists of a list of the array's elements,
-     * enclosed in square brackets (<tt>"[]"</tt>).  Adjacent elements are
-     * separated by the characters <tt>", "</tt> (a comma followed by a
+     * enclosed in square brackets ({@code "[]"}).  Adjacent elements are
+     * separated by the characters {@code ", "} (a comma followed by a
      * space).  Elements are converted to strings as by
-     * <tt>String.valueOf(float)</tt>.  Returns <tt>"null"</tt> if <tt>a</tt>
-     * is <tt>null</tt>.
+     * {@code String.valueOf(float)}.  Returns {@code "null"} if {@code a}
+     * is {@code null}.
      *
      * @param a the array whose string representation to return
-     * @return a string representation of <tt>a</tt>
+     * @return a string representation of {@code a}
      * @since 1.5
      */
     public static String toString(float[] a) {
@@ -4518,14 +4519,14 @@
     /**
      * Returns a string representation of the contents of the specified array.
      * The string representation consists of a list of the array's elements,
-     * enclosed in square brackets (<tt>"[]"</tt>).  Adjacent elements are
-     * separated by the characters <tt>", "</tt> (a comma followed by a
+     * enclosed in square brackets ({@code "[]"}).  Adjacent elements are
+     * separated by the characters {@code ", "} (a comma followed by a
      * space).  Elements are converted to strings as by
-     * <tt>String.valueOf(double)</tt>.  Returns <tt>"null"</tt> if <tt>a</tt>
-     * is <tt>null</tt>.
+     * {@code String.valueOf(double)}.  Returns {@code "null"} if {@code a}
+     * is {@code null}.
      *
      * @param a the array whose string representation to return
-     * @return a string representation of <tt>a</tt>
+     * @return a string representation of {@code a}
      * @since 1.5
      */
     public static String toString(double[] a) {
@@ -4549,15 +4550,15 @@
      * Returns a string representation of the contents of the specified array.
      * If the array contains other arrays as elements, they are converted to
      * strings by the {@link Object#toString} method inherited from
-     * <tt>Object</tt>, which describes their <i>identities</i> rather than
+     * {@code Object}, which describes their <i>identities</i> rather than
      * their contents.
      *
      * <p>The value returned by this method is equal to the value that would
-     * be returned by <tt>Arrays.asList(a).toString()</tt>, unless <tt>a</tt>
-     * is <tt>null</tt>, in which case <tt>"null"</tt> is returned.
+     * be returned by {@code Arrays.asList(a).toString()}, unless {@code a}
+     * is {@code null}, in which case {@code "null"} is returned.
      *
      * @param a the array whose string representation to return
-     * @return a string representation of <tt>a</tt>
+     * @return a string representation of {@code a}
      * @see #deepToString(Object[])
      * @since 1.5
      */
@@ -4586,29 +4587,29 @@
      * designed for converting multidimensional arrays to strings.
      *
      * <p>The string representation consists of a list of the array's
-     * elements, enclosed in square brackets (<tt>"[]"</tt>).  Adjacent
-     * elements are separated by the characters <tt>", "</tt> (a comma
+     * elements, enclosed in square brackets ({@code "[]"}).  Adjacent
+     * elements are separated by the characters {@code ", "} (a comma
      * followed by a space).  Elements are converted to strings as by
-     * <tt>String.valueOf(Object)</tt>, unless they are themselves
+     * {@code String.valueOf(Object)}, unless they are themselves
      * arrays.
      *
-     * <p>If an element <tt>e</tt> is an array of a primitive type, it is
+     * <p>If an element {@code e} is an array of a primitive type, it is
      * converted to a string as by invoking the appropriate overloading of
-     * <tt>Arrays.toString(e)</tt>.  If an element <tt>e</tt> is an array of a
+     * {@code Arrays.toString(e)}.  If an element {@code e} is an array of a
      * reference type, it is converted to a string as by invoking
      * this method recursively.
      *
      * <p>To avoid infinite recursion, if the specified array contains itself
      * as an element, or contains an indirect reference to itself through one
      * or more levels of arrays, the self-reference is converted to the string
-     * <tt>"[...]"</tt>.  For example, an array containing only a reference
-     * to itself would be rendered as <tt>"[[...]]"</tt>.
-     *
-     * <p>This method returns <tt>"null"</tt> if the specified array
-     * is <tt>null</tt>.
+     * {@code "[...]"}.  For example, an array containing only a reference
+     * to itself would be rendered as {@code "[[...]]"}.
+     *
+     * <p>This method returns {@code "null"} if the specified array
+     * is {@code null}.
      *
      * @param a the array whose string representation to return
-     * @return a string representation of <tt>a</tt>
+     * @return a string representation of {@code a}
      * @see #toString(Object[])
      * @since 1.5
      */
--- a/jdk/src/java.base/share/classes/java/util/Collection.java	Thu Apr 09 12:29:31 2015 +0200
+++ b/jdk/src/java.base/share/classes/java/util/Collection.java	Mon Aug 17 12:45:16 2015 +0300
@@ -35,30 +35,30 @@
  * collections allow duplicate elements and others do not.  Some are ordered
  * and others unordered.  The JDK does not provide any <i>direct</i>
  * implementations of this interface: it provides implementations of more
- * specific subinterfaces like <tt>Set</tt> and <tt>List</tt>.  This interface
+ * specific subinterfaces like {@code Set} and {@code List}.  This interface
  * is typically used to pass collections around and manipulate them where
  * maximum generality is desired.
  *
  * <p><i>Bags</i> or <i>multisets</i> (unordered collections that may contain
  * duplicate elements) should implement this interface directly.
  *
- * <p>All general-purpose <tt>Collection</tt> implementation classes (which
- * typically implement <tt>Collection</tt> indirectly through one of its
+ * <p>All general-purpose {@code Collection} implementation classes (which
+ * typically implement {@code Collection} indirectly through one of its
  * subinterfaces) should provide two "standard" constructors: a void (no
  * arguments) constructor, which creates an empty collection, and a
- * constructor with a single argument of type <tt>Collection</tt>, which
+ * constructor with a single argument of type {@code Collection}, which
  * creates a new collection with the same elements as its argument.  In
  * effect, the latter constructor allows the user to copy any collection,
  * producing an equivalent collection of the desired implementation type.
  * There is no way to enforce this convention (as interfaces cannot contain
- * constructors) but all of the general-purpose <tt>Collection</tt>
+ * constructors) but all of the general-purpose {@code Collection}
  * implementations in the Java platform libraries comply.
  *
  * <p>The "destructive" methods contained in this interface, that is, the
  * methods that modify the collection on which they operate, are specified to
- * throw <tt>UnsupportedOperationException</tt> if this collection does not
+ * throw {@code UnsupportedOperationException} if this collection does not
  * support the operation.  If this is the case, these methods may, but are not
- * required to, throw an <tt>UnsupportedOperationException</tt> if the
+ * required to, throw an {@code UnsupportedOperationException} if the
  * invocation would have no effect on the collection.  For example, invoking
  * the {@link #addAll(Collection)} method on an unmodifiable collection may,
  * but is not required to, throw the exception if the collection to be added
@@ -69,7 +69,7 @@
  * they may contain.</a>  For example, some implementations prohibit null elements,
  * and some have restrictions on the types of their elements.  Attempting to
  * add an ineligible element throws an unchecked exception, typically
- * <tt>NullPointerException</tt> or <tt>ClassCastException</tt>.  Attempting
+ * {@code NullPointerException} or {@code ClassCastException}.  Attempting
  * to query the presence of an ineligible element may throw an exception,
  * or it may simply return false; some implementations will exhibit the former
  * behavior and some will exhibit the latter.  More generally, attempting an
@@ -90,13 +90,13 @@
  * <p>Many methods in Collections Framework interfaces are defined in
  * terms of the {@link Object#equals(Object) equals} method.  For example,
  * the specification for the {@link #contains(Object) contains(Object o)}
- * method says: "returns <tt>true</tt> if and only if this collection
- * contains at least one element <tt>e</tt> such that
- * <tt>(o==null ? e==null : o.equals(e))</tt>."  This specification should
- * <i>not</i> be construed to imply that invoking <tt>Collection.contains</tt>
- * with a non-null argument <tt>o</tt> will cause <tt>o.equals(e)</tt> to be
- * invoked for any element <tt>e</tt>.  Implementations are free to implement
- * optimizations whereby the <tt>equals</tt> invocation is avoided, for
+ * method says: "returns {@code true} if and only if this collection
+ * contains at least one element {@code e} such that
+ * {@code (o==null ? e==null : o.equals(e))}."  This specification should
+ * <i>not</i> be construed to imply that invoking {@code Collection.contains}
+ * with a non-null argument {@code o} will cause {@code o.equals(e)} to be
+ * invoked for any element {@code e}.  Implementations are free to implement
+ * optimizations whereby the {@code equals} invocation is avoided, for
  * example, by first comparing the hash codes of the two elements.  (The
  * {@link Object#hashCode()} specification guarantees that two objects with
  * unequal hash codes cannot be equal.)  More generally, implementations of
@@ -146,28 +146,28 @@
 
     /**
      * Returns the number of elements in this collection.  If this collection
-     * contains more than <tt>Integer.MAX_VALUE</tt> elements, returns
-     * <tt>Integer.MAX_VALUE</tt>.
+     * contains more than {@code Integer.MAX_VALUE} elements, returns
+     * {@code Integer.MAX_VALUE}.
      *
      * @return the number of elements in this collection
      */
     int size();
 
     /**
-     * Returns <tt>true</tt> if this collection contains no elements.
+     * Returns {@code true} if this collection contains no elements.
      *
-     * @return <tt>true</tt> if this collection contains no elements
+     * @return {@code true} if this collection contains no elements
      */
     boolean isEmpty();
 
     /**
-     * Returns <tt>true</tt> if this collection contains the specified element.
-     * More formally, returns <tt>true</tt> if and only if this collection
-     * contains at least one element <tt>e</tt> such that
-     * <tt>(o==null&nbsp;?&nbsp;e==null&nbsp;:&nbsp;o.equals(e))</tt>.
+     * Returns {@code true} if this collection contains the specified element.
+     * More formally, returns {@code true} if and only if this collection
+     * contains at least one element {@code e} such that
+     * {@code Objects.equals(o, e)}.
      *
      * @param o element whose presence in this collection is to be tested
-     * @return <tt>true</tt> if this collection contains the specified
+     * @return {@code true} if this collection contains the specified
      *         element
      * @throws ClassCastException if the type of the specified element
      *         is incompatible with this collection
@@ -184,7 +184,7 @@
      * (unless this collection is an instance of some class that provides a
      * guarantee).
      *
-     * @return an <tt>Iterator</tt> over the elements in this collection
+     * @return an {@code Iterator} over the elements in this collection
      */
     Iterator<E> iterator();
 
@@ -216,9 +216,9 @@
      * <p>If this collection fits in the specified array with room to spare
      * (i.e., the array has more elements than this collection), the element
      * in the array immediately following the end of the collection is set to
-     * <tt>null</tt>.  (This is useful in determining the length of this
+     * {@code null}.  (This is useful in determining the length of this
      * collection <i>only</i> if the caller knows that this collection does
-     * not contain any <tt>null</tt> elements.)
+     * not contain any {@code null} elements.)
      *
      * <p>If this collection makes any guarantees as to what order its elements
      * are returned by its iterator, this method must return the elements in
@@ -229,15 +229,15 @@
      * precise control over the runtime type of the output array, and may,
      * under certain circumstances, be used to save allocation costs.
      *
-     * <p>Suppose <tt>x</tt> is a collection known to contain only strings.
+     * <p>Suppose {@code x} is a collection known to contain only strings.
      * The following code can be used to dump the collection into a newly
-     * allocated array of <tt>String</tt>:
+     * allocated array of {@code String}:
      *
      * <pre>
      *     String[] y = x.toArray(new String[0]);</pre>
      *
-     * Note that <tt>toArray(new Object[0])</tt> is identical in function to
-     * <tt>toArray()</tt>.
+     * Note that {@code toArray(new Object[0])} is identical in function to
+     * {@code toArray()}.
      *
      * @param <T> the runtime type of the array to contain the collection
      * @param a the array into which the elements of this collection are to be
@@ -255,27 +255,27 @@
 
     /**
      * Ensures that this collection contains the specified element (optional
-     * operation).  Returns <tt>true</tt> if this collection changed as a
-     * result of the call.  (Returns <tt>false</tt> if this collection does
+     * operation).  Returns {@code true} if this collection changed as a
+     * result of the call.  (Returns {@code false} if this collection does
      * not permit duplicates and already contains the specified element.)<p>
      *
      * Collections that support this operation may place limitations on what
      * elements may be added to this collection.  In particular, some
-     * collections will refuse to add <tt>null</tt> elements, and others will
+     * collections will refuse to add {@code null} elements, and others will
      * impose restrictions on the type of elements that may be added.
      * Collection classes should clearly specify in their documentation any
      * restrictions on what elements may be added.<p>
      *
      * If a collection refuses to add a particular element for any reason
      * other than that it already contains the element, it <i>must</i> throw
-     * an exception (rather than returning <tt>false</tt>).  This preserves
+     * an exception (rather than returning {@code false}).  This preserves
      * the invariant that a collection always contains the specified element
      * after this call returns.
      *
      * @param e element whose presence in this collection is to be ensured
-     * @return <tt>true</tt> if this collection changed as a result of the
+     * @return {@code true} if this collection changed as a result of the
      *         call
-     * @throws UnsupportedOperationException if the <tt>add</tt> operation
+     * @throws UnsupportedOperationException if the {@code add} operation
      *         is not supported by this collection
      * @throws ClassCastException if the class of the specified element
      *         prevents it from being added to this collection
@@ -291,21 +291,21 @@
     /**
      * Removes a single instance of the specified element from this
      * collection, if it is present (optional operation).  More formally,
-     * removes an element <tt>e</tt> such that
-     * <tt>(o==null&nbsp;?&nbsp;e==null&nbsp;:&nbsp;o.equals(e))</tt>, if
+     * removes an element {@code e} such that
+     * {@code Objects.equals(o, e)}, if
      * this collection contains one or more such elements.  Returns
-     * <tt>true</tt> if this collection contained the specified element (or
+     * {@code true} if this collection contained the specified element (or
      * equivalently, if this collection changed as a result of the call).
      *
      * @param o element to be removed from this collection, if present
-     * @return <tt>true</tt> if an element was removed as a result of this call
+     * @return {@code true} if an element was removed as a result of this call
      * @throws ClassCastException if the type of the specified element
      *         is incompatible with this collection
      *         (<a href="#optional-restrictions">optional</a>)
      * @throws NullPointerException if the specified element is null and this
      *         collection does not permit null elements
      *         (<a href="#optional-restrictions">optional</a>)
-     * @throws UnsupportedOperationException if the <tt>remove</tt> operation
+     * @throws UnsupportedOperationException if the {@code remove} operation
      *         is not supported by this collection
      */
     boolean remove(Object o);
@@ -314,11 +314,11 @@
     // Bulk Operations
 
     /**
-     * Returns <tt>true</tt> if this collection contains all of the elements
+     * Returns {@code true} if this collection contains all of the elements
      * in the specified collection.
      *
      * @param  c collection to be checked for containment in this collection
-     * @return <tt>true</tt> if this collection contains all of the elements
+     * @return {@code true} if this collection contains all of the elements
      *         in the specified collection
      * @throws ClassCastException if the types of one or more elements
      *         in the specified collection are incompatible with this
@@ -342,8 +342,8 @@
      * nonempty.)
      *
      * @param c collection containing elements to be added to this collection
-     * @return <tt>true</tt> if this collection changed as a result of the call
-     * @throws UnsupportedOperationException if the <tt>addAll</tt> operation
+     * @return {@code true} if this collection changed as a result of the call
+     * @throws UnsupportedOperationException if the {@code addAll} operation
      *         is not supported by this collection
      * @throws ClassCastException if the class of an element of the specified
      *         collection prevents it from being added to this collection
@@ -366,9 +366,9 @@
      * collection.
      *
      * @param c collection containing elements to be removed from this collection
-     * @return <tt>true</tt> if this collection changed as a result of the
+     * @return {@code true} if this collection changed as a result of the
      *         call
-     * @throws UnsupportedOperationException if the <tt>removeAll</tt> method
+     * @throws UnsupportedOperationException if the {@code removeAll} method
      *         is not supported by this collection
      * @throws ClassCastException if the types of one or more elements
      *         in this collection are incompatible with the specified
@@ -426,8 +426,8 @@
      * specified collection.
      *
      * @param c collection containing elements to be retained in this collection
-     * @return <tt>true</tt> if this collection changed as a result of the call
-     * @throws UnsupportedOperationException if the <tt>retainAll</tt> operation
+     * @return {@code true} if this collection changed as a result of the call
+     * @throws UnsupportedOperationException if the {@code retainAll} operation
      *         is not supported by this collection
      * @throws ClassCastException if the types of one or more elements
      *         in this collection are incompatible with the specified
@@ -447,7 +447,7 @@
      * Removes all of the elements from this collection (optional operation).
      * The collection will be empty after this method returns.
      *
-     * @throws UnsupportedOperationException if the <tt>clear</tt> operation
+     * @throws UnsupportedOperationException if the {@code clear} operation
      *         is not supported by this collection
      */
     void clear();
@@ -458,30 +458,30 @@
     /**
      * Compares the specified object with this collection for equality. <p>
      *
-     * While the <tt>Collection</tt> interface adds no stipulations to the
-     * general contract for the <tt>Object.equals</tt>, programmers who
-     * implement the <tt>Collection</tt> interface "directly" (in other words,
-     * create a class that is a <tt>Collection</tt> but is not a <tt>Set</tt>
-     * or a <tt>List</tt>) must exercise care if they choose to override the
-     * <tt>Object.equals</tt>.  It is not necessary to do so, and the simplest
-     * course of action is to rely on <tt>Object</tt>'s implementation, but
+     * While the {@code Collection} interface adds no stipulations to the
+     * general contract for the {@code Object.equals}, programmers who
+     * implement the {@code Collection} interface "directly" (in other words,
+     * create a class that is a {@code Collection} but is not a {@code Set}
+     * or a {@code List}) must exercise care if they choose to override the
+     * {@code Object.equals}.  It is not necessary to do so, and the simplest
+     * course of action is to rely on {@code Object}'s implementation, but
      * the implementor may wish to implement a "value comparison" in place of
-     * the default "reference comparison."  (The <tt>List</tt> and
-     * <tt>Set</tt> interfaces mandate such value comparisons.)<p>
+     * the default "reference comparison."  (The {@code List} and
+     * {@code Set} interfaces mandate such value comparisons.)<p>
      *
-     * The general contract for the <tt>Object.equals</tt> method states that
-     * equals must be symmetric (in other words, <tt>a.equals(b)</tt> if and
-     * only if <tt>b.equals(a)</tt>).  The contracts for <tt>List.equals</tt>
-     * and <tt>Set.equals</tt> state that lists are only equal to other lists,
-     * and sets to other sets.  Thus, a custom <tt>equals</tt> method for a
-     * collection class that implements neither the <tt>List</tt> nor
-     * <tt>Set</tt> interface must return <tt>false</tt> when this collection
+     * The general contract for the {@code Object.equals} method states that
+     * equals must be symmetric (in other words, {@code a.equals(b)} if and
+     * only if {@code b.equals(a)}).  The contracts for {@code List.equals}
+     * and {@code Set.equals} state that lists are only equal to other lists,
+     * and sets to other sets.  Thus, a custom {@code equals} method for a
+     * collection class that implements neither the {@code List} nor
+     * {@code Set} interface must return {@code false} when this collection
      * is compared to any list or set.  (By the same logic, it is not possible
-     * to write a class that correctly implements both the <tt>Set</tt> and
-     * <tt>List</tt> interfaces.)
+     * to write a class that correctly implements both the {@code Set} and
+     * {@code List} interfaces.)
      *
      * @param o object to be compared for equality with this collection
-     * @return <tt>true</tt> if the specified object is equal to this
+     * @return {@code true} if the specified object is equal to this
      * collection
      *
      * @see Object#equals(Object)
@@ -492,13 +492,13 @@
 
     /**
      * Returns the hash code value for this collection.  While the
-     * <tt>Collection</tt> interface adds no stipulations to the general
-     * contract for the <tt>Object.hashCode</tt> method, programmers should
-     * take note that any class that overrides the <tt>Object.equals</tt>
-     * method must also override the <tt>Object.hashCode</tt> method in order
-     * to satisfy the general contract for the <tt>Object.hashCode</tt> method.
-     * In particular, <tt>c1.equals(c2)</tt> implies that
-     * <tt>c1.hashCode()==c2.hashCode()</tt>.
+     * {@code Collection} interface adds no stipulations to the general
+     * contract for the {@code Object.hashCode} method, programmers should
+     * take note that any class that overrides the {@code Object.equals}
+     * method must also override the {@code Object.hashCode} method in order
+     * to satisfy the general contract for the {@code Object.hashCode} method.
+     * In particular, {@code c1.equals(c2)} implies that
+     * {@code c1.hashCode()==c2.hashCode()}.
      *
      * @return the hash code value for this collection
      *
--- a/jdk/src/java.base/share/classes/java/util/Collections.java	Thu Apr 09 12:29:31 2015 +0200
+++ b/jdk/src/java.base/share/classes/java/util/Collections.java	Mon Aug 17 12:45:16 2015 +0300
@@ -44,7 +44,7 @@
  * collections, "wrappers", which return a new collection backed by a
  * specified collection, and a few other odds and ends.
  *
- * <p>The methods of this class all throw a <tt>NullPointerException</tt>
+ * <p>The methods of this class all throw a {@code NullPointerException}
  * if the collections or class objects provided to them are null.
  *
  * <p>The documentation for the polymorphic algorithms contained in this class
@@ -52,17 +52,17 @@
  * descriptions should be regarded as <i>implementation notes</i>, rather than
  * parts of the <i>specification</i>.  Implementors should feel free to
  * substitute other algorithms, so long as the specification itself is adhered
- * to.  (For example, the algorithm used by <tt>sort</tt> does not have to be
+ * to.  (For example, the algorithm used by {@code sort} does not have to be
  * a mergesort, but it does have to be <i>stable</i>.)
  *
  * <p>The "destructive" algorithms contained in this class, that is, the
  * algorithms that modify the collection on which they operate, are specified
- * to throw <tt>UnsupportedOperationException</tt> if the collection does not
- * support the appropriate mutation primitive(s), such as the <tt>set</tt>
+ * to throw {@code UnsupportedOperationException} if the collection does not
+ * support the appropriate mutation primitive(s), such as the {@code set}
  * method.  These algorithms may, but are not required to, throw this
  * exception if an invocation would have no effect on the collection.  For
- * example, invoking the <tt>sort</tt> method on an unmodifiable list that is
- * already sorted may or may not throw <tt>UnsupportedOperationException</tt>.
+ * example, invoking the {@code sort} method on an unmodifiable list that is
+ * already sorted may or may not throw {@code UnsupportedOperationException}.
  *
  * <p>This class is a member of the
  * <a href="{@docRoot}/../technotes/guides/collections/index.html">
@@ -195,10 +195,10 @@
      * @param  list the list to be searched.
      * @param  key the key to be searched for.
      * @return the index of the search key, if it is contained in the list;
-     *         otherwise, <tt>(-(<i>insertion point</i>) - 1)</tt>.  The
+     *         otherwise, <code>(-(<i>insertion point</i>) - 1)</code>.  The
      *         <i>insertion point</i> is defined as the point at which the
      *         key would be inserted into the list: the index of the first
-     *         element greater than the key, or <tt>list.size()</tt> if all
+     *         element greater than the key, or {@code list.size()} if all
      *         elements in the list are less than the specified key.  Note
      *         that this guarantees that the return value will be &gt;= 0 if
      *         and only if the key is found.
@@ -296,13 +296,13 @@
      * @param  list the list to be searched.
      * @param  key the key to be searched for.
      * @param  c the comparator by which the list is ordered.
-     *         A <tt>null</tt> value indicates that the elements'
+     *         A {@code null} value indicates that the elements'
      *         {@linkplain Comparable natural ordering} should be used.
      * @return the index of the search key, if it is contained in the list;
-     *         otherwise, <tt>(-(<i>insertion point</i>) - 1)</tt>.  The
+     *         otherwise, <code>(-(<i>insertion point</i>) - 1)</code>.  The
      *         <i>insertion point</i> is defined as the point at which the
      *         key would be inserted into the list: the index of the first
-     *         element greater than the key, or <tt>list.size()</tt> if all
+     *         element greater than the key, or {@code list.size()} if all
      *         elements in the list are less than the specified key.  Note
      *         that this guarantees that the return value will be &gt;= 0 if
      *         and only if the key is found.
@@ -368,7 +368,7 @@
      *
      * @param  list the list whose elements are to be reversed.
      * @throws UnsupportedOperationException if the specified list or
-     *         its list-iterator does not support the <tt>set</tt> operation.
+     *         its list-iterator does not support the {@code set} operation.
      */
     @SuppressWarnings({"rawtypes", "unchecked"})
     public static void reverse(List<?> list) {
@@ -416,7 +416,7 @@
      *
      * @param  list the list to be shuffled.
      * @throws UnsupportedOperationException if the specified list or
-     *         its list-iterator does not support the <tt>set</tt> operation.
+     *         its list-iterator does not support the {@code set} operation.
      */
     public static void shuffle(List<?> list) {
         Random rnd = r;
@@ -448,7 +448,7 @@
      * @param  list the list to be shuffled.
      * @param  rnd the source of randomness to use to shuffle the list.
      * @throws UnsupportedOperationException if the specified list or its
-     *         list-iterator does not support the <tt>set</tt> operation.
+     *         list-iterator does not support the {@code set} operation.
      */
     @SuppressWarnings({"rawtypes", "unchecked"})
     public static void shuffle(List<?> list, Random rnd) {
@@ -483,7 +483,7 @@
      * @param list The list in which to swap elements.
      * @param i the index of one element to be swapped.
      * @param j the index of the other element to be swapped.
-     * @throws IndexOutOfBoundsException if either <tt>i</tt> or <tt>j</tt>
+     * @throws IndexOutOfBoundsException if either {@code i} or {@code j}
      *         is out of range (i &lt; 0 || i &gt;= list.size()
      *         || j &lt; 0 || j &gt;= list.size()).
      * @since 1.4
@@ -516,7 +516,7 @@
      * @param  list the list to be filled with the specified element.
      * @param  obj The element with which to fill the specified list.
      * @throws UnsupportedOperationException if the specified list or its
-     *         list-iterator does not support the <tt>set</tt> operation.
+     *         list-iterator does not support the {@code set} operation.
      */
     public static <T> void fill(List<? super T> list, T obj) {
         int size = list.size();
@@ -548,7 +548,7 @@
      * @throws IndexOutOfBoundsException if the destination list is too small
      *         to contain the entire source List.
      * @throws UnsupportedOperationException if the destination list's
-     *         list-iterator does not support the <tt>set</tt> operation.
+     *         list-iterator does not support the {@code set} operation.
      */
     public static <T> void copy(List<? super T> dest, List<? extends T> src) {
         int srcSize = src.size();
@@ -572,11 +572,11 @@
     /**
      * Returns the minimum element of the given collection, according to the
      * <i>natural ordering</i> of its elements.  All elements in the
-     * collection must implement the <tt>Comparable</tt> interface.
+     * collection must implement the {@code Comparable} interface.
      * Furthermore, all elements in the collection must be <i>mutually
-     * comparable</i> (that is, <tt>e1.compareTo(e2)</tt> must not throw a
-     * <tt>ClassCastException</tt> for any elements <tt>e1</tt> and
-     * <tt>e2</tt> in the collection).<p>
+     * comparable</i> (that is, {@code e1.compareTo(e2)} must not throw a
+     * {@code ClassCastException} for any elements {@code e1} and
+     * {@code e2} in the collection).<p>
      *
      * This method iterates over the entire collection, hence it requires
      * time proportional to the size of the collection.
@@ -607,9 +607,9 @@
      * Returns the minimum element of the given collection, according to the
      * order induced by the specified comparator.  All elements in the
      * collection must be <i>mutually comparable</i> by the specified
-     * comparator (that is, <tt>comp.compare(e1, e2)</tt> must not throw a
-     * <tt>ClassCastException</tt> for any elements <tt>e1</tt> and
-     * <tt>e2</tt> in the collection).<p>
+     * comparator (that is, {@code comp.compare(e1, e2)} must not throw a
+     * {@code ClassCastException} for any elements {@code e1} and
+     * {@code e2} in the collection).<p>
      *
      * This method iterates over the entire collection, hence it requires
      * time proportional to the size of the collection.
@@ -617,7 +617,7 @@
      * @param  <T> the class of the objects in the collection
      * @param  coll the collection whose minimum element is to be determined.
      * @param  comp the comparator with which to determine the minimum element.
-     *         A <tt>null</tt> value indicates that the elements' <i>natural
+     *         A {@code null} value indicates that the elements' <i>natural
      *         ordering</i> should be used.
      * @return the minimum element of the given collection, according
      *         to the specified comparator.
@@ -645,11 +645,11 @@
     /**
      * Returns the maximum element of the given collection, according to the
      * <i>natural ordering</i> of its elements.  All elements in the
-     * collection must implement the <tt>Comparable</tt> interface.
+     * collection must implement the {@code Comparable} interface.
      * Furthermore, all elements in the collection must be <i>mutually
-     * comparable</i> (that is, <tt>e1.compareTo(e2)</tt> must not throw a
-     * <tt>ClassCastException</tt> for any elements <tt>e1</tt> and
-     * <tt>e2</tt> in the collection).<p>
+     * comparable</i> (that is, {@code e1.compareTo(e2)} must not throw a
+     * {@code ClassCastException} for any elements {@code e1} and
+     * {@code e2} in the collection).<p>
      *
      * This method iterates over the entire collection, hence it requires
      * time proportional to the size of the collection.
@@ -680,9 +680,9 @@
      * Returns the maximum element of the given collection, according to the
      * order induced by the specified comparator.  All elements in the
      * collection must be <i>mutually comparable</i> by the specified
-     * comparator (that is, <tt>comp.compare(e1, e2)</tt> must not throw a
-     * <tt>ClassCastException</tt> for any elements <tt>e1</tt> and
-     * <tt>e2</tt> in the collection).<p>
+     * comparator (that is, {@code comp.compare(e1, e2)} must not throw a
+     * {@code ClassCastException} for any elements {@code e1} and
+     * {@code e2} in the collection).<p>
      *
      * This method iterates over the entire collection, hence it requires
      * time proportional to the size of the collection.
@@ -690,7 +690,7 @@
      * @param  <T> the class of the objects in the collection
      * @param  coll the collection whose maximum element is to be determined.
      * @param  comp the comparator with which to determine the maximum element.
-     *         A <tt>null</tt> value indicates that the elements' <i>natural
+     *         A {@code null} value indicates that the elements' <i>natural
      *        ordering</i> should be used.
      * @return the maximum element of the given collection, according
      *         to the specified comparator.
@@ -717,32 +717,32 @@
 
     /**
      * Rotates the elements in the specified list by the specified distance.
-     * After calling this method, the element at index <tt>i</tt> will be
-     * the element previously at index <tt>(i - distance)</tt> mod
-     * <tt>list.size()</tt>, for all values of <tt>i</tt> between <tt>0</tt>
-     * and <tt>list.size()-1</tt>, inclusive.  (This method has no effect on
+     * After calling this method, the element at index {@code i} will be
+     * the element previously at index {@code (i - distance)} mod
+     * {@code list.size()}, for all values of {@code i} between {@code 0}
+     * and {@code list.size()-1}, inclusive.  (This method has no effect on
      * the size of the list.)
      *
-     * <p>For example, suppose <tt>list</tt> comprises<tt> [t, a, n, k, s]</tt>.
-     * After invoking <tt>Collections.rotate(list, 1)</tt> (or
-     * <tt>Collections.rotate(list, -4)</tt>), <tt>list</tt> will comprise
-     * <tt>[s, t, a, n, k]</tt>.
+     * <p>For example, suppose {@code list} comprises{@code  [t, a, n, k, s]}.
+     * After invoking {@code Collections.rotate(list, 1)} (or
+     * {@code Collections.rotate(list, -4)}), {@code list} will comprise
+     * {@code [s, t, a, n, k]}.
      *
      * <p>Note that this method can usefully be applied to sublists to
      * move one or more elements within a list while preserving the
      * order of the remaining elements.  For example, the following idiom
-     * moves the element at index <tt>j</tt> forward to position
-     * <tt>k</tt> (which must be greater than or equal to <tt>j</tt>):
+     * moves the element at index {@code j} forward to position
+     * {@code k} (which must be greater than or equal to {@code j}):
      * <pre>
      *     Collections.rotate(list.subList(j, k+1), -1);
      * </pre>
-     * To make this concrete, suppose <tt>list</tt> comprises
-     * <tt>[a, b, c, d, e]</tt>.  To move the element at index <tt>1</tt>
-     * (<tt>b</tt>) forward two positions, perform the following invocation:
+     * To make this concrete, suppose {@code list} comprises
+     * {@code [a, b, c, d, e]}.  To move the element at index {@code 1}
+     * ({@code b}) forward two positions, perform the following invocation:
      * <pre>
      *     Collections.rotate(l.subList(1, 4), -1);
      * </pre>
-     * The resulting list is <tt>[a, c, d, b, e]</tt>.
+     * The resulting list is {@code [a, c, d, b, e]}.
      *
      * <p>To move more than one element forward, increase the absolute value
      * of the rotation distance.  To move elements backward, use a positive
@@ -755,8 +755,8 @@
      * element is swapped into the first element.  If necessary, the process
      * is repeated on the second and successive elements, until the rotation
      * is complete.  If the specified list is large and doesn't implement the
-     * <tt>RandomAccess</tt> interface, this implementation breaks the
-     * list into two sublist views around index <tt>-distance mod size</tt>.
+     * {@code RandomAccess} interface, this implementation breaks the
+     * list into two sublist views around index {@code -distance mod size}.
      * Then the {@link #reverse(List)} method is invoked on each sublist view,
      * and finally it is invoked on the entire list.  For a more complete
      * description of both algorithms, see Section 2.3 of Jon Bentley's
@@ -765,9 +765,9 @@
      * @param list the list to be rotated.
      * @param distance the distance to rotate the list.  There are no
      *        constraints on this value; it may be zero, negative, or
-     *        greater than <tt>list.size()</tt>.
+     *        greater than {@code list.size()}.
      * @throws UnsupportedOperationException if the specified list or
-     *         its list-iterator does not support the <tt>set</tt> operation.
+     *         its list-iterator does not support the {@code set} operation.
      * @since 1.4
      */
     public static void rotate(List<?> list, int distance) {
@@ -817,21 +817,21 @@
 
     /**
      * Replaces all occurrences of one specified value in a list with another.
-     * More formally, replaces with <tt>newVal</tt> each element <tt>e</tt>
-     * in <tt>list</tt> such that
-     * <tt>(oldVal==null ? e==null : oldVal.equals(e))</tt>.
+     * More formally, replaces with {@code newVal} each element {@code e}
+     * in {@code list} such that
+     * {@code (oldVal==null ? e==null : oldVal.equals(e))}.
      * (This method has no effect on the size of the list.)
      *
      * @param  <T> the class of the objects in the list
      * @param list the list in which replacement is to occur.
      * @param oldVal the old value to be replaced.
-     * @param newVal the new value with which <tt>oldVal</tt> is to be
+     * @param newVal the new value with which {@code oldVal} is to be
      *        replaced.
-     * @return <tt>true</tt> if <tt>list</tt> contained one or more elements
-     *         <tt>e</tt> such that
-     *         <tt>(oldVal==null ?  e==null : oldVal.equals(e))</tt>.
+     * @return {@code true} if {@code list} contained one or more elements
+     *         {@code e} such that
+     *         {@code (oldVal==null ?  e==null : oldVal.equals(e))}.
      * @throws UnsupportedOperationException if the specified list or
-     *         its list-iterator does not support the <tt>set</tt> operation.
+     *         its list-iterator does not support the {@code set} operation.
      * @since  1.4
      */
     public static <T> boolean replaceAll(List<T> list, T oldVal, T newVal) {
@@ -877,7 +877,7 @@
     /**
      * Returns the starting position of the first occurrence of the specified
      * target list within the specified source list, or -1 if there is no
-     * such occurrence.  More formally, returns the lowest index <tt>i</tt>
+     * such occurrence.  More formally, returns the lowest index {@code i}
      * such that {@code source.subList(i, i+target.size()).equals(target)},
      * or -1 if there is no such index.  (Returns -1 if
      * {@code target.size() > source.size()})
@@ -887,8 +887,8 @@
      * location in turn.
      *
      * @param source the list in which to search for the first occurrence
-     *        of <tt>target</tt>.
-     * @param target the list to search for as a subList of <tt>source</tt>.
+     *        of {@code target}.
+     * @param target the list to search for as a subList of {@code source}.
      * @return the starting position of the first occurrence of the specified
      *         target list within the specified source list, or -1 if there
      *         is no such occurrence.
@@ -930,7 +930,7 @@
     /**
      * Returns the starting position of the last occurrence of the specified
      * target list within the specified source list, or -1 if there is no such
-     * occurrence.  More formally, returns the highest index <tt>i</tt>
+     * occurrence.  More formally, returns the highest index {@code i}
      * such that {@code source.subList(i, i+target.size()).equals(target)},
      * or -1 if there is no such index.  (Returns -1 if
      * {@code target.size() > source.size()})
@@ -940,8 +940,8 @@
      * location in turn.
      *
      * @param source the list in which to search for the last occurrence
-     *        of <tt>target</tt>.
-     * @param target the list to search for as a subList of <tt>source</tt>.
+     *        of {@code target}.
+     * @param target the list to search for as a subList of {@code source}.
      * @return the starting position of the last occurrence of the specified
      *         target list within the specified source list, or -1 if there
      *         is no such occurrence.
@@ -993,11 +993,11 @@
      * collections.  Query operations on the returned collection "read through"
      * to the specified collection, and attempts to modify the returned
      * collection, whether direct or via its iterator, result in an
-     * <tt>UnsupportedOperationException</tt>.<p>
+     * {@code UnsupportedOperationException}.<p>
      *
      * The returned collection does <i>not</i> pass the hashCode and equals
      * operations through to the backing collection, but relies on
-     * <tt>Object</tt>'s <tt>equals</tt> and <tt>hashCode</tt> methods.  This
+     * {@code Object}'s {@code equals} and {@code hashCode} methods.  This
      * is necessary to preserve the contracts of these operations in the case
      * that the backing collection is a set or a list.<p>
      *
@@ -1105,7 +1105,7 @@
      * modules to provide users with "read-only" access to internal sets.
      * Query operations on the returned set "read through" to the specified
      * set, and attempts to modify the returned set, whether direct or via its
-     * iterator, result in an <tt>UnsupportedOperationException</tt>.<p>
+     * iterator, result in an {@code UnsupportedOperationException}.<p>
      *
      * The returned set will be serializable if the specified set
      * is serializable.
@@ -1136,8 +1136,8 @@
      * sorted sets.  Query operations on the returned sorted set "read
      * through" to the specified sorted set.  Attempts to modify the returned
      * sorted set, whether direct, via its iterator, or via its
-     * <tt>subSet</tt>, <tt>headSet</tt>, or <tt>tailSet</tt> views, result in
-     * an <tt>UnsupportedOperationException</tt>.<p>
+     * {@code subSet}, {@code headSet}, or {@code tailSet} views, result in
+     * an {@code UnsupportedOperationException}.<p>
      *
      * The returned sorted set will be serializable if the specified sorted set
      * is serializable.
@@ -1273,7 +1273,7 @@
      * lists.  Query operations on the returned list "read through" to the
      * specified list, and attempts to modify the returned list, whether
      * direct or via its iterator, result in an
-     * <tt>UnsupportedOperationException</tt>.<p>
+     * {@code UnsupportedOperationException}.<p>
      *
      * The returned list will be serializable if the specified list
      * is serializable. Similarly, the returned list will implement
@@ -1419,7 +1419,7 @@
      * maps.  Query operations on the returned map "read through"
      * to the specified map, and attempts to modify the returned
      * map, whether direct or via its collection views, result in an
-     * <tt>UnsupportedOperationException</tt>.<p>
+     * {@code UnsupportedOperationException}.<p>
      *
      * The returned map will be serializable if the specified map
      * is serializable.
@@ -1769,8 +1769,8 @@
      * sorted maps.  Query operations on the returned sorted map "read through"
      * to the specified sorted map.  Attempts to modify the returned
      * sorted map, whether direct, via its collection views, or via its
-     * <tt>subMap</tt>, <tt>headMap</tt>, or <tt>tailMap</tt> views, result in
-     * an <tt>UnsupportedOperationException</tt>.<p>
+     * {@code subMap}, {@code headMap}, or {@code tailMap} views, result in
+     * an {@code UnsupportedOperationException}.<p>
      *
      * The returned sorted map will be serializable if the specified sorted map
      * is serializable.
@@ -2148,8 +2148,8 @@
      * through the returned sorted set (or its views).<p>
      *
      * It is imperative that the user manually synchronize on the returned
-     * sorted set when iterating over it or any of its <tt>subSet</tt>,
-     * <tt>headSet</tt>, or <tt>tailSet</tt> views.
+     * sorted set when iterating over it or any of its {@code subSet},
+     * {@code headSet}, or {@code tailSet} views.
      * <pre>
      *  SortedSet s = Collections.synchronizedSortedSet(new TreeSet());
      *      ...
@@ -2700,8 +2700,8 @@
      *
      * It is imperative that the user manually synchronize on the returned
      * sorted map when iterating over any of its collection views, or the
-     * collections views of any of its <tt>subMap</tt>, <tt>headMap</tt> or
-     * <tt>tailMap</tt> views.
+     * collections views of any of its {@code subMap}, {@code headMap} or
+     * {@code tailMap} views.
      * <pre>
      *  SortedMap m = Collections.synchronizedSortedMap(new TreeMap());
      *      ...
@@ -4406,7 +4406,7 @@
      * </pre>
      *
      * @implNote
-     * Implementations of this method need not create a separate <tt>List</tt>
+     * Implementations of this method need not create a separate {@code List}
      * object for each call.   Using this method is likely to have comparable
      * cost to using the like-named field.  (Unlike this method, the field does
      * not provide type safety.)
@@ -4846,7 +4846,7 @@
      * @param <K> the class of the map keys
      * @param <V> the class of the map values
      * @param key the sole key to be stored in the returned map.
-     * @param value the value to which the returned map maps <tt>key</tt>.
+     * @param value the value to which the returned map maps {@code key}.
      * @return an immutable map containing only the specified key-value
      *         mapping.
      * @since 1.3
@@ -4964,17 +4964,17 @@
     // Miscellaneous
 
     /**
-     * Returns an immutable list consisting of <tt>n</tt> copies of the
+     * Returns an immutable list consisting of {@code n} copies of the
      * specified object.  The newly allocated data object is tiny (it contains
      * a single reference to the data object).  This method is useful in
-     * combination with the <tt>List.addAll</tt> method to grow lists.
+     * combination with the {@code List.addAll} method to grow lists.
      * The returned list is serializable.
      *
      * @param  <T> the class of the object to copy and of the objects
      *         in the returned list.
      * @param  n the number of elements in the returned list.
      * @param  o the element to appear repeatedly in the returned list.
-     * @return an immutable list consisting of <tt>n</tt> copies of the
+     * @return an immutable list consisting of {@code n} copies of the
      *         specified object.
      * @throws IllegalArgumentException if {@code n < 0}
      * @see    List#addAll(Collection)
@@ -5095,7 +5095,7 @@
      * @param  <T> the class of the objects compared by the comparator
      * @return A comparator that imposes the reverse of the <i>natural
      *         ordering</i> on a collection of objects that implement
-     *         the <tt>Comparable</tt> interface.
+     *         the {@code Comparable} interface.
      * @see Comparable
      */
     @SuppressWarnings("unchecked")
@@ -5259,14 +5259,14 @@
     /**
      * Returns the number of elements in the specified collection equal to the
      * specified object.  More formally, returns the number of elements
-     * <tt>e</tt> in the collection such that
-     * <tt>(o == null ? e == null : o.equals(e))</tt>.
+     * {@code e} in the collection such that
+     * {@code Objects.equals(o, e)}.
      *
      * @param c the collection in which to determine the frequency
-     *     of <tt>o</tt>
+     *     of {@code o}
      * @param o the object whose frequency is to be determined
      * @return the number of elements in {@code c} equal to {@code o}
-     * @throws NullPointerException if <tt>c</tt> is null
+     * @throws NullPointerException if {@code c} is null
      * @since 1.5
      */
     public static int frequency(Collection<?> c, Object o) {
@@ -5377,7 +5377,7 @@
      * Adds all of the specified elements to the specified collection.
      * Elements to be added may be specified individually or as an array.
      * The behavior of this convenience method is identical to that of
-     * <tt>c.addAll(Arrays.asList(elements))</tt>, but this method is likely
+     * {@code c.addAll(Arrays.asList(elements))}, but this method is likely
      * to run significantly faster under most implementations.
      *
      * <p>When elements are specified individually, this method provides a
@@ -5387,16 +5387,16 @@
      * </pre>
      *
      * @param  <T> the class of the elements to add and of the collection
-     * @param c the collection into which <tt>elements</tt> are to be inserted
-     * @param elements the elements to insert into <tt>c</tt>
-     * @return <tt>true</tt> if the collection changed as a result of the call
-     * @throws UnsupportedOperationException if <tt>c</tt> does not support
-     *         the <tt>add</tt> operation
-     * @throws NullPointerException if <tt>elements</tt> contains one or more
-     *         null values and <tt>c</tt> does not permit null elements, or
-     *         if <tt>c</tt> or <tt>elements</tt> are <tt>null</tt>
+     * @param c the collection into which {@code elements} are to be inserted
+     * @param elements the elements to insert into {@code c}
+     * @return {@code true} if the collection changed as a result of the call
+     * @throws UnsupportedOperationException if {@code c} does not support
+     *         the {@code add} operation
+     * @throws NullPointerException if {@code elements} contains one or more
+     *         null values and {@code c} does not permit null elements, or
+     *         if {@code c} or {@code elements} are {@code null}
      * @throws IllegalArgumentException if some property of a value in
-     *         <tt>elements</tt> prevents it from being added to <tt>c</tt>
+     *         {@code elements} prevents it from being added to {@code c}
      * @see Collection#addAll(Collection)
      * @since 1.5
      */
@@ -5418,9 +5418,9 @@
      * HashMap} or {@link TreeMap}).
      *
      * <p>Each method invocation on the set returned by this method results in
-     * exactly one method invocation on the backing map or its <tt>keySet</tt>
-     * view, with one exception.  The <tt>addAll</tt> method is implemented
-     * as a sequence of <tt>put</tt> invocations on the backing map.
+     * exactly one method invocation on the backing map or its {@code keySet}
+     * view, with one exception.  The {@code addAll} method is implemented
+     * as a sequence of {@code put} invocations on the backing map.
      *
      * <p>The specified map must be empty at the time this method is invoked,
      * and should not be accessed directly after this method returns.  These
@@ -5436,7 +5436,7 @@
      *        returned set
      * @param map the backing map
      * @return the set backed by the map
-     * @throws IllegalArgumentException if <tt>map</tt> is not empty
+     * @throws IllegalArgumentException if {@code map} is not empty
      * @since 1.6
      */
     public static <E> Set<E> newSetFromMap(Map<E, Boolean> map) {
@@ -5505,10 +5505,10 @@
 
     /**
      * Returns a view of a {@link Deque} as a Last-in-first-out (Lifo)
-     * {@link Queue}. Method <tt>add</tt> is mapped to <tt>push</tt>,
-     * <tt>remove</tt> is mapped to <tt>pop</tt> and so on. This
+     * {@link Queue}. Method {@code add} is mapped to {@code push},
+     * {@code remove} is mapped to {@code pop} and so on. This
      * view can be useful when you would like to use a method
-     * requiring a <tt>Queue</tt> but you need Lifo ordering.
+     * requiring a {@code Queue} but you need Lifo ordering.
      *
      * <p>Each method invocation on the queue returned by this method
      * results in exactly one method invocation on the backing deque, with
--- a/jdk/src/java.base/share/classes/java/util/Comparator.java	Thu Apr 09 12:29:31 2015 +0200
+++ b/jdk/src/java.base/share/classes/java/util/Comparator.java	Mon Aug 17 12:45:16 2015 +0300
@@ -42,20 +42,20 @@
  * SortedMap sorted maps}), or to provide an ordering for collections of
  * objects that don't have a {@link Comparable natural ordering}.<p>
  *
- * The ordering imposed by a comparator <tt>c</tt> on a set of elements
- * <tt>S</tt> is said to be <i>consistent with equals</i> if and only if
- * <tt>c.compare(e1, e2)==0</tt> has the same boolean value as
- * <tt>e1.equals(e2)</tt> for every <tt>e1</tt> and <tt>e2</tt> in
- * <tt>S</tt>.<p>
+ * The ordering imposed by a comparator {@code c} on a set of elements
+ * {@code S} is said to be <i>consistent with equals</i> if and only if
+ * {@code c.compare(e1, e2)==0} has the same boolean value as
+ * {@code e1.equals(e2)} for every {@code e1} and {@code e2} in
+ * {@code S}.<p>
  *
  * Caution should be exercised when using a comparator capable of imposing an
  * ordering inconsistent with equals to order a sorted set (or sorted map).
- * Suppose a sorted set (or sorted map) with an explicit comparator <tt>c</tt>
- * is used with elements (or keys) drawn from a set <tt>S</tt>.  If the
- * ordering imposed by <tt>c</tt> on <tt>S</tt> is inconsistent with equals,
+ * Suppose a sorted set (or sorted map) with an explicit comparator {@code c}
+ * is used with elements (or keys) drawn from a set {@code S}.  If the
+ * ordering imposed by {@code c} on {@code S} is inconsistent with equals,
  * the sorted set (or sorted map) will behave "strangely."  In particular the
  * sorted set (or sorted map) will violate the general contract for set (or
- * map), which is defined in terms of <tt>equals</tt>.<p>
+ * map), which is defined in terms of {@code equals}.<p>
  *
  * For example, suppose one adds two elements {@code a} and {@code b} such that
  * {@code (a.equals(b) && c.compare(a, b) != 0)}
@@ -67,23 +67,23 @@
  * {@link Set#add Set.add} method.<p>
  *
  * Note: It is generally a good idea for comparators to also implement
- * <tt>java.io.Serializable</tt>, as they may be used as ordering methods in
+ * {@code java.io.Serializable}, as they may be used as ordering methods in
  * serializable data structures (like {@link TreeSet}, {@link TreeMap}).  In
  * order for the data structure to serialize successfully, the comparator (if
- * provided) must implement <tt>Serializable</tt>.<p>
+ * provided) must implement {@code Serializable}.<p>
  *
  * For the mathematically inclined, the <i>relation</i> that defines the
- * <i>imposed ordering</i> that a given comparator <tt>c</tt> imposes on a
- * given set of objects <tt>S</tt> is:<pre>
+ * <i>imposed ordering</i> that a given comparator {@code c} imposes on a
+ * given set of objects {@code S} is:<pre>
  *       {(x, y) such that c.compare(x, y) &lt;= 0}.
  * </pre> The <i>quotient</i> for this total order is:<pre>
  *       {(x, y) such that c.compare(x, y) == 0}.
  * </pre>
  *
- * It follows immediately from the contract for <tt>compare</tt> that the
- * quotient is an <i>equivalence relation</i> on <tt>S</tt>, and that the
- * imposed ordering is a <i>total order</i> on <tt>S</tt>.  When we say that
- * the ordering imposed by <tt>c</tt> on <tt>S</tt> is <i>consistent with
+ * It follows immediately from the contract for {@code compare} that the
+ * quotient is an <i>equivalence relation</i> on {@code S}, and that the
+ * imposed ordering is a <i>total order</i> on {@code S}.  When we say that
+ * the ordering imposed by {@code c} on {@code S} is <i>consistent with
  * equals</i>, we mean that the quotient for the ordering is the equivalence
  * relation defined by the objects' {@link Object#equals(Object)
  * equals(Object)} method(s):<pre>
@@ -113,26 +113,26 @@
      * to, or greater than the second.<p>
      *
      * In the foregoing description, the notation
-     * <tt>sgn(</tt><i>expression</i><tt>)</tt> designates the mathematical
-     * <i>signum</i> function, which is defined to return one of <tt>-1</tt>,
-     * <tt>0</tt>, or <tt>1</tt> according to whether the value of
+     * {@code sgn(}<i>expression</i>{@code )} designates the mathematical
+     * <i>signum</i> function, which is defined to return one of {@code -1},
+     * {@code 0}, or {@code 1} according to whether the value of
      * <i>expression</i> is negative, zero or positive.<p>
      *
-     * The implementor must ensure that <tt>sgn(compare(x, y)) ==
-     * -sgn(compare(y, x))</tt> for all <tt>x</tt> and <tt>y</tt>.  (This
-     * implies that <tt>compare(x, y)</tt> must throw an exception if and only
-     * if <tt>compare(y, x)</tt> throws an exception.)<p>
+     * The implementor must ensure that {@code sgn(compare(x, y)) ==
+     * -sgn(compare(y, x))} for all {@code x} and {@code y}.  (This
+     * implies that {@code compare(x, y)} must throw an exception if and only
+     * if {@code compare(y, x)} throws an exception.)<p>
      *
      * The implementor must also ensure that the relation is transitive:
-     * <tt>((compare(x, y)&gt;0) &amp;&amp; (compare(y, z)&gt;0))</tt> implies
-     * <tt>compare(x, z)&gt;0</tt>.<p>
+     * {@code ((compare(x, y)>0) && (compare(y, z)>0))} implies
+     * {@code compare(x, z)>0}.<p>
      *
-     * Finally, the implementor must ensure that <tt>compare(x, y)==0</tt>
-     * implies that <tt>sgn(compare(x, z))==sgn(compare(y, z))</tt> for all
-     * <tt>z</tt>.<p>
+     * Finally, the implementor must ensure that {@code compare(x, y)==0}
+     * implies that {@code sgn(compare(x, z))==sgn(compare(y, z))} for all
+     * {@code z}.<p>
      *
      * It is generally the case, but <i>not</i> strictly required that
-     * <tt>(compare(x, y)==0) == (x.equals(y))</tt>.  Generally speaking,
+     * {@code (compare(x, y)==0) == (x.equals(y))}.  Generally speaking,
      * any comparator that violates this condition should clearly indicate
      * this fact.  The recommended language is "Note: this comparator
      * imposes orderings that are inconsistent with equals."
@@ -153,19 +153,19 @@
      * Indicates whether some other object is &quot;equal to&quot; this
      * comparator.  This method must obey the general contract of
      * {@link Object#equals(Object)}.  Additionally, this method can return
-     * <tt>true</tt> <i>only</i> if the specified object is also a comparator
+     * {@code true} <i>only</i> if the specified object is also a comparator
      * and it imposes the same ordering as this comparator.  Thus,
-     * <code>comp1.equals(comp2)</code> implies that <tt>sgn(comp1.compare(o1,
-     * o2))==sgn(comp2.compare(o1, o2))</tt> for every object reference
-     * <tt>o1</tt> and <tt>o2</tt>.<p>
+     * {@code comp1.equals(comp2)} implies that {@code sgn(comp1.compare(o1,
+     * o2))==sgn(comp2.compare(o1, o2))} for every object reference
+     * {@code o1} and {@code o2}.<p>
      *
      * Note that it is <i>always</i> safe <i>not</i> to override
-     * <tt>Object.equals(Object)</tt>.  However, overriding this method may,
+     * {@code Object.equals(Object)}.  However, overriding this method may,
      * in some cases, improve performance by allowing programs to determine
      * that two distinct comparators impose the same order.
      *
      * @param   obj   the reference object with which to compare.
-     * @return  <code>true</code> only if the specified object is also
+     * @return  {@code true} only if the specified object is also
      *          a comparator and it imposes the same ordering as this
      *          comparator.
      * @see Object#equals(Object)
--- a/jdk/src/java.base/share/classes/java/util/Dictionary.java	Thu Apr 09 12:29:31 2015 +0200
+++ b/jdk/src/java.base/share/classes/java/util/Dictionary.java	Mon Aug 17 12:45:16 2015 +0300
@@ -26,14 +26,14 @@
 package java.util;
 
 /**
- * The <code>Dictionary</code> class is the abstract parent of any
- * class, such as <code>Hashtable</code>, which maps keys to values.
- * Every key and every value is an object. In any one <tt>Dictionary</tt>
+ * The {@code Dictionary} class is the abstract parent of any
+ * class, such as {@code Hashtable}, which maps keys to values.
+ * Every key and every value is an object. In any one {@code Dictionary}
  * object, every key is associated with at most one value. Given a
- * <tt>Dictionary</tt> and a key, the associated element can be looked up.
- * Any non-<code>null</code> object can be used as a key and as a value.
+ * {@code Dictionary} and a key, the associated element can be looked up.
+ * Any non-{@code null} object can be used as a key and as a value.
  * <p>
- * As a rule, the <code>equals</code> method should be used by
+ * As a rule, the {@code equals} method should be used by
  * implementations of this class to decide if two keys are the same.
  * <p>
  * <strong>NOTE: This class is obsolete.  New implementations should
@@ -64,17 +64,17 @@
 
     /**
      * Tests if this dictionary maps no keys to value. The general contract
-     * for the <tt>isEmpty</tt> method is that the result is true if and only
+     * for the {@code isEmpty} method is that the result is true if and only
      * if this dictionary contains no entries.
      *
-     * @return  <code>true</code> if this dictionary maps no keys to values;
-     *          <code>false</code> otherwise.
+     * @return  {@code true} if this dictionary maps no keys to values;
+     *          {@code false} otherwise.
      */
     abstract public boolean isEmpty();
 
     /**
      * Returns an enumeration of the keys in this dictionary. The general
-     * contract for the keys method is that an <tt>Enumeration</tt> object
+     * contract for the keys method is that an {@code Enumeration} object
      * is returned that will generate all the keys for which this dictionary
      * contains entries.
      *
@@ -86,8 +86,8 @@
 
     /**
      * Returns an enumeration of the values in this dictionary. The general
-     * contract for the <tt>elements</tt> method is that an
-     * <tt>Enumeration</tt> is returned that will generate all the elements
+     * contract for the {@code elements} method is that an
+     * {@code Enumeration} is returned that will generate all the elements
      * contained in entries in this dictionary.
      *
      * @return  an enumeration of the values in this dictionary.
@@ -98,58 +98,58 @@
 
     /**
      * Returns the value to which the key is mapped in this dictionary.
-     * The general contract for the <tt>isEmpty</tt> method is that if this
+     * The general contract for the {@code isEmpty} method is that if this
      * dictionary contains an entry for the specified key, the associated
-     * value is returned; otherwise, <tt>null</tt> is returned.
+     * value is returned; otherwise, {@code null} is returned.
      *
      * @return  the value to which the key is mapped in this dictionary;
      * @param   key   a key in this dictionary.
-     *          <code>null</code> if the key is not mapped to any value in
+     *          {@code null} if the key is not mapped to any value in
      *          this dictionary.
-     * @exception NullPointerException if the <tt>key</tt> is <tt>null</tt>.
+     * @exception NullPointerException if the {@code key} is {@code null}.
      * @see     java.util.Dictionary#put(java.lang.Object, java.lang.Object)
      */
     abstract public V get(Object key);
 
     /**
-     * Maps the specified <code>key</code> to the specified
-     * <code>value</code> in this dictionary. Neither the key nor the
-     * value can be <code>null</code>.
+     * Maps the specified {@code key} to the specified
+     * {@code value} in this dictionary. Neither the key nor the
+     * value can be {@code null}.
      * <p>
      * If this dictionary already contains an entry for the specified
-     * <tt>key</tt>, the value already in this dictionary for that
-     * <tt>key</tt> is returned, after modifying the entry to contain the
+     * {@code key}, the value already in this dictionary for that
+     * {@code key} is returned, after modifying the entry to contain the
      *  new element. <p>If this dictionary does not already have an entry
-     *  for the specified <tt>key</tt>, an entry is created for the
-     *  specified <tt>key</tt> and <tt>value</tt>, and <tt>null</tt> is
+     *  for the specified {@code key}, an entry is created for the
+     *  specified {@code key} and {@code value}, and {@code null} is
      *  returned.
      * <p>
-     * The <code>value</code> can be retrieved by calling the
-     * <code>get</code> method with a <code>key</code> that is equal to
-     * the original <code>key</code>.
+     * The {@code value} can be retrieved by calling the
+     * {@code get} method with a {@code key} that is equal to
+     * the original {@code key}.
      *
      * @param      key     the hashtable key.
      * @param      value   the value.
-     * @return     the previous value to which the <code>key</code> was mapped
-     *             in this dictionary, or <code>null</code> if the key did not
+     * @return     the previous value to which the {@code key} was mapped
+     *             in this dictionary, or {@code null} if the key did not
      *             have a previous mapping.
-     * @exception  NullPointerException  if the <code>key</code> or
-     *               <code>value</code> is <code>null</code>.
+     * @exception  NullPointerException  if the {@code key} or
+     *               {@code value} is {@code null}.
      * @see        java.lang.Object#equals(java.lang.Object)
      * @see        java.util.Dictionary#get(java.lang.Object)
      */
     abstract public V put(K key, V value);
 
     /**
-     * Removes the <code>key</code> (and its corresponding
-     * <code>value</code>) from this dictionary. This method does nothing
-     * if the <code>key</code> is not in this dictionary.
+     * Removes the {@code key} (and its corresponding
+     * {@code value}) from this dictionary. This method does nothing
+     * if the {@code key} is not in this dictionary.
      *
      * @param   key   the key that needs to be removed.
-     * @return  the value to which the <code>key</code> had been mapped in this
-     *          dictionary, or <code>null</code> if the key did not have a
+     * @return  the value to which the {@code key} had been mapped in this
+     *          dictionary, or {@code null} if the key did not have a
      *          mapping.
-     * @exception NullPointerException if <tt>key</tt> is <tt>null</tt>.
+     * @exception NullPointerException if {@code key} is {@code null}.
      */
     abstract public V remove(Object key);
 }
--- a/jdk/src/java.base/share/classes/java/util/DuplicateFormatFlagsException.java	Thu Apr 09 12:29:31 2015 +0200
+++ b/jdk/src/java.base/share/classes/java/util/DuplicateFormatFlagsException.java	Mon Aug 17 12:45:16 2015 +0300
@@ -29,7 +29,7 @@
  * Unchecked exception thrown when duplicate flags are provided in the format
  * specifier.
  *
- * <p> Unless otherwise specified, passing a <tt>null</tt> argument to any
+ * <p> Unless otherwise specified, passing a {@code null} argument to any
  * method or constructor in this class will cause a {@link
  * NullPointerException} to be thrown.
  *
--- a/jdk/src/java.base/share/classes/java/util/EmptyStackException.java	Thu Apr 09 12:29:31 2015 +0200
+++ b/jdk/src/java.base/share/classes/java/util/EmptyStackException.java	Mon Aug 17 12:45:16 2015 +0300
@@ -26,7 +26,7 @@
 package java.util;
 
 /**
- * Thrown by methods in the <code>Stack</code> class to indicate
+ * Thrown by methods in the {@code Stack} class to indicate
  * that the stack is empty.
  *
  * @author  Jonathan Payne
@@ -38,7 +38,7 @@
     private static final long serialVersionUID = 5084686378493302095L;
 
     /**
-     * Constructs a new <code>EmptyStackException</code> with <tt>null</tt>
+     * Constructs a new {@code EmptyStackException} with {@code null}
      * as its error message string.
      */
     public EmptyStackException() {
--- a/jdk/src/java.base/share/classes/java/util/EnumMap.java	Thu Apr 09 12:29:31 2015 +0200
+++ b/jdk/src/java.base/share/classes/java/util/EnumMap.java	Mon Aug 17 12:45:16 2015 +0300
@@ -50,7 +50,7 @@
  * presence of a null key or to remove one will, however, function properly.
  * Null values are permitted.
 
- * <P>Like most collection implementations <tt>EnumMap</tt> is not
+ * <P>Like most collection implementations {@code EnumMap} is not
  * synchronized. If multiple threads access an enum map concurrently, and at
  * least one of the threads modifies the map, it should be synchronized
  * externally.  This is typically accomplished by synchronizing on some
@@ -80,7 +80,7 @@
     implements java.io.Serializable, Cloneable
 {
     /**
-     * The <tt>Class</tt> object for the enum type of all the keys of this map.
+     * The {@code Class} object for the enum type of all the keys of this map.
      *
      * @serial
      */
@@ -131,7 +131,7 @@
      * Creates an empty enum map with the specified key type.
      *
      * @param keyType the class object of the key type for this enum map
-     * @throws NullPointerException if <tt>keyType</tt> is null
+     * @throws NullPointerException if {@code keyType} is null
      */
     public EnumMap(Class<K> keyType) {
         this.keyType = keyType;
@@ -144,7 +144,7 @@
      * map, initially containing the same mappings (if any).
      *
      * @param m the enum map from which to initialize this enum map
-     * @throws NullPointerException if <tt>m</tt> is null
+     * @throws NullPointerException if {@code m} is null
      */
     public EnumMap(EnumMap<K, ? extends V> m) {
         keyType = m.keyType;
@@ -155,15 +155,15 @@
 
     /**
      * Creates an enum map initialized from the specified map.  If the
-     * specified map is an <tt>EnumMap</tt> instance, this constructor behaves
+     * specified map is an {@code EnumMap} instance, this constructor behaves
      * identically to {@link #EnumMap(EnumMap)}.  Otherwise, the specified map
      * must contain at least one mapping (in order to determine the new
      * enum map's key type).
      *
      * @param m the map from which to initialize this enum map
-     * @throws IllegalArgumentException if <tt>m</tt> is not an
-     *     <tt>EnumMap</tt> instance and contains no mappings
-     * @throws NullPointerException if <tt>m</tt> is null
+     * @throws IllegalArgumentException if {@code m} is not an
+     *     {@code EnumMap} instance and contains no mappings
+     * @throws NullPointerException if {@code m} is null
      */
     public EnumMap(Map<K, ? extends V> m) {
         if (m instanceof EnumMap) {
@@ -194,11 +194,11 @@
     }
 
     /**
-     * Returns <tt>true</tt> if this map maps one or more keys to the
+     * Returns {@code true} if this map maps one or more keys to the
      * specified value.
      *
      * @param value the value whose presence in this map is to be tested
-     * @return <tt>true</tt> if this map maps one or more keys to this value
+     * @return {@code true} if this map maps one or more keys to this value
      */
     public boolean containsValue(Object value) {
         value = maskNull(value);
@@ -211,11 +211,11 @@
     }
 
     /**
-     * Returns <tt>true</tt> if this map contains a mapping for the specified
+     * Returns {@code true} if this map contains a mapping for the specified
      * key.
      *
      * @param key the key whose presence in this map is to be tested
-     * @return <tt>true</tt> if this map contains a mapping for the specified
+     * @return {@code true} if this map contains a mapping for the specified
      *            key
      */
     public boolean containsKey(Object key) {
@@ -258,9 +258,9 @@
      * @param value the value to be associated with the specified key
      *
      * @return the previous value associated with specified key, or
-     *     <tt>null</tt> if there was no mapping for key.  (A <tt>null</tt>
+     *     {@code null} if there was no mapping for key.  (A {@code null}
      *     return can also indicate that the map previously associated
-     *     <tt>null</tt> with the specified key.)
+     *     {@code null} with the specified key.)
      * @throws NullPointerException if the specified key is null
      */
     public V put(K key, V value) {
@@ -279,9 +279,9 @@
      *
      * @param key the key whose mapping is to be removed from the map
      * @return the previous value associated with specified key, or
-     *     <tt>null</tt> if there was no entry for key.  (A <tt>null</tt>
+     *     {@code null} if there was no entry for key.  (A {@code null}
      *     return can also indicate that the map previously associated
-     *     <tt>null</tt> with the specified key.)
+     *     {@code null} with the specified key.)
      */
     public V remove(Object key) {
         if (!isValidKey(key))
@@ -644,12 +644,12 @@
 
     /**
      * Compares the specified object with this map for equality.  Returns
-     * <tt>true</tt> if the given object is also a map and the two maps
+     * {@code true} if the given object is also a map and the two maps
      * represent the same mappings, as specified in the {@link
      * Map#equals(Object)} contract.
      *
      * @param o the object to be compared for equality with this map
-     * @return <tt>true</tt> if the specified object is equal to this map
+     * @return {@code true} if the specified object is equal to this map
      */
     public boolean equals(Object o) {
         if (this == o)
@@ -758,7 +758,7 @@
     private static final long serialVersionUID = 458661240069192865L;
 
     /**
-     * Save the state of the <tt>EnumMap</tt> instance to a stream (i.e.,
+     * Save the state of the {@code EnumMap} instance to a stream (i.e.,
      * serialize it).
      *
      * @serialData The <i>size</i> of the enum map (the number of key-value
@@ -787,7 +787,7 @@
     }
 
     /**
-     * Reconstitute the <tt>EnumMap</tt> instance from a stream (i.e.,
+     * Reconstitute the {@code EnumMap} instance from a stream (i.e.,
      * deserialize it).
      */
     @SuppressWarnings("unchecked")
--- a/jdk/src/java.base/share/classes/java/util/EnumSet.java	Thu Apr 09 12:29:31 2015 +0200
+++ b/jdk/src/java.base/share/classes/java/util/EnumSet.java	Mon Aug 17 12:45:16 2015 +0300
@@ -34,11 +34,11 @@
  * are represented internally as bit vectors.  This representation is
  * extremely compact and efficient. The space and time performance of this
  * class should be good enough to allow its use as a high-quality, typesafe
- * alternative to traditional <tt>int</tt>-based "bit flags."  Even bulk
- * operations (such as <tt>containsAll</tt> and <tt>retainAll</tt>) should
+ * alternative to traditional {@code int}-based "bit flags."  Even bulk
+ * operations (such as {@code containsAll} and {@code retainAll}) should
  * run very quickly if their argument is also an enum set.
  *
- * <p>The iterator returned by the <tt>iterator</tt> method traverses the
+ * <p>The iterator returned by the {@code iterator} method traverses the
  * elements in their <i>natural order</i> (the order in which the enum
  * constants are declared).  The returned iterator is <i>weakly
  * consistent</i>: it will never throw {@link ConcurrentModificationException}
@@ -50,7 +50,7 @@
  * presence of a null element or to remove one will, however, function
  * properly.
  *
- * <P>Like most collection implementations, <tt>EnumSet</tt> is not
+ * <P>Like most collection implementations, {@code EnumSet} is not
  * synchronized.  If multiple threads access an enum set concurrently, and at
  * least one of the threads modifies the set, it should be synchronized
  * externally.  This is typically accomplished by synchronizing on some
@@ -106,7 +106,7 @@
      * @param elementType the class object of the element type for this enum
      *     set
      * @return An empty enum set of the specified type.
-     * @throws NullPointerException if <tt>elementType</tt> is null
+     * @throws NullPointerException if {@code elementType} is null
      */
     public static <E extends Enum<E>> EnumSet<E> noneOf(Class<E> elementType) {
         Enum<?>[] universe = getUniverse(elementType);
@@ -127,7 +127,7 @@
      * @param elementType the class object of the element type for this enum
      *     set
      * @return An enum set containing all the elements in the specified type.
-     * @throws NullPointerException if <tt>elementType</tt> is null
+     * @throws NullPointerException if {@code elementType} is null
      */
     public static <E extends Enum<E>> EnumSet<E> allOf(Class<E> elementType) {
         EnumSet<E> result = noneOf(elementType);
@@ -148,7 +148,7 @@
      * @param <E> The class of the elements in the set
      * @param s the enum set from which to initialize this enum set
      * @return A copy of the specified enum set.
-     * @throws NullPointerException if <tt>s</tt> is null
+     * @throws NullPointerException if {@code s} is null
      */
     public static <E extends Enum<E>> EnumSet<E> copyOf(EnumSet<E> s) {
         return s.clone();
@@ -156,7 +156,7 @@
 
     /**
      * Creates an enum set initialized from the specified collection.  If
-     * the specified collection is an <tt>EnumSet</tt> instance, this static
+     * the specified collection is an {@code EnumSet} instance, this static
      * factory method behaves identically to {@link #copyOf(EnumSet)}.
      * Otherwise, the specified collection must contain at least one element
      * (in order to determine the new enum set's element type).
@@ -164,9 +164,9 @@
      * @param <E> The class of the elements in the collection
      * @param c the collection from which to initialize this enum set
      * @return An enum set initialized from the given collection.
-     * @throws IllegalArgumentException if <tt>c</tt> is not an
-     *     <tt>EnumSet</tt> instance and contains no elements
-     * @throws NullPointerException if <tt>c</tt> is null
+     * @throws IllegalArgumentException if {@code c} is not an
+     *     {@code EnumSet} instance and contains no elements
+     * @throws NullPointerException if {@code c} is null
      */
     public static <E extends Enum<E>> EnumSet<E> copyOf(Collection<E> c) {
         if (c instanceof EnumSet) {
@@ -191,7 +191,7 @@
      * @param <E> The class of the elements in the enum set
      * @param s the enum set from whose complement to initialize this enum set
      * @return The complement of the specified set in this set
-     * @throws NullPointerException if <tt>s</tt> is null
+     * @throws NullPointerException if {@code s} is null
      */
     public static <E extends Enum<E>> EnumSet<E> complementOf(EnumSet<E> s) {
         EnumSet<E> result = copyOf(s);
@@ -210,7 +210,7 @@
      *
      * @param <E> The class of the specified element and of the set
      * @param e the element that this set is to contain initially
-     * @throws NullPointerException if <tt>e</tt> is null
+     * @throws NullPointerException if {@code e} is null
      * @return an enum set initially containing the specified element
      */
     public static <E extends Enum<E>> EnumSet<E> of(E e) {
@@ -332,7 +332,7 @@
      * @param first an element that the set is to contain initially
      * @param rest the remaining elements the set is to contain initially
      * @throws NullPointerException if any of the specified elements are null,
-     *     or if <tt>rest</tt> is null
+     *     or if {@code rest} is null
      * @return an enum set initially containing the specified elements
      */
     @SafeVarargs
--- a/jdk/src/java.base/share/classes/java/util/Enumeration.java	Thu Apr 09 12:29:31 2015 +0200
+++ b/jdk/src/java.base/share/classes/java/util/Enumeration.java	Mon Aug 17 12:45:16 2015 +0300
@@ -28,10 +28,10 @@
 /**
  * An object that implements the Enumeration interface generates a
  * series of elements, one at a time. Successive calls to the
- * <code>nextElement</code> method return successive elements of the
+ * {@code nextElement} method return successive elements of the
  * series.
  * <p>
- * For example, to print all elements of a <tt>Vector&lt;E&gt;</tt> <i>v</i>:
+ * For example, to print all elements of a {@code Vector<E>} <i>v</i>:
  * <pre>
  *   for (Enumeration&lt;E&gt; e = v.elements(); e.hasMoreElements();)
  *       System.out.println(e.nextElement());</pre>
@@ -39,7 +39,7 @@
  * Methods are provided to enumerate through the elements of a
  * vector, the keys of a hashtable, and the values in a hashtable.
  * Enumerations are also used to specify the input streams to a
- * <code>SequenceInputStream</code>.
+ * {@code SequenceInputStream}.
  *
  * @apiNote
  * The functionality of this interface is duplicated by the {@link Iterator}
@@ -65,9 +65,9 @@
     /**
      * Tests if this enumeration contains more elements.
      *
-     * @return  <code>true</code> if and only if this enumeration object
+     * @return  {@code true} if and only if this enumeration object
      *           contains at least one more element to provide;
-     *          <code>false</code> otherwise.
+     *          {@code false} otherwise.
      */
     boolean hasMoreElements();
 
--- a/jdk/src/java.base/share/classes/java/util/FormatFlagsConversionMismatchException.java	Thu Apr 09 12:29:31 2015 +0200
+++ b/jdk/src/java.base/share/classes/java/util/FormatFlagsConversionMismatchException.java	Mon Aug 17 12:45:16 2015 +0300
@@ -28,7 +28,7 @@
 /**
  * Unchecked exception thrown when a conversion and flag are incompatible.
  *
- * <p> Unless otherwise specified, passing a <tt>null</tt> argument to any
+ * <p> Unless otherwise specified, passing a {@code null} argument to any
  * method or constructor in this class will cause a {@link
  * NullPointerException} to be thrown.
  *
--- a/jdk/src/java.base/share/classes/java/util/Formattable.java	Thu Apr 09 12:29:31 2015 +0200
+++ b/jdk/src/java.base/share/classes/java/util/Formattable.java	Mon Aug 17 12:45:16 2015 +0300
@@ -28,8 +28,8 @@
 import java.io.IOException;
 
 /**
- * The <tt>Formattable</tt> interface must be implemented by any class that
- * needs to perform custom formatting using the <tt>'s'</tt> conversion
+ * The {@code Formattable} interface must be implemented by any class that
+ * needs to perform custom formatting using the {@code 's'} conversion
  * specifier of {@link java.util.Formatter}.  This interface allows basic
  * control for formatting arbitrary objects.
  *
@@ -110,7 +110,7 @@
  * safety is optional and may be enforced by classes that extend and implement
  * this interface.
  *
- * <p> Unless otherwise specified, passing a <tt>null</tt> argument to
+ * <p> Unless otherwise specified, passing a {@code null} argument to
  * any method in this interface will cause a {@link
  * NullPointerException} to be thrown.
  *
@@ -126,7 +126,7 @@
      *         {@link Formatter#out() formatter.out()} or {@link
      *         Formatter#locale() formatter.locale()} to obtain the {@link
      *         Appendable} or {@link Locale} used by this
-     *         <tt>formatter</tt> respectively.
+     *         {@code formatter} respectively.
      *
      * @param  flags
      *         The flags modify the output format.  The value is interpreted as
@@ -139,19 +139,19 @@
      * @param  width
      *         The minimum number of characters to be written to the output.
      *         If the length of the converted value is less than the
-     *         <tt>width</tt> then the output will be padded by
-     *         <tt>'&nbsp;&nbsp;'</tt> until the total number of characters
+     *         {@code width} then the output will be padded by
+     *         <code>'&nbsp;&nbsp;'</code> until the total number of characters
      *         equals width.  The padding is at the beginning by default.  If
      *         the {@link FormattableFlags#LEFT_JUSTIFY} flag is set then the
-     *         padding will be at the end.  If <tt>width</tt> is <tt>-1</tt>
+     *         padding will be at the end.  If {@code width} is {@code -1}
      *         then there is no minimum.
      *
      * @param  precision
      *         The maximum number of characters to be written to the output.
      *         The precision is applied before the width, thus the output will
-     *         be truncated to <tt>precision</tt> characters even if the
-     *         <tt>width</tt> is greater than the <tt>precision</tt>.  If
-     *         <tt>precision</tt> is <tt>-1</tt> then there is no explicit
+     *         be truncated to {@code precision} characters even if the
+     *         {@code width} is greater than the {@code precision}.  If
+     *         {@code precision} is {@code -1} then there is no explicit
      *         limit on the number of characters.
      *
      * @throws  IllegalFormatException
--- a/jdk/src/java.base/share/classes/java/util/FormattableFlags.java	Thu Apr 09 12:29:31 2015 +0200
+++ b/jdk/src/java.base/share/classes/java/util/FormattableFlags.java	Mon Aug 17 12:45:16 2015 +0300
@@ -39,12 +39,12 @@
     private FormattableFlags() {}
 
     /**
-     * Left-justifies the output.  Spaces (<tt>'&#92;u0020'</tt>) will be added
+     * Left-justifies the output.  Spaces (<code>'&#92;u0020'</code>) will be added
      * at the end of the converted value as required to fill the minimum width
      * of the field.  If this flag is not set then the output will be
      * right-justified.
      *
-     * <p> This flag corresponds to <tt>'-'</tt> (<tt>'&#92;u002d'</tt>) in
+     * <p> This flag corresponds to {@code '-'} (<code>'&#92;u002d'</code>) in
      * the format specifier.
      */
     public static final int LEFT_JUSTIFY = 1<<0; // '-'
@@ -52,23 +52,23 @@
     /**
      * Converts the output to upper case according to the rules of the
      * {@linkplain java.util.Locale locale} given during creation of the
-     * <tt>formatter</tt> argument of the {@link Formattable#formatTo
+     * {@code formatter} argument of the {@link Formattable#formatTo
      * formatTo()} method.  The output should be equivalent the following
      * invocation of {@link String#toUpperCase(java.util.Locale)}
      *
      * <pre>
      *     out.toUpperCase() </pre>
      *
-     * <p> This flag corresponds to <tt>'S'</tt> (<tt>'&#92;u0053'</tt>) in
+     * <p> This flag corresponds to {@code 'S'} (<code>'&#92;u0053'</code>) in
      * the format specifier.
      */
     public static final int UPPERCASE = 1<<1;    // 'S'
 
     /**
      * Requires the output to use an alternate form.  The definition of the
-     * form is specified by the <tt>Formattable</tt>.
+     * form is specified by the {@code Formattable}.
      *
-     * <p> This flag corresponds to <tt>'#'</tt> (<tt>'&#92;u0023'</tt>) in
+     * <p> This flag corresponds to {@code '#'} (<code>'&#92;u0023'</code>) in
      * the format specifier.
      */
     public static final int ALTERNATE = 1<<2;    // '#'
--- a/jdk/src/java.base/share/classes/java/util/Formatter.java	Thu Apr 09 12:29:31 2015 +0200
+++ b/jdk/src/java.base/share/classes/java/util/Formatter.java	Mon Aug 17 12:45:16 2015 +0300
@@ -267,7 +267,7 @@
  * {@link Date} and {@link TemporalAccessor TemporalAccessor}
  *
  * <li> <b>Percent</b> - produces a literal {@code '%'}
- * (<tt>'&#92;u0025'</tt>)
+ * (<code>'&#92;u0025'</code>)
  *
  * <li> <b>Line Separator</b> - produces the platform-specific line separator
  *
@@ -356,7 +356,7 @@
  *
  * <tr><td valign="top">{@code '%'}
  *     <td valign="top"> percent
- *     <td> The result is a literal {@code '%'} (<tt>'&#92;u0025'</tt>)
+ *     <td> The result is a literal {@code '%'} (<code>'&#92;u0025'</code>)
  *
  * <tr><td valign="top">{@code 'n'}
  *     <td valign="top"> line separator
@@ -644,7 +644,7 @@
  * "{@code 1$}", the second by "{@code 2$}", etc.
  *
  * <p> Another way to reference arguments by position is to use the
- * {@code '<'} (<tt>'&#92;u003c'</tt>) flag, which causes the argument for
+ * {@code '<'} (<code>'&#92;u003c'</code>) flag, which causes the argument for
  * the previous format specifier to be re-used.  For example, the following two
  * statements would produce identical strings:
  *
@@ -701,7 +701,7 @@
  * <table cellpadding=5 summary="dgConv">
  *
  * <tr><td valign="top"> {@code 'b'}
- *     <td valign="top"> <tt>'&#92;u0062'</tt>
+ *     <td valign="top"> <code>'&#92;u0062'</code>
  *     <td> Produces either "{@code true}" or "{@code false}" as returned by
  *     {@link Boolean#toString(boolean)}.
  *
@@ -715,11 +715,11 @@
  *     FormatFlagsConversionMismatchException} will be thrown.
  *
  * <tr><td valign="top"> {@code 'B'}
- *     <td valign="top"> <tt>'&#92;u0042'</tt>
+ *     <td valign="top"> <code>'&#92;u0042'</code>
  *     <td> The upper-case variant of {@code 'b'}.
  *
  * <tr><td valign="top"> {@code 'h'}
- *     <td valign="top"> <tt>'&#92;u0068'</tt>
+ *     <td valign="top"> <code>'&#92;u0068'</code>
  *     <td> Produces a string representing the hash code value of the object.
  *
  *     <p> If the argument, <i>arg</i> is {@code null}, then the
@@ -730,11 +730,11 @@
  *     FormatFlagsConversionMismatchException} will be thrown.
  *
  * <tr><td valign="top"> {@code 'H'}
- *     <td valign="top"> <tt>'&#92;u0048'</tt>
+ *     <td valign="top"> <code>'&#92;u0048'</code>
  *     <td> The upper-case variant of {@code 'h'}.
  *
  * <tr><td valign="top"> {@code 's'}
- *     <td valign="top"> <tt>'&#92;u0073'</tt>
+ *     <td valign="top"> <code>'&#92;u0073'</code>
  *     <td> Produces a string.
  *
  *     <p> If the argument is {@code null}, then the result is
@@ -748,7 +748,7 @@
  *     will be thrown.
  *
  * <tr><td valign="top"> {@code 'S'}
- *     <td valign="top"> <tt>'&#92;u0053'</tt>
+ *     <td valign="top"> <code>'&#92;u0053'</code>
  *     <td> The upper-case variant of {@code 's'}.
  *
  * </table>
@@ -758,15 +758,15 @@
  * <table cellpadding=5 summary="dFlags">
  *
  * <tr><td valign="top"> {@code '-'}
- *     <td valign="top"> <tt>'&#92;u002d'</tt>
- *     <td> Left justifies the output.  Spaces (<tt>'&#92;u0020'</tt>) will be
+ *     <td valign="top"> <code>'&#92;u002d'</code>
+ *     <td> Left justifies the output.  Spaces (<code>'&#92;u0020'</code>) will be
  *     added at the end of the converted value as required to fill the minimum
  *     width of the field.  If the width is not provided, then a {@link
  *     MissingFormatWidthException} will be thrown.  If this flag is not given
  *     then the output will be right-justified.
  *
  * <tr><td valign="top"> {@code '#'}
- *     <td valign="top"> <tt>'&#92;u0023'</tt>
+ *     <td valign="top"> <code>'&#92;u0023'</code>
  *     <td> Requires the output use an alternate form.  The definition of the
  *     form is specified by the conversion.
  *
@@ -775,7 +775,7 @@
  * <p> The <a name="genWidth">width</a> is the minimum number of characters to
  * be written to the
  * output.  If the length of the converted value is less than the width then
- * the output will be padded by <tt>'&nbsp;&nbsp;'</tt> (<tt>'&#92;u0020'</tt>)
+ * the output will be padded by <code>'&nbsp;&nbsp;'</code> (<code>'&#92;u0020'</code>)
  * until the total number of characters equals the width.  The padding is on
  * the left by default.  If the {@code '-'} flag is given, then the padding
  * will be on the right.  If the width is not specified then there is no
@@ -799,7 +799,7 @@
  * <table cellpadding=5 summary="charConv">
  *
  * <tr><td valign="top"> {@code 'c'}
- *     <td valign="top"> <tt>'&#92;u0063'</tt>
+ *     <td valign="top"> <code>'&#92;u0063'</code>
  *     <td> Formats the argument as a Unicode character as described in <a
  *     href="../lang/Character.html#unicode">Unicode Character
  *     Representation</a>.  This may be more than one 16-bit {@code char} in
@@ -809,7 +809,7 @@
  *     FormatFlagsConversionMismatchException} will be thrown.
  *
  * <tr><td valign="top"> {@code 'C'}
- *     <td valign="top"> <tt>'&#92;u0043'</tt>
+ *     <td valign="top"> <code>'&#92;u0043'</code>
  *     <td> The upper-case variant of {@code 'c'}.
  *
  * </table>
@@ -859,7 +859,7 @@
  * java.text.DecimalFormatSymbols#getDecimalSeparator decimal separator} is
  * substituted.
  *
- * <li> If the {@code ','} (<tt>'&#92;u002c'</tt>)
+ * <li> If the {@code ','} (<code>'&#92;u002c'</code>)
  * <a name="L10nGroup">flag</a> is given, then the locale-specific {@linkplain
  * java.text.DecimalFormatSymbols#getGroupingSeparator grouping separator} is
  * inserted by scanning the integer part of the string from least significant
@@ -873,15 +873,15 @@
  * the length of the string is equal to the requested field width.
  *
  * <li> If the value is negative and the {@code '('} flag is given, then a
- * {@code '('} (<tt>'&#92;u0028'</tt>) is prepended and a {@code ')'}
- * (<tt>'&#92;u0029'</tt>) is appended.
+ * {@code '('} (<code>'&#92;u0028'</code>) is prepended and a {@code ')'}
+ * (<code>'&#92;u0029'</code>) is appended.
  *
  * <li> If the value is negative (or floating-point negative zero) and
- * {@code '('} flag is not given, then a {@code '-'} (<tt>'&#92;u002d'</tt>)
+ * {@code '('} flag is not given, then a {@code '-'} (<code>'&#92;u002d'</code>)
  * is prepended.
  *
  * <li> If the {@code '+'} flag is given and the value is positive or zero (or
- * floating-point positive zero), then a {@code '+'} (<tt>'&#92;u002b'</tt>)
+ * floating-point positive zero), then a {@code '+'} (<code>'&#92;u002b'</code>)
  * will be prepended.
  *
  * </ol>
@@ -900,7 +900,7 @@
  * <table cellpadding=5 summary="IntConv">
  *
  * <tr><td valign="top"> {@code 'd'}
- *     <td valign="top"> <tt>'&#92;u0064'</tt>
+ *     <td valign="top"> <code>'&#92;u0064'</code>
  *     <td> Formats the argument as a decimal integer. The <a
  *     href="#L10nAlgorithm">localization algorithm</a> is applied.
  *
@@ -911,7 +911,7 @@
  *     FormatFlagsConversionMismatchException} will be thrown.
  *
  * <tr><td valign="top"> {@code 'o'}
- *     <td valign="top"> <tt>'&#92;u006f'</tt>
+ *     <td valign="top"> <code>'&#92;u006f'</code>
  *     <td> Formats the argument as an integer in base eight.  No localization
  *     is applied.
  *
@@ -933,7 +933,7 @@
  *     thrown.
  *
  * <tr><td valign="top"> {@code 'x'}
- *     <td valign="top"> <tt>'&#92;u0078'</tt>
+ *     <td valign="top"> <code>'&#92;u0078'</code>
  *     <td> Formats the argument as an integer in base sixteen. No
  *     localization is applied.
  *
@@ -951,17 +951,17 @@
  *     the field width with leading zeros after the radix indicator or sign (if
  *     present).
  *
- *     <p> If {@code '('}, <tt>'&nbsp;&nbsp;'</tt>, {@code '+'}, or
+ *     <p> If {@code '('}, <code>'&nbsp;&nbsp;'</code>, {@code '+'}, or
  *     {@code ','} flags are given then a {@link
  *     FormatFlagsConversionMismatchException} will be thrown.
  *
  * <tr><td valign="top"> {@code 'X'}
- *     <td valign="top"> <tt>'&#92;u0058'</tt>
+ *     <td valign="top"> <code>'&#92;u0058'</code>
  *     <td> The upper-case variant of {@code 'x'}.  The entire string
  *     representing the number will be converted to {@linkplain
  *     String#toUpperCase upper case} including the {@code 'x'} (if any) and
  *     all hexadecimal digits {@code 'a'} - {@code 'f'}
- *     (<tt>'&#92;u0061'</tt> -  <tt>'&#92;u0066'</tt>).
+ *     (<code>'&#92;u0061'</code> -  <code>'&#92;u0066'</code>).
  *
  * </table>
  *
@@ -980,24 +980,24 @@
  * <table cellpadding=5 summary="intFlags">
  *
  * <tr><td valign="top"> {@code '+'}
- *     <td valign="top"> <tt>'&#92;u002b'</tt>
+ *     <td valign="top"> <code>'&#92;u002b'</code>
  *     <td> Requires the output to include a positive sign for all positive
  *     numbers.  If this flag is not given then only negative values will
  *     include a sign.
  *
- *     <p> If both the {@code '+'} and <tt>'&nbsp;&nbsp;'</tt> flags are given
+ *     <p> If both the {@code '+'} and <code>'&nbsp;&nbsp;'</code> flags are given
  *     then an {@link IllegalFormatFlagsException} will be thrown.
  *
- * <tr><td valign="top"> <tt>'&nbsp;&nbsp;'</tt>
- *     <td valign="top"> <tt>'&#92;u0020'</tt>
+ * <tr><td valign="top"> <code>'&nbsp;&nbsp;'</code>
+ *     <td valign="top"> <code>'&#92;u0020'</code>
  *     <td> Requires the output to include a single extra space
- *     (<tt>'&#92;u0020'</tt>) for non-negative values.
- *
- *     <p> If both the {@code '+'} and <tt>'&nbsp;&nbsp;'</tt> flags are given
+ *     (<code>'&#92;u0020'</code>) for non-negative values.
+ *
+ *     <p> If both the {@code '+'} and <code>'&nbsp;&nbsp;'</code> flags are given
  *     then an {@link IllegalFormatFlagsException} will be thrown.
  *
  * <tr><td valign="top"> {@code '0'}
- *     <td valign="top"> <tt>'&#92;u0030'</tt>
+ *     <td valign="top"> <code>'&#92;u0030'</code>
  *     <td> Requires the output to be padded with leading {@linkplain
  *     java.text.DecimalFormatSymbols#getZeroDigit zeros} to the minimum field
  *     width following any sign or radix indicator except when converting NaN
@@ -1008,17 +1008,17 @@
  *     {@link IllegalFormatFlagsException} will be thrown.
  *
  * <tr><td valign="top"> {@code ','}
- *     <td valign="top"> <tt>'&#92;u002c'</tt>
+ *     <td valign="top"> <code>'&#92;u002c'</code>
  *     <td> Requires the output to include the locale-specific {@linkplain
  *     java.text.DecimalFormatSymbols#getGroupingSeparator group separators} as
  *     described in the <a href="#L10nGroup">"group" section</a> of the
  *     localization algorithm.
  *
  * <tr><td valign="top"> {@code '('}
- *     <td valign="top"> <tt>'&#92;u0028'</tt>
+ *     <td valign="top"> <code>'&#92;u0028'</code>
  *     <td> Requires the output to prepend a {@code '('}
- *     (<tt>'&#92;u0028'</tt>) and append a {@code ')'}
- *     (<tt>'&#92;u0029'</tt>) to negative values.
+ *     (<code>'&#92;u0028'</code>) and append a {@code ')'}
+ *     (<code>'&#92;u0029'</code>) to negative values.
  *
  * </table>
  *
@@ -1029,7 +1029,7 @@
  *
  * <li> The output is right-justified within the {@code width}
  *
- * <li> Negative numbers begin with a {@code '-'} (<tt>'&#92;u002d'</tt>)
+ * <li> Negative numbers begin with a {@code '-'} (<code>'&#92;u002d'</code>)
  *
  * <li> Positive numbers and zero do not include a sign or extra leading
  * space
@@ -1042,7 +1042,7 @@
  * be written to the output.  This includes any signs, digits, grouping
  * separators, radix indicator, and parentheses.  If the length of the
  * converted value is less than the width then the output will be padded by
- * spaces (<tt>'&#92;u0020'</tt>) until the total number of characters equals
+ * spaces (<code>'&#92;u0020'</code>) until the total number of characters equals
  * width.  The padding is on the left by default.  If {@code '-'} flag is
  * given then the padding will be on the right.  If width is not specified then
  * there is no minimum.
@@ -1058,7 +1058,7 @@
  * <table cellpadding=5 summary="BIntConv">
  *
  * <tr><td valign="top"> {@code 'd'}
- *     <td valign="top"> <tt>'&#92;u0064'</tt>
+ *     <td valign="top"> <code>'&#92;u0064'</code>
  *     <td> Requires the output to be formatted as a decimal integer. The <a
  *     href="#L10nAlgorithm">localization algorithm</a> is applied.
  *
@@ -1066,18 +1066,18 @@
  *     FormatFlagsConversionMismatchException} will be thrown.
  *
  * <tr><td valign="top"> {@code 'o'}
- *     <td valign="top"> <tt>'&#92;u006f'</tt>
+ *     <td valign="top"> <code>'&#92;u006f'</code>
  *     <td> Requires the output to be formatted as an integer in base eight.
  *     No localization is applied.
  *
  *     <p> If <i>x</i> is negative then the result will be a signed value
- *     beginning with {@code '-'} (<tt>'&#92;u002d'</tt>).  Signed output is
+ *     beginning with {@code '-'} (<code>'&#92;u002d'</code>).  Signed output is
  *     allowed for this type because unlike the primitive types it is not
  *     possible to create an unsigned equivalent without assuming an explicit
  *     data-type size.
  *
  *     <p> If <i>x</i> is positive or zero and the {@code '+'} flag is given
- *     then the result will begin with {@code '+'} (<tt>'&#92;u002b'</tt>).
+ *     then the result will begin with {@code '+'} (<code>'&#92;u002b'</code>).
  *
  *     <p> If the {@code '#'} flag is given then the output will always begin
  *     with {@code '0'} prefix.
@@ -1089,18 +1089,18 @@
  *     FormatFlagsConversionMismatchException} will be thrown.
  *
  * <tr><td valign="top"> {@code 'x'}
- *     <td valign="top"> <tt>'&#92;u0078'</tt>
+ *     <td valign="top"> <code>'&#92;u0078'</code>
  *     <td> Requires the output to be formatted as an integer in base
  *     sixteen.  No localization is applied.
  *
  *     <p> If <i>x</i> is negative then the result will be a signed value
- *     beginning with {@code '-'} (<tt>'&#92;u002d'</tt>).  Signed output is
+ *     beginning with {@code '-'} (<code>'&#92;u002d'</code>).  Signed output is
  *     allowed for this type because unlike the primitive types it is not
  *     possible to create an unsigned equivalent without assuming an explicit
  *     data-type size.
  *
  *     <p> If <i>x</i> is positive or zero and the {@code '+'} flag is given
- *     then the result will begin with {@code '+'} (<tt>'&#92;u002b'</tt>).
+ *     then the result will begin with {@code '+'} (<code>'&#92;u002b'</code>).
  *
  *     <p> If the {@code '#'} flag is given then the output will always begin
  *     with the radix indicator {@code "0x"}.
@@ -1113,12 +1113,12 @@
  *     FormatFlagsConversionMismatchException} will be thrown.
  *
  * <tr><td valign="top"> {@code 'X'}
- *     <td valign="top"> <tt>'&#92;u0058'</tt>
+ *     <td valign="top"> <code>'&#92;u0058'</code>
  *     <td> The upper-case variant of {@code 'x'}.  The entire string
  *     representing the number will be converted to {@linkplain
  *     String#toUpperCase upper case} including the {@code 'x'} (if any) and
  *     all hexadecimal digits {@code 'a'} - {@code 'f'}
- *     (<tt>'&#92;u0061'</tt> - <tt>'&#92;u0066'</tt>).
+ *     (<code>'&#92;u0061'</code> - <code>'&#92;u0066'</code>).
  *
  * </table>
  *
@@ -1152,7 +1152,7 @@
  * <table cellpadding=5 summary="floatConv">
  *
  * <tr><td valign="top"> {@code 'e'}
- *     <td valign="top"> <tt>'&#92;u0065'</tt>
+ *     <td valign="top"> <code>'&#92;u0065'</code>
  *     <td> Requires the output to be formatted using <a
  *     name="scientific">computerized scientific notation</a>.  The <a
  *     href="#L10nAlgorithm">localization algorithm</a> is applied.
@@ -1179,7 +1179,7 @@
  *     integer part of <i>a</i>, as a single decimal digit, followed by the
  *     decimal separator followed by decimal digits representing the fractional
  *     part of <i>a</i>, followed by the exponent symbol {@code 'e'}
- *     (<tt>'&#92;u0065'</tt>), followed by the sign of the exponent, followed
+ *     (<code>'&#92;u0065'</code>), followed by the sign of the exponent, followed
  *     by a representation of <i>n</i> as a decimal integer, as produced by the
  *     method {@link Long#toString(long, int)}, and zero-padded to include at
  *     least two digits.
@@ -1200,12 +1200,12 @@
  *     FormatFlagsConversionMismatchException} will be thrown.
  *
  * <tr><td valign="top"> {@code 'E'}
- *     <td valign="top"> <tt>'&#92;u0045'</tt>
+ *     <td valign="top"> <code>'&#92;u0045'</code>
  *     <td> The upper-case variant of {@code 'e'}.  The exponent symbol
- *     will be {@code 'E'} (<tt>'&#92;u0045'</tt>).
+ *     will be {@code 'E'} (<code>'&#92;u0045'</code>).
  *
  * <tr><td valign="top"> {@code 'g'}
- *     <td valign="top"> <tt>'&#92;u0067'</tt>
+ *     <td valign="top"> <code>'&#92;u0067'</code>
  *     <td> Requires the output to be formatted in general scientific notation
  *     as described below. The <a href="#L10nAlgorithm">localization
  *     algorithm</a> is applied.
@@ -1230,11 +1230,11 @@
  *     FormatFlagsConversionMismatchException} will be thrown.
  *
  * <tr><td valign="top"> {@code 'G'}
- *     <td valign="top"> <tt>'&#92;u0047'</tt>
+ *     <td valign="top"> <code>'&#92;u0047'</code>
  *     <td> The upper-case variant of {@code 'g'}.
  *
  * <tr><td valign="top"> {@code 'f'}
- *     <td valign="top"> <tt>'&#92;u0066'</tt>
+ *     <td valign="top"> <code>'&#92;u0066'</code>
  *     <td> Requires the output to be formatted using <a name="decimal">decimal
  *     format</a>.  The <a href="#L10nAlgorithm">localization algorithm</a> is
  *     applied.
@@ -1266,7 +1266,7 @@
  *     appropriate.
  *
  * <tr><td valign="top"> {@code 'a'}
- *     <td valign="top"> <tt>'&#92;u0061'</tt>
+ *     <td valign="top"> <code>'&#92;u0061'</code>
  *     <td> Requires the output to be formatted in hexadecimal exponential
  *     form.  No localization is applied.
  *
@@ -1274,11 +1274,11 @@
  *     (absolute value) of the argument <i>x</i>.
  *
  *     <p> If <i>x</i> is negative or a negative-zero value then the result
- *     will begin with {@code '-'} (<tt>'&#92;u002d'</tt>).
+ *     will begin with {@code '-'} (<code>'&#92;u002d'</code>).
  *
  *     <p> If <i>x</i> is positive or a positive-zero value and the
  *     {@code '+'} flag is given then the result will begin with {@code '+'}
- *     (<tt>'&#92;u002b'</tt>).
+ *     (<code>'&#92;u002b'</code>).
  *
  *     <p> The formatting of the magnitude <i>m</i> depends upon its value.
  *
@@ -1295,7 +1295,7 @@
  *     exponent fields.  The significand is represented by the characters
  *     {@code "0x1."} followed by the hexadecimal representation of the rest
  *     of the significand as a fraction.  The exponent is represented by
- *     {@code 'p'} (<tt>'&#92;u0070'</tt>) followed by a decimal string of the
+ *     {@code 'p'} (<code>'&#92;u0070'</code>) followed by a decimal string of the
  *     unbiased exponent as if produced by invoking {@link
  *     Integer#toString(int) Integer.toString} on the exponent value.  If the
  *     precision is specified, the value is rounded to the given number of
@@ -1319,12 +1319,12 @@
  *     FormatFlagsConversionMismatchException} will be thrown.
  *
  * <tr><td valign="top"> {@code 'A'}
- *     <td valign="top"> <tt>'&#92;u0041'</tt>
+ *     <td valign="top"> <code>'&#92;u0041'</code>
  *     <td> The upper-case variant of {@code 'a'}.  The entire string
  *     representing the number will be converted to upper case including the
- *     {@code 'x'} (<tt>'&#92;u0078'</tt>) and {@code 'p'}
- *     (<tt>'&#92;u0070'</tt> and all hexadecimal digits {@code 'a'} -
- *     {@code 'f'} (<tt>'&#92;u0061'</tt> - <tt>'&#92;u0066'</tt>).
+ *     {@code 'x'} (<code>'&#92;u0078'</code>) and {@code 'p'}
+ *     (<code>'&#92;u0070'</code> and all hexadecimal digits {@code 'a'} -
+ *     {@code 'f'} (<code>'&#92;u0061'</code> - <code>'&#92;u0066'</code>).
  *
  * </table>
  *
@@ -1357,7 +1357,7 @@
  * separators, decimal separators, exponential symbol, radix indicator,
  * parentheses, and strings representing infinity and NaN as applicable.  If
  * the length of the converted value is less than the width then the output
- * will be padded by spaces (<tt>'&#92;u0020'</tt>) until the total number of
+ * will be padded by spaces (<code>'&#92;u0020'</code>) until the total number of
  * characters equals width.  The padding is on the left by default.  If the
  * {@code '-'} flag is given then the padding will be on the right.  If width
  * is not specified then there is no minimum.
@@ -1386,7 +1386,7 @@
  * <table cellpadding=5 summary="floatConv">
  *
  * <tr><td valign="top"> {@code 'e'}
- *     <td valign="top"> <tt>'&#92;u0065'</tt>
+ *     <td valign="top"> <code>'&#92;u0065'</code>
  *     <td> Requires the output to be formatted using <a
  *     name="bscientific">computerized scientific notation</a>.  The <a
  *     href="#L10nAlgorithm">localization algorithm</a> is applied.
@@ -1409,7 +1409,7 @@
  *     integer part of <i>a</i>, as a single decimal digit, followed by the
  *     decimal separator followed by decimal digits representing the fractional
  *     part of <i>a</i>, followed by the exponent symbol {@code 'e'}
- *     (<tt>'&#92;u0065'</tt>), followed by the sign of the exponent, followed
+ *     (<code>'&#92;u0065'</code>), followed by the sign of the exponent, followed
  *     by a representation of <i>n</i> as a decimal integer, as produced by the
  *     method {@link Long#toString(long, int)}, and zero-padded to include at
  *     least two digits.
@@ -1428,12 +1428,12 @@
  *     FormatFlagsConversionMismatchException} will be thrown.
  *
  * <tr><td valign="top"> {@code 'E'}
- *     <td valign="top"> <tt>'&#92;u0045'</tt>
+ *     <td valign="top"> <code>'&#92;u0045'</code>
  *     <td> The upper-case variant of {@code 'e'}.  The exponent symbol
- *     will be {@code 'E'} (<tt>'&#92;u0045'</tt>).
+ *     will be {@code 'E'} (<code>'&#92;u0045'</code>).
  *
  * <tr><td valign="top"> {@code 'g'}
- *     <td valign="top"> <tt>'&#92;u0067'</tt>
+ *     <td valign="top"> <code>'&#92;u0067'</code>
  *     <td> Requires the output to be formatted in general scientific notation
  *     as described below. The <a href="#L10nAlgorithm">localization
  *     algorithm</a> is applied.
@@ -1458,11 +1458,11 @@
  *     FormatFlagsConversionMismatchException} will be thrown.
  *
  * <tr><td valign="top"> {@code 'G'}
- *     <td valign="top"> <tt>'&#92;u0047'</tt>
+ *     <td valign="top"> <code>'&#92;u0047'</code>
  *     <td> The upper-case variant of {@code 'g'}.
  *
  * <tr><td valign="top"> {@code 'f'}
- *     <td valign="top"> <tt>'&#92;u0066'</tt>
+ *     <td valign="top"> <code>'&#92;u0066'</code>
  *     <td> Requires the output to be formatted using <a name="bdecimal">decimal
  *     format</a>.  The <a href="#L10nAlgorithm">localization algorithm</a> is
  *     applied.
@@ -1510,10 +1510,10 @@
  * <table cellpadding=5 summary="DTConv">
  *
  * <tr><td valign="top"> {@code 't'}
- *     <td valign="top"> <tt>'&#92;u0074'</tt>
+ *     <td valign="top"> <code>'&#92;u0074'</code>
  *     <td> Prefix for date and time conversion characters.
  * <tr><td valign="top"> {@code 'T'}
- *     <td valign="top"> <tt>'&#92;u0054'</tt>
+ *     <td valign="top"> <code>'&#92;u0054'</code>
  *     <td> The upper-case variant of {@code 't'}.
  *
  * </table>
@@ -1530,52 +1530,52 @@
  * <table cellpadding=5 summary="time">
  *
  * <tr><td valign="top"> {@code 'H'}
- *     <td valign="top"> <tt>'&#92;u0048'</tt>
+ *     <td valign="top"> <code>'&#92;u0048'</code>
  *     <td> Hour of the day for the 24-hour clock, formatted as two digits with
  *     a leading zero as necessary i.e. {@code 00 - 23}. {@code 00}
  *     corresponds to midnight.
  *
  * <tr><td valign="top">{@code 'I'}
- *     <td valign="top"> <tt>'&#92;u0049'</tt>
+ *     <td valign="top"> <code>'&#92;u0049'</code>
  *     <td> Hour for the 12-hour clock, formatted as two digits with a leading
  *     zero as necessary, i.e.  {@code 01 - 12}.  {@code 01} corresponds to
  *     one o'clock (either morning or afternoon).
  *
  * <tr><td valign="top">{@code 'k'}
- *     <td valign="top"> <tt>'&#92;u006b'</tt>
+ *     <td valign="top"> <code>'&#92;u006b'</code>
  *     <td> Hour of the day for the 24-hour clock, i.e. {@code 0 - 23}.
  *     {@code 0} corresponds to midnight.
  *
  * <tr><td valign="top">{@code 'l'}
- *     <td valign="top"> <tt>'&#92;u006c'</tt>
+ *     <td valign="top"> <code>'&#92;u006c'</code>
  *     <td> Hour for the 12-hour clock, i.e. {@code 1 - 12}.  {@code 1}
  *     corresponds to one o'clock (either morning or afternoon).
  *
  * <tr><td valign="top">{@code 'M'}
- *     <td valign="top"> <tt>'&#92;u004d'</tt>
+ *     <td valign="top"> <code>'&#92;u004d'</code>
  *     <td> Minute within the hour formatted as two digits with a leading zero
  *     as necessary, i.e.  {@code 00 - 59}.
  *
  * <tr><td valign="top">{@code 'S'}
- *     <td valign="top"> <tt>'&#92;u0053'</tt>
+ *     <td valign="top"> <code>'&#92;u0053'</code>
  *     <td> Seconds within the minute, formatted as two digits with a leading
  *     zero as necessary, i.e. {@code 00 - 60} ("{@code 60}" is a special
  *     value required to support leap seconds).
  *
  * <tr><td valign="top">{@code 'L'}
- *     <td valign="top"> <tt>'&#92;u004c'</tt>
+ *     <td valign="top"> <code>'&#92;u004c'</code>
  *     <td> Millisecond within the second formatted as three digits with
  *     leading zeros as necessary, i.e. {@code 000 - 999}.
  *
  * <tr><td valign="top">{@code 'N'}
- *     <td valign="top"> <tt>'&#92;u004e'</tt>
+ *     <td valign="top"> <code>'&#92;u004e'</code>
  *     <td> Nanosecond within the second, formatted as nine digits with leading
  *     zeros as necessary, i.e. {@code 000000000 - 999999999}.  The precision
  *     of this value is limited by the resolution of the underlying operating
  *     system or hardware.
  *
  * <tr><td valign="top">{@code 'p'}
- *     <td valign="top"> <tt>'&#92;u0070'</tt>
+ *     <td valign="top"> <code>'&#92;u0070'</code>
  *     <td> Locale-specific {@linkplain
  *     java.text.DateFormatSymbols#getAmPmStrings morning or afternoon} marker
  *     in lower case, e.g."{@code am}" or "{@code pm}".  Use of the
@@ -1585,7 +1585,7 @@
  *     upper-case output.)
  *
  * <tr><td valign="top">{@code 'z'}
- *     <td valign="top"> <tt>'&#92;u007a'</tt>
+ *     <td valign="top"> <code>'&#92;u007a'</code>
  *     <td> <a href="http://www.ietf.org/rfc/rfc0822.txt">RFC&nbsp;822</a>
  *     style numeric time zone offset from GMT, e.g. {@code -0800}.  This
  *     value will be adjusted as necessary for Daylight Saving Time.  For
@@ -1594,7 +1594,7 @@
  *     instance of the Java virtual machine.
  *
  * <tr><td valign="top">{@code 'Z'}
- *     <td valign="top"> <tt>'&#92;u005a'</tt>
+ *     <td valign="top"> <code>'&#92;u005a'</code>
  *     <td> A string representing the abbreviation for the time zone.  This
  *     value will be adjusted as necessary for Daylight Saving Time.  For
  *     {@code long}, {@link Long}, and {@link Date} the time zone used is
@@ -1603,13 +1603,13 @@
  *     supersede the locale of the argument (if any).
  *
  * <tr><td valign="top">{@code 's'}
- *     <td valign="top"> <tt>'&#92;u0073'</tt>
+ *     <td valign="top"> <code>'&#92;u0073'</code>
  *     <td> Seconds since the beginning of the epoch starting at 1 January 1970
  *     {@code 00:00:00} UTC, i.e. {@code Long.MIN_VALUE/1000} to
  *     {@code Long.MAX_VALUE/1000}.
  *
  * <tr><td valign="top">{@code 'Q'}
- *     <td valign="top"> <tt>'&#92;u004f'</tt>
+ *     <td valign="top"> <code>'&#92;u004f'</code>
  *     <td> Milliseconds since the beginning of the epoch starting at 1 January
  *     1970 {@code 00:00:00} UTC, i.e. {@code Long.MIN_VALUE} to
  *     {@code Long.MAX_VALUE}. The precision of this value is limited by
@@ -1622,68 +1622,68 @@
  * <table cellpadding=5 summary="date">
  *
  * <tr><td valign="top">{@code 'B'}
- *     <td valign="top"> <tt>'&#92;u0042'</tt>
+ *     <td valign="top"> <code>'&#92;u0042'</code>
  *     <td> Locale-specific {@linkplain java.text.DateFormatSymbols#getMonths
  *     full month name}, e.g. {@code "January"}, {@code "February"}.
  *
  * <tr><td valign="top">{@code 'b'}
- *     <td valign="top"> <tt>'&#92;u0062'</tt>
+ *     <td valign="top"> <code>'&#92;u0062'</code>
  *     <td> Locale-specific {@linkplain
  *     java.text.DateFormatSymbols#getShortMonths abbreviated month name},
  *     e.g. {@code "Jan"}, {@code "Feb"}.
  *
  * <tr><td valign="top">{@code 'h'}
- *     <td valign="top"> <tt>'&#92;u0068'</tt>
+ *     <td valign="top"> <code>'&#92;u0068'</code>
  *     <td> Same as {@code 'b'}.
  *
  * <tr><td valign="top">{@code 'A'}
- *     <td valign="top"> <tt>'&#92;u0041'</tt>
+ *     <td valign="top"> <code>'&#92;u0041'</code>
  *     <td> Locale-specific full name of the {@linkplain
  *     java.text.DateFormatSymbols#getWeekdays day of the week},
  *     e.g. {@code "Sunday"}, {@code "Monday"}
  *
  * <tr><td valign="top">{@code 'a'}
- *     <td valign="top"> <tt>'&#92;u0061'</tt>
+ *     <td valign="top"> <code>'&#92;u0061'</code>
  *     <td> Locale-specific short name of the {@linkplain
  *     java.text.DateFormatSymbols#getShortWeekdays day of the week},
  *     e.g. {@code "Sun"}, {@code "Mon"}
  *
  * <tr><td valign="top">{@code 'C'}
- *     <td valign="top"> <tt>'&#92;u0043'</tt>
+ *     <td valign="top"> <code>'&#92;u0043'</code>
  *     <td> Four-digit year divided by {@code 100}, formatted as two digits
  *     with leading zero as necessary, i.e. {@code 00 - 99}
  *
  * <tr><td valign="top">{@code 'Y'}
- *     <td valign="top"> <tt>'&#92;u0059'</tt> <td> Year, formatted to at least
+ *     <td valign="top"> <code>'&#92;u0059'</code> <td> Year, formatted to at least
  *     four digits with leading zeros as necessary, e.g. {@code 0092} equals
  *     {@code 92} CE for the Gregorian calendar.
  *
  * <tr><td valign="top">{@code 'y'}
- *     <td valign="top"> <tt>'&#92;u0079'</tt>
+ *     <td valign="top"> <code>'&#92;u0079'</code>
  *     <td> Last two digits of the year, formatted with leading zeros as
  *     necessary, i.e. {@code 00 - 99}.
  *
  * <tr><td valign="top">{@code 'j'}
- *     <td valign="top"> <tt>'&#92;u006a'</tt>
+ *     <td valign="top"> <code>'&#92;u006a'</code>
  *     <td> Day of year, formatted as three digits with leading zeros as
  *     necessary, e.g. {@code 001 - 366} for the Gregorian calendar.
  *     {@code 001} corresponds to the first day of the year.
  *
  * <tr><td valign="top">{@code 'm'}
- *     <td valign="top"> <tt>'&#92;u006d'</tt>
+ *     <td valign="top"> <code>'&#92;u006d'</code>
  *     <td> Month, formatted as two digits with leading zeros as necessary,
  *     i.e. {@code 01 - 13}, where "{@code 01}" is the first month of the
  *     year and ("{@code 13}" is a special value required to support lunar
  *     calendars).
  *
  * <tr><td valign="top">{@code 'd'}
- *     <td valign="top"> <tt>'&#92;u0064'</tt>
+ *     <td valign="top"> <code>'&#92;u0064'</code>
  *     <td> Day of month, formatted as two digits with leading zeros as
  *     necessary, i.e. {@code 01 - 31}, where "{@code 01}" is the first day
  *     of the month.
  *
  * <tr><td valign="top">{@code 'e'}
- *     <td valign="top"> <tt>'&#92;u0065'</tt>
+ *     <td valign="top"> <code>'&#92;u0065'</code>
  *     <td> Day of month, formatted as two digits, i.e. {@code 1 - 31} where
  *     "{@code 1}" is the first day of the month.
  *
@@ -1695,30 +1695,30 @@
  * <table cellpadding=5 summary="composites">
  *
  * <tr><td valign="top">{@code 'R'}
- *     <td valign="top"> <tt>'&#92;u0052'</tt>
+ *     <td valign="top"> <code>'&#92;u0052'</code>
  *     <td> Time formatted for the 24-hour clock as {@code "%tH:%tM"}
  *
  * <tr><td valign="top">{@code 'T'}
- *     <td valign="top"> <tt>'&#92;u0054'</tt>
+ *     <td valign="top"> <code>'&#92;u0054'</code>
  *     <td> Time formatted for the 24-hour clock as {@code "%tH:%tM:%tS"}.
  *
  * <tr><td valign="top">{@code 'r'}
- *     <td valign="top"> <tt>'&#92;u0072'</tt>
+ *     <td valign="top"> <code>'&#92;u0072'</code>
  *     <td> Time formatted for the 12-hour clock as {@code "%tI:%tM:%tS
  *     %Tp"}.  The location of the morning or afternoon marker
  *     ({@code '%Tp'}) may be locale-dependent.
  *
  * <tr><td valign="top">{@code 'D'}
- *     <td valign="top"> <tt>'&#92;u0044'</tt>
+ *     <td valign="top"> <code>'&#92;u0044'</code>
  *     <td> Date formatted as {@code "%tm/%td/%ty"}.
  *
  * <tr><td valign="top">{@code 'F'}
- *     <td valign="top"> <tt>'&#92;u0046'</tt>
+ *     <td valign="top"> <code>'&#92;u0046'</code>
  *     <td> <a href="http://www.w3.org/TR/NOTE-datetime">ISO&nbsp;8601</a>
  *     complete date formatted as {@code "%tY-%tm-%td"}.
  *
  * <tr><td valign="top">{@code 'c'}
- *     <td valign="top"> <tt>'&#92;u0063'</tt>
+ *     <td valign="top"> <code>'&#92;u0063'</code>
  *     <td> Date and time formatted as {@code "%ta %tb %td %tT %tZ %tY"},
  *     e.g. {@code "Sun Jul 20 16:17:00 EDT 1969"}.
  *
@@ -1731,7 +1731,7 @@
  * <p> The width is the minimum number of characters to
  * be written to the output.  If the length of the converted value is less than
  * the {@code width} then the output will be padded by spaces
- * (<tt>'&#92;u0020'</tt>) until the total number of characters equals width.
+ * (<code>'&#92;u0020'</code>) until the total number of characters equals width.
  * The padding is on the left by default.  If the {@code '-'} flag is given
  * then the padding will be on the right.  If width is not specified then there
  * is no minimum.
@@ -1746,12 +1746,12 @@
  * <table cellpadding=5 summary="DTConv">
  *
  * <tr><td valign="top">{@code '%'}
- *     <td> The result is a literal {@code '%'} (<tt>'&#92;u0025'</tt>)
+ *     <td> The result is a literal {@code '%'} (<code>'&#92;u0025'</code>)
  *
  * <p> The width is the minimum number of characters to
  * be written to the output including the {@code '%'}.  If the length of the
  * converted value is less than the {@code width} then the output will be
- * padded by spaces (<tt>'&#92;u0020'</tt>) until the total number of
+ * padded by spaces (<code>'&#92;u0020'</code>) until the total number of
  * characters equals width.  The padding is on the left.  If width is not
  * specified then just the {@code '%'} is output.
  *
@@ -1772,7 +1772,7 @@
  *
  * <tr><td valign="top">{@code 'n'}
  *     <td> the platform-specific line separator as returned by {@link
- *     System#getProperty System.getProperty("line.separator")}.
+ *     System#lineSeparator()}.
  *
  * </table>
  *
@@ -1801,7 +1801,7 @@
  * </pre></blockquote>
  *
  * <li> <i>Relative indexing</i> is used when the format specifier contains a
- * {@code '<'} (<tt>'&#92;u003c'</tt>) flag which causes the argument for
+ * {@code '<'} (<code>'&#92;u003c'</code>) flag which causes the argument for
  * the previous format specifier to be re-used.  If there is no previous
  * argument, then a {@link MissingFormatArgumentException} is thrown.
  *
--- a/jdk/src/java.base/share/classes/java/util/FormatterClosedException.java	Thu Apr 09 12:29:31 2015 +0200
+++ b/jdk/src/java.base/share/classes/java/util/FormatterClosedException.java	Mon Aug 17 12:45:16 2015 +0300
@@ -28,7 +28,7 @@
 /**
  * Unchecked exception thrown when the formatter has been closed.
  *
- * <p> Unless otherwise specified, passing a <tt>null</tt> argument to any
+ * <p> Unless otherwise specified, passing a {@code null} argument to any
  * method or constructor in this class will cause a {@link
  * NullPointerException} to be thrown.
  *
--- a/jdk/src/java.base/share/classes/java/util/HashMap.java	Thu Apr 09 12:29:31 2015 +0200
+++ b/jdk/src/java.base/share/classes/java/util/HashMap.java	Mon Aug 17 12:45:16 2015 +0300
@@ -36,24 +36,24 @@
 import java.util.function.Function;
 
 /**
- * Hash table based implementation of the <tt>Map</tt> interface.  This
+ * Hash table based implementation of the {@code Map} interface.  This
  * implementation provides all of the optional map operations, and permits
- * <tt>null</tt> values and the <tt>null</tt> key.  (The <tt>HashMap</tt>
- * class is roughly equivalent to <tt>Hashtable</tt>, except that it is
+ * {@code null} values and the {@code null} key.  (The {@code HashMap}
+ * class is roughly equivalent to {@code Hashtable}, except that it is
  * unsynchronized and permits nulls.)  This class makes no guarantees as to
  * the order of the map; in particular, it does not guarantee that the order
  * will remain constant over time.
  *
  * <p>This implementation provides constant-time performance for the basic
- * operations (<tt>get</tt> and <tt>put</tt>), assuming the hash function
+ * operations ({@code get} and {@code put}), assuming the hash function
  * disperses the elements properly among the buckets.  Iteration over
  * collection views requires time proportional to the "capacity" of the
- * <tt>HashMap</tt> instance (the number of buckets) plus its size (the number
+ * {@code HashMap} instance (the number of buckets) plus its size (the number
  * of key-value mappings).  Thus, it's very important not to set the initial
  * capacity too high (or the load factor too low) if iteration performance is
  * important.
  *
- * <p>An instance of <tt>HashMap</tt> has two parameters that affect its
+ * <p>An instance of {@code HashMap} has two parameters that affect its
  * performance: <i>initial capacity</i> and <i>load factor</i>.  The
  * <i>capacity</i> is the number of buckets in the hash table, and the initial
  * capacity is simply the capacity at the time the hash table is created.  The
@@ -67,15 +67,15 @@
  * <p>As a general rule, the default load factor (.75) offers a good
  * tradeoff between time and space costs.  Higher values decrease the
  * space overhead but increase the lookup cost (reflected in most of
- * the operations of the <tt>HashMap</tt> class, including
- * <tt>get</tt> and <tt>put</tt>).  The expected number of entries in
+ * the operations of the {@code HashMap} class, including
+ * {@code get} and {@code put}).  The expected number of entries in
  * the map and its load factor should be taken into account when
  * setting its initial capacity, so as to minimize the number of
  * rehash operations.  If the initial capacity is greater than the
  * maximum number of entries divided by the load factor, no rehash
  * operations will ever occur.
  *
- * <p>If many mappings are to be stored in a <tt>HashMap</tt>
+ * <p>If many mappings are to be stored in a {@code HashMap}
  * instance, creating it with a sufficiently large capacity will allow
  * the mappings to be stored more efficiently than letting it perform
  * automatic rehashing as needed to grow the table.  Note that using
@@ -102,7 +102,7 @@
  * <p>The iterators returned by all of this class's "collection view methods"
  * are <i>fail-fast</i>: if the map is structurally modified at any time after
  * the iterator is created, in any way except through the iterator's own
- * <tt>remove</tt> method, the iterator will throw a
+ * {@code remove} method, the iterator will throw a
  * {@link ConcurrentModificationException}.  Thus, in the face of concurrent
  * modification, the iterator fails quickly and cleanly, rather than risking
  * arbitrary, non-deterministic behavior at an undetermined time in the
@@ -111,7 +111,7 @@
  * <p>Note that the fail-fast behavior of an iterator cannot be guaranteed
  * as it is, generally speaking, impossible to make any hard guarantees in the
  * presence of unsynchronized concurrent modification.  Fail-fast iterators
- * throw <tt>ConcurrentModificationException</tt> on a best-effort basis.
+ * throw {@code ConcurrentModificationException} on a best-effort basis.
  * Therefore, it would be wrong to write a program that depended on this
  * exception for its correctness: <i>the fail-fast behavior of iterators
  * should be used only to detect bugs.</i>
@@ -435,7 +435,7 @@
     /* ---------------- Public operations -------------- */
 
     /**
-     * Constructs an empty <tt>HashMap</tt> with the specified initial
+     * Constructs an empty {@code HashMap} with the specified initial
      * capacity and load factor.
      *
      * @param  initialCapacity the initial capacity
@@ -457,7 +457,7 @@
     }
 
     /**
-     * Constructs an empty <tt>HashMap</tt> with the specified initial
+     * Constructs an empty {@code HashMap} with the specified initial
      * capacity and the default load factor (0.75).
      *
      * @param  initialCapacity the initial capacity.
@@ -468,7 +468,7 @@
     }
 
     /**
-     * Constructs an empty <tt>HashMap</tt> with the default initial capacity
+     * Constructs an empty {@code HashMap} with the default initial capacity
      * (16) and the default load factor (0.75).
      */
     public HashMap() {
@@ -476,10 +476,10 @@
     }
 
     /**
-     * Constructs a new <tt>HashMap</tt> with the same mappings as the
-     * specified <tt>Map</tt>.  The <tt>HashMap</tt> is created with
+     * Constructs a new {@code HashMap} with the same mappings as the
+     * specified {@code Map}.  The {@code HashMap} is created with
      * default load factor (0.75) and an initial capacity sufficient to
-     * hold the mappings in the specified <tt>Map</tt>.
+     * hold the mappings in the specified {@code Map}.
      *
      * @param   m the map whose mappings are to be placed in this map
      * @throws  NullPointerException if the specified map is null
@@ -526,9 +526,9 @@
     }
 
     /**
-     * Returns <tt>true</tt> if this map contains no key-value mappings.
+     * Returns {@code true} if this map contains no key-value mappings.
      *
-     * @return <tt>true</tt> if this map contains no key-value mappings
+     * @return {@code true} if this map contains no key-value mappings
      */
     public boolean isEmpty() {
         return size == 0;
@@ -584,11 +584,11 @@
     }
 
     /**
-     * Returns <tt>true</tt> if this map contains a mapping for the
+     * Returns {@code true} if this map contains a mapping for the
      * specified key.
      *
      * @param   key   The key whose presence in this map is to be tested
-     * @return <tt>true</tt> if this map contains a mapping for the specified
+     * @return {@code true} if this map contains a mapping for the specified
      * key.
      */
     public boolean containsKey(Object key) {
@@ -602,10 +602,10 @@
      *
      * @param key key with which the specified value is to be associated
      * @param value value to be associated with the specified key
-     * @return the previous value associated with <tt>key</tt>, or
-     *         <tt>null</tt> if there was no mapping for <tt>key</tt>.
-     *         (A <tt>null</tt> return can also indicate that the map
-     *         previously associated <tt>null</tt> with <tt>key</tt>.)
+     * @return the previous value associated with {@code key}, or
+     *         {@code null} if there was no mapping for {@code key}.
+     *         (A {@code null} return can also indicate that the map
+     *         previously associated {@code null} with {@code key}.)
      */
     public V put(K key, V value) {
         return putVal(hash(key), key, value, false, true);
@@ -788,10 +788,10 @@
      * Removes the mapping for the specified key from this map if present.
      *
      * @param  key key whose mapping is to be removed from the map
-     * @return the previous value associated with <tt>key</tt>, or
-     *         <tt>null</tt> if there was no mapping for <tt>key</tt>.
-     *         (A <tt>null</tt> return can also indicate that the map
-     *         previously associated <tt>null</tt> with <tt>key</tt>.)
+     * @return the previous value associated with {@code key}, or
+     *         {@code null} if there was no mapping for {@code key}.
+     *         (A {@code null} return can also indicate that the map
+     *         previously associated {@code null} with {@code key}.)
      */
     public V remove(Object key) {
         Node<K,V> e;
@@ -865,11 +865,11 @@
     }
 
     /**
-     * Returns <tt>true</tt> if this map maps one or more keys to the
+     * Returns {@code true} if this map maps one or more keys to the
      * specified value.
      *
      * @param value value whose presence in this map is to be tested
-     * @return <tt>true</tt> if this map maps one or more keys to the
+     * @return {@code true} if this map maps one or more keys to the
      *         specified value
      */
     public boolean containsValue(Object value) {
@@ -891,12 +891,12 @@
      * The set is backed by the map, so changes to the map are
      * reflected in the set, and vice-versa.  If the map is modified
      * while an iteration over the set is in progress (except through
-     * the iterator's own <tt>remove</tt> operation), the results of
+     * the iterator's own {@code remove} operation), the results of
      * the iteration are undefined.  The set supports element removal,
      * which removes the corresponding mapping from the map, via the
-     * <tt>Iterator.remove</tt>, <tt>Set.remove</tt>,
-     * <tt>removeAll</tt>, <tt>retainAll</tt>, and <tt>clear</tt>
-     * operations.  It does not support the <tt>add</tt> or <tt>addAll</tt>
+     * {@code Iterator.remove}, {@code Set.remove},
+     * {@code removeAll}, {@code retainAll}, and {@code clear}
+     * operations.  It does not support the {@code add} or {@code addAll}
      * operations.
      *
      * @return a set view of the keys contained in this map
@@ -938,13 +938,13 @@
      * The collection is backed by the map, so changes to the map are
      * reflected in the collection, and vice-versa.  If the map is
      * modified while an iteration over the collection is in progress
-     * (except through the iterator's own <tt>remove</tt> operation),
+     * (except through the iterator's own {@code remove} operation),
      * the results of the iteration are undefined.  The collection
      * supports element removal, which removes the corresponding
-     * mapping from the map, via the <tt>Iterator.remove</tt>,
-     * <tt>Collection.remove</tt>, <tt>removeAll</tt>,
-     * <tt>retainAll</tt> and <tt>clear</tt> operations.  It does not
-     * support the <tt>add</tt> or <tt>addAll</tt> operations.
+     * mapping from the map, via the {@code Iterator.remove},
+     * {@code Collection.remove}, {@code removeAll},
+     * {@code retainAll} and {@code clear} operations.  It does not
+     * support the {@code add} or {@code addAll} operations.
      *
      * @return a view of the values contained in this map
      */
@@ -982,14 +982,14 @@
      * The set is backed by the map, so changes to the map are
      * reflected in the set, and vice-versa.  If the map is modified
      * while an iteration over the set is in progress (except through
-     * the iterator's own <tt>remove</tt> operation, or through the
-     * <tt>setValue</tt> operation on a map entry returned by the
+     * the iterator's own {@code remove} operation, or through the
+     * {@code setValue} operation on a map entry returned by the
      * iterator) the results of the iteration are undefined.  The set
      * supports element removal, which removes the corresponding
-     * mapping from the map, via the <tt>Iterator.remove</tt>,
-     * <tt>Set.remove</tt>, <tt>removeAll</tt>, <tt>retainAll</tt> and
-     * <tt>clear</tt> operations.  It does not support the
-     * <tt>add</tt> or <tt>addAll</tt> operations.
+     * mapping from the map, via the {@code Iterator.remove},
+     * {@code Set.remove}, {@code removeAll}, {@code retainAll} and
+     * {@code clear} operations.  It does not support the
+     * {@code add} or {@code addAll} operations.
      *
      * @return a set view of the mappings contained in this map
      */
@@ -1357,7 +1357,7 @@
     // Cloning and serialization
 
     /**
-     * Returns a shallow copy of this <tt>HashMap</tt> instance: the keys and
+     * Returns a shallow copy of this {@code HashMap} instance: the keys and
      * values themselves are not cloned.
      *
      * @return a shallow copy of this map
@@ -1386,7 +1386,7 @@
     }
 
     /**
-     * Save the state of the <tt>HashMap</tt> instance to a stream (i.e.,
+     * Save the state of the {@code HashMap} instance to a stream (i.e.,
      * serialize it).
      *
      * @serialData The <i>capacity</i> of the HashMap (the length of the
--- a/jdk/src/java.base/share/classes/java/util/HashSet.java	Thu Apr 09 12:29:31 2015 +0200
+++ b/jdk/src/java.base/share/classes/java/util/HashSet.java	Mon Aug 17 12:45:16 2015 +0300
@@ -28,18 +28,18 @@
 import java.io.InvalidObjectException;
 
 /**
- * This class implements the <tt>Set</tt> interface, backed by a hash table
- * (actually a <tt>HashMap</tt> instance).  It makes no guarantees as to the
+ * This class implements the {@code Set} interface, backed by a hash table
+ * (actually a {@code HashMap} instance).  It makes no guarantees as to the
  * iteration order of the set; in particular, it does not guarantee that the
- * order will remain constant over time.  This class permits the <tt>null</tt>
+ * order will remain constant over time.  This class permits the {@code null}
  * element.
  *
  * <p>This class offers constant time performance for the basic operations
- * (<tt>add</tt>, <tt>remove</tt>, <tt>contains</tt> and <tt>size</tt>),
+ * ({@code add}, {@code remove}, {@code contains} and {@code size}),
  * assuming the hash function disperses the elements properly among the
  * buckets.  Iterating over this set requires time proportional to the sum of
- * the <tt>HashSet</tt> instance's size (the number of elements) plus the
- * "capacity" of the backing <tt>HashMap</tt> instance (the number of
+ * the {@code HashSet} instance's size (the number of elements) plus the
+ * "capacity" of the backing {@code HashMap} instance (the number of
  * buckets).  Thus, it's very important not to set the initial capacity too
  * high (or the load factor too low) if iteration performance is important.
  *
@@ -55,9 +55,9 @@
  * unsynchronized access to the set:<pre>
  *   Set s = Collections.synchronizedSet(new HashSet(...));</pre>
  *
- * <p>The iterators returned by this class's <tt>iterator</tt> method are
+ * <p>The iterators returned by this class's {@code iterator} method are
  * <i>fail-fast</i>: if the set is modified at any time after the iterator is
- * created, in any way except through the iterator's own <tt>remove</tt>
+ * created, in any way except through the iterator's own {@code remove}
  * method, the Iterator throws a {@link ConcurrentModificationException}.
  * Thus, in the face of concurrent modification, the iterator fails quickly
  * and cleanly, rather than risking arbitrary, non-deterministic behavior at
@@ -66,7 +66,7 @@
  * <p>Note that the fail-fast behavior of an iterator cannot be guaranteed
  * as it is, generally speaking, impossible to make any hard guarantees in the
  * presence of unsynchronized concurrent modification.  Fail-fast iterators
- * throw <tt>ConcurrentModificationException</tt> on a best-effort basis.
+ * throw {@code ConcurrentModificationException} on a best-effort basis.
  * Therefore, it would be wrong to write a program that depended on this
  * exception for its correctness: <i>the fail-fast behavior of iterators
  * should be used only to detect bugs.</i>
@@ -98,7 +98,7 @@
     private static final Object PRESENT = new Object();
 
     /**
-     * Constructs a new, empty set; the backing <tt>HashMap</tt> instance has
+     * Constructs a new, empty set; the backing {@code HashMap} instance has
      * default initial capacity (16) and load factor (0.75).
      */
     public HashSet() {
@@ -107,7 +107,7 @@
 
     /**
      * Constructs a new set containing the elements in the specified
-     * collection.  The <tt>HashMap</tt> is created with default load factor
+     * collection.  The {@code HashMap} is created with default load factor
      * (0.75) and an initial capacity sufficient to contain the elements in
      * the specified collection.
      *
@@ -120,7 +120,7 @@
     }
 
     /**
-     * Constructs a new, empty set; the backing <tt>HashMap</tt> instance has
+     * Constructs a new, empty set; the backing {@code HashMap} instance has
      * the specified initial capacity and the specified load factor.
      *
      * @param      initialCapacity   the initial capacity of the hash map
@@ -133,7 +133,7 @@
     }
 
     /**
-     * Constructs a new, empty set; the backing <tt>HashMap</tt> instance has
+     * Constructs a new, empty set; the backing {@code HashMap} instance has
      * the specified initial capacity and default load factor (0.75).
      *
      * @param      initialCapacity   the initial capacity of the hash table
@@ -182,22 +182,22 @@
     }
 
     /**
-     * Returns <tt>true</tt> if this set contains no elements.
+     * Returns {@code true} if this set contains no elements.
      *
-     * @return <tt>true</tt> if this set contains no elements
+     * @return {@code true} if this set contains no elements
      */
     public boolean isEmpty() {
         return map.isEmpty();
     }
 
     /**
-     * Returns <tt>true</tt> if this set contains the specified element.
-     * More formally, returns <tt>true</tt> if and only if this set
-     * contains an element <tt>e</tt> such that
-     * <tt>(o==null&nbsp;?&nbsp;e==null&nbsp;:&nbsp;o.equals(e))</tt>.
+     * Returns {@code true} if this set contains the specified element.
+     * More formally, returns {@code true} if and only if this set
+     * contains an element {@code e} such that
+     * {@code Objects.equals(o, e)}.
      *
      * @param o element whose presence in this set is to be tested
-     * @return <tt>true</tt> if this set contains the specified element
+     * @return {@code true} if this set contains the specified element
      */
     public boolean contains(Object o) {
         return map.containsKey(o);
@@ -205,14 +205,14 @@
 
     /**
      * Adds the specified element to this set if it is not already present.
-     * More formally, adds the specified element <tt>e</tt> to this set if
-     * this set contains no element <tt>e2</tt> such that
-     * <tt>(e==null&nbsp;?&nbsp;e2==null&nbsp;:&nbsp;e.equals(e2))</tt>.
+     * More formally, adds the specified element {@code e} to this set if
+     * this set contains no element {@code e2} such that
+     * {@code Objects.equals(e, e2)}.
      * If this set already contains the element, the call leaves the set
-     * unchanged and returns <tt>false</tt>.
+     * unchanged and returns {@code false}.
      *
      * @param e element to be added to this set
-     * @return <tt>true</tt> if this set did not already contain the specified
+     * @return {@code true} if this set did not already contain the specified
      * element
      */
     public boolean add(E e) {
@@ -221,15 +221,15 @@
 
     /**
      * Removes the specified element from this set if it is present.
-     * More formally, removes an element <tt>e</tt> such that
-     * <tt>(o==null&nbsp;?&nbsp;e==null&nbsp;:&nbsp;o.equals(e))</tt>,
-     * if this set contains such an element.  Returns <tt>true</tt> if
+     * More formally, removes an element {@code e} such that
+     * {@code Objects.equals(o, e)},
+     * if this set contains such an element.  Returns {@code true} if
      * this set contained the element (or equivalently, if this set
      * changed as a result of the call).  (This set will not contain the
      * element once the call returns.)
      *
      * @param o object to be removed from this set, if present
-     * @return <tt>true</tt> if the set contained the specified element
+     * @return {@code true} if the set contained the specified element
      */
     public boolean remove(Object o) {
         return map.remove(o)==PRESENT;
@@ -244,7 +244,7 @@
     }
 
     /**
-     * Returns a shallow copy of this <tt>HashSet</tt> instance: the elements
+     * Returns a shallow copy of this {@code HashSet} instance: the elements
      * themselves are not cloned.
      *
      * @return a shallow copy of this set
@@ -261,10 +261,10 @@
     }
 
     /**
-     * Save the state of this <tt>HashSet</tt> instance to a stream (that is,
+     * Save the state of this {@code HashSet} instance to a stream (that is,
      * serialize it).
      *
-     * @serialData The capacity of the backing <tt>HashMap</tt> instance
+     * @serialData The capacity of the backing {@code HashMap} instance
      *             (int), and its load factor (float) are emitted, followed by
      *             the size of the set (the number of elements it contains)
      *             (int), followed by all of its elements (each an Object) in
@@ -288,7 +288,7 @@
     }
 
     /**
-     * Reconstitute the <tt>HashSet</tt> instance from a stream (that is,
+     * Reconstitute the {@code HashSet} instance from a stream (that is,
      * deserialize it).
      */
     private void readObject(java.io.ObjectInputStream s)
--- a/jdk/src/java.base/share/classes/java/util/Hashtable.java	Thu Apr 09 12:29:31 2015 +0200
+++ b/jdk/src/java.base/share/classes/java/util/Hashtable.java	Mon Aug 17 12:45:16 2015 +0300
@@ -32,13 +32,13 @@
 
 /**
  * This class implements a hash table, which maps keys to values. Any
- * non-<code>null</code> object can be used as a key or as a value. <p>
+ * non-{@code null} object can be used as a key or as a value. <p>
  *
  * To successfully store and retrieve objects from a hashtable, the
- * objects used as keys must implement the <code>hashCode</code>
- * method and the <code>equals</code> method. <p>
+ * objects used as keys must implement the {@code hashCode}
+ * method and the {@code equals} method. <p>
  *
- * An instance of <code>Hashtable</code> has two parameters that affect its
+ * An instance of {@code Hashtable} has two parameters that affect its
  * performance: <i>initial capacity</i> and <i>load factor</i>.  The
  * <i>capacity</i> is the number of <i>buckets</i> in the hash table, and the
  * <i>initial capacity</i> is simply the capacity at the time the hash table
@@ -53,16 +53,16 @@
  * Generally, the default load factor (.75) offers a good tradeoff between
  * time and space costs.  Higher values decrease the space overhead but
  * increase the time cost to look up an entry (which is reflected in most
- * <tt>Hashtable</tt> operations, including <tt>get</tt> and <tt>put</tt>).<p>
+ * {@code Hashtable} operations, including {@code get} and {@code put}).<p>
  *
  * The initial capacity controls a tradeoff between wasted space and the
- * need for <code>rehash</code> operations, which are time-consuming.
- * No <code>rehash</code> operations will <i>ever</i> occur if the initial
+ * need for {@code rehash} operations, which are time-consuming.
+ * No {@code rehash} operations will <i>ever</i> occur if the initial
  * capacity is greater than the maximum number of entries the
- * <tt>Hashtable</tt> will contain divided by its load factor.  However,
+ * {@code Hashtable} will contain divided by its load factor.  However,
  * setting the initial capacity too high can waste space.<p>
  *
- * If many entries are to be made into a <code>Hashtable</code>,
+ * If many entries are to be made into a {@code Hashtable},
  * creating it with a sufficiently large capacity may allow the
  * entries to be inserted more efficiently than letting it perform
  * automatic rehashing as needed to grow the table. <p>
@@ -83,11 +83,11 @@
  *     System.out.println("two = " + n);
  *   }}</pre>
  *
- * <p>The iterators returned by the <tt>iterator</tt> method of the collections
+ * <p>The iterators returned by the {@code iterator} method of the collections
  * returned by all of this class's "collection view methods" are
  * <em>fail-fast</em>: if the Hashtable is structurally modified at any time
  * after the iterator is created, in any way except through the iterator's own
- * <tt>remove</tt> method, the iterator will throw a {@link
+ * {@code remove} method, the iterator will throw a {@link
  * ConcurrentModificationException}.  Thus, in the face of concurrent
  * modification, the iterator fails quickly and cleanly, rather than risking
  * arbitrary, non-deterministic behavior at an undetermined time in the future.
@@ -99,7 +99,7 @@
  * <p>Note that the fail-fast behavior of an iterator cannot be guaranteed
  * as it is, generally speaking, impossible to make any hard guarantees in the
  * presence of unsynchronized concurrent modification.  Fail-fast iterators
- * throw <tt>ConcurrentModificationException</tt> on a best-effort basis.
+ * throw {@code ConcurrentModificationException} on a best-effort basis.
  * Therefore, it would be wrong to write a program that depended on this
  * exception for its correctness: <i>the fail-fast behavior of iterators
  * should be used only to detect bugs.</i>
@@ -241,8 +241,8 @@
     /**
      * Tests if this hashtable maps no keys to values.
      *
-     * @return  <code>true</code> if this hashtable maps no keys to values;
-     *          <code>false</code> otherwise.
+     * @return  {@code true} if this hashtable maps no keys to values;
+     *          {@code false} otherwise.
      */
     public synchronized boolean isEmpty() {
         return count == 0;
@@ -290,11 +290,11 @@
      * {@link Map} interface in the collections framework).
      *
      * @param      value   a value to search for
-     * @return     <code>true</code> if and only if some key maps to the
-     *             <code>value</code> argument in this hashtable as
-     *             determined by the <tt>equals</tt> method;
-     *             <code>false</code> otherwise.
-     * @exception  NullPointerException  if the value is <code>null</code>
+     * @return     {@code true} if and only if some key maps to the
+     *             {@code value} argument in this hashtable as
+     *             determined by the {@code equals} method;
+     *             {@code false} otherwise.
+     * @exception  NullPointerException  if the value is {@code null}
      */
     public synchronized boolean contains(Object value) {
         if (value == null) {
@@ -319,9 +319,9 @@
      * #contains contains} (which predates the {@link Map} interface).
      *
      * @param value value whose presence in this hashtable is to be tested
-     * @return <tt>true</tt> if this map maps one or more keys to the
+     * @return {@code true} if this map maps one or more keys to the
      *         specified value
-     * @throws NullPointerException  if the value is <code>null</code>
+     * @throws NullPointerException  if the value is {@code null}
      * @since 1.2
      */
     public boolean containsValue(Object value) {
@@ -332,10 +332,10 @@
      * Tests if the specified object is a key in this hashtable.
      *
      * @param   key   possible key
-     * @return  <code>true</code> if and only if the specified object
+     * @return  {@code true} if and only if the specified object
      *          is a key in this hashtable, as determined by the
-     *          <tt>equals</tt> method; <code>false</code> otherwise.
-     * @throws  NullPointerException  if the key is <code>null</code>
+     *          {@code equals} method; {@code false} otherwise.
+     * @throws  NullPointerException  if the key is {@code null}
      * @see     #contains(Object)
      */
     public synchronized boolean containsKey(Object key) {
@@ -444,19 +444,19 @@
     }
 
     /**
-     * Maps the specified <code>key</code> to the specified
-     * <code>value</code> in this hashtable. Neither the key nor the
-     * value can be <code>null</code>. <p>
+     * Maps the specified {@code key} to the specified
+     * {@code value} in this hashtable. Neither the key nor the
+     * value can be {@code null}. <p>
      *
-     * The value can be retrieved by calling the <code>get</code> method
+     * The value can be retrieved by calling the {@code get} method
      * with a key that is equal to the original key.
      *
      * @param      key     the hashtable key
      * @param      value   the value
      * @return     the previous value of the specified key in this hashtable,
-     *             or <code>null</code> if it did not have one
+     *             or {@code null} if it did not have one
      * @exception  NullPointerException  if the key or value is
-     *               <code>null</code>
+     *               {@code null}
      * @see     Object#equals(Object)
      * @see     #get(Object)
      */
@@ -490,8 +490,8 @@
      *
      * @param   key   the key that needs to be removed
      * @return  the value to which the key had been mapped in this hashtable,
-     *          or <code>null</code> if the key did not have a mapping
-     * @throws  NullPointerException  if the key is <code>null</code>
+     *          or {@code null} if the key did not have a mapping
+     * @throws  NullPointerException  if the key is {@code null}
      */
     public synchronized V remove(Object key) {
         Entry<?,?> tab[] = table;
@@ -568,11 +568,11 @@
     }
 
     /**
-     * Returns a string representation of this <tt>Hashtable</tt> object
+     * Returns a string representation of this {@code Hashtable} object
      * in the form of a set of entries, enclosed in braces and separated
-     * by the ASCII characters "<tt>,&nbsp;</tt>" (comma and space). Each
-     * entry is rendered as the key, an equals sign <tt>=</tt>, and the
-     * associated element, where the <tt>toString</tt> method is used to
+     * by the ASCII characters "<code> ,&nbsp;</code>" (comma and space). Each
+     * entry is rendered as the key, an equals sign {@code =}, and the
+     * associated element, where the {@code toString} method is used to
      * convert the key and element to strings.
      *
      * @return  a string representation of this hashtable
@@ -633,12 +633,12 @@
      * The set is backed by the map, so changes to the map are
      * reflected in the set, and vice-versa.  If the map is modified
      * while an iteration over the set is in progress (except through
-     * the iterator's own <tt>remove</tt> operation), the results of
+     * the iterator's own {@code remove} operation), the results of
      * the iteration are undefined.  The set supports element removal,
      * which removes the corresponding mapping from the map, via the
-     * <tt>Iterator.remove</tt>, <tt>Set.remove</tt>,
-     * <tt>removeAll</tt>, <tt>retainAll</tt>, and <tt>clear</tt>
-     * operations.  It does not support the <tt>add</tt> or <tt>addAll</tt>
+     * {@code Iterator.remove}, {@code Set.remove},
+     * {@code removeAll}, {@code retainAll}, and {@code clear}
+     * operations.  It does not support the {@code add} or {@code addAll}
      * operations.
      *
      * @since 1.2
@@ -672,14 +672,14 @@
      * The set is backed by the map, so changes to the map are
      * reflected in the set, and vice-versa.  If the map is modified
      * while an iteration over the set is in progress (except through
-     * the iterator's own <tt>remove</tt> operation, or through the
-     * <tt>setValue</tt> operation on a map entry returned by the
+     * the iterator's own {@code remove} operation, or through the
+     * {@code setValue} operation on a map entry returned by the
      * iterator) the results of the iteration are undefined.  The set
      * supports element removal, which removes the corresponding
-     * mapping from the map, via the <tt>Iterator.remove</tt>,
-     * <tt>Set.remove</tt>, <tt>removeAll</tt>, <tt>retainAll</tt> and
-     * <tt>clear</tt> operations.  It does not support the
-     * <tt>add</tt> or <tt>addAll</tt> operations.
+     * mapping from the map, via the {@code Iterator.remove},
+     * {@code Set.remove}, {@code removeAll}, {@code retainAll} and
+     * {@code clear} operations.  It does not support the
+     * {@code add} or {@code addAll} operations.
      *
      * @since 1.2
      */
@@ -754,13 +754,13 @@
      * The collection is backed by the map, so changes to the map are
      * reflected in the collection, and vice-versa.  If the map is
      * modified while an iteration over the collection is in progress
-     * (except through the iterator's own <tt>remove</tt> operation),
+     * (except through the iterator's own {@code remove} operation),
      * the results of the iteration are undefined.  The collection
      * supports element removal, which removes the corresponding
-     * mapping from the map, via the <tt>Iterator.remove</tt>,
-     * <tt>Collection.remove</tt>, <tt>removeAll</tt>,
-     * <tt>retainAll</tt> and <tt>clear</tt> operations.  It does not
-     * support the <tt>add</tt> or <tt>addAll</tt> operations.
+     * mapping from the map, via the {@code Iterator.remove},
+     * {@code Collection.remove}, {@code removeAll},
+     * {@code retainAll} and {@code clear} operations.  It does not
+     * support the {@code add} or {@code addAll} operations.
      *
      * @since 1.2
      */
--- a/jdk/src/java.base/share/classes/java/util/IdentityHashMap.java	Thu Apr 09 12:29:31 2015 +0200
+++ b/jdk/src/java.base/share/classes/java/util/IdentityHashMap.java	Mon Aug 17 12:45:16 2015 +0300
@@ -31,18 +31,18 @@
 import java.util.function.Consumer;
 
 /**
- * This class implements the <tt>Map</tt> interface with a hash table, using
+ * This class implements the {@code Map} interface with a hash table, using
  * reference-equality in place of object-equality when comparing keys (and
- * values).  In other words, in an <tt>IdentityHashMap</tt>, two keys
- * <tt>k1</tt> and <tt>k2</tt> are considered equal if and only if
- * <tt>(k1==k2)</tt>.  (In normal <tt>Map</tt> implementations (like
- * <tt>HashMap</tt>) two keys <tt>k1</tt> and <tt>k2</tt> are considered equal
- * if and only if <tt>(k1==null ? k2==null : k1.equals(k2))</tt>.)
+ * values).  In other words, in an {@code IdentityHashMap}, two keys
+ * {@code k1} and {@code k2} are considered equal if and only if
+ * {@code (k1==k2)}.  (In normal {@code Map} implementations (like
+ * {@code HashMap}) two keys {@code k1} and {@code k2} are considered equal
+ * if and only if {@code (k1==null ? k2==null : k1.equals(k2))}.)
  *
- * <p><b>This class is <i>not</i> a general-purpose <tt>Map</tt>
- * implementation!  While this class implements the <tt>Map</tt> interface, it
- * intentionally violates <tt>Map's</tt> general contract, which mandates the
- * use of the <tt>equals</tt> method when comparing objects.  This class is
+ * <p><b>This class is <i>not</i> a general-purpose {@code Map}
+ * implementation!  While this class implements the {@code Map} interface, it
+ * intentionally violates {@code Map's} general contract, which mandates the
+ * use of the {@code equals} method when comparing objects.  This class is
  * designed for use only in the rare cases wherein reference-equality
  * semantics are required.</b>
  *
@@ -56,12 +56,12 @@
  * each object in the program being debugged.
  *
  * <p>This class provides all of the optional map operations, and permits
- * <tt>null</tt> values and the <tt>null</tt> key.  This class makes no
+ * {@code null} values and the {@code null} key.  This class makes no
  * guarantees as to the order of the map; in particular, it does not guarantee
  * that the order will remain constant over time.
  *
  * <p>This class provides constant-time performance for the basic
- * operations (<tt>get</tt> and <tt>put</tt>), assuming the system
+ * operations ({@code get} and {@code put}), assuming the system
  * identity hash function ({@link System#identityHashCode(Object)})
  * disperses elements properly among the buckets.
  *
@@ -96,11 +96,11 @@
  * unsynchronized access to the map:<pre>
  *   Map m = Collections.synchronizedMap(new IdentityHashMap(...));</pre>
  *
- * <p>The iterators returned by the <tt>iterator</tt> method of the
+ * <p>The iterators returned by the {@code iterator} method of the
  * collections returned by all of this class's "collection view
  * methods" are <i>fail-fast</i>: if the map is structurally modified
  * at any time after the iterator is created, in any way except
- * through the iterator's own <tt>remove</tt> method, the iterator
+ * through the iterator's own {@code remove} method, the iterator
  * will throw a {@link ConcurrentModificationException}.  Thus, in the
  * face of concurrent modification, the iterator fails quickly and
  * cleanly, rather than risking arbitrary, non-deterministic behavior
@@ -109,7 +109,7 @@
  * <p>Note that the fail-fast behavior of an iterator cannot be guaranteed
  * as it is, generally speaking, impossible to make any hard guarantees in the
  * presence of unsynchronized concurrent modification.  Fail-fast iterators
- * throw <tt>ConcurrentModificationException</tt> on a best-effort basis.
+ * throw {@code ConcurrentModificationException} on a best-effort basis.
  * Therefore, it would be wrong to write a program that depended on this
  * exception for its correctness: <i>fail-fast iterators should be used only
  * to detect bugs.</i>
@@ -217,7 +217,7 @@
      * somewhat time-consuming.
      *
      * @param expectedMaxSize the expected maximum size of the map
-     * @throws IllegalArgumentException if <tt>expectedMaxSize</tt> is negative
+     * @throws IllegalArgumentException if {@code expectedMaxSize} is negative
      */
     public IdentityHashMap(int expectedMaxSize) {
         if (expectedMaxSize < 0)
@@ -277,10 +277,10 @@
     }
 
     /**
-     * Returns <tt>true</tt> if this identity hash map contains no key-value
+     * Returns {@code true} if this identity hash map contains no key-value
      * mappings.
      *
-     * @return <tt>true</tt> if this identity hash map contains no key-value
+     * @return {@code true} if this identity hash map contains no key-value
      *         mappings
      */
     public boolean isEmpty() {
@@ -341,7 +341,7 @@
      * hash map.
      *
      * @param   key   possible key
-     * @return  <code>true</code> if the specified object reference is a key
+     * @return  {@code true} if the specified object reference is a key
      *          in this map
      * @see     #containsValue(Object)
      */
@@ -365,7 +365,7 @@
      * hash map.
      *
      * @param value value whose presence in this map is to be tested
-     * @return <tt>true</tt> if this map maps one or more keys to the
+     * @return {@code true} if this map maps one or more keys to the
      *         specified object reference
      * @see     #containsKey(Object)
      */
@@ -383,7 +383,7 @@
      *
      * @param   key   possible key
      * @param   value possible value
-     * @return  <code>true</code> if and only if the specified key-value
+     * @return  {@code true} if and only if the specified key-value
      *          mapping is in the map
      */
     private boolean containsMapping(Object key, Object value) {
@@ -408,10 +408,10 @@
      *
      * @param key the key with which the specified value is to be associated
      * @param value the value to be associated with the specified key
-     * @return the previous value associated with <tt>key</tt>, or
-     *         <tt>null</tt> if there was no mapping for <tt>key</tt>.
-     *         (A <tt>null</tt> return can also indicate that the map
-     *         previously associated <tt>null</tt> with <tt>key</tt>.)
+     * @return the previous value associated with {@code key}, or
+     *         {@code null} if there was no mapping for {@code key}.
+     *         (A {@code null} return can also indicate that the map
+     *         previously associated {@code null} with {@code key}.)
      * @see     Object#equals(Object)
      * @see     #get(Object)
      * @see     #containsKey(Object)
@@ -510,10 +510,10 @@
      * Removes the mapping for this key from this map if present.
      *
      * @param key key whose mapping is to be removed from the map
-     * @return the previous value associated with <tt>key</tt>, or
-     *         <tt>null</tt> if there was no mapping for <tt>key</tt>.
-     *         (A <tt>null</tt> return can also indicate that the map
-     *         previously associated <tt>null</tt> with <tt>key</tt>.)
+     * @return the previous value associated with {@code key}, or
+     *         {@code null} if there was no mapping for {@code key}.
+     *         (A {@code null} return can also indicate that the map
+     *         previously associated {@code null} with {@code key}.)
      */
     public V remove(Object key) {
         Object k = maskNull(key);
@@ -544,7 +544,7 @@
      *
      * @param   key   possible key
      * @param   value possible value
-     * @return  <code>true</code> if and only if the specified key-value
+     * @return  {@code true} if and only if the specified key-value
      *          mapping was in the map
      */
     private boolean removeMapping(Object key, Object value) {
@@ -621,19 +621,19 @@
 
     /**
      * Compares the specified object with this map for equality.  Returns
-     * <tt>true</tt> if the given object is also a map and the two maps
+     * {@code true} if the given object is also a map and the two maps
      * represent identical object-reference mappings.  More formally, this
-     * map is equal to another map <tt>m</tt> if and only if
-     * <tt>this.entrySet().equals(m.entrySet())</tt>.
+     * map is equal to another map {@code m} if and only if
+     * {@code this.entrySet().equals(m.entrySet())}.
      *
      * <p><b>Owing to the reference-equality-based semantics of this map it is
      * possible that the symmetry and transitivity requirements of the
-     * <tt>Object.equals</tt> contract may be violated if this map is compared
-     * to a normal map.  However, the <tt>Object.equals</tt> contract is
-     * guaranteed to hold among <tt>IdentityHashMap</tt> instances.</b>
+     * {@code Object.equals} contract may be violated if this map is compared
+     * to a normal map.  However, the {@code Object.equals} contract is
+     * guaranteed to hold among {@code IdentityHashMap} instances.</b>
      *
      * @param  o object to be compared for equality with this map
-     * @return <tt>true</tt> if the specified object is equal to this map
+     * @return {@code true} if the specified object is equal to this map
      * @see Object#equals(Object)
      */
     public boolean equals(Object o) {
@@ -662,17 +662,17 @@
     /**
      * Returns the hash code value for this map.  The hash code of a map is
      * defined to be the sum of the hash codes of each entry in the map's
-     * <tt>entrySet()</tt> view.  This ensures that <tt>m1.equals(m2)</tt>
-     * implies that <tt>m1.hashCode()==m2.hashCode()</tt> for any two
-     * <tt>IdentityHashMap</tt> instances <tt>m1</tt> and <tt>m2</tt>, as
+     * {@code entrySet()} view.  This ensures that {@code m1.equals(m2)}
+     * implies that {@code m1.hashCode()==m2.hashCode()} for any two
+     * {@code IdentityHashMap} instances {@code m1} and {@code m2}, as
      * required by the general contract of {@link Object#hashCode}.
      *
      * <p><b>Owing to the reference-equality-based semantics of the
-     * <tt>Map.Entry</tt> instances in the set returned by this map's
-     * <tt>entrySet</tt> method, it is possible that the contractual
-     * requirement of <tt>Object.hashCode</tt> mentioned in the previous
+     * {@code Map.Entry} instances in the set returned by this map's
+     * {@code entrySet} method, it is possible that the contractual
+     * requirement of {@code Object.hashCode} mentioned in the previous
      * paragraph will be violated if one of the two objects being compared is
-     * an <tt>IdentityHashMap</tt> instance and the other is a normal map.</b>
+     * an {@code IdentityHashMap} instance and the other is a normal map.</b>
      *
      * @return the hash code value for this map
      * @see Object#equals(Object)
@@ -930,32 +930,32 @@
      * the set, and vice-versa.  If the map is modified while an iteration
      * over the set is in progress, the results of the iteration are
      * undefined.  The set supports element removal, which removes the
-     * corresponding mapping from the map, via the <tt>Iterator.remove</tt>,
-     * <tt>Set.remove</tt>, <tt>removeAll</tt>, <tt>retainAll</tt>, and
-     * <tt>clear</tt> methods.  It does not support the <tt>add</tt> or
-     * <tt>addAll</tt> methods.
+     * corresponding mapping from the map, via the {@code Iterator.remove},
+     * {@code Set.remove}, {@code removeAll}, {@code retainAll}, and
+     * {@code clear} methods.  It does not support the {@code add} or
+     * {@code addAll} methods.
      *
      * <p><b>While the object returned by this method implements the
-     * <tt>Set</tt> interface, it does <i>not</i> obey <tt>Set's</tt> general
+     * {@code Set} interface, it does <i>not</i> obey {@code Set's} general
      * contract.  Like its backing map, the set returned by this method
      * defines element equality as reference-equality rather than
-     * object-equality.  This affects the behavior of its <tt>contains</tt>,
-     * <tt>remove</tt>, <tt>containsAll</tt>, <tt>equals</tt>, and
-     * <tt>hashCode</tt> methods.</b>
+     * object-equality.  This affects the behavior of its {@code contains},
+     * {@code remove}, {@code containsAll}, {@code equals}, and
+     * {@code hashCode} methods.</b>
      *
-     * <p><b>The <tt>equals</tt> method of the returned set returns <tt>true</tt>
+     * <p><b>The {@code equals} method of the returned set returns {@code true}
      * only if the specified object is a set containing exactly the same
      * object references as the returned set.  The symmetry and transitivity
-     * requirements of the <tt>Object.equals</tt> contract may be violated if
+     * requirements of the {@code Object.equals} contract may be violated if
      * the set returned by this method is compared to a normal set.  However,
-     * the <tt>Object.equals</tt> contract is guaranteed to hold among sets
+     * the {@code Object.equals} contract is guaranteed to hold among sets
      * returned by this method.</b>
      *
-     * <p>The <tt>hashCode</tt> method of the returned set returns the sum of
+     * <p>The {@code hashCode} method of the returned set returns the sum of
      * the <i>identity hashcodes</i> of the elements in the set, rather than
      * the sum of their hashcodes.  This is mandated by the change in the
-     * semantics of the <tt>equals</tt> method, in order to enforce the
-     * general contract of the <tt>Object.hashCode</tt> method among sets
+     * semantics of the {@code equals} method, in order to enforce the
+     * general contract of the {@code Object.hashCode} method among sets
      * returned by this method.
      *
      * @return an identity-based set view of the keys contained in this map
@@ -1054,18 +1054,18 @@
      * modified while an iteration over the collection is in progress,
      * the results of the iteration are undefined.  The collection
      * supports element removal, which removes the corresponding
-     * mapping from the map, via the <tt>Iterator.remove</tt>,
-     * <tt>Collection.remove</tt>, <tt>removeAll</tt>,
-     * <tt>retainAll</tt> and <tt>clear</tt> methods.  It does not
-     * support the <tt>add</tt> or <tt>addAll</tt> methods.
+     * mapping from the map, via the {@code Iterator.remove},
+     * {@code Collection.remove}, {@code removeAll},
+     * {@code retainAll} and {@code clear} methods.  It does not
+     * support the {@code add} or {@code addAll} methods.
      *
      * <p><b>While the object returned by this method implements the
-     * <tt>Collection</tt> interface, it does <i>not</i> obey
-     * <tt>Collection's</tt> general contract.  Like its backing map,
+     * {@code Collection} interface, it does <i>not</i> obey
+     * {@code Collection's} general contract.  Like its backing map,
      * the collection returned by this method defines element equality as
      * reference-equality rather than object-equality.  This affects the
-     * behavior of its <tt>contains</tt>, <tt>remove</tt> and
-     * <tt>containsAll</tt> methods.</b>
+     * behavior of its {@code contains}, {@code remove} and
+     * {@code containsAll} methods.</b>
      */
     public Collection<V> values() {
         Collection<V> vs = values;
@@ -1136,36 +1136,36 @@
     /**
      * Returns a {@link Set} view of the mappings contained in this map.
      * Each element in the returned set is a reference-equality-based
-     * <tt>Map.Entry</tt>.  The set is backed by the map, so changes
+     * {@code Map.Entry}.  The set is backed by the map, so changes
      * to the map are reflected in the set, and vice-versa.  If the
      * map is modified while an iteration over the set is in progress,
      * the results of the iteration are undefined.  The set supports
      * element removal, which removes the corresponding mapping from
-     * the map, via the <tt>Iterator.remove</tt>, <tt>Set.remove</tt>,
-     * <tt>removeAll</tt>, <tt>retainAll</tt> and <tt>clear</tt>
-     * methods.  It does not support the <tt>add</tt> or
-     * <tt>addAll</tt> methods.
+     * the map, via the {@code Iterator.remove}, {@code Set.remove},
+     * {@code removeAll}, {@code retainAll} and {@code clear}
+     * methods.  It does not support the {@code add} or
+     * {@code addAll} methods.
      *
-     * <p>Like the backing map, the <tt>Map.Entry</tt> objects in the set
+     * <p>Like the backing map, the {@code Map.Entry} objects in the set
      * returned by this method define key and value equality as
      * reference-equality rather than object-equality.  This affects the
-     * behavior of the <tt>equals</tt> and <tt>hashCode</tt> methods of these
-     * <tt>Map.Entry</tt> objects.  A reference-equality based <tt>Map.Entry
-     * e</tt> is equal to an object <tt>o</tt> if and only if <tt>o</tt> is a
-     * <tt>Map.Entry</tt> and <tt>e.getKey()==o.getKey() &amp;&amp;
-     * e.getValue()==o.getValue()</tt>.  To accommodate these equals
-     * semantics, the <tt>hashCode</tt> method returns
-     * <tt>System.identityHashCode(e.getKey()) ^
-     * System.identityHashCode(e.getValue())</tt>.
+     * behavior of the {@code equals} and {@code hashCode} methods of these
+     * {@code Map.Entry} objects.  A reference-equality based {@code Map.Entry
+     * e} is equal to an object {@code o} if and only if {@code o} is a
+     * {@code Map.Entry} and {@code e.getKey()==o.getKey() &&
+     * e.getValue()==o.getValue()}.  To accommodate these equals
+     * semantics, the {@code hashCode} method returns
+     * {@code System.identityHashCode(e.getKey()) ^
+     * System.identityHashCode(e.getValue())}.
      *
      * <p><b>Owing to the reference-equality-based semantics of the
-     * <tt>Map.Entry</tt> instances in the set returned by this method,
+     * {@code Map.Entry} instances in the set returned by this method,
      * it is possible that the symmetry and transitivity requirements of
      * the {@link Object#equals(Object)} contract may be violated if any of
      * the entries in the set is compared to a normal map entry, or if
      * the set returned by this method is compared to a set of normal map
      * entries (such as would be returned by a call to this method on a normal
-     * map).  However, the <tt>Object.equals</tt> contract is guaranteed to
+     * map).  However, the {@code Object.equals} contract is guaranteed to
      * hold among identity-based map entries, and among sets of such entries.
      * </b>
      *
@@ -1260,11 +1260,11 @@
     private static final long serialVersionUID = 8188218128353913216L;
 
     /**
-     * Saves the state of the <tt>IdentityHashMap</tt> instance to a stream
+     * Saves the state of the {@code IdentityHashMap} instance to a stream
      * (i.e., serializes it).
      *
      * @serialData The <i>size</i> of the HashMap (the number of key-value
-     *          mappings) (<tt>int</tt>), followed by the key (Object) and
+     *          mappings) ({@code int}), followed by the key (Object) and
      *          value (Object) for each key-value mapping represented by the
      *          IdentityHashMap.  The key-value mappings are emitted in no
      *          particular order.
@@ -1289,7 +1289,7 @@
     }
 
     /**
-     * Reconstitutes the <tt>IdentityHashMap</tt> instance from a stream (i.e.,
+     * Reconstitutes the {@code IdentityHashMap} instance from a stream (i.e.,
      * deserializes it).
      */
     private void readObject(java.io.ObjectInputStream s)
--- a/jdk/src/java.base/share/classes/java/util/IllegalFormatCodePointException.java	Thu Apr 09 12:29:31 2015 +0200
+++ b/jdk/src/java.base/share/classes/java/util/IllegalFormatCodePointException.java	Mon Aug 17 12:45:16 2015 +0300
@@ -30,7 +30,7 @@
  * point as defined by {@link Character#isValidCodePoint} is passed to the
  * {@link Formatter}.
  *
- * <p> Unless otherwise specified, passing a <tt>null</tt> argument to any
+ * <p> Unless otherwise specified, passing a {@code null} argument to any
  * method or constructor in this class will cause a {@link
  * NullPointerException} to be thrown.
  *
--- a/jdk/src/java.base/share/classes/java/util/IllegalFormatConversionException.java	Thu Apr 09 12:29:31 2015 +0200
+++ b/jdk/src/java.base/share/classes/java/util/IllegalFormatConversionException.java	Mon Aug 17 12:45:16 2015 +0300
@@ -29,7 +29,7 @@
  * Unchecked exception thrown when the argument corresponding to the format
  * specifier is of an incompatible type.
  *
- * <p> Unless otherwise specified, passing a <tt>null</tt> argument to any
+ * <p> Unless otherwise specified, passing a {@code null} argument to any
  * method or constructor in this class will cause a {@link
  * NullPointerException} to be thrown.
  *
--- a/jdk/src/java.base/share/classes/java/util/IllegalFormatFlagsException.java	Thu Apr 09 12:29:31 2015 +0200
+++ b/jdk/src/java.base/share/classes/java/util/IllegalFormatFlagsException.java	Mon Aug 17 12:45:16 2015 +0300
@@ -28,7 +28,7 @@
 /**
  * Unchecked exception thrown when an illegal combination flags is given.
  *
- * <p> Unless otherwise specified, passing a <tt>null</tt> argument to any
+ * <p> Unless otherwise specified, passing a {@code null} argument to any
  * method or constructor in this class will cause a {@link
  * NullPointerException} to be thrown.
  *
--- a/jdk/src/java.base/share/classes/java/util/IllegalFormatPrecisionException.java	Thu Apr 09 12:29:31 2015 +0200
+++ b/jdk/src/java.base/share/classes/java/util/IllegalFormatPrecisionException.java	Mon Aug 17 12:45:16 2015 +0300
@@ -27,7 +27,7 @@
 
 /**
  * Unchecked exception thrown when the precision is a negative value other than
- * <tt>-1</tt>, the conversion does not support a precision, or the value is
+ * {@code -1}, the conversion does not support a precision, or the value is
  * otherwise unsupported.
  *
  * @since 1.5
--- a/jdk/src/java.base/share/classes/java/util/IllegalFormatWidthException.java	Thu Apr 09 12:29:31 2015 +0200
+++ b/jdk/src/java.base/share/classes/java/util/IllegalFormatWidthException.java	Mon Aug 17 12:45:16 2015 +0300
@@ -27,7 +27,7 @@
 
 /**
  * Unchecked exception thrown when the format width is a negative value other
- * than <tt>-1</tt> or is otherwise unsupported.
+ * than {@code -1} or is otherwise unsupported.
  *
  * @since 1.5
  */
--- a/jdk/src/java.base/share/classes/java/util/InputMismatchException.java	Thu Apr 09 12:29:31 2015 +0200
+++ b/jdk/src/java.base/share/classes/java/util/InputMismatchException.java	Mon Aug 17 12:45:16 2015 +0300
@@ -26,7 +26,7 @@
 package java.util;
 
 /**
- * Thrown by a <code>Scanner</code> to indicate that the token
+ * Thrown by a {@code Scanner} to indicate that the token
  * retrieved does not match the pattern for the expected type, or
  * that the token is out of range for the expected type.
  *
@@ -39,7 +39,7 @@
     private static final long serialVersionUID = 8811230760997066428L;
 
     /**
-     * Constructs an <code>InputMismatchException</code> with <tt>null</tt>
+     * Constructs an {@code InputMismatchException} with {@code null}
      * as its error message string.
      */
     public InputMismatchException() {
@@ -47,9 +47,9 @@
     }
 
     /**
-     * Constructs an <code>InputMismatchException</code>, saving a reference
-     * to the error message string <tt>s</tt> for later retrieval by the
-     * <tt>getMessage</tt> method.
+     * Constructs an {@code InputMismatchException}, saving a reference
+     * to the error message string {@code s} for later retrieval by the
+     * {@code getMessage} method.
      *
      * @param   s   the detail message.
      */
--- a/jdk/src/java.base/share/classes/java/util/JumboEnumSet.java	Thu Apr 09 12:29:31 2015 +0200
+++ b/jdk/src/java.base/share/classes/java/util/JumboEnumSet.java	Mon Aug 17 12:45:16 2015 +0300
@@ -163,19 +163,19 @@
     }
 
     /**
-     * Returns <tt>true</tt> if this set contains no elements.
+     * Returns {@code true} if this set contains no elements.
      *
-     * @return <tt>true</tt> if this set contains no elements
+     * @return {@code true} if this set contains no elements
      */
     public boolean isEmpty() {
         return size == 0;
     }
 
     /**
-     * Returns <tt>true</tt> if this set contains the specified element.
+     * Returns {@code true} if this set contains the specified element.
      *
      * @param e element to be checked for containment in this collection
-     * @return <tt>true</tt> if this set contains the specified element
+     * @return {@code true} if this set contains the specified element
      */
     public boolean contains(Object e) {
         if (e == null)
@@ -194,9 +194,9 @@
      * Adds the specified element to this set if it is not already present.
      *
      * @param e element to be added to this set
-     * @return <tt>true</tt> if the set changed as a result of the call
+     * @return {@code true} if the set changed as a result of the call
      *
-     * @throws NullPointerException if <tt>e</tt> is null
+     * @throws NullPointerException if {@code e} is null
      */
     public boolean add(E e) {
         typeCheck(e);
@@ -216,7 +216,7 @@
      * Removes the specified element from this set if it is present.
      *
      * @param e element to be removed from this set, if present
-     * @return <tt>true</tt> if the set contained the specified element
+     * @return {@code true} if the set contained the specified element
      */
     public boolean remove(Object e) {
         if (e == null)
@@ -238,11 +238,11 @@
     // Bulk Operations
 
     /**
-     * Returns <tt>true</tt> if this set contains all of the elements
+     * Returns {@code true} if this set contains all of the elements
      * in the specified collection.
      *
      * @param c collection to be checked for containment in this set
-     * @return <tt>true</tt> if this set contains all of the elements
+     * @return {@code true} if this set contains all of the elements
      *        in the specified collection
      * @throws NullPointerException if the specified collection is null
      */
@@ -264,7 +264,7 @@
      * Adds all of the elements in the specified collection to this set.
      *
      * @param c collection whose elements are to be added to this set
-     * @return <tt>true</tt> if this set changed as a result of the call
+     * @return {@code true} if this set changed as a result of the call
      * @throws NullPointerException if the specified collection or any of
      *     its elements are null
      */
@@ -291,7 +291,7 @@
      * the specified collection.
      *
      * @param c elements to be removed from this set
-     * @return <tt>true</tt> if this set changed as a result of the call
+     * @return {@code true} if this set changed as a result of the call
      * @throws NullPointerException if the specified collection is null
      */
     public boolean removeAll(Collection<?> c) {
@@ -312,7 +312,7 @@
      * specified collection.
      *
      * @param c elements to be retained in this set
-     * @return <tt>true</tt> if this set changed as a result of the call
+     * @return {@code true} if this set changed as a result of the call
      * @throws NullPointerException if the specified collection is null
      */
     public boolean retainAll(Collection<?> c) {
@@ -341,12 +341,12 @@
 
     /**
      * Compares the specified object with this set for equality.  Returns
-     * <tt>true</tt> if the given object is also a set, the two sets have
+     * {@code true} if the given object is also a set, the two sets have
      * the same size, and every member of the given set is contained in
      * this set.
      *
      * @param o object to be compared for equality with this set
-     * @return <tt>true</tt> if the specified object is equal to this set
+     * @return {@code true} if the specified object is equal to this set
      */
     public boolean equals(Object o) {
         if (!(o instanceof JumboEnumSet))
--- a/jdk/src/java.base/share/classes/java/util/LinkedHashMap.java	Thu Apr 09 12:29:31 2015 +0200
+++ b/jdk/src/java.base/share/classes/java/util/LinkedHashMap.java	Mon Aug 17 12:45:16 2015 +0300
@@ -31,15 +31,15 @@
 import java.io.IOException;
 
 /**
- * <p>Hash table and linked list implementation of the <tt>Map</tt> interface,
+ * <p>Hash table and linked list implementation of the {@code Map} interface,
  * with predictable iteration order.  This implementation differs from
- * <tt>HashMap</tt> in that it maintains a doubly-linked list running through
+ * {@code HashMap} in that it maintains a doubly-linked list running through
  * all of its entries.  This linked list defines the iteration ordering,
  * which is normally the order in which keys were inserted into the map
  * (<i>insertion-order</i>).  Note that insertion order is not affected
- * if a key is <i>re-inserted</i> into the map.  (A key <tt>k</tt> is
- * reinserted into a map <tt>m</tt> if <tt>m.put(k, v)</tt> is invoked when
- * <tt>m.containsKey(k)</tt> would return <tt>true</tt> immediately prior to
+ * if a key is <i>re-inserted</i> into the map.  (A key {@code k} is
+ * reinserted into a map {@code m} if {@code m.put(k, v)} is invoked when
+ * {@code m.containsKey(k)} would return {@code true} immediately prior to
  * the invocation.)
  *
  * <p>This implementation spares its clients from the unspecified, generally
@@ -78,23 +78,23 @@
  * impose a policy for removing stale mappings automatically when new mappings
  * are added to the map.
  *
- * <p>This class provides all of the optional <tt>Map</tt> operations, and
- * permits null elements.  Like <tt>HashMap</tt>, it provides constant-time
- * performance for the basic operations (<tt>add</tt>, <tt>contains</tt> and
- * <tt>remove</tt>), assuming the hash function disperses elements
+ * <p>This class provides all of the optional {@code Map} operations, and
+ * permits null elements.  Like {@code HashMap}, it provides constant-time
+ * performance for the basic operations ({@code add}, {@code contains} and
+ * {@code remove}), assuming the hash function disperses elements
  * properly among the buckets.  Performance is likely to be just slightly
- * below that of <tt>HashMap</tt>, due to the added expense of maintaining the
+ * below that of {@code HashMap}, due to the added expense of maintaining the
  * linked list, with one exception: Iteration over the collection-views
- * of a <tt>LinkedHashMap</tt> requires time proportional to the <i>size</i>
- * of the map, regardless of its capacity.  Iteration over a <tt>HashMap</tt>
+ * of a {@code LinkedHashMap} requires time proportional to the <i>size</i>
+ * of the map, regardless of its capacity.  Iteration over a {@code HashMap}
  * is likely to be more expensive, requiring time proportional to its
  * <i>capacity</i>.
  *
  * <p>A linked hash map has two parameters that affect its performance:
  * <i>initial capacity</i> and <i>load factor</i>.  They are defined precisely
- * as for <tt>HashMap</tt>.  Note, however, that the penalty for choosing an
+ * as for {@code HashMap}.  Note, however, that the penalty for choosing an
  * excessively high value for initial capacity is less severe for this class
- * than for <tt>HashMap</tt>, as iteration times for this class are unaffected
+ * than for {@code HashMap}, as iteration times for this class are unaffected
  * by capacity.
  *
  * <p><strong>Note that this implementation is not synchronized.</strong>
@@ -114,14 +114,14 @@
  * iteration order.  In insertion-ordered linked hash maps, merely changing
  * the value associated with a key that is already contained in the map is not
  * a structural modification.  <strong>In access-ordered linked hash maps,
- * merely querying the map with <tt>get</tt> is a structural modification.
+ * merely querying the map with {@code get} is a structural modification.
  * </strong>)
  *
- * <p>The iterators returned by the <tt>iterator</tt> method of the collections
+ * <p>The iterators returned by the {@code iterator} method of the collections
  * returned by all of this class's collection view methods are
  * <em>fail-fast</em>: if the map is structurally modified at any time after
  * the iterator is created, in any way except through the iterator's own
- * <tt>remove</tt> method, the iterator will throw a {@link
+ * {@code remove} method, the iterator will throw a {@link
  * ConcurrentModificationException}.  Thus, in the face of concurrent
  * modification, the iterator fails quickly and cleanly, rather than risking
  * arbitrary, non-deterministic behavior at an undetermined time in the future.
@@ -129,7 +129,7 @@
  * <p>Note that the fail-fast behavior of an iterator cannot be guaranteed
  * as it is, generally speaking, impossible to make any hard guarantees in the
  * presence of unsynchronized concurrent modification.  Fail-fast iterators
- * throw <tt>ConcurrentModificationException</tt> on a best-effort basis.
+ * throw {@code ConcurrentModificationException} on a best-effort basis.
  * Therefore, it would be wrong to write a program that depended on this
  * exception for its correctness:   <i>the fail-fast behavior of iterators
  * should be used only to detect bugs.</i>
@@ -209,8 +209,8 @@
     transient LinkedHashMap.Entry<K,V> tail;
 
     /**
-     * The iteration ordering method for this linked hash map: <tt>true</tt>
-     * for access-order, <tt>false</tt> for insertion-order.
+     * The iteration ordering method for this linked hash map: {@code true}
+     * for access-order, {@code false} for insertion-order.
      *
      * @serial
      */
@@ -335,7 +335,7 @@
     }
 
     /**
-     * Constructs an empty insertion-ordered <tt>LinkedHashMap</tt> instance
+     * Constructs an empty insertion-ordered {@code LinkedHashMap} instance
      * with the specified initial capacity and load factor.
      *
      * @param  initialCapacity the initial capacity
@@ -349,7 +349,7 @@
     }
 
     /**
-     * Constructs an empty insertion-ordered <tt>LinkedHashMap</tt> instance
+     * Constructs an empty insertion-ordered {@code LinkedHashMap} instance
      * with the specified initial capacity and a default load factor (0.75).
      *
      * @param  initialCapacity the initial capacity
@@ -361,7 +361,7 @@
     }
 
     /**
-     * Constructs an empty insertion-ordered <tt>LinkedHashMap</tt> instance
+     * Constructs an empty insertion-ordered {@code LinkedHashMap} instance
      * with the default initial capacity (16) and load factor (0.75).
      */
     public LinkedHashMap() {
@@ -370,8 +370,8 @@
     }
 
     /**
-     * Constructs an insertion-ordered <tt>LinkedHashMap</tt> instance with
-     * the same mappings as the specified map.  The <tt>LinkedHashMap</tt>
+     * Constructs an insertion-ordered {@code LinkedHashMap} instance with
+     * the same mappings as the specified map.  The {@code LinkedHashMap}
      * instance is created with a default load factor (0.75) and an initial
      * capacity sufficient to hold the mappings in the specified map.
      *
@@ -385,13 +385,13 @@
     }
 
     /**
-     * Constructs an empty <tt>LinkedHashMap</tt> instance with the
+     * Constructs an empty {@code LinkedHashMap} instance with the
      * specified initial capacity, load factor and ordering mode.
      *
      * @param  initialCapacity the initial capacity
      * @param  loadFactor      the load factor
-     * @param  accessOrder     the ordering mode - <tt>true</tt> for
-     *         access-order, <tt>false</tt> for insertion-order
+     * @param  accessOrder     the ordering mode - {@code true} for
+     *         access-order, {@code false} for insertion-order
      * @throws IllegalArgumentException if the initial capacity is negative
      *         or the load factor is nonpositive
      */
@@ -404,11 +404,11 @@
 
 
     /**
-     * Returns <tt>true</tt> if this map maps one or more keys to the
+     * Returns {@code true} if this map maps one or more keys to the
      * specified value.
      *
      * @param value value whose presence in this map is to be tested
-     * @return <tt>true</tt> if this map maps one or more keys to the
+     * @return {@code true} if this map maps one or more keys to the
      *         specified value
      */
     public boolean containsValue(Object value) {
@@ -465,8 +465,8 @@
     }
 
     /**
-     * Returns <tt>true</tt> if this map should remove its eldest entry.
-     * This method is invoked by <tt>put</tt> and <tt>putAll</tt> after
+     * Returns {@code true} if this map should remove its eldest entry.
+     * This method is invoked by {@code put} and {@code putAll} after
      * inserting a new entry into the map.  It provides the implementor
      * with the opportunity to remove the eldest entry each time a new one
      * is added.  This is useful if the map represents a cache: it allows
@@ -487,23 +487,23 @@
      * instead allowing the map to modify itself as directed by its
      * return value.  It <i>is</i> permitted for this method to modify
      * the map directly, but if it does so, it <i>must</i> return
-     * <tt>false</tt> (indicating that the map should not attempt any
-     * further modification).  The effects of returning <tt>true</tt>
+     * {@code false} (indicating that the map should not attempt any
+     * further modification).  The effects of returning {@code true}
      * after modifying the map from within this method are unspecified.
      *
-     * <p>This implementation merely returns <tt>false</tt> (so that this
+     * <p>This implementation merely returns {@code false} (so that this
      * map acts like a normal map - the eldest element is never removed).
      *
      * @param    eldest The least recently inserted entry in the map, or if
      *           this is an access-ordered map, the least recently accessed
      *           entry.  This is the entry that will be removed it this
-     *           method returns <tt>true</tt>.  If the map was empty prior
-     *           to the <tt>put</tt> or <tt>putAll</tt> invocation resulting
+     *           method returns {@code true}.  If the map was empty prior
+     *           to the {@code put} or {@code putAll} invocation resulting
      *           in this invocation, this will be the entry that was just
      *           inserted; in other words, if the map contains a single
      *           entry, the eldest entry is also the newest.
-     * @return   <tt>true</tt> if the eldest entry should be removed
-     *           from the map; <tt>false</tt> if it should be retained.
+     * @return   {@code true} if the eldest entry should be removed
+     *           from the map; {@code false} if it should be retained.
      */
     protected boolean removeEldestEntry(Map.Entry<K,V> eldest) {
         return false;
@@ -514,12 +514,12 @@
      * The set is backed by the map, so changes to the map are
      * reflected in the set, and vice-versa.  If the map is modified
      * while an iteration over the set is in progress (except through
-     * the iterator's own <tt>remove</tt> operation), the results of
+     * the iterator's own {@code remove} operation), the results of
      * the iteration are undefined.  The set supports element removal,
      * which removes the corresponding mapping from the map, via the
-     * <tt>Iterator.remove</tt>, <tt>Set.remove</tt>,
-     * <tt>removeAll</tt>, <tt>retainAll</tt>, and <tt>clear</tt>
-     * operations.  It does not support the <tt>add</tt> or <tt>addAll</tt>
+     * {@code Iterator.remove}, {@code Set.remove},
+     * {@code removeAll}, {@code retainAll}, and {@code clear}
+     * operations.  It does not support the {@code add} or {@code addAll}
      * operations.
      * Its {@link Spliterator} typically provides faster sequential
      * performance but much poorer parallel performance than that of
@@ -563,13 +563,13 @@
      * The collection is backed by the map, so changes to the map are
      * reflected in the collection, and vice-versa.  If the map is
      * modified while an iteration over the collection is in progress
-     * (except through the iterator's own <tt>remove</tt> operation),
+     * (except through the iterator's own {@code remove} operation),
      * the results of the iteration are undefined.  The collection
      * supports element removal, which removes the corresponding
-     * mapping from the map, via the <tt>Iterator.remove</tt>,
-     * <tt>Collection.remove</tt>, <tt>removeAll</tt>,
-     * <tt>retainAll</tt> and <tt>clear</tt> operations.  It does not
-     * support the <tt>add</tt> or <tt>addAll</tt> operations.
+     * mapping from the map, via the {@code Iterator.remove},
+     * {@code Collection.remove}, {@code removeAll},
+     * {@code retainAll} and {@code clear} operations.  It does not
+     * support the {@code add} or {@code addAll} operations.
      * Its {@link Spliterator} typically provides faster sequential
      * performance but much poorer parallel performance than that of
      * {@code HashMap}.
@@ -608,14 +608,14 @@
      * The set is backed by the map, so changes to the map are
      * reflected in the set, and vice-versa.  If the map is modified
      * while an iteration over the set is in progress (except through
-     * the iterator's own <tt>remove</tt> operation, or through the
-     * <tt>setValue</tt> operation on a map entry returned by the
+     * the iterator's own {@code remove} operation, or through the
+     * {@code setValue} operation on a map entry returned by the
      * iterator) the results of the iteration are undefined.  The set
      * supports element removal, which removes the corresponding
-     * mapping from the map, via the <tt>Iterator.remove</tt>,
-     * <tt>Set.remove</tt>, <tt>removeAll</tt>, <tt>retainAll</tt> and
-     * <tt>clear</tt> operations.  It does not support the
-     * <tt>add</tt> or <tt>addAll</tt> operations.
+     * mapping from the map, via the {@code Iterator.remove},
+     * {@code Set.remove}, {@code removeAll}, {@code retainAll} and
+     * {@code clear} operations.  It does not support the
+     * {@code add} or {@code addAll} operations.
      * Its {@link Spliterator} typically provides faster sequential
      * performance but much poorer parallel performance than that of
      * {@code HashMap}.
--- a/jdk/src/java.base/share/classes/java/util/LinkedHashSet.java	Thu Apr 09 12:29:31 2015 +0200
+++ b/jdk/src/java.base/share/classes/java/util/LinkedHashSet.java	Mon Aug 17 12:45:16 2015 +0300
@@ -26,15 +26,15 @@
 package java.util;
 
 /**
- * <p>Hash table and linked list implementation of the <tt>Set</tt> interface,
+ * <p>Hash table and linked list implementation of the {@code Set} interface,
  * with predictable iteration order.  This implementation differs from
- * <tt>HashSet</tt> in that it maintains a doubly-linked list running through
+ * {@code HashSet} in that it maintains a doubly-linked list running through
  * all of its entries.  This linked list defines the iteration ordering,
  * which is the order in which elements were inserted into the set
  * (<i>insertion-order</i>).  Note that insertion order is <i>not</i> affected
- * if an element is <i>re-inserted</i> into the set.  (An element <tt>e</tt>
- * is reinserted into a set <tt>s</tt> if <tt>s.add(e)</tt> is invoked when
- * <tt>s.contains(e)</tt> would return <tt>true</tt> immediately prior to
+ * if an element is <i>re-inserted</i> into the set.  (An element {@code e}
+ * is reinserted into a set {@code s} if {@code s.add(e)} is invoked when
+ * {@code s.contains(e)} would return {@code true} immediately prior to
  * the invocation.)
  *
  * <p>This implementation spares its clients from the unspecified, generally
@@ -53,22 +53,22 @@
  * the copy.  (Clients generally appreciate having things returned in the same
  * order they were presented.)
  *
- * <p>This class provides all of the optional <tt>Set</tt> operations, and
- * permits null elements.  Like <tt>HashSet</tt>, it provides constant-time
- * performance for the basic operations (<tt>add</tt>, <tt>contains</tt> and
- * <tt>remove</tt>), assuming the hash function disperses elements
+ * <p>This class provides all of the optional {@code Set} operations, and
+ * permits null elements.  Like {@code HashSet}, it provides constant-time
+ * performance for the basic operations ({@code add}, {@code contains} and
+ * {@code remove}), assuming the hash function disperses elements
  * properly among the buckets.  Performance is likely to be just slightly
- * below that of <tt>HashSet</tt>, due to the added expense of maintaining the
- * linked list, with one exception: Iteration over a <tt>LinkedHashSet</tt>
+ * below that of {@code HashSet}, due to the added expense of maintaining the
+ * linked list, with one exception: Iteration over a {@code LinkedHashSet}
  * requires time proportional to the <i>size</i> of the set, regardless of
- * its capacity.  Iteration over a <tt>HashSet</tt> is likely to be more
+ * its capacity.  Iteration over a {@code HashSet} is likely to be more
  * expensive, requiring time proportional to its <i>capacity</i>.
  *
  * <p>A linked hash set has two parameters that affect its performance:
  * <i>initial capacity</i> and <i>load factor</i>.  They are defined precisely
- * as for <tt>HashSet</tt>.  Note, however, that the penalty for choosing an
+ * as for {@code HashSet}.  Note, however, that the penalty for choosing an
  * excessively high value for initial capacity is less severe for this class
- * than for <tt>HashSet</tt>, as iteration times for this class are unaffected
+ * than for {@code HashSet}, as iteration times for this class are unaffected
  * by capacity.
  *
  * <p><strong>Note that this implementation is not synchronized.</strong>
@@ -83,9 +83,9 @@
  * unsynchronized access to the set: <pre>
  *   Set s = Collections.synchronizedSet(new LinkedHashSet(...));</pre>
  *
- * <p>The iterators returned by this class's <tt>iterator</tt> method are
+ * <p>The iterators returned by this class's {@code iterator} method are
  * <em>fail-fast</em>: if the set is modified at any time after the iterator
- * is created, in any way except through the iterator's own <tt>remove</tt>
+ * is created, in any way except through the iterator's own {@code remove}
  * method, the iterator will throw a {@link ConcurrentModificationException}.
  * Thus, in the face of concurrent modification, the iterator fails quickly
  * and cleanly, rather than risking arbitrary, non-deterministic behavior at
@@ -94,7 +94,7 @@
  * <p>Note that the fail-fast behavior of an iterator cannot be guaranteed
  * as it is, generally speaking, impossible to make any hard guarantees in the
  * presence of unsynchronized concurrent modification.  Fail-fast iterators
- * throw <tt>ConcurrentModificationException</tt> on a best-effort basis.
+ * throw {@code ConcurrentModificationException} on a best-effort basis.
  * Therefore, it would be wrong to write a program that depended on this
  * exception for its correctness:   <i>the fail-fast behavior of iterators
  * should be used only to detect bugs.</i>
--- a/jdk/src/java.base/share/classes/java/util/LinkedList.java	Thu Apr 09 12:29:31 2015 +0200
+++ b/jdk/src/java.base/share/classes/java/util/LinkedList.java	Mon Aug 17 12:45:16 2015 +0300
@@ -312,7 +312,7 @@
      * Returns {@code true} if this list contains the specified element.
      * More formally, returns {@code true} if and only if this list contains
      * at least one element {@code e} such that
-     * <tt>(o==null&nbsp;?&nbsp;e==null&nbsp;:&nbsp;o.equals(e))</tt>.
+     * {@code Objects.equals(o, e)}.
      *
      * @param o element whose presence in this list is to be tested
      * @return {@code true} if this list contains the specified element
@@ -348,7 +348,7 @@
      * if it is present.  If this list does not contain the element, it is
      * unchanged.  More formally, removes the element with the lowest index
      * {@code i} such that
-     * <tt>(o==null&nbsp;?&nbsp;get(i)==null&nbsp;:&nbsp;o.equals(get(i)))</tt>
+     * {@code Objects.equals(o, get(i))}
      * (if such an element exists).  Returns {@code true} if this list
      * contained the specified element (or equivalently, if this list
      * changed as a result of the call).
@@ -589,7 +589,7 @@
      * Returns the index of the first occurrence of the specified element
      * in this list, or -1 if this list does not contain the element.
      * More formally, returns the lowest index {@code i} such that
-     * <tt>(o==null&nbsp;?&nbsp;get(i)==null&nbsp;:&nbsp;o.equals(get(i)))</tt>,
+     * {@code Objects.equals(o, get(i))},
      * or -1 if there is no such index.
      *
      * @param o element to search for
@@ -618,7 +618,7 @@
      * Returns the index of the last occurrence of the specified element
      * in this list, or -1 if this list does not contain the element.
      * More formally, returns the highest index {@code i} such that
-     * <tt>(o==null&nbsp;?&nbsp;get(i)==null&nbsp;:&nbsp;o.equals(get(i)))</tt>,
+     * {@code Objects.equals(o, get(i))},
      * or -1 if there is no such index.
      *
      * @param o element to search for
--- a/jdk/src/java.base/share/classes/java/util/List.java	Thu Apr 09 12:29:31 2015 +0200
+++ b/jdk/src/java.base/share/classes/java/util/List.java	Mon Aug 17 12:45:16 2015 +0300
@@ -34,50 +34,50 @@
  * the list), and search for elements in the list.<p>
  *
  * Unlike sets, lists typically allow duplicate elements.  More formally,
- * lists typically allow pairs of elements <tt>e1</tt> and <tt>e2</tt>
- * such that <tt>e1.equals(e2)</tt>, and they typically allow multiple
+ * lists typically allow pairs of elements {@code e1} and {@code e2}
+ * such that {@code e1.equals(e2)}, and they typically allow multiple
  * null elements if they allow null elements at all.  It is not inconceivable
  * that someone might wish to implement a list that prohibits duplicates, by
  * throwing runtime exceptions when the user attempts to insert them, but we
  * expect this usage to be rare.<p>
  *
- * The <tt>List</tt> interface places additional stipulations, beyond those
- * specified in the <tt>Collection</tt> interface, on the contracts of the
- * <tt>iterator</tt>, <tt>add</tt>, <tt>remove</tt>, <tt>equals</tt>, and
- * <tt>hashCode</tt> methods.  Declarations for other inherited methods are
+ * The {@code List} interface places additional stipulations, beyond those
+ * specified in the {@code Collection} interface, on the contracts of the
+ * {@code iterator}, {@code add}, {@code remove}, {@code equals}, and
+ * {@code hashCode} methods.  Declarations for other inherited methods are
  * also included here for convenience.<p>
  *
- * The <tt>List</tt> interface provides four methods for positional (indexed)
+ * The {@code List} interface provides four methods for positional (indexed)
  * access to list elements.  Lists (like Java arrays) are zero based.  Note
  * that these operations may execute in time proportional to the index value
- * for some implementations (the <tt>LinkedList</tt> class, for
+ * for some implementations (the {@code LinkedList} class, for
  * example). Thus, iterating over the elements in a list is typically
  * preferable to indexing through it if the caller does not know the
  * implementation.<p>
  *
- * The <tt>List</tt> interface provides a special iterator, called a
- * <tt>ListIterator</tt>, that allows element insertion and replacement, and
+ * The {@code List} interface provides a special iterator, called a
+ * {@code ListIterator}, that allows element insertion and replacement, and
  * bidirectional access in addition to the normal operations that the
- * <tt>Iterator</tt> interface provides.  A method is provided to obtain a
+ * {@code Iterator} interface provides.  A method is provided to obtain a
  * list iterator that starts at a specified position in the list.<p>
  *
- * The <tt>List</tt> interface provides two methods to search for a specified
+ * The {@code List} interface provides two methods to search for a specified
  * object.  From a performance standpoint, these methods should be used with
  * caution.  In many implementations they will perform costly linear
  * searches.<p>
  *
- * The <tt>List</tt> interface provides two methods to efficiently insert and
+ * The {@code List} interface provides two methods to efficiently insert and
  * remove multiple elements at an arbitrary point in the list.<p>
  *
  * Note: While it is permissible for lists to contain themselves as elements,
- * extreme caution is advised: the <tt>equals</tt> and <tt>hashCode</tt>
+ * extreme caution is advised: the {@code equals} and {@code hashCode}
  * methods are no longer well defined on such a list.
  *
  * <p>Some list implementations have restrictions on the elements that
  * they may contain.  For example, some implementations prohibit null elements,
  * and some have restrictions on the types of their elements.  Attempting to
  * add an ineligible element throws an unchecked exception, typically
- * <tt>NullPointerException</tt> or <tt>ClassCastException</tt>.  Attempting
+ * {@code NullPointerException} or {@code ClassCastException}.  Attempting
  * to query the presence of an ineligible element may throw an exception,
  * or it may simply return false; some implementations will exhibit the former
  * behavior and some will exhibit the latter.  More generally, attempting an
@@ -113,28 +113,28 @@
 
     /**
      * Returns the number of elements in this list.  If this list contains
-     * more than <tt>Integer.MAX_VALUE</tt> elements, returns
-     * <tt>Integer.MAX_VALUE</tt>.
+     * more than {@code Integer.MAX_VALUE} elements, returns
+     * {@code Integer.MAX_VALUE}.
      *
      * @return the number of elements in this list
      */
     int size();
 
     /**
-     * Returns <tt>true</tt> if this list contains no elements.
+     * Returns {@code true} if this list contains no elements.
      *
-     * @return <tt>true</tt> if this list contains no elements
+     * @return {@code true} if this list contains no elements
      */
     boolean isEmpty();
 
     /**
-     * Returns <tt>true</tt> if this list contains the specified element.
-     * More formally, returns <tt>true</tt> if and only if this list contains
-     * at least one element <tt>e</tt> such that
-     * <tt>(o==null&nbsp;?&nbsp;e==null&nbsp;:&nbsp;o.equals(e))</tt>.
+     * Returns {@code true} if this list contains the specified element.
+     * More formally, returns {@code true} if and only if this list contains
+     * at least one element {@code e} such that
+     * {@code Objects.equals(o, e)}.
      *
      * @param o element whose presence in this list is to be tested
-     * @return <tt>true</tt> if this list contains the specified element
+     * @return {@code true} if this list contains the specified element
      * @throws ClassCastException if the type of the specified element
      *         is incompatible with this list
      * (<a href="Collection.html#optional-restrictions">optional</a>)
@@ -179,7 +179,7 @@
      *
      * <p>If the list fits in the specified array with room to spare (i.e.,
      * the array has more elements than the list), the element in the array
-     * immediately following the end of the list is set to <tt>null</tt>.
+     * immediately following the end of the list is set to {@code null}.
      * (This is useful in determining the length of the list <i>only</i> if
      * the caller knows that the list does not contain any null elements.)
      *
@@ -188,16 +188,16 @@
      * precise control over the runtime type of the output array, and may,
      * under certain circumstances, be used to save allocation costs.
      *
-     * <p>Suppose <tt>x</tt> is a list known to contain only strings.
+     * <p>Suppose {@code x} is a list known to contain only strings.
      * The following code can be used to dump the list into a newly
-     * allocated array of <tt>String</tt>:
+     * allocated array of {@code String}:
      *
      * <pre>{@code
      *     String[] y = x.toArray(new String[0]);
      * }</pre>
      *
-     * Note that <tt>toArray(new Object[0])</tt> is identical in function to
-     * <tt>toArray()</tt>.
+     * Note that {@code toArray(new Object[0])} is identical in function to
+     * {@code toArray()}.
      *
      * @param a the array into which the elements of this list are to
      *          be stored, if it is big enough; otherwise, a new array of the
@@ -225,8 +225,8 @@
      * on what elements may be added.
      *
      * @param e element to be appended to this list
-     * @return <tt>true</tt> (as specified by {@link Collection#add})
-     * @throws UnsupportedOperationException if the <tt>add</tt> operation
+     * @return {@code true} (as specified by {@link Collection#add})
+     * @throws UnsupportedOperationException if the {@code add} operation
      *         is not supported by this list
      * @throws ClassCastException if the class of the specified element
      *         prevents it from being added to this list
@@ -241,21 +241,21 @@
      * Removes the first occurrence of the specified element from this list,
      * if it is present (optional operation).  If this list does not contain
      * the element, it is unchanged.  More formally, removes the element with
-     * the lowest index <tt>i</tt> such that
-     * <tt>(o==null&nbsp;?&nbsp;get(i)==null&nbsp;:&nbsp;o.equals(get(i)))</tt>
-     * (if such an element exists).  Returns <tt>true</tt> if this list
+     * the lowest index {@code i} such that
+     * {@code Objects.equals(o, get(i))}
+     * (if such an element exists).  Returns {@code true} if this list
      * contained the specified element (or equivalently, if this list changed
      * as a result of the call).
      *
      * @param o element to be removed from this list, if present
-     * @return <tt>true</tt> if this list contained the specified element
+     * @return {@code true} if this list contained the specified element
      * @throws ClassCastException if the type of the specified element
      *         is incompatible with this list
      * (<a href="Collection.html#optional-restrictions">optional</a>)
      * @throws NullPointerException if the specified element is null and this
      *         list does not permit null elements
      * (<a href="Collection.html#optional-restrictions">optional</a>)
-     * @throws UnsupportedOperationException if the <tt>remove</tt> operation
+     * @throws UnsupportedOperationException if the {@code remove} operation
      *         is not supported by this list
      */
     boolean remove(Object o);
@@ -264,11 +264,11 @@
     // Bulk Modification Operations
 
     /**
-     * Returns <tt>true</tt> if this list contains all of the elements of the
+     * Returns {@code true} if this list contains all of the elements of the
      * specified collection.
      *
      * @param  c collection to be checked for containment in this list
-     * @return <tt>true</tt> if this list contains all of the elements of the
+     * @return {@code true} if this list contains all of the elements of the
      *         specified collection
      * @throws ClassCastException if the types of one or more elements
      *         in the specified collection are incompatible with this
@@ -292,8 +292,8 @@
      * specified collection is this list, and it's nonempty.)
      *
      * @param c collection containing elements to be added to this list
-     * @return <tt>true</tt> if this list changed as a result of the call
-     * @throws UnsupportedOperationException if the <tt>addAll</tt> operation
+     * @return {@code true} if this list changed as a result of the call
+     * @throws UnsupportedOperationException if the {@code addAll} operation
      *         is not supported by this list
      * @throws ClassCastException if the class of an element of the specified
      *         collection prevents it from being added to this list
@@ -320,8 +320,8 @@
      * @param index index at which to insert the first element from the
      *              specified collection
      * @param c collection containing elements to be added to this list
-     * @return <tt>true</tt> if this list changed as a result of the call
-     * @throws UnsupportedOperationException if the <tt>addAll</tt> operation
+     * @return {@code true} if this list changed as a result of the call
+     * @throws UnsupportedOperationException if the {@code addAll} operation
      *         is not supported by this list
      * @throws ClassCastException if the class of an element of the specified
      *         collection prevents it from being added to this list
@@ -331,7 +331,7 @@
      * @throws IllegalArgumentException if some property of an element of the
      *         specified collection prevents it from being added to this list
      * @throws IndexOutOfBoundsException if the index is out of range
-     *         (<tt>index &lt; 0 || index &gt; size()</tt>)
+     *         ({@code index < 0 || index > size()})
      */
     boolean addAll(int index, Collection<? extends E> c);
 
@@ -340,8 +340,8 @@
      * specified collection (optional operation).
      *
      * @param c collection containing elements to be removed from this list
-     * @return <tt>true</tt> if this list changed as a result of the call
-     * @throws UnsupportedOperationException if the <tt>removeAll</tt> operation
+     * @return {@code true} if this list changed as a result of the call
+     * @throws UnsupportedOperationException if the {@code removeAll} operation
      *         is not supported by this list
      * @throws ClassCastException if the class of an element of this list
      *         is incompatible with the specified collection
@@ -362,8 +362,8 @@
      * specified collection.
      *
      * @param c collection containing elements to be retained in this list
-     * @return <tt>true</tt> if this list changed as a result of the call
-     * @throws UnsupportedOperationException if the <tt>retainAll</tt> operation
+     * @return {@code true} if this list changed as a result of the call
+     * @throws UnsupportedOperationException if the {@code retainAll} operation
      *         is not supported by this list
      * @throws ClassCastException if the class of an element of this list
      *         is incompatible with the specified collection
@@ -487,7 +487,7 @@
      * Removes all of the elements from this list (optional operation).
      * The list will be empty after this call returns.
      *
-     * @throws UnsupportedOperationException if the <tt>clear</tt> operation
+     * @throws UnsupportedOperationException if the {@code clear} operation
      *         is not supported by this list
      */
     void clear();
@@ -497,17 +497,17 @@
 
     /**
      * Compares the specified object with this list for equality.  Returns
-     * <tt>true</tt> if and only if the specified object is also a list, both
+     * {@code true} if and only if the specified object is also a list, both
      * lists have the same size, and all corresponding pairs of elements in
-     * the two lists are <i>equal</i>.  (Two elements <tt>e1</tt> and
-     * <tt>e2</tt> are <i>equal</i> if <tt>(e1==null ? e2==null :
-     * e1.equals(e2))</tt>.)  In other words, two lists are defined to be
+     * the two lists are <i>equal</i>.  (Two elements {@code e1} and
+     * {@code e2} are <i>equal</i> if {@code Objects.equals(e1, e2)}.)
+     * In other words, two lists are defined to be
      * equal if they contain the same elements in the same order.  This
      * definition ensures that the equals method works properly across
-     * different implementations of the <tt>List</tt> interface.
+     * different implementations of the {@code List} interface.
      *
      * @param o the object to be compared for equality with this list
-     * @return <tt>true</tt> if the specified object is equal to this list
+     * @return {@code true} if the specified object is equal to this list
      */
     boolean equals(Object o);
 
@@ -519,9 +519,9 @@
      *     for (E e : list)
      *         hashCode = 31*hashCode + (e==null ? 0 : e.hashCode());
      * }</pre>
-     * This ensures that <tt>list1.equals(list2)</tt> implies that
-     * <tt>list1.hashCode()==list2.hashCode()</tt> for any two lists,
-     * <tt>list1</tt> and <tt>list2</tt>, as required by the general
+     * This ensures that {@code list1.equals(list2)} implies that
+     * {@code list1.hashCode()==list2.hashCode()} for any two lists,
+     * {@code list1} and {@code list2}, as required by the general
      * contract of {@link Object#hashCode}.
      *
      * @return the hash code value for this list
@@ -539,7 +539,7 @@
      * @param index index of the element to return
      * @return the element at the specified position in this list
      * @throws IndexOutOfBoundsException if the index is out of range
-     *         (<tt>index &lt; 0 || index &gt;= size()</tt>)
+     *         ({@code index < 0 || index >= size()})
      */
     E get(int index);
 
@@ -550,7 +550,7 @@
      * @param index index of the element to replace
      * @param element element to be stored at the specified position
      * @return the element previously at the specified position
-     * @throws UnsupportedOperationException if the <tt>set</tt> operation
+     * @throws UnsupportedOperationException if the {@code set} operation
      *         is not supported by this list
      * @throws ClassCastException if the class of the specified element
      *         prevents it from being added to this list
@@ -559,7 +559,7 @@
      * @throws IllegalArgumentException if some property of the specified
      *         element prevents it from being added to this list
      * @throws IndexOutOfBoundsException if the index is out of range
-     *         (<tt>index &lt; 0 || index &gt;= size()</tt>)
+     *         ({@code index < 0 || index >= size()})
      */
     E set(int index, E element);
 
@@ -571,7 +571,7 @@
      *
      * @param index index at which the specified element is to be inserted
      * @param element element to be inserted
-     * @throws UnsupportedOperationException if the <tt>add</tt> operation
+     * @throws UnsupportedOperationException if the {@code add} operation
      *         is not supported by this list
      * @throws ClassCastException if the class of the specified element
      *         prevents it from being added to this list
@@ -580,7 +580,7 @@
      * @throws IllegalArgumentException if some property of the specified
      *         element prevents it from being added to this list
      * @throws IndexOutOfBoundsException if the index is out of range
-     *         (<tt>index &lt; 0 || index &gt; size()</tt>)
+     *         ({@code index < 0 || index > size()})
      */
     void add(int index, E element);
 
@@ -592,10 +592,10 @@
      *
      * @param index the index of the element to be removed
      * @return the element previously at the specified position
-     * @throws UnsupportedOperationException if the <tt>remove</tt> operation
+     * @throws UnsupportedOperationException if the {@code remove} operation
      *         is not supported by this list
      * @throws IndexOutOfBoundsException if the index is out of range
-     *         (<tt>index &lt; 0 || index &gt;= size()</tt>)
+     *         ({@code index < 0 || index >= size()})
      */
     E remove(int index);
 
@@ -605,8 +605,8 @@
     /**
      * Returns the index of the first occurrence of the specified element
      * in this list, or -1 if this list does not contain the element.
-     * More formally, returns the lowest index <tt>i</tt> such that
-     * <tt>(o==null&nbsp;?&nbsp;get(i)==null&nbsp;:&nbsp;o.equals(get(i)))</tt>,
+     * More formally, returns the lowest index {@code i} such that
+     * {@code Objects.equals(o, get(i))},
      * or -1 if there is no such index.
      *
      * @param o element to search for
@@ -624,8 +624,8 @@
     /**
      * Returns the index of the last occurrence of the specified element
      * in this list, or -1 if this list does not contain the element.
-     * More formally, returns the highest index <tt>i</tt> such that
-     * <tt>(o==null&nbsp;?&nbsp;get(i)==null&nbsp;:&nbsp;o.equals(get(i)))</tt>,
+     * More formally, returns the highest index {@code i} such that
+     * {@code Objects.equals(o, get(i))},
      * or -1 if there is no such index.
      *
      * @param o element to search for
@@ -673,8 +673,8 @@
 
     /**
      * Returns a view of the portion of this list between the specified
-     * <tt>fromIndex</tt>, inclusive, and <tt>toIndex</tt>, exclusive.  (If
-     * <tt>fromIndex</tt> and <tt>toIndex</tt> are equal, the returned list is
+     * {@code fromIndex}, inclusive, and {@code toIndex}, exclusive.  (If
+     * {@code fromIndex} and {@code toIndex} are equal, the returned list is
      * empty.)  The returned list is backed by this list, so non-structural
      * changes in the returned list are reflected in this list, and vice-versa.
      * The returned list supports all of the optional list operations supported
@@ -688,9 +688,9 @@
      * <pre>{@code
      *      list.subList(from, to).clear();
      * }</pre>
-     * Similar idioms may be constructed for <tt>indexOf</tt> and
-     * <tt>lastIndexOf</tt>, and all of the algorithms in the
-     * <tt>Collections</tt> class can be applied to a subList.<p>
+     * Similar idioms may be constructed for {@code indexOf} and
+     * {@code lastIndexOf}, and all of the algorithms in the
+     * {@code Collections} class can be applied to a subList.<p>
      *
      * The semantics of the list returned by this method become undefined if
      * the backing list (i.e., this list) is <i>structurally modified</i> in
@@ -702,8 +702,8 @@
      * @param toIndex high endpoint (exclusive) of the subList
      * @return a view of the specified range within this list
      * @throws IndexOutOfBoundsException for an illegal endpoint index value
-     *         (<tt>fromIndex &lt; 0 || toIndex &gt; size ||
-     *         fromIndex &gt; toIndex</tt>)
+     *         ({@code fromIndex < 0 || toIndex > size ||
+     *         fromIndex > toIndex})
      */
     List<E> subList(int fromIndex, int toIndex);
 
--- a/jdk/src/java.base/share/classes/java/util/Locale.java	Thu Apr 09 12:29:31 2015 +0200
+++ b/jdk/src/java.base/share/classes/java/util/Locale.java	Mon Aug 17 12:45:16 2015 +0300
@@ -413,24 +413,24 @@
  *
  * <p>For compatibility reasons, two
  * non-conforming locales are treated as special cases.  These are
- * <b><tt>ja_JP_JP</tt></b> and <b><tt>th_TH_TH</tt></b>. These are ill-formed
+ * <b>{@code ja_JP_JP}</b> and <b>{@code th_TH_TH}</b>. These are ill-formed
  * in BCP 47 since the variants are too short. To ease migration to BCP 47,
  * these are treated specially during construction.  These two cases (and only
  * these) cause a constructor to generate an extension, all other values behave
  * exactly as they did prior to Java 7.
  *
- * <p>Java has used <tt>ja_JP_JP</tt> to represent Japanese as used in
+ * <p>Java has used {@code ja_JP_JP} to represent Japanese as used in
  * Japan together with the Japanese Imperial calendar. This is now
  * representable using a Unicode locale extension, by specifying the
- * Unicode locale key <tt>ca</tt> (for "calendar") and type
- * <tt>japanese</tt>. When the Locale constructor is called with the
+ * Unicode locale key {@code ca} (for "calendar") and type
+ * {@code japanese}. When the Locale constructor is called with the
  * arguments "ja", "JP", "JP", the extension "u-ca-japanese" is
  * automatically added.
  *
- * <p>Java has used <tt>th_TH_TH</tt> to represent Thai as used in
+ * <p>Java has used {@code th_TH_TH} to represent Thai as used in
  * Thailand together with Thai digits. This is also now representable using
  * a Unicode locale extension, by specifying the Unicode locale key
- * <tt>nu</tt> (for "number") and value <tt>thai</tt>. When the Locale
+ * {@code nu} (for "number") and value {@code thai}. When the Locale
  * constructor is called with the arguments "th", "TH", "TH", the
  * extension "u-nu-thai" is automatically added.
  *
@@ -446,9 +446,9 @@
  * <h5>Legacy language codes</h5>
  *
  * <p>Locale's constructor has always converted three language codes to
- * their earlier, obsoleted forms: <tt>he</tt> maps to <tt>iw</tt>,
- * <tt>yi</tt> maps to <tt>ji</tt>, and <tt>id</tt> maps to
- * <tt>in</tt>.  This continues to be the case, in order to not break
+ * their earlier, obsoleted forms: {@code he} maps to {@code iw},
+ * {@code yi} maps to {@code ji}, and {@code id} maps to
+ * {@code in}.  This continues to be the case, in order to not break
  * backwards compatibility.
  *
  * <p>The APIs added in 1.7 map between the old and new language codes,
@@ -1272,14 +1272,14 @@
      * {@link #toLanguageTag}.
      *
      * <p>Examples: <ul>
-     * <li><tt>en</tt></li>
-     * <li><tt>de_DE</tt></li>
-     * <li><tt>_GB</tt></li>
-     * <li><tt>en_US_WIN</tt></li>
-     * <li><tt>de__POSIX</tt></li>
-     * <li><tt>zh_CN_#Hans</tt></li>
-     * <li><tt>zh_TW_#Hant-x-java</tt></li>
-     * <li><tt>th_TH_TH_#u-nu-thai</tt></li></ul>
+     * <li>{@code en}</li>
+     * <li>{@code de_DE}</li>
+     * <li>{@code _GB}</li>
+     * <li>{@code en_US_WIN}</li>
+     * <li>{@code de__POSIX}</li>
+     * <li>{@code zh_CN_#Hans}</li>
+     * <li>{@code zh_TW_#Hant-x-java}</li>
+     * <li>{@code th_TH_TH_#u-nu-thai}</li></ul>
      *
      * @return A string representation of the Locale, for debugging.
      * @see #getDisplayName
--- a/jdk/src/java.base/share/classes/java/util/Map.java	Thu Apr 09 12:29:31 2015 +0200
+++ b/jdk/src/java.base/share/classes/java/util/Map.java	Mon Aug 17 12:45:16 2015 +0300
@@ -34,29 +34,29 @@
  * An object that maps keys to values.  A map cannot contain duplicate keys;
  * each key can map to at most one value.
  *
- * <p>This interface takes the place of the <tt>Dictionary</tt> class, which
+ * <p>This interface takes the place of the {@code Dictionary} class, which
  * was a totally abstract class rather than an interface.
  *
- * <p>The <tt>Map</tt> interface provides three <i>collection views</i>, which
+ * <p>The {@code Map} interface provides three <i>collection views</i>, which
  * allow a map's contents to be viewed as a set of keys, collection of values,
  * or set of key-value mappings.  The <i>order</i> of a map is defined as
  * the order in which the iterators on the map's collection views return their
- * elements.  Some map implementations, like the <tt>TreeMap</tt> class, make
- * specific guarantees as to their order; others, like the <tt>HashMap</tt>
+ * elements.  Some map implementations, like the {@code TreeMap} class, make
+ * specific guarantees as to their order; others, like the {@code HashMap}
  * class, do not.
  *
  * <p>Note: great care must be exercised if mutable objects are used as map
  * keys.  The behavior of a map is not specified if the value of an object is
- * changed in a manner that affects <tt>equals</tt> comparisons while the
+ * changed in a manner that affects {@code equals} comparisons while the
  * object is a key in the map.  A special case of this prohibition is that it
  * is not permissible for a map to contain itself as a key.  While it is
  * permissible for a map to contain itself as a value, extreme caution is
- * advised: the <tt>equals</tt> and <tt>hashCode</tt> methods are no longer
+ * advised: the {@code equals} and {@code hashCode} methods are no longer
  * well defined on such a map.
  *
  * <p>All general-purpose map implementation classes should provide two
  * "standard" constructors: a void (no arguments) constructor which creates an
- * empty map, and a constructor with a single argument of type <tt>Map</tt>,
+ * empty map, and a constructor with a single argument of type {@code Map},
  * which creates a new map with the same key-value mappings as its argument.
  * In effect, the latter constructor allows the user to copy any map,
  * producing an equivalent map of the desired class.  There is no way to
@@ -65,9 +65,9 @@
  *
  * <p>The "destructive" methods contained in this interface, that is, the
  * methods that modify the map on which they operate, are specified to throw
- * <tt>UnsupportedOperationException</tt> if this map does not support the
+ * {@code UnsupportedOperationException} if this map does not support the
  * operation.  If this is the case, these methods may, but are not required
- * to, throw an <tt>UnsupportedOperationException</tt> if the invocation would
+ * to, throw an {@code UnsupportedOperationException} if the invocation would
  * have no effect on the map.  For example, invoking the {@link #putAll(Map)}
  * method on an unmodifiable map may, but is not required to, throw the
  * exception if the map whose mappings are to be "superimposed" is empty.
@@ -76,7 +76,7 @@
  * may contain.  For example, some implementations prohibit null keys and
  * values, and some have restrictions on the types of their keys.  Attempting
  * to insert an ineligible key or value throws an unchecked exception,
- * typically <tt>NullPointerException</tt> or <tt>ClassCastException</tt>.
+ * typically {@code NullPointerException} or {@code ClassCastException}.
  * Attempting to query the presence of an ineligible key or value may throw an
  * exception, or it may simply return false; some implementations will exhibit
  * the former behavior and some will exhibit the latter.  More generally,
@@ -89,13 +89,13 @@
  * <p>Many methods in Collections Framework interfaces are defined
  * in terms of the {@link Object#equals(Object) equals} method.  For
  * example, the specification for the {@link #containsKey(Object)
- * containsKey(Object key)} method says: "returns <tt>true</tt> if and
- * only if this map contains a mapping for a key <tt>k</tt> such that
- * <tt>(key==null ? k==null : key.equals(k))</tt>." This specification should
- * <i>not</i> be construed to imply that invoking <tt>Map.containsKey</tt>
- * with a non-null argument <tt>key</tt> will cause <tt>key.equals(k)</tt> to
- * be invoked for any key <tt>k</tt>.  Implementations are free to
- * implement optimizations whereby the <tt>equals</tt> invocation is avoided,
+ * containsKey(Object key)} method says: "returns {@code true} if and
+ * only if this map contains a mapping for a key {@code k} such that
+ * {@code (key==null ? k==null : key.equals(k))}." This specification should
+ * <i>not</i> be construed to imply that invoking {@code Map.containsKey}
+ * with a non-null argument {@code key} will cause {@code key.equals(k)} to
+ * be invoked for any key {@code k}.  Implementations are free to
+ * implement optimizations whereby the {@code equals} invocation is avoided,
  * for example, by first comparing the hash codes of the two keys.  (The
  * {@link Object#hashCode()} specification guarantees that two objects with
  * unequal hash codes cannot be equal.)  More generally, implementations of
@@ -131,29 +131,29 @@
 
     /**
      * Returns the number of key-value mappings in this map.  If the
-     * map contains more than <tt>Integer.MAX_VALUE</tt> elements, returns
-     * <tt>Integer.MAX_VALUE</tt>.
+     * map contains more than {@code Integer.MAX_VALUE} elements, returns
+     * {@code Integer.MAX_VALUE}.
      *
      * @return the number of key-value mappings in this map
      */
     int size();
 
     /**
-     * Returns <tt>true</tt> if this map contains no key-value mappings.
+     * Returns {@code true} if this map contains no key-value mappings.
      *
-     * @return <tt>true</tt> if this map contains no key-value mappings
+     * @return {@code true} if this map contains no key-value mappings
      */
     boolean isEmpty();
 
     /**
-     * Returns <tt>true</tt> if this map contains a mapping for the specified
-     * key.  More formally, returns <tt>true</tt> if and only if
-     * this map contains a mapping for a key <tt>k</tt> such that
-     * <tt>(key==null ? k==null : key.equals(k))</tt>.  (There can be
+     * Returns {@code true} if this map contains a mapping for the specified
+     * key.  More formally, returns {@code true} if and only if
+     * this map contains a mapping for a key {@code k} such that
+     * {@code Objects.equals(key, k)}.  (There can be
      * at most one such mapping.)
      *
      * @param key key whose presence in this map is to be tested
-     * @return <tt>true</tt> if this map contains a mapping for the specified
+     * @return {@code true} if this map contains a mapping for the specified
      *         key
      * @throws ClassCastException if the key is of an inappropriate type for
      *         this map
@@ -165,15 +165,15 @@
     boolean containsKey(Object key);
 
     /**
-     * Returns <tt>true</tt> if this map maps one or more keys to the
-     * specified value.  More formally, returns <tt>true</tt> if and only if
-     * this map contains at least one mapping to a value <tt>v</tt> such that
-     * <tt>(value==null ? v==null : value.equals(v))</tt>.  This operation
+     * Returns {@code true} if this map maps one or more keys to the
+     * specified value.  More formally, returns {@code true} if and only if
+     * this map contains at least one mapping to a value {@code v} such that
+     * {@code Objects.equals(value, v)}.  This operation
      * will probably require time linear in the map size for most
-     * implementations of the <tt>Map</tt> interface.
+     * implementations of the {@code Map} interface.
      *
      * @param value value whose presence in this map is to be tested
-     * @return <tt>true</tt> if this map maps one or more keys to the
+     * @return {@code true} if this map maps one or more keys to the
      *         specified value
      * @throws ClassCastException if the value is of an inappropriate type for
      *         this map
@@ -189,8 +189,9 @@
      * or {@code null} if this map contains no mapping for the key.
      *
      * <p>More formally, if this map contains a mapping from a key
-     * {@code k} to a value {@code v} such that {@code (key==null ? k==null :
-     * key.equals(k))}, then this method returns {@code v}; otherwise
+     * {@code k} to a value {@code v} such that
+     * {@code Objects.equals(key, k)},
+     * then this method returns {@code v}; otherwise
      * it returns {@code null}.  (There can be at most one such mapping.)
      *
      * <p>If this map permits null values, then a return value of
@@ -217,18 +218,18 @@
      * Associates the specified value with the specified key in this map
      * (optional operation).  If the map previously contained a mapping for
      * the key, the old value is replaced by the specified value.  (A map
-     * <tt>m</tt> is said to contain a mapping for a key <tt>k</tt> if and only
+     * {@code m} is said to contain a mapping for a key {@code k} if and only
      * if {@link #containsKey(Object) m.containsKey(k)} would return
-     * <tt>true</tt>.)
+     * {@code true}.)
      *
      * @param key key with which the specified value is to be associated
      * @param value value to be associated with the specified key
-     * @return the previous value associated with <tt>key</tt>, or
-     *         <tt>null</tt> if there was no mapping for <tt>key</tt>.
-     *         (A <tt>null</tt> return can also indicate that the map
-     *         previously associated <tt>null</tt> with <tt>key</tt>,
-     *         if the implementation supports <tt>null</tt> values.)
-     * @throws UnsupportedOperationException if the <tt>put</tt> operation
+     * @return the previous value associated with {@code key}, or
+     *         {@code null} if there was no mapping for {@code key}.
+     *         (A {@code null} return can also indicate that the map
+     *         previously associated {@code null} with {@code key},
+     *         if the implementation supports {@code null} values.)
+     * @throws UnsupportedOperationException if the {@code put} operation
      *         is not supported by this map
      * @throws ClassCastException if the class of the specified key or value
      *         prevents it from being stored in this map
@@ -242,25 +243,25 @@
     /**
      * Removes the mapping for a key from this map if it is present
      * (optional operation).   More formally, if this map contains a mapping
-     * from key <tt>k</tt> to value <tt>v</tt> such that
-     * <code>(key==null ?  k==null : key.equals(k))</code>, that mapping
+     * from key {@code k} to value {@code v} such that
+     * {@code Objects.equals(key, k)}, that mapping
      * is removed.  (The map can contain at most one such mapping.)
      *
      * <p>Returns the value to which this map previously associated the key,
-     * or <tt>null</tt> if the map contained no mapping for the key.
+     * or {@code null} if the map contained no mapping for the key.
      *
      * <p>If this map permits null values, then a return value of
-     * <tt>null</tt> does not <i>necessarily</i> indicate that the map
+     * {@code null} does not <i>necessarily</i> indicate that the map
      * contained no mapping for the key; it's also possible that the map
-     * explicitly mapped the key to <tt>null</tt>.
+     * explicitly mapped the key to {@code null}.
      *
      * <p>The map will not contain a mapping for the specified key once the
      * call returns.
      *
      * @param key key whose mapping is to be removed from the map
-     * @return the previous value associated with <tt>key</tt>, or
-     *         <tt>null</tt> if there was no mapping for <tt>key</tt>.
-     * @throws UnsupportedOperationException if the <tt>remove</tt> operation
+     * @return the previous value associated with {@code key}, or
+     *         {@code null} if there was no mapping for {@code key}.
+     * @throws UnsupportedOperationException if the {@code remove} operation
      *         is not supported by this map
      * @throws ClassCastException if the key is of an inappropriate type for
      *         this map
@@ -278,12 +279,12 @@
      * Copies all of the mappings from the specified map to this map
      * (optional operation).  The effect of this call is equivalent to that
      * of calling {@link #put(Object,Object) put(k, v)} on this map once
-     * for each mapping from key <tt>k</tt> to value <tt>v</tt> in the
+     * for each mapping from key {@code k} to value {@code v} in the
      * specified map.  The behavior of this operation is undefined if the
      * specified map is modified while the operation is in progress.
      *
      * @param m mappings to be stored in this map
-     * @throws UnsupportedOperationException if the <tt>putAll</tt> operation
+     * @throws UnsupportedOperationException if the {@code putAll} operation
      *         is not supported by this map
      * @throws ClassCastException if the class of a key or value in the
      *         specified map prevents it from being stored in this map
@@ -299,7 +300,7 @@
      * Removes all of the mappings from this map (optional operation).
      * The map will be empty after this call returns.
      *
-     * @throws UnsupportedOperationException if the <tt>clear</tt> operation
+     * @throws UnsupportedOperationException if the {@code clear} operation
      *         is not supported by this map
      */
     void clear();
@@ -312,12 +313,12 @@
      * The set is backed by the map, so changes to the map are
      * reflected in the set, and vice-versa.  If the map is modified
      * while an iteration over the set is in progress (except through
-     * the iterator's own <tt>remove</tt> operation), the results of
+     * the iterator's own {@code remove} operation), the results of
      * the iteration are undefined.  The set supports element removal,
      * which removes the corresponding mapping from the map, via the
-     * <tt>Iterator.remove</tt>, <tt>Set.remove</tt>,
-     * <tt>removeAll</tt>, <tt>retainAll</tt>, and <tt>clear</tt>
-     * operations.  It does not support the <tt>add</tt> or <tt>addAll</tt>
+     * {@code Iterator.remove}, {@code Set.remove},
+     * {@code removeAll}, {@code retainAll}, and {@code clear}
+     * operations.  It does not support the {@code add} or {@code addAll}
      * operations.
      *
      * @return a set view of the keys contained in this map
@@ -329,13 +330,13 @@
      * The collection is backed by the map, so changes to the map are
      * reflected in the collection, and vice-versa.  If the map is
      * modified while an iteration over the collection is in progress
-     * (except through the iterator's own <tt>remove</tt> operation),
+     * (except through the iterator's own {@code remove} operation),
      * the results of the iteration are undefined.  The collection
      * supports element removal, which removes the corresponding
-     * mapping from the map, via the <tt>Iterator.remove</tt>,
-     * <tt>Collection.remove</tt>, <tt>removeAll</tt>,
-     * <tt>retainAll</tt> and <tt>clear</tt> operations.  It does not
-     * support the <tt>add</tt> or <tt>addAll</tt> operations.
+     * mapping from the map, via the {@code Iterator.remove},
+     * {@code Collection.remove}, {@code removeAll},
+     * {@code retainAll} and {@code clear} operations.  It does not
+     * support the {@code add} or {@code addAll} operations.
      *
      * @return a collection view of the values contained in this map
      */
@@ -346,28 +347,28 @@
      * The set is backed by the map, so changes to the map are
      * reflected in the set, and vice-versa.  If the map is modified
      * while an iteration over the set is in progress (except through
-     * the iterator's own <tt>remove</tt> operation, or through the
-     * <tt>setValue</tt> operation on a map entry returned by the
+     * the iterator's own {@code remove} operation, or through the
+     * {@code setValue} operation on a map entry returned by the
      * iterator) the results of the iteration are undefined.  The set
      * supports element removal, which removes the corresponding
-     * mapping from the map, via the <tt>Iterator.remove</tt>,
-     * <tt>Set.remove</tt>, <tt>removeAll</tt>, <tt>retainAll</tt> and
-     * <tt>clear</tt> operations.  It does not support the
-     * <tt>add</tt> or <tt>addAll</tt> operations.
+     * mapping from the map, via the {@code Iterator.remove},
+     * {@code Set.remove}, {@code removeAll}, {@code retainAll} and
+     * {@code clear} operations.  It does not support the
+     * {@code add} or {@code addAll} operations.
      *
      * @return a set view of the mappings contained in this map
      */
     Set<Map.Entry<K, V>> entrySet();
 
     /**
-     * A map entry (key-value pair).  The <tt>Map.entrySet</tt> method returns
+     * A map entry (key-value pair).  The {@code Map.entrySet} method returns
      * a collection-view of the map, whose elements are of this class.  The
      * <i>only</i> way to obtain a reference to a map entry is from the
-     * iterator of this collection-view.  These <tt>Map.Entry</tt> objects are
+     * iterator of this collection-view.  These {@code Map.Entry} objects are
      * valid <i>only</i> for the duration of the iteration; more formally,
      * the behavior of a map entry is undefined if the backing map has been
      * modified after the entry was returned by the iterator, except through
-     * the <tt>setValue</tt> operation on the map entry.
+     * the {@code setValue} operation on the map entry.
      *
      * @see Map#entrySet()
      * @since 1.2
@@ -386,7 +387,7 @@
         /**
          * Returns the value corresponding to this entry.  If the mapping
          * has been removed from the backing map (by the iterator's
-         * <tt>remove</tt> operation), the results of this call are undefined.
+         * {@code remove} operation), the results of this call are undefined.
          *
          * @return the value corresponding to this entry
          * @throws IllegalStateException implementations may, but are not
@@ -399,11 +400,11 @@
          * Replaces the value corresponding to this entry with the specified
          * value (optional operation).  (Writes through to the map.)  The
          * behavior of this call is undefined if the mapping has already been
-         * removed from the map (by the iterator's <tt>remove</tt> operation).
+         * removed from the map (by the iterator's {@code remove} operation).
          *
          * @param value new value to be stored in this entry
          * @return old value corresponding to the entry
-         * @throws UnsupportedOperationException if the <tt>put</tt> operation
+         * @throws UnsupportedOperationException if the {@code put} operation
          *         is not supported by the backing map
          * @throws ClassCastException if the class of the specified value
          *         prevents it from being stored in the backing map
@@ -419,34 +420,34 @@
 
         /**
          * Compares the specified object with this entry for equality.
-         * Returns <tt>true</tt> if the given object is also a map entry and
+         * Returns {@code true} if the given object is also a map entry and
          * the two entries represent the same mapping.  More formally, two
-         * entries <tt>e1</tt> and <tt>e2</tt> represent the same mapping
+         * entries {@code e1} and {@code e2} represent the same mapping
          * if<pre>
          *     (e1.getKey()==null ?
          *      e2.getKey()==null : e1.getKey().equals(e2.getKey()))  &amp;&amp;
          *     (e1.getValue()==null ?
          *      e2.getValue()==null : e1.getValue().equals(e2.getValue()))
          * </pre>
-         * This ensures that the <tt>equals</tt> method works properly across
-         * different implementations of the <tt>Map.Entry</tt> interface.
+         * This ensures that the {@code equals} method works properly across
+         * different implementations of the {@code Map.Entry} interface.
          *
          * @param o object to be compared for equality with this map entry
-         * @return <tt>true</tt> if the specified object is equal to this map
+         * @return {@code true} if the specified object is equal to this map
          *         entry
          */
         boolean equals(Object o);
 
         /**
          * Returns the hash code value for this map entry.  The hash code
-         * of a map entry <tt>e</tt> is defined to be: <pre>
+         * of a map entry {@code e} is defined to be: <pre>
          *     (e.getKey()==null   ? 0 : e.getKey().hashCode()) ^
          *     (e.getValue()==null ? 0 : e.getValue().hashCode())
          * </pre>
-         * This ensures that <tt>e1.equals(e2)</tt> implies that
-         * <tt>e1.hashCode()==e2.hashCode()</tt> for any two Entries
-         * <tt>e1</tt> and <tt>e2</tt>, as required by the general
-         * contract of <tt>Object.hashCode</tt>.
+         * This ensures that {@code e1.equals(e2)} implies that
+         * {@code e1.hashCode()==e2.hashCode()} for any two Entries
+         * {@code e1} and {@code e2}, as required by the general
+         * contract of {@code Object.hashCode}.
          *
          * @return the hash code value for this map entry
          * @see Object#hashCode()
@@ -532,24 +533,24 @@
 
     /**
      * Compares the specified object with this map for equality.  Returns
-     * <tt>true</tt> if the given object is also a map and the two maps
-     * represent the same mappings.  More formally, two maps <tt>m1</tt> and
-     * <tt>m2</tt> represent the same mappings if
-     * <tt>m1.entrySet().equals(m2.entrySet())</tt>.  This ensures that the
-     * <tt>equals</tt> method works properly across different implementations
-     * of the <tt>Map</tt> interface.
+     * {@code true} if the given object is also a map and the two maps
+     * represent the same mappings.  More formally, two maps {@code m1} and
+     * {@code m2} represent the same mappings if
+     * {@code m1.entrySet().equals(m2.entrySet())}.  This ensures that the
+     * {@code equals} method works properly across different implementations
+     * of the {@code Map} interface.
      *
      * @param o object to be compared for equality with this map
-     * @return <tt>true</tt> if the specified object is equal to this map
+     * @return {@code true} if the specified object is equal to this map
      */
     boolean equals(Object o);
 
     /**
      * Returns the hash code value for this map.  The hash code of a map is
      * defined to be the sum of the hash codes of each entry in the map's
-     * <tt>entrySet()</tt> view.  This ensures that <tt>m1.equals(m2)</tt>
-     * implies that <tt>m1.hashCode()==m2.hashCode()</tt> for any two maps
-     * <tt>m1</tt> and <tt>m2</tt>, as required by the general contract of
+     * {@code entrySet()} view.  This ensures that {@code m1.equals(m2)}
+     * implies that {@code m1.hashCode()==m2.hashCode()} for any two maps
+     * {@code m1} and {@code m2}, as required by the general contract of
      * {@link Object#hashCode}.
      *
      * @return the hash code value for this map
--- a/jdk/src/java.base/share/classes/java/util/MissingFormatArgumentException.java	Thu Apr 09 12:29:31 2015 +0200
+++ b/jdk/src/java.base/share/classes/java/util/MissingFormatArgumentException.java	Mon Aug 17 12:45:16 2015 +0300
@@ -30,7 +30,7 @@
  * have a corresponding argument or if an argument index refers to an argument
  * that does not exist.
  *
- * <p> Unless otherwise specified, passing a <tt>null</tt> argument to any
+ * <p> Unless otherwise specified, passing a {@code null} argument to any
  * method or constructor in this class will cause a {@link
  * NullPointerException} to be thrown.
  *
--- a/jdk/src/java.base/share/classes/java/util/MissingFormatWidthException.java	Thu Apr 09 12:29:31 2015 +0200
+++ b/jdk/src/java.base/share/classes/java/util/MissingFormatWidthException.java	Mon Aug 17 12:45:16 2015 +0300
@@ -28,7 +28,7 @@
 /**
  * Unchecked exception thrown when the format width is required.
  *
- * <p> Unless otherwise specified, passing a <tt>null</tt> argument to any
+ * <p> Unless otherwise specified, passing a {@code null} argument to any
  * method or constructor in this class will cause a {@link
  * NullPointerException} to be thrown.
  *
--- a/jdk/src/java.base/share/classes/java/util/MissingResourceException.java	Thu Apr 09 12:29:31 2015 +0200
+++ b/jdk/src/java.base/share/classes/java/util/MissingResourceException.java	Mon Aug 17 12:45:16 2015 +0300
@@ -64,10 +64,10 @@
     }
 
     /**
-     * Constructs a <code>MissingResourceException</code> with
-     * <code>message</code>, <code>className</code>, <code>key</code>,
-     * and <code>cause</code>. This constructor is package private for
-     * use by <code>ResourceBundle.getBundle</code>.
+     * Constructs a {@code MissingResourceException} with
+     * {@code message}, {@code className}, {@code key},
+     * and {@code cause}. This constructor is package private for
+     * use by {@code ResourceBundle.getBundle}.
      *
      * @param message
      *        the detail message
--- a/jdk/src/java.base/share/classes/java/util/NoSuchElementException.java	Thu Apr 09 12:29:31 2015 +0200
+++ b/jdk/src/java.base/share/classes/java/util/NoSuchElementException.java	Mon Aug 17 12:45:16 2015 +0300
@@ -39,7 +39,7 @@
     private static final long serialVersionUID = 6769829250639411880L;
 
     /**
-     * Constructs a <code>NoSuchElementException</code> with <tt>null</tt>
+     * Constructs a {@code NoSuchElementException} with {@code null}
      * as its error message string.
      */
     public NoSuchElementException() {
@@ -47,9 +47,9 @@
     }
 
     /**
-     * Constructs a <code>NoSuchElementException</code>, saving a reference
-     * to the error message string <tt>s</tt> for later retrieval by the
-     * <tt>getMessage</tt> method.
+     * Constructs a {@code NoSuchElementException}, saving a reference
+     * to the error message string {@code s} for later retrieval by the
+     * {@code getMessage} method.
      *
      * @param   s   the detail message.
      */
--- a/jdk/src/java.base/share/classes/java/util/Observable.java	Thu Apr 09 12:29:31 2015 +0200
+++ b/jdk/src/java.base/share/classes/java/util/Observable.java	Mon Aug 17 12:45:16 2015 +0300
@@ -31,11 +31,11 @@
  * object that the application wants to have observed.
  * <p>
  * An observable object can have one or more observers. An observer
- * may be any object that implements interface <tt>Observer</tt>. After an
+ * may be any object that implements interface {@code Observer}. After an
  * observable instance changes, an application calling the
- * <code>Observable</code>'s <code>notifyObservers</code> method
+ * {@code Observable}'s {@code notifyObservers} method
  * causes all of its observers to be notified of the change by a call
- * to their <code>update</code> method.
+ * to their {@code update} method.
  * <p>
  * The order in which notifications will be delivered is unspecified.
  * The default implementation provided in the Observable class will
@@ -45,12 +45,12 @@
  * subclass follows this order, as they choose.
  * <p>
  * Note that this notification mechanism has nothing to do with threads
- * and is completely separate from the <tt>wait</tt> and <tt>notify</tt>
- * mechanism of class <tt>Object</tt>.
+ * and is completely separate from the {@code wait} and {@code notify}
+ * mechanism of class {@code Object}.
  * <p>
  * When an observable object is newly created, its set of observers is
  * empty. Two observers are considered the same if and only if the
- * <tt>equals</tt> method returns true for them.
+ * {@code equals} method returns true for them.
  *
  * @author  Chris Warth
  * @see     java.util.Observable#notifyObservers()
@@ -88,7 +88,7 @@
 
     /**
      * Deletes an observer from the set of observers of this object.
-     * Passing <CODE>null</CODE> to this method will have no effect.
+     * Passing {@code null} to this method will have no effect.
      * @param   o   the observer to be deleted.
      */
     public synchronized void deleteObserver(Observer o) {
@@ -97,15 +97,15 @@
 
     /**
      * If this object has changed, as indicated by the
-     * <code>hasChanged</code> method, then notify all of its observers
-     * and then call the <code>clearChanged</code> method to
+     * {@code hasChanged} method, then notify all of its observers
+     * and then call the {@code clearChanged} method to
      * indicate that this object has no longer changed.
      * <p>
-     * Each observer has its <code>update</code> method called with two
-     * arguments: this observable object and <code>null</code>. In other
+     * Each observer has its {@code update} method called with two
+     * arguments: this observable object and {@code null}. In other
      * words, this method is equivalent to:
-     * <blockquote><tt>
-     * notifyObservers(null)</tt></blockquote>
+     * <blockquote>{@code
+     * notifyObservers(null)}</blockquote>
      *
      * @see     java.util.Observable#clearChanged()
      * @see     java.util.Observable#hasChanged()
@@ -117,12 +117,12 @@
 
     /**
      * If this object has changed, as indicated by the
-     * <code>hasChanged</code> method, then notify all of its observers
-     * and then call the <code>clearChanged</code> method to indicate
+     * {@code hasChanged} method, then notify all of its observers
+     * and then call the {@code clearChanged} method to indicate
      * that this object has no longer changed.
      * <p>
-     * Each observer has its <code>update</code> method called with two
-     * arguments: this observable object and the <code>arg</code> argument.
+     * Each observer has its {@code update} method called with two
+     * arguments: this observable object and the {@code arg} argument.
      *
      * @param   arg   any object.
      * @see     java.util.Observable#clearChanged()
@@ -167,8 +167,8 @@
     }
 
     /**
-     * Marks this <tt>Observable</tt> object as having been changed; the
-     * <tt>hasChanged</tt> method will now return <tt>true</tt>.
+     * Marks this {@code Observable} object as having been changed; the
+     * {@code hasChanged} method will now return {@code true}.
      */
     protected synchronized void setChanged() {
         changed = true;
@@ -177,9 +177,9 @@
     /**
      * Indicates that this object has no longer changed, or that it has
      * already notified all of its observers of its most recent change,
-     * so that the <tt>hasChanged</tt> method will now return <tt>false</tt>.
+     * so that the {@code hasChanged} method will now return {@code false}.
      * This method is called automatically by the
-     * <code>notifyObservers</code> methods.
+     * {@code notifyObservers} methods.
      *
      * @see     java.util.Observable#notifyObservers()
      * @see     java.util.Observable#notifyObservers(java.lang.Object)
@@ -191,10 +191,10 @@
     /**
      * Tests if this object has changed.
      *
-     * @return  <code>true</code> if and only if the <code>setChanged</code>
+     * @return  {@code true} if and only if the {@code setChanged}
      *          method has been called more recently than the
-     *          <code>clearChanged</code> method on this object;
-     *          <code>false</code> otherwise.
+     *          {@code clearChanged} method on this object;
+     *          {@code false} otherwise.
      * @see     java.util.Observable#clearChanged()
      * @see     java.util.Observable#setChanged()
      */
@@ -203,7 +203,7 @@
     }
 
     /**
-     * Returns the number of observers of this <tt>Observable</tt> object.
+     * Returns the number of observers of this {@code Observable} object.
      *
      * @return  the number of observers of this object.
      */
--- a/jdk/src/java.base/share/classes/java/util/Observer.java	Thu Apr 09 12:29:31 2015 +0200
+++ b/jdk/src/java.base/share/classes/java/util/Observer.java	Mon Aug 17 12:45:16 2015 +0300
@@ -25,7 +25,7 @@
 package java.util;
 
 /**
- * A class can implement the <code>Observer</code> interface when it
+ * A class can implement the {@code Observer} interface when it
  * wants to be informed of changes in observable objects.
  *
  * @author  Chris Warth
@@ -35,12 +35,12 @@
 public interface Observer {
     /**
      * This method is called whenever the observed object is changed. An
-     * application calls an <tt>Observable</tt> object's
-     * <code>notifyObservers</code> method to have all the object's
+     * application calls an {@code Observable} object's
+     * {@code notifyObservers} method to have all the object's
      * observers notified of the change.
      *
      * @param   o     the observable object.
-     * @param   arg   an argument passed to the <code>notifyObservers</code>
+     * @param   arg   an argument passed to the {@code notifyObservers}
      *                 method.
      */
     void update(Observable o, Object arg);
--- a/jdk/src/java.base/share/classes/java/util/Properties.java	Thu Apr 09 12:29:31 2015 +0200
+++ b/jdk/src/java.base/share/classes/java/util/Properties.java	Mon Aug 17 12:45:16 2015 +0300
@@ -60,12 +60,12 @@
  * object that contains a non-{@code String} key.
  *
  * <p>
- * The {@link #load(java.io.Reader) load(Reader)} <tt>/</tt>
+ * The {@link #load(java.io.Reader) load(Reader)} {@code /}
  * {@link #store(java.io.Writer, java.lang.String) store(Writer, String)}
  * methods load and store properties from and to a character based stream
  * in a simple line-oriented format specified below.
  *
- * The {@link #load(java.io.InputStream) load(InputStream)} <tt>/</tt>
+ * The {@link #load(java.io.InputStream) load(InputStream)} {@code /}
  * {@link #store(java.io.OutputStream, java.lang.String) store(OutputStream, String)}
  * methods work the same way as the load(Reader)/store(Writer, String) pair, except
  * the input/output stream is encoded in ISO 8859-1 character encoding.
@@ -105,7 +105,7 @@
  * </pre>
  *
  * <p>This class is thread-safe: multiple threads can share a single
- * <tt>Properties</tt> object without the need for external synchronization.
+ * {@code Properties} object without the need for external synchronization.
  *
  * @author  Arthur van Hoff
  * @author  Michael McCloskey
@@ -144,13 +144,13 @@
     }
 
     /**
-     * Calls the <tt>Hashtable</tt> method {@code put}. Provided for
-     * parallelism with the <tt>getProperty</tt> method. Enforces use of
+     * Calls the {@code Hashtable} method {@code put}. Provided for
+     * parallelism with the {@code getProperty} method. Enforces use of
      * strings for property keys and values. The value returned is the
-     * result of the <tt>Hashtable</tt> call to {@code put}.
+     * result of the {@code Hashtable} call to {@code put}.
      *
      * @param key the key to be placed into this property list.
-     * @param value the value corresponding to <tt>key</tt>.
+     * @param value the value corresponding to {@code key}.
      * @return     the previous value of the specified key in this property
      *             list, or {@code null} if it did not have one.
      * @see #getProperty
@@ -756,7 +756,7 @@
      * @param   writer      an output character stream writer.
      * @param   comments   a description of the property list.
      * @exception  IOException if writing this property list to the specified
-     *             output stream throws an <tt>IOException</tt>.
+     *             output stream throws an {@code IOException}.
      * @exception  ClassCastException  if this {@code Properties} object
      *             contains any keys or values that are not {@code Strings}.
      * @exception  NullPointerException  if {@code writer} is null.
@@ -803,7 +803,7 @@
      * @param   out      an output stream.
      * @param   comments   a description of the property list.
      * @exception  IOException if writing this property list to the specified
-     *             output stream throws an <tt>IOException</tt>.
+     *             output stream throws an {@code IOException}.
      * @exception  ClassCastException  if this {@code Properties} object
      *             contains any keys or values that are not {@code Strings}.
      * @exception  NullPointerException  if {@code out} is null.
@@ -860,7 +860,7 @@
      *
      * @param in the input stream from which to read the XML document.
      * @throws IOException if reading from the specified input stream
-     *         results in an <tt>IOException</tt>.
+     *         results in an {@code IOException}.
      * @throws java.io.UnsupportedEncodingException if the document's encoding
      *         declaration can be read and it specifies an encoding that is not
      *         supported
@@ -885,15 +885,15 @@
      * Emits an XML document representing all of the properties contained
      * in this table.
      *
-     * <p> An invocation of this method of the form <tt>props.storeToXML(os,
-     * comment)</tt> behaves in exactly the same way as the invocation
-     * <tt>props.storeToXML(os, comment, "UTF-8");</tt>.
+     * <p> An invocation of this method of the form {@code props.storeToXML(os,
+     * comment)} behaves in exactly the same way as the invocation
+     * {@code props.storeToXML(os, comment, "UTF-8");}.
      *
      * @param os the output stream on which to emit the XML document.
      * @param comment a description of the property list, or {@code null}
      *        if no comment is desired.
      * @throws IOException if writing to the specified output stream
-     *         results in an <tt>IOException</tt>.
+     *         results in an {@code IOException}.
      * @throws NullPointerException if {@code os} is null.
      * @throws ClassCastException  if this {@code Properties} object
      *         contains any keys or values that are not
@@ -933,7 +933,7 @@
      *                  character encoding</a>
      *
      * @throws IOException if writing to the specified output stream
-     *         results in an <tt>IOException</tt>.
+     *         results in an {@code IOException}.
      * @throws java.io.UnsupportedEncodingException if the encoding is not
      *         supported by the implementation.
      * @throws NullPointerException if {@code os} is {@code null},
@@ -1016,10 +1016,10 @@
      * including distinct keys in the default property list if a key
      * of the same name has not already been found from the main
      * properties list.  Properties whose key or value is not
-     * of type <tt>String</tt> are omitted.
+     * of type {@code String} are omitted.
      * <p>
-     * The returned set is not backed by the <tt>Properties</tt> object.
-     * Changes to this <tt>Properties</tt> are not reflected in the set,
+     * The returned set is not backed by the {@code Properties} object.
+     * Changes to this {@code Properties} are not reflected in the set,
      * or vice versa.
      *
      * @return  a set of keys in this property list where
--- a/jdk/src/java.base/share/classes/java/util/RandomAccess.java	Thu Apr 09 12:29:31 2015 +0200
+++ b/jdk/src/java.base/share/classes/java/util/RandomAccess.java	Mon Aug 17 12:45:16 2015 +0300
@@ -26,27 +26,27 @@
 package java.util;
 
 /**
- * Marker interface used by <tt>List</tt> implementations to indicate that
+ * Marker interface used by {@code List} implementations to indicate that
  * they support fast (generally constant time) random access.  The primary
  * purpose of this interface is to allow generic algorithms to alter their
  * behavior to provide good performance when applied to either random or
  * sequential access lists.
  *
  * <p>The best algorithms for manipulating random access lists (such as
- * <tt>ArrayList</tt>) can produce quadratic behavior when applied to
- * sequential access lists (such as <tt>LinkedList</tt>).  Generic list
+ * {@code ArrayList}) can produce quadratic behavior when applied to
+ * sequential access lists (such as {@code LinkedList}).  Generic list
  * algorithms are encouraged to check whether the given list is an
- * <tt>instanceof</tt> this interface before applying an algorithm that would
+ * {@code instanceof} this interface before applying an algorithm that would
  * provide poor performance if it were applied to a sequential access list,
  * and to alter their behavior if necessary to guarantee acceptable
  * performance.
  *
  * <p>It is recognized that the distinction between random and sequential
- * access is often fuzzy.  For example, some <tt>List</tt> implementations
+ * access is often fuzzy.  For example, some {@code List} implementations
  * provide asymptotically linear access times if they get huge, but constant
- * access times in practice.  Such a <tt>List</tt> implementation
+ * access times in practice.  Such a {@code List} implementation
  * should generally implement this interface.  As a rule of thumb, a
- * <tt>List</tt> implementation should implement this interface if,
+ * {@code List} implementation should implement this interface if,
  * for typical instances of the class, this loop:
  * <pre>
  *     for (int i=0, n=list.size(); i &lt; n; i++)
--- a/jdk/src/java.base/share/classes/java/util/RegularEnumSet.java	Thu Apr 09 12:29:31 2015 +0200
+++ b/jdk/src/java.base/share/classes/java/util/RegularEnumSet.java	Mon Aug 17 12:45:16 2015 +0300
@@ -123,19 +123,19 @@
     }
 
     /**
-     * Returns <tt>true</tt> if this set contains no elements.
+     * Returns {@code true} if this set contains no elements.
      *
-     * @return <tt>true</tt> if this set contains no elements
+     * @return {@code true} if this set contains no elements
      */
     public boolean isEmpty() {
         return elements == 0;
     }
 
     /**
-     * Returns <tt>true</tt> if this set contains the specified element.
+     * Returns {@code true} if this set contains the specified element.
      *
      * @param e element to be checked for containment in this collection
-     * @return <tt>true</tt> if this set contains the specified element
+     * @return {@code true} if this set contains the specified element
      */
     public boolean contains(Object e) {
         if (e == null)
@@ -153,9 +153,9 @@
      * Adds the specified element to this set if it is not already present.
      *
      * @param e element to be added to this set
-     * @return <tt>true</tt> if the set changed as a result of the call
+     * @return {@code true} if the set changed as a result of the call
      *
-     * @throws NullPointerException if <tt>e</tt> is null
+     * @throws NullPointerException if {@code e} is null
      */
     public boolean add(E e) {
         typeCheck(e);
@@ -169,7 +169,7 @@
      * Removes the specified element from this set if it is present.
      *
      * @param e element to be removed from this set, if present
-     * @return <tt>true</tt> if the set contained the specified element
+     * @return {@code true} if the set contained the specified element
      */
     public boolean remove(Object e) {
         if (e == null)
@@ -186,11 +186,11 @@
     // Bulk Operations
 
     /**
-     * Returns <tt>true</tt> if this set contains all of the elements
+     * Returns {@code true} if this set contains all of the elements
      * in the specified collection.
      *
      * @param c collection to be checked for containment in this set
-     * @return <tt>true</tt> if this set contains all of the elements
+     * @return {@code true} if this set contains all of the elements
      *        in the specified collection
      * @throws NullPointerException if the specified collection is null
      */
@@ -209,7 +209,7 @@
      * Adds all of the elements in the specified collection to this set.
      *
      * @param c collection whose elements are to be added to this set
-     * @return <tt>true</tt> if this set changed as a result of the call
+     * @return {@code true} if this set changed as a result of the call
      * @throws NullPointerException if the specified collection or any
      *     of its elements are null
      */
@@ -236,7 +236,7 @@
      * the specified collection.
      *
      * @param c elements to be removed from this set
-     * @return <tt>true</tt> if this set changed as a result of the call
+     * @return {@code true} if this set changed as a result of the call
      * @throws NullPointerException if the specified collection is null
      */
     public boolean removeAll(Collection<?> c) {
@@ -257,7 +257,7 @@
      * specified collection.
      *
      * @param c elements to be retained in this set
-     * @return <tt>true</tt> if this set changed as a result of the call
+     * @return {@code true} if this set changed as a result of the call
      * @throws NullPointerException if the specified collection is null
      */
     public boolean retainAll(Collection<?> c) {
@@ -285,12 +285,12 @@
 
     /**
      * Compares the specified object with this set for equality.  Returns
-     * <tt>true</tt> if the given object is also a set, the two sets have
+     * {@code true} if the given object is also a set, the two sets have
      * the same size, and every member of the given set is contained in
      * this set.
      *
      * @param o object to be compared for equality with this set
-     * @return <tt>true</tt> if the specified object is equal to this set
+     * @return {@code true} if the specified object is equal to this set
      */
     public boolean equals(Object o) {
         if (!(o instanceof RegularEnumSet))
--- a/jdk/src/java.base/share/classes/java/util/Scanner.java	Thu Apr 09 12:29:31 2015 +0200
+++ b/jdk/src/java.base/share/classes/java/util/Scanner.java	Mon Aug 17 12:45:16 2015 +0300
@@ -42,20 +42,20 @@
  * A simple text scanner which can parse primitive types and strings using
  * regular expressions.
  *
- * <p>A <code>Scanner</code> breaks its input into tokens using a
+ * <p>A {@code Scanner} breaks its input into tokens using a
  * delimiter pattern, which by default matches whitespace. The resulting
  * tokens may then be converted into values of different types using the
- * various <tt>next</tt> methods.
+ * various {@code next} methods.
  *
  * <p>For example, this code allows a user to read a number from
- * <tt>System.in</tt>:
+ * {@code System.in}:
  * <blockquote><pre>{@code
  *     Scanner sc = new Scanner(System.in);
  *     int i = sc.nextInt();
  * }</pre></blockquote>
  *
- * <p>As another example, this code allows <code>long</code> types to be
- * assigned from entries in a file <code>myNumbers</code>:
+ * <p>As another example, this code allows {@code long} types to be
+ * assigned from entries in a file {@code myNumbers}:
  * <blockquote><pre>{@code
  *      Scanner sc = new Scanner(new File("myNumbers"));
  *      while (sc.hasNextLong()) {
@@ -106,10 +106,10 @@
  * <p>The {@link #next} and {@link #hasNext} methods and their
  * primitive-type companion methods (such as {@link #nextInt} and
  * {@link #hasNextInt}) first skip any input that matches the delimiter
- * pattern, and then attempt to return the next token. Both <tt>hasNext</tt>
- * and <tt>next</tt> methods may block waiting for further input.  Whether a
- * <tt>hasNext</tt> method blocks has no connection to whether or not its
- * associated <tt>next</tt> method will block.
+ * pattern, and then attempt to return the next token. Both {@code hasNext}
+ * and {@code next} methods may block waiting for further input.  Whether a
+ * {@code hasNext} method blocks has no connection to whether or not its
+ * associated {@code next} method will block.
  *
  * <p> The {@link #findInLine}, {@link #findWithinHorizon}, and {@link #skip}
  * methods operate independently of the delimiter pattern. These methods will
@@ -122,32 +122,32 @@
  * retrieved or skipped via some other method.
  *
  * <p>Depending upon the type of delimiting pattern, empty tokens may be
- * returned. For example, the pattern <tt>"\\s+"</tt> will return no empty
+ * returned. For example, the pattern {@code "\\s+"} will return no empty
  * tokens since it matches multiple instances of the delimiter. The delimiting
- * pattern <tt>"\\s"</tt> could return empty tokens since it only passes one
+ * pattern {@code "\\s"} could return empty tokens since it only passes one
  * space at a time.
  *
  * <p> A scanner can read text from any object which implements the {@link
  * java.lang.Readable} interface.  If an invocation of the underlying
  * readable's {@link java.lang.Readable#read} method throws an {@link
  * java.io.IOException} then the scanner assumes that the end of the input
- * has been reached.  The most recent <tt>IOException</tt> thrown by the
+ * has been reached.  The most recent {@code IOException} thrown by the
  * underlying readable can be retrieved via the {@link #ioException} method.
  *
- * <p>When a <code>Scanner</code> is closed, it will close its input source
+ * <p>When a {@code Scanner} is closed, it will close its input source
  * if the source implements the {@link java.io.Closeable} interface.
  *
- * <p>A <code>Scanner</code> is not safe for multithreaded use without
+ * <p>A {@code Scanner} is not safe for multithreaded use without
  * external synchronization.
  *
- * <p>Unless otherwise mentioned, passing a <code>null</code> parameter into
- * any method of a <code>Scanner</code> will cause a
- * <code>NullPointerException</code> to be thrown.
+ * <p>Unless otherwise mentioned, passing a {@code null} parameter into
+ * any method of a {@code Scanner} will cause a
+ * {@code NullPointerException} to be thrown.
  *
  * <p>A scanner will default to interpreting numbers as decimal unless a
  * different radix has been set by using the {@link #useRadix} method. The
  * {@link #reset} method will reset the value of the scanner's radix to
- * <code>10</code> regardless of whether it was previously changed.
+ * {@code 10} regardless of whether it was previously changed.
  *
  * <h3> <a name="localized-numbers">Localized numbers</a> </h3>
  *
@@ -162,50 +162,50 @@
  *
  * <p>The localized formats are defined in terms of the following parameters,
  * which for a particular locale are taken from that locale's {@link
- * java.text.DecimalFormat DecimalFormat} object, <tt>df</tt>, and its and
+ * java.text.DecimalFormat DecimalFormat} object, {@code df}, and its and
  * {@link java.text.DecimalFormatSymbols DecimalFormatSymbols} object,
- * <tt>dfs</tt>.
+ * {@code dfs}.
  *
  * <blockquote><dl>
  *     <dt><i>LocalGroupSeparator&nbsp;&nbsp;</i>
  *         <dd>The character used to separate thousands groups,
- *         <i>i.e.,</i>&nbsp;<tt>dfs.</tt>{@link
+ *         <i>i.e.,</i>&nbsp;{@code dfs.}{@link
  *         java.text.DecimalFormatSymbols#getGroupingSeparator
  *         getGroupingSeparator()}
  *     <dt><i>LocalDecimalSeparator&nbsp;&nbsp;</i>
  *         <dd>The character used for the decimal point,
- *     <i>i.e.,</i>&nbsp;<tt>dfs.</tt>{@link
+ *     <i>i.e.,</i>&nbsp;{@code dfs.}{@link
  *     java.text.DecimalFormatSymbols#getDecimalSeparator
  *     getDecimalSeparator()}
  *     <dt><i>LocalPositivePrefix&nbsp;&nbsp;</i>
  *         <dd>The string that appears before a positive number (may
- *         be empty), <i>i.e.,</i>&nbsp;<tt>df.</tt>{@link
+ *         be empty), <i>i.e.,</i>&nbsp;{@code df.}{@link
  *         java.text.DecimalFormat#getPositivePrefix
  *         getPositivePrefix()}
  *     <dt><i>LocalPositiveSuffix&nbsp;&nbsp;</i>
  *         <dd>The string that appears after a positive number (may be
- *         empty), <i>i.e.,</i>&nbsp;<tt>df.</tt>{@link
+ *         empty), <i>i.e.,</i>&nbsp;{@code df.}{@link
  *         java.text.DecimalFormat#getPositiveSuffix
  *         getPositiveSuffix()}
  *     <dt><i>LocalNegativePrefix&nbsp;&nbsp;</i>
  *         <dd>The string that appears before a negative number (may
- *         be empty), <i>i.e.,</i>&nbsp;<tt>df.</tt>{@link
+ *         be empty), <i>i.e.,</i>&nbsp;{@code df.}{@link
  *         java.text.DecimalFormat#getNegativePrefix
  *         getNegativePrefix()}
  *     <dt><i>LocalNegativeSuffix&nbsp;&nbsp;</i>
  *         <dd>The string that appears after a negative number (may be
- *         empty), <i>i.e.,</i>&nbsp;<tt>df.</tt>{@link
+ *         empty), <i>i.e.,</i>&nbsp;{@code df.}{@link
  *     java.text.DecimalFormat#getNegativeSuffix
  *     getNegativeSuffix()}
  *     <dt><i>LocalNaN&nbsp;&nbsp;</i>
  *         <dd>The string that represents not-a-number for
  *         floating-point values,
- *         <i>i.e.,</i>&nbsp;<tt>dfs.</tt>{@link
+ *         <i>i.e.,</i>&nbsp;{@code dfs.}{@link
  *         java.text.DecimalFormatSymbols#getNaN
  *         getNaN()}
  *     <dt><i>LocalInfinity&nbsp;&nbsp;</i>
  *         <dd>The string that represents infinity for floating-point
- *         values, <i>i.e.,</i>&nbsp;<tt>dfs.</tt>{@link
+ *         values, <i>i.e.,</i>&nbsp;{@code dfs.}{@link
  *         java.text.DecimalFormatSymbols#getInfinity
  *         getInfinity()}
  * </dl></blockquote>
@@ -219,82 +219,82 @@
  * <dl>
  *   <dt><i>NonAsciiDigit</i>:
  *       <dd>A non-ASCII character c for which
- *            {@link java.lang.Character#isDigit Character.isDigit}<tt>(c)</tt>
+ *            {@link java.lang.Character#isDigit Character.isDigit}{@code (c)}
  *                        returns&nbsp;true
  *
  *   <dt><i>Non0Digit</i>:
- *       <dd><tt>[1-</tt><i>Rmax</i><tt>] | </tt><i>NonASCIIDigit</i>
+ *       <dd>{@code [1-}<i>Rmax</i>{@code ] | }<i>NonASCIIDigit</i>
  *
  *   <dt><i>Digit</i>:
- *       <dd><tt>[0-</tt><i>Rmax</i><tt>] | </tt><i>NonASCIIDigit</i>
+ *       <dd>{@code [0-}<i>Rmax</i>{@code ] | }<i>NonASCIIDigit</i>
  *
  *   <dt><i>GroupedNumeral</i>:
- *       <dd><tt>(&nbsp;</tt><i>Non0Digit</i>
- *                   <i>Digit</i><tt>?
- *                   </tt><i>Digit</i><tt>?</tt>
- *       <dd>&nbsp;&nbsp;&nbsp;&nbsp;<tt>(&nbsp;</tt><i>LocalGroupSeparator</i>
+ *       <dd><code>(&nbsp;</code><i>Non0Digit</i>
+ *                   <i>Digit</i>{@code ?
+ *                   }<i>Digit</i>{@code ?}
+ *       <dd>&nbsp;&nbsp;&nbsp;&nbsp;<code>(&nbsp;</code><i>LocalGroupSeparator</i>
  *                         <i>Digit</i>
  *                         <i>Digit</i>
- *                         <i>Digit</i><tt> )+ )</tt>
+ *                         <i>Digit</i>{@code  )+ )}
  *
  *   <dt><i>Numeral</i>:
- *       <dd><tt>( ( </tt><i>Digit</i><tt>+ )
- *               | </tt><i>GroupedNumeral</i><tt> )</tt>
+ *       <dd>{@code ( ( }<i>Digit</i>{@code + )
+ *               | }<i>GroupedNumeral</i>{@code  )}
  *
  *   <dt><a name="Integer-regex"><i>Integer</i>:</a>
- *       <dd><tt>( [-+]? ( </tt><i>Numeral</i><tt>
- *                               ) )</tt>
- *       <dd><tt>| </tt><i>LocalPositivePrefix</i> <i>Numeral</i>
+ *       <dd>{@code ( [-+]? ( }<i>Numeral</i>{@code
+ *                               ) )}
+ *       <dd>{@code | }<i>LocalPositivePrefix</i> <i>Numeral</i>
  *                      <i>LocalPositiveSuffix</i>
- *       <dd><tt>| </tt><i>LocalNegativePrefix</i> <i>Numeral</i>
+ *       <dd>{@code | }<i>LocalNegativePrefix</i> <i>Numeral</i>
  *                 <i>LocalNegativeSuffix</i>
  *
  *   <dt><i>DecimalNumeral</i>:
  *       <dd><i>Numeral</i>
- *       <dd><tt>| </tt><i>Numeral</i>
+ *       <dd>{@code | }<i>Numeral</i>
  *                 <i>LocalDecimalSeparator</i>
- *                 <i>Digit</i><tt>*</tt>
- *       <dd><tt>| </tt><i>LocalDecimalSeparator</i>
- *                 <i>Digit</i><tt>+</tt>
+ *                 <i>Digit</i>{@code *}
+ *       <dd>{@code | }<i>LocalDecimalSeparator</i>
+ *                 <i>Digit</i>{@code +}
  *
  *   <dt><i>Exponent</i>:
- *       <dd><tt>( [eE] [+-]? </tt><i>Digit</i><tt>+ )</tt>
+ *       <dd>{@code ( [eE] [+-]? }<i>Digit</i>{@code + )}
  *
  *   <dt><a name="Decimal-regex"><i>Decimal</i>:</a>
- *       <dd><tt>( [-+]? </tt><i>DecimalNumeral</i>
- *                         <i>Exponent</i><tt>? )</tt>
- *       <dd><tt>| </tt><i>LocalPositivePrefix</i>
+ *       <dd>{@code ( [-+]? }<i>DecimalNumeral</i>
+ *                         <i>Exponent</i>{@code ? )}
+ *       <dd>{@code | }<i>LocalPositivePrefix</i>
  *                 <i>DecimalNumeral</i>
  *                 <i>LocalPositiveSuffix</i>
- *                 <i>Exponent</i><tt>?</tt>
- *       <dd><tt>| </tt><i>LocalNegativePrefix</i>
+ *                 <i>Exponent</i>{@code ?}
+ *       <dd>{@code | }<i>LocalNegativePrefix</i>
  *                 <i>DecimalNumeral</i>
  *                 <i>LocalNegativeSuffix</i>
- *                 <i>Exponent</i><tt>?</tt>
+ *                 <i>Exponent</i>{@code ?}
  *
  *   <dt><i>HexFloat</i>:
- *       <dd><tt>[-+]? 0[xX][0-9a-fA-F]*\.[0-9a-fA-F]+
- *                 ([pP][-+]?[0-9]+)?</tt>
+ *       <dd>{@code [-+]? 0[xX][0-9a-fA-F]*\.[0-9a-fA-F]+
+ *                 ([pP][-+]?[0-9]+)?}
  *
  *   <dt><i>NonNumber</i>:
- *       <dd><tt>NaN
- *                          | </tt><i>LocalNan</i><tt>
+ *       <dd>{@code NaN
+ *                          | }<i>LocalNan</i>{@code
  *                          | Infinity
- *                          | </tt><i>LocalInfinity</i>
+ *                          | }<i>LocalInfinity</i>
  *
  *   <dt><i>SignedNonNumber</i>:
- *       <dd><tt>( [-+]? </tt><i>NonNumber</i><tt> )</tt>
- *       <dd><tt>| </tt><i>LocalPositivePrefix</i>
+ *       <dd>{@code ( [-+]? }<i>NonNumber</i>{@code  )}
+ *       <dd>{@code | }<i>LocalPositivePrefix</i>
  *                 <i>NonNumber</i>
  *                 <i>LocalPositiveSuffix</i>
- *       <dd><tt>| </tt><i>LocalNegativePrefix</i>
+ *       <dd>{@code | }<i>LocalNegativePrefix</i>
  *                 <i>NonNumber</i>
  *                 <i>LocalNegativeSuffix</i>
  *
  *   <dt><a name="Float-regex"><i>Float</i></a>:
  *       <dd><i>Decimal</i>
- *           <tt>| </tt><i>HexFloat</i>
- *           <tt>| </tt><i>SignedNonNumber</i>
+ *           {@code | }<i>HexFloat</i>
+ *           {@code | }<i>SignedNonNumber</i>
  *
  * </dl>
  * <p>Whitespace is not significant in the above regular expressions.
@@ -521,7 +521,7 @@
     // Constructors
 
     /**
-     * Constructs a <code>Scanner</code> that returns values scanned
+     * Constructs a {@code Scanner} that returns values scanned
      * from the specified source delimited by the specified pattern.
      *
      * @param source A character source implementing the Readable interface
@@ -541,7 +541,7 @@
     }
 
     /**
-     * Constructs a new <code>Scanner</code> that produces values scanned
+     * Constructs a new {@code Scanner} that produces values scanned
      * from the specified source.
      *
      * @param  source A character source implementing the {@link Readable}
@@ -552,7 +552,7 @@
     }
 
     /**
-     * Constructs a new <code>Scanner</code> that produces values scanned
+     * Constructs a new {@code Scanner} that produces values scanned
      * from the specified input stream. Bytes from the stream are converted
      * into characters using the underlying platform's
      * {@linkplain java.nio.charset.Charset#defaultCharset() default charset}.
@@ -564,7 +564,7 @@
     }
 
     /**
-     * Constructs a new <code>Scanner</code> that produces values scanned
+     * Constructs a new {@code Scanner} that produces values scanned
      * from the specified input stream. Bytes from the stream are converted
      * into characters using the specified charset.
      *
@@ -599,7 +599,7 @@
     }
 
     /**
-     * Constructs a new <code>Scanner</code> that produces values scanned
+     * Constructs a new {@code Scanner} that produces values scanned
      * from the specified file. Bytes from the file are converted into
      * characters using the underlying platform's
      * {@linkplain java.nio.charset.Charset#defaultCharset() default charset}.
@@ -612,7 +612,7 @@
     }
 
     /**
-     * Constructs a new <code>Scanner</code> that produces values scanned
+     * Constructs a new {@code Scanner} that produces values scanned
      * from the specified file. Bytes from the file are converted into
      * characters using the specified charset.
      *
@@ -650,7 +650,7 @@
     }
 
     /**
-     * Constructs a new <code>Scanner</code> that produces values scanned
+     * Constructs a new {@code Scanner} that produces values scanned
      * from the specified file. Bytes from the file are converted into
      * characters using the underlying platform's
      * {@linkplain java.nio.charset.Charset#defaultCharset() default charset}.
@@ -669,7 +669,7 @@
     }
 
     /**
-     * Constructs a new <code>Scanner</code> that produces values scanned
+     * Constructs a new {@code Scanner} that produces values scanned
      * from the specified file. Bytes from the file are converted into
      * characters using the specified charset.
      *
@@ -693,7 +693,7 @@
     }
 
     /**
-     * Constructs a new <code>Scanner</code> that produces values scanned
+     * Constructs a new {@code Scanner} that produces values scanned
      * from the specified string.
      *
      * @param  source A string to scan
@@ -703,7 +703,7 @@
     }
 
     /**
-     * Constructs a new <code>Scanner</code> that produces values scanned
+     * Constructs a new {@code Scanner} that produces values scanned
      * from the specified channel. Bytes from the source are converted into
      * characters using the underlying platform's
      * {@linkplain java.nio.charset.Charset#defaultCharset() default charset}.
@@ -720,7 +720,7 @@
     }
 
     /**
-     * Constructs a new <code>Scanner</code> that produces values scanned
+     * Constructs a new {@code Scanner} that produces values scanned
      * from the specified channel. Bytes from the source are converted into
      * characters using the specified charset.
      *
@@ -1077,7 +1077,7 @@
      *
      * <p> If this scanner has not yet been closed then if its underlying
      * {@linkplain java.lang.Readable readable} also implements the {@link
-     * java.io.Closeable} interface then the readable's <tt>close</tt> method
+     * java.io.Closeable} interface then the readable's {@code close} method
      * will be invoked.  If this scanner is already closed then invoking this
      * method will have no effect.
      *
@@ -1101,9 +1101,9 @@
     }
 
     /**
-     * Returns the <code>IOException</code> last thrown by this
-     * <code>Scanner</code>'s underlying <code>Readable</code>. This method
-     * returns <code>null</code> if no such exception exists.
+     * Returns the {@code IOException} last thrown by this
+     * {@code Scanner}'s underlying {@code Readable}. This method
+     * returns {@code null} if no such exception exists.
      *
      * @return the last exception thrown by this scanner's readable
      */
@@ -1112,7 +1112,7 @@
     }
 
     /**
-     * Returns the <code>Pattern</code> this <code>Scanner</code> is currently
+     * Returns the {@code Pattern} this {@code Scanner} is currently
      * using to match delimiters.
      *
      * @return this scanner's delimiting pattern.
@@ -1134,11 +1134,11 @@
 
     /**
      * Sets this scanner's delimiting pattern to a pattern constructed from
-     * the specified <code>String</code>.
+     * the specified {@code String}.
      *
      * <p> An invocation of this method of the form
-     * <tt>useDelimiter(pattern)</tt> behaves in exactly the same way as the
-     * invocation <tt>useDelimiter(Pattern.compile(pattern))</tt>.
+     * {@code useDelimiter(pattern)} behaves in exactly the same way as the
+     * invocation {@code useDelimiter(Pattern.compile(pattern))}.
      *
      * <p> Invoking the {@link #reset} method will set the scanner's delimiter
      * to the <a href= "#default-delimiter">default</a>.
@@ -1236,12 +1236,12 @@
      * number matching regular expressions; see
      * <a href= "#localized-numbers">localized numbers</a> above.
      *
-     * <p>If the radix is less than <code>Character.MIN_RADIX</code>
-     * or greater than <code>Character.MAX_RADIX</code>, then an
-     * <code>IllegalArgumentException</code> is thrown.
+     * <p>If the radix is less than {@code Character.MIN_RADIX}
+     * or greater than {@code Character.MAX_RADIX}, then an
+     * {@code IllegalArgumentException} is thrown.
      *
      * <p>Invoking the {@link #reset} method will set the scanner's radix to
-     * <code>10</code>.
+     * {@code 10}.
      *
      * @param radix The radix to use when scanning numbers
      * @return this scanner
@@ -1271,15 +1271,15 @@
 
     /**
      * Returns the match result of the last scanning operation performed
-     * by this scanner. This method throws <code>IllegalStateException</code>
+     * by this scanner. This method throws {@code IllegalStateException}
      * if no match has been performed, or if the last match was
      * not successful.
      *
-     * <p>The various <code>next</code>methods of <code>Scanner</code>
+     * <p>The various {@code next}methods of {@code Scanner}
      * make a match result available if they complete without throwing an
      * exception. For instance, after an invocation of the {@link #nextInt}
      * method that returned an int, this method returns a
-     * <code>MatchResult</code> for the search of the
+     * {@code MatchResult} for the search of the
      * <a href="#Integer-regex"><i>Integer</i></a> regular expression
      * defined above. Similarly the {@link #findInLine},
      * {@link #findWithinHorizon}, and {@link #skip} methods will make a
@@ -1295,8 +1295,8 @@
     }
 
     /**
-     * <p>Returns the string representation of this <code>Scanner</code>. The
-     * string representation of a <code>Scanner</code> contains information
+     * <p>Returns the string representation of this {@code Scanner}. The
+     * string representation of a {@code Scanner} contains information
      * that may be useful for debugging. The exact format is unspecified.
      *
      * @return  The string representation of this scanner
@@ -1347,7 +1347,7 @@
      * A complete token is preceded and followed by input that matches
      * the delimiter pattern. This method may block while waiting for input
      * to scan, even if a previous invocation of {@link #hasNext} returned
-     * <code>true</code>.
+     * {@code true}.
      *
      * @return the next token
      * @throws NoSuchElementException if no more tokens are available
@@ -1374,7 +1374,7 @@
 
     /**
      * The remove operation is not supported by this implementation of
-     * <code>Iterator</code>.
+     * {@code Iterator}.
      *
      * @throws UnsupportedOperationException if this method is invoked.
      * @see java.util.Iterator
@@ -1387,9 +1387,9 @@
      * Returns true if the next token matches the pattern constructed from the
      * specified string. The scanner does not advance past any input.
      *
-     * <p> An invocation of this method of the form <tt>hasNext(pattern)</tt>
+     * <p> An invocation of this method of the form {@code hasNext(pattern)}
      * behaves in exactly the same way as the invocation
-     * <tt>hasNext(Pattern.compile(pattern))</tt>.
+     * {@code hasNext(Pattern.compile(pattern))}.
      *
      * @param pattern a string specifying the pattern to scan
      * @return true if and only if this scanner has another token matching
@@ -1405,9 +1405,9 @@
      * specified string.  If the match is successful, the scanner advances
      * past the input that matched the pattern.
      *
-     * <p> An invocation of this method of the form <tt>next(pattern)</tt>
+     * <p> An invocation of this method of the form {@code next(pattern)}
      * behaves in exactly the same way as the invocation
-     * <tt>next(Pattern.compile(pattern))</tt>.
+     * {@code next(Pattern.compile(pattern))}.
      *
      * @param pattern a string specifying the pattern to scan
      * @return the next token
@@ -1452,7 +1452,7 @@
     /**
      * Returns the next token if it matches the specified pattern. This
      * method may block while waiting for input to scan, even if a previous
-     * invocation of {@link #hasNext(Pattern)} returned <code>true</code>.
+     * invocation of {@link #hasNext(Pattern)} returned {@code true}.
      * If the match is successful, the scanner advances past the input that
      * matched the pattern.
      *
@@ -1554,9 +1554,9 @@
      * Attempts to find the next occurrence of a pattern constructed from the
      * specified string, ignoring delimiters.
      *
-     * <p>An invocation of this method of the form <tt>findInLine(pattern)</tt>
+     * <p>An invocation of this method of the form {@code findInLine(pattern)}
      * behaves in exactly the same way as the invocation
-     * <tt>findInLine(Pattern.compile(pattern))</tt>.
+     * {@code findInLine(Pattern.compile(pattern))}.
      *
      * @param pattern a string specifying the pattern to search for
      * @return the text that matched the specified pattern
@@ -1572,7 +1572,7 @@
      * scanner advances past the input that matched and returns the string that
      * matched the pattern.
      * If no such pattern is detected in the input up to the next line
-     * separator, then <code>null</code> is returned and the scanner's
+     * separator, then {@code null} is returned and the scanner's
      * position is unchanged. This method may block waiting for input that
      * matches the pattern.
      *
@@ -1621,9 +1621,9 @@
      * specified string, ignoring delimiters.
      *
      * <p>An invocation of this method of the form
-     * <tt>findWithinHorizon(pattern)</tt> behaves in exactly the same way as
+     * {@code findWithinHorizon(pattern)} behaves in exactly the same way as
      * the invocation
-     * <tt>findWithinHorizon(Pattern.compile(pattern, horizon))</tt>.
+     * {@code findWithinHorizon(Pattern.compile(pattern, horizon))}.
      *
      * @param pattern a string specifying the pattern to search for
      * @param horizon the search horizon
@@ -1645,14 +1645,14 @@
      * null is returned and the scanner's position remains unchanged. This
      * method may block waiting for input that matches the pattern.
      *
-     * <p>A scanner will never search more than <code>horizon</code> code
+     * <p>A scanner will never search more than {@code horizon} code
      * points beyond its current position. Note that a match may be clipped
      * by the horizon; that is, an arbitrary match result may have been
      * different if the horizon had been larger. The scanner treats the
      * horizon as a transparent, non-anchoring bound (see {@link
      * Matcher#useTransparentBounds} and {@link Matcher#useAnchoringBounds}).
      *
-     * <p>If horizon is <code>0</code>, then the horizon is ignored and
+     * <p>If horizon is {@code 0}, then the horizon is ignored and
      * this method continues to search through the input looking for the
      * specified pattern without bound. In this case it may buffer all of
      * the input searching for the pattern.
@@ -1696,7 +1696,7 @@
      *
      * <p>If a match to the specified pattern is not found at the
      * current position, then no input is skipped and a
-     * <tt>NoSuchElementException</tt> is thrown.
+     * {@code NoSuchElementException} is thrown.
      *
      * <p>Since this method seeks to match the specified pattern starting at
      * the scanner's current position, patterns that can match a lot of
@@ -1704,8 +1704,8 @@
      * amount of input.
      *
      * <p>Note that it is possible to skip something without risking a
-     * <code>NoSuchElementException</code> by using a pattern that can
-     * match nothing, e.g., <code>sc.skip("[ \t]*")</code>.
+     * {@code NoSuchElementException} by using a pattern that can
+     * match nothing, e.g., {@code sc.skip("[ \t]*")}.
      *
      * @param pattern a string specifying the pattern to skip over
      * @return this scanner
@@ -1737,9 +1737,9 @@
      * Skips input that matches a pattern constructed from the specified
      * string.
      *
-     * <p> An invocation of this method of the form <tt>skip(pattern)</tt>
+     * <p> An invocation of this method of the form {@code skip(pattern)}
      * behaves in exactly the same way as the invocation
-     * <tt>skip(Pattern.compile(pattern))</tt>.
+     * {@code skip(Pattern.compile(pattern))}.
      *
      * @param pattern a string specifying the pattern to skip over
      * @return this scanner
@@ -1767,7 +1767,7 @@
 
     /**
      * Scans the next token of the input into a boolean value and returns
-     * that value. This method will throw <code>InputMismatchException</code>
+     * that value. This method will throw {@code InputMismatchException}
      * if the next token cannot be translated into a valid boolean value.
      * If the match is successful, the scanner advances past the input that
      * matched.
@@ -1822,14 +1822,14 @@
     }
 
     /**
-     * Scans the next token of the input as a <tt>byte</tt>.
+     * Scans the next token of the input as a {@code byte}.
      *
      * <p> An invocation of this method of the form
-     * <tt>nextByte()</tt> behaves in exactly the same way as the
-     * invocation <tt>nextByte(radix)</tt>, where <code>radix</code>
+     * {@code nextByte()} behaves in exactly the same way as the
+     * invocation {@code nextByte(radix)}, where {@code radix}
      * is the default radix of this scanner.
      *
-     * @return the <tt>byte</tt> scanned from the input
+     * @return the {@code byte} scanned from the input
      * @throws InputMismatchException
      *         if the next token does not match the <i>Integer</i>
      *         regular expression, or is out of range
@@ -1841,15 +1841,15 @@
     }
 
     /**
-     * Scans the next token of the input as a <tt>byte</tt>.
-     * This method will throw <code>InputMismatchException</code>
+     * Scans the next token of the input as a {@code byte}.
+     * This method will throw {@code InputMismatchException}
      * if the next token cannot be translated into a valid byte value as
      * described below. If the translation is successful, the scanner advances
      * past the input that matched.
      *
      * <p> If the next token matches the <a
      * href="#Integer-regex"><i>Integer</i></a> regular expression defined
-     * above then the token is converted into a <tt>byte</tt> value as if by
+     * above then the token is converted into a {@code byte} value as if by
      * removing all locale specific prefixes, group separators, and locale
      * specific suffixes, then mapping non-ASCII digits into ASCII
      * digits via {@link Character#digit Character.digit}, prepending a
@@ -1859,7 +1859,7 @@
      * specified radix.
      *
      * @param radix the radix used to interpret the token as a byte value
-     * @return the <tt>byte</tt> scanned from the input
+     * @return the {@code byte} scanned from the input
      * @throws InputMismatchException
      *         if the next token does not match the <i>Integer</i>
      *         regular expression, or is out of range
@@ -1928,14 +1928,14 @@
     }
 
     /**
-     * Scans the next token of the input as a <tt>short</tt>.
+     * Scans the next token of the input as a {@code short}.
      *
      * <p> An invocation of this method of the form
-     * <tt>nextShort()</tt> behaves in exactly the same way as the
-     * invocation <tt>nextShort(radix)</tt>, where <code>radix</code>
+     * {@code nextShort()} behaves in exactly the same way as the
+     * invocation {@code nextShort(radix)}, where {@code radix}
      * is the default radix of this scanner.
      *
-     * @return the <tt>short</tt> scanned from the input
+     * @return the {@code short} scanned from the input
      * @throws InputMismatchException
      *         if the next token does not match the <i>Integer</i>
      *         regular expression, or is out of range
@@ -1947,15 +1947,15 @@
     }
 
     /**
-     * Scans the next token of the input as a <tt>short</tt>.
-     * This method will throw <code>InputMismatchException</code>
+     * Scans the next token of the input as a {@code short}.
+     * This method will throw {@code InputMismatchException}
      * if the next token cannot be translated into a valid short value as
      * described below. If the translation is successful, the scanner advances
      * past the input that matched.
      *
      * <p> If the next token matches the <a
      * href="#Integer-regex"><i>Integer</i></a> regular expression defined
-     * above then the token is converted into a <tt>short</tt> value as if by
+     * above then the token is converted into a {@code short} value as if by
      * removing all locale specific prefixes, group separators, and locale
      * specific suffixes, then mapping non-ASCII digits into ASCII
      * digits via {@link Character#digit Character.digit}, prepending a
@@ -1965,7 +1965,7 @@
      * specified radix.
      *
      * @param radix the radix used to interpret the token as a short value
-     * @return the <tt>short</tt> scanned from the input
+     * @return the {@code short} scanned from the input
      * @throws InputMismatchException
      *         if the next token does not match the <i>Integer</i>
      *         regular expression, or is out of range
@@ -2058,14 +2058,14 @@
     }
 
     /**
-     * Scans the next token of the input as an <tt>int</tt>.
+     * Scans the next token of the input as an {@code int}.
      *
      * <p> An invocation of this method of the form
-     * <tt>nextInt()</tt> behaves in exactly the same way as the
-     * invocation <tt>nextInt(radix)</tt>, where <code>radix</code>
+     * {@code nextInt()} behaves in exactly the same way as the
+     * invocation {@code nextInt(radix)}, where {@code radix}
      * is the default radix of this scanner.
      *
-     * @return the <tt>int</tt> scanned from the input
+     * @return the {@code int} scanned from the input
      * @throws InputMismatchException
      *         if the next token does not match the <i>Integer</i>
      *         regular expression, or is out of range
@@ -2077,15 +2077,15 @@
     }
 
     /**
-     * Scans the next token of the input as an <tt>int</tt>.
-     * This method will throw <code>InputMismatchException</code>
+     * Scans the next token of the input as an {@code int}.
+     * This method will throw {@code InputMismatchException}
      * if the next token cannot be translated into a valid int value as
      * described below. If the translation is successful, the scanner advances
      * past the input that matched.
      *
      * <p> If the next token matches the <a
      * href="#Integer-regex"><i>Integer</i></a> regular expression defined
-     * above then the token is converted into an <tt>int</tt> value as if by
+     * above then the token is converted into an {@code int} value as if by
      * removing all locale specific prefixes, group separators, and locale
      * specific suffixes, then mapping non-ASCII digits into ASCII
      * digits via {@link Character#digit Character.digit}, prepending a
@@ -2095,7 +2095,7 @@
      * specified radix.
      *
      * @param radix the radix used to interpret the token as an int value
-     * @return the <tt>int</tt> scanned from the input
+     * @return the {@code int} scanned from the input
      * @throws InputMismatchException
      *         if the next token does not match the <i>Integer</i>
      *         regular expression, or is out of range
@@ -2164,14 +2164,14 @@
     }
 
     /**
-     * Scans the next token of the input as a <tt>long</tt>.
+     * Scans the next token of the input as a {@code long}.
      *
      * <p> An invocation of this method of the form
-     * <tt>nextLong()</tt> behaves in exactly the same way as the
-     * invocation <tt>nextLong(radix)</tt>, where <code>radix</code>
+     * {@code nextLong()} behaves in exactly the same way as the
+     * invocation {@code nextLong(radix)}, where {@code radix}
      * is the default radix of this scanner.
      *
-     * @return the <tt>long</tt> scanned from the input
+     * @return the {@code long} scanned from the input
      * @throws InputMismatchException
      *         if the next token does not match the <i>Integer</i>
      *         regular expression, or is out of range
@@ -2183,15 +2183,15 @@
     }
 
     /**
-     * Scans the next token of the input as a <tt>long</tt>.
-     * This method will throw <code>InputMismatchException</code>
+     * Scans the next token of the input as a {@code long}.
+     * This method will throw {@code InputMismatchException}
      * if the next token cannot be translated into a valid long value as
      * described below. If the translation is successful, the scanner advances
      * past the input that matched.
      *
      * <p> If the next token matches the <a
      * href="#Integer-regex"><i>Integer</i></a> regular expression defined
-     * above then the token is converted into a <tt>long</tt> value as if by
+     * above then the token is converted into a {@code long} value as if by
      * removing all locale specific prefixes, group separators, and locale
      * specific suffixes, then mapping non-ASCII digits into ASCII
      * digits via {@link Character#digit Character.digit}, prepending a
@@ -2201,7 +2201,7 @@
      * specified radix.
      *
      * @param radix the radix used to interpret the token as an int value
-     * @return the <tt>long</tt> scanned from the input
+     * @return the {@code long} scanned from the input
      * @throws InputMismatchException
      *         if the next token does not match the <i>Integer</i>
      *         regular expression, or is out of range
@@ -2306,15 +2306,15 @@
     }
 
     /**
-     * Scans the next token of the input as a <tt>float</tt>.
-     * This method will throw <code>InputMismatchException</code>
+     * Scans the next token of the input as a {@code float}.
+     * This method will throw {@code InputMismatchException}
      * if the next token cannot be translated into a valid float value as
      * described below. If the translation is successful, the scanner advances
      * past the input that matched.
      *
      * <p> If the next token matches the <a
      * href="#Float-regex"><i>Float</i></a> regular expression defined above
-     * then the token is converted into a <tt>float</tt> value as if by
+     * then the token is converted into a {@code float} value as if by
      * removing all locale specific prefixes, group separators, and locale
      * specific suffixes, then mapping non-ASCII digits into ASCII
      * digits via {@link Character#digit Character.digit}, prepending a
@@ -2325,7 +2325,7 @@
      * is passed to {@link Float#parseFloat(String) Float.parseFloat} as
      * appropriate.
      *
-     * @return the <tt>float</tt> scanned from the input
+     * @return the {@code float} scanned from the input
      * @throws InputMismatchException
      *         if the next token does not match the <i>Float</i>
      *         regular expression, or is out of range
@@ -2373,15 +2373,15 @@
     }
 
     /**
-     * Scans the next token of the input as a <tt>double</tt>.
-     * This method will throw <code>InputMismatchException</code>
+     * Scans the next token of the input as a {@code double}.
+     * This method will throw {@code InputMismatchException}
      * if the next token cannot be translated into a valid double value.
      * If the translation is successful, the scanner advances past the input
      * that matched.
      *
      * <p> If the next token matches the <a
      * href="#Float-regex"><i>Float</i></a> regular expression defined above
-     * then the token is converted into a <tt>double</tt> value as if by
+     * then the token is converted into a {@code double} value as if by
      * removing all locale specific prefixes, group separators, and locale
      * specific suffixes, then mapping non-ASCII digits into ASCII
      * digits via {@link Character#digit Character.digit}, prepending a
@@ -2392,7 +2392,7 @@
      * is passed to {@link Double#parseDouble(String) Double.parseDouble} as
      * appropriate.
      *
-     * @return the <tt>double</tt> scanned from the input
+     * @return the {@code double} scanned from the input
      * @throws InputMismatchException
      *         if the next token does not match the <i>Float</i>
      *         regular expression, or is out of range
@@ -2421,12 +2421,12 @@
 
     /**
      * Returns true if the next token in this scanner's input can be
-     * interpreted as a <code>BigInteger</code> in the default radix using the
+     * interpreted as a {@code BigInteger} in the default radix using the
      * {@link #nextBigInteger} method. The scanner does not advance past any
      * input.
      *
      * @return true if and only if this scanner's next token is a valid
-     *         <code>BigInteger</code>
+     *         {@code BigInteger}
      * @throws IllegalStateException if this scanner is closed
      */
     public boolean hasNextBigInteger() {
@@ -2435,13 +2435,13 @@
 
     /**
      * Returns true if the next token in this scanner's input can be
-     * interpreted as a <code>BigInteger</code> in the specified radix using
+     * interpreted as a {@code BigInteger} in the specified radix using
      * the {@link #nextBigInteger} method. The scanner does not advance past
      * any input.
      *
      * @param radix the radix used to interpret the token as an integer
      * @return true if and only if this scanner's next token is a valid
-     *         <code>BigInteger</code>
+     *         {@code BigInteger}
      * @throws IllegalStateException if this scanner is closed
      */
     public boolean hasNextBigInteger(int radix) {
@@ -2465,11 +2465,11 @@
      * BigInteger}.
      *
      * <p> An invocation of this method of the form
-     * <tt>nextBigInteger()</tt> behaves in exactly the same way as the
-     * invocation <tt>nextBigInteger(radix)</tt>, where <code>radix</code>
+     * {@code nextBigInteger()} behaves in exactly the same way as the
+     * invocation {@code nextBigInteger(radix)}, where {@code radix}
      * is the default radix of this scanner.
      *
-     * @return the <tt>BigInteger</tt> scanned from the input
+     * @return the {@code BigInteger} scanned from the input
      * @throws InputMismatchException
      *         if the next token does not match the <i>Integer</i>
      *         regular expression, or is out of range
@@ -2486,7 +2486,7 @@
      *
      * <p> If the next token matches the <a
      * href="#Integer-regex"><i>Integer</i></a> regular expression defined
-     * above then the token is converted into a <tt>BigInteger</tt> value as if
+     * above then the token is converted into a {@code BigInteger} value as if
      * by removing all group separators, mapping non-ASCII digits into ASCII
      * digits via the {@link Character#digit Character.digit}, and passing the
      * resulting string to the {@link
@@ -2494,7 +2494,7 @@
      * BigInteger(String, int)} constructor with the specified radix.
      *
      * @param radix the radix used to interpret the token
-     * @return the <tt>BigInteger</tt> scanned from the input
+     * @return the {@code BigInteger} scanned from the input
      * @throws InputMismatchException
      *         if the next token does not match the <i>Integer</i>
      *         regular expression, or is out of range
@@ -2525,12 +2525,12 @@
 
     /**
      * Returns true if the next token in this scanner's input can be
-     * interpreted as a <code>BigDecimal</code> using the
+     * interpreted as a {@code BigDecimal} using the
      * {@link #nextBigDecimal} method. The scanner does not advance past any
      * input.
      *
      * @return true if and only if this scanner's next token is a valid
-     *         <code>BigDecimal</code>
+     *         {@code BigDecimal}
      * @throws IllegalStateException if this scanner is closed
      */
     public boolean hasNextBigDecimal() {
@@ -2553,14 +2553,14 @@
      *
      * <p> If the next token matches the <a
      * href="#Decimal-regex"><i>Decimal</i></a> regular expression defined
-     * above then the token is converted into a <tt>BigDecimal</tt> value as if
+     * above then the token is converted into a {@code BigDecimal} value as if
      * by removing all group separators, mapping non-ASCII digits into ASCII
      * digits via the {@link Character#digit Character.digit}, and passing the
      * resulting string to the {@link
      * java.math.BigDecimal#BigDecimal(java.lang.String) BigDecimal(String)}
      * constructor.
      *
-     * @return the <tt>BigDecimal</tt> scanned from the input
+     * @return the {@code BigDecimal} scanned from the input
      * @throws InputMismatchException
      *         if the next token does not match the <i>Decimal</i>
      *         regular expression, or is out of range
@@ -2594,7 +2594,7 @@
      * #useDelimiter}, {@link #useLocale}, or {@link #useRadix}.
      *
      * <p> An invocation of this method of the form
-     * <tt>scanner.reset()</tt> behaves in exactly the same way as the
+     * {@code scanner.reset()} behaves in exactly the same way as the
      * invocation
      *
      * <blockquote><pre>{@code
--- a/jdk/src/java.base/share/classes/java/util/ServiceConfigurationError.java	Thu Apr 09 12:29:31 2015 +0200
+++ b/jdk/src/java.base/share/classes/java/util/ServiceConfigurationError.java	Mon Aug 17 12:45:16 2015 +0300
@@ -65,7 +65,7 @@
     /**
      * Constructs a new instance with the specified message.
      *
-     * @param  msg  The message, or <tt>null</tt> if there is no message
+     * @param  msg  The message, or {@code null} if there is no message
      *
      */
     public ServiceConfigurationError(String msg) {
@@ -75,9 +75,9 @@
     /**
      * Constructs a new instance with the specified message and cause.
      *
-     * @param  msg  The message, or <tt>null</tt> if there is no message
+     * @param  msg  The message, or {@code null} if there is no message
      *
-     * @param  cause  The cause, or <tt>null</tt> if the cause is nonexistent
+     * @param  cause  The cause, or {@code null} if the cause is nonexistent
      *                or unknown
      */
     public ServiceConfigurationError(String msg, Throwable cause) {
--- a/jdk/src/java.base/share/classes/java/util/Set.java	Thu Apr 09 12:29:31 2015 +0200
+++ b/jdk/src/java.base/share/classes/java/util/Set.java	Mon Aug 17 12:45:16 2015 +0300
@@ -27,16 +27,16 @@
 
 /**
  * A collection that contains no duplicate elements.  More formally, sets
- * contain no pair of elements <code>e1</code> and <code>e2</code> such that
- * <code>e1.equals(e2)</code>, and at most one null element.  As implied by
+ * contain no pair of elements {@code e1} and {@code e2} such that
+ * {@code e1.equals(e2)}, and at most one null element.  As implied by
  * its name, this interface models the mathematical <i>set</i> abstraction.
  *
- * <p>The <tt>Set</tt> interface places additional stipulations, beyond those
- * inherited from the <tt>Collection</tt> interface, on the contracts of all
- * constructors and on the contracts of the <tt>add</tt>, <tt>equals</tt> and
- * <tt>hashCode</tt> methods.  Declarations for other inherited methods are
+ * <p>The {@code Set} interface places additional stipulations, beyond those
+ * inherited from the {@code Collection} interface, on the contracts of all
+ * constructors and on the contracts of the {@code add}, {@code equals} and
+ * {@code hashCode} methods.  Declarations for other inherited methods are
  * also included here for convenience.  (The specifications accompanying these
- * declarations have been tailored to the <tt>Set</tt> interface, but they do
+ * declarations have been tailored to the {@code Set} interface, but they do
  * not contain any additional stipulations.)
  *
  * <p>The additional stipulation on constructors is, not surprisingly,
@@ -45,7 +45,7 @@
  *
  * <p>Note: Great care must be exercised if mutable objects are used as set
  * elements.  The behavior of a set is not specified if the value of an object
- * is changed in a manner that affects <tt>equals</tt> comparisons while the
+ * is changed in a manner that affects {@code equals} comparisons while the
  * object is an element in the set.  A special case of this prohibition is
  * that it is not permissible for a set to contain itself as an element.
  *
@@ -53,7 +53,7 @@
  * they may contain.  For example, some implementations prohibit null elements,
  * and some have restrictions on the types of their elements.  Attempting to
  * add an ineligible element throws an unchecked exception, typically
- * <tt>NullPointerException</tt> or <tt>ClassCastException</tt>.  Attempting
+ * {@code NullPointerException} or {@code ClassCastException}.  Attempting
  * to query the presence of an ineligible element may throw an exception,
  * or it may simply return false; some implementations will exhibit the former
  * behavior and some will exhibit the latter.  More generally, attempting an
@@ -87,28 +87,28 @@
 
     /**
      * Returns the number of elements in this set (its cardinality).  If this
-     * set contains more than <tt>Integer.MAX_VALUE</tt> elements, returns
-     * <tt>Integer.MAX_VALUE</tt>.
+     * set contains more than {@code Integer.MAX_VALUE} elements, returns
+     * {@code Integer.MAX_VALUE}.
      *
      * @return the number of elements in this set (its cardinality)
      */
     int size();
 
     /**
-     * Returns <tt>true</tt> if this set contains no elements.
+     * Returns {@code true} if this set contains no elements.
      *
-     * @return <tt>true</tt> if this set contains no elements
+     * @return {@code true} if this set contains no elements
      */
     boolean isEmpty();
 
     /**
-     * Returns <tt>true</tt> if this set contains the specified element.
-     * More formally, returns <tt>true</tt> if and only if this set
-     * contains an element <tt>e</tt> such that
-     * <tt>(o==null&nbsp;?&nbsp;e==null&nbsp;:&nbsp;o.equals(e))</tt>.
+     * Returns {@code true} if this set contains the specified element.
+     * More formally, returns {@code true} if and only if this set
+     * contains an element {@code e} such that
+     * {@code Objects.equals(o, e)}.
      *
      * @param o element whose presence in this set is to be tested
-     * @return <tt>true</tt> if this set contains the specified element
+     * @return {@code true} if this set contains the specified element
      * @throws ClassCastException if the type of the specified element
      *         is incompatible with this set
      * (<a href="Collection.html#optional-restrictions">optional</a>)
@@ -155,7 +155,7 @@
      * <p>If this set fits in the specified array with room to spare
      * (i.e., the array has more elements than this set), the element in
      * the array immediately following the end of the set is set to
-     * <tt>null</tt>.  (This is useful in determining the length of this
+     * {@code null}.  (This is useful in determining the length of this
      * set <i>only</i> if the caller knows that this set does not contain
      * any null elements.)
      *
@@ -168,15 +168,15 @@
      * precise control over the runtime type of the output array, and may,
      * under certain circumstances, be used to save allocation costs.
      *
-     * <p>Suppose <tt>x</tt> is a set known to contain only strings.
+     * <p>Suppose {@code x} is a set known to contain only strings.
      * The following code can be used to dump the set into a newly allocated
-     * array of <tt>String</tt>:
+     * array of {@code String}:
      *
      * <pre>
      *     String[] y = x.toArray(new String[0]);</pre>
      *
-     * Note that <tt>toArray(new Object[0])</tt> is identical in function to
-     * <tt>toArray()</tt>.
+     * Note that {@code toArray(new Object[0])} is identical in function to
+     * {@code toArray()}.
      *
      * @param a the array into which the elements of this set are to be
      *        stored, if it is big enough; otherwise, a new array of the same
@@ -195,25 +195,25 @@
     /**
      * Adds the specified element to this set if it is not already present
      * (optional operation).  More formally, adds the specified element
-     * <tt>e</tt> to this set if the set contains no element <tt>e2</tt>
+     * {@code e} to this set if the set contains no element {@code e2}
      * such that
-     * <tt>(e==null&nbsp;?&nbsp;e2==null&nbsp;:&nbsp;e.equals(e2))</tt>.
+     * {@code Objects.equals(e, e2)}.
      * If this set already contains the element, the call leaves the set
-     * unchanged and returns <tt>false</tt>.  In combination with the
+     * unchanged and returns {@code false}.  In combination with the
      * restriction on constructors, this ensures that sets never contain
      * duplicate elements.
      *
      * <p>The stipulation above does not imply that sets must accept all
      * elements; sets may refuse to add any particular element, including
-     * <tt>null</tt>, and throw an exception, as described in the
+     * {@code null}, and throw an exception, as described in the
      * specification for {@link Collection#add Collection.add}.
      * Individual set implementations should clearly document any
      * restrictions on the elements that they may contain.
      *
      * @param e element to be added to this set
-     * @return <tt>true</tt> if this set did not already contain the specified
+     * @return {@code true} if this set did not already contain the specified
      *         element
-     * @throws UnsupportedOperationException if the <tt>add</tt> operation
+     * @throws UnsupportedOperationException if the {@code add} operation
      *         is not supported by this set
      * @throws ClassCastException if the class of the specified element
      *         prevents it from being added to this set
@@ -227,23 +227,23 @@
 
     /**
      * Removes the specified element from this set if it is present
-     * (optional operation).  More formally, removes an element <tt>e</tt>
+     * (optional operation).  More formally, removes an element {@code e}
      * such that
-     * <tt>(o==null&nbsp;?&nbsp;e==null&nbsp;:&nbsp;o.equals(e))</tt>, if
-     * this set contains such an element.  Returns <tt>true</tt> if this set
+     * {@code Objects.equals(o, e)}, if
+     * this set contains such an element.  Returns {@code true} if this set
      * contained the element (or equivalently, if this set changed as a
      * result of the call).  (This set will not contain the element once the
      * call returns.)
      *
      * @param o object to be removed from this set, if present
-     * @return <tt>true</tt> if this set contained the specified element
+     * @return {@code true} if this set contained the specified element
      * @throws ClassCastException if the type of the specified element
      *         is incompatible with this set
      * (<a href="Collection.html#optional-restrictions">optional</a>)
      * @throws NullPointerException if the specified element is null and this
      *         set does not permit null elements
      * (<a href="Collection.html#optional-restrictions">optional</a>)
-     * @throws UnsupportedOperationException if the <tt>remove</tt> operation
+     * @throws UnsupportedOperationException if the {@code remove} operation
      *         is not supported by this set
      */
     boolean remove(Object o);
@@ -252,12 +252,12 @@
     // Bulk Operations
 
     /**
-     * Returns <tt>true</tt> if this set contains all of the elements of the
+     * Returns {@code true} if this set contains all of the elements of the
      * specified collection.  If the specified collection is also a set, this
-     * method returns <tt>true</tt> if it is a <i>subset</i> of this set.
+     * method returns {@code true} if it is a <i>subset</i> of this set.
      *
      * @param  c collection to be checked for containment in this set
-     * @return <tt>true</tt> if this set contains all of the elements of the
+     * @return {@code true} if this set contains all of the elements of the
      *         specified collection
      * @throws ClassCastException if the types of one or more elements
      *         in the specified collection are incompatible with this
@@ -275,15 +275,15 @@
     /**
      * Adds all of the elements in the specified collection to this set if
      * they're not already present (optional operation).  If the specified
-     * collection is also a set, the <tt>addAll</tt> operation effectively
+     * collection is also a set, the {@code addAll} operation effectively
      * modifies this set so that its value is the <i>union</i> of the two
      * sets.  The behavior of this operation is undefined if the specified
      * collection is modified while the operation is in progress.
      *
      * @param  c collection containing elements to be added to this set
-     * @return <tt>true</tt> if this set changed as a result of the call
+     * @return {@code true} if this set changed as a result of the call
      *
-     * @throws UnsupportedOperationException if the <tt>addAll</tt> operation
+     * @throws UnsupportedOperationException if the {@code addAll} operation
      *         is not supported by this set
      * @throws ClassCastException if the class of an element of the
      *         specified collection prevents it from being added to this set
@@ -305,8 +305,8 @@
      * <i>intersection</i> of the two sets.
      *
      * @param  c collection containing elements to be retained in this set
-     * @return <tt>true</tt> if this set changed as a result of the call
-     * @throws UnsupportedOperationException if the <tt>retainAll</tt> operation
+     * @return {@code true} if this set changed as a result of the call
+     * @throws UnsupportedOperationException if the {@code retainAll} operation
      *         is not supported by this set
      * @throws ClassCastException if the class of an element of this set
      *         is incompatible with the specified collection
@@ -327,8 +327,8 @@
      * the two sets.
      *
      * @param  c collection containing elements to be removed from this set
-     * @return <tt>true</tt> if this set changed as a result of the call
-     * @throws UnsupportedOperationException if the <tt>removeAll</tt> operation
+     * @return {@code true} if this set changed as a result of the call
+     * @throws UnsupportedOperationException if the {@code removeAll} operation
      *         is not supported by this set
      * @throws ClassCastException if the class of an element of this set
      *         is incompatible with the specified collection
@@ -346,7 +346,7 @@
      * Removes all of the elements from this set (optional operation).
      * The set will be empty after this call returns.
      *
-     * @throws UnsupportedOperationException if the <tt>clear</tt> method
+     * @throws UnsupportedOperationException if the {@code clear} method
      *         is not supported by this set
      */
     void clear();
@@ -356,7 +356,7 @@
 
     /**
      * Compares the specified object with this set for equality.  Returns
-     * <tt>true</tt> if the specified object is also a set, the two sets
+     * {@code true} if the specified object is also a set, the two sets
      * have the same size, and every member of the specified set is
      * contained in this set (or equivalently, every member of this set is
      * contained in the specified set).  This definition ensures that the
@@ -364,17 +364,17 @@
      * set interface.
      *
      * @param o object to be compared for equality with this set
-     * @return <tt>true</tt> if the specified object is equal to this set
+     * @return {@code true} if the specified object is equal to this set
      */
     boolean equals(Object o);
 
     /**
      * Returns the hash code value for this set.  The hash code of a set is
      * defined to be the sum of the hash codes of the elements in the set,
-     * where the hash code of a <tt>null</tt> element is defined to be zero.
-     * This ensures that <tt>s1.equals(s2)</tt> implies that
-     * <tt>s1.hashCode()==s2.hashCode()</tt> for any two sets <tt>s1</tt>
-     * and <tt>s2</tt>, as required by the general contract of
+     * where the hash code of a {@code null} element is defined to be zero.
+     * This ensures that {@code s1.equals(s2)} implies that
+     * {@code s1.hashCode()==s2.hashCode()} for any two sets {@code s1}
+     * and {@code s2}, as required by the general contract of
      * {@link Object#hashCode}.
      *
      * @return the hash code value for this set
--- a/jdk/src/java.base/share/classes/java/util/SortedSet.java	Thu Apr 09 12:29:31 2015 +0200
+++ b/jdk/src/java.base/share/classes/java/util/SortedSet.java	Mon Aug 17 12:45:16 2015 +0300
@@ -34,38 +34,38 @@
  * to take advantage of the ordering.  (This interface is the set
  * analogue of {@link SortedMap}.)
  *
- * <p>All elements inserted into a sorted set must implement the <tt>Comparable</tt>
+ * <p>All elements inserted into a sorted set must implement the {@code Comparable}
  * interface (or be accepted by the specified comparator).  Furthermore, all
- * such elements must be <i>mutually comparable</i>: <tt>e1.compareTo(e2)</tt>
- * (or <tt>comparator.compare(e1, e2)</tt>) must not throw a
- * <tt>ClassCastException</tt> for any elements <tt>e1</tt> and <tt>e2</tt> in
+ * such elements must be <i>mutually comparable</i>: {@code e1.compareTo(e2)}
+ * (or {@code comparator.compare(e1, e2)}) must not throw a
+ * {@code ClassCastException} for any elements {@code e1} and {@code e2} in
  * the sorted set.  Attempts to violate this restriction will cause the
  * offending method or constructor invocation to throw a
- * <tt>ClassCastException</tt>.
+ * {@code ClassCastException}.
  *
  * <p>Note that the ordering maintained by a sorted set (whether or not an
  * explicit comparator is provided) must be <i>consistent with equals</i> if
- * the sorted set is to correctly implement the <tt>Set</tt> interface.  (See
- * the <tt>Comparable</tt> interface or <tt>Comparator</tt> interface for a
+ * the sorted set is to correctly implement the {@code Set} interface.  (See
+ * the {@code Comparable} interface or {@code Comparator} interface for a
  * precise definition of <i>consistent with equals</i>.)  This is so because
- * the <tt>Set</tt> interface is defined in terms of the <tt>equals</tt>
+ * the {@code Set} interface is defined in terms of the {@code equals}
  * operation, but a sorted set performs all element comparisons using its
- * <tt>compareTo</tt> (or <tt>compare</tt>) method, so two elements that are
+ * {@code compareTo} (or {@code compare}) method, so two elements that are
  * deemed equal by this method are, from the standpoint of the sorted set,
  * equal.  The behavior of a sorted set <i>is</i> well-defined even if its
  * ordering is inconsistent with equals; it just fails to obey the general
- * contract of the <tt>Set</tt> interface.
+ * contract of the {@code Set} interface.
  *
  * <p>All general-purpose sorted set implementation classes should
  * provide four "standard" constructors: 1) A void (no arguments)
  * constructor, which creates an empty sorted set sorted according to
  * the natural ordering of its elements.  2) A constructor with a
- * single argument of type <tt>Comparator</tt>, which creates an empty
+ * single argument of type {@code Comparator}, which creates an empty
  * sorted set sorted according to the specified comparator.  3) A
- * constructor with a single argument of type <tt>Collection</tt>,
+ * constructor with a single argument of type {@code Collection},
  * which creates a new sorted set with the same elements as its
  * argument, sorted according to the natural ordering of the elements.
- * 4) A constructor with a single argument of type <tt>SortedSet</tt>,
+ * 4) A constructor with a single argument of type {@code SortedSet},
  * which creates a new sorted set with the same elements and the same
  * ordering as the input sorted set.  There is no way to enforce this
  * recommendation, as interfaces cannot contain constructors.
@@ -75,17 +75,17 @@
  * endpoint but not their high endpoint (where applicable).
  * If you need a <i>closed range</i> (which includes both endpoints), and
  * the element type allows for calculation of the successor of a given
- * value, merely request the subrange from <tt>lowEndpoint</tt> to
- * <tt>successor(highEndpoint)</tt>.  For example, suppose that <tt>s</tt>
+ * value, merely request the subrange from {@code lowEndpoint} to
+ * {@code successor(highEndpoint)}.  For example, suppose that {@code s}
  * is a sorted set of strings.  The following idiom obtains a view
- * containing all of the strings in <tt>s</tt> from <tt>low</tt> to
- * <tt>high</tt>, inclusive:<pre>
+ * containing all of the strings in {@code s} from {@code low} to
+ * {@code high}, inclusive:<pre>
  *   SortedSet&lt;String&gt; sub = s.subSet(low, high+"\0");</pre>
  *
  * A similar technique can be used to generate an <i>open range</i> (which
  * contains neither endpoint).  The following idiom obtains a view
- * containing all of the Strings in <tt>s</tt> from <tt>low</tt> to
- * <tt>high</tt>, exclusive:<pre>
+ * containing all of the Strings in {@code s} from {@code low} to
+ * {@code high}, exclusive:<pre>
  *   SortedSet&lt;String&gt; sub = s.subSet(low+"\0", high);</pre>
  *
  * <p>This interface is a member of the
@@ -108,98 +108,98 @@
 public interface SortedSet<E> extends Set<E> {
     /**
      * Returns the comparator used to order the elements in this set,
-     * or <tt>null</tt> if this set uses the {@linkplain Comparable
+     * or {@code null} if this set uses the {@linkplain Comparable
      * natural ordering} of its elements.
      *
      * @return the comparator used to order the elements in this set,
-     *         or <tt>null</tt> if this set uses the natural ordering
+     *         or {@code null} if this set uses the natural ordering
      *         of its elements
      */
     Comparator<? super E> comparator();
 
     /**
      * Returns a view of the portion of this set whose elements range
-     * from <tt>fromElement</tt>, inclusive, to <tt>toElement</tt>,
-     * exclusive.  (If <tt>fromElement</tt> and <tt>toElement</tt> are
+     * from {@code fromElement}, inclusive, to {@code toElement},
+     * exclusive.  (If {@code fromElement} and {@code toElement} are
      * equal, the returned set is empty.)  The returned set is backed
      * by this set, so changes in the returned set are reflected in
      * this set, and vice-versa.  The returned set supports all
      * optional set operations that this set supports.
      *
-     * <p>The returned set will throw an <tt>IllegalArgumentException</tt>
+     * <p>The returned set will throw an {@code IllegalArgumentException}
      * on an attempt to insert an element outside its range.
      *
      * @param fromElement low endpoint (inclusive) of the returned set
      * @param toElement high endpoint (exclusive) of the returned set
      * @return a view of the portion of this set whose elements range from
-     *         <tt>fromElement</tt>, inclusive, to <tt>toElement</tt>, exclusive
-     * @throws ClassCastException if <tt>fromElement</tt> and
-     *         <tt>toElement</tt> cannot be compared to one another using this
+     *         {@code fromElement}, inclusive, to {@code toElement}, exclusive
+     * @throws ClassCastException if {@code fromElement} and
+     *         {@code toElement} cannot be compared to one another using this
      *         set's comparator (or, if the set has no comparator, using
      *         natural ordering).  Implementations may, but are not required
-     *         to, throw this exception if <tt>fromElement</tt> or
-     *         <tt>toElement</tt> cannot be compared to elements currently in
+     *         to, throw this exception if {@code fromElement} or
+     *         {@code toElement} cannot be compared to elements currently in
      *         the set.
-     * @throws NullPointerException if <tt>fromElement</tt> or
-     *         <tt>toElement</tt> is null and this set does not permit null
+     * @throws NullPointerException if {@code fromElement} or
+     *         {@code toElement} is null and this set does not permit null
      *         elements
-     * @throws IllegalArgumentException if <tt>fromElement</tt> is
-     *         greater than <tt>toElement</tt>; or if this set itself
-     *         has a restricted range, and <tt>fromElement</tt> or
-     *         <tt>toElement</tt> lies outside the bounds of the range
+     * @throws IllegalArgumentException if {@code fromElement} is
+     *         greater than {@code toElement}; or if this set itself
+     *         has a restricted range, and {@code fromElement} or
+     *         {@code toElement} lies outside the bounds of the range
      */
     SortedSet<E> subSet(E fromElement, E toElement);
 
     /**
      * Returns a view of the portion of this set whose elements are
-     * strictly less than <tt>toElement</tt>.  The returned set is
+     * strictly less than {@code toElement}.  The returned set is
      * backed by this set, so changes in the returned set are
      * reflected in this set, and vice-versa.  The returned set
      * supports all optional set operations that this set supports.
      *
-     * <p>The returned set will throw an <tt>IllegalArgumentException</tt>
+     * <p>The returned set will throw an {@code IllegalArgumentException}
      * on an attempt to insert an element outside its range.
      *
      * @param toElement high endpoint (exclusive) of the returned set
      * @return a view of the portion of this set whose elements are strictly
-     *         less than <tt>toElement</tt>
-     * @throws ClassCastException if <tt>toElement</tt> is not compatible
+     *         less than {@code toElement}
+     * @throws ClassCastException if {@code toElement} is not compatible
      *         with this set's comparator (or, if the set has no comparator,
-     *         if <tt>toElement</tt> does not implement {@link Comparable}).
+     *         if {@code toElement} does not implement {@link Comparable}).
      *         Implementations may, but are not required to, throw this
-     *         exception if <tt>toElement</tt> cannot be compared to elements
+     *         exception if {@code toElement} cannot be compared to elements
      *         currently in the set.
-     * @throws NullPointerException if <tt>toElement</tt> is null and
+     * @throws NullPointerException if {@code toElement} is null and
      *         this set does not permit null elements
      * @throws IllegalArgumentException if this set itself has a
-     *         restricted range, and <tt>toElement</tt> lies outside the
+     *         restricted range, and {@code toElement} lies outside the
      *         bounds of the range
      */
     SortedSet<E> headSet(E toElement);
 
     /**
      * Returns a view of the portion of this set whose elements are
-     * greater than or equal to <tt>fromElement</tt>.  The returned
+     * greater than or equal to {@code fromElement}.  The returned
      * set is backed by this set, so changes in the returned set are
      * reflected in this set, and vice-versa.  The returned set
      * supports all optional set operations that this set supports.
      *
-     * <p>The returned set will throw an <tt>IllegalArgumentException</tt>
+     * <p>The returned set will throw an {@code IllegalArgumentException}
      * on an attempt to insert an element outside its range.
      *
      * @param fromElement low endpoint (inclusive) of the returned set
      * @return a view of the portion of this set whose elements are greater
-     *         than or equal to <tt>fromElement</tt>
-     * @throws ClassCastException if <tt>fromElement</tt> is not compatible
+     *         than or equal to {@code fromElement}
+     * @throws ClassCastException if {@code fromElement} is not compatible
      *         with this set's comparator (or, if the set has no comparator,
-     *         if <tt>fromElement</tt> does not implement {@link Comparable}).
+     *         if {@code fromElement} does not implement {@link Comparable}).
      *         Implementations may, but are not required to, throw this
-     *         exception if <tt>fromElement</tt> cannot be compared to elements
+     *         exception if {@code fromElement} cannot be compared to elements
      *         currently in the set.
-     * @throws NullPointerException if <tt>fromElement</tt> is null
+     * @throws NullPointerException if {@code fromElement} is null
      *         and this set does not permit null elements
      * @throws IllegalArgumentException if this set itself has a
-     *         restricted range, and <tt>fromElement</tt> lies outside the
+     *         restricted range, and {@code fromElement} lies outside the
      *         bounds of the range
      */
     SortedSet<E> tailSet(E fromElement);
--- a/jdk/src/java.base/share/classes/java/util/Stack.java	Thu Apr 09 12:29:31 2015 +0200
+++ b/jdk/src/java.base/share/classes/java/util/Stack.java	Mon Aug 17 12:45:16 2015 +0300
@@ -26,12 +26,12 @@
 package java.util;
 
 /**
- * The <code>Stack</code> class represents a last-in-first-out
- * (LIFO) stack of objects. It extends class <tt>Vector</tt> with five
+ * The {@code Stack} class represents a last-in-first-out
+ * (LIFO) stack of objects. It extends class {@code Vector} with five
  * operations that allow a vector to be treated as a stack. The usual
- * <tt>push</tt> and <tt>pop</tt> operations are provided, as well as a
- * method to <tt>peek</tt> at the top item on the stack, a method to test
- * for whether the stack is <tt>empty</tt>, and a method to <tt>search</tt>
+ * {@code push} and {@code pop} operations are provided, as well as a
+ * method to {@code peek} at the top item on the stack, a method to test
+ * for whether the stack is {@code empty}, and a method to {@code search}
  * the stack for an item and discover how far it is from the top.
  * <p>
  * When a stack is first created, it contains no items.
@@ -60,7 +60,7 @@
      * addElement(item)</pre></blockquote>
      *
      * @param   item   the item to be pushed onto this stack.
-     * @return  the <code>item</code> argument.
+     * @return  the {@code item} argument.
      * @see     java.util.Vector#addElement
      */
     public E push(E item) {
@@ -74,7 +74,7 @@
      * object as the value of this function.
      *
      * @return  The object at the top of this stack (the last item
-     *          of the <tt>Vector</tt> object).
+     *          of the {@code Vector} object).
      * @throws  EmptyStackException  if this stack is empty.
      */
     public synchronized E pop() {
@@ -92,7 +92,7 @@
      * from the stack.
      *
      * @return  the object at the top of this stack (the last item
-     *          of the <tt>Vector</tt> object).
+     *          of the {@code Vector} object).
      * @throws  EmptyStackException  if this stack is empty.
      */
     public synchronized E peek() {
@@ -106,8 +106,8 @@
     /**
      * Tests if this stack is empty.
      *
-     * @return  <code>true</code> if and only if this stack contains
-     *          no items; <code>false</code> otherwise.
+     * @return  {@code true} if and only if this stack contains
+     *          no items; {@code false} otherwise.
      */
     public boolean empty() {
         return size() == 0;
@@ -115,16 +115,16 @@
 
     /**
      * Returns the 1-based position where an object is on this stack.
-     * If the object <tt>o</tt> occurs as an item in this stack, this
+     * If the object {@code o} occurs as an item in this stack, this
      * method returns the distance from the top of the stack of the
      * occurrence nearest the top of the stack; the topmost item on the
-     * stack is considered to be at distance <tt>1</tt>. The <tt>equals</tt>
-     * method is used to compare <tt>o</tt> to the
+     * stack is considered to be at distance {@code 1}. The {@code equals}
+     * method is used to compare {@code o} to the
      * items in this stack.
      *
      * @param   o   the desired object.
      * @return  the 1-based position from the top of the stack where
-     *          the object is located; the return value <code>-1</code>
+     *          the object is located; the return value {@code -1}
      *          indicates that the object is not on the stack.
      */
     public synchronized int search(Object o) {
--- a/jdk/src/java.base/share/classes/java/util/StringTokenizer.java	Thu Apr 09 12:29:31 2015 +0200
+++ b/jdk/src/java.base/share/classes/java/util/StringTokenizer.java	Mon Aug 17 12:45:16 2015 +0300
@@ -30,32 +30,32 @@
 /**
  * The string tokenizer class allows an application to break a
  * string into tokens. The tokenization method is much simpler than
- * the one used by the <code>StreamTokenizer</code> class. The
- * <code>StringTokenizer</code> methods do not distinguish among
+ * the one used by the {@code StreamTokenizer} class. The
+ * {@code StringTokenizer} methods do not distinguish among
  * identifiers, numbers, and quoted strings, nor do they recognize
  * and skip comments.
  * <p>
  * The set of delimiters (the characters that separate tokens) may
  * be specified either at creation time or on a per-token basis.
  * <p>
- * An instance of <code>StringTokenizer</code> behaves in one of two
+ * An instance of {@code StringTokenizer} behaves in one of two
  * ways, depending on whether it was created with the
- * <code>returnDelims</code> flag having the value <code>true</code>
- * or <code>false</code>:
+ * {@code returnDelims} flag having the value {@code true}
+ * or {@code false}:
  * <ul>
- * <li>If the flag is <code>false</code>, delimiter characters serve to
+ * <li>If the flag is {@code false}, delimiter characters serve to
  *     separate tokens. A token is a maximal sequence of consecutive
  *     characters that are not delimiters.
- * <li>If the flag is <code>true</code>, delimiter characters are themselves
+ * <li>If the flag is {@code true}, delimiter characters are themselves
  *     considered to be tokens. A token is thus either one delimiter
  *     character, or a maximal sequence of consecutive characters that are
  *     not delimiters.
  * </ul><p>
- * A <tt>StringTokenizer</tt> object internally maintains a current
+ * A {@code StringTokenizer} object internally maintains a current
  * position within the string to be tokenized. Some operations advance this
  * current position past the characters processed.<p>
  * A token is returned by taking a substring of the string that was used to
- * create the <tt>StringTokenizer</tt> object.
+ * create the {@code StringTokenizer} object.
  * <p>
  * The following is one example of the use of the tokenizer. The code:
  * <blockquote><pre>
@@ -74,12 +74,12 @@
  * </pre></blockquote>
  *
  * <p>
- * <tt>StringTokenizer</tt> is a legacy class that is retained for
+ * {@code StringTokenizer} is a legacy class that is retained for
  * compatibility reasons although its use is discouraged in new code. It is
- * recommended that anyone seeking this functionality use the <tt>split</tt>
- * method of <tt>String</tt> or the java.util.regex package instead.
+ * recommended that anyone seeking this functionality use the {@code split}
+ * method of {@code String} or the java.util.regex package instead.
  * <p>
- * The following example illustrates how the <tt>String.split</tt>
+ * The following example illustrates how the {@code String.split}
  * method can be used to break up a string into its basic tokens:
  * <blockquote><pre>
  *     String[] result = "this is a test".split("\\s");
@@ -171,25 +171,25 @@
 
     /**
      * Constructs a string tokenizer for the specified string. All
-     * characters in the <code>delim</code> argument are the delimiters
+     * characters in the {@code delim} argument are the delimiters
      * for separating tokens.
      * <p>
-     * If the <code>returnDelims</code> flag is <code>true</code>, then
+     * If the {@code returnDelims} flag is {@code true}, then
      * the delimiter characters are also returned as tokens. Each
      * delimiter is returned as a string of length one. If the flag is
-     * <code>false</code>, the delimiter characters are skipped and only
+     * {@code false}, the delimiter characters are skipped and only
      * serve as separators between tokens.
      * <p>
-     * Note that if <tt>delim</tt> is <tt>null</tt>, this constructor does
+     * Note that if {@code delim} is {@code null}, this constructor does
      * not throw an exception. However, trying to invoke other methods on the
-     * resulting <tt>StringTokenizer</tt> may result in a
-     * <tt>NullPointerException</tt>.
+     * resulting {@code StringTokenizer} may result in a
+     * {@code NullPointerException}.
      *
      * @param   str            a string to be parsed.
      * @param   delim          the delimiters.
      * @param   returnDelims   flag indicating whether to return the delimiters
      *                         as tokens.
-     * @exception NullPointerException if str is <CODE>null</CODE>
+     * @exception NullPointerException if str is {@code null}
      */
     public StringTokenizer(String str, String delim, boolean returnDelims) {
         currentPosition = 0;
@@ -204,18 +204,18 @@
 
     /**
      * Constructs a string tokenizer for the specified string. The
-     * characters in the <code>delim</code> argument are the delimiters
+     * characters in the {@code delim} argument are the delimiters
      * for separating tokens. Delimiter characters themselves will not
      * be treated as tokens.
      * <p>
-     * Note that if <tt>delim</tt> is <tt>null</tt>, this constructor does
+     * Note that if {@code delim} is {@code null}, this constructor does
      * not throw an exception. However, trying to invoke other methods on the
-     * resulting <tt>StringTokenizer</tt> may result in a
-     * <tt>NullPointerException</tt>.
+     * resulting {@code StringTokenizer} may result in a
+     * {@code NullPointerException}.
      *
      * @param   str     a string to be parsed.
      * @param   delim   the delimiters.
-     * @exception NullPointerException if str is <CODE>null</CODE>
+     * @exception NullPointerException if str is {@code null}
      */
     public StringTokenizer(String str, String delim) {
         this(str, delim, false);
@@ -230,7 +230,7 @@
      * not be treated as tokens.
      *
      * @param   str   a string to be parsed.
-     * @exception NullPointerException if str is <CODE>null</CODE>
+     * @exception NullPointerException if str is {@code null}
      */
     public StringTokenizer(String str) {
         this(str, " \t\n\r\f", false);
@@ -307,11 +307,11 @@
 
     /**
      * Tests if there are more tokens available from this tokenizer's string.
-     * If this method returns <tt>true</tt>, then a subsequent call to
-     * <tt>nextToken</tt> with no argument will successfully return a token.
+     * If this method returns {@code true}, then a subsequent call to
+     * {@code nextToken} with no argument will successfully return a token.
      *
-     * @return  <code>true</code> if and only if there is at least one token
-     *          in the string after the current position; <code>false</code>
+     * @return  {@code true} if and only if there is at least one token
+     *          in the string after the current position; {@code false}
      *          otherwise.
      */
     public boolean hasMoreTokens() {
@@ -355,8 +355,8 @@
     /**
      * Returns the next token in this string tokenizer's string. First,
      * the set of characters considered to be delimiters by this
-     * <tt>StringTokenizer</tt> object is changed to be the characters in
-     * the string <tt>delim</tt>. Then the next token in the string
+     * {@code StringTokenizer} object is changed to be the characters in
+     * the string {@code delim}. Then the next token in the string
      * after the current position is returned. The current position is
      * advanced beyond the recognized token.  The new delimiter set
      * remains the default after this call.
@@ -365,7 +365,7 @@
      * @return     the next token, after switching to the new delimiter set.
      * @exception  NoSuchElementException  if there are no more tokens in this
      *               tokenizer's string.
-     * @exception NullPointerException if delim is <CODE>null</CODE>
+     * @exception NullPointerException if delim is {@code null}
      */
     public String nextToken(String delim) {
         delimiters = delim;
@@ -378,12 +378,12 @@
     }
 
     /**
-     * Returns the same value as the <code>hasMoreTokens</code>
+     * Returns the same value as the {@code hasMoreTokens}
      * method. It exists so that this class can implement the
-     * <code>Enumeration</code> interface.
+     * {@code Enumeration} interface.
      *
-     * @return  <code>true</code> if there are more tokens;
-     *          <code>false</code> otherwise.
+     * @return  {@code true} if there are more tokens;
+     *          {@code false} otherwise.
      * @see     java.util.Enumeration
      * @see     java.util.StringTokenizer#hasMoreTokens()
      */
@@ -392,10 +392,10 @@
     }
 
     /**
-     * Returns the same value as the <code>nextToken</code> method,
-     * except that its declared return value is <code>Object</code> rather than
-     * <code>String</code>. It exists so that this class can implement the
-     * <code>Enumeration</code> interface.
+     * Returns the same value as the {@code nextToken} method,
+     * except that its declared return value is {@code Object} rather than
+     * {@code String}. It exists so that this class can implement the
+     * {@code Enumeration} interface.
      *
      * @return     the next token in the string.
      * @exception  NoSuchElementException  if there are no more tokens in this
@@ -409,7 +409,7 @@
 
     /**
      * Calculates the number of times that this tokenizer's
-     * <code>nextToken</code> method can be called before it generates an
+     * {@code nextToken} method can be called before it generates an
      * exception. The current position is not advanced.
      *
      * @return  the number of tokens remaining in the string using the current
--- a/jdk/src/java.base/share/classes/java/util/Timer.java	Thu Apr 09 12:29:31 2015 +0200
+++ b/jdk/src/java.base/share/classes/java/util/Timer.java	Mon Aug 17 12:45:16 2015 +0300
@@ -32,7 +32,7 @@
  * background thread.  Tasks may be scheduled for one-time execution, or for
  * repeated execution at regular intervals.
  *
- * <p>Corresponding to each <tt>Timer</tt> object is a single background
+ * <p>Corresponding to each {@code Timer} object is a single background
  * thread that is used to execute all of the timer's tasks, sequentially.
  * Timer tasks should complete quickly.  If a timer task takes excessive time
  * to complete, it "hogs" the timer's task execution thread.  This can, in
@@ -40,26 +40,26 @@
  * execute in rapid succession when (and if) the offending task finally
  * completes.
  *
- * <p>After the last live reference to a <tt>Timer</tt> object goes away
+ * <p>After the last live reference to a {@code Timer} object goes away
  * <i>and</i> all outstanding tasks have completed execution, the timer's task
  * execution thread terminates gracefully (and becomes subject to garbage
  * collection).  However, this can take arbitrarily long to occur.  By
  * default, the task execution thread does not run as a <i>daemon thread</i>,
  * so it is capable of keeping an application from terminating.  If a caller
  * wants to terminate a timer's task execution thread rapidly, the caller
- * should invoke the timer's <tt>cancel</tt> method.
+ * should invoke the timer's {@code cancel} method.
  *
  * <p>If the timer's task execution thread terminates unexpectedly, for
- * example, because its <tt>stop</tt> method is invoked, any further
+ * example, because its {@code stop} method is invoked, any further
  * attempt to schedule a task on the timer will result in an
- * <tt>IllegalStateException</tt>, as if the timer's <tt>cancel</tt>
+ * {@code IllegalStateException}, as if the timer's {@code cancel}
  * method had been invoked.
  *
  * <p>This class is thread-safe: multiple threads can share a single
- * <tt>Timer</tt> object without the need for external synchronization.
+ * {@code Timer} object without the need for external synchronization.
  *
  * <p>This class does <i>not</i> offer real-time guarantees: it schedules
- * tasks using the <tt>Object.wait(long)</tt> method.
+ * tasks using the {@code Object.wait(long)} method.
  *
  * <p>Java 5.0 introduced the {@code java.util.concurrent} package and
  * one of the concurrency utilities therein is the {@link
@@ -181,8 +181,8 @@
      *
      * @param task  task to be scheduled.
      * @param delay delay in milliseconds before task is to be executed.
-     * @throws IllegalArgumentException if <tt>delay</tt> is negative, or
-     *         <tt>delay + System.currentTimeMillis()</tt> is negative.
+     * @throws IllegalArgumentException if {@code delay} is negative, or
+     *         {@code delay + System.currentTimeMillis()} is negative.
      * @throws IllegalStateException if task was already scheduled or
      *         cancelled, timer was cancelled, or timer thread terminated.
      * @throws NullPointerException if {@code task} is null
@@ -199,7 +199,7 @@
      *
      * @param task task to be scheduled.
      * @param time time at which task is to be executed.
-     * @throws IllegalArgumentException if <tt>time.getTime()</tt> is negative.
+     * @throws IllegalArgumentException if {@code time.getTime()} is negative.
      * @throws IllegalStateException if task was already scheduled or
      *         cancelled, timer was cancelled, or timer thread terminated.
      * @throws NullPointerException if {@code task} or {@code time} is null
@@ -219,7 +219,7 @@
      * background activity), subsequent executions will be delayed as well.
      * In the long run, the frequency of execution will generally be slightly
      * lower than the reciprocal of the specified period (assuming the system
-     * clock underlying <tt>Object.wait(long)</tt> is accurate).
+     * clock underlying {@code Object.wait(long)} is accurate).
      *
      * <p>Fixed-delay execution is appropriate for recurring activities
      * that require "smoothness."  In other words, it is appropriate for
@@ -259,7 +259,7 @@
      * background activity), subsequent executions will be delayed as well.
      * In the long run, the frequency of execution will generally be slightly
      * lower than the reciprocal of the specified period (assuming the system
-     * clock underlying <tt>Object.wait(long)</tt> is accurate).  As a
+     * clock underlying {@code Object.wait(long)} is accurate).  As a
      * consequence of the above, if the scheduled first time is in the past,
      * it is scheduled for immediate execution.
      *
@@ -298,7 +298,7 @@
      * activity), two or more executions will occur in rapid succession to
      * "catch up."  In the long run, the frequency of execution will be
      * exactly the reciprocal of the specified period (assuming the system
-     * clock underlying <tt>Object.wait(long)</tt> is accurate).
+     * clock underlying {@code Object.wait(long)} is accurate).
      *
      * <p>Fixed-rate execution is appropriate for recurring activities that
      * are sensitive to <i>absolute</i> time, such as ringing a chime every
@@ -339,7 +339,7 @@
      * activity), two or more executions will occur in rapid succession to
      * "catch up."  In the long run, the frequency of execution will be
      * exactly the reciprocal of the specified period (assuming the system
-     * clock underlying <tt>Object.wait(long)</tt> is accurate).  As a
+     * clock underlying {@code Object.wait(long)} is accurate).  As a
      * consequence of the above, if the scheduled first time is in the past,
      * then any "missed" executions will be scheduled for immediate "catch up"
      * execution.
@@ -378,7 +378,7 @@
      * in Date.getTime() format.  This method checks timer state, task state,
      * and initial execution time, but not period.
      *
-     * @throws IllegalArgumentException if <tt>time</tt> is negative.
+     * @throws IllegalArgumentException if {@code time} is negative.
      * @throws IllegalStateException if task was already scheduled or
      *         cancelled, timer was cancelled, or timer thread terminated.
      * @throws NullPointerException if {@code task} is null
--- a/jdk/src/java.base/share/classes/java/util/TimerTask.java	Thu Apr 09 12:29:31 2015 +0200
+++ b/jdk/src/java.base/share/classes/java/util/TimerTask.java	Mon Aug 17 12:45:16 2015 +0300
@@ -102,7 +102,7 @@
      * will never run again.  (If the task is running when this call occurs,
      * the task will run to completion, but will never run again.)
      *
-     * <p>Note that calling this method from within the <tt>run</tt> method of
+     * <p>Note that calling this method from within the {@code run} method of
      * a repeating timer task absolutely guarantees that the timer task will
      * not run again.
      *
@@ -114,7 +114,7 @@
      *         Returns false if the task was scheduled for one-time execution
      *         and has already run, or if the task was never scheduled, or if
      *         the task was already cancelled.  (Loosely speaking, this method
-     *         returns <tt>true</tt> if it prevents one or more scheduled
+     *         returns {@code true} if it prevents one or more scheduled
      *         executions from taking place.)
      */
     public boolean cancel() {
--- a/jdk/src/java.base/share/classes/java/util/TreeSet.java	Thu Apr 09 12:29:31 2015 +0200
+++ b/jdk/src/java.base/share/classes/java/util/TreeSet.java	Mon Aug 17 12:45:16 2015 +0300
@@ -220,7 +220,7 @@
      * Returns {@code true} if this set contains the specified element.
      * More formally, returns {@code true} if and only if this set
      * contains an element {@code e} such that
-     * <tt>(o==null&nbsp;?&nbsp;e==null&nbsp;:&nbsp;o.equals(e))</tt>.
+     * {@code Objects.equals(o, e)}.
      *
      * @param o object to be checked for containment in this set
      * @return {@code true} if this set contains the specified element
@@ -238,7 +238,7 @@
      * Adds the specified element to this set if it is not already present.
      * More formally, adds the specified element {@code e} to this set if
      * the set contains no element {@code e2} such that
-     * <tt>(e==null&nbsp;?&nbsp;e2==null&nbsp;:&nbsp;e.equals(e2))</tt>.
+     * {@code Objects.equals(e, e2)}.
      * If this set already contains the element, the call leaves the set
      * unchanged and returns {@code false}.
      *
@@ -258,7 +258,7 @@
     /**
      * Removes the specified element from this set if it is present.
      * More formally, removes an element {@code e} such that
-     * <tt>(o==null&nbsp;?&nbsp;e==null&nbsp;:&nbsp;o.equals(e))</tt>,
+     * {@code Objects.equals(o, e)},
      * if this set contains such an element.  Returns {@code true} if
      * this set contained the element (or equivalently, if this set
      * changed as a result of the call).  (This set will not contain the
--- a/jdk/src/java.base/share/classes/java/util/UnknownFormatConversionException.java	Thu Apr 09 12:29:31 2015 +0200
+++ b/jdk/src/java.base/share/classes/java/util/UnknownFormatConversionException.java	Mon Aug 17 12:45:16 2015 +0300
@@ -28,7 +28,7 @@
 /**
  * Unchecked exception thrown when an unknown conversion is given.
  *
- * <p> Unless otherwise specified, passing a <tt>null</tt> argument to
+ * <p> Unless otherwise specified, passing a {@code null} argument to
  * any method or constructor in this class will cause a {@link
  * NullPointerException} to be thrown.
  *
--- a/jdk/src/java.base/share/classes/java/util/UnknownFormatFlagsException.java	Thu Apr 09 12:29:31 2015 +0200
+++ b/jdk/src/java.base/share/classes/java/util/UnknownFormatFlagsException.java	Mon Aug 17 12:45:16 2015 +0300
@@ -28,7 +28,7 @@
 /**
  * Unchecked exception thrown when an unknown flag is given.
  *
- * <p> Unless otherwise specified, passing a <tt>null</tt> argument to any
+ * <p> Unless otherwise specified, passing a {@code null} argument to any
  * method or constructor in this class will cause a {@link
  * NullPointerException} to be thrown.
  *
--- a/jdk/src/java.base/share/classes/java/util/Vector.java	Thu Apr 09 12:29:31 2015 +0200
+++ b/jdk/src/java.base/share/classes/java/util/Vector.java	Mon Aug 17 12:45:16 2015 +0300
@@ -365,7 +365,7 @@
      * Returns {@code true} if this vector contains the specified element.
      * More formally, returns {@code true} if and only if this vector
      * contains at least one element {@code e} such that
-     * <tt>(o==null&nbsp;?&nbsp;e==null&nbsp;:&nbsp;o.equals(e))</tt>.
+     * {@code Objects.equals(o, e)}.
      *
      * @param o element whose presence in this vector is to be tested
      * @return {@code true} if this vector contains the specified element
@@ -378,7 +378,7 @@
      * Returns the index of the first occurrence of the specified element
      * in this vector, or -1 if this vector does not contain the element.
      * More formally, returns the lowest index {@code i} such that
-     * <tt>(o==null&nbsp;?&nbsp;get(i)==null&nbsp;:&nbsp;o.equals(get(i)))</tt>,
+     * {@code Objects.equals(o, get(i))},
      * or -1 if there is no such index.
      *
      * @param o element to search for
@@ -394,7 +394,7 @@
      * this vector, searching forwards from {@code index}, or returns -1 if
      * the element is not found.
      * More formally, returns the lowest index {@code i} such that
-     * <tt>(i&nbsp;&gt;=&nbsp;index&nbsp;&amp;&amp;&nbsp;(o==null&nbsp;?&nbsp;get(i)==null&nbsp;:&nbsp;o.equals(get(i))))</tt>,
+     * {@code (i >= index && Objects.equals(o, get(i)))},
      * or -1 if there is no such index.
      *
      * @param o element to search for
@@ -422,7 +422,7 @@
      * Returns the index of the last occurrence of the specified element
      * in this vector, or -1 if this vector does not contain the element.
      * More formally, returns the highest index {@code i} such that
-     * <tt>(o==null&nbsp;?&nbsp;get(i)==null&nbsp;:&nbsp;o.equals(get(i)))</tt>,
+     * {@code Objects.equals(o, get(i))},
      * or -1 if there is no such index.
      *
      * @param o element to search for
@@ -438,7 +438,7 @@
      * this vector, searching backwards from {@code index}, or returns -1 if
      * the element is not found.
      * More formally, returns the highest index {@code i} such that
-     * <tt>(i&nbsp;&lt;=&nbsp;index&nbsp;&amp;&amp;&nbsp;(o==null&nbsp;?&nbsp;get(i)==null&nbsp;:&nbsp;o.equals(get(i))))</tt>,
+     * {@code (i <= index && Objects.equals(o, get(i)))},
      * or -1 if there is no such index.
      *
      * @param o element to search for
@@ -798,7 +798,7 @@
      * Removes the first occurrence of the specified element in this Vector
      * If the Vector does not contain the element, it is unchanged.  More
      * formally, removes the element with the lowest index i such that
-     * {@code (o==null ? get(i)==null : o.equals(get(i)))} (if such
+     * {@code Objects.equals(o, get(i))} (if such
      * an element exists).
      *
      * @param o element to be removed from this Vector, if present
@@ -991,8 +991,8 @@
      * true if and only if the specified Object is also a List, both Lists
      * have the same size, and all corresponding pairs of elements in the two
      * Lists are <em>equal</em>.  (Two elements {@code e1} and
-     * {@code e2} are <em>equal</em> if {@code (e1==null ? e2==null :
-     * e1.equals(e2))}.)  In other words, two Lists are defined to be
+     * {@code e2} are <em>equal</em> if {@code Objects.equals(e1, e2)}.)
+     * In other words, two Lists are defined to be
      * equal if they contain the same elements in the same order.
      *
      * @param o the Object to be compared for equality with this Vector
--- a/jdk/src/java.base/share/classes/java/util/WeakHashMap.java	Thu Apr 09 12:29:31 2015 +0200
+++ b/jdk/src/java.base/share/classes/java/util/WeakHashMap.java	Mon Aug 17 12:45:16 2015 +0300
@@ -34,79 +34,79 @@
 
 
 /**
- * Hash table based implementation of the <tt>Map</tt> interface, with
+ * Hash table based implementation of the {@code Map} interface, with
  * <em>weak keys</em>.
- * An entry in a <tt>WeakHashMap</tt> will automatically be removed when
+ * An entry in a {@code WeakHashMap} will automatically be removed when
  * its key is no longer in ordinary use.  More precisely, the presence of a
  * mapping for a given key will not prevent the key from being discarded by the
  * garbage collector, that is, made finalizable, finalized, and then reclaimed.
  * When a key has been discarded its entry is effectively removed from the map,
- * so this class behaves somewhat differently from other <tt>Map</tt>
+ * so this class behaves somewhat differently from other {@code Map}
  * implementations.
  *
  * <p> Both null values and the null key are supported. This class has
- * performance characteristics similar to those of the <tt>HashMap</tt>
+ * performance characteristics similar to those of the {@code HashMap}
  * class, and has the same efficiency parameters of <em>initial capacity</em>
  * and <em>load factor</em>.
  *
  * <p> Like most collection classes, this class is not synchronized.
- * A synchronized <tt>WeakHashMap</tt> may be constructed using the
+ * A synchronized {@code WeakHashMap} may be constructed using the
  * {@link Collections#synchronizedMap Collections.synchronizedMap}
  * method.
  *
  * <p> This class is intended primarily for use with key objects whose
- * <tt>equals</tt> methods test for object identity using the
- * <tt>==</tt> operator.  Once such a key is discarded it can never be
+ * {@code equals} methods test for object identity using the
+ * {@code ==} operator.  Once such a key is discarded it can never be
  * recreated, so it is impossible to do a lookup of that key in a
- * <tt>WeakHashMap</tt> at some later time and be surprised that its entry
+ * {@code WeakHashMap} at some later time and be surprised that its entry
  * has been removed.  This class will work perfectly well with key objects
- * whose <tt>equals</tt> methods are not based upon object identity, such
- * as <tt>String</tt> instances.  With such recreatable key objects,
- * however, the automatic removal of <tt>WeakHashMap</tt> entries whose
+ * whose {@code equals} methods are not based upon object identity, such
+ * as {@code String} instances.  With such recreatable key objects,
+ * however, the automatic removal of {@code WeakHashMap} entries whose
  * keys have been discarded may prove to be confusing.
  *
- * <p> The behavior of the <tt>WeakHashMap</tt> class depends in part upon
+ * <p> The behavior of the {@code WeakHashMap} class depends in part upon
  * the actions of the garbage collector, so several familiar (though not
- * required) <tt>Map</tt> invariants do not hold for this class.  Because
+ * required) {@code Map} invariants do not hold for this class.  Because
  * the garbage collector may discard keys at any time, a
- * <tt>WeakHashMap</tt> may behave as though an unknown thread is silently
+ * {@code WeakHashMap} may behave as though an unknown thread is silently
  * removing entries.  In particular, even if you synchronize on a
- * <tt>WeakHashMap</tt> instance and invoke none of its mutator methods, it
- * is possible for the <tt>size</tt> method to return smaller values over
- * time, for the <tt>isEmpty</tt> method to return <tt>false</tt> and
- * then <tt>true</tt>, for the <tt>containsKey</tt> method to return
- * <tt>true</tt> and later <tt>false</tt> for a given key, for the
- * <tt>get</tt> method to return a value for a given key but later return
- * <tt>null</tt>, for the <tt>put</tt> method to return
- * <tt>null</tt> and the <tt>remove</tt> method to return
- * <tt>false</tt> for a key that previously appeared to be in the map, and
+ * {@code WeakHashMap} instance and invoke none of its mutator methods, it
+ * is possible for the {@code size} method to return smaller values over
+ * time, for the {@code isEmpty} method to return {@code false} and
+ * then {@code true}, for the {@code containsKey} method to return
+ * {@code true} and later {@code false} for a given key, for the
+ * {@code get} method to return a value for a given key but later return
+ * {@code null}, for the {@code put} method to return
+ * {@code null} and the {@code remove} method to return
+ * {@code false} for a key that previously appeared to be in the map, and
  * for successive examinations of the key set, the value collection, and
  * the entry set to yield successively smaller numbers of elements.
  *
- * <p> Each key object in a <tt>WeakHashMap</tt> is stored indirectly as
+ * <p> Each key object in a {@code WeakHashMap} is stored indirectly as
  * the referent of a weak reference.  Therefore a key will automatically be
  * removed only after the weak references to it, both inside and outside of the
  * map, have been cleared by the garbage collector.
  *
  * <p> <strong>Implementation note:</strong> The value objects in a
- * <tt>WeakHashMap</tt> are held by ordinary strong references.  Thus care
+ * {@code WeakHashMap} are held by ordinary strong references.  Thus care
  * should be taken to ensure that value objects do not strongly refer to their
  * own keys, either directly or indirectly, since that will prevent the keys
  * from being discarded.  Note that a value object may refer indirectly to its
- * key via the <tt>WeakHashMap</tt> itself; that is, a value object may
+ * key via the {@code WeakHashMap} itself; that is, a value object may
  * strongly refer to some other key object whose associated value object, in
  * turn, strongly refers to the key of the first value object.  If the values
  * in the map do not rely on the map holding strong references to them, one way
  * to deal with this is to wrap values themselves within
- * <tt>WeakReferences</tt> before
- * inserting, as in: <tt>m.put(key, new WeakReference(value))</tt>,
- * and then unwrapping upon each <tt>get</tt>.
+ * {@code WeakReferences} before
+ * inserting, as in: {@code m.put(key, new WeakReference(value))},
+ * and then unwrapping upon each {@code get}.
  *
- * <p>The iterators returned by the <tt>iterator</tt> method of the collections
+ * <p>The iterators returned by the {@code iterator} method of the collections
  * returned by all of this class's "collection view methods" are
  * <i>fail-fast</i>: if the map is structurally modified at any time after the
  * iterator is created, in any way except through the iterator's own
- * <tt>remove</tt> method, the iterator will throw a {@link
+ * {@code remove} method, the iterator will throw a {@link
  * ConcurrentModificationException}.  Thus, in the face of concurrent
  * modification, the iterator fails quickly and cleanly, rather than risking
  * arbitrary, non-deterministic behavior at an undetermined time in the future.
@@ -114,7 +114,7 @@
  * <p>Note that the fail-fast behavior of an iterator cannot be guaranteed
  * as it is, generally speaking, impossible to make any hard guarantees in the
  * presence of unsynchronized concurrent modification.  Fail-fast iterators
- * throw <tt>ConcurrentModificationException</tt> on a best-effort basis.
+ * throw {@code ConcurrentModificationException} on a best-effort basis.
  * Therefore, it would be wrong to write a program that depended on this
  * exception for its correctness:  <i>the fail-fast behavior of iterators
  * should be used only to detect bugs.</i>
@@ -196,11 +196,11 @@
     }
 
     /**
-     * Constructs a new, empty <tt>WeakHashMap</tt> with the given initial
+     * Constructs a new, empty {@code WeakHashMap} with the given initial
      * capacity and the given load factor.
      *
-     * @param  initialCapacity The initial capacity of the <tt>WeakHashMap</tt>
-     * @param  loadFactor      The load factor of the <tt>WeakHashMap</tt>
+     * @param  initialCapacity The initial capacity of the {@code WeakHashMap}
+     * @param  loadFactor      The load factor of the {@code WeakHashMap}
      * @throws IllegalArgumentException if the initial capacity is negative,
      *         or if the load factor is nonpositive.
      */
@@ -223,10 +223,10 @@
     }
 
     /**
-     * Constructs a new, empty <tt>WeakHashMap</tt> with the given initial
+     * Constructs a new, empty {@code WeakHashMap} with the given initial
      * capacity and the default load factor (0.75).
      *
-     * @param  initialCapacity The initial capacity of the <tt>WeakHashMap</tt>
+     * @param  initialCapacity The initial capacity of the {@code WeakHashMap}
      * @throws IllegalArgumentException if the initial capacity is negative
      */
     public WeakHashMap(int initialCapacity) {
@@ -234,7 +234,7 @@
     }
 
     /**
-     * Constructs a new, empty <tt>WeakHashMap</tt> with the default initial
+     * Constructs a new, empty {@code WeakHashMap} with the default initial
      * capacity (16) and load factor (0.75).
      */
     public WeakHashMap() {
@@ -242,8 +242,8 @@
     }
 
     /**
-     * Constructs a new <tt>WeakHashMap</tt> with the same mappings as the
-     * specified map.  The <tt>WeakHashMap</tt> is created with the default
+     * Constructs a new {@code WeakHashMap} with the same mappings as the
+     * specified map.  The {@code WeakHashMap} is created with the default
      * load factor (0.75) and an initial capacity sufficient to hold the
      * mappings in the specified map.
      *
@@ -365,7 +365,7 @@
     }
 
     /**
-     * Returns <tt>true</tt> if this map contains no key-value mappings.
+     * Returns {@code true} if this map contains no key-value mappings.
      * This result is a snapshot, and may not reflect unprocessed
      * entries that will be removed before next attempted access
      * because they are no longer referenced.
@@ -379,8 +379,9 @@
      * or {@code null} if this map contains no mapping for the key.
      *
      * <p>More formally, if this map contains a mapping from a key
-     * {@code k} to a value {@code v} such that {@code (key==null ? k==null :
-     * key.equals(k))}, then this method returns {@code v}; otherwise
+     * {@code k} to a value {@code v} such that
+     * {@code Objects.equals(key, k)},
+     * then this method returns {@code v}; otherwise
      * it returns {@code null}.  (There can be at most one such mapping.)
      *
      * <p>A return value of {@code null} does not <i>necessarily</i>
@@ -406,12 +407,12 @@
     }
 
     /**
-     * Returns <tt>true</tt> if this map contains a mapping for the
+     * Returns {@code true} if this map contains a mapping for the
      * specified key.
      *
      * @param  key   The key whose presence in this map is to be tested
-     * @return <tt>true</tt> if there is a mapping for <tt>key</tt>;
-     *         <tt>false</tt> otherwise
+     * @return {@code true} if there is a mapping for {@code key};
+     *         {@code false} otherwise
      */
     public boolean containsKey(Object key) {
         return getEntry(key) != null;
@@ -439,10 +440,10 @@
      *
      * @param key key with which the specified value is to be associated.
      * @param value value to be associated with the specified key.
-     * @return the previous value associated with <tt>key</tt>, or
-     *         <tt>null</tt> if there was no mapping for <tt>key</tt>.
-     *         (A <tt>null</tt> return can also indicate that the map
-     *         previously associated <tt>null</tt> with <tt>key</tt>.)
+     * @return the previous value associated with {@code key}, or
+     *         {@code null} if there was no mapping for {@code key}.
+     *         (A {@code null} return can also indicate that the map
+     *         previously associated {@code null} with {@code key}.)
      */
     public V put(K key, V value) {
         Object k = maskNull(key);
@@ -568,23 +569,23 @@
 
     /**
      * Removes the mapping for a key from this weak hash map if it is present.
-     * More formally, if this map contains a mapping from key <tt>k</tt> to
-     * value <tt>v</tt> such that <code>(key==null ?  k==null :
+     * More formally, if this map contains a mapping from key {@code k} to
+     * value {@code v} such that <code>(key==null ?  k==null :
      * key.equals(k))</code>, that mapping is removed.  (The map can contain
      * at most one such mapping.)
      *
      * <p>Returns the value to which this map previously associated the key,
-     * or <tt>null</tt> if the map contained no mapping for the key.  A
-     * return value of <tt>null</tt> does not <i>necessarily</i> indicate
+     * or {@code null} if the map contained no mapping for the key.  A
+     * return value of {@code null} does not <i>necessarily</i> indicate
      * that the map contained no mapping for the key; it's also possible
-     * that the map explicitly mapped the key to <tt>null</tt>.
+     * that the map explicitly mapped the key to {@code null}.
      *
      * <p>The map will not contain a mapping for the specified key once the
      * call returns.
      *
      * @param key key whose mapping is to be removed from the map
-     * @return the previous value associated with <tt>key</tt>, or
-     *         <tt>null</tt> if there was no mapping for <tt>key</tt>
+     * @return the previous value associated with {@code key}, or
+     *         {@code null} if there was no mapping for {@code key}
      */
     public V remove(Object key) {
         Object k = maskNull(key);
@@ -664,11 +665,11 @@
     }
 
     /**
-     * Returns <tt>true</tt> if this map maps one or more keys to the
+     * Returns {@code true} if this map maps one or more keys to the
      * specified value.
      *
      * @param value value whose presence in this map is to be tested
-     * @return <tt>true</tt> if this map maps one or more keys to the
+     * @return {@code true} if this map maps one or more keys to the
      *         specified value
      */
     public boolean containsValue(Object value) {
@@ -855,12 +856,12 @@
      * The set is backed by the map, so changes to the map are
      * reflected in the set, and vice-versa.  If the map is modified
      * while an iteration over the set is in progress (except through
-     * the iterator's own <tt>remove</tt> operation), the results of
+     * the iterator's own {@code remove} operation), the results of
      * the iteration are undefined.  The set supports element removal,
      * which removes the corresponding mapping from the map, via the
-     * <tt>Iterator.remove</tt>, <tt>Set.remove</tt>,
-     * <tt>removeAll</tt>, <tt>retainAll</tt>, and <tt>clear</tt>
-     * operations.  It does not support the <tt>add</tt> or <tt>addAll</tt>
+     * {@code Iterator.remove}, {@code Set.remove},
+     * {@code removeAll}, {@code retainAll}, and {@code clear}
+     * operations.  It does not support the {@code add} or {@code addAll}
      * operations.
      */
     public Set<K> keySet() {
@@ -904,13 +905,13 @@
      * The collection is backed by the map, so changes to the map are
      * reflected in the collection, and vice-versa.  If the map is
      * modified while an iteration over the collection is in progress
-     * (except through the iterator's own <tt>remove</tt> operation),
+     * (except through the iterator's own {@code remove} operation),
      * the results of the iteration are undefined.  The collection
      * supports element removal, which removes the corresponding
-     * mapping from the map, via the <tt>Iterator.remove</tt>,
-     * <tt>Collection.remove</tt>, <tt>removeAll</tt>,
-     * <tt>retainAll</tt> and <tt>clear</tt> operations.  It does not
-     * support the <tt>add</tt> or <tt>addAll</tt> operations.
+     * mapping from the map, via the {@code Iterator.remove},
+     * {@code Collection.remove}, {@code removeAll},
+     * {@code retainAll} and {@code clear} operations.  It does not
+     * support the {@code add} or {@code addAll} operations.
      */
     public Collection<V> values() {
         Collection<V> vs = values;
@@ -944,14 +945,14 @@
      * The set is backed by the map, so changes to the map are
      * reflected in the set, and vice-versa.  If the map is modified
      * while an iteration over the set is in progress (except through
-     * the iterator's own <tt>remove</tt> operation, or through the
-     * <tt>setValue</tt> operation on a map entry returned by the
+     * the iterator's own {@code remove} operation, or through the
+     * {@code setValue} operation on a map entry returned by the
      * iterator) the results of the iteration are undefined.  The set
      * supports element removal, which removes the corresponding
-     * mapping from the map, via the <tt>Iterator.remove</tt>,
-     * <tt>Set.remove</tt>, <tt>removeAll</tt>, <tt>retainAll</tt> and
-     * <tt>clear</tt> operations.  It does not support the
-     * <tt>add</tt> or <tt>addAll</tt> operations.
+     * mapping from the map, via the {@code Iterator.remove},
+     * {@code Set.remove}, {@code removeAll}, {@code retainAll} and
+     * {@code clear} operations.  It does not support the
+     * {@code add} or {@code addAll} operations.
      */
     public Set<Map.Entry<K,V>> entrySet() {
         Set<Map.Entry<K,V>> es = entrySet;
--- a/jdk/src/java.base/share/classes/java/util/regex/MatchResult.java	Thu Apr 09 12:29:31 2015 +0200
+++ b/jdk/src/java.base/share/classes/java/util/regex/MatchResult.java	Mon Aug 17 12:45:16 2015 +0300
@@ -31,7 +31,7 @@
  * <p>This interface contains query methods used to determine the
  * results of a match against a regular expression. The match boundaries,
  * groups and group boundaries can be seen but not modified through
- * a <code>MatchResult</code>.
+ * a {@code MatchResult}.
  *
  * @author  Michael McCloskey
  * @see Matcher
@@ -56,14 +56,14 @@
      *
      * <p> <a href="Pattern.html#cg">Capturing groups</a> are indexed from left
      * to right, starting at one.  Group zero denotes the entire pattern, so
-     * the expression <i>m.</i><tt>start(0)</tt> is equivalent to
-     * <i>m.</i><tt>start()</tt>.  </p>
+     * the expression <i>m.</i>{@code start(0)} is equivalent to
+     * <i>m.</i>{@code start()}.  </p>
      *
      * @param  group
      *         The index of a capturing group in this matcher's pattern
      *
      * @return  The index of the first character captured by the group,
-     *          or <tt>-1</tt> if the match was successful but the group
+     *          or {@code -1} if the match was successful but the group
      *          itself did not match anything
      *
      * @throws  IllegalStateException
@@ -93,14 +93,14 @@
      *
      * <p> <a href="Pattern.html#cg">Capturing groups</a> are indexed from left
      * to right, starting at one.  Group zero denotes the entire pattern, so
-     * the expression <i>m.</i><tt>end(0)</tt> is equivalent to
-     * <i>m.</i><tt>end()</tt>.  </p>
+     * the expression <i>m.</i>{@code end(0)} is equivalent to
+     * <i>m.</i>{@code end()}.  </p>
      *
      * @param  group
      *         The index of a capturing group in this matcher's pattern
      *
      * @return  The offset after the last character captured by the group,
-     *          or <tt>-1</tt> if the match was successful
+     *          or {@code -1} if the match was successful
      *          but the group itself did not match anything
      *
      * @throws  IllegalStateException
@@ -117,11 +117,11 @@
      * Returns the input subsequence matched by the previous match.
      *
      * <p> For a matcher <i>m</i> with input sequence <i>s</i>,
-     * the expressions <i>m.</i><tt>group()</tt> and
-     * <i>s.</i><tt>substring(</tt><i>m.</i><tt>start(),</tt>&nbsp;<i>m.</i><tt>end())</tt>
+     * the expressions <i>m.</i>{@code group()} and
+     * <i>s.</i>{@code substring(}<i>m.</i>{@code start(),}&nbsp;<i>m.</i>{@code end())}
      * are equivalent.  </p>
      *
-     * <p> Note that some patterns, for example <tt>a*</tt>, match the empty
+     * <p> Note that some patterns, for example {@code a*}, match the empty
      * string.  This method will return the empty string when the pattern
      * successfully matches the empty string in the input.  </p>
      *
@@ -139,18 +139,19 @@
      * previous match operation.
      *
      * <p> For a matcher <i>m</i>, input sequence <i>s</i>, and group index
-     * <i>g</i>, the expressions <i>m.</i><tt>group(</tt><i>g</i><tt>)</tt> and
-     * <i>s.</i><tt>substring(</tt><i>m.</i><tt>start(</tt><i>g</i><tt>),</tt>&nbsp;<i>m.</i><tt>end(</tt><i>g</i><tt>))</tt>
+     * <i>g</i>, the expressions <i>m.</i>{@code group(}<i>g</i>{@code )} and
+     * <i>s.</i>{@code substring(}<i>m.</i>{@code start(}<i>g</i>{@code
+     * ),}&nbsp;<i>m.</i>{@code end(}<i>g</i>{@code ))}
      * are equivalent.  </p>
      *
      * <p> <a href="Pattern.html#cg">Capturing groups</a> are indexed from left
      * to right, starting at one.  Group zero denotes the entire pattern, so
-     * the expression <tt>m.group(0)</tt> is equivalent to <tt>m.group()</tt>.
+     * the expression {@code m.group(0)} is equivalent to {@code m.group()}.
      * </p>
      *
      * <p> If the match was successful but the group specified failed to match
-     * any part of the input sequence, then <tt>null</tt> is returned. Note
-     * that some groups, for example <tt>(a*)</tt>, match the empty string.
+     * any part of the input sequence, then {@code null} is returned. Note
+     * that some groups, for example {@code (a*)}, match the empty string.
      * This method will return the empty string when such a group successfully
      * matches the empty string in the input.  </p>
      *
@@ -158,7 +159,7 @@
      *         The index of a capturing group in this matcher's pattern
      *
      * @return  The (possibly empty) subsequence captured by the group
-     *          during the previous match, or <tt>null</tt> if the group
+     *          during the previous match, or {@code null} if the group
      *          failed to match part of the input
      *
      * @throws  IllegalStateException
--- a/jdk/src/java.base/share/classes/java/util/regex/Matcher.java	Thu Apr 09 12:29:31 2015 +0200
+++ b/jdk/src/java.base/share/classes/java/util/regex/Matcher.java	Mon Aug 17 12:45:16 2015 +0300
@@ -258,7 +258,7 @@
      * The result is unaffected by subsequent operations performed upon this
      * matcher.
      *
-     * @return  a <code>MatchResult</code> with the state of this matcher
+     * @return  a {@code MatchResult} with the state of this matcher
      * @since 1.5
      */
     public MatchResult toMatchResult() {
@@ -347,7 +347,7 @@
     }
 
     /**
-      * Changes the <tt>Pattern</tt> that this <tt>Matcher</tt> uses to
+      * Changes the {@code Pattern} that this {@code Matcher} uses to
       * find matches with.
       *
       * <p> This method causes this matcher to lose information
@@ -359,7 +359,7 @@
       *         The new pattern used by this matcher
       * @return  This matcher
       * @throws  IllegalArgumentException
-      *          If newPattern is <tt>null</tt>
+      *          If newPattern is {@code null}
       * @since 1.5
       */
     public Matcher usePattern(Pattern newPattern) {
@@ -444,14 +444,14 @@
      *
      * <p> <a href="Pattern.html#cg">Capturing groups</a> are indexed from left
      * to right, starting at one.  Group zero denotes the entire pattern, so
-     * the expression <i>m.</i><tt>start(0)</tt> is equivalent to
-     * <i>m.</i><tt>start()</tt>.  </p>
+     * the expression <i>m.</i>{@code start(0)} is equivalent to
+     * <i>m.</i>{@code start()}.  </p>
      *
      * @param  group
      *         The index of a capturing group in this matcher's pattern
      *
      * @return  The index of the first character captured by the group,
-     *          or <tt>-1</tt> if the match was successful but the group
+     *          or {@code -1} if the match was successful but the group
      *          itself did not match anything
      *
      * @throws  IllegalStateException
@@ -516,14 +516,14 @@
      *
      * <p> <a href="Pattern.html#cg">Capturing groups</a> are indexed from left
      * to right, starting at one.  Group zero denotes the entire pattern, so
-     * the expression <i>m.</i><tt>end(0)</tt> is equivalent to
-     * <i>m.</i><tt>end()</tt>.  </p>
+     * the expression <i>m.</i>{@code end(0)} is equivalent to
+     * <i>m.</i>{@code end()}.  </p>
      *
      * @param  group
      *         The index of a capturing group in this matcher's pattern
      *
      * @return  The offset after the last character captured by the group,
-     *          or <tt>-1</tt> if the match was successful
+     *          or {@code -1} if the match was successful
      *          but the group itself did not match anything
      *
      * @throws  IllegalStateException
@@ -571,11 +571,11 @@
      * Returns the input subsequence matched by the previous match.
      *
      * <p> For a matcher <i>m</i> with input sequence <i>s</i>,
-     * the expressions <i>m.</i><tt>group()</tt> and
-     * <i>s.</i><tt>substring(</tt><i>m.</i><tt>start(),</tt>&nbsp;<i>m.</i><tt>end())</tt>
+     * the expressions <i>m.</i>{@code group()} and
+     * <i>s.</i>{@code substring(}<i>m.</i>{@code start(),}&nbsp;<i>m.</i>{@code end())}
      * are equivalent.  </p>
      *
-     * <p> Note that some patterns, for example <tt>a*</tt>, match the empty
+     * <p> Note that some patterns, for example {@code a*}, match the empty
      * string.  This method will return the empty string when the pattern
      * successfully matches the empty string in the input.  </p>
      *
@@ -595,18 +595,19 @@
      * previous match operation.
      *
      * <p> For a matcher <i>m</i>, input sequence <i>s</i>, and group index
-     * <i>g</i>, the expressions <i>m.</i><tt>group(</tt><i>g</i><tt>)</tt> and
-     * <i>s.</i><tt>substring(</tt><i>m.</i><tt>start(</tt><i>g</i><tt>),</tt>&nbsp;<i>m.</i><tt>end(</tt><i>g</i><tt>))</tt>
+     * <i>g</i>, the expressions <i>m.</i>{@code group(}<i>g</i>{@code )} and
+     * <i>s.</i>{@code substring(}<i>m.</i>{@code start(}<i>g</i>{@code
+     * ),}&nbsp;<i>m.</i>{@code end(}<i>g</i>{@code ))}
      * are equivalent.  </p>
      *
      * <p> <a href="Pattern.html#cg">Capturing groups</a> are indexed from left
      * to right, starting at one.  Group zero denotes the entire pattern, so
-     * the expression <tt>m.group(0)</tt> is equivalent to <tt>m.group()</tt>.
+     * the expression {@code m.group(0)} is equivalent to {@code m.group()}.
      * </p>
      *
      * <p> If the match was successful but the group specified failed to match
-     * any part of the input sequence, then <tt>null</tt> is returned. Note
-     * that some groups, for example <tt>(a*)</tt>, match the empty string.
+     * any part of the input sequence, then {@code null} is returned. Note
+     * that some groups, for example {@code (a*)}, match the empty string.
      * This method will return the empty string when such a group successfully
      * matches the empty string in the input.  </p>
      *
@@ -614,7 +615,7 @@
      *         The index of a capturing group in this matcher's pattern
      *
      * @return  The (possibly empty) subsequence captured by the group
-     *          during the previous match, or <tt>null</tt> if the group
+     *          during the previous match, or {@code null} if the group
      *          failed to match part of the input
      *
      * @throws  IllegalStateException
@@ -641,8 +642,8 @@
      * match operation.
      *
      * <p> If the match was successful but the group specified failed to match
-     * any part of the input sequence, then <tt>null</tt> is returned. Note
-     * that some groups, for example <tt>(a*)</tt>, match the empty string.
+     * any part of the input sequence, then {@code null} is returned. Note
+     * that some groups, for example {@code (a*)}, match the empty string.
      * This method will return the empty string when such a group successfully
      * matches the empty string in the input.  </p>
      *
@@ -650,7 +651,7 @@
      *         The name of a named-capturing group in this matcher's pattern
      *
      * @return  The (possibly empty) subsequence captured by the named group
-     *          during the previous match, or <tt>null</tt> if the group
+     *          during the previous match, or {@code null} if the group
      *          failed to match part of the input
      *
      * @throws  IllegalStateException
@@ -689,9 +690,9 @@
      * Attempts to match the entire region against the pattern.
      *
      * <p> If the match succeeds then more information can be obtained via the
-     * <tt>start</tt>, <tt>end</tt>, and <tt>group</tt> methods.  </p>
+     * {@code start}, {@code end}, and {@code group} methods.  </p>
      *
-     * @return  <tt>true</tt> if, and only if, the entire region sequence
+     * @return  {@code true} if, and only if, the entire region sequence
      *          matches this matcher's pattern
      */
     public boolean matches() {
@@ -708,9 +709,9 @@
      * match.
      *
      * <p> If the match succeeds then more information can be obtained via the
-     * <tt>start</tt>, <tt>end</tt>, and <tt>group</tt> methods.  </p>
+     * {@code start}, {@code end}, and {@code group} methods.  </p>
      *
-     * @return  <tt>true</tt> if, and only if, a subsequence of the input
+     * @return  {@code true} if, and only if, a subsequence of the input
      *          sequence matches this matcher's pattern
      */
     public boolean find() {
@@ -737,7 +738,7 @@
      * index.
      *
      * <p> If the match succeeds then more information can be obtained via the
-     * <tt>start</tt>, <tt>end</tt>, and <tt>group</tt> methods, and subsequent
+     * {@code start}, {@code end}, and {@code group} methods, and subsequent
      * invocations of the {@link #find()} method will start at the first
      * character not matched by this match.  </p>
      *
@@ -746,7 +747,7 @@
      *          If start is less than zero or if start is greater than the
      *          length of the input sequence.
      *
-     * @return  <tt>true</tt> if, and only if, a subsequence of the input
+     * @return  {@code true} if, and only if, a subsequence of the input
      *          sequence starting at the given index matches this matcher's
      *          pattern
      */
@@ -767,9 +768,9 @@
      * require that the entire region be matched.
      *
      * <p> If the match succeeds then more information can be obtained via the
-     * <tt>start</tt>, <tt>end</tt>, and <tt>group</tt> methods.  </p>
+     * {@code start}, {@code end}, and {@code group} methods.  </p>
      *
-     * @return  <tt>true</tt> if, and only if, a prefix of the input
+     * @return  {@code true} if, and only if, a prefix of the input
      *          sequence matches this matcher's pattern
      */
     public boolean lookingAt() {
@@ -777,14 +778,14 @@
     }
 
     /**
-     * Returns a literal replacement <code>String</code> for the specified
-     * <code>String</code>.
+     * Returns a literal replacement {@code String} for the specified
+     * {@code String}.
      *
-     * This method produces a <code>String</code> that will work
-     * as a literal replacement <code>s</code> in the
-     * <code>appendReplacement</code> method of the {@link Matcher} class.
-     * The <code>String</code> produced will match the sequence of characters
-     * in <code>s</code> treated as a literal sequence. Slashes ('\') and
+     * This method produces a {@code String} that will work
+     * as a literal replacement {@code s} in the
+     * {@code appendReplacement} method of the {@link Matcher} class.
+     * The {@code String} produced will match the sequence of characters
+     * in {@code s} treated as a literal sequence. Slashes ('\') and
      * dollar signs ('$') will be given no special meaning.
      *
      * @param  s The string to be literalized
@@ -816,7 +817,7 @@
      *   append position, and appends them to the given string buffer.  It
      *   stops after reading the last character preceding the previous match,
      *   that is, the character at index {@link
-     *   #start()}&nbsp;<tt>-</tt>&nbsp;<tt>1</tt>.  </p></li>
+     *   #start()}&nbsp;{@code -}&nbsp;{@code 1}.  </p></li>
      *
      *   <li><p> It appends the given replacement string to the string buffer.
      *   </p></li>
@@ -829,21 +830,21 @@
      *
      * <p> The replacement string may contain references to subsequences
      * captured during the previous match: Each occurrence of
-     * <tt>${</tt><i>name</i><tt>}</tt> or <tt>$</tt><i>g</i>
+     * <code>${</code><i>name</i><code>}</code> or {@code $}<i>g</i>
      * will be replaced by the result of evaluating the corresponding
      * {@link #group(String) group(name)} or {@link #group(int) group(g)}
-     * respectively. For  <tt>$</tt><i>g</i>,
-     * the first number after the <tt>$</tt> is always treated as part of
+     * respectively. For {@code $}<i>g</i>,
+     * the first number after the {@code $} is always treated as part of
      * the group reference. Subsequent numbers are incorporated into g if
      * they would form a legal group reference. Only the numerals '0'
      * through '9' are considered as potential components of the group
-     * reference. If the second group matched the string <tt>"foo"</tt>, for
-     * example, then passing the replacement string <tt>"$2bar"</tt> would
-     * cause <tt>"foobar"</tt> to be appended to the string buffer. A dollar
-     * sign (<tt>$</tt>) may be included as a literal in the replacement
-     * string by preceding it with a backslash (<tt>\$</tt>).
+     * reference. If the second group matched the string {@code "foo"}, for
+     * example, then passing the replacement string {@code "$2bar"} would
+     * cause {@code "foobar"} to be appended to the string buffer. A dollar
+     * sign ({@code $}) may be included as a literal in the replacement
+     * string by preceding it with a backslash ({@code \$}).
      *
-     * <p> Note that backslashes (<tt>\</tt>) and dollar signs (<tt>$</tt>) in
+     * <p> Note that backslashes ({@code \}) and dollar signs ({@code $}) in
      * the replacement string may cause the results to be different than if it
      * were being treated as a literal replacement string. Dollar signs may be
      * treated as references to captured subsequences as described above, and
@@ -852,8 +853,8 @@
      *
      * <p> This method is intended to be used in a loop together with the
      * {@link #appendTail appendTail} and {@link #find find} methods.  The
-     * following code, for example, writes <tt>one dog two dogs in the
-     * yard</tt> to the standard-output stream: </p>
+     * following code, for example, writes {@code one dog two dogs in the
+     * yard} to the standard-output stream: </p>
      *
      * <blockquote><pre>
      * Pattern p = Pattern.compile("cat");
@@ -911,7 +912,7 @@
      *   append position, and appends them to the given string builder.  It
      *   stops after reading the last character preceding the previous match,
      *   that is, the character at index {@link
-     *   #start()}&nbsp;<tt>-</tt>&nbsp;<tt>1</tt>.  </p></li>
+     *   #start()}&nbsp;{@code -}&nbsp;{@code 1}.  </p></li>
      *
      *   <li><p> It appends the given replacement string to the string builder.
      *   </p></li>
@@ -924,19 +925,19 @@
      *
      * <p> The replacement string may contain references to subsequences
      * captured during the previous match: Each occurrence of
-     * <tt>$</tt><i>g</i> will be replaced by the result of
-     * evaluating {@link #group(int) group}<tt>(</tt><i>g</i><tt>)</tt>.
-     * The first number after the <tt>$</tt> is always treated as part of
+     * {@code $}<i>g</i> will be replaced by the result of
+     * evaluating {@link #group(int) group}{@code (}<i>g</i>{@code )}.
+     * The first number after the {@code $} is always treated as part of
      * the group reference. Subsequent numbers are incorporated into g if
      * they would form a legal group reference. Only the numerals '0'
      * through '9' are considered as potential components of the group
-     * reference. If the second group matched the string <tt>"foo"</tt>, for
-     * example, then passing the replacement string <tt>"$2bar"</tt> would
-     * cause <tt>"foobar"</tt> to be appended to the string builder. A dollar
-     * sign (<tt>$</tt>) may be included as a literal in the replacement
-     * string by preceding it with a backslash (<tt>\$</tt>).
+     * reference. If the second group matched the string {@code "foo"}, for
+     * example, then passing the replacement string {@code "$2bar"} would
+     * cause {@code "foobar"} to be appended to the string builder. A dollar
+     * sign ({@code $}) may be included as a literal in the replacement
+     * string by preceding it with a backslash ({@code \$}).
      *
-     * <p> Note that backslashes (<tt>\</tt>) and dollar signs (<tt>$</tt>) in
+     * <p> Note that backslashes ({@code \}) and dollar signs ({@code $}) in
      * the replacement string may cause the results to be different than if it
      * were being treated as a literal replacement string. Dollar signs may be
      * treated as references to captured subsequences as described above, and
@@ -945,8 +946,8 @@
      *
      * <p> This method is intended to be used in a loop together with the
      * {@link #appendTail appendTail} and {@link #find find} methods.  The
-     * following code, for example, writes <tt>one dog two dogs in the
-     * yard</tt> to the standard-output stream: </p>
+     * following code, for example, writes {@code one dog two dogs in the
+     * yard} to the standard-output stream: </p>
      *
      * <blockquote><pre>
      * Pattern p = Pattern.compile("cat");
@@ -1134,17 +1135,17 @@
      * string may contain references to captured subsequences as in the {@link
      * #appendReplacement appendReplacement} method.
      *
-     * <p> Note that backslashes (<tt>\</tt>) and dollar signs (<tt>$</tt>) in
+     * <p> Note that backslashes ({@code \}) and dollar signs ({@code $}) in
      * the replacement string may cause the results to be different than if it
      * were being treated as a literal replacement string. Dollar signs may be
      * treated as references to captured subsequences as described above, and
      * backslashes are used to escape literal characters in the replacement
      * string.
      *
-     * <p> Given the regular expression <tt>a*b</tt>, the input
-     * <tt>"aabfooaabfooabfoob"</tt>, and the replacement string
-     * <tt>"-"</tt>, an invocation of this method on a matcher for that
-     * expression would yield the string <tt>"-foo-foo-foo-"</tt>.
+     * <p> Given the regular expression {@code a*b}, the input
+     * {@code "aabfooaabfooabfoob"}, and the replacement string
+     * {@code "-"}, an invocation of this method on a matcher for that
+     * expression would yield the string {@code "-foo-foo-foo-"}.
      *
      * <p> Invoking this method changes this matcher's state.  If the matcher
      * is to be used in further matching operations then it should first be
@@ -1186,18 +1187,18 @@
      * references to captured subsequences as in the {@link #appendReplacement
      * appendReplacement} method.
      *
-     * <p> Note that backslashes (<tt>\</tt>) and dollar signs (<tt>$</tt>) in
+     * <p> Note that backslashes ({@code \}) and dollar signs ({@code $}) in
      * a replacement string may cause the results to be different than if it
      * were being treated as a literal replacement string. Dollar signs may be
      * treated as references to captured subsequences as described above, and
      * backslashes are used to escape literal characters in the replacement
      * string.
      *
-     * <p> Given the regular expression <tt>dog</tt>, the input
-     * <tt>"zzzdogzzzdogzzz"</tt>, and the function
+     * <p> Given the regular expression {@code dog}, the input
+     * {@code "zzzdogzzzdogzzz"}, and the function
      * {@code mr -> mr.group().toUpperCase()}, an invocation of this method on
      * a matcher for that expression would yield the string
-     * <tt>"zzzDOGzzzDOGzzz"</tt>.
+     * {@code "zzzDOGzzzDOGzzz"}.
      *
      * <p> Invoking this method changes this matcher's state.  If the matcher
      * is to be used in further matching operations then it should first be
@@ -1360,17 +1361,17 @@
      * string may contain references to captured subsequences as in the {@link
      * #appendReplacement appendReplacement} method.
      *
-     * <p>Note that backslashes (<tt>\</tt>) and dollar signs (<tt>$</tt>) in
+     * <p>Note that backslashes ({@code \}) and dollar signs ({@code $}) in
      * the replacement string may cause the results to be different than if it
      * were being treated as a literal replacement string. Dollar signs may be
      * treated as references to captured subsequences as described above, and
      * backslashes are used to escape literal characters in the replacement
      * string.
      *
-     * <p> Given the regular expression <tt>dog</tt>, the input
-     * <tt>"zzzdogzzzdogzzz"</tt>, and the replacement string
-     * <tt>"cat"</tt>, an invocation of this method on a matcher for that
-     * expression would yield the string <tt>"zzzcatzzzdogzzz"</tt>.  </p>
+     * <p> Given the regular expression {@code dog}, the input
+     * {@code "zzzdogzzzdogzzz"}, and the replacement string
+     * {@code "cat"}, an invocation of this method on a matcher for that
+     * expression would yield the string {@code "zzzcatzzzdogzzz"}.  </p>
      *
      * <p> Invoking this method changes this matcher's state.  If the matcher
      * is to be used in further matching operations then it should first be
@@ -1408,18 +1409,18 @@
      * references to captured subsequences as in the {@link #appendReplacement
      * appendReplacement} method.
      *
-     * <p>Note that backslashes (<tt>\</tt>) and dollar signs (<tt>$</tt>) in
+     * <p>Note that backslashes ({@code \}) and dollar signs ({@code $}) in
      * the replacement string may cause the results to be different than if it
      * were being treated as a literal replacement string. Dollar signs may be
      * treated as references to captured subsequences as described above, and
      * backslashes are used to escape literal characters in the replacement
      * string.
      *
-     * <p> Given the regular expression <tt>dog</tt>, the input
-     * <tt>"zzzdogzzzdogzzz"</tt>, and the function
+     * <p> Given the regular expression {@code dog}, the input
+     * {@code "zzzdogzzzdogzzz"}, and the function
      * {@code mr -> mr.group().toUpperCase()}, an invocation of this method on
      * a matcher for that expression would yield the string
-     * <tt>"zzzDOGzzzdogzzz"</tt>.
+     * {@code "zzzDOGzzzdogzzz"}.
      *
      * <p> Invoking this method changes this matcher's state.  If the matcher
      * is to be used in further matching operations then it should first be
@@ -1471,8 +1472,8 @@
      * Sets the limits of this matcher's region. The region is the part of the
      * input sequence that will be searched to find a match. Invoking this
      * method resets the matcher, and then sets the region to start at the
-     * index specified by the <code>start</code> parameter and end at the
-     * index specified by the <code>end</code> parameter.
+     * index specified by the {@code start} parameter and end at the
+     * index specified by the {@code end} parameter.
      *
      * <p>Depending on the transparency and anchoring being used (see
      * {@link #useTransparentBounds useTransparentBounds} and
@@ -1534,8 +1535,8 @@
     /**
      * Queries the transparency of region bounds for this matcher.
      *
-     * <p> This method returns <tt>true</tt> if this matcher uses
-     * <i>transparent</i> bounds, <tt>false</tt> if it uses <i>opaque</i>
+     * <p> This method returns {@code true} if this matcher uses
+     * <i>transparent</i> bounds, {@code false} if it uses <i>opaque</i>
      * bounds.
      *
      * <p> See {@link #useTransparentBounds useTransparentBounds} for a
@@ -1543,8 +1544,8 @@
      *
      * <p> By default, a matcher uses opaque region boundaries.
      *
-     * @return <tt>true</tt> iff this matcher is using transparent bounds,
-     *         <tt>false</tt> otherwise.
+     * @return {@code true} iff this matcher is using transparent bounds,
+     *         {@code false} otherwise.
      * @see java.util.regex.Matcher#useTransparentBounds(boolean)
      * @since 1.5
      */
@@ -1555,9 +1556,9 @@
     /**
      * Sets the transparency of region bounds for this matcher.
      *
-     * <p> Invoking this method with an argument of <tt>true</tt> will set this
+     * <p> Invoking this method with an argument of {@code true} will set this
      * matcher to use <i>transparent</i> bounds. If the boolean
-     * argument is <tt>false</tt>, then <i>opaque</i> bounds will be used.
+     * argument is {@code false}, then <i>opaque</i> bounds will be used.
      *
      * <p> Using transparent bounds, the boundaries of this
      * matcher's region are transparent to lookahead, lookbehind,
@@ -1586,16 +1587,16 @@
     /**
      * Queries the anchoring of region bounds for this matcher.
      *
-     * <p> This method returns <tt>true</tt> if this matcher uses
-     * <i>anchoring</i> bounds, <tt>false</tt> otherwise.
+     * <p> This method returns {@code true} if this matcher uses
+     * <i>anchoring</i> bounds, {@code false} otherwise.
      *
      * <p> See {@link #useAnchoringBounds useAnchoringBounds} for a
      * description of anchoring bounds.
      *
      * <p> By default, a matcher uses anchoring region boundaries.
      *
-     * @return <tt>true</tt> iff this matcher is using anchoring bounds,
-     *         <tt>false</tt> otherwise.
+     * @return {@code true} iff this matcher is using anchoring bounds,
+     *         {@code false} otherwise.
      * @see java.util.regex.Matcher#useAnchoringBounds(boolean)
      * @since 1.5
      */
@@ -1606,9 +1607,9 @@
     /**
      * Sets the anchoring of region bounds for this matcher.
      *
-     * <p> Invoking this method with an argument of <tt>true</tt> will set this
+     * <p> Invoking this method with an argument of {@code true} will set this
      * matcher to use <i>anchoring</i> bounds. If the boolean
-     * argument is <tt>false</tt>, then <i>non-anchoring</i> bounds will be
+     * argument is {@code false}, then <i>non-anchoring</i> bounds will be
      * used.
      *
      * <p> Using anchoring bounds, the boundaries of this
@@ -1631,7 +1632,7 @@
 
     /**
      * <p>Returns the string representation of this matcher. The
-     * string representation of a <code>Matcher</code> contains information
+     * string representation of a {@code Matcher} contains information
      * that may be useful for debugging. The exact format is unspecified.
      *
      * @return  The string representation of this matcher
--- a/jdk/src/java.base/share/classes/java/util/regex/Pattern.java	Thu Apr 09 12:29:31 2015 +0200
+++ b/jdk/src/java.base/share/classes/java/util/regex/Pattern.java	Mon Aug 17 12:45:16 2015 +0300
@@ -88,40 +88,40 @@
  *
  * <tr><td valign="top" headers="construct characters"><i>x</i></td>
  *     <td headers="matches">The character <i>x</i></td></tr>
- * <tr><td valign="top" headers="construct characters"><tt>\\</tt></td>
+ * <tr><td valign="top" headers="construct characters">{@code \\}</td>
  *     <td headers="matches">The backslash character</td></tr>
- * <tr><td valign="top" headers="construct characters"><tt>\0</tt><i>n</i></td>
- *     <td headers="matches">The character with octal value <tt>0</tt><i>n</i>
- *         (0&nbsp;<tt>&lt;=</tt>&nbsp;<i>n</i>&nbsp;<tt>&lt;=</tt>&nbsp;7)</td></tr>
- * <tr><td valign="top" headers="construct characters"><tt>\0</tt><i>nn</i></td>
- *     <td headers="matches">The character with octal value <tt>0</tt><i>nn</i>
- *         (0&nbsp;<tt>&lt;=</tt>&nbsp;<i>n</i>&nbsp;<tt>&lt;=</tt>&nbsp;7)</td></tr>
- * <tr><td valign="top" headers="construct characters"><tt>\0</tt><i>mnn</i></td>
- *     <td headers="matches">The character with octal value <tt>0</tt><i>mnn</i>
- *         (0&nbsp;<tt>&lt;=</tt>&nbsp;<i>m</i>&nbsp;<tt>&lt;=</tt>&nbsp;3,
- *         0&nbsp;<tt>&lt;=</tt>&nbsp;<i>n</i>&nbsp;<tt>&lt;=</tt>&nbsp;7)</td></tr>
- * <tr><td valign="top" headers="construct characters"><tt>\x</tt><i>hh</i></td>
- *     <td headers="matches">The character with hexadecimal&nbsp;value&nbsp;<tt>0x</tt><i>hh</i></td></tr>
- * <tr><td valign="top" headers="construct characters"><tt>&#92;u</tt><i>hhhh</i></td>
- *     <td headers="matches">The character with hexadecimal&nbsp;value&nbsp;<tt>0x</tt><i>hhhh</i></td></tr>
- * <tr><td valign="top" headers="construct characters"><tt>&#92;x</tt><i>{h...h}</i></td>
- *     <td headers="matches">The character with hexadecimal&nbsp;value&nbsp;<tt>0x</tt><i>h...h</i>
+ * <tr><td valign="top" headers="construct characters">{@code \0}<i>n</i></td>
+ *     <td headers="matches">The character with octal value {@code 0}<i>n</i>
+ *         (0&nbsp;{@code <=}&nbsp;<i>n</i>&nbsp;{@code <=}&nbsp;7)</td></tr>
+ * <tr><td valign="top" headers="construct characters">{@code \0}<i>nn</i></td>
+ *     <td headers="matches">The character with octal value {@code 0}<i>nn</i>
+ *         (0&nbsp;{@code <=}&nbsp;<i>n</i>&nbsp;{@code <=}&nbsp;7)</td></tr>
+ * <tr><td valign="top" headers="construct characters">{@code \0}<i>mnn</i></td>
+ *     <td headers="matches">The character with octal value {@code 0}<i>mnn</i>
+ *         (0&nbsp;{@code <=}&nbsp;<i>m</i>&nbsp;{@code <=}&nbsp;3,
+ *         0&nbsp;{@code <=}&nbsp;<i>n</i>&nbsp;{@code <=}&nbsp;7)</td></tr>
+ * <tr><td valign="top" headers="construct characters">{@code \x}<i>hh</i></td>
+ *     <td headers="matches">The character with hexadecimal&nbsp;value&nbsp;{@code 0x}<i>hh</i></td></tr>
+ * <tr><td valign="top" headers="construct characters"><code>&#92;u</code><i>hhhh</i></td>
+ *     <td headers="matches">The character with hexadecimal&nbsp;value&nbsp;{@code 0x}<i>hhhh</i></td></tr>
+ * <tr><td valign="top" headers="construct characters"><code>&#92;x</code><i>{h...h}</i></td>
+ *     <td headers="matches">The character with hexadecimal&nbsp;value&nbsp;{@code 0x}<i>h...h</i>
  *         ({@link java.lang.Character#MIN_CODE_POINT Character.MIN_CODE_POINT}
- *         &nbsp;&lt;=&nbsp;<tt>0x</tt><i>h...h</i>&nbsp;&lt;=&nbsp;
+ *         &nbsp;&lt;=&nbsp;{@code 0x}<i>h...h</i>&nbsp;&lt;=&nbsp;
  *          {@link java.lang.Character#MAX_CODE_POINT Character.MAX_CODE_POINT})</td></tr>
- * <tr><td valign="top" headers="matches"><tt>\t</tt></td>
- *     <td headers="matches">The tab character (<tt>'&#92;u0009'</tt>)</td></tr>
- * <tr><td valign="top" headers="construct characters"><tt>\n</tt></td>
- *     <td headers="matches">The newline (line feed) character (<tt>'&#92;u000A'</tt>)</td></tr>
- * <tr><td valign="top" headers="construct characters"><tt>\r</tt></td>
- *     <td headers="matches">The carriage-return character (<tt>'&#92;u000D'</tt>)</td></tr>
- * <tr><td valign="top" headers="construct characters"><tt>\f</tt></td>
- *     <td headers="matches">The form-feed character (<tt>'&#92;u000C'</tt>)</td></tr>
- * <tr><td valign="top" headers="construct characters"><tt>\a</tt></td>
- *     <td headers="matches">The alert (bell) character (<tt>'&#92;u0007'</tt>)</td></tr>
- * <tr><td valign="top" headers="construct characters"><tt>\e</tt></td>
- *     <td headers="matches">The escape character (<tt>'&#92;u001B'</tt>)</td></tr>
- * <tr><td valign="top" headers="construct characters"><tt>\c</tt><i>x</i></td>
+ * <tr><td valign="top" headers="matches">{@code \t}</td>
+ *     <td headers="matches">The tab character (<code>'&#92;u0009'</code>)</td></tr>
+ * <tr><td valign="top" headers="construct characters">{@code \n}</td>
+ *     <td headers="matches">The newline (line feed) character (<code>'&#92;u000A'</code>)</td></tr>
+ * <tr><td valign="top" headers="construct characters">{@code \r}</td>
+ *     <td headers="matches">The carriage-return character (<code>'&#92;u000D'</code>)</td></tr>
+ * <tr><td valign="top" headers="construct characters">{@code \f}</td>
+ *     <td headers="matches">The form-feed character (<code>'&#92;u000C'</code>)</td></tr>
+ * <tr><td valign="top" headers="construct characters">{@code \a}</td>
+ *     <td headers="matches">The alert (bell) character (<code>'&#92;u0007'</code>)</td></tr>
+ * <tr><td valign="top" headers="construct characters">{@code \e}</td>
+ *     <td headers="matches">The escape character (<code>'&#92;u001B'</code>)</td></tr>
+ * <tr><td valign="top" headers="construct characters">{@code \c}<i>x</i></td>
  *     <td headers="matches">The control character corresponding to <i>x</i></td></tr>
  *
  * <tr><th>&nbsp;</th></tr>
@@ -149,30 +149,30 @@
  *
  * <tr align="left"><th colspan="2" id="predef">Predefined character classes</th></tr>
  *
- * <tr><td valign="top" headers="construct predef"><tt>.</tt></td>
+ * <tr><td valign="top" headers="construct predef">{@code .}</td>
  *     <td headers="matches">Any character (may or may not match <a href="#lt">line terminators</a>)</td></tr>
- * <tr><td valign="top" headers="construct predef"><tt>\d</tt></td>
- *     <td headers="matches">A digit: <tt>[0-9]</tt></td></tr>
- * <tr><td valign="top" headers="construct predef"><tt>\D</tt></td>
- *     <td headers="matches">A non-digit: <tt>[^0-9]</tt></td></tr>
- * <tr><td valign="top" headers="construct predef"><tt>\h</tt></td>
+ * <tr><td valign="top" headers="construct predef">{@code \d}</td>
+ *     <td headers="matches">A digit: {@code [0-9]}</td></tr>
+ * <tr><td valign="top" headers="construct predef">{@code \D}</td>
+ *     <td headers="matches">A non-digit: {@code [^0-9]}</td></tr>
+ * <tr><td valign="top" headers="construct predef">{@code \h}</td>
  *     <td headers="matches">A horizontal whitespace character:
- *     <tt>[ \t\xA0&#92;u1680&#92;u180e&#92;u2000-&#92;u200a&#92;u202f&#92;u205f&#92;u3000]</tt></td></tr>
- * <tr><td valign="top" headers="construct predef"><tt>\H</tt></td>
- *     <td headers="matches">A non-horizontal whitespace character: <tt>[^\h]</tt></td></tr>
- * <tr><td valign="top" headers="construct predef"><tt>\s</tt></td>
- *     <td headers="matches">A whitespace character: <tt>[ \t\n\x0B\f\r]</tt></td></tr>
- * <tr><td valign="top" headers="construct predef"><tt>\S</tt></td>
- *     <td headers="matches">A non-whitespace character: <tt>[^\s]</tt></td></tr>
- * <tr><td valign="top" headers="construct predef"><tt>\v</tt></td>
- *     <td headers="matches">A vertical whitespace character: <tt>[\n\x0B\f\r\x85&#92;u2028&#92;u2029]</tt>
+ *     <code>[ \t\xA0&#92;u1680&#92;u180e&#92;u2000-&#92;u200a&#92;u202f&#92;u205f&#92;u3000]</code></td></tr>
+ * <tr><td valign="top" headers="construct predef">{@code \H}</td>
+ *     <td headers="matches">A non-horizontal whitespace character: {@code [^\h]}</td></tr>
+ * <tr><td valign="top" headers="construct predef">{@code \s}</td>
+ *     <td headers="matches">A whitespace character: {@code [ \t\n\x0B\f\r]}</td></tr>
+ * <tr><td valign="top" headers="construct predef">{@code \S}</td>
+ *     <td headers="matches">A non-whitespace character: {@code [^\s]}</td></tr>
+ * <tr><td valign="top" headers="construct predef">{@code \v}</td>
+ *     <td headers="matches">A vertical whitespace character: <code>[\n\x0B\f\r\x85&#92;u2028&#92;u2029]</code>
  *     </td></tr>
- * <tr><td valign="top" headers="construct predef"><tt>\V</tt></td>
- *     <td headers="matches">A non-vertical whitespace character: <tt>[^\v]</tt></td></tr>
- * <tr><td valign="top" headers="construct predef"><tt>\w</tt></td>
- *     <td headers="matches">A word character: <tt>[a-zA-Z_0-9]</tt></td></tr>
- * <tr><td valign="top" headers="construct predef"><tt>\W</tt></td>
- *     <td headers="matches">A non-word character: <tt>[^\w]</tt></td></tr>
+ * <tr><td valign="top" headers="construct predef">{@code \V}</td>
+ *     <td headers="matches">A non-vertical whitespace character: {@code [^\v]}</td></tr>
+ * <tr><td valign="top" headers="construct predef">{@code \w}</td>
+ *     <td headers="matches">A word character: {@code [a-zA-Z_0-9]}</td></tr>
+ * <tr><td valign="top" headers="construct predef">{@code \W}</td>
+ *     <td headers="matches">A non-word character: {@code [^\w]}</td></tr>
  * <tr><th>&nbsp;</th></tr>
  * <tr align="left"><th colspan="2" id="posix"><b>POSIX character classes (US-ASCII only)</b></th></tr>
  *
@@ -208,13 +208,13 @@
  * <tr><th>&nbsp;</th></tr>
  * <tr align="left"><th colspan="2">java.lang.Character classes (simple <a href="#jcc">java character type</a>)</th></tr>
  *
- * <tr><td valign="top"><tt>\p{javaLowerCase}</tt></td>
+ * <tr><td valign="top">{@code \p{javaLowerCase}}</td>
  *     <td>Equivalent to java.lang.Character.isLowerCase()</td></tr>
- * <tr><td valign="top"><tt>\p{javaUpperCase}</tt></td>
+ * <tr><td valign="top">{@code \p{javaUpperCase}}</td>
  *     <td>Equivalent to java.lang.Character.isUpperCase()</td></tr>
- * <tr><td valign="top"><tt>\p{javaWhitespace}</tt></td>
+ * <tr><td valign="top">{@code \p{javaWhitespace}}</td>
  *     <td>Equivalent to java.lang.Character.isWhitespace()</td></tr>
- * <tr><td valign="top"><tt>\p{javaMirrored}</tt></td>
+ * <tr><td valign="top">{@code \p{javaMirrored}}</td>
  *     <td>Equivalent to java.lang.Character.isMirrored()</td></tr>
  *
  * <tr><th>&nbsp;</th></tr>
@@ -237,77 +237,77 @@
  * <tr><th>&nbsp;</th></tr>
  * <tr align="left"><th colspan="2" id="bounds">Boundary matchers</th></tr>
  *
- * <tr><td valign="top" headers="construct bounds"><tt>^</tt></td>
+ * <tr><td valign="top" headers="construct bounds">{@code ^}</td>
  *     <td headers="matches">The beginning of a line</td></tr>
- * <tr><td valign="top" headers="construct bounds"><tt>$</tt></td>
+ * <tr><td valign="top" headers="construct bounds">{@code $}</td>
  *     <td headers="matches">The end of a line</td></tr>
- * <tr><td valign="top" headers="construct bounds"><tt>\b</tt></td>
+ * <tr><td valign="top" headers="construct bounds">{@code \b}</td>
  *     <td headers="matches">A word boundary</td></tr>
- * <tr><td valign="top" headers="construct bounds"><tt>\B</tt></td>
+ * <tr><td valign="top" headers="construct bounds">{@code \B}</td>
  *     <td headers="matches">A non-word boundary</td></tr>
- * <tr><td valign="top" headers="construct bounds"><tt>\A</tt></td>
+ * <tr><td valign="top" headers="construct bounds">{@code \A}</td>
  *     <td headers="matches">The beginning of the input</td></tr>
- * <tr><td valign="top" headers="construct bounds"><tt>\G</tt></td>
+ * <tr><td valign="top" headers="construct bounds">{@code \G}</td>
  *     <td headers="matches">The end of the previous match</td></tr>
- * <tr><td valign="top" headers="construct bounds"><tt>\Z</tt></td>
+ * <tr><td valign="top" headers="construct bounds">{@code \Z}</td>
  *     <td headers="matches">The end of the input but for the final
  *         <a href="#lt">terminator</a>, if&nbsp;any</td></tr>
- * <tr><td valign="top" headers="construct bounds"><tt>\z</tt></td>
+ * <tr><td valign="top" headers="construct bounds">{@code \z}</td>
  *     <td headers="matches">The end of the input</td></tr>
  *
  * <tr><th>&nbsp;</th></tr>
  * <tr align="left"><th colspan="2" id="lineending">Linebreak matcher</th></tr>
- * <tr><td valign="top" headers="construct lineending"><tt>\R</tt></td>
+ * <tr><td valign="top" headers="construct lineending">{@code \R}</td>
  *     <td headers="matches">Any Unicode linebreak sequence, is equivalent to
- *     <tt>&#92;u000D&#92;u000A|[&#92;u000A&#92;u000B&#92;u000C&#92;u000D&#92;u0085&#92;u2028&#92;u2029]
- *     </tt></td></tr>
+ *     <code>&#92;u000D&#92;u000A|[&#92;u000A&#92;u000B&#92;u000C&#92;u000D&#92;u0085&#92;u2028&#92;u2029]
+ *     </code></td></tr>
  *
  * <tr><th>&nbsp;</th></tr>
  * <tr align="left"><th colspan="2" id="greedy">Greedy quantifiers</th></tr>
  *
- * <tr><td valign="top" headers="construct greedy"><i>X</i><tt>?</tt></td>
+ * <tr><td valign="top" headers="construct greedy"><i>X</i>{@code ?}</td>
  *     <td headers="matches"><i>X</i>, once or not at all</td></tr>
- * <tr><td valign="top" headers="construct greedy"><i>X</i><tt>*</tt></td>
+ * <tr><td valign="top" headers="construct greedy"><i>X</i>{@code *}</td>
  *     <td headers="matches"><i>X</i>, zero or more times</td></tr>
- * <tr><td valign="top" headers="construct greedy"><i>X</i><tt>+</tt></td>
+ * <tr><td valign="top" headers="construct greedy"><i>X</i>{@code +}</td>
  *     <td headers="matches"><i>X</i>, one or more times</td></tr>
- * <tr><td valign="top" headers="construct greedy"><i>X</i><tt>{</tt><i>n</i><tt>}</tt></td>
+ * <tr><td valign="top" headers="construct greedy"><i>X</i><code>{</code><i>n</i><code>}</code></td>
  *     <td headers="matches"><i>X</i>, exactly <i>n</i> times</td></tr>
- * <tr><td valign="top" headers="construct greedy"><i>X</i><tt>{</tt><i>n</i><tt>,}</tt></td>
+ * <tr><td valign="top" headers="construct greedy"><i>X</i><code>{</code><i>n</i>{@code ,}}</td>
  *     <td headers="matches"><i>X</i>, at least <i>n</i> times</td></tr>
- * <tr><td valign="top" headers="construct greedy"><i>X</i><tt>{</tt><i>n</i><tt>,</tt><i>m</i><tt>}</tt></td>
+ * <tr><td valign="top" headers="construct greedy"><i>X</i><code>{</code><i>n</i>{@code ,}<i>m</i><code>}</code></td>
  *     <td headers="matches"><i>X</i>, at least <i>n</i> but not more than <i>m</i> times</td></tr>
  *
  * <tr><th>&nbsp;</th></tr>
  * <tr align="left"><th colspan="2" id="reluc">Reluctant quantifiers</th></tr>
  *
- * <tr><td valign="top" headers="construct reluc"><i>X</i><tt>??</tt></td>
+ * <tr><td valign="top" headers="construct reluc"><i>X</i>{@code ??}</td>
  *     <td headers="matches"><i>X</i>, once or not at all</td></tr>
- * <tr><td valign="top" headers="construct reluc"><i>X</i><tt>*?</tt></td>
+ * <tr><td valign="top" headers="construct reluc"><i>X</i>{@code *?}</td>
  *     <td headers="matches"><i>X</i>, zero or more times</td></tr>
- * <tr><td valign="top" headers="construct reluc"><i>X</i><tt>+?</tt></td>
+ * <tr><td valign="top" headers="construct reluc"><i>X</i>{@code +?}</td>
  *     <td headers="matches"><i>X</i>, one or more times</td></tr>
- * <tr><td valign="top" headers="construct reluc"><i>X</i><tt>{</tt><i>n</i><tt>}?</tt></td>
+ * <tr><td valign="top" headers="construct reluc"><i>X</i><code>{</code><i>n</i><code>}?</code></td>
  *     <td headers="matches"><i>X</i>, exactly <i>n</i> times</td></tr>
- * <tr><td valign="top" headers="construct reluc"><i>X</i><tt>{</tt><i>n</i><tt>,}?</tt></td>
+ * <tr><td valign="top" headers="construct reluc"><i>X</i><code>{</code><i>n</i><code>,}?</code></td>
  *     <td headers="matches"><i>X</i>, at least <i>n</i> times</td></tr>
- * <tr><td valign="top" headers="construct reluc"><i>X</i><tt>{</tt><i>n</i><tt>,</tt><i>m</i><tt>}?</tt></td>
+ * <tr><td valign="top" headers="construct reluc"><i>X</i><code>{</code><i>n</i>{@code ,}<i>m</i><code>}?</code></td>
  *     <td headers="matches"><i>X</i>, at least <i>n</i> but not more than <i>m</i> times</td></tr>
  *
  * <tr><th>&nbsp;</th></tr>
  * <tr align="left"><th colspan="2" id="poss">Possessive quantifiers</th></tr>
  *
- * <tr><td valign="top" headers="construct poss"><i>X</i><tt>?+</tt></td>
+ * <tr><td valign="top" headers="construct poss"><i>X</i>{@code ?+}</td>
  *     <td headers="matches"><i>X</i>, once or not at all</td></tr>
- * <tr><td valign="top" headers="construct poss"><i>X</i><tt>*+</tt></td>
+ * <tr><td valign="top" headers="construct poss"><i>X</i>{@code *+}</td>
  *     <td headers="matches"><i>X</i>, zero or more times</td></tr>
- * <tr><td valign="top" headers="construct poss"><i>X</i><tt>++</tt></td>
+ * <tr><td valign="top" headers="construct poss"><i>X</i>{@code ++}</td>
  *     <td headers="matches"><i>X</i>, one or more times</td></tr>
- * <tr><td valign="top" headers="construct poss"><i>X</i><tt>{</tt><i>n</i><tt>}+</tt></td>
+ * <tr><td valign="top" headers="construct poss"><i>X</i><code>{</code><i>n</i><code>}+</code></td>
  *     <td headers="matches"><i>X</i>, exactly <i>n</i> times</td></tr>
- * <tr><td valign="top" headers="construct poss"><i>X</i><tt>{</tt><i>n</i><tt>,}+</tt></td>
+ * <tr><td valign="top" headers="construct poss"><i>X</i><code>{</code><i>n</i><code>,}+</code></td>
  *     <td headers="matches"><i>X</i>, at least <i>n</i> times</td></tr>
- * <tr><td valign="top" headers="construct poss"><i>X</i><tt>{</tt><i>n</i><tt>,</tt><i>m</i><tt>}+</tt></td>
+ * <tr><td valign="top" headers="construct poss"><i>X</i><code>{</code><i>n</i>{@code ,}<i>m</i><code>}+</code></td>
  *     <td headers="matches"><i>X</i>, at least <i>n</i> but not more than <i>m</i> times</td></tr>
  *
  * <tr><th>&nbsp;</th></tr>
@@ -315,59 +315,59 @@
  *
  * <tr><td valign="top" headers="construct logical"><i>XY</i></td>
  *     <td headers="matches"><i>X</i> followed by <i>Y</i></td></tr>
- * <tr><td valign="top" headers="construct logical"><i>X</i><tt>|</tt><i>Y</i></td>
+ * <tr><td valign="top" headers="construct logical"><i>X</i>{@code |}<i>Y</i></td>
  *     <td headers="matches">Either <i>X</i> or <i>Y</i></td></tr>
- * <tr><td valign="top" headers="construct logical"><tt>(</tt><i>X</i><tt>)</tt></td>
+ * <tr><td valign="top" headers="construct logical">{@code (}<i>X</i>{@code )}</td>
  *     <td headers="matches">X, as a <a href="#cg">capturing group</a></td></tr>
  *
  * <tr><th>&nbsp;</th></tr>
  * <tr align="left"><th colspan="2" id="backref">Back references</th></tr>
  *
- * <tr><td valign="bottom" headers="construct backref"><tt>\</tt><i>n</i></td>
+ * <tr><td valign="bottom" headers="construct backref">{@code \}<i>n</i></td>
  *     <td valign="bottom" headers="matches">Whatever the <i>n</i><sup>th</sup>
  *     <a href="#cg">capturing group</a> matched</td></tr>
  *
- * <tr><td valign="bottom" headers="construct backref"><tt>\</tt><i>k</i>&lt;<i>name</i>&gt;</td>
+ * <tr><td valign="bottom" headers="construct backref">{@code \}<i>k</i>&lt;<i>name</i>&gt;</td>
  *     <td valign="bottom" headers="matches">Whatever the
  *     <a href="#groupname">named-capturing group</a> "name" matched</td></tr>
  *
  * <tr><th>&nbsp;</th></tr>
  * <tr align="left"><th colspan="2" id="quot">Quotation</th></tr>
  *
- * <tr><td valign="top" headers="construct quot"><tt>\</tt></td>
+ * <tr><td valign="top" headers="construct quot">{@code \}</td>
  *     <td headers="matches">Nothing, but quotes the following character</td></tr>
- * <tr><td valign="top" headers="construct quot"><tt>\Q</tt></td>
- *     <td headers="matches">Nothing, but quotes all characters until <tt>\E</tt></td></tr>
- * <tr><td valign="top" headers="construct quot"><tt>\E</tt></td>
- *     <td headers="matches">Nothing, but ends quoting started by <tt>\Q</tt></td></tr>
+ * <tr><td valign="top" headers="construct quot">{@code \Q}</td>
+ *     <td headers="matches">Nothing, but quotes all characters until {@code \E}</td></tr>
+ * <tr><td valign="top" headers="construct quot">{@code \E}</td>
+ *     <td headers="matches">Nothing, but ends quoting started by {@code \Q}</td></tr>
  *     <!-- Metachars: !$()*+.<>?[\]^{|} -->
  *
  * <tr><th>&nbsp;</th></tr>
  * <tr align="left"><th colspan="2" id="special">Special constructs (named-capturing and non-capturing)</th></tr>
  *
- * <tr><td valign="top" headers="construct special"><tt>(?&lt;<a href="#groupname">name</a>&gt;</tt><i>X</i><tt>)</tt></td>
+ * <tr><td valign="top" headers="construct special"><code>(?&lt;<a href="#groupname">name</a>&gt;</code><i>X</i>{@code )}</td>
  *     <td headers="matches"><i>X</i>, as a named-capturing group</td></tr>
- * <tr><td valign="top" headers="construct special"><tt>(?:</tt><i>X</i><tt>)</tt></td>
+ * <tr><td valign="top" headers="construct special">{@code (?:}<i>X</i>{@code )}</td>
  *     <td headers="matches"><i>X</i>, as a non-capturing group</td></tr>
- * <tr><td valign="top" headers="construct special"><tt>(?idmsuxU-idmsuxU)&nbsp;</tt></td>
+ * <tr><td valign="top" headers="construct special"><code>(?idmsuxU-idmsuxU)&nbsp;</code></td>
  *     <td headers="matches">Nothing, but turns match flags <a href="#CASE_INSENSITIVE">i</a>
  * <a href="#UNIX_LINES">d</a> <a href="#MULTILINE">m</a> <a href="#DOTALL">s</a>
  * <a href="#UNICODE_CASE">u</a> <a href="#COMMENTS">x</a> <a href="#UNICODE_CHARACTER_CLASS">U</a>
  * on - off</td></tr>
- * <tr><td valign="top" headers="construct special"><tt>(?idmsux-idmsux:</tt><i>X</i><tt>)</tt>&nbsp;&nbsp;</td>
+ * <tr><td valign="top" headers="construct special"><code>(?idmsux-idmsux:</code><i>X</i>{@code )}&nbsp;&nbsp;</td>
  *     <td headers="matches"><i>X</i>, as a <a href="#cg">non-capturing group</a> with the
  *         given flags <a href="#CASE_INSENSITIVE">i</a> <a href="#UNIX_LINES">d</a>
  * <a href="#MULTILINE">m</a> <a href="#DOTALL">s</a> <a href="#UNICODE_CASE">u</a >
  * <a href="#COMMENTS">x</a> on - off</td></tr>
- * <tr><td valign="top" headers="construct special"><tt>(?=</tt><i>X</i><tt>)</tt></td>
+ * <tr><td valign="top" headers="construct special">{@code (?=}<i>X</i>{@code )}</td>
  *     <td headers="matches"><i>X</i>, via zero-width positive lookahead</td></tr>
- * <tr><td valign="top" headers="construct special"><tt>(?!</tt><i>X</i><tt>)</tt></td>
+ * <tr><td valign="top" headers="construct special">{@code (?!}<i>X</i>{@code )}</td>
  *     <td headers="matches"><i>X</i>, via zero-width negative lookahead</td></tr>
- * <tr><td valign="top" headers="construct special"><tt>(?&lt;=</tt><i>X</i><tt>)</tt></td>
+ * <tr><td valign="top" headers="construct special">{@code (?<=}<i>X</i>{@code )}</td>
  *     <td headers="matches"><i>X</i>, via zero-width positive lookbehind</td></tr>
- * <tr><td valign="top" headers="construct special"><tt>(?&lt;!</tt><i>X</i><tt>)</tt></td>
+ * <tr><td valign="top" headers="construct special">{@code (?<!}<i>X</i>{@code )}</td>
  *     <td headers="matches"><i>X</i>, via zero-width negative lookbehind</td></tr>
- * <tr><td valign="top" headers="construct special"><tt>(?&gt;</tt><i>X</i><tt>)</tt></td>
+ * <tr><td valign="top" headers="construct special">{@code (?>}<i>X</i>{@code )}</td>
  *     <td headers="matches"><i>X</i>, as an independent, non-capturing group</td></tr>
  *
  * </table>
@@ -377,10 +377,10 @@
  *
  * <h3><a name="bs">Backslashes, escapes, and quoting</a></h3>
  *
- * <p> The backslash character (<tt>'\'</tt>) serves to introduce escaped
+ * <p> The backslash character ({@code '\'}) serves to introduce escaped
  * constructs, as defined in the table above, as well as to quote characters
  * that otherwise would be interpreted as unescaped constructs.  Thus the
- * expression <tt>\\</tt> matches a single backslash and <tt>\{</tt> matches a
+ * expression {@code \\} matches a single backslash and <code>\{</code> matches a
  * left brace.
  *
  * <p> It is an error to use a backslash prior to any alphabetic character that
@@ -396,18 +396,18 @@
  * It is therefore necessary to double backslashes in string
  * literals that represent regular expressions to protect them from
  * interpretation by the Java bytecode compiler.  The string literal
- * <tt>"&#92;b"</tt>, for example, matches a single backspace character when
- * interpreted as a regular expression, while <tt>"&#92;&#92;b"</tt> matches a
- * word boundary.  The string literal <tt>"&#92;(hello&#92;)"</tt> is illegal
+ * <code>"&#92;b"</code>, for example, matches a single backspace character when
+ * interpreted as a regular expression, while {@code "\\b"} matches a
+ * word boundary.  The string literal {@code "\(hello\)"} is illegal
  * and leads to a compile-time error; in order to match the string
- * <tt>(hello)</tt> the string literal <tt>"&#92;&#92;(hello&#92;&#92;)"</tt>
+ * {@code (hello)} the string literal {@code "\\(hello\\)"}
  * must be used.
  *
  * <h3><a name="cc">Character Classes</a></h3>
  *
  *    <p> Character classes may appear within other character classes, and
  *    may be composed by the union operator (implicit) and the intersection
- *    operator (<tt>&amp;&amp;</tt>).
+ *    operator ({@code &&}).
  *    The union operator denotes a class that contains every character that is
  *    in at least one of its operand classes.  The intersection operator
  *    denotes a class that contains every character that is in both of its
@@ -420,16 +420,16 @@
  *                 summary="Precedence of character class operators.">
  *      <tr><th>1&nbsp;&nbsp;&nbsp;&nbsp;</th>
  *        <td>Literal escape&nbsp;&nbsp;&nbsp;&nbsp;</td>
- *        <td><tt>\x</tt></td></tr>
+ *        <td>{@code \x}</td></tr>
  *     <tr><th>2&nbsp;&nbsp;&nbsp;&nbsp;</th>
  *        <td>Grouping</td>
- *        <td><tt>[...]</tt></td></tr>
+ *        <td>{@code [...]}</td></tr>
  *     <tr><th>3&nbsp;&nbsp;&nbsp;&nbsp;</th>
  *        <td>Range</td>
- *        <td><tt>a-z</tt></td></tr>
+ *        <td>{@code a-z}</td></tr>
  *      <tr><th>4&nbsp;&nbsp;&nbsp;&nbsp;</th>
  *        <td>Union</td>
- *        <td><tt>[a-e][i-u]</tt></td></tr>
+ *        <td>{@code [a-e][i-u]}</td></tr>
  *      <tr><th>5&nbsp;&nbsp;&nbsp;&nbsp;</th>
  *        <td>Intersection</td>
  *        <td>{@code [a-z&&[aeiou]]}</td></tr>
@@ -437,8 +437,8 @@
  *
  *    <p> Note that a different set of metacharacters are in effect inside
  *    a character class than outside a character class. For instance, the
- *    regular expression <tt>.</tt> loses its special meaning inside a
- *    character class, while the expression <tt>-</tt> becomes a range
+ *    regular expression {@code .} loses its special meaning inside a
+ *    character class, while the expression {@code -} becomes a range
  *    forming metacharacter.
  *
  * <h3><a name="lt">Line terminators</a></h3>
@@ -449,49 +449,49 @@
  *
  * <ul>
  *
- *   <li> A newline (line feed) character&nbsp;(<tt>'\n'</tt>),
+ *   <li> A newline (line feed) character&nbsp;({@code '\n'}),
  *
  *   <li> A carriage-return character followed immediately by a newline
- *   character&nbsp;(<tt>"\r\n"</tt>),
+ *   character&nbsp;({@code "\r\n"}),
  *
- *   <li> A standalone carriage-return character&nbsp;(<tt>'\r'</tt>),
+ *   <li> A standalone carriage-return character&nbsp;({@code '\r'}),
  *
- *   <li> A next-line character&nbsp;(<tt>'&#92;u0085'</tt>),
+ *   <li> A next-line character&nbsp;(<code>'&#92;u0085'</code>),
  *
- *   <li> A line-separator character&nbsp;(<tt>'&#92;u2028'</tt>), or
+ *   <li> A line-separator character&nbsp;(<code>'&#92;u2028'</code>), or
  *
- *   <li> A paragraph-separator character&nbsp;(<tt>'&#92;u2029</tt>).
+ *   <li> A paragraph-separator character&nbsp;(<code>'&#92;u2029</code>).
  *
  * </ul>
  * <p>If {@link #UNIX_LINES} mode is activated, then the only line terminators
  * recognized are newline characters.
  *
- * <p> The regular expression <tt>.</tt> matches any character except a line
+ * <p> The regular expression {@code .} matches any character except a line
  * terminator unless the {@link #DOTALL} flag is specified.
  *
- * <p> By default, the regular expressions <tt>^</tt> and <tt>$</tt> ignore
+ * <p> By default, the regular expressions {@code ^} and {@code $} ignore
  * line terminators and only match at the beginning and the end, respectively,
  * of the entire input sequence. If {@link #MULTILINE} mode is activated then
- * <tt>^</tt> matches at the beginning of input and after any line terminator
- * except at the end of input. When in {@link #MULTILINE} mode <tt>$</tt>
+ * {@code ^} matches at the beginning of input and after any line terminator
+ * except at the end of input. When in {@link #MULTILINE} mode {@code $}
  * matches just before a line terminator or the end of the input sequence.
  *
  * <h3><a name="cg">Groups and capturing</a></h3>
  *
  * <h4><a name="gnumber">Group number</a></h4>
  * <p> Capturing groups are numbered by counting their opening parentheses from
- * left to right.  In the expression <tt>((A)(B(C)))</tt>, for example, there
+ * left to right.  In the expression {@code ((A)(B(C)))}, for example, there
  * are four such groups: </p>
  *
  * <blockquote><table cellpadding=1 cellspacing=0 summary="Capturing group numberings">
  * <tr><th>1&nbsp;&nbsp;&nbsp;&nbsp;</th>
- *     <td><tt>((A)(B(C)))</tt></td></tr>
+ *     <td>{@code ((A)(B(C)))}</td></tr>
  * <tr><th>2&nbsp;&nbsp;&nbsp;&nbsp;</th>
- *     <td><tt>(A)</tt></td></tr>
+ *     <td>{@code (A)}</td></tr>
  * <tr><th>3&nbsp;&nbsp;&nbsp;&nbsp;</th>
- *     <td><tt>(B(C))</tt></td></tr>
+ *     <td>{@code (B(C))}</td></tr>
  * <tr><th>4&nbsp;&nbsp;&nbsp;&nbsp;</th>
- *     <td><tt>(C)</tt></td></tr>
+ *     <td>{@code (C)}</td></tr>
  * </table></blockquote>
  *
  * <p> Group zero always stands for the entire expression.
@@ -502,31 +502,31 @@
  * may also be retrieved from the matcher once the match operation is complete.
  *
  * <h4><a name="groupname">Group name</a></h4>
- * <p>A capturing group can also be assigned a "name", a <tt>named-capturing group</tt>,
+ * <p>A capturing group can also be assigned a "name", a {@code named-capturing group},
  * and then be back-referenced later by the "name". Group names are composed of
- * the following characters. The first character must be a <tt>letter</tt>.
+ * the following characters. The first character must be a {@code letter}.
  *
  * <ul>
- *   <li> The uppercase letters <tt>'A'</tt> through <tt>'Z'</tt>
- *        (<tt>'&#92;u0041'</tt>&nbsp;through&nbsp;<tt>'&#92;u005a'</tt>),
- *   <li> The lowercase letters <tt>'a'</tt> through <tt>'z'</tt>
- *        (<tt>'&#92;u0061'</tt>&nbsp;through&nbsp;<tt>'&#92;u007a'</tt>),
- *   <li> The digits <tt>'0'</tt> through <tt>'9'</tt>
- *        (<tt>'&#92;u0030'</tt>&nbsp;through&nbsp;<tt>'&#92;u0039'</tt>),
+ *   <li> The uppercase letters {@code 'A'} through {@code 'Z'}
+ *        (<code>'&#92;u0041'</code>&nbsp;through&nbsp;<code>'&#92;u005a'</code>),
+ *   <li> The lowercase letters {@code 'a'} through {@code 'z'}
+ *        (<code>'&#92;u0061'</code>&nbsp;through&nbsp;<code>'&#92;u007a'</code>),
+ *   <li> The digits {@code '0'} through {@code '9'}
+ *        (<code>'&#92;u0030'</code>&nbsp;through&nbsp;<code>'&#92;u0039'</code>),
  * </ul>
  *
- * <p> A <tt>named-capturing group</tt> is still numbered as described in
+ * <p> A {@code named-capturing group} is still numbered as described in
  * <a href="#gnumber">Group number</a>.
  *
  * <p> The captured input associated with a group is always the subsequence
  * that the group most recently matched.  If a group is evaluated a second time
  * because of quantification then its previously-captured value, if any, will
  * be retained if the second evaluation fails.  Matching the string
- * <tt>"aba"</tt> against the expression <tt>(a(b)?)+</tt>, for example, leaves
- * group two set to <tt>"b"</tt>.  All captured input is discarded at the
+ * {@code "aba"} against the expression {@code (a(b)?)+}, for example, leaves
+ * group two set to {@code "b"}.  All captured input is discarded at the
  * beginning of each match.
  *
- * <p> Groups beginning with <tt>(?</tt> are either pure, <i>non-capturing</i> groups
+ * <p> Groups beginning with {@code (?} are either pure, <i>non-capturing</i> groups
  * that do not capture text and do not count towards the group total, or
  * <i>named-capturing</i> group.
  *
@@ -537,26 +537,26 @@
  * Standard #18: Unicode Regular Expression</i></a>, plus RL2.1
  * Canonical Equivalents.
  * <p>
- * <b>Unicode escape sequences</b> such as <tt>&#92;u2014</tt> in Java source code
+ * <b>Unicode escape sequences</b> such as <code>&#92;u2014</code> in Java source code
  * are processed as described in section 3.3 of
  * <cite>The Java&trade; Language Specification</cite>.
  * Such escape sequences are also implemented directly by the regular-expression
  * parser so that Unicode escapes can be used in expressions that are read from
- * files or from the keyboard.  Thus the strings <tt>"&#92;u2014"</tt> and
- * <tt>"\\u2014"</tt>, while not equal, compile into the same pattern, which
- * matches the character with hexadecimal value <tt>0x2014</tt>.
+ * files or from the keyboard.  Thus the strings <code>"&#92;u2014"</code> and
+ * {@code "\\u2014"}, while not equal, compile into the same pattern, which
+ * matches the character with hexadecimal value {@code 0x2014}.
  * <p>
  * A Unicode character can also be represented in a regular-expression by
  * using its <b>Hex notation</b>(hexadecimal code point value) directly as described in construct
- * <tt>&#92;x{...}</tt>, for example a supplementary character U+2011F
- * can be specified as <tt>&#92;x{2011F}</tt>, instead of two consecutive
+ * <code>&#92;x{...}</code>, for example a supplementary character U+2011F
+ * can be specified as <code>&#92;x{2011F}</code>, instead of two consecutive
  * Unicode escape sequences of the surrogate pair
- * <tt>&#92;uD840</tt><tt>&#92;uDD1F</tt>.
+ * <code>&#92;uD840</code><code>&#92;uDD1F</code>.
  * <p>
  * Unicode scripts, blocks, categories and binary properties are written with
- * the <tt>\p</tt> and <tt>\P</tt> constructs as in Perl.
- * <tt>\p{</tt><i>prop</i><tt>}</tt> matches if
- * the input has the property <i>prop</i>, while <tt>\P{</tt><i>prop</i><tt>}</tt>
+ * the {@code \p} and {@code \P} constructs as in Perl.
+ * <code>\p{</code><i>prop</i><code>}</code> matches if
+ * the input has the property <i>prop</i>, while <code>\P{</code><i>prop</i><code>}</code>
  * does not match if the input has that property.
  * <p>
  * Scripts, blocks, categories and binary properties can be used both inside
@@ -567,7 +567,7 @@
  * {@code IsHiragana}, or by using  the {@code script} keyword (or its short
  * form {@code sc}) as in {@code script=Hiragana} or {@code sc=Hiragana}.
  * <p>
- * The script names supported by <code>Pattern</code> are the valid script names
+ * The script names supported by {@code Pattern} are the valid script names
  * accepted and defined by
  * {@link java.lang.Character.UnicodeScript#forName(String) UnicodeScript.forName}.
  *
@@ -576,7 +576,7 @@
  * {@code InMongolian}, or by using the keyword {@code block} (or its short
  * form {@code blk}) as in {@code block=Mongolian} or {@code blk=Mongolian}.
  * <p>
- * The block names supported by <code>Pattern</code> are the valid block names
+ * The block names supported by {@code Pattern} are the valid block names
  * accepted and defined by
  * {@link java.lang.Character.UnicodeBlock#forName(String) UnicodeBlock.forName}.
  * <p>
@@ -595,7 +595,7 @@
  * <p>
  *
  * <b><a name="ubpc">Binary properties</a></b> are specified with the prefix {@code Is}, as in
- * {@code IsAlphabetic}. The supported binary properties by <code>Pattern</code>
+ * {@code IsAlphabetic}. The supported binary properties by {@code Pattern}
  * are
  * <ul>
  *   <li> Alphabetic
@@ -625,88 +625,88 @@
  * <th align="left" id="predef_classes">Classes</th>
  * <th align="left" id="predef_matches">Matches</th>
  *</tr>
- * <tr><td><tt>\p{Lower}</tt></td>
- *     <td>A lowercase character:<tt>\p{IsLowercase}</tt></td></tr>
- * <tr><td><tt>\p{Upper}</tt></td>
- *     <td>An uppercase character:<tt>\p{IsUppercase}</tt></td></tr>
- * <tr><td><tt>\p{ASCII}</tt></td>
- *     <td>All ASCII:<tt>[\x00-\x7F]</tt></td></tr>
- * <tr><td><tt>\p{Alpha}</tt></td>
- *     <td>An alphabetic character:<tt>\p{IsAlphabetic}</tt></td></tr>
- * <tr><td><tt>\p{Digit}</tt></td>
- *     <td>A decimal digit character:<tt>p{IsDigit}</tt></td></tr>
- * <tr><td><tt>\p{Alnum}</tt></td>
- *     <td>An alphanumeric character:<tt>[\p{IsAlphabetic}\p{IsDigit}]</tt></td></tr>
- * <tr><td><tt>\p{Punct}</tt></td>
- *     <td>A punctuation character:<tt>p{IsPunctuation}</tt></td></tr>
- * <tr><td><tt>\p{Graph}</tt></td>
- *     <td>A visible character: <tt>[^\p{IsWhite_Space}\p{gc=Cc}\p{gc=Cs}\p{gc=Cn}]</tt></td></tr>
- * <tr><td><tt>\p{Print}</tt></td>
+ * <tr><td>{@code \p{Lower}}</td>
+ *     <td>A lowercase character:{@code \p{IsLowercase}}</td></tr>
+ * <tr><td>{@code \p{Upper}}</td>
+ *     <td>An uppercase character:{@code \p{IsUppercase}}</td></tr>
+ * <tr><td>{@code \p{ASCII}}</td>
+ *     <td>All ASCII:{@code [\x00-\x7F]}</td></tr>
+ * <tr><td>{@code \p{Alpha}}</td>
+ *     <td>An alphabetic character:{@code \p{IsAlphabetic}}</td></tr>
+ * <tr><td>{@code \p{Digit}}</td>
+ *     <td>A decimal digit character:{@code p{IsDigit}}</td></tr>
+ * <tr><td>{@code \p{Alnum}}</td>
+ *     <td>An alphanumeric character:{@code [\p{IsAlphabetic}\p{IsDigit}]}</td></tr>
+ * <tr><td>{@code \p{Punct}}</td>
+ *     <td>A punctuation character:{@code p{IsPunctuation}}</td></tr>
+ * <tr><td>{@code \p{Graph}}</td>
+ *     <td>A visible character: {@code [^\p{IsWhite_Space}\p{gc=Cc}\p{gc=Cs}\p{gc=Cn}]}</td></tr>
+ * <tr><td>{@code \p{Print}}</td>
  *     <td>A printable character: {@code [\p{Graph}\p{Blank}&&[^\p{Cntrl}]]}</td></tr>
- * <tr><td><tt>\p{Blank}</tt></td>
+ * <tr><td>{@code \p{Blank}}</td>
  *     <td>A space or a tab: {@code [\p{IsWhite_Space}&&[^\p{gc=Zl}\p{gc=Zp}\x0a\x0b\x0c\x0d\x85]]}</td></tr>
- * <tr><td><tt>\p{Cntrl}</tt></td>
- *     <td>A control character: <tt>\p{gc=Cc}</tt></td></tr>
- * <tr><td><tt>\p{XDigit}</tt></td>
- *     <td>A hexadecimal digit: <tt>[\p{gc=Nd}\p{IsHex_Digit}]</tt></td></tr>
- * <tr><td><tt>\p{Space}</tt></td>
- *     <td>A whitespace character:<tt>\p{IsWhite_Space}</tt></td></tr>
- * <tr><td><tt>\d</tt></td>
- *     <td>A digit: <tt>\p{IsDigit}</tt></td></tr>
- * <tr><td><tt>\D</tt></td>
- *     <td>A non-digit: <tt>[^\d]</tt></td></tr>
- * <tr><td><tt>\s</tt></td>
- *     <td>A whitespace character: <tt>\p{IsWhite_Space}</tt></td></tr>
- * <tr><td><tt>\S</tt></td>
- *     <td>A non-whitespace character: <tt>[^\s]</tt></td></tr>
- * <tr><td><tt>\w</tt></td>
- *     <td>A word character: <tt>[\p{Alpha}\p{gc=Mn}\p{gc=Me}\p{gc=Mc}\p{Digit}\p{gc=Pc}\p{IsJoin_Control}]</tt></td></tr>
- * <tr><td><tt>\W</tt></td>
- *     <td>A non-word character: <tt>[^\w]</tt></td></tr>
+ * <tr><td>{@code \p{Cntrl}}</td>
+ *     <td>A control character: {@code \p{gc=Cc}}</td></tr>
+ * <tr><td>{@code \p{XDigit}}</td>
+ *     <td>A hexadecimal digit: {@code [\p{gc=Nd}\p{IsHex_Digit}]}</td></tr>
+ * <tr><td>{@code \p{Space}}</td>
+ *     <td>A whitespace character:{@code \p{IsWhite_Space}}</td></tr>
+ * <tr><td>{@code \d}</td>
+ *     <td>A digit: {@code \p{IsDigit}}</td></tr>
+ * <tr><td>{@code \D}</td>
+ *     <td>A non-digit: {@code [^\d]}</td></tr>
+ * <tr><td>{@code \s}</td>
+ *     <td>A whitespace character: {@code \p{IsWhite_Space}}</td></tr>
+ * <tr><td>{@code \S}</td>
+ *     <td>A non-whitespace character: {@code [^\s]}</td></tr>
+ * <tr><td>{@code \w}</td>
+ *     <td>A word character: {@code [\p{Alpha}\p{gc=Mn}\p{gc=Me}\p{gc=Mc}\p{Digit}\p{gc=Pc}\p{IsJoin_Control}]}</td></tr>
+ * <tr><td>{@code \W}</td>
+ *     <td>A non-word character: {@code [^\w]}</td></tr>
  * </table>
  * <p>
  * <a name="jcc">
  * Categories that behave like the java.lang.Character
  * boolean is<i>methodname</i> methods (except for the deprecated ones) are
- * available through the same <tt>\p{</tt><i>prop</i><tt>}</tt> syntax where
- * the specified property has the name <tt>java<i>methodname</i></tt></a>.
+ * available through the same <code>\p{</code><i>prop</i><code>}</code> syntax where
+ * the specified property has the name <code>java<i>methodname</i></code></a>.
  *
  * <h3> Comparison to Perl 5 </h3>
  *
- * <p>The <code>Pattern</code> engine performs traditional NFA-based matching
+ * <p>The {@code Pattern} engine performs traditional NFA-based matching
  * with ordered alternation as occurs in Perl 5.
  *
  * <p> Perl constructs not supported by this class: </p>
  *
  * <ul>
  *    <li><p> Predefined character classes (Unicode character)
- *    <p><tt>\X&nbsp;&nbsp;&nbsp;&nbsp;</tt>Match Unicode
+ *    <p><code>\X&nbsp;&nbsp;&nbsp;&nbsp;</code>Match Unicode
  *    <a href="http://www.unicode.org/reports/tr18/#Default_Grapheme_Clusters">
  *    <i>extended grapheme cluster</i></a>
  *    </p></li>
  *
- *    <li><p> The backreference constructs, <tt>\g{</tt><i>n</i><tt>}</tt> for
+ *    <li><p> The backreference constructs, <code>\g{</code><i>n</i><code>}</code> for
  *    the <i>n</i><sup>th</sup><a href="#cg">capturing group</a> and
- *    <tt>\g{</tt><i>name</i><tt>}</tt> for
+ *    <code>\g{</code><i>name</i><code>}</code> for
  *    <a href="#groupname">named-capturing group</a>.
  *    </p></li>
  *
- *    <li><p> The named character construct, <tt>\N{</tt><i>name</i><tt>}</tt>
+ *    <li><p> The named character construct, <code>\N{</code><i>name</i><code>}</code>
  *    for a Unicode character by its name.
  *    </p></li>
  *
  *    <li><p> The conditional constructs
- *    <tt>(?(</tt><i>condition</i><tt>)</tt><i>X</i><tt>)</tt> and
- *    <tt>(?(</tt><i>condition</i><tt>)</tt><i>X</i><tt>|</tt><i>Y</i><tt>)</tt>,
+ *    {@code (?(}<i>condition</i>{@code )}<i>X</i>{@code )} and
+ *    {@code (?(}<i>condition</i>{@code )}<i>X</i>{@code |}<i>Y</i>{@code )},
  *    </p></li>
  *
- *    <li><p> The embedded code constructs <tt>(?{</tt><i>code</i><tt>})</tt>
- *    and <tt>(??{</tt><i>code</i><tt>})</tt>,</p></li>
+ *    <li><p> The embedded code constructs <code>(?{</code><i>code</i><code>})</code>
+ *    and <code>(??{</code><i>code</i><code>})</code>,</p></li>
  *
- *    <li><p> The embedded comment syntax <tt>(?#comment)</tt>, and </p></li>
+ *    <li><p> The embedded comment syntax {@code (?#comment)}, and </p></li>
  *
- *    <li><p> The preprocessing operations <tt>\l</tt> <tt>&#92;u</tt>,
- *    <tt>\L</tt>, and <tt>\U</tt>.  </p></li>
+ *    <li><p> The preprocessing operations {@code \l} <code>&#92;u</code>,
+ *    {@code \L}, and {@code \U}.  </p></li>
  *
  * </ul>
  *
@@ -723,19 +723,19 @@
  *
  * <ul>
  *
- *    <li><p> In Perl, <tt>\1</tt> through <tt>\9</tt> are always interpreted
- *    as back references; a backslash-escaped number greater than <tt>9</tt> is
+ *    <li><p> In Perl, {@code \1} through {@code \9} are always interpreted
+ *    as back references; a backslash-escaped number greater than {@code 9} is
  *    treated as a back reference if at least that many subexpressions exist,
  *    otherwise it is interpreted, if possible, as an octal escape.  In this
  *    class octal escapes must always begin with a zero. In this class,
- *    <tt>\1</tt> through <tt>\9</tt> are always interpreted as back
+ *    {@code \1} through {@code \9} are always interpreted as back
  *    references, and a larger number is accepted as a back reference if at
  *    least that many subexpressions exist at that point in the regular
  *    expression, otherwise the parser will drop digits until the number is
  *    smaller or equal to the existing number of groups or it is one digit.
  *    </p></li>
  *
- *    <li><p> Perl uses the <tt>g</tt> flag to request a match that resumes
+ *    <li><p> Perl uses the {@code g} flag to request a match that resumes
  *    where the last match left off.  This functionality is provided implicitly
  *    by the {@link Matcher} class: Repeated invocations of the {@link
  *    Matcher#find find} method will resume where the last match left off,
@@ -786,11 +786,11 @@
     /**
      * Enables Unix lines mode.
      *
-     * <p> In this mode, only the <tt>'\n'</tt> line terminator is recognized
-     * in the behavior of <tt>.</tt>, <tt>^</tt>, and <tt>$</tt>.
+     * <p> In this mode, only the {@code '\n'} line terminator is recognized
+     * in the behavior of {@code .}, {@code ^}, and {@code $}.
      *
      * <p> Unix lines mode can also be enabled via the embedded flag
-     * expression&nbsp;<tt>(?d)</tt>.
+     * expression&nbsp;{@code (?d)}.
      */
     public static final int UNIX_LINES = 0x01;
 
@@ -803,7 +803,7 @@
      * #UNICODE_CASE} flag in conjunction with this flag.
      *
      * <p> Case-insensitive matching can also be enabled via the embedded flag
-     * expression&nbsp;<tt>(?i)</tt>.
+     * expression&nbsp;{@code (?i)}.
      *
      * <p> Specifying this flag may impose a slight performance penalty.  </p>
      */
@@ -813,23 +813,23 @@
      * Permits whitespace and comments in pattern.
      *
      * <p> In this mode, whitespace is ignored, and embedded comments starting
-     * with <tt>#</tt> are ignored until the end of a line.
+     * with {@code #} are ignored until the end of a line.
      *
      * <p> Comments mode can also be enabled via the embedded flag
-     * expression&nbsp;<tt>(?x)</tt>.
+     * expression&nbsp;{@code (?x)}.
      */
     public static final int COMMENTS = 0x04;
 
     /**
      * Enables multiline mode.
      *
-     * <p> In multiline mode the expressions <tt>^</tt> and <tt>$</tt> match
+     * <p> In multiline mode the expressions {@code ^} and {@code $} match
      * just after or just before, respectively, a line terminator or the end of
      * the input sequence.  By default these expressions only match at the
      * beginning and the end of the entire input sequence.
      *
      * <p> Multiline mode can also be enabled via the embedded flag
-     * expression&nbsp;<tt>(?m)</tt>.  </p>
+     * expression&nbsp;{@code (?m)}.  </p>
      */
     public static final int MULTILINE = 0x08;
 
@@ -853,12 +853,12 @@
     /**
      * Enables dotall mode.
      *
-     * <p> In dotall mode, the expression <tt>.</tt> matches any character,
+     * <p> In dotall mode, the expression {@code .} matches any character,
      * including a line terminator.  By default this expression does not match
      * line terminators.
      *
      * <p> Dotall mode can also be enabled via the embedded flag
-     * expression&nbsp;<tt>(?s)</tt>.  (The <tt>s</tt> is a mnemonic for
+     * expression&nbsp;{@code (?s)}.  (The {@code s} is a mnemonic for
      * "single-line" mode, which is what this is called in Perl.)  </p>
      */
     public static final int DOTALL = 0x20;
@@ -873,7 +873,7 @@
      * matched.
      *
      * <p> Unicode-aware case folding can also be enabled via the embedded flag
-     * expression&nbsp;<tt>(?u)</tt>.
+     * expression&nbsp;{@code (?u)}.
      *
      * <p> Specifying this flag may impose a performance penalty.  </p>
      */
@@ -884,8 +884,8 @@
      *
      * <p> When this flag is specified then two characters will be considered
      * to match if, and only if, their full canonical decompositions match.
-     * The expression <tt>"a&#92;u030A"</tt>, for example, will match the
-     * string <tt>"&#92;u00E5"</tt> when this flag is specified.  By default,
+     * The expression <code>"a&#92;u030A"</code>, for example, will match the
+     * string <code>"&#92;u00E5"</code> when this flag is specified.  By default,
      * matching does not take canonical equivalence into account.
      *
      * <p> There is no embedded flag character for enabling canonical
@@ -907,7 +907,7 @@
      * <i>Annex C: Compatibility Properties</i>.
      * <p>
      * The UNICODE_CHARACTER_CLASS mode can also be enabled via the embedded
-     * flag expression&nbsp;<tt>(?U)</tt>.
+     * flag expression&nbsp;{@code (?U)}.
      * <p>
      * The flag implies UNICODE_CASE, that is, it enables Unicode-aware case
      * folding.
@@ -1052,7 +1052,7 @@
      * @return the given regular expression compiled into a pattern with the given flags
      * @throws  IllegalArgumentException
      *          If bit values other than those corresponding to the defined
-     *          match flags are set in <tt>flags</tt>
+     *          match flags are set in {@code flags}
      *
      * @throws  PatternSyntaxException
      *          If the expression's syntax is invalid
@@ -1158,7 +1158,7 @@
      * of the resulting array. A zero-width match at the beginning however
      * never produces such empty leading substring.
      *
-     * <p> The <tt>limit</tt> parameter controls the number of times the
+     * <p> The {@code limit} parameter controls the number of times the
      * pattern is applied and therefore affects the length of the resulting
      * array.  If the limit <i>n</i> is greater than zero then the pattern
      * will be applied at most <i>n</i>&nbsp;-&nbsp;1 times, the array's
@@ -1169,7 +1169,7 @@
      * the pattern will be applied as many times as possible, the array can
      * have any length, and trailing empty strings will be discarded.
      *
-     * <p> The input <tt>"boo:and:foo"</tt>, for example, yields the following
+     * <p> The input {@code "boo:and:foo"}, for example, yields the following
      * results with these parameters:
      *
      * <blockquote><table cellpadding=1 cellspacing=0
@@ -1179,22 +1179,22 @@
      *     <th align="left"><i>Result&nbsp;&nbsp;&nbsp;&nbsp;</i></th></tr>
      * <tr><td align=center>:</td>
      *     <td align=center>2</td>
-     *     <td><tt>{ "boo", "and:foo" }</tt></td></tr>
+     *     <td>{@code { "boo", "and:foo" }}</td></tr>
      * <tr><td align=center>:</td>
      *     <td align=center>5</td>
-     *     <td><tt>{ "boo", "and", "foo" }</tt></td></tr>
+     *     <td>{@code { "boo", "and", "foo" }}</td></tr>
      * <tr><td align=center>:</td>
      *     <td align=center>-2</td>
-     *     <td><tt>{ "boo", "and", "foo" }</tt></td></tr>
+     *     <td>{@code { "boo", "and", "foo" }}</td></tr>
      * <tr><td align=center>o</td>
      *     <td align=center>5</td>
-     *     <td><tt>{ "b", "", ":and:f", "", "" }</tt></td></tr>
+     *     <td>{@code { "b", "", ":and:f", "", "" }}</td></tr>
      * <tr><td align=center>o</td>
      *     <td align=center>-2</td>
-     *     <td><tt>{ "b", "", ":and:f", "", "" }</tt></td></tr>
+     *     <td>{@code { "b", "", ":and:f", "", "" }}</td></tr>
      * <tr><td align=center>o</td>
      *     <td align=center>0</td>
-     *     <td><tt>{ "b", "", ":and:f" }</tt></td></tr>
+     *     <td>{@code { "b", "", ":and:f" }}</td></tr>
      * </table></blockquote>
      *
      * @param  input
@@ -1256,7 +1256,7 @@
      * sequence and a limit argument of zero.  Trailing empty strings are
      * therefore not included in the resulting array. </p>
      *
-     * <p> The input <tt>"boo:and:foo"</tt>, for example, yields the following
+     * <p> The input {@code "boo:and:foo"}, for example, yields the following
      * results with these expressions:
      *
      * <blockquote><table cellpadding=1 cellspacing=0
@@ -1264,9 +1264,9 @@
      * <tr><th align="left"><i>Regex&nbsp;&nbsp;&nbsp;&nbsp;</i></th>
      *     <th align="left"><i>Result</i></th></tr>
      * <tr><td align=center>:</td>
-     *     <td><tt>{ "boo", "and", "foo" }</tt></td></tr>
+     *     <td>{@code { "boo", "and", "foo" }}</td></tr>
      * <tr><td align=center>o</td>
-     *     <td><tt>{ "b", "", ":and:f" }</tt></td></tr>
+     *     <td>{@code { "b", "", ":and:f" }}</td></tr>
      * </table></blockquote>
      *
      *
@@ -1281,12 +1281,12 @@
     }
 
     /**
-     * Returns a literal pattern <code>String</code> for the specified
-     * <code>String</code>.
+     * Returns a literal pattern {@code String} for the specified
+     * {@code String}.
      *
-     * <p>This method produces a <code>String</code> that can be used to
-     * create a <code>Pattern</code> that would match the string
-     * <code>s</code> as if it were a literal pattern.</p> Metacharacters
+     * <p>This method produces a {@code String} that can be used to
+     * create a {@code Pattern} that would match the string
+     * {@code s} as if it were a literal pattern.</p> Metacharacters
      * or escape sequences in the input sequence will be given no special
      * meaning.
      *
--- a/jdk/src/java.base/share/classes/java/util/regex/PatternSyntaxException.java	Thu Apr 09 12:29:31 2015 +0200
+++ b/jdk/src/java.base/share/classes/java/util/regex/PatternSyntaxException.java	Mon Aug 17 12:45:16 2015 +0300
@@ -57,7 +57,7 @@
      *
      * @param  index
      *         The approximate index in the pattern of the error,
-     *         or <tt>-1</tt> if the index is not known
+     *         or {@code -1} if the index is not known
      */
     public PatternSyntaxException(String desc, String regex, int index) {
         this.desc = desc;
@@ -69,7 +69,7 @@
      * Retrieves the error index.
      *
      * @return  The approximate index in the pattern of the error,
-     *         or <tt>-1</tt> if the index is not known
+     *         or {@code -1} if the index is not known
      */
     public int getIndex() {
         return index;
--- a/jdk/src/java.base/share/classes/java/util/regex/package-info.java	Thu Apr 09 12:29:31 2015 +0200
+++ b/jdk/src/java.base/share/classes/java/util/regex/package-info.java	Mon Aug 17 12:45:16 2015 +0300
@@ -37,7 +37,7 @@
  * interface in order to support matching against characters from a
  * wide variety of input sources. </p>
  *
- * <p> Unless otherwise noted, passing a <tt>null</tt> argument to a
+ * <p> Unless otherwise noted, passing a <code>null</code> argument to a
  * method in any class or interface in this package will cause a
  * {@link java.lang.NullPointerException NullPointerException} to be
  * thrown.
--- a/jdk/src/java.base/share/classes/javax/security/auth/AuthPermission.java	Thu Apr 09 12:29:31 2015 +0200
+++ b/jdk/src/java.base/share/classes/javax/security/auth/AuthPermission.java	Mon Aug 17 12:45:16 2015 +0300
@@ -26,18 +26,17 @@
 package javax.security.auth;
 
 /**
- * This class is for authentication permissions.
- * An AuthPermission contains a name
- * (also referred to as a "target name")
- * but no actions list; you either have the named permission
- * or you don't.
+ * This class is for authentication permissions. An {@code AuthPermission}
+ * contains a name (also referred to as a "target name") but no actions
+ * list; you either have the named permission or you don't.
  *
  * <p> The target name is the name of a security configuration parameter
- * (see below).  Currently the AuthPermission object is used to
- * guard access to the Policy, Subject, LoginContext,
- * and Configuration objects.
+ * (see below).  Currently the {@code AuthPermission} object is used to
+ * guard access to the {@link Policy}, {@link Subject},
+ * {@link javax.security.auth.login.LoginContext}, and
+ * {@link javax.security.auth.login.Configuration} objects.
  *
- * <p> The possible target names for an Authentication Permission are:
+ * <p> The standard target names for an Authentication Permission are:
  *
  * <pre>
  *      doAs -                  allow the caller to invoke the
@@ -125,6 +124,9 @@
  *                              Subject-based access control policy.
  * </pre>
  *
+ * @implNote
+ * Implementations may define additional target names, but should use naming
+ * conventions such as reverse domain name notation to avoid name clashes.
  */
 public final class AuthPermission extends
 java.security.BasicPermission {
--- a/jdk/src/java.base/share/classes/sun/nio/ByteBuffered.java	Thu Apr 09 12:29:31 2015 +0200
+++ b/jdk/src/java.base/share/classes/sun/nio/ByteBuffered.java	Mon Aug 17 12:45:16 2015 +0300
@@ -29,11 +29,11 @@
 import java.io.IOException;
 
 /** This is an interface to adapt existing APIs to use {@link java.nio.ByteBuffer
- *  <tt>ByteBuffers</tt>} as the underlying
+ *  ByteBuffers} as the underlying
  *  data format.  Only the initial producer and final consumer have to be changed.<p>
  *
- *  For example, the Zip/Jar code supports {@link java.io.InputStream <tt>InputStreams</tt>}.
- *  To make the Zip code use {@link java.nio.MappedByteBuffer <tt>MappedByteBuffers</tt>} as
+ *  For example, the Zip/Jar code supports {@link java.io.InputStream InputStreams}.
+ *  To make the Zip code use {@link java.nio.MappedByteBuffer MappedByteBuffers} as
  *  the underlying data structure, it can create a class of InputStream that wraps the ByteBuffer,
  *  and implements the ByteBuffered interface. A co-operating class several layers
  *  away can ask the InputStream if it is an instance of ByteBuffered, then
@@ -42,12 +42,12 @@
 public interface ByteBuffered {
 
      /**
-     * Returns the <tt>ByteBuffer</tt> behind this object, if this particular
-     * instance has one. An implementation of <tt>getByteBuffer()</tt> is allowed
-     * to return <tt>null</tt> for any reason.
+     * Returns the {@code ByteBuffer} behind this object, if this particular
+     * instance has one. An implementation of {@code getByteBuffer()} is allowed
+     * to return {@code null} for any reason.
      *
-     * @return  The <tt>ByteBuffer</tt>, if this particular instance has one,
-     *          or <tt>null</tt> otherwise.
+     * @return  The {@code ByteBuffer}, if this particular instance has one,
+     *          or {@code null} otherwise.
      *
      * @throws  IOException
      *          If the ByteBuffer is no longer valid.
--- a/jdk/src/java.base/share/classes/sun/nio/ch/AllocatedNativeObject.java	Thu Apr 09 12:29:31 2015 +0200
+++ b/jdk/src/java.base/share/classes/sun/nio/ch/AllocatedNativeObject.java	Mon Aug 17 12:45:16 2015 +0300
@@ -36,14 +36,14 @@
 {
 
     /**
-     * Allocates a memory area of at least <tt>size</tt> bytes outside of the
+     * Allocates a memory area of at least {@code size} bytes outside of the
      * Java heap and creates a native object for that area.
      *
      * @param  size
      *         Number of bytes to allocate
      *
      * @param  pageAligned
-     *         If <tt>true</tt> then the area will be aligned on a hardware
+     *         If {@code true} then the area will be aligned on a hardware
      *         page boundary
      *
      * @throws OutOfMemoryError
--- a/jdk/src/java.base/share/conf/security/java.policy	Thu Apr 09 12:29:31 2015 +0200
+++ b/jdk/src/java.base/share/conf/security/java.policy	Mon Aug 17 12:45:16 2015 +0300
@@ -23,6 +23,14 @@
         permission java.security.AllPermission;
 };
 
+grant codeBase "jrt:/jdk.scripting.nashorn.shell" {
+        permission java.security.AllPermission;
+};
+
+grant codeBase "jrt:/jdk.internal.le" {
+        permission java.security.AllPermission;
+};
+
 grant codeBase "jrt:/jdk.crypto.ucrypto" {
         permission java.lang.RuntimePermission "accessClassInPackage.sun.security.*";
         permission java.lang.RuntimePermission "accessClassInPackage.sun.nio.ch";
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/src/java.base/share/native/libnio/nio_util.c	Mon Aug 17 12:45:16 2015 +0300
@@ -0,0 +1,40 @@
+/*
+ * Copyright (c) 2015, 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 "jni.h"
+#include "jvm.h"
+#include "jni_util.h"
+
+JNIEXPORT jint JNICALL
+JNI_OnLoad(JavaVM *vm, void *reserved)
+{
+    JNIEnv *env;
+
+    if ((*vm)->GetEnv(vm, (void**) &env, JNI_VERSION_1_2) != JNI_OK) {
+        return JNI_EVERSION; /* JNI version not supported */
+    }
+
+    return JNI_VERSION_1_2;
+}
--- a/jdk/src/java.base/unix/classes/sun/nio/fs/GnomeFileTypeDetector.java	Thu Apr 09 12:29:31 2015 +0200
+++ b/jdk/src/java.base/unix/classes/sun/nio/fs/GnomeFileTypeDetector.java	Mon Aug 17 12:45:16 2015 +0300
@@ -67,7 +67,7 @@
 
     // GIO
     private static native boolean initializeGio();
-    private static native byte[] probeGio(long pathAddress);
+    private static synchronized native byte[] probeGio(long pathAddress);
 
     static {
         AccessController.doPrivileged(new PrivilegedAction<>() {
--- a/jdk/src/java.base/unix/classes/sun/nio/fs/MimeTypesFileTypeDetector.java	Thu Apr 09 12:29:31 2015 +0200
+++ b/jdk/src/java.base/unix/classes/sun/nio/fs/MimeTypesFileTypeDetector.java	Mon Aug 17 12:45:16 2015 +0300
@@ -159,7 +159,7 @@
 
                 final String EXTEQUAL = "exts=";
                 String extRegex = "\\b" + EXTEQUAL +
-                        "(\"[\\p{Graph}|\\p{Blank}]+?\"|\\p{Graph}+\\b)";
+                        "(\"[\\p{Graph}\\p{Blank}]+?\"|\\p{Graph}+\\b)";
                 Pattern extPattern = Pattern.compile(extRegex);
                 Matcher extMatcher = extPattern.matcher(entry);
 
@@ -169,7 +169,7 @@
                     if (exts.charAt(0) == '"') {
                         exts = exts.substring(1, exts.length() - 1);
                     }
-                    String[] extList = exts.split("[\\p{Blank}|\\p{Punct}]+");
+                    String[] extList = exts.split("[\\p{Blank}\\p{Punct}]+");
                     for (String ext : extList) {
                         putIfAbsent(ext, type);
                     }
--- a/jdk/src/java.base/windows/native/libjava/WinNTFileSystem_md.c	Thu Apr 09 12:29:31 2015 +0200
+++ b/jdk/src/java.base/windows/native/libjava/WinNTFileSystem_md.c	Mon Aug 17 12:45:16 2015 +0300
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2015, 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
@@ -233,10 +233,13 @@
 
     if (GetFileAttributesExW(path, GetFileExInfoStandard, &wfad)) {
         attr = getFinalAttributesIfReparsePoint(path, wfad.dwFileAttributes);
-    } else if (GetLastError() == ERROR_SHARING_VIOLATION &&
-               (h = FindFirstFileW(path, &wfd)) != INVALID_HANDLE_VALUE) {
-        attr = getFinalAttributesIfReparsePoint(path, wfd.dwFileAttributes);
-        FindClose(h);
+    } else {
+        DWORD lerr = GetLastError();
+        if ((lerr == ERROR_SHARING_VIOLATION || lerr == ERROR_ACCESS_DENIED) &&
+            (h = FindFirstFileW(path, &wfd)) != INVALID_HANDLE_VALUE) {
+            attr = getFinalAttributesIfReparsePoint(path, wfd.dwFileAttributes);
+            FindClose(h);
+        }
     }
     return attr;
 }
--- a/jdk/src/java.desktop/macosx/native/libawt_lwawt/awt/CFRetainedResource.m	Thu Apr 09 12:29:31 2015 +0200
+++ b/jdk/src/java.desktop/macosx/native/libawt_lwawt/awt/CFRetainedResource.m	Mon Aug 17 12:45:16 2015 +0300
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2015, 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,10 +40,17 @@
     if (releaseOnAppKitThread) {
         // Releasing resources on the main AppKit message loop only
         // Releasing resources on the nested loops may cause dangling 
-        // pointers after the nested loop is exited 
-        [NSApp postRunnableEvent:^(){
-            CFRelease(jlong_to_ptr(ptr));
-        }];
+        // pointers after the nested loop is exited
+        if ([NSApp respondsToSelector:@selector(postRunnableEvent:)]) {
+            [NSApp postRunnableEvent:^() {
+                CFRelease(jlong_to_ptr(ptr));
+            }];
+        } else {
+            // could happen if we are embedded inside SWT/FX application,
+            [JNFRunLoop performOnMainThreadWaiting:NO withBlock:^() {
+                CFRelease(jlong_to_ptr(ptr));
+            }];
+        }
     } else {
 
 JNF_COCOA_ENTER(env);
--- a/jdk/src/java.desktop/share/classes/com/sun/beans/introspect/PropertyInfo.java	Thu Apr 09 12:29:31 2015 +0200
+++ b/jdk/src/java.desktop/share/classes/com/sun/beans/introspect/PropertyInfo.java	Mon Aug 17 12:45:16 2015 +0300
@@ -40,7 +40,7 @@
 import static com.sun.beans.finder.ClassFinder.findClass;
 
 public final class PropertyInfo {
-    public enum Name {bound, expert, hidden, preferred, visualUpdate, description, enumerationValues}
+    public enum Name {bound, expert, hidden, preferred, required, visualUpdate, description, enumerationValues}
 
     private static final String VETO_EXCEPTION_NAME = "java.beans.PropertyVetoException";
     private static final Class<?> VETO_EXCEPTION;
@@ -120,6 +120,7 @@
                     put(Name.bound, Boolean.FALSE);
                 }
                 put(Name.expert, annotation.expert());
+                put(Name.required, annotation.required());
                 put(Name.hidden, annotation.hidden());
                 put(Name.preferred, annotation.preferred());
                 put(Name.visualUpdate, annotation.visualUpdate());
--- a/jdk/src/java.desktop/share/classes/com/sun/media/sound/AiffFileReader.java	Thu Apr 09 12:29:31 2015 +0200
+++ b/jdk/src/java.desktop/share/classes/com/sun/media/sound/AiffFileReader.java	Mon Aug 17 12:45:16 2015 +0300
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2015, 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,19 +27,14 @@
 
 import java.io.DataInputStream;
 import java.io.DataOutputStream;
-import java.io.File;
-import java.io.FileInputStream;
 import java.io.IOException;
 import java.io.InputStream;
-import java.net.URL;
 
 import javax.sound.sampled.AudioFileFormat;
 import javax.sound.sampled.AudioFormat;
-import javax.sound.sampled.AudioInputStream;
 import javax.sound.sampled.AudioSystem;
 import javax.sound.sampled.UnsupportedAudioFileException;
 
-
 /**
  * AIFF file reader and writer.
  *
@@ -49,177 +44,10 @@
  */
 public final class AiffFileReader extends SunFileReader {
 
-    private static final int MAX_READ_LENGTH = 8;
-
-    // METHODS TO IMPLEMENT AudioFileReader
-
-    /**
-     * Obtains the audio file format of the input stream provided.  The stream must
-     * point to valid audio file data.  In general, audio file providers may
-     * need to read some data from the stream before determining whether they
-     * support it.  These parsers must
-     * be able to mark the stream, read enough data to determine whether they
-     * support the stream, and, if not, reset the stream's read pointer to its original
-     * position.  If the input stream does not support this, this method may fail
-     * with an IOException.
-     * @param stream the input stream from which file format information should be
-     * extracted
-     * @return an <code>AudioFileFormat</code> object describing the audio file format
-     * @throws UnsupportedAudioFileException if the stream does not point to valid audio
-     * file data recognized by the system
-     * @throws IOException if an I/O exception occurs
-     * @see InputStream#markSupported
-     * @see InputStream#mark
-     */
-    public AudioFileFormat getAudioFileFormat(InputStream stream) throws UnsupportedAudioFileException, IOException {
-        // fix for 4489272: AudioSystem.getAudioFileFormat() fails for InputStream, but works for URL
-        AudioFileFormat aff = getCOMM(stream, true);
-        // the following is not strictly necessary - but was implemented like that in 1.3.0 - 1.4.1
-        // so I leave it as it was. May remove this for 1.5.0
-        stream.reset();
-        return aff;
-    }
-
-
-    /**
-     * Obtains the audio file format of the URL provided.  The URL must
-     * point to valid audio file data.
-     * @param url the URL from which file format information should be
-     * extracted
-     * @return an <code>AudioFileFormat</code> object describing the audio file format
-     * @throws UnsupportedAudioFileException if the URL does not point to valid audio
-     * file data recognized by the system
-     * @throws IOException if an I/O exception occurs
-     */
-    public AudioFileFormat getAudioFileFormat(URL url) throws UnsupportedAudioFileException, IOException {
-        AudioFileFormat fileFormat = null;
-        InputStream urlStream = url.openStream();       // throws IOException
-        try {
-            fileFormat = getCOMM(urlStream, false);
-        } finally {
-            urlStream.close();
-        }
-        return fileFormat;
-    }
-
-
-    /**
-     * Obtains the audio file format of the File provided.  The File must
-     * point to valid audio file data.
-     * @param file the File from which file format information should be
-     * extracted
-     * @return an <code>AudioFileFormat</code> object describing the audio file format
-     * @throws UnsupportedAudioFileException if the File does not point to valid audio
-     * file data recognized by the system
-     * @throws IOException if an I/O exception occurs
-     */
-    public AudioFileFormat getAudioFileFormat(File file) throws UnsupportedAudioFileException, IOException {
-        AudioFileFormat fileFormat = null;
-        FileInputStream fis = new FileInputStream(file);       // throws IOException
-        // part of fix for 4325421
-        try {
-            fileFormat = getCOMM(fis, false);
-        } finally {
-            fis.close();
-        }
-
-        return fileFormat;
-    }
-
-
-
-
-    /**
-     * Obtains an audio stream from the input stream provided.  The stream must
-     * point to valid audio file data.  In general, audio file providers may
-     * need to read some data from the stream before determining whether they
-     * support it.  These parsers must
-     * be able to mark the stream, read enough data to determine whether they
-     * support the stream, and, if not, reset the stream's read pointer to its original
-     * position.  If the input stream does not support this, this method may fail
-     * with an IOException.
-     * @param stream the input stream from which the <code>AudioInputStream</code> should be
-     * constructed
-     * @return an <code>AudioInputStream</code> object based on the audio file data contained
-     * in the input stream.
-     * @throws UnsupportedAudioFileException if the stream does not point to valid audio
-     * file data recognized by the system
-     * @throws IOException if an I/O exception occurs
-     * @see InputStream#markSupported
-     * @see InputStream#mark
-     */
-    public AudioInputStream getAudioInputStream(InputStream stream) throws UnsupportedAudioFileException, IOException {
-        // getCOMM leaves the input stream at the beginning of the audio data
-        AudioFileFormat fileFormat = getCOMM(stream, true);     // throws UnsupportedAudioFileException, IOException
-
-        // we've got everything, and the stream is at the
-        // beginning of the audio data, so return an AudioInputStream.
-        return new AudioInputStream(stream, fileFormat.getFormat(), fileFormat.getFrameLength());
-    }
-
-
-    /**
-     * Obtains an audio stream from the URL provided.  The URL must
-     * point to valid audio file data.
-     * @param url the URL for which the <code>AudioInputStream</code> should be
-     * constructed
-     * @return an <code>AudioInputStream</code> object based on the audio file data pointed
-     * to by the URL
-     * @throws UnsupportedAudioFileException if the URL does not point to valid audio
-     * file data recognized by the system
-     * @throws IOException if an I/O exception occurs
-     */
-    public AudioInputStream getAudioInputStream(URL url) throws UnsupportedAudioFileException, IOException {
-        InputStream urlStream = url.openStream();  // throws IOException
-        AudioFileFormat fileFormat = null;
-        try {
-            fileFormat = getCOMM(urlStream, false);
-        } finally {
-            if (fileFormat == null) {
-                urlStream.close();
-            }
-        }
-        return new AudioInputStream(urlStream, fileFormat.getFormat(), fileFormat.getFrameLength());
-    }
-
-
-    /**
-     * Obtains an audio stream from the File provided.  The File must
-     * point to valid audio file data.
-     * @param file the File for which the <code>AudioInputStream</code> should be
-     * constructed
-     * @return an <code>AudioInputStream</code> object based on the audio file data pointed
-     * to by the File
-     * @throws UnsupportedAudioFileException if the File does not point to valid audio
-     * file data recognized by the system
-     * @throws IOException if an I/O exception occurs
-     */
-    public AudioInputStream getAudioInputStream(File file)
-        throws UnsupportedAudioFileException, IOException {
-
-        FileInputStream fis = new FileInputStream(file); // throws IOException
-        AudioFileFormat fileFormat = null;
-        // part of fix for 4325421
-        try {
-            fileFormat = getCOMM(fis, false);
-        } finally {
-            if (fileFormat == null) {
-                fis.close();
-            }
-        }
-        return new AudioInputStream(fis, fileFormat.getFormat(), fileFormat.getFrameLength());
-    }
-
-    //--------------------------------------------------------------------
-
-    private AudioFileFormat getCOMM(InputStream is, boolean doReset)
-        throws UnsupportedAudioFileException, IOException {
-
-        DataInputStream dis = new DataInputStream(is);
-
-        if (doReset) {
-            dis.mark(MAX_READ_LENGTH);
-        }
+    @Override
+    AudioFileFormat getAudioFileFormatImpl(final InputStream stream)
+            throws UnsupportedAudioFileException, IOException {
+        DataInputStream dis = new DataInputStream(stream);
 
         // assumes a stream at the beginning of the file which has already
         // passed the magic number test...
@@ -234,9 +62,6 @@
         // $$fb: fix for 4369044: javax.sound.sampled.AudioSystem.getAudioInputStream() works wrong with Cp037
         if (magic != AiffFileFormat.AIFF_MAGIC) {
             // not AIFF, throw exception
-            if (doReset) {
-                dis.reset();
-            }
             throw new UnsupportedAudioFileException("not an AIFF file");
         }
 
--- a/jdk/src/java.desktop/share/classes/com/sun/media/sound/AuFileReader.java	Thu Apr 09 12:29:31 2015 +0200
+++ b/jdk/src/java.desktop/share/classes/com/sun/media/sound/AuFileReader.java	Mon Aug 17 12:45:16 2015 +0300
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2015, 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
@@ -25,21 +25,15 @@
 
 package com.sun.media.sound;
 
-import java.io.BufferedInputStream;
 import java.io.DataInputStream;
-import java.io.File;
-import java.io.FileInputStream;
 import java.io.IOException;
 import java.io.InputStream;
-import java.net.URL;
 
 import javax.sound.sampled.AudioFileFormat;
 import javax.sound.sampled.AudioFormat;
-import javax.sound.sampled.AudioInputStream;
 import javax.sound.sampled.AudioSystem;
 import javax.sound.sampled.UnsupportedAudioFileException;
 
-
 /**
  * AU file reader.
  *
@@ -49,33 +43,10 @@
  */
 public final class AuFileReader extends SunFileReader {
 
-    // METHODS TO IMPLEMENT AudioFileReader
-
-    /**
-     * Obtains the audio file format of the input stream provided.  The stream must
-     * point to valid audio file data.  In general, audio file providers may
-     * need to read some data from the stream before determining whether they
-     * support it.  These parsers must
-     * be able to mark the stream, read enough data to determine whether they
-     * support the stream, and, if not, reset the stream's read pointer to its original
-     * position.  If the input stream does not support this, this method may fail
-     * with an IOException.
-     * @param stream the input stream from which file format information should be
-     * extracted
-     * @return an <code>AudioFileFormat</code> object describing the audio file format
-     * @throws UnsupportedAudioFileException if the stream does not point to valid audio
-     * file data recognized by the system
-     * @throws IOException if an I/O exception occurs
-     * @see InputStream#markSupported
-     * @see InputStream#mark
-     */
-    public AudioFileFormat getAudioFileFormat(InputStream stream) throws UnsupportedAudioFileException, IOException {
-
-        AudioFormat format = null;
-        AuFileFormat fileFormat = null;
-        int maxReadLength = 28;
+    @Override
+    public AudioFileFormat getAudioFileFormatImpl(final InputStream stream)
+            throws UnsupportedAudioFileException, IOException {
         boolean bigendian  = false;
-        int magic          = -1;
         int headerSize     = -1;
         int dataSize       = -1;
         int encoding_local = -1;
@@ -90,15 +61,12 @@
 
         DataInputStream dis = new DataInputStream( stream );
 
-        dis.mark(maxReadLength);
-
-        magic = dis.readInt();
+        final int magic = dis.readInt(); nread += 4;
 
         if (! (magic == AuFileFormat.AU_SUN_MAGIC) || (magic == AuFileFormat.AU_DEC_MAGIC) ||
             (magic == AuFileFormat.AU_SUN_INV_MAGIC) || (magic == AuFileFormat.AU_DEC_INV_MAGIC) ) {
 
-            // not AU, reset the stream, place into exception, throw exception
-            dis.reset();
+            // not AU, throw exception
             throw new UnsupportedAudioFileException("not an AU file");
         }
 
@@ -112,7 +80,6 @@
         sampleRate     = (bigendian==true ? dis.readInt() : rllong(dis) );  nread += 4;
         channels       = (bigendian==true ? dis.readInt() : rllong(dis) );  nread += 4;
         if (channels <= 0) {
-            dis.reset();
             throw new UnsupportedAudioFileException("Invalid number of channels");
         }
 
@@ -172,7 +139,6 @@
             */
         default:
                 // unsupported filetype, throw exception
-                dis.reset();
                 throw new UnsupportedAudioFileException("not a valid AU file");
         }
 
@@ -184,189 +150,13 @@
             //$$fb 2003-10-20: fix for 4940459: AudioInputStream.getFrameLength() returns 0 instead of NOT_SPECIFIED
             length = dataSize / frameSize;
         }
-
-        format = new AudioFormat( encoding, (float)sampleRate, sampleSizeInBits,
-                                  channels, frameSize, (float)frameRate, bigendian);
-
-        fileFormat = new AuFileFormat( AudioFileFormat.Type.AU, dataSize+headerSize,
-                                       format, length);
-
-        dis.reset(); // Throws IOException
-        return fileFormat;
-
-    }
-
-
-    /**
-     * Obtains the audio file format of the URL provided.  The URL must
-     * point to valid audio file data.
-     * @param url the URL from which file format information should be
-     * extracted
-     * @return an <code>AudioFileFormat</code> object describing the audio file format
-     * @throws UnsupportedAudioFileException if the URL does not point to valid audio
-     * file data recognized by the system
-     * @throws IOException if an I/O exception occurs
-     */
-    public AudioFileFormat getAudioFileFormat(URL url) throws UnsupportedAudioFileException, IOException {
-
-        InputStream                             urlStream = null;
-        BufferedInputStream             bis = null;
-        AudioFileFormat                 fileFormat = null;
-        AudioFormat                             format = null;
-
-        urlStream = url.openStream();   // throws IOException
-
-        try {
-            bis = new BufferedInputStream( urlStream, bisBufferSize );
-
-            fileFormat = getAudioFileFormat( bis );             // throws UnsupportedAudioFileException
-        } finally {
-            urlStream.close();
-        }
-
-        return fileFormat;
-    }
-
-
-    /**
-     * Obtains the audio file format of the File provided.  The File must
-     * point to valid audio file data.
-     * @param file the File from which file format information should be
-     * extracted
-     * @return an <code>AudioFileFormat</code> object describing the audio file format
-     * @throws UnsupportedAudioFileException if the File does not point to valid audio
-     * file data recognized by the system
-     * @throws IOException if an I/O exception occurs
-     */
-    public AudioFileFormat getAudioFileFormat(File file) throws UnsupportedAudioFileException, IOException {
-
-        FileInputStream                 fis = null;
-        BufferedInputStream             bis = null;
-        AudioFileFormat                 fileFormat = null;
-        AudioFormat                             format = null;
-
-        fis = new FileInputStream( file );      // throws IOException
-        // part of fix for 4325421
-        try {
-            bis = new BufferedInputStream( fis, bisBufferSize );
-            fileFormat = getAudioFileFormat( bis );             // throws UnsupportedAudioFileException
-        } finally {
-            fis.close();
-        }
-
-        return fileFormat;
-    }
-
-
-    /**
-     * Obtains an audio stream from the input stream provided.  The stream must
-     * point to valid audio file data.  In general, audio file providers may
-     * need to read some data from the stream before determining whether they
-     * support it.  These parsers must
-     * be able to mark the stream, read enough data to determine whether they
-     * support the stream, and, if not, reset the stream's read pointer to its original
-     * position.  If the input stream does not support this, this method may fail
-     * with an IOException.
-     * @param stream the input stream from which the <code>AudioInputStream</code> should be
-     * constructed
-     * @return an <code>AudioInputStream</code> object based on the audio file data contained
-     * in the input stream.
-     * @throws UnsupportedAudioFileException if the stream does not point to valid audio
-     * file data recognized by the system
-     * @throws IOException if an I/O exception occurs
-     * @see InputStream#markSupported
-     * @see InputStream#mark
-     */
-    public AudioInputStream getAudioInputStream(InputStream stream) throws UnsupportedAudioFileException, IOException {
-
-        DataInputStream dis = null;
-        int headerSize;
-        AudioFileFormat fileFormat = null;
-        AudioFormat format = null;
-
-
-        fileFormat = getAudioFileFormat( stream ); // throws UnsupportedAudioFileException, IOException
-
-        // if we passed this call, we have an AU file.
-
-        format = fileFormat.getFormat();
-
-        dis = new DataInputStream(stream);
-
         // now seek past the header
-
-        dis.readInt(); // magic
-        headerSize     = (format.isBigEndian()==true ? dis.readInt() : rllong(dis) );
-        dis.skipBytes( headerSize - 8 );
-
-
-        // we've got everything, and the stream should be at the
-        // beginning of the data chunk, so return an AudioInputStream.
-
-        return new AudioInputStream(dis, format, fileFormat.getFrameLength());
-    }
-
-
-    /**
-     * Obtains an audio stream from the URL provided.  The URL must
-     * point to valid audio file data.
-     * @param url the URL for which the <code>AudioInputStream</code> should be
-     * constructed
-     * @return an <code>AudioInputStream</code> object based on the audio file data pointed
-     * to by the URL
-     * @throws UnsupportedAudioFileException if the URL does not point to valid audio
-     * file data recognized by the system
-     * @throws IOException if an I/O exception occurs
-     */
-    public AudioInputStream getAudioInputStream(URL url) throws UnsupportedAudioFileException, IOException {
-
-        InputStream                             urlStream = null;
-        BufferedInputStream             bis = null;
-        AudioFileFormat                 fileFormat = null;
-
-        urlStream = url.openStream();   // throws IOException
-        AudioInputStream result = null;
-        try {
-            bis = new BufferedInputStream( urlStream, bisBufferSize );
-            result = getAudioInputStream( (InputStream)bis );
-        } finally {
-            if (result == null) {
-                urlStream.close();
-            }
-        }
-        return result;
-    }
-
-
-    /**
-     * Obtains an audio stream from the File provided.  The File must
-     * point to valid audio file data.
-     * @param file the File for which the <code>AudioInputStream</code> should be
-     * constructed
-     * @return an <code>AudioInputStream</code> object based on the audio file data pointed
-     * to by the File
-     * @throws UnsupportedAudioFileException if the File does not point to valid audio
-     * file data recognized by the system
-     * @throws IOException if an I/O exception occurs
-     */
-    public AudioInputStream getAudioInputStream(File file) throws UnsupportedAudioFileException, IOException {
-
-        FileInputStream                 fis = null;
-        BufferedInputStream             bis = null;
-        AudioFileFormat                 fileFormat = null;
-
-        fis = new FileInputStream( file );      // throws IOException
-        AudioInputStream result = null;
-        // part of fix for 4325421
-        try {
-            bis = new BufferedInputStream( fis, bisBufferSize );
-            result = getAudioInputStream( (InputStream)bis );
-        } finally {
-            if (result == null) {
-                fis.close();
-            }
-        }
-
-        return result;
+        dis.skipBytes(headerSize - nread);
+        AudioFormat format = new AudioFormat(encoding, sampleRate,
+                                             sampleSizeInBits, channels,
+                                             frameSize, (float) frameRate,
+                                             bigendian);
+        return new AuFileFormat(AudioFileFormat.Type.AU, dataSize + headerSize,
+                                format, length);
     }
 }
--- a/jdk/src/java.desktop/share/classes/com/sun/media/sound/SunFileReader.java	Thu Apr 09 12:29:31 2015 +0200
+++ b/jdk/src/java.desktop/share/classes/com/sun/media/sound/SunFileReader.java	Mon Aug 17 12:45:16 2015 +0300
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2015, 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
@@ -25,10 +25,12 @@
 
 package com.sun.media.sound;
 
+import java.io.BufferedInputStream;
+import java.io.DataInputStream;
 import java.io.File;
+import java.io.FileInputStream;
+import java.io.IOException;
 import java.io.InputStream;
-import java.io.IOException;
-import java.io.DataInputStream;
 import java.net.URL;
 
 import javax.sound.sampled.AudioFileFormat;
@@ -36,8 +38,6 @@
 import javax.sound.sampled.UnsupportedAudioFileException;
 import javax.sound.sampled.spi.AudioFileReader;
 
-
-
 /**
  * Abstract File Reader class.
  *
@@ -45,118 +45,109 @@
  */
 abstract class SunFileReader extends AudioFileReader {
 
-    // buffer size for temporary input streams
-    protected static final int bisBufferSize = 4096;
+    @Override
+    public final AudioFileFormat getAudioFileFormat(final InputStream stream)
+            throws UnsupportedAudioFileException, IOException {
+        stream.mark(200); // The biggest value which was historically used
+        try {
+            return getAudioFileFormatImpl(stream);
+        } finally {
+            // According to specification the following is not strictly
+            // necessary, if we got correct format. But it was implemented like
+            // that in 1.3.0 - 1.8. So I leave it as it was, but it seems
+            // specification should be updated.
+            stream.reset();
+        }
+    }
 
-    /**
-     * Constructs a new SunFileReader object.
-     */
-    SunFileReader() {
+    @Override
+    public final AudioFileFormat getAudioFileFormat(final URL url)
+            throws UnsupportedAudioFileException, IOException {
+        try (InputStream is = url.openStream()) {
+            return getAudioFileFormatImpl(new BufferedInputStream(is));
+        }
+    }
+
+    @Override
+    public final AudioFileFormat getAudioFileFormat(final File file)
+            throws UnsupportedAudioFileException, IOException {
+        try (InputStream is = new FileInputStream(file)) {
+            return getAudioFileFormatImpl(new BufferedInputStream(is));
+        }
     }
 
-
-    // METHODS TO IMPLEMENT AudioFileReader
+    @Override
+    public AudioInputStream getAudioInputStream(final InputStream stream)
+            throws UnsupportedAudioFileException, IOException {
+        stream.mark(200); // The biggest value which was historically used
+        try {
+            final AudioFileFormat fileFormat = getAudioFileFormatImpl(stream);
+            // we've got everything, the stream is supported and it is at the
+            // beginning of the audio data, so return an AudioInputStream
+            return new AudioInputStream(stream, fileFormat.getFormat(),
+                                        fileFormat.getFrameLength());
+        } catch (final UnsupportedAudioFileException e) {
+            stream.reset();
+            throw e;
+        }
+    }
 
-    /**
-     * Obtains the audio file format of the input stream provided.  The stream must
-     * point to valid audio file data.  In general, audio file providers may
-     * need to read some data from the stream before determining whether they
-     * support it.  These parsers must
-     * be able to mark the stream, read enough data to determine whether they
-     * support the stream, and, if not, reset the stream's read pointer to its original
-     * position.  If the input stream does not support this, this method may fail
-     * with an IOException.
-     * @param stream the input stream from which file format information should be
-     * extracted
-     * @return an <code>AudioFileFormat</code> object describing the audio file format
-     * @throws UnsupportedAudioFileException if the stream does not point to valid audio
-     * file data recognized by the system
-     * @throws IOException if an I/O exception occurs
-     * @see InputStream#markSupported
-     * @see InputStream#mark
-     */
-    abstract public AudioFileFormat getAudioFileFormat(InputStream stream) throws UnsupportedAudioFileException, IOException;
+    @Override
+    public final AudioInputStream getAudioInputStream(final URL url)
+            throws UnsupportedAudioFileException, IOException {
+        final InputStream urlStream = url.openStream();
+        try {
+            return getAudioInputStream(new BufferedInputStream(urlStream));
+        } catch (final Throwable e) {
+            closeSilently(urlStream);
+            throw e;
+        }
+    }
 
-
-    /**
-     * Obtains the audio file format of the URL provided.  The URL must
-     * point to valid audio file data.
-     * @param url the URL from which file format information should be
-     * extracted
-     * @return an <code>AudioFileFormat</code> object describing the audio file format
-     * @throws UnsupportedAudioFileException if the URL does not point to valid audio
-     * file data recognized by the system
-     * @throws IOException if an I/O exception occurs
-     */
-    abstract public AudioFileFormat getAudioFileFormat(URL url) throws UnsupportedAudioFileException, IOException;
-
+    @Override
+    public final AudioInputStream getAudioInputStream(final File file)
+            throws UnsupportedAudioFileException, IOException {
+        final InputStream fileStream = new FileInputStream(file);
+        try {
+            return getAudioInputStream(new BufferedInputStream(fileStream));
+        } catch (final Throwable e) {
+            closeSilently(fileStream);
+            throw e;
+        }
+    }
 
     /**
-     * Obtains the audio file format of the File provided.  The File must
-     * point to valid audio file data.
-     * @param file the File from which file format information should be
-     * extracted
-     * @return an <code>AudioFileFormat</code> object describing the audio file format
-     * @throws UnsupportedAudioFileException if the File does not point to valid audio
-     * file data recognized by the system
+     * Obtains the audio file format of the input stream provided. The stream
+     * must point to valid audio file data. Note that default implementation of
+     * {@link #getAudioInputStream(InputStream)} assume that this method leaves
+     * the input stream at the beginning of the audio data.
+     *
+     * @param  stream the input stream from which file format information should
+     *         be extracted
+     * @return an {@code AudioFileFormat} object describing the audio file
+     *         format
+     * @throws UnsupportedAudioFileException if the stream does not point to
+     *         valid audio file data recognized by the system
      * @throws IOException if an I/O exception occurs
      */
-    abstract public AudioFileFormat getAudioFileFormat(File file) throws UnsupportedAudioFileException, IOException;
-
-
-    /**
-     * Obtains an audio stream from the input stream provided.  The stream must
-     * point to valid audio file data.  In general, audio file providers may
-     * need to read some data from the stream before determining whether they
-     * support it.  These parsers must
-     * be able to mark the stream, read enough data to determine whether they
-     * support the stream, and, if not, reset the stream's read pointer to its original
-     * position.  If the input stream does not support this, this method may fail
-     * with an IOException.
-     * @param stream the input stream from which the <code>AudioInputStream</code> should be
-     * constructed
-     * @return an <code>AudioInputStream</code> object based on the audio file data contained
-     * in the input stream.
-     * @throws UnsupportedAudioFileException if the stream does not point to valid audio
-     * file data recognized by the system
-     * @throws IOException if an I/O exception occurs
-     * @see InputStream#markSupported
-     * @see InputStream#mark
-     */
-    abstract public AudioInputStream getAudioInputStream(InputStream stream) throws UnsupportedAudioFileException, IOException;
-
-
-    /**
-     * Obtains an audio stream from the URL provided.  The URL must
-     * point to valid audio file data.
-     * @param url the URL for which the <code>AudioInputStream</code> should be
-     * constructed
-     * @return an <code>AudioInputStream</code> object based on the audio file data pointed
-     * to by the URL
-     * @throws UnsupportedAudioFileException if the URL does not point to valid audio
-     * file data recognized by the system
-     * @throws IOException if an I/O exception occurs
-     */
-    abstract public AudioInputStream getAudioInputStream(URL url) throws UnsupportedAudioFileException, IOException;
-
-
-    /**
-     * Obtains an audio stream from the File provided.  The File must
-     * point to valid audio file data.
-     * @param file the File for which the <code>AudioInputStream</code> should be
-     * constructed
-     * @return an <code>AudioInputStream</code> object based on the audio file data pointed
-     * to by the File
-     * @throws UnsupportedAudioFileException if the File does not point to valid audio
-     * file data recognized by the system
-     * @throws IOException if an I/O exception occurs
-     */
-    abstract public AudioInputStream getAudioInputStream(File file) throws UnsupportedAudioFileException, IOException;
-
+    abstract AudioFileFormat getAudioFileFormatImpl(InputStream stream)
+            throws UnsupportedAudioFileException, IOException;
 
     // HELPER METHODS
 
-
+    /**
+     * Closes the InputStream when we have read all necessary data from it, and
+     * ignores an IOException.
+     *
+     * @param is the InputStream which should be closed
+     */
+    private static void closeSilently(final InputStream is) {
+        try {
+            is.close();
+        } catch (final IOException ignored) {
+            // IOException is ignored
+        }
+    }
 
     /**
      * rllong
--- a/jdk/src/java.desktop/share/classes/com/sun/media/sound/WaveExtensibleFileReader.java	Thu Apr 09 12:29:31 2015 +0200
+++ b/jdk/src/java.desktop/share/classes/com/sun/media/sound/WaveExtensibleFileReader.java	Mon Aug 17 12:45:16 2015 +0300
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2007, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2007, 2015, 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
@@ -22,55 +22,40 @@
  * or visit www.oracle.com if you need additional information or have any
  * questions.
  */
+
 package com.sun.media.sound;
 
-import java.io.BufferedInputStream;
-import java.io.File;
-import java.io.FileInputStream;
 import java.io.IOException;
 import java.io.InputStream;
-import java.net.URL;
 import java.util.HashMap;
 import java.util.Map;
 
 import javax.sound.sampled.AudioFileFormat;
 import javax.sound.sampled.AudioFormat;
+import javax.sound.sampled.AudioFormat.Encoding;
 import javax.sound.sampled.AudioInputStream;
 import javax.sound.sampled.AudioSystem;
 import javax.sound.sampled.UnsupportedAudioFileException;
-import javax.sound.sampled.AudioFormat.Encoding;
-import javax.sound.sampled.spi.AudioFileReader;
 
 /**
  * WAVE file reader for files using format WAVE_FORMAT_EXTENSIBLE (0xFFFE).
  *
  * @author Karl Helgason
  */
-public final class WaveExtensibleFileReader extends AudioFileReader {
-
-    static private class GUID {
-        long i1;
-
-        int s1;
-
-        int s2;
-
-        int x1;
-
-        int x2;
+public final class WaveExtensibleFileReader extends SunFileReader {
 
-        int x3;
-
-        int x4;
-
-        int x5;
-
-        int x6;
-
-        int x7;
-
-        int x8;
-
+    private static class GUID {
+        private long i1;
+        private int s1;
+        private int s2;
+        private int x1;
+        private int x2;
+        private int x3;
+        private int x4;
+        private int x5;
+        private int x6;
+        private int x7;
+        private int x8;
         private GUID() {
         }
 
@@ -105,10 +90,12 @@
             return d;
         }
 
+        @Override
         public int hashCode() {
             return (int) i1;
         }
 
+        @Override
         public boolean equals(Object obj) {
             if (!(obj instanceof GUID))
                 return false;
@@ -161,7 +148,7 @@
     private static final GUID SUBTYPE_IEEE_FLOAT = new GUID(0x00000003, 0x0000,
             0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71);
 
-    private String decodeChannelMask(long channelmask) {
+    private static String decodeChannelMask(long channelmask) {
         StringBuilder sb = new StringBuilder();
         long m = 1;
         for (int i = 0; i < allchannelnames.length; i++) {
@@ -180,20 +167,8 @@
 
     }
 
-    public AudioFileFormat getAudioFileFormat(InputStream stream)
-            throws UnsupportedAudioFileException, IOException {
-
-        stream.mark(200);
-        AudioFileFormat format;
-        try {
-            format = internal_getAudioFileFormat(stream);
-        } finally {
-            stream.reset();
-        }
-        return format;
-    }
-
-    private AudioFileFormat internal_getAudioFileFormat(InputStream stream)
+    @Override
+    AudioFileFormat getAudioFileFormatImpl(final InputStream stream)
             throws UnsupportedAudioFileException, IOException {
 
         RIFFReader riffiterator = new RIFFReader(stream);
@@ -244,12 +219,9 @@
                 break;
             }
         }
-
-        if (!fmt_found)
+        if (!fmt_found || !data_found) {
             throw new UnsupportedAudioFileException();
-        if (!data_found)
-            throw new UnsupportedAudioFileException();
-
+        }
         Map<String, Object> p = new HashMap<String, Object>();
         String s_channelmask = decodeChannelMask(channelMask);
         if (s_channelmask != null)
@@ -273,24 +245,22 @@
         } else if (subFormat.equals(SUBTYPE_IEEE_FLOAT)) {
             audioformat = new AudioFormat(Encoding.PCM_FLOAT,
                     samplerate, bits, channels, framesize, samplerate, false, p);
-        } else
+        } else {
             throw new UnsupportedAudioFileException();
-
-        AudioFileFormat fileformat = new AudioFileFormat(
-                AudioFileFormat.Type.WAVE, audioformat,
-                AudioSystem.NOT_SPECIFIED);
-        return fileformat;
+        }
+        return new AudioFileFormat(AudioFileFormat.Type.WAVE, audioformat,
+                                   AudioSystem.NOT_SPECIFIED);
     }
 
-    public AudioInputStream getAudioInputStream(InputStream stream)
+    @Override
+    public AudioInputStream getAudioInputStream(final InputStream stream)
             throws UnsupportedAudioFileException, IOException {
 
         AudioFileFormat format = getAudioFileFormat(stream);
+        // we've got everything, the stream is supported and it is at the
+        // beginning of the header, so find the data chunk again and return an
+        // AudioInputStream
         RIFFReader riffiterator = new RIFFReader(stream);
-        if (!riffiterator.getFormat().equals("RIFF"))
-            throw new UnsupportedAudioFileException();
-        if (!riffiterator.getType().equals("WAVE"))
-            throw new UnsupportedAudioFileException();
         while (riffiterator.hasNextChunk()) {
             RIFFReader chunk = riffiterator.nextChunk();
             if (chunk.getFormat().equals("data")) {
@@ -300,40 +270,4 @@
         }
         throw new UnsupportedAudioFileException();
     }
-
-    public AudioFileFormat getAudioFileFormat(URL url)
-            throws UnsupportedAudioFileException, IOException {
-        InputStream stream = url.openStream();
-        AudioFileFormat format;
-        try {
-            format = getAudioFileFormat(new BufferedInputStream(stream));
-        } finally {
-            stream.close();
-        }
-        return format;
-    }
-
-    public AudioFileFormat getAudioFileFormat(File file)
-            throws UnsupportedAudioFileException, IOException {
-        InputStream stream = new FileInputStream(file);
-        AudioFileFormat format;
-        try {
-            format = getAudioFileFormat(new BufferedInputStream(stream));
-        } finally {
-            stream.close();
-        }
-        return format;
-    }
-
-    public AudioInputStream getAudioInputStream(URL url)
-            throws UnsupportedAudioFileException, IOException {
-        return getAudioInputStream(new BufferedInputStream(url.openStream()));
-    }
-
-    public AudioInputStream getAudioInputStream(File file)
-            throws UnsupportedAudioFileException, IOException {
-        return getAudioInputStream(new BufferedInputStream(new FileInputStream(
-                file)));
-    }
-
 }
--- a/jdk/src/java.desktop/share/classes/com/sun/media/sound/WaveFileReader.java	Thu Apr 09 12:29:31 2015 +0200
+++ b/jdk/src/java.desktop/share/classes/com/sun/media/sound/WaveFileReader.java	Mon Aug 17 12:45:16 2015 +0300
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2015, 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,20 +27,14 @@
 
 import java.io.DataInputStream;
 import java.io.EOFException;
-import java.io.File;
-import java.io.FileInputStream;
 import java.io.IOException;
 import java.io.InputStream;
-import java.net.URL;
 
 import javax.sound.sampled.AudioFileFormat;
 import javax.sound.sampled.AudioFormat;
-import javax.sound.sampled.AudioInputStream;
 import javax.sound.sampled.AudioSystem;
 import javax.sound.sampled.UnsupportedAudioFileException;
 
-
-
 /**
  * WAVE file reader.
  *
@@ -50,170 +44,12 @@
  */
 public final class WaveFileReader extends SunFileReader {
 
-    private static final int MAX_READ_LENGTH = 12;
-
-    /**
-     * Obtains the audio file format of the input stream provided.  The stream must
-     * point to valid audio file data.  In general, audio file providers may
-     * need to read some data from the stream before determining whether they
-     * support it.  These parsers must
-     * be able to mark the stream, read enough data to determine whether they
-     * support the stream, and, if not, reset the stream's read pointer to its original
-     * position.  If the input stream does not support this, this method may fail
-     * with an IOException.
-     * @param stream the input stream from which file format information should be
-     * extracted
-     * @return an <code>AudioFileFormat</code> object describing the audio file format
-     * @throws UnsupportedAudioFileException if the stream does not point to valid audio
-     * file data recognized by the system
-     * @throws IOException if an I/O exception occurs
-     * @see InputStream#markSupported
-     * @see InputStream#mark
-     */
-    public AudioFileFormat getAudioFileFormat(InputStream stream) throws UnsupportedAudioFileException, IOException {
-        // fix for 4489272: AudioSystem.getAudioFileFormat() fails for InputStream, but works for URL
-        AudioFileFormat aff = getFMT(stream, true);
-        // the following is not strictly necessary - but was implemented like that in 1.3.0 - 1.4.1
-        // so I leave it as it was. May remove this for 1.5.0
-        stream.reset();
-        return aff;
-    }
-
-
-    /**
-     * Obtains the audio file format of the URL provided.  The URL must
-     * point to valid audio file data.
-     * @param url the URL from which file format information should be
-     * extracted
-     * @return an <code>AudioFileFormat</code> object describing the audio file format
-     * @throws UnsupportedAudioFileException if the URL does not point to valid audio
-     * file data recognized by the system
-     * @throws IOException if an I/O exception occurs
-     */
-    public AudioFileFormat getAudioFileFormat(URL url) throws UnsupportedAudioFileException, IOException {
-        InputStream urlStream = url.openStream(); // throws IOException
-        AudioFileFormat fileFormat = null;
-        try {
-            fileFormat = getFMT(urlStream, false);
-        } finally {
-            urlStream.close();
-        }
-        return fileFormat;
-    }
-
-
-    /**
-     * Obtains the audio file format of the File provided.  The File must
-     * point to valid audio file data.
-     * @param file the File from which file format information should be
-     * extracted
-     * @return an <code>AudioFileFormat</code> object describing the audio file format
-     * @throws UnsupportedAudioFileException if the File does not point to valid audio
-     * file data recognized by the system
-     * @throws IOException if an I/O exception occurs
-     */
-    public AudioFileFormat getAudioFileFormat(File file) throws UnsupportedAudioFileException, IOException {
-        AudioFileFormat fileFormat = null;
-        FileInputStream fis = new FileInputStream(file);       // throws IOException
-        // part of fix for 4325421
-        try {
-            fileFormat = getFMT(fis, false);
-        } finally {
-            fis.close();
-        }
-
-        return fileFormat;
-    }
-
-
-    /**
-     * Obtains an audio stream from the input stream provided.  The stream must
-     * point to valid audio file data.  In general, audio file providers may
-     * need to read some data from the stream before determining whether they
-     * support it.  These parsers must
-     * be able to mark the stream, read enough data to determine whether they
-     * support the stream, and, if not, reset the stream's read pointer to its original
-     * position.  If the input stream does not support this, this method may fail
-     * with an IOException.
-     * @param stream the input stream from which the <code>AudioInputStream</code> should be
-     * constructed
-     * @return an <code>AudioInputStream</code> object based on the audio file data contained
-     * in the input stream.
-     * @throws UnsupportedAudioFileException if the stream does not point to valid audio
-     * file data recognized by the system
-     * @throws IOException if an I/O exception occurs
-     * @see InputStream#markSupported
-     * @see InputStream#mark
-     */
-    public AudioInputStream getAudioInputStream(InputStream stream) throws UnsupportedAudioFileException, IOException {
-        // getFMT leaves the input stream at the beginning of the audio data
-        AudioFileFormat fileFormat = getFMT(stream, true); // throws UnsupportedAudioFileException, IOException
-
-        // we've got everything, and the stream is at the
-        // beginning of the audio data, so return an AudioInputStream.
-        return new AudioInputStream(stream, fileFormat.getFormat(), fileFormat.getFrameLength());
-    }
-
-
-    /**
-     * Obtains an audio stream from the URL provided.  The URL must
-     * point to valid audio file data.
-     * @param url the URL for which the <code>AudioInputStream</code> should be
-     * constructed
-     * @return an <code>AudioInputStream</code> object based on the audio file data pointed
-     * to by the URL
-     * @throws UnsupportedAudioFileException if the URL does not point to valid audio
-     * file data recognized by the system
-     * @throws IOException if an I/O exception occurs
-     */
-    public AudioInputStream getAudioInputStream(URL url) throws UnsupportedAudioFileException, IOException {
-        InputStream urlStream = url.openStream();  // throws IOException
-        AudioFileFormat fileFormat = null;
-        try {
-            fileFormat = getFMT(urlStream, false);
-        } finally {
-            if (fileFormat == null) {
-                urlStream.close();
-            }
-        }
-        return new AudioInputStream(urlStream, fileFormat.getFormat(), fileFormat.getFrameLength());
-    }
-
-
-    /**
-     * Obtains an audio stream from the File provided.  The File must
-     * point to valid audio file data.
-     * @param file the File for which the <code>AudioInputStream</code> should be
-     * constructed
-     * @return an <code>AudioInputStream</code> object based on the audio file data pointed
-     * to by the File
-     * @throws UnsupportedAudioFileException if the File does not point to valid audio
-     * file data recognized by the system
-     * @throws IOException if an I/O exception occurs
-     */
-    public AudioInputStream getAudioInputStream(File file) throws UnsupportedAudioFileException, IOException {
-        FileInputStream fis = new FileInputStream(file); // throws IOException
-        AudioFileFormat fileFormat = null;
-        // part of fix for 4325421
-        try {
-            fileFormat = getFMT(fis, false);
-        } finally {
-            if (fileFormat == null) {
-                fis.close();
-            }
-        }
-        return new AudioInputStream(fis, fileFormat.getFormat(), fileFormat.getFrameLength());
-    }
-
-
-    //--------------------------------------------------------------------
-
-
-    private AudioFileFormat getFMT(InputStream stream, boolean doReset) throws UnsupportedAudioFileException, IOException {
+    @Override
+    AudioFileFormat getAudioFileFormatImpl(final InputStream stream)
+            throws UnsupportedAudioFileException, IOException {
 
         // assumes sream is rewound
 
-        int bytesRead;
         int nread = 0;
         int fmt;
         int length = 0;
@@ -227,10 +63,6 @@
 
         DataInputStream dis = new DataInputStream( stream );
 
-        if (doReset) {
-            dis.mark(MAX_READ_LENGTH);
-        }
-
         int magic = dis.readInt();
         int fileLength = rllong(dis);
         int waveMagic = dis.readInt();
@@ -244,9 +76,6 @@
 
         if ((magic != WaveFileFormat.RIFF_MAGIC) || (waveMagic != WaveFileFormat.WAVE_MAGIC)) {
             // not WAVE, throw UnsupportedAudioFileException
-            if (doReset) {
-                dis.reset();
-            }
             throw new UnsupportedAudioFileException("not a WAVE file");
         }
 
--- a/jdk/src/java.desktop/share/classes/com/sun/media/sound/WaveFloatFileReader.java	Thu Apr 09 12:29:31 2015 +0200
+++ b/jdk/src/java.desktop/share/classes/com/sun/media/sound/WaveFloatFileReader.java	Mon Aug 17 12:45:16 2015 +0300
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2007, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2007, 2015, 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
@@ -22,14 +22,11 @@
  * or visit www.oracle.com if you need additional information or have any
  * questions.
  */
+
 package com.sun.media.sound;
 
-import java.io.BufferedInputStream;
-import java.io.File;
-import java.io.FileInputStream;
 import java.io.IOException;
 import java.io.InputStream;
-import java.net.URL;
 
 import javax.sound.sampled.AudioFileFormat;
 import javax.sound.sampled.AudioFormat;
@@ -37,29 +34,16 @@
 import javax.sound.sampled.AudioInputStream;
 import javax.sound.sampled.AudioSystem;
 import javax.sound.sampled.UnsupportedAudioFileException;
-import javax.sound.sampled.spi.AudioFileReader;
 
 /**
  * Floating-point encoded (format 3) WAVE file loader.
  *
  * @author Karl Helgason
  */
-public final class WaveFloatFileReader extends AudioFileReader {
-
-    public AudioFileFormat getAudioFileFormat(InputStream stream)
-            throws UnsupportedAudioFileException, IOException {
+public final class WaveFloatFileReader extends SunFileReader {
 
-        stream.mark(200);
-        AudioFileFormat format;
-        try {
-            format = internal_getAudioFileFormat(stream);
-        } finally {
-            stream.reset();
-        }
-        return format;
-    }
-
-    private AudioFileFormat internal_getAudioFileFormat(InputStream stream)
+    @Override
+    AudioFileFormat getAudioFileFormatImpl(final InputStream stream)
             throws UnsupportedAudioFileException, IOException {
 
         RIFFReader riffiterator = new RIFFReader(stream);
@@ -96,30 +80,25 @@
                 break;
             }
         }
-
-        if (!fmt_found)
+        if (!fmt_found || !data_found) {
             throw new UnsupportedAudioFileException();
-        if (!data_found)
-            throw new UnsupportedAudioFileException();
-
+        }
         AudioFormat audioformat = new AudioFormat(
                 Encoding.PCM_FLOAT, samplerate, bits, channels,
                 framesize, samplerate, false);
-        AudioFileFormat fileformat = new AudioFileFormat(
-                AudioFileFormat.Type.WAVE, audioformat,
-                AudioSystem.NOT_SPECIFIED);
-        return fileformat;
+        return new AudioFileFormat(AudioFileFormat.Type.WAVE, audioformat,
+                                   AudioSystem.NOT_SPECIFIED);
     }
 
-    public AudioInputStream getAudioInputStream(InputStream stream)
+    @Override
+    public AudioInputStream getAudioInputStream(final InputStream stream)
             throws UnsupportedAudioFileException, IOException {
 
         AudioFileFormat format = getAudioFileFormat(stream);
+        // we've got everything, the stream is supported and it is at the
+        // beginning of the header, so find the data chunk again and return an
+        // AudioInputStream
         RIFFReader riffiterator = new RIFFReader(stream);
-        if (!riffiterator.getFormat().equals("RIFF"))
-            throw new UnsupportedAudioFileException();
-        if (!riffiterator.getType().equals("WAVE"))
-            throw new UnsupportedAudioFileException();
         while (riffiterator.hasNextChunk()) {
             RIFFReader chunk = riffiterator.nextChunk();
             if (chunk.getFormat().equals("data")) {
@@ -129,39 +108,4 @@
         }
         throw new UnsupportedAudioFileException();
     }
-
-    public AudioFileFormat getAudioFileFormat(URL url)
-            throws UnsupportedAudioFileException, IOException {
-        InputStream stream = url.openStream();
-        AudioFileFormat format;
-        try {
-            format = getAudioFileFormat(new BufferedInputStream(stream));
-        } finally {
-            stream.close();
-        }
-        return format;
-    }
-
-    public AudioFileFormat getAudioFileFormat(File file)
-            throws UnsupportedAudioFileException, IOException {
-        InputStream stream = new FileInputStream(file);
-        AudioFileFormat format;
-        try {
-            format = getAudioFileFormat(new BufferedInputStream(stream));
-        } finally {
-            stream.close();
-        }
-        return format;
-    }
-
-    public AudioInputStream getAudioInputStream(URL url)
-            throws UnsupportedAudioFileException, IOException {
-        return getAudioInputStream(new BufferedInputStream(url.openStream()));
-    }
-
-    public AudioInputStream getAudioInputStream(File file)
-            throws UnsupportedAudioFileException, IOException {
-        return getAudioInputStream(new BufferedInputStream(new FileInputStream(
-                file)));
-    }
 }
--- a/jdk/src/java.desktop/share/classes/java/awt/MenuBar.java	Thu Apr 09 12:29:31 2015 +0200
+++ b/jdk/src/java.desktop/share/classes/java/awt/MenuBar.java	Mon Aug 17 12:45:16 2015 +0300
@@ -229,9 +229,11 @@
                 if (m.peer == null) {
                     m.addNotify();
                 }
+                menus.addElement(m);
                 peer.addMenu(m);
+            } else {
+                menus.addElement(m);
             }
-            menus.addElement(m);
             return m;
         }
     }
--- a/jdk/src/java.desktop/share/classes/java/awt/Toolkit.java	Thu Apr 09 12:29:31 2015 +0200
+++ b/jdk/src/java.desktop/share/classes/java/awt/Toolkit.java	Mon Aug 17 12:45:16 2015 +0300
@@ -519,13 +519,7 @@
      * <p>
      * If a system property named {@code "java.awt.headless"} is set
      * to {@code true} then the headless implementation
-     * of {@code Toolkit} is used.
-     * <p>
-     * If there is no {@code "java.awt.headless"} or it is set to
-     * {@code false} and there is a system property named
-     * {@code "awt.toolkit"},
-     * that property is treated as the name of a class that is a subclass
-     * of {@code Toolkit};
+     * of {@code Toolkit} is used,
      * otherwise the default platform-specific implementation of
      * {@code Toolkit} is used.
      * <p>
--- a/jdk/src/java.desktop/share/classes/java/beans/PropertyDescriptor.java	Thu Apr 09 12:29:31 2015 +0200
+++ b/jdk/src/java.desktop/share/classes/java/beans/PropertyDescriptor.java	Mon Aug 17 12:45:16 2015 +0300
@@ -160,21 +160,23 @@
         setPropertyType(info.getPropertyType());
         setConstrained(info.isConstrained());
         setBound(bound && info.is(PropertyInfo.Name.bound));
-        if (info.is(PropertyInfo.Name.expert)) {
-            setValue(PropertyInfo.Name.expert.name(), Boolean.TRUE); // compatibility
-            setExpert(true);
-        }
-        if (info.is(PropertyInfo.Name.hidden)) {
-            setValue(PropertyInfo.Name.hidden.name(), Boolean.TRUE); // compatibility
-            setHidden(true);
-        }
-        if (info.is(PropertyInfo.Name.preferred)) {
-            setPreferred(true);
-        }
-        Object visual = info.get(PropertyInfo.Name.visualUpdate);
-        if (visual != null) {
-            setValue(PropertyInfo.Name.visualUpdate.name(), visual);
-        }
+
+        boolean isExpert = info.is(PropertyInfo.Name.expert);
+        setValue(PropertyInfo.Name.expert.name(), isExpert); // compatibility
+        setExpert(isExpert);
+
+        boolean isHidden = info.is(PropertyInfo.Name.hidden);
+        setValue(PropertyInfo.Name.hidden.name(), isHidden); // compatibility
+        setHidden(isHidden);
+
+        setPreferred(info.is(PropertyInfo.Name.preferred));
+
+        boolean isRequired = info.is(PropertyInfo.Name.required);
+        setValue(PropertyInfo.Name.required.name(), isRequired);
+
+        boolean visual = info.is(PropertyInfo.Name.visualUpdate);
+        setValue(PropertyInfo.Name.visualUpdate.name(), visual);
+
         Object description = info.get(PropertyInfo.Name.description);
         if (description != null) {
             setShortDescription(description.toString());
--- a/jdk/src/java.desktop/share/classes/javax/swing/JInternalFrame.java	Thu Apr 09 12:29:31 2015 +0200
+++ b/jdk/src/java.desktop/share/classes/javax/swing/JInternalFrame.java	Mon Aug 17 12:45:16 2015 +0300
@@ -1247,6 +1247,7 @@
      *
      * @param layer  an <code>Integer</code> object specifying this
      *          frame's desktop layer
+     * @throws NullPointerException if {@code layer} is {@code null}
      * @see JLayeredPane
      * @beaninfo
      *     expert: true
--- a/jdk/src/java.desktop/share/classes/javax/swing/TimerQueue.java	Thu Apr 09 12:29:31 2015 +0200
+++ b/jdk/src/java.desktop/share/classes/javax/swing/TimerQueue.java	Mon Aug 17 12:45:16 2015 +0300
@@ -94,6 +94,9 @@
     void startIfNeeded() {
         if (! running) {
             runningLock.lock();
+            if (running) {
+                return;
+            }
             try {
                 final ThreadGroup threadGroup = AppContext.getAppContext().getThreadGroup();
                 AccessController.doPrivileged((PrivilegedAction<Object>) () -> {
@@ -166,15 +169,17 @@
         try {
             while (running) {
                 try {
-                    Timer timer = queue.take().getTimer();
+                    DelayedTimer runningTimer = queue.take();
+                    Timer timer = runningTimer.getTimer();
                     timer.getLock().lock();
                     try {
                         DelayedTimer delayedTimer = timer.delayedTimer;
-                        if (delayedTimer != null) {
+                        if (delayedTimer == runningTimer) {
                             /*
-                             * Timer is not removed after we get it from
-                             * the queue and before the lock on the timer is
-                             * acquired
+                             * Timer is not removed (delayedTimer != null)
+                             * or not removed and added (runningTimer == delayedTimer)
+                             * after we get it from the queue and before the
+                             * lock on the timer is acquired
                              */
                             timer.post(); // have timer post an event
                             timer.delayedTimer = null;
--- a/jdk/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicTextFieldUI.java	Thu Apr 09 12:29:31 2015 +0200
+++ b/jdk/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicTextFieldUI.java	Mon Aug 17 12:45:16 2015 +0300
@@ -97,12 +97,7 @@
             String kind = elem.getName();
             if (kind != null) {
                 if (kind.equals(AbstractDocument.ContentElementName)) {
-                    return new GlyphView(elem) {
-                        @Override
-                        public int getResizeWeight(int axis) {
-                            return 0;
-                        }
-                    };
+                    return new GlyphView(elem);
                 } else if (kind.equals(AbstractDocument.ParagraphElementName)) {
                     return new I18nFieldView(elem);
                 }
--- a/jdk/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicTextUI.java	Thu Apr 09 12:29:31 2015 +0200
+++ b/jdk/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicTextUI.java	Mon Aug 17 12:45:16 2015 +0300
@@ -940,7 +940,7 @@
                 rootView.setSize(d.width - i.left - i.right -
                         caretMargin, d.height - i.top - i.bottom);
             }
-            else if (d.width == 0 || d.height == 0) {
+            else if (d.width <= 0 || d.height <= 0) {
                 // Probably haven't been layed out yet, force some sort of
                 // initial sizing.
                 rootView.setSize(Integer.MAX_VALUE, Integer.MAX_VALUE);
--- a/jdk/src/java.desktop/share/classes/javax/swing/text/GlyphView.java	Thu Apr 09 12:29:31 2015 +0200
+++ b/jdk/src/java.desktop/share/classes/javax/swing/text/GlyphView.java	Mon Aug 17 12:45:16 2015 +0300
@@ -538,17 +538,6 @@
     }
 
     /**
-     * {@inheritDoc}
-     */
-    @Override
-    public int getResizeWeight(int axis) {
-        if (axis == View.X_AXIS) {
-            return 1;
-        }
-        return 0;
-    }
-
-    /**
      * Determines the minimum span for this view along an axis.
      *
      * <p>This implementation returns the longest non-breakable area within
@@ -561,11 +550,13 @@
      */
     @Override
     public float getMinimumSpan(int axis) {
+        int w = getResizeWeight(axis);
+        if (w == 0) {
+            // can't resize
+            return getPreferredSpan(axis);
+        }
         switch (axis) {
             case View.X_AXIS:
-                if (getResizeWeight(X_AXIS) == 0) {
-                    return getPreferredSpan(X_AXIS);
-                }
                 if (minimumSpan < 0) {
                     minimumSpan = 0;
                     int p0 = getStartOffset();
--- a/jdk/src/java.desktop/share/classes/sun/applet/AppletPanel.java	Thu Apr 09 12:29:31 2015 +0200
+++ b/jdk/src/java.desktop/share/classes/sun/applet/AppletPanel.java	Mon Aug 17 12:45:16 2015 +0300
@@ -687,12 +687,7 @@
 
         if (toFocus != null) {
             if (parent instanceof EmbeddedFrame) {
-                // JDK-8056915: Try to request focus to the embedder first and
-                // activate the embedded frame through it
-                if (!((EmbeddedFrame) parent).requestFocusToEmbedder()) {
-                    // Otherwise activate the embedded frame directly
-                    ((EmbeddedFrame) parent).synthesizeWindowActivation(true);
-                }
+                ((EmbeddedFrame) parent).synthesizeWindowActivation(true);
             }
             // EmbeddedFrame might have focus before the applet was added.
             // Thus after its activation the most recent focus owner will be
--- a/jdk/src/java.desktop/share/classes/sun/awt/EmbeddedFrame.java	Thu Apr 09 12:29:31 2015 +0200
+++ b/jdk/src/java.desktop/share/classes/sun/awt/EmbeddedFrame.java	Mon Aug 17 12:45:16 2015 +0300
@@ -357,15 +357,6 @@
     public void synthesizeWindowActivation(boolean doActivate) {}
 
     /**
-     * Requests the focus to the embedder.
-     *
-     * @return {@code true} if focus request was successful, and {@code false} otherwise.
-     */
-    public boolean requestFocusToEmbedder() {
-        return false;
-    }
-
-    /**
      * Moves this embedded frame to a new location. The top-left corner of
      * the new location is specified by the <code>x</code> and <code>y</code>
      * parameters relative to the native parent component.
--- a/jdk/src/java.desktop/share/classes/sun/awt/image/MultiResolutionCachedImage.java	Thu Apr 09 12:29:31 2015 +0200
+++ b/jdk/src/java.desktop/share/classes/sun/awt/image/MultiResolutionCachedImage.java	Mon Aug 17 12:45:16 2015 +0300
@@ -86,19 +86,24 @@
     @Override
     public int getWidth(ImageObserver observer) {
         updateInfo(observer, ImageObserver.WIDTH);
-        return super.getWidth(observer);
+        return baseImageWidth;
     }
 
     @Override
     public int getHeight(ImageObserver observer) {
         updateInfo(observer, ImageObserver.HEIGHT);
-        return super.getHeight(observer);
+        return baseImageHeight;
     }
 
     @Override
     public Object getProperty(String name, ImageObserver observer) {
         updateInfo(observer, ImageObserver.PROPERTIES);
-        return super.getProperty(name, observer);
+        return Image.UndefinedProperty;
+    }
+
+    @Override
+    public Image getScaledInstance(int width, int height, int hints) {
+        return getResolutionVariant(width, height);
     }
 
     @Override
--- a/jdk/src/java.desktop/share/native/libjsound/PortMixer.c	Thu Apr 09 12:29:31 2015 +0200
+++ b/jdk/src/java.desktop/share/native/libjsound/PortMixer.c	Mon Aug 17 12:45:16 2015 +0300
@@ -272,7 +272,7 @@
 }
 
 void* PORT_NewFloatControl(void* creatorV, void* controlID, char* type,
-                           float min, float max, float precision, char* units) {
+                           float min, float max, float precision, const char* units) {
     ControlCreatorJNI* creator = (ControlCreatorJNI*) creatorV;
     jobject ctrl = NULL;
     jstring unitsString;
--- a/jdk/src/java.desktop/share/native/libjsound/Ports.h	Thu Apr 09 12:29:31 2015 +0200
+++ b/jdk/src/java.desktop/share/native/libjsound/Ports.h	Mon Aug 17 12:45:16 2015 +0300
@@ -93,7 +93,7 @@
  * returns an opaque pointer to the created control
  */
 typedef void* (*PORT_NewFloatControlPtr)(void* creator, void* controlID, char* type,
-              float min, float max, float precision, char* units);
+              float min, float max, float precision, const char* units);
 
 /* control: The control to add to current port
  * creator: pointer to the creator struct provided by PORT_GetControls
--- a/jdk/src/java.desktop/unix/classes/sun/awt/X11/GtkFileDialogPeer.java	Thu Apr 09 12:29:31 2015 +0200
+++ b/jdk/src/java.desktop/unix/classes/sun/awt/X11/GtkFileDialogPeer.java	Mon Aug 17 12:45:16 2015 +0300
@@ -42,6 +42,8 @@
 
     // A pointer to the native GTK FileChooser widget
     private volatile long widget = 0L;
+    private long standaloneWindow;
+    private volatile boolean quit;
 
     GtkFileDialogPeer(FileDialog fd) {
         super(fd);
@@ -111,9 +113,11 @@
     public void setVisible(boolean b) {
         XToolkit.awtLock();
         try {
+            quit = !b;
             if (b) {
                 Runnable task = () -> {
                     showNativeDialog();
+                    standaloneWindow = 0;
                     fd.setVisible(false);
                 };
                 new ManagedLocalsThread(task).start();
@@ -128,7 +132,14 @@
 
     @Override
     public void dispose() {
-        quit();
+        XToolkit.awtLock();
+        try {
+            quit = true;
+            quit();
+        }
+        finally {
+            XToolkit.awtUnlock();
+        }
         super.dispose();
     }
 
@@ -144,6 +155,17 @@
         // have delegated to FileDialog#setFile
     }
 
+    protected void requestXFocus(long time, boolean timeProvided) {
+        if(standaloneWindow == 0) {
+            super.requestXFocus(time, timeProvided);
+            return;
+        }
+        XNETProtocol net_protocol = XWM.getWM().getNETProtocol();
+        if (net_protocol != null) {
+            net_protocol.setActiveWindow(standaloneWindow);
+        }
+    }
+
     @Override
     public void setFilenameFilter(FilenameFilter filter) {
         // We do not implement this method because we
@@ -170,7 +192,21 @@
                 dirname = file.getParent();
             }
         }
-        run(fd.getTitle(), fd.getMode(), dirname, filename,
-            fd.getFilenameFilter(), fd.isMultipleMode(), fd.getX(), fd.getY());
+        if (!quit) {
+            run(fd.getTitle(), fd.getMode(), dirname, filename,
+                    fd.getFilenameFilter(), fd.isMultipleMode(), fd.getX(), fd.getY());
+        }
+    }
+
+    /**
+     * Called by native code when GTK dialog is created.
+     */
+    boolean setWindow(long xid) {
+        if (!quit && widget != 0) {
+            standaloneWindow = xid;
+            requestXFocus();
+            return true;
+        }
+        return false;
     }
 }
--- a/jdk/src/java.desktop/unix/classes/sun/awt/X11/XFramePeer.java	Thu Apr 09 12:29:31 2015 +0200
+++ b/jdk/src/java.desktop/unix/classes/sun/awt/X11/XFramePeer.java	Mon Aug 17 12:45:16 2015 +0300
@@ -289,7 +289,7 @@
 
             XNETProtocol net_protocol = XWM.getWM().getNETProtocol();
             if (net_protocol != null) {
-                net_protocol.setActiveWindow(this);
+                net_protocol.setActiveWindow(getWindow());
             }
             xSetVisible(true);
         }
--- a/jdk/src/java.desktop/unix/classes/sun/awt/X11/XNETProtocol.java	Thu Apr 09 12:29:31 2015 +0200
+++ b/jdk/src/java.desktop/unix/classes/sun/awt/X11/XNETProtocol.java	Mon Aug 17 12:45:16 2015 +0300
@@ -326,7 +326,7 @@
         return res;
     }
 
-    public void setActiveWindow(XWindow window) {
+    public void setActiveWindow(long window) {
         if (!active() || !checkProtocol(XA_NET_SUPPORTED, XA_NET_ACTIVE_WINDOW)) {
             return;
         }
@@ -336,7 +336,7 @@
         msg.set_type(XConstants.ClientMessage);
         msg.set_message_type(XA_NET_ACTIVE_WINDOW.getAtom());
         msg.set_display(XToolkit.getDisplay());
-        msg.set_window(window.getWindow());
+        msg.set_window(window);
         msg.set_format(32);
         msg.set_data(0, 1);
         msg.set_data(1, XToolkit.getCurrentServerTime());
--- a/jdk/src/java.desktop/unix/classes/sun/awt/X11GraphicsDevice.java	Thu Apr 09 12:29:31 2015 +0200
+++ b/jdk/src/java.desktop/unix/classes/sun/awt/X11GraphicsDevice.java	Mon Aug 17 12:45:16 2015 +0300
@@ -316,6 +316,7 @@
     @Override
     public boolean isDisplayChangeSupported() {
         return (isFullScreenSupported()
+                && (getFullScreenWindow() != null)
                 && !((X11GraphicsEnvironment) GraphicsEnvironment
                         .getLocalGraphicsEnvironment()).runningXinerama());
     }
--- a/jdk/src/java.desktop/unix/classes/sun/java2d/xr/XRDrawImage.java	Thu Apr 09 12:29:31 2015 +0200
+++ b/jdk/src/java.desktop/unix/classes/sun/java2d/xr/XRDrawImage.java	Mon Aug 17 12:45:16 2015 +0300
@@ -46,24 +46,28 @@
         SurfaceData dstData = sg.surfaceData;
         SurfaceData srcData = dstData.getSourceSurfaceData(img,
                 SunGraphics2D.TRANSFORM_GENERIC, sg.imageComp, bgColor);
-        int compRule = ((AlphaComposite) sg.composite).getRule();
-        float extraAlpha = ((AlphaComposite) sg.composite).getAlpha();
 
-        if (srcData != null && !isBgOperation(srcData, bgColor)
+        if (sg.composite instanceof AlphaComposite) {
+            int compRule = ((AlphaComposite) sg.composite).getRule();
+            float extraAlpha = ((AlphaComposite) sg.composite).getAlpha();
+
+            if (srcData != null && !isBgOperation(srcData, bgColor)
                 && interpType <= AffineTransformOp.TYPE_BILINEAR
                 && (XRUtils.isMaskEvaluated(XRUtils.j2dAlphaCompToXR(compRule))
-                        || (XRUtils.isTransformQuadrantRotated(tx)) && extraAlpha == 1.0f))
-                         {
-            SurfaceType srcType = srcData.getSurfaceType();
-            SurfaceType dstType = dstData.getSurfaceType();
+                    || (XRUtils.isTransformQuadrantRotated(tx))
+                    && extraAlpha == 1.0f))
+            {
+                SurfaceType srcType = srcData.getSurfaceType();
+                SurfaceType dstType = dstData.getSurfaceType();
 
-            TransformBlit blit = TransformBlit.getFromCache(srcType,
-                    sg.imageComp, dstType);
-            if (blit != null) {
-                blit.Transform(srcData, dstData, sg.composite,
-                        sg.getCompClip(), tx, interpType, sx1, sy1, 0, 0, sx2
+                TransformBlit blit = TransformBlit.getFromCache(srcType,
+                        sg.imageComp, dstType);
+                if (blit != null) {
+                    blit.Transform(srcData, dstData, sg.composite,
+                          sg.getCompClip(), tx, interpType, sx1, sy1, 0, 0, sx2
                                 - sx1, sy2 - sy1);
                     return;
+                }
             }
         }
 
--- a/jdk/src/java.desktop/unix/native/common/awt/awt.h	Thu Apr 09 12:29:31 2015 +0200
+++ b/jdk/src/java.desktop/unix/native/common/awt/awt.h	Mon Aug 17 12:45:16 2015 +0300
@@ -82,7 +82,12 @@
     } while (0)
 
 #define AWT_LOCK_IMPL() \
-    (*env)->CallStaticVoidMethod(env, tkClass, awtLockMID)
+    do { \
+        (*env)->CallStaticVoidMethod(env, tkClass, awtLockMID); \
+        if ((*env)->ExceptionCheck(env)) { \
+            (*env)->ExceptionClear(env); \
+        } \
+    } while(0)
 
 #define AWT_NOFLUSH_UNLOCK_IMPL() \
     do { \
@@ -91,11 +96,10 @@
          (*env)->ExceptionClear(env); \
       } \
       (*env)->CallStaticVoidMethod(env, tkClass, awtUnlockMID); \
+      if ((*env)->ExceptionCheck(env)) { \
+         (*env)->ExceptionClear(env); \
+      } \
       if (pendingException) { \
-         if ((*env)->ExceptionCheck(env)) { \
-            (*env)->ExceptionDescribe(env); \
-            (*env)->ExceptionClear(env); \
-         } \
          (*env)->Throw(env, pendingException); \
       } \
     } while (0)
--- a/jdk/src/java.desktop/unix/native/libawt/awt/awt_LoadLibrary.c	Thu Apr 09 12:29:31 2015 +0200
+++ b/jdk/src/java.desktop/unix/native/libawt/awt/awt_LoadLibrary.c	Mon Aug 17 12:45:16 2015 +0300
@@ -71,6 +71,10 @@
         }
         isHeadless = (*env)->CallStaticBooleanMethod(env, graphicsEnvClass,
                                                      headlessFn);
+        if ((*env)->ExceptionCheck(env)) {
+            (*env)->ExceptionClear(env);
+            return JNI_TRUE;
+        }
     }
     return isHeadless;
 }
--- a/jdk/src/java.desktop/unix/native/libawt_xawt/awt/HPkeysym.h	Thu Apr 09 12:29:31 2015 +0200
+++ b/jdk/src/java.desktop/unix/native/libawt_xawt/awt/HPkeysym.h	Mon Aug 17 12:45:16 2015 +0300
@@ -58,7 +58,7 @@
 
 #ifndef _HPKEYSYM_H
 
-#define _HPKEYSYM
+#define _HPKEYSYM_H
 
 #define hpXK_ClearLine          0x1000FF6F
 #define hpXK_InsertLine         0x1000FF70
--- a/jdk/src/java.desktop/unix/native/libawt_xawt/awt/awt_Event.h	Thu Apr 09 12:29:31 2015 +0200
+++ b/jdk/src/java.desktop/unix/native/libawt_xawt/awt/awt_Event.h	Mon Aug 17 12:45:16 2015 +0300
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2001, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2015, 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
@@ -28,7 +28,7 @@
  ***
  ***/
 #ifndef _AWT_EVENT_H_
-#define _AWT_EVENT_H
+#define _AWT_EVENT_H_
 
 #include "jni_util.h"
 
--- a/jdk/src/java.desktop/unix/native/libawt_xawt/awt/awt_GraphicsEnv.c	Thu Apr 09 12:29:31 2015 +0200
+++ b/jdk/src/java.desktop/unix/native/libawt_xawt/awt/awt_GraphicsEnv.c	Mon Aug 17 12:45:16 2015 +0300
@@ -1564,6 +1564,9 @@
     for (i = 0; i < visScreenInfo->count; i++) {
         XdbeVisualInfo* visInfo = visScreenInfo->visinfo;
         (*env)->CallVoidMethod(env, this, midAddVisual, (visInfo[i]).visual);
+        if ((*env)->ExceptionCheck(env)) {
+            break;
+        }
     }
 #endif /* !HEADLESS */
 }
--- a/jdk/src/java.desktop/unix/native/libawt_xawt/awt/awt_util.c	Thu Apr 09 12:29:31 2015 +0200
+++ b/jdk/src/java.desktop/unix/native/libawt_xawt/awt/awt_util.c	Mon Aug 17 12:45:16 2015 +0300
@@ -98,5 +98,8 @@
 
     (*env)->CallStaticVoidMethod(env, threadClass, yieldMethodID);
     DASSERT(!((*env)->ExceptionOccurred(env)));
+    if ((*env)->ExceptionCheck(env)) {
+        return JNI_FALSE;
+    }
     return JNI_TRUE;
 } /* awtJNI_ThreadYield() */
--- a/jdk/src/java.desktop/unix/native/libawt_xawt/awt/gtk2_interface.c	Thu Apr 09 12:29:31 2015 +0200
+++ b/jdk/src/java.desktop/unix/native/libawt_xawt/awt/gtk2_interface.c	Mon Aug 17 12:45:16 2015 +0300
@@ -576,6 +576,7 @@
     fp_gtk_file_chooser_get_filenames = dl_symbol(
             "gtk_file_chooser_get_filenames");
     fp_gtk_g_slist_length = dl_symbol("g_slist_length");
+    fp_gdk_x11_drawable_get_xid = dl_symbol("gdk_x11_drawable_get_xid");
 }
 
 gboolean gtk2_load(JNIEnv *env)
@@ -904,6 +905,10 @@
 
         // Init the thread system to use GLib in a thread-safe mode
         (*env)->CallStaticVoidMethod(env, clazz, mid_lock);
+        if ((*env)->ExceptionCheck(env)) {
+            AWT_UNLOCK();
+            return FALSE;
+        }
 
         // Calling g_thread_init() multiple times leads to crash on GLib < 2.24
         // We can use g_thread_get_initialized () but it is available only for
@@ -922,7 +927,22 @@
             //called before gtk_init() or gtk_init_check()
             fp_gdk_threads_init();
         }
+        jthrowable pendExcpn = NULL;
+        // Exception raised during mid_getAndSetInitializationNeededFlag
+        // call is saved and error handling is done
+        // after unlock method is called
+        if ((pendExcpn = (*env)->ExceptionOccurred(env)) != NULL) {
+            (*env)->ExceptionClear(env);
+        }
         (*env)->CallStaticVoidMethod(env, clazz, mid_unlock);
+        if (pendExcpn != NULL) {
+            (*env)->Throw(env, pendExcpn);
+        }
+        // check if any exception occured during mid_unlock call
+        if ((*env)->ExceptionCheck(env)) {
+            AWT_UNLOCK();
+            return FALSE;
+        }
     }
     result = (*fp_gtk_init_check)(NULL, NULL);
 
--- a/jdk/src/java.desktop/unix/native/libawt_xawt/awt/gtk2_interface.h	Thu Apr 09 12:29:31 2015 +0200
+++ b/jdk/src/java.desktop/unix/native/libawt_xawt/awt/gtk2_interface.h	Mon Aug 17 12:45:16 2015 +0300
@@ -27,6 +27,7 @@
 
 #include <stdlib.h>
 #include <jni.h>
+#include <X11/X.h>
 
 #define _G_TYPE_CIC(ip, gt, ct)       ((ct*) ip)
 #define G_TYPE_CHECK_INSTANCE_CAST(instance, g_type, c_type)    (_G_TYPE_CIC ((instance), (g_type), c_type))
@@ -820,6 +821,7 @@
 void (*fp_gtk_main)(void);
 guint (*fp_gtk_main_level)(void);
 gchar* (*fp_g_path_get_dirname) (const gchar *file_name);
+XID (*fp_gdk_x11_drawable_get_xid) (GdkWindow *drawable);
 
 /**
  * This function is available for GLIB > 2.20, so it MUST be
--- a/jdk/src/java.desktop/unix/native/libawt_xawt/awt/sun_awt_X11_GtkFileDialogPeer.c	Thu Apr 09 12:29:31 2015 +0200
+++ b/jdk/src/java.desktop/unix/native/libawt_xawt/awt/sun_awt_X11_GtkFileDialogPeer.c	Mon Aug 17 12:45:16 2015 +0300
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2010, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2015, 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,6 +27,7 @@
 #include <stdio.h>
 #include <jni_util.h>
 #include <string.h>
+#include <X11/X.h>
 #include "gtk2_interface.h"
 #include "sun_awt_X11_GtkFileDialogPeer.h"
 #include "java_awt_FileDialog.h"
@@ -38,6 +39,7 @@
 static jmethodID filenameFilterCallbackMethodID = NULL;
 static jmethodID setFileInternalMethodID = NULL;
 static jfieldID  widgetFieldID = NULL;
+static jmethodID  setWindowMethodID = NULL;
 
 JNIEXPORT void JNICALL Java_sun_awt_X11_GtkFileDialogPeer_initIDs
 (JNIEnv *env, jclass cx)
@@ -54,6 +56,10 @@
 
     widgetFieldID = (*env)->GetFieldID(env, cx, "widget", "J");
     DASSERT(widgetFieldID != NULL);
+    CHECK_NULL(widgetFieldID);
+
+    setWindowMethodID = (*env)->GetMethodID(env, cx, "setWindow", "(J)Z");
+    DASSERT(setWindowMethodID != NULL);
 }
 
 static gboolean filenameFilterCallback(const GtkFileFilterInfo * filter_info, gpointer obj)
@@ -401,7 +407,11 @@
 
     fp_gtk_widget_show(dialog);
 
-    fp_gtk_main();
+    XID xid = fp_gdk_x11_drawable_get_xid(dialog->window);
+    if( (*env)->CallBooleanMethod(env, jpeer, setWindowMethodID, xid) ) {
+        fp_gtk_main();
+    }
+
     fp_gdk_threads_leave();
 }
 
--- a/jdk/src/java.desktop/unix/native/libjsound/PLATFORM_API_LinuxOS_ALSA_Ports.c	Thu Apr 09 12:29:31 2015 +0200
+++ b/jdk/src/java.desktop/unix/native/libjsound/PLATFORM_API_LinuxOS_ALSA_Ports.c	Mon Aug 17 12:45:16 2015 +0300
@@ -431,8 +431,8 @@
             }
         } else { // more than two channels, each channels has its own control.
             for (channel = SND_MIXER_SCHN_FRONT_LEFT; channel <= SND_MIXER_SCHN_LAST; channel++) {
-                if (isPlayback && snd_mixer_selem_has_playback_channel(elem, channel) ||
-                    !isPlayback && snd_mixer_selem_has_capture_channel(elem, channel)) {
+                if ((isPlayback && snd_mixer_selem_has_playback_channel(elem, channel)) ||
+                    (!isPlayback && snd_mixer_selem_has_capture_channel(elem, channel))) {
                     if (getControlSlot(portMixer, &portControl)) {
                         portControl->elem = elem;
                         portControl->portType = portMixer->types[portIndex];
--- a/jdk/src/java.desktop/windows/classes/sun/awt/windows/WEmbeddedFrame.java	Thu Apr 09 12:29:31 2015 +0200
+++ b/jdk/src/java.desktop/windows/classes/sun/awt/windows/WEmbeddedFrame.java	Mon Aug 17 12:45:16 2015 +0300
@@ -251,15 +251,6 @@
         }
     }
 
-    public boolean requestFocusToEmbedder() {
-        if (isEmbeddedInIE) {
-            final WEmbeddedFramePeer peer = AWTAccessor.getComponentAccessor()
-                                                       .getPeer(this);
-            return peer.requestFocusToEmbedder();
-        }
-        return false;
-    }
-
     public void registerAccelerator(AWTKeyStroke stroke) {}
     public void unregisterAccelerator(AWTKeyStroke stroke) {}
 
--- a/jdk/src/java.desktop/windows/classes/sun/awt/windows/WEmbeddedFramePeer.java	Thu Apr 09 12:29:31 2015 +0200
+++ b/jdk/src/java.desktop/windows/classes/sun/awt/windows/WEmbeddedFramePeer.java	Mon Aug 17 12:45:16 2015 +0300
@@ -79,10 +79,4 @@
         return !Win32GraphicsEnvironment.isDWMCompositionEnabled();
     }
 
-    /**
-     * Sets the focus to plugin control window, the parent of embedded frame.
-     * Eventually, it will synthesizeWindowActivation to activate the embedded frame,
-     * if plugin control window gets the focus.
-     */
-    public native boolean requestFocusToEmbedder();
 }
--- a/jdk/src/java.desktop/windows/classes/sun/awt/windows/WListPeer.java	Thu Apr 09 12:29:31 2015 +0200
+++ b/jdk/src/java.desktop/windows/classes/sun/awt/windows/WListPeer.java	Mon Aug 17 12:45:16 2015 +0300
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1996, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1996, 2015, 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,10 +39,9 @@
     // ListPeer implementation
 
     @Override
-    @SuppressWarnings("deprecation")
     public int[] getSelectedIndexes() {
         List l = (List)target;
-        int len = l.countItems();
+        int len = l.getItemCount();
         int sel[] = new int[len];
         int nsel = 0;
         for (int i = 0 ; i < len ; i++) {
@@ -93,10 +92,9 @@
 
     @Override
     public native void delItems(int start, int end);
-    @SuppressWarnings("deprecation")
     public void clear() {
         List l = (List)target;
-        delItems(0, l.countItems());
+        delItems(0, l.getItemCount());
     }
     @Override
     public native void select(int index);
@@ -131,7 +129,6 @@
     native void create(WComponentPeer parent);
 
     @Override
-    @SuppressWarnings("deprecation")
     void initialize() {
         List li = (List)target;
 
@@ -144,7 +141,7 @@
         }
 
         // add any items that were already inserted in the target.
-        int  nitems = li.countItems();
+        int  nitems = li.getItemCount();
         if (nitems > 0) {
             String[] items = new String[nitems];
             int maxWidth = 0;
@@ -160,7 +157,7 @@
         }
 
         // set whether this list should allow multiple selections.
-        setMultipleSelections(li.allowsMultipleSelections());
+        setMultipleSelections(li.isMultipleMode());
 
         // select the item if necessary.
         int sel[] = li.getSelectedIndexes();
--- a/jdk/src/java.desktop/windows/native/libawt/windows/awt_Frame.cpp	Thu Apr 09 12:29:31 2015 +0200
+++ b/jdk/src/java.desktop/windows/native/libawt/windows/awt_Frame.cpp	Mon Aug 17 12:45:16 2015 +0300
@@ -1961,29 +1961,6 @@
     CATCH_BAD_ALLOC;
 }
 
-JNIEXPORT jboolean JNICALL
-Java_sun_awt_windows_WEmbeddedFramePeer_requestFocusToEmbedder(JNIEnv *env, jobject self)
-{
-    jboolean result = JNI_FALSE;
-
-    TRY;
-
-    AwtFrame *frame = NULL;
-
-    PDATA pData;
-    JNI_CHECK_PEER_GOTO(self, ret);
-    frame = (AwtFrame *)pData;
-
-    // JDK-8056915: During initial applet activation, set focus to plugin control window
-    HWND hwndParent = ::GetParent(frame->GetHWnd());
-
-    result = SetFocusToPluginControl(hwndParent);
-
-    CATCH_BAD_ALLOC_RET(JNI_FALSE);
-ret:
-    return result;
-}
-
 } /* extern "C" */
 
 static bool SetFocusToPluginControl(HWND hwndPlugin)
--- a/jdk/src/jdk.accessibility/windows/native/libjavaaccessbridge/AccessBridgeATInstance.cpp	Thu Apr 09 12:29:31 2015 +0200
+++ b/jdk/src/jdk.accessibility/windows/native/libjavaaccessbridge/AccessBridgeATInstance.cpp	Mon Aug 17 12:45:16 2015 +0300
@@ -87,7 +87,7 @@
 AccessBridgeATInstance::initiateIPC() {
     DWORD errorCode;
 
-    PrintDebugString("\r\nin AccessBridgeATInstance::initiateIPC()");
+    PrintDebugString("\r\nIn AccessBridgeATInstance::initiateIPC()");
 
     // open Windows-initiated IPC filemap & map it to a ptr
 
--- a/jdk/src/jdk.accessibility/windows/native/libjavaaccessbridge/AccessBridgeJavaEntryPoints.cpp	Thu Apr 09 12:29:31 2015 +0200
+++ b/jdk/src/jdk.accessibility/windows/native/libjavaaccessbridge/AccessBridgeJavaEntryPoints.cpp	Mon Aug 17 12:45:16 2015 +0300
@@ -40,7 +40,7 @@
                                                          jobject bridgeObject) {
     jniEnv = jniEnvironment;
     accessBridgeObject = (jobject)bridgeObject;
-    PrintDebugString("AccessBridgeJavaEntryPoints(%X, %X) called", jniEnv, accessBridgeObject);
+    PrintDebugString("AccessBridgeJavaEntryPoints(%p, %p) called", jniEnv, accessBridgeObject);
 }
 
 
--- a/jdk/src/jdk.accessibility/windows/native/libjavaaccessbridge/JavaAccessBridge.cpp	Thu Apr 09 12:29:31 2015 +0200
+++ b/jdk/src/jdk.accessibility/windows/native/libjavaaccessbridge/JavaAccessBridge.cpp	Mon Aug 17 12:45:16 2015 +0300
@@ -89,53 +89,31 @@
         theJavaAccessBridge->javaRun(env, obj);
     }
 
-#if 0 // SetDlgItemText has caused problems with JAWS
-    /**
-     * Append debug info to dialog
-     *
-     */
-    void AppendToCallInfo(char *s) {
-        char buffer[4096];
-
-        PrintDebugString(s);
-
-        GetDlgItemText(theDialogWindow, cCallInfo, buffer, sizeof(buffer));
-        if (strlen(buffer) < (sizeof(buffer) - strlen(s))) {
-            strncat(buffer, s, sizeof(buffer));
-            SetDlgItemText(theDialogWindow, cCallInfo, buffer);
-        } else {
-            SetDlgItemText(theDialogWindow, cCallInfo, s);
-        }
-    }
-#endif
-
-
     /**
      * Our window proc
      *
      */
-    BOOL APIENTRY AccessBridgeDialogProc (HWND hDlg, UINT message, UINT wParam, LONG lParam) {
+    BOOL APIENTRY AccessBridgeDialogProc (HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) {
         int command;
         COPYDATASTRUCT *sentToUs;
         char *package;
-        //DEBUG_CODE(char buffer[256]);
 
         switch (message) {
         case WM_INITDIALOG:
-            //DEBUG_CODE(SetDlgItemText(theDialogWindow, cStatusText, "Initializing"));
+            PrintDebugString("In AccessBridgeDialog - Initializing");
             break;
 
         case WM_COMMAND:
             command = LOWORD (wParam);
+            PrintDebugString("In AccessBridgeDialog - Got WM_COMMAND, command: %X", command);
             break;
 
             // call from Java with data for us to deliver
         case WM_COPYDATA:
             if (theDialogWindow == (HWND) wParam) {
-                //DEBUG_CODE(SetDlgItemText(theDialogWindow, cStatusText, "Got WM_COPYDATA from ourselves"));
+                PrintDebugString("In AccessBridgeDialog - Got WM_COPYDATA from ourselves");
             } else {
-                //DEBUG_CODE(sprintf(buffer, "Got WM_COPYDATA from HWND %p", wParam));
-                //DEBUG_CODE(SetDlgItemText(theDialogWindow, cStatusText, buffer));
+                PrintDebugString("In AccessBridgeDialog - Got WM_COPYDATA from HWND %p", wParam);
                 sentToUs = (COPYDATASTRUCT *) lParam;
                 package = (char *) sentToUs->lpData;
                 theJavaAccessBridge->processPackage(package, sentToUs->cbData);
@@ -147,18 +125,16 @@
             // wParam == sourceHwnd
             // lParam == buffer size in shared memory
             if (theDialogWindow == (HWND) wParam) {
-                //DEBUG_CODE(SetDlgItemText(theDialogWindow, cStatusText, "Got AB_MESSAGE_WAITING from ourselves"));
+                PrintDebugString("In AccessBridgeDialog - Got AB_MESSAGE_WAITING from ourselves");
             } else {
-                //DEBUG_CODE(sprintf(buffer, "Got AB_MESSAGE_WAITING from HWND %p", wParam));
-                //DEBUG_CODE(SetDlgItemText(theDialogWindow, cStatusText, buffer));
-                LRESULT returnVal = theJavaAccessBridge->receiveMemoryPackage((HWND) wParam, lParam);
+                PrintDebugString("In AccessBridgeDialog - Got AB_MESSAGE_WAITING from HWND %p", wParam);
+                LRESULT returnVal = theJavaAccessBridge->receiveMemoryPackage((HWND) wParam, (long) lParam);
             }
             break;
 
             // a JavaAccessBridge DLL is going away
         case AB_DLL_GOING_AWAY:
-            // wParam == sourceHwnd
-            //DEBUG_CODE(SetDlgItemText(theDialogWindow, cStatusText, "Got AB_DLL_GOING_AWAY message"));
+            PrintDebugString("In AccessBridgeDialog - Got AB_DLL_GOING_AWAY message");
             theJavaAccessBridge->WindowsATDestroyed((HWND) wParam);
             break;
 
@@ -169,6 +145,7 @@
                 // A new Windows AT just said "hi";
                 // say "hi" back so it can mate up with us
                 // otherwise don't do anything (e.g. don't set up data structures yet)
+                PrintDebugString("In AccessBridgeDialog - Got theFromWindowsHelloMsgID message");
                 theJavaAccessBridge->postHelloToWindowsDLLMsg((HWND) wParam);
             }
         }
@@ -324,9 +301,9 @@
  */
 void
 JavaAccessBridge::postHelloToWindowsDLLMsg(HWND destHwnd) {
-    PrintDebugString("\r\nin JavaAccessBridge::postHelloToWindowsDLLMsg");
+    PrintDebugString("\r\nIn JavaAccessBridge::postHelloToWindowsDLLMsg");
     PrintDebugString("  calling PostMessage(%p, %X, %p, %p)",
-                     destHwnd, theFromJavaHelloMsgID, dialogWindow, javaVM);
+                     destHwnd, theFromJavaHelloMsgID, dialogWindow, dialogWindow);
     PostMessage(destHwnd, theFromJavaHelloMsgID, (WPARAM) dialogWindow, (LPARAM) dialogWindow);
 }
 
@@ -2493,7 +2470,7 @@
                                     jobject eventObj, jobject source) {                 \
                                                                                         \
         PrintDebugString("\r\nFiring event id = %d(%p, %p, %p, %p); vmID = %X",         \
-                         eventConstant, env, callingObj, eventObj, source, javaVM);     \
+                         eventConstant, env, callingObj, eventObj, source, dialogWindow); \
                                                                                         \
         /* sanity check */                                                              \
         if (ATs == (AccessBridgeATInstance *) 0) {                                      \
@@ -2531,7 +2508,7 @@
     void JavaAccessBridge::javaShutdown(JNIEnv *env, jobject callingObj) {
 
         PrintDebugString("\r\nFiring event id = %d(%p, %p); vmID = %X",
-                         cJavaShutdownEvent, env, callingObj, javaVM);
+                         cJavaShutdownEvent, env, callingObj, dialogWindow);
 
         /* sanity check */
         if (ATs == (AccessBridgeATInstance *) 0) {
--- a/jdk/src/jdk.accessibility/windows/native/libjavaaccessbridge/JavaAccessBridge.h	Thu Apr 09 12:29:31 2015 +0200
+++ b/jdk/src/jdk.accessibility/windows/native/libjavaaccessbridge/JavaAccessBridge.h	Mon Aug 17 12:45:16 2015 +0300
@@ -44,7 +44,7 @@
                             LPVOID lpvReserved);
         void AppendToCallOutput(char *s);
         BOOL APIENTRY AccessBridgeDialogProc(HWND hDlg, UINT message,
-                                             UINT wParam, LONG lParam);
+                                             WPARAM wParam, LPARAM lParam);
 }
 
 /**
--- a/jdk/src/jdk.accessibility/windows/native/libwindowsaccessbridge/AccessBridgeJavaVMInstance.cpp	Thu Apr 09 12:29:31 2015 +0200
+++ b/jdk/src/jdk.accessibility/windows/native/libwindowsaccessbridge/AccessBridgeJavaVMInstance.cpp	Mon Aug 17 12:45:16 2015 +0300
@@ -188,7 +188,7 @@
  *               with the Java AccessBridge DLL
  *
  *               NOTE: WM_COPYDATA is only for one-way IPC; there
- *               is now way to return parameters (especially big ones)
+ *               is no way to return parameters (especially big ones)
  *               Use sendMemoryPackage() to do that!
  */
 LRESULT
--- a/jdk/src/jdk.accessibility/windows/native/libwindowsaccessbridge/AccessBridgeWindowsEntryPoints.cpp	Thu Apr 09 12:29:31 2015 +0200
+++ b/jdk/src/jdk.accessibility/windows/native/libwindowsaccessbridge/AccessBridgeWindowsEntryPoints.cpp	Mon Aug 17 12:45:16 2015 +0300
@@ -51,7 +51,6 @@
         // open our window
         if (theWindowsAccessBridge != (WinAccessBridge *) 0) {
             theWindowsAccessBridge->initWindow();
-            DEBUG_CODE(SetDlgItemText(theDialogWindow, cInvokedByText, "Windows"));
         }
     }
 
--- a/jdk/src/jdk.accessibility/windows/native/libwindowsaccessbridge/WinAccessBridge.cpp	Thu Apr 09 12:29:31 2015 +0200
+++ b/jdk/src/jdk.accessibility/windows/native/libwindowsaccessbridge/WinAccessBridge.cpp	Mon Aug 17 12:45:16 2015 +0300
@@ -366,7 +366,7 @@
 WinAccessBridge::rendezvousWithNewJavaDLL(HWND JavaBridgeDLLwindow, long vmID) {
     LRESULT returnVal;
 
-    PrintDebugString("in JavaAccessBridge::rendezvousWithNewJavaDLL(%p, %X)",
+    PrintDebugString("in WinAccessBridge::rendezvousWithNewJavaDLL(%p, %X)",
                      JavaBridgeDLLwindow, vmID);
 
     isVMInstanceChainInUse = true;
@@ -880,7 +880,7 @@
         return FALSE;
     }
 
-    PrintDebugString("  in WinAccessBridge::isJavaWindow");
+    PrintDebugString("In WinAccessBridge::isJavaWindow");
 
 
 
--- a/jdk/src/jdk.crypto.pkcs11/share/native/libj2pkcs11/p11_convert.c	Thu Apr 09 12:29:31 2015 +0200
+++ b/jdk/src/jdk.crypto.pkcs11/share/native/libj2pkcs11/p11_convert.c	Mon Aug 17 12:45:16 2015 +0300
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved.
  */
 
 /* Copyright  (c) 2002 Graz University of Technology. All rights reserved.
@@ -474,6 +474,7 @@
     jfieldID fieldID;
     jclass jSsl3RandomDataClass;
     jobject jRandomInfo, jRIClientRandom, jRIServerRandom, jVersion;
+    memset(&ckParam, 0, sizeof(CK_SSL3_MASTER_KEY_DERIVE_PARAMS));
 
     /* get RandomInfo */
     jSsl3MasterKeyDeriveParamsClass = (*env)->FindClass(env, CLASS_SSL3_MASTER_KEY_DERIVE_PARAMS);
@@ -527,6 +528,7 @@
     CK_TLS_PRF_PARAMS ckParam;
     jfieldID fieldID;
     jobject jSeed, jLabel, jOutput;
+    memset(&ckParam, 0, sizeof(CK_TLS_PRF_PARAMS));
 
     // TBD: what if jParam == NULL?!
 
@@ -592,6 +594,7 @@
     jobject jRandomInfo, jRIClientRandom, jRIServerRandom;
     jobject jReturnedKeyMaterial, jRMIvClient, jRMIvServer;
     CK_ULONG ckTemp;
+    memset(&ckParam, 0, sizeof(CK_SSL3_KEY_MAT_PARAMS));
 
     /* get ulMacSizeInBits */
     jSsl3KeyMatParamsClass = (*env)->FindClass(env, CLASS_SSL3_KEY_MAT_PARAMS);
@@ -1355,6 +1358,7 @@
     jlong jHashAlg, jMgf, jSource;
     jobject jSourceData;
     CK_BYTE_PTR ckpByte;
+    memset(&ckParam, 0, sizeof(CK_RSA_PKCS_OAEP_PARAMS));
 
     /* get hashAlg */
     jRsaPkcsOaepParamsClass = (*env)->FindClass(env, CLASS_RSA_PKCS_OAEP_PARAMS);
@@ -1404,6 +1408,7 @@
     jlong jIteration;
     jobject jInitVector, jPassword, jSalt;
     CK_ULONG ckTemp;
+    memset(&ckParam, 0, sizeof(CK_PBE_PARAMS));
 
     /* get pInitVector */
     jPbeParamsClass = (*env)->FindClass(env, CLASS_PBE_PARAMS);
@@ -1522,6 +1527,7 @@
     jfieldID fieldID;
     jlong jSaltSource, jIteration, jPrf;
     jobject jSaltSourceData, jPrfData;
+    memset(&ckParam, 0, sizeof(CK_PKCS5_PBKD2_PARAMS));
 
     /* get saltSource */
     jPkcs5Pbkd2ParamsClass = (*env)->FindClass(env, CLASS_PKCS5_PBKD2_PARAMS);
@@ -1734,6 +1740,7 @@
     jfieldID fieldID;
     jlong jKdf;
     jobject jOtherInfo, jPublicData;
+    memset(&ckParam, 0, sizeof(CK_X9_42_DH1_DERIVE_PARAMS));
 
     /* get kdf */
     jX942Dh1DeriveParamsClass = (*env)->FindClass(env, CLASS_X9_42_DH1_DERIVE_PARAMS);
@@ -1779,6 +1786,7 @@
     jfieldID fieldID;
     jlong jKdf, jPrivateDataLen, jPrivateData;
     jobject jOtherInfo, jPublicData, jPublicData2;
+    memset(&ckParam, 0, sizeof(CK_X9_42_DH2_DERIVE_PARAMS));
 
     /* get kdf */
     jX942Dh2DeriveParamsClass = (*env)->FindClass(env, CLASS_X9_42_DH2_DERIVE_PARAMS);
--- a/jdk/src/jdk.sctp/share/classes/com/sun/nio/sctp/SctpChannel.java	Thu Apr 09 12:29:31 2015 +0200
+++ b/jdk/src/jdk.sctp/share/classes/com/sun/nio/sctp/SctpChannel.java	Mon Aug 17 12:45:16 2015 +0300
@@ -538,11 +538,11 @@
      * {@link java.io.IOException} to be thrown.
      *
      * <P> If this channel is already connected then this method will not block
-     * and will immediately return <tt>true</tt>.  If this channel is in
-     * non-blocking mode then this method will return <tt>false</tt> if the
+     * and will immediately return {@code true}.  If this channel is in
+     * non-blocking mode then this method will return {@code false} if the
      * connection process is not yet complete.  If this channel is in blocking
      * mode then this method will block until the connection either completes
-     * or fails, and will always either return <tt>true</tt> or throw a checked
+     * or fails, and will always either return {@code true} or throw a checked
      * exception describing the failure.
      *
      * <P> This method may be invoked at any time. If a {@link #send send} or {@link #receive receive}
@@ -711,9 +711,9 @@
      * Returns an operation set identifying this channel's supported operations.
      *
      * <P> SCTP channels support connecting, reading, and writing, so this
-     * method returns <tt>(</tt>{@link SelectionKey#OP_CONNECT}
-     * <tt>|</tt>&nbsp;{@link SelectionKey#OP_READ} <tt>|</tt>&nbsp;{@link
-     * SelectionKey#OP_WRITE}<tt>)</tt>.  </p>
+     * method returns {@code (}{@link SelectionKey#OP_CONNECT}
+     * {@code |}&nbsp;{@link SelectionKey#OP_READ} {@code |}&nbsp;{@link
+     * SelectionKey#OP_WRITE}{@code )}.
      *
      * @return  The valid-operation set
      */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/awt/FileDialog/ModalFocus/FileDialogModalFocusTest.java	Mon Aug 17 12:45:16 2015 +0300
@@ -0,0 +1,137 @@
+/*
+ * Copyright (c) 2015, 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 8025815
+   @summary Child FileDialog of modal dialog does not get focus on Gnome
+   @author Semyon Sadetsky
+  */
+
+import javax.swing.*;
+import java.awt.*;
+import java.awt.event.*;
+import java.awt.image.BufferedImage;
+import java.lang.reflect.InvocationTargetException;
+import java.util.concurrent.TimeUnit;
+import java.util.concurrent.locks.Condition;
+import java.util.concurrent.locks.ReentrantLock;
+
+public class FileDialogModalFocusTest {
+    public static void main(String[] args) throws Exception {
+        Frame frame = new Frame();
+        FileDialog fileDialog = new FileDialog((Frame) null);
+        test(frame, fileDialog);
+        frame = new Frame();
+        fileDialog = new FileDialog(frame);
+        test(frame, fileDialog);
+        System.out.println("ok");
+    }
+
+    private static void test(final Frame frame, final FileDialog fileDialog)
+            throws InterruptedException, InvocationTargetException,
+            AWTException {
+        Button button = new Button();
+        button.setBackground(Color.RED);
+        button.addActionListener(new ActionListener() {
+            @Override
+            public void actionPerformed(ActionEvent e) {
+                fileDialog.setVisible(true);
+            }
+        });
+        frame.add(button);
+        frame.setSize(200, 200);
+        EventQueue.invokeAndWait(new Runnable() {
+            @Override
+            public void run() {
+                frame.setVisible(true);
+            }
+        });
+        Robot robot = new Robot();
+        robot.setAutoDelay(200);
+        robot.waitForIdle();
+        Point point = button.getLocationOnScreen();
+        point.translate(100, 100);
+        robot.mouseMove(point.x, point.y);
+        robot.mousePress(InputEvent.BUTTON1_MASK);
+        robot.mouseRelease(InputEvent.BUTTON1_MASK);
+        int delay = 0;
+        while (frame.isFocused() && delay < 2000) {
+            robot.delay(50);
+            delay += 50;
+        }
+        ReentrantLock lock = new ReentrantLock();
+        Condition condition = lock.newCondition();
+        button.addComponentListener(new ComponentAdapter() {
+            @Override
+            public void componentResized(ComponentEvent e) {
+                lock.lock();
+                condition.signal();
+                lock.unlock();
+            }
+        });
+        lock.lock();
+        EventQueue.invokeLater(new Runnable() {
+            @Override
+            public void run() {
+                frame.setExtendedState(JFrame.MAXIMIZED_BOTH);
+            }
+        });
+        condition.await(5, TimeUnit.SECONDS);
+        lock.unlock();
+        robot.delay(200);
+        robot.waitForIdle();
+        EventQueue.invokeAndWait(new Runnable() {
+            @Override
+            public void run() {
+                button.requestFocus();
+                Point p = new Point(button.getWidth() - 10, button.getHeight() - 10);
+                SwingUtilities.convertPointToScreen(p, button);
+                robot.mouseMove(p.x, p.y);
+                robot.mousePress(InputEvent.BUTTON1_MASK);
+                robot.mouseRelease(InputEvent.BUTTON1_MASK);
+            }
+        });
+        robot.waitForIdle();
+        Point p = new Point(100, 100);
+        SwingUtilities.convertPointToScreen(p, button);
+        BufferedImage image = robot.createScreenCapture(
+                new Rectangle(p,
+                        new Dimension(button.getWidth() - 200,
+                                button.getHeight() - 200)));
+        boolean found = false;
+        for (int x = 0; x < image.getWidth(); x+=50) {
+            for (int y = 0; y < image.getHeight(); y+=50) {
+                if( (image.getRGB(x, y) & 0x00FFFF) != 0 ) {
+                    found = true;
+                    break;
+                };
+            }
+        }
+        frame.dispose();
+        robot.waitForIdle();
+        fileDialog.dispose();
+        if(!found) {
+            throw new RuntimeException("file chooser is underneath");
+        }
+    }
+}
\ No newline at end of file
--- a/jdk/test/java/awt/event/KeyEvent/KeyTyped/CtrlASCII.java	Thu Apr 09 12:29:31 2015 +0200
+++ b/jdk/test/java/awt/event/KeyEvent/KeyTyped/CtrlASCII.java	Mon Aug 17 12:45:16 2015 +0300
@@ -257,8 +257,12 @@
     }// start()
     public void punchCtrlKey( Robot ro, int keyCode ) {
         ro.keyPress(KeyEvent.VK_CONTROL);
-        ro.keyPress(keyCode);
-        ro.keyRelease(keyCode);
+        try {
+            ro.keyPress(keyCode);
+            ro.keyRelease(keyCode);
+        }catch(IllegalArgumentException iae) {
+            System.err.println("skip probably invalid keyCode "+keyCode);
+        }
         ro.keyRelease(KeyEvent.VK_CONTROL);
         ro.delay(200);
     }
--- a/jdk/test/java/awt/image/DrawImage/IncorrectClipXorModeSurface2Surface.java	Thu Apr 09 12:29:31 2015 +0200
+++ b/jdk/test/java/awt/image/DrawImage/IncorrectClipXorModeSurface2Surface.java	Mon Aug 17 12:45:16 2015 +0300
@@ -40,7 +40,7 @@
 
 /**
  * @test
- * @bug 8061831
+ * @bug 8061831 8130400
  * @summary Tests drawing volatile image to volatile image using different
  *          clips + xor mode. Results of the blit compatibleImage to
  *          compatibleImage is used for comparison.
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/awt/image/multiresolution/MultiResolutionCachedImageTest.java	Mon Aug 17 12:45:16 2015 +0300
@@ -0,0 +1,113 @@
+/*
+ * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import java.awt.Color;
+import java.awt.Dimension;
+import java.awt.Graphics;
+import java.awt.Image;
+import java.awt.geom.Dimension2D;
+import java.awt.image.BufferedImage;
+import sun.awt.image.MultiResolutionCachedImage;
+
+/**
+ * @test
+ * @bug 8132123
+ * @author Alexander Scherbatiy
+ * @summary MultiResolutionCachedImage unnecessarily creates base image to get
+ *          its size
+ * @modules java.desktop/sun.awt.image
+ * @run main MultiResolutionCachedImageTest
+ */
+public class MultiResolutionCachedImageTest {
+
+    private static final Color TEST_COLOR = Color.BLUE;
+
+    public static void main(String[] args) {
+
+        Image image = new TestMultiResolutionCachedImage(100);
+
+        image.getWidth(null);
+        image.getHeight(null);
+        image.getProperty("comment", null);
+
+        int scaledSize = 50;
+        Image scaledImage = image.getScaledInstance(scaledSize, scaledSize,
+                Image.SCALE_SMOOTH);
+
+        if (!(scaledImage instanceof BufferedImage)) {
+            throw new RuntimeException("Wrong scaled image!");
+        }
+
+        BufferedImage buffScaledImage = (BufferedImage) scaledImage;
+
+        if (buffScaledImage.getWidth() != scaledSize
+                || buffScaledImage.getHeight() != scaledSize) {
+            throw new RuntimeException("Wrong scaled image!");
+        }
+
+        if (buffScaledImage.getRGB(scaledSize / 2, scaledSize / 2) != TEST_COLOR.getRGB()) {
+            throw new RuntimeException("Wrong scaled image!");
+        }
+    }
+
+    private static Dimension2D getDimension(int size) {
+        return new Dimension(size, size);
+    }
+
+    private static Dimension2D[] getSizes(int size) {
+        return new Dimension2D[]{getDimension(size), getDimension(2 * size)};
+    }
+
+    private static Image createImage(int width, int height) {
+        BufferedImage buffImage = new BufferedImage(width, height,
+                BufferedImage.TYPE_INT_RGB);
+        Graphics g = buffImage.createGraphics();
+        g.setColor(TEST_COLOR);
+        g.fillRect(0, 0, width, height);
+        return buffImage;
+    }
+
+    private static class TestMultiResolutionCachedImage
+            extends MultiResolutionCachedImage {
+
+        private final int size;
+
+        public TestMultiResolutionCachedImage(int size) {
+            super(size, size, getSizes(size), (w, h) -> createImage(w, h));
+            this.size = size;
+        }
+
+        @Override
+        public Image getResolutionVariant(int width, int height) {
+            if (width == size || height == size) {
+                throw new RuntimeException("Base image is requested!");
+            }
+            return super.getResolutionVariant(width, height);
+        }
+
+        @Override
+        protected Image getBaseImage() {
+            throw new RuntimeException("Base image is used");
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/beans/Introspector/4058433/TestBeanInfoPriority.java	Mon Aug 17 12:45:16 2015 +0300
@@ -0,0 +1,294 @@
+/*
+ * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+
+import java.awt.event.ActionListener;
+import java.awt.event.MouseListener;
+import java.beans.BeanDescriptor;
+import java.beans.BeanInfo;
+import java.beans.BeanProperty;
+import java.beans.EventSetDescriptor;
+import java.beans.IntrospectionException;
+import java.beans.Introspector;
+import java.beans.JavaBean;
+import java.beans.MethodDescriptor;
+import java.beans.PropertyDescriptor;
+import java.beans.SimpleBeanInfo;
+import javax.swing.SwingContainer;
+import java.util.Arrays;
+
+/**
+ * @test
+ * @bug 4058433 8131055
+ * @summary Check if the user-defined bean info
+ *          is not overridden with the annotated one.
+ * @author a.stepanov
+ */
+
+
+public class TestBeanInfoPriority {
+
+    // ========== test bean (annotations must be ignored!) ==========
+
+    @JavaBean(
+            description = "annotation-description",
+            defaultProperty = "other",
+            defaultEventSet = "mouse")
+    @SwingContainer(value = false)
+    public static class TestClass {
+
+        private int    value;
+        private double other;
+
+        @BeanProperty(
+                bound     = false,
+                expert    = false,
+                hidden    = false,
+                preferred = false,
+                required  = false,
+                visualUpdate = false,
+                description = "annotation-value",
+                enumerationValues = {
+                    "javax.swing.SwingConstants.NORTH"}
+                )
+        public void setValue(int v) { value = v; }
+        public  int getValue()      { return value; }
+
+
+        @BeanProperty(
+            bound     = true,
+            expert    = true,
+            hidden    = true,
+            preferred = true,
+            required  = true,
+            visualUpdate = true,
+            description = "annotation-other",
+            enumerationValues = {
+                "javax.swing.SwingConstants.LEFT",
+                "javax.swing.SwingConstants.RIGHT",
+                "javax.swing.SwingConstants.CENTER"}
+            )
+        public   void setOther(double o) { other = o; }
+        public double getOther()         { return other; }
+
+        public void addActionListener(ActionListener l) {}
+        public void removeActionListener(ActionListener l) {}
+
+        public void addMouseListener(MouseListener l) {}
+        public void removeMouseListener(MouseListener l) {}
+    }
+
+    // ========== user-defined bean info ==========
+
+    public static class TestClassBeanInfo extends SimpleBeanInfo {
+
+        private static final int iOther = 0;
+        private static final int iValue = 1;
+
+        private static final int iAction = 0;
+        private static final int iMouse  = 1;
+
+
+        @Override
+        public BeanDescriptor getBeanDescriptor() {
+
+            BeanDescriptor bd = new BeanDescriptor(TestClass.class, null);
+            bd.setShortDescription("user-defined-description");
+            bd.setValue("isContainer", true);
+            bd.setValue("containerDelegate", "user-defined-delegate");
+
+            return bd;
+        }
+
+        @Override
+        public PropertyDescriptor[] getPropertyDescriptors() {
+
+            PropertyDescriptor[] p = new PropertyDescriptor[2];
+
+            try {
+
+                // value
+                PropertyDescriptor pdValue = new PropertyDescriptor(
+                    "value", TestClass.class, "getValue", "setValue");
+                pdValue.setBound(true);
+                pdValue.setConstrained(true);
+                pdValue.setExpert(true);
+                pdValue.setHidden(true);
+                pdValue.setPreferred(true);
+                pdValue.setValue("required", true);
+                pdValue.setValue("visualUpdate", true);
+                pdValue.setShortDescription("user-defined-value");
+                pdValue.setValue("enumerationValues", new Object[]{
+                        "EAST", 3, "javax.swing.SwingConstants.EAST",
+                        "WEST", 7, "javax.swing.SwingConstants.WEST"});
+                p[iValue] = pdValue;
+
+                // other
+                PropertyDescriptor pdOther = new PropertyDescriptor(
+                        "other", TestClass.class, "getOther", "setOther");
+                pdOther.setBound(false);
+                pdOther.setConstrained(false);
+                pdOther.setExpert(false);
+                pdOther.setHidden(false);
+                pdOther.setPreferred(false);
+                pdOther.setValue("required", false);
+                pdOther.setValue("visualUpdate", false);
+                pdOther.setShortDescription("user-defined-other");
+                pdOther.setValue("enumerationValues", new Object[]{
+                        "TOP", 1, "javax.swing.SwingConstants.TOP"});
+                p[iOther] = pdOther;
+
+            } catch(IntrospectionException e) {
+                e.printStackTrace();
+            }
+
+            return p;
+        }
+
+        @Override
+        public EventSetDescriptor[] getEventSetDescriptors() {
+            EventSetDescriptor[] es = new EventSetDescriptor[2];
+            try {
+                es[iAction] = new EventSetDescriptor(
+                        TestClass.class,
+                        "actionListener",
+                        java.awt.event.ActionListener.class,
+                        new String[] {"actionPerformed"},
+                        "addActionListener",
+                        "removeActionListener");
+                es[iMouse] = new EventSetDescriptor(
+                        TestClass.class,
+                        "mouseListener",
+                        java.awt.event.MouseListener.class,
+                        new String[] {"mouseClicked", "mousePressed", "mouseReleased", "mouseEntered", "mouseExited"},
+                        "addMouseListener",
+                        "removeMouseListener");
+            } catch(IntrospectionException e) {
+                e.printStackTrace();
+            }
+            return es;
+        }
+
+        @Override
+        public MethodDescriptor[] getMethodDescriptors() {
+            MethodDescriptor[] m = new MethodDescriptor[0];
+            return m;
+        }
+
+        @Override
+        public int getDefaultPropertyIndex() { return iValue; } // default: value
+
+        @Override
+        public int getDefaultEventIndex() { return iAction; } // default: action
+
+        @Override
+        public java.awt.Image getIcon(int iconKind) { return null; }
+    }
+
+    // ========== auxiliary functions ==========
+
+    static void checkEq(String what, Object v, Object ref) throws Exception {
+
+        if ((v != null) && v.equals(ref)) {
+            System.out.println(what + ": ok (" + ref.toString() + ")");
+        } else {
+            throw new Exception(
+                "invalid " + what + ", expected: \"" + ref + "\", got: \"" + v + "\"");
+        }
+    }
+
+    static void checkEnumEq(String what, Object v, Object ref[]) throws Exception {
+
+        what = "\"" + what + "\"";
+        if (v == null) {
+            throw new Exception("null " + what + " enumeration values");
+        }
+
+        String msg = "invalid " + what + " enumeration values";
+        if (!(v instanceof Object[])) { throw new Exception(msg); }
+
+        if (Arrays.equals((Object []) v, ref)) {
+            System.out.println(what + " enumeration values: ok");
+        } else { throw new Exception(msg); }
+    }
+
+
+    // ========== test ==========
+
+
+    public static void main(String[] args) throws Exception {
+
+        BeanInfo i = Introspector.getBeanInfo(TestClass.class, Object.class);
+        BeanDescriptor bd = i.getBeanDescriptor();
+
+        checkEq("description", bd.getShortDescription(), "user-defined-description");
+        checkEq("default property index", i.getDefaultPropertyIndex(), 1);
+        checkEq("default event index", i.getDefaultEventIndex(), 0);
+
+        checkEq("isContainer", i.getBeanDescriptor().getValue("isContainer"), true);
+        checkEq("containerDelegate",
+            i.getBeanDescriptor().getValue("containerDelegate"), "user-defined-delegate");
+        System.out.println("");
+
+        PropertyDescriptor[] pds = i.getPropertyDescriptors();
+        for (PropertyDescriptor pd: pds) {
+            String name = pd.getName();
+            switch (name) {
+                case "value":
+                    checkEq("\"value\" isBound",       pd.isBound(),       true);
+                    checkEq("\"value\" isConstrained", pd.isConstrained(), true);
+                    checkEq("\"value\" isExpert",      pd.isExpert(),      true);
+                    checkEq("\"value\" isHidden",      pd.isHidden(),      true);
+                    checkEq("\"value\" isPreferred",   pd.isPreferred(),   true);
+                    checkEq("\"value\" required",      pd.getValue("required"),     true);
+                    checkEq("\"value\" visualUpdate",  pd.getValue("visualUpdate"), true);
+
+                    checkEq("\"value\" description",   pd.getShortDescription(), "user-defined-value");
+
+                    checkEnumEq(pd.getName(), pd.getValue("enumerationValues"),
+                        new Object[]{
+                        "EAST", 3, "javax.swing.SwingConstants.EAST",
+                        "WEST", 7, "javax.swing.SwingConstants.WEST"});
+                    System.out.println("");
+                    break;
+                case "other":
+                    checkEq("\"other\" isBound",       pd.isBound(),       false);
+                    checkEq("\"other\" isConstrained", pd.isConstrained(), false);
+                    checkEq("\"other\" isExpert",      pd.isExpert(),      false);
+                    checkEq("\"other\" isHidden",      pd.isHidden(),      false);
+                    checkEq("\"other\" isPreferred",   pd.isPreferred(),   false);
+                    checkEq("\"other\" required",      pd.getValue("required"),     false);
+                    checkEq("\"other\" visualUpdate",  pd.getValue("visualUpdate"), false);
+
+                    checkEq("\"other\" description",   pd.getShortDescription(), "user-defined-other");
+
+                    checkEnumEq(pd.getName(), pd.getValue("enumerationValues"),
+                        new Object[]{"TOP", 1, "javax.swing.SwingConstants.TOP"});
+                    System.out.println("");
+                    break;
+                default:
+                    throw new Exception("invalid property descriptor: " + name);
+            }
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/beans/Introspector/8130937/TestBooleanBeanProperties.java	Mon Aug 17 12:45:16 2015 +0300
@@ -0,0 +1,380 @@
+/*
+ * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import java.beans.BeanProperty;
+import java.beans.PropertyChangeListener;
+import java.beans.PropertyChangeSupport;
+import java.beans.PropertyDescriptor;
+
+/**
+ * @test
+ * @bug 8130937
+ * @summary Tests the booleans properties of the BeanProperty annotation
+ * @library ..
+ */
+public final class TestBooleanBeanProperties {
+
+    public static void main(final String[] args) {
+        test(Empty.class, false, false, false, false, false, false);
+        test(BoundTrue.class, false, false, false, false, false, false);
+        test(BoundFalse.class, false, false, false, false, false, false);
+        test(BoundListener.class, true, false, false, false, false, false);
+        test(BoundFalseListener.class, false, false, false, false, false, false);
+        test(BoundTrueListener.class, true, false, false, false, false, false);
+        test(ExpertTrue.class, false, true, false, false, false, false);
+        test(ExpertFalse.class, false, false, false, false, false, false);
+        test(HiddenTrue.class, false, false, true, false, false, false);
+        test(HiddenFalse.class, false, false, false, false, false, false);
+        test(PreferredTrue.class, false, false, false, true, false, false);
+        test(PreferredFalse.class, false, false, false, false, false, false);
+        test(RequiredTrue.class, false, false, false, false, true, false);
+        test(RequiredFalse.class, false, false, false, false, false, false);
+        test(VisualUpdateTrue.class, false, false, false, false, false, true);
+        test(VisualUpdateFalse.class, false, false, false, false, false, false);
+        test(All.class, true, true, true, true, true, true);
+    }
+
+    private static void test(Class<?> cls, boolean isBound, boolean isExpert,
+                             boolean isHidden, boolean isPref, boolean isReq,
+                             boolean isVS) {
+        PropertyDescriptor pd = BeanUtils.getPropertyDescriptor(cls, "value");
+        if (pd.isBound() != isBound) {
+            throw new RuntimeException("isBound should be: " + isBound);
+        }
+        if (pd.isExpert() != isExpert || getValue(pd, "expert") != isExpert) {
+            throw new RuntimeException("isExpert should be:" + isExpert);
+        }
+        if (pd.isHidden() != isHidden || getValue(pd, "hidden") != isHidden) {
+            throw new RuntimeException("isHidden should be: " + isHidden);
+        }
+        if (pd.isPreferred() != isPref) {
+            throw new RuntimeException("isPreferred should be: " + isPref);
+        }
+        if (getValue(pd, "required") != isReq) {
+            throw new RuntimeException("required should be: " + isReq);
+        }
+        if (getValue(pd, "visualUpdate") != isVS) {
+            throw new RuntimeException("required should be: " + isVS);
+        }
+    }
+
+    private static boolean getValue(PropertyDescriptor pd, String value) {
+        return (boolean) pd.getValue(value);
+    }
+    ////////////////////////////////////////////////////////////////////////////
+
+    public static final class Empty {
+
+        private int value;
+
+        public int getValue() {
+            return value;
+        }
+
+        public void setValue(int value) {
+            this.value = value;
+        }
+    }
+
+    public static final class All {
+
+        private int value;
+
+        private PropertyChangeSupport pcs = new PropertyChangeSupport(this);
+
+        public int getValue() {
+            return value;
+        }
+
+        @BeanProperty(bound = true, expert = true, hidden = true,
+                      preferred = true, required = true, visualUpdate = true)
+        public void setValue(int value) {
+            this.value = value;
+        }
+
+        public void addPropertyChangeListener(PropertyChangeListener l) {
+            pcs.addPropertyChangeListener(l);
+        }
+
+        public void removePropertyChangeListener(PropertyChangeListener l) {
+            pcs.removePropertyChangeListener(l);
+        }
+    }
+    ////////////////////////////////////////////////////////////////////////////
+    // bound property
+    ////////////////////////////////////////////////////////////////////////////
+
+    public static final class BoundTrue {
+
+        private int value;
+
+        public int getValue() {
+            return value;
+        }
+
+        @BeanProperty(bound = true)
+        public void setValue(int value) {
+            this.value = value;
+        }
+    }
+
+    public static final class BoundFalse {
+
+        private int value;
+
+        public int getValue() {
+            return value;
+        }
+
+        @BeanProperty(bound = false)
+        public void setValue(int value) {
+            this.value = value;
+        }
+    }
+
+    public static final class BoundListener {
+
+        private PropertyChangeSupport pcs = new PropertyChangeSupport(this);
+
+        private int value;
+
+        public int getValue() {
+            return value;
+        }
+
+        public void setValue(int value) {
+            this.value = value;
+        }
+
+        public void addPropertyChangeListener(PropertyChangeListener l) {
+            pcs.addPropertyChangeListener(l);
+        }
+
+        public void removePropertyChangeListener(PropertyChangeListener l) {
+            pcs.removePropertyChangeListener(l);
+        }
+    }
+
+    public static final class BoundFalseListener {
+
+        private PropertyChangeSupport pcs = new PropertyChangeSupport(this);
+
+        private int value;
+
+        public int getValue() {
+            return value;
+        }
+
+        @BeanProperty(bound = false)
+        public void setValue(int value) {
+            this.value = value;
+        }
+
+        public void addPropertyChangeListener(PropertyChangeListener l) {
+            pcs.addPropertyChangeListener(l);
+        }
+
+        public void removePropertyChangeListener(PropertyChangeListener l) {
+            pcs.removePropertyChangeListener(l);
+        }
+    }
+
+    public static final class BoundTrueListener {
+
+        private PropertyChangeSupport pcs = new PropertyChangeSupport(this);
+
+        private int value;
+
+        public int getValue() {
+            return value;
+        }
+
+        @BeanProperty(bound = true)
+        public void setValue(int value) {
+            this.value = value;
+        }
+
+        public void addPropertyChangeListener(PropertyChangeListener l) {
+            pcs.addPropertyChangeListener(l);
+        }
+
+        public void removePropertyChangeListener(PropertyChangeListener l) {
+            pcs.removePropertyChangeListener(l);
+        }
+    }
+    ////////////////////////////////////////////////////////////////////////////
+    // expert property
+    ////////////////////////////////////////////////////////////////////////////
+
+    public static final class ExpertTrue {
+
+        private int value;
+
+        public int getValue() {
+            return value;
+        }
+
+        @BeanProperty(expert = true)
+        public void setValue(int value) {
+            this.value = value;
+        }
+    }
+
+    public static final class ExpertFalse {
+
+        private int value;
+
+        public int getValue() {
+            return value;
+        }
+
+        @BeanProperty(expert = false)
+        public void setValue(int value) {
+            this.value = value;
+        }
+    }
+    ////////////////////////////////////////////////////////////////////////////
+    // hidden property
+    ////////////////////////////////////////////////////////////////////////////
+
+    public static final class HiddenTrue {
+
+        private int value;
+
+        public int getValue() {
+            return value;
+        }
+
+        @BeanProperty(hidden = true)
+        public void setValue(int value) {
+            this.value = value;
+        }
+    }
+
+    public static final class HiddenFalse {
+
+        private int value;
+
+        public int getValue() {
+            return value;
+        }
+
+        @BeanProperty(hidden = false)
+        public void setValue(int value) {
+            this.value = value;
+        }
+    }
+    ////////////////////////////////////////////////////////////////////////////
+    // preferred property
+    ////////////////////////////////////////////////////////////////////////////
+
+    public static final class PreferredTrue {
+
+        private int value;
+
+        public int getValue() {
+            return value;
+        }
+
+        @BeanProperty(preferred = true)
+        public void setValue(int value) {
+            this.value = value;
+        }
+    }
+
+    public static final class PreferredFalse {
+
+        private int value;
+
+        public int getValue() {
+            return value;
+        }
+
+        @BeanProperty(preferred = false)
+        public void setValue(int value) {
+            this.value = value;
+        }
+    }
+    ////////////////////////////////////////////////////////////////////////////
+    // required property
+    ////////////////////////////////////////////////////////////////////////////
+
+    public static final class RequiredTrue {
+
+        private int value;
+
+        public int getValue() {
+            return value;
+        }
+
+        @BeanProperty(required = true)
+        public void setValue(int value) {
+            this.value = value;
+        }
+    }
+
+    public static final class RequiredFalse {
+
+        private int value;
+
+        public int getValue() {
+            return value;
+        }
+
+        @BeanProperty(required = false)
+        public void setValue(int value) {
+            this.value = value;
+        }
+    }
+    ////////////////////////////////////////////////////////////////////////////
+    // visualUpdate property
+    ////////////////////////////////////////////////////////////////////////////
+
+    public static final class VisualUpdateTrue {
+
+        private int value;
+
+        public int getValue() {
+            return value;
+        }
+
+        @BeanProperty(visualUpdate = true)
+        public void setValue(int value) {
+            this.value = value;
+        }
+    }
+
+    public static final class VisualUpdateFalse {
+
+        private int value;
+
+        public int getValue() {
+            return value;
+        }
+
+        @BeanProperty(visualUpdate = false)
+        public void setValue(int value) {
+            this.value = value;
+        }
+    }
+}
--- a/jdk/test/java/beans/Performance/Test4058433.java	Thu Apr 09 12:29:31 2015 +0200
+++ b/jdk/test/java/beans/Performance/Test4058433.java	Mon Aug 17 12:45:16 2015 +0300
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -33,6 +33,14 @@
 import java.beans.PropertyDescriptor;
 import java.lang.reflect.Array;
 import java.lang.reflect.Method;
+import java.net.URI;
+import java.nio.file.FileSystem;
+import java.nio.file.FileSystems;
+import java.nio.file.FileVisitResult;
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.nio.file.SimpleFileVisitor;
+import java.nio.file.attribute.BasicFileAttributes;
 import java.util.Arrays;
 import java.util.Comparator;
 import java.util.Enumeration;
@@ -40,19 +48,13 @@
 import java.util.Objects;
 import java.util.TreeMap;
 import java.util.TreeSet;
-import java.util.jar.JarEntry;
-import java.util.jar.JarFile;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
 
 /*
  * @test
  * @bug 4058433
  * @summary Generates BeanInfo for public classes in AWT, Accessibility, and Swing
  * @author Sergey Malenkov
- * @run main/manual Test4058433
  */
-
 public class Test4058433 implements Comparator<Object> {
     @Override
     public int compare(Object one, Object two) {
@@ -76,31 +78,41 @@
     }
 
     public static void main(String[] args) throws Exception {
-        String resource = ClassLoader.getSystemResource("java/lang/Object.class").toString();
-
-        Pattern pattern = Pattern.compile("jar:file:(.*)!.*");
-        Matcher matcher = pattern.matcher(resource);
-        matcher.matches();
-        resource = matcher.group(1);
+        FileSystem fs = FileSystems.getFileSystem(URI.create("jrt:/"));
+        fs.getFileStores();
 
         TreeSet<Class<?>> types = new TreeSet<>(new Test4058433());
-        try (JarFile jarFile = new JarFile(resource.replaceAll("%20", " "))) {
-            Enumeration<JarEntry> entries = jarFile.entries();
-            while (entries.hasMoreElements()) {
-                String name = entries.nextElement().getName();
-                if (name.startsWith("java/awt/") || name.startsWith("javax/accessibility/") || name.startsWith("javax/swing/")) {
+        Files.walkFileTree(fs.getPath("/modules/java.desktop"), new SimpleFileVisitor<Path>() {
+            @Override
+            public FileVisitResult visitFile(Path file,
+                                             BasicFileAttributes attrs) {
+                file = file.subpath(2, file.getNameCount());
+                if (file.startsWith("java/awt/")
+                        || file.startsWith("javax/accessibility/")
+                        || file.startsWith("javax/swing/")) {
+                    String name =file.toString();
                     if (name.endsWith(".class")) {
                         name = name.substring(0, name.indexOf(".")).replace('/', '.');
-                        Class<?> type = Class.forName(name);
-                        if (!type.isInterface() && !type.isEnum() && !type.isAnnotation() && !type.isAnonymousClass()) {
+
+                        final Class<?> type;
+                        try {
+                            type = Class.forName(name);
+                        } catch (ClassNotFoundException e) {
+                            throw new RuntimeException(e);
+                        }
+                        if (!BeanInfo.class.isAssignableFrom(type) && !type.isInterface()
+                            && !type.isEnum() && !type.isAnnotation()
+                            && !type.isAnonymousClass()) {
                             if (null == type.getDeclaringClass()) {
                                 types.add(type);
                             }
                         }
                     }
                 }
+                return FileVisitResult.CONTINUE;
             }
-        }
+        });
+
         System.out.println("found " + types.size() + " classes");
         long time = -System.currentTimeMillis();
         for (Class<?> type : types) {
--- a/jdk/test/java/nio/file/FileSystem/Basic.java	Thu Apr 09 12:29:31 2015 +0200
+++ b/jdk/test/java/nio/file/FileSystem/Basic.java	Mon Aug 17 12:45:16 2015 +0300
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2008, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2008, 2015, 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
@@ -22,17 +22,23 @@
  */
 
 /* @test
- * @bug 4313887 6838333
+ * @bug 4313887 6838333 8132497
  * @summary Unit test for java.nio.file.FileSystem
- * @library ..
+ * @library .. /lib/testlibrary
+ * @build jdk.testlibrary.FileUtils
+ * @run main/othervm Basic
  */
 
+import java.io.File;
 import java.nio.file.*;
-import java.nio.file.attribute.*;
 import java.io.IOException;
+import java.net.URI;
+import java.net.URISyntaxException;
+import java.util.HashMap;
+import jdk.testlibrary.FileUtils;
 
 /**
- * Simple santity checks for java.nio.file.FileSystem
+ * Simple sanity checks for java.nio.file.FileSystem
  */
 public class Basic {
 
@@ -48,7 +54,25 @@
         }
     }
 
-    public static void main(String[] args) throws IOException {
+    static void checkNoUOE() throws IOException, URISyntaxException {
+        String dir = System.getProperty("test.dir", ".");
+        String fileName = dir + File.separator + "foo.bar";
+        Path path = Paths.get(fileName);
+        Path file = Files.createFile(path);
+        try {
+            URI uri = new URI("jar", file.toUri().toString(), null);
+            System.out.println(uri);
+            FileSystem fs = FileSystems.newFileSystem(uri, new HashMap());
+            fs.close();
+        } catch (ProviderNotFoundException pnfe) {
+            System.out.println("Expected ProviderNotFoundException caught: "
+                + "\"" + pnfe.getMessage() + "\"");
+        } finally {
+            FileUtils.deleteFileWithRetry(path);
+        }
+    }
+
+    public static void main(String[] args) throws IOException, URISyntaxException {
         FileSystem fs = FileSystems.getDefault();
 
         // close should throw UOE
@@ -80,5 +104,9 @@
             checkSupported(fs, "posix", "unix", "owner");
         if (os.equals("Windows"))
             checkSupported(fs, "owner", "dos", "acl", "user");
+
+        // sanity check non-throwing of UnsupportedOperationException by
+        // FileSystems.newFileSystem(URI, ..)
+        checkNoUOE();
     }
 }
--- a/jdk/test/java/nio/file/Files/StreamTest.java	Thu Apr 09 12:29:31 2015 +0200
+++ b/jdk/test/java/nio/file/Files/StreamTest.java	Mon Aug 17 12:45:16 2015 +0300
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2015, 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
@@ -22,7 +22,7 @@
  */
 
 /* @test
- * @bug 8006884 8019526
+ * @bug 8006884 8019526 8132539
  * @library ..
  * @build PassThroughFileSystem FaultyFileSystem
  * @run testng StreamTest
@@ -685,4 +685,18 @@
             // expected
         }
     }
+
+    public void testProcFile() throws IOException {
+        if (System.getProperty("os.name").equals("Linux")) {
+            Path path = Paths.get("/proc/cpuinfo");
+            if (Files.exists(path)) {
+                String NEW_LINE = System.getProperty("line.separator");
+                String s =
+                    Files.lines(path).collect(Collectors.joining(NEW_LINE));
+                if (s.length() == 0) {
+                    fail("Files.lines(\"" + path + "\") returns no data");
+                }
+            }
+        }
+    }
 }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/nio/file/Files/probeContentType/ParallelProbes.java	Mon Aug 17 12:45:16 2015 +0300
@@ -0,0 +1,97 @@
+/*
+ * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import java.io.IOException;
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.util.ArrayList;
+
+/* @test
+ * @summary Test probing content type simultaneously from multiple threads.
+ * @requires (os.family == "linux") | (os.family == "solaris")
+ * @build ParallelProbes SimpleFileTypeDetector
+ * @run main/othervm ParallelProbes 10
+ */
+public class ParallelProbes {
+
+    private static final int REPEATS = 1000;
+
+    private int numThreads = 0;
+    private ArrayList<Thread> threads;
+
+    public ParallelProbes(int numThreads) {
+        System.out.println("Using <" + numThreads + "> threads.");
+        this.numThreads = numThreads;
+        this.threads = new ArrayList<Thread>(numThreads);
+    }
+
+    private Path createTmpFile() throws IOException {
+        final Path p = Files.createTempFile("prefix", ".json");
+        Files.write(p, "{\"test\"}".getBytes());
+        System.out.println("Write test file <" + p + ">");
+        return p;
+    }
+
+    private Runnable createRunnable(final Path p) {
+        Runnable r = new Runnable() {
+            public void run() {
+                for (int i = 0; i < REPEATS; i++) {
+                    try {
+                        System.out.println(Thread.currentThread().getName()
+                            + " -> " + Files.probeContentType(p));
+                    } catch (IOException ioException) {
+                        ioException.printStackTrace();
+                    }
+                }
+            }
+        };
+        return r;
+    }
+
+    public void start() throws IOException {
+        for (int i = 0; i < numThreads; i++) {
+            final Path p = createTmpFile();
+            Runnable r = createRunnable(p);
+            Thread thread = new Thread(r, "thread-" + i);
+            thread.start();
+            threads.add(thread);
+        }
+    }
+
+    public void join() {
+        for (Thread thread : threads) {
+            try {
+                thread.join();
+            } catch (InterruptedException e) {
+                // ignore it and proceed to the next one
+            }
+        }
+    }
+
+    public static void main(String[] args) throws Exception {
+        ParallelProbes probes =
+            new ParallelProbes(args.length < 1 ? 1 : Integer.parseInt(args[0]));
+        probes.start();
+        probes.join();
+    }
+}
--- a/jdk/test/java/util/TimeZone/CLDRDisplayNamesTest.java	Thu Apr 09 12:29:31 2015 +0200
+++ b/jdk/test/java/util/TimeZone/CLDRDisplayNamesTest.java	Mon Aug 17 12:45:16 2015 +0300
@@ -109,9 +109,6 @@
             fmtROOT.parse("Thu Nov 13 04:35:51 AKST 2008");
             fmtUS.parse("Thu Nov 13 04:35:51 AKST 2008");
             fmtUK.parse("Thu Nov 13 04:35:51 GMT-09:00 2008");
-            String dateString = new Date().toString();
-            System.out.println("Date: "+dateString);
-            System.out.println("Parsed Date: "+new Date(Date.parse(dateString)).toString());
         } catch (ParseException pe) {
             System.err.println(pe);
             errors++;
--- a/jdk/test/java/util/concurrent/locks/ReentrantLock/TimeoutLockLoops.java	Thu Apr 09 12:29:31 2015 +0200
+++ b/jdk/test/java/util/concurrent/locks/ReentrantLock/TimeoutLockLoops.java	Mon Aug 17 12:45:16 2015 +0300
@@ -35,6 +35,7 @@
  * @test
  * @bug 4486658 5031862
  * @run main TimeoutLockLoops
+ * @key intermittent
  * @summary Checks for responsiveness of locks to timeouts.
  * Runs under the assumption that ITERS computations require more than
  * TIMEOUT msecs to complete, which seems to be a safe assumption for
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/javax/crypto/SealedObject/TestSealedObjectNull.java	Mon Aug 17 12:45:16 2015 +0300
@@ -0,0 +1,57 @@
+/*
+ * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import java.io.IOException;
+import javax.crypto.BadPaddingException;
+import javax.crypto.Cipher;
+import javax.crypto.IllegalBlockSizeException;
+import javax.crypto.NullCipher;
+import javax.crypto.SealedObject;
+
+/*
+ * @test
+ * @bug 8048624
+ * @summary This test instantiate a NullCipher, seal and unseal a String
+ *  object using the SealedObject with the initialized NullCipher,
+ *  and then compare the String content.
+ */
+public class TestSealedObjectNull {
+
+    private static final String SEAL_STR = "Any String!@#$%^";
+
+    public static void main(String[] args) throws IOException,
+            IllegalBlockSizeException, ClassNotFoundException,
+            BadPaddingException {
+        Cipher nullCipher = new NullCipher();
+
+        // Seal
+        SealedObject so = new SealedObject(SEAL_STR, nullCipher);
+
+        // Unseal and compare
+        if (!(SEAL_STR.equals(so.getObject(nullCipher)))) {
+            throw new RuntimeException("Unseal and compare failed.");
+        }
+
+        System.out.println("Test passed.");
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/javax/sound/sampled/FileReader/AudioFileClose.java	Mon Aug 17 12:45:16 2015 +0300
@@ -0,0 +1,54 @@
+/*
+ * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import java.io.File;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.nio.file.Files;
+import java.nio.file.Paths;
+
+import javax.sound.sampled.AudioSystem;
+import javax.sound.sampled.UnsupportedAudioFileException;
+
+/**
+ * @test
+ * @bug 8013586
+ * @author Sergey Bylokhov
+ */
+public final class AudioFileClose {
+
+    public static void main(final String[] args) throws Exception {
+        final File file = Files.createTempFile("JavaSound", "Test").toFile();
+        try (OutputStream fos = new FileOutputStream(file)) {
+            fos.write(new byte[200]);
+        }
+        try {
+            final InputStream stream = AudioSystem.getAudioInputStream(file);
+            stream.close();
+        } catch (final IOException | UnsupportedAudioFileException ignored) {
+        }
+        Files.delete(Paths.get(file.getAbsolutePath()));
+    }
+}
--- a/jdk/test/javax/sound/sampled/FileReader/ReadersExceptions.java	Thu Apr 09 12:29:31 2015 +0200
+++ b/jdk/test/javax/sound/sampled/FileReader/ReadersExceptions.java	Mon Aug 17 12:45:16 2015 +0300
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2015, 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
@@ -21,17 +21,19 @@
  * questions.
  */
 
-
 import java.io.ByteArrayInputStream;
 import java.io.IOException;
 import java.io.InputStream;
 
 import javax.sound.sampled.AudioSystem;
 import javax.sound.sampled.UnsupportedAudioFileException;
+import javax.sound.sampled.spi.AudioFileReader;
+
+import static java.util.ServiceLoader.load;
 
 /**
  * @test
- * @bug 7058662 7058666 7058672
+ * @bug 7058662 7058666 7058672 8130305
  * @author Sergey Bylokhov
  */
 public final class ReadersExceptions {
@@ -111,16 +113,18 @@
              0, 0, 0, 0, // dataLength
             };
 
+    static byte[][] data = {wrongAIFFCh, wrongAIFFSSL, wrongAIFFSSH, wrongAUCh,
+                            wrongWAVCh, wrongWAVSSB};
+
     public static void main(final String[] args) throws IOException {
-        test(wrongAIFFCh);
-        test(wrongAIFFSSL);
-        test(wrongAIFFSSH);
-        test(wrongAUCh);
-        test(wrongWAVCh);
-        test(wrongWAVSSB);
+        for (final byte[] bytes : data) {
+            testAS(bytes);
+            testAFR(bytes);
+        }
     }
 
-    private static void test(final byte[] buffer) throws IOException {
+    private static void testAS(final byte[] buffer) throws IOException {
+        // AudioSystem API
         final InputStream is = new ByteArrayInputStream(buffer);
         try {
             AudioSystem.getAudioFileFormat(is);
@@ -130,4 +134,19 @@
         }
         throw new RuntimeException("Test Failed");
     }
+
+    private static void testAFR(final byte[] buffer) throws IOException {
+        // AudioFileReader API
+        final InputStream is = new ByteArrayInputStream(buffer);
+        for (final AudioFileReader afr : load(AudioFileReader.class)) {
+            for (int i = 0; i < 10; ++i) {
+                try {
+                    afr.getAudioFileFormat(is);
+                    throw new RuntimeException("UAFE expected");
+                } catch (final UnsupportedAudioFileException ignored) {
+                    // Expected.
+                }
+            }
+        }
+    }
 }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/javax/swing/JInternalFrame/SetLayerNPE/SetLayerNPE.java	Mon Aug 17 12:45:16 2015 +0300
@@ -0,0 +1,55 @@
+/*
+ * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import java.awt.EventQueue;
+
+import javax.swing.JDesktopPane;
+import javax.swing.JInternalFrame;
+
+/**
+ * @test
+ * @bug 6206439
+ */
+public final class SetLayerNPE {
+
+    public static void main(final String[] args) throws Exception {
+        EventQueue.invokeAndWait(() -> {
+            try {
+                // JInternalFrame without parent
+                new JInternalFrame("My Frame").setLayer(null);
+                throw new AssertionError("expected NPE was not thrown");
+            } catch (final NullPointerException ignored) {
+            }
+        });
+        EventQueue.invokeAndWait(() -> {
+            try {
+                // JInternalFrame with parent
+                JInternalFrame jif = new JInternalFrame("My Frame");
+                new JDesktopPane().add(jif);
+                jif.setLayer(null);
+                throw new AssertionError("expected NPE was not thrown");
+            } catch (final NullPointerException ignored) {
+            }
+        });
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/javax/swing/JSplitPane/8132123/bug8132123.html	Mon Aug 17 12:45:16 2015 +0300
@@ -0,0 +1,38 @@
+<!--
+ Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+
+ This code is free software; you can redistribute it and/or modify it
+ under the terms of the GNU General Public License version 2 only, as
+ published by the Free Software Foundation.
+
+ This code is distributed in the hope that it will be useful, but WITHOUT
+ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ version 2 for more details (a copy is included in the LICENSE file that
+ accompanied this code).
+
+ You should have received a copy of the GNU General Public License version
+ 2 along with this work; if not, write to the Free Software Foundation,
+ Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+
+ Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ or visit www.oracle.com if you need additional information or have any
+ questions.
+-->
+
+<html>
+<body>
+Verify that JSplitPane uses high-resolution system icons for the one-touch expanding
+buttons on HiDPI displays.
+
+If the display does not support HiDPI mode press PASS.
+
+1. Run the test on HiDPI Display.
+2. Check that the one-touch expanding buttons on the JSplitPane are painted
+correctly. If so, press PASS, else press FAIL.
+
+<applet  code="bug8132123.class" width=250 height=250></applet>
+
+</body>
+</html>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/javax/swing/JSplitPane/8132123/bug8132123.java	Mon Aug 17 12:45:16 2015 +0300
@@ -0,0 +1,51 @@
+/*
+ * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+import java.awt.Color;
+import javax.swing.JApplet;
+import javax.swing.JPanel;
+import javax.swing.JSplitPane;
+import javax.swing.SwingUtilities;
+
+/* @test
+ * @bug 8132123
+ * @summary MultiResolutionCachedImage unnecessarily creates base image
+ *           to get its size
+ * @author Alexander Scherbatiy
+ * @run applet/manual=yesno bug8132123.html
+ */
+public class bug8132123 extends JApplet {
+
+    @Override
+    public void init() {
+        SwingUtilities.invokeLater(() -> {
+            JPanel left = new JPanel();
+            left.setBackground(Color.GRAY);
+            JPanel right = new JPanel();
+            right.setBackground(Color.GRAY);
+            JSplitPane splitPane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT,
+                    left, right);
+            splitPane.setOneTouchExpandable(true);
+            getContentPane().add(splitPane);
+        });
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/javax/swing/JTextPane/JTextPaneDocumentAlignment.java	Mon Aug 17 12:45:16 2015 +0300
@@ -0,0 +1,99 @@
+/*
+ * Copyright (c) 2015, 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 8132136
+   @summary [PIT] RTL orientation in JEditorPane is broken
+   @author Semyon Sadetsky
+  */
+
+import javax.swing.*;
+import javax.swing.text.BadLocationException;
+import javax.swing.text.SimpleAttributeSet;
+import javax.swing.text.StyleConstants;
+import java.awt.*;
+
+public class JTextPaneDocumentAlignment {
+
+    private static JFrame frame;
+    private static JTextPane jTextPane;
+    private static int position;
+
+    public static void main(String[] args) throws Exception{
+        SwingUtilities.invokeAndWait(new Runnable() {
+            @Override
+            public void run() {
+                frame = new JFrame();
+                frame.setUndecorated(true);
+                frame.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
+                frame.setSize(200, 200);
+                jTextPane = new JTextPane();
+                jTextPane.setContentType("text/html");
+                jTextPane.setText(
+                        "<html><body><b id='test'>Test</b></body></html>");
+                SimpleAttributeSet right = new SimpleAttributeSet();
+                StyleConstants.setAlignment(right, StyleConstants.ALIGN_RIGHT);
+                jTextPane.getStyledDocument()
+                        .setParagraphAttributes(0, 10, right, true);
+                frame.getContentPane().add(jTextPane);
+                frame.setVisible(true);
+            }
+        });
+        Robot robot = new Robot();
+        robot.waitForIdle();
+        robot.delay(200);
+        SwingUtilities.invokeAndWait(new Runnable() {
+            @Override
+            public void run() {
+                try {
+                    position = jTextPane.modelToView(1).x;
+                    SimpleAttributeSet center = new SimpleAttributeSet();
+                    StyleConstants.setAlignment(center,
+                            StyleConstants.ALIGN_CENTER);
+                    jTextPane.getStyledDocument()
+                            .setParagraphAttributes(0, 10, center, true);
+                } catch (BadLocationException e) {
+                    e.printStackTrace();
+                }
+            }
+        });
+        if(position < 100) {
+            throw  new RuntimeException("Text is not right aligned " + position);
+        }
+        SwingUtilities.invokeAndWait(new Runnable() {
+            @Override
+            public void run() {
+                try {
+                    position = jTextPane.modelToView(1).x;
+                } catch (BadLocationException e) {
+                    e.printStackTrace();
+                }
+                frame.dispose();
+            }
+        });
+        if(position < 20) {
+            throw  new RuntimeException("Text is not center aligned " + position);
+        }
+        System.out.println("ok");
+    }
+}
--- a/jdk/test/sun/security/pkcs11/PKCS11Test.java	Thu Apr 09 12:29:31 2015 +0200
+++ b/jdk/test/sun/security/pkcs11/PKCS11Test.java	Mon Aug 17 12:45:16 2015 +0300
@@ -630,4 +630,18 @@
         return algorithms;
     }
 
+    /**
+     * Get the identifier for the operating system distribution
+     */
+    public String getDistro() {
+
+        try (BufferedReader in =
+            new BufferedReader(new InputStreamReader(
+                Runtime.getRuntime().exec("uname -v").getInputStream()))) {
+
+            return in.readLine();
+        } catch (Exception e) {
+            return "";
+        }
+    }
 }
--- a/jdk/test/sun/security/pkcs11/Signature/ByteBuffers.java	Thu Apr 09 12:29:31 2015 +0200
+++ b/jdk/test/sun/security/pkcs11/Signature/ByteBuffers.java	Mon Aug 17 12:45:16 2015 +0300
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -42,6 +42,22 @@
     }
 
     public void main(Provider p) throws Exception {
+
+        /*
+         * Use Solaris SPARC 11.2 or later to avoid an intermittent failure
+         * when running SunPKCS11-Solaris provider (8044554)
+         */
+        if (p.getName().equals("SunPKCS11-Solaris") &&
+            System.getProperty("os.name").equals("SunOS") &&
+            System.getProperty("os.arch").equals("sparcv9") &&
+            System.getProperty("os.version").compareTo("5.11") <= 0 &&
+            getDistro().compareTo("11.2") < 0) {
+
+            System.out.println("SunPKCS11-Solaris provider requires " +
+                "Solaris SPARC 11.2 or later, skipping");
+            return;
+        }
+
         Random random = new Random();
         int n = 10 * 1024;
         byte[] t = new byte[n];
--- a/jdk/test/sun/security/pkcs11/Signature/ReinitSignature.java	Thu Apr 09 12:29:31 2015 +0200
+++ b/jdk/test/sun/security/pkcs11/Signature/ReinitSignature.java	Mon Aug 17 12:45:16 2015 +0300
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2015, 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
@@ -28,6 +28,306 @@
  * @author Andreas Sterbenz
  * @library ..
  * @key randomness
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
+ * @run main ReinitSignature
  */
 
 import java.util.*;
@@ -41,6 +341,22 @@
     }
 
     public void main(Provider p) throws Exception {
+
+        /*
+         * Use Solaris SPARC 11.2 or later to avoid an intermittent failure
+         * when running SunPKCS11-Solaris (8044554)
+         */
+        if (p.getName().equals("SunPKCS11-Solaris") &&
+            System.getProperty("os.name").equals("SunOS") &&
+            System.getProperty("os.arch").equals("sparcv9") &&
+            System.getProperty("os.version").compareTo("5.11") <= 0 &&
+            getDistro().compareTo("11.2") < 0) {
+
+            System.out.println("SunPKCS11-Solaris provider requires " +
+                "Solaris SPARC 11.2 or later, skipping");
+            return;
+        }
+
         KeyPairGenerator kpg = KeyPairGenerator.getInstance("RSA", p);
         kpg.initialize(512);
         KeyPair kp = kpg.generateKeyPair();
--- a/jdk/test/sun/security/pkcs11/Signature/TestDSA.java	Thu Apr 09 12:29:31 2015 +0200
+++ b/jdk/test/sun/security/pkcs11/Signature/TestDSA.java	Mon Aug 17 12:45:16 2015 +0300
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2005, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2015, 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
@@ -110,6 +110,21 @@
 
         System.out.println("Testing provider " + provider + "...");
 
+        /*
+         * Use Solaris SPARC 11.2 or later to avoid an intermittent failure
+         * when running SunPKCS11-Solaris (8044554)
+         */
+        if (provider.getName().equals("SunPKCS11-Solaris") &&
+            System.getProperty("os.name").equals("SunOS") &&
+            System.getProperty("os.arch").equals("sparcv9") &&
+            System.getProperty("os.version").compareTo("5.11") <= 0 &&
+            getDistro().compareTo("11.2") < 0) {
+
+            System.out.println("SunPKCS11-Solaris provider requires " +
+                "Solaris SPARC 11.2 or later, skipping");
+            return;
+        }
+
         if (provider.getService("Signature", "SHA1withDSA") == null) {
             System.out.println("DSA not supported, skipping");
             return;
--- a/jdk/test/sun/security/pkcs11/Signature/TestDSAKeyLength.java	Thu Apr 09 12:29:31 2015 +0200
+++ b/jdk/test/sun/security/pkcs11/Signature/TestDSAKeyLength.java	Mon Aug 17 12:45:16 2015 +0300
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -46,6 +46,21 @@
             return;
         }
 
+        /*
+         * Use Solaris SPARC 11.2 or later to avoid an intermittent failure
+         * when running SunPKCS11-Solaris (8044554)
+         */
+        if (provider.getName().equals("SunPKCS11-Solaris") &&
+            System.getProperty("os.name").equals("SunOS") &&
+            System.getProperty("os.arch").equals("sparcv9") &&
+            System.getProperty("os.version").compareTo("5.11") <= 0 &&
+            getDistro().compareTo("11.2") < 0) {
+
+            System.out.println("SunPKCS11-Solaris provider requires " +
+                "Solaris SPARC 11.2 or later, skipping");
+            return;
+        }
+
         KeyPairGenerator kpg = KeyPairGenerator.getInstance("DSA", "SUN");
         kpg.initialize(2048, new SecureRandom());
         KeyPair pair = kpg.generateKeyPair();
--- a/jdk/test/sun/security/pkcs11/Signature/TestRSAKeyLength.java	Thu Apr 09 12:29:31 2015 +0200
+++ b/jdk/test/sun/security/pkcs11/Signature/TestRSAKeyLength.java	Mon Aug 17 12:45:16 2015 +0300
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2015, 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,6 +36,22 @@
         main(new TestRSAKeyLength());
     }
     public void main(Provider p) throws Exception {
+
+        /*
+         * Use Solaris SPARC 11.2 or later to avoid an intermittent failure
+         * when running SunPKCS11-Solaris (8044554)
+         */
+        if (p.getName().equals("SunPKCS11-Solaris") &&
+            System.getProperty("os.name").equals("SunOS") &&
+            System.getProperty("os.arch").equals("sparcv9") &&
+            System.getProperty("os.version").compareTo("5.11") <= 0 &&
+            getDistro().compareTo("11.2") < 0) {
+
+            System.out.println("SunPKCS11-Solaris provider requires " +
+                "Solaris SPARC 11.2 or later, skipping");
+            return;
+        }
+
         boolean isValidKeyLength[] = { true, true, true, false, false };
         String algos[] = { "SHA1withRSA", "SHA224withRSA", "SHA256withRSA",
                            "SHA384withRSA", "SHA512withRSA" };
--- a/jdk/test/sun/security/pkcs11/ec/TestCurves.java	Thu Apr 09 12:29:31 2015 +0200
+++ b/jdk/test/sun/security/pkcs11/ec/TestCurves.java	Mon Aug 17 12:45:16 2015 +0300
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2006, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2006, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -58,6 +58,21 @@
             return;
         }
 
+        /*
+         * Use Solaris SPARC 11.2 or later to avoid an intermittent failure
+         * when running SunPKCS11-Solaris (8044554)
+         */
+        if (p.getName().equals("SunPKCS11-Solaris") &&
+            System.getProperty("os.name").equals("SunOS") &&
+            System.getProperty("os.arch").equals("sparcv9") &&
+            System.getProperty("os.version").compareTo("5.11") <= 0 &&
+            getDistro().compareTo("11.2") < 0) {
+
+            System.out.println("SunPKCS11-Solaris provider requires " +
+                "Solaris SPARC 11.2 or later, skipping");
+            return;
+        }
+
         // Check if this is sparc for later failure avoidance.
         boolean sparc = false;
         if (System.getProperty("os.arch").equals("sparcv9")) {
--- a/jdk/test/sun/security/pkcs11/ec/TestECDSA.java	Thu Apr 09 12:29:31 2015 +0200
+++ b/jdk/test/sun/security/pkcs11/ec/TestECDSA.java	Mon Aug 17 12:45:16 2015 +0300
@@ -124,6 +124,21 @@
         }
 
         /*
+         * Use Solaris SPARC 11.2 or later to avoid an intermittent failure
+         * when running SunPKCS11-Solaris (8044554)
+         */
+        if (provider.getName().equals("SunPKCS11-Solaris") &&
+            System.getProperty("os.name").equals("SunOS") &&
+            System.getProperty("os.arch").equals("sparcv9") &&
+            System.getProperty("os.version").compareTo("5.11") <= 0 &&
+            getDistro().compareTo("11.2") < 0) {
+
+            System.out.println("SunPKCS11-Solaris provider requires " +
+                "Solaris SPARC 11.2 or later, skipping");
+            return;
+        }
+
+        /*
          * PKCS11Test.main will remove this provider if needed
          */
         Providers.setAt(provider, 1);
--- a/jdk/test/sun/security/pkcs11/rsa/TestCACerts.java	Thu Apr 09 12:29:31 2015 +0200
+++ b/jdk/test/sun/security/pkcs11/rsa/TestCACerts.java	Mon Aug 17 12:45:16 2015 +0300
@@ -47,6 +47,22 @@
     }
 
     public void main(Provider p) throws Exception {
+
+        /*
+         * Use Solaris SPARC 11.2 or later to avoid an intermittent failure
+         * when running SunPKCS11-Solaris (8044554)
+         */
+        if (p.getName().equals("SunPKCS11-Solaris") &&
+            System.getProperty("os.name").equals("SunOS") &&
+            System.getProperty("os.arch").equals("sparcv9") &&
+            System.getProperty("os.version").compareTo("5.11") <= 0 &&
+            getDistro().compareTo("11.2") < 0) {
+
+            System.out.println("SunPKCS11-Solaris provider requires " +
+                "Solaris SPARC 11.2 or later, skipping");
+            return;
+        }
+
         long start = System.currentTimeMillis();
         Providers.setAt(p, 1);
         try {
--- a/jdk/test/sun/security/pkcs11/rsa/TestSignatures.java	Thu Apr 09 12:29:31 2015 +0200
+++ b/jdk/test/sun/security/pkcs11/rsa/TestSignatures.java	Mon Aug 17 12:45:16 2015 +0300
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2015, 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
@@ -97,6 +97,22 @@
     }
 
     public void main(Provider p) throws Exception {
+
+        /*
+         * Use Solaris SPARC 11.2 or later to avoid an intermittent failure
+         * when running SunPKCS11-Solaris (8044554)
+         */
+        if (p.getName().equals("SunPKCS11-Solaris") &&
+            System.getProperty("os.name").equals("SunOS") &&
+            System.getProperty("os.arch").equals("sparcv9") &&
+            System.getProperty("os.version").compareTo("5.11") <= 0 &&
+            getDistro().compareTo("11.2") < 0) {
+
+            System.out.println("SunPKCS11-Solaris provider requires " +
+                "Solaris SPARC 11.2 or later, skipping");
+            return;
+        }
+
         long start = System.currentTimeMillis();
         provider = p;
         data = new byte[2048];
--- a/jdk/test/tools/pack200/PackTestZip64.java	Thu Apr 09 12:29:31 2015 +0200
+++ b/jdk/test/tools/pack200/PackTestZip64.java	Mon Aug 17 12:45:16 2015 +0300
@@ -37,10 +37,13 @@
  * @compile -XDignore.symbol.file Utils.java PackTestZip64.java
  * @run main PackTestZip64
  * @author kizune
- * @key intermittent
  */
 
 public class PackTestZip64 {
+
+    private static final boolean bigJarEnabled
+            = Boolean.getBoolean("PackTestZip64.enableBigJar");
+
     public static void main(String... args) throws Exception {
         testPacking();
         Utils.cleanup();
@@ -50,10 +53,14 @@
     private static final byte[] BUFFER = new byte[1024];
 
     static void testPacking() throws IOException {
-        // make a copy of the test specimen to local directory
         File testFile = new File("tools_java.jar");
-        // Add a large number of small files to the golden jar
-        generateLargeJar(testFile, Utils.getGoldenJar());
+        if (bigJarEnabled) {
+            // Add a large number of small files to the golden jar
+            generateLargeJar(testFile, Utils.getGoldenJar());
+        } else {
+            // make a copy of the test specimen to local directory
+            Utils.copyFile(Utils.getGoldenJar(), testFile);
+        }
 
         List<String> cmdsList = new ArrayList<>();
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/tools/pack200/PackTestZip64Manual.java	Mon Aug 17 12:45:16 2015 +0300
@@ -0,0 +1,33 @@
+/*
+ * Copyright (c) 2015, 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 8029646
+ * @summary tests that native unpacker produces the same result as Java one
+ * @compile -XDignore.symbol.file Utils.java PackTestZip64.java
+ * @run main/manual/othervm -DPackTestZip64.enableBigJar=true PackTestZip64
+ */
+
+public class PackTestZip64Manual {
+}
--- a/langtools/.hgtags	Thu Apr 09 12:29:31 2015 +0200
+++ b/langtools/.hgtags	Mon Aug 17 12:45:16 2015 +0300
@@ -318,3 +318,4 @@
 1fccc38cd6f56cb2173195e317ba2784b484c2d1 jdk9-b73
 02681b7c4232ba5d43ccba794492db9502211ff0 jdk9-b74
 827915d1e55eac4f2e138f9b8c79d154862c2284 jdk9-b75
+80ab772222fb6b85f8174bf97261178ee4026620 jdk9-b76
--- a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/code/Scope.java	Thu Apr 09 12:29:31 2015 +0200
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/code/Scope.java	Mon Aug 17 12:45:16 2015 +0300
@@ -27,7 +27,11 @@
 
 import com.sun.tools.javac.code.Kinds.Kind;
 import java.util.*;
+import java.util.function.BiConsumer;
+import java.util.stream.Stream;
+import java.util.stream.StreamSupport;
 
+import com.sun.tools.javac.code.Symbol.CompletionFailure;
 import com.sun.tools.javac.code.Symbol.TypeSymbol;
 import com.sun.tools.javac.tree.JCTree.JCImport;
 import com.sun.tools.javac.util.*;
@@ -35,8 +39,6 @@
 
 import static com.sun.tools.javac.code.Scope.LookupKind.NON_RECURSIVE;
 import static com.sun.tools.javac.code.Scope.LookupKind.RECURSIVE;
-import java.util.stream.Stream;
-import java.util.stream.StreamSupport;
 
 /** A scope represents an area of visibility in a Java program. The
  *  Scope class is a container for symbols which provides
@@ -721,8 +723,8 @@
             prependSubScope(currentFileScope);
         }
 
-        public Scope importByName(Types types, Scope origin, Name name, ImportFilter filter) {
-            return appendScope(new FilterImportScope(types, origin, name, filter, true));
+        public Scope importByName(Types types, Scope origin, Name name, ImportFilter filter, JCImport imp, BiConsumer<JCImport, CompletionFailure> cfHandler) {
+            return appendScope(new FilterImportScope(types, origin, name, filter, imp, cfHandler));
         }
 
         public Scope importType(Scope delegate, Scope origin, Symbol sym) {
@@ -786,15 +788,16 @@
 
         public void importAll(Types types, Scope origin,
                               ImportFilter filter,
-                              boolean staticImport) {
+                              JCImport imp,
+                              BiConsumer<JCImport, CompletionFailure> cfHandler) {
             for (Scope existing : subScopes) {
                 Assert.check(existing instanceof FilterImportScope);
                 FilterImportScope fis = (FilterImportScope) existing;
                 if (fis.origin == origin && fis.filter == filter &&
-                    fis.staticImport == staticImport)
+                    fis.imp.staticImport == imp.staticImport)
                     return ; //avoid entering the same scope twice
             }
-            prependSubScope(new FilterImportScope(types, origin, null, filter, staticImport));
+            prependSubScope(new FilterImportScope(types, origin, null, filter, imp, cfHandler));
         }
 
         public boolean isFilled() {
@@ -813,32 +816,40 @@
         private final Scope origin;
         private final Name  filterName;
         private final ImportFilter filter;
-        private final boolean staticImport;
+        private final JCImport imp;
+        private final BiConsumer<JCImport, CompletionFailure> cfHandler;
 
         public FilterImportScope(Types types,
                                  Scope origin,
                                  Name  filterName,
                                  ImportFilter filter,
-                                 boolean staticImport) {
+                                 JCImport imp,
+                                 BiConsumer<JCImport, CompletionFailure> cfHandler) {
             super(origin.owner);
             this.types = types;
             this.origin = origin;
             this.filterName = filterName;
             this.filter = filter;
-            this.staticImport = staticImport;
+            this.imp = imp;
+            this.cfHandler = cfHandler;
         }
 
         @Override
         public Iterable<Symbol> getSymbols(final Filter<Symbol> sf, final LookupKind lookupKind) {
             if (filterName != null)
                 return getSymbolsByName(filterName, sf, lookupKind);
-            SymbolImporter si = new SymbolImporter(staticImport) {
-                @Override
-                Iterable<Symbol> doLookup(TypeSymbol tsym) {
-                    return tsym.members().getSymbols(sf, lookupKind);
-                }
-            };
-            return si.importFrom((TypeSymbol) origin.owner) :: iterator;
+            try {
+                SymbolImporter si = new SymbolImporter(imp.staticImport) {
+                    @Override
+                    Iterable<Symbol> doLookup(TypeSymbol tsym) {
+                        return tsym.members().getSymbols(sf, lookupKind);
+                    }
+                };
+                return si.importFrom((TypeSymbol) origin.owner) :: iterator;
+            } catch (CompletionFailure cf) {
+                cfHandler.accept(imp, cf);
+                return Collections.emptyList();
+            }
         }
 
         @Override
@@ -847,13 +858,18 @@
                                                  final LookupKind lookupKind) {
             if (filterName != null && filterName != name)
                 return Collections.emptyList();
-            SymbolImporter si = new SymbolImporter(staticImport) {
-                @Override
-                Iterable<Symbol> doLookup(TypeSymbol tsym) {
-                    return tsym.members().getSymbolsByName(name, sf, lookupKind);
-                }
-            };
-            return si.importFrom((TypeSymbol) origin.owner) :: iterator;
+            try {
+                SymbolImporter si = new SymbolImporter(imp.staticImport) {
+                    @Override
+                    Iterable<Symbol> doLookup(TypeSymbol tsym) {
+                        return tsym.members().getSymbolsByName(name, sf, lookupKind);
+                    }
+                };
+                return si.importFrom((TypeSymbol) origin.owner) :: iterator;
+            } catch (CompletionFailure cf) {
+                cfHandler.accept(imp, cf);
+                return Collections.emptyList();
+            }
         }
 
         @Override
@@ -863,7 +879,7 @@
 
         @Override
         public boolean isStaticallyImported(Symbol byName) {
-            return staticImport;
+            return imp.staticImport;
         }
 
         abstract class SymbolImporter {
--- a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/TypeEnter.java	Thu Apr 09 12:29:31 2015 +0200
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/TypeEnter.java	Mon Aug 17 12:45:16 2015 +0300
@@ -27,6 +27,7 @@
 
 import java.util.HashSet;
 import java.util.Set;
+import java.util.function.BiConsumer;
 
 import javax.tools.JavaFileObject;
 
@@ -284,6 +285,8 @@
         Env<AttrContext> env;
         ImportFilter staticImportFilter;
         ImportFilter typeImportFilter;
+        BiConsumer<JCImport, CompletionFailure> cfHandler =
+                (imp, cf) -> chk.completionError(imp.pos(), cf);
 
         @Override
         protected void doRunPhase(Env<AttrContext> env) {
@@ -327,7 +330,7 @@
                 PackageSymbol javaLang = syms.enterPackage(names.java_lang);
                 if (javaLang.members().isEmpty() && !javaLang.exists())
                     throw new FatalError(diags.fragment("fatal.err.no.java.lang"));
-                importAll(tree.pos, javaLang, env);
+                importAll(make.at(tree.pos()).Import(make.QualIdent(javaLang), false), javaLang, env);
 
                 // Process the package def and all import clauses.
                 if (tree.getPackage() != null)
@@ -378,13 +381,13 @@
                 // Import on demand.
                 chk.checkCanonical(imp.selected);
                 if (tree.staticImport)
-                    importStaticAll(tree.pos, p, env);
+                    importStaticAll(tree, p, env);
                 else
-                    importAll(tree.pos, p, env);
+                    importAll(tree, p, env);
             } else {
                 // Named type import.
                 if (tree.staticImport) {
-                    importNamedStatic(tree.pos(), p, name, localEnv, tree);
+                    importNamedStatic(tree, p, name, localEnv);
                     chk.checkCanonical(imp.selected);
                 } else {
                     TypeSymbol c = attribImportType(imp, localEnv).tsym;
@@ -411,51 +414,50 @@
         }
 
         /** Import all classes of a class or package on demand.
-         *  @param pos           Position to be used for error reporting.
+         *  @param imp           The import that is being handled.
          *  @param tsym          The class or package the members of which are imported.
          *  @param env           The env in which the imported classes will be entered.
          */
-        private void importAll(int pos,
+        private void importAll(JCImport imp,
                                final TypeSymbol tsym,
                                Env<AttrContext> env) {
-            env.toplevel.starImportScope.importAll(types, tsym.members(), typeImportFilter, false);
+            env.toplevel.starImportScope.importAll(types, tsym.members(), typeImportFilter, imp, cfHandler);
         }
 
         /** Import all static members of a class or package on demand.
-         *  @param pos           Position to be used for error reporting.
+         *  @param imp           The import that is being handled.
          *  @param tsym          The class or package the members of which are imported.
          *  @param env           The env in which the imported classes will be entered.
          */
-        private void importStaticAll(int pos,
+        private void importStaticAll(JCImport imp,
                                      final TypeSymbol tsym,
                                      Env<AttrContext> env) {
             final StarImportScope toScope = env.toplevel.starImportScope;
             final TypeSymbol origin = tsym;
 
-            toScope.importAll(types, origin.members(), staticImportFilter, true);
+            toScope.importAll(types, origin.members(), staticImportFilter, imp, cfHandler);
         }
 
         /** Import statics types of a given name.  Non-types are handled in Attr.
-         *  @param pos           Position to be used for error reporting.
+         *  @param imp           The import that is being handled.
          *  @param tsym          The class from which the name is imported.
          *  @param name          The (simple) name being imported.
          *  @param env           The environment containing the named import
          *                  scope to add to.
          */
-        private void importNamedStatic(final DiagnosticPosition pos,
+        private void importNamedStatic(final JCImport imp,
                                        final TypeSymbol tsym,
                                        final Name name,
-                                       final Env<AttrContext> env,
-                                       final JCImport imp) {
+                                       final Env<AttrContext> env) {
             if (tsym.kind != TYP) {
-                log.error(DiagnosticFlag.RECOVERABLE, pos, "static.imp.only.classes.and.interfaces");
+                log.error(DiagnosticFlag.RECOVERABLE, imp.pos(), "static.imp.only.classes.and.interfaces");
                 return;
             }
 
             final NamedImportScope toScope = env.toplevel.namedImportScope;
             final Scope originMembers = tsym.members();
 
-            imp.importScope = toScope.importByName(types, originMembers, name, staticImportFilter);
+            imp.importScope = toScope.importByName(types, originMembers, name, staticImportFilter, imp, cfHandler);
         }
 
         /** Import given class.
--- a/langtools/src/jdk.compiler/share/classes/com/sun/tools/sjavac/pubapi/PubApiTypeParam.java	Thu Apr 09 12:29:31 2015 +0200
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/tools/sjavac/pubapi/PubApiTypeParam.java	Mon Aug 17 12:45:16 2015 +0300
@@ -1,3 +1,28 @@
+/*
+ * Copyright (c) 2015, 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 com.sun.tools.sjavac.pubapi;
 
 import java.io.Serializable;
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/importscope/CompletionFailureDuringImport.java	Mon Aug 17 12:45:16 2015 +0300
@@ -0,0 +1,86 @@
+/*
+ * Copyright (c) 2015, 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 8131915
+ * @summary Verify that CompletionFailure thrown during listing of import content is handled properly.
+ * @library /tools/lib
+ */
+
+import java.nio.file.Files;
+import java.nio.file.Paths;
+import java.util.Arrays;
+import java.util.List;
+
+public class CompletionFailureDuringImport {
+    public static void main(String... args) throws Exception {
+        new CompletionFailureDuringImport().run();
+    }
+
+    ToolBox tb = new ToolBox();
+
+    void run() throws Exception {
+        tb.new JavacTask()
+          .outdir(".")
+          .sources("package p; public class Super { public static final int I = 0; }",
+                   "package p; public class Sub extends Super { }")
+          .run()
+          .writeAll();
+
+        Files.delete(Paths.get(".", "p", "Super.class"));
+
+        doTest("import static p.Sub.*;",
+               "",
+               "Test.java:1:1: compiler.err.cant.access: p.Super, (compiler.misc.class.file.not.found: p.Super)",
+               "1 error");
+        doTest("import static p.Sub.I;",
+               "",
+               "Test.java:1:1: compiler.err.cant.access: p.Super, (compiler.misc.class.file.not.found: p.Super)",
+               "1 error");
+        doTest("import static p.Sub.*;",
+               "int i = I;",
+               "Test.java:1:1: compiler.err.cant.access: p.Super, (compiler.misc.class.file.not.found: p.Super)",
+               "Test.java:1:52: compiler.err.cant.resolve.location: kindname.variable, I, , , (compiler.misc.location: kindname.class, Test, null)",
+               "2 errors");
+        doTest("import static p.Sub.I;",
+               "int i = I;",
+               "Test.java:1:1: compiler.err.cant.access: p.Super, (compiler.misc.class.file.not.found: p.Super)",
+               "Test.java:1:52: compiler.err.cant.resolve.location: kindname.variable, I, , , (compiler.misc.location: kindname.class, Test, null)",
+               "2 errors");
+    }
+
+    void doTest(String importText, String useText, String... expectedOutput) {
+        List<String> log = tb.new JavacTask()
+                .classpath(".")
+                .sources(importText + " public class Test { " + useText + " }")
+                .options("-XDrawDiagnostics")
+                .run(ToolBox.Expect.FAIL)
+                .writeAll()
+                .getOutputLines(ToolBox.OutputKind.DIRECT);
+
+        if (!log.equals(Arrays.asList(expectedOutput))) {
+            throw new AssertionError("Unexpected output: " + log);
+        }
+    }
+}
--- a/langtools/test/tools/javac/scope/HashCollisionTest.java	Thu Apr 09 12:29:31 2015 +0200
+++ b/langtools/test/tools/javac/scope/HashCollisionTest.java	Mon Aug 17 12:45:16 2015 +0300
@@ -23,7 +23,7 @@
 
 /*
  * @test
- * @bug 7004029
+ * @bug 7004029 8131915
  * @summary Ensure Scope impl can cope with hash collisions
  * @library /tools/javac/lib
  * @modules jdk.compiler/com.sun.tools.javac.api
@@ -37,6 +37,7 @@
 
 import java.lang.reflect.*;
 import java.io.*;
+import java.util.function.BiConsumer;
 
 import com.sun.source.util.Trees;
 import com.sun.tools.javac.api.JavacTrees;
@@ -45,6 +46,8 @@
 import com.sun.tools.javac.code.Scope.*;
 import com.sun.tools.javac.code.Symbol.*;
 import com.sun.tools.javac.file.JavacFileManager;
+import com.sun.tools.javac.tree.JCTree.JCImport;
+import com.sun.tools.javac.tree.TreeMaker;
 
 import static com.sun.tools.javac.code.Kinds.Kind.*;
 
@@ -57,6 +60,7 @@
         // set up basic environment for test
         Context context = new Context();
         JavacFileManager.preRegister(context); // required by ClassReader which is required by Symtab
+        make = TreeMaker.instance(context);
         names = Names.instance(context);       // Name.Table impls tied to an instance of Names
         symtab = Symtab.instance(context);
         trees = JavacTrees.instance(context);
@@ -127,12 +131,14 @@
                 return sym.kind == TYP;
             }
         };
-        starImportScope.importAll(types, fromScope, typeFilter, false);
+        BiConsumer<JCImport, CompletionFailure> noCompletionFailure =
+                (imp, cf) -> { throw new IllegalStateException(); };
+        starImportScope.importAll(types, fromScope, typeFilter, make.Import(null, false), noCompletionFailure);
 
         dump("imported p", starImportScope);
 
         // 7. Insert the class from 3.
-        starImportScope.importAll(types, cc.members_field, typeFilter, false);
+        starImportScope.importAll(types, cc.members_field, typeFilter, make.Import(null, false), noCompletionFailure);
         dump("imported ce", starImportScope);
 
         /*
@@ -199,6 +205,7 @@
     int MAX_TRIES = 100; // max tries to find a hash clash before giving up.
     int scopeHashMask;
 
+    TreeMaker make;
     Names names;
     Symtab symtab;
     Trees trees;
--- a/langtools/test/tools/javac/scope/StarImportTest.java	Thu Apr 09 12:29:31 2015 +0200
+++ b/langtools/test/tools/javac/scope/StarImportTest.java	Mon Aug 17 12:45:16 2015 +0300
@@ -23,7 +23,7 @@
 
 /*
  * @test
- * @bug 7004029
+ * @bug 7004029 8131915
  * @summary Basher for star-import scopes
  * @modules jdk.compiler/com.sun.tools.javac.code
  *          jdk.compiler/com.sun.tools.javac.file
@@ -39,6 +39,7 @@
 import com.sun.tools.javac.code.Scope.WriteableScope;
 import com.sun.tools.javac.code.Symbol.*;
 import com.sun.tools.javac.file.JavacFileManager;
+import com.sun.tools.javac.tree.TreeMaker;
 import com.sun.tools.javac.util.*;
 
 import static com.sun.tools.javac.code.Kinds.Kind.*;
@@ -136,6 +137,7 @@
             log ("setup");
             context = new Context();
             JavacFileManager.preRegister(context); // required by ClassReader which is required by Symtab
+            make = TreeMaker.instance(context);
             names = Names.instance(context);       // Name.Table impls tied to an instance of Names
             symtab = Symtab.instance(context);
             types = Types.instance(context);
@@ -227,7 +229,7 @@
                     public boolean accepts(Scope origin, Symbol t) {
                         return t.kind == TYP;
                     }
-                }, false);
+                }, make.Import(null, false), (i, cf) -> { throw new IllegalStateException(); });
 
                 for (Symbol sym : members.getSymbols()) {
                     starImportModel.enter(sym);
@@ -295,6 +297,7 @@
 
         Context context;
         Symtab symtab;
+        TreeMaker make;
         Names names;
         Types types;
         int nextNameSerial;
--- a/make/Main.gmk	Thu Apr 09 12:29:31 2015 +0200
+++ b/make/Main.gmk	Mon Aug 17 12:45:16 2015 +0300
@@ -78,11 +78,14 @@
 interim-rmic:
 	+($(CD) $(JDK_TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f CompileInterimRmic.gmk)
 
+interim-cldrconverter:
+	+($(CD) $(JDK_TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f CopyInterimCLDRConverter.gmk)
+
 buildtools-jdk:
 	+($(CD) $(JDK_TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f Tools.gmk java-tools)
 
 ALL_TARGETS += buildtools-langtools interim-langtools interim-corba \
-    interim-rmic buildtools-jdk
+    interim-rmic interim-cldrconverter buildtools-jdk
 
 ################################################################################
 # Special targets for certain modules
@@ -345,7 +348,7 @@
 
   interim-langtools: $(LANGTOOLS_GENSRC_TARGETS)
 
-  buildtools-jdk: interim-langtools
+  buildtools-jdk: interim-langtools interim-cldrconverter
 
   $(CORBA_GENSRC_TARGETS): interim-langtools
 
--- a/nashorn/.hgtags	Thu Apr 09 12:29:31 2015 +0200
+++ b/nashorn/.hgtags	Mon Aug 17 12:45:16 2015 +0300
@@ -309,3 +309,4 @@
 548f1eb2c3c89e024ef3805f48ceed9de503588f jdk9-b73
 2e8bb16872d7b15dc0a4f8e45c6ad65f762c1b04 jdk9-b74
 f884dff432a7ac349153f3d1ea1eb222f3764c6c jdk9-b75
+ab231613d7206431ba31917a02e7cedd70e88e70 jdk9-b76
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/codegen/CodeGenerator.java	Thu Apr 09 12:29:31 2015 +0200
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/codegen/CodeGenerator.java	Mon Aug 17 12:45:16 2015 +0300
@@ -1480,7 +1480,7 @@
                     }
                     @Override
                     void consumeStack() {
-                        dynamicCall(2 + argsCount, flags);
+                        dynamicCall(2 + argsCount, flags, ident.getName());
                     }
                 }.emit();
             }
@@ -1538,7 +1538,7 @@
                     @Override
                     void consumeStack() {
                         // Ordinary call
-                        dynamicCall(2 + argsCount, flags);
+                        dynamicCall(2 + argsCount, flags, "eval");
                         method._goto(eval_done);
 
                         method.label(invoke_direct_eval);
@@ -1610,7 +1610,7 @@
                     }
                     @Override
                     void consumeStack() {
-                        dynamicCall(2 + argCount, flags);
+                        dynamicCall(2 + argCount, flags, node.toString(false));
                     }
                 }.emit();
 
@@ -1635,9 +1635,7 @@
 
                     @Override
                     void consumeStack() {
-                        final int flags = getCallSiteFlags();
-                        //assert callNodeType.equals(callee.getReturnType()) : callNodeType + " != " + callee.getReturnType();
-                        dynamicCall(2 + argsCount, flags);
+                        dynamicCall(2 + argsCount, getCallSiteFlags(), origCallee.getName());
                     }
                 }.emit();
                 return false;
@@ -1666,8 +1664,7 @@
                     }
                     @Override
                     void consumeStack() {
-                        final int flags = getCallSiteFlags();
-                        dynamicCall(2 + argsCount, flags);
+                        dynamicCall(2 + argsCount, getCallSiteFlags(), node.toString(false));
                     }
                 }.emit();
                 return false;
@@ -1687,7 +1684,7 @@
                         @Override
                         void consumeStack() {
                             final int flags = getCallSiteFlags() | CALLSITE_SCOPE;
-                            dynamicCall(2 + argsCount, flags);
+                            dynamicCall(2 + argsCount, flags, node.toString(false));
                         }
                 }.emit();
                 return false;
@@ -3707,10 +3704,11 @@
         final CallNode callNode = (CallNode)unaryNode.getExpression();
         final List<Expression> args   = callNode.getArgs();
 
+        final Expression func = callNode.getFunction();
         // Load function reference.
-        loadExpressionAsObject(callNode.getFunction()); // must detect type error
-
-        method.dynamicNew(1 + loadArgs(args), getCallSiteFlags());
+        loadExpressionAsObject(func); // must detect type error
+
+        method.dynamicNew(1 + loadArgs(args), getCallSiteFlags(), func.toString(false));
     }
 
     private void loadNOT(final UnaryNode unaryNode) {
@@ -4818,11 +4816,11 @@
             return method.dynamicGetIndex(resultBounds.within(expression.getType()), nonOptimisticFlags(flags), isMethod);
         }
 
-        MethodEmitter dynamicCall(final int argCount, final int flags) {
+        MethodEmitter dynamicCall(final int argCount, final int flags, final String msg) {
             if (isOptimistic) {
-                return method.dynamicCall(getOptimisticCoercedType(), argCount, getOptimisticFlags(flags));
-            }
-            return method.dynamicCall(resultBounds.within(expression.getType()), argCount, nonOptimisticFlags(flags));
+                return method.dynamicCall(getOptimisticCoercedType(), argCount, getOptimisticFlags(flags), msg);
+            }
+            return method.dynamicCall(resultBounds.within(expression.getType()), argCount, nonOptimisticFlags(flags), msg);
         }
 
         int getOptimisticFlags(final int flags) {
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/codegen/MethodEmitter.java	Thu Apr 09 12:29:31 2015 +0200
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/codegen/MethodEmitter.java	Mon Aug 17 12:45:16 2015 +0300
@@ -2132,10 +2132,25 @@
      * @return the method emitter
      */
     MethodEmitter dynamicNew(final int argCount, final int flags) {
+        return dynamicNew(argCount, flags, null);
+    }
+
+    /**
+     * Generate a dynamic new
+     *
+     * @param argCount  number of arguments
+     * @param flags     callsite flags
+     * @param msg        additional message to be used when reporting error
+     *
+     * @return the method emitter
+     */
+    MethodEmitter dynamicNew(final int argCount, final int flags, final String msg) {
         assert !isOptimistic(flags);
         debug("dynamic_new", "argcount=", argCount);
         final String signature = getDynamicSignature(Type.OBJECT, argCount);
-        method.visitInvokeDynamicInsn("dyn:new", signature, LINKERBOOTSTRAP, flags);
+        method.visitInvokeDynamicInsn(
+                msg != null && msg.length() < LARGE_STRING_THRESHOLD? "dyn:new:" + NameCodec.encode(msg) : "dyn:new",
+                signature, LINKERBOOTSTRAP, flags);
         pushType(Type.OBJECT); //TODO fix result type
         return this;
     }
@@ -2150,10 +2165,26 @@
      * @return the method emitter
      */
     MethodEmitter dynamicCall(final Type returnType, final int argCount, final int flags) {
+        return dynamicCall(returnType, argCount, flags, null);
+    }
+
+    /**
+     * Generate a dynamic call
+     *
+     * @param returnType return type
+     * @param argCount   number of arguments
+     * @param flags      callsite flags
+     * @param msg        additional message to be used when reporting error
+     *
+     * @return the method emitter
+     */
+    MethodEmitter dynamicCall(final Type returnType, final int argCount, final int flags, final String msg) {
         debug("dynamic_call", "args=", argCount, "returnType=", returnType);
         final String signature = getDynamicSignature(returnType, argCount); // +1 because the function itself is the 1st parameter for dynamic calls (what you call - call target)
         debug("   signature", signature);
-        method.visitInvokeDynamicInsn("dyn:call", signature, LINKERBOOTSTRAP, flags);
+        method.visitInvokeDynamicInsn(
+                msg != null && msg.length() < LARGE_STRING_THRESHOLD? "dyn:call:" + NameCodec.encode(msg) : "dyn:call",
+                signature, LINKERBOOTSTRAP, flags);
         pushType(returnType);
 
         return this;
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/codegen/SharedScopeCall.java	Thu Apr 09 12:29:31 2015 +0200
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/codegen/SharedScopeCall.java	Mon Aug 17 12:45:16 2015 +0300
@@ -169,7 +169,7 @@
                 slot += type.getSlots();
             }
             // Shared scope calls disabled in optimistic world. TODO is this right?
-            method.dynamicCall(returnType, 2 + paramTypes.length, flags);
+            method.dynamicCall(returnType, 2 + paramTypes.length, flags, symbol.getName());
         }
 
         method._return(returnType);
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/ir/Node.java	Thu Apr 09 12:29:31 2015 +0200
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/ir/Node.java	Mon Aug 17 12:45:16 2015 +0300
@@ -141,9 +141,17 @@
     public abstract Node accept(NodeVisitor<? extends LexicalContext> visitor);
 
     @Override
-    public String toString() {
+    public final String toString() {
+        return toString(true);
+    }
+
+    /*
+     * Return String representation of this Node.
+     * @param includeTypeInfo include type information or not
+     */
+    public final String toString(final boolean includeTypeInfo) {
         final StringBuilder sb = new StringBuilder();
-        toString(sb);
+        toString(sb, includeTypeInfo);
         return sb.toString();
     }
 
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/ScriptObject.java	Thu Apr 09 12:29:31 2015 +0200
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/ScriptObject.java	Mon Aug 17 12:45:16 2015 +0300
@@ -1859,7 +1859,7 @@
      * @return GuardedInvocation to be invoked at call site.
      */
     protected GuardedInvocation findNewMethod(final CallSiteDescriptor desc, final LinkRequest request) {
-        return notAFunction();
+        return notAFunction(desc);
     }
 
     /**
@@ -1872,11 +1872,11 @@
      * @return GuardedInvocation to be invoked at call site.
      */
     protected GuardedInvocation findCallMethod(final CallSiteDescriptor desc, final LinkRequest request) {
-        return notAFunction();
+        return notAFunction(desc);
     }
 
-    private GuardedInvocation notAFunction() {
-        throw typeError("not.a.function", ScriptRuntime.safeToString(this));
+    private GuardedInvocation notAFunction(final CallSiteDescriptor desc) {
+        throw typeError("not.a.function", NashornCallSiteDescriptor.getFunctionErrorMessage(desc, this));
     }
 
     /**
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/Undefined.java	Thu Apr 09 12:29:31 2015 +0200
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/Undefined.java	Mon Aug 17 12:45:16 2015 +0300
@@ -96,8 +96,12 @@
 
         switch (operator) {
         case "new":
-        case "call":
-            throw lookupTypeError("cant.call.undefined", desc);
+        case "call": {
+            final String name = NashornCallSiteDescriptor.getFunctionDescription(desc);
+            final String msg = name != null? "not.a.function" : "cant.call.undefined";
+            throw typeError(msg, name);
+        }
+
         case "callMethod":
             throw lookupTypeError("cant.read.property.of.undefined", desc);
         // NOTE: we support getElem and setItem as JavaScript doesn't distinguish items from properties. Nashorn itself
@@ -125,7 +129,8 @@
     }
 
     private static ECMAException lookupTypeError(final String msg, final CallSiteDescriptor desc) {
-        return typeError(msg, desc.getNameTokenCount() > 2 ? desc.getNameToken(2) : null);
+        final String name = desc.getNameToken(2);
+        return typeError(msg, name != null && !name.isEmpty()? name : null);
     }
 
     private static final MethodHandle GET_METHOD = findOwnMH("get", Object.class, Object.class);
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/linker/NashornBottomLinker.java	Thu Apr 09 12:29:31 2015 +0200
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/linker/NashornBottomLinker.java	Mon Aug 17 12:45:16 2015 +0300
@@ -27,6 +27,8 @@
 
 import static jdk.nashorn.internal.lookup.Lookup.MH;
 import static jdk.nashorn.internal.runtime.ECMAErrors.typeError;
+import static jdk.nashorn.internal.runtime.JSType.GET_UNDEFINED;
+import static jdk.nashorn.internal.runtime.JSType.TYPE_OBJECT_INDEX;
 import static jdk.nashorn.internal.runtime.ScriptRuntime.UNDEFINED;
 
 import java.lang.invoke.MethodHandle;
@@ -92,7 +94,7 @@
             if(BeansLinker.isDynamicMethod(self)) {
                 throw typeError("method.not.constructor", ScriptRuntime.safeToString(self));
             }
-            throw typeError("not.a.function", ScriptRuntime.safeToString(self));
+            throw typeError("not.a.function", desc.getFunctionErrorMessage(self));
         case "call":
             if(BeansLinker.isDynamicConstructor(self)) {
                 throw typeError("constructor.requires.new", ScriptRuntime.safeToString(self));
@@ -100,10 +102,12 @@
             if(BeansLinker.isDynamicMethod(self)) {
                 throw typeError("no.method.matches.args", ScriptRuntime.safeToString(self));
             }
-            throw typeError("not.a.function", ScriptRuntime.safeToString(self));
+            throw typeError("not.a.function", desc.getFunctionErrorMessage(self));
         case "callMethod":
+            throw typeError("no.such.function", getArgument(linkRequest), ScriptRuntime.safeToString(self));
         case "getMethod":
-            throw typeError("no.such.function", getArgument(linkRequest), ScriptRuntime.safeToString(self));
+            // evaluate to undefined, later on Undefined will take care of throwing TypeError
+            return getInvocation(MH.dropArguments(GET_UNDEFINED.get(TYPE_OBJECT_INDEX), 0, Object.class), self, linkerServices, desc);
         case "getProp":
         case "getElem":
             if(NashornCallSiteDescriptor.isOptimistic(desc)) {
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/linker/NashornCallSiteDescriptor.java	Thu Apr 09 12:29:31 2015 +0200
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/linker/NashornCallSiteDescriptor.java	Mon Aug 17 12:45:16 2015 +0300
@@ -34,6 +34,7 @@
 import jdk.internal.dynalink.support.AbstractCallSiteDescriptor;
 import jdk.internal.dynalink.support.CallSiteDescriptorFactory;
 import jdk.nashorn.internal.ir.debug.NashornTextifier;
+import jdk.nashorn.internal.runtime.ScriptRuntime;
 
 /**
  * Nashorn-specific implementation of Dynalink's {@link CallSiteDescriptor}. The reason we have our own subclass is that
@@ -150,7 +151,7 @@
     public static NashornCallSiteDescriptor get(final MethodHandles.Lookup lookup, final String name,
             final MethodType methodType, final int flags) {
         final String[] tokenizedName = CallSiteDescriptorFactory.tokenizeName(name);
-        assert tokenizedName.length == 2 || tokenizedName.length == 3;
+        assert tokenizedName.length >= 2;
         assert "dyn".equals(tokenizedName[0]);
         assert tokenizedName[1] != null;
         // TODO: see if we can move mangling/unmangling into Dynalink
@@ -248,6 +249,54 @@
     }
 
     /**
+     * If this is a dyn:call or dyn:new, this returns function description from callsite.
+     * Caller has to make sure this is a dyn:call or dyn:new call site.
+     *
+     * @return function description if available (or null)
+     */
+    public String getFunctionDescription() {
+        assert getFirstOperator().equals("call") || getFirstOperator().equals("new");
+        return getNameTokenCount() > 2? getNameToken(2) : null;
+    }
+
+    /**
+     * If this is a dyn:call or dyn:new, this returns function description from callsite.
+     * Caller has to make sure this is a dyn:call or dyn:new call site.
+     *
+     * @param desc call site descriptor
+     * @return function description if available (or null)
+     */
+    public static String getFunctionDescription(final CallSiteDescriptor desc) {
+        return desc instanceof NashornCallSiteDescriptor ?
+                ((NashornCallSiteDescriptor)desc).getFunctionDescription() : null;
+    }
+
+
+    /**
+     * Returns the error message to be used when dyn:call or dyn:new is used on a non-function.
+     *
+     * @param obj object on which dyn:call or dyn:new is used
+     * @return error message
+     */
+    public String getFunctionErrorMessage(final Object obj) {
+        final String funcDesc = getFunctionDescription();
+        return funcDesc != null? funcDesc : ScriptRuntime.safeToString(obj);
+    }
+
+    /**
+     * Returns the error message to be used when dyn:call or dyn:new is used on a non-function.
+     *
+     * @param desc call site descriptor
+     * @param obj object on which dyn:call or dyn:new is used
+     * @return error message
+     */
+    public static String getFunctionErrorMessage(final CallSiteDescriptor desc, final Object obj) {
+        return desc instanceof NashornCallSiteDescriptor ?
+                ((NashornCallSiteDescriptor)desc).getFunctionErrorMessage(obj) :
+                ScriptRuntime.safeToString(obj);
+    }
+
+    /**
      * Returns the Nashorn-specific flags for this call site descriptor.
      * @param desc the descriptor. It can be any kind of a call site descriptor, not necessarily a
      * {@code NashornCallSiteDescriptor}. This allows for graceful interoperability when linking Nashorn with code
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/resources/Messages.properties	Thu Apr 09 12:29:31 2015 +0200
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/resources/Messages.properties	Mon Aug 17 12:45:16 2015 +0300
@@ -78,6 +78,7 @@
 type.error.not.a.regexp={0} is not a RegExp
 type.error.not.a.string={0} is not a String
 type.error.not.a.function={0} is not a function
+type.error.not.a.function.value={0}, which has value {1}, is not a function
 type.error.not.a.constructor={0} is not a constructor function
 type.error.not.a.file={0} is not a File
 type.error.not.a.numeric.array={0} is not a numeric array
--- a/nashorn/test/script/basic/JDK-8026016.js.EXPECTED	Thu Apr 09 12:29:31 2015 +0200
+++ b/nashorn/test/script/basic/JDK-8026016.js.EXPECTED	Mon Aug 17 12:45:16 2015 +0300
@@ -1,182 +1,182 @@
-no such property _
-TypeError: Cannot call undefined
-no such property _
-TypeError: Cannot call undefined
-no such property _
-TypeError: Cannot call undefined
-no such property _
-TypeError: Cannot call undefined
-no such property _
-TypeError: Cannot call undefined
-no such property _
-TypeError: Cannot call undefined
-no such property _
-TypeError: Cannot call undefined
-no such property _
-TypeError: Cannot call undefined
-no such property _
-TypeError: Cannot call undefined
-no such property _
-TypeError: Cannot call undefined
-no such property _
-TypeError: Cannot call undefined
-no such property _
-TypeError: Cannot call undefined
-no such property _
-TypeError: Cannot call undefined
-no such property _
-TypeError: Cannot call undefined
-no such property _
-TypeError: Cannot call undefined
-no such property _
-TypeError: Cannot call undefined
-no such property _
-TypeError: Cannot call undefined
-no such property _
-TypeError: Cannot call undefined
-no such property _
-TypeError: Cannot call undefined
-no such property _
-TypeError: Cannot call undefined
-no such property _
-TypeError: Cannot call undefined
-no such property _
-TypeError: Cannot call undefined
-no such property _
-TypeError: Cannot call undefined
-no such property _
-TypeError: Cannot call undefined
-no such property _
-TypeError: Cannot call undefined
-no such property _
-TypeError: Cannot call undefined
-no such property _
-no such property _
-no such property _
-no such property _
-no such property _
-no such property _
-no such property _
-no such property _
-no such property _
-no such property _
-no such property _
-no such property _
-no such property _
-no such property _
-no such property _
-no such property _
-no such property _
-no such property _
-no such property _
-no such property _
-no such property _
-no such property _
-no such property _
-no such property _
-no such property _
-no such property _
-no such method _,0
-no such method _,1
-no such method _,2
-no such method _,3
-no such method _,4
-no such method _,5
-no such method _,6
-no such method _,7
-no such method _,8
-no such method _,9
-no such method _,10
-no such method _,11
-no such method _,12
-no such method _,13
-no such method _,14
-no such method _,15
-no such method _,16
-no such method _,17
-no such method _,18
-no such method _,19
-no such method _,20
-no such method _,21
-no such method _,22
-no such method _,23
-no such method _,24
-no such method _,25
-no such property _
-no such property _
-no such property _
-no such property _
-no such property _
-no such property _
-no such property _
-no such property _
-no such property _
-no such property _
-no such property _
-no such property _
-no such property _
-no such property _
-no such property _
-no such property _
-no such property _
-no such property _
-no such property _
-no such property _
-no such property _
-no such property _
-no such property _
-no such property _
-no such property _
-no such property _
-TypeError: Cannot call undefined
-TypeError: Cannot call undefined
-TypeError: Cannot call undefined
-TypeError: Cannot call undefined
-TypeError: Cannot call undefined
-TypeError: Cannot call undefined
-TypeError: Cannot call undefined
-TypeError: Cannot call undefined
-TypeError: Cannot call undefined
-TypeError: Cannot call undefined
-TypeError: Cannot call undefined
-TypeError: Cannot call undefined
-TypeError: Cannot call undefined
-TypeError: Cannot call undefined
-TypeError: Cannot call undefined
-TypeError: Cannot call undefined
-TypeError: Cannot call undefined
-TypeError: Cannot call undefined
-TypeError: Cannot call undefined
-TypeError: Cannot call undefined
-TypeError: Cannot call undefined
-TypeError: Cannot call undefined
-TypeError: Cannot call undefined
-TypeError: Cannot call undefined
-TypeError: Cannot call undefined
-TypeError: Cannot call undefined
-no such property _
-no such property _
-no such property _
-no such property _
-no such property _
-no such property _
-no such property _
-no such property _
-no such property _
-no such property _
-no such property _
-no such property _
-no such property _
-no such property _
-no such property _
-no such property _
-no such property _
-no such property _
-no such property _
-no such property _
-no such property _
-no such property _
-no such property _
-no such property _
-no such property _
-no such property _
+no such property _
+TypeError: o._ is not a function
+no such property _
+TypeError: o._ is not a function
+no such property _
+TypeError: o._ is not a function
+no such property _
+TypeError: o._ is not a function
+no such property _
+TypeError: o._ is not a function
+no such property _
+TypeError: o._ is not a function
+no such property _
+TypeError: o._ is not a function
+no such property _
+TypeError: o._ is not a function
+no such property _
+TypeError: o._ is not a function
+no such property _
+TypeError: o._ is not a function
+no such property _
+TypeError: o._ is not a function
+no such property _
+TypeError: o._ is not a function
+no such property _
+TypeError: o._ is not a function
+no such property _
+TypeError: o._ is not a function
+no such property _
+TypeError: o._ is not a function
+no such property _
+TypeError: o._ is not a function
+no such property _
+TypeError: o._ is not a function
+no such property _
+TypeError: o._ is not a function
+no such property _
+TypeError: o._ is not a function
+no such property _
+TypeError: o._ is not a function
+no such property _
+TypeError: o._ is not a function
+no such property _
+TypeError: o._ is not a function
+no such property _
+TypeError: o._ is not a function
+no such property _
+TypeError: o._ is not a function
+no such property _
+TypeError: o._ is not a function
+no such property _
+TypeError: o._ is not a function
+no such property _
+no such property _
+no such property _
+no such property _
+no such property _
+no such property _
+no such property _
+no such property _
+no such property _
+no such property _
+no such property _
+no such property _
+no such property _
+no such property _
+no such property _
+no such property _
+no such property _
+no such property _
+no such property _
+no such property _
+no such property _
+no such property _
+no such property _
+no such property _
+no such property _
+no such property _
+no such method _,0
+no such method _,1
+no such method _,2
+no such method _,3
+no such method _,4
+no such method _,5
+no such method _,6
+no such method _,7
+no such method _,8
+no such method _,9
+no such method _,10
+no such method _,11
+no such method _,12
+no such method _,13
+no such method _,14
+no such method _,15
+no such method _,16
+no such method _,17
+no such method _,18
+no such method _,19
+no such method _,20
+no such method _,21
+no such method _,22
+no such method _,23
+no such method _,24
+no such method _,25
+no such property _
+no such property _
+no such property _
+no such property _
+no such property _
+no such property _
+no such property _
+no such property _
+no such property _
+no such property _
+no such property _
+no such property _
+no such property _
+no such property _
+no such property _
+no such property _
+no such property _
+no such property _
+no such property _
+no such property _
+no such property _
+no such property _
+no such property _
+no such property _
+no such property _
+no such property _
+TypeError: o._ is not a function
+TypeError: o._ is not a function
+TypeError: o._ is not a function
+TypeError: o._ is not a function
+TypeError: o._ is not a function
+TypeError: o._ is not a function
+TypeError: o._ is not a function
+TypeError: o._ is not a function
+TypeError: o._ is not a function
+TypeError: o._ is not a function
+TypeError: o._ is not a function
+TypeError: o._ is not a function
+TypeError: o._ is not a function
+TypeError: o._ is not a function
+TypeError: o._ is not a function
+TypeError: o._ is not a function
+TypeError: o._ is not a function
+TypeError: o._ is not a function
+TypeError: o._ is not a function
+TypeError: o._ is not a function
+TypeError: o._ is not a function
+TypeError: o._ is not a function
+TypeError: o._ is not a function
+TypeError: o._ is not a function
+TypeError: o._ is not a function
+TypeError: o._ is not a function
+no such property _
+no such property _
+no such property _
+no such property _
+no such property _
+no such property _
+no such property _
+no such property _
+no such property _
+no such property _
+no such property _
+no such property _
+no such property _
+no such property _
+no such property _
+no such property _
+no such property _
+no such property _
+no such property _
+no such property _
+no such property _
+no such property _
+no such property _
+no such property _
+no such property _
+no such property _
--- a/nashorn/test/script/basic/JDK-8036743.js	Thu Apr 09 12:29:31 2015 +0200
+++ b/nashorn/test/script/basic/JDK-8036743.js	Mon Aug 17 12:45:16 2015 +0300
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 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
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/test/script/basic/JDK-8073733.js	Mon Aug 17 12:45:16 2015 +0300
@@ -0,0 +1,49 @@
+/*
+ * Copyright (c) 2015, 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.
+ */
+
+/**
+ * JDK-8073733: TypeError messages with "call" and "new" could be improved
+ *
+ * @test
+ * @run
+ */
+
+var func = undefined;
+try {
+    func();
+} catch (e) {
+    print(e);
+}
+
+var obj = {};
+try {
+    obj.foo();
+} catch (e) {
+    print(e);
+}
+
+try {
+    new func();
+} catch (e) {
+    print(e);
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/test/script/basic/JDK-8073733.js.EXPECTED	Mon Aug 17 12:45:16 2015 +0300
@@ -0,0 +1,3 @@
+TypeError: func is not a function
+TypeError: obj.foo is not a function
+TypeError: func is not a function
--- a/nashorn/test/script/basic/JDK-8114838.js	Thu Apr 09 12:29:31 2015 +0200
+++ b/nashorn/test/script/basic/JDK-8114838.js	Mon Aug 17 12:45:16 2015 +0300
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 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
--- a/nashorn/test/script/basic/JDK-8130853.js	Thu Apr 09 12:29:31 2015 +0200
+++ b/nashorn/test/script/basic/JDK-8130853.js	Mon Aug 17 12:45:16 2015 +0300
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 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
--- a/nashorn/test/script/basic/JDK-8131039.js	Thu Apr 09 12:29:31 2015 +0200
+++ b/nashorn/test/script/basic/JDK-8131039.js	Mon Aug 17 12:45:16 2015 +0300
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 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
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/test/script/basic/JDK-8133119.js	Mon Aug 17 12:45:16 2015 +0300
@@ -0,0 +1,81 @@
+/*
+ * Copyright (c) 2015, 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.
+ */
+
+/**
+ * JDK-8133119: Error message associated with TypeError for call and new should include stringified Node
+ *
+ * @test
+ * @run
+ */
+
+var obj = {}
+try {
+    obj.func();
+} catch (e) {
+    print(e);
+}
+
+var arr = [33];
+try {
+    arr[0].func();
+} catch (e) {
+    print(e);
+}
+
+try {
+    new obj.func();
+} catch (e) {
+    print(e);
+}
+
+try {
+    new arr[0].func();
+} catch (e) {
+    print(e);
+}
+
+obj.foo = {}
+try {
+    new obj.foo();
+} catch (e) {
+    print(e);
+}
+
+try {
+    obj.foo();
+} catch (e) {
+    print(e);
+}
+
+var v = new java.util.Vector();
+try {
+    v();
+} catch (e) {
+    print(e);
+}
+
+try {
+    new v();
+} catch (e) {
+    print(e);
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/test/script/basic/JDK-8133119.js.EXPECTED	Mon Aug 17 12:45:16 2015 +0300
@@ -0,0 +1,8 @@
+TypeError: obj.func is not a function
+TypeError: arr[0].func is not a function
+TypeError: obj.func is not a function
+TypeError: arr[0].func is not a function
+TypeError: obj.foo is not a function
+TypeError: obj.foo is not a function
+TypeError: v is not a function
+TypeError: v is not a function
--- a/nashorn/test/script/basic/NASHORN-75.js.EXPECTED	Thu Apr 09 12:29:31 2015 +0200
+++ b/nashorn/test/script/basic/NASHORN-75.js.EXPECTED	Mon Aug 17 12:45:16 2015 +0300
@@ -1,3 +1,3 @@
-TypeError: [RegExp /a|b/g] is not a function
-TypeError: [String hello] is not a function
-TypeError: [object Object] is not a function
+TypeError: RegExp("a|b", "g") is not a function
+TypeError: new String("hello") is not a function
+TypeError: new Object() is not a function
--- a/nashorn/test/script/basic/errors.js.EXPECTED	Thu Apr 09 12:29:31 2015 +0200
+++ b/nashorn/test/script/basic/errors.js.EXPECTED	Mon Aug 17 12:45:16 2015 +0300
@@ -1,31 +1,31 @@
-Error is a function
-EvalError is a function
-RangeError is a function
-ReferenceError is a function
-SyntaxError is a function
-TypeError is a function
-URIError is a function
-Error.arity 1
-EvalError.arity 1
-RangeError.arity 1
-ReferenceError.arity 1
-SyntaxError.arity 1
-TypeError.arity 1
-URIError.arity 1
-true
-my error
-Error
-thrown @ 49
-true
-ReferenceError
-"foo" is not defined
-true
-TypeError
-Cannot call undefined
-Error
-EvalError
-RangeError
-ReferenceError
-SyntaxError
-TypeError
-URIError
+Error is a function
+EvalError is a function
+RangeError is a function
+ReferenceError is a function
+SyntaxError is a function
+TypeError is a function
+URIError is a function
+Error.arity 1
+EvalError.arity 1
+RangeError.arity 1
+ReferenceError.arity 1
+SyntaxError.arity 1
+TypeError.arity 1
+URIError.arity 1
+true
+my error
+Error
+thrown @ 49
+true
+ReferenceError
+"foo" is not defined
+true
+TypeError
+Object.foo_method is not a function
+Error
+EvalError
+RangeError
+ReferenceError
+SyntaxError
+TypeError
+URIError
--- a/test/lib/sun/hotspot/WhiteBox.java	Thu Apr 09 12:29:31 2015 +0200
+++ b/test/lib/sun/hotspot/WhiteBox.java	Mon Aug 17 12:45:16 2015 +0300
@@ -182,6 +182,30 @@
     Objects.requireNonNull(method);
     return isMethodQueuedForCompilation0(method);
   }
+  // Determine if the compiler corresponding to the compilation level 'compLevel'
+  // and to the compilation context 'compilation_context' provides an intrinsic
+  // for the method 'method'. An intrinsic is available for method 'method' if:
+  //  - the intrinsic is enabled (by using the appropriate command-line flag) and
+  //  - the platform on which the VM is running provides the instructions necessary
+  //    for the compiler to generate the intrinsic code.
+  //
+  // The compilation context is related to using the DisableIntrinsic flag on a
+  // per-method level, see hotspot/src/share/vm/compiler/abstractCompiler.hpp
+  // for more details.
+  public boolean isIntrinsicAvailable(Executable method,
+                                      Executable compilationContext,
+                                      int compLevel) {
+      Objects.requireNonNull(method);
+      return isIntrinsicAvailable0(method, compilationContext, compLevel);
+  }
+  // If usage of the DisableIntrinsic flag is not expected (or the usage can be ignored),
+  // use the below method that does not require the compilation context as argument.
+  public boolean isIntrinsicAvailable(Executable method, int compLevel) {
+      return isIntrinsicAvailable(method, null, compLevel);
+  }
+  private native boolean isIntrinsicAvailable0(Executable method,
+                                               Executable compilationContext,
+                                               int compLevel);
   public        int     deoptimizeMethod(Executable method) {
     return deoptimizeMethod(method, false /*not osr*/);
   }