--- a/jdk/make/ModuleTools.gmk Thu Jun 15 17:24:12 2017 +0000
+++ b/jdk/make/ModuleTools.gmk Thu Jun 15 17:43:21 2017 +0000
@@ -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
--- a/jdk/make/src/classes/build/tools/docs/GenDocsBundlePage.java Thu Jun 15 17:24:12 2017 +0000
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -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;
- }
- }
-}
--- a/jdk/make/src/classes/build/tools/docs/docs-bundle-page.html Thu Jun 15 17:24:12 2017 +0000
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -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"> </span> Java SE
-<li><span class="jdk"> </span> JDK
-<li><span class="javafx"> </span> JavaFX
-<li><span class="jcp"> </span> 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> © 1993, 2017, Oracle and/or its affiliates. All rights reserved.</p>
-
-</body>
-</html>
-
-
--- a/jdk/make/src/classes/build/tools/docs/docs-module-groups.properties Thu Jun 15 17:24:12 2017 +0000
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -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
-
--- a/jdk/src/java.base/share/classes/java/io/File.java Thu Jun 15 17:24:12 2017 +0000
+++ b/jdk/src/java.base/share/classes/java/io/File.java Thu Jun 15 17:43:21 2017 +0000
@@ -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
--- a/jdk/src/java.base/share/classes/java/lang/invoke/VarHandle.java Thu Jun 15 17:24:12 2017 +0000
+++ b/jdk/src/java.base/share/classes/java/lang/invoke/VarHandle.java Thu Jun 15 17:43:21 2017 +0000
@@ -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
--- a/jdk/src/java.base/share/classes/java/util/concurrent/atomic/AtomicInteger.java Thu Jun 15 17:24:12 2017 +0000
+++ b/jdk/src/java.base/share/classes/java/util/concurrent/atomic/AtomicInteger.java Thu Jun 15 17:43:21 2017 +0000
@@ -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
--- a/jdk/src/java.base/share/classes/java/util/concurrent/atomic/AtomicIntegerArray.java Thu Jun 15 17:24:12 2017 +0000
+++ b/jdk/src/java.base/share/classes/java/util/concurrent/atomic/AtomicIntegerArray.java Thu Jun 15 17:43:21 2017 +0000
@@ -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
--- a/jdk/src/java.base/share/classes/java/util/concurrent/atomic/AtomicIntegerFieldUpdater.java Thu Jun 15 17:24:12 2017 +0000
+++ b/jdk/src/java.base/share/classes/java/util/concurrent/atomic/AtomicIntegerFieldUpdater.java Thu Jun 15 17:43:21 2017 +0000
@@ -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
--- a/jdk/src/java.base/share/classes/java/util/concurrent/atomic/AtomicLong.java Thu Jun 15 17:24:12 2017 +0000
+++ b/jdk/src/java.base/share/classes/java/util/concurrent/atomic/AtomicLong.java Thu Jun 15 17:43:21 2017 +0000
@@ -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
--- a/jdk/src/java.base/share/classes/java/util/concurrent/atomic/AtomicLongArray.java Thu Jun 15 17:24:12 2017 +0000
+++ b/jdk/src/java.base/share/classes/java/util/concurrent/atomic/AtomicLongArray.java Thu Jun 15 17:43:21 2017 +0000
@@ -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
--- a/jdk/src/java.base/share/classes/java/util/concurrent/atomic/AtomicLongFieldUpdater.java Thu Jun 15 17:24:12 2017 +0000
+++ b/jdk/src/java.base/share/classes/java/util/concurrent/atomic/AtomicLongFieldUpdater.java Thu Jun 15 17:43:21 2017 +0000
@@ -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
--- a/jdk/src/java.base/share/classes/java/util/concurrent/atomic/AtomicReference.java Thu Jun 15 17:24:12 2017 +0000
+++ b/jdk/src/java.base/share/classes/java/util/concurrent/atomic/AtomicReference.java Thu Jun 15 17:43:21 2017 +0000
@@ -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
--- a/jdk/src/java.base/share/classes/java/util/concurrent/atomic/AtomicReferenceArray.java Thu Jun 15 17:24:12 2017 +0000
+++ b/jdk/src/java.base/share/classes/java/util/concurrent/atomic/AtomicReferenceArray.java Thu Jun 15 17:43:21 2017 +0000
@@ -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
--- a/jdk/src/java.base/share/classes/java/util/concurrent/atomic/AtomicReferenceFieldUpdater.java Thu Jun 15 17:24:12 2017 +0000
+++ b/jdk/src/java.base/share/classes/java/util/concurrent/atomic/AtomicReferenceFieldUpdater.java Thu Jun 15 17:43:21 2017 +0000
@@ -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
--- a/jdk/src/java.base/share/classes/sun/security/pkcs12/PKCS12KeyStore.java Thu Jun 15 17:24:12 2017 +0000
+++ b/jdk/src/java.base/share/classes/sun/security/pkcs12/PKCS12KeyStore.java Thu Jun 15 17:43:21 2017 +0000
@@ -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 = {
--- a/jdk/src/java.base/share/lib/security/default.policy Thu Jun 15 17:24:12 2017 +0000
+++ b/jdk/src/java.base/share/lib/security/default.policy Thu Jun 15 17:43:21 2017 +0000
@@ -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;
-};
--- a/jdk/src/java.sql.rowset/share/classes/javax/sql/rowset/spi/package.html Thu Jun 15 17:24:12 2017 +0000
+++ b/jdk/src/java.sql.rowset/share/classes/javax/sql/rowset/spi/package.html Thu Jun 15 17:43:21 2017 +0000
@@ -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>
--- a/jdk/src/jdk.unsupported/share/classes/sun/misc/Unsafe.java Thu Jun 15 17:24:12 2017 +0000
+++ b/jdk/src/jdk.unsupported/share/classes/sun/misc/Unsafe.java Thu Jun 15 17:43:21 2017 +0000
@@ -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,
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/sun/security/pkcs12/ProbeLargeKeystore.java Thu Jun 15 17:43:21 2017 +0000
@@ -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);
+ }
+ }
+}