8253497: Core Libs Terminology Refresh

Reviewed-by: naoto, kcr, rriggs, joehw, bpb, smarks, alanb
This commit is contained in:
Brent Christian 2020-12-16 23:09:20 +00:00
parent a244b82293
commit b2f035549a
15 changed files with 82 additions and 81 deletions

View File

@ -132,7 +132,7 @@ public class EquivMapsGenerator {
+ " A region/variant subtag \"" + preferred
+ "\" is registered for more than one subtags.");
}
} else { // language, extlang, grandfathered, and redundant
} else { // language, extlang, legacy, and redundant
if (!initialLanguageMap.containsKey(preferred)) {
sb = new StringBuilder(preferred);
sb.append(',');

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2016, 2019, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2016, 2020, 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
@ -64,7 +64,7 @@ import jdk.internal.util.StaticProperty;
* {@link Status#UNDECIDED UNDECIDED}.
* Filters should be designed for the specific use case and expected types.
* A filter designed for a particular use may be passed a class that is outside
* of the scope of the filter. If the purpose of the filter is to black-list classes
* of the scope of the filter. If the purpose of the filter is to reject classes
* then it can reject a candidate class that matches and report UNDECIDED for others.
* A filter may be called with class equals {@code null}, {@code arrayLength} equal -1,
* the depth, number of references, and stream size and return a status

View File

@ -1645,18 +1645,19 @@ public final class Locale implements Cloneable, Serializable {
* </pre></ul>
*
* <p>This implements the 'Language-Tag' production of BCP47, and
* so supports grandfathered (regular and irregular) as well as
* so supports legacy (regular and irregular, referred to as
* "Type: grandfathered" in BCP47) as well as
* private use language tags. Stand alone private use tags are
* represented as empty language and extension 'x-whatever',
* and grandfathered tags are converted to their canonical replacements
* and legacy tags are converted to their canonical replacements
* where they exist.
*
* <p>Grandfathered tags with canonical replacements are as follows:
* <p>Legacy tags with canonical replacements are as follows:
*
* <table class="striped">
* <caption style="display:none">Grandfathered tags with canonical replacements</caption>
* <caption style="display:none">Legacy tags with canonical replacements</caption>
* <thead style="text-align:center">
* <tr><th scope="col" style="padding: 0 2px">grandfathered tag</th><th scope="col" style="padding: 0 2px">modern replacement</th></tr>
* <tr><th scope="col" style="padding: 0 2px">legacy tag</th><th scope="col" style="padding: 0 2px">modern replacement</th></tr>
* </thead>
* <tbody style="text-align:center">
* <tr><th scope="row">art-lojban</th><td>jbo</td></tr>
@ -1682,13 +1683,13 @@ public final class Locale implements Cloneable, Serializable {
* </tbody>
* </table>
*
* <p>Grandfathered tags with no modern replacement will be
* <p>Legacy tags with no modern replacement will be
* converted as follows:
*
* <table class="striped">
* <caption style="display:none">Grandfathered tags with no modern replacement</caption>
* <caption style="display:none">Legacy tags with no modern replacement</caption>
* <thead style="text-align:center">
* <tr><th scope="col" style="padding: 0 2px">grandfathered tag</th><th scope="col" style="padding: 0 2px">converts to</th></tr>
* <tr><th scope="col" style="padding: 0 2px">legacy tag</th><th scope="col" style="padding: 0 2px">converts to</th></tr>
* </thead>
* <tbody style="text-align:center">
* <tr><th scope="row">cel-gaulish</th><td>xtg-x-cel-gaulish</td></tr>
@ -1700,7 +1701,7 @@ public final class Locale implements Cloneable, Serializable {
* </tbody>
* </table>
*
* <p>For a list of all grandfathered tags, see the
* <p>For a list of all legacy tags, see the
* IANA Language Subtag Registry (search for "Type: grandfathered").
*
* <p><b>Note</b>: there is no guarantee that {@code toLanguageTag}
@ -2586,7 +2587,7 @@ public final class Locale implements Cloneable, Serializable {
* Resets the Builder to match the provided IETF BCP 47
* language tag. Discards the existing state. Null and the
* empty string cause the builder to be reset, like {@link
* #clear}. Grandfathered tags (see {@link
* #clear}. Legacy tags (see {@link
* Locale#forLanguageTag}) are converted to their canonical
* form before being processed. Otherwise, the language tag
* must be well-formed (see {@link Locale}) or an exception is
@ -2838,7 +2839,7 @@ public final class Locale implements Cloneable, Serializable {
* on this builder.
*
* <p>This applies the conversions listed in {@link Locale#forLanguageTag}
* when constructing a Locale. (Grandfathered tags are handled in
* when constructing a Locale. (Legacy tags are handled in
* {@link #setLanguageTag}.)
*
* @return A Locale.

View File

@ -847,7 +847,7 @@ public final class BootstrapLogger implements Logger, PlatformLogger.Bridge,
else return VM.isBooted();
}
// A bit of black magic. We try to find out the nature of the logging
// A bit of magic. We try to find out the nature of the logging
// backend without actually loading it.
private static enum LoggingBackend {
// There is no LoggerFinder and JUL is not present

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2010, 2020, 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
@ -60,10 +60,10 @@ public class LanguageTag {
private List<String> variants = Collections.emptyList(); // variant subtags
private List<String> extensions = Collections.emptyList(); // extensions
// Map contains grandfathered tags and its preferred mappings from
// Map contains legacy language tags and its preferred mappings from
// http://www.ietf.org/rfc/rfc5646.txt
// Keys are lower-case strings.
private static final Map<String, String[]> GRANDFATHERED = new HashMap<>();
private static final Map<String, String[]> LEGACY = new HashMap<>();
static {
// grandfathered = irregular ; non-redundant tags registered
@ -127,7 +127,7 @@ public class LanguageTag {
{"zh-xiang", "hsn"},
};
for (String[] e : entries) {
GRANDFATHERED.put(LocaleUtils.toLowerString(e[0]), e);
LEGACY.put(LocaleUtils.toLowerString(e[0]), e);
}
}
@ -188,8 +188,8 @@ public class LanguageTag {
StringTokenIterator itr;
// Check if the tag is grandfathered
String[] gfmap = GRANDFATHERED.get(LocaleUtils.toLowerString(languageTag));
// Check if the tag is a legacy language tag
String[] gfmap = LEGACY.get(LocaleUtils.toLowerString(languageTag));
if (gfmap != null) {
// use preferred mapping
itr = new StringTokenIterator(gfmap[1], SEP);

View File

@ -132,7 +132,7 @@ public class RMIConnectorServer extends JMXConnectorServer {
* the serial form of any deserialized object.
* The pattern must be in same format as used in
* {@link java.io.ObjectInputFilter.Config#createFilter}.
* It may define a white list of permitted classes, a black list of
* It may define an allow-list of permitted classes, a reject-list of
* rejected classes, a maximum depth for the deserialized objects,
* etc.
* <p>
@ -149,7 +149,7 @@ public class RMIConnectorServer extends JMXConnectorServer {
* classes they use in their serial form.
* <p>
* Care must be taken when defining such a filter, as defining
* a white list too restrictive or a too wide a black list may
* an allow-list that is too narrow or a reject-list that is too wide may
* prevent legitimate clients from interoperating with the
* {@code JMXConnectorServer}.
*/

View File

@ -441,7 +441,7 @@ public class RegistryImpl extends java.rmi.server.RemoteServer
if (registryFilter != null) {
ObjectInputFilter.Status status = registryFilter.checkInput(filterInfo);
if (status != ObjectInputFilter.Status.UNDECIDED) {
// The Registry filter can override the built-in white-list
// The Registry filter can override the built-in allow-list
return status;
}
}

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1996, 2016, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1996, 2020, 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
@ -382,7 +382,7 @@ final class DGCImpl implements DGC {
if (dgcFilter != null) {
ObjectInputFilter.Status status = dgcFilter.checkInput(filterInfo);
if (status != ObjectInputFilter.Status.UNDECIDED) {
// The DGC filter can override the built-in white-list
// The DGC filter can override the built-in allow-list
return status;
}
}

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2000, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -62,7 +62,7 @@ public class Assert {
int[] switches = new int[7];
int switchSource = 0;
if (args.length == 0) { // This is master version
if (args.length == 0) { // This is the controller
// This code is for an exhaustive test
//while(switchSource < 2187) {
@ -92,7 +92,7 @@ public class Assert {
new InputStreamReader(p.getInputStream()));
String outString = blah.readLine();
while (outString != null) {
System.out.println("from slave:"+outString);
System.out.println("from BufferedReader:"+outString);
outString = blah.readLine();
}
}

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2003, 2020, 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
@ -119,9 +119,9 @@ class SimpleOne {}
class SimpleTwo {}
class Chain {
Slave slave = new Slave();
Worker worker = new Worker();
}
class Slave {}
class Worker {}
class LeftHand extends ClassLoader {
public LeftHand() {

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2008, 2020, 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
@ -45,13 +45,13 @@ public class Lock {
static final Random rand = new Random();
public static void main(String[] args) throws Exception {
if (args.length > 0 && args[0].equals("-lockslave")) {
if (args.length > 0 && args[0].equals("-lockworker")) {
int port = Integer.parseInt(args[1]);
runLockSlave(port);
runLockWorker(port);
System.exit(0);
}
LockSlaveMirror slave = startLockSlave();
LockWorkerMirror worker = startLockWorker();
try {
// create temporary file
@ -59,31 +59,31 @@ public class Lock {
blah.deleteOnExit();
// run tests
testLockProtocol(blah, slave);
testAsyncClose(blah, slave);
testLockProtocol(blah, worker);
testAsyncClose(blah, worker);
// eagerly clean-up
blah.delete();
} finally {
slave.shutdown();
worker.shutdown();
}
}
// test locking protocol
static void testLockProtocol(File file, LockSlaveMirror slave)
static void testLockProtocol(File file, LockWorkerMirror worker)
throws Exception
{
FileLock fl;
// slave VM opens file and acquires exclusive lock
slave.open(file.getPath()).lock();
// worker VM opens file and acquires exclusive lock
worker.open(file.getPath()).lock();
AsynchronousFileChannel ch = AsynchronousFileChannel
.open(file.toPath(), READ, WRITE);
// this VM tries to acquire lock
// (lock should not be acquire until released by slave VM)
// (lock should not be acquire until released by worker VM)
Future<FileLock> result = ch.lock();
try {
result.get(2, TimeUnit.SECONDS);
@ -91,15 +91,15 @@ public class Lock {
} catch (TimeoutException x) {
}
// slave VM releases lock
slave.unlock();
// worker VM releases lock
worker.unlock();
// this VM should now acquire lock
fl = result.get();
fl.release();
// slave VM acquires lock on range
slave.lock(0, 10, false);
// worker VM acquires lock on range
worker.lock(0, 10, false);
// this VM acquires lock on non-overlapping range
fl = ch.lock(10, 10, false).get();
@ -107,19 +107,19 @@ public class Lock {
// done
ch.close();
slave.close();
worker.close();
}
// test close of channel with outstanding lock operation
static void testAsyncClose(File file, LockSlaveMirror slave) throws Exception {
// slave VM opens file and acquires exclusive lock
slave.open(file.getPath()).lock();
static void testAsyncClose(File file, LockWorkerMirror worker) throws Exception {
// worker VM opens file and acquires exclusive lock
worker.open(file.getPath()).lock();
for (int i=0; i<100; i++) {
AsynchronousFileChannel ch = AsynchronousFileChannel
.open(file.toPath(), READ, WRITE);
// try to lock file (should not complete because file is locked by slave)
// try to lock file (should not complete because file is locked by worker)
Future<FileLock> result = ch.lock();
try {
result.get(rand.nextInt(100), TimeUnit.MILLISECONDS);
@ -142,12 +142,12 @@ public class Lock {
}
}
slave.close();
worker.close();
}
// starts a "lock slave" in another process, returning a mirror object to
// control the slave
static LockSlaveMirror startLockSlave() throws Exception {
// starts a "lock worker" in another process, returning a mirror object to
// control the worker
static LockWorkerMirror startLockWorker() throws Exception {
ServerSocketChannel ssc = ServerSocketChannel.open()
.bind(new InetSocketAddress(0));
int port = ((InetSocketAddress)(ssc.getLocalAddress())).getPort();
@ -159,29 +159,29 @@ public class Lock {
String testClasses = System.getProperty("test.classes");
if (testClasses != null)
command += " -cp " + testClasses;
command += " Lock -lockslave " + port;
command += " Lock -lockworker " + port;
Process p = Runtime.getRuntime().exec(command);
IOHandler.handle(p.getInputStream());
IOHandler.handle(p.getErrorStream());
// wait for slave to connect
// wait for worker to connect
SocketChannel sc = ssc.accept();
return new LockSlaveMirror(sc);
return new LockWorkerMirror(sc);
}
// commands that the slave understands
// commands that the worker understands
static final String OPEN_CMD = "open";
static final String CLOSE_CMD = "close";
static final String LOCK_CMD = "lock";
static final String UNLOCK_CMD = "unlock";
static final char TERMINATOR = ';';
// provides a proxy to a "lock slave"
static class LockSlaveMirror {
// provides a proxy to a "lock worker"
static class LockWorkerMirror {
private final SocketChannel sc;
LockSlaveMirror(SocketChannel sc) {
LockWorkerMirror(SocketChannel sc) {
this.sc = sc;
}
@ -207,7 +207,7 @@ public class Lock {
throw new RuntimeException("Terminated expected");
}
LockSlaveMirror open(String file) throws IOException {
LockWorkerMirror open(String file) throws IOException {
sendCommand(OPEN_CMD, file);
return this;
}
@ -216,20 +216,20 @@ public class Lock {
sendCommand(CLOSE_CMD);
}
LockSlaveMirror lock() throws IOException {
LockWorkerMirror lock() throws IOException {
sendCommand(LOCK_CMD);
return this;
}
LockSlaveMirror lock(long position, long size, boolean shared)
LockWorkerMirror lock(long position, long size, boolean shared)
throws IOException
{
sendCommand(LOCK_CMD, position + "," + size + "," + shared);
return this;
}
LockSlaveMirror unlock() throws IOException {
LockWorkerMirror unlock() throws IOException {
sendCommand(UNLOCK_CMD);
return this;
}
@ -268,8 +268,8 @@ public class Lock {
}
}
// slave process that responds to simple commands a socket connection
static void runLockSlave(int port) throws Exception {
// worker process that responds to simple commands a socket connection
static void runLockWorker(int port) throws Exception {
// establish connection to parent
SocketChannel sc = SocketChannel.open(new InetSocketAddress(port));

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2005, 2019, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2005, 2020, 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,8 +42,8 @@ public class CloseRegisteredChannel {
SocketChannel client = SocketChannel.open ();
client.connect (new InetSocketAddress (InetAddress.getLoopbackAddress(), port));
SocketChannel slave = server.accept ();
slave.configureBlocking (true);
SocketChannel peer = server.accept();
peer.configureBlocking(true);
Selector selector = Selector.open ();
client.configureBlocking (false);
@ -53,7 +53,7 @@ public class CloseRegisteredChannel {
client.close();
//System.out.println ("client.isOpen = " + client.isOpen());
System.out.println ("Will hang here...");
int nb = slave.read (ByteBuffer.allocate (1024));
int nb = peer.read(ByteBuffer.allocate (1024));
//System.out.println("read nb=" + nb);
selector.close();

View File

@ -151,7 +151,7 @@ public class LSRDataTest {
+ " A region/variant subtag \"" + preferred
+ "\" is registered for more than one subtags.");
}
} else { // language, extlang, grandfathered, and redundant
} else { // language, extlang, legacy, and redundant
if (!singleLangEquivMap.containsKey(preferred)
&& !multiLangEquivsMap.containsKey(preferred)) {
// new entry add it into single equiv map

View File

@ -504,7 +504,7 @@ public class LocaleEnhanceTest extends IntlTest {
public void testForLanguageTag() {
// forLanguageTag implements the 'Language-Tag' production of
// BCP47, so it handles private use and grandfathered tags,
// BCP47, so it handles private use and legacy language tags,
// unlike locale builder. Tags listed below (except for the
// sample private use tags) come from 4646bis Feb 29, 2009.
@ -514,7 +514,7 @@ public class LocaleEnhanceTest extends IntlTest {
{ "x-a-b-c", "x-a-b-c" },
{ "x-a-12345678", "x-a-12345678" },
// grandfathered tags with preferred mappings
// legacy language tags with preferred mappings
{ "i-ami", "ami" },
{ "i-bnn", "bnn" },
{ "i-hak", "hak" },
@ -536,7 +536,7 @@ public class LocaleEnhanceTest extends IntlTest {
{ "zh-min-nan", "nan" },
{ "zh-xiang", "hsn" },
// grandfathered irregular tags, no preferred mappings, drop illegal fields
// irregular legacy language tags, no preferred mappings, drop illegal fields
// from end. If no subtag is mappable, fallback to 'und'
{ "i-default", "en-x-i-default" },
{ "i-enochian", "x-i-enochian" },
@ -548,7 +548,7 @@ public class LocaleEnhanceTest extends IntlTest {
for (int i = 0; i < tests.length; ++i) {
String[] test = tests[i];
Locale locale = Locale.forLanguageTag(test[0]);
assertEquals("grandfathered case " + i, test[1], locale.toLanguageTag());
assertEquals("legacy language tag case " + i, test[1], locale.toLanguageTag());
}
// forLanguageTag ignores everything past the first place it encounters

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2016, 2020, 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
@ -238,7 +238,7 @@ public class DefaultAgentFilterTest {
boolean retry = false;
do {
try {
// blacklist String
// filter DefaultAgentFilterTest$MyTestObject
testDefaultAgent("mgmt1.properties");
System.out.println("----\tTest FAILED !!");
throw new RuntimeException("---" + DefaultAgentFilterTest.class.getName() + " - No exception reported");
@ -264,7 +264,7 @@ public class DefaultAgentFilterTest {
retry = false;
do {
try {
// blacklist non-existent class
// filter non-existent class
testDefaultAgent("mgmt2.properties");
System.out.println("----\tTest PASSED !!");
} catch (Exception ex) {