Merge
diff --git a/.hgtags b/.hgtags
index 7c40923..140c696 100644
--- a/.hgtags
+++ b/.hgtags
@@ -415,3 +415,5 @@
 ef9954f6896bb0b95ac62bf769f68b59a7a56ccd jdk-9+170
 29bbedd4cce8e14742bdb22118c057b877c02f0f jdk-9+171
 0ff9ad7d067cd4fa14450cf208bf019175a0aaba jdk-9+172
+a5506b425f1bf91530d8417b57360e5d89328c0c jdk-9+173
+42f18c931bd4fae5c206ccf6d8e591e4c4e69d31 jdk-9+174
diff --git a/make/ModuleTools.gmk b/make/ModuleTools.gmk
index 53586aa..c48a1b6 100644
--- a/make/ModuleTools.gmk
+++ b/make/ModuleTools.gmk
@@ -49,7 +49,4 @@
     --add-exports java.base/jdk.internal.module=ALL-UNNAMED \
     build.tools.jigsaw.AddPackagesAttribute
 
-TOOL_GEN_DOCS_BUNDLE_PAGE := $(BUILD_JAVA) -esa -ea -cp $(TOOLS_CLASSES_DIR) \
-    build.tools.docs.GenDocsBundlePage
-
 endif # _MODULE_TOOLS_GMK
