Mercurial > hg > openjdk > jdk9 > jdk
changeset 17235:14c177bb4ea4
Merge
author | alanb |
---|---|
date | Sat, 17 Jun 2017 08:03:05 +0100 |
parents | bd582963beb7 (diff) f8b19df2115a (current diff) |
children | a59b6b3fc4dd |
files | src/java.instrument/share/classes/java/lang/instrument/package.html test/java/util/ServiceLoader/modules/BadProvidersTest.java test/java/util/ServiceLoader/modules/Basic.java test/java/util/ServiceLoader/modules/badfactories/badreturntype/ProviderFactory.java test/java/util/ServiceLoader/modules/badfactories/classnotpublic/ProviderFactory.java test/java/util/ServiceLoader/modules/badfactories/classnotpublic/Service.java test/java/util/ServiceLoader/modules/badfactories/methodnotpublic/ProviderFactory.java test/java/util/ServiceLoader/modules/badfactories/methodnotpublic/Service.java test/java/util/ServiceLoader/modules/badfactories/returnsnull/ProviderFactory.java test/java/util/ServiceLoader/modules/badfactories/returnsnull/Service.java test/java/util/ServiceLoader/modules/badfactories/throwsexception/ProviderFactory.java test/java/util/ServiceLoader/modules/badfactories/throwsexception/Service.java test/java/util/ServiceLoader/modules/badproviders/ctornotpublic/Provider.java test/java/util/ServiceLoader/modules/badproviders/ctornotpublic/Service.java test/java/util/ServiceLoader/modules/badproviders/notasubtype/Provider.java test/java/util/ServiceLoader/modules/badproviders/notpublic/Provider.java test/java/util/ServiceLoader/modules/badproviders/notpublic/Service.java test/java/util/ServiceLoader/modules/badproviders/throwsexception/Provider.java test/java/util/ServiceLoader/modules/badproviders/throwsexception/Service.java test/java/util/ServiceLoader/modules/modules/bananascript/module-info.java test/java/util/ServiceLoader/modules/modules/bananascript/org/banana/BananaScript.java test/java/util/ServiceLoader/modules/modules/bananascript/org/banana/BananaScriptEngineFactory.java test/java/util/ServiceLoader/modules/modules/test1/module-info.java test/java/util/ServiceLoader/modules/modules/test1/p/ProviderFactory.java test/java/util/ServiceLoader/modules/modules/test1/p/Service.java test/java/util/ServiceLoader/modules/modules/test2/module-info.java test/java/util/ServiceLoader/modules/modules/test2/p/Provider.java test/java/util/ServiceLoader/modules/modules/test2/p/Service.java test/java/util/ServiceLoader/modules/src/pearscript/META-INF/services/javax.script.ScriptEngineFactory test/java/util/ServiceLoader/modules/src/pearscript/org/pear/PearScript.java test/java/util/ServiceLoader/modules/src/pearscript/org/pear/PearScriptEngineFactory.java test/tools/launcher/modules/permit/AttemptAccess.java test/tools/launcher/modules/permit/PermitIllegalAccess.java |
diffstat | 102 files changed, 3892 insertions(+), 2573 deletions(-) [+] |
line wrap: on
line diff
--- a/make/ModuleTools.gmk Fri Jun 16 09:20:39 2017 -0700 +++ b/make/ModuleTools.gmk Sat Jun 17 08:03:05 2017 +0100 @@ -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/make/src/classes/build/tools/docs/GenDocsBundlePage.java Fri Jun 16 09:20:39 2017 -0700 +++ /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/make/src/classes/build/tools/docs/docs-bundle-page.html Fri Jun 16 09:20:39 2017 -0700 +++ /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/make/src/classes/build/tools/docs/docs-module-groups.properties Fri Jun 16 09:20:39 2017 -0700 +++ /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/src/java.base/share/classes/java/io/File.java Fri Jun 16 09:20:39 2017 -0700 +++ b/src/java.base/share/classes/java/io/File.java Sat Jun 17 08:03:05 2017 +0100 @@ -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/src/java.base/share/classes/java/lang/invoke/VarHandle.java Fri Jun 16 09:20:39 2017 -0700 +++ b/src/java.base/share/classes/java/lang/invoke/VarHandle.java Sat Jun 17 08:03:05 2017 +0100 @@ -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/src/java.base/share/classes/java/util/Deque.java Fri Jun 16 09:20:39 2017 -0700 +++ b/src/java.base/share/classes/java/util/Deque.java Sat Jun 17 08:03:05 2017 +0100 @@ -72,24 +72,24 @@ * </tr> * <tr> * <td><b>Insert</b></td> - * <td>{@link Deque#addFirst addFirst(e)}</td> - * <td>{@link Deque#offerFirst offerFirst(e)}</td> - * <td>{@link Deque#addLast addLast(e)}</td> - * <td>{@link Deque#offerLast offerLast(e)}</td> + * <td>{@link #addFirst(Object) addFirst(e)}</td> + * <td>{@link #offerFirst(Object) offerFirst(e)}</td> + * <td>{@link #addLast(Object) addLast(e)}</td> + * <td>{@link #offerLast(Object) offerLast(e)}</td> * </tr> * <tr> * <td><b>Remove</b></td> - * <td>{@link Deque#removeFirst removeFirst()}</td> - * <td>{@link Deque#pollFirst pollFirst()}</td> - * <td>{@link Deque#removeLast removeLast()}</td> - * <td>{@link Deque#pollLast pollLast()}</td> + * <td>{@link #removeFirst() removeFirst()}</td> + * <td>{@link #pollFirst() pollFirst()}</td> + * <td>{@link #removeLast() removeLast()}</td> + * <td>{@link #pollLast() pollLast()}</td> * </tr> * <tr> * <td><b>Examine</b></td> - * <td>{@link Deque#getFirst getFirst()}</td> - * <td>{@link Deque#peekFirst peekFirst()}</td> - * <td>{@link Deque#getLast getLast()}</td> - * <td>{@link Deque#peekLast peekLast()}</td> + * <td>{@link #getFirst() getFirst()}</td> + * <td>{@link #peekFirst() peekFirst()}</td> + * <td>{@link #getLast() getLast()}</td> + * <td>{@link #peekLast() peekLast()}</td> * </tr> * </table> * @@ -106,28 +106,28 @@ * <td style="text-align:center"> <b>Equivalent {@code Deque} Method</b></td> * </tr> * <tr> - * <td>{@link java.util.Queue#add add(e)}</td> - * <td>{@link #addLast addLast(e)}</td> + * <td>{@link #add(Object) add(e)}</td> + * <td>{@link #addLast(Object) addLast(e)}</td> * </tr> * <tr> - * <td>{@link java.util.Queue#offer offer(e)}</td> - * <td>{@link #offerLast offerLast(e)}</td> + * <td>{@link #offer(Object) offer(e)}</td> + * <td>{@link #offerLast(Object) offerLast(e)}</td> * </tr> * <tr> - * <td>{@link java.util.Queue#remove remove()}</td> - * <td>{@link #removeFirst removeFirst()}</td> + * <td>{@link #remove() remove()}</td> + * <td>{@link #removeFirst() removeFirst()}</td> * </tr> * <tr> - * <td>{@link java.util.Queue#poll poll()}</td> - * <td>{@link #pollFirst pollFirst()}</td> + * <td>{@link #poll() poll()}</td> + * <td>{@link #pollFirst() pollFirst()}</td> * </tr> * <tr> - * <td>{@link java.util.Queue#element element()}</td> - * <td>{@link #getFirst getFirst()}</td> + * <td>{@link #element() element()}</td> + * <td>{@link #getFirst() getFirst()}</td> * </tr> * <tr> - * <td>{@link java.util.Queue#peek peek()}</td> - * <td>{@link #peek peekFirst()}</td> + * <td>{@link #peek() peek()}</td> + * <td>{@link #peekFirst() peekFirst()}</td> * </tr> * </table> * @@ -144,16 +144,16 @@ * <td style="text-align:center"> <b>Equivalent {@code Deque} Method</b></td> * </tr> * <tr> - * <td>{@link #push push(e)}</td> - * <td>{@link #addFirst addFirst(e)}</td> + * <td>{@link #push(Object) push(e)}</td> + * <td>{@link #addFirst(Object) addFirst(e)}</td> * </tr> * <tr> - * <td>{@link #pop pop()}</td> - * <td>{@link #removeFirst removeFirst()}</td> + * <td>{@link #pop() pop()}</td> + * <td>{@link #removeFirst() removeFirst()}</td> * </tr> * <tr> - * <td>{@link #peek peek()}</td> - * <td>{@link #peekFirst peekFirst()}</td> + * <td>{@link #peek() peek()}</td> + * <td>{@link #peekFirst() peekFirst()}</td> * </tr> * </table> * @@ -430,8 +430,8 @@ /** * Retrieves and removes the head of the queue represented by this deque * (in other words, the first element of this deque). - * This method differs from {@link #poll poll} only in that it throws an - * exception if this deque is empty. + * This method differs from {@link #poll() poll()} only in that it + * throws an exception if this deque is empty. * * <p>This method is equivalent to {@link #removeFirst()}. * @@ -477,6 +477,31 @@ */ E peek(); + /** + * Adds all of the elements in the specified collection at the end + * of this deque, as if by calling {@link #addLast} on each one, + * in the order that they are returned by the collection's iterator. + * + * <p>When using a capacity-restricted deque, it is generally preferable + * to call {@link #offer(Object) offer} separately on each element. + * + * <p>An exception encountered while trying to add an element may result + * in only some of the elements having been successfully added when + * the associated exception is thrown. + * + * @param c the elements to be inserted into this deque + * @return {@code true} if this deque changed as a result of the call + * @throws IllegalStateException if not all the elements can be added at + * this time due to insertion restrictions + * @throws ClassCastException if the class of an element of the specified + * collection prevents it from being added to this deque + * @throws NullPointerException if the specified collection contains a + * null element and this deque does not permit null elements, + * or if the specified collection is null + * @throws IllegalArgumentException if some property of an element of the + * specified collection prevents it from being added to this deque + */ + boolean addAll(Collection<? extends E> c); // *** Stack methods ***
--- a/src/java.base/share/classes/java/util/concurrent/atomic/AtomicInteger.java Fri Jun 16 09:20:39 2017 -0700 +++ b/src/java.base/share/classes/java/util/concurrent/atomic/AtomicInteger.java Sat Jun 17 08:03:05 2017 +0100 @@ -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/src/java.base/share/classes/java/util/concurrent/atomic/AtomicIntegerArray.java Fri Jun 16 09:20:39 2017 -0700 +++ b/src/java.base/share/classes/java/util/concurrent/atomic/AtomicIntegerArray.java Sat Jun 17 08:03:05 2017 +0100 @@ -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/src/java.base/share/classes/java/util/concurrent/atomic/AtomicIntegerFieldUpdater.java Fri Jun 16 09:20:39 2017 -0700 +++ b/src/java.base/share/classes/java/util/concurrent/atomic/AtomicIntegerFieldUpdater.java Sat Jun 17 08:03:05 2017 +0100 @@ -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/src/java.base/share/classes/java/util/concurrent/atomic/AtomicLong.java Fri Jun 16 09:20:39 2017 -0700 +++ b/src/java.base/share/classes/java/util/concurrent/atomic/AtomicLong.java Sat Jun 17 08:03:05 2017 +0100 @@ -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/src/java.base/share/classes/java/util/concurrent/atomic/AtomicLongArray.java Fri Jun 16 09:20:39 2017 -0700 +++ b/src/java.base/share/classes/java/util/concurrent/atomic/AtomicLongArray.java Sat Jun 17 08:03:05 2017 +0100 @@ -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/src/java.base/share/classes/java/util/concurrent/atomic/AtomicLongFieldUpdater.java Fri Jun 16 09:20:39 2017 -0700 +++ b/src/java.base/share/classes/java/util/concurrent/atomic/AtomicLongFieldUpdater.java Sat Jun 17 08:03:05 2017 +0100 @@ -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/src/java.base/share/classes/java/util/concurrent/atomic/AtomicReference.java Fri Jun 16 09:20:39 2017 -0700 +++ b/src/java.base/share/classes/java/util/concurrent/atomic/AtomicReference.java Sat Jun 17 08:03:05 2017 +0100 @@ -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/src/java.base/share/classes/java/util/concurrent/atomic/AtomicReferenceArray.java Fri Jun 16 09:20:39 2017 -0700 +++ b/src/java.base/share/classes/java/util/concurrent/atomic/AtomicReferenceArray.java Sat Jun 17 08:03:05 2017 +0100 @@ -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/src/java.base/share/classes/java/util/concurrent/atomic/AtomicReferenceFieldUpdater.java Fri Jun 16 09:20:39 2017 -0700 +++ b/src/java.base/share/classes/java/util/concurrent/atomic/AtomicReferenceFieldUpdater.java Sat Jun 17 08:03:05 2017 +0100 @@ -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
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/java.base/share/classes/java/util/doc-files/coll-designfaq.html Sat Jun 17 08:03:05 2017 +0100 @@ -0,0 +1,399 @@ +<?xml version="1.0" encoding="utf-8"?> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" + "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> + +<!-- + Copyright (c) 1998, 2017, Oracle and/or its affiliates. All rights reserved. + DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + + This code is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License version 2 only, as + published by the Free Software Foundation. Oracle designates this + particular file as subject to the "Classpath" exception as provided + by Oracle in the LICENSE file that accompanied this code. + + This code is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + version 2 for more details (a copy is included in the LICENSE file that + accompanied this code). + + You should have received a copy of the GNU General Public License version + 2 along with this work; if not, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + + Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + or visit www.oracle.com if you need additional information or have any + questions. +--> + +<html lang="en-US" xmlns="http://www.w3.org/1999/xhtml" xml:lang= +"en-US"> +<head> +<title>Java Collections API Design FAQ</title> +</head> +<body> +<h2>Java Collections API Design FAQ</h2> +<!-- Body text begins here --> +<hr /> +This document answers frequently asked questions concerning the +design of the Java collections framework. It is derived from the +large volume of traffic on the collections-comments alias. It +serves as a design rationale for the collections framework. +<h3>Core Interfaces - General Questions</h3> +<ol> +<li><a href="#a1"><b>Why don't you support immutability directly in +the core collection interfaces so that you can do away with +<em>optional operations</em> (and +UnsupportedOperationException)?</b></a></li> +<li><a href="#a2"><b>Won't programmers have to surround any code +that calls optional operations with a try-catch clause in case they +throw an UnsupportedOperationException?</b></a></li> +<li><a href="#a3"><b>Why isn't there a core interface for "bags" +(AKA multisets)?</b></a></li> +<li><a href="#a28"><b>Why didn't you use "Beans-style names" for +consistency?</b></a></li> +</ol> +<h3>Collection Interface</h3> +<ol> +<li><a href="#a5"><b>Why doesn't Collection extend Cloneable and +Serializable?</b></a></li> +<li><a href="#a6"><b>Why don't you provide an "apply" method in +Collection to apply a given method ("upcall") to all the elements +of the Collection?</b></a></li> +<li><a href="#a7"><b>Why didn't you provide a "Predicate" interface, +and related methods (e.g., a method to find the first element in +the Collection satisfying the predicate)?</b></a></li> +<li><a href="#a8"><b>Why don't you provide a form of the addAll +method that takes an Enumeration (or an Iterator)?</b></a></li> +<li><a href="#a9"><b>Why don't the concrete implementations in the +JDK have Enumeration (or Iterator) constructors?</b></a></li> +<li><a href="#a10"><b>Why don't you provide an Iterator.add +method?</b></a></li> +</ol> +<h3>List Interface</h3> +<ol> +<li><a href="#a11"><b>Why don't you rename the List interface to +Sequence; doesn't "list" generally suggest "linked list"? Also, +doesn't it conflict with java.awt.List?</b></a></li> +<li><a href="#a12"><b>Why don't you rename List's set method to +replace, to avoid confusion with Set.</b></a></li> +</ol> +<h3>Map Interface</h3> +<ol> +<li><a href="#a14"><b>Why doesn't Map extend +Collection?</b></a></li> +</ol> +<h3>Iterator Interface</h3> +<ol> +<li><a href="#a18"><b>Why doesn't Iterator extend +Enumeration?</b></a></li> +<li><a href="#a19"><b>Why don't you provide an Iterator.peek method +that allows you to look at the next element in an iteration without +advancing the iterator?</b></a></li> +</ol> +<h3>Miscellaneous</h3> +<ol> +<li><a href="#a23"><b>Why did you write a new collections framework +instead of adopting JGL (a preexisting collections package from +ObjectSpace, Inc.) into the JDK?</b></a></li> +<li><a href="#a26"><b>Why don't you eliminate all of the methods and +classes that return "views" (Collections backed by other +collection-like objects). This would greatly reduce +aliasing.</b></a></li> +<li><a href="#a27"><b>Why don't you provide for "observable" +collections that send out Events when they're +modified?</b></a></li> +</ol> +<hr size="3" noshade="noshade" /> +<h3>Core Interfaces - General Questions</h3> +<ol> +<li><a name="a1" id="a1"><b>Why don't you support immutability +directly in the core collection interfaces so that you can do away +with <em>optional operations</em> (and +UnsupportedOperationException)?</b></a> +<p>This is the most controversial design decision in the whole API. +Clearly, static (compile time) type checking is highly desirable, +and is the norm in Java. We would have supported it if we believed +it were feasible. Unfortunately, attempts to achieve this goal +cause an explosion in the size of the interface hierarchy, and do +not succeed in eliminating the need for runtime exceptions (though +they reduce it substantially).</p> +<p>Doug Lea, who wrote a popular Java collections package that did +reflect mutability distinctions in its interface hierarchy, no +longer believes it is a viable approach, based on user experience +with his collections package. In his words (from personal +correspondence) "Much as it pains me to say it, strong static +typing does not work for collection interfaces in Java."</p> +<p>To illustrate the problem in gory detail, suppose you want to +add the notion of modifiability to the Hierarchy. You need four new +interfaces: ModifiableCollection, ModifiableSet, ModifiableList, +and ModifiableMap. What was previously a simple hierarchy is now a +messy heterarchy. Also, you need a new Iterator interface for use +with unmodifiable Collections, that does not contain the remove +operation. Now can you do away with UnsupportedOperationException? +Unfortunately not.</p> +<p>Consider arrays. They implement most of the List operations, but +not remove and add. They are "fixed-size" Lists. If you want to +capture this notion in the hierarchy, you have to add two new +interfaces: VariableSizeList and VariableSizeMap. You don't have to +add VariableSizeCollection and VariableSizeSet, because they'd be +identical to ModifiableCollection and ModifiableSet, but you might +choose to add them anyway for consistency's sake. Also, you need a +new variety of ListIterator that doesn't support the add and remove +operations, to go along with unmodifiable List. Now we're up to ten +or twelve interfaces, plus two new Iterator interfaces, instead of +our original four. Are we done? No.</p> +<p>Consider logs (such as error logs, audit logs and journals for +recoverable data objects). They are natural append-only sequences, +that support all of the List operations except for remove and set +(replace). They require a new core interface, and a new +iterator.</p> +<p>And what about immutable Collections, as opposed to unmodifiable +ones? (i.e., Collections that cannot be changed by the client AND +will never change for any other reason). Many argue that this is +the most important distinction of all, because it allows multiple +threads to access a collection concurrently without the need for +synchronization. Adding this support to the type hierarchy requires +four more interfaces.</p> +<p>Now we're up to twenty or so interfaces and five iterators, and +it's almost certain that there are still collections arising in +practice that don't fit cleanly into any of the interfaces. For +example, the <em>collection-views</em> returned by Map are natural +delete-only collections. Also, there are collections that will +reject certain elements on the basis of their value, so we still +haven't done away with runtime exceptions.</p> +<p>When all was said and done, we felt that it was a sound +engineering compromise to sidestep the whole issue by providing a +very small set of core interfaces that can throw a runtime +exception.</p> +</li> +<li><a name="a2" id="a2"><b>Won't programmers have to surround any +code that calls optional operations with a try-catch clause in case +they throw an UnsupportedOperationException?</b></a> +<p>It was never our intention that programs should catch these +exceptions: that's why they're unchecked (runtime) exceptions. They +should only arise as a result of programming errors, in which case, +your program will halt due to the uncaught exception.</p> +</li> +<li><a name="a3" id="a3"><b>Why isn't there a core interface for +"bags" (AKA multisets)?</b></a> +<p>The Collection interface provides this functionality. We are not +providing any public implementations of this interface, as we think +that it wouldn't be used frequently enough to "pull its weight." We +occasionally return such Collections, which are implemented easily +atop AbstractCollection (for example, the Collection returned by +Map.values).</p> +</li> +<li><a name="a28" id="a28"><b>Why didn't you use "Beans-style +names" for consistency?</b></a> +<p>While the names of the new collections methods do not adhere to +the "Beans naming conventions", we believe that they are +reasonable, consistent and appropriate to their purpose. It should +be remembered that the Beans naming conventions do not apply to the +JDK as a whole; the AWT did adopt these conventions, but that +decision was somewhat controversial. We suspect that the +collections APIs will be used quite pervasively, often with +multiple method calls on a single line of code, so it is important +that the names be short. Consider, for example, the Iterator +methods. Currently, a loop over a collection looks like this:</p> +<pre> + for (Iterator i = c.iterator(); i.hasNext(); ) + System.out.println(i.next()); +</pre> +Everything fits neatly on one line, even if the Collection name is +a long expression. If we named the methods "getIterator", +"hasNextElement" and "getNextElement", this would no longer be the +case. Thus, we adopted the "traditional" JDK style rather than the +Beans style.</li> +</ol> +<hr /> +<h3>Collection Interface</h3> +<ol> +<li><a name="a5" id="a5"><b>Why doesn't Collection extend Cloneable +and Serializable?</b></a> +<p>Many Collection implementations (including all of the ones +provided by the JDK) will have a public clone method, but it would +be mistake to require it of all Collections. For example, what does +it mean to clone a Collection that's backed by a terabyte SQL +database? Should the method call cause the company to requisition a +new disk farm? Similar arguments hold for serializable.</p> +<p>If the client doesn't know the actual type of a Collection, it's +much more flexible and less error prone to have the client decide +what type of Collection is desired, create an empty Collection of +this type, and use the addAll method to copy the elements of the +original collection into the new one.</p> +</li> +<li><a name="a6" id="a6"><b>Why don't you provide an "apply" method +in Collection to apply a given method ("upcall") to all the +elements of the Collection?</b></a> +<p>This is what is referred to as an "Internal Iterator" in the +"Design Patterns" book (Gamma et al.). We considered providing it, +but decided not to as it seems somewhat redundant to support +internal and external iterators, and Java already has a precedent +for external iterators (with Enumerations). The "throw weight" of +this functionality is increased by the fact that it requires a +public interface to describe upcalls.</p> +</li> +<li><a name="a7" id="a7"><b>Why didn't you provide a "Predicate" +interface, and related methods (e.g., a method to find the first +element in the Collection satisfying the predicate)?</b></a> +<p>It's easy to implement this functionality atop Iterators, and +the resulting code may actually look cleaner as the user can inline +the predicate. Thus, it's not clear whether this facility pulls its +weight. It could be added to the Collections class at a later date +(implemented atop Iterator), if it's deemed useful.</p> +</li> +<li><a name="a8" id="a8"><b>Why don't you provide a form of the +addAll method that takes an Enumeration (or an Iterator)?</b></a> +<p>Because we don't believe in using Enumerations (or Iterators) as +"poor man's collections." This was occasionally done in prior +releases, but now that we have the Collection interface, it is the +preferred way to pass around abstract collections of objects.</p> +</li> +<li><a name="a9" id="a9"><b>Why don't the concrete implementations +in the JDK have Enumeration (or Iterator) constructors?</b></a> +<p>Again, this is an instance of an Enumeration serving as a "poor +man's collection" and we're trying to discourage that. Note +however, that we strongly suggest that all concrete implementations +should have constructors that take a Collection (and create a new +Collection with the same elements).</p> +</li> +<li><a name="a10" id="a10"><b>Why don't you provide an Iterator.add +method?</b></a> +<p>The semantics are unclear, given that the contract for Iterator +makes no guarantees about the order of iteration. Note, however, +that ListIterator does provide an add operation, as it does +guarantee the order of the iteration.</p> +</li> +</ol> +<hr /> +<h3>List Interface</h3> +<ol> +<li><a name="a11" id="a11"><b>Why don't you rename the List +interface to Sequence; doesn't "list" generally suggest "linked +list"? Also, doesn't it conflict with java.awt.List?</b></a> +<p>People were evenly divided as to whether List suggests linked +lists. Given the implementation naming convention, +<<em>Implementation</em>><<em>Interface</em>>, there +was a strong desire to keep the core interface names short. Also, +several existing names (AbstractSequentialList, LinkedList) would +have been decidedly worse if we changed List to Sequence. The +naming conflict can be dealt with by the following incantation:</p> +<pre> + import java.util.*; + import java.awt.*; + import java.util.List; // Dictates interpretation of "List" +</pre></li> +<li><a name="a12" id="a12"><b>Why don't you rename List's set +method to replace, to avoid confusion with Set.</b></a> +<p>It was decided that the "set/get" naming convention was strongly +enough enshrined in the language that we'd stick with it.</p> +</li> +</ol> +<hr /> +<h3>Map Interface</h3> +<ol> +<li><a name="a14" id="a14"><b>Why doesn't Map extend +Collection?</b></a> +<p>This was by design. We feel that mappings are not collections +and collections are not mappings. Thus, it makes little sense for +Map to extend the Collection interface (or vice versa).</p> +<p>If a Map is a Collection, what are the elements? The only +reasonable answer is "Key-value pairs", but this provides a very +limited (and not particularly useful) Map abstraction. You can't +ask what value a given key maps to, nor can you delete the entry +for a given key without knowing what value it maps to.</p> +<p>Collection could be made to extend Map, but this raises the +question: what are the keys? There's no really satisfactory answer, +and forcing one leads to an unnatural interface.</p> +<p>Maps can be <em>viewed</em> as Collections (of keys, values, or +pairs), and this fact is reflected in the three "Collection view +operations" on Maps (keySet, entrySet, and values). While it is, in +principle, possible to view a List as a Map mapping indices to +elements, this has the nasty property that deleting an element from +the List changes the Key associated with every element before the +deleted element. That's why we don't have a map view operation on +Lists.</p> +</li> +</ol> +<hr /> +<h3>Iterator Interface</h3> +<ol> +<li><a name="a18" id="a18"><b>Why doesn't Iterator extend +Enumeration?</b></a> +<p>We view the method names for Enumeration as unfortunate. They're +very long, and very frequently used. Given that we were adding a +method and creating a whole new framework, we felt that it would be +foolish not to take advantage of the opportunity to improve the +names. Of course we could support the new and old names in +Iterator, but it doesn't seem worthwhile.</p> +</li> +<li><a name="a19" id="a19"><b>Why don't you provide an +Iterator.peek method that allows you to look at the next element in +an iteration without advancing the iterator?</b></a> +<p>It can be implemented atop the current Iterators (a similar +pattern to java.io.PushbackInputStream). We believe that its use +would be rare enough that it isn't worth including in the interface +that everyone has to implement.</p> +</li> +</ol> +<hr /> +<h3>Miscellaneous</h3> +<ol> +<li><a name="a23" id="a23"><b>Why did you write a new collections +framework instead of adopting JGL (a preexisting collections +package from ObjectSpace, Inc.) into the JDK?</b></a> +<p>If you examine the goals for our Collections framework (in the +Overview), you'll see that we are not really "playing in the same +space" as JGL. Quoting from the "Design Goals" Section of the Java +Collections Overview: "Our main design goal was to produce an API +that was reasonably small, both in size, and (more importantly) in +'conceptual weight.'"</p> +<p>JGL consists of approximately 130 classes and interfaces; its +main goal was consistency with the C++ Standard Template Library +(STL). This was <em>not</em> one of our goals. Java has +traditionally stayed away from C++'s more complex features (e.g., +multiple inheritance, operator overloading). Our entire framework, +including all infrastructure, contains approximately 25 classes and +interfaces.</p> +<p>While this may cause some discomfort for some C++ programmers, +we feel that it will be good for Java in the long run. As the Java +libraries mature, they inevitably grow, but we are trying as hard +as we can to keep them small and manageable, so that Java continues +to be an easy, fun language to learn and to use.</p> +</li> +<li><a name="a26" id="a26"><b>Why don't you eliminate all of the +methods and classes that return "views" (Collections backed by +other collection-like objects). This would greatly reduce +aliasing.</b></a> +<p>Given that we provide core collection interfaces behind which +programmers can "hide" their own implementations, there will be +aliased collections whether the JDK provides them or not. +Eliminating all views from the JDK would greatly increase the cost +of common operations like making a Collection out of an array, and +would do away with many useful facilities (like synchronizing +wrappers). One view that we see as being particularly useful is +<a href= +"../List.html#subList-int-int-">List.subList</a>. +The existence of this method means that people who write methods +taking List on input do not have to write secondary forms taking an +offset and a length (as they do for arrays).</p> +</li> +<li><a name="a27" id="a27"><b>Why don't you provide for +"observable" collections that send out Events when they're +modified?</b></a> +<p>Primarily, resource constraints. If we're going to commit to +such an API, it has to be something that works for everyone, that +we can live with for the long haul. We may provide such a facility +some day. In the meantime, it's not difficult to implement such a +facility on top of the public APIs.</p> +</li> +</ol> +<hr /> +<p style="font-size:smaller"> +Copyright © 1998, 2017, Oracle and/or its affiliates. 500 Oracle Parkway<br /> + Redwood Shores, CA 94065 USA. All rights reserved.</p> +<!-- Body text ends here --> +</body> +</html>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/java.base/share/classes/java/util/doc-files/coll-index.html Sat Jun 17 08:03:05 2017 +0100 @@ -0,0 +1,80 @@ +<?xml version="1.0" encoding="utf-8"?> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" + "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> + +<!-- + Copyright (c) 1998, 2017, Oracle and/or its affiliates. All rights reserved. + DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + + This code is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License version 2 only, as + published by the Free Software Foundation. Oracle designates this + particular file as subject to the "Classpath" exception as provided + by Oracle in the LICENSE file that accompanied this code. + + This code is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + version 2 for more details (a copy is included in the LICENSE file that + accompanied this code). + + You should have received a copy of the GNU General Public License version + 2 along with this work; if not, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + + Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + or visit www.oracle.com if you need additional information or have any + questions. +--> + +<html lang="en-US" xmlns="http://www.w3.org/1999/xhtml" xml:lang= +"en-US"> +<head> +<meta name="generator" content="HTML Tidy, see www.w3.org" /> +<title>The Collections Framework</title> + +<style type="text/css"> +/*<![CDATA[*/ + +ul li, ul ul li {font-weight: normal;} +pre {margin-left: 42pt;} +a {font-weight: bold;} + +/*]]>*/ +</style> +</head> +<body> +<h1>The Collections Framework</h1> +<!-- Body text begins here --> +<p>The collections framework is a unified architecture for +representing and manipulating collections, enabling them to be +manipulated independently of the details of their representation. +It reduces programming effort while increasing performance. It +enables interoperability among unrelated APIs, reduces effort in +designing and learning new APIs, and fosters software reuse. The +framework is based on more than a dozen collection interfaces. It +includes implementations of these interfaces and algorithms to +manipulate them.</p> +<p>The documents in this section are non-normative portions of +the Java™ Platform, Standard Edition API Specification.</p> +<ul> +<li><b><a href="coll-overview.html">Overview</a></b> - An overview of +the collections framework.</li> +</ul> +<ul> +<li><b><a href="coll-reference.html">Annotated API Outline</a></b> - An +annotated outline of the classes and interfaces comprising the +collections framework, with links into the API Specification.</li> +</ul> +<ul> +<li><b><a href="coll-designfaq.html">Design FAQ</a></b> - Answers to +frequently asked questions (FAQ) about the design of the +collections framework.</li> +</ul> +<hr /> +<p style="font-size:smaller"> +Copyright © 1998, 2017, Oracle and/or its affiliates. 500 Oracle Parkway<br /> + Redwood Shores, CA 94065 USA. All rights reserved.</p> +<!-- Body text ends here --> +</body> +</html>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/java.base/share/classes/java/util/doc-files/coll-overview.html Sat Jun 17 08:03:05 2017 +0100 @@ -0,0 +1,359 @@ +<?xml version="1.0" encoding="utf-8"?> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" + "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> + +<!-- + Copyright (c) 1998, 2017, Oracle and/or its affiliates. All rights reserved. + DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + + This code is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License version 2 only, as + published by the Free Software Foundation. Oracle designates this + particular file as subject to the "Classpath" exception as provided + by Oracle in the LICENSE file that accompanied this code. + + This code is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + version 2 for more details (a copy is included in the LICENSE file that + accompanied this code). + + You should have received a copy of the GNU General Public License version + 2 along with this work; if not, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + + Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + or visit www.oracle.com if you need additional information or have any + questions. +--> + +<html lang="en-US" xmlns="http://www.w3.org/1999/xhtml" xml:lang= +"en-US"> +<head> +<title>Collections Framework Overview</title> +</head> +<body> +<h1>Collections Framework Overview</h1> +<!-- Body text begins here --> +<h2>Introduction</h2> +The Java platform includes a <i>collections framework</i>. A +<i>collection</i> is an object that represents a group of objects +(such as the classic <a href="../ArrayList.html">ArrayList</a> class). +A collections framework is a unified architecture for representing +and manipulating collections, enabling collections to be +manipulated independently of implementation details. +<p>The primary advantages of a collections framework are that +it:</p> +<ul> +<li><strong>Reduces programming effort</strong> by providing data +structures and algorithms so you don't have to write them +yourself.</li> +<li><strong>Increases performance</strong> by providing +high-performance implementations of data structures and algorithms. +Because the various implementations of each interface are +interchangeable, programs can be tuned by switching +implementations.</li> +<li><strong>Provides interoperability between unrelated +APIs</strong> by establishing a common language to pass collections +back and forth.</li> +<li><strong>Reduces the effort required to learn APIs</strong> by +requiring you to learn multiple ad hoc collection APIs.</li> +<li><strong>Reduces the effort required to design and implement +APIs</strong> by not requiring you to produce ad hoc collections +APIs.</li> +<li><strong>Fosters software reuse</strong> by providing a standard +interface for collections and algorithms with which to manipulate +them.</li> +</ul> +<p>The collections framework consists of:</p> +<ul> +<li><strong>Collection interfaces</strong>. Represent different +types of collections, such as sets, lists, and maps. These +interfaces form the basis of the framework.</li> +<li><strong>General-purpose implementations</strong>. Primary +implementations of the collection interfaces.</li> +<li><strong>Legacy implementations</strong>. The collection classes +from earlier releases, <tt>Vector</tt> and <tt>Hashtable</tt>, were +retrofitted to implement the collection interfaces.</li> +<li><strong>Special-purpose implementations</strong>. +Implementations designed for use in special situations. These +implementations display nonstandard performance characteristics, +usage restrictions, or behavior.</li> +<li><strong>Concurrent implementations</strong>. Implementations +designed for highly concurrent use.</li> +<li><strong>Wrapper implementations</strong>. Add functionality, +such as synchronization, to other implementations.</li> +<li><strong>Convenience implementations</strong>. High-performance +"mini-implementations" of the collection interfaces.</li> +<li><strong>Abstract implementations</strong>. Partial +implementations of the collection interfaces to facilitate custom +implementations.</li> +<li><strong>Algorithms</strong>. Static methods that perform useful +functions on collections, such as sorting a list.</li> +<li><strong>Infrastructure</strong>. Interfaces that provide +essential support for the collection interfaces.</li> +<li><strong>Array Utilities</strong>. Utility functions for arrays +of primitive types and reference objects. Not, strictly speaking, a +part of the collections framework, this feature was added to the +Java platform at the same time as the collections framework and +relies on some of the same infrastructure.</li> +</ul> +<hr /> +<h2>Collection Interfaces</h2> +<p>The <i>collection interfaces</i> are divided into two groups. +The most basic interface, <tt><a href= +"../Collection.html">java.util.Collection</a></tt>, +has the following descendants:</p> +<ul> +<li><tt><a href= +"../Set.html">java.util.Set</a></tt></li> +<li><tt><a href= +"../SortedSet.html">java.util.SortedSet</a></tt></li> +<li><tt><a href= +"../NavigableSet.html">java.util.NavigableSet</a></tt></li> +<li><tt><a href= +"../Queue.html">java.util.Queue</a></tt></li> +<li><tt><a href= +"../concurrent/BlockingQueue.html">java.util.concurrent.BlockingQueue</a></tt></li> +<li><tt><a href= +"../concurrent/TransferQueue.html">java.util.concurrent.TransferQueue</a></tt></li> +<li><tt><a href= +"../Deque.html">java.util.Deque</a></tt></li> +<li><tt><a href= +"../concurrent/BlockingDeque.html">java.util.concurrent.BlockingDeque</a></tt></li> +</ul> +<p>The other collection interfaces are based on <tt><a href= +"../Map.html">java.util.Map</a></tt> and are +not true collections. However, these interfaces contain +<i>collection-view</i> operations, which enable them to be +manipulated as collections. <tt>Map</tt> has the following +offspring:</p> +<ul> +<li><tt><a href= +"../SortedMap.html">java.util.SortedMap</a></tt></li> +<li><tt><a href= +"../NavigableMap.html">java.util.NavigableMap</a></tt></li> +<li><tt><a href= +"../concurrent/ConcurrentMap.html">java.util.concurrent.ConcurrentMap</a></tt></li> +<li><tt><a href= +"../concurrent/ConcurrentNavigableMap.html">java.util.concurrent.ConcurrentNavigableMap</a></tt></li> +</ul> +<p>Many of the modification methods in the collection interfaces +are labeled <i>optional</i>. Implementations are permitted to not +perform one or more of these operations, throwing a runtime +exception (<tt>UnsupportedOperationException</tt>) if they are +attempted. The documentation for each implementation must specify +which optional operations are supported. Several terms are +introduced to aid in this specification:</p> +<ul> +<li>Collections that do not support modification operations (such +as <tt>add</tt>, <tt>remove</tt> and <tt>clear</tt>) are referred +to as <i>unmodifiable</i>. Collections that are not unmodifiable +are <i>modifiable.</i></li> +<li>Collections that additionally guarantee that no change in the +<tt>Collection</tt> object will be visible are referred to as +<i>immutable</i>. Collections that are not immutable are +<i>mutable</i>.</li> +<li>Lists that guarantee that their size remains constant even +though the elements can change are referred to as +<i>fixed-size</i>. Lists that are not fixed-size are referred to as +<i>variable-size</i>.</li> +<li>Lists that support fast (generally constant time) indexed +element access are known as <i>random access</i> lists. Lists that +do not support fast indexed element access are known as +<i>sequential access</i> lists. The <tt><a href= +"../RandomAccess.html">RandomAccess</a></tt> +marker interface enables lists to advertise the fact that they +support random access. This enables generic algorithms to change +their behavior to provide good performance when applied to either +random or sequential access lists.</li> +</ul> +<p>Some implementations restrict what elements (or in the case of +<tt>Maps</tt>, keys and values) can be stored. Possible +restrictions include requiring elements to:</p> +<ul> +<li>Be of a particular type.</li> +<li>Be not null.</li> +<li>Obey some arbitrary predicate.</li> +</ul> +<p>Attempting to add an element that violates an implementation's +restrictions results in a runtime exception, typically a +<tt>ClassCastException</tt>, an <tt>IllegalArgumentException</tt>, +or a <tt>NullPointerException</tt>. Attempting to remove or test +for the presence of an element that violates an implementation's +restrictions can result in an exception. Some restricted +collections permit this usage.</p> +<hr /> +<h2>Collection Implementations</h2> +<p>Classes that implement the collection interfaces typically have +names in the form of +<<em>Implementation-style</em>><<em>Interface</em>>. +The general purpose implementations are summarized in the following +table:</p> +<table border="2" summary= +"general purpose implementations and interfaces" align="center"> +<thead> +<tr> +<th id="interfaces">Interface</th> +<th id="hashtable">Hash Table</th> +<th id="resizablearray">Resizable Array</th> +<th id="balancedtree">Balanced Tree</th> +<th id="linkedlist">Linked List</th> +<th id="hashtableandlinkedlist">Hash Table + Linked List</th> +</tr> +<tr> +<td headers="interfaces"><code>Set</code></td> +<td headers="hashtable"><a href= +"../HashSet.html"><tt>HashSet</tt></a></td> +<td headers="resizablearray"> </td> +<td headers="balancedtree"><a href= +"../TreeSet.html"><tt>TreeSet</tt></a></td> +<td headers="linkedlist"> </td> +<td headers="hashtableandlinkedlist"><a href= +"../LinkedHashSet.html"><tt>LinkedHashSet</tt></a></td> +</tr> +<tr> +<td headers="interfaces"><code>List</code></td> +<td headers="hashtable"> </td> +<td headers="resizablearray"><a href= +"../ArrayList.html"><tt>ArrayList</tt></a></td> +<td headers="balancedtree"> </td> +<td headers="linkedlist"><a href= +"../LinkedList.html"><tt>LinkedList</tt></a></td> +<td headers="hashtableandlinkedlist"> </td> +</tr> +<tr> +<td headers="interfaces"><code>Deque</code></td> +<td headers="hashtable"> </td> +<td headers="resizablearray"><a href= +"../ArrayDeque.html"><tt>ArrayDeque</tt></a></td> +<td headers="balancedtree"> </td> +<td headers="linkedlist"><a href= +"../LinkedList.html"><tt>LinkedList</tt></a></td> +<td headers="hashtableandlinkedlist"> </td> +</tr> +<tr> +<td headers="interfaces"><code>Map</code></td> +<td headers="hashtable"><a href= +"../HashMap.html"><tt>HashMap</tt></a></td> +<td headers="resizablearray"> </td> +<td headers="balancedtree"><a href= +"../TreeMap.html"><tt>TreeMap</tt></a></td> +<td headers="linkedlist"> </td> +<td headers="hashtableandlinkedlist"><a href= +"../LinkedHashMap.html"><tt>LinkedHashMap</tt></a></td> +</tr> +</thead> +</table> +<p>The general-purpose implementations support all of the +<i>optional operations</i> in the collection interfaces and have no +restrictions on the elements they may contain. They are +unsynchronized, but the <tt>Collections</tt> class contains static +factories called <a href= +"../Collections.html#synchronizedCollection-java.util.Collection-"> +<em>synchronization wrappers</em></a> that can be used to add +synchronization to many unsynchronized collections. All of the new +implementations have <i>fail-fast iterators</i>, which detect +invalid concurrent modification, and fail quickly and cleanly +(rather than behaving erratically).</p> +<p>The <tt>AbstractCollection</tt>, <tt>AbstractSet</tt>, +<tt>AbstractList</tt>, <tt>AbstractSequentialList</tt> and +<tt>AbstractMap</tt> classes provide basic implementations of the +core collection interfaces, to minimize the effort required to +implement them. The API documentation for these classes describes +precisely how each method is implemented so the implementer knows +which methods must be overridden, given the performance of the +basic operations of a specific implementation.</p> +<hr /> +<h2>Concurrent Collections</h2> +<p>Applications that use collections from more than one thread must +be carefully programmed. In general, this is known as <i>concurrent +programming</i>. The Java platform includes extensive support for +concurrent programming. See <a href= +"../concurrent/package-summary.html">Java Concurrency +Utilities</a> for details.</p> +<p>Collections are so frequently used that various concurrent +friendly interfaces and implementations of collections are included +in the APIs. These types go beyond the synchronization wrappers +discussed previously to provide features that are frequently needed +in concurrent programming.</p> +<p>These concurrent-aware interfaces are available:</p> +<ul> +<li><tt><a href= +"../concurrent/BlockingQueue.html">BlockingQueue</a></tt></li> +<li><tt><a href= +"../concurrent/TransferQueue.html">TransferQueue</a></tt></li> +<li><tt><a href= +"../concurrent/BlockingDeque.html">BlockingDeque</a></tt></li> +<li><tt><a href= +"../concurrent/ConcurrentMap.html">ConcurrentMap</a></tt></li> +<li><tt><a href= +"../concurrent/ConcurrentNavigableMap.html">ConcurrentNavigableMap</a></tt></li> +</ul> +<p>The following concurrent-aware implementation classes are +available. See the API documentation for the correct usage of these +implementations.</p> +<ul> +<li><tt><a href= +"../concurrent/LinkedBlockingQueue.html">LinkedBlockingQueue</a></tt></li> +<li><tt><a href= +"../concurrent/ArrayBlockingQueue.html">ArrayBlockingQueue</a></tt></li> +<li><tt><a href= +"../concurrent/PriorityBlockingQueue.html">PriorityBlockingQueue</a></tt></li> +<li><tt><a href= +"../concurrent/DelayQueue.html">DelayQueue</a></tt></li> +<li><tt><a href= +"../concurrent/SynchronousQueue.html">SynchronousQueue</a></tt></li> +<li><a href= +"../concurrent/LinkedBlockingDeque.html"><tt>LinkedBlockingDeque</tt></a></li> +<li><a href= +"../concurrent/LinkedTransferQueue.html"><tt>LinkedTransferQueue</tt></a></li> +<li><tt><a href= +"../concurrent/CopyOnWriteArrayList.html">CopyOnWriteArrayList</a></tt></li> +<li><tt><a href= +"../concurrent/CopyOnWriteArraySet.html">CopyOnWriteArraySet</a></tt></li> +<li><tt><a href= +"../concurrent/ConcurrentSkipListSet.html">ConcurrentSkipListSet</a></tt></li> +<li><tt><a href= +"../concurrent/ConcurrentHashMap.html">ConcurrentHashMap</a></tt></li> +<li><tt><a href= +"../concurrent/ConcurrentSkipListMap.html">ConcurrentSkipListMap</a></tt></li> +</ul> +<hr /> +<h2>Design Goals</h2> +<p>The main design goal was to produce an API that was small in +size and, more importantly, in "conceptual weight." It +was critical that the new functionality not seem too different to +current Java programmers; it had to augment current facilities, +rather than replace them. At the same time, the new API had to be +powerful enough to provide all the advantages described +previously.</p> +<p>To keep the number of core interfaces small, the interfaces do +not attempt to capture such subtle distinctions as mutability, +modifiability, and resizability. Instead, certain calls in the core +interfaces are <i>optional</i>, enabling implementations to throw +an <tt>UnsupportedOperationException</tt> to indicate that they do +not support a specified optional operation. Collection implementers +must clearly document which optional operations are supported by an +implementation.</p> +<p>To keep the number of methods in each core interface small, an +interface contains a method only if either:</p> +<ul> +<li>It is a truly <i>fundamental operation</i>: a basic operations +in terms of which others could be reasonably defined,</li> +<li>There is a compelling performance reason why an important +implementation would want to override it.</li> +</ul> +<p>It was critical that all reasonable representations of +collections interoperate well. This included arrays, which cannot +be made to implement the <tt>Collection</tt> interface directly +without changing the language. Thus, the framework includes methods +to enable collections to be moved into arrays, arrays to be viewed +as collections, and maps to be viewed as collections.</p> +<hr /> +<p style="font-size:smaller"> +Copyright © 1998, 2017, Oracle and/or its affiliates. 500 Oracle Parkway<br /> + Redwood Shores, CA 94065 USA. All rights reserved.</p> +<!-- Body text ends here --> +</body> +</html>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/java.base/share/classes/java/util/doc-files/coll-reference.html Sat Jun 17 08:03:05 2017 +0100 @@ -0,0 +1,564 @@ +<?xml version="1.0" encoding="utf-8"?> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" + "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> + +<!-- + Copyright (c) 1998, 2017, Oracle and/or its affiliates. All rights reserved. + DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + + This code is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License version 2 only, as + published by the Free Software Foundation. Oracle designates this + particular file as subject to the "Classpath" exception as provided + by Oracle in the LICENSE file that accompanied this code. + + This code is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + version 2 for more details (a copy is included in the LICENSE file that + accompanied this code). + + You should have received a copy of the GNU General Public License version + 2 along with this work; if not, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + + Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + or visit www.oracle.com if you need additional information or have any + questions. +--> + +<html lang="en-US" xmlns="http://www.w3.org/1999/xhtml" xml:lang= +"en-US"> +<head> +<title>Outline of the Collections Framework</title> +</head> +<body> +<h1>Outline of the Collections Framework</h1> +<!-- Body text begins here --> +The collections framework consists of: +<ul> +<li><strong>Collection interfaces</strong> - The primary means by +which collections are manipulated. +<ul> +<li><a href= +"../Collection.html"><strong>Collection</strong></a> +- A group of objects. No assumptions are made about the order of +the collection (if any) or whether it can contain duplicate +elements.</li> +<li><a href= +"../Set.html"><strong>Set</strong></a> - The +familiar set abstraction. No duplicate elements permitted. May or +may not be ordered. Extends the <tt>Collection</tt> interface.</li> +<li><a href= +"../List.html"><strong>List</strong></a> - +Ordered collection, also known as a <i>sequence</i>. Duplicates are +generally permitted. Allows positional access. Extends the +<tt>Collection</tt> interface.</li> +<li><a href= +"../Queue.html"><strong>Queue</strong></a> - A +collection designed for holding elements before processing. Besides +basic <tt>Collection</tt> operations, queues provide additional +insertion, extraction, and inspection operations.</li> +<li><a href= +"../Deque.html"><strong>Deque</strong></a> - A +<em>double ended queue</em>, supporting element insertion and +removal at both ends. Extends the <tt>Queue</tt> interface.</li> +<li><a href= +"../Map.html"><strong>Map</strong></a> - A +mapping from keys to values. Each key can map to one value.</li> +<li><a href= +"../SortedSet.html"><strong>SortedSet</strong></a> +- A set whose elements are automatically sorted, either in their +<i>natural ordering</i> (see the <a href= +"../../lang/Comparable.html"><tt>Comparable</tt></a> +interface) or by a <a href= +"../Comparator.html"><tt>Comparator</tt></a> +object provided when a <tt>SortedSet</tt> instance is created. +Extends the <tt>Set</tt> interface.</li> +<li><a href= +"../SortedMap.html"><strong>SortedMap</strong></a> +- A map whose mappings are automatically sorted by key, either +using the <i>natural ordering</i> of the keys or by a comparator +provided when a <tt>SortedMap</tt> instance is created. Extends the +<tt>Map</tt> interface.</li> +<li><a href= +"../NavigableSet.html"><strong>NavigableSet</strong></a> +- A <tt>SortedSet</tt> extended with navigation methods reporting +closest matches for given search targets. A <tt>NavigableSet</tt> +may be accessed and traversed in either ascending or descending +order.</li> +<li><a href= +"../NavigableMap.html"><strong>NavigableMap</strong></a> +- A <tt>SortedMap</tt> extended with navigation methods returning +the closest matches for given search targets. A +<tt>NavigableMap</tt> can be accessed and traversed in either +ascending or descending key order.</li> +<li><a href= +"../concurrent/BlockingQueue.html"><strong>BlockingQueue</strong></a> +- A <tt>Queue</tt> with operations that wait for the queue to +become nonempty when retrieving an element and that wait for space +to become available in the queue when storing an element. (This +interface is part of the <tt><a href= +"../concurrent/package-summary.html">java.util.concurrent</a></tt> +package.)</li> +<li><a href= +"../concurrent/TransferQueue.html"><strong>TransferQueue</strong></a> +- A <tt>BlockingQueue</tt> in which producers can wait for +consumers to receive elements. (This interface is part of the +<tt><a href= +"../concurrent/package-summary.html">java.util.concurrent</a></tt> +package.)</li> +<li><a href= +"../concurrent/BlockingDeque.html"><strong>BlockingDeque</strong></a> +- A <tt>Deque</tt> with operations that wait for the deque to +become nonempty when retrieving an element and wait for space to +become available in the deque when storing an element. Extends both +the <tt>Deque</tt> and <tt>BlockingQueue</tt> interfaces. (This +interface is part of the <tt><a href= +"../concurrent/package-summary.html">java.util.concurrent</a></tt> +package.)</li> +<li><a href= +"../concurrent/ConcurrentMap.html"><strong>ConcurrentMap</strong></a> +- A <tt>Map</tt> with atomic <tt>putIfAbsent</tt>, <tt>remove</tt>, +and <tt>replace</tt> methods. (This interface is part of the +<tt>java.util.concurrent</tt> package.)</li> +<li><a href= +"../concurrent/ConcurrentNavigableMap.html"><strong> +ConcurrentNavigableMap</strong></a> - A <tt>ConcurrentMap</tt> that +is also a <tt>NavigableMap</tt>.</li> +</ul> +</li> +<li><strong>General-purpose implementations</strong> - The primary +implementations of the collection interfaces. +<ul> +<li><strong><a href= +"../HashSet.html">HashSet</a></strong> - Hash +table implementation of the <tt>Set</tt> interface. The best +all-around implementation of the <tt>Set</tt> interface.</li> +<li><a href= +"../TreeSet.html"><strong>TreeSet</strong></a> +- Red-black tree implementation of the <tt>NavigableSet</tt> +interface.</li> +<li><strong><a href= +"../LinkedHashSet.html">LinkedHashSet</a></strong> +- Hash table and linked list implementation of the <tt>Set</tt> +interface. An insertion-ordered <tt>Set</tt> implementation that +runs nearly as fast as <tt>HashSet</tt>.</li> +<li><strong><a href= +"../ArrayList.html">ArrayList</a></strong> - +Resizable array implementation of the <tt>List</tt> interface (an +unsynchronized <tt>Vector</tt>). The best all-around implementation +of the <tt>List</tt> interface.</li> +<li><strong><a href= +"../ArrayDeque.html">ArrayDeque</a></strong> - +Efficient, resizable array implementation of the <tt>Deque</tt> +interface.</li> +<li><a href= +"../LinkedList.html"><strong>LinkedList</strong></a> +- Doubly-linked list implementation of the <tt>List</tt> interface. +Provides better performance than the <tt>ArrayList</tt> +implementation if elements are frequently inserted or deleted +within the list. Also implements the <tt>Deque</tt> interface. When +accessed through the <tt>Queue</tt> interface, <tt>LinkedList</tt> +acts as a FIFO queue.</li> +<li><strong><a href= +"../PriorityQueue.html">PriorityQueue</a></strong> +- Heap implementation of an unbounded priority queue.</li> +<li><strong><a href= +"../HashMap.html">HashMap</a></strong> - Hash +table implementation of the <tt>Map</tt> interface (an +unsynchronized <tt>Hashtable</tt> that supports <tt>null</tt> keys +and values). The best all-around implementation of the <tt>Map</tt> +interface.</li> +<li><a href= +"../TreeMap.html"><strong>TreeMap</strong></a> +Red-black tree implementation of the <tt>NavigableMap</tt> +interface.</li> +<li><strong><a href= +"../LinkedHashMap.html">LinkedHashMap</a></strong> +- Hash table and linked list implementation of the <tt>Map</tt> +interface. An insertion-ordered <tt>Map</tt> implementation that +runs nearly as fast as <tt>HashMap</tt>. Also useful for building +caches (see <a href= +"../LinkedHashMap.html#removeEldestEntry-java.util.Map.Entry-"> +removeEldestEntry(Map.Entry)</a> ).</li> +</ul> +</li> +<li><strong>Wrapper implementations</strong> - +Functionality-enhancing implementations for use with other +implementations. Accessed solely through static factory methods. +<ul> +<li><a href= +"../Collections.html#unmodifiableCollection-java.util.Collection-"> +<strong>Collections.unmodifiable<i>Interface</i></strong></a> - +Returns an unmodifiable view of a specified collection that throws +an <tt>UnsupportedOperationException</tt> if the user attempts to +modify it.</li> +<li><a name="synchWrappers" href= +"../Collections.html#synchronizedCollection-java.util.Collection-" +id= +"synchWrappers"><strong>Collections.synchronized<i>Interface</i></strong></a> +- Returns a synchronized collection that is backed by the specified +(typically unsynchronized) collection. As long as all accesses to +the backing collection are through the returned collection, thread +safety is guaranteed.</li> +<li><a href= +"../Collections.html#checkedCollection-java.util.Collection-java.lang.Class-"> +<strong>Collections.checked<i>Interface</i></strong></a> - Returns +a dynamically type-safe view of the specified collection, which +throws a <tt>ClassCastException</tt> if a client attempts to add an +element of the wrong type. The generics mechanism in the language +provides compile-time (static) type checking, but it is possible to +bypass this mechanism. Dynamically type-safe views eliminate this +possibility.</li> +</ul> +</li> +<li><strong>Adapter implementations</strong> - Implementations that +adapt one collections interface to another: +<ul> +<li><strong><a href= +"../Collections.html#newSetFromMap-java.util.Map-"> +newSetFromMap(Map)</a></strong> - Creates a general-purpose +<tt>Set</tt> implementation from a general-purpose <tt>Map</tt> +implementation.</li> +<li><strong><a href= +"../Collections.html#asLifoQueue-java.util.Deque-"> +asLifoQueue(Deque)</a></strong> - Returns a view of a +<tt>Deque</tt> as a Last In First Out (LIFO) <tt>Queue</tt>.</li> +</ul> +</li> +<li><strong>Convenience implementations</strong> - High-performance +"mini-implementations" of the collection interfaces. +<ul> +<li><a href= +"../Arrays.html#asList-T...-"><strong>Arrays.asList</strong></a> +- Enables an array to be viewed as a list.</li> +<li><strong><a href= +"../Collections.html#emptySet--">emptySet</a>, +<a href= +"../Collections.html#emptyList--">emptyList</a> +and <a href= +"../Collections.html#emptyMap--">emptyMap</a></strong> +- Return an immutable empty set, list, or map.</li> +<li><strong><a href= +"../Collections.html#singleton-java.lang.Object-"> +singleton</a>, <a href= +"../Collections.html#singletonList-java.lang.Object-"> +singletonList</a>, and <a href= +"../Collections.html#singletonMap-K-V-">singletonMap</a></strong> +- Return an immutable singleton set, list, or map, containing only +the specified object (or key-value mapping).</li> +<li><a href= +"../Collections.html#nCopies-int-T-"><strong> +nCopies</strong></a> - Returns an immutable list consisting of n +copies of a specified object.</li> +</ul> +</li> +<li><strong>Legacy implementations</strong> - Older collection +classes were retrofitted to implement the collection interfaces. +<ul> +<li><a href= +"../Vector.html"><strong>Vector</strong></a> - +Synchronized resizable array implementation of the <tt>List</tt> +interface with additional legacy methods.</li> +<li><a href= +"../Hashtable.html"><strong>Hashtable</strong></a> +- Synchronized hash table implementation of the <tt>Map</tt> +interface that does not allow <tt>null</tt> keys or values, plus +additional legacy methods.</li> +</ul> +</li> +<li><strong>Special-purpose implementations</strong> +<ul> +<li><strong><a href= +"../WeakHashMap.html">WeakHashMap</a></strong> +- An implementation of the <tt>Map</tt> interface that stores only +<a href="../../lang/ref/WeakReference.html"><i>weak +references</i></a> to its keys. Storing only weak references +enables key-value pairs to be garbage collected when the key is no +longer referenced outside of the <tt>WeakHashMap</tt>. This class +is the easiest way to use the power of weak references. It is +useful for implementing registry-like data structures, where the +utility of an entry vanishes when its key is no longer reachable by +any thread.</li> +<li><strong><a href= +"../IdentityHashMap.html">IdentityHashMap</a></strong> +- Identity-based <tt>Map</tt> implementation based on a hash table. +This class is useful for topology-preserving object graph +transformations (such as serialization or deep copying). To perform +these transformations, you must maintain an identity-based "node +table" that keeps track of which objects have already been seen. +Identity-based maps are also used to maintain +object-to-meta-information mappings in dynamic debuggers and +similar systems. Finally, identity-based maps are useful in +preventing "spoof attacks" resulting from intentionally perverse +equals methods. (<tt>IdentityHashMap</tt> never invokes the equals +method on its keys.) An added benefit of this implementation is +that it is fast.</li> +<li><strong><a href= +"../concurrent/CopyOnWriteArrayList.html">CopyOnWriteArrayList</a></strong> +- A <tt>List</tt> implementation backed by an copy-on-write array. +All mutative operations (such as <tt>add</tt>, <tt>set</tt>, and +<tt>remove</tt>) are implemented by making a new copy of the array. +No synchronization is necessary, even during iteration, and +iterators are guaranteed never to throw +<tt>ConcurrentModificationException</tt>. This implementation is +well-suited to maintaining event-handler lists (where change is +infrequent, and traversal is frequent and potentially +time-consuming).</li> +<li><strong><a href= +"../concurrent/CopyOnWriteArraySet.html">CopyOnWriteArraySet</a></strong> +- A <tt>Set</tt> implementation backed by a copy-on-write array. +This implementation is similar to <tt>CopyOnWriteArrayList</tt>. +Unlike most <tt>Set</tt> implementations, the <tt>add</tt>, +<tt>remove</tt>, and <tt>contains</tt> methods require time +proportional to the size of the set. This implementation is well +suited to maintaining event-handler lists that must prevent +duplicates.</li> +<li><strong><a href= +"../EnumSet.html">EnumSet</a></strong> - A +high-performance <tt>Set</tt> implementation backed by a bit +vector. All elements of each <tt>EnumSet</tt> instance must be +elements of a single enum type.</li> +<li><strong><a href= +"../EnumMap.html">EnumMap</a></strong> - A +high-performance <tt>Map</tt> implementation backed by an array. +All keys in each <tt>EnumMap</tt> instance must be elements of a +single enum type.</li> +</ul> +</li> +<li><strong>Concurrent implementations</strong> - These +implementations are part of <tt>java.util.concurrent</tt>. +<ul> +<li><strong><a href= +"../concurrent/ConcurrentLinkedQueue.html">ConcurrentLinkedQueue</a></strong> +- An unbounded first in, first out (FIFO) queue based on linked +nodes.</li> +<li><a href= +"../concurrent/LinkedBlockingQueue.html"><strong> +LinkedBlockingQueue</strong></a> - An optionally bounded FIFO +blocking queue backed by linked nodes.</li> +<li><a href= +"../concurrent/ArrayBlockingQueue.html"><strong> +ArrayBlockingQueue</strong></a> - A bounded FIFO blocking queue +backed by an array.</li> +<li><a href= +"../concurrent/PriorityBlockingQueue.html"><strong> +PriorityBlockingQueue</strong></a> - An unbounded blocking priority +queue backed by a priority heap.</li> +<li><a href= +"../concurrent/DelayQueue.html"><strong>DelayQueue</strong></a> +- A time-based scheduling queue backed by a priority heap.</li> +<li><a href= +"../concurrent/SynchronousQueue.html"><strong>SynchronousQueue</strong></a> +- A simple rendezvous mechanism that uses the +<tt>BlockingQueue</tt> interface.</li> +<li><a href= +"../concurrent/LinkedBlockingDeque.html"><strong> +LinkedBlockingDeque</strong></a> - An optionally bounded FIFO +blocking deque backed by linked nodes.</li> +<li><a href= +"../concurrent/LinkedTransferQueue.html"><strong> +LinkedTransferQueue</strong></a> - An unbounded +<tt>TransferQueue</tt> backed by linked nodes.</li> +<li><a href= +"../concurrent/ConcurrentHashMap.html"><strong>ConcurrentHashMap</strong></a> +- A highly concurrent, high-performance <tt>ConcurrentMap</tt> +implementation based on a hash table. This implementation never +blocks when performing retrievals and enables the client to select +the concurrency level for updates. It is intended as a drop-in +replacement for <tt><a href= +"../Hashtable.html">Hashtable</a></tt>. In +addition to implementing <tt>ConcurrentMap</tt>, it supports all of +the legacy methods of <tt>Hashtable</tt>.</li> +<li><a href= +"../concurrent/ConcurrentSkipListSet.html"><strong> +ConcurrentSkipListSet</strong></a> - Skips list implementation of +the <tt>NavigableSet</tt> interface.</li> +<li><a href= +"../concurrent/ConcurrentSkipListMap.html"><strong> +ConcurrentSkipListMap</strong></a> - Skips list implementation of +the <tt>ConcurrentNavigableMap</tt> interface.</li> +</ul> +</li> +<li><strong>Abstract implementations</strong> - Skeletal +implementations of the collection interfaces to facilitate custom +implementations. +<ul> +<li><a href= +"../AbstractCollection.html"><strong>AbstractCollection</strong></a> +- Skeletal <tt>Collection</tt> implementation that is neither a set +nor a list (such as a "bag" or multiset).</li> +<li><a href= +"../AbstractSet.html"><strong>AbstractSet</strong></a> +- Skeletal <tt>Set</tt> implementation.</li> +<li><a href= +"../AbstractList.html"><strong>AbstractList</strong></a> +- Skeletal <tt>List</tt> implementation backed by a random access +data store (such as an array).</li> +<li><a href= +"../AbstractSequentialList.html"><strong>AbstractSequentialList</strong></a> +- Skeletal <tt>List</tt> implementation backed by a sequential +access data store (such as a linked list).</li> +<li><a href= +"../AbstractQueue.html"><strong>AbstractQueue</strong></a> +- Skeletal <tt>Queue</tt> implementation.</li> +<li><a href= +"../AbstractMap.html"><strong>AbstractMap</strong></a> +- Skeletal <tt>Map</tt> implementation.</li> +</ul> +</li> +<li><strong>Algorithms</strong> - The <a href= +"../Collections.html"><strong>Collections</strong></a> +class contains these useful static methods. +<ul> +<li><strong><a href= +"../Collections.html#sort-java.util.List-">sort(List)</a></strong> +- Sorts a list using a merge sort algorithm, which provides average +case performance comparable to a high quality quicksort, guaranteed +O(n*log n) performance (unlike quicksort), and <em>stability</em> +(unlike quicksort). A stable sort is one that does not reorder +equal elements.</li> +<li><strong><a href= +"../Collections.html#binarySearch-java.util.List-T-"> +binarySearch(List, Object)</a></strong> - Searches for an element +in an ordered list using the binary search algorithm.</li> +<li><strong><a href= +"../Collections.html#reverse-java.util.List-">reverse(List)</a></strong> +- Reverses the order of the elements in a list.</li> +<li><strong><a href= +"../Collections.html#shuffle-java.util.List-">shuffle(List)</a></strong> +- Randomly changes the order of the elements in a list.</li> +<li><strong><a href= +"../Collections.html#fill-java.util.List-T-"> +fill(List, Object)</a></strong> - Overwrites every element in a +list with the specified value.</li> +<li><strong><a href= +"../Collections.html#copy-java.util.List-java.util.List-"> +copy(List dest, List src)</a></strong> - Copies the source list +into the destination list.</li> +<li><strong><a href= +"../Collections.html#min-java.util.Collection-"> +min(Collection)</a></strong> - Returns the minimum element in a +collection.</li> +<li><strong><a href= +"../Collections.html#max-java.util.Collection-"> +max(Collection)</a></strong> - Returns the maximum element in a +collection.</li> +<li><strong><a href= +"../Collections.html#rotate-java.util.List-int-"> +rotate(List list, int distance)</a></strong> - Rotates all of the +elements in the list by the specified distance.</li> +<li><strong><a href= +"../Collections.html#replaceAll-java.util.List-T-T-"> +replaceAll(List list, Object oldVal, Object newVal)</a></strong> - +Replaces all occurrences of one specified value with another.</li> +<li><strong><a href= +"../Collections.html#indexOfSubList-java.util.List-java.util.List-"> +indexOfSubList(List source, List target)</a></strong> - Returns the +index of the first sublist of source that is equal to target.</li> +<li><strong><a href= +"../Collections.html#lastIndexOfSubList-java.util.List-java.util.List-"> +lastIndexOfSubList(List source, List target)</a></strong> - Returns +the index of the last sublist of source that is equal to +target.</li> +<li><strong><a href= +"../Collections.html#swap-java.util.List-int-int-"> +swap(List, int, int)</a></strong> - Swaps the elements at the +specified positions in the specified list.</li> +<li><strong><a href= +"../Collections.html#frequency-java.util.Collection-java.lang.Object-"> +frequency(Collection, Object)</a></strong> - Counts the number of +times the specified element occurs in the specified +collection.</li> +<li><strong><a href= +"../Collections.html#disjoint-java.util.Collection-java.util.Collection-"> +disjoint(Collection, Collection)</a></strong> - Determines whether +two collections are disjoint, in other words, whether they contain +no elements in common.</li> +<li><strong><a href= +"../Collections.html#addAll-java.util.Collection-T...-"> +addAll(Collection<? super T>, T...)</a></strong> - Adds all +of the elements in the specified array to the specified +collection.</li> +</ul> +</li> +<li><strong>Infrastructure</strong> +<ul> +<li><strong>Iterators</strong> - Similar to the familiar <a href= +"../Enumeration.html">Enumeration</a> +interface, but more powerful, and with improved method names. +<ul> +<li><a href= +"../Iterator.html"><strong>Iterator</strong></a> +- In addition to the functionality of the <tt>Enumeration</tt> +interface, enables the user to remove elements from the backing +collection with well-defined, useful semantics.</li> +<li><a href= +"../ListIterator.html"><strong>ListIterator</strong></a> +- Iterator for use with lists. In addition to the functionality of +the <tt>Iterator</tt> interface, supports bidirectional iteration, +element replacement, element insertion, and index retrieval.</li> +</ul> +</li> +<li><strong>Ordering</strong> +<ul> +<li><a href= +"../../lang/Comparable.html"><strong>Comparable</strong></a> +- Imparts a <i>natural ordering</i> to classes that implement it. +The natural ordering can be used to sort a list or maintain order +in a sorted set or map. Many classes were retrofitted to implement +this interface.</li> +<li><a href= +"../Comparator.html"><strong>Comparator</strong></a> +- Represents an order relation, which can be used to sort a list or +maintain order in a sorted set or map. Can override a type's +natural ordering or order objects of a type that does not implement +the <tt>Comparable</tt> interface.</li> +</ul> +</li> +<li><strong>Runtime exceptions</strong> +<ul> +<li><a href= +"../../lang/UnsupportedOperationException.html"><strong> +UnsupportedOperationException</strong></a> - Thrown by collections +if an unsupported optional operation is called.</li> +<li><a href= +"../ConcurrentModificationException.html"><strong> +ConcurrentModificationException</strong></a> - Thrown by iterators +and list iterators if the backing collection is changed +unexpectedly while the iteration is in progress. Also thrown by +<i>sublist</i> views of lists if the backing list is changed +unexpectedly.</li> +</ul> +</li> +<li><strong>Performance</strong> +<ul> +<li><strong><a href= +"../RandomAccess.html">RandomAccess</a></strong> +- Marker interface that lets <tt>List</tt> implementations indicate +that they support fast (generally constant time) random access. +This lets generic algorithms change their behavior to provide good +performance when applied to either random or sequential access +lists.</li> +</ul> +</li> +</ul> +</li> +<li><strong>Array Utilities</strong> +<ul> +<li><a href= +"../Arrays.html"><strong>Arrays</strong></a> - +Contains static methods to sort, search, compare, hash, copy, +resize, convert to <tt>String</tt>, and fill arrays of primitives +and objects.</li> +</ul> +</li> +</ul> +<hr /> +<p style="font-size:smaller"> +Copyright © 1998, 2017, Oracle and/or its affiliates. 500 Oracle Parkway<br /> + Redwood Shores, CA 94065 USA. All rights reserved.</p> +<!-- Body text ends here --> +</body> +</html>
--- a/src/java.base/share/classes/java/util/jar/Pack200.java Fri Jun 16 09:20:39 2017 -0700 +++ b/src/java.base/share/classes/java/util/jar/Pack200.java Sat Jun 17 08:03:05 2017 +0100 @@ -34,8 +34,7 @@ /** * Transforms a JAR file to or from a packed stream in Pack200 format. - * Please refer to Network Transfer Format JSR 200 Specification at - * <a href=http://jcp.org/aboutJava/communityprocess/review/jsr200/index.html>http://jcp.org/aboutJava/communityprocess/review/jsr200/index.html</a> + * Please refer to <a href="{@docRoot}/../specs/pack-spec.html">Network Transfer Format JSR 200 Specification</a> * <p> * Typically the packer engine is used by application developers * to deploy or host JAR files on a website.
--- a/src/java.base/share/classes/java/util/package-info.java Fri Jun 16 09:20:39 2017 -0700 +++ b/src/java.base/share/classes/java/util/package-info.java Sat Jun 17 08:03:05 2017 +0100 @@ -24,27 +24,24 @@ */ /** - * Contains the collections framework, legacy collection classes, - * event model, date and time facilities, internationalization, and - * miscellaneous utility classes (a string tokenizer, a random-number - * generator, and a bit array). + * Contains the collections framework, some internationalization support classes, + * a service loader, properties, random number generation, string parsing + * and scanning classes, base64 encoding and decoding, a bit array, and + * several miscellaneous utility classes. This package also contains + * legacy collection classes and legacy date and time classes. * * <h2><a id="CollectionsFramework"></a>{@index "Java Collections Framework"}</h2> + * <p>For an overview, API outline, and design rationale, please see: * <ul> - * <li><a href="../../../technotes/guides/collections/overview.html"><b>Collections Framework Overview</b></a> - * <li><a href="../../../technotes/guides/collections/reference.html"><b> - * Collections Framework Annotated Outline</b></a> + * <li><a href="doc-files/coll-index.html"> + * <b>Collections Framework Documentation</b></a> * </ul> * - * <h2>Related Documentation</h2> - * For overviews, tutorials, examples, guides, and tool documentation, - * please see: + * <p>For a tutorial and programming guide with examples of use + * of the collections framework, please see: * <ul> - * <li><a href="http://docs.oracle.com/javase/tutorial/collections/index.html"> - * <b>Collections Framework Tutorial</b></a> - * <li><a - * href="../../../technotes/guides/collections/designfaq.html"><b>Collections - * Framework Design FAQ</b></a> + * <li><a href="http://docs.oracle.com/javase/tutorial/collections/index.html"> + * <b>Collections Framework Tutorial</b></a> * </ul> * * @since 1.0
--- a/src/java.base/share/classes/sun/security/pkcs12/PKCS12KeyStore.java Fri Jun 16 09:20:39 2017 -0700 +++ b/src/java.base/share/classes/sun/security/pkcs12/PKCS12KeyStore.java Sat Jun 17 08:03:05 2017 +0100 @@ -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/src/java.base/share/lib/security/default.policy Fri Jun 16 09:20:39 2017 -0700 +++ b/src/java.base/share/lib/security/default.policy Sat Jun 17 08:03:05 2017 +0100 @@ -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/src/java.desktop/share/classes/java/applet/AppletContext.java Fri Jun 16 09:20:39 2017 -0700 +++ b/src/java.desktop/share/classes/java/applet/AppletContext.java Sat Jun 17 08:03:05 2017 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1995, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1995, 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 @@ -114,8 +114,13 @@ * document is to be displayed. * The target argument is interpreted as follows: * - * <center><table border="3" summary="Target arguments and their descriptions"> - * <tr><th>Target Argument</th><th>Description</th></tr> + * <table class="striped"> + * <caption>Target arguments and their descriptions</caption> + * <thead> + * <tr><th>Target Argument</th> + * <th>Description</th></tr> + * </thead> + * <tbody> * <tr><td>{@code "_self"} <td>Show in the window and frame that * contain the applet.</tr> * <tr><td>{@code "_parent"}<td>Show in the applet's parent frame. If @@ -130,7 +135,8 @@ * a target named <i>name</i> does not already exist, a * new top-level window with the specified name is created, * and the document is shown there.</tr> - * </table> </center> + * </tbody> + * </table> * <p> * An applet viewer or browser is free to ignore {@code showDocument}. *
--- a/src/java.desktop/share/classes/java/awt/AWTKeyStroke.java Fri Jun 16 09:20:39 2017 -0700 +++ b/src/java.desktop/share/classes/java/awt/AWTKeyStroke.java Sat Jun 17 08:03:05 2017 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 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 @@ -90,8 +90,13 @@ /** * Constructs an {@code AWTKeyStroke} with default values. * The default values used are: - * <table border="1" summary="AWTKeyStroke default values"> + * + * <table class="striped"> + * <caption>AWTKeyStroke default values</caption> + * <thead> * <tr><th>Property</th><th>Default Value</th></tr> + * </thead> + * <tbody> * <tr> * <td>Key Char</td> * <td>{@code KeyEvent.CHAR_UNDEFINED}</td> @@ -108,6 +113,7 @@ * <td>On key release?</td> * <td>{@code false}</td> * </tr> + * </tbody> * </table> * * {@code AWTKeyStroke}s should not be constructed
--- a/src/java.desktop/share/classes/java/awt/AWTPermission.java Fri Jun 16 09:20:39 2017 -0700 +++ b/src/java.desktop/share/classes/java/awt/AWTPermission.java Sat Jun 17 08:03:05 2017 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 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,13 +44,17 @@ * permission allows and a discussion of the risks of granting code * the permission. * - * <table border=1 cellpadding=5 summary="AWTPermission target names, descriptions, and associated risks."> + * <table class="striped"> + * <caption>AWTPermission target names, descriptions, and associated risks + * </caption> + * <thead> * <tr> * <th>Permission Target Name</th> * <th>What the Permission Allows</th> * <th>Risks of Allowing this Permission</th> * </tr> - * + * </thead> + * <tbody> * <tr> * <td>accessClipboard</td> * <td>Posting and retrieval of information to and from the AWT clipboard</td> @@ -182,6 +186,7 @@ * so that keyboard is emulated using the mouse, an applet may guess what * is being typed.</td> * </tr> + * </tbody> * </table> * * @see java.security.BasicPermission
--- a/src/java.desktop/share/classes/java/awt/AlphaComposite.java Fri Jun 16 09:20:39 2017 -0700 +++ b/src/java.desktop/share/classes/java/awt/AlphaComposite.java Sat Jun 17 08:03:05 2017 +0100 @@ -73,7 +73,8 @@ * equation in the Porter and Duff paper: * * <blockquote> - * <table summary="layout"> + * <table class="borderless"> + * <caption style="display:none">Factors</caption> * <tr><th style="text-align:left">Factor <th style="text-align:left">Definition * <tr><td><em>A<sub>s</sub></em><td>the alpha component of the source pixel * <tr><td><em>C<sub>s</sub></em><td>a color component of the source pixel in premultiplied form @@ -113,7 +114,8 @@ * the blending equation in the Porter and Duff paper: * * <blockquote> - * <table summary="layout"> + * <table class="borderless"> + * <caption style="display:none">Factors</caption> * <tr><th style="text-align:left">Factor <th style="text-align:left">Definition * <tr><td><em>C<sub>sr</sub></em> <td>one of the raw color components of the source pixel * <tr><td><em>C<sub>dr</sub></em> <td>one of the raw color components of the destination pixel
--- a/src/java.desktop/share/classes/java/awt/Component.java Fri Jun 16 09:20:39 2017 -0700 +++ b/src/java.desktop/share/classes/java/awt/Component.java Sat Jun 17 08:03:05 2017 +0100 @@ -7237,12 +7237,17 @@ * recommendations for Windows and Unix are listed below. These * recommendations are used in the Sun AWT implementations. * - * <table border=1 summary="Recommended default values for a Component's focus traversal keys"> + * <table class="striped"> + * <caption>Recommended default values for a Component's focus traversal + * keys</caption> + * <thead> * <tr> * <th>Identifier</th> * <th>Meaning</th> * <th>Default</th> * </tr> + * </thead> + * <tbody> * <tr> * <td>KeyboardFocusManager.FORWARD_TRAVERSAL_KEYS</td> * <td>Normal forward keyboard traversal</td> @@ -7258,6 +7263,7 @@ * <td>Go up one focus traversal cycle</td> * <td>none</td> * </tr> + * </tbody> * </table> * * To disable a traversal key, use an empty Set; Collections.EMPTY_SET is
--- a/src/java.desktop/share/classes/java/awt/Container.java Fri Jun 16 09:20:39 2017 -0700 +++ b/src/java.desktop/share/classes/java/awt/Container.java Sat Jun 17 08:03:05 2017 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1995, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1995, 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 @@ -3064,12 +3064,17 @@ * recommendations for Windows and Unix are listed below. These * recommendations are used in the Sun AWT implementations. * - * <table border=1 summary="Recommended default values for a Container's focus traversal keys"> + * <table class="striped"> + * <caption>Recommended default values for a Container's focus traversal + * keys</caption> + * <thead> * <tr> * <th>Identifier</th> * <th>Meaning</th> * <th>Default</th> * </tr> + * </thead> + * <tbody> * <tr> * <td>KeyboardFocusManager.FORWARD_TRAVERSAL_KEYS</td> * <td>Normal forward keyboard traversal</td> @@ -3086,10 +3091,11 @@ * <td>none</td> * </tr> * <tr> - * <td>KeyboardFocusManager.DOWN_CYCLE_TRAVERSAL_KEYS<td> + * <td>KeyboardFocusManager.DOWN_CYCLE_TRAVERSAL_KEYS</td> * <td>Go down one focus traversal cycle</td> * <td>none</td> * </tr> + * </tbody> * </table> * * To disable a traversal key, use an empty Set; Collections.EMPTY_SET is
--- a/src/java.desktop/share/classes/java/awt/EventQueue.java Fri Jun 16 09:20:39 2017 -0700 +++ b/src/java.desktop/share/classes/java/awt/EventQueue.java Sat Jun 17 08:03:05 2017 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1996, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1996, 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 @@ -668,12 +668,16 @@ * dispatched depends upon the type of the event and the * type of the event's source object: * - * <table border=1 summary="Event types, source types, and dispatch methods"> + * <table class="striped"> + * <caption>Event types, source types, and dispatch methods</caption> + * <thead> * <tr> * <th>Event Type</th> * <th>Source Type</th> * <th>Dispatched To</th> * </tr> + * </thead> + * <tbody> * <tr> * <td>ActiveEvent</td> * <td>Any</td> @@ -694,6 +698,7 @@ * <td>Other</td> * <td>No action (ignored)</td> * </tr> + * </tbody> * </table> * * @param event an instance of {@code java.awt.AWTEvent},
--- a/src/java.desktop/share/classes/java/awt/GridBagLayout.java Fri Jun 16 09:20:39 2017 -0700 +++ b/src/java.desktop/share/classes/java/awt/GridBagLayout.java Sat Jun 17 08:03:05 2017 +0100 @@ -122,13 +122,16 @@ * are not. Baseline relative values are calculated relative to the * baseline. Valid values are: * - * <center><table BORDER=0 style="width:800" - * SUMMARY="absolute, relative and baseline values as described above"> + * <table class="striped" style="margin: 0px auto"> + * <caption>Absolute, relative and baseline values as described above</caption> + * <thead> * <tr> - * <th><P style="text-align:left">Absolute Values</th> - * <th><P style="text-align:left">Orientation Relative Values</th> - * <th><P style="text-align:left">Baseline Relative Values</th> + * <th><p style="text-align:center">Absolute Values</th> + * <th><p style="text-align:center">Orientation Relative Values</th> + * <th><p style="text-align:center">Baseline Relative Values</th> * </tr> + * </thead> + * <tbody> * <tr> * <td> * <ul style="list-style-type:none"> @@ -169,7 +172,8 @@ * </ul> * </td> * </tr> - * </table></center> + * </tbody> + * </table> * <dt>{@link GridBagConstraints#weightx}, * {@link GridBagConstraints#weighty} * <dd>Used to determine how to distribute space, which is @@ -197,13 +201,14 @@ * <p> * The following figure shows a baseline layout and includes a * component that spans rows: - * <center><table summary="Baseline Layout"> + * <table class="borderless" style="margin: 0px auto"> + * <caption>Baseline Layout</caption> * <tr style="text-align:center"> * <td> * <img src="doc-files/GridBagLayout-baseline.png" * alt="The following text describes this graphic (Figure 1)." style="float:center"> * </td> - * </table></center> + * </table> * This layout consists of three components: * <ul><li>A panel that starts in row 0 and ends in row 1. The panel * has a baseline-resize behavior of {@code CONSTANT_DESCENT} and has @@ -252,7 +257,8 @@ * left-to-right container and Figure 3 shows the layout for a horizontal, * right-to-left container. * - * <center><table style="width:600" summary="layout"> + * <table class="borderless" style="margin: 0px auto"> + * <caption style="width:600;display:none">Figures</caption> * <tr style="text-align:center"> * <td> * <img src="doc-files/GridBagLayout-1.gif" alt="The preceding text describes this graphic (Figure 1)." style="float:center; margin: 7px 10px;"> @@ -264,7 +270,7 @@ * <td>Figure 2: Horizontal, Left-to-Right</td> * <td>Figure 3: Horizontal, Right-to-Left</td> * </tr> - * </table></center> + * </table> * <p> * Each of the ten components has the {@code fill} field * of its associated {@code GridBagConstraints} object
--- a/src/java.desktop/share/classes/java/awt/GridLayout.java Fri Jun 16 09:20:39 2017 -0700 +++ b/src/java.desktop/share/classes/java/awt/GridLayout.java Sat Jun 17 08:03:05 2017 +0100 @@ -55,7 +55,8 @@ * If the container's {@code ComponentOrientation} property is horizontal * and right-to-left, the example produces the output shown in Figure 2. * - * <table style="float:center;width:600" summary="layout"> + * <table style="float:center;width:600"> + * <caption style="display:none">Figures</caption> * <tr style="text-align:center"> * <td><img SRC="doc-files/GridLayout-1.gif" * alt="Shows 6 buttons in rows of 2. Row 1 shows buttons 1 then 2.
--- a/src/java.desktop/share/classes/java/awt/KeyboardFocusManager.java Fri Jun 16 09:20:39 2017 -0700 +++ b/src/java.desktop/share/classes/java/awt/KeyboardFocusManager.java Sat Jun 17 08:03:05 2017 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 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 @@ -1039,12 +1039,16 @@ * recommendations for Windows and Unix are listed below. These * recommendations are used in the Sun AWT implementations. * - * <table border=1 summary="Recommended default values for focus traversal keys"> + * <table class="striped"> + * <caption>Recommended default values for focus traversal keys</caption> + * <thead> * <tr> * <th>Identifier</th> * <th>Meaning</th> * <th>Default</th> * </tr> + * </thead> + * <tbody> * <tr> * <td>{@code KeyboardFocusManager.FORWARD_TRAVERSAL_KEYS}</td> * <td>Normal forward keyboard traversal</td> @@ -1067,6 +1071,7 @@ * <td>Go down one focus traversal cycle</td> * <td>none</td> * </tr> + * </tbody> * </table> * * To disable a traversal key, use an empty {@code Set};
--- a/src/java.desktop/share/classes/java/awt/Scrollbar.java Fri Jun 16 09:20:39 2017 -0700 +++ b/src/java.desktop/share/classes/java/awt/Scrollbar.java Sat Jun 17 08:03:05 2017 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1995, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1995, 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 @@ -296,12 +296,16 @@ * The default properties of the scroll bar are listed in * the following table: * - * <table border=1 summary="Scrollbar default properties"> + * <table class="striped"> + * <caption>Scrollbar default properties</caption> + * <thead> * <tr> * <th>Property</th> * <th>Description</th> * <th>Default Value</th> * </tr> + * </thead> + * <tbody> * <tr> * <td>orientation</td> * <td>indicates whether the scroll bar is vertical @@ -347,6 +351,7 @@ * <br>on either side of the bubble </td> * <td>10</td> * </tr> + * </tbody> * </table> * * @exception HeadlessException if GraphicsEnvironment.isHeadless()
--- a/src/java.desktop/share/classes/java/awt/SystemTray.java Fri Jun 16 09:20:39 2017 -0700 +++ b/src/java.desktop/share/classes/java/awt/SystemTray.java Sat Jun 17 08:03:05 2017 +0100 @@ -368,11 +368,15 @@ * Adds a {@code PropertyChangeListener} to the list of listeners for the * specific property. The following properties are currently supported: * - * <table border=1 summary="SystemTray properties"> + * <table class="striped"> + * <caption>SystemTray properties</caption> + * <thead> * <tr> * <th>Property</th> * <th>Description</th> * </tr> + * </thead> + * <tbody> * <tr> * <td>{@code trayIcons}</td> * <td>The {@code SystemTray}'s array of {@code TrayIcon} objects. @@ -389,6 +393,7 @@ * when the system tray becomes available or unavailable on the desktop.<br> * The property is accessed by the {@link #getSystemTray} method.</td> * </tr> + * </tbody> * </table> * <p> * The {@code listener} listens to property changes only in this context.
--- a/src/java.desktop/share/classes/java/awt/font/NumericShaper.java Fri Jun 16 09:20:39 2017 -0700 +++ b/src/java.desktop/share/classes/java/awt/font/NumericShaper.java Sat Jun 17 08:03:05 2017 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 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 @@ -106,12 +106,16 @@ * multiple decimal digits sets are specified for the same Unicode * range, one of the sets will take precedence as follows. * - * <table border=1 cellspacing=3 cellpadding=0 summary="NumericShaper constants precedence."> + * <table class="plain"> + * <caption>NumericShaper constants precedence</caption> + * <thead> * <tr> * <th class="TableHeadingColor">Unicode Range</th> * <th class="TableHeadingColor">{@code NumericShaper} Constants</th> * <th class="TableHeadingColor">Precedence</th> * </tr> + * </thead> + * <tbody> * <tr> * <td rowspan="2">Arabic</td> * <td>{@link NumericShaper#ARABIC NumericShaper.ARABIC}<br> @@ -123,12 +127,15 @@ * {@link NumericShaper.Range#EASTERN_ARABIC}</td> * <td>{@link NumericShaper.Range#EASTERN_ARABIC}</td> * </tr> + * </tbody> + * <tbody> * <tr> * <td>Tai Tham</td> * <td>{@link NumericShaper.Range#TAI_THAM_HORA}<br> * {@link NumericShaper.Range#TAI_THAM_THAM}</td> * <td>{@link NumericShaper.Range#TAI_THAM_THAM}</td> * </tr> + * </tbody> * </table> * * @since 1.4
--- a/src/java.desktop/share/classes/java/awt/font/TextAttribute.java Fri Jun 16 09:20:39 2017 -0700 +++ b/src/java.desktop/share/classes/java/awt/font/TextAttribute.java Sat Jun 17 08:03:05 2017 +0100 @@ -96,15 +96,18 @@ * </UL> * * <h4>Summary of attributes</h4> - * <table style="float:center;width:95%" border="0" cellspacing="0" cellpadding="2" - * summary="Key, value type, principal constants, and default value - * behavior of all TextAttributes"> - * <tr style="background-color:#ccccff"> + * <table style="float:center;width:95%" class="striped"> + * <caption>Key, value type, principal constants, and + * default value behavior of all TextAttributes</caption> + * <thead> + * <tr> * <th valign="TOP" style="text-align:center">Key</th> * <th valign="TOP" style="text-align:center">Value Type</th> * <th valign="TOP" style="text-align:center">Principal Constants</th> * <th valign="TOP" style="text-align:center">Default Value</th> * </tr> + * </thead> + * <tbody> * <tr> * <td valign="TOP">{@link #FAMILY}</td> * <td valign="TOP">String</td> @@ -114,7 +117,7 @@ * </td> * <td valign="TOP">"Default" (use platform default)</td> * </tr> - * <tr style="background-color:#eeeeff"> + * <tr> * <td valign="TOP">{@link #WEIGHT}</td> * <td valign="TOP">Number</td> * <td valign="TOP">WEIGHT_REGULAR, WEIGHT_BOLD</td> @@ -126,7 +129,7 @@ * <td valign="TOP">WIDTH_CONDENSED, WIDTH_REGULAR,<br>WIDTH_EXTENDED</td> * <td valign="TOP">WIDTH_REGULAR</td> * </tr> - * <tr style="background-color:#eeeeff"> + * <tr> * <td valign="TOP">{@link #POSTURE}</td> * <td valign="TOP">Number</td> * <td valign="TOP">POSTURE_REGULAR, POSTURE_OBLIQUE</td> @@ -138,7 +141,7 @@ * <td valign="TOP">none</td> * <td valign="TOP">12.0</td> * </tr> - * <tr style="background-color:#eeeeff"> + * <tr> * <td valign="TOP">{@link #TRANSFORM}</td> * <td valign="TOP">{@link TransformAttribute}</td> * <td valign="TOP">See TransformAttribute {@link TransformAttribute#IDENTITY IDENTITY}</td> @@ -150,7 +153,7 @@ * <td valign="TOP">SUPERSCRIPT_SUPER, SUPERSCRIPT_SUB</td> * <td valign="TOP">0 (use the standard glyphs and metrics)</td> * </tr> - * <tr style="background-color:#eeeeff"> + * <tr> * <td valign="TOP">{@link #FONT}</td> * <td valign="TOP">{@link java.awt.Font}</td> * <td valign="TOP">none</td> @@ -162,7 +165,7 @@ * <td valign="TOP">none</td> * <td valign="TOP">null (draw text using font glyphs)</td> * </tr> - * <tr style="background-color:#eeeeff"> + * <tr> * <td valign="TOP">{@link #FOREGROUND}</td> * <td valign="TOP">{@link java.awt.Paint}</td> * <td valign="TOP">none</td> @@ -174,7 +177,7 @@ * <td valign="TOP">none</td> * <td valign="TOP">null (do not render background)</td> * </tr> - * <tr style="background-color:#eeeeff"> + * <tr> * <td valign="TOP">{@link #UNDERLINE}</td> * <td valign="TOP">Integer</td> * <td valign="TOP">UNDERLINE_ON</td> @@ -186,7 +189,7 @@ * <td valign="TOP">STRIKETHROUGH_ON</td> * <td valign="TOP">false (do not render strikethrough)</td> * </tr> - * <tr style="background-color:#eeeeff"> + * <tr> * <td valign="TOP">{@link #RUN_DIRECTION}</td> * <td valign="TOP">Boolean</td> * <td valign="TOP">RUN_DIRECTION_LTR<br>RUN_DIRECTION_RTL</td> @@ -198,7 +201,7 @@ * <td valign="TOP">none</td> * <td valign="TOP">0 (use base line direction)</td> * </tr> - * <tr style="background-color:#eeeeff"> + * <tr> * <td valign="TOP">{@link #JUSTIFICATION}</td> * <td valign="TOP">Number</td> * <td valign="TOP">JUSTIFICATION_FULL</td> @@ -210,7 +213,7 @@ * <td valign="TOP">(see class)</td> * <td valign="TOP">null (do not apply input highlighting)</td> * </tr> - * <tr style="background-color:#eeeeff"> + * <tr> * <td valign="TOP">{@link #INPUT_METHOD_UNDERLINE}</td> * <td valign="TOP">Integer</td> * <td valign="TOP">UNDERLINE_LOW_ONE_PIXEL,<br>UNDERLINE_LOW_TWO_PIXEL</td> @@ -222,7 +225,7 @@ * <td valign="TOP">SWAP_COLORS_ON</td> * <td valign="TOP">false (do not swap colors)</td> * </tr> - * <tr style="background-color:#eeeeff"> + * <tr> * <td valign="TOP">{@link #NUMERIC_SHAPING}</td> * <td valign="TOP">{@link java.awt.font.NumericShaper}</td> * <td valign="TOP">none</td> @@ -234,7 +237,7 @@ * <td valign="TOP">KERNING_ON</td> * <td valign="TOP">0 (do not request kerning)</td> * </tr> - * <tr style="background-color:#eeeeff"> + * <tr> * <td valign="TOP">{@link #LIGATURES}</td> * <td valign="TOP">Integer</td> * <td valign="TOP">LIGATURES_ON</td> @@ -246,6 +249,7 @@ * <td valign="TOP">TRACKING_LOOSE, TRACKING_TIGHT</td> * <td valign="TOP">0 (do not add tracking)</td> * </tr> + * </tbody> * </table> * * @see java.awt.Font
--- a/src/java.desktop/share/classes/java/awt/geom/Path2D.java Fri Jun 16 09:20:39 2017 -0700 +++ b/src/java.desktop/share/classes/java/awt/geom/Path2D.java Sat Jun 17 08:03:05 2017 +0100 @@ -876,13 +876,18 @@ * <p> * The following byte value constants are used in the serialized form * of {@code Path2D} objects: - * <table> + * + * <table class="striped"> + * <caption>Constants</caption> + * <thead> * <tr> * <th>Constant Name</th> * <th>Byte Value</th> * <th>Followed by</th> * <th>Description</th> * </tr> + * </thead> + * <tbody> * <tr> * <td>{@code SERIAL_STORAGE_FLT_ARRAY}</td> * <td>0x30</td> @@ -956,6 +961,7 @@ * <td>0x61</td> * <td></td> * <td>There are no more path segments following.</td> + * </tbody> * </table> * * @since 1.6 @@ -1635,13 +1641,17 @@ * <p> * The following byte value constants are used in the serialized form * of {@code Path2D} objects: - * <table> + * <table class="striped"> + * <caption>Constants</caption> + * <thead> * <tr> * <th>Constant Name</th> * <th>Byte Value</th> * <th>Followed by</th> * <th>Description</th> * </tr> + * </thead> + * <tbody> * <tr> * <td>{@code SERIAL_STORAGE_FLT_ARRAY}</td> * <td>0x30</td> @@ -1715,6 +1725,7 @@ * <td>0x61</td> * <td></td> * <td>There are no more path segments following.</td> + * </tbody> * </table> * * @since 1.6
--- a/src/java.desktop/share/classes/javax/accessibility/AccessibilityProvider.java Fri Jun 16 09:20:39 2017 -0700 +++ b/src/java.desktop/share/classes/javax/accessibility/AccessibilityProvider.java Sat Jun 17 08:03:05 2017 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 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 @@ -22,25 +22,26 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + package javax.accessibility; /** * Service Provider Interface (SPI) for Assistive Technology. * <p> - * This service provider class provides mappings from the platform - * specific accessibility APIs to the Java Accessibility API. + * This service provider class provides mappings from the platform specific + * accessibility APIs to the Java Accessibility API. * <p> * Each service provider implementation is named and can be activated via the * {@link #activate} method. Service providers can be loaded when the default * {@link java.awt.Toolkit toolkit} is initialized. * * @apiNote There will typically be one provider per platform, such as Windows - * or Linux, to support accessibility for screen readers and magnifiers. However, - * more than one service provider can be activated. For example, a test tool - * which provides visual results obtained by interrogating the Java Accessibility - * API can be activated along with the activation of the support for screen readers - * and screen magnifiers. - * + * or Linux, to support accessibility for screen readers and + * magnifiers. However, more than one service provider can be + * activated. For example, a test tool which provides visual results + * obtained by interrogating the Java Accessibility API can be + * activated along with the activation of the support for screen + * readers and screen magnifiers. * @see java.awt.Toolkit#getDefaultToolkit * @see java.util.ServiceLoader * @since 9 @@ -50,25 +51,34 @@ /** * Initializes a new accessibility provider. * - * @throws SecurityException - * If a security manager has been installed and it denies - * {@link RuntimePermission} {@code "accessibilityProvider"} + * @throws SecurityException If a security manager has been installed and it + * denies {@link RuntimePermission} {@code "accessibilityProvider"} */ protected AccessibilityProvider() { - // Use a permission check when calling a private constructor to check that - // the proper security permission has been granted before the Object superclass - // is called. If an exception is thrown before the Object superclass is - // constructed a finalizer in a subclass of this class will not be run. - // This protects against a finalizer vulnerability. + // Use a permission check when calling a private constructor to check + // that the proper security permission has been granted before the + // {@code Object} superclass is called. If an exception is thrown before + // the {@code Object} superclass is constructed a finalizer in a + // subclass of this class will not be run. This protects against a + // finalizer vulnerability. this(checkPermission()); } + /** + * Allows to check a permission before the {@code Object} is called. + * + * @param ignore unused stub to call a {@link #checkPermission()}} + */ private AccessibilityProvider(Void ignore) { } /** * If this code is running with a security manager and if the permission - * "accessibilityProvider" has not been granted SecurityException will be thrown. + * {@code "accessibilityProvider"} has not been granted + * {@code SecurityException} will be thrown. * + * @return {@code null} if {@code SecurityException} was not thrown + * @throws SecurityException If a security manager has been installed and it + * denies {@link RuntimePermission} {@code "accessibilityProvider"} */ private static Void checkPermission() { SecurityManager sm = System.getSecurityManager(); @@ -78,7 +88,7 @@ } /** - * Returns the name of this service provider. This name is used to locate a + * Returns the name of this service provider. This name is used to locate a * requested service provider. * * @return the name of this service provider @@ -89,5 +99,4 @@ * Activates the support provided by this service provider. */ public abstract void activate(); - }
--- a/src/java.desktop/share/classes/javax/accessibility/Accessible.java Fri Jun 16 09:20:39 2017 -0700 +++ b/src/java.desktop/share/classes/javax/accessibility/Accessible.java Sat Jun 17 08:03:05 2017 +0100 @@ -26,26 +26,26 @@ package javax.accessibility; /** - * Interface Accessible is the main interface for the accessibility package. - * All components that support - * the accessibility package must implement this interface. - * It contains a single method, {@link #getAccessibleContext}, which - * returns an instance of the class {@link AccessibleContext}. + * Interface {@code Accessible} is the main interface for the accessibility + * package. All components that support the accessibility package must implement + * this interface. It contains a single method, {@link #getAccessibleContext}, + * which returns an instance of the class {@link AccessibleContext}. * - * @author Peter Korn - * @author Hans Muller - * @author Willie Walker + * @author Peter Korn + * @author Hans Muller + * @author Willie Walker */ public interface Accessible { /** - * Returns the AccessibleContext associated with this object. In most - * cases, the return value should not be null if the object implements - * interface Accessible. If a component developer creates a subclass - * of an object that implements Accessible, and that subclass - * is not Accessible, the developer should override the - * getAccessibleContext method to return null. - * @return the AccessibleContext associated with this object + * Returns the {@code AccessibleContext} associated with this object. In + * most cases, the return value should not be {@code null} if the object + * implements interface {@code Accessible}. If a component developer creates + * a subclass of an object that implements {@code Accessible}, and that + * subclass is not {@code Accessible}, the developer should override the + * {@code getAccessibleContext} method to return {@code null}. + * + * @return the {@code AccessibleContext} associated with this object */ public AccessibleContext getAccessibleContext(); }
--- a/src/java.desktop/share/classes/javax/accessibility/AccessibleAction.java Fri Jun 16 09:20:39 2017 -0700 +++ b/src/java.desktop/share/classes/javax/accessibility/AccessibleAction.java Sat Jun 17 08:03:05 2017 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 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 @@ -26,31 +26,31 @@ package javax.accessibility; /** - * The AccessibleAction interface should be supported by any object - * that can perform one or more actions. This interface - * provides the standard mechanism for an assistive technology to determine - * what those actions are as well as tell the object to perform them. - * Any object that can be manipulated should support this - * interface. Applications can determine if an object supports the - * AccessibleAction interface by first obtaining its AccessibleContext (see - * {@link Accessible}) and then calling the {@link AccessibleContext#getAccessibleAction} - * method. If the return value is not null, the object supports this interface. + * The {@code AccessibleAction} interface should be supported by any object that + * can perform one or more actions. This interface provides the standard + * mechanism for an assistive technology to determine what those actions are as + * well as tell the object to perform them. Any object that can be manipulated + * should support this interface. Applications can determine if an object + * supports the {@code AccessibleAction} interface by first obtaining its + * {@code AccessibleContext} (see {@link Accessible}) and then calling the + * {@link AccessibleContext#getAccessibleAction} method. If the return value is + * not {@code null}, the object supports this interface. * + * @author Peter Korn + * @author Hans Muller + * @author Willie Walker + * @author Lynn Monsanto * @see Accessible * @see Accessible#getAccessibleContext * @see AccessibleContext * @see AccessibleContext#getAccessibleAction - * - * @author Peter Korn - * @author Hans Muller - * @author Willie Walker - * @author Lynn Monsanto */ public interface AccessibleAction { /** - * An action which causes a tree node to - * collapse if expanded and expand if collapsed. + * An action which causes a tree node to collapse if expanded and expand if + * collapsed. + * * @since 1.5 */ public static final String TOGGLE_EXPAND = @@ -58,6 +58,7 @@ /** * An action which increments a value. + * * @since 1.5 */ public static final String INCREMENT = @@ -66,6 +67,7 @@ /** * An action which decrements a value. + * * @since 1.5 */ public static final String DECREMENT = @@ -73,6 +75,7 @@ /** * An action which causes a component to execute its default action. + * * @since 1.6 */ public static final String CLICK = new String("click"); @@ -80,33 +83,34 @@ /** * An action which causes a popup to become visible if it is hidden and * hidden if it is visible. + * * @since 1.6 */ public static final String TOGGLE_POPUP = new String("toggle popup"); /** - * Returns the number of accessible actions available in this object - * If there are more than one, the first one is considered the "default" - * action of the object. + * Returns the number of accessible actions available in this object If + * there are more than one, the first one is considered the "default" action + * of the object. * - * @return the zero-based number of Actions in this object + * @return the zero-based number of actions in this object */ public int getAccessibleActionCount(); /** * Returns a description of the specified action of the object. * - * @param i zero-based index of the actions - * @return a String description of the action + * @param i zero-based index of the actions + * @return a {@code String} description of the action * @see #getAccessibleActionCount */ public String getAccessibleActionDescription(int i); /** - * Performs the specified Action on the object + * Performs the specified action on the object. * - * @param i zero-based index of actions - * @return true if the action was performed; otherwise false. + * @param i zero-based index of actions + * @return {@code true} if the action was performed; otherwise {@code false} * @see #getAccessibleActionCount */ public boolean doAccessibleAction(int i);
--- a/src/java.desktop/share/classes/javax/accessibility/AccessibleAttributeSequence.java Fri Jun 16 09:20:39 2017 -0700 +++ b/src/java.desktop/share/classes/javax/accessibility/AccessibleAttributeSequence.java Sat Jun 17 08:03:05 2017 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2005, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -22,51 +22,44 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + package javax.accessibility; import javax.swing.text.AttributeSet; - /** - * <P>The AccessibleAttributeSequence provides information about - * a contiguous sequence of text attributes - * - * @see Accessible - * @see Accessible#getAccessibleContext - * @see AccessibleContext - * @see AccessibleContext#getAccessibleText - * @see AccessibleTextSequence + * This class collects together the span of text that share the same contiguous + * set of attributes, along with that set of attributes. It is used by + * implementors of the class {@code AccessibleContext} in order to generate + * {@code ACCESSIBLE_TEXT_ATTRIBUTES_CHANGED} events. * - * @author Lynn Monsanto - */ - -/** - * This class collects together the span of text that share the same - * contiguous set of attributes, along with that set of attributes. It - * is used by implementors of the class {@code AccessibleContext} in - * order to generate {@code ACCESSIBLE_TEXT_ATTRIBUTES_CHANGED} events. - * - * @see javax.accessibility.AccessibleContext - * @see javax.accessibility.AccessibleContext#ACCESSIBLE_TEXT_ATTRIBUTES_CHANGED + * @see AccessibleContext + * @see AccessibleContext#ACCESSIBLE_TEXT_ATTRIBUTES_CHANGED */ public class AccessibleAttributeSequence { - /** The start index of the text sequence */ + + /** + * The start index of the text sequence. + */ public int startIndex; - /** The end index of the text sequence */ + /** + * The end index of the text sequence. + */ public int endIndex; - /** The text attributes */ + /** + * The text attributes. + */ public AttributeSet attributes; /** * Constructs an {@code AccessibleAttributeSequence} with the given * parameters. * - * @param start the beginning index of the span of text - * @param end the ending index of the span of text - * @param attr the {@code AttributeSet} shared by this text span - * + * @param start the beginning index of the span of text + * @param end the ending index of the span of text + * @param attr the {@code AttributeSet} shared by this text span * @since 1.6 */ public AccessibleAttributeSequence(int start, int end, AttributeSet attr) { @@ -74,5 +67,4 @@ endIndex = end; attributes = attr; } - };
--- a/src/java.desktop/share/classes/javax/accessibility/AccessibleBundle.java Fri Jun 16 09:20:39 2017 -0700 +++ b/src/java.desktop/share/classes/javax/accessibility/AccessibleBundle.java Sat Jun 17 08:03:05 2017 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 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 @@ -27,30 +27,31 @@ import java.util.Enumeration; import java.util.Hashtable; -import java.util.Vector; import java.util.Locale; import java.util.MissingResourceException; import java.util.ResourceBundle; + import sun.awt.AWTAccessor; /** - * <p>Base class used to maintain a strongly typed enumeration. This is - * the superclass of {@link AccessibleState} and {@link AccessibleRole}. - * <p>The toDisplayString method allows you to obtain the localized string - * for a locale independent key from a predefined ResourceBundle for the - * keys defined in this class. This localized string is intended to be + * Base class used to maintain a strongly typed enumeration. This is the + * superclass of {@link AccessibleState} and {@link AccessibleRole}. + * <p> + * The {@link #toDisplayString()} method allows you to obtain the localized + * string for a locale independent key from a predefined {@code ResourceBundle} + * for the keys defined in this class. This localized string is intended to be * readable by humans. * + * @author Willie Walker + * @author Peter Korn + * @author Lynn Monsanto * @see AccessibleRole * @see AccessibleState - * - * @author Willie Walker - * @author Peter Korn - * @author Lynn Monsanto */ public abstract class AccessibleBundle { private static Hashtable<Locale, Hashtable<String, Object>> table = new Hashtable<>(); + private final String defaultResourceBundleName = "com.sun.accessibility.internal.resources.accessibility"; @@ -72,23 +73,24 @@ } /** - * The locale independent name of the state. This is a programmatic - * name that is not intended to be read by humans. + * The locale independent name of the state. This is a programmatic name + * that is not intended to be read by humans. + * * @see #toDisplayString */ protected String key = null; /** - * Obtains the key as a localized string. - * If a localized string cannot be found for the key, the - * locale independent key stored in the role will be returned. - * This method is intended to be used only by subclasses so that they - * can specify their own resource bundles which contain localized + * Obtains the key as a localized string. If a localized string cannot be + * found for the key, the locale independent key stored in the role will be + * returned. This method is intended to be used only by subclasses so that + * they can specify their own resource bundles which contain localized * strings for their keys. - * @param resourceBundleName the name of the resource bundle to use for - * lookup - * @param locale the locale for which to obtain a localized string - * @return a localized String for the key. + * + * @param resourceBundleName the name of the resource bundle to use for + * lookup + * @param locale the locale for which to obtain a localized string + * @return a localized string for the key */ protected String toDisplayString(String resourceBundleName, Locale locale) { @@ -108,12 +110,12 @@ } /** - * Obtains the key as a localized string. - * If a localized string cannot be found for the key, the - * locale independent key stored in the role will be returned. + * Obtains the key as a localized string. If a localized string cannot be + * found for the key, the locale independent key stored in the role will be + * returned. * - * @param locale the locale for which to obtain a localized string - * @return a localized String for the key. + * @param locale the locale for which to obtain a localized string + * @return a localized string for the key */ public String toDisplayString(Locale locale) { return toDisplayString(defaultResourceBundleName, locale); @@ -121,7 +123,8 @@ /** * Gets localized string describing the key using the default locale. - * @return a localized String describing the key for the default locale + * + * @return a localized string describing the key using the default locale */ public String toDisplayString() { return toDisplayString(Locale.getDefault()); @@ -129,14 +132,15 @@ /** * Gets localized string describing the key using the default locale. - * @return a localized String describing the key using the default locale + * + * @return a localized string describing the key using the default locale * @see #toDisplayString */ public String toString() { return toDisplayString(); } - /* + /** * Loads the Accessibility resource bundle if necessary. */ private void loadResourceBundle(String resourceBundleName, @@ -164,5 +168,4 @@ } } } - }
--- a/src/java.desktop/share/classes/javax/accessibility/AccessibleComponent.java Fri Jun 16 09:20:39 2017 -0700 +++ b/src/java.desktop/share/classes/javax/accessibility/AccessibleComponent.java Sat Jun 17 08:03:05 2017 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2003, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 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 @@ -25,36 +25,40 @@ package javax.accessibility; -import java.awt.*; -import java.awt.event.*; +import java.awt.Color; +import java.awt.Cursor; +import java.awt.Dimension; +import java.awt.Font; +import java.awt.FontMetrics; +import java.awt.Point; +import java.awt.Rectangle; +import java.awt.event.FocusListener; /** - * The AccessibleComponent interface should be supported by any object - * that is rendered on the screen. This interface provides the standard - * mechanism for an assistive technology to determine and set the - * graphical representation of an object. Applications can determine - * if an object supports the AccessibleComponent interface by first - * obtaining its AccessibleContext - * and then calling the - * {@link AccessibleContext#getAccessibleComponent} method. - * If the return value is not null, the object supports this interface. + * The {@code AccessibleComponent} interface should be supported by any object + * that is rendered on the screen. This interface provides the standard + * mechanism for an assistive technology to determine and set the graphical + * representation of an object. Applications can determine if an object supports + * the {@code AccessibleComponent} interface by first obtaining its + * {@code AccessibleContext} and then calling the + * {@link AccessibleContext#getAccessibleComponent} method. If the return value + * is not {@code null}, the object supports this interface. * + * @author Peter Korn + * @author Hans Muller + * @author Willie Walker * @see Accessible * @see Accessible#getAccessibleContext * @see AccessibleContext * @see AccessibleContext#getAccessibleComponent - * - * @author Peter Korn - * @author Hans Muller - * @author Willie Walker */ public interface AccessibleComponent { /** * Gets the background color of this object. * - * @return the background color, if supported, of the object; - * otherwise, null + * @return the background color, if supported, of the object; otherwise, + * {@code null} * @see #setBackground */ public Color getBackground(); @@ -62,7 +66,7 @@ /** * Sets the background color of this object. * - * @param c the new Color for the background + * @param c the new color for the background * @see #setBackground */ public void setBackground(Color c); @@ -70,8 +74,8 @@ /** * Gets the foreground color of this object. * - * @return the foreground color, if supported, of the object; - * otherwise, null + * @return the foreground color, if supported, of the object; otherwise, + * {@code null} * @see #setForeground */ public Color getForeground(); @@ -79,58 +83,59 @@ /** * Sets the foreground color of this object. * - * @param c the new Color for the foreground + * @param c the new color for the foreground * @see #getForeground */ public void setForeground(Color c); /** - * Gets the Cursor of this object. + * Gets the cursor of this object. * - * @return the Cursor, if supported, of the object; otherwise, null + * @return the cursor, if supported, of the object; otherwise, {@code null} * @see #setCursor */ public Cursor getCursor(); /** - * Sets the Cursor of this object. + * Sets the cursor of this object. * - * @param cursor the new Cursor for the object + * @param cursor the new cursor for the object * @see #getCursor */ public void setCursor(Cursor cursor); /** - * Gets the Font of this object. + * Gets the font of this object. * - * @return the Font,if supported, for the object; otherwise, null + * @return the font, if supported, for the object; otherwise, {@code null} * @see #setFont */ public Font getFont(); /** - * Sets the Font of this object. + * Sets the font of this object. * - * @param f the new Font for the object + * @param f the new font for the object * @see #getFont */ public void setFont(Font f); /** - * Gets the FontMetrics of this object. + * Gets the {@code FontMetrics} of this object. * - * @param f the Font - * @return the FontMetrics, if supported, the object; otherwise, null + * @param f the font for which font metrics is to be obtained + * @return the {@code FontMetrics}, if supported, the object; otherwise, + * {@code null} * @see #getFont */ public FontMetrics getFontMetrics(Font f); /** - * Determines if the object is enabled. Objects that are enabled - * will also have the AccessibleState.ENABLED state set in their - * AccessibleStateSets. + * Determines if the object is enabled. Objects that are enabled will also + * have the {@code AccessibleState.ENABLED} state set in their + * {@code AccessibleStateSets}. * - * @return true if object is enabled; otherwise, false + * @return {@code true} if object is enabled; otherwise, {@code false} * @see #setEnabled * @see AccessibleContext#getAccessibleStateSet * @see AccessibleState#ENABLED @@ -141,21 +146,23 @@ /** * Sets the enabled state of the object. * - * @param b if true, enables this object; otherwise, disables it + * @param b if {@code true}, enables this object; otherwise, disables it * @see #isEnabled */ public void setEnabled(boolean b); /** - * Determines if the object is visible. Note: this means that the - * object intends to be visible; however, it may not be - * showing on the screen because one of the objects that this object - * is contained by is currently not visible. To determine if an object is - * showing on the screen, use isShowing(). - * <p>Objects that are visible will also have the - * AccessibleState.VISIBLE state set in their AccessibleStateSets. + * Determines if the object is visible. Note: this means that the object + * intends to be visible; however, it may not be showing on the screen + * because one of the objects that this object is contained by is currently + * not visible. To determine if an object is showing on the screen, use + * {@link #isShowing()} + * <p> + * Objects that are visible will also have the + * {@code AccessibleState.VISIBLE} state set in their + * {@code AccessibleStateSets}. * - * @return true if object is visible; otherwise, false + * @return {@code true} if object is visible; otherwise, {@code false} * @see #setVisible * @see AccessibleContext#getAccessibleStateSet * @see AccessibleState#VISIBLE @@ -166,29 +173,28 @@ /** * Sets the visible state of the object. * - * @param b if true, shows this object; otherwise, hides it + * @param b if {@code true}, shows this object; otherwise, hides it * @see #isVisible */ public void setVisible(boolean b); /** - * Determines if the object is showing. This is determined by checking - * the visibility of the object and its ancestors. - * Note: this - * will return true even if the object is obscured by another (for example, - * it is underneath a menu that was pulled down). + * Determines if the object is showing. This is determined by checking the + * visibility of the object and its ancestors. Note: this will return + * {@code true} even if the object is obscured by another (for example, it + * is underneath a menu that was pulled down). * - * @return true if object is showing; otherwise, false + * @return {@code true} if object is showing; otherwise, {@code false} */ public boolean isShowing(); /** - * Checks whether the specified point is within this object's bounds, - * where the point's x and y coordinates are defined to be relative to the + * Checks whether the specified point is within this object's bounds, where + * the point's x and y coordinates are defined to be relative to the * coordinate system of the object. * - * @param p the Point relative to the coordinate system of the object - * @return true if object contains Point; otherwise false + * @param p the point relative to the coordinate system of the object + * @return {@code true} if object contains point; otherwise {@code false} * @see #getBounds */ public boolean contains(Point p); @@ -196,21 +202,21 @@ /** * Returns the location of the object on the screen. * - * @return the location of the object on screen; null if this object - * is not on the screen + * @return the location of the object on screen; {@code null} if this object + * is not on the screen * @see #getBounds * @see #getLocation */ public Point getLocationOnScreen(); /** - * Gets the location of the object relative to the parent in the form - * of a point specifying the object's top-left corner in the screen's - * coordinate space. + * Gets the location of the object relative to the parent in the form of a + * point specifying the object's top-left corner in the screen's coordinate + * space. * - * @return An instance of Point representing the top-left corner of the - * object's bounds in the coordinate space of the screen; null if - * this object or its parent are not on the screen + * @return An instance of {@code Point} representing the top-left corner of + * the object's bounds in the coordinate space of the screen; + * {@code null} if this object or its parent are not on the screen * @see #getBounds * @see #getLocationOnScreen */ @@ -218,40 +224,41 @@ /** * Sets the location of the object relative to the parent. - * @param p the new position for the top-left corner + * + * @param p the new position for the top-left corner * @see #getLocation */ public void setLocation(Point p); /** - * Gets the bounds of this object in the form of a Rectangle object. - * The bounds specify this object's width, height, and location - * relative to its parent. + * Gets the bounds of this object in the form of a {@code Rectangle} object. + * The bounds specify this object's width, height, and location relative to + * its parent. * - * @return A rectangle indicating this component's bounds; null if - * this object is not on the screen. + * @return A rectangle indicating this component's bounds; {@code null} if + * this object is not on the screen. * @see #contains */ public Rectangle getBounds(); /** - * Sets the bounds of this object in the form of a Rectangle object. - * The bounds specify this object's width, height, and location - * relative to its parent. + * Sets the bounds of this object in the form of a {@code Rectangle} object. + * The bounds specify this object's width, height, and location relative to + * its parent. * - * @param r rectangle indicating this component's bounds + * @param r rectangle indicating this component's bounds * @see #getBounds */ public void setBounds(Rectangle r); /** - * Returns the size of this object in the form of a Dimension object. - * The height field of the Dimension object contains this object's - * height, and the width field of the Dimension object contains this - * object's width. + * Returns the size of this object in the form of a {@code Dimension} + * object. The {@code height} field of the {@code Dimension} object contains + * this object's height, and the {@code width} field of the + * {@code Dimension} object contains this object's width. * - * @return A Dimension object that indicates the size of this component; - * null if this object is not on the screen + * @return A {@code Dimension} object that indicates the size of this + * component; {@code null} if this object is not on the screen * @see #setSize */ public Dimension getSize(); @@ -259,27 +266,27 @@ /** * Resizes this object so that it has width and height. * - * @param d The dimension specifying the new size of the object. + * @param d The dimension specifying the new size of the object * @see #getSize */ public void setSize(Dimension d); /** - * Returns the Accessible child, if one exists, contained at the local - * coordinate Point. + * Returns the {@code Accessible} child, if one exists, contained at the + * local coordinate {@code Point}. * - * @param p The point relative to the coordinate system of this object. - * @return the Accessible, if it exists, at the specified location; - * otherwise null + * @param p The point relative to the coordinate system of this object + * @return the {@code Accessible}, if it exists, at the specified location; + * otherwise {@code null} */ public Accessible getAccessibleAt(Point p); /** - * Returns whether this object can accept focus or not. Objects that - * can accept focus will also have the AccessibleState.FOCUSABLE state - * set in their AccessibleStateSets. + * Returns whether this object can accept focus or not. Objects that can + * accept focus will also have the {@code AccessibleState.FOCUSABLE} state + * set in their {@code AccessibleStateSets}. * - * @return true if object can accept focus; otherwise false + * @return {@code true} if object can accept focus; otherwise {@code false} * @see AccessibleContext#getAccessibleStateSet * @see AccessibleState#FOCUSABLE * @see AccessibleState#FOCUSED @@ -288,9 +295,9 @@ public boolean isFocusTraversable(); /** - * Requests focus for this object. If this object cannot accept focus, - * nothing will happen. Otherwise, the object will attempt to take - * focus. + * Requests focus for this object. If this object cannot accept focus, + * nothing will happen. Otherwise, the object will attempt to take focus. + * * @see #isFocusTraversable */ public void requestFocus(); @@ -299,7 +306,7 @@ * Adds the specified focus listener to receive focus events from this * component. * - * @param l the focus listener + * @param l the focus listener * @see #removeFocusListener */ public void addFocusListener(FocusListener l); @@ -308,7 +315,7 @@ * Removes the specified focus listener so it no longer receives focus * events from this component. * - * @param l the focus listener + * @param l the focus listener * @see #addFocusListener */ public void removeFocusListener(FocusListener l);
--- a/src/java.desktop/share/classes/javax/accessibility/AccessibleContext.java Fri Jun 16 09:20:39 2017 -0700 +++ b/src/java.desktop/share/classes/javax/accessibility/AccessibleContext.java Sat Jun 17 08:03:05 2017 +0100 @@ -25,63 +25,63 @@ package javax.accessibility; +import java.awt.IllegalComponentStateException; +import java.beans.BeanProperty; +import java.beans.JavaBean; +import java.beans.PropertyChangeEvent; +import java.beans.PropertyChangeListener; +import java.beans.PropertyChangeSupport; +import java.util.Locale; + import sun.awt.AWTAccessor; import sun.awt.AppContext; -import java.util.Locale; -import java.beans.JavaBean; -import java.beans.BeanProperty; -import java.beans.PropertyChangeListener; -import java.beans.PropertyChangeSupport; -import java.beans.PropertyChangeEvent; -import java.awt.IllegalComponentStateException; - /** - * AccessibleContext represents the minimum information all accessible objects - * return. This information includes the accessible name, description, role, - * and state of the object, as well as information about its parent and - * children. AccessibleContext also contains methods for - * obtaining more specific accessibility information about a component. - * If the component supports them, these methods will return an object that - * implements one or more of the following interfaces: + * {@code AccessibleContext} represents the minimum information all accessible + * objects return. This information includes the accessible name, description, + * role, and state of the object, as well as information about its parent and + * children. {@code AccessibleContext} also contains methods for obtaining more + * specific accessibility information about a component. If the component + * supports them, these methods will return an object that implements one or + * more of the following interfaces: * <ul> - * <li>{@link AccessibleAction} - the object can perform one or more actions. - * This interface provides the standard mechanism for an assistive - * technology to determine what those actions are and tell the object - * to perform them. Any object that can be manipulated should - * support this interface. - * <li>{@link AccessibleComponent} - the object has a graphical representation. - * This interface provides the standard mechanism for an assistive - * technology to determine and set the graphical representation of the - * object. Any object that is rendered on the screen should support - * this interface. - * <li>{@link AccessibleSelection} - the object allows its children to be - * selected. This interface provides the standard mechanism for an - * assistive technology to determine the currently selected children of the object - * as well as modify its selection set. Any object that has children - * that can be selected should support this interface. - * <li>{@link AccessibleText} - the object presents editable textual information - * on the display. This interface provides the standard mechanism for - * an assistive technology to access that text via its content, attributes, - * and spatial location. Any object that contains editable text should - * support this interface. - * <li>{@link AccessibleValue} - the object supports a numerical value. This - * interface provides the standard mechanism for an assistive technology - * to determine and set the current value of the object, as well as obtain its - * minimum and maximum values. Any object that supports a numerical value - * should support this interface.</ul> + * <li>{@link AccessibleAction} - the object can perform one or more actions. + * This interface provides the standard mechanism for an assistive technology + * to determine what those actions are and tell the object to perform them. + * Any object that can be manipulated should support this interface. + * <li>{@link AccessibleComponent} - the object has a graphical + * representation. This interface provides the standard mechanism for an + * assistive technology to determine and set the graphical representation of + * the object. Any object that is rendered on the screen should support this + * interface. + * <li>{@link AccessibleSelection} - the object allows its children to be + * selected. This interface provides the standard mechanism for an assistive + * technology to determine the currently selected children of the object as + * well as modify its selection set. Any object that has children that can be + * selected should support this interface. + * <li>{@link AccessibleText} - the object presents editable textual + * information on the display. This interface provides the standard mechanism + * for an assistive technology to access that text via its content, + * attributes, and spatial location. Any object that contains editable text + * should support this interface. + * <li>{@link AccessibleValue} - the object supports a numerical value. This + * interface provides the standard mechanism for an assistive technology to + * determine and set the current value of the object, as well as obtain its + * minimum and maximum values. Any object that supports a numerical value + * should support this interface. + * </ul> * - * @author Peter Korn - * @author Hans Muller - * @author Willie Walker - * @author Lynn Monsanto + * @author Peter Korn + * @author Hans Muller + * @author Willie Walker + * @author Lynn Monsanto */ @JavaBean(description = "Minimal information that all accessible objects return") public abstract class AccessibleContext { /** - * The AppContext that should be used to dispatch events for this - * AccessibleContext + * The {@code AppContext} that should be used to dispatch events for this + * {@code AccessibleContext}. */ private volatile AppContext targetAppContext; @@ -109,115 +109,118 @@ }); } - /** - * Constant used to determine when the accessibleName property has - * changed. The old value in the PropertyChangeEvent will be the old - * accessibleName and the new value will be the new accessibleName. - * - * @see #getAccessibleName - * @see #addPropertyChangeListener - */ - public static final String ACCESSIBLE_NAME_PROPERTY = "AccessibleName"; - - /** - * Constant used to determine when the accessibleDescription property has - * changed. The old value in the PropertyChangeEvent will be the - * old accessibleDescription and the new value will be the new - * accessibleDescription. - * - * @see #getAccessibleDescription - * @see #addPropertyChangeListener - */ - public static final String ACCESSIBLE_DESCRIPTION_PROPERTY = "AccessibleDescription"; + /** + * Constant used to determine when the {@link #accessibleName} property has + * changed. The old value in the {@code PropertyChangeEvent} will be the old + * {@code accessibleName} and the new value will be the new + * {@code accessibleName}. + * + * @see #getAccessibleName + * @see #addPropertyChangeListener + */ + public static final String ACCESSIBLE_NAME_PROPERTY = "AccessibleName"; - /** - * Constant used to determine when the accessibleStateSet property has - * changed. The old value will be the old AccessibleState and the new - * value will be the new AccessibleState in the accessibleStateSet. - * For example, if a component that supports the vertical and horizontal - * states changes its orientation from vertical to horizontal, the old - * value will be AccessibleState.VERTICAL and the new value will be - * AccessibleState.HORIZONTAL. Please note that either value can also - * be null. For example, when a component changes from being enabled - * to disabled, the old value will be AccessibleState.ENABLED - * and the new value will be null. - * - * @see #getAccessibleStateSet - * @see AccessibleState - * @see AccessibleStateSet - * @see #addPropertyChangeListener - */ - public static final String ACCESSIBLE_STATE_PROPERTY = "AccessibleState"; - - /** - * Constant used to determine when the accessibleValue property has - * changed. The old value in the PropertyChangeEvent will be a Number - * representing the old value and the new value will be a Number - * representing the new value - * - * @see #getAccessibleValue - * @see #addPropertyChangeListener - */ - public static final String ACCESSIBLE_VALUE_PROPERTY = "AccessibleValue"; + /** + * Constant used to determine when the {@link #accessibleDescription} + * property has changed. The old value in the {@code PropertyChangeEvent} + * will be the old {@code accessibleDescription} and the new value will be + * the new {@code accessibleDescription}. + * + * @see #getAccessibleDescription + * @see #addPropertyChangeListener + */ + public static final String ACCESSIBLE_DESCRIPTION_PROPERTY = "AccessibleDescription"; - /** - * Constant used to determine when the accessibleSelection has changed. - * The old and new values in the PropertyChangeEvent are currently - * reserved for future use. - * - * @see #getAccessibleSelection - * @see #addPropertyChangeListener - */ - public static final String ACCESSIBLE_SELECTION_PROPERTY = "AccessibleSelection"; - - /** - * Constant used to determine when the accessibleText caret has changed. - * The old value in the PropertyChangeEvent will be an - * integer representing the old caret position, and the new value will - * be an integer representing the new/current caret position. - * - * @see #addPropertyChangeListener - */ - public static final String ACCESSIBLE_CARET_PROPERTY = "AccessibleCaret"; + /** + * Constant used to determine when the {@code accessibleStateSet} property + * has changed. The old value will be the old {@code AccessibleState} and + * the new value will be the new {@code AccessibleState} in the + * {@code accessibleStateSet}. For example, if a component that supports the + * vertical and horizontal states changes its orientation from vertical to + * horizontal, the old value will be {@code AccessibleState.VERTICAL} and + * the new value will be {@code AccessibleState.HORIZONTAL}. Please note + * that either value can also be {@code null}. For example, when a component + * changes from being enabled to disabled, the old value will be + * {@code AccessibleState.ENABLED} and the new value will be {@code null}. + * + * @see #getAccessibleStateSet + * @see AccessibleState + * @see AccessibleStateSet + * @see #addPropertyChangeListener + */ + public static final String ACCESSIBLE_STATE_PROPERTY = "AccessibleState"; - /** - * Constant used to determine when the visual appearance of the object - * has changed. The old and new values in the PropertyChangeEvent are - * currently reserved for future use. - * - * @see #addPropertyChangeListener - */ - public static final String ACCESSIBLE_VISIBLE_DATA_PROPERTY = "AccessibleVisibleData"; - - /** - * Constant used to determine when Accessible children are added/removed - * from the object. If an Accessible child is being added, the old - * value will be null and the new value will be the Accessible child. If an - * Accessible child is being removed, the old value will be the Accessible - * child, and the new value will be null. - * - * @see #addPropertyChangeListener - */ - public static final String ACCESSIBLE_CHILD_PROPERTY = "AccessibleChild"; - - /** - * Constant used to determine when the active descendant of a component - * has changed. The active descendant is used for objects such as - * list, tree, and table, which may have transient children. When the - * active descendant has changed, the old value of the property change - * event will be the Accessible representing the previous active child, and - * the new value will be the Accessible representing the current active - * child. - * - * @see #addPropertyChangeListener - */ - public static final String ACCESSIBLE_ACTIVE_DESCENDANT_PROPERTY = "AccessibleActiveDescendant"; + /** + * Constant used to determine when the {@code accessibleValue} property has + * changed. The old value in the {@code PropertyChangeEvent} will be a + * {@code Number} representing the old value and the new value will be a + * {@code Number} representing the new value. + * + * @see #getAccessibleValue + * @see #addPropertyChangeListener + */ + public static final String ACCESSIBLE_VALUE_PROPERTY = "AccessibleValue"; /** - * Constant used to indicate that the table caption has changed - * The old value in the PropertyChangeEvent will be an Accessible - * representing the previous table caption and the new value will - * be an Accessible representing the new table caption. + * Constant used to determine when the {@code accessibleSelection} has + * changed. The old and new values in the {@code PropertyChangeEvent} are + * currently reserved for future use. + * + * @see #getAccessibleSelection + * @see #addPropertyChangeListener + */ + public static final String ACCESSIBLE_SELECTION_PROPERTY = "AccessibleSelection"; + + /** + * Constant used to determine when the {@code accessibleText} caret has + * changed. The old value in the {@code PropertyChangeEvent} will be an + * integer representing the old caret position, and the new value will be an + * integer representing the new/current caret position. + * + * @see #addPropertyChangeListener + */ + public static final String ACCESSIBLE_CARET_PROPERTY = "AccessibleCaret"; + + /** + * Constant used to determine when the visual appearance of the object has + * changed. The old and new values in the {@code PropertyChangeEvent} are + * currently reserved for future use. + * + * @see #addPropertyChangeListener + */ + public static final String ACCESSIBLE_VISIBLE_DATA_PROPERTY = "AccessibleVisibleData"; + + /** + * Constant used to determine when {@code Accessible} children are + * added/removed from the object. If an {@code Accessible} child is being + * added, the old value will be {@code null} and the new value will be the + * {@code Accessible} child. If an {@code Accessible} child is being + * removed, the old value will be the {@code Accessible} child, and the new + * value will be {@code null}. + * + * @see #addPropertyChangeListener + */ + public static final String ACCESSIBLE_CHILD_PROPERTY = "AccessibleChild"; + + /** + * Constant used to determine when the active descendant of a component has + * changed. The active descendant is used for objects such as list, tree, + * and table, which may have transient children. When the active descendant + * has changed, the old value of the property change event will be the + * {@code Accessible} representing the previous active child, and the new + * value will be the {@code Accessible} representing the current active + * child. + * + * @see #addPropertyChangeListener + */ + public static final String ACCESSIBLE_ACTIVE_DESCENDANT_PROPERTY = "AccessibleActiveDescendant"; + + /** + * Constant used to indicate that the table caption has changed. The old + * value in the {@code PropertyChangeEvent} will be an {@code Accessible} + * representing the previous table caption and the new value will be an + * {@code Accessible} representing the new table caption. + * * @see Accessible * @see AccessibleTable */ @@ -225,10 +228,11 @@ "accessibleTableCaptionChanged"; /** - * Constant used to indicate that the table summary has changed - * The old value in the PropertyChangeEvent will be an Accessible - * representing the previous table summary and the new value will - * be an Accessible representing the new table summary. + * Constant used to indicate that the table summary has changed. The old + * value in the {@code PropertyChangeEvent} will be an {@code Accessible} + * representing the previous table summary and the new value will be an + * {@code Accessible} representing the new table summary. + * * @see Accessible * @see AccessibleTable */ @@ -236,10 +240,11 @@ "accessibleTableSummaryChanged"; /** - * Constant used to indicate that table data has changed. - * The old value in the PropertyChangeEvent will be null and the - * new value will be an AccessibleTableModelChange representing - * the table change. + * Constant used to indicate that table data has changed. The old value in + * the {@code PropertyChangeEvent} will be {@code null} and the new value + * will be an {@code AccessibleTableModelChange} representing the table + * change. + * * @see AccessibleTable * @see AccessibleTableModelChange */ @@ -247,10 +252,11 @@ "accessibleTableModelChanged"; /** - * Constant used to indicate that the row header has changed - * The old value in the PropertyChangeEvent will be null and the - * new value will be an AccessibleTableModelChange representing - * the header change. + * Constant used to indicate that the row header has changed. The old value + * in the {@code PropertyChangeEvent} will be {@code null} and the new value + * will be an {@code AccessibleTableModelChange} representing the header + * change. + * * @see AccessibleTable * @see AccessibleTableModelChange */ @@ -258,19 +264,21 @@ "accessibleTableRowHeaderChanged"; /** - * Constant used to indicate that the row description has changed - * The old value in the PropertyChangeEvent will be null and the - * new value will be an Integer representing the row index. + * Constant used to indicate that the row description has changed. The old + * value in the {@code PropertyChangeEvent} will be {@code null} and the new + * value will be an {@code Integer} representing the row index. + * * @see AccessibleTable */ public static final String ACCESSIBLE_TABLE_ROW_DESCRIPTION_CHANGED = "accessibleTableRowDescriptionChanged"; /** - * Constant used to indicate that the column header has changed - * The old value in the PropertyChangeEvent will be null and the - * new value will be an AccessibleTableModelChange representing - * the header change. + * Constant used to indicate that the column header has changed. The old + * value in the {@code PropertyChangeEvent} will be {@code null} and the new + * value will be an {@code AccessibleTableModelChange} representing the + * header change. + * * @see AccessibleTable * @see AccessibleTableModelChange */ @@ -278,20 +286,22 @@ "accessibleTableColumnHeaderChanged"; /** - * Constant used to indicate that the column description has changed - * The old value in the PropertyChangeEvent will be null and the - * new value will be an Integer representing the column index. + * Constant used to indicate that the column description has changed. The + * old value in the {@code PropertyChangeEvent} will be {@code null} and the + * new value will be an {@code Integer} representing the column index. + * * @see AccessibleTable */ public static final String ACCESSIBLE_TABLE_COLUMN_DESCRIPTION_CHANGED = "accessibleTableColumnDescriptionChanged"; /** - * Constant used to indicate that the supported set of actions - * has changed. The old value in the PropertyChangeEvent will - * be an Integer representing the old number of actions supported - * and the new value will be an Integer representing the new - * number of actions supported. + * Constant used to indicate that the supported set of actions has changed. + * The old value in the {@code PropertyChangeEvent} will be an + * {@code Integer} representing the old number of actions supported and the + * new value will be an {@code Integer} representing the new number of + * actions supported. + * * @see AccessibleAction */ public static final String ACCESSIBLE_ACTION_PROPERTY = @@ -299,30 +309,33 @@ /** * Constant used to indicate that a hypertext element has received focus. - * The old value in the PropertyChangeEvent will be an Integer - * representing the start index in the document of the previous element - * that had focus and the new value will be an Integer representing - * the start index in the document of the current element that has - * focus. A value of -1 indicates that an element does not or did - * not have focus. + * The old value in the {@code PropertyChangeEvent} will be an + * {@code Integer} representing the start index in the document of the + * previous element that had focus and the new value will be an + * {@code Integer} representing the start index in the document of the + * current element that has focus. A value of -1 indicates that an element + * does not or did not have focus. + * * @see AccessibleHyperlink */ public static final String ACCESSIBLE_HYPERTEXT_OFFSET = "AccessibleHypertextOffset"; /** - * PropertyChangeEvent which indicates that text has changed. + * {@code PropertyChangeEvent} which indicates that text has changed. * <br> - * For text insertion, the oldValue is null and the newValue - * is an AccessibleTextSequence specifying the text that was - * inserted. + * For text insertion, the {@code oldValue} is {@code null} and the + * {@code newValue} is an {@code AccessibleTextSequence} specifying the text + * that was inserted. * <br> - * For text deletion, the oldValue is an AccessibleTextSequence - * specifying the text that was deleted and the newValue is null. + * For text deletion, the {@code oldValue} is an + * {@code AccessibleTextSequence} specifying the text that was deleted and + * the {@code newValue} is {@code null}. * <br> - * For text replacement, the oldValue is an AccessibleTextSequence - * specifying the old text and the newValue is an AccessibleTextSequence - * specifying the new text. + * For text replacement, the {@code oldValue} is an + * {@code AccessibleTextSequence} specifying the old text and the + * {@code newValue} is an {@code AccessibleTextSequence} specifying the new + * text. * * @see #getAccessibleText * @see #addPropertyChangeListener @@ -332,53 +345,51 @@ = "AccessibleText"; /** - * PropertyChangeEvent which indicates that a significant change - * has occurred to the children of a component like a tree or text. - * This change notifies the event listener that it needs to - * reacquire the state of the subcomponents. The oldValue is - * null and the newValue is the component whose children have - * become invalid. + * {@code PropertyChangeEvent} which indicates that a significant change has + * occurred to the children of a component like a tree or text. This change + * notifies the event listener that it needs to reacquire the state of the + * subcomponents. The {@code oldValue} is {@code null} and the + * {@code newValue} is the component whose children have become invalid. * * @see #getAccessibleText * @see #addPropertyChangeListener * @see AccessibleTextSequence - * * @since 1.5 */ public static final String ACCESSIBLE_INVALIDATE_CHILDREN = "accessibleInvalidateChildren"; - /** - * PropertyChangeEvent which indicates that text attributes have changed. + /** + * {@code PropertyChangeEvent} which indicates that text attributes have + * changed. * <br> - * For attribute insertion, the oldValue is null and the newValue - * is an AccessibleAttributeSequence specifying the attributes that were - * inserted. + * For attribute insertion, the {@code oldValue} is {@code null} and the + * {@code newValue} is an {@code AccessibleAttributeSequence} specifying the + * attributes that were inserted. * <br> - * For attribute deletion, the oldValue is an AccessibleAttributeSequence - * specifying the attributes that were deleted and the newValue is null. + * For attribute deletion, the {@code oldValue} is an + * {@code AccessibleAttributeSequence} specifying the attributes that were + * deleted and the {@code newValue} is {@code null}. * <br> - * For attribute replacement, the oldValue is an AccessibleAttributeSequence - * specifying the old attributes and the newValue is an - * AccessibleAttributeSequence specifying the new attributes. + * For attribute replacement, the {@code oldValue} is an + * {@code AccessibleAttributeSequence} specifying the old attributes and the + * {@code newValue} is an {@code AccessibleAttributeSequence} specifying the + * new attributes. * * @see #getAccessibleText * @see #addPropertyChangeListener * @see AccessibleAttributeSequence - * * @since 1.5 */ public static final String ACCESSIBLE_TEXT_ATTRIBUTES_CHANGED = "accessibleTextAttributesChanged"; - /** - * PropertyChangeEvent which indicates that a change has occurred - * in a component's bounds. - * The oldValue is the old component bounds and the newValue is - * the new component bounds. + /** + * {@code PropertyChangeEvent} which indicates that a change has occurred in + * a component's bounds. The {@code oldValue} is the old component bounds + * and the {@code newValue} is the new component bounds. * * @see #addPropertyChangeListener - * * @since 1.5 */ public static final String ACCESSIBLE_COMPONENT_BOUNDS_CHANGED = @@ -418,7 +429,8 @@ private PropertyChangeSupport accessibleChangeSupport = null; /** - * Used to represent the context's relation set + * Used to represent the context's relation set. + * * @see #getAccessibleRelationSet */ private AccessibleRelationSet relationSet @@ -427,18 +439,17 @@ private Object nativeAXResource; /** - * Gets the accessibleName property of this object. The accessibleName - * property of an object is a localized String that designates the purpose - * of the object. For example, the accessibleName property of a label - * or button might be the text of the label or button itself. In the - * case of an object that doesn't display its name, the accessibleName - * should still be set. For example, in the case of a text field used - * to enter the name of a city, the accessibleName for the en_US locale - * could be 'city.' + * Gets the {@code accessibleName} property of this object. The + * {@code accessibleName} property of an object is a localized + * {@code String} that designates the purpose of the object. For example, + * the {@code accessibleName} property of a label or button might be the + * text of the label or button itself. In the case of an object that doesn't + * display its name, the {@code accessibleName} should still be set. For + * example, in the case of a text field used to enter the name of a city, + * the {@code accessibleName} for the {@code en_US} locale could be 'city.' * - * @return the localized name of the object; null if this - * object does not have a name - * + * @return the localized name of the object; {@code null} if this object + * does not have a name * @see #setAccessibleName */ public String getAccessibleName() { @@ -446,12 +457,11 @@ } /** - * Sets the localized accessible name of this object. Changing the - * name will cause a PropertyChangeEvent to be fired for the - * ACCESSIBLE_NAME_PROPERTY property. + * Sets the localized accessible name of this object. Changing the name will + * cause a {@code PropertyChangeEvent} to be fired for the + * {@code ACCESSIBLE_NAME_PROPERTY} property. * - * @param s the new localized name of the object. - * + * @param s the new localized name of the object * @see #getAccessibleName * @see #addPropertyChangeListener */ @@ -464,15 +474,14 @@ } /** - * Gets the accessibleDescription property of this object. The - * accessibleDescription property of this object is a short localized - * phrase describing the purpose of the object. For example, in the - * case of a 'Cancel' button, the accessibleDescription could be + * Gets the {@code accessibleDescription} property of this object. The + * {@code accessibleDescription} property of this object is a short + * localized phrase describing the purpose of the object. For example, in + * the case of a 'Cancel' button, the {@code accessibleDescription} could be * 'Ignore changes and close dialog box.' * - * @return the localized description of the object; null if - * this object does not have a description - * + * @return the localized description of the object; {@code null} if this + * object does not have a description * @see #setAccessibleDescription */ public String getAccessibleDescription() { @@ -480,12 +489,11 @@ } /** - * Sets the accessible description of this object. Changing the - * name will cause a PropertyChangeEvent to be fired for the - * ACCESSIBLE_DESCRIPTION_PROPERTY property. + * Sets the accessible description of this object. Changing the name will + * cause a {@code PropertyChangeEvent} to be fired for the + * {@code ACCESSIBLE_DESCRIPTION_PROPERTY} property. * - * @param s the new localized description of the object - * + * @param s the new localized description of the object * @see #setAccessibleName * @see #addPropertyChangeListener */ @@ -499,33 +507,36 @@ } /** - * Gets the role of this object. The role of the object is the generic - * purpose or use of the class of this object. For example, the role - * of a push button is AccessibleRole.PUSH_BUTTON. The roles in - * AccessibleRole are provided so component developers can pick from - * a set of predefined roles. This enables assistive technologies to - * provide a consistent interface to various tweaked subclasses of - * components (e.g., use AccessibleRole.PUSH_BUTTON for all components - * that act like a push button) as well as distinguish between subclasses - * that behave differently (e.g., AccessibleRole.CHECK_BOX for check boxes - * and AccessibleRole.RADIO_BUTTON for radio buttons). - * <p>Note that the AccessibleRole class is also extensible, so - * custom component developers can define their own AccessibleRole's - * if the set of predefined roles is inadequate. + * Gets the role of this object. The role of the object is the generic + * purpose or use of the class of this object. For example, the role of a + * push button is {@code AccessibleRole.PUSH_BUTTON}. The roles in + * {@code AccessibleRole} are provided so component developers can pick from + * a set of predefined roles. This enables assistive technologies to provide + * a consistent interface to various tweaked subclasses of components (e.g., + * use {@code AccessibleRole.PUSH_BUTTON} for all components that act like a + * push button) as well as distinguish between subclasses that behave + * differently (e.g., {@code AccessibleRole.CHECK_BOX} for check boxes and + * {@code AccessibleRole.RADIO_BUTTON} for radio buttons). + * <p> + * Note that the {@code AccessibleRole} class is also extensible, so custom + * component developers can define their own {@code AccessibleRole}'s if the + * set of predefined roles is inadequate. * - * @return an instance of AccessibleRole describing the role of the object + * @return an instance of {@code AccessibleRole} describing the role of the + * object * @see AccessibleRole */ public abstract AccessibleRole getAccessibleRole(); /** - * Gets the state set of this object. The AccessibleStateSet of an object - * is composed of a set of unique AccessibleStates. A change in the - * AccessibleStateSet of an object will cause a PropertyChangeEvent to - * be fired for the ACCESSIBLE_STATE_PROPERTY property. + * Gets the state set of this object. The {@code AccessibleStateSet} of an + * object is composed of a set of unique {@code AccessibleStates}. A change + * in the {@code AccessibleStateSet} of an object will cause a + * {@code PropertyChangeEvent} to be fired for the + * {@code ACCESSIBLE_STATE_PROPERTY} property. * - * @return an instance of AccessibleStateSet containing the - * current state set of the object + * @return an instance of {@code AccessibleStateSet} containing the current + * state set of the object * @see AccessibleStateSet * @see AccessibleState * @see #addPropertyChangeListener @@ -533,22 +544,22 @@ public abstract AccessibleStateSet getAccessibleStateSet(); /** - * Gets the Accessible parent of this object. + * Gets the {@code Accessible} parent of this object. * - * @return the Accessible parent of this object; null if this - * object does not have an Accessible parent + * @return the {@code Accessible} parent of this object; {@code null} if + * this object does not have an {@code Accessible} parent */ public Accessible getAccessibleParent() { return accessibleParent; } /** - * Sets the Accessible parent of this object. This is meant to be used - * only in the situations where the actual component's parent should - * not be treated as the component's accessible parent and is a method - * that should only be called by the parent of the accessible child. + * Sets the {@code Accessible} parent of this object. This is meant to be + * used only in the situations where the actual component's parent should + * not be treated as the component's accessible parent and is a method that + * should only be called by the parent of the accessible child. * - * @param a - Accessible to be set as the parent + * @param a - {@code Accessible} to be set as the parent */ public void setAccessibleParent(Accessible a) { accessibleParent = a; @@ -557,9 +568,8 @@ /** * Gets the 0-based index of this object in its accessible parent. * - * @return the 0-based index of this object in its parent; -1 if this - * object does not have an accessible parent. - * + * @return the 0-based index of this object in its parent; -1 if this object + * does not have an accessible parent. * @see #getAccessibleParent * @see #getAccessibleChildrenCount * @see #getAccessibleChild @@ -574,13 +584,13 @@ public abstract int getAccessibleChildrenCount(); /** - * Returns the specified Accessible child of the object. The Accessible - * children of an Accessible object are zero-based, so the first child - * of an Accessible child is at index 0, the second child is at index 1, - * and so on. + * Returns the specified {@code Accessible} child of the object. The + * {@code Accessible} children of an {@code Accessible} object are + * zero-based, so the first child of an {@code Accessible} child is at index + * 0, the second child is at index 1, and so on. * - * @param i zero-based index of child - * @return the Accessible child of the object + * @param i zero-based index of child + * @return the {@code Accessible} child of the object * @see #getAccessibleChildrenCount */ public abstract Accessible getAccessibleChild(int i); @@ -589,21 +599,21 @@ * Gets the locale of the component. If the component does not have a * locale, then the locale of its parent is returned. * - * @return this component's locale. If this component does not have - * a locale, the locale of its parent is returned. - * - * @exception IllegalComponentStateException - * If the Component does not have its own locale and has not yet been - * added to a containment hierarchy such that the locale can be - * determined from the containing parent. + * @return this component's locale. If this component does not have a + * locale, the locale of its parent is returned. + * @throws IllegalComponentStateException If the component does not have its + * own locale and has not yet been added to a containment hierarchy + * such that the locale can be determined from the containing + * parent */ public abstract Locale getLocale() throws IllegalComponentStateException; /** - * Adds a PropertyChangeListener to the listener list. - * The listener is registered for all Accessible properties and will - * be called when those properties change. + * Adds a {@code PropertyChangeListener} to the listener list. The listener + * is registered for all {@code Accessible} properties and will be called + * when those properties change. * + * @param listener The PropertyChangeListener to be added * @see #ACCESSIBLE_NAME_PROPERTY * @see #ACCESSIBLE_DESCRIPTION_PROPERTY * @see #ACCESSIBLE_STATE_PROPERTY @@ -611,8 +621,6 @@ * @see #ACCESSIBLE_SELECTION_PROPERTY * @see #ACCESSIBLE_TEXT_PROPERTY * @see #ACCESSIBLE_VISIBLE_DATA_PROPERTY - * - * @param listener The PropertyChangeListener to be added */ public void addPropertyChangeListener(PropertyChangeListener listener) { if (accessibleChangeSupport == null) { @@ -622,11 +630,11 @@ } /** - * Removes a PropertyChangeListener from the listener list. - * This removes a PropertyChangeListener that was registered - * for all properties. + * Removes a {@code PropertyChangeListener} from the listener list. This + * removes a {@code PropertyChangeListener} that was registered for all + * properties. * - * @param listener The PropertyChangeListener to be removed + * @param listener The PropertyChangeListener to be removed */ public void removePropertyChangeListener(PropertyChangeListener listener) { if (accessibleChangeSupport != null) { @@ -635,10 +643,11 @@ } /** - * Gets the AccessibleAction associated with this object that supports - * one or more actions. + * Gets the {@code AccessibleAction} associated with this object that + * supports one or more actions. * - * @return AccessibleAction if supported by object; else return null + * @return {@code AccessibleAction} if supported by object; else return + * {@code null} * @see AccessibleAction */ public AccessibleAction getAccessibleAction() { @@ -646,10 +655,11 @@ } /** - * Gets the AccessibleComponent associated with this object that has a - * graphical representation. + * Gets the {@code AccessibleComponent} associated with this object that has + * a graphical representation. * - * @return AccessibleComponent if supported by object; else return null + * @return {@code AccessibleComponent} if supported by object; else return + * {@code null} * @see AccessibleComponent */ public AccessibleComponent getAccessibleComponent() { @@ -657,10 +667,11 @@ } /** - * Gets the AccessibleSelection associated with this object which allows its - * Accessible children to be selected. + * Gets the {@code AccessibleSelection} associated with this object which + * allows its {@code Accessible} children to be selected. * - * @return AccessibleSelection if supported by object; else return null + * @return {@code AccessibleSelection} if supported by object; else return + * {@code null} * @see AccessibleSelection */ public AccessibleSelection getAccessibleSelection() { @@ -668,10 +679,11 @@ } /** - * Gets the AccessibleText associated with this object presenting + * Gets the {@code AccessibleText} associated with this object presenting * text on the display. * - * @return AccessibleText if supported by object; else return null + * @return {@code AccessibleText} if supported by object; else return + * {@code null} * @see AccessibleText */ public AccessibleText getAccessibleText() { @@ -679,10 +691,11 @@ } /** - * Gets the AccessibleEditableText associated with this object + * Gets the {@code AccessibleEditableText} associated with this object * presenting editable text on the display. * - * @return AccessibleEditableText if supported by object; else return null + * @return {@code AccessibleEditableText} if supported by object; else + * return {@code null} * @see AccessibleEditableText * @since 1.4 */ @@ -690,12 +703,12 @@ return null; } - /** - * Gets the AccessibleValue associated with this object that supports a - * Numerical value. + * Gets the {@code AccessibleValue} associated with this object that + * supports a {@code Numerical} value. * - * @return AccessibleValue if supported by object; else return null + * @return {@code AccessibleValue} if supported by object; else return + * {@code null} * @see AccessibleValue */ public AccessibleValue getAccessibleValue() { @@ -703,11 +716,11 @@ } /** - * Gets the AccessibleIcons associated with an object that has - * one or more associated icons + * Gets the {@code AccessibleIcons} associated with an object that has one + * or more associated icons. * - * @return an array of AccessibleIcon if supported by object; - * otherwise return null + * @return an array of {@code AccessibleIcon} if supported by object; + * otherwise return {@code null} * @see AccessibleIcon * @since 1.3 */ @@ -716,10 +729,10 @@ } /** - * Gets the AccessibleRelationSet associated with an object + * Gets the {@code AccessibleRelationSet} associated with an object. * - * @return an AccessibleRelationSet if supported by object; - * otherwise return null + * @return an {@code AccessibleRelationSet} if supported by object; + * otherwise return {@code null} * @see AccessibleRelationSet * @since 1.3 */ @@ -728,10 +741,10 @@ } /** - * Gets the AccessibleTable associated with an object + * Gets the {@code AccessibleTable} associated with an object. * - * @return an AccessibleTable if supported by object; - * otherwise return null + * @return an {@code AccessibleTable} if supported by object; otherwise return + * {@code null} * @see AccessibleTable * @since 1.3 */ @@ -740,16 +753,17 @@ } /** - * Support for reporting bound property changes. If oldValue and - * newValue are not equal and the PropertyChangeEvent listener list - * is not empty, then fire a PropertyChange event to each listener. - * In general, this is for use by the Accessible objects themselves - * and should not be called by an application program. - * @param propertyName The programmatic name of the property that - * was changed. - * @param oldValue The old value of the property. - * @param newValue The new value of the property. - * @see java.beans.PropertyChangeSupport + * Support for reporting bound property changes. If {@code oldValue} and + * {@code newValue} are not equal and the {@code PropertyChangeEvent} + * listener list is not empty, then fire a {@code PropertyChange} event to + * each listener. In general, this is for use by the {@code Accessible} + * objects themselves and should not be called by an application program. + * + * @param propertyName The programmatic name of the property that was + * changed + * @param oldValue The old value of the property + * @param newValue The new value of the property + * @see PropertyChangeSupport * @see #addPropertyChangeListener * @see #removePropertyChangeListener * @see #ACCESSIBLE_NAME_PROPERTY
--- a/src/java.desktop/share/classes/javax/accessibility/AccessibleEditableText.java Fri Jun 16 09:20:39 2017 -0700 +++ b/src/java.desktop/share/classes/javax/accessibility/AccessibleEditableText.java Sat Jun 17 08:03:05 2017 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 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 @@ -25,109 +25,102 @@ package javax.accessibility; -import java.util.*; -import java.awt.*; -import javax.swing.text.*; +import javax.swing.text.AttributeSet; /** - * <P>The AccessibleEditableText interface should be implemented by all - * classes that present editable textual information on the display. - * Along with the AccessibleText interface, this interface provides - * the standard mechanism for an assistive technology to access - * that text via its content, attributes, and spatial location. - * Applications can determine if an object supports the AccessibleEditableText - * interface by first obtaining its AccessibleContext (see {@link Accessible}) - * and then calling the {@link AccessibleContext#getAccessibleEditableText} - * method of AccessibleContext. If the return value is not null, the object - * supports this interface. + * The {@code AccessibleEditableText} interface should be implemented by all + * classes that present editable textual information on the display. Along with + * the {@code AccessibleText} interface, this interface provides the standard + * mechanism for an assistive technology to access that text via its content, + * attributes, and spatial location. Applications can determine if an object + * supports the {@code AccessibleEditableText} interface by first obtaining its + * {@code AccessibleContext} (see {@link Accessible}) and then calling the + * {@link AccessibleContext#getAccessibleEditableText} method of + * {@code AccessibleContext}. If the return value is not {@code null}, the + * object supports this interface. * + * @author Lynn Monsanto * @see Accessible * @see Accessible#getAccessibleContext * @see AccessibleContext * @see AccessibleContext#getAccessibleText * @see AccessibleContext#getAccessibleEditableText - * - * @author Lynn Monsanto * @since 1.4 */ - public interface AccessibleEditableText extends AccessibleText { /** * Sets the text contents to the specified string. * - * @param s the string to set the text contents + * @param s the string to set the text contents */ public void setTextContents(String s); /** - * Inserts the specified string at the given index/ + * Inserts the specified string at the given index. * - * @param index the index in the text where the string will - * be inserted - * @param s the string to insert in the text + * @param index the index in the text where the string will be inserted + * @param s the string to insert in the text */ public void insertTextAtIndex(int index, String s); /** * Returns the text string between two indices. * - * @param startIndex the starting index in the text - * @param endIndex the ending index in the text + * @param startIndex the starting index in the text + * @param endIndex the ending index in the text * @return the text string between the indices */ public String getTextRange(int startIndex, int endIndex); /** - * Deletes the text between two indices + * Deletes the text between two indices. * - * @param startIndex the starting index in the text - * @param endIndex the ending index in the text + * @param startIndex the starting index in the text + * @param endIndex the ending index in the text */ public void delete(int startIndex, int endIndex); /** * Cuts the text between two indices into the system clipboard. * - * @param startIndex the starting index in the text - * @param endIndex the ending index in the text + * @param startIndex the starting index in the text + * @param endIndex the ending index in the text */ public void cut(int startIndex, int endIndex); /** - * Pastes the text from the system clipboard into the text - * starting at the specified index. + * Pastes the text from the system clipboard into the text starting at the + * specified index. * - * @param startIndex the starting index in the text + * @param startIndex the starting index in the text */ public void paste(int startIndex); /** - * Replaces the text between two indices with the specified - * string. + * Replaces the text between two indices with the specified string. * - * @param startIndex the starting index in the text - * @param endIndex the ending index in the text - * @param s the string to replace the text between two indices + * @param startIndex the starting index in the text + * @param endIndex the ending index in the text + * @param s the string to replace the text between two indices */ public void replaceText(int startIndex, int endIndex, String s); /** * Selects the text between two indices. * - * @param startIndex the starting index in the text - * @param endIndex the ending index in the text + * @param startIndex the starting index in the text + * @param endIndex the ending index in the text */ public void selectText(int startIndex, int endIndex); /** * Sets attributes for the text between two indices. * - * @param startIndex the starting index in the text - * @param endIndex the ending index in the text - * @param as the attribute set + * @param startIndex the starting index in the text + * @param endIndex the ending index in the text + * @param as the attribute set * @see AttributeSet */ public void setAttributes(int startIndex, int endIndex, AttributeSet as); - }
--- a/src/java.desktop/share/classes/javax/accessibility/AccessibleExtendedComponent.java Fri Jun 16 09:20:39 2017 -0700 +++ b/src/java.desktop/share/classes/javax/accessibility/AccessibleExtendedComponent.java Sat Jun 17 08:03:05 2017 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 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 @@ -26,48 +26,46 @@ package javax.accessibility; /** - * The AccessibleExtendedComponent interface should be supported by any object - * that is rendered on the screen. This interface provides the standard - * mechanism for an assistive technology to determine the extended - * graphical representation of an object. Applications can determine - * if an object supports the AccessibleExtendedComponent interface by first - * obtaining its AccessibleContext - * and then calling the - * {@link AccessibleContext#getAccessibleComponent} method. - * If the return value is not null and the type of the return value is - * AccessibleExtendedComponent, the object supports this interface. + * The {@code AccessibleExtendedComponent} interface should be supported by any + * object that is rendered on the screen. This interface provides the standard + * mechanism for an assistive technology to determine the extended graphical + * representation of an object. Applications can determine if an object supports + * the {@code AccessibleExtendedComponent} interface by first obtaining its + * {@code AccessibleContext} and then calling the + * {@link AccessibleContext#getAccessibleComponent} method. If the return value + * is not {@code null} and the type of the return value is + * {@code AccessibleExtendedComponent}, the object supports this interface. * + * @author Lynn Monsanto * @see Accessible * @see Accessible#getAccessibleContext * @see AccessibleContext * @see AccessibleContext#getAccessibleComponent - * - * @author Lynn Monsanto * @since 1.4 */ public interface AccessibleExtendedComponent extends AccessibleComponent { /** - * Returns the tool tip text + * Returns the tool tip text. * - * @return the tool tip text, if supported, of the object; - * otherwise, null + * @return the tool tip text, if supported, of the object; otherwise, + * {@code null} */ public String getToolTipText(); /** - * Returns the titled border text + * Returns the titled border text. * - * @return the titled border text, if supported, of the object; - * otherwise, null + * @return the titled border text, if supported, of the object; otherwise, + * {@code null} */ public String getTitledBorderText(); /** - * Returns key bindings associated with this object + * Returns key bindings associated with this object. * - * @return the key bindings, if supported, of the object; - * otherwise, null + * @return the key bindings, if supported, of the object; otherwise, + * {@code null} * @see AccessibleKeyBinding */ public AccessibleKeyBinding getAccessibleKeyBinding();
--- a/src/java.desktop/share/classes/javax/accessibility/AccessibleExtendedTable.java Fri Jun 16 09:20:39 2017 -0700 +++ b/src/java.desktop/share/classes/javax/accessibility/AccessibleExtendedTable.java Sat Jun 17 08:03:05 2017 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 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 @@ -22,52 +22,49 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + package javax.accessibility; /** - * Class AccessibleExtendedTable provides extended information about - * a user-interface component that presents data in a two-dimensional - * table format. - * Applications can determine if an object supports the - * AccessibleExtendedTable interface by first obtaining its - * AccessibleContext and then calling the - * {@link AccessibleContext#getAccessibleTable} method. - * If the return value is not null and the type of the return value is - * AccessibleExtendedTable, the object supports this interface. - * - * @author Lynn Monsanto - * @since 1.4 - */ + * Class {@code AccessibleExtendedTable} provides extended information about a + * user-interface component that presents data in a two-dimensional table + * format. Applications can determine if an object supports the + * {@code AccessibleExtendedTable} interface by first obtaining its + * {@code AccessibleContext} and then calling the + * {@link AccessibleContext#getAccessibleTable} method. If the return value is + * not {@code null} and the type of the return value is + * {@code AccessibleExtendedTable}, the object supports this interface. + * + * @author Lynn Monsanto + * @since 1.4 + */ public interface AccessibleExtendedTable extends AccessibleTable { - /** - * Returns the row number of an index in the table. - * - * @param index the zero-based index in the table. The index is - * the table cell offset from row == 0 and column == 0. - * @return the zero-based row of the table if one exists; - * otherwise -1. - */ - public int getAccessibleRow(int index); - - /** - * Returns the column number of an index in the table. - * - * @param index the zero-based index in the table. The index is - * the table cell offset from row == 0 and column == 0. - * @return the zero-based column of the table if one exists; - * otherwise -1. - */ - public int getAccessibleColumn(int index); + /** + * Returns the row number of an index in the table. + * + * @param index the zero-based index in the table. The index is the table + * cell offset from row == 0 and column == 0. + * @return the zero-based row of the table if one exists; otherwise -1 + */ + public int getAccessibleRow(int index); /** - * Returns the index at a row and column in the table. - * - * @param r zero-based row of the table - * @param c zero-based column of the table - * @return the zero-based index in the table if one exists; - * otherwise -1. The index is the table cell offset from - * row == 0 and column == 0. - */ - public int getAccessibleIndex(int r, int c); + * Returns the column number of an index in the table. + * + * @param index the zero-based index in the table. The index is the table + * cell offset from row == 0 and column == 0. + * @return the zero-based column of the table if one exists; otherwise -1 + */ + public int getAccessibleColumn(int index); + + /** + * Returns the index at a row and column in the table. + * + * @param r zero-based row of the table + * @param c zero-based column of the table + * @return the zero-based index in the table if one exists; otherwise -1. + * The index is the table cell offset from row == 0 and column == 0. + */ + public int getAccessibleIndex(int r, int c); }
--- a/src/java.desktop/share/classes/javax/accessibility/AccessibleExtendedText.java Fri Jun 16 09:20:39 2017 -0700 +++ b/src/java.desktop/share/classes/javax/accessibility/AccessibleExtendedText.java Sat Jun 17 08:03:05 2017 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -25,29 +25,25 @@ package javax.accessibility; - -import java.util.*; -import java.awt.*; -import javax.swing.text.*; - +import java.awt.Rectangle; /** - * <P>The AccessibleExtendedText interface contains additional methods - * not provided by the AccessibleText interface + * The {@code AccessibleExtendedText} interface contains additional methods not + * provided by the {@code AccessibleText} interface. + * <p> + * Applications can determine if an object supports the + * {@code AccessibleExtendedText} interface by first obtaining its + * {@code AccessibleContext} (see {@link Accessible}) and then calling the + * {@link AccessibleContext#getAccessibleText} method of + * {@code AccessibleContext}. If the return value is an instance of + * {@code AccessibleExtendedText}, the object supports this interface. * - * Applications can determine if an object supports the AccessibleExtendedText - * interface by first obtaining its AccessibleContext (see {@link Accessible}) - * and then calling the {@link AccessibleContext#getAccessibleText} method of - * AccessibleContext. If the return value is an instance of - * AccessibleExtendedText, the object supports this interface. - * + * @author Peter Korn + * @author Lynn Monsanto * @see Accessible * @see Accessible#getAccessibleContext * @see AccessibleContext * @see AccessibleContext#getAccessibleText - * - * @author Peter Korn - * @author Lynn Monsanto * @since 1.5 */ public interface AccessibleExtendedText { @@ -73,25 +69,24 @@ public static final int ATTRIBUTE_RUN = 5; // BugID: 4849720 /** - * Returns the text between two indices + * Returns the text between two indices. * - * @param startIndex the start index in the text - * @param endIndex the end index in the text - * @return the text string if the indices are valid. - * Otherwise, null is returned. + * @param startIndex the start index in the text + * @param endIndex the end index in the text + * @return the text string if the indices are valid. Otherwise, {@code null} + * is returned. */ public String getTextRange(int startIndex, int endIndex); /** * Returns the {@code AccessibleTextSequence} at a given index. * - * @param part the {@code CHARACTER}, {@code WORD}, - * {@code SENTENCE}, {@code LINE} or {@code ATTRIBUTE_RUN} - * to retrieve - * @param index an index within the text - * @return an {@code AccessibleTextSequence} specifying the text - * if part and index are valid. Otherwise, null is returned. - * + * @param part the {@code CHARACTER}, {@code WORD}, {@code SENTENCE}, + * {@code LINE} or {@code ATTRIBUTE_RUN} to retrieve + * @param index an index within the text + * @return an {@code AccessibleTextSequence} specifying the text if + * {@code part} and {@code index} are valid. Otherwise, {@code null} + * is returned. * @see AccessibleText#CHARACTER * @see AccessibleText#WORD * @see AccessibleText#SENTENCE @@ -101,13 +96,12 @@ /** * Returns the {@code AccessibleTextSequence} after a given index. * - * @param part the {@code CHARACTER}, {@code WORD}, - * {@code SENTENCE}, {@code LINE} or {@code ATTRIBUTE_RUN} - * to retrieve - * @param index an index within the text - * @return an {@code AccessibleTextSequence} specifying the text - * if part and index are valid. Otherwise, null is returned. - * + * @param part the {@code CHARACTER}, {@code WORD}, {@code SENTENCE}, + * {@code LINE} or {@code ATTRIBUTE_RUN} to retrieve + * @param index an index within the text + * @return an {@code AccessibleTextSequence} specifying the text if + * {@code part} and {@code index} are valid. Otherwise, {@code null} + * is returned. * @see AccessibleText#CHARACTER * @see AccessibleText#WORD * @see AccessibleText#SENTENCE @@ -117,13 +111,12 @@ /** * Returns the {@code AccessibleTextSequence} before a given index. * - * @param part the {@code CHARACTER}, {@code WORD}, - * {@code SENTENCE}, {@code LINE} or {@code ATTRIBUTE_RUN} - * to retrieve - * @param index an index within the text - * @return an {@code AccessibleTextSequence} specifying the text - * if part and index are valid. Otherwise, null is returned. - * + * @param part the {@code CHARACTER}, {@code WORD}, {@code SENTENCE}, + * {@code LINE} or {@code ATTRIBUTE_RUN} to retrieve + * @param index an index within the text + * @return an {@code AccessibleTextSequence} specifying the text if + * {@code part} and {@code index} are valid. Otherwise, {@code null} + * is returned. * @see AccessibleText#CHARACTER * @see AccessibleText#WORD * @see AccessibleText#SENTENCE @@ -133,10 +126,10 @@ /** * Returns the bounding rectangle of the text between two indices. * - * @param startIndex the start index in the text - * @param endIndex the end index in the text + * @param startIndex the start index in the text + * @param endIndex the end index in the text * @return the bounding rectangle of the text if the indices are valid. - * Otherwise, null is returned. + * Otherwise, {@code null} is returned. */ public Rectangle getTextBounds(int startIndex, int endIndex); }
--- a/src/java.desktop/share/classes/javax/accessibility/AccessibleHyperlink.java Fri Jun 16 09:20:39 2017 -0700 +++ b/src/java.desktop/share/classes/javax/accessibility/AccessibleHyperlink.java Sat Jun 17 08:03:05 2017 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2000, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -25,116 +25,103 @@ package javax.accessibility; - -import java.util.*; -import java.awt.*; -import javax.swing.text.*; - - /** - * Encapsulation of a link, or set of links (e.g. client side imagemap) - * in a Hypertext document + * Encapsulation of a link, or set of links (e.g. client side imagemap) in a + * Hypertext document * + * @author Peter Korn * @see Accessible * @see Accessible#getAccessibleContext * @see AccessibleContext * @see AccessibleText * @see AccessibleContext#getAccessibleText - * - * @author Peter Korn */ public abstract class AccessibleHyperlink implements AccessibleAction { - /** - * Since the document a link is associated with may have - * changed, this method returns whether or not this Link is still valid - * (with respect to the document it references). - * - * @return a flag indicating whether this link is still valid with - * respect to the AccessibleHypertext it belongs to - */ - public abstract boolean isValid(); - - /** - * Returns the number of accessible actions available in this Link - * If there are more than one, the first one is NOT considered the - * "default" action of this LINK object (e.g. in an HTML imagemap). - * In general, links will have only one AccessibleAction in them. - * - * @return the zero-based number of Actions in this object - */ - public abstract int getAccessibleActionCount(); + /** + * Since the document a link is associated with may have changed, this + * method returns whether or not this Link is still valid (with respect to + * the document it references). + * + * @return a flag indicating whether this link is still valid with respect + * to the {@code AccessibleHypertext} it belongs to + */ + public abstract boolean isValid(); - /** - * Performs the specified Action on the object - * - * @param i zero-based index of actions - * @return true if the action was performed; otherwise false. - * @see #getAccessibleActionCount - */ - public abstract boolean doAccessibleAction(int i); + /** + * Returns the number of accessible actions available in this Link If there + * are more than one, the first one is NOT considered the "default" action + * of this LINK object (e.g. in an HTML imagemap). In general, links will + * have only one {@code AccessibleAction} in them. + * + * @return the zero-based number of actions in this object + */ + public abstract int getAccessibleActionCount(); - /** - * Returns a String description of this particular - * link action. This should be a text string - * associated with anchoring text, this should be the - * anchor text. E.g. from HTML: - * <a HREF="http://www.sun.com/access">Accessibility</a> - * this method would return "Accessibility". - * - * Similarly, from this HTML: - * <a HREF="#top"><img src="top-hat.gif" alt="top hat"></a> - * this method would return "top hat" - * - * @param i zero-based index of the actions - * @return a String description of the action - * @see #getAccessibleActionCount - */ - public abstract String getAccessibleActionDescription(int i); + /** + * Performs the specified action on the object. + * + * @param i zero-based index of actions + * @return {@code true} if the action was performed; otherwise {@code false} + * @see #getAccessibleActionCount + */ + public abstract boolean doAccessibleAction(int i); - /** - * Returns an object that represents the link action, - * as appropriate for that link. E.g. from HTML: - * <a HREF="http://www.sun.com/access">Accessibility</a> - * this method would return a - * java.net.URL("http://www.sun.com/access.html"); - * - * @param i zero-based index of the actions - * @return an Object representing the hypertext link itself - * @see #getAccessibleActionCount - */ - public abstract Object getAccessibleActionObject(int i); + /** + * Returns a string description of this particular link action. This should + * be a text string associated with anchoring text, this should be the + * anchor text. E.g. from HTML: <a + * HREF="http://www.sun.com/access">Accessibility</a> this method + * would return "Accessibility". + * <p> + * Similarly, from this HTML: <a HREF="#top"><img src="top-hat.gif" + * alt="top hat"></a> this method would return "top hat" + * + * @param i zero-based index of the actions + * @return a string description of the action + * @see #getAccessibleActionCount + */ + public abstract String getAccessibleActionDescription(int i); + + /** + * Returns an object that represents the link action, as appropriate for + * that link. E.g. from HTML: <a + * HREF="http://www.sun.com/access">Accessibility</a> this method + * would return a java.net.URL("http://www.sun.com/access.html"); + * + * @param i zero-based index of the actions + * @return an object representing the hypertext link itself + * @see #getAccessibleActionCount + */ + public abstract Object getAccessibleActionObject(int i); - /** - * Returns an object that represents the link anchor, - * as appropriate for that link. E.g. from HTML: - * <a href="http://www.sun.com/access">Accessibility</a> - * this method would return a String containing the text: - * "Accessibility". - * - * Similarly, from this HTML: - * <a HREF="#top"><img src="top-hat.gif" alt="top hat"></a> - * this might return the object ImageIcon("top-hat.gif", "top hat"); - * - * @param i zero-based index of the actions - * @return an Object representing the hypertext anchor - * @see #getAccessibleActionCount - */ - public abstract Object getAccessibleActionAnchor(int i); + /** + * Returns an object that represents the link anchor, as appropriate for + * that link. E.g. from HTML: <a + * href="http://www.sun.com/access">Accessibility</a> this method + * would return a {@code String} containing the text: "Accessibility". + * <p> + * Similarly, from this HTML: <a HREF="#top"><img src="top-hat.gif" + * alt="top hat"></a> this might return the object + * ImageIcon("top-hat.gif", "top hat"); + * + * @param i zero-based index of the actions + * @return an object representing the hypertext anchor + * @see #getAccessibleActionCount + */ + public abstract Object getAccessibleActionAnchor(int i); - /** - * Gets the index with the hypertext document at which this - * link begins - * - * @return index of start of link - */ - public abstract int getStartIndex(); + /** + * Gets the index with the hypertext document at which this link begins. + * + * @return index of start of link + */ + public abstract int getStartIndex(); - /** - * Gets the index with the hypertext document at which this - * link ends - * - * @return index of end of link - */ - public abstract int getEndIndex(); + /** + * Gets the index with the hypertext document at which this link ends. + * + * @return index of end of link + */ + public abstract int getEndIndex(); }
--- a/src/java.desktop/share/classes/javax/accessibility/AccessibleHypertext.java Fri Jun 16 09:20:39 2017 -0700 +++ b/src/java.desktop/share/classes/javax/accessibility/AccessibleHypertext.java Sat Jun 17 08:03:05 2017 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2000, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -25,56 +25,50 @@ package javax.accessibility; - -import java.util.*; -import java.awt.*; -import javax.swing.text.*; - - /** - * <P>The AccessibleHypertext class is the base class for all - * classes that present hypertext information on the display. This class - * provides the standard mechanism for an assistive technology to access - * that text via its content, attributes, and spatial location. - * It also provides standard mechanisms for manipulating hyperlinks. - * Applications can determine if an object supports the AccessibleHypertext - * interface by first obtaining its AccessibleContext (see {@link Accessible}) - * and then calling the {@link AccessibleContext#getAccessibleText} - * method of AccessibleContext. If the return value is a class which extends - * AccessibleHypertext, then that object supports AccessibleHypertext. + * The {@code AccessibleHypertext} class is the base class for all classes that + * present hypertext information on the display. This class provides the + * standard mechanism for an assistive technology to access that text via its + * content, attributes, and spatial location. It also provides standard + * mechanisms for manipulating hyperlinks. Applications can determine if an + * object supports the {@code AccessibleHypertext} interface by first obtaining + * its {@code AccessibleContext} (see {@link Accessible}) and then calling the + * {@link AccessibleContext#getAccessibleText} method of + * {@code AccessibleContext}. If the return value is a class which extends + * {@code AccessibleHypertext}, then that object supports + * {@code AccessibleHypertext}. * + * @author Peter Korn * @see Accessible * @see Accessible#getAccessibleContext * @see AccessibleContext * @see AccessibleText * @see AccessibleContext#getAccessibleText - * - * @author Peter Korn */ public interface AccessibleHypertext extends AccessibleText { /** * Returns the number of links within this hypertext document. * - * @return number of links in this hypertext doc. + * @return number of links in this hypertext doc */ public abstract int getLinkCount(); /** * Returns the nth Link of this Hypertext document. * - * @param linkIndex within the links of this Hypertext + * @param linkIndex within the links of this Hypertext * @return Link object encapsulating the nth link(s) */ public abstract AccessibleHyperlink getLink(int linkIndex); /** - * Returns the index into an array of hyperlinks that - * is associated with this character index, or -1 if there - * is no hyperlink associated with this index. + * Returns the index into an array of hyperlinks that is associated with + * this character index, or -1 if there is no hyperlink associated with this + * index. * - * @param charIndex index within the text - * @return index into the set of hyperlinks for this hypertext doc. + * @param charIndex index within the text + * @return index into the set of hyperlinks for this hypertext doc */ public abstract int getLinkIndex(int charIndex); }
--- a/src/java.desktop/share/classes/javax/accessibility/AccessibleIcon.java Fri Jun 16 09:20:39 2017 -0700 +++ b/src/java.desktop/share/classes/javax/accessibility/AccessibleIcon.java Sat Jun 17 08:03:05 2017 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 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 @@ -26,57 +26,51 @@ package javax.accessibility; /** - * The AccessibleIcon interface should be supported by any object - * that has an associated icon (e.g., buttons). This interface - * provides the standard mechanism for an assistive technology - * to get descriptive information about icons. - * Applications can determine - * if an object supports the AccessibleIcon interface by first - * obtaining its AccessibleContext (see - * {@link Accessible}) and then calling the - * {@link AccessibleContext#getAccessibleIcon} method. - * If the return value is not null, the object supports this interface. + * The {@code AccessibleIcon} interface should be supported by any object that + * has an associated icon (e.g., buttons). This interface provides the standard + * mechanism for an assistive technology to get descriptive information about + * icons. Applications can determine if an object supports the + * {@code AccessibleIcon} interface by first obtaining its + * {@code AccessibleContext} (see {@link Accessible}) and then calling the + * {@link AccessibleContext#getAccessibleIcon} method. If the return value is + * not {@code null}, the object supports this interface. * + * @author Lynn Monsanto * @see Accessible * @see AccessibleContext - * - * @author Lynn Monsanto * @since 1.3 */ public interface AccessibleIcon { /** - * Gets the description of the icon. This is meant to be a brief - * textual description of the object. For example, it might be - * presented to a blind user to give an indication of the purpose - * of the icon. + * Gets the description of the icon. This is meant to be a brief textual + * description of the object. For example, it might be presented to a blind + * user to give an indication of the purpose of the icon. * * @return the description of the icon */ public String getAccessibleIconDescription(); /** - * Sets the description of the icon. This is meant to be a brief - * textual description of the object. For example, it might be - * presented to a blind user to give an indication of the purpose - * of the icon. + * Sets the description of the icon. This is meant to be a brief textual + * description of the object. For example, it might be presented to a blind + * user to give an indication of the purpose of the icon. * - * @param description the description of the icon + * @param description the description of the icon */ public void setAccessibleIconDescription(String description); /** - * Gets the width of the icon + * Gets the width of the icon. * - * @return the width of the icon. + * @return the width of the icon */ public int getAccessibleIconWidth(); /** - * Gets the height of the icon + * Gets the height of the icon. * - * @return the height of the icon. + * @return the height of the icon */ public int getAccessibleIconHeight(); - }
--- a/src/java.desktop/share/classes/javax/accessibility/AccessibleKeyBinding.java Fri Jun 16 09:20:39 2017 -0700 +++ b/src/java.desktop/share/classes/javax/accessibility/AccessibleKeyBinding.java Sat Jun 17 08:03:05 2017 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 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 @@ -26,38 +26,36 @@ package javax.accessibility; /** - * The AccessibleKeyBinding interface should be supported by any object + * The {@code AccessibleKeyBinding} interface should be supported by any object * that has a keyboard bindings such as a keyboard mnemonic and/or keyboard - * shortcut which can be used to select the object. This interface provides - * the standard mechanism for an assistive technology to determine the - * key bindings which exist for this object. - * Any object that has such key bindings should support this - * interface. + * shortcut which can be used to select the object. This interface provides the + * standard mechanism for an assistive technology to determine the key bindings + * which exist for this object. Any object that has such key bindings should + * support this interface. * + * @author Lynn Monsanto * @see Accessible * @see Accessible#getAccessibleContext * @see AccessibleContext - * - * @author Lynn Monsanto * @since 1.4 */ public interface AccessibleKeyBinding { /** - * Returns the number of key bindings for this object + * Returns the number of key bindings for this object. * * @return the zero-based number of key bindings for this object */ public int getAccessibleKeyBindingCount(); /** - * Returns a key binding for this object. The value returned is an - * java.lang.Object which must be cast to appropriate type depending + * Returns a key binding for this object. The value returned is an + * {@code java.lang.Object} which must be cast to appropriate type depending * on the underlying implementation of the key. * - * @param i zero-based index of the key bindings - * @return a javax.lang.Object which specifies the key binding + * @param i zero-based index of the key bindings + * @return a {@code javax.lang.Object} which specifies the key binding * @see #getAccessibleKeyBindingCount */ - public java.lang.Object getAccessibleKeyBinding(int i); + public Object getAccessibleKeyBinding(int i); }
--- a/src/java.desktop/share/classes/javax/accessibility/AccessibleRelation.java Fri Jun 16 09:20:39 2017 -0700 +++ b/src/java.desktop/share/classes/javax/accessibility/AccessibleRelation.java Sat Jun 17 08:03:05 2017 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 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 @@ -25,39 +25,36 @@ package javax.accessibility; -import java.util.Vector; -import java.util.Locale; -import java.util.MissingResourceException; -import java.util.ResourceBundle; - /** - * <P>Class AccessibleRelation describes a relation between the - * object that implements the AccessibleRelation and one or more other - * objects. The actual relations that an object has with other - * objects are defined as an AccessibleRelationSet, which is a composed - * set of AccessibleRelations. - * <p>The toDisplayString method allows you to obtain the localized string - * for a locale independent key from a predefined ResourceBundle for the - * keys defined in this class. - * <p>The constants in this class present a strongly typed enumeration - * of common object roles. If the constants in this class are not sufficient - * to describe the role of an object, a subclass should be generated - * from this class and it should provide constants in a similar manner. + * Class {@code AccessibleRelation} describes a relation between the object that + * implements the {@code AccessibleRelation} and one or more other objects. The + * actual relations that an object has with other objects are defined as an + * {@code AccessibleRelationSet}, which is a composed set of + * {@code AccessibleRelations}. + * <p> + * The {@link #toDisplayString()} method allows you to obtain the localized + * string for a locale independent key from a predefined {@code ResourceBundle} + * for the keys defined in this class. + * <p> + * The constants in this class present a strongly typed enumeration of common + * object roles. If the constants in this class are not sufficient to describe + * the role of an object, a subclass should be generated from this class and it + * should provide constants in a similar manner. * - * @author Lynn Monsanto + * @author Lynn Monsanto * @since 1.3 */ public class AccessibleRelation extends AccessibleBundle { - /* - * The group of objects that participate in the relation. - * The relation may be one-to-one or one-to-many. For - * example, in the case of a LABEL_FOR relation, the target - * vector would contain a list of objects labeled by the object - * that implements this AccessibleRelation. In the case of a - * MEMBER_OF relation, the target vector would contain all - * of the components that are members of the same group as the - * object that implements this AccessibleRelation. + /** + * The group of objects that participate in the relation. The relation may + * be one-to-one or one-to-many. For example, in the case of a + * {@code LABEL_FOR} relation, the target vector would contain a list of + * objects labeled by the object that implements this + * {@code AccessibleRelation}. In the case of a {@code MEMBER_OF} relation, + * the target vector would contain all of the components that are members of + * the same group as the object that implements this + * {@code AccessibleRelation}. */ private Object [] target = new Object[0]; @@ -84,8 +81,7 @@ public static final String LABELED_BY = new String("labeledBy"); /** - * Indicates an object is a member of a group of one or more - * target objects. + * Indicates an object is a member of a group of one or more target objects. * * @see #getTarget * @see #CONTROLLER_FOR @@ -96,8 +92,7 @@ public static final String MEMBER_OF = new String("memberOf"); /** - * Indicates an object is a controller for one or more target - * objects. + * Indicates an object is a controller for one or more target objects. * * @see #getTarget * @see #CONTROLLED_BY @@ -108,8 +103,7 @@ public static final String CONTROLLER_FOR = new String("controllerFor"); /** - * Indicates an object is controlled by one or more target - * objects. + * Indicates an object is controlled by one or more target objects. * * @see #getTarget * @see #CONTROLLER_FOR @@ -120,83 +114,73 @@ public static final String CONTROLLED_BY = new String("controlledBy"); /** - * Indicates an object is logically contiguous with a second - * object where the second object occurs after the object. - * An example is a paragraph of text that runs to the end of - * a page and continues on the next page with an intervening - * text footer and/or text header. The two parts of - * the paragraph are separate text elements but are related - * in that the second element is a continuation - * of the first - * element. In other words, the first element "flows to" - * the second element. + * Indicates an object is logically contiguous with a second object where + * the second object occurs after the object. An example is a paragraph of + * text that runs to the end of a page and continues on the next page with + * an intervening text footer and/or text header. The two parts of the + * paragraph are separate text elements but are related in that the second + * element is a continuation of the first element. In other words, the first + * element "flows to" the second element. * * @since 1.5 */ public static final String FLOWS_TO = "flowsTo"; /** - * Indicates an object is logically contiguous with a second - * object where the second object occurs before the object. - * An example is a paragraph of text that runs to the end of - * a page and continues on the next page with an intervening - * text footer and/or text header. The two parts of - * the paragraph are separate text elements but are related - * in that the second element is a continuation of the first - * element. In other words, the second element "flows from" - * the second element. + * Indicates an object is logically contiguous with a second object where + * the second object occurs before the object. An example is a paragraph of + * text that runs to the end of a page and continues on the next page with + * an intervening text footer and/or text header. The two parts of the + * paragraph are separate text elements but are related in that the second + * element is a continuation of the first element. In other words, the + * second element "flows from" the second element. * * @since 1.5 */ public static final String FLOWS_FROM = "flowsFrom"; /** - * Indicates that an object is a subwindow of one or more - * objects. + * Indicates that an object is a subwindow of one or more objects. * * @since 1.5 */ public static final String SUBWINDOW_OF = "subwindowOf"; /** - * Indicates that an object is a parent window of one or more - * objects. + * Indicates that an object is a parent window of one or more objects. * * @since 1.5 */ public static final String PARENT_WINDOW_OF = "parentWindowOf"; /** - * Indicates that an object has one or more objects - * embedded in it. + * Indicates that an object has one or more objects embedded in it. * * @since 1.5 */ public static final String EMBEDS = "embeds"; /** - * Indicates that an object is embedded in one or more - * objects. + * Indicates that an object is embedded in one or more objects. * * @since 1.5 */ public static final String EMBEDDED_BY = "embeddedBy"; /** - * Indicates that an object is a child node of one - * or more objects. + * Indicates that an object is a child node of one or more objects. * * @since 1.5 */ public static final String CHILD_NODE_OF = "childNodeOf"; /** - * Identifies that the target group for a label has changed + * Identifies that the target group for a label has changed. */ public static final String LABEL_FOR_PROPERTY = "labelForProperty"; /** - * Identifies that the objects that are doing the labeling have changed + * Identifies that the objects that are doing the labeling have changed. */ public static final String LABELED_BY_PROPERTY = "labeledByProperty"; @@ -206,34 +190,33 @@ public static final String MEMBER_OF_PROPERTY = "memberOfProperty"; /** - * Identifies that the controller for the target object has changed + * Identifies that the controller for the target object has changed. */ public static final String CONTROLLER_FOR_PROPERTY = "controllerForProperty"; /** * Identifies that the target object that is doing the controlling has - * changed + * changed. */ public static final String CONTROLLED_BY_PROPERTY = "controlledByProperty"; /** - * Indicates the FLOWS_TO relation between two objects - * has changed. + * Indicates the {@code FLOWS_TO} relation between two objects has changed. * * @since 1.5 */ public static final String FLOWS_TO_PROPERTY = "flowsToProperty"; /** - * Indicates the FLOWS_FROM relation between two objects - * has changed. + * Indicates the {@code FLOWS_FROM} relation between two objects has + * changed. * * @since 1.5 */ public static final String FLOWS_FROM_PROPERTY = "flowsFromProperty"; /** - * Indicates the SUBWINDOW_OF relation between two or more objects + * Indicates the {@code SUBWINDOW_OF} relation between two or more objects * has changed. * * @since 1.5 @@ -241,23 +224,23 @@ public static final String SUBWINDOW_OF_PROPERTY = "subwindowOfProperty"; /** - * Indicates the PARENT_WINDOW_OF relation between two or more objects - * has changed. + * Indicates the {@code PARENT_WINDOW_OF} relation between two or more + * objects has changed. * * @since 1.5 */ public static final String PARENT_WINDOW_OF_PROPERTY = "parentWindowOfProperty"; /** - * Indicates the EMBEDS relation between two or more objects - * has changed. + * Indicates the {@code EMBEDS} relation between two or more objects has + * changed. * * @since 1.5 */ public static final String EMBEDS_PROPERTY = "embedsProperty"; /** - * Indicates the EMBEDDED_BY relation between two or more objects + * Indicates the {@code EMBEDDED_BY} relation between two or more objects * has changed. * * @since 1.5 @@ -265,7 +248,7 @@ public static final String EMBEDDED_BY_PROPERTY = "embeddedByProperty"; /** - * Indicates the CHILD_NODE_OF relation between two or more objects + * Indicates the {@code CHILD_NODE_OF} relation between two or more objects * has changed. * * @since 1.5 @@ -273,12 +256,13 @@ public static final String CHILD_NODE_OF_PROPERTY = "childNodeOfProperty"; /** - * Create a new AccessibleRelation using the given locale independent key. - * The key String should be a locale independent key for the relation. - * It is not intended to be used as the actual String to display - * to the user. To get the localized string, use toDisplayString. + * Create a new {@code AccessibleRelation} using the given locale + * independent key. The key {@code String} should be a locale independent + * key for the relation. It is not intended to be used as the actual + * {@code String} to display to the user. To get the localized string, use + * {@link #toDisplayString()}. * - * @param key the locale independent name of the relation. + * @param key the locale independent name of the relation * @see AccessibleBundle#toDisplayString */ public AccessibleRelation(String key) { @@ -287,13 +271,14 @@ } /** - * Creates a new AccessibleRelation using the given locale independent key. - * The key String should be a locale independent key for the relation. - * It is not intended to be used as the actual String to display - * to the user. To get the localized string, use toDisplayString. + * Creates a new {@code AccessibleRelation} using the given locale + * independent key. The key {@code String} should be a locale independent + * key for the relation. It is not intended to be used as the actual + * {@code String} to display to the user. To get the localized string, use + * {@link #toDisplayString()}. * - * @param key the locale independent name of the relation. - * @param target the target object for this relation + * @param key the locale independent name of the relation + * @param target the target object for this relation * @see AccessibleBundle#toDisplayString */ public AccessibleRelation(String key, Object target) { @@ -303,25 +288,25 @@ } /** - * Creates a new AccessibleRelation using the given locale independent key. - * The key String should be a locale independent key for the relation. - * It is not intended to be used as the actual String to display - * to the user. To get the localized string, use toDisplayString. + * Creates a new {@code AccessibleRelation} using the given locale + * independent key. The key {@code String} should be a locale independent + * key for the relation. It is not intended to be used as the actual + * {@code String} to display to the user. To get the localized string, use + * {@link #toDisplayString()}. * - * @param key the locale independent name of the relation. - * @param target the target object(s) for this relation + * @param key the locale independent name of the relation + * @param target the target object(s) for this relation * @see AccessibleBundle#toDisplayString */ - public AccessibleRelation(String key, Object [] target) { + public AccessibleRelation(String key, Object[] target) { this.key = key; this.target = target; } /** - * Returns the key for this relation + * Returns the key for this relation. * * @return the key for this relation - * * @see #CONTROLLER_FOR * @see #CONTROLLED_BY * @see #LABEL_FOR @@ -333,7 +318,7 @@ } /** - * Returns the target objects for this relation + * Returns the target objects for this relation. * * @return an array containing the target objects for this relation */ @@ -349,9 +334,9 @@ } /** - * Sets the target object for this relation + * Sets the target object for this relation. * - * @param target the target object for this relation + * @param target the target object for this relation */ public void setTarget(Object target) { this.target = new Object[1]; @@ -359,9 +344,9 @@ } /** - * Sets the target objects for this relation + * Sets the target objects for this relation. * - * @param target an array containing the target objects for this relation + * @param target an array containing the target objects for this relation */ public void setTarget(Object [] target) { this.target = target;
--- a/src/java.desktop/share/classes/javax/accessibility/AccessibleRelationSet.java Fri Jun 16 09:20:39 2017 -0700 +++ b/src/java.desktop/share/classes/javax/accessibility/AccessibleRelationSet.java Sat Jun 17 08:03:05 2017 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 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 @@ -26,24 +26,22 @@ package javax.accessibility; import java.util.Vector; -import java.util.Locale; -import java.util.MissingResourceException; -import java.util.ResourceBundle; /** - * Class AccessibleRelationSet determines a component's relation set. The - * relation set of a component is a set of AccessibleRelation objects that - * describe the component's relationships with other components. + * Class {@code AccessibleRelationSet} determines a component's relation set. + * The relation set of a component is a set of {@code AccessibleRelation} + * objects that describe the component's relationships with other components. * + * @author Lynn Monsanto * @see AccessibleRelation - * - * @author Lynn Monsanto * @since 1.3 */ public class AccessibleRelationSet { /** - * Each entry in the Vector represents an AccessibleRelation. + * Each entry in the {@code Vector} represents an + * {@code AccessibleRelation}. + * * @see #add * @see #addAll * @see #remove @@ -63,11 +61,11 @@ } /** - * Creates a new relation with the initial set of relations contained in - * the array of relations passed in. Duplicate entries are ignored. + * Creates a new relation with the initial set of relations contained in the + * array of relations passed in. Duplicate entries are ignored. * - * @param relations an array of AccessibleRelation describing the - * relation set. + * @param relations an array of {@code AccessibleRelation} describing the + * relation set */ public AccessibleRelationSet(AccessibleRelation[] relations) { if (relations.length != 0) { @@ -79,14 +77,14 @@ } /** - * Adds a new relation to the current relation set. If the relation - * is already in the relation set, the target(s) of the specified - * relation is merged with the target(s) of the existing relation. - * Otherwise, the new relation is added to the relation set. + * Adds a new relation to the current relation set. If the relation is + * already in the relation set, the target(s) of the specified relation is + * merged with the target(s) of the existing relation. Otherwise, the new + * relation is added to the relation set. * - * @param relation the relation to add to the relation set - * @return true if relation is added to the relation set; false if the - * relation set is unchanged + * @param relation the relation to add to the relation set + * @return {@code true} if relation is added to the relation set; + * {@code false} if the relation set is unchanged */ public boolean add(AccessibleRelation relation) { if (relations == null) { @@ -117,10 +115,11 @@ } /** - * Adds all of the relations to the existing relation set. Duplicate - * entries are ignored. + * Adds all of the relations to the existing relation set. Duplicate entries + * are ignored. * - * @param relations AccessibleRelation array describing the relation set. + * @param relations {@code AccessibleRelation} array describing the + * relation set */ public void addAll(AccessibleRelation[] relations) { if (relations.length != 0) { @@ -134,15 +133,14 @@ } /** - * Removes a relation from the current relation set. If the relation - * is not in the set, the relation set will be unchanged and the - * return value will be false. If the relation is in the relation - * set, it will be removed from the set and the return value will be - * true. + * Removes a relation from the current relation set. If the relation is not + * in the set, the relation set will be unchanged and the return value will + * be {@code false}. If the relation is in the relation set, it will be + * removed from the set and the return value will be {@code true}. * - * @param relation the relation to remove from the relation set - * @return true if the relation is in the relation set; false if the - * relation set is unchanged + * @param relation the relation to remove from the relation set + * @return {@code true} if the relation is in the relation set; + * {@code false} if the relation set is unchanged */ public boolean remove(AccessibleRelation relation) { if (relations == null) { @@ -163,6 +161,7 @@ /** * Returns the number of relations in the relation set. + * * @return the number of relations in the relation set */ public int size() { @@ -174,10 +173,12 @@ } /** - * Returns whether the relation set contains a relation - * that matches the specified key. - * @param key the AccessibleRelation key - * @return true if the relation is in the relation set; otherwise false + * Returns whether the relation set contains a relation that matches the + * specified key. + * + * @param key the {@code AccessibleRelation} key + * @return {@code true} if the relation is in the relation set; otherwise + * {@code false} */ public boolean contains(String key) { return get(key) != null; @@ -185,9 +186,10 @@ /** * Returns the relation that matches the specified key. - * @param key the AccessibleRelation key + * + * @param key the {@code AccessibleRelation} key * @return the relation, if one exists, that matches the specified key. - * Otherwise, null is returned. + * Otherwise, {@code null} is returned. */ public AccessibleRelation get(String key) { if (relations == null) { @@ -205,8 +207,10 @@ } /** - * Returns the current relation set as an array of AccessibleRelation - * @return AccessibleRelation array contacting the current relation. + * Returns the current relation set as an array of + * {@code AccessibleRelation}. + * + * @return {@code AccessibleRelation} array contacting the current relation */ public AccessibleRelation[] toArray() { if (relations == null) { @@ -222,10 +226,10 @@ } /** - * Creates a localized String representing all the relations in the set + * Creates a localized string representing all the relations in the set * using the default locale. * - * @return comma separated localized String + * @return comma separated localized string * @see AccessibleBundle#toDisplayString */ public String toString() {
--- a/src/java.desktop/share/classes/javax/accessibility/AccessibleResourceBundle.java Fri Jun 16 09:20:39 2017 -0700 +++ b/src/java.desktop/share/classes/javax/accessibility/AccessibleResourceBundle.java Sat Jun 17 08:03:05 2017 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -29,19 +29,20 @@ /** * A resource bundle containing the localized strings in the accessibility - * package. This is meant only for internal use by Java Accessibility and - * is not meant to be used by assistive technologies or applications. + * package. This is meant only for internal use by Java Accessibility and is not + * meant to be used by assistive technologies or applications. * - * @author Willie Walker - * @deprecated This class is deprecated as of version 1.3 of the - * Java Platform. + * @author Willie Walker + * @deprecated This class is deprecated as of version 1.3 of the Java Platform */ @Deprecated public class AccessibleResourceBundle extends ListResourceBundle { /** - * Returns the mapping between the programmatic keys and the - * localized display strings. + * Returns the mapping between the programmatic keys and the localized + * display strings. + * + * @return an array of an {@code Object} array representing a key-value pair */ public Object[][] getContents() { // The table holding the mapping between the programmatic keys
--- a/src/java.desktop/share/classes/javax/accessibility/AccessibleRole.java Fri Jun 16 09:20:39 2017 -0700 +++ b/src/java.desktop/share/classes/javax/accessibility/AccessibleRole.java Sat Jun 17 08:03:05 2017 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2005, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 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 @@ -25,32 +25,30 @@ package javax.accessibility; -import java.util.Locale; -import java.util.MissingResourceException; -import java.util.ResourceBundle; - /** - * <P>Class AccessibleRole determines the role of a component. The role of a - * component describes its generic function. (E.G., -* "push button," "table," or "list.") - * <p>The toDisplayString method allows you to obtain the localized string - * for a locale independent key from a predefined ResourceBundle for the - * keys defined in this class. - * <p>The constants in this class present a strongly typed enumeration - * of common object roles. A public constructor for this class has been - * purposely omitted and applications should use one of the constants - * from this class. If the constants in this class are not sufficient - * to describe the role of an object, a subclass should be generated - * from this class and it should provide constants in a similar manner. + * Class {@code AccessibleRole} determines the role of a component. The role of + * a component describes its generic function. (E.G., "push button," "table," or + * "list.") + * <p> + * The {@link #toDisplayString()} method allows you to obtain the localized + * string for a locale independent key from a predefined {@code ResourceBundle} + * for the keys defined in this class. + * <p> + * The constants in this class present a strongly typed enumeration of common + * object roles. A public constructor for this class has been purposely omitted + * and applications should use one of the constants from this class. If the + * constants in this class are not sufficient to describe the role of an object, + * a subclass should be generated from this class and it should provide + * constants in a similar manner. * - * @author Willie Walker - * @author Peter Korn - * @author Lynn Monsanto + * @author Willie Walker + * @author Peter Korn + * @author Lynn Monsanto */ public class AccessibleRole extends AccessibleBundle { -// If you add or remove anything from here, make sure you -// update AccessibleResourceBundle.java. + // If you add or remove anything from here, make sure you + // update AccessibleResourceBundle.java. /** * Object is used to alert the user about something. @@ -65,8 +63,8 @@ = new AccessibleRole("columnheader"); /** - * Object that can be drawn into and is used to trap - * events. + * Object that can be drawn into and is used to trap events. + * * @see #FRAME * @see #GLASS_PANE * @see #LAYERED_PANE @@ -75,14 +73,15 @@ = new AccessibleRole("canvas"); /** - * A list of choices the user can select from. Also optionally - * allows the user to enter a choice of their own. + * A list of choices the user can select from. Also optionally allows the + * user to enter a choice of their own. */ public static final AccessibleRole COMBO_BOX = new AccessibleRole("combobox"); /** - * An iconified internal frame in a DESKTOP_PANE. + * An iconified internal frame in a {@code DESKTOP_PANE}. + * * @see #DESKTOP_PANE * @see #INTERNAL_FRAME */ @@ -90,11 +89,12 @@ = new AccessibleRole("desktopicon"); /** - * An object containing a collection of {@code Accessibles} that - * together represents {@code HTML} content. The child - * {@code Accessibles} would include objects implementing - * {@code AccessibleText}, {@code AccessibleHypertext}, - * {@code AccessibleIcon}, and other interfaces. + * An object containing a collection of {@code Accessibles} that together + * represents {@code HTML} content. The child {@code Accessibles} would + * include objects implementing {@code AccessibleText}, + * {@code AccessibleHypertext}, {@code AccessibleIcon}, and other + * interfaces. + * * @see #HYPERLINK * @see AccessibleText * @see AccessibleHypertext @@ -106,10 +106,10 @@ = new AccessibleRole("htmlcontainer"); /** - * A frame-like object that is clipped by a desktop pane. The - * desktop pane, internal frame, and desktop icon objects are - * often used to create multiple document interfaces within an - * application. + * A frame-like object that is clipped by a desktop pane. The desktop pane, + * internal frame, and desktop icon objects are often used to create + * multiple document interfaces within an application. + * * @see #DESKTOP_ICON * @see #DESKTOP_PANE * @see #FRAME @@ -118,8 +118,9 @@ = new AccessibleRole("internalframe"); /** - * A pane that supports internal frames and - * iconified versions of those internal frames. + * A pane that supports internal frames and iconified versions of those + * internal frames. + * * @see #DESKTOP_ICON * @see #INTERNAL_FRAME */ @@ -127,7 +128,8 @@ = new AccessibleRole("desktoppane"); /** - * A specialized pane whose primary use is inside a DIALOG + * A specialized pane whose primary use is inside a {@code DIALOG}. + * * @see #DIALOG */ public static final AccessibleRole OPTION_PANE @@ -135,6 +137,7 @@ /** * A top level window with no title or border. + * * @see #FRAME * @see #DIALOG */ @@ -142,8 +145,9 @@ = new AccessibleRole("window"); /** - * A top level window with a title bar, border, menu bar, etc. It is - * often used as the primary window for an application. + * A top level window with a title bar, border, menu bar, etc. It is often + * used as the primary window for an application. + * * @see #DIALOG * @see #CANVAS * @see #WINDOW @@ -152,9 +156,10 @@ = new AccessibleRole("frame"); /** - * A top level window with title bar and a border. A dialog is similar - * to a frame, but it has fewer properties and is often used as a - * secondary window for an application. + * A top level window with title bar and a border. A dialog is similar to a + * frame, but it has fewer properties and is often used as a secondary + * window for an application. + * * @see #FRAME * @see #WINDOW */ @@ -169,34 +174,34 @@ /** - * A pane that allows the user to navigate through - * and select the contents of a directory. May be used - * by a file chooser. + * A pane that allows the user to navigate through and select the contents + * of a directory. May be used by a file chooser. + * * @see #FILE_CHOOSER */ public static final AccessibleRole DIRECTORY_PANE = new AccessibleRole("directorypane"); /** - * A specialized dialog that displays the files in the directory - * and lets the user select a file, browse a different directory, - * or specify a filename. May use the directory pane to show the - * contents of a directory. + * A specialized dialog that displays the files in the directory and lets + * the user select a file, browse a different directory, or specify a + * filename. May use the directory pane to show the contents of a directory. + * * @see #DIRECTORY_PANE */ public static final AccessibleRole FILE_CHOOSER = new AccessibleRole("filechooser"); /** - * An object that fills up space in a user interface. It is often - * used in interfaces to tweak the spacing between components, - * but serves no other purpose. + * An object that fills up space in a user interface. It is often used in + * interfaces to tweak the spacing between components, but serves no other + * purpose. */ public static final AccessibleRole FILLER = new AccessibleRole("filler"); /** - * A hypertext anchor + * A hypertext anchor. */ public static final AccessibleRole HYPERLINK = new AccessibleRole("hyperlink"); @@ -216,6 +221,7 @@ /** * A specialized pane that has a glass pane and a layered pane as its * children. + * * @see #GLASS_PANE * @see #LAYERED_PANE */ @@ -223,8 +229,8 @@ = new AccessibleRole("rootpane"); /** - * A pane that is guaranteed to be painted on top - * of all panes beneath it. + * A pane that is guaranteed to be painted on top of all panes beneath it. + * * @see #ROOT_PANE * @see #CANVAS */ @@ -233,9 +239,10 @@ /** * A specialized pane that allows its children to be drawn in layers, - * providing a form of stacking order. This is usually the pane that - * holds the menu bar as well as the pane that contains most of the - * visual components in a window. + * providing a form of stacking order. This is usually the pane that holds + * the menu bar as well as the pane that contains most of the visual + * components in a window. + * * @see #GLASS_PANE * @see #ROOT_PANE */ @@ -243,9 +250,10 @@ = new AccessibleRole("layeredpane"); /** - * An object that presents a list of objects to the user and allows the - * user to select one or more of them. A list is usually contained - * within a scroll pane. + * An object that presents a list of objects to the user and allows the user + * to select one or more of them. A list is usually contained within a + * scroll pane. + * * @see #SCROLL_PANE * @see #LIST_ITEM */ @@ -253,8 +261,9 @@ = new AccessibleRole("list"); /** - * An object that presents an element in a list. A list is usually - * contained within a scroll pane. + * An object that presents an element in a list. A list is usually contained + * within a scroll pane. + * * @see #SCROLL_PANE * @see #LIST */ @@ -262,10 +271,10 @@ = new AccessibleRole("listitem"); /** - * An object usually drawn at the top of the primary dialog box of - * an application that contains a list of menus the user can choose - * from. For example, a menu bar might contain menus for "File," - * "Edit," and "Help." + * An object usually drawn at the top of the primary dialog box of an + * application that contains a list of menus the user can choose from. For + * example, a menu bar might contain menus for "File," "Edit," and "Help." + * * @see #MENU * @see #POPUP_MENU * @see #LAYERED_PANE @@ -274,9 +283,9 @@ = new AccessibleRole("menubar"); /** - * A temporary window that is usually used to offer the user a - * list of choices, and then hides when the user selects one of - * those choices. + * A temporary window that is usually used to offer the user a list of + * choices, and then hides when the user selects one of those choices. + * * @see #MENU * @see #MENU_ITEM */ @@ -284,12 +293,12 @@ = new AccessibleRole("popupmenu"); /** - * An object usually found inside a menu bar that contains a list - * of actions the user can choose from. A menu can have any object - * as its children, but most often they are menu items, other menus, - * or rudimentary objects such as radio buttons, check boxes, or - * separators. For example, an application may have an "Edit" menu - * that contains menu items for "Cut" and "Paste." + * An object usually found inside a menu bar that contains a list of actions + * the user can choose from. A menu can have any object as its children, but + * most often they are menu items, other menus, or rudimentary objects such + * as radio buttons, check boxes, or separators. For example, an application + * may have an "Edit" menu that contains menu items for "Cut" and "Paste." + * * @see #MENU_BAR * @see #MENU_ITEM * @see #SEPARATOR @@ -301,10 +310,11 @@ = new AccessibleRole("menu"); /** - * An object usually contained in a menu that presents an action - * the user can choose. For example, the "Cut" menu item in an - * "Edit" menu would be an action the user can select to cut the - * selected area of text in a document. + * An object usually contained in a menu that presents an action the user + * can choose. For example, the "Cut" menu item in an "Edit" menu would be + * an action the user can select to cut the selected area of text in a + * document. + * * @see #MENU_BAR * @see #SEPARATOR * @see #POPUP_MENU @@ -313,11 +323,11 @@ = new AccessibleRole("menuitem"); /** - * An object usually contained in a menu to provide a visual - * and logical separation of the contents in a menu. For example, - * the "File" menu of an application might contain menu items for - * "Open," "Close," and "Exit," and will place a separator between - * "Close" and "Exit" menu items. + * An object usually contained in a menu to provide a visual and logical + * separation of the contents in a menu. For example, the "File" menu of an + * application might contain menu items for "Open," "Close," and "Exit," and + * will place a separator between "Close" and "Exit" menu items. + * * @see #MENU * @see #MENU_ITEM */ @@ -325,19 +335,21 @@ = new AccessibleRole("separator"); /** - * An object that presents a series of panels (or page tabs), one at a - * time, through some mechanism provided by the object. The most common - * mechanism is a list of tabs at the top of the panel. The children of - * a page tab list are all page tabs. + * An object that presents a series of panels (or page tabs), one at a time, + * through some mechanism provided by the object. The most common mechanism + * is a list of tabs at the top of the panel. The children of a page tab + * list are all page tabs. + * * @see #PAGE_TAB */ public static final AccessibleRole PAGE_TAB_LIST = new AccessibleRole("pagetablist"); /** - * An object that is a child of a page tab list. Its sole child is - * the panel that is to be presented to the user when the user - * selects the page tab from the list of tabs in the page tab list. + * An object that is a child of a page tab list. Its sole child is the panel + * that is to be presented to the user when the user selects the page tab + * from the list of tabs in the page tab list. + * * @see #PAGE_TAB_LIST */ public static final AccessibleRole PAGE_TAB @@ -356,8 +368,8 @@ = new AccessibleRole("progressbar"); /** - * A text object used for passwords, or other places where the - * text contents is not shown visibly to the user + * A text object used for passwords, or other places where the text contents + * is not shown visibly to the user. */ public static final AccessibleRole PASSWORD_TEXT = new AccessibleRole("passwordtext"); @@ -365,6 +377,7 @@ /** * An object the user can manipulate to tell the application to do * something. + * * @see #CHECK_BOX * @see #TOGGLE_BUTTON * @see #RADIO_BUTTON @@ -373,8 +386,9 @@ = new AccessibleRole("pushbutton"); /** - * A specialized push button that can be checked or unchecked, but - * does not provide a separate indicator for the current state. + * A specialized push button that can be checked or unchecked, but does not + * provide a separate indicator for the current state. + * * @see #PUSH_BUTTON * @see #CHECK_BOX * @see #RADIO_BUTTON @@ -383,8 +397,9 @@ = new AccessibleRole("togglebutton"); /** - * A choice that can be checked or unchecked and provides a - * separate indicator for the current state. + * A choice that can be checked or unchecked and provides a separate + * indicator for the current state. + * * @see #PUSH_BUTTON * @see #TOGGLE_BUTTON * @see #RADIO_BUTTON @@ -393,8 +408,9 @@ = new AccessibleRole("checkbox"); /** - * A specialized check box that will cause other radio buttons in the - * same group to become unchecked when this one is checked. + * A specialized check box that will cause other radio buttons in the same + * group to become unchecked when this one is checked. + * * @see #PUSH_BUTTON * @see #TOGGLE_BUTTON * @see #CHECK_BOX @@ -409,8 +425,9 @@ = new AccessibleRole("rowheader"); /** - * An object that allows a user to incrementally view a large amount - * of information. Its children can include scroll bars and a viewport. + * An object that allows a user to incrementally view a large amount of + * information. Its children can include scroll bars and a viewport. + * * @see #SCROLL_BAR * @see #VIEWPORT */ @@ -418,24 +435,26 @@ = new AccessibleRole("scrollpane"); /** - * An object usually used to allow a user to incrementally view a - * large amount of data. Usually used only by a scroll pane. + * An object usually used to allow a user to incrementally view a large + * amount of data. Usually used only by a scroll pane. + * * @see #SCROLL_PANE */ public static final AccessibleRole SCROLL_BAR = new AccessibleRole("scrollbar"); /** - * An object usually used in a scroll pane. It represents the portion - * of the entire data that the user can see. As the user manipulates - * the scroll bars, the contents of the viewport can change. + * An object usually used in a scroll pane. It represents the portion of the + * entire data that the user can see. As the user manipulates the scroll + * bars, the contents of the viewport can change. + * * @see #SCROLL_PANE */ public static final AccessibleRole VIEWPORT = new AccessibleRole("viewport"); /** - * An object that allows the user to select from a bounded range. For + * An object that allows the user to select from a bounded range. For * example, a slider might be used to select a number between 0 and 100. */ public static final AccessibleRole SLIDER @@ -443,54 +462,56 @@ /** * A specialized panel that presents two other panels at the same time. - * Between the two panels is a divider the user can manipulate to make - * one panel larger and the other panel smaller. + * Between the two panels is a divider the user can manipulate to make one + * panel larger and the other panel smaller. */ public static final AccessibleRole SPLIT_PANE = new AccessibleRole("splitpane"); /** - * An object used to present information in terms of rows and columns. - * An example might include a spreadsheet application. + * An object used to present information in terms of rows and columns. An + * example might include a spreadsheet application. */ public static final AccessibleRole TABLE = new AccessibleRole("table"); /** - * An object that presents text to the user. The text is usually - * editable by the user as opposed to a label. + * An object that presents text to the user. The text is usually editable by + * the user as opposed to a label. + * * @see #LABEL */ public static final AccessibleRole TEXT = new AccessibleRole("text"); /** - * An object used to present hierarchical information to the user. - * The individual nodes in the tree can be collapsed and expanded - * to provide selective disclosure of the tree's contents. + * An object used to present hierarchical information to the user. The + * individual nodes in the tree can be collapsed and expanded to provide + * selective disclosure of the tree's contents. */ public static final AccessibleRole TREE = new AccessibleRole("tree"); /** - * A bar or palette usually composed of push buttons or toggle buttons. - * It is often used to provide the most frequently used functions for an + * A bar or palette usually composed of push buttons or toggle buttons. It + * is often used to provide the most frequently used functions for an * application. */ public static final AccessibleRole TOOL_BAR = new AccessibleRole("toolbar"); /** - * An object that provides information about another object. The - * accessibleDescription property of the tool tip is often displayed - * to the user in a small "help bubble" when the user causes the - * mouse to hover over the object associated with the tool tip. + * An object that provides information about another object. The + * {@code accessibleDescription} property of the tool tip is often displayed + * to the user in a small "help bubble" when the user causes the mouse to + * hover over the object associated with the tool tip. */ public static final AccessibleRole TOOL_TIP = new AccessibleRole("tooltip"); /** * An AWT component, but nothing else is known about it. + * * @see #SWING_COMPONENT * @see #UNKNOWN */ @@ -499,6 +520,7 @@ /** * A Swing component, but nothing else is known about it. + * * @see #AWT_COMPONENT * @see #UNKNOWN */ @@ -506,8 +528,9 @@ = new AccessibleRole("swingcomponent"); /** - * The object contains some Accessible information, but its role is + * The object contains some {@code Accessible} information, but its role is * not known. + * * @see #AWT_COMPONENT * @see #SWING_COMPONENT */ @@ -515,42 +538,42 @@ = new AccessibleRole("unknown"); /** - * A STATUS_BAR is an simple component that can contain - * multiple labels of status information to the user. + * A {@code STATUS_BAR} is an simple component that can contain multiple + * labels of status information to the user. */ public static final AccessibleRole STATUS_BAR = new AccessibleRole("statusbar"); /** - * A DATE_EDITOR is a component that allows users to edit - * java.util.Date and java.util.Time objects + * A {@code DATE_EDITOR} is a component that allows users to edit + * {@code java.util.Date} and {@code java.util.Time} objects. */ public static final AccessibleRole DATE_EDITOR = new AccessibleRole("dateeditor"); /** - * A SPIN_BOX is a simple spinner component and its main use - * is for simple numbers. + * A {@code SPIN_BOX} is a simple spinner component and its main use is for + * simple numbers. */ public static final AccessibleRole SPIN_BOX = new AccessibleRole("spinbox"); /** - * A FONT_CHOOSER is a component that lets the user pick various + * A {@code FONT_CHOOSER} is a component that lets the user pick various * attributes for fonts. */ public static final AccessibleRole FONT_CHOOSER = new AccessibleRole("fontchooser"); /** - * A GROUP_BOX is a simple container that contains a border - * around it and contains components inside it. + * A {@code GROUP_BOX} is a simple container that contains a border around + * it and contains components inside it. */ public static final AccessibleRole GROUP_BOX = new AccessibleRole("groupbox"); /** - * A text header + * A text header. * * @since 1.5 */ @@ -558,7 +581,7 @@ new AccessibleRole("header"); /** - * A text footer + * A text footer. * * @since 1.5 */ @@ -566,7 +589,7 @@ new AccessibleRole("footer"); /** - * A text paragraph + * A text paragraph. * * @since 1.5 */ @@ -574,7 +597,7 @@ new AccessibleRole("paragraph"); /** - * A ruler is an object used to measure distance + * A ruler is an object used to measure distance. * * @since 1.5 */ @@ -582,9 +605,8 @@ new AccessibleRole("ruler"); /** - * A role indicating the object acts as a formula for - * calculating a value. An example is a formula in - * a spreadsheet cell. + * A role indicating the object acts as a formula for calculating a value. + * An example is a formula in a spreadsheet cell. * * @since 1.5 */ @@ -592,8 +614,7 @@ new AccessibleRole("editbar"); /** - * A role indicating the object monitors the progress - * of some operation. + * A role indicating the object monitors the progress of some operation. * * @since 1.5 */ @@ -643,16 +664,16 @@ // = new AccessibleRole("treenode"); /** - * Creates a new AccessibleRole using the given locale independent key. - * This should not be a public method. Instead, it is used to create + * Creates a new {@code AccessibleRole} using the given locale independent + * key. This should not be a public method. Instead, it is used to create * the constants in this file to make it a strongly typed enumeration. * Subclasses of this class should enforce similar policy. * <p> - * The key String should be a locale independent key for the role. - * It is not intended to be used as the actual String to display - * to the user. To get the localized string, use toDisplayString. + * The key {@code String} should be a locale independent key for the role. + * It is not intended to be used as the actual {@code String} to display to + * the user. To get the localized string, use {@link #toDisplayString()}. * - * @param key the locale independent name of the role. + * @param key the locale independent name of the role * @see AccessibleBundle#toDisplayString */ protected AccessibleRole(String key) {
--- a/src/java.desktop/share/classes/javax/accessibility/AccessibleSelection.java Fri Jun 16 09:20:39 2017 -0700 +++ b/src/java.desktop/share/classes/javax/accessibility/AccessibleSelection.java Sat Jun 17 08:03:05 2017 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 1999, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 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 @@ -26,89 +26,90 @@ package javax.accessibility; /** - * This AccessibleSelection interface - * provides the standard mechanism for an assistive technology to determine - * what the current selected children are, as well as modify the selection set. - * Any object that has children that can be selected should support - * the AccessibleSelection interface. Applications can determine if an object supports the - * AccessibleSelection interface by first obtaining its AccessibleContext (see - * {@link Accessible}) and then calling the - * {@link AccessibleContext#getAccessibleSelection} method. - * If the return value is not null, the object supports this interface. + * This {@code AccessibleSelection} interface provides the standard mechanism + * for an assistive technology to determine what the current selected children + * are, as well as modify the selection set. Any object that has children that + * can be selected should support the {@code AccessibleSelection} interface. + * Applications can determine if an object supports the + * {@code AccessibleSelection} interface by first obtaining its + * {@code AccessibleContext} (see {@link Accessible}) and then calling the + * {@link AccessibleContext#getAccessibleSelection} method. If the return value + * is not {@code null}, the object supports this interface. * + * @author Peter Korn + * @author Hans Muller + * @author Willie Walker * @see Accessible * @see Accessible#getAccessibleContext * @see AccessibleContext * @see AccessibleContext#getAccessibleSelection - * - * @author Peter Korn - * @author Hans Muller - * @author Willie Walker */ public interface AccessibleSelection { /** - * Returns the number of Accessible children currently selected. - * If no children are selected, the return value will be 0. + * Returns the number of {@code Accessible} children currently selected. If + * no children are selected, the return value will be 0. * - * @return the number of items currently selected. + * @return the number of items currently selected */ - public int getAccessibleSelectionCount(); + public int getAccessibleSelectionCount(); /** - * Returns an Accessible representing the specified selected child - * of the object. If there isn't a selection, or there are - * fewer children selected than the integer passed in, the return - * value will be null. - * <p>Note that the index represents the i-th selected child, which - * is different from the i-th child. + * Returns an {@code Accessible} representing the specified selected child + * of the object. If there isn't a selection, or there are fewer children + * selected than the integer passed in, the return value will be + * {@code null}. + * <p> + * Note that the index represents the i-th selected child, which is + * different from the i-th child. * - * @param i the zero-based index of selected children + * @param i the zero-based index of selected children * @return the i-th selected child * @see #getAccessibleSelectionCount */ - public Accessible getAccessibleSelection(int i); + public Accessible getAccessibleSelection(int i); /** * Determines if the current child of this object is selected. * - * @return true if the current child of this object is selected; else false. - * @param i the zero-based index of the child in this Accessible object. + * @param i the zero-based index of the child in this {@code Accessible} + * object + * @return {@code true} if the current child of this object is selected; + * else {@code false} * @see AccessibleContext#getAccessibleChild */ - public boolean isAccessibleChildSelected(int i); + public boolean isAccessibleChildSelected(int i); /** - * Adds the specified Accessible child of the object to the object's - * selection. If the object supports multiple selections, - * the specified child is added to any existing selection, otherwise - * it replaces any existing selection in the object. If the - * specified child is already selected, this method has no effect. + * Adds the specified {@code Accessible} child of the object to the object's + * selection. If the object supports multiple selections, the specified + * child is added to any existing selection, otherwise it replaces any + * existing selection in the object. If the specified child is already + * selected, this method has no effect. * - * @param i the zero-based index of the child + * @param i the zero-based index of the child * @see AccessibleContext#getAccessibleChild */ - public void addAccessibleSelection(int i); + public void addAccessibleSelection(int i); /** - * Removes the specified child of the object from the object's - * selection. If the specified item isn't currently selected, this - * method has no effect. + * Removes the specified child of the object from the object's selection. If + * the specified item isn't currently selected, this method has no effect. * - * @param i the zero-based index of the child + * @param i the zero-based index of the child * @see AccessibleContext#getAccessibleChild */ - public void removeAccessibleSelection(int i); + public void removeAccessibleSelection(int i); /** - * Clears the selection in the object, so that no children in the - * object are selected. + * Clears the selection in the object, so that no children in the object are + * selected. */ - public void clearAccessibleSelection(); + public void clearAccessibleSelection(); /** - * Causes every child of the object to be selected - * if the object supports multiple selections. + * Causes every child of the object to be selected if the object supports + * multiple selections. */ - public void selectAllAccessibleSelection(); + public void selectAllAccessibleSelection(); }
--- a/src/java.desktop/share/classes/javax/accessibility/AccessibleState.java Fri Jun 16 09:20:39 2017 -0700 +++ b/src/java.desktop/share/classes/javax/accessibility/AccessibleState.java Sat Jun 17 08:03:05 2017 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2004, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 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 @@ -25,27 +25,24 @@ package javax.accessibility; -import java.util.Vector; -import java.util.Locale; -import java.util.MissingResourceException; -import java.util.ResourceBundle; - /** - * <P>Class AccessibleState describes a component's particular state. The actual - * state of the component is defined as an AccessibleStateSet, which is a - * composed set of AccessibleStates. - * <p>The toDisplayString method allows you to obtain the localized string - * for a locale independent key from a predefined ResourceBundle for the - * keys defined in this class. - * <p>The constants in this class present a strongly typed enumeration - * of common object roles. A public constructor for this class has been - * purposely omitted and applications should use one of the constants - * from this class. If the constants in this class are not sufficient - * to describe the role of an object, a subclass should be generated - * from this class and it should provide constants in a similar manner. + * Class {@code AccessibleState} describes a component's particular state. The + * actual state of the component is defined as an {@code AccessibleStateSet}, + * which is a composed set of {@code AccessibleStates}. + * <p> + * The {@link #toDisplayString()} method allows you to obtain the localized + * string for a locale independent key from a predefined {@code ResourceBundle} + * for the keys defined in this class. + * <p> + * The constants in this class present a strongly typed enumeration of common + * object roles. A public constructor for this class has been purposely omitted + * and applications should use one of the constants from this class. If the + * constants in this class are not sufficient to describe the role of an object, + * a subclass should be generated from this class and it should provide + * constants in a similar manner. * - * @author Willie Walker - * @author Peter Korn + * @author Willie Walker + * @author Peter Korn */ public class AccessibleState extends AccessibleBundle { @@ -53,11 +50,12 @@ // update AccessibleResourceBundle.java. /** - * Indicates a window is currently the active window. This includes - * windows, dialogs, frames, etc. In addition, this state is used - * to indicate the currently active child of a component such as a - * list, table, or tree. For example, the active child of a list - * is the child that is drawn with a rectangle around it. + * Indicates a window is currently the active window. This includes windows, + * dialogs, frames, etc. In addition, this state is used to indicate the + * currently active child of a component such as a list, table, or tree. For + * example, the active child of a list is the child that is drawn with a + * rectangle around it. + * * @see AccessibleRole#WINDOW * @see AccessibleRole#FRAME * @see AccessibleRole#DIALOG @@ -66,28 +64,30 @@ = new AccessibleState("active"); /** - * Indicates this object is currently pressed. This is usually - * associated with buttons and indicates the user has pressed a - * mouse button while the pointer was over the button and has - * not yet released the mouse button. + * Indicates this object is currently pressed. This is usually associated + * with buttons and indicates the user has pressed a mouse button while the + * pointer was over the button and has not yet released the mouse button. + * * @see AccessibleRole#PUSH_BUTTON */ public static final AccessibleState PRESSED = new AccessibleState("pressed"); /** - * Indicates that the object is armed. This is usually used on buttons - * that have been pressed but not yet released, and the mouse pointer - * is still over the button. + * Indicates that the object is armed. This is usually used on buttons that + * have been pressed but not yet released, and the mouse pointer is still + * over the button. + * * @see AccessibleRole#PUSH_BUTTON */ public static final AccessibleState ARMED = new AccessibleState("armed"); /** - * Indicates the current object is busy. This is usually used on objects - * such as progress bars, sliders, or scroll bars to indicate they are - * in a state of transition. + * Indicates the current object is busy. This is usually used on objects + * such as progress bars, sliders, or scroll bars to indicate they are in a + * state of transition. + * * @see AccessibleRole#PROGRESS_BAR * @see AccessibleRole#SCROLL_BAR * @see AccessibleRole#SLIDER @@ -96,8 +96,9 @@ = new AccessibleState("busy"); /** - * Indicates this object is currently checked. This is usually used on + * Indicates this object is currently checked. This is usually used on * objects such as toggle buttons, radio buttons, and check boxes. + * * @see AccessibleRole#TOGGLE_BUTTON * @see AccessibleRole#RADIO_BUTTON * @see AccessibleRole#CHECK_BOX @@ -106,19 +107,21 @@ = new AccessibleState("checked"); /** - * Indicates the user can change the contents of this object. This - * is usually used primarily for objects that allow the user to - * enter text. Other objects, such as scroll bars and sliders, - * are automatically editable if they are enabled. + * Indicates the user can change the contents of this object. This is + * usually used primarily for objects that allow the user to enter text. + * Other objects, such as scroll bars and sliders, are automatically + * editable if they are enabled. + * * @see #ENABLED */ public static final AccessibleState EDITABLE = new AccessibleState("editable"); /** - * Indicates this object allows progressive disclosure of its children. - * This is usually used with hierarchical objects such as trees and - * is often paired with the EXPANDED or COLLAPSED states. + * Indicates this object allows progressive disclosure of its children. This + * is usually used with hierarchical objects such as trees and is often + * paired with the {@code EXPANDED} or {@code COLLAPSED} states. + * * @see #EXPANDED * @see #COLLAPSED * @see AccessibleRole#TREE @@ -127,9 +130,10 @@ = new AccessibleState("expandable"); /** - * Indicates this object is collapsed. This is usually paired with the - * EXPANDABLE state and is used on objects that provide progressive + * Indicates this object is collapsed. This is usually paired with the + * {@code EXPANDABLE} state and is used on objects that provide progressive * disclosure such as trees. + * * @see #EXPANDABLE * @see #EXPANDED * @see AccessibleRole#TREE @@ -138,9 +142,10 @@ = new AccessibleState("collapsed"); /** - * Indicates this object is expanded. This is usually paired with the - * EXPANDABLE state and is used on objects that provide progressive + * Indicates this object is expanded. This is usually paired with the + * {@code EXPANDABLE} state and is used on objects that provide progressive * disclosure such as trees. + * * @see #EXPANDABLE * @see #COLLAPSED * @see AccessibleRole#TREE @@ -149,18 +154,19 @@ = new AccessibleState("expanded"); /** - * Indicates this object is enabled. The absence of this state from an - * object's state set indicates this object is not enabled. An object - * that is not enabled cannot be manipulated by the user. In a graphical - * display, it is usually grayed out. + * Indicates this object is enabled. The absence of this state from an + * object's state set indicates this object is not enabled. An object that + * is not enabled cannot be manipulated by the user. In a graphical display, + * it is usually grayed out. */ public static final AccessibleState ENABLED = new AccessibleState("enabled"); /** - * Indicates this object can accept keyboard focus, which means all - * events resulting from typing on the keyboard will normally be - * passed to it when it has focus. + * Indicates this object can accept keyboard focus, which means all events + * resulting from typing on the keyboard will normally be passed to it when + * it has focus. + * * @see #FOCUSED */ public static final AccessibleState FOCUSABLE @@ -168,15 +174,16 @@ /** * Indicates this object currently has the keyboard focus. + * * @see #FOCUSABLE */ public static final AccessibleState FOCUSED = new AccessibleState("focused"); /** - * Indicates this object is minimized and is represented only by an - * icon. This is usually only associated with frames and internal - * frames. + * Indicates this object is minimized and is represented only by an icon. + * This is usually only associated with frames and internal frames. + * * @see AccessibleRole#FRAME * @see AccessibleRole#INTERNAL_FRAME */ @@ -184,20 +191,21 @@ = new AccessibleState("iconified"); /** - * Indicates something must be done with this object before the - * user can interact with an object in a different window. This - * is usually associated only with dialogs. + * Indicates something must be done with this object before the user can + * interact with an object in a different window. This is usually associated + * only with dialogs. + * * @see AccessibleRole#DIALOG */ public static final AccessibleState MODAL = new AccessibleState("modal"); /** - * Indicates this object paints every pixel within its - * rectangular region. A non-opaque component paints only some of - * its pixels, allowing the pixels underneath it to "show through". - * A component that does not fully paint its pixels therefore - * provides a degree of transparency. + * Indicates this object paints every pixel within its rectangular region. A + * non-opaque component paints only some of its pixels, allowing the pixels + * underneath it to "show through". A component that does not fully paint + * its pixels therefore provides a degree of transparency. + * * @see Accessible#getAccessibleContext * @see AccessibleContext#getAccessibleComponent * @see AccessibleComponent#getBounds @@ -207,6 +215,7 @@ /** * Indicates the size of this object is not fixed. + * * @see Accessible#getAccessibleContext * @see AccessibleContext#getAccessibleComponent * @see AccessibleComponent#getSize @@ -217,8 +226,9 @@ /** - * Indicates this object allows more than one of its children to - * be selected at the same time. + * Indicates this object allows more than one of its children to be selected + * at the same time. + * * @see Accessible#getAccessibleContext * @see AccessibleContext#getAccessibleSelection * @see AccessibleSelection @@ -227,9 +237,10 @@ = new AccessibleState("multiselectable"); /** - * Indicates this object is the child of an object that allows its - * children to be selected, and that this child is one of those - * children that can be selected. + * Indicates this object is the child of an object that allows its children + * to be selected, and that this child is one of those children that can be + * selected. + * * @see #SELECTED * @see Accessible#getAccessibleContext * @see AccessibleContext#getAccessibleSelection @@ -239,9 +250,10 @@ = new AccessibleState("selectable"); /** - * Indicates this object is the child of an object that allows its - * children to be selected, and that this child is one of those - * children that has been selected. + * Indicates this object is the child of an object that allows its children + * to be selected, and that this child is one of those children that has + * been selected. + * * @see #SELECTABLE * @see Accessible#getAccessibleContext * @see AccessibleContext#getAccessibleSelection @@ -251,29 +263,31 @@ = new AccessibleState("selected"); /** - * Indicates this object, the object's parent, the object's parent's - * parent, and so on, are all visible. Note that this does not - * necessarily mean the object is painted on the screen. It might - * be occluded by some other showing object. + * Indicates this object, the object's parent, the object's parent's parent, + * and so on, are all visible. Note that this does not necessarily mean the + * object is painted on the screen. It might be occluded by some other + * showing object. + * * @see #VISIBLE */ public static final AccessibleState SHOWING = new AccessibleState("showing"); /** - * Indicates this object is visible. Note: this means that the - * object intends to be visible; however, it may not in fact be - * showing on the screen because one of the objects that this object - * is contained by is not visible. + * Indicates this object is visible. Note: this means that the object + * intends to be visible; however, it may not in fact be showing on the + * screen because one of the objects that this object is contained by is not + * visible. + * * @see #SHOWING */ public static final AccessibleState VISIBLE = new AccessibleState("visible"); /** - * Indicates the orientation of this object is vertical. This is - * usually associated with objects such as scrollbars, sliders, and - * progress bars. + * Indicates the orientation of this object is vertical. This is usually + * associated with objects such as scrollbars, sliders, and progress bars. + * * @see #VERTICAL * @see AccessibleRole#SCROLL_BAR * @see AccessibleRole#SLIDER @@ -283,9 +297,9 @@ = new AccessibleState("vertical"); /** - * Indicates the orientation of this object is horizontal. This is - * usually associated with objects such as scrollbars, sliders, and - * progress bars. + * Indicates the orientation of this object is horizontal. This is usually + * associated with objects such as scrollbars, sliders, and progress bars. + * * @see #HORIZONTAL * @see AccessibleRole#SCROLL_BAR * @see AccessibleRole#SLIDER @@ -295,39 +309,38 @@ = new AccessibleState("horizontal"); /** - * Indicates this (text) object can contain only a single line of text + * Indicates this (text) object can contain only a single line of text. */ public static final AccessibleState SINGLE_LINE = new AccessibleState("singleline"); /** - * Indicates this (text) object can contain multiple lines of text + * Indicates this (text) object can contain multiple lines of text. */ public static final AccessibleState MULTI_LINE = new AccessibleState("multiline"); /** - * Indicates this object is transient. An assistive technology should - * not add a PropertyChange listener to an object with transient state, - * as that object will never generate any events. Transient objects - * are typically created to answer Java Accessibility method queries, - * but otherwise do not remain linked to the underlying object (for - * example, those objects underneath lists, tables, and trees in Swing, - * where only one actual UI Component does shared rendering duty for - * all of the data objects underneath the actual list/table/tree elements). + * Indicates this object is transient. An assistive technology should not + * add a {@code PropertyChange} listener to an object with transient state, + * as that object will never generate any events. Transient objects are + * typically created to answer Java Accessibility method queries, but + * otherwise do not remain linked to the underlying object (for example, + * those objects underneath lists, tables, and trees in Swing, where only + * one actual {@code UI Component} does shared rendering duty for all of the + * data objects underneath the actual list/table/tree elements). * * @since 1.5 - * */ public static final AccessibleState TRANSIENT = new AccessibleState("transient"); /** - * Indicates this object is responsible for managing its - * subcomponents. This is typically used for trees and tables - * that have a large number of subcomponents and where the - * objects are created only when needed and otherwise remain virtual. - * The application should not manage the subcomponents directly. + * Indicates this object is responsible for managing its subcomponents. This + * is typically used for trees and tables that have a large number of + * subcomponents and where the objects are created only when needed and + * otherwise remain virtual. The application should not manage the + * subcomponents directly. * * @since 1.5 */ @@ -335,10 +348,9 @@ = new AccessibleState ("managesDescendants"); /** - * Indicates that the object state is indeterminate. An example - * is selected text that is partially bold and partially not - * bold. In this case the attributes associated with the selected - * text are indeterminate. + * Indicates that the object state is indeterminate. An example is selected + * text that is partially bold and partially not bold. In this case the + * attributes associated with the selected text are indeterminate. * * @since 1.5 */ @@ -346,10 +358,9 @@ = new AccessibleState ("indeterminate"); /** - * A state indicating that text is truncated by a bounding rectangle - * and that some of the text is not displayed on the screen. An example - * is text in a spreadsheet cell that is truncated by the bounds of - * the cell. + * A state indicating that text is truncated by a bounding rectangle and + * that some of the text is not displayed on the screen. An example is text + * in a spreadsheet cell that is truncated by the bounds of the cell. * * @since 1.5 */ @@ -357,16 +368,16 @@ = new AccessibleState("truncated"); /** - * Creates a new AccessibleState using the given locale independent key. - * This should not be a public method. Instead, it is used to create + * Creates a new {@code AccessibleState} using the given locale independent + * key. This should not be a public method. Instead, it is used to create * the constants in this file to make it a strongly typed enumeration. * Subclasses of this class should enforce similar policy. * <p> - * The key String should be a locale independent key for the state. - * It is not intended to be used as the actual String to display - * to the user. To get the localized string, use toDisplayString. + * The key {@code String} should be a locale independent key for the state. + * It is not intended to be used as the actual {@code String} to display to + * the user. To get the localized string, use {@link #toDisplayString()}. * - * @param key the locale independent name of the state. + * @param key the locale independent name of the state * @see AccessibleBundle#toDisplayString */ protected AccessibleState(String key) {
--- a/src/java.desktop/share/classes/javax/accessibility/AccessibleStateSet.java Fri Jun 16 09:20:39 2017 -0700 +++ b/src/java.desktop/share/classes/javax/accessibility/AccessibleStateSet.java Sat Jun 17 08:03:05 2017 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 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 @@ -26,24 +26,21 @@ package javax.accessibility; import java.util.Vector; -import java.util.Locale; -import java.util.MissingResourceException; -import java.util.ResourceBundle; /** - * Class AccessibleStateSet determines a component's state set. The state set - * of a component is a set of AccessibleState objects and descriptions. E.G., The - * current overall state of the object, such as whether it is enabled, - * has focus, etc. + * Class {@code AccessibleStateSet} determines a component's state set. The + * state set of a component is a set of {@code AccessibleState} objects and + * descriptions. E.G., The current overall state of the object, such as whether + * it is enabled, has focus, etc. * + * @author Willie Walker * @see AccessibleState - * - * @author Willie Walker */ public class AccessibleStateSet { /** - * Each entry in the Vector represents an AccessibleState. + * Each entry in the {@code Vector} represents an {@code AccessibleState}. + * * @see #add * @see #addAll * @see #remove @@ -61,10 +58,11 @@ } /** - * Creates a new state with the initial set of states contained in - * the array of states passed in. Duplicate entries are ignored. + * Creates a new state with the initial set of states contained in the array + * of states passed in. Duplicate entries are ignored. * - * @param states an array of AccessibleState describing the state set. + * @param states an array of {@code AccessibleState} describing the state + * set */ public AccessibleStateSet(AccessibleState[] states) { if (states.length != 0) { @@ -78,14 +76,14 @@ } /** - * Adds a new state to the current state set if it is not already - * present. If the state is already in the state set, the state - * set is unchanged and the return value is false. Otherwise, - * the state is added to the state set and the return value is - * true. - * @param state the state to add to the state set - * @return true if state is added to the state set; false if the state set - * is unchanged + * Adds a new state to the current state set if it is not already present. + * If the state is already in the state set, the state set is unchanged and + * the return value is {@code false}. Otherwise, the state is added to the + * state set and the return value is {@code true}. + * + * @param state the state to add to the state set + * @return {@code true} if state is added to the state set; {@code false} if + * the state set is unchanged */ public boolean add(AccessibleState state) { // [[[ PENDING: WDW - the implementation of this does not need @@ -104,9 +102,10 @@ } /** - * Adds all of the states to the existing state set. Duplicate entries - * are ignored. - * @param states AccessibleState array describing the state set. + * Adds all of the states to the existing state set. Duplicate entries are + * ignored. + * + * @param states {@code AccessibleState} array describing the state set */ public void addAll(AccessibleState[] states) { if (states.length != 0) { @@ -122,14 +121,14 @@ } /** - * Removes a state from the current state set. If the state is not - * in the set, the state set will be unchanged and the return value - * will be false. If the state is in the state set, it will be removed - * from the set and the return value will be true. + * Removes a state from the current state set. If the state is not in the + * set, the state set will be unchanged and the return value will be + * {@code false}. If the state is in the state set, it will be removed from + * the set and the return value will be {@code true}. * - * @param state the state to remove from the state set - * @return true if the state is in the state set; false if the state set - * will be unchanged + * @param state the state to remove from the state set + * @return {@code true} if the state is in the state set; {@code false} if + * the state set will be unchanged */ public boolean remove(AccessibleState state) { if (states == null) { @@ -150,8 +149,10 @@ /** * Checks if the current state is in the state set. - * @param state the state - * @return true if the state is in the state set; otherwise false + * + * @param state the state + * @return {@code true} if the state is in the state set; otherwise + * {@code false} */ public boolean contains(AccessibleState state) { if (states == null) { @@ -162,8 +163,9 @@ } /** - * Returns the current state set as an array of AccessibleState - * @return AccessibleState array containing the current state. + * Returns the current state set as an array of {@code AccessibleState}. + * + * @return {@code AccessibleState} array containing the current state */ public AccessibleState[] toArray() { if (states == null) { @@ -178,10 +180,10 @@ } /** - * Creates a localized String representing all the states in the set - * using the default locale. + * Creates a localized string representing all the states in the set using + * the default locale. * - * @return comma separated localized String + * @return comma separated localized string * @see AccessibleBundle#toDisplayString */ public String toString() {
--- a/src/java.desktop/share/classes/javax/accessibility/AccessibleStreamable.java Fri Jun 16 09:20:39 2017 -0700 +++ b/src/java.desktop/share/classes/javax/accessibility/AccessibleStreamable.java Sat Jun 17 08:03:05 2017 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -25,41 +25,40 @@ package javax.accessibility; +import java.awt.datatransfer.DataFlavor; import java.io.InputStream; -import java.awt.datatransfer.DataFlavor; /** - * - * The {@code AccessibleStreamable} interface should be implemented - * by the {@code AccessibleContext} of any component that presents the - * raw stream behind a component on the display screen. Examples of such - * components are HTML, bitmap images and MathML. An object that implements - * {@code AccessibleStreamable} provides two things: a list of MIME - * types supported by the object and a streaming interface for each MIME type to - * get the data. + * The {@code AccessibleStreamable} interface should be implemented by the + * {@code AccessibleContext} of any component that presents the raw stream + * behind a component on the display screen. Examples of such components are + * HTML, bitmap images and MathML. An object that implements + * {@code AccessibleStreamable} provides two things: a list of MIME types + * supported by the object and a streaming interface for each MIME type to get + * the data. * * @author Lynn Monsanto * @author Peter Korn - * - * @see javax.accessibility.AccessibleContext + * @see AccessibleContext * @since 1.5 */ public interface AccessibleStreamable { - /** - * Returns an array of DataFlavor objects for the MIME types - * this object supports. - * - * @return an array of DataFlavor objects for the MIME types - * this object supports. - */ - DataFlavor[] getMimeTypes(); /** - * Returns an InputStream for a DataFlavor - * - * @param flavor the DataFlavor - * @return an ImputStream if an ImputStream for this DataFlavor exists. - * Otherwise, null is returned. - */ - InputStream getStream(DataFlavor flavor); + * Returns an array of {@code DataFlavor} objects for the MIME types this + * object supports. + * + * @return an array of {@code DataFlavor} objects for the MIME types this + * object supports + */ + DataFlavor[] getMimeTypes(); + + /** + * Returns an {@code InputStream} for a {@code DataFlavor}. + * + * @param flavor the {@code DataFlavor} + * @return an {@code ImputStream} if an input stream for this + * {@code DataFlavor} exists. Otherwise, {@code null} is returned. + */ + InputStream getStream(DataFlavor flavor); }
--- a/src/java.desktop/share/classes/javax/accessibility/AccessibleTable.java Fri Jun 16 09:20:39 2017 -0700 +++ b/src/java.desktop/share/classes/javax/accessibility/AccessibleTable.java Sat Jun 17 08:03:05 2017 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 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 @@ -26,10 +26,10 @@ package javax.accessibility; /** - * Class AccessibleTable describes a user-interface component that + * Class {@code AccessibleTable} describes a user-interface component that * presents data in a two-dimensional table format. * - * @author Lynn Monsanto + * @author Lynn Monsanto * @since 1.3 */ public interface AccessibleTable { @@ -44,7 +44,7 @@ /** * Sets the caption for the table. * - * @param a the caption for the table + * @param a the caption for the table */ public void setAccessibleCaption(Accessible a); @@ -56,9 +56,9 @@ public Accessible getAccessibleSummary(); /** - * Sets the summary description of the table + * Sets the summary description of the table. * - * @param a the summary description of the table + * @param a the summary description of the table */ public void setAccessibleSummary(Accessible a); @@ -77,73 +77,69 @@ public int getAccessibleColumnCount(); /** - * Returns the Accessible at a specified row and column - * in the table. + * Returns the {@code Accessible} at a specified row and column in the + * table. * - * @param r zero-based row of the table - * @param c zero-based column of the table - * @return the Accessible at the specified row and column + * @param r zero-based row of the table + * @param c zero-based column of the table + * @return the {@code Accessible} at the specified row and column */ public Accessible getAccessibleAt(int r, int c); /** - * Returns the number of rows occupied by the Accessible at - * a specified row and column in the table. + * Returns the number of rows occupied by the {@code Accessible} at a + * specified row and column in the table. * - * @param r zero-based row of the table - * @param c zero-based column of the table - * @return the number of rows occupied by the Accessible at a - * given specified (row, column) + * @param r zero-based row of the table + * @param c zero-based column of the table + * @return the number of rows occupied by the {@code Accessible} at a given + * specified (row, column) */ public int getAccessibleRowExtentAt(int r, int c); /** - * Returns the number of columns occupied by the Accessible at - * a specified row and column in the table. + * Returns the number of columns occupied by the {@code Accessible} at a + * specified row and column in the table. * - * @param r zero-based row of the table - * @param c zero-based column of the table - * @return the number of columns occupied by the Accessible at a - * given specified row and column + * @param r zero-based row of the table + * @param c zero-based column of the table + * @return the number of columns occupied by the {@code Accessible} at a + * given specified row and column */ public int getAccessibleColumnExtentAt(int r, int c); /** - * Returns the row headers as an AccessibleTable. + * Returns the row headers as an {@code AccessibleTable}. * - * @return an AccessibleTable representing the row - * headers + * @return an {@code AccessibleTable} representing the row headers */ public AccessibleTable getAccessibleRowHeader(); /** * Sets the row headers. * - * @param table an AccessibleTable representing the - * row headers + * @param table an {@code AccessibleTable} representing the row headers */ public void setAccessibleRowHeader(AccessibleTable table); /** - * Returns the column headers as an AccessibleTable. + * Returns the column headers as an {@code AccessibleTable}. * - * @return an AccessibleTable representing the column - * headers + * @return an {@code AccessibleTable} representing the column headers */ public AccessibleTable getAccessibleColumnHeader(); /** * Sets the column headers. * - * @param table an AccessibleTable representing the - * column headers + * @param table an {@code AccessibleTable} representing the column headers */ public void setAccessibleColumnHeader(AccessibleTable table); /** * Returns the description of the specified row in the table. * - * @param r zero-based row of the table + * @param r zero-based row of the table * @return the description of the row */ public Accessible getAccessibleRowDescription(int r); @@ -151,15 +147,15 @@ /** * Sets the description text of the specified row of the table. * - * @param r zero-based row of the table - * @param a the description of the row + * @param r zero-based row of the table + * @param a the description of the row */ public void setAccessibleRowDescription(int r, Accessible a); /** * Returns the description text of the specified column in the table. * - * @param c zero-based column of the table + * @param c zero-based column of the table * @return the text description of the column */ public Accessible getAccessibleColumnDescription(int c); @@ -167,56 +163,54 @@ /** * Sets the description text of the specified column in the table. * - * @param c zero-based column of the table - * @param a the text description of the column + * @param c zero-based column of the table + * @param a the text description of the column */ public void setAccessibleColumnDescription(int c, Accessible a); /** - * Returns a boolean value indicating whether the accessible at - * a specified row and column is selected. + * Returns a boolean value indicating whether the accessible at a specified + * row and column is selected. * - * @param r zero-based row of the table - * @param c zero-based column of the table - * @return the boolean value true if the accessible at the - * row and column is selected. Otherwise, the boolean value - * false + * @param r zero-based row of the table + * @param c zero-based column of the table + * @return the boolean value {@code true} if the accessible at the row and + * column is selected. Otherwise, the boolean value {@code false} */ public boolean isAccessibleSelected(int r, int c); /** - * Returns a boolean value indicating whether the specified row - * is selected. + * Returns a boolean value indicating whether the specified row is selected. * - * @param r zero-based row of the table - * @return the boolean value true if the specified row is selected. - * Otherwise, false. + * @param r zero-based row of the table + * @return the boolean value {@code true} if the specified row is selected. + * Otherwise, {@code false}. */ public boolean isAccessibleRowSelected(int r); /** - * Returns a boolean value indicating whether the specified column - * is selected. + * Returns a boolean value indicating whether the specified column is + * selected. * - * @param c zero-based column of the table - * @return the boolean value true if the specified column is selected. - * Otherwise, false. + * @param c zero-based column of the table + * @return the boolean value {@code true} if the specified column is + * selected. Otherwise, {@code false}. */ public boolean isAccessibleColumnSelected(int c); /** * Returns the selected rows in a table. * - * @return an array of selected rows where each element is a - * zero-based row of the table + * @return an array of selected rows where each element is a zero-based row + * of the table */ - public int [] getSelectedAccessibleRows(); + public int[] getSelectedAccessibleRows(); /** * Returns the selected columns in a table. * - * @return an array of selected columns where each element is a - * zero-based column of the table + * @return an array of selected columns where each element is a zero-based + * column of the table */ - public int [] getSelectedAccessibleColumns(); + public int[] getSelectedAccessibleColumns(); }
--- a/src/java.desktop/share/classes/javax/accessibility/AccessibleTableModelChange.java Fri Jun 16 09:20:39 2017 -0700 +++ b/src/java.desktop/share/classes/javax/accessibility/AccessibleTableModelChange.java Sat Jun 17 08:03:05 2017 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 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 @@ -26,31 +26,30 @@ package javax.accessibility; /** - * The AccessibleTableModelChange interface describes a change to - * the table model. The attributes of the model change can be - * obtained by the following methods: + * The {@code AccessibleTableModelChange} interface describes a change to the + * table model. The attributes of the model change can be obtained by the + * following methods: * <ul> - * <li> public int getType() - * <li> public int getFirstRow(); - * <li> public int getLastRow(); - * <li> public int getFirstColumn(); - * <li> public int getLastColumn(); + * <li>{@code public int getType();} + * <li>{@code public int getFirstRow();} + * <li>{@code public int getLastRow();} + * <li>{@code public int getFirstColumn();} + * <li>{@code public int getLastColumn();} * </ul> * The model change type returned by getType() will be one of: * <ul> - * <li> INSERT - one or more rows and/or columns have been inserted - * <li> UPDATE - some of the table data has changed - * <li> DELETE - one or more rows and/or columns have been deleted + * <li>{@code INSERT} - one or more rows and/or columns have been inserted + * <li>{@code UPDATE} - some of the table data has changed + * <li>{@code DELETE} - one or more rows and/or columns have been deleted * </ul> - * The affected area of the table can be determined by the other - * four methods which specify ranges of rows and columns + * The affected area of the table can be determined by the other four methods + * which specify ranges of rows and columns * + * @author Lynn Monsanto * @see Accessible * @see Accessible#getAccessibleContext * @see AccessibleContext * @see AccessibleContext#getAccessibleTable - * - * @author Lynn Monsanto * @since 1.3 */ public interface AccessibleTableModelChange { @@ -71,34 +70,39 @@ public static final int DELETE = -1; /** - * Returns the type of event. - * @return the type of event - * @see #INSERT - * @see #UPDATE - * @see #DELETE + * Returns the type of event. + * + * @return the type of event + * @see #INSERT + * @see #UPDATE + * @see #DELETE */ public int getType(); /** * Returns the first row that changed. + * * @return the first row that changed */ public int getFirstRow(); /** * Returns the last row that changed. + * * @return the last row that changed */ public int getLastRow(); /** * Returns the first column that changed. + * * @return the first column that changed */ public int getFirstColumn(); /** * Returns the last column that changed. + * * @return the last column that changed */ public int getLastColumn();
--- a/src/java.desktop/share/classes/javax/accessibility/AccessibleText.java Fri Jun 16 09:20:39 2017 -0700 +++ b/src/java.desktop/share/classes/javax/accessibility/AccessibleText.java Sat Jun 17 08:03:05 2017 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 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 @@ -25,29 +25,27 @@ package javax.accessibility; +import java.awt.Point; +import java.awt.Rectangle; -import java.util.*; -import java.awt.*; -import javax.swing.text.*; - +import javax.swing.text.AttributeSet; /** - * <P>The AccessibleText interface should be implemented by all - * classes that present textual information on the display. This interface - * provides the standard mechanism for an assistive technology to access - * that text via its content, attributes, and spatial location. - * Applications can determine if an object supports the AccessibleText - * interface by first obtaining its AccessibleContext (see {@link Accessible}) - * and then calling the {@link AccessibleContext#getAccessibleText} method of - * AccessibleContext. If the return value is not null, the object supports this - * interface. + * The {@code AccessibleText} interface should be implemented by all classes + * that present textual information on the display. This interface provides the + * standard mechanism for an assistive technology to access that text via its + * content, attributes, and spatial location. Applications can determine if an + * object supports the {@code AccessibleText} interface by first obtaining its + * {@code AccessibleContext} (see {@link Accessible}) and then calling the + * {@link AccessibleContext#getAccessibleText} method of + * {@code AccessibleContext}. If the return value is not {@code null}, the + * object supports this interface. * + * @author Peter Korn * @see Accessible * @see Accessible#getAccessibleContext * @see AccessibleContext * @see AccessibleContext#getAccessibleText - * - * @author Peter Korn */ public interface AccessibleText { @@ -74,13 +72,13 @@ /** * Constant used to indicate that the part of the text that should be * retrieved is a sentence. - * - * A sentence is a string of words which expresses an assertion, - * a question, a command, a wish, an exclamation, or the performance - * of an action. In English locales, the string usually begins with - * a capital letter and concludes with appropriate end punctuation; - * such as a period, question or exclamation mark. Other locales may - * use different capitalization and/or punctuation. + * <p> + * A sentence is a string of words which expresses an assertion, a question, + * a command, a wish, an exclamation, or the performance of an action. In + * English locales, the string usually begins with a capital letter and + * concludes with appropriate end punctuation; such as a period, question or + * exclamation mark. Other locales may use different capitalization and/or + * punctuation. * * @see #getAtIndex * @see #getAfterIndex @@ -89,29 +87,29 @@ public static final int SENTENCE = 3; /** - * Given a point in local coordinates, return the zero-based index - * of the character under that Point. If the point is invalid, - * this method returns -1. + * Given a point in local coordinates, return the zero-based index of the + * character under that point. If the point is invalid, this method returns + * -1. * - * @param p the Point in local coordinates - * @return the zero-based index of the character under Point p; if - * Point is invalid return -1. + * @param p the point in local coordinates + * @return the zero-based index of the character under {@code Point p}; if + * point is invalid return -1. */ public int getIndexAtPoint(Point p); /** - * Determines the bounding box of the character at the given - * index into the string. The bounds are returned in local - * coordinates. If the index is invalid an empty rectangle is returned. + * Determines the bounding box of the character at the given index into the + * string. The bounds are returned in local coordinates. If the index is + * invalid an empty rectangle is returned. * - * @param i the index into the String - * @return the screen coordinates of the character's bounding box, - * if index is invalid return an empty rectangle. + * @param i the index into the string + * @return the screen coordinates of the character's bounding box, if index + * is invalid return an empty rectangle. */ public Rectangle getCharacterBounds(int i); /** - * Returns the number of characters (valid indicies) + * Returns the number of characters (valid indicies). * * @return the number of characters */ @@ -119,61 +117,62 @@ /** * Returns the zero-based offset of the caret. + * <p> + * Note: That to the right of the caret will have the same index value as + * the offset (the caret is between two characters). * - * Note: That to the right of the caret will have the same index - * value as the offset (the caret is between two characters). - * @return the zero-based offset of the caret. + * @return the zero-based offset of the caret */ public int getCaretPosition(); /** - * Returns the String at a given index. + * Returns the {@code String} at a given index. * - * @param part the CHARACTER, WORD, or SENTENCE to retrieve - * @param index an index within the text + * @param part the CHARACTER, WORD, or SENTENCE to retrieve + * @param index an index within the text * @return the letter, word, or sentence */ public String getAtIndex(int part, int index); /** - * Returns the String after a given index. + * Returns the {@code String} after a given index. * - * @param part the CHARACTER, WORD, or SENTENCE to retrieve - * @param index an index within the text + * @param part the CHARACTER, WORD, or SENTENCE to retrieve + * @param index an index within the text * @return the letter, word, or sentence */ public String getAfterIndex(int part, int index); /** - * Returns the String before a given index. + * Returns the {@code String} before a given index. * - * @param part the CHARACTER, WORD, or SENTENCE to retrieve - * @param index an index within the text + * @param part the CHARACTER, WORD, or SENTENCE to retrieve + * @param index an index within the text * @return the letter, word, or sentence */ public String getBeforeIndex(int part, int index); /** - * Returns the AttributeSet for a given character at a given index + * Returns the {@code AttributeSet} for a given character at a given index. * - * @param i the zero-based index into the text - * @return the AttributeSet of the character + * @param i the zero-based index into the text + * @return the {@code AttributeSet} of the character */ public AttributeSet getCharacterAttribute(int i); /** - * Returns the start offset within the selected text. - * If there is no selection, but there is - * a caret, the start and end offsets will be the same. + * Returns the start offset within the selected text. If there is no + * selection, but there is a caret, the start and end offsets will be the + * same. * * @return the index into the text of the start of the selection */ public int getSelectionStart(); /** - * Returns the end offset within the selected text. - * If there is no selection, but there is - * a caret, the start and end offsets will be the same. + * Returns the end offset within the selected text. If there is no + * selection, but there is a caret, the start and end offsets will be the + * same. * * @return the index into the text of the end of the selection */ @@ -182,7 +181,7 @@ /** * Returns the portion of the text that is selected. * - * @return the String portion of the text that is selected + * @return the {@code String} portion of the text that is selected */ public String getSelectedText(); }
--- a/src/java.desktop/share/classes/javax/accessibility/AccessibleTextSequence.java Fri Jun 16 09:20:39 2017 -0700 +++ b/src/java.desktop/share/classes/javax/accessibility/AccessibleTextSequence.java Sat Jun 17 08:03:05 2017 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -22,50 +22,41 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + package javax.accessibility; - /** - * <P>The AccessibleTextSequence provides information about - * a contiguous sequence of text. - * - * @see Accessible - * @see Accessible#getAccessibleContext - * @see AccessibleContext - * @see AccessibleContext#getAccessibleText - * @see AccessibleAttributeSequence + * This class collects together key details of a span of text. It is used by + * implementors of the class {@code AccessibleExtendedText} in order to return + * the requested triplet of a {@code String}, and the start and end + * indicies/offsets into a larger body of text that the {@code String} comes + * from. * - * @author Lynn Monsanto - */ - -/** - * This class collects together key details of a span of text. It - * is used by implementors of the class {@code AccessibleExtendedText} in - * order to return the requested triplet of a {@code String}, and the - * start and end indicies/offsets into a larger body of text that the - * {@code String} comes from. - * - * @see javax.accessibility.AccessibleExtendedText + * @see AccessibleExtendedText */ public class AccessibleTextSequence { - /** The start index of the text sequence */ + /** + * The start index of the text sequence. + */ public int startIndex; - /** The end index of the text sequence */ + /** + * The end index of the text sequence. + */ public int endIndex; - /** The text */ + /** + * The text. + */ public String text; /** - * Constructs an {@code AccessibleTextSequence} with the given - * parameters. + * Constructs an {@code AccessibleTextSequence} with the given parameters. * - * @param start the beginning index of the span of text - * @param end the ending index of the span of text - * @param txt the {@code String} shared by this text span - * + * @param start the beginning index of the span of text + * @param end the ending index of the span of text + * @param txt the {@code String} shared by this text span * @since 1.6 */ public AccessibleTextSequence(int start, int end, String txt) {
--- a/src/java.desktop/share/classes/javax/accessibility/AccessibleValue.java Fri Jun 16 09:20:39 2017 -0700 +++ b/src/java.desktop/share/classes/javax/accessibility/AccessibleValue.java Sat Jun 17 08:03:05 2017 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 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 @@ -26,31 +26,28 @@ package javax.accessibility; /** - * The AccessibleValue interface should be supported by any object - * that supports a numerical value (e.g., a scroll bar). This interface - * provides the standard mechanism for an assistive technology to determine - * and set the numerical value as well as get the minimum and maximum values. - * Applications can determine - * if an object supports the AccessibleValue interface by first - * obtaining its AccessibleContext (see - * {@link Accessible}) and then calling the - * {@link AccessibleContext#getAccessibleValue} method. - * If the return value is not null, the object supports this interface. + * The {@code AccessibleValue} interface should be supported by any object that + * supports a numerical value (e.g., a scroll bar). This interface provides the + * standard mechanism for an assistive technology to determine and set the + * numerical value as well as get the minimum and maximum values. Applications + * can determine if an object supports the {@code AccessibleValue} interface by + * first obtaining its {@code AccessibleContext} (see {@link Accessible}) and + * then calling the {@link AccessibleContext#getAccessibleValue} method. If the + * return value is not {@code null}, the object supports this interface. * + * @author Peter Korn + * @author Hans Muller + * @author Willie Walker * @see Accessible * @see Accessible#getAccessibleContext * @see AccessibleContext * @see AccessibleContext#getAccessibleValue - * - * @author Peter Korn - * @author Hans Muller - * @author Willie Walker */ public interface AccessibleValue { /** - * Get the value of this object as a Number. If the value has not been - * set, the return value will be null. + * Get the value of this object as a {@code Number}. If the value has not + * been set, the return value will be {@code null}. * * @return value of the object * @see #setCurrentAccessibleValue @@ -58,35 +55,35 @@ public Number getCurrentAccessibleValue(); /** - * Set the value of this object as a Number. + * Set the value of this object as a {@code Number}. * - * @param n the number to use for the value - * @return True if the value was set; else False + * @param n the number to use for the value + * @return {@code true} if the value was set; else {@code false} * @see #getCurrentAccessibleValue */ public boolean setCurrentAccessibleValue(Number n); -// /** -// * Get the description of the value of this object. -// * -// * @return description of the value of the object -// */ -// public String getAccessibleValueDescription(); + // /** + // * Get the description of the value of this object. + // * + // * @return description of the value of the object + // */ + // public String getAccessibleValueDescription(); /** - * Get the minimum value of this object as a Number. + * Get the minimum value of this object as a {@code Number}. * - * @return Minimum value of the object; null if this object does not - * have a minimum value + * @return minimum value of the object; {@code null} if this object does not + * have a minimum value * @see #getMaximumAccessibleValue */ public Number getMinimumAccessibleValue(); /** - * Get the maximum value of this object as a Number. + * Get the maximum value of this object as a {@code Number}. * - * @return Maximum value of the object; null if this object does not - * have a maximum value + * @return maximum value of the object; {@code null} if this object does not + * have a maximum value * @see #getMinimumAccessibleValue */ public Number getMaximumAccessibleValue();
--- a/src/java.desktop/share/classes/javax/accessibility/package-info.java Fri Jun 16 09:20:39 2017 -0700 +++ b/src/java.desktop/share/classes/javax/accessibility/package-info.java Sat Jun 17 08:03:05 2017 +0100 @@ -57,7 +57,7 @@ * accessible name, description, <a href="#AccessibleRole">role</a>, and * <a href="#AccessibleState">state</a> of the object, as well as information * about the parent and children of the object. In addition, - * JavaBeans™ property change support is also included to allow assisitive + * JavaBeans™ property change support is also included to allow assistive * technologies learn when the values of the accessible properties change. * AccessibleContext also contains methods for obtaining more specific * accessibility information about a component. If the component supports it, @@ -175,7 +175,7 @@ * <a href="#Accessible">Accessible</a>) and then calling the * {@code getAccessibleAction} method of * <a href="#AccessibleContext">AccessibleContext</a>. If the return value is - * not null, the object supports this interface. + * not {@code null}, the object supports this interface. * * <h3> <a id="AccessibleComponent"></a><a href="AccessibleComponent.html"> * Interface AccessibleComponent</a></h3> @@ -188,7 +188,7 @@ * <a href="#Accessible">Accessible</a>) and then calling the * {@code getAccessibleComponent} method of * <a href="#AccessibleContext">AccessibleContext</a>. If the return value is - * not null, the object supports this interface. + * not {@code null}, the object supports this interface. * * <h3><a id="AccessibleSelection"></a><a href="AccessibleSelection.html"> * Interface AccessibleSelection</a></h3> @@ -204,7 +204,7 @@ * <a href="#Accessible">Accessible</a>) and then calling the * {@code getAccessibleSelection} method of * <a href="#AccessibleContext">AccessibleContext</a>. If the return value is - * not null, the object supports this interface. + * not {@code null}, the object supports this interface. * * <h3><a id="AccessibleText"></a><a href="AccessibleText.html">Interface * AccessibleText</a></h3> @@ -228,7 +228,7 @@ * (see <a href="#Accessible">Accessible</a>) and then calling the * {@code getAccessibleText} method of * <a href="#AccessibleContext">AccessibleContext</a>. If the return value is - * not null, the object supports this interface. + * not {@code null}, the object supports this interface. * * <h3><a id="AccessibleHypertext"></a> <a href="AccessibleHypertext.html"> * Interface AccessibleHypertext</a></h3> @@ -268,7 +268,7 @@ * <a href="#Accessible">Accessible</a>) and then calling the * {@code getAccessibleValue} method of * <a href="#AccessibleContext">AccessibleContext</a>. If the return value is - * not null, the object supports this interface. + * not {@code null}, the object supports this interface. * * @since 1.2 */
--- a/src/java.desktop/share/classes/javax/print/DocFlavor.java Fri Jun 16 09:20:39 2017 -0700 +++ b/src/java.desktop/share/classes/javax/print/DocFlavor.java Sat Jun 17 08:03:05 2017 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 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 @@ -194,10 +194,14 @@ * constructor can be used to create an arbitrary doc flavor. * <UL> * <LI>Preformatted text - * <TABLE BORDER=1 CELLPADDING=0 CELLSPACING=0 SUMMARY="MIME-Types and their descriptions"> + * <table class="striped"> + * <caption>MIME-Types and their descriptions</caption> + * <thead> * <TR> * <TH>MIME-Type</TH><TH>Description</TH> * </TR> + * </thead> + * <tbody> * <TR> * <TD>{@code "text/plain"}</TD> * <TD>Plain text in the default character set (US-ASCII)</TD> @@ -214,6 +218,7 @@ * <TD><code>"text/html; charset=<I>xxx</I>"</code></TD> * <TD>HyperText Markup Language in character set <I>xxx</I></TD> * </TR> + * </tbody> * </TABLE> * <P> * In general, preformatted text print data is provided either in a character @@ -222,11 +227,15 @@ * * <LI>Preformatted page description language (PDL) documents * - * <TABLE BORDER=1 CELLPADDING=0 CELLSPACING=0 SUMMARY="MIME-Types and their descriptions"> + * <table class="striped"> + * <caption>MIME-Types and their descriptions</caption> + * <thead> * <TR> * <TH>MIME-Type</TH><TH>Description</TH> * </TR> - *<TR> + * </thead> + * <tbody> + * <TR> * <TD>{@code "application/pdf"}</TD> * <TD>Portable Document Format document</TD> * </TR> @@ -238,6 +247,7 @@ * <TD>{@code "application/vnd.hp-PCL"}</TD> * <TD>Printer Control Language document</TD> * </TR> + * </tbody> * </TABLE> * <P> * In general, preformatted PDL print data is provided in a byte oriented @@ -245,11 +255,14 @@ * * <LI>Preformatted images * - * <TABLE BORDER=1 CELLPADDING=0 CELLSPACING=0 SUMMARY="MIME-Types and their descriptions"> + * <table class="striped"> + * <caption>MIME-Types and their descriptions</caption> + * <thead> * <TR> * <TH>MIME-Type</TH><TH>Description</TH> * </TR> - * + * </thead> + * <tbody> * <TR> * <TD>{@code "image/gif"}</TD> * <TD>Graphics Interchange Format image</TD> @@ -262,6 +275,7 @@ * <TD>{@code "image/png"}</TD> * <TD>Portable Network Graphics image</TD> * </TR> + * </tbody> * </TABLE> * <P> * In general, preformatted image print data is provided in a byte oriented @@ -269,14 +283,19 @@ * * <LI>Preformatted autosense print data * - * <TABLE BORDER=1 CELLPADDING=0 CELLSPACING=0 SUMMARY="MIME-Types and their descriptions"> + * <table class="striped"> + * <caption>MIME-Types and their descriptions</caption> + * <thead> * <TR> * <TH>MIME-Type</TH><TH>Description</TH> * </TR> - * + * </thead> + * <tbody> * <TR> * <TD>{@code "application/octet-stream"}</TD> * <TD>The print data format is unspecified (just an octet stream)</TD> + * </TR> + * </tbody> * </TABLE> * <P> * The printer decides how to interpret the print data; the way this
--- a/src/java.desktop/share/classes/javax/print/attribute/standard/Chromaticity.java Fri Jun 16 09:20:39 2017 -0700 +++ b/src/java.desktop/share/classes/javax/print/attribute/standard/Chromaticity.java Sat Jun 17 08:03:05 2017 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 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 @@ -42,7 +42,10 @@ * {@link #MONOCHROME MONOCHROME} or {@link #COLOR COLOR} * for a monochrome or color document. * - * <TABLE BORDER=1 CELLPADDING=2 CELLSPACING=1 SUMMARY="Shows effects of specifying MONOCHROME or COLOR Chromaticity attributes"> + * <table class="striped"> + * <caption>Shows effects of specifying MONOCHROME or COLOR Chromaticity + * attributes</caption> + * <thead> * <TR> * <TH> * Chromaticity<BR>Attribute @@ -54,6 +57,8 @@ * Effect on<BR>Color Document * </TH> * </TR> + * </thead> + * <tbody> * <TR> * <TD> * {@link #MONOCHROME MONOCHROME} @@ -76,6 +81,7 @@ * Printed as is, in color * </TD> * </TR> + * </tbody> * </TABLE> * <P> * <B>IPP Compatibility:</B> Chromaticity is not an IPP attribute at present.
--- a/src/java.desktop/share/classes/javax/print/attribute/standard/Finishings.java Fri Jun 16 09:20:39 2017 -0700 +++ b/src/java.desktop/share/classes/javax/print/attribute/standard/Finishings.java Sat Jun 17 08:03:05 2017 +0100 @@ -40,7 +40,8 @@ * for purposes of finishing. * <P> * Standard Finishings values are: - * <TABLE BORDER=0 CELLPADDING=0 CELLSPACING=0 style="width:100%" SUMMARY="layout"> + * <table class="borderless" style="width:100%;margin: 0px auto"> + * <caption>Standard Finishings values</caption> * <TR> * <TD STYLE="WIDTH:10%"> * @@ -76,7 +77,8 @@ * <P> * The following Finishings values are more specific; they indicate a * corner or an edge as if the document were a portrait document: - * <TABLE BORDER=0 CELLPADDING=0 CELLSPACING=0 style="width:100%" SUMMARY="layout"> + * <table class="borderless" style="width:100%;margin: 0px auto"> + * <caption>Specific Finishings values</caption> * <TR> * <TD STYLE="WIDTH:10%"> *
--- a/src/java.desktop/share/classes/javax/print/attribute/standard/JobKOctets.java Fri Jun 16 09:20:39 2017 -0700 +++ b/src/java.desktop/share/classes/javax/print/attribute/standard/JobKOctets.java Sat Jun 17 08:03:05 2017 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 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 @@ -66,11 +66,15 @@ * specified by the doc's {@link javax.print.DocFlavor DocFlavor}, as * shown in the table below. * - * <TABLE BORDER=1 CELLPADDING=2 CELLSPACING=1 SUMMARY="Table showing computation of doc sizes"> + * <table class="striped"> + * <caption>Table showing computation of doc sizes</caption> + * <thead> * <TR> * <TH>Representation Class</TH> * <TH>Document Size</TH> * </TR> + * </thead> + * <tbody> * <TR> * <TD>byte[]</TD> * <TD>Length of the byte array</TD> @@ -107,6 +111,7 @@ * <TD>java.awt.print.Pageable</TD> * <TD>Implementation dependent*</TD> * </TR> + * </tbody> * </TABLE> * <P> * * In these cases the Print Service itself generates the print data sent
--- a/src/java.desktop/share/classes/javax/sound/midi/MidiSystem.java Fri Jun 16 09:20:39 2017 -0700 +++ b/src/java.desktop/share/classes/javax/sound/midi/MidiSystem.java Sat Jun 17 08:03:05 2017 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 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 @@ -74,13 +74,16 @@ * following table lists the available property keys and which methods consider * them: * - * <table border=0> - * <caption>MIDI System Property Keys</caption> + * <table class="striped"> + * <caption>MIDI System Property Keys</caption> + * <thead> * <tr> * <th>Property Key</th> * <th>Interface</th> * <th>Affected Method</th> * </tr> + * </thead> + * <tbody> * <tr> * <td>{@code javax.sound.midi.Receiver}</td> * <td>{@link Receiver}</td> @@ -101,6 +104,7 @@ * <td>{@link Transmitter}</td> * <td>{@link #getTransmitter}</td> * </tr> + * </tbody> * </table> * * The property value consists of the provider class name and the device name,
--- a/src/java.desktop/share/classes/javax/sound/sampled/AudioFormat.java Fri Jun 16 09:20:39 2017 -0700 +++ b/src/java.desktop/share/classes/javax/sound/sampled/AudioFormat.java Sat Jun 17 08:03:05 2017 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 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 @@ -89,13 +89,16 @@ * The following table lists some common properties which service providers * should use, if applicable: * - * <table border=0> - * <caption>Audio Format Properties</caption> + * <table class="striped"> + * <caption>Audio Format Properties</caption> + * <thead> * <tr> * <th>Property key</th> * <th>Value type</th> * <th>Description</th> * </tr> + * </thead> + * <tbody> * <tr> * <td>"bitrate"</td> * <td>{@link java.lang.Integer Integer}</td> @@ -112,6 +115,7 @@ * <td>{@link java.lang.Integer Integer}</td> * <td>encoding/conversion quality, 1..100</td> * </tr> + * </tbody> * </table> * <p> * Vendors of service providers (plugins) are encouraged to seek information
--- a/src/java.desktop/share/classes/javax/sound/sampled/AudioPermission.java Fri Jun 16 09:20:39 2017 -0700 +++ b/src/java.desktop/share/classes/javax/sound/sampled/AudioPermission.java Sat Jun 17 08:03:05 2017 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 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 @@ -41,13 +41,17 @@ * permission allows, as well as a discussion of the risks of granting code the * permission. * - * <table border=1 cellpadding=5 summary="permission target name, what the permission allows, and associated risks"> + * <table class="striped"> + * <caption>Permission target name, what the permission allows, and associated + * risks</caption> + * <thead> * <tr> * <th>Permission Target Name</th> * <th>What the Permission Allows</th> * <th>Risks of Allowing this Permission</th> * </tr> - * + * </thead> + * <tbody> * <tr> * <td>play</td> * <td>Audio playback through the audio device or devices on the system. @@ -69,6 +73,7 @@ * using that mixer. * This permission can enable an applet or application to eavesdrop on a user.</td> * </tr> + * </tbody> * </table> * * @author Kara Kytle
--- a/src/java.desktop/share/classes/javax/sound/sampled/AudioSystem.java Fri Jun 16 09:20:39 2017 -0700 +++ b/src/java.desktop/share/classes/javax/sound/sampled/AudioSystem.java Sat Jun 17 08:03:05 2017 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 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,13 +72,16 @@ * {@link Properties#load(InputStream) Properties.load}. The following table * lists the available property keys and which methods consider them: * - * <table border=0> - * <caption>Audio System Property Keys</caption> + * <table class="striped"> + * <caption>Audio System Property Keys</caption> + * <thead> * <tr> * <th>Property Key</th> * <th>Interface</th> * <th>Affected Method(s)</th> * </tr> + * </thead> + * <tbody> * <tr> * <td>{@code javax.sound.sampled.Clip}</td> * <td>{@link Clip}</td> @@ -99,6 +102,7 @@ * <td>{@link TargetDataLine}</td> * <td>{@link #getLine}, {@link #getTargetDataLine}</td> * </tr> + * </tbody> * </table> * * The property value consists of the provider class name and the mixer name,
--- a/src/java.desktop/share/classes/javax/sound/sampled/ReverbType.java Fri Jun 16 09:20:39 2017 -0700 +++ b/src/java.desktop/share/classes/javax/sound/sampled/ReverbType.java Sat Jun 17 08:03:05 2017 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 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 @@ -69,12 +69,11 @@ * <p> * The following table shows what parameter values an implementation might use * for a representative set of reverberation settings. - * <p> * - * <b>Reverberation Types and Parameters</b> - * - * <table border=1 cellpadding=5 summary="reverb types and params: decay time, late intensity, late delay, early intensity, and early delay"> - * + * <table class="striped"> + * <caption>Reverb types and params: decay time, late intensity, late delay, + * early intensity, and early delay</caption> + * <thead> * <tr> * <th>Type</th> * <th>Decay Time (ms)</th> @@ -83,7 +82,8 @@ * <th>Early Intensity (dB)</th> * <th>Early Delay(ms)</th> * </tr> - * + * </thead> + * <tbody> * <tr> * <td>Cavern</td> * <td>2250</td> @@ -128,7 +128,7 @@ * <td>-7.0</td> * <td>0.6</td> * </tr> - * + * </tbody> * </table> * * @author Kara Kytle
--- a/src/java.desktop/share/classes/javax/swing/Action.java Fri Jun 16 09:20:39 2017 -0700 +++ b/src/java.desktop/share/classes/javax/swing/Action.java Sat Jun 17 08:03:05 2017 +0100 @@ -94,13 +94,16 @@ * <code>Action</code> that is <code>null</code>) results in the * button's corresponding property being set to <code>null</code>. * - * <table border="1" cellpadding="1" cellspacing="0" - * summary="Supported Action properties"> - * <tr valign="top" style="text-align:left"> - * <th style="background-color:#CCCCFF;text-align:left">Component Property - * <th style="background-color:#CCCCFF;text-align:left">Components - * <th style="background-color:#CCCCFF;text-align:left">Action Key - * <th style="background-color:#CCCCFF;text-align:left">Notes + * <table class="striped"> + * <caption>Supported Action properties</caption> + * <thead> + * <tr> + * <th>Component Property + * <th>Components + * <th>Action Key + * <th>Notes + * </thead> + * <tbody> * <tr valign="top" style="text-align:left"> * <td><b><code>enabled</code></b> * <td>All @@ -191,6 +194,7 @@ * use the same {@code Action} that defines a value for the * {@code SELECTED_KEY} property with multiple mutually * exclusive buttons. + * </tbody> * </table> * <p> * <code>JPopupMenu</code>, <code>JToolBar</code> and <code>JMenu</code>
--- a/src/java.desktop/share/classes/javax/swing/BoxLayout.java Fri Jun 16 09:20:39 2017 -0700 +++ b/src/java.desktop/share/classes/javax/swing/BoxLayout.java Sat Jun 17 08:03:05 2017 +0100 @@ -36,7 +36,8 @@ * vertically or horizontally. The components will not wrap so, for * example, a vertical arrangement of components will stay vertically * arranged when the frame is resized. - * <TABLE STYLE="FLOAT:RIGHT" BORDER="0" SUMMARY="layout"> + * <table class="borderless" style="float:right"> + * <caption>Example:</caption> * <TR> * <TD style="text-align:center"> * <P STYLE="TEXT-ALIGN:CENTER"><IMG SRC="doc-files/BoxLayout-1.gif"
--- a/src/java.desktop/share/classes/javax/swing/JFormattedTextField.java Fri Jun 16 09:20:39 2017 -0700 +++ b/src/java.desktop/share/classes/javax/swing/JFormattedTextField.java Sat Jun 17 08:03:05 2017 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 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 @@ -54,8 +54,15 @@ * <code>JFormattedTextField</code> allows * configuring what action should be taken when focus is lost. The possible * configurations are: - * <table summary="Possible JFormattedTextField configurations and their descriptions"> - * <tr><th><p style="text-align:left">Value</p></th><th><p style="text-align:left">Description</p></th></tr> + * + * <table class="striped"> + * <caption>Possible JFormattedTextField configurations and their descriptions + * </caption> + * <thead> + * <tr><th>Value</th> + * <th>Description</th></tr> + * </thead> + * <tbody> * <tr><td>JFormattedTextField.REVERT * <td>Revert the display to match that of <code>getValue</code>, * possibly losing the current edit. @@ -71,6 +78,7 @@ * <tr><td>JFormattedTextField.PERSIST * <td>Do nothing, don't obtain a new * <code>AbstractFormatter</code>, and don't update the value. + * </tbody> * </table> * The default is <code>JFormattedTextField.COMMIT_OR_REVERT</code>, * refer to {@link #setFocusLostBehavior} for more information on this.
--- a/src/java.desktop/share/classes/javax/swing/JLayeredPane.java Fri Jun 16 09:20:39 2017 -0700 +++ b/src/java.desktop/share/classes/javax/swing/JLayeredPane.java Sat Jun 17 08:03:05 2017 +0100 @@ -47,7 +47,8 @@ * <a href="http://docs.oracle.com/javase/tutorial/uiswing/components/layeredpane.html">How to Use a Layered Pane</a>, * a section in <em>The Java Tutorial</em>. * - * <TABLE STYLE="FLOAT:RIGHT" BORDER="0" SUMMARY="layout"> + * <table class="borderless" style="float:right"> + * <caption>Example</caption> * <TR> * <TD style="text-align:center"> * <P STYLE="TEXT-ALIGN:CENTER"><IMG SRC="doc-files/JLayeredPane-1.gif"
--- a/src/java.desktop/share/classes/javax/swing/JList.java Fri Jun 16 09:20:39 2017 -0700 +++ b/src/java.desktop/share/classes/javax/swing/JList.java Sat Jun 17 08:03:05 2017 +0100 @@ -962,9 +962,13 @@ * <p> * A description of these layouts follows: * - * <table border="1" - * summary="Describes layouts VERTICAL, HORIZONTAL_WRAP, and VERTICAL_WRAP"> - * <tr><th><p style="text-align:left">Value</p></th><th><p style="text-align:left">Description</p></th></tr> + * <table class="striped"> + * <caption>Describes layouts VERTICAL,HORIZONTAL_WRAP, and VERTICAL_WRAP + * </caption> + * <thead> + * <tr><th>Value</th><th>Description</th></tr> + * </thead> + * <tbody> * <tr><td><code>VERTICAL</code> * <td>Cells are layed out vertically in a single column. * <tr><td><code>HORIZONTAL_WRAP</code> @@ -978,7 +982,8 @@ * necessary. If the {@code visibleRowCount} property is less than * or equal to zero, wrapping is determined by the height of the * list; otherwise wrapping is done at {@code visibleRowCount} rows. - * </table> + * </tbody> + * </table> * <p> * The default value of this property is <code>VERTICAL</code>. *
--- a/src/java.desktop/share/classes/javax/swing/JOptionPane.java Fri Jun 16 09:20:39 2017 -0700 +++ b/src/java.desktop/share/classes/javax/swing/JOptionPane.java Sat Jun 17 08:03:05 2017 +0100 @@ -73,12 +73,15 @@ * <code>showXxxDialog</code> methods shown below: * <blockquote> * - * - * <table border=1 summary="Common JOptionPane method names and their descriptions"> + * <table class="striped"> + * <caption>Common JOptionPane method names and their descriptions</caption> + * <thead> * <tr> * <th>Method Name</th> * <th>Description</th> * </tr> + * </thead> + * <tbody> * <tr> * <td>showConfirmDialog</td> * <td>Asks a confirming question, like yes/no/cancel.</td> @@ -95,6 +98,7 @@ * <td>showOptionDialog</td> * <td>The Grand Unification of the above three.</td> * </tr> + * </tbody> * </table> * * </blockquote> @@ -107,7 +111,8 @@ * All dialogs are modal. Each <code>showXxxDialog</code> method blocks * the caller until the user's interaction is complete. * - * <table cellspacing=6 cellpadding=4 border=0 style="float:right" summary="layout"> + * <table class="borderless"> + * <caption>Common dialog</caption> * <tr> * <td style="background-color:#FFe0d0" rowspan=2>icon</td> * <td style="background-color:#FFe0d0">message</td> @@ -121,7 +126,7 @@ * </table> * * The basic appearance of one of these dialog boxes is generally - * similar to the picture at the right, although the various + * similar to the picture above, although the various * look-and-feels are * ultimately responsible for the final result. In particular, the * look-and-feels will adjust the layout to accommodate the option pane's
--- a/src/java.desktop/share/classes/javax/swing/JRootPane.java Fri Jun 16 09:20:39 2017 -0700 +++ b/src/java.desktop/share/classes/javax/swing/JRootPane.java Sat Jun 17 08:03:05 2017 +0100 @@ -70,7 +70,9 @@ * can be used to obtain the <code>JRootPane</code> that contains * a given component. * </blockquote> - * <table style="float:right" border="0" summary="layout"> + * + * <table class="borderless" style="float:right"> + * <caption>Example</caption> * <tr> * <td style="text-align:center"> * <img src="doc-files/JRootPane-2.gif"
--- a/src/java.desktop/share/classes/javax/swing/JScrollPane.java Fri Jun 16 09:20:39 2017 -0700 +++ b/src/java.desktop/share/classes/javax/swing/JScrollPane.java Sat Jun 17 08:03:05 2017 +0100 @@ -55,7 +55,8 @@ * a section in <em>The Java Tutorial</em>. Note that * <code>JScrollPane</code> does not support heavyweight components. * - * <TABLE STYLE="FLOAT:RIGHT" BORDER="0" SUMMARY="layout"> + * <table class="borderless" style="float:right"> + * <caption>Example</caption> * <TR> * <TD style="text-align:center"> * <P STYLE="TEXT-ALIGN:CENTER"><IMG SRC="doc-files/JScrollPane-1.gif"
--- a/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicListUI.java Fri Jun 16 09:20:39 2017 -0700 +++ b/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicListUI.java Sat Jun 17 08:03:05 2017 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 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 @@ -583,8 +583,14 @@ /** * The preferredSize of the list depends upon the layout orientation. - * <table summary="Describes the preferred size for each layout orientation"> + * + * <table class="striped"> + * <caption>Describes the preferred size for each layout orientation + * </caption> + * <thead> * <tr><th>Layout Orientation</th><th>Preferred Size</th></tr> + * </thead> + * <tbody> * <tr> * <td>JList.VERTICAL * <td>The preferredSize of the list is total height of the rows @@ -626,6 +632,7 @@ * Max cell height is either the fixed * cell height, or is determined by iterating through all the cells * to find the maximum height from the ListCellRenderer. + * </tbody> * </table> * The above specifies the raw preferred width and height. The resulting * preferred width is the above width + insets.left + insets.right and
--- a/src/java.desktop/share/classes/javax/swing/plaf/metal/MetalLookAndFeel.java Fri Jun 16 09:20:39 2017 -0700 +++ b/src/java.desktop/share/classes/javax/swing/plaf/metal/MetalLookAndFeel.java Sat Jun 17 08:03:05 2017 +0100 @@ -290,11 +290,15 @@ /** * Populates {@code table} with system colors. The following values are * added to {@code table}: - * <table border="1" cellpadding="1" cellspacing="0" - * summary="Metal's system color mapping"> - * <tr valign="top" style="text-align:left"> - * <th style="background-color:#CCCCFF;text-align:left">Key - * <th style="background-color:#CCCCFF;text-align:left">Value + * + * <table class="striped"> + * <caption>Metal's system color mapping</caption> + * <thead> + * <tr> + * <th>Key + * <th>Value + * </thead> + * <tbody> * <tr valign="top" style="text-align:left"> * <td>"desktop" * <td>{@code theme.getDesktopColor()} @@ -373,6 +377,7 @@ * <tr valign="top" style="text-align:left"> * <td>"infoText" * <td>{@code theme.getPrimaryControlInfo()} + * </tbody> * </table> * The value {@code theme} corresponds to the current {@code MetalTheme}. *
--- a/src/java.desktop/share/classes/javax/swing/plaf/metal/MetalTreeUI.java Fri Jun 16 09:20:39 2017 -0700 +++ b/src/java.desktop/share/classes/javax/swing/plaf/metal/MetalTreeUI.java Sat Jun 17 08:03:05 2017 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -44,9 +44,11 @@ * visually render the spacing and delineation between nodes. The following * hints are supported: * - * <table summary="Descriptions of supported hints: Angled, Horizontal, and None"> + * <table class="striped"> + * <caption>Descriptions of supported hints: Angled, Horizontal, and None + * </caption> * <tr> - * <th><p style="text-align:left">Angled</p></th> + * <th>Angled</th> * <td>A line is drawn connecting the child to the parent. For handling * of the root node refer to * {@link javax.swing.JTree#setRootVisible} and @@ -54,11 +56,11 @@ * </td> * </tr> * <tr> - * <th><p style="text-align:left">Horizontal</p></th> + * <th>Horizontal</th> * <td>A horizontal line is drawn dividing the children of the root node.</td> * </tr> * <tr> - * <th><p style="text-align:left">None</p></th> + * <th>None</th> * <td>Do not draw any visual indication between nodes.</td> * </tr> * </table>
--- a/src/java.desktop/share/classes/javax/swing/text/JTextComponent.java Fri Jun 16 09:20:39 2017 -0700 +++ b/src/java.desktop/share/classes/javax/swing/text/JTextComponent.java Sat Jun 17 08:03:05 2017 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 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 @@ -157,11 +157,15 @@ * Keyboard event and input method events are handled in the following stages, * with each stage capable of consuming the event: * - * <table border=1 summary="Stages of keyboard and input method event handling"> + * <table class="striped"> + * <caption>Stages of keyboard and input method event handling</caption> + * <thead> * <tr> - * <th id="stage"><p style="text-align:left">Stage</p></th> - * <th id="ke"><p style="text-align:left">KeyEvent</p></th> - * <th id="ime"><p style="text-align:left">InputMethodEvent</p></th></tr> + * <th id="stage">Stage</th> + * <th id="ke">KeyEvent</th> + * <th id="ime">InputMethodEvent</th></tr> + * </thead> + * <tbody> * <tr><td headers="stage">1. </td> * <td headers="ke">input methods </td> * <td headers="ime">(generated here)</td></tr> @@ -181,6 +185,7 @@ * <td headers="stage">5. </td><td headers="ke ime" colspan=2>keymap handling using the current keymap</td></tr> * <tr><td headers="stage">6. </td><td headers="ke">keyboard handling in JComponent (e.g. accelerators, component navigation, etc.)</td> * <td headers="ime"></td></tr> + * </tbody> * </table> * * <p>
--- a/src/java.desktop/share/classes/javax/swing/text/MaskFormatter.java Fri Jun 16 09:20:39 2017 -0700 +++ b/src/java.desktop/share/classes/javax/swing/text/MaskFormatter.java Sat Jun 17 08:03:05 2017 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 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 @@ -37,11 +37,15 @@ * location in the <code>Document</code> model. The following characters can * be specified: * - * <table border=1 summary="Valid characters and their descriptions"> + * <table class="striped"> + * <caption>Valid characters and their descriptions</caption> + * <thead> * <tr> * <th>Character </th> - * <th><p style="text-align:left">Description</p></th> + * <th>Description</th> * </tr> + * </thead> + * <tbody> * <tr> * <td>#</td> * <td>Any valid number, uses <code>Character.isDigit</code>.</td> @@ -66,6 +70,7 @@ * </tr> * <tr><td>*</td><td>Anything.</td></tr> * <tr><td>H</td><td>Any hex character (0-9, a-f or A-F).</td></tr> + * </tbody> * </table> * * <p>
--- a/src/java.desktop/share/classes/javax/swing/text/html/FormView.java Fri Jun 16 09:20:39 2017 -0700 +++ b/src/java.desktop/share/classes/javax/swing/text/html/FormView.java Sat Jun 17 08:03:05 2017 +0100 @@ -46,11 +46,16 @@ * <p> * The following table shows what components get built * by this view. - * <table summary="shows what components get built by this view"> + * + * <table class="striped"> + * <caption>Shows what components get built by this view</caption> + * <thead> * <tr> * <th>Element Type</th> * <th>Component built</th> * </tr> + * </thead> + * <tbody> * <tr> * <td>input, type button</td> * <td>JButton</td> @@ -99,6 +104,7 @@ * <td>input, type file</td> * <td>JTextField</td> * </tr> + * </tbody> * </table> * * @author Timothy Prinzing
--- a/src/java.desktop/share/classes/javax/swing/text/html/HTMLDocument.java Fri Jun 16 09:20:39 2017 -0700 +++ b/src/java.desktop/share/classes/javax/swing/text/html/HTMLDocument.java Sat Jun 17 08:03:05 2017 +0100 @@ -183,7 +183,8 @@ * <p>The following table shows the example document and the results * of various methods described above.</p> * - * <table border=1 cellspacing=0 summary="HTML Content of example above"> + * <table class="plain"> + * <caption>HTML Content of example above</caption> * <tr> * <th>Example</th> * <th><code>insertAfterStart</code></th> @@ -2129,8 +2130,13 @@ * <p> * The assignment of the actions described is shown in the * following table for the tags defined in <code>HTML.Tag</code>. - * <table border=1 summary="HTML tags and assigned actions"> + * + * <table class="striped"> + * <caption>HTML tags and assigned actions</caption> + * <thead> * <tr><th>Tag</th><th>Action</th></tr> + * </thead> + * <tbody> * <tr><td><code>HTML.Tag.A</code> <td>CharacterAction * <tr><td><code>HTML.Tag.ADDRESS</code> <td>CharacterAction * <tr><td><code>HTML.Tag.APPLET</code> <td>HiddenAction @@ -2203,6 +2209,7 @@ * <tr><td><code>HTML.Tag.U</code> <td>CharacterAction * <tr><td><code>HTML.Tag.UL</code> <td>BlockAction * <tr><td><code>HTML.Tag.VAR</code> <td>CharacterAction + * </tbody> * </table> * <p> * Once </html> is encountered, the Actions are no longer notified. @@ -3385,10 +3392,17 @@ * be iterated over picking up the data of the form. * The following are the model assignments for the * various type of form elements. - * <table summary="model assignments for the various types of form elements"> + * + * <table class="striped"> + * <caption>Model assignments for the various types of form elements + * </caption> + * <thead> * <tr> * <th>Element Type * <th>Model Type + * </tr> + * </thead> + * <tbody> * <tr> * <td>input, type button * <td>{@link DefaultButtonModel} @@ -3419,6 +3433,7 @@ * <tr> * <td>textarea * <td>{@link PlainDocument} + * </tbody> * </table> * */
--- a/src/java.desktop/share/classes/javax/swing/text/html/HTMLEditorKit.java Fri Jun 16 09:20:39 2017 -0700 +++ b/src/java.desktop/share/classes/javax/swing/text/html/HTMLEditorKit.java Sat Jun 17 08:03:05 2017 +0100 @@ -1118,10 +1118,17 @@ * table describes what this factory will build by * default. * - * <table summary="Describes the tag and view created by this factory by default"> + * <table class="striped"> + * <caption>Describes the tag and view created by this factory by default + * </caption> + * <thead> * <tr> - * <th style="text-align:left">Tag<th style="text-align:left">View created - * </tr><tr> + * <th>Tag + * <th>View created + * </tr> + * </thead> + * <tbody> + * <tr> * <td>HTML.Tag.CONTENT<td>InlineView * </tr><tr> * <td>HTML.Tag.IMPLIED<td>javax.swing.text.html.ParagraphView @@ -1192,6 +1199,7 @@ * </tr><tr> * <td>HTML.Tag.FRAME<td>FrameView * </tr> + * </tbody> * </table> */ public static class HTMLFactory implements ViewFactory {
--- a/src/java.desktop/share/classes/javax/swing/tree/DefaultTreeCellRenderer.java Fri Jun 16 09:20:39 2017 -0700 +++ b/src/java.desktop/share/classes/javax/swing/tree/DefaultTreeCellRenderer.java Sat Jun 17 08:03:05 2017 +0100 @@ -60,10 +60,16 @@ * that have a value of type {@code UIResource} are refreshed from the * defaults table. The following table lists the mapping between * {@code DefaultTreeCellRenderer} property and defaults table key: - * <table border="1" cellpadding="1" cellspacing="0" summary=""> - * <tr valign="top" style="text-align:left"> - * <th style="background-color:#CCCCFF;text-align:left">Property: - * <th style="background-color:#CCCCFF;text-align:left">Key: + * + * <table class="striped"> + * <caption>Properties</caption> + * <thead> + * <tr> + * <th>Property: + * <th>Key: + * </tr> + * </thead> + * <tbody> * <tr><td>"leafIcon"<td>"Tree.leafIcon" * <tr><td>"closedIcon"<td>"Tree.closedIcon" * <tr><td>"openIcon"<td>"Tree.openIcon" @@ -72,6 +78,7 @@ * <tr><td>"backgroundSelectionColor"<td>"Tree.selectionBackground" * <tr><td>"backgroundNonSelectionColor"<td>"Tree.textBackground" * <tr><td>"borderSelectionColor"<td>"Tree.selectionBorderColor" + * </tbody> * </table> * <p> * <strong><a id="override">Implementation Note:</a></strong>
--- a/src/java.desktop/share/classes/javax/swing/undo/UndoManager.java Fri Jun 16 09:20:39 2017 -0700 +++ b/src/java.desktop/share/classes/javax/swing/undo/UndoManager.java Sat Jun 17 08:03:05 2017 +0100 @@ -58,7 +58,8 @@ * and italicized are insignificant. * <p> * <a id="figure1"></a> - * <table border=0 summary=""> + * <table class="borderless"> + * <caption style="display:none">Figure 1</caption> * <tr><td> * <img src="doc-files/UndoManager-1.gif" alt=""> * <tr><td style="text-align:center">Figure 1 @@ -71,7 +72,8 @@ * figure. * <p> * <a id="figure2"></a> - * <table border=0 summary=""> + * <table class="borderless"> + * <caption style="display:none">Figure 2</caption> * <tr><td> * <img src="doc-files/UndoManager-2.gif" alt=""> * <tr><td style="text-align:center">Figure 2 @@ -83,7 +85,8 @@ * next edit to 0, as shown in the following figure. * <p> * <a id="figure3"></a> - * <table border=0 summary=""> + * <table class="borderless"> + * <caption style="display:none">Figure 3</caption> * <tr><td> * <img src="doc-files/UndoManager-3.gif" alt=""> * <tr><td style="text-align:center">Figure 3 @@ -109,7 +112,8 @@ * figure. * <p> * <a id="figure4"></a> - * <table border=0 summary=""> + * <table class="borderless"> + * <caption style="display:none">Figure 4</caption> * <tr><td> * <img src="doc-files/UndoManager-4.gif" alt=""> * <tr><td style="text-align:center">Figure 4
--- a/src/java.management/share/classes/sun/management/MemoryPoolImpl.java Fri Jun 16 09:20:39 2017 -0700 +++ b/src/java.management/share/classes/sun/management/MemoryPoolImpl.java Sat Jun 17 08:03:05 2017 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -304,8 +304,7 @@ getCount()); } void triggerAction() { - // Should not reach here - throw new AssertionError("Should not reach here"); + // do nothing } void clearAction() { // do nothing @@ -332,8 +331,7 @@ gcSensor.getCount()); } void triggerAction() { - // Should not reach here - throw new AssertionError("Should not reach here"); + // do nothing } void clearAction() { // do nothing
--- a/src/java.sql.rowset/share/classes/javax/sql/rowset/spi/package.html Fri Jun 16 09:20:39 2017 -0700 +++ b/src/java.sql.rowset/share/classes/javax/sql/rowset/spi/package.html Sat Jun 17 08:03:05 2017 +0100 @@ -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/src/jdk.jsobject/share/classes/netscape/javascript/JSObject.java Fri Jun 16 09:20:39 2017 -0700 +++ b/src/jdk.jsobject/share/classes/netscape/javascript/JSObject.java Sat Jun 17 08:03:05 2017 +0100 @@ -151,7 +151,7 @@ * JavaScript engine or if applet is {@code null} * * @deprecated The Applet API is deprecated. See the - * <a href="../../../../../../api/java/applet/package-summary.html"> + * <a href="{@docRoot}/java/applet/package-summary.html"> * java.applet package documentation</a> for further information. */
--- a/src/jdk.unsupported/share/classes/sun/misc/Unsafe.java Fri Jun 16 09:20:39 2017 -0700 +++ b/src/jdk.unsupported/share/classes/sun/misc/Unsafe.java Sat Jun 17 08:03:05 2017 +0100 @@ -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/test/jdk/modules/etc/UpgradeableModules.java Sat Jun 17 08:03:05 2017 +0100 @@ -0,0 +1,104 @@ +/* + * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/** + * @test + * @summary Verify that upgradeable modules are not hashed in java.base + * whereas non-upgradeable modules are. + * @modules java.base/jdk.internal.module + * @run main UpgradeableModules + */ + +import jdk.internal.module.ModuleHashes; +import jdk.internal.module.ModuleReferenceImpl; + +import java.lang.module.ModuleFinder; +import java.lang.module.ModuleReference; +import java.lang.module.ResolvedModule; +import java.util.HashSet; +import java.util.List; +import java.util.Optional; +import java.util.Set; +import java.util.stream.Collectors; + +public class UpgradeableModules { + private static final List<String> UPGRADEABLE_MODULES = + List.of("java.activation", + "java.compiler", + "java.corba", + "java.jnlp", + "java.transaction", + "java.xml.bind", + "java.xml.ws", + "java.xml.ws.annotation", + "jdk.internal.vm.compiler", + "jdk.deploy", + "jdk.javaws", + "jdk.plugin", + "jdk.plugin.dom", + "jdk.xml.bind", + "jdk.xml.ws"); + + public static void main(String... args) { + Set<String> hashedModules = hashedModules(); + if (hashedModules.isEmpty()) + return; + + if (UPGRADEABLE_MODULES.stream().anyMatch(hashedModules::contains)) { + throw new RuntimeException("upgradeable modules are hashed: " + + UPGRADEABLE_MODULES.stream() + .filter(hashedModules::contains) + .collect(Collectors.joining(" "))); + } + + Set<String> nonUpgradeableModules = + ModuleFinder.ofSystem().findAll().stream() + .map(mref -> mref.descriptor().name()) + .filter(mn -> !UPGRADEABLE_MODULES.contains(mn)) + .collect(Collectors.toSet()); + + if (nonUpgradeableModules.stream().anyMatch(mn -> !hashedModules.contains(mn))) { + throw new RuntimeException("non-upgradeable modules are not hashed: " + + nonUpgradeableModules.stream() + .filter(mn -> !hashedModules.contains(mn)) + .collect(Collectors.joining(" "))); + } + } + + private static Set<String> hashedModules() { + Optional<ResolvedModule> resolvedModule = ModuleLayer.boot() + .configuration() + .findModule("java.base"); + assert resolvedModule.isPresent(); + ModuleReference mref = resolvedModule.get().reference(); + assert mref instanceof ModuleReferenceImpl; + ModuleHashes hashes = ((ModuleReferenceImpl) mref).recordedHashes(); + if (hashes != null) { + Set<String> names = new HashSet<>(hashes.names()); + names.add("java.base"); + return names; + } + + return Set.of(); + } +}
--- a/test/jdk/modules/etc/VerifyModuleDelegation.java Fri Jun 16 09:20:39 2017 -0700 +++ b/test/jdk/modules/etc/VerifyModuleDelegation.java Sat Jun 17 08:03:05 2017 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -29,13 +29,9 @@ */ import java.lang.module.ModuleDescriptor; -import java.lang.module.ModuleFinder; -import java.lang.module.ModuleReference; import java.util.Set; import static java.util.stream.Collectors.toSet; -import static java.lang.module.ModuleDescriptor.Requires.Modifier.*; - import org.testng.annotations.*; import static org.testng.Assert.*; @@ -76,8 +72,9 @@ ClassLoader loader1 = boot.findLoader(md.name()); ClassLoader loader2 = boot.findLoader(req.name()); if (loader1 != loader2 && !isAncestor(loader2, loader1)) { - throw new Error(md.name() + " can't delegate to " + - "find classes from " + req.name()); + throw new Error(loader1.getName() + "/" + md.name() + + " can't delegate to find classes from " + + loader2.getName() + "/" + req.name()); } })); }
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/sun/security/pkcs12/ProbeLargeKeystore.java Sat Jun 17 08:03:05 2017 +0100 @@ -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); + } + } +}