--- a/jdk/.hgtags Wed May 31 10:41:07 2017 -0700
+++ b/jdk/.hgtags Wed May 31 18:33:35 2017 +0000
@@ -423,3 +423,4 @@
cbd65760a005766610583949b3b5c9ace92e74b3 jdk-10+7
f0adc10ed8316e6cf316e3208c5ecf6835d22bc4 jdk-10+8
b9409a7daa6c793dd631e52fe6ef79d08a3b337a jdk-10+9
+29bbedd4cce8e14742bdb22118c057b877c02f0f jdk-9+171
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/make/data/docs-resources/resources/jdk-default.css Wed May 31 18:33:35 2017 +0000
@@ -0,0 +1,129 @@
+/*
+ * 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.
+ */
+
+body {
+ margin: 2em 2em;
+ font-family: DejaVu Sans, Bitstream Vera Sans, Luxi Sans, Verdana, Arial, Helvetica;
+ font-size: 10pt;
+ line-height: 1.4;
+}
+
+pre, code, tt {
+ font-family: DejaVu Sans Mono, Bitstream Vera Sans Mono, Luxi Mono,
+ Courier New, monospace;
+}
+
+blockquote {
+ margin: 1.5ex 0em 1.5ex 2em;
+}
+
+p {
+ padding: 0pt;
+ margin: 1ex 0em;
+}
+
+p:first-child, pre:first-child { margin-top: 0pt; }
+
+h1 {
+ font-weight: bold;
+ padding: 0pt;
+ margin: 2ex .5ex 1ex 0pt;
+}
+
+h1:first-child, h2:first-child {
+ margin-top: 0ex;
+}
+
+h2 {
+ font-weight: bold;
+ padding: 0pt;
+ margin: 2ex 0pt 1ex 0pt;
+}
+
+h3 {
+ font-weight: bold;
+ padding: 0pt;
+ margin: 1.5ex 0pt 1ex 0pt;
+}
+
+h4 {
+ font-weight: bold;
+ padding: 0pt;
+ margin: 1.5ex 0pt 1ex 0pt;
+}
+
+a:link {
+ color: #437291;
+}
+
+a:visited {
+ color: #666666;
+}
+
+a[href]:hover {
+ color: #e76f00;
+}
+
+a img {
+ border-width: 0px;
+}
+
+img {
+ background: white;
+}
+
+table {
+ border-collapse: collapse;
+ margin-left: 15px;
+ margin-right: 15px;
+}
+
+th, td {
+ padding: 3px;
+ vertical-align: top;
+}
+
+table, th, td {
+ border: 1px solid black;
+}
+
+caption {
+ text-align: left;
+ font-style: italic;
+ text-indent: 15px;
+ margin-bottom:10px;
+}
+
+tr:nth-child(even), tr:nth-child(even) th[scope=row] {
+ background: #DDD;
+}
+
+tr:nth-child(odd), tr:nth-child(odd) th[scope=row] {
+ background: #FFF;
+}
+
+th {
+ background: #DDF;
+}
--- a/jdk/make/data/docs-resources/specs/resources/jdk-default.css Wed May 31 10:41:07 2017 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,129 +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.
- */
-
-body {
- margin: 2em 2em;
- font-family: DejaVu Sans, Bitstream Vera Sans, Luxi Sans, Verdana, Arial, Helvetica;
- font-size: 10pt;
- line-height: 1.4;
-}
-
-pre, code, tt {
- font-family: DejaVu Sans Mono, Bitstream Vera Sans Mono, Luxi Mono,
- Courier New, monospace;
-}
-
-blockquote {
- margin: 1.5ex 0em 1.5ex 2em;
-}
-
-p {
- padding: 0pt;
- margin: 1ex 0em;
-}
-
-p:first-child, pre:first-child { margin-top: 0pt; }
-
-h1 {
- font-weight: bold;
- padding: 0pt;
- margin: 2ex .5ex 1ex 0pt;
-}
-
-h1:first-child, h2:first-child {
- margin-top: 0ex;
-}
-
-h2 {
- font-weight: bold;
- padding: 0pt;
- margin: 2ex 0pt 1ex 0pt;
-}
-
-h3 {
- font-weight: bold;
- padding: 0pt;
- margin: 1.5ex 0pt 1ex 0pt;
-}
-
-h4 {
- font-weight: bold;
- padding: 0pt;
- margin: 1.5ex 0pt 1ex 0pt;
-}
-
-a:link {
- color: #437291;
-}
-
-a:visited {
- color: #666666;
-}
-
-a[href]:hover {
- color: #e76f00;
-}
-
-a img {
- border-width: 0px;
-}
-
-img {
- background: white;
-}
-
-table {
- border-collapse: collapse;
- margin-left: 15px;
- margin-right: 15px;
-}
-
-th, td {
- padding: 3px;
- vertical-align: top;
-}
-
-table, th, td {
- border: 1px solid black;
-}
-
-caption {
- text-align: left;
- font-style: italic;
- text-indent: 15px;
- margin-bottom:10px;
-}
-
-tr:nth-child(even) {
- background: #DDD;
-}
-
-tr:nth-child(odd) {
- background: #FFF;
-}
-
-th {
- background: #DDF;
-}
--- a/jdk/make/src/classes/build/tools/docs/GenDocsBundlePage.java Wed May 31 10:41:07 2017 -0700
+++ b/jdk/make/src/classes/build/tools/docs/GenDocsBundlePage.java Wed May 31 18:33:35 2017 +0000
@@ -31,18 +31,23 @@
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.stream.Collectors;
+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.
@@ -104,59 +109,33 @@
}
private static final String HEADER_TITLE = "@HEADER_TITLE@";
+
+
final Path outputfile;
final String title;
- final Map<String, String> moduleGroups;
-
+ final Map<String, Set<ModuleDescriptor>> moduleGroups = new HashMap<>();
GenDocsBundlePage(String title, Path outputfile) throws IOException
{
this.outputfile = outputfile;
this.title = title;
- this.moduleGroups = moduleGroups();
- }
- static Map<String, String> moduleGroups() throws IOException {
+ // read module groups
ModuleFinder finder = ModuleFinder.ofSystem();
- Map<String, String> groups = new HashMap<>();
try (InputStream in = GenDocsBundlePage.class.getResourceAsStream(MODULE_GROUPS_PROPS)) {
Properties props = new Properties();
props.load(in);
for (String key: props.stringPropertyNames()) {
- Set<String> mods = Stream.of(props.getProperty(key).split("\\s+"))
- .filter(mn -> finder.find(mn).isPresent())
- .map(String::trim)
- .collect(Collectors.toSet());
+ Set<ModuleDescriptor> mods =
+ Stream.of(props.getProperty(key).split("\\s+"))
+ .map(String::trim)
+ .flatMap(mn -> finder.find(mn).stream())
+ .map(ModuleReference::descriptor)
+ .collect(toSet());
- // divide into 3 columns: Java SE, JDK, JavaFX
- StringBuilder sb = new StringBuilder();
- sb.append(mods.stream()
- .filter(mn -> mn.startsWith("java."))
- .sorted()
- .map(GenDocsBundlePage::toHRef)
- .collect(Collectors.joining("\n")));
- sb.append("</td>\n<td>")
- .append(mods.stream()
- .filter(mn -> mn.startsWith("jdk."))
- .sorted()
- .map(GenDocsBundlePage::toHRef)
- .collect(Collectors.joining("\n")));
- sb.append("</td>\n<td>");
- if (mods.stream().anyMatch(mn -> mn.startsWith("javafx."))) {
- sb.append(mods.stream()
- .filter(mn -> mn.startsWith("javafx."))
- .sorted()
- .map(GenDocsBundlePage::toHRef)
- .collect(Collectors.joining("\n")));
- }
String name = "@" + key.toUpperCase(Locale.ENGLISH) + "@";
- groups.put(name, sb.toString());
- }
+ moduleGroups.put(name, mods);
+ };
}
- return groups;
- }
-
- static String toHRef(String mn) {
- return String.format("<a href=\"api/%s-summary.html\">%s</a><br>", mn, mn);
}
void run(BufferedReader reader) throws IOException {
@@ -174,13 +153,95 @@
if (line.contains(HEADER_TITLE)) {
line = line.replace(HEADER_TITLE, title);
}
- if (line.contains("@")) {
- for (Map.Entry<String,String> e: moduleGroups.entrySet()) {
- if (line.contains(e.getKey())) {
- line = line.replace(e.getKey(), e.getValue());
- }
+ 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 Wed May 31 10:41:07 2017 -0700
+++ b/jdk/make/src/classes/build/tools/docs/docs-bundle-page.html Wed May 31 18:33:35 2017 +0000
@@ -26,121 +26,146 @@
<!DOCTYPE html>
<html lang="en">
<head>
- <meta http-equiv="content-type" content="text/html;" charset="utf-8">
- <style type="text/css">
-table {
- border-collapse: collapse;
-}
-table {
+<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;
-}
-th ,td {
- border: 0px solid black;
-}
-thead th {
- background-color: #DDD;
-}
-tbody > tr:nth-child(even) {
- background-color: #EEE
-}
-tbody > tr:nth-child(odd) {
- background-color: #FFF
+ font-family: DejaVu Sans Mono, monospace;
}
-th, td {
- font-family: sans-serif; /* could eventually be DejaVu */
- font-size: small;
- padding: 5px 10px;
- vertical-align:top;
-}
-td a {
- text-decoration: none;
+ul.key span:before { content: " " }
+ul.key span:after { content: " " }
+
+caption {
+ text-align: center;
}
-tr th {
- text-align:left;
+
+tr:nth-child(even), tr:nth-child(even) th[scope=row] {
+ background-color: #EEE;
}
-caption {
- font-size: smaller;
- font-weight: bold;
+tr:nth-child(odd), tr:nth-child(odd) th[scope=row] {
+ background-color: #EEE;
}
+
</style>
-<title>@HEADER_TITLE@</title>
</head>
-<body>
<h1>@HEADER_TITLE@</h1>
<ul>
<li><a href="api/index.html">JDK API Specification</a></li>
-<li>Java Language Specification</li>
-<li>Java Virtual Machine Specification</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>Modules</caption>
+<caption style="display:none">JDK Modules</caption>
<thead>
<tr>
<th scope="col">Group</th>
- <th scope="col">Java SE</th>
- <th scope="col">JDK</th>
- <th scope="col">JavaFX</th>
+ <th scope="col">Modules</th>
</tr>
</thead>
<tbody>
<tr>
<th scope="row">Foundation</th>
- <td>@CORE_MODULES@</td>
+ <td>@JAVA_BASE@</td>
</tr>
<tr>
-<th scope="row">Security</th>
- <td>@SECURITY_MODULES@</td>
-</tr>
-<tr>
-<th scope="row">Instrumentation and<br>Management</th>
- <td>@INSTRUMENT_MGMT_MODULES@</td>
-</tr>
-<tr>
-<th scope="row">Integration</th>
+ <th scope="row">Integration</th>
<td>@INTEGRATION_MODULES@</td>
</tr>
<tr>
<th scope="row">User Interface</th>
- <td>@UI_TOOLKITS_MODULES@</td>
+ <td>@UI_MODULES@</td>
+</tr>
+<tr>
+ <th scope="row">Compilation</th>
+ <td>@COMPILER_MODULES@</td>
</tr>
<tr>
- <th scope="row">Compiler and Scripting</th>
- <td>@COMPILER_SCRIPTING_MODULES@</td>
+ <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">Debugging</th>
- <td>@DEBUG_MODULES@</td>
+ <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">Tools and Tool APIs</th>
- <td>@TOOL_MODULES@</td>
+ <th scope="row">Packaging</th>
+ <td>@PACKAGING_MODULES@</td>
</tr>
<tr>
- <th scope="row">Incubating Features</th>
+ <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"></th>
- <th scope="row">Outside Java SE</th>
- <th scope="row">JDK</th>
- <th scope="row">JavaFX</th>
-</tr>
-<tr>
- <th scope="row">Others</th>
- <td>@OTHER_MODULES@</td>
+ <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>
+<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 Wed May 31 10:41:07 2017 -0700
+++ b/jdk/make/src/classes/build/tools/docs/docs-module-groups.properties Wed May 31 18:33:35 2017 +0000
@@ -1,13 +1,8 @@
# Module Grouping for the docs bundle page
#
-core_modules=\
-java.base \
-jdk.charsets \
-jdk.localedata \
-jdk.net \
-jdk.sctp \
-jdk.zipfs
+java_base=\
+java.base
java_ee_modules=\
java.activation \
@@ -17,6 +12,10 @@
java.xml.ws \
java.xml.ws.annotation
+aggregator_modules=\
+java.se \
+java.se.ee
+
security_modules=\
java.security.jgss \
java.security.sasl \
@@ -26,18 +25,22 @@
jdk.crypto.cryptoki \
jdk.crypto.ec \
jdk.crypto.mscapi \
-jdk.crypto.ucrypto
+jdk.crypto.ucrypto \
+jdk.policytool
-instrument_mgmt_modules=\
-java.instrument \
+instrument_modules=\
+java.instrument
+
+management_modules=\
java.management \
java.management.rmi \
-jdk.jfr \
jdk.management \
jdk.management.agent \
jdk.management.cmm \
jdk.management.jfr \
jdk.management.resource \
+jdk.snmp \
+jdk.jconsole
integration_modules=\
java.logging \
@@ -47,11 +50,18 @@
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.naming.rmi \
+jdk.xml.dom \
+jdk.zipfs
-ui_toolkits_modules=\
+ui_modules=\
java.datatransfer \
java.desktop \
javafx.base \
@@ -63,39 +73,40 @@
javafx.web \
jdk.accessibility
-other_modules=\
-java.jnlp \
-java.smartcardio \
-jdk.jsobject \
-jdk.xml.dom
-
-debug_modules=\
-jdk.jdi \
-jdk.jdwp.agent
-
-tool_modules=\
+svc_modules=\
+jdk.jfr \
jdk.attach \
-jdk.editpad \
+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.jcmd \
-jdk.jconsole \
jdk.jdeps \
-jdk.jlink \
+jdk.editpad \
jdk.jshell \
-jdk.jstatd \
-jdk.pack \
-jdk.policytool \
-jdk.packager.services \
jdk.rmic
-compiler_scripting_modules=\
-java.compiler \
+scripting_modules=\
java.scripting \
-jdk.compiler \
jdk.dynalink \
jdk.scripting.nashorn \
jdk.scripting.nashorn.shell
+other_modules=\
+java.jnlp \
+java.smartcardio
+
incubator_modules=\
jdk.incubator.httpclient
+
--- a/jdk/make/src/classes/build/tools/taglet/ExtLink.java Wed May 31 10:41:07 2017 -0700
+++ b/jdk/make/src/classes/build/tools/taglet/ExtLink.java Wed May 31 18:33:35 2017 +0000
@@ -56,7 +56,7 @@
static final String TAG_NAME = "extLink";
- static final String URL = "https://www.oracle.com/pls/topic/lookup?ctx=javase9&id=";
+ static final String URL = "https://www.oracle.com/pls/topic/lookup?ctx=javase9&id=";
static final Pattern TAG_PATTERN = Pattern.compile("(\\s*)(?<name>\\w+)(\\s+)(?<desc>.*)");
--- a/jdk/src/java.base/aix/native/libnet/aix_close.c Wed May 31 10:41:07 2017 -0700
+++ b/jdk/src/java.base/aix/native/libnet/aix_close.c Wed May 31 18:33:35 2017 +0000
@@ -421,10 +421,8 @@
}
int NET_RecvFrom(int s, void *buf, int len, unsigned int flags,
- struct sockaddr *from, int *fromlen) {
- socklen_t socklen = *fromlen;
- BLOCKING_IO_RETURN_INT( s, recvfrom(s, buf, len, flags, from, &socklen) );
- *fromlen = socklen;
+ struct sockaddr *from, socklen_t *fromlen) {
+ BLOCKING_IO_RETURN_INT( s, recvfrom(s, buf, len, flags, from, fromlen) );
}
int NET_Send(int s, void *msg, int len, unsigned int flags) {
@@ -440,10 +438,8 @@
BLOCKING_IO_RETURN_INT( s, sendto(s, msg, len, flags, to, tolen) );
}
-int NET_Accept(int s, struct sockaddr *addr, int *addrlen) {
- socklen_t socklen = *addrlen;
- BLOCKING_IO_RETURN_INT( s, accept(s, addr, &socklen) );
- *addrlen = socklen;
+int NET_Accept(int s, struct sockaddr *addr, socklen_t *addrlen) {
+ BLOCKING_IO_RETURN_INT( s, accept(s, addr, addrlen) );
}
int NET_Connect(int s, struct sockaddr *addr, int addrlen) {
--- a/jdk/src/java.base/share/classes/java/io/File.java Wed May 31 10:41:07 2017 -0700
+++ b/jdk/src/java.base/share/classes/java/io/File.java Wed May 31 18:33:35 2017 +0000
@@ -923,6 +923,12 @@
* 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.
+ *
* @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
--- a/jdk/src/java.base/share/classes/javax/crypto/Cipher.java Wed May 31 10:41:07 2017 -0700
+++ b/jdk/src/java.base/share/classes/javax/crypto/Cipher.java Wed May 31 18:33:35 2017 +0000
@@ -137,6 +137,7 @@
* <li>{@code AES/CBC/PKCS5Padding} (128)</li>
* <li>{@code AES/ECB/NoPadding} (128)</li>
* <li>{@code AES/ECB/PKCS5Padding} (128)</li>
+ * <li>{@code AES/GCM/NoPadding} (128)</li>
* <li>{@code DES/CBC/NoPadding} (56)</li>
* <li>{@code DES/CBC/PKCS5Padding} (56)</li>
* <li>{@code DES/ECB/NoPadding} (56)</li>
--- a/jdk/src/java.base/share/native/libjli/args.c Wed May 31 10:41:07 2017 -0700
+++ b/jdk/src/java.base/share/native/libjli/args.c Wed May 31 18:33:35 2017 +0000
@@ -456,6 +456,11 @@
env++;
}
+ // Trailing space
+ if (*env == '\0') {
+ break;
+ }
+
arg = p;
while (*env != '\0' && !isspace(*env)) {
if (*env == '"' || *env == '\'') {
--- a/jdk/src/java.base/share/native/libjli/emessages.h Wed May 31 10:41:07 2017 -0700
+++ b/jdk/src/java.base/share/native/libjli/emessages.h Wed May 31 18:33:35 2017 +0000
@@ -36,7 +36,7 @@
#define JNI_ERROR "Error: A JNI error has occurred, please check your installation and try again"
#define JNI_ERROR1 "Error: can't find JNI interfaces in: %s"
-#define ARG_INFO_ENVVAR "NOTE: Picked up the following options via %s:\n %s"
+#define ARG_INFO_ENVVAR "NOTE: Picked up %s: %s"
#define ARG_WARN "Warning: %s option is no longer supported."
#define ARG_ERROR1 "Error: %s requires class path specification"
--- a/jdk/src/jdk.incubator.httpclient/share/classes/jdk/incubator/http/AsyncSSLConnection.java Wed May 31 10:41:07 2017 -0700
+++ b/jdk/src/jdk.incubator.httpclient/share/classes/jdk/incubator/http/AsyncSSLConnection.java Wed May 31 18:33:35 2017 +0000
@@ -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
@@ -190,11 +190,6 @@
}
@Override
- protected int readImpl(ByteBuffer buffer) throws IOException {
- throw new UnsupportedOperationException("Not supported.");
- }
-
- @Override
CompletableFuture<Void> whenReceivingResponse() {
throw new UnsupportedOperationException("Not supported.");
}
--- a/jdk/src/jdk.incubator.httpclient/share/classes/jdk/incubator/http/Exchange.java Wed May 31 10:41:07 2017 -0700
+++ b/jdk/src/jdk.incubator.httpclient/share/classes/jdk/incubator/http/Exchange.java Wed May 31 18:33:35 2017 +0000
@@ -33,7 +33,6 @@
import java.net.URI;
import java.net.URISyntaxException;
import java.net.URLPermission;
-import java.nio.ByteBuffer;
import java.security.AccessControlContext;
import java.security.AccessController;
import java.security.PrivilegedAction;
@@ -76,9 +75,6 @@
boolean upgrading; // to HTTP/2
final PushGroup<?,T> pushGroup;
- // buffer for receiving response headers
- private volatile ByteBuffer rxBuffer;
-
Exchange(HttpRequestImpl request, MultiExchange<?,T> multi) {
this.request = request;
this.upgrading = false;
@@ -121,17 +117,6 @@
return client;
}
- ByteBuffer getBuffer() {
- if(rxBuffer == null) {
- synchronized (this) {
- if(rxBuffer == null) {
- rxBuffer = Utils.getExchangeBuffer();
- }
- }
- }
- return rxBuffer;
- }
-
public Response response() throws IOException, InterruptedException {
return responseImpl(null);
}
--- a/jdk/src/jdk.incubator.httpclient/share/classes/jdk/incubator/http/Http1Exchange.java Wed May 31 10:41:07 2017 -0700
+++ b/jdk/src/jdk.incubator.httpclient/share/classes/jdk/incubator/http/Http1Exchange.java Wed May 31 18:33:35 2017 +0000
@@ -55,7 +55,7 @@
final HttpConnection connection;
final HttpClientImpl client;
final Executor executor;
- final ByteBuffer buffer; // used for receiving
+ volatile ByteBuffer buffer; // used for receiving
@Override
public String toString() {
@@ -74,7 +74,7 @@
this.client = exchange.client();
this.executor = exchange.executor();
this.operations = new LinkedList<>();
- this.buffer = exchange.getBuffer();
+ this.buffer = Utils.EMPTY_BYTEBUFFER;
if (connection != null) {
this.connection = connection;
} else {
@@ -157,7 +157,9 @@
try {
response = new Http1Response<>(connection, this);
response.readHeaders();
- return response.response();
+ Response r = response.response();
+ buffer = response.getBuffer();
+ return r;
} catch (Throwable t) {
connection.close();
throw t;
@@ -213,7 +215,9 @@
return MinimalFuture.supply( () -> {
response = new Http1Response<>(connection, Http1Exchange.this);
response.readHeaders();
- return response.response();
+ Response r = response.response();
+ buffer = response.getBuffer();
+ return r;
}, executor);
}
--- a/jdk/src/jdk.incubator.httpclient/share/classes/jdk/incubator/http/Http1Response.java Wed May 31 10:41:07 2017 -0700
+++ b/jdk/src/jdk.incubator.httpclient/share/classes/jdk/incubator/http/Http1Response.java Wed May 31 18:33:35 2017 +0000
@@ -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
@@ -44,7 +44,7 @@
private final HttpConnection connection;
private ResponseHeaders headers;
private int responseCode;
- private final ByteBuffer buffer; // same buffer used for reading status line and headers
+ private ByteBuffer buffer;
private final Http1Exchange<T> exchange;
private final boolean redirecting; // redirecting
private boolean return2Cache; // return connection to cache when finished
@@ -96,6 +96,10 @@
return finished;
}
+ ByteBuffer getBuffer() {
+ return buffer;
+ }
+
int fixupContentLen(int clen) {
if (request.method().equalsIgnoreCase("HEAD")) {
return 0;
@@ -194,12 +198,15 @@
static final char CR = '\r';
static final char LF = '\n';
- private int getBuffer() throws IOException {
+ private int obtainBuffer() throws IOException {
int n = buffer.remaining();
if (n == 0) {
- buffer.clear();
- return connection.read(buffer);
+ buffer = connection.read();
+ if (buffer == null) {
+ return -1;
+ }
+ n = buffer.remaining();
}
return n;
}
@@ -207,18 +214,17 @@
String readStatusLine() throws IOException {
boolean cr = false;
StringBuilder statusLine = new StringBuilder(128);
- ByteBuffer b = buffer;
- while (getBuffer() != -1) {
- byte[] buf = b.array();
- int offset = b.position();
- int len = b.limit() - offset;
+ while ((obtainBuffer()) != -1) {
+ byte[] buf = buffer.array();
+ int offset = buffer.position();
+ int len = buffer.limit() - offset;
for (int i = 0; i < len; i++) {
char c = (char) buf[i+offset];
if (cr) {
if (c == LF) {
- b.position(i + 1 + offset);
+ buffer.position(i + 1 + offset);
return statusLine.toString();
} else {
throw new IOException("invalid status line");
@@ -231,7 +237,7 @@
}
}
// unlikely, but possible, that multiple reads required
- b.position(b.limit());
+ buffer.position(buffer.limit());
}
return null;
}
--- a/jdk/src/jdk.incubator.httpclient/share/classes/jdk/incubator/http/HttpConnection.java Wed May 31 10:41:07 2017 -0700
+++ b/jdk/src/jdk.incubator.httpclient/share/classes/jdk/incubator/http/HttpConnection.java Wed May 31 18:33:35 2017 +0000
@@ -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
@@ -323,12 +323,9 @@
}
}
- final int read(ByteBuffer buffer) throws IOException {
- return readImpl(buffer);
- }
-
final ByteBuffer read() throws IOException {
- return readImpl();
+ ByteBuffer b = readImpl();
+ return b;
}
/*
@@ -337,9 +334,6 @@
*/
protected abstract ByteBuffer readImpl() throws IOException;
- /** Reads as much as possible into given buffer and returns amount read. */
- protected abstract int readImpl(ByteBuffer buffer) throws IOException;
-
@Override
public String toString() {
return "HttpConnection: " + channel().toString();
--- a/jdk/src/jdk.incubator.httpclient/share/classes/jdk/incubator/http/PlainHttpConnection.java Wed May 31 10:41:07 2017 -0700
+++ b/jdk/src/jdk.incubator.httpclient/share/classes/jdk/incubator/http/PlainHttpConnection.java Wed May 31 18:33:35 2017 +0000
@@ -311,8 +311,7 @@
}
}
- @Override
- protected int readImpl(ByteBuffer buf) throws IOException {
+ private int readImpl(ByteBuffer buf) throws IOException {
int mark = buf.position();
int n;
// FIXME: this hack works in conjunction with the corresponding change
--- a/jdk/src/jdk.incubator.httpclient/share/classes/jdk/incubator/http/PlainTunnelingConnection.java Wed May 31 10:41:07 2017 -0700
+++ b/jdk/src/jdk.incubator.httpclient/share/classes/jdk/incubator/http/PlainTunnelingConnection.java Wed May 31 18:33:35 2017 +0000
@@ -157,11 +157,6 @@
}
@Override
- protected int readImpl(ByteBuffer buffer) throws IOException {
- return delegate.readImpl(buffer);
- }
-
- @Override
boolean isSecure() {
return false;
}
--- a/jdk/src/jdk.incubator.httpclient/share/classes/jdk/incubator/http/ResponseContent.java Wed May 31 10:41:07 2017 -0700
+++ b/jdk/src/jdk.incubator.httpclient/share/classes/jdk/incubator/http/ResponseContent.java Wed May 31 18:33:35 2017 +0000
@@ -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
@@ -148,11 +148,7 @@
// make sure we have at least 1 byte to look at
private void getHunk() throws IOException {
if (chunkbuf == null || !chunkbuf.hasRemaining()) {
- if (chunkbuf == null) {
- chunkbuf = Utils.getBuffer();
- }
- chunkbuf.clear();
- connection.read(chunkbuf);
+ chunkbuf = connection.read();
}
}
@@ -256,7 +252,6 @@
private void pushBodyFixed(ByteBuffer b) throws IOException {
int remaining = contentLength;
- //lastBufferUsed = b;
while (b.hasRemaining() && remaining > 0) {
ByteBuffer buffer = Utils.getBuffer();
int amount = Math.min(b.remaining(), remaining);
@@ -265,22 +260,14 @@
buffer.flip();
dataConsumer.accept(Optional.of(buffer));
}
- //client.returnBuffer(b);
while (remaining > 0) {
- ByteBuffer buffer = Utils.getBuffer();
- int xx = connection.read(buffer);
- if (xx == -1)
+ ByteBuffer buffer = connection.read();
+ if (buffer == null)
throw new IOException("connection closed");
int bytesread = buffer.remaining();
// assume for now that pipelining not implemented
if (bytesread > remaining) {
- System.err.println("xx = " + xx);
- System.err.println("bytesread = " + bytesread);
- System.err.println("remaining = " + remaining);
- for (int i=0; i<remaining; i++) {
- System.err.printf("%x ", buffer.get());
- }
throw new IOException("too many bytes read");
}
remaining -= bytesread;
--- a/jdk/src/jdk.incubator.httpclient/share/classes/jdk/incubator/http/ResponseHeaders.java Wed May 31 10:41:07 2017 -0700
+++ b/jdk/src/jdk.incubator.httpclient/share/classes/jdk/incubator/http/ResponseHeaders.java Wed May 31 18:33:35 2017 +0000
@@ -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
@@ -72,7 +72,7 @@
static final class InputStreamWrapper extends InputStream {
final HttpConnection connection;
- final ByteBuffer buffer;
+ ByteBuffer buffer;
int lastRead = -1; // last byte read from the buffer
int consumed = 0; // number of bytes consumed.
InputStreamWrapper(HttpConnection connection, ByteBuffer buffer) {
@@ -83,9 +83,8 @@
@Override
public int read() throws IOException {
if (!buffer.hasRemaining()) {
- buffer.clear();
- int n = connection.read(buffer);
- if (n == -1) {
+ buffer = connection.read();
+ if (buffer == null) {
return lastRead = -1;
}
}
@@ -97,6 +96,16 @@
}
}
+ private static void display(Map<String, List<String>> map) {
+ map.forEach((k,v) -> {
+ System.out.print (k + ": ");
+ for (String val : v) {
+ System.out.print(val + ", ");
+ }
+ System.out.println("");
+ });
+ }
+
private Map<String, List<String>> parse(InputStreamWrapper input)
throws IOException
{
@@ -114,7 +123,6 @@
// finds is CR. This only happens if there are no headers, and
// only one byte will be consumed from the buffer. In this case
// the next byte MUST be LF
- //System.err.println("Last character read is: " + (byte)lastRead);
if (input.read() != LF) {
throw new IOException("Unexpected byte sequence when no headers: "
+ ((int)CR) + " " + input.lastRead
--- a/jdk/src/jdk.incubator.httpclient/share/classes/jdk/incubator/http/SSLConnection.java Wed May 31 10:41:07 2017 -0700
+++ b/jdk/src/jdk.incubator.httpclient/share/classes/jdk/incubator/http/SSLConnection.java Wed May 31 18:33:35 2017 +0000
@@ -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
@@ -162,10 +162,11 @@
@Override
protected ByteBuffer readImpl() throws IOException {
- ByteBuffer dst = ByteBuffer.allocate(8192);
- int n = readImpl(dst);
+ WrapperResult r = sslDelegate.recvData(ByteBuffer.allocate(8192));
+ // TODO: check for closure
+ int n = r.result.bytesProduced();
if (n > 0) {
- return dst;
+ return r.buf;
} else if (n == 0) {
return Utils.EMPTY_BYTEBUFFER;
} else {
@@ -174,19 +175,6 @@
}
@Override
- protected int readImpl(ByteBuffer buf) throws IOException {
- // TODO: need to ensure that buf is big enough for application data
- WrapperResult r = sslDelegate.recvData(buf);
- // TODO: check for closure
- String s = "Receive) ";
- //debugPrint(s, r.buf);
- if (r.result.bytesProduced() > 0) {
- assert buf == r.buf;
- }
- return r.result.bytesProduced();
- }
-
- @Override
boolean connected() {
return delegate.connected();
}
--- a/jdk/src/jdk.incubator.httpclient/share/classes/jdk/incubator/http/SSLDelegate.java Wed May 31 10:41:07 2017 -0700
+++ b/jdk/src/jdk.incubator.httpclient/share/classes/jdk/incubator/http/SSLDelegate.java Wed May 31 18:33:35 2017 +0000
@@ -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
@@ -104,9 +104,7 @@
}
SSLEngineResult result;
- /* if passed in buffer was not big enough then the a reallocated buffer
- * is returned here */
- ByteBuffer buf;
+ ByteBuffer buf; // buffer containing result data
}
int app_buf_size;
--- a/jdk/src/jdk.incubator.httpclient/share/classes/jdk/incubator/http/SSLTunnelConnection.java Wed May 31 10:41:07 2017 -0700
+++ b/jdk/src/jdk.incubator.httpclient/share/classes/jdk/incubator/http/SSLTunnelConnection.java Wed May 31 18:33:35 2017 +0000
@@ -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
@@ -164,19 +164,10 @@
@Override
protected ByteBuffer readImpl() throws IOException {
- return sslDelegate.recvData(Utils.EMPTY_BYTEBUFFER).buf; // fix this, make the read normal
- }
+ ByteBuffer buf = Utils.getBuffer();
- @Override
- protected int readImpl(ByteBuffer buf) throws IOException {
WrapperResult r = sslDelegate.recvData(buf);
- // TODO: check for closure
- String s = "Receive) ";
- //debugPrint(s, r.buf);
- if (r.result.bytesProduced() > 0) {
- assert buf == r.buf;
- }
- return r.result.bytesProduced();
+ return r.buf;
}
@Override
--- a/jdk/test/java/lang/ClassLoader/Assert.java Wed May 31 10:41:07 2017 -0700
+++ b/jdk/test/java/lang/ClassLoader/Assert.java Wed May 31 18:33:35 2017 +0000
@@ -28,7 +28,7 @@
* @run main/othervm Assert
* @summary Test the assertion facility
* @author Mike McCloskey
- * @key randomness intermittent
+ * @key randomness
*/
import package1.*;
--- a/jdk/test/java/net/httpclient/whitebox/jdk.incubator.httpclient/jdk/incubator/http/ResponseHeadersTest.java Wed May 31 10:41:07 2017 -0700
+++ b/jdk/test/java/net/httpclient/whitebox/jdk.incubator.httpclient/jdk/incubator/http/ResponseHeadersTest.java Wed May 31 18:33:35 2017 +0000
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+ * 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
@@ -214,10 +214,6 @@
protected ByteBuffer readImpl() throws IOException {
throw new AssertionError("Bad test assumption: should not have reached here!");
}
- @Override
- protected int readImpl(ByteBuffer buffer) throws IOException {
- throw new AssertionError("Bad test assumption: should not have reached here!");
- }
}
public static HttpHeaders createResponseHeaders(ByteBuffer buffer)
--- a/jdk/test/java/nio/channels/Selector/SelectAndClose.java Wed May 31 10:41:07 2017 -0700
+++ b/jdk/test/java/nio/channels/Selector/SelectAndClose.java Wed May 31 18:33:35 2017 +0000
@@ -23,7 +23,6 @@
/* @test
* @bug 5004077
- * @key intermittent
* @summary Check blocking of select and close
*/
--- a/jdk/test/java/nio/channels/Selector/WakeupAfterClose.java Wed May 31 10:41:07 2017 -0700
+++ b/jdk/test/java/nio/channels/Selector/WakeupAfterClose.java Wed May 31 18:33:35 2017 +0000
@@ -24,7 +24,6 @@
/* @test
* @bug 6524172
* @summary Invoking wakeup on closed Selector can throw NPE if close resets interrupt status
- * @key intermittent
*/
import java.io.IOException;
--- a/jdk/test/javax/sound/sampled/Clip/ClipCloseLoss.java Wed May 31 10:41:07 2017 -0700
+++ b/jdk/test/javax/sound/sampled/Clip/ClipCloseLoss.java Wed May 31 18:33:35 2017 +0000
@@ -36,6 +36,7 @@
* @bug 4946913
* @summary DirectClip doesn't kill the thread correctly, sometimes
* @run main/othervm ClipCloseLoss
+ * @key intermittent
*/
public class ClipCloseLoss {
static int frameCount = 441000; // lets say 10 seconds
--- a/jdk/test/tools/launcher/ArgsEnvVar.java Wed May 31 10:41:07 2017 -0700
+++ b/jdk/test/tools/launcher/ArgsEnvVar.java Wed May 31 18:33:35 2017 +0000
@@ -23,7 +23,7 @@
/**
* @test
- * @bug 8170832
+ * @bug 8170832 8180447
* @summary Arguments passed in environment variable
* @build TestHelper
* @run main ArgsEnvVar
@@ -224,6 +224,21 @@
verifyOptions(List.of("-p", "?", "-jar", "test.jar", "one", "two"), tr);
}
+ @Test
+ public void testTrailingSpaces() {
+ env.put(JDK_JAVA_OPTIONS, "--add-exports java.base/jdk.internal.misc=ALL-UNNAMED ");
+ TestResult tr = doExec(env, javaCmd, "-jar", "test.jar");
+ verifyOptions(List.of("--add-exports", "java.base/jdk.internal.misc=ALL-UNNAMED", "-jar", "test.jar"), tr);
+
+ env.put(JDK_JAVA_OPTIONS, "--class-path ' '");
+ tr = doExec(env, javaCmd, "-jar", "test.jar");
+ verifyOptions(List.of("--class-path", " ", "-jar", "test.jar"), tr);
+
+ env.put(JDK_JAVA_OPTIONS, " --add-exports java.base/jdk.internal.misc=ALL-UNNAMED ");
+ tr = doExec(env, javaCmd, "-jar", "test.jar");
+ verifyOptions(List.of("--add-exports", "java.base/jdk.internal.misc=ALL-UNNAMED", "-jar", "test.jar"), tr);
+ }
+
public static void main(String... args) throws Exception {
init();
ArgsEnvVar a = new ArgsEnvVar();
@@ -236,4 +251,3 @@
}
}
}
-