diff --git a/make/src/classes/build/tools/docs/GenDocsBundlePage.java b/make/src/classes/build/tools/docs/GenDocsBundlePage.java
deleted file mode 100644
index ef1eb43..0000000
--- a/make/src/classes/build/tools/docs/GenDocsBundlePage.java
+++ /dev/null
@@ -1,247 +0,0 @@
-/*
- * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package build.tools.docs;
-
-import java.io.BufferedReader;
-import java.io.BufferedWriter;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.io.PrintWriter;
-import java.lang.module.ModuleDescriptor;
-import java.lang.module.ModuleFinder;
-import java.lang.module.ModuleReference;
-import java.nio.charset.StandardCharsets;
-import java.nio.file.Files;
-import java.nio.file.Path;
-import java.nio.file.Paths;
-import java.util.Arrays;
-import java.util.Comparator;
-import java.util.HashMap;
-import java.util.Locale;
-import java.util.Map;
-import java.util.Properties;
-import java.util.Set;
-import java.util.function.Predicate;
-import java.util.stream.Stream;
-import static java.util.stream.Collectors.*;
-
-/**
- * Build tool to generate the docs bundle index page.
- */
-public class GenDocsBundlePage {
-    private static String DOCS_BUNDLE_PAGE = "docs-bundle-page.html";
-    private static String MODULE_GROUPS_PROPS = "docs-module-groups.properties";
-
-    private static String USAGE =
-        "GenDocsBundlePage --output <file path> --title <title>" +
-        "                  [--template <template>]";
-
-    public static void main(String... args) throws IOException {
-        String title = null;
-        Path outputfile = null;
-        Path template = null;
-        for (int i=0; i < args.length; i++) {
-            String option = args[i];
-            if (option.equals("--output")) {
-                outputfile = Paths.get(getArgument(args, option, ++i));
-            } else if (option.equals("--title")) {
-                title = getArgument(args, option, ++i);
-            } else if (option.equals("--template")) {
-                template = Paths.get(getArgument(args, option, ++i));
-            } else if (option.startsWith("-")) {
-                throw new IllegalArgumentException("Invalid option: " + option);
-            }
-        }
-
-        if (outputfile == null) {
-            System.err.println("ERROR: must specify --output option");
-            System.exit(1);
-        }
-        if (title == null) {
-            System.err.println("ERROR: must specify --title option");
-            System.exit(1);
-        }
-
-        try (InputStream is = readTemplate(template);
-             BufferedReader reader = new BufferedReader(new InputStreamReader(is)))
-        {
-            new GenDocsBundlePage(title, outputfile).run(reader);
-        }
-    }
-
-    private static String getArgument(String[] args, String option, int index) {
-        if (index < args.length) {
-            return args[index];
-        }
-        throw new IllegalArgumentException("Argument must be specified for " + option);
-    }
-
-    private static InputStream readTemplate(Path template) throws IOException {
-        if (template != null) {
-            return Files.newInputStream(template);
-        } else {
-            return GenDocsBundlePage.class.getResourceAsStream(DOCS_BUNDLE_PAGE);
-        }
-    }
-
-    private static final String HEADER_TITLE = "@HEADER_TITLE@";
-
-
-    final Path outputfile;
-    final String title;
-    final Map<String, Set<ModuleDescriptor>> moduleGroups = new HashMap<>();
-    GenDocsBundlePage(String title, Path outputfile) throws IOException
-    {
-        this.outputfile = outputfile;
-        this.title = title;
-
-        // read module groups
-        ModuleFinder finder = ModuleFinder.ofSystem();
-        try (InputStream in = GenDocsBundlePage.class.getResourceAsStream(MODULE_GROUPS_PROPS)) {
-            Properties props = new Properties();
-            props.load(in);
-            for (String key: props.stringPropertyNames()) {
-                Set<ModuleDescriptor> mods =
-                    Stream.of(props.getProperty(key).split("\\s+"))
-                          .map(String::trim)
-                          .flatMap(mn -> finder.find(mn).stream())
-                          .map(ModuleReference::descriptor)
-                          .collect(toSet());
-
-                String name = "@" + key.toUpperCase(Locale.ENGLISH) + "@";
-                moduleGroups.put(name, mods);
-            };
-        }
-    }
-
-    void run(BufferedReader reader) throws IOException {
-        if (Files.notExists(outputfile.getParent())) {
-            Files.createDirectories(outputfile.getParent());
-        }
-        try (BufferedWriter bw = Files.newBufferedWriter(outputfile, StandardCharsets.UTF_8);
-             PrintWriter writer = new PrintWriter(bw)) {
-            reader.lines().map(this::genOutputLine)
-                  .forEach(writer::println);
-        }
-    }
-
-    String genOutputLine(String line) {
-        if (line.contains(HEADER_TITLE)) {
-            line = line.replace(HEADER_TITLE, title);
-        }
-        int i = line.indexOf('@');
-        int j = line.indexOf('@', i+1);
-        if (i >= 0 && i < j) {
-            String name = line.substring(i, j+1);
-            if (moduleGroups.containsKey(name)) {
-                line = line.replace(name, formatModuleGroup(name));
-            }
-        }
-        return line;
-    }
-
-    String toHRef(ModuleDescriptor md) {
-        String mn = md.name();
-        String formattedName;
-        if (hasExportedAPIs(md)) {
-            // has exported APIs
-            formattedName = mn;
-        } else if (!md.provides().isEmpty()) {
-            // a provider
-            formattedName = "<i>" + mn + "</i>";
-        } else {
-            // a tool
-            formattedName = "<i>" + mn + "</i>";
-        }
-        return String.format("<a href=\"api/%s-summary.html\">%s</a>",
-                             mn, formattedName);
-    }
-
-    String formatModuleGroup(String groupName) {
-        StringBuilder sb = new StringBuilder();
-        // organize in Java SE, JDK, JavaFX, JCP groups
-        Set<ModuleDescriptor> modules = moduleGroups.get(groupName);
-        Arrays.stream(ModuleGroup.values())
-            .forEach(g -> {
-                Set<ModuleDescriptor> mods = modules.stream()
-                    .filter(md -> g.predicate.test(md.name()))
-                    .collect(toSet());
-                if (!mods.isEmpty()) {
-                    sb.append("<div class=" + g.cssClass + ">\n");
-                    // modules with exported API
-                    mods.stream()
-                        .filter(this::hasExportedAPIs)
-                        .sorted(Comparator.comparing(ModuleDescriptor::name))
-                        .map(this::toHRef)
-                        .forEach(m -> sb.append(m).append("\n"));
-
-                    // tools and providers
-                    mods.stream()
-                        .filter(md -> !hasExportedAPIs(md))
-                        .sorted(Comparator.comparing(ModuleDescriptor::name))
-                        .map(this::toHRef)
-                        .forEach(m -> sb.append(m).append("\n"));
-                    sb.append("</div>");
-                }
-            });
-        return sb.toString();
-    }
-
-    private boolean hasExportedAPIs(ModuleDescriptor md) {
-        if (md.exports().stream().anyMatch(e -> !e.isQualified())) {
-            return true;
-        }
-        // this should check if any indirect exports
-        // checking requires transitive would be sufficient for JDK modules
-        if (md.requires().stream()
-              .map(ModuleDescriptor.Requires::modifiers)
-              .anyMatch(mods -> mods.contains(ModuleDescriptor.Requires.Modifier.TRANSITIVE))) {
-            return true;
-        }
-        return false;
-    }
-
-    private static final Set<String> NON_JAVA_SE_MODULES =
-        Set.of("java.jnlp", "java.smartcardio");
-
-    /**
-     * CSS class names are defined in docs-bundle-page.html
-     */
-    enum ModuleGroup {
-        JAVA_SE("javase", mn -> mn.startsWith("java.") && !NON_JAVA_SE_MODULES.contains(mn)),
-        JDK("jdk", mn -> mn.startsWith("jdk.")),
-        JAVAFX("javafx", mn -> mn.startsWith("javafx.")),
-        NON_JAVA_SE("jcp", NON_JAVA_SE_MODULES::contains);
-
-        final String cssClass;
-        final Predicate<String> predicate;
-        ModuleGroup(String cssClass, Predicate<String> predicate) {
-            this.cssClass = cssClass;
-            this.predicate = predicate;
-        }
-    }
-}
diff --git a/make/src/classes/build/tools/docs/docs-bundle-page.html b/make/src/classes/build/tools/docs/docs-bundle-page.html
deleted file mode 100644
index 9a4f5cf..0000000
--- a/make/src/classes/build/tools/docs/docs-bundle-page.html
+++ /dev/null
@@ -1,171 +0,0 @@
-<!--
-Copyright (c) 2017, 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.
--->
-
-<!DOCTYPE html>
-<html lang="en">
-<head>
-<title>@HEADER_TITLE@</title>
-
-<meta http-equiv="content-type" content="text/html;" charset="utf-8">
-<link rel="stylesheet" href="resources/jdk-default.css" type="text/css" />
-<style type="text/css">
-
-table a { text-decoration: none }
-table { border: none }
-th, td { border: 2px solid white; }
-thead th { background-color: #DDD }
-tbody th { background-color: #EEE }
-
-table div.javase, ul.key span.javase { background-color: #C6E7F3 }
-table div.jdk, ul.key span.jdk { background-color: #ECE1C5 }
-table div.javafx, ul.key span.javafx { background-color: #ECEDCC }
-table div.jcp, ul.key span.jcp { background-color: #E9E9E9 }
-td div { padding: 3px 5px; color: blue }
-table tbody td div a { padding: 0 .5em; margin: 0: 1em; }
-table tbody td div a:link { color: black }
-table tbody td div a:visited { color: black }
-table tbody td div a[href]:hover { color: black; text-decoration: underline }
-td { padding: 0 }
-table tbody td div a { padding: 0 .5em; margin: 0: 1em }
-
-.key { font-size: smaller; }
-ul.key li { display:inline-block; padding: 0 1em }
-ul.key span {
-  border: 1px solid black;
-  font-family: DejaVu Sans Mono, monospace;
-}
-ul.key span:before { content: " " }
-ul.key span:after { content: " " }
-
-caption {
-  text-align: center;
-}
-
-tr:nth-child(even), tr:nth-child(even) th[scope=row] {
-  background-color: #EEE;
-}
-tr:nth-child(odd), tr:nth-child(odd) th[scope=row] {
-  background-color: #EEE;
-}
-
-</style>
-</head>
-
-<h1>@HEADER_TITLE@</h1>
-
-<ul>
-<li><a href="api/index.html">JDK API Specification</a></li>
-<li><a href="https://docs.oracle.com/javase/specs/">
-    Java Language and Virtual Machine Specifications</a></li>
-<li><a href="https://www.oracle.com/pls/topic/lookup?ctx=javase9&id=tools_reference_overview">
-    Tools Reference</a></li>
-</ul>
-
-
-<table>
-<caption style="display:none">JDK Modules</caption>
-<thead>
-<tr>
-  <th scope="col">Group</th>
-  <th scope="col">Modules</th>
-</tr>
-</thead>
-<tbody>
-<tr>
-  <th scope="row">Foundation</th>
-  <td>@JAVA_BASE@</td>
-</tr>
-<tr>
-  <th scope="row">Integration</th>
-  <td>@INTEGRATION_MODULES@</td>
-</tr>
-<tr>
-  <th scope="row">User Interface</th>
-  <td>@UI_MODULES@</td>
-</tr>
-<tr>
-  <th scope="row">Compilation</th>
-  <td>@COMPILER_MODULES@</td>
-</tr>
-<tr>
-  <th scope="row">Scripting</th>
-  <td>@SCRIPTING_MODULES@</td>
-</tr>
-<tr>
-  <th scope="row">Security</th>
-  <td>@SECURITY_MODULES@</td>
-</tr>
-<tr>
-  <th scope="row">Management</th>
-  <td>@MANAGEMENT_MODULES@</td>
-</tr>
-<tr>
-  <th scope="row">Instrumentation</th>
-  <td>@INSTRUMENT_MODULES@</td>
-</tr>
-<tr>
-  <th scope="row">Serviceability</th>
-  <td>@SVC_MODULES@</td>
-</tr>
-<tr>
-  <th scope="row">Packaging</th>
-  <td>@PACKAGING_MODULES@</td>
-</tr>
-<tr>
-  <th scope="row">Incubator</th>
-  <td>@INCUBATOR_MODULES@</td>
-</tr>
-<tr>
-  <th scope="row">Non-Java SE</th>
-  <td>@OTHER_MODULES@</td>
-</tr>
-<tr>
-  <th scope="row">Java EE</th>
-  <td>@JAVA_EE_MODULES@</td>
-</tr>
-<tr>
-  <th scope="row">Aggregator</th>
-  <td>@AGGREGATOR_MODULES@</td>
-</tr>
-</tbody>
-</table>
-
-<p class="key">Key:
-<ul class="key">
-<li><span class="javase">&nbsp;</span>&nbsp; Java SE
-<li><span class="jdk">&nbsp;</span>&nbsp; JDK
-<li><span class="javafx">&nbsp;</span>&nbsp; JavaFX
-<li><span class="jcp">&nbsp;</span>&nbsp; Non-Java SE
-<li><i>italic</i> No Exported API (e.g. a tool or provider)</li>
-</ul>
-
-<p>
-<hr>
-<a href="legal/cpyr.html">Copyright</a> &copy 1993, 2017, Oracle and/or its affiliates. All rights reserved.</p>
-
-</body>
-</html>
-	
-	
diff --git a/make/src/classes/build/tools/docs/docs-module-groups.properties b/make/src/classes/build/tools/docs/docs-module-groups.properties
deleted file mode 100644
index 093a294..0000000
--- a/make/src/classes/build/tools/docs/docs-module-groups.properties
+++ /dev/null
@@ -1,114 +0,0 @@
-# Module Grouping for the docs bundle page
-#
-
-java_base=\
-java.base
-
-java_ee_modules=\
-java.activation \
-java.corba \
-java.transaction \
-java.xml.bind \
-java.xml.ws \
-java.xml.ws.annotation \
-jdk.xml.bind \
-jdk.xml.ws
-
-aggregator_modules=\
-java.se \
-java.se.ee
-
-security_modules=\
-java.security.jgss \
-java.security.sasl \
-java.xml.crypto \
-jdk.security.auth \
-jdk.security.jgss \
-jdk.crypto.cryptoki \
-jdk.crypto.ec \
-jdk.crypto.mscapi \
-jdk.crypto.ucrypto \
-jdk.policytool
-
-instrument_modules=\
-java.instrument
-  
-management_modules=\
-java.management \
-java.management.rmi \
-jdk.management \
-jdk.management.agent \
-jdk.management.cmm \
-jdk.management.jfr \
-jdk.management.resource \
-jdk.snmp \
-jdk.jconsole
-
-integration_modules=\
-java.logging \
-java.naming \
-java.prefs \
-java.rmi \
-java.sql \
-java.sql.rowset \
-java.xml \
-jdk.charsets \
-jdk.localedata \
-jdk.net \
-jdk.sctp \
-jdk.jsobject \
-jdk.httpserver \
-jdk.naming.dns \
-jdk.naming.rmi \
-jdk.xml.dom \
-jdk.zipfs
-
-ui_modules=\
-java.datatransfer \
-java.desktop \
-javafx.base \
-javafx.controls \
-javafx.fxml \
-javafx.graphics \
-javafx.media \
-javafx.swing \
-javafx.web \
-jdk.accessibility
-
-svc_modules=\
-jdk.jfr \
-jdk.attach \
-jdk.jcmd \
-jdk.jdi \
-jdk.jdwp.agent \
-jdk.jstatd \
-jdk.hotspot.agent
-
-packaging_modules=\
-jdk.jartool \
-jdk.jlink \
-jdk.pack \
-jdk.packager.services
-
-compiler_modules=\
-java.compiler \
-jdk.compiler \
-jdk.javadoc \
-jdk.jdeps \
-jdk.editpad \
-jdk.jshell \
-jdk.rmic
-
-scripting_modules=\
-java.scripting \
-jdk.dynalink \
-jdk.scripting.nashorn \
-jdk.scripting.nashorn.shell
-
-other_modules=\
-java.jnlp \
-java.smartcardio
-  
-incubator_modules=\
-jdk.incubator.httpclient
-
diff --git a/src/java.base/share/classes/java/io/File.java b/src/java.base/share/classes/java/io/File.java
index e9959b5..2edef59 100644
--- a/src/java.base/share/classes/java/io/File.java
+++ b/src/java.base/share/classes/java/io/File.java
@@ -916,23 +916,28 @@
      * Returns the time that the file denoted by this abstract pathname was
      * last modified.
      *
+     * @apiNote
+     * While the unit of time of the return value is milliseconds, the
+     * granularity of the value depends on the underlying file system and may
+     * be larger.  For example, some file systems use time stamps in units of
+     * seconds.
+     *
      * <p> Where it is required to distinguish an I/O exception from the case
      * where {@code 0L} is returned, or where several attributes of the
      * same file are required at the same time, or where the time of last
      * access or the creation time are required, then the {@link
      * java.nio.file.Files#readAttributes(Path,Class,LinkOption[])
-     * Files.readAttributes} method may be used.
-     *
-     * @apiNote
-     * While the unit of time of the return value is milliseconds,
-     * the granularity of the value depends on the underlying
-     * file system and may be larger.  For example, some
-     * file systems use time stamps in units of seconds.
+     * Files.readAttributes} method may be used.  If however only the
+     * time of last modification is required, then the
+     * {@link java.nio.file.Files#getLastModifiedTime(Path,LinkOption[])
+     * Files.getLastModifiedTime} method may be used instead.
      *
      * @return  A <code>long</code> value representing the time the file was
      *          last modified, measured in milliseconds since the epoch
      *          (00:00:00 GMT, January 1, 1970), or <code>0L</code> if the
-     *          file does not exist or if an I/O error occurs
+     *          file does not exist or if an I/O error occurs.  The value may
+     *          be negative indicating the number of milliseconds before the
+     *          epoch
      *
      * @throws  SecurityException
      *          If a security manager exists and its {@link
diff --git a/src/java.base/share/classes/java/lang/invoke/VarHandle.java b/src/java.base/share/classes/java/lang/invoke/VarHandle.java
index 9e2533f..e468055 100644
--- a/src/java.base/share/classes/java/lang/invoke/VarHandle.java
+++ b/src/java.base/share/classes/java/lang/invoke/VarHandle.java
@@ -110,6 +110,20 @@
  * boolean r = avh.compareAndSet(sa, 10, "expected", "new");
  * }</pre>
  *
+ * <p>Access modes control atomicity and consistency properties.
+ * <em>Plain</em> read ({@code get}) and write ({@code set})
+ * accesses are guaranteed to be bitwise atomic only for references
+ * and for primitive values of at most 32 bits, and impose no observable
+ * ordering constraints with respect to threads other than the
+ * executing thread. <em>Opaque</em> operations are bitwise atomic and
+ * coherently ordered with respect to accesses to the same variable.
+ * In addition to obeying Opaque properties, <em>Acquire</em> mode
+ * reads and their subsequent accesses are ordered after matching
+ * <em>Release</em> mode writes and their previous accesses.  In
+ * addition to obeying Acquire and Release properties, all
+ * <em>Volatile</em> operations are totally ordered with respect to
+ * each other.
+ *
  * <p>Access modes are grouped into the following categories:
  * <ul>
  * <li>read access modes that get the value of a variable under specified
diff --git a/src/java.base/share/classes/java/util/BitSet.java b/src/java.base/share/classes/java/util/BitSet.java
index f453965..c9dafae 100644
--- a/src/java.base/share/classes/java/util/BitSet.java
+++ b/src/java.base/share/classes/java/util/BitSet.java
@@ -1212,7 +1212,7 @@
      *
      * <p>The stream binds to this bit set when the terminal stream operation
      * commences (specifically, the spliterator for the stream is
-     * <a href="../Spliterator.html#binding"><em>late-binding</em></a>).  If the
+     * <a href="Spliterator.html#binding"><em>late-binding</em></a>).  If the
      * bit set is modified during that operation then the result is undefined.
      *
      * @return a stream of integers representing set indices
diff --git a/src/java.base/share/classes/java/util/concurrent/atomic/AtomicInteger.java b/src/java.base/share/classes/java/util/concurrent/atomic/AtomicInteger.java
index 22850e6..d61f246 100644
--- a/src/java.base/share/classes/java/util/concurrent/atomic/AtomicInteger.java
+++ b/src/java.base/share/classes/java/util/concurrent/atomic/AtomicInteger.java
@@ -249,7 +249,8 @@
     }
 
     /**
-     * Atomically updates the current value with the results of
+     * Atomically updates (with memory effects as specified by {@link
+     * VarHandle#compareAndSet}) the current value with the results of
      * applying the given function, returning the previous value. The
      * function should be side-effect-free, since it may be re-applied
      * when attempted updates fail due to contention among threads.
@@ -270,7 +271,8 @@
     }
 
     /**
-     * Atomically updates the current value with the results of
+     * Atomically updates (with memory effects as specified by {@link
+     * VarHandle#compareAndSet}) the current value with the results of
      * applying the given function, returning the updated value. The
      * function should be side-effect-free, since it may be re-applied
      * when attempted updates fail due to contention among threads.
@@ -291,13 +293,14 @@
     }
 
     /**
-     * Atomically updates the current value with the results of
+     * Atomically updates (with memory effects as specified by {@link
+     * VarHandle#compareAndSet}) the current value with the results of
      * applying the given function to the current and given values,
      * returning the previous value. The function should be
      * side-effect-free, since it may be re-applied when attempted
-     * updates fail due to contention among threads.  The function
-     * is applied with the current value as its first argument,
-     * and the given update as the second argument.
+     * updates fail due to contention among threads.  The function is
+     * applied with the current value as its first argument, and the
+     * given update as the second argument.
      *
      * @param x the update value
      * @param accumulatorFunction a side-effect-free function of two arguments
@@ -317,13 +320,14 @@
     }
 
     /**
-     * Atomically updates the current value with the results of
+     * Atomically updates (with memory effects as specified by {@link
+     * VarHandle#compareAndSet}) the current value with the results of
      * applying the given function to the current and given values,
      * returning the updated value. The function should be
      * side-effect-free, since it may be re-applied when attempted
-     * updates fail due to contention among threads.  The function
-     * is applied with the current value as its first argument,
-     * and the given update as the second argument.
+     * updates fail due to contention among threads.  The function is
+     * applied with the current value as its first argument, and the
+     * given update as the second argument.
      *
      * @param x the update value
      * @param accumulatorFunction a side-effect-free function of two arguments
diff --git a/src/java.base/share/classes/java/util/concurrent/atomic/AtomicIntegerArray.java b/src/java.base/share/classes/java/util/concurrent/atomic/AtomicIntegerArray.java
index efddc9f..f59327d 100644
--- a/src/java.base/share/classes/java/util/concurrent/atomic/AtomicIntegerArray.java
+++ b/src/java.base/share/classes/java/util/concurrent/atomic/AtomicIntegerArray.java
@@ -260,10 +260,12 @@
     }
 
     /**
-     * Atomically updates the element at index {@code i} with the results
-     * of applying the given function, returning the previous value. The
-     * function should be side-effect-free, since it may be re-applied
-     * when attempted updates fail due to contention among threads.
+     * Atomically updates (with memory effects as specified by {@link
+     * VarHandle#compareAndSet}) the element at index {@code i} with
+     * the results of applying the given function, returning the
+     * previous value. The function should be side-effect-free, since
+     * it may be re-applied when attempted updates fail due to
+     * contention among threads.
      *
      * @param i the index
      * @param updateFunction a side-effect-free function
@@ -282,10 +284,12 @@
     }
 
     /**
-     * Atomically updates the element at index {@code i} with the results
-     * of applying the given function, returning the updated value. The
-     * function should be side-effect-free, since it may be re-applied
-     * when attempted updates fail due to contention among threads.
+     * Atomically updates (with memory effects as specified by {@link
+     * VarHandle#compareAndSet}) the element at index {@code i} with
+     * the results of applying the given function, returning the
+     * updated value. The function should be side-effect-free, since it
+     * may be re-applied when attempted updates fail due to contention
+     * among threads.
      *
      * @param i the index
      * @param updateFunction a side-effect-free function
@@ -304,10 +308,11 @@
     }
 
     /**
-     * Atomically updates the element at index {@code i} with the
-     * results of applying the given function to the current and given
-     * values, returning the previous value. The function should be
-     * side-effect-free, since it may be re-applied when attempted
+     * Atomically updates (with memory effects as specified by {@link
+     * VarHandle#compareAndSet}) the element at index {@code i} with
+     * the results of applying the given function to the current and
+     * given values, returning the previous value. The function should
+     * be side-effect-free, since it may be re-applied when attempted
      * updates fail due to contention among threads.  The function is
      * applied with the current value of the element at index {@code i}
      * as its first argument, and the given update as the second
@@ -332,10 +337,11 @@
     }
 
     /**
-     * Atomically updates the element at index {@code i} with the
-     * results of applying the given function to the current and given
-     * values, returning the updated value. The function should be
-     * side-effect-free, since it may be re-applied when attempted
+     * Atomically updates (with memory effects as specified by {@link
+     * VarHandle#compareAndSet}) the element at index {@code i} with
+     * the results of applying the given function to the current and
+     * given values, returning the updated value. The function should
+     * be side-effect-free, since it may be re-applied when attempted
      * updates fail due to contention among threads.  The function is
      * applied with the current value of the element at index {@code i}
      * as its first argument, and the given update as the second
diff --git a/src/java.base/share/classes/java/util/concurrent/atomic/AtomicIntegerFieldUpdater.java b/src/java.base/share/classes/java/util/concurrent/atomic/AtomicIntegerFieldUpdater.java
index 826a055..c8a37f3 100644
--- a/src/java.base/share/classes/java/util/concurrent/atomic/AtomicIntegerFieldUpdater.java
+++ b/src/java.base/share/classes/java/util/concurrent/atomic/AtomicIntegerFieldUpdater.java
@@ -46,6 +46,7 @@
 import jdk.internal.misc.Unsafe;
 import jdk.internal.reflect.CallerSensitive;
 import jdk.internal.reflect.Reflection;
+import java.lang.invoke.VarHandle;
 
 /**
  * A reflection-based utility that enables atomic updates to
@@ -275,10 +276,12 @@
     }
 
     /**
-     * Atomically updates the field of the given object managed by this updater
-     * with the results of applying the given function, returning the previous
-     * value. The function should be side-effect-free, since it may be
-     * re-applied when attempted updates fail due to contention among threads.
+     * Atomically updates (with memory effects as specified by {@link
+     * VarHandle#compareAndSet}) the field of the given object managed
+     * by this updater with the results of applying the given
+     * function, returning the previous value. The function should be
+     * side-effect-free, since it may be re-applied when attempted
+     * updates fail due to contention among threads.
      *
      * @param obj An object whose field to get and set
      * @param updateFunction a side-effect-free function
@@ -295,10 +298,12 @@
     }
 
     /**
-     * Atomically updates the field of the given object managed by this updater
-     * with the results of applying the given function, returning the updated
-     * value. The function should be side-effect-free, since it may be
-     * re-applied when attempted updates fail due to contention among threads.
+     * Atomically updates (with memory effects as specified by {@link
+     * VarHandle#compareAndSet}) the field of the given object managed
+     * by this updater with the results of applying the given
+     * function, returning the updated value. The function should be
+     * side-effect-free, since it may be re-applied when attempted
+     * updates fail due to contention among threads.
      *
      * @param obj An object whose field to get and set
      * @param updateFunction a side-effect-free function
@@ -315,13 +320,14 @@
     }
 
     /**
-     * Atomically updates the field of the given object managed by this
-     * updater with the results of applying the given function to the
-     * current and given values, returning the previous value. The
-     * function should be side-effect-free, since it may be re-applied
-     * when attempted updates fail due to contention among threads.  The
-     * function is applied with the current value as its first argument,
-     * and the given update as the second argument.
+     * Atomically updates (with memory effects as specified by {@link
+     * VarHandle#compareAndSet}) the field of the given object managed
+     * by this updater with the results of applying the given function
+     * to the current and given values, returning the previous value.
+     * The function should be side-effect-free, since it may be
+     * re-applied when attempted updates fail due to contention among
+     * threads.  The function is applied with the current value as its
+     * first argument, and the given update as the second argument.
      *
      * @param obj An object whose field to get and set
      * @param x the update value
@@ -340,13 +346,14 @@
     }
 
     /**
-     * Atomically updates the field of the given object managed by this
-     * updater with the results of applying the given function to the
-     * current and given values, returning the updated value. The
-     * function should be side-effect-free, since it may be re-applied
-     * when attempted updates fail due to contention among threads.  The
-     * function is applied with the current value as its first argument,
-     * and the given update as the second argument.
+     * Atomically updates (with memory effects as specified by {@link
+     * VarHandle#compareAndSet}) the field of the given object managed
+     * by this updater with the results of applying the given function
+     * to the current and given values, returning the updated value.
+     * The function should be side-effect-free, since it may be
+     * re-applied when attempted updates fail due to contention among
+     * threads.  The function is applied with the current value as its
+     * first argument, and the given update as the second argument.
      *
      * @param obj An object whose field to get and set
      * @param x the update value
diff --git a/src/java.base/share/classes/java/util/concurrent/atomic/AtomicLong.java b/src/java.base/share/classes/java/util/concurrent/atomic/AtomicLong.java
index 940f67c..4345ae8 100644
--- a/src/java.base/share/classes/java/util/concurrent/atomic/AtomicLong.java
+++ b/src/java.base/share/classes/java/util/concurrent/atomic/AtomicLong.java
@@ -118,8 +118,7 @@
      * @param newValue the new value
      */
     public final void set(long newValue) {
-        // Use putLongVolatile instead of ordinary volatile store when
-        // using compareAndSetLong, for sake of some 32bit systems.
+        // See JDK-8180620: Clarify VarHandle mixed-access subtleties
         U.putLongVolatile(this, VALUE, newValue);
     }
 
@@ -265,7 +264,8 @@
     }
 
     /**
-     * Atomically updates the current value with the results of
+     * Atomically updates (with memory effects as specified by {@link
+     * VarHandle#compareAndSet}) the current value with the results of
      * applying the given function, returning the previous value. The
      * function should be side-effect-free, since it may be re-applied
      * when attempted updates fail due to contention among threads.
@@ -286,7 +286,8 @@
     }
 
     /**
-     * Atomically updates the current value with the results of
+     * Atomically updates (with memory effects as specified by {@link
+     * VarHandle#compareAndSet}) the current value with the results of
      * applying the given function, returning the updated value. The
      * function should be side-effect-free, since it may be re-applied
      * when attempted updates fail due to contention among threads.
@@ -307,13 +308,14 @@
     }
 
     /**
-     * Atomically updates the current value with the results of
+     * Atomically updates (with memory effects as specified by {@link
+     * VarHandle#compareAndSet}) the current value with the results of
      * applying the given function to the current and given values,
      * returning the previous value. The function should be
      * side-effect-free, since it may be re-applied when attempted
-     * updates fail due to contention among threads.  The function
-     * is applied with the current value as its first argument,
-     * and the given update as the second argument.
+     * updates fail due to contention among threads.  The function is
+     * applied with the current value as its first argument, and the
+     * given update as the second argument.
      *
      * @param x the update value
      * @param accumulatorFunction a side-effect-free function of two arguments
@@ -333,13 +335,14 @@
     }
 
     /**
-     * Atomically updates the current value with the results of
+     * Atomically updates (with memory effects as specified by {@link
+     * VarHandle#compareAndSet}) the current value with the results of
      * applying the given function to the current and given values,
      * returning the updated value. The function should be
      * side-effect-free, since it may be re-applied when attempted
-     * updates fail due to contention among threads.  The function
-     * is applied with the current value as its first argument,
-     * and the given update as the second argument.
+     * updates fail due to contention among threads.  The function is
+     * applied with the current value as its first argument, and the
+     * given update as the second argument.
      *
      * @param x the update value
      * @param accumulatorFunction a side-effect-free function of two arguments
diff --git a/src/java.base/share/classes/java/util/concurrent/atomic/AtomicLongArray.java b/src/java.base/share/classes/java/util/concurrent/atomic/AtomicLongArray.java
index 10aa9de..24e42a1 100644
--- a/src/java.base/share/classes/java/util/concurrent/atomic/AtomicLongArray.java
+++ b/src/java.base/share/classes/java/util/concurrent/atomic/AtomicLongArray.java
@@ -260,10 +260,12 @@
     }
 
     /**
-     * Atomically updates the element at index {@code i} with the results
-     * of applying the given function, returning the previous value. The
-     * function should be side-effect-free, since it may be re-applied
-     * when attempted updates fail due to contention among threads.
+     * Atomically updates (with memory effects as specified by {@link
+     * VarHandle#compareAndSet}) the element at index {@code i} with
+     * the results of applying the given function, returning the
+     * previous value. The function should be side-effect-free, since
+     * it may be re-applied when attempted updates fail due to
+     * contention among threads.
      *
      * @param i the index
      * @param updateFunction a side-effect-free function
@@ -282,10 +284,12 @@
     }
 
     /**
-     * Atomically updates the element at index {@code i} with the results
-     * of applying the given function, returning the updated value. The
-     * function should be side-effect-free, since it may be re-applied
-     * when attempted updates fail due to contention among threads.
+     * Atomically updates (with memory effects as specified by {@link
+     * VarHandle#compareAndSet}) the element at index {@code i} with
+     * the results of applying the given function, returning the
+     * updated value. The function should be side-effect-free, since it
+     * may be re-applied when attempted updates fail due to contention
+     * among threads.
      *
      * @param i the index
      * @param updateFunction a side-effect-free function
@@ -304,10 +308,11 @@
     }
 
     /**
-     * Atomically updates the element at index {@code i} with the
-     * results of applying the given function to the current and given
-     * values, returning the previous value. The function should be
-     * side-effect-free, since it may be re-applied when attempted
+     * Atomically updates (with memory effects as specified by {@link
+     * VarHandle#compareAndSet}) the element at index {@code i} with
+     * the results of applying the given function to the current and
+     * given values, returning the previous value. The function should
+     * be side-effect-free, since it may be re-applied when attempted
      * updates fail due to contention among threads.  The function is
      * applied with the current value of the element at index {@code i}
      * as its first argument, and the given update as the second
@@ -332,10 +337,11 @@
     }
 
     /**
-     * Atomically updates the element at index {@code i} with the
-     * results of applying the given function to the current and given
-     * values, returning the updated value. The function should be
-     * side-effect-free, since it may be re-applied when attempted
+     * Atomically updates (with memory effects as specified by {@link
+     * VarHandle#compareAndSet}) the element at index {@code i} with
+     * the results of applying the given function to the current and
+     * given values, returning the updated value. The function should
+     * be side-effect-free, since it may be re-applied when attempted
      * updates fail due to contention among threads.  The function is
      * applied with the current value of the element at index {@code i}
      * as its first argument, and the given update as the second
diff --git a/src/java.base/share/classes/java/util/concurrent/atomic/AtomicLongFieldUpdater.java b/src/java.base/share/classes/java/util/concurrent/atomic/AtomicLongFieldUpdater.java
index ee0447a..3db7e36 100644
--- a/src/java.base/share/classes/java/util/concurrent/atomic/AtomicLongFieldUpdater.java
+++ b/src/java.base/share/classes/java/util/concurrent/atomic/AtomicLongFieldUpdater.java
@@ -46,6 +46,7 @@
 import jdk.internal.misc.Unsafe;
 import jdk.internal.reflect.CallerSensitive;
 import jdk.internal.reflect.Reflection;
+import java.lang.invoke.VarHandle;
 
 /**
  * A reflection-based utility that enables atomic updates to
@@ -278,10 +279,12 @@
     }
 
     /**
-     * Atomically updates the field of the given object managed by this updater
-     * with the results of applying the given function, returning the previous
-     * value. The function should be side-effect-free, since it may be
-     * re-applied when attempted updates fail due to contention among threads.
+     * Atomically updates (with memory effects as specified by {@link
+     * VarHandle#compareAndSet}) the field of the given object managed
+     * by this updater with the results of applying the given
+     * function, returning the previous value. The function should be
+     * side-effect-free, since it may be re-applied when attempted
+     * updates fail due to contention among threads.
      *
      * @param obj An object whose field to get and set
      * @param updateFunction a side-effect-free function
@@ -298,10 +301,12 @@
     }
 
     /**
-     * Atomically updates the field of the given object managed by this updater
-     * with the results of applying the given function, returning the updated
-     * value. The function should be side-effect-free, since it may be
-     * re-applied when attempted updates fail due to contention among threads.
+     * Atomically updates (with memory effects as specified by {@link
+     * VarHandle#compareAndSet}) the field of the given object managed
+     * by this updater with the results of applying the given
+     * function, returning the updated value. The function should be
+     * side-effect-free, since it may be re-applied when attempted
+     * updates fail due to contention among threads.
      *
      * @param obj An object whose field to get and set
      * @param updateFunction a side-effect-free function
@@ -318,13 +323,14 @@
     }
 
     /**
-     * Atomically updates the field of the given object managed by this
-     * updater with the results of applying the given function to the
-     * current and given values, returning the previous value. The
-     * function should be side-effect-free, since it may be re-applied
-     * when attempted updates fail due to contention among threads.  The
-     * function is applied with the current value as its first argument,
-     * and the given update as the second argument.
+     * Atomically updates (with memory effects as specified by {@link
+     * VarHandle#compareAndSet}) the field of the given object managed
+     * by this updater with the results of applying the given function
+     * to the current and given values, returning the previous value.
+     * The function should be side-effect-free, since it may be
+     * re-applied when attempted updates fail due to contention among
+     * threads.  The function is applied with the current value as its
+     * first argument, and the given update as the second argument.
      *
      * @param obj An object whose field to get and set
      * @param x the update value
@@ -343,13 +349,14 @@
     }
 
     /**
-     * Atomically updates the field of the given object managed by this
-     * updater with the results of applying the given function to the
-     * current and given values, returning the updated value. The
-     * function should be side-effect-free, since it may be re-applied
-     * when attempted updates fail due to contention among threads.  The
-     * function is applied with the current value as its first argument,
-     * and the given update as the second argument.
+     * Atomically updates (with memory effects as specified by {@link
+     * VarHandle#compareAndSet}) the field of the given object managed
+     * by this updater with the results of applying the given function
+     * to the current and given values, returning the updated value.
+     * The function should be side-effect-free, since it may be
+     * re-applied when attempted updates fail due to contention among
+     * threads.  The function is applied with the current value as its
+     * first argument, and the given update as the second argument.
      *
      * @param obj An object whose field to get and set
      * @param x the update value
diff --git a/src/java.base/share/classes/java/util/concurrent/atomic/AtomicReference.java b/src/java.base/share/classes/java/util/concurrent/atomic/AtomicReference.java
index 66b7b6c..db1d483 100644
--- a/src/java.base/share/classes/java/util/concurrent/atomic/AtomicReference.java
+++ b/src/java.base/share/classes/java/util/concurrent/atomic/AtomicReference.java
@@ -170,7 +170,8 @@
     }
 
     /**
-     * Atomically updates the current value with the results of
+     * Atomically updates (with memory effects as specified by {@link
+     * VarHandle#compareAndSet}) the current value with the results of
      * applying the given function, returning the previous value. The
      * function should be side-effect-free, since it may be re-applied
      * when attempted updates fail due to contention among threads.
@@ -191,7 +192,8 @@
     }
 
     /**
-     * Atomically updates the current value with the results of
+     * Atomically updates (with memory effects as specified by {@link
+     * VarHandle#compareAndSet}) the current value with the results of
      * applying the given function, returning the updated value. The
      * function should be side-effect-free, since it may be re-applied
      * when attempted updates fail due to contention among threads.
@@ -212,13 +214,14 @@
     }
 
     /**
-     * Atomically updates the current value with the results of
+     * Atomically updates (with memory effects as specified by {@link
+     * VarHandle#compareAndSet}) the current value with the results of
      * applying the given function to the current and given values,
      * returning the previous value. The function should be
      * side-effect-free, since it may be re-applied when attempted
-     * updates fail due to contention among threads.  The function
-     * is applied with the current value as its first argument,
-     * and the given update as the second argument.
+     * updates fail due to contention among threads.  The function is
+     * applied with the current value as its first argument, and the
+     * given update as the second argument.
      *
      * @param x the update value
      * @param accumulatorFunction a side-effect-free function of two arguments
@@ -238,13 +241,14 @@
     }
 
     /**
-     * Atomically updates the current value with the results of
+     * Atomically updates (with memory effects as specified by {@link
+     * VarHandle#compareAndSet}) the current value with the results of
      * applying the given function to the current and given values,
      * returning the updated value. The function should be
      * side-effect-free, since it may be re-applied when attempted
-     * updates fail due to contention among threads.  The function
-     * is applied with the current value as its first argument,
-     * and the given update as the second argument.
+     * updates fail due to contention among threads.  The function is
+     * applied with the current value as its first argument, and the
+     * given update as the second argument.
      *
      * @param x the update value
      * @param accumulatorFunction a side-effect-free function of two arguments
diff --git a/src/java.base/share/classes/java/util/concurrent/atomic/AtomicReferenceArray.java b/src/java.base/share/classes/java/util/concurrent/atomic/AtomicReferenceArray.java
index 2d529bb..b3193a2 100644
--- a/src/java.base/share/classes/java/util/concurrent/atomic/AtomicReferenceArray.java
+++ b/src/java.base/share/classes/java/util/concurrent/atomic/AtomicReferenceArray.java
@@ -190,10 +190,12 @@
     }
 
     /**
-     * Atomically updates the element at index {@code i} with the results
-     * of applying the given function, returning the previous value. The
-     * function should be side-effect-free, since it may be re-applied
-     * when attempted updates fail due to contention among threads.
+     * Atomically updates (with memory effects as specified by {@link
+     * VarHandle#compareAndSet}) the element at index {@code i} with
+     * the results of applying the given function, returning the
+     * previous value. The function should be side-effect-free, since
+     * it may be re-applied when attempted updates fail due to
+     * contention among threads.
      *
      * @param i the index
      * @param updateFunction a side-effect-free function
@@ -212,10 +214,12 @@
     }
 
     /**
-     * Atomically updates the element at index {@code i} with the results
-     * of applying the given function, returning the updated value. The
-     * function should be side-effect-free, since it may be re-applied
-     * when attempted updates fail due to contention among threads.
+     * Atomically updates (with memory effects as specified by {@link
+     * VarHandle#compareAndSet}) the element at index {@code i} with
+     * the results of applying the given function, returning the
+     * updated value. The function should be side-effect-free, since it
+     * may be re-applied when attempted updates fail due to contention
+     * among threads.
      *
      * @param i the index
      * @param updateFunction a side-effect-free function
@@ -234,10 +238,11 @@
     }
 
     /**
-     * Atomically updates the element at index {@code i} with the
-     * results of applying the given function to the current and given
-     * values, returning the previous value. The function should be
-     * side-effect-free, since it may be re-applied when attempted
+     * Atomically updates (with memory effects as specified by {@link
+     * VarHandle#compareAndSet}) the element at index {@code i} with
+     * the results of applying the given function to the current and
+     * given values, returning the previous value. The function should
+     * be side-effect-free, since it may be re-applied when attempted
      * updates fail due to contention among threads.  The function is
      * applied with the current value of the element at index {@code i}
      * as its first argument, and the given update as the second
@@ -262,10 +267,11 @@
     }
 
     /**
-     * Atomically updates the element at index {@code i} with the
-     * results of applying the given function to the current and given
-     * values, returning the updated value. The function should be
-     * side-effect-free, since it may be re-applied when attempted
+     * Atomically updates (with memory effects as specified by {@link
+     * VarHandle#compareAndSet}) the element at index {@code i} with
+     * the results of applying the given function to the current and
+     * given values, returning the updated value. The function should
+     * be side-effect-free, since it may be re-applied when attempted
      * updates fail due to contention among threads.  The function is
      * applied with the current value of the element at index {@code i}
      * as its first argument, and the given update as the second
diff --git a/src/java.base/share/classes/java/util/concurrent/atomic/AtomicReferenceFieldUpdater.java b/src/java.base/share/classes/java/util/concurrent/atomic/AtomicReferenceFieldUpdater.java
index a469abb..062e797 100644
--- a/src/java.base/share/classes/java/util/concurrent/atomic/AtomicReferenceFieldUpdater.java
+++ b/src/java.base/share/classes/java/util/concurrent/atomic/AtomicReferenceFieldUpdater.java
@@ -46,6 +46,7 @@
 import jdk.internal.misc.Unsafe;
 import jdk.internal.reflect.CallerSensitive;
 import jdk.internal.reflect.Reflection;
+import java.lang.invoke.VarHandle;
 
 /**
  * A reflection-based utility that enables atomic updates to
@@ -199,10 +200,12 @@
     }
 
     /**
-     * Atomically updates the field of the given object managed by this updater
-     * with the results of applying the given function, returning the previous
-     * value. The function should be side-effect-free, since it may be
-     * re-applied when attempted updates fail due to contention among threads.
+     * Atomically updates (with memory effects as specified by {@link
+     * VarHandle#compareAndSet}) the field of the given object managed
+     * by this updater with the results of applying the given
+     * function, returning the previous value. The function should be
+     * side-effect-free, since it may be re-applied when attempted
+     * updates fail due to contention among threads.
      *
      * @param obj An object whose field to get and set
      * @param updateFunction a side-effect-free function
@@ -219,10 +222,12 @@
     }
 
     /**
-     * Atomically updates the field of the given object managed by this updater
-     * with the results of applying the given function, returning the updated
-     * value. The function should be side-effect-free, since it may be
-     * re-applied when attempted updates fail due to contention among threads.
+     * Atomically updates (with memory effects as specified by {@link
+     * VarHandle#compareAndSet}) the field of the given object managed
+     * by this updater with the results of applying the given
+     * function, returning the updated value. The function should be
+     * side-effect-free, since it may be re-applied when attempted
+     * updates fail due to contention among threads.
      *
      * @param obj An object whose field to get and set
      * @param updateFunction a side-effect-free function
@@ -239,13 +244,14 @@
     }
 
     /**
-     * Atomically updates the field of the given object managed by this
-     * updater with the results of applying the given function to the
-     * current and given values, returning the previous value. The
-     * function should be side-effect-free, since it may be re-applied
-     * when attempted updates fail due to contention among threads.  The
-     * function is applied with the current value as its first argument,
-     * and the given update as the second argument.
+     * Atomically updates (with memory effects as specified by {@link
+     * VarHandle#compareAndSet}) the field of the given object managed
+     * by this updater with the results of applying the given function
+     * to the current and given values, returning the previous value.
+     * The function should be side-effect-free, since it may be
+     * re-applied when attempted updates fail due to contention among
+     * threads.  The function is applied with the current value as its
+     * first argument, and the given update as the second argument.
      *
      * @param obj An object whose field to get and set
      * @param x the update value
@@ -264,13 +270,14 @@
     }
 
     /**
-     * Atomically updates the field of the given object managed by this
-     * updater with the results of applying the given function to the
-     * current and given values, returning the updated value. The
-     * function should be side-effect-free, since it may be re-applied
-     * when attempted updates fail due to contention among threads.  The
-     * function is applied with the current value as its first argument,
-     * and the given update as the second argument.
+     * Atomically updates (with memory effects as specified by {@link
+     * VarHandle#compareAndSet}) the field of the given object managed
+     * by this updater with the results of applying the given function
+     * to the current and given values, returning the updated value.
+     * The function should be side-effect-free, since it may be
+     * re-applied when attempted updates fail due to contention among
+     * threads.  The function is applied with the current value as its
+     * first argument, and the given update as the second argument.
      *
      * @param obj An object whose field to get and set
      * @param x the update value
diff --git a/src/java.base/share/classes/java/util/doc-files/coll-designfaq.html b/src/java.base/share/classes/java/util/doc-files/coll-designfaq.html
new file mode 100644
index 0000000..84d6cc3
--- /dev/null
+++ b/src/java.base/share/classes/java/util/doc-files/coll-designfaq.html
@@ -0,0 +1,399 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<!--
+ Copyright (c) 1998, 2017, 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.
+-->
+
+<html lang="en-US" xmlns="http://www.w3.org/1999/xhtml" xml:lang=
+"en-US">
+<head>
+<title>Java Collections API Design FAQ</title>
+</head>
+<body>
+<h2>Java Collections API Design FAQ</h2>
+<!-- Body text begins here -->
+<hr />
+This document answers frequently asked questions concerning the
+design of the Java collections framework. It is derived from the
+large volume of traffic on the collections-comments alias. It
+serves as a design rationale for the collections framework.
+<h3>Core Interfaces - General Questions</h3>
+<ol>
+<li><a href="#a1"><b>Why don't you support immutability directly in
+the core collection interfaces so that you can do away with
+<em>optional operations</em> (and
+UnsupportedOperationException)?</b></a></li>
+<li><a href="#a2"><b>Won't programmers have to surround any code
+that calls optional operations with a try-catch clause in case they
+throw an UnsupportedOperationException?</b></a></li>
+<li><a href="#a3"><b>Why isn't there a core interface for "bags"
+(AKA multisets)?</b></a></li>
+<li><a href="#a28"><b>Why didn't you use "Beans-style names" for
+consistency?</b></a></li>
+</ol>
+<h3>Collection Interface</h3>
+<ol>
+<li><a href="#a5"><b>Why doesn't Collection extend Cloneable and
+Serializable?</b></a></li>
+<li><a href="#a6"><b>Why don't you provide an "apply" method in
+Collection to apply a given method ("upcall") to all the elements
+of the Collection?</b></a></li>
+<li><a href="#a7"><b>Why didn't you provide a "Predicate" interface,
+and related methods (e.g., a method to find the first element in
+the Collection satisfying the predicate)?</b></a></li>
+<li><a href="#a8"><b>Why don't you provide a form of the addAll
+method that takes an Enumeration (or an Iterator)?</b></a></li>
+<li><a href="#a9"><b>Why don't the concrete implementations in the
+JDK have Enumeration (or Iterator) constructors?</b></a></li>
+<li><a href="#a10"><b>Why don't you provide an Iterator.add
+method?</b></a></li>
+</ol>
+<h3>List Interface</h3>
+<ol>
+<li><a href="#a11"><b>Why don't you rename the List interface to
+Sequence; doesn't "list" generally suggest "linked list"? Also,
+doesn't it conflict with java.awt.List?</b></a></li>
+<li><a href="#a12"><b>Why don't you rename List's set method to
+replace, to avoid confusion with Set.</b></a></li>
+</ol>
+<h3>Map Interface</h3>
+<ol>
+<li><a href="#a14"><b>Why doesn't Map extend
+Collection?</b></a></li>
+</ol>
+<h3>Iterator Interface</h3>
+<ol>
+<li><a href="#a18"><b>Why doesn't Iterator extend
+Enumeration?</b></a></li>
+<li><a href="#a19"><b>Why don't you provide an Iterator.peek method
+that allows you to look at the next element in an iteration without
+advancing the iterator?</b></a></li>
+</ol>
+<h3>Miscellaneous</h3>
+<ol>
+<li><a href="#a23"><b>Why did you write a new collections framework
+instead of adopting JGL (a preexisting collections package from
+ObjectSpace, Inc.) into the JDK?</b></a></li>
+<li><a href="#a26"><b>Why don't you eliminate all of the methods and
+classes that return "views" (Collections backed by other
+collection-like objects). This would greatly reduce
+aliasing.</b></a></li>
+<li><a href="#a27"><b>Why don't you provide for "observable"
+collections that send out Events when they're
+modified?</b></a></li>
+</ol>
+<hr size="3" noshade="noshade" />
+<h3>Core Interfaces - General Questions</h3>
+<ol>
+<li><a name="a1" id="a1"><b>Why don't you support immutability
+directly in the core collection interfaces so that you can do away
+with <em>optional operations</em> (and
+UnsupportedOperationException)?</b></a>
+<p>This is the most controversial design decision in the whole API.
+Clearly, static (compile time) type checking is highly desirable,
+and is the norm in Java. We would have supported it if we believed
+it were feasible. Unfortunately, attempts to achieve this goal
+cause an explosion in the size of the interface hierarchy, and do
+not succeed in eliminating the need for runtime exceptions (though
+they reduce it substantially).</p>
+<p>Doug Lea, who wrote a popular Java collections package that did
+reflect mutability distinctions in its interface hierarchy, no
+longer believes it is a viable approach, based on user experience
+with his collections package. In his words (from personal
+correspondence) "Much as it pains me to say it, strong static
+typing does not work for collection interfaces in Java."</p>
+<p>To illustrate the problem in gory detail, suppose you want to
+add the notion of modifiability to the Hierarchy. You need four new
+interfaces: ModifiableCollection, ModifiableSet, ModifiableList,
+and ModifiableMap. What was previously a simple hierarchy is now a
+messy heterarchy. Also, you need a new Iterator interface for use
+with unmodifiable Collections, that does not contain the remove
+operation. Now can you do away with UnsupportedOperationException?
+Unfortunately not.</p>
+<p>Consider arrays. They implement most of the List operations, but
+not remove and add. They are "fixed-size" Lists. If you want to
+capture this notion in the hierarchy, you have to add two new
+interfaces: VariableSizeList and VariableSizeMap. You don't have to
+add VariableSizeCollection and VariableSizeSet, because they'd be
+identical to ModifiableCollection and ModifiableSet, but you might
+choose to add them anyway for consistency's sake. Also, you need a
+new variety of ListIterator that doesn't support the add and remove
+operations, to go along with unmodifiable List. Now we're up to ten
+or twelve interfaces, plus two new Iterator interfaces, instead of
+our original four. Are we done? No.</p>
+<p>Consider logs (such as error logs, audit logs and journals for
+recoverable data objects). They are natural append-only sequences,
+that support all of the List operations except for remove and set
+(replace). They require a new core interface, and a new
+iterator.</p>
+<p>And what about immutable Collections, as opposed to unmodifiable
+ones? (i.e., Collections that cannot be changed by the client AND
+will never change for any other reason). Many argue that this is
+the most important distinction of all, because it allows multiple
+threads to access a collection concurrently without the need for
+synchronization. Adding this support to the type hierarchy requires
+four more interfaces.</p>
+<p>Now we're up to twenty or so interfaces and five iterators, and
+it's almost certain that there are still collections arising in
+practice that don't fit cleanly into any of the interfaces. For
+example, the <em>collection-views</em> returned by Map are natural
+delete-only collections. Also, there are collections that will
+reject certain elements on the basis of their value, so we still
+haven't done away with runtime exceptions.</p>
+<p>When all was said and done, we felt that it was a sound
+engineering compromise to sidestep the whole issue by providing a
+very small set of core interfaces that can throw a runtime
+exception.</p>
+</li>
+<li><a name="a2" id="a2"><b>Won't programmers have to surround any
+code that calls optional operations with a try-catch clause in case
+they throw an UnsupportedOperationException?</b></a>
+<p>It was never our intention that programs should catch these
+exceptions: that's why they're unchecked (runtime) exceptions. They
+should only arise as a result of programming errors, in which case,
+your program will halt due to the uncaught exception.</p>
+</li>
+<li><a name="a3" id="a3"><b>Why isn't there a core interface for
+"bags" (AKA multisets)?</b></a>
+<p>The Collection interface provides this functionality. We are not
+providing any public implementations of this interface, as we think
+that it wouldn't be used frequently enough to "pull its weight." We
+occasionally return such Collections, which are implemented easily
+atop AbstractCollection (for example, the Collection returned by
+Map.values).</p>
+</li>
+<li><a name="a28" id="a28"><b>Why didn't you use "Beans-style
+names" for consistency?</b></a>
+<p>While the names of the new collections methods do not adhere to
+the "Beans naming conventions", we believe that they are
+reasonable, consistent and appropriate to their purpose. It should
+be remembered that the Beans naming conventions do not apply to the
+JDK as a whole; the AWT did adopt these conventions, but that
+decision was somewhat controversial. We suspect that the
+collections APIs will be used quite pervasively, often with
+multiple method calls on a single line of code, so it is important
+that the names be short. Consider, for example, the Iterator
+methods. Currently, a loop over a collection looks like this:</p>
+<pre>
+    for (Iterator i = c.iterator(); i.hasNext(); )
+        System.out.println(i.next());
+</pre>
+Everything fits neatly on one line, even if the Collection name is
+a long expression. If we named the methods "getIterator",
+"hasNextElement" and "getNextElement", this would no longer be the
+case. Thus, we adopted the "traditional" JDK style rather than the
+Beans style.</li>
+</ol>
+<hr />
+<h3>Collection Interface</h3>
+<ol>
+<li><a name="a5" id="a5"><b>Why doesn't Collection extend Cloneable
+and Serializable?</b></a>
+<p>Many Collection implementations (including all of the ones
+provided by the JDK) will have a public clone method, but it would
+be mistake to require it of all Collections. For example, what does
+it mean to clone a Collection that's backed by a terabyte SQL
+database? Should the method call cause the company to requisition a
+new disk farm? Similar arguments hold for serializable.</p>
+<p>If the client doesn't know the actual type of a Collection, it's
+much more flexible and less error prone to have the client decide
+what type of Collection is desired, create an empty Collection of
+this type, and use the addAll method to copy the elements of the
+original collection into the new one.</p>
+</li>
+<li><a name="a6" id="a6"><b>Why don't you provide an "apply" method
+in Collection to apply a given method ("upcall") to all the
+elements of the Collection?</b></a>
+<p>This is what is referred to as an "Internal Iterator" in the
+"Design Patterns" book (Gamma et al.). We considered providing it,
+but decided not to as it seems somewhat redundant to support
+internal and external iterators, and Java already has a precedent
+for external iterators (with Enumerations). The "throw weight" of
+this functionality is increased by the fact that it requires a
+public interface to describe upcalls.</p>
+</li>
+<li><a name="a7" id="a7"><b>Why didn't you provide a "Predicate"
+interface, and related methods (e.g., a method to find the first
+element in the Collection satisfying the predicate)?</b></a>
+<p>It's easy to implement this functionality atop Iterators, and
+the resulting code may actually look cleaner as the user can inline
+the predicate. Thus, it's not clear whether this facility pulls its
+weight. It could be added to the Collections class at a later date
+(implemented atop Iterator), if it's deemed useful.</p>
+</li>
+<li><a name="a8" id="a8"><b>Why don't you provide a form of the
+addAll method that takes an Enumeration (or an Iterator)?</b></a>
+<p>Because we don't believe in using Enumerations (or Iterators) as
+"poor man's collections." This was occasionally done in prior
+releases, but now that we have the Collection interface, it is the
+preferred way to pass around abstract collections of objects.</p>
+</li>
+<li><a name="a9" id="a9"><b>Why don't the concrete implementations
+in the JDK have Enumeration (or Iterator) constructors?</b></a>
+<p>Again, this is an instance of an Enumeration serving as a "poor
+man's collection" and we're trying to discourage that. Note
+however, that we strongly suggest that all concrete implementations
+should have constructors that take a Collection (and create a new
+Collection with the same elements).</p>
+</li>
+<li><a name="a10" id="a10"><b>Why don't you provide an Iterator.add
+method?</b></a>
+<p>The semantics are unclear, given that the contract for Iterator
+makes no guarantees about the order of iteration. Note, however,
+that ListIterator does provide an add operation, as it does
+guarantee the order of the iteration.</p>
+</li>
+</ol>
+<hr />
+<h3>List Interface</h3>
+<ol>
+<li><a name="a11" id="a11"><b>Why don't you rename the List
+interface to Sequence; doesn't "list" generally suggest "linked
+list"? Also, doesn't it conflict with java.awt.List?</b></a>
+<p>People were evenly divided as to whether List suggests linked
+lists. Given the implementation naming convention,
+&lt;<em>Implementation</em>&gt;&lt;<em>Interface</em>&gt;, there
+was a strong desire to keep the core interface names short. Also,
+several existing names (AbstractSequentialList, LinkedList) would
+have been decidedly worse if we changed List to Sequence. The
+naming conflict can be dealt with by the following incantation:</p>
+<pre>
+    import java.util.*;
+    import java.awt.*;
+    import java.util.List;   // Dictates interpretation of "List"
+</pre></li>
+<li><a name="a12" id="a12"><b>Why don't you rename List's set
+method to replace, to avoid confusion with Set.</b></a>
+<p>It was decided that the "set/get" naming convention was strongly
+enough enshrined in the language that we'd stick with it.</p>
+</li>
+</ol>
+<hr />
+<h3>Map Interface</h3>
+<ol>
+<li><a name="a14" id="a14"><b>Why doesn't Map extend
+Collection?</b></a>
+<p>This was by design. We feel that mappings are not collections
+and collections are not mappings. Thus, it makes little sense for
+Map to extend the Collection interface (or vice versa).</p>
+<p>If a Map is a Collection, what are the elements? The only
+reasonable answer is "Key-value pairs", but this provides a very
+limited (and not particularly useful) Map abstraction. You can't
+ask what value a given key maps to, nor can you delete the entry
+for a given key without knowing what value it maps to.</p>
+<p>Collection could be made to extend Map, but this raises the
+question: what are the keys? There's no really satisfactory answer,
+and forcing one leads to an unnatural interface.</p>
+<p>Maps can be <em>viewed</em> as Collections (of keys, values, or
+pairs), and this fact is reflected in the three "Collection view
+operations" on Maps (keySet, entrySet, and values). While it is, in
+principle, possible to view a List as a Map mapping indices to
+elements, this has the nasty property that deleting an element from
+the List changes the Key associated with every element before the
+deleted element. That's why we don't have a map view operation on
+Lists.</p>
+</li>
+</ol>
+<hr />
+<h3>Iterator Interface</h3>
+<ol>
+<li><a name="a18" id="a18"><b>Why doesn't Iterator extend
+Enumeration?</b></a>
+<p>We view the method names for Enumeration as unfortunate. They're
+very long, and very frequently used. Given that we were adding a
+method and creating a whole new framework, we felt that it would be
+foolish not to take advantage of the opportunity to improve the
+names. Of course we could support the new and old names in
+Iterator, but it doesn't seem worthwhile.</p>
+</li>
+<li><a name="a19" id="a19"><b>Why don't you provide an
+Iterator.peek method that allows you to look at the next element in
+an iteration without advancing the iterator?</b></a>
+<p>It can be implemented atop the current Iterators (a similar
+pattern to java.io.PushbackInputStream). We believe that its use
+would be rare enough that it isn't worth including in the interface
+that everyone has to implement.</p>
+</li>
+</ol>
+<hr />
+<h3>Miscellaneous</h3>
+<ol>
+<li><a name="a23" id="a23"><b>Why did you write a new collections
+framework instead of adopting JGL (a preexisting collections
+package from ObjectSpace, Inc.) into the JDK?</b></a>
+<p>If you examine the goals for our Collections framework (in the
+Overview), you'll see that we are not really "playing in the same
+space" as JGL. Quoting from the "Design Goals" Section of the Java
+Collections Overview: "Our main design goal was to produce an API
+that was reasonably small, both in size, and (more importantly) in
+'conceptual weight.'"</p>
+<p>JGL consists of approximately 130 classes and interfaces; its
+main goal was consistency with the C++ Standard Template Library
+(STL). This was <em>not</em> one of our goals. Java has
+traditionally stayed away from C++'s more complex features (e.g.,
+multiple inheritance, operator overloading). Our entire framework,
+including all infrastructure, contains approximately 25 classes and
+interfaces.</p>
+<p>While this may cause some discomfort for some C++ programmers,
+we feel that it will be good for Java in the long run. As the Java
+libraries mature, they inevitably grow, but we are trying as hard
+as we can to keep them small and manageable, so that Java continues
+to be an easy, fun language to learn and to use.</p>
+</li>
+<li><a name="a26" id="a26"><b>Why don't you eliminate all of the
+methods and classes that return "views" (Collections backed by
+other collection-like objects). This would greatly reduce
+aliasing.</b></a>
+<p>Given that we provide core collection interfaces behind which
+programmers can "hide" their own implementations, there will be
+aliased collections whether the JDK provides them or not.
+Eliminating all views from the JDK would greatly increase the cost
+of common operations like making a Collection out of an array, and
+would do away with many useful facilities (like synchronizing
+wrappers). One view that we see as being particularly useful is
+<a href=
+"../List.html#subList-int-int-">List.subList</a>.
+The existence of this method means that people who write methods
+taking List on input do not have to write secondary forms taking an
+offset and a length (as they do for arrays).</p>
+</li>
+<li><a name="a27" id="a27"><b>Why don't you provide for
+"observable" collections that send out Events when they're
+modified?</b></a>
+<p>Primarily, resource constraints. If we're going to commit to
+such an API, it has to be something that works for everyone, that
+we can live with for the long haul. We may provide such a facility
+some day. In the meantime, it's not difficult to implement such a
+facility on top of the public APIs.</p>
+</li>
+</ol>
+<hr />
+<p style="font-size:smaller">
+Copyright &copy; 1998, 2017, Oracle and/or its affiliates. 500 Oracle Parkway<br />
+    Redwood Shores, CA 94065 USA. All rights reserved.</p>
+<!-- Body text ends here -->
+</body>
+</html>
diff --git a/src/java.base/share/classes/java/util/doc-files/coll-index.html b/src/java.base/share/classes/java/util/doc-files/coll-index.html
new file mode 100644
index 0000000..1e3f553
--- /dev/null
+++ b/src/java.base/share/classes/java/util/doc-files/coll-index.html
@@ -0,0 +1,80 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<!--
+ Copyright (c) 1998, 2017, 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.
+-->
+
+<html lang="en-US" xmlns="http://www.w3.org/1999/xhtml" xml:lang=
+"en-US">
+<head>
+<meta name="generator" content="HTML Tidy, see www.w3.org" />
+<title>The Collections Framework</title>
+
+<style type="text/css">
+/*<![CDATA[*/
+
+ul li, ul ul li {font-weight: normal;}
+pre             {margin-left: 42pt;}
+a               {font-weight: bold;}
+
+/*]]>*/
+</style>
+</head>
+<body>
+<h1>The Collections Framework</h1>
+<!-- Body text begins here -->
+<p>The collections framework is a unified architecture for
+representing and manipulating collections, enabling them to be
+manipulated independently of the details of their representation.
+It reduces programming effort while increasing performance. It
+enables interoperability among unrelated APIs, reduces effort in
+designing and learning new APIs, and fosters software reuse. The
+framework is based on more than a dozen collection interfaces. It
+includes implementations of these interfaces and algorithms to
+manipulate them.</p>
+<p>The documents in this section are non-normative portions of
+the Java&trade; Platform, Standard Edition API Specification.</p>
+<ul>
+<li><b><a href="coll-overview.html">Overview</a></b> - An overview of
+the collections framework.</li>
+</ul>
+<ul>
+<li><b><a href="coll-reference.html">Annotated API Outline</a></b> - An
+annotated outline of the classes and interfaces comprising the
+collections framework, with links into the API Specification.</li>
+</ul>
+<ul>
+<li><b><a href="coll-designfaq.html">Design FAQ</a></b> - Answers to
+frequently asked questions (FAQ) about the design of the
+collections framework.</li>
+</ul>
+<hr />
+<p style="font-size:smaller">
+Copyright &copy; 1998, 2017, Oracle and/or its affiliates. 500 Oracle Parkway<br />
+    Redwood Shores, CA 94065 USA. All rights reserved.</p>
+<!-- Body text ends here -->
+</body>
+</html>
diff --git a/src/java.base/share/classes/java/util/doc-files/coll-overview.html b/src/java.base/share/classes/java/util/doc-files/coll-overview.html
new file mode 100644
index 0000000..61db049
--- /dev/null
+++ b/src/java.base/share/classes/java/util/doc-files/coll-overview.html
@@ -0,0 +1,359 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<!--
+ Copyright (c) 1998, 2017, 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.
+-->
+
+<html lang="en-US" xmlns="http://www.w3.org/1999/xhtml" xml:lang=
+"en-US">
+<head>
+<title>Collections Framework Overview</title>
+</head>
+<body>
+<h1>Collections Framework Overview</h1>
+<!-- Body text begins here -->
+<h2>Introduction</h2>
+The Java platform includes a <i>collections framework</i>. A
+<i>collection</i> is an object that represents a group of objects
+(such as the classic <a href="../ArrayList.html">ArrayList</a> class).
+A collections framework is a unified architecture for representing
+and manipulating collections, enabling collections to be
+manipulated independently of implementation details.
+<p>The primary advantages of a collections framework are that
+it:</p>
+<ul>
+<li><strong>Reduces programming effort</strong> by providing data
+structures and algorithms so you don't have to write them
+yourself.</li>
+<li><strong>Increases performance</strong> by providing
+high-performance implementations of data structures and algorithms.
+Because the various implementations of each interface are
+interchangeable, programs can be tuned by switching
+implementations.</li>
+<li><strong>Provides interoperability between unrelated
+APIs</strong> by establishing a common language to pass collections
+back and forth.</li>
+<li><strong>Reduces the effort required to learn APIs</strong> by
+requiring you to learn multiple ad hoc collection APIs.</li>
+<li><strong>Reduces the effort required to design and implement
+APIs</strong> by not requiring you to produce ad hoc collections
+APIs.</li>
+<li><strong>Fosters software reuse</strong> by providing a standard
+interface for collections and algorithms with which to manipulate
+them.</li>
+</ul>
+<p>The collections framework consists of:</p>
+<ul>
+<li><strong>Collection interfaces</strong>. Represent different
+types of collections, such as sets, lists, and maps. These
+interfaces form the basis of the framework.</li>
+<li><strong>General-purpose implementations</strong>. Primary
+implementations of the collection interfaces.</li>
+<li><strong>Legacy implementations</strong>. The collection classes
+from earlier releases, <tt>Vector</tt> and <tt>Hashtable</tt>, were
+retrofitted to implement the collection interfaces.</li>
+<li><strong>Special-purpose implementations</strong>.
+Implementations designed for use in special situations. These
+implementations display nonstandard performance characteristics,
+usage restrictions, or behavior.</li>
+<li><strong>Concurrent implementations</strong>. Implementations
+designed for highly concurrent use.</li>
+<li><strong>Wrapper implementations</strong>. Add functionality,
+such as synchronization, to other implementations.</li>
+<li><strong>Convenience implementations</strong>. High-performance
+"mini-implementations" of the collection interfaces.</li>
+<li><strong>Abstract implementations</strong>. Partial
+implementations of the collection interfaces to facilitate custom
+implementations.</li>
+<li><strong>Algorithms</strong>. Static methods that perform useful
+functions on collections, such as sorting a list.</li>
+<li><strong>Infrastructure</strong>. Interfaces that provide
+essential support for the collection interfaces.</li>
+<li><strong>Array Utilities</strong>. Utility functions for arrays
+of primitive types and reference objects. Not, strictly speaking, a
+part of the collections framework, this feature was added to the
+Java platform at the same time as the collections framework and
+relies on some of the same infrastructure.</li>
+</ul>
+<hr />
+<h2>Collection Interfaces</h2>
+<p>The <i>collection interfaces</i> are divided into two groups.
+The most basic interface, <tt><a href=
+"../Collection.html">java.util.Collection</a></tt>,
+has the following descendants:</p>
+<ul>
+<li><tt><a href=
+"../Set.html">java.util.Set</a></tt></li>
+<li><tt><a href=
+"../SortedSet.html">java.util.SortedSet</a></tt></li>
+<li><tt><a href=
+"../NavigableSet.html">java.util.NavigableSet</a></tt></li>
+<li><tt><a href=
+"../Queue.html">java.util.Queue</a></tt></li>
+<li><tt><a href=
+"../concurrent/BlockingQueue.html">java.util.concurrent.BlockingQueue</a></tt></li>
+<li><tt><a href=
+"../concurrent/TransferQueue.html">java.util.concurrent.TransferQueue</a></tt></li>
+<li><tt><a href=
+"../Deque.html">java.util.Deque</a></tt></li>
+<li><tt><a href=
+"../concurrent/BlockingDeque.html">java.util.concurrent.BlockingDeque</a></tt></li>
+</ul>
+<p>The other collection interfaces are based on <tt><a href=
+"../Map.html">java.util.Map</a></tt> and are
+not true collections. However, these interfaces contain
+<i>collection-view</i> operations, which enable them to be
+manipulated as collections. <tt>Map</tt> has the following
+offspring:</p>
+<ul>
+<li><tt><a href=
+"../SortedMap.html">java.util.SortedMap</a></tt></li>
+<li><tt><a href=
+"../NavigableMap.html">java.util.NavigableMap</a></tt></li>
+<li><tt><a href=
+"../concurrent/ConcurrentMap.html">java.util.concurrent.ConcurrentMap</a></tt></li>
+<li><tt><a href=
+"../concurrent/ConcurrentNavigableMap.html">java.util.concurrent.ConcurrentNavigableMap</a></tt></li>
+</ul>
+<p>Many of the modification methods in the collection interfaces
+are labeled <i>optional</i>. Implementations are permitted to not
+perform one or more of these operations, throwing a runtime
+exception (<tt>UnsupportedOperationException</tt>) if they are
+attempted. The documentation for each implementation must specify
+which optional operations are supported. Several terms are
+introduced to aid in this specification:</p>
+<ul>
+<li>Collections that do not support modification operations (such
+as <tt>add</tt>, <tt>remove</tt> and <tt>clear</tt>) are referred
+to as <i>unmodifiable</i>. Collections that are not unmodifiable
+are <i>modifiable.</i></li>
+<li>Collections that additionally guarantee that no change in the
+<tt>Collection</tt> object will be visible are referred to as
+<i>immutable</i>. Collections that are not immutable are
+<i>mutable</i>.</li>
+<li>Lists that guarantee that their size remains constant even
+though the elements can change are referred to as
+<i>fixed-size</i>. Lists that are not fixed-size are referred to as
+<i>variable-size</i>.</li>
+<li>Lists that support fast (generally constant time) indexed
+element access are known as <i>random access</i> lists. Lists that
+do not support fast indexed element access are known as
+<i>sequential access</i> lists. The <tt><a href=
+"../RandomAccess.html">RandomAccess</a></tt>
+marker interface enables lists to advertise the fact that they
+support random access. This enables generic algorithms to change
+their behavior to provide good performance when applied to either
+random or sequential access lists.</li>
+</ul>
+<p>Some implementations restrict what elements (or in the case of
+<tt>Maps</tt>, keys and values) can be stored. Possible
+restrictions include requiring elements to:</p>
+<ul>
+<li>Be of a particular type.</li>
+<li>Be not null.</li>
+<li>Obey some arbitrary predicate.</li>
+</ul>
+<p>Attempting to add an element that violates an implementation's
+restrictions results in a runtime exception, typically a
+<tt>ClassCastException</tt>, an <tt>IllegalArgumentException</tt>,
+or a <tt>NullPointerException</tt>. Attempting to remove or test
+for the presence of an element that violates an implementation's
+restrictions can result in an exception. Some restricted
+collections permit this usage.</p>
+<hr />
+<h2>Collection Implementations</h2>
+<p>Classes that implement the collection interfaces typically have
+names in the form of
+&lt;<em>Implementation-style</em>&gt;&lt;<em>Interface</em>&gt;.
+The general purpose implementations are summarized in the following
+table:</p>
+<table border="2" summary=
+"general purpose implementations and interfaces" align="center">
+<thead>
+<tr>
+<th id="interfaces">Interface</th>
+<th id="hashtable">Hash Table</th>
+<th id="resizablearray">Resizable Array</th>
+<th id="balancedtree">Balanced Tree</th>
+<th id="linkedlist">Linked List</th>
+<th id="hashtableandlinkedlist">Hash Table + Linked List</th>
+</tr>
+<tr>
+<td headers="interfaces"><code>Set</code></td>
+<td headers="hashtable"><a href=
+"../HashSet.html"><tt>HashSet</tt></a></td>
+<td headers="resizablearray">&nbsp;</td>
+<td headers="balancedtree"><a href=
+"../TreeSet.html"><tt>TreeSet</tt></a></td>
+<td headers="linkedlist">&nbsp;</td>
+<td headers="hashtableandlinkedlist"><a href=
+"../LinkedHashSet.html"><tt>LinkedHashSet</tt></a></td>
+</tr>
+<tr>
+<td headers="interfaces"><code>List</code></td>
+<td headers="hashtable">&nbsp;</td>
+<td headers="resizablearray"><a href=
+"../ArrayList.html"><tt>ArrayList</tt></a></td>
+<td headers="balancedtree">&nbsp;</td>
+<td headers="linkedlist"><a href=
+"../LinkedList.html"><tt>LinkedList</tt></a></td>
+<td headers="hashtableandlinkedlist">&nbsp;</td>
+</tr>
+<tr>
+<td headers="interfaces"><code>Deque</code></td>
+<td headers="hashtable">&nbsp;</td>
+<td headers="resizablearray"><a href=
+"../ArrayDeque.html"><tt>ArrayDeque</tt></a></td>
+<td headers="balancedtree">&nbsp;</td>
+<td headers="linkedlist"><a href=
+"../LinkedList.html"><tt>LinkedList</tt></a></td>
+<td headers="hashtableandlinkedlist">&nbsp;</td>
+</tr>
+<tr>
+<td headers="interfaces"><code>Map</code></td>
+<td headers="hashtable"><a href=
+"../HashMap.html"><tt>HashMap</tt></a></td>
+<td headers="resizablearray">&nbsp;</td>
+<td headers="balancedtree"><a href=
+"../TreeMap.html"><tt>TreeMap</tt></a></td>
+<td headers="linkedlist">&nbsp;</td>
+<td headers="hashtableandlinkedlist"><a href=
+"../LinkedHashMap.html"><tt>LinkedHashMap</tt></a></td>
+</tr>
+</thead>
+</table>
+<p>The general-purpose implementations support all of the
+<i>optional operations</i> in the collection interfaces and have no
+restrictions on the elements they may contain. They are
+unsynchronized, but the <tt>Collections</tt> class contains static
+factories called <a href=
+"../Collections.html#synchronizedCollection-java.util.Collection-">
+<em>synchronization wrappers</em></a> that can be used to add
+synchronization to many unsynchronized collections. All of the new
+implementations have <i>fail-fast iterators</i>, which detect
+invalid concurrent modification, and fail quickly and cleanly
+(rather than behaving erratically).</p>
+<p>The <tt>AbstractCollection</tt>, <tt>AbstractSet</tt>,
+<tt>AbstractList</tt>, <tt>AbstractSequentialList</tt> and
+<tt>AbstractMap</tt> classes provide basic implementations of the
+core collection interfaces, to minimize the effort required to
+implement them. The API documentation for these classes describes
+precisely how each method is implemented so the implementer knows
+which methods must be overridden, given the performance of the
+basic operations of a specific implementation.</p>
+<hr />
+<h2>Concurrent Collections</h2>
+<p>Applications that use collections from more than one thread must
+be carefully programmed. In general, this is known as <i>concurrent
+programming</i>. The Java platform includes extensive support for
+concurrent programming. See <a href=
+"../concurrent/package-summary.html">Java Concurrency
+Utilities</a> for details.</p>
+<p>Collections are so frequently used that various concurrent
+friendly interfaces and implementations of collections are included
+in the APIs. These types go beyond the synchronization wrappers
+discussed previously to provide features that are frequently needed
+in concurrent programming.</p>
+<p>These concurrent-aware interfaces are available:</p>
+<ul>
+<li><tt><a href=
+"../concurrent/BlockingQueue.html">BlockingQueue</a></tt></li>
+<li><tt><a href=
+"../concurrent/TransferQueue.html">TransferQueue</a></tt></li>
+<li><tt><a href=
+"../concurrent/BlockingDeque.html">BlockingDeque</a></tt></li>
+<li><tt><a href=
+"../concurrent/ConcurrentMap.html">ConcurrentMap</a></tt></li>
+<li><tt><a href=
+"../concurrent/ConcurrentNavigableMap.html">ConcurrentNavigableMap</a></tt></li>
+</ul>
+<p>The following concurrent-aware implementation classes are
+available. See the API documentation for the correct usage of these
+implementations.</p>
+<ul>
+<li><tt><a href=
+"../concurrent/LinkedBlockingQueue.html">LinkedBlockingQueue</a></tt></li>
+<li><tt><a href=
+"../concurrent/ArrayBlockingQueue.html">ArrayBlockingQueue</a></tt></li>
+<li><tt><a href=
+"../concurrent/PriorityBlockingQueue.html">PriorityBlockingQueue</a></tt></li>
+<li><tt><a href=
+"../concurrent/DelayQueue.html">DelayQueue</a></tt></li>
+<li><tt><a href=
+"../concurrent/SynchronousQueue.html">SynchronousQueue</a></tt></li>
+<li><a href=
+"../concurrent/LinkedBlockingDeque.html"><tt>LinkedBlockingDeque</tt></a></li>
+<li><a href=
+"../concurrent/LinkedTransferQueue.html"><tt>LinkedTransferQueue</tt></a></li>
+<li><tt><a href=
+"../concurrent/CopyOnWriteArrayList.html">CopyOnWriteArrayList</a></tt></li>
+<li><tt><a href=
+"../concurrent/CopyOnWriteArraySet.html">CopyOnWriteArraySet</a></tt></li>
+<li><tt><a href=
+"../concurrent/ConcurrentSkipListSet.html">ConcurrentSkipListSet</a></tt></li>
+<li><tt><a href=
+"../concurrent/ConcurrentHashMap.html">ConcurrentHashMap</a></tt></li>
+<li><tt><a href=
+"../concurrent/ConcurrentSkipListMap.html">ConcurrentSkipListMap</a></tt></li>
+</ul>
+<hr />
+<h2>Design Goals</h2>
+<p>The main design goal was to produce an API that was small in
+size and, more importantly, in &quot;conceptual weight.&quot; It
+was critical that the new functionality not seem too different to
+current Java programmers; it had to augment current facilities,
+rather than replace them. At the same time, the new API had to be
+powerful enough to provide all the advantages described
+previously.</p>
+<p>To keep the number of core interfaces small, the interfaces do
+not attempt to capture such subtle distinctions as mutability,
+modifiability, and resizability. Instead, certain calls in the core
+interfaces are <i>optional</i>, enabling implementations to throw
+an <tt>UnsupportedOperationException</tt> to indicate that they do
+not support a specified optional operation. Collection implementers
+must clearly document which optional operations are supported by an
+implementation.</p>
+<p>To keep the number of methods in each core interface small, an
+interface contains a method only if either:</p>
+<ul>
+<li>It is a truly <i>fundamental operation</i>: a basic operations
+in terms of which others could be reasonably defined,</li>
+<li>There is a compelling performance reason why an important
+implementation would want to override it.</li>
+</ul>
+<p>It was critical that all reasonable representations of
+collections interoperate well. This included arrays, which cannot
+be made to implement the <tt>Collection</tt> interface directly
+without changing the language. Thus, the framework includes methods
+to enable collections to be moved into arrays, arrays to be viewed
+as collections, and maps to be viewed as collections.</p>
+<hr />
+<p style="font-size:smaller">
+Copyright &copy; 1998, 2017, Oracle and/or its affiliates. 500 Oracle Parkway<br />
+    Redwood Shores, CA 94065 USA. All rights reserved.</p>
+<!-- Body text ends here -->
+</body>
+</html>
diff --git a/src/java.base/share/classes/java/util/doc-files/coll-reference.html b/src/java.base/share/classes/java/util/doc-files/coll-reference.html
new file mode 100644
index 0000000..97ebf93
--- /dev/null
+++ b/src/java.base/share/classes/java/util/doc-files/coll-reference.html
@@ -0,0 +1,564 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<!--
+ Copyright (c) 1998, 2017, 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.
+-->
+
+<html lang="en-US" xmlns="http://www.w3.org/1999/xhtml" xml:lang=
+"en-US">
+<head>
+<title>Outline of the Collections Framework</title>
+</head>
+<body>
+<h1>Outline of the Collections Framework</h1>
+<!-- Body text begins here -->
+The collections framework consists of:
+<ul>
+<li><strong>Collection interfaces</strong> - The primary means by
+which collections are manipulated.
+<ul>
+<li><a href=
+"../Collection.html"><strong>Collection</strong></a>
+- A group of objects. No assumptions are made about the order of
+the collection (if any) or whether it can contain duplicate
+elements.</li>
+<li><a href=
+"../Set.html"><strong>Set</strong></a> - The
+familiar set abstraction. No duplicate elements permitted. May or
+may not be ordered. Extends the <tt>Collection</tt> interface.</li>
+<li><a href=
+"../List.html"><strong>List</strong></a> -
+Ordered collection, also known as a <i>sequence</i>. Duplicates are
+generally permitted. Allows positional access. Extends the
+<tt>Collection</tt> interface.</li>
+<li><a href=
+"../Queue.html"><strong>Queue</strong></a> - A
+collection designed for holding elements before processing. Besides
+basic <tt>Collection</tt> operations, queues provide additional
+insertion, extraction, and inspection operations.</li>
+<li><a href=
+"../Deque.html"><strong>Deque</strong></a> - A
+<em>double ended queue</em>, supporting element insertion and
+removal at both ends. Extends the <tt>Queue</tt> interface.</li>
+<li><a href=
+"../Map.html"><strong>Map</strong></a> - A
+mapping from keys to values. Each key can map to one value.</li>
+<li><a href=
+"../SortedSet.html"><strong>SortedSet</strong></a>
+- A set whose elements are automatically sorted, either in their
+<i>natural ordering</i> (see the <a href=
+"../../lang/Comparable.html"><tt>Comparable</tt></a>
+interface) or by a <a href=
+"../Comparator.html"><tt>Comparator</tt></a>
+object provided when a <tt>SortedSet</tt> instance is created.
+Extends the <tt>Set</tt> interface.</li>
+<li><a href=
+"../SortedMap.html"><strong>SortedMap</strong></a>
+- A map whose mappings are automatically sorted by key, either
+using the <i>natural ordering</i> of the keys or by a comparator
+provided when a <tt>SortedMap</tt> instance is created. Extends the
+<tt>Map</tt> interface.</li>
+<li><a href=
+"../NavigableSet.html"><strong>NavigableSet</strong></a>
+- A <tt>SortedSet</tt> extended with navigation methods reporting
+closest matches for given search targets. A <tt>NavigableSet</tt>
+may be accessed and traversed in either ascending or descending
+order.</li>
+<li><a href=
+"../NavigableMap.html"><strong>NavigableMap</strong></a>
+- A <tt>SortedMap</tt> extended with navigation methods returning
+the closest matches for given search targets. A
+<tt>NavigableMap</tt> can be accessed and traversed in either
+ascending or descending key order.</li>
+<li><a href=
+"../concurrent/BlockingQueue.html"><strong>BlockingQueue</strong></a>
+- A <tt>Queue</tt> with operations that wait for the queue to
+become nonempty when retrieving an element and that wait for space
+to become available in the queue when storing an element. (This
+interface is part of the <tt><a href=
+"../concurrent/package-summary.html">java.util.concurrent</a></tt>
+package.)</li>
+<li><a href=
+"../concurrent/TransferQueue.html"><strong>TransferQueue</strong></a>
+- A <tt>BlockingQueue</tt> in which producers can wait for
+consumers to receive elements. (This interface is part of the
+<tt><a href=
+"../concurrent/package-summary.html">java.util.concurrent</a></tt>
+package.)</li>
+<li><a href=
+"../concurrent/BlockingDeque.html"><strong>BlockingDeque</strong></a>
+- A <tt>Deque</tt> with operations that wait for the deque to
+become nonempty when retrieving an element and wait for space to
+become available in the deque when storing an element. Extends both
+the <tt>Deque</tt> and <tt>BlockingQueue</tt> interfaces. (This
+interface is part of the <tt><a href=
+"../concurrent/package-summary.html">java.util.concurrent</a></tt>
+package.)</li>
+<li><a href=
+"../concurrent/ConcurrentMap.html"><strong>ConcurrentMap</strong></a>
+- A <tt>Map</tt> with atomic <tt>putIfAbsent</tt>, <tt>remove</tt>,
+and <tt>replace</tt> methods. (This interface is part of the
+<tt>java.util.concurrent</tt> package.)</li>
+<li><a href=
+"../concurrent/ConcurrentNavigableMap.html"><strong>
+ConcurrentNavigableMap</strong></a> - A <tt>ConcurrentMap</tt> that
+is also a <tt>NavigableMap</tt>.</li>
+</ul>
+</li>
+<li><strong>General-purpose implementations</strong> - The primary
+implementations of the collection interfaces.
+<ul>
+<li><strong><a href=
+"../HashSet.html">HashSet</a></strong> - Hash
+table implementation of the <tt>Set</tt> interface. The best
+all-around implementation of the <tt>Set</tt> interface.</li>
+<li><a href=
+"../TreeSet.html"><strong>TreeSet</strong></a>
+- Red-black tree implementation of the <tt>NavigableSet</tt>
+interface.</li>
+<li><strong><a href=
+"../LinkedHashSet.html">LinkedHashSet</a></strong>
+- Hash table and linked list implementation of the <tt>Set</tt>
+interface. An insertion-ordered <tt>Set</tt> implementation that
+runs nearly as fast as <tt>HashSet</tt>.</li>
+<li><strong><a href=
+"../ArrayList.html">ArrayList</a></strong> -
+Resizable array implementation of the <tt>List</tt> interface (an
+unsynchronized <tt>Vector</tt>). The best all-around implementation
+of the <tt>List</tt> interface.</li>
+<li><strong><a href=
+"../ArrayDeque.html">ArrayDeque</a></strong> -
+Efficient, resizable array implementation of the <tt>Deque</tt>
+interface.</li>
+<li><a href=
+"../LinkedList.html"><strong>LinkedList</strong></a>
+- Doubly-linked list implementation of the <tt>List</tt> interface.
+Provides better performance than the <tt>ArrayList</tt>
+implementation if elements are frequently inserted or deleted
+within the list. Also implements the <tt>Deque</tt> interface. When
+accessed through the <tt>Queue</tt> interface, <tt>LinkedList</tt>
+acts as a FIFO queue.</li>
+<li><strong><a href=
+"../PriorityQueue.html">PriorityQueue</a></strong>
+- Heap implementation of an unbounded priority queue.</li>
+<li><strong><a href=
+"../HashMap.html">HashMap</a></strong> - Hash
+table implementation of the <tt>Map</tt> interface (an
+unsynchronized <tt>Hashtable</tt> that supports <tt>null</tt> keys
+and values). The best all-around implementation of the <tt>Map</tt>
+interface.</li>
+<li><a href=
+"../TreeMap.html"><strong>TreeMap</strong></a>
+Red-black tree implementation of the <tt>NavigableMap</tt>
+interface.</li>
+<li><strong><a href=
+"../LinkedHashMap.html">LinkedHashMap</a></strong>
+- Hash table and linked list implementation of the <tt>Map</tt>
+interface. An insertion-ordered <tt>Map</tt> implementation that
+runs nearly as fast as <tt>HashMap</tt>. Also useful for building
+caches (see <a href=
+"../LinkedHashMap.html#removeEldestEntry-java.util.Map.Entry-">
+removeEldestEntry(Map.Entry)</a> ).</li>
+</ul>
+</li>
+<li><strong>Wrapper implementations</strong> -
+Functionality-enhancing implementations for use with other
+implementations. Accessed solely through static factory methods.
+<ul>
+<li><a href=
+"../Collections.html#unmodifiableCollection-java.util.Collection-">
+<strong>Collections.unmodifiable<i>Interface</i></strong></a> -
+Returns an unmodifiable view of a specified collection that throws
+an <tt>UnsupportedOperationException</tt> if the user attempts to
+modify it.</li>
+<li><a name="synchWrappers" href=
+"../Collections.html#synchronizedCollection-java.util.Collection-"
+id=
+"synchWrappers"><strong>Collections.synchronized<i>Interface</i></strong></a>
+- Returns a synchronized collection that is backed by the specified
+(typically unsynchronized) collection. As long as all accesses to
+the backing collection are through the returned collection, thread
+safety is guaranteed.</li>
+<li><a href=
+"../Collections.html#checkedCollection-java.util.Collection-java.lang.Class-">
+<strong>Collections.checked<i>Interface</i></strong></a> - Returns
+a dynamically type-safe view of the specified collection, which
+throws a <tt>ClassCastException</tt> if a client attempts to add an
+element of the wrong type. The generics mechanism in the language
+provides compile-time (static) type checking, but it is possible to
+bypass this mechanism. Dynamically type-safe views eliminate this
+possibility.</li>
+</ul>
+</li>
+<li><strong>Adapter implementations</strong> - Implementations that
+adapt one collections interface to another:
+<ul>
+<li><strong><a href=
+"../Collections.html#newSetFromMap-java.util.Map-">
+newSetFromMap(Map)</a></strong> - Creates a general-purpose
+<tt>Set</tt> implementation from a general-purpose <tt>Map</tt>
+implementation.</li>
+<li><strong><a href=
+"../Collections.html#asLifoQueue-java.util.Deque-">
+asLifoQueue(Deque)</a></strong> - Returns a view of a
+<tt>Deque</tt> as a Last In First Out (LIFO) <tt>Queue</tt>.</li>
+</ul>
+</li>
+<li><strong>Convenience implementations</strong> - High-performance
+"mini-implementations" of the collection interfaces.
+<ul>
+<li><a href=
+"../Arrays.html#asList-T...-"><strong>Arrays.asList</strong></a>
+- Enables an array to be viewed as a list.</li>
+<li><strong><a href=
+"../Collections.html#emptySet--">emptySet</a>,
+<a href=
+"../Collections.html#emptyList--">emptyList</a>
+and <a href=
+"../Collections.html#emptyMap--">emptyMap</a></strong>
+- Return an immutable empty set, list, or map.</li>
+<li><strong><a href=
+"../Collections.html#singleton-java.lang.Object-">
+singleton</a>, <a href=
+"../Collections.html#singletonList-java.lang.Object-">
+singletonList</a>, and <a href=
+"../Collections.html#singletonMap-K-V-">singletonMap</a></strong>
+- Return an immutable singleton set, list, or map, containing only
+the specified object (or key-value mapping).</li>
+<li><a href=
+"../Collections.html#nCopies-int-T-"><strong>
+nCopies</strong></a> - Returns an immutable list consisting of n
+copies of a specified object.</li>
+</ul>
+</li>
+<li><strong>Legacy implementations</strong> - Older collection
+classes were retrofitted to implement the collection interfaces.
+<ul>
+<li><a href=
+"../Vector.html"><strong>Vector</strong></a> -
+Synchronized resizable array implementation of the <tt>List</tt>
+interface with additional legacy methods.</li>
+<li><a href=
+"../Hashtable.html"><strong>Hashtable</strong></a>
+- Synchronized hash table implementation of the <tt>Map</tt>
+interface that does not allow <tt>null</tt> keys or values, plus
+additional legacy methods.</li>
+</ul>
+</li>
+<li><strong>Special-purpose implementations</strong>
+<ul>
+<li><strong><a href=
+"../WeakHashMap.html">WeakHashMap</a></strong>
+- An implementation of the <tt>Map</tt> interface that stores only
+<a href="../../lang/ref/WeakReference.html"><i>weak
+references</i></a> to its keys. Storing only weak references
+enables key-value pairs to be garbage collected when the key is no
+longer referenced outside of the <tt>WeakHashMap</tt>. This class
+is the easiest way to use the power of weak references. It is
+useful for implementing registry-like data structures, where the
+utility of an entry vanishes when its key is no longer reachable by
+any thread.</li>
+<li><strong><a href=
+"../IdentityHashMap.html">IdentityHashMap</a></strong>
+- Identity-based <tt>Map</tt> implementation based on a hash table.
+This class is useful for topology-preserving object graph
+transformations (such as serialization or deep copying). To perform
+these transformations, you must maintain an identity-based "node
+table" that keeps track of which objects have already been seen.
+Identity-based maps are also used to maintain
+object-to-meta-information mappings in dynamic debuggers and
+similar systems. Finally, identity-based maps are useful in
+preventing "spoof attacks" resulting from intentionally perverse
+equals methods. (<tt>IdentityHashMap</tt> never invokes the equals
+method on its keys.) An added benefit of this implementation is
+that it is fast.</li>
+<li><strong><a href=
+"../concurrent/CopyOnWriteArrayList.html">CopyOnWriteArrayList</a></strong>
+- A <tt>List</tt> implementation backed by an copy-on-write array.
+All mutative operations (such as <tt>add</tt>, <tt>set</tt>, and
+<tt>remove</tt>) are implemented by making a new copy of the array.
+No synchronization is necessary, even during iteration, and
+iterators are guaranteed never to throw
+<tt>ConcurrentModificationException</tt>. This implementation is
+well-suited to maintaining event-handler lists (where change is
+infrequent, and traversal is frequent and potentially
+time-consuming).</li>
+<li><strong><a href=
+"../concurrent/CopyOnWriteArraySet.html">CopyOnWriteArraySet</a></strong>
+- A <tt>Set</tt> implementation backed by a copy-on-write array.
+This implementation is similar to <tt>CopyOnWriteArrayList</tt>.
+Unlike most <tt>Set</tt> implementations, the <tt>add</tt>,
+<tt>remove</tt>, and <tt>contains</tt> methods require time
+proportional to the size of the set. This implementation is well
+suited to maintaining event-handler lists that must prevent
+duplicates.</li>
+<li><strong><a href=
+"../EnumSet.html">EnumSet</a></strong> - A
+high-performance <tt>Set</tt> implementation backed by a bit
+vector. All elements of each <tt>EnumSet</tt> instance must be
+elements of a single enum type.</li>
+<li><strong><a href=
+"../EnumMap.html">EnumMap</a></strong> - A
+high-performance <tt>Map</tt> implementation backed by an array.
+All keys in each <tt>EnumMap</tt> instance must be elements of a
+single enum type.</li>
+</ul>
+</li>
+<li><strong>Concurrent implementations</strong> - These
+implementations are part of <tt>java.util.concurrent</tt>.
+<ul>
+<li><strong><a href=
+"../concurrent/ConcurrentLinkedQueue.html">ConcurrentLinkedQueue</a></strong>
+- An unbounded first in, first out (FIFO) queue based on linked
+nodes.</li>
+<li><a href=
+"../concurrent/LinkedBlockingQueue.html"><strong>
+LinkedBlockingQueue</strong></a> - An optionally bounded FIFO
+blocking queue backed by linked nodes.</li>
+<li><a href=
+"../concurrent/ArrayBlockingQueue.html"><strong>
+ArrayBlockingQueue</strong></a> - A bounded FIFO blocking queue
+backed by an array.</li>
+<li><a href=
+"../concurrent/PriorityBlockingQueue.html"><strong>
+PriorityBlockingQueue</strong></a> - An unbounded blocking priority
+queue backed by a priority heap.</li>
+<li><a href=
+"../concurrent/DelayQueue.html"><strong>DelayQueue</strong></a>
+- A time-based scheduling queue backed by a priority heap.</li>
+<li><a href=
+"../concurrent/SynchronousQueue.html"><strong>SynchronousQueue</strong></a>
+- A simple rendezvous mechanism that uses the
+<tt>BlockingQueue</tt> interface.</li>
+<li><a href=
+"../concurrent/LinkedBlockingDeque.html"><strong>
+LinkedBlockingDeque</strong></a> - An optionally bounded FIFO
+blocking deque backed by linked nodes.</li>
+<li><a href=
+"../concurrent/LinkedTransferQueue.html"><strong>
+LinkedTransferQueue</strong></a> - An unbounded
+<tt>TransferQueue</tt> backed by linked nodes.</li>
+<li><a href=
+"../concurrent/ConcurrentHashMap.html"><strong>ConcurrentHashMap</strong></a>
+- A highly concurrent, high-performance <tt>ConcurrentMap</tt>
+implementation based on a hash table. This implementation never
+blocks when performing retrievals and enables the client to select
+the concurrency level for updates. It is intended as a drop-in
+replacement for <tt><a href=
+"../Hashtable.html">Hashtable</a></tt>. In
+addition to implementing <tt>ConcurrentMap</tt>, it supports all of
+the legacy methods of <tt>Hashtable</tt>.</li>
+<li><a href=
+"../concurrent/ConcurrentSkipListSet.html"><strong>
+ConcurrentSkipListSet</strong></a> - Skips list implementation of
+the <tt>NavigableSet</tt> interface.</li>
+<li><a href=
+"../concurrent/ConcurrentSkipListMap.html"><strong>
+ConcurrentSkipListMap</strong></a> - Skips list implementation of
+the <tt>ConcurrentNavigableMap</tt> interface.</li>
+</ul>
+</li>
+<li><strong>Abstract implementations</strong> - Skeletal
+implementations of the collection interfaces to facilitate custom
+implementations.
+<ul>
+<li><a href=
+"../AbstractCollection.html"><strong>AbstractCollection</strong></a>
+- Skeletal <tt>Collection</tt> implementation that is neither a set
+nor a list (such as a "bag" or multiset).</li>
+<li><a href=
+"../AbstractSet.html"><strong>AbstractSet</strong></a>
+- Skeletal <tt>Set</tt> implementation.</li>
+<li><a href=
+"../AbstractList.html"><strong>AbstractList</strong></a>
+- Skeletal <tt>List</tt> implementation backed by a random access
+data store (such as an array).</li>
+<li><a href=
+"../AbstractSequentialList.html"><strong>AbstractSequentialList</strong></a>
+- Skeletal <tt>List</tt> implementation backed by a sequential
+access data store (such as a linked list).</li>
+<li><a href=
+"../AbstractQueue.html"><strong>AbstractQueue</strong></a>
+- Skeletal <tt>Queue</tt> implementation.</li>
+<li><a href=
+"../AbstractMap.html"><strong>AbstractMap</strong></a>
+- Skeletal <tt>Map</tt> implementation.</li>
+</ul>
+</li>
+<li><strong>Algorithms</strong> - The <a href=
+"../Collections.html"><strong>Collections</strong></a>
+class contains these useful static methods.
+<ul>
+<li><strong><a href=
+"../Collections.html#sort-java.util.List-">sort(List)</a></strong>
+- Sorts a list using a merge sort algorithm, which provides average
+case performance comparable to a high quality quicksort, guaranteed
+O(n*log n) performance (unlike quicksort), and <em>stability</em>
+(unlike quicksort). A stable sort is one that does not reorder
+equal elements.</li>
+<li><strong><a href=
+"../Collections.html#binarySearch-java.util.List-T-">
+binarySearch(List, Object)</a></strong> - Searches for an element
+in an ordered list using the binary search algorithm.</li>
+<li><strong><a href=
+"../Collections.html#reverse-java.util.List-">reverse(List)</a></strong>
+- Reverses the order of the elements in a list.</li>
+<li><strong><a href=
+"../Collections.html#shuffle-java.util.List-">shuffle(List)</a></strong>
+- Randomly changes the order of the elements in a list.</li>
+<li><strong><a href=
+"../Collections.html#fill-java.util.List-T-">
+fill(List, Object)</a></strong> - Overwrites every element in a
+list with the specified value.</li>
+<li><strong><a href=
+"../Collections.html#copy-java.util.List-java.util.List-">
+copy(List dest, List src)</a></strong> - Copies the source list
+into the destination list.</li>
+<li><strong><a href=
+"../Collections.html#min-java.util.Collection-">
+min(Collection)</a></strong> - Returns the minimum element in a
+collection.</li>
+<li><strong><a href=
+"../Collections.html#max-java.util.Collection-">
+max(Collection)</a></strong> - Returns the maximum element in a
+collection.</li>
+<li><strong><a href=
+"../Collections.html#rotate-java.util.List-int-">
+rotate(List list, int distance)</a></strong> - Rotates all of the
+elements in the list by the specified distance.</li>
+<li><strong><a href=
+"../Collections.html#replaceAll-java.util.List-T-T-">
+replaceAll(List list, Object oldVal, Object newVal)</a></strong> -
+Replaces all occurrences of one specified value with another.</li>
+<li><strong><a href=
+"../Collections.html#indexOfSubList-java.util.List-java.util.List-">
+indexOfSubList(List source, List target)</a></strong> - Returns the
+index of the first sublist of source that is equal to target.</li>
+<li><strong><a href=
+"../Collections.html#lastIndexOfSubList-java.util.List-java.util.List-">
+lastIndexOfSubList(List source, List target)</a></strong> - Returns
+the index of the last sublist of source that is equal to
+target.</li>
+<li><strong><a href=
+"../Collections.html#swap-java.util.List-int-int-">
+swap(List, int, int)</a></strong> - Swaps the elements at the
+specified positions in the specified list.</li>
+<li><strong><a href=
+"../Collections.html#frequency-java.util.Collection-java.lang.Object-">
+frequency(Collection, Object)</a></strong> - Counts the number of
+times the specified element occurs in the specified
+collection.</li>
+<li><strong><a href=
+"../Collections.html#disjoint-java.util.Collection-java.util.Collection-">
+disjoint(Collection, Collection)</a></strong> - Determines whether
+two collections are disjoint, in other words, whether they contain
+no elements in common.</li>
+<li><strong><a href=
+"../Collections.html#addAll-java.util.Collection-T...-">
+addAll(Collection&lt;? super T&gt;, T...)</a></strong> - Adds all
+of the elements in the specified array to the specified
+collection.</li>
+</ul>
+</li>
+<li><strong>Infrastructure</strong>
+<ul>
+<li><strong>Iterators</strong> - Similar to the familiar <a href=
+"../Enumeration.html">Enumeration</a>
+interface, but more powerful, and with improved method names.
+<ul>
+<li><a href=
+"../Iterator.html"><strong>Iterator</strong></a>
+- In addition to the functionality of the <tt>Enumeration</tt>
+interface, enables the user to remove elements from the backing
+collection with well-defined, useful semantics.</li>
+<li><a href=
+"../ListIterator.html"><strong>ListIterator</strong></a>
+- Iterator for use with lists. In addition to the functionality of
+the <tt>Iterator</tt> interface, supports bidirectional iteration,
+element replacement, element insertion, and index retrieval.</li>
+</ul>
+</li>
+<li><strong>Ordering</strong>
+<ul>
+<li><a href=
+"../../lang/Comparable.html"><strong>Comparable</strong></a>
+- Imparts a <i>natural ordering</i> to classes that implement it.
+The natural ordering can be used to sort a list or maintain order
+in a sorted set or map. Many classes were retrofitted to implement
+this interface.</li>
+<li><a href=
+"../Comparator.html"><strong>Comparator</strong></a>
+- Represents an order relation, which can be used to sort a list or
+maintain order in a sorted set or map. Can override a type's
+natural ordering or order objects of a type that does not implement
+the <tt>Comparable</tt> interface.</li>
+</ul>
+</li>
+<li><strong>Runtime exceptions</strong>
+<ul>
+<li><a href=
+"../../lang/UnsupportedOperationException.html"><strong>
+UnsupportedOperationException</strong></a> - Thrown by collections
+if an unsupported optional operation is called.</li>
+<li><a href=
+"../ConcurrentModificationException.html"><strong>
+ConcurrentModificationException</strong></a> - Thrown by iterators
+and list iterators if the backing collection is changed
+unexpectedly while the iteration is in progress. Also thrown by
+<i>sublist</i> views of lists if the backing list is changed
+unexpectedly.</li>
+</ul>
+</li>
+<li><strong>Performance</strong>
+<ul>
+<li><strong><a href=
+"../RandomAccess.html">RandomAccess</a></strong>
+- Marker interface that lets <tt>List</tt> implementations indicate
+that they support fast (generally constant time) random access.
+This lets generic algorithms change their behavior to provide good
+performance when applied to either random or sequential access
+lists.</li>
+</ul>
+</li>
+</ul>
+</li>
+<li><strong>Array Utilities</strong>
+<ul>
+<li><a href=
+"../Arrays.html"><strong>Arrays</strong></a> -
+Contains static methods to sort, search, compare, hash, copy,
+resize, convert to <tt>String</tt>, and fill arrays of primitives
+and objects.</li>
+</ul>
+</li>
+</ul>
+<hr />
+<p style="font-size:smaller">
+Copyright &copy; 1998, 2017, Oracle and/or its affiliates. 500 Oracle Parkway<br />
+    Redwood Shores, CA 94065 USA. All rights reserved.</p>
+<!-- Body text ends here -->
+</body>
+</html>
diff --git a/src/java.base/share/classes/java/util/jar/Pack200.java b/src/java.base/share/classes/java/util/jar/Pack200.java
index c8862a8..b5fc981 100644
--- a/src/java.base/share/classes/java/util/jar/Pack200.java
+++ b/src/java.base/share/classes/java/util/jar/Pack200.java
@@ -34,8 +34,7 @@
 
 /**
  * Transforms a JAR file to or from a packed stream in Pack200 format.
- * Please refer to Network Transfer Format JSR 200 Specification at
- * <a href=http://jcp.org/aboutJava/communityprocess/review/jsr200/index.html>http://jcp.org/aboutJava/communityprocess/review/jsr200/index.html</a>
+ * Please refer to <a href="{@docRoot}/../specs/pack-spec.html">Network Transfer Format JSR 200 Specification</a>
  * <p>
  * Typically the packer engine is used by application developers
  * to deploy or host JAR files on a website.
diff --git a/src/java.base/share/classes/java/util/package-info.java b/src/java.base/share/classes/java/util/package-info.java
index ff82404..1da427e 100644
--- a/src/java.base/share/classes/java/util/package-info.java
+++ b/src/java.base/share/classes/java/util/package-info.java
@@ -24,27 +24,24 @@
  */
 
 /**
- * Contains the collections framework, legacy collection classes,
- * event model, date and time facilities, internationalization, and
- * miscellaneous utility classes (a string tokenizer, a random-number
- * generator, and a bit array).
+ * Contains the collections framework, some internationalization support classes,
+ * a service loader, properties, random number generation, string parsing
+ * and scanning classes, base64 encoding and decoding, a bit array, and
+ * several miscellaneous utility classes. This package also contains
+ * legacy collection classes and legacy date and time classes.
  *
  * <h2><a id="CollectionsFramework"></a>{@index "Java Collections Framework"}</h2>
+ * <p>For an overview, API outline, and design rationale, please see:
  * <ul>
- *   <li><a href="../../../technotes/guides/collections/overview.html"><b>Collections Framework Overview</b></a>
- *   <li><a href="../../../technotes/guides/collections/reference.html"><b>
- *        Collections Framework Annotated Outline</b></a>
+ *   <li><a href="doc-files/coll-index.html">
+ *          <b>Collections Framework Documentation</b></a>
  * </ul>
  *
- * <h2>Related Documentation</h2>
- * For overviews, tutorials, examples, guides, and tool documentation,
- * please see:
+ * <p>For a tutorial and programming guide with examples of use
+ * of the collections framework, please see:
  * <ul>
- *     <li><a href="http://docs.oracle.com/javase/tutorial/collections/index.html">
- *        <b>Collections Framework Tutorial</b></a>
- *     <li><a
- *     href="../../../technotes/guides/collections/designfaq.html"><b>Collections
- *     Framework Design FAQ</b></a>
+ *   <li><a href="http://docs.oracle.com/javase/tutorial/collections/index.html">
+ *          <b>Collections Framework Tutorial</b></a>
  * </ul>
  *
  * @since 1.0
diff --git a/src/java.base/share/classes/sun/security/pkcs12/PKCS12KeyStore.java b/src/java.base/share/classes/sun/security/pkcs12/PKCS12KeyStore.java
index baf3b54..9c0e0b7 100644
--- a/src/java.base/share/classes/sun/security/pkcs12/PKCS12KeyStore.java
+++ b/src/java.base/share/classes/sun/security/pkcs12/PKCS12KeyStore.java
@@ -2408,9 +2408,9 @@
         { 0x3081000201033081L, 0x0006092A864886F7L, 0x0D010701A0810004L },
         { 0x3082000002010330L, 0x810006092A864886L, 0xF70D010701A08100L },
         { 0x3083000000020103L, 0x3082000006092A86L, 0x4886F70D010701A0L },
-        { 0x3083000000020103L, 0x308200000006092AL, 0x864886F70D010701L },
-        { 0x3084000000000201L, 0x0330820000000609L, 0x2A864886F70D0107L },
-        { 0x3084000000000201L, 0x0330820000000006L, 0x092A864886F70D01L }
+        { 0x3083000000020103L, 0x308300000006092AL, 0x864886F70D010701L },
+        { 0x3084000000000201L, 0x0330830000000609L, 0x2A864886F70D0107L },
+        { 0x3084000000000201L, 0x0330840000000006L, 0x092A864886F70D01L }
     };
 
     private static final long[][] PKCS12_HEADER_MASKS = {
diff --git a/src/java.base/share/lib/security/default.policy b/src/java.base/share/lib/security/default.policy
index 033d80b..94c2f15 100644
--- a/src/java.base/share/lib/security/default.policy
+++ b/src/java.base/share/lib/security/default.policy
@@ -20,9 +20,6 @@
     permission java.security.AllPermission;
 };
 
-grant codeBase "jrt:/jdk.incubator.httpclient" {
-};
-
 grant codeBase "jrt:/java.scripting" {
     permission java.security.AllPermission;
 };
@@ -69,17 +66,7 @@
 };
 
 grant codeBase "jrt:/java.xml.bind" {
-    permission java.lang.RuntimePermission
-                   "accessClassInPackage.sun.misc";
-    permission java.lang.RuntimePermission
-                   "accessClassInPackage.com.sun.xml.internal.*";
-    permission java.lang.RuntimePermission
-                   "accessClassInPackage.com.sun.istack.internal";
-    permission java.lang.RuntimePermission
-                   "accessClassInPackage.com.sun.istack.internal.*";
-    permission java.lang.RuntimePermission "accessDeclaredMembers";
-    permission java.lang.reflect.ReflectPermission "suppressAccessChecks";
-    permission java.util.PropertyPermission "*", "read";
+    permission java.security.AllPermission;
 };
 
 grant codeBase "jrt:/java.xml.crypto" {
@@ -104,19 +91,11 @@
 };
 
 grant codeBase "jrt:/java.xml.ws" {
-    permission java.net.NetPermission
-                   "getProxySelector";
-    permission java.lang.RuntimePermission
-                   "accessClassInPackage.sun.misc";
-    permission java.lang.RuntimePermission
-                   "accessClassInPackage.com.sun.xml.internal.*";
-    permission java.lang.RuntimePermission
-                   "accessClassInPackage.com.sun.istack.internal";
-    permission java.lang.RuntimePermission
-                   "accessClassInPackage.com.sun.istack.internal.*";
-    permission java.lang.RuntimePermission "accessDeclaredMembers";
-    permission java.lang.reflect.ReflectPermission "suppressAccessChecks";
-    permission java.util.PropertyPermission "*", "read";
+    permission java.security.AllPermission;
+};
+
+grant codeBase "jrt:/jdk.accessibility" {
+    permission java.lang.RuntimePermission "accessClassInPackage.sun.awt";
 };
 
 grant codeBase "jrt:/jdk.charsets" {
@@ -155,6 +134,10 @@
     permission java.io.FilePermission "<<ALL FILES>>", "read";
 };
 
+grant codeBase "jrt:/jdk.desktop" {
+    permission java.lang.RuntimePermission "accessClassInPackage.com.sun.awt";
+};
+
 grant codeBase "jrt:/jdk.dynalink" {
     permission java.security.AllPermission;
 };
@@ -163,6 +146,10 @@
     permission java.security.AllPermission;
 };
 
+grant codeBase "jrt:/jdk.internal.vm.compiler" {
+    permission java.security.AllPermission;
+};
+
 grant codeBase "jrt:/jdk.jsobject" {
     permission java.security.AllPermission;
 };
@@ -198,14 +185,6 @@
     permission java.util.PropertyPermission "os.name", "read";
 };
 
-grant codeBase "jrt:/jdk.accessibility" {
-    permission java.lang.RuntimePermission "accessClassInPackage.sun.awt";
-};
-
-grant codeBase "jrt:/jdk.desktop" {
-    permission java.lang.RuntimePermission "accessClassInPackage.com.sun.awt";
-};
-
 // permissions needed by applications using java.desktop module
 grant {
     permission java.lang.RuntimePermission "accessClassInPackage.com.sun.beans";
@@ -213,7 +192,3 @@
     permission java.lang.RuntimePermission "accessClassInPackage.com.sun.java.swing.plaf.*";
     permission java.lang.RuntimePermission "accessClassInPackage.com.apple.*";
 };
-
-grant codeBase "jrt:/jdk.internal.vm.compiler" {
-    permission java.security.AllPermission;
-};
diff --git a/src/java.management/share/classes/sun/management/MemoryPoolImpl.java b/src/java.management/share/classes/sun/management/MemoryPoolImpl.java
index 1a91b8f..881207a 100644
--- a/src/java.management/share/classes/sun/management/MemoryPoolImpl.java
+++ b/src/java.management/share/classes/sun/management/MemoryPoolImpl.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2017, 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
@@ -304,8 +304,7 @@
                                           getCount());
         }
         void triggerAction() {
-            // Should not reach here
-            throw new AssertionError("Should not reach here");
+            // do nothing
         }
         void clearAction() {
             // do nothing
@@ -332,8 +331,7 @@
                                           gcSensor.getCount());
         }
         void triggerAction() {
-            // Should not reach here
-            throw new AssertionError("Should not reach here");
+            // do nothing
         }
         void clearAction() {
             // do nothing
diff --git a/src/java.sql.rowset/share/classes/javax/sql/rowset/spi/package.html b/src/java.sql.rowset/share/classes/javax/sql/rowset/spi/package.html
index 3c3dbc5..786b906 100644
--- a/src/java.sql.rowset/share/classes/javax/sql/rowset/spi/package.html
+++ b/src/java.sql.rowset/share/classes/javax/sql/rowset/spi/package.html
@@ -38,10 +38,7 @@
 
 The standard classes and interfaces that a third party vendor has to
 use in its implementation of a synchronization provider. These classes and
-interfaces are referred to as the Service Provider Interface (SPI). A vendor may
-have its implementation included on the JDBC web page that lists available
-<code>SyncProvider</code> implementations by sending email to <code>jdbc@sun.com</code>.
-Doing this helps make developers aware of the implementation. To make it possible
+interfaces are referred to as the Service Provider Interface (SPI).  To make it possible
 for a <code>RowSet</code> object to use an implementation, the vendor must register
 it with the <code>SyncFactory</code> singleton. (See the class comment for
 <code>SyncProvider</code> for a full explanation of the registration process and
@@ -108,19 +105,14 @@
 <P>
 The lowest level of synchronization is simply writing any changes made to the
 <code>RowSet</code> object to its underlying data source.  The writer does
-nothing to check for conflicts. 
+nothing to check for conflicts.
 If there is a conflict and the data
 source values are overwritten, the changes other parties have made by to the data
-source are lost. 
+source are lost.
 <P>
-The <code>RIXMLProvider</code> implementation uses the lowest level 
+The <code>RIXMLProvider</code> implementation uses the lowest level
 of synchronization and just writes <code>RowSet</code> changes to the data source.
-This is true because  typically XML data sources do not enable transaction
-techniques for maintaining the integrity of data. However, specific standards
-groups have considered offering XML-based synchronization.  For details, see
-<PRE>
-     <a href="http://www.syncml.org">http://www.syncml.org</a>
-</PRE>
+
 <P>
 For the next level up, the
 writer checks to see if there are any conflicts, and if there are,
@@ -141,7 +133,7 @@
 It is a requirement that all disconnected <code>RowSet</code> objects
 (<code>CachedRowSet</code>, <code>FilteredRowSet</code>, <code>JoinRowSet</code>,
 and <code>WebRowSet</code> objects) obtain their <code>SyncProvider</code> objects
-from the <code>SyncFactory</code> mechanism.  
+from the <code>SyncFactory</code> mechanism.
 <P>
 The reference implementation (RI) provides two synchronization providers.
     <UL>
@@ -164,7 +156,7 @@
             <code>RIXMLProvider</code> implementation does no checking at all for
             conflicts and simply writes any updated data in the
             <code>WebRowSet</code> object to the underlying data source.
-            <code>WebRowSet</code> objects use this provider when they are 
+            <code>WebRowSet</code> objects use this provider when they are
             dealing with XML data.
     </UL>
 
@@ -198,9 +190,7 @@
 <p>
 Vendors may develop a <code>SyncProvider</code> implementation with any one of the possible
 levels of synchronization, thus giving <code>RowSet</code> objects a choice of
-synchronization mechanisms.  A vendor can make its implementation available by
-registering the fully qualified class name with Oracle Corporation at
-<code>jdbc@sun.com</code>. This process is discussed in further detail below.
+synchronization mechanisms.
 
 <h3><a id="arch">2.0 Service Provider Interface Architecture</a></h3>
 <b>2.1 Overview</b>
@@ -274,7 +264,7 @@
 A compliant <code>SyncProvider</code> implementation that is fully pluggable
 into the <code>SyncFactory</code> <b>must</b> extend and implement all
 abstract methods in the <a href="SyncProvider.html"><code>SyncProvider</code></a>
-class. In addition, an implementation <b>must</b> determine the 
+class. In addition, an implementation <b>must</b> determine the
 grade, locking and updatable view capabilities defined in the
 <code>SyncProvider</code> class definition. One or more of the
 <code>SyncProvider</code> description criteria <b>must</b> be supported. It
@@ -405,7 +395,7 @@
     case: SyncProvider.GRADE_LOCK_WHEN_MODIFIED
          // A pessimistic synchronization grade
     break;
-    case: SyncProvider.GRADE_NONE 
+    case: SyncProvider.GRADE_NONE
       // No synchronization with the originating data source provided
     break;
     }
@@ -413,7 +403,7 @@
     switch (sync.getDataSourcLock() {
       case: SyncProvider.DATASOURCE_DB_LOCK
        // A lock is placed on the entire datasource that is used by the
-       // <code>RowSet</code> object 
+       // <code>RowSet</code> object
        break;
 
       case: SyncProvider.DATASOURCE_NO_LOCK
@@ -490,14 +480,11 @@
 <h3><a id="relspec">5.0 Related Specifications</a></h3>
 <ul>
 <li><a href="http://docs.oracle.com/javase/jndi/tutorial/index.html">JNDI</a>
-<li><a href="{@docRoot}/../technotes/guides/logging/index.html">Java Logging
+<li><a href="{@docRoot}/java/util/logging/package-summary.html">Java Logging
 APIs</a>
 </ul>
 <h3><a id="reldocs">6.0 Related Documentation</a></h3>
 <ul>
-<li><a href="{@docRoot}/../technotes/tools/index.html#basic">System
-properties</a>
-<li>Resource Files
 <li><a href="http://docs.oracle.com/javase/tutorial/jdbc/">DataSource for JDBC
 Connections</a>
 </ul>
diff --git a/src/jdk.jsobject/share/classes/netscape/javascript/JSObject.java b/src/jdk.jsobject/share/classes/netscape/javascript/JSObject.java
index bdf551f..82cd00a 100644
--- a/src/jdk.jsobject/share/classes/netscape/javascript/JSObject.java
+++ b/src/jdk.jsobject/share/classes/netscape/javascript/JSObject.java
@@ -151,7 +151,7 @@
      * JavaScript engine or if applet is {@code null}
      *
      * @deprecated  The Applet API is deprecated. See the
-     * <a href="../../../../../../api/java/applet/package-summary.html">
+     * <a href="{@docRoot}/java/applet/package-summary.html">
      * java.applet package documentation</a> for further information.
      */
 
diff --git a/src/jdk.unsupported/share/classes/sun/misc/Unsafe.java b/src/jdk.unsupported/share/classes/sun/misc/Unsafe.java
index c4fe1d9..36b5c2d 100644
--- a/src/jdk.unsupported/share/classes/sun/misc/Unsafe.java
+++ b/src/jdk.unsupported/share/classes/sun/misc/Unsafe.java
@@ -813,8 +813,15 @@
     /**
      * Tells the VM to define a class, without security checks.  By default, the
      * class loader and protection domain come from the caller's class.
+     *
+     * @deprecated Use {@link java.lang.invoke.MethodHandles.Lookup#defineClass MethodHandles.Lookup#defineClass}
+     * to define a class to the same class loader and in the same runtime package
+     * and {@linkplain java.security.ProtectionDomain protection domain} of a
+     * given {@code Lookup}'s {@linkplain java.lang.invoke.MethodHandles.Lookup#lookupClass() lookup class}.
+     *
      * @see java.lang.invoke.MethodHandles.Lookup#defineClass(byte[])
      */
+    @Deprecated(since="9", forRemoval=true)
     @ForceInline
     public Class<?> defineClass(String name, byte[] b, int off, int len,
                                 ClassLoader loader,
diff --git a/test/com/sun/net/httpserver/EchoHandler.java b/test/com/sun/net/httpserver/EchoHandler.java
new file mode 100644
index 0000000..0b9de1f
--- /dev/null
+++ b/test/com/sun/net/httpserver/EchoHandler.java
@@ -0,0 +1,98 @@
+/*
+ * Copyright (c) 2005, 2017, 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.util.*;
+import java.util.concurrent.*;
+import java.util.logging.*;
+import java.io.*;
+import java.net.*;
+import java.security.*;
+import javax.net.ssl.*;
+import com.sun.net.httpserver.*;
+
+/**
+ * Implements a basic static EchoHandler for an HTTP server
+ */
+public class EchoHandler implements HttpHandler {
+
+    byte[] read(InputStream is) throws IOException {
+        byte[] buf = new byte[1024];
+        byte[] result = new byte[0];
+
+        while (true) {
+            int n = is.read(buf);
+            if (n > 0) {
+                byte[] b1 = new byte[result.length + n];
+                System.arraycopy(result, 0, b1, 0, result.length);
+                System.arraycopy(buf, 0, b1, result.length, n);
+                result = b1;
+            } else if (n == -1) {
+                return result;
+            }
+        }
+    }
+
+    public void handle (HttpExchange t)
+        throws IOException
+    {
+        InputStream is = t.getRequestBody();
+        Headers map = t.getRequestHeaders();
+        String fixedrequest = map.getFirst ("XFixed");
+
+        // return the number of bytes received (no echo)
+        String summary = map.getFirst ("XSummary");
+        if (fixedrequest != null && summary == null)  {
+            byte[] in = read(is);
+            t.sendResponseHeaders(200, in.length);
+            OutputStream os = t.getResponseBody();
+            os.write(in);
+            close(os);
+            close(is);
+        } else {
+            OutputStream os = t.getResponseBody();
+            byte[] buf = new byte[64 * 1024];
+            t.sendResponseHeaders(200, 0);
+            int n, count=0;;
+
+            while ((n = is.read(buf)) != -1) {
+                if (summary == null) {
+                    os.write(buf, 0, n);
+                }
+                count += n;
+            }
+            if (summary != null) {
+                String s = Integer.toString(count);
+                os.write(s.getBytes());
+            }
+            close(os);
+            close(is);
+        }
+    }
+
+    protected void close(OutputStream os) throws IOException {
+            os.close();
+    }
+    protected void close(InputStream is) throws IOException {
+            is.close();
+    }
+}
diff --git a/test/com/sun/net/httpserver/FileServerHandler.java b/test/com/sun/net/httpserver/FileServerHandler.java
index 298dc09..bff7844 100644
--- a/test/com/sun/net/httpserver/FileServerHandler.java
+++ b/test/com/sun/net/httpserver/FileServerHandler.java
@@ -31,216 +31,122 @@
 import com.sun.net.httpserver.*;
 
 /**
- * Implements a basic static content HTTP server
+ * Implements a basic static content HTTP file server handler
  * which understands text/html, text/plain content types
  *
  * Must be given an abs pathname to the document root.
  * Directory listings together with text + html files
  * can be served.
  *
- * File Server created on files sub-path
- *
- * Echo server created on echo sub-path
  */
 public class FileServerHandler implements HttpHandler {
 
-        public static void main (String[] args) throws Exception {
-            if (args.length != 3) {
-                System.out.println ("usage: java FileServerHandler rootDir port logfilename");
-                System.exit(1);
-            }
-            Logger logger = Logger.getLogger("com.sun.net.httpserver");
-            ConsoleHandler ch = new ConsoleHandler();
-            logger.setLevel(Level.ALL);
-            ch.setLevel(Level.ALL);
-            logger.addHandler(ch);
+    String docroot;
 
-            String rootDir = args[0];
-            int port = Integer.parseInt (args[1]);
-            String logfile = args[2];
-            HttpServer server = HttpServer.create (new InetSocketAddress (port), 0);
-            HttpHandler h = new FileServerHandler (rootDir);
-            HttpHandler h1 = new EchoHandler ();
+    public FileServerHandler (String docroot) {
+        this.docroot = docroot;
+    }
 
-            HttpContext c = server.createContext ("/files", h);
-            c.getFilters().add (new LogFilter (new File (logfile)));
-            HttpContext c1 = server.createContext ("/echo", h1);
-            c.getFilters().add (new LogFilter (new File (logfile)));
-            c1.getFilters().add (new LogFilter (new File (logfile)));
-            server.setExecutor (Executors.newCachedThreadPool());
-            server.start ();
+    int invocation = 1;
+    public void handle (HttpExchange t)
+        throws IOException
+    {
+        InputStream is = t.getRequestBody();
+        Headers map = t.getRequestHeaders();
+        Headers rmap = t.getResponseHeaders();
+        URI uri = t.getRequestURI();
+        String path = uri.getPath();
+
+        int x = 0;
+        while (is.read () != -1) x++;
+        is.close();
+        File f = new File (docroot, path);
+        if (!f.exists()) {
+            notfound (t, path);
+            return;
+        }
+        String fixedrequest = map.getFirst ("XFixed");
+
+        String method = t.getRequestMethod();
+        if (method.equals ("HEAD")) {
+            rmap.set ("Content-Length", Long.toString (f.length()));
+            t.sendResponseHeaders (200, -1);
+            t.close();
+        } else if (!method.equals("GET")) {
+            t.sendResponseHeaders (405, -1);
+            t.close();
+            return;
         }
 
-        String docroot;
-
-        FileServerHandler (String docroot) {
-            this.docroot = docroot;
+        if (path.endsWith (".html") || path.endsWith (".htm")) {
+            rmap.set ("Content-Type", "text/html");
+        } else {
+            rmap.set ("Content-Type", "text/plain");
         }
-
-        int invocation = 1;
-        public void handle (HttpExchange t)
-            throws IOException
-        {
-            InputStream is = t.getRequestBody();
-            Headers map = t.getRequestHeaders();
-            Headers rmap = t.getResponseHeaders();
-            URI uri = t.getRequestURI();
-            String path = uri.getPath();
-
-            int x = 0;
-            while (is.read () != -1) x++;
-            is.close();
-            File f = new File (docroot, path);
-            if (!f.exists()) {
-                notfound (t, path);
+        if (f.isDirectory()) {
+            if (!path.endsWith ("/")) {
+                moved (t);
                 return;
             }
-            String fixedrequest = map.getFirst ("XFixed");
-
-            String method = t.getRequestMethod();
-            if (method.equals ("HEAD")) {
-                rmap.set ("Content-Length", Long.toString (f.length()));
-                t.sendResponseHeaders (200, -1);
-                t.close();
-            } else if (!method.equals("GET")) {
-                t.sendResponseHeaders (405, -1);
-                t.close();
-                return;
+            rmap.set ("Content-Type", "text/html");
+            t.sendResponseHeaders (200, 0);
+            String[] list = f.list();
+            OutputStream os = t.getResponseBody();
+            PrintStream p = new PrintStream (os);
+            p.println ("<h2>Directory listing for: " + path+ "</h2>");
+            p.println ("<ul>");
+            for (int i=0; i<list.length; i++) {
+                p.println ("<li><a href=\""+list[i]+"\">"+list[i]+"</a></li>");
             }
-
-            if (path.endsWith (".html") || path.endsWith (".htm")) {
-                rmap.set ("Content-Type", "text/html");
+            p.println ("</ul><p><hr>");
+            p.flush();
+            p.close();
+        } else {
+            int clen;
+            if (fixedrequest != null) {
+                clen = (int) f.length();
             } else {
-                rmap.set ("Content-Type", "text/plain");
+                clen = 0;
             }
-            if (f.isDirectory()) {
-                if (!path.endsWith ("/")) {
-                    moved (t);
-                    return;
-                }
-                rmap.set ("Content-Type", "text/html");
-                t.sendResponseHeaders (200, 0);
-                String[] list = f.list();
-                OutputStream os = t.getResponseBody();
-                PrintStream p = new PrintStream (os);
-                p.println ("<h2>Directory listing for: " + path+ "</h2>");
-                p.println ("<ul>");
-                for (int i=0; i<list.length; i++) {
-                    p.println ("<li><a href=\""+list[i]+"\">"+list[i]+"</a></li>");
-                }
-                p.println ("</ul><p><hr>");
-                p.flush();
-                p.close();
-            } else {
-                int clen;
-                if (fixedrequest != null) {
-                    clen = (int) f.length();
-                } else {
-                    clen = 0;
-                }
-                t.sendResponseHeaders (200, clen);
-                OutputStream os = t.getResponseBody();
-                FileInputStream fis = new FileInputStream (f);
-                int count = 0;
-                try {
+            t.sendResponseHeaders (200, clen);
+            OutputStream os = t.getResponseBody();
+            FileInputStream fis = new FileInputStream (f);
+            int count = 0;
+            try {
                 byte[] buf = new byte [16 * 1024];
                 int len;
                 while ((len=fis.read (buf)) != -1) {
                     os.write (buf, 0, len);
                     count += len;
                 }
-                } catch (IOException e) {
-                        e.printStackTrace();
-                }
-                fis.close();
-                os.close();
+            } catch (IOException e) {
+                e.printStackTrace();
             }
-        }
-
-        void moved (HttpExchange t) throws IOException {
-            Headers req = t.getRequestHeaders();
-            Headers map = t.getResponseHeaders();
-            URI uri = t.getRequestURI();
-            String host = req.getFirst ("Host");
-            String location = "http://"+host+uri.getPath() + "/";
-            map.set ("Content-Type", "text/html");
-            map.set ("Location", location);
-            t.sendResponseHeaders (301, -1);
-            t.close();
-        }
-
-        void notfound (HttpExchange t, String p) throws IOException {
-            t.getResponseHeaders().set ("Content-Type", "text/html");
-            t.sendResponseHeaders (404, 0);
-            OutputStream os = t.getResponseBody();
-            String s = "<h2>File not found</h2>";
-            s = s + p + "<p>";
-            os.write (s.getBytes());
+            fis.close();
             os.close();
-            t.close();
         }
     }
 
-class EchoHandler implements HttpHandler {
-
-    byte[] read(InputStream is) throws IOException {
-        byte[] buf = new byte[1024];
-        byte[] result = new byte[0];
-
-        while (true) {
-            int n = is.read(buf);
-            if (n > 0) {
-                byte[] b1 = new byte[result.length + n];
-                System.arraycopy(result, 0, b1, 0, result.length);
-                System.arraycopy(buf, 0, b1, result.length, n);
-                result = b1;
-            } else if (n == -1) {
-                return result;
-            }
-        }
+    void moved (HttpExchange t) throws IOException {
+        Headers req = t.getRequestHeaders();
+        Headers map = t.getResponseHeaders();
+        URI uri = t.getRequestURI();
+        String host = req.getFirst ("Host");
+        String location = "http://"+host+uri.getPath() + "/";
+        map.set ("Content-Type", "text/html");
+        map.set ("Location", location);
+        t.sendResponseHeaders (301, -1);
+        t.close();
     }
 
-    public void handle (HttpExchange t)
-        throws IOException
-    {
-        InputStream is = t.getRequestBody();
-        Headers map = t.getRequestHeaders();
-        String fixedrequest = map.getFirst ("XFixed");
-
-        // return the number of bytes received (no echo)
-        String summary = map.getFirst ("XSummary");
-        if (fixedrequest != null && summary == null)  {
-            byte[] in = read(is);
-            t.sendResponseHeaders(200, in.length);
-            OutputStream os = t.getResponseBody();
-            os.write(in);
-            close(os);
-            close(is);
-        } else {
-            OutputStream os = t.getResponseBody();
-            byte[] buf = new byte[64 * 1024];
-            t.sendResponseHeaders(200, 0);
-            int n, count=0;;
-
-            while ((n = is.read(buf)) != -1) {
-                if (summary == null) {
-                    os.write(buf, 0, n);
-                }
-                count += n;
-            }
-            if (summary != null) {
-                String s = Integer.toString(count);
-                os.write(s.getBytes());
-            }
-            close(os);
-            close(is);
-        }
+    void notfound (HttpExchange t, String p) throws IOException {
+        t.getResponseHeaders().set ("Content-Type", "text/html");
+        t.sendResponseHeaders (404, 0);
+        OutputStream os = t.getResponseBody();
+        String s = "<h2>File not found</h2>";
+        s = s + p + "<p>";
+        os.write (s.getBytes());
+        os.close();
+        t.close();
     }
-
-    protected void close(OutputStream os) throws IOException {
-            os.close();
-    }
-    protected void close(InputStream is) throws IOException {
-            is.close();
-        }
-    }
+}
diff --git a/test/com/sun/net/httpserver/SimpleFileServer.java b/test/com/sun/net/httpserver/SimpleFileServer.java
new file mode 100644
index 0000000..0d32f37
--- /dev/null
+++ b/test/com/sun/net/httpserver/SimpleFileServer.java
@@ -0,0 +1,73 @@
+/*
+ * Copyright (c) 2005, 2017, 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.util.*;
+import java.util.concurrent.*;
+import java.util.logging.*;
+import java.io.*;
+import java.net.*;
+import java.security.*;
+import javax.net.ssl.*;
+import com.sun.net.httpserver.*;
+
+/**
+ * Implements a basic static content HTTP server
+ * which understands text/html, text/plain content types
+ *
+ * Must be given an abs pathname to the document root.
+ * Directory listings together with text + html files
+ * can be served.
+ *
+ * File Server created on files sub-path
+ *
+ * Echo server created on echo sub-path
+ */
+public class SimpleFileServer {
+
+    public static void main (String[] args) throws Exception {
+        if (args.length != 3) {
+            System.out.println ("usage: java FileServerHandler rootDir port logfilename");
+            System.exit(1);
+        }
+        Logger logger = Logger.getLogger("com.sun.net.httpserver");
+        ConsoleHandler ch = new ConsoleHandler();
+        logger.setLevel(Level.ALL);
+        ch.setLevel(Level.ALL);
+        logger.addHandler(ch);
+
+        String rootDir = args[0];
+        int port = Integer.parseInt (args[1]);
+        String logfile = args[2];
+        HttpServer server = HttpServer.create (new InetSocketAddress (port), 0);
+        HttpHandler h = new FileServerHandler (rootDir);
+        HttpHandler h1 = new EchoHandler ();
+
+        HttpContext c = server.createContext ("/files", h);
+        c.getFilters().add (new LogFilter (new File (logfile)));
+        HttpContext c1 = server.createContext ("/echo", h1);
+        c.getFilters().add (new LogFilter (new File (logfile)));
+        c1.getFilters().add (new LogFilter (new File (logfile)));
+        server.setExecutor (Executors.newCachedThreadPool());
+        server.start ();
+    }
+}
diff --git a/test/java/net/httpclient/HttpEchoHandler.java b/test/java/net/httpclient/HttpEchoHandler.java
new file mode 100644
index 0000000..914d891
--- /dev/null
+++ b/test/java/net/httpclient/HttpEchoHandler.java
@@ -0,0 +1,87 @@
+/*
+ * Copyright (c) 2015, 2017, 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 com.sun.net.httpserver.*;
+import java.net.*;
+import jdk.incubator.http.*;
+import java.io.*;
+import java.util.concurrent.*;
+import javax.net.ssl.*;
+import java.nio.file.*;
+import java.util.HashSet;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Random;
+import jdk.testlibrary.SimpleSSLContext;
+import static jdk.incubator.http.HttpRequest.*;
+import static jdk.incubator.http.HttpResponse.*;
+import java.util.logging.ConsoleHandler;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+
+public class HttpEchoHandler implements HttpHandler {
+    public HttpEchoHandler() {}
+
+    @Override
+    public void handle(HttpExchange t)
+            throws IOException {
+        try {
+            System.err.println("EchoHandler received request to " + t.getRequestURI());
+            InputStream is = t.getRequestBody();
+            Headers map = t.getRequestHeaders();
+            Headers map1 = t.getResponseHeaders();
+            map1.add("X-Hello", "world");
+            map1.add("X-Bye", "universe");
+            String fixedrequest = map.getFirst("XFixed");
+            File outfile = File.createTempFile("foo", "bar");
+            FileOutputStream fos = new FileOutputStream(outfile);
+            int count = (int) is.transferTo(fos);
+            is.close();
+            fos.close();
+            InputStream is1 = new FileInputStream(outfile);
+            OutputStream os = null;
+            // return the number of bytes received (no echo)
+            String summary = map.getFirst("XSummary");
+            if (fixedrequest != null && summary == null) {
+                t.sendResponseHeaders(200, count);
+                os = t.getResponseBody();
+                is1.transferTo(os);
+            } else {
+                t.sendResponseHeaders(200, 0);
+                os = t.getResponseBody();
+                is1.transferTo(os);
+
+                if (summary != null) {
+                    String s = Integer.toString(count);
+                    os.write(s.getBytes());
+                }
+            }
+            outfile.delete();
+            os.close();
+            is1.close();
+        } catch (Throwable e) {
+            e.printStackTrace();
+            throw new IOException(e);
+        }
+    }
+}
diff --git a/test/java/net/httpclient/LightWeightHttpServer.java b/test/java/net/httpclient/LightWeightHttpServer.java
index a0d6e9a..d80a382 100644
--- a/test/java/net/httpclient/LightWeightHttpServer.java
+++ b/test/java/net/httpclient/LightWeightHttpServer.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -23,8 +23,9 @@
 
 /**
  * library /lib/testlibrary/ /
- * build jdk.testlibrary.SimpleSSLContext ProxyServer EchoHandler
+ * build jdk.testlibrary.SimpleSSLContext ProxyServer
  * compile ../../../com/sun/net/httpserver/LogFilter.java
+ * compile ../../../com/sun/net/httpserver/EchoHandler.java
  * compile ../../../com/sun/net/httpserver/FileServerHandler.java
  */
 import com.sun.net.httpserver.Headers;
diff --git a/test/java/net/httpclient/ManyRequests.java b/test/java/net/httpclient/ManyRequests.java
index 7420c72..8803b39 100644
--- a/test/java/net/httpclient/ManyRequests.java
+++ b/test/java/net/httpclient/ManyRequests.java
@@ -28,8 +28,9 @@
  *          java.logging
  *          jdk.httpserver
  * @library /lib/testlibrary/ /
- * @build jdk.testlibrary.SimpleSSLContext EchoHandler
+ * @build jdk.testlibrary.SimpleSSLContext
  * @compile ../../../com/sun/net/httpserver/LogFilter.java
+ * @compile ../../../com/sun/net/httpserver/EchoHandler.java
  * @compile ../../../com/sun/net/httpserver/FileServerHandler.java
  * @run main/othervm/timeout=40 -Djdk.httpclient.HttpClient.log=ssl ManyRequests
  * @run main/othervm/timeout=40 -Dtest.insertDelay=true ManyRequests
diff --git a/test/java/net/httpclient/ManyRequests2.java b/test/java/net/httpclient/ManyRequests2.java
index 2ec01de..26c281f 100644
--- a/test/java/net/httpclient/ManyRequests2.java
+++ b/test/java/net/httpclient/ManyRequests2.java
@@ -28,8 +28,9 @@
  *          java.logging
  *          jdk.httpserver
  * @library /lib/testlibrary/ /
- * @build jdk.testlibrary.SimpleSSLContext EchoHandler
+ * @build jdk.testlibrary.SimpleSSLContext
  * @compile ../../../com/sun/net/httpserver/LogFilter.java
+ * @compile ../../../com/sun/net/httpserver/EchoHandler.java
  * @compile ../../../com/sun/net/httpserver/FileServerHandler.java
  * @build ManyRequests ManyRequests2
  * @run main/othervm/timeout=40 -Dtest.XFixed=true ManyRequests2
diff --git a/test/java/net/httpclient/RequestBodyTest.java b/test/java/net/httpclient/RequestBodyTest.java
index fd0bbcc..446eb03 100644
--- a/test/java/net/httpclient/RequestBodyTest.java
+++ b/test/java/net/httpclient/RequestBodyTest.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2017, 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,7 @@
  *          jdk.httpserver
  * @library /lib/testlibrary/
  * @compile ../../../com/sun/net/httpserver/LogFilter.java
+ * @compile ../../../com/sun/net/httpserver/EchoHandler.java
  * @compile ../../../com/sun/net/httpserver/FileServerHandler.java
  * @build LightWeightHttpServer
  * @build jdk.testlibrary.SimpleSSLContext
diff --git a/test/java/net/httpclient/SmokeTest.java b/test/java/net/httpclient/SmokeTest.java
index 8d33296..a0636cc 100644
--- a/test/java/net/httpclient/SmokeTest.java
+++ b/test/java/net/httpclient/SmokeTest.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2017, 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,8 +28,9 @@
  *          java.logging
  *          jdk.httpserver
  * @library /lib/testlibrary/ /
- * @build jdk.testlibrary.SimpleSSLContext ProxyServer EchoHandler
+ * @build jdk.testlibrary.SimpleSSLContext ProxyServer
  * @compile ../../../com/sun/net/httpserver/LogFilter.java
+ * @compile ../../../com/sun/net/httpserver/EchoHandler.java
  * @compile ../../../com/sun/net/httpserver/FileServerHandler.java
  * @run main/othervm -Djdk.httpclient.HttpClient.log=errors,trace SmokeTest
  */
diff --git a/test/java/net/httpclient/http2/BasicTest.java b/test/java/net/httpclient/http2/BasicTest.java
index 615843d..9744eda 100644
--- a/test/java/net/httpclient/http2/BasicTest.java
+++ b/test/java/net/httpclient/http2/BasicTest.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2017, 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
@@ -62,11 +62,11 @@
             sslContext = sslct.get();
             client = getClient();
             httpServer = new Http2TestServer(false, 0, exec, sslContext);
-            httpServer.addHandler(new EchoHandler(), "/");
+            httpServer.addHandler(new Http2EchoHandler(), "/");
             httpPort = httpServer.getAddress().getPort();
 
             httpsServer = new Http2TestServer(true, 0, exec, sslContext);
-            httpsServer.addHandler(new EchoHandler(), "/");
+            httpsServer.addHandler(new Http2EchoHandler(), "/");
 
             httpsPort = httpsServer.getAddress().getPort();
             httpURIString = "http://127.0.0.1:" + httpPort + "/foo/";
diff --git a/test/java/net/httpclient/http2/ErrorTest.java b/test/java/net/httpclient/http2/ErrorTest.java
index a2e1150..9a8815d 100644
--- a/test/java/net/httpclient/http2/ErrorTest.java
+++ b/test/java/net/httpclient/http2/ErrorTest.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2017, 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
@@ -83,7 +83,7 @@
                                               0,
                                               exec,
                                               serverContext);
-            httpsServer.addHandler(new EchoHandler(), "/");
+            httpsServer.addHandler(new Http2EchoHandler(), "/");
             int httpsPort = httpsServer.getAddress().getPort();
             String httpsURIString = "https://127.0.0.1:" + httpsPort + "/bar/";
 
diff --git a/test/java/net/httpclient/http2/FixedThreadPoolTest.java b/test/java/net/httpclient/http2/FixedThreadPoolTest.java
index 3967614..d6de84a 100644
--- a/test/java/net/httpclient/http2/FixedThreadPoolTest.java
+++ b/test/java/net/httpclient/http2/FixedThreadPoolTest.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2017, 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
@@ -62,11 +62,11 @@
             sslContext = sslct.get();
             client = getClient();
             httpServer = new Http2TestServer(false, 0, exec, sslContext);
-            httpServer.addHandler(new EchoHandler(), "/");
+            httpServer.addHandler(new Http2EchoHandler(), "/");
             httpPort = httpServer.getAddress().getPort();
 
             httpsServer = new Http2TestServer(true, 0, exec, sslContext);
-            httpsServer.addHandler(new EchoHandler(), "/");
+            httpsServer.addHandler(new Http2EchoHandler(), "/");
 
             httpsPort = httpsServer.getAddress().getPort();
             httpURIString = "http://127.0.0.1:" + httpPort + "/foo/";
diff --git a/test/java/net/httpclient/http2/RedirectTest.java b/test/java/net/httpclient/http2/RedirectTest.java
index 634467e..cf02785 100644
--- a/test/java/net/httpclient/http2/RedirectTest.java
+++ b/test/java/net/httpclient/http2/RedirectTest.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2017, 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
@@ -79,7 +79,7 @@
 
             httpServer.addHandler(new RedirectHandler(sup(altURIString1)), "/foo");
             altServer.addHandler(new RedirectHandler(sup(altURIString2)), "/redir");
-            altServer.addHandler(new EchoHandler(), "/redir/again");
+            altServer.addHandler(new Http2EchoHandler(), "/redir/again");
 
             httpServer.start();
             altServer.start();
diff --git a/test/java/net/httpclient/http2/server/Http2EchoHandler.java b/test/java/net/httpclient/http2/server/Http2EchoHandler.java
new file mode 100644
index 0000000..c1ebebe
--- /dev/null
+++ b/test/java/net/httpclient/http2/server/Http2EchoHandler.java
@@ -0,0 +1,76 @@
+/*
+ * Copyright (c) 2005, 2017, 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.*;
+import jdk.incubator.http.internal.common.HttpHeadersImpl;
+
+public class Http2EchoHandler implements Http2Handler {
+    public Http2EchoHandler() {}
+
+    @Override
+    public void handle(Http2TestExchange t)
+            throws IOException {
+        try {
+            System.err.println("EchoHandler received request to " + t.getRequestURI());
+            InputStream is = t.getRequestBody();
+            HttpHeadersImpl map = t.getRequestHeaders();
+            HttpHeadersImpl map1 = t.getResponseHeaders();
+            map1.addHeader("X-Hello", "world");
+            map1.addHeader("X-Bye", "universe");
+            String fixedrequest = map.firstValue("XFixed").orElse(null);
+            File outfile = File.createTempFile("foo", "bar");
+            //System.err.println ("QQQ = " + outfile.toString());
+            FileOutputStream fos = new FileOutputStream(outfile);
+            int count = (int) is.transferTo(fos);
+            System.err.printf("EchoHandler read %d bytes\n", count);
+            is.close();
+            fos.close();
+            InputStream is1 = new FileInputStream(outfile);
+            OutputStream os = null;
+            // return the number of bytes received (no echo)
+            String summary = map.firstValue("XSummary").orElse(null);
+            if (fixedrequest != null && summary == null) {
+                t.sendResponseHeaders(200, count);
+                os = t.getResponseBody();
+                int count1 = (int)is1.transferTo(os);
+                System.err.printf("EchoHandler wrote %d bytes\n", count1);
+            } else {
+                t.sendResponseHeaders(200, 0);
+                os = t.getResponseBody();
+                int count1 = (int)is1.transferTo(os);
+                System.err.printf("EchoHandler wrote %d bytes\n", count1);
+
+                if (summary != null) {
+                    String s = Integer.toString(count);
+                    os.write(s.getBytes());
+                }
+            }
+            outfile.delete();
+            os.close();
+            is1.close();
+        } catch (Throwable e) {
+            e.printStackTrace();
+            throw new IOException(e);
+        }
+    }
+}
diff --git a/test/jdk/modules/etc/UpgradeableModules.java b/test/jdk/modules/etc/UpgradeableModules.java
new file mode 100644
index 0000000..a5ef602
--- /dev/null
+++ b/test/jdk/modules/etc/UpgradeableModules.java
@@ -0,0 +1,104 @@
+/*
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * @test
+ * @summary Verify that upgradeable modules are not hashed in java.base
+ *          whereas non-upgradeable modules are.
+ * @modules java.base/jdk.internal.module
+ * @run main UpgradeableModules
+ */
+
+import jdk.internal.module.ModuleHashes;
+import jdk.internal.module.ModuleReferenceImpl;
+
+import java.lang.module.ModuleFinder;
+import java.lang.module.ModuleReference;
+import java.lang.module.ResolvedModule;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Optional;
+import java.util.Set;
+import java.util.stream.Collectors;
+
+public class UpgradeableModules {
+    private static final List<String> UPGRADEABLE_MODULES =
+        List.of("java.activation",
+                "java.compiler",
+                "java.corba",
+                "java.jnlp",
+                "java.transaction",
+                "java.xml.bind",
+                "java.xml.ws",
+                "java.xml.ws.annotation",
+                "jdk.internal.vm.compiler",
+                "jdk.deploy",
+                "jdk.javaws",
+                "jdk.plugin",
+                "jdk.plugin.dom",
+                "jdk.xml.bind",
+                "jdk.xml.ws");
+
+    public static void main(String... args) {
+        Set<String> hashedModules = hashedModules();
+        if (hashedModules.isEmpty())
+            return;
+
+        if (UPGRADEABLE_MODULES.stream().anyMatch(hashedModules::contains)) {
+            throw new RuntimeException("upgradeable modules are hashed: " +
+                UPGRADEABLE_MODULES.stream()
+                    .filter(hashedModules::contains)
+                    .collect(Collectors.joining(" ")));
+        }
+
+        Set<String> nonUpgradeableModules =
+            ModuleFinder.ofSystem().findAll().stream()
+                .map(mref -> mref.descriptor().name())
+                .filter(mn -> !UPGRADEABLE_MODULES.contains(mn))
+                .collect(Collectors.toSet());
+
+        if (nonUpgradeableModules.stream().anyMatch(mn -> !hashedModules.contains(mn))) {
+            throw new RuntimeException("non-upgradeable modules are not hashed: " +
+                nonUpgradeableModules.stream()
+                    .filter(mn -> !hashedModules.contains(mn))
+                    .collect(Collectors.joining(" ")));
+        }
+    }
+
+    private static Set<String> hashedModules() {
+        Optional<ResolvedModule> resolvedModule = ModuleLayer.boot()
+            .configuration()
+            .findModule("java.base");
+        assert resolvedModule.isPresent();
+        ModuleReference mref = resolvedModule.get().reference();
+        assert mref instanceof ModuleReferenceImpl;
+        ModuleHashes hashes = ((ModuleReferenceImpl) mref).recordedHashes();
+        if (hashes != null) {
+            Set<String> names = new HashSet<>(hashes.names());
+            names.add("java.base");
+            return names;
+        }
+
+        return Set.of();
+    }
+}
diff --git a/test/jdk/modules/etc/VerifyModuleDelegation.java b/test/jdk/modules/etc/VerifyModuleDelegation.java
index 2d8b30c..12cfee6 100644
--- a/test/jdk/modules/etc/VerifyModuleDelegation.java
+++ b/test/jdk/modules/etc/VerifyModuleDelegation.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -29,13 +29,9 @@
  */
 
 import java.lang.module.ModuleDescriptor;
-import java.lang.module.ModuleFinder;
-import java.lang.module.ModuleReference;
 import java.util.Set;
 import static java.util.stream.Collectors.toSet;
 
-import static java.lang.module.ModuleDescriptor.Requires.Modifier.*;
-
 import org.testng.annotations.*;
 
 import static org.testng.Assert.*;
@@ -76,8 +72,9 @@
                      ClassLoader loader1 = boot.findLoader(md.name());
                      ClassLoader loader2 = boot.findLoader(req.name());
                      if (loader1 != loader2 && !isAncestor(loader2, loader1)) {
-                         throw new Error(md.name() + " can't delegate to " +
-                                         "find classes from " + req.name());
+                         throw new Error(loader1.getName() + "/" + md.name() +
+                             " can't delegate to find classes from " +
+                             loader2.getName() + "/" + req.name());
                      }
                  }));
     }
diff --git a/test/sun/security/pkcs12/ProbeLargeKeystore.java b/test/sun/security/pkcs12/ProbeLargeKeystore.java
new file mode 100644
index 0000000..33450e9
--- /dev/null
+++ b/test/sun/security/pkcs12/ProbeLargeKeystore.java
@@ -0,0 +1,82 @@
+/*
+ * Copyright (c) 2017, 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 8181978
+ * @summary Test automatic keystore type detection for a large PKCS12 keystore
+ */
+
+import java.io.*;
+import java.security.*;
+import java.security.cert.*;
+import java.security.cert.Certificate;
+
+public class ProbeLargeKeystore {
+
+    private static final String DIR = System.getProperty("test.src", ".");
+    private static final String CERT = DIR + "/trusted.pem";
+    private static final String ALIAS = "test-entry-";
+    private static final int COUNT = 100;
+    private static final String KEYSTORE = "test-keystore.p12";
+    private static final char[] PASSWORD = "passphrase".toCharArray();
+
+    public static final void main(String[] args) throws Exception {
+
+        // Create a large PKCS12 keystore
+
+        new File(KEYSTORE).delete();
+        KeyStore keystore = KeyStore.getInstance("PKCS12");
+        keystore.load(null, null);
+        Certificate cert = loadCertificate(CERT);
+
+        for (int i = 0; i < COUNT; i++) {
+            keystore.setCertificateEntry(ALIAS + i, cert);
+        }
+
+        try (FileOutputStream out = new FileOutputStream(KEYSTORE)) {
+            keystore.store(out, PASSWORD);
+        }
+
+        // Test the automatic keystore type detection mechanism for PKCS12
+
+        KeyStore largeKeystore =
+           KeyStore.getInstance(new File(KEYSTORE), PASSWORD);
+
+        if (largeKeystore.size() != COUNT) {
+            throw new Exception("Error detecting a large PKCS12 keystore");
+        }
+
+        new File(KEYSTORE).delete();
+        System.out.println("OK");
+    }
+
+    private static final Certificate loadCertificate(String certFile)
+            throws Exception {
+        try (FileInputStream certStream = new FileInputStream(certFile)) {
+             CertificateFactory factory =
+                 CertificateFactory.getInstance("X.509");
+            return factory.generateCertificate(certStream);
+        }
+    }
+}