From 9b84cfb7f6f599a39da22268c1ba0cd3ee4a90e0 Mon Sep 17 00:00:00 2001 From: Lana Steuck Date: Thu, 27 Jul 2017 18:04:48 +0000 Subject: [PATCH 01/26] Added tag jdk-9+180 for changeset c3e45a079573 --- jdk/.hgtags | 1 + 1 file changed, 1 insertion(+) diff --git a/jdk/.hgtags b/jdk/.hgtags index 9126335d0c5..df28072c0e4 100644 --- a/jdk/.hgtags +++ b/jdk/.hgtags @@ -422,3 +422,4 @@ e6c4f6ef717d104dba880e2dae538690c993b46f jdk-9+175 80acf577b7d0b886fb555c9916552844f6cc72af jdk-9+177 443025bee731eb2225371b92c1c74b519b7baf33 jdk-9+178 06df1ce4b9b887d05ce6a13f4def3547e434dd1a jdk-9+179 +4feab1acec6a9c3620a19ff379a65ab8618d0e2a jdk-9+180 From c27877713e1cb15212caff7a2cf2655331877088 Mon Sep 17 00:00:00 2001 From: Phil Race Date: Thu, 3 Aug 2017 18:56:59 +0000 Subject: [PATCH 02/26] Added tag jdk-9+181 for changeset 35dc62e43188 --- jdk/.hgtags | 1 + 1 file changed, 1 insertion(+) diff --git a/jdk/.hgtags b/jdk/.hgtags index df28072c0e4..eca17387148 100644 --- a/jdk/.hgtags +++ b/jdk/.hgtags @@ -423,3 +423,4 @@ e6c4f6ef717d104dba880e2dae538690c993b46f jdk-9+175 443025bee731eb2225371b92c1c74b519b7baf33 jdk-9+178 06df1ce4b9b887d05ce6a13f4def3547e434dd1a jdk-9+179 4feab1acec6a9c3620a19ff379a65ab8618d0e2a jdk-9+180 +bd66ea2fdde3d60a73b5272263a7b8b0ca926a33 jdk-9+181 From 61548e670edfdbbceb0d00f49de0c23b798970c1 Mon Sep 17 00:00:00 2001 From: Hamlin Li Date: Thu, 3 Aug 2017 18:30:32 -0700 Subject: [PATCH 03/26] 8185788: langtools test jdk/javadoc/doclet/testModules/TestModuleServicesLink.java fails with compilation error Reviewed-by: jjg --- .../javadoc/doclet/testModules/TestModuleServicesLink.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/langtools/test/jdk/javadoc/doclet/testModules/TestModuleServicesLink.java b/langtools/test/jdk/javadoc/doclet/testModules/TestModuleServicesLink.java index aeb9b2486ab..8a61fc2c30c 100644 --- a/langtools/test/jdk/javadoc/doclet/testModules/TestModuleServicesLink.java +++ b/langtools/test/jdk/javadoc/doclet/testModules/TestModuleServicesLink.java @@ -25,7 +25,9 @@ * @test * @bug 8185151 * @summary test that navigation summary links are not linked when there are no dependencies - * @modules jdk.javadoc/jdk.javadoc.internal.api + * @modules jdk.compiler/com.sun.tools.javac.api + * jdk.compiler/com.sun.tools.javac.main + * jdk.javadoc/jdk.javadoc.internal.api * jdk.javadoc/jdk.javadoc.internal.tool * @library ../lib /tools/lib * @build toolbox.ToolBox toolbox.ModuleBuilder JavadocTester From c61869008f0ad639593d602506ceac711dc2bb7b Mon Sep 17 00:00:00 2001 From: Jonathan Gibbons Date: Fri, 4 Aug 2017 10:59:28 -0700 Subject: [PATCH 04/26] 8185752: update javadoc options in make/Docs.gmk Reviewed-by: tbell --- make/Docs.gmk | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/make/Docs.gmk b/make/Docs.gmk index b997881805c..7b5194adbf4 100644 --- a/make/Docs.gmk +++ b/make/Docs.gmk @@ -101,9 +101,9 @@ JAVADOC_TAGS := \ JAVADOC_DISABLED_DOCLINT := accessibility html missing syntax reference # The initial set of options for javadoc -JAVADOC_OPTIONS := -XDignore.symbol.file=true -use -keywords -notimestamp \ - -serialwarn -encoding ISO-8859-1 -breakiterator -splitIndex --system none \ - -html5 -javafx --expand-requires transitive +JAVADOC_OPTIONS := -use -keywords -notimestamp \ + -serialwarn -encoding ISO-8859-1 -docencoding UTF-8 -breakiterator \ + -splitIndex --system none -html5 -javafx --expand-requires transitive # Should we add DRAFT stamps to the generated javadoc? ifeq ($(VERSION_IS_GA), true) From e3fc153bc8bda2c2c7882a5678a3020c48b479ac Mon Sep 17 00:00:00 2001 From: Jonathan Gibbons Date: Fri, 4 Aug 2017 15:42:58 -0700 Subject: [PATCH 05/26] 8185756: JShell has two broken links in its documentation Reviewed-by: rfield --- .../src/jdk.jshell/share/classes/jdk/jshell/Snippet.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/langtools/src/jdk.jshell/share/classes/jdk/jshell/Snippet.java b/langtools/src/jdk.jshell/share/classes/jdk/jshell/Snippet.java index 255c8c92a6a..fa2d58345f9 100644 --- a/langtools/src/jdk.jshell/share/classes/jdk/jshell/Snippet.java +++ b/langtools/src/jdk.jshell/share/classes/jdk/jshell/Snippet.java @@ -31,7 +31,7 @@ import java.util.List; /** * A Snippet represents a snippet of Java source code as passed to - * {@link jdk.jshell.JShell#eval}. It is associated only with the + * {@link jdk.jshell.JShell#eval(java.lang.String)}. It is associated only with the * {@link jdk.jshell.JShell JShell} instance that created it. * An instance of Snippet (including its subclasses) is immutable: an access to * any of its methods will always return the same result. @@ -52,7 +52,7 @@ public abstract class Snippet { * It is accessed with {@link jdk.jshell.Snippet#kind()}. * The {@code Kind} can be used to determine which * subclass of Snippet it is. For example, - * {@link jdk.jshell.JShell#eval eval("int three() { return 3; }")} will + * {@link jdk.jshell.JShell#eval(java.lang.String) eval("int three() { return 3; }")} will * return a snippet creation event. The {@code Kind} of that Snippet * will be {@code METHOD}, from which you know that the subclass * of {@code Snippet} is {@code MethodSnippet} and it can be @@ -178,7 +178,7 @@ public abstract class Snippet { /** * The detailed variety of a snippet. This is a sub-classification of the * Kind. The Kind of a SubKind is accessible with - * {@link jdk.jshell.Snippet.SubKind#kind}. + * {@link jdk.jshell.Snippet.SubKind#kind()}. */ public enum SubKind { @@ -460,7 +460,7 @@ public abstract class Snippet { /** * The snippet is inactive because it has been replaced by a new * snippet. This occurs when the new snippet added with - * {@link jdk.jshell.JShell#eval} matches a previous snippet. + * {@link jdk.jshell.JShell#eval(java.lang.String) eval} matches a previous snippet. * A {@code TypeDeclSnippet} will match another * {@code TypeDeclSnippet} if the names match. * For example {@code class X { }} will overwrite From e896a1e02484513a55ce0ab61374124666f3c26a Mon Sep 17 00:00:00 2001 From: Lana Steuck Date: Fri, 4 Aug 2017 23:29:03 +0000 Subject: [PATCH 06/26] Added tag jdk-10+18 for changeset fa58de12a8c0 --- .hgtags-top-repo | 1 + 1 file changed, 1 insertion(+) diff --git a/.hgtags-top-repo b/.hgtags-top-repo index 8faa13d434f..9ed3c0b1f24 100644 --- a/.hgtags-top-repo +++ b/.hgtags-top-repo @@ -440,3 +440,4 @@ a6c830ee8a6798b186730475e700027cdf4598aa jdk-10+15 ec4159ebe7050fcc5dcee8a2d150cf948ecc97db jdk-9+178 252475ccfd84cc249f8d6faf4b7806b5e2c384ce jdk-9+179 a133a7d1007b1456bc62824382fd8ac93b45d329 jdk-10+17 +536b81db8075486ca0fe3225d8e59313df5b936c jdk-10+18 From b89e86826298a3a1f7f38aeb70e6476814b2075a Mon Sep 17 00:00:00 2001 From: Lana Steuck Date: Fri, 4 Aug 2017 23:29:04 +0000 Subject: [PATCH 07/26] Added tag jdk-10+18 for changeset d47f92fdf2a1 --- nashorn/.hgtags | 1 + 1 file changed, 1 insertion(+) diff --git a/nashorn/.hgtags b/nashorn/.hgtags index 52f64b895d0..8053fd21be1 100644 --- a/nashorn/.hgtags +++ b/nashorn/.hgtags @@ -431,3 +431,4 @@ f456f59dad3f6b74bcc3c668a56d51f5955cfb28 jdk-10+16 7497ad85759ff010f44344b553223d1647fb6eba jdk-9+178 3adfb547e3e49e304ffc82d8c6489cb830b74d62 jdk-9+179 6ac0ca441ccb9ccc49c5007248dc1f3af8076a71 jdk-10+17 +e7fbd9c8637ff362e5a1801e3c89c579f23279f7 jdk-10+18 From f0cfaafe8b5f8515c43b499c690ecaaa5534dda0 Mon Sep 17 00:00:00 2001 From: Lana Steuck Date: Fri, 4 Aug 2017 23:29:05 +0000 Subject: [PATCH 08/26] Added tag jdk-10+18 for changeset 086cb2c6e9e2 --- hotspot/.hgtags | 1 + 1 file changed, 1 insertion(+) diff --git a/hotspot/.hgtags b/hotspot/.hgtags index 93330098b14..bd997249d7d 100644 --- a/hotspot/.hgtags +++ b/hotspot/.hgtags @@ -600,3 +600,4 @@ c1f3649a3a42f124b418a5a916dbad13d059b757 jdk-10+15 9d032191f82fca5ba0aac98682f69c4ff0f1283d jdk-9+178 d2661aa42bff322badbe6c1337fc638d2e0f5730 jdk-9+179 73e2cb8700bfa51304bd4b02f224620859a3f600 jdk-10+17 +c9d3317623d48da3327232c81e3f8cfc0d29d888 jdk-10+18 From 42710f93067880f6ca51826805dd76a7ac9a5822 Mon Sep 17 00:00:00 2001 From: Lana Steuck Date: Fri, 4 Aug 2017 23:29:08 +0000 Subject: [PATCH 09/26] Added tag jdk-10+18 for changeset 0bdcd03d587a --- corba/.hgtags | 1 + 1 file changed, 1 insertion(+) diff --git a/corba/.hgtags b/corba/.hgtags index ae9a9aab2e5..96e4906862a 100644 --- a/corba/.hgtags +++ b/corba/.hgtags @@ -440,3 +440,4 @@ b82b62ed5debda2d98dda597506ef29cf947fbae jdk-10+16 9c1e9712648921ae389d623042d22561fad82d75 jdk-9+178 24390da83c5ee9e23ceafbcaff4460a01e37bb3a jdk-9+179 50ff1fd66362f212a8db6de76089d9d0ffa4df0f jdk-10+17 +a923b3f30e7bddb4f960059ddfc7978fc63e2e6e jdk-10+18 From bc66e635c4761f89a76e184076d3789eec645472 Mon Sep 17 00:00:00 2001 From: Lana Steuck Date: Fri, 4 Aug 2017 23:29:09 +0000 Subject: [PATCH 10/26] Added tag jdk-10+18 for changeset 8314cfaaacab --- jaxp/.hgtags | 1 + 1 file changed, 1 insertion(+) diff --git a/jaxp/.hgtags b/jaxp/.hgtags index f2420478bb0..d8240378ee2 100644 --- a/jaxp/.hgtags +++ b/jaxp/.hgtags @@ -440,3 +440,4 @@ d109d55cf642bf2b438624e81f94c18c168f9178 jdk-10+16 0983b2dbe17ba4fed3af34e0512ca77a9845fe8a jdk-9+178 87243a3131f79e8b3903eaca6b629abc48f08ace jdk-9+179 97d6f14334cfd766f57c296a5a707c8a709aeff0 jdk-10+17 +7ba7ebbc304a4817e05b72efa6b45ed635839b98 jdk-10+18 From 34c20f69e019122d23fd52d0d4ac33abfe1351c3 Mon Sep 17 00:00:00 2001 From: Lana Steuck Date: Fri, 4 Aug 2017 23:29:09 +0000 Subject: [PATCH 11/26] Added tag jdk-10+18 for changeset c65be9fae87b --- langtools/.hgtags | 1 + 1 file changed, 1 insertion(+) diff --git a/langtools/.hgtags b/langtools/.hgtags index dae0ab0140c..d9f55494232 100644 --- a/langtools/.hgtags +++ b/langtools/.hgtags @@ -440,3 +440,4 @@ add6717b655efa3aa9350e917175f3965cfc0729 jdk-10+14 849e366ef175012e6dedc3ca151da416716e0ea9 jdk-9+178 b653b1b2ea883593596bc18e9af73a9b369eeb0a jdk-9+179 41028d8c0a71c6beaf1886ca095e703fbb1513ec jdk-10+17 +bc2a67fe6b7fcec3a33e3912e27efec83ec6b52c jdk-10+18 From e4e97a05f1885c77de6538a93e71cdc7ca24f998 Mon Sep 17 00:00:00 2001 From: Lana Steuck Date: Fri, 4 Aug 2017 23:29:15 +0000 Subject: [PATCH 12/26] Added tag jdk-10+18 for changeset 0f6c90f4ce74 --- jaxws/.hgtags | 1 + 1 file changed, 1 insertion(+) diff --git a/jaxws/.hgtags b/jaxws/.hgtags index 2ab93a9d847..bc0e3e8345d 100644 --- a/jaxws/.hgtags +++ b/jaxws/.hgtags @@ -443,3 +443,4 @@ bc8289ce1ed3ed5fff62152ed46da3be0b60b7c3 jdk-10+16 d0190aaf1816081d9b2e0577b65b793804896d1e jdk-9+178 56ac1831ac5924b5092a53a85d6fc68749501fb8 jdk-9+179 4c07d366c2e177edba7aa54c4b015e4dbf12bc83 jdk-10+17 +6859ffbe2c510c930f88983743578d8186cf6dbd jdk-10+18 From 15ebee5d38ef8166ed9d8e9fb493ae5fb1cfd6a3 Mon Sep 17 00:00:00 2001 From: Roger Riggs Date: Mon, 7 Aug 2017 14:14:03 -0400 Subject: [PATCH 13/26] 8184744: Replace finalizer in crypto classes with Cleaner Reviewed-by: mchung --- .../com/sun/crypto/provider/DESKey.java | 23 ++-- .../com/sun/crypto/provider/DESedeKey.java | 23 ++-- .../com/sun/crypto/provider/PBEKey.java | 25 ++--- .../sun/crypto/provider/PBKDF2KeyImpl.java | 34 +++--- .../sun/security/provider/KeyProtector.java | 17 +-- .../Cipher/DES/DESKeyCleanupTest.java | 78 +++++++++++++ .../Cipher/PBE/PBEKeyCleanupTest.java | 103 ++++++++++++++++++ 7 files changed, 221 insertions(+), 82 deletions(-) create mode 100644 jdk/test/com/sun/crypto/provider/Cipher/DES/DESKeyCleanupTest.java create mode 100644 jdk/test/com/sun/crypto/provider/Cipher/PBE/PBEKeyCleanupTest.java diff --git a/jdk/src/java.base/share/classes/com/sun/crypto/provider/DESKey.java b/jdk/src/java.base/share/classes/com/sun/crypto/provider/DESKey.java index d3f1c99df2a..7fd898fe594 100644 --- a/jdk/src/java.base/share/classes/com/sun/crypto/provider/DESKey.java +++ b/jdk/src/java.base/share/classes/com/sun/crypto/provider/DESKey.java @@ -31,6 +31,8 @@ import java.security.InvalidKeyException; import javax.crypto.SecretKey; import javax.crypto.spec.DESKeySpec; +import jdk.internal.ref.CleanerFactory; + /** * This class represents a DES key. * @@ -74,6 +76,11 @@ final class DESKey implements SecretKey { this.key = new byte[DESKeySpec.DES_KEY_LEN]; System.arraycopy(key, offset, this.key, 0, DESKeySpec.DES_KEY_LEN); DESKeyGenerator.setParityBit(this.key, 0); + + // Use the cleaner to zero the key when no longer referenced + final byte[] k = this.key; + CleanerFactory.cleaner().register(this, + () -> java.util.Arrays.fill(k, (byte)0x00)); } public byte[] getEncoded() { @@ -144,20 +151,4 @@ final class DESKey implements SecretKey { getFormat(), getEncoded()); } - - /** - * Ensures that the bytes of this key are - * set to zero when there are no more references to it. - */ - @SuppressWarnings("deprecation") - protected void finalize() throws Throwable { - try { - if (this.key != null) { - java.util.Arrays.fill(this.key, (byte)0x00); - this.key = null; - } - } finally { - super.finalize(); - } - } } diff --git a/jdk/src/java.base/share/classes/com/sun/crypto/provider/DESedeKey.java b/jdk/src/java.base/share/classes/com/sun/crypto/provider/DESedeKey.java index 9695ba39e6f..a618b71f05b 100644 --- a/jdk/src/java.base/share/classes/com/sun/crypto/provider/DESedeKey.java +++ b/jdk/src/java.base/share/classes/com/sun/crypto/provider/DESedeKey.java @@ -31,6 +31,8 @@ import java.security.InvalidKeyException; import javax.crypto.SecretKey; import javax.crypto.spec.DESedeKeySpec; +import jdk.internal.ref.CleanerFactory; + /** * This class represents a DES-EDE key. * @@ -76,6 +78,11 @@ final class DESedeKey implements SecretKey { DESKeyGenerator.setParityBit(this.key, 0); DESKeyGenerator.setParityBit(this.key, 8); DESKeyGenerator.setParityBit(this.key, 16); + + // Use the cleaner to zero the key when no longer referenced + final byte[] k = this.key; + CleanerFactory.cleaner().register(this, + () -> java.util.Arrays.fill(k, (byte)0x00)); } public byte[] getEncoded() { @@ -145,20 +152,4 @@ final class DESedeKey implements SecretKey { getFormat(), getEncoded()); } - - /** - * Ensures that the bytes of this key are - * set to zero when there are no more references to it. - */ - @SuppressWarnings("deprecation") - protected void finalize() throws Throwable { - try { - if (this.key != null) { - java.util.Arrays.fill(this.key, (byte)0x00); - this.key = null; - } - } finally { - super.finalize(); - } - } } diff --git a/jdk/src/java.base/share/classes/com/sun/crypto/provider/PBEKey.java b/jdk/src/java.base/share/classes/com/sun/crypto/provider/PBEKey.java index 72e7452ace0..011fb954963 100644 --- a/jdk/src/java.base/share/classes/com/sun/crypto/provider/PBEKey.java +++ b/jdk/src/java.base/share/classes/com/sun/crypto/provider/PBEKey.java @@ -32,6 +32,8 @@ import java.util.Locale; import javax.crypto.SecretKey; import javax.crypto.spec.PBEKeySpec; +import jdk.internal.ref.CleanerFactory; + /** * This class represents a PBE key. * @@ -49,7 +51,7 @@ final class PBEKey implements SecretKey { /** * Creates a PBE key from a given PBE key specification. * - * @param key the given PBE key specification + * @param keytype the given PBE key specification */ PBEKey(PBEKeySpec keySpec, String keytype) throws InvalidKeySpecException { char[] passwd = keySpec.getPassword(); @@ -70,6 +72,11 @@ final class PBEKey implements SecretKey { this.key[i] = (byte) (passwd[i] & 0x7f); java.util.Arrays.fill(passwd, ' '); type = keytype; + + // Use the cleaner to zero the key when no longer referenced + final byte[] k = this.key; + CleanerFactory.cleaner().register(this, + () -> java.util.Arrays.fill(k, (byte)0x00)); } public byte[] getEncoded() { @@ -140,20 +147,4 @@ final class PBEKey implements SecretKey { getFormat(), getEncoded()); } - - /** - * Ensures that the password bytes of this key are - * set to zero when there are no more references to it. - */ - @SuppressWarnings("deprecation") - protected void finalize() throws Throwable { - try { - if (this.key != null) { - java.util.Arrays.fill(this.key, (byte)0x00); - this.key = null; - } - } finally { - super.finalize(); - } - } } diff --git a/jdk/src/java.base/share/classes/com/sun/crypto/provider/PBKDF2KeyImpl.java b/jdk/src/java.base/share/classes/com/sun/crypto/provider/PBKDF2KeyImpl.java index 1bf51566165..bc9a7f88c8c 100644 --- a/jdk/src/java.base/share/classes/com/sun/crypto/provider/PBKDF2KeyImpl.java +++ b/jdk/src/java.base/share/classes/com/sun/crypto/provider/PBKDF2KeyImpl.java @@ -40,6 +40,8 @@ import javax.crypto.Mac; import javax.crypto.SecretKey; import javax.crypto.spec.PBEKeySpec; +import jdk.internal.ref.CleanerFactory; + /** * This class represents a PBE key derived using PBKDF2 defined * in PKCS#5 v2.0. meaning that @@ -76,7 +78,8 @@ final class PBKDF2KeyImpl implements javax.crypto.interfaces.PBEKey { /** * Creates a PBE key from a given PBE key specification. * - * @param key the given PBE key specification + * @param keySpec the given PBE key specification + * @param prfAlgo the given PBE key algorithm */ PBKDF2KeyImpl(PBEKeySpec keySpec, String prfAlgo) throws InvalidKeySpecException { @@ -120,6 +123,15 @@ final class PBKDF2KeyImpl implements javax.crypto.interfaces.PBEKey { throw ike; } this.key = deriveKey(prf, passwdBytes, salt, iterCount, keyLength); + + // Use the cleaner to zero the key when no longer referenced + final byte[] k = this.key; + final char[] p = this.passwd; + CleanerFactory.cleaner().register(this, + () -> { + java.util.Arrays.fill(k, (byte)0x00); + java.util.Arrays.fill(p, '0'); + }); } private static byte[] deriveKey(final Mac prf, final byte[] password, @@ -262,24 +274,4 @@ final class PBKDF2KeyImpl implements javax.crypto.interfaces.PBEKey { return new KeyRep(KeyRep.Type.SECRET, getAlgorithm(), getFormat(), getEncoded()); } - - /** - * Ensures that the password bytes of this key are - * erased when there are no more references to it. - */ - @SuppressWarnings("deprecation") - protected void finalize() throws Throwable { - try { - if (this.passwd != null) { - java.util.Arrays.fill(this.passwd, '0'); - this.passwd = null; - } - if (this.key != null) { - java.util.Arrays.fill(this.key, (byte)0x00); - this.key = null; - } - } finally { - super.finalize(); - } - } } diff --git a/jdk/src/java.base/share/classes/sun/security/provider/KeyProtector.java b/jdk/src/java.base/share/classes/sun/security/provider/KeyProtector.java index bffa1f5b283..99f5fbb7ac2 100644 --- a/jdk/src/java.base/share/classes/sun/security/provider/KeyProtector.java +++ b/jdk/src/java.base/share/classes/sun/security/provider/KeyProtector.java @@ -35,6 +35,7 @@ import java.security.SecureRandom; import java.security.UnrecoverableKeyException; import java.util.*; +import jdk.internal.ref.CleanerFactory; import sun.security.pkcs.PKCS8Key; import sun.security.pkcs.EncryptedPrivateKeyInfo; import sun.security.x509.AlgorithmId; @@ -141,18 +142,10 @@ final class KeyProtector { passwdBytes[j++] = (byte)(password[i] >> 8); passwdBytes[j++] = (byte)password[i]; } - } - - /** - * Ensures that the password bytes of this key protector are - * set to zero when there are no more references to it. - */ - @SuppressWarnings("deprecation") - protected void finalize() { - if (passwdBytes != null) { - Arrays.fill(passwdBytes, (byte)0x00); - passwdBytes = null; - } + // Use the cleaner to zero the password when no longer referenced + final byte[] k = this.passwdBytes; + CleanerFactory.cleaner().register(this, + () -> java.util.Arrays.fill(k, (byte)0x00)); } /* diff --git a/jdk/test/com/sun/crypto/provider/Cipher/DES/DESKeyCleanupTest.java b/jdk/test/com/sun/crypto/provider/Cipher/DES/DESKeyCleanupTest.java new file mode 100644 index 00000000000..7c62c904e3b --- /dev/null +++ b/jdk/test/com/sun/crypto/provider/Cipher/DES/DESKeyCleanupTest.java @@ -0,0 +1,78 @@ +/* + * 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 + * @modules java.base/com.sun.crypto.provider:+open + * @run main/othervm DESKeyCleanupTest + * @summary Verify that key storage is cleared + */ + +import java.lang.ref.PhantomReference; +import java.lang.ref.Reference; +import java.lang.ref.ReferenceQueue; +import java.lang.reflect.Field; +import java.util.Arrays; + +import javax.crypto.KeyGenerator; +import javax.crypto.SecretKey; + +/** + * Test that the array holding the key bytes is cleared when it is + * no longer referenced by the key. + */ + +public class DESKeyCleanupTest { + + private final static String SunJCEProvider = "SunJCE"; + + public static void main(String[] args) throws Exception { + testCleanupSecret("DES"); + testCleanupSecret("DESede"); + } + + static void testCleanupSecret(String algorithm) throws Exception { + KeyGenerator desGen = KeyGenerator.getInstance(algorithm, SunJCEProvider); + SecretKey key = desGen.generateKey(); + + // Break into the implementation to observe the key byte array. + Class keyClass = key.getClass(); + Field keyField = keyClass.getDeclaredField("key"); + keyField.setAccessible(true); + byte[] array = (byte[])keyField.get(key); + + byte[] zeros = new byte[array.length]; + do { + // Wait for array to be cleared; if not cleared test will timeout + System.out.printf("%s array: %s%n", algorithm, Arrays.toString(array)); + key = null; + System.gc(); // attempt to reclaim the key + } while (Arrays.compare(zeros, array) != 0); + System.out.printf("%s array: %s%n", algorithm, Arrays.toString(array)); + + Reference.reachabilityFence(key); // Keep key alive + Reference.reachabilityFence(array); // Keep array alive + } +} + + diff --git a/jdk/test/com/sun/crypto/provider/Cipher/PBE/PBEKeyCleanupTest.java b/jdk/test/com/sun/crypto/provider/Cipher/PBE/PBEKeyCleanupTest.java new file mode 100644 index 00000000000..03da1d9c9a9 --- /dev/null +++ b/jdk/test/com/sun/crypto/provider/Cipher/PBE/PBEKeyCleanupTest.java @@ -0,0 +1,103 @@ +/* + * 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 + * @modules java.base/com.sun.crypto.provider:+open + * @run main/othervm PBEKeyCleanupTest + * @summary Verify that key storage is cleared + */ + +import java.lang.ref.PhantomReference; +import java.lang.ref.Reference; +import java.lang.ref.ReferenceQueue; +import java.lang.reflect.Field; +import java.util.Arrays; +import java.util.Random; + +import javax.crypto.SecretKey; +import javax.crypto.SecretKeyFactory; +import javax.crypto.spec.PBEKeySpec; + +/** + * Test that the array holding the key bytes is cleared when it is + * no longer referenced by the key. + */ +public class PBEKeyCleanupTest { + + private final static String SunJCEProvider = "SunJCE"; + + private static final String PASS_PHRASE = "some hidden string"; + private static final int ITERATION_COUNT = 1000; + private static final int KEY_SIZE = 128; + + public static void main(String[] args) throws Exception { + testPBESecret("PBEWithMD5AndDES"); + testPBKSecret("PBKDF2WithHmacSHA1"); + } + + private static void testPBESecret(String algorithm) throws Exception { + char[] password = new char[] {'f', 'o', 'o'}; + PBEKeySpec pbeKeySpec = new PBEKeySpec(password); + SecretKeyFactory keyFac = + SecretKeyFactory.getInstance(algorithm, SunJCEProvider); + + testCleanupSecret(algorithm, keyFac.generateSecret(pbeKeySpec)); + } + + private static void testPBKSecret(String algorithm) throws Exception { + byte[] salt = new byte[8]; + new Random().nextBytes(salt); + char[] password = new char[] {'f', 'o', 'o'}; + PBEKeySpec pbeKeySpec = new PBEKeySpec(PASS_PHRASE.toCharArray(), salt, + ITERATION_COUNT, KEY_SIZE); + SecretKeyFactory keyFac = + SecretKeyFactory.getInstance(algorithm, SunJCEProvider); + + testCleanupSecret(algorithm, keyFac.generateSecret(pbeKeySpec)); + } + + static void testCleanupSecret(String algorithm, SecretKey key) throws Exception { + + // Break into the implementation to observe the key byte array. + Class keyClass = key.getClass(); + Field keyField = keyClass.getDeclaredField("key"); + keyField.setAccessible(true); + byte[] array = (byte[])keyField.get(key); + + byte[] zeros = new byte[array.length]; + do { + // Wait for array to be cleared; if not cleared test will timeout + System.out.printf("%s array: %s%n", algorithm, Arrays.toString(array)); + key = null; + System.gc(); // attempt to reclaim the key + } while (Arrays.compare(zeros, array) != 0); + System.out.printf("%s array: %s%n", algorithm, Arrays.toString(array)); + + Reference.reachabilityFence(key); // Keep key alive + Reference.reachabilityFence(array); // Keep array alive + } +} + + + From cd6621765c3ad3e9baedf6466af3966cf317d8e3 Mon Sep 17 00:00:00 2001 From: "J. Duke" Date: Thu, 24 Aug 2017 16:34:07 +0200 Subject: [PATCH 14/26] Added tag jdk-10+18 for changeset 373965429061 --- .hgtags | 1 + 1 file changed, 1 insertion(+) diff --git a/.hgtags b/.hgtags index 2336f25130c..7f312ff4fc2 100644 --- a/.hgtags +++ b/.hgtags @@ -441,3 +441,4 @@ e6d70017f5b9adbb2ec82d826973d0251800a3c3 jdk-10+12 878e216039322cb3f0ecbd0944642a2b4e2593f3 jdk-10+15 4bbea012e5676e8025ade2bcfab4d6581e6e9f4b jdk-10+16 7db699468b4f84abbcc01647e5a964409737411a jdk-10+17 +3739654290616e533fc6f51bf9ad69ed47a6abba jdk-10+18 From 36378834a9ffa98066a4d7b6097e7adcdb8fc6b7 Mon Sep 17 00:00:00 2001 From: Daniel Fuchs Date: Tue, 8 Aug 2017 12:32:41 +0100 Subject: [PATCH 15/26] 8185852: HttpConnection should resolve addresses before SocketChannel.connect() is called HttpConnection checks whether the proxy address is resolved and if not attempts to resolve it before creating the underlying connection that connects to the proxy. Reviewed-by: chegar --- .../jdk/incubator/http/HttpConnection.java | 6 + jdk/test/java/net/httpclient/ProxyTest.java | 346 ++++++++++++++++++ 2 files changed, 352 insertions(+) create mode 100644 jdk/test/java/net/httpclient/ProxyTest.java diff --git a/jdk/src/jdk.incubator.httpclient/share/classes/jdk/incubator/http/HttpConnection.java b/jdk/src/jdk.incubator.httpclient/share/classes/jdk/incubator/http/HttpConnection.java index 96bd67f969e..a520390ba2d 100644 --- a/jdk/src/jdk.incubator.httpclient/share/classes/jdk/incubator/http/HttpConnection.java +++ b/jdk/src/jdk.incubator.httpclient/share/classes/jdk/incubator/http/HttpConnection.java @@ -154,6 +154,12 @@ abstract class HttpConnection implements Closeable { { HttpConnection c = null; InetSocketAddress proxy = request.proxy(client); + if (proxy != null && proxy.isUnresolved()) { + // The default proxy selector may select a proxy whose + // address is unresolved. We must resolve the address + // before using it to connect. + proxy = new InetSocketAddress(proxy.getHostString(), proxy.getPort()); + } boolean secure = request.secure(); ConnectionPool pool = client.connectionPool(); String[] alpn = null; diff --git a/jdk/test/java/net/httpclient/ProxyTest.java b/jdk/test/java/net/httpclient/ProxyTest.java new file mode 100644 index 00000000000..8dc90dfb1a1 --- /dev/null +++ b/jdk/test/java/net/httpclient/ProxyTest.java @@ -0,0 +1,346 @@ +/* + * 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. + */ + +import com.sun.net.httpserver.HttpContext; +import com.sun.net.httpserver.HttpExchange; +import com.sun.net.httpserver.HttpHandler; +import com.sun.net.httpserver.HttpServer; +import com.sun.net.httpserver.HttpsConfigurator; +import com.sun.net.httpserver.HttpsParameters; +import com.sun.net.httpserver.HttpsServer; +import java.io.IOException; +import java.io.InputStream; +import java.io.OutputStream; +import java.io.OutputStreamWriter; +import java.io.PrintWriter; +import java.io.Writer; +import java.net.HttpURLConnection; +import java.net.InetAddress; +import java.net.InetSocketAddress; +import java.net.Proxy; +import java.net.ProxySelector; +import java.net.ServerSocket; +import java.net.Socket; +import java.net.URI; +import java.net.URISyntaxException; +import java.nio.charset.StandardCharsets; +import java.security.NoSuchAlgorithmException; +import javax.net.ssl.HostnameVerifier; +import javax.net.ssl.HttpsURLConnection; +import javax.net.ssl.SSLContext; +import javax.net.ssl.SSLSession; +import jdk.incubator.http.HttpClient; +import jdk.incubator.http.HttpRequest; +import jdk.incubator.http.HttpResponse; +import jdk.testlibrary.SimpleSSLContext; + +/** + * @test + * @bug 8185852 + * @summary verifies that passing a proxy with an unresolved address does + * not cause java.nio.channels.UnresolvedAddressException + * @modules jdk.incubator.httpclient + * @library /lib/testlibrary/ + * @build jdk.testlibrary.SimpleSSLContext ProxyTest + * @run main/othervm ProxyTest + * @author danielfuchs + */ +public class ProxyTest { + + static { + try { + HttpsURLConnection.setDefaultHostnameVerifier(new HostnameVerifier() { + public boolean verify(String hostname, SSLSession session) { + return true; + } + }); + SSLContext.setDefault(new SimpleSSLContext().get()); + } catch (IOException ex) { + throw new ExceptionInInitializerError(ex); + } + } + + static final String RESPONSE = "

Hello World!"; + static final String PATH = "/foo/"; + + static HttpServer createHttpsServer() throws IOException, NoSuchAlgorithmException { + HttpsServer server = com.sun.net.httpserver.HttpsServer.create(); + HttpContext context = server.createContext(PATH); + context.setHandler(new HttpHandler() { + @Override + public void handle(HttpExchange he) throws IOException { + he.getResponseHeaders().add("encoding", "UTF-8"); + he.sendResponseHeaders(200, RESPONSE.length()); + he.getResponseBody().write(RESPONSE.getBytes(StandardCharsets.UTF_8)); + he.close(); + } + }); + + server.setHttpsConfigurator(new Configurator(SSLContext.getDefault())); + server.bind(new InetSocketAddress(InetAddress.getLoopbackAddress(), 0), 0); + return server; + } + + public static void main(String[] args) + throws IOException, + URISyntaxException, + NoSuchAlgorithmException, + InterruptedException + { + HttpServer server = createHttpsServer(); + server.start(); + try { + test(server, HttpClient.Version.HTTP_1_1); + // test(server, HttpClient.Version.HTTP_2); + } finally { + server.stop(0); + System.out.println("Server stopped"); + } + } + + public static void test(HttpServer server, HttpClient.Version version) + throws IOException, + URISyntaxException, + NoSuchAlgorithmException, + InterruptedException + { + System.out.println("Server is: " + server.getAddress().toString()); + System.out.println("Verifying communication with server"); + URI uri = new URI("https:/" + server.getAddress().toString() + PATH + "x"); + try (InputStream is = uri.toURL().openConnection().getInputStream()) { + String resp = new String(is.readAllBytes(), StandardCharsets.UTF_8); + System.out.println(resp); + if (!RESPONSE.equals(resp)) { + throw new AssertionError("Unexpected response from server"); + } + } + System.out.println("Communication with server OK"); + + TunnelingProxy proxy = new TunnelingProxy(server); + proxy.start(); + try { + System.out.println("Proxy started"); + Proxy p = new Proxy(Proxy.Type.HTTP, + InetSocketAddress.createUnresolved("localhost", proxy.getAddress().getPort())); + System.out.println("Verifying communication with proxy"); + HttpURLConnection conn = (HttpURLConnection)uri.toURL().openConnection(p); + try (InputStream is = conn.getInputStream()) { + String resp = new String(is.readAllBytes(), StandardCharsets.UTF_8); + System.out.println(resp); + if (!RESPONSE.equals(resp)) { + throw new AssertionError("Unexpected response from proxy"); + } + } + System.out.println("Communication with proxy OK"); + System.out.println("\nReal test begins here."); + System.out.println("Setting up request with HttpClient for version: " + + version.name()); + ProxySelector ps = ProxySelector.of( + InetSocketAddress.createUnresolved("localhost", proxy.getAddress().getPort())); + HttpClient client = HttpClient.newBuilder() + .version(version) + .proxy(ps) + .build(); + HttpRequest request = HttpRequest.newBuilder() + .uri(uri) + .GET() + .build(); + + System.out.println("Sending request with HttpClient"); + HttpResponse response + = client.send(request, HttpResponse.BodyHandler.asString()); + System.out.println("Got response"); + String resp = response.body(); + System.out.println("Received: " + resp); + if (!RESPONSE.equals(resp)) { + throw new AssertionError("Unexpected response"); + } + } finally { + System.out.println("Stopping proxy"); + proxy.stop(); + System.out.println("Proxy stopped"); + } + } + + static class TunnelingProxy { + final Thread accept; + final ServerSocket ss; + final boolean DEBUG = false; + final HttpServer serverImpl; + TunnelingProxy(HttpServer serverImpl) throws IOException { + this.serverImpl = serverImpl; + ss = new ServerSocket(); + accept = new Thread(this::accept); + } + + void start() throws IOException { + ss.bind(new InetSocketAddress(InetAddress.getLoopbackAddress(), 0)); + accept.start(); + } + + // Pipe the input stream to the output stream. + private synchronized Thread pipe(InputStream is, OutputStream os, char tag) { + return new Thread("TunnelPipe("+tag+")") { + @Override + public void run() { + try { + try { + int c; + while ((c = is.read()) != -1) { + os.write(c); + os.flush(); + // if DEBUG prints a + or a - for each transferred + // character. + if (DEBUG) System.out.print(tag); + } + is.close(); + } finally { + os.close(); + } + } catch (IOException ex) { + if (DEBUG) ex.printStackTrace(System.out); + } + } + }; + } + + public InetSocketAddress getAddress() { + return new InetSocketAddress(ss.getInetAddress(), ss.getLocalPort()); + } + + // This is a bit shaky. It doesn't handle continuation + // lines, but our client shouldn't send any. + // Read a line from the input stream, swallowing the final + // \r\n sequence. Stops at the first \n, doesn't complain + // if it wasn't preceded by '\r'. + // + String readLine(InputStream r) throws IOException { + StringBuilder b = new StringBuilder(); + int c; + while ((c = r.read()) != -1) { + if (c == '\n') break; + b.appendCodePoint(c); + } + if (b.codePointAt(b.length() -1) == '\r') { + b.delete(b.length() -1, b.length()); + } + return b.toString(); + } + + public void accept() { + Socket clientConnection = null; + try { + while (true) { + System.out.println("Tunnel: Waiting for client"); + Socket previous = clientConnection; + try { + clientConnection = ss.accept(); + } catch (IOException io) { + if (DEBUG) io.printStackTrace(System.out); + break; + } finally { + // we have only 1 client at a time, so it is safe + // to close the previous connection here + if (previous != null) previous.close(); + } + System.out.println("Tunnel: Client accepted"); + Socket targetConnection = null; + InputStream ccis = clientConnection.getInputStream(); + OutputStream ccos = clientConnection.getOutputStream(); + Writer w = new OutputStreamWriter(ccos, "UTF-8"); + PrintWriter pw = new PrintWriter(w); + System.out.println("Tunnel: Reading request line"); + String requestLine = readLine(ccis); + System.out.println("Tunnel: Request status line: " + requestLine); + if (requestLine.startsWith("CONNECT ")) { + // We should probably check that the next word following + // CONNECT is the host:port of our HTTPS serverImpl. + // Some improvement for a followup! + + // Read all headers until we find the empty line that + // signals the end of all headers. + while(!requestLine.equals("")) { + System.out.println("Tunnel: Reading header: " + + (requestLine = readLine(ccis))); + } + + // Open target connection + targetConnection = new Socket( + serverImpl.getAddress().getAddress(), + serverImpl.getAddress().getPort()); + + // Then send the 200 OK response to the client + System.out.println("Tunnel: Sending " + + "HTTP/1.1 200 OK\r\n\r\n"); + pw.print("HTTP/1.1 200 OK\r\nContent-Length: 0\r\n\r\n"); + pw.flush(); + } else { + // This should not happen. + throw new IOException("Tunnel: Unexpected status line: " + + requestLine); + } + + // Pipe the input stream of the client connection to the + // output stream of the target connection and conversely. + // Now the client and target will just talk to each other. + System.out.println("Tunnel: Starting tunnel pipes"); + Thread t1 = pipe(ccis, targetConnection.getOutputStream(), '+'); + Thread t2 = pipe(targetConnection.getInputStream(), ccos, '-'); + t1.start(); + t2.start(); + + // We have only 1 client... wait until it has finished before + // accepting a new connection request. + // System.out.println("Tunnel: Waiting for pipes to close"); + // t1.join(); + // t2.join(); + System.out.println("Tunnel: Done - waiting for next client"); + } + } catch (Throwable ex) { + try { + ss.close(); + } catch (IOException ex1) { + ex.addSuppressed(ex1); + } + ex.printStackTrace(System.err); + } + } + + void stop() throws IOException { + ss.close(); + } + + } + + static class Configurator extends HttpsConfigurator { + public Configurator(SSLContext ctx) { + super(ctx); + } + + @Override + public void configure (HttpsParameters params) { + params.setSSLParameters (getSSLContext().getSupportedSSLParameters()); + } + } + +} From 43ead07d44b05a199ed455cc83a36a8b1f33af27 Mon Sep 17 00:00:00 2001 From: Weijun Wang Date: Tue, 8 Aug 2017 21:37:38 +0800 Subject: [PATCH 16/26] 8185934: keytool shows "Signature algorithm: SHA1withECDSA, -1-bit key" Reviewed-by: mullan --- .../share/classes/sun/security/tools/keytool/Main.java | 10 ++++++++-- .../classes/sun/security/tools/keytool/Resources.java | 1 + .../classes/sun/security/tools/jarsigner/Main.java | 8 ++++++-- .../sun/security/tools/jarsigner/Resources.java | 1 + 4 files changed, 16 insertions(+), 4 deletions(-) diff --git a/jdk/src/java.base/share/classes/sun/security/tools/keytool/Main.java b/jdk/src/java.base/share/classes/sun/security/tools/keytool/Main.java index ec5e59c07fc..dac650b1451 100644 --- a/jdk/src/java.base/share/classes/sun/security/tools/keytool/Main.java +++ b/jdk/src/java.base/share/classes/sun/security/tools/keytool/Main.java @@ -3071,8 +3071,14 @@ public final class Main { private String withWeak(PublicKey key) { if (DISABLED_CHECK.permits(SIG_PRIMITIVE_SET, key)) { - return String.format(rb.getString("key.bit"), - KeyUtil.getKeySize(key), key.getAlgorithm()); + int kLen = KeyUtil.getKeySize(key); + if (kLen >= 0) { + return String.format(rb.getString("key.bit"), + kLen, key.getAlgorithm()); + } else { + return String.format( + rb.getString("unknown.size.1"), key.getAlgorithm()); + } } else { return String.format(rb.getString("key.bit.weak"), KeyUtil.getKeySize(key), key.getAlgorithm()); diff --git a/jdk/src/java.base/share/classes/sun/security/tools/keytool/Resources.java b/jdk/src/java.base/share/classes/sun/security/tools/keytool/Resources.java index a78eb6bc3e6..9bdd95cbda0 100644 --- a/jdk/src/java.base/share/classes/sun/security/tools/keytool/Resources.java +++ b/jdk/src/java.base/share/classes/sun/security/tools/keytool/Resources.java @@ -462,6 +462,7 @@ public class Resources extends java.util.ListResourceBundle { {"with.weak", "%s (weak)"}, {"key.bit", "%d-bit %s key"}, {"key.bit.weak", "%d-bit %s key (weak)"}, + {"unknown.size.1", "unknown size %s key"}, {".PATTERN.printX509Cert.with.weak", "Owner: {0}\nIssuer: {1}\nSerial number: {2}\nValid from: {3} until: {4}\nCertificate fingerprints:\n\t SHA1: {5}\n\t SHA256: {6}\nSignature algorithm name: {7}\nSubject Public Key Algorithm: {8}\nVersion: {9}"}, {"PKCS.10.with.weak", diff --git a/jdk/src/jdk.jartool/share/classes/sun/security/tools/jarsigner/Main.java b/jdk/src/jdk.jartool/share/classes/sun/security/tools/jarsigner/Main.java index cb86682f7da..12d4e1ba380 100644 --- a/jdk/src/jdk.jartool/share/classes/sun/security/tools/jarsigner/Main.java +++ b/jdk/src/jdk.jartool/share/classes/sun/security/tools/jarsigner/Main.java @@ -1088,8 +1088,12 @@ public class Main { private String withWeak(PublicKey key) { if (DISABLED_CHECK.permits(SIG_PRIMITIVE_SET, key)) { - return String.format( - rb.getString("key.bit"), KeyUtil.getKeySize(key)); + int kLen = KeyUtil.getKeySize(key); + if (kLen >= 0) { + return String.format(rb.getString("key.bit"), kLen); + } else { + return rb.getString("unknown.size"); + } } else { seeWeak = true; return String.format( diff --git a/jdk/src/jdk.jartool/share/classes/sun/security/tools/jarsigner/Resources.java b/jdk/src/jdk.jartool/share/classes/sun/security/tools/jarsigner/Resources.java index 26e0553ebb2..ebdd79d792e 100644 --- a/jdk/src/jdk.jartool/share/classes/sun/security/tools/jarsigner/Resources.java +++ b/jdk/src/jdk.jartool/share/classes/sun/security/tools/jarsigner/Resources.java @@ -164,6 +164,7 @@ public class Resources extends java.util.ListResourceBundle { {"with.weak", "%s (weak)"}, {"key.bit", "%d-bit key"}, {"key.bit.weak", "%d-bit key (weak)"}, + {"unknown.size", "unknown size"}, {"jarsigner.", "jarsigner: "}, {"signature.filename.must.consist.of.the.following.characters.A.Z.0.9.or.", From 74419eb34a83fe6502f0ba360b3d9821bfbe9e8e Mon Sep 17 00:00:00 2001 From: Jonathan Gibbons Date: Tue, 8 Aug 2017 12:01:02 -0700 Subject: [PATCH 17/26] 8185867: fix a11y and html issues in jdk.jdi docs Reviewed-by: alanb --- .../com/sun/jdi/InvalidModuleException.java | 1 - .../classes/com/sun/jdi/JDIPermission.java | 14 +- .../share/classes/com/sun/jdi/Type.java | 109 +++++----- .../share/classes/com/sun/jdi/Value.java | 201 ++++++++++-------- .../com/sun/jdi/VirtualMachineManager.java | 17 +- .../com/sun/jdi/doc-files/signature.html | 38 ++-- 6 files changed, 207 insertions(+), 173 deletions(-) diff --git a/jdk/src/jdk.jdi/share/classes/com/sun/jdi/InvalidModuleException.java b/jdk/src/jdk.jdi/share/classes/com/sun/jdi/InvalidModuleException.java index 5351594c952..422a7cbfce8 100644 --- a/jdk/src/jdk.jdi/share/classes/com/sun/jdi/InvalidModuleException.java +++ b/jdk/src/jdk.jdi/share/classes/com/sun/jdi/InvalidModuleException.java @@ -28,7 +28,6 @@ package com.sun.jdi; /** * Thrown to indicate that the requested module is invalid * or became invalid after the module was unloaded. - *

* * @since 9 */ diff --git a/jdk/src/jdk.jdi/share/classes/com/sun/jdi/JDIPermission.java b/jdk/src/jdk.jdi/share/classes/com/sun/jdi/JDIPermission.java index 8f9b4da9980..2c80497d3f1 100644 --- a/jdk/src/jdk.jdi/share/classes/com/sun/jdi/JDIPermission.java +++ b/jdk/src/jdk.jdi/share/classes/com/sun/jdi/JDIPermission.java @@ -40,17 +40,20 @@ package com.sun.jdi; * permission allows, and discusses the risks of granting code the * permission. * - * + *
* + * * - * - * - * + * + * + * * + * * + * * - * + * * @@ -59,6 +62,7 @@ package com.sun.jdi; * misbehave. * * + * * *
Table shows permission target name, what the * permission allows, and associated risks
Permission Target NameWhat the Permission AllowsRisks of Allowing this PermissionPermission Target NameWhat the Permission AllowsRisks of Allowing this Permission
virtualMachineManagervirtualMachineManagerAbility to inspect and modify the JDI objects in the * {@code VirtualMachineManager} *
* diff --git a/jdk/src/jdk.jdi/share/classes/com/sun/jdi/Type.java b/jdk/src/jdk.jdi/share/classes/com/sun/jdi/Type.java index 50ad02747e8..0eb7eae3e0e 100644 --- a/jdk/src/jdk.jdi/share/classes/com/sun/jdi/Type.java +++ b/jdk/src/jdk.jdi/share/classes/com/sun/jdi/Type.java @@ -43,79 +43,86 @@ package com.sun.jdi; * {@link ArrayType#componentType()} * *

- * The following table illustrates which subinterfaces of Type + * The following tables illustrate which subinterfaces of Type * are used to mirror types in the target VM -- - * - * - * - * - * - * - * + *
Maps each type declared in target to a mirrored - * instance of a subinterface of PrimitiveType or ReferenceType"
Subinterfaces of {@link PrimitiveType}
Type declared in target asIs mirrored as an instance of
+ * + * * - * - * + * + * + * + * * - * - * + * + * * - * - * + * + * * - * - * + * + * * - * - * + * + * * - * - * + * + * * - * - * + * + * * - * - * + * + * * - * - * - * - * - * - * - * - * + * + * * - * - * - * + * + * + * + *
Subinterfaces of {@link PrimitiveType}
boolean {@link BooleanType}Type declared in target asIs mirrored as an instance of
byte{@link ByteType}boolean {@link BooleanType}
char{@link CharType}byte{@link ByteType}
double{@link DoubleType}char{@link CharType}
float{@link FloatType}double{@link DoubleType}
int{@link IntegerType}float{@link FloatType}
long{@link LongType}int{@link IntegerType}
short{@link ShortType}long{@link LongType}
void{@link VoidType}
Subinterfaces of {@link ReferenceType}
Type declared in target asFor exampleIs mirrored as an instance ofshort{@link ShortType}
a classDate{@link ClassType}void{@link VoidType}
+ * + * + * + * * - * - * - * + * + * + * + * + * * - * - * - * + * + * + * * - * - * - * + * + * + * + * + * + * + * + * + * + * * - * - * - * + * * - * - * - * + * + * *
Subinterfaces of {@link ReferenceType}
an interfaceRunnable{@link InterfaceType}Type declared in target asFor exampleIs mirrored as an instance of
an array {@link ArrayType}a classDate{@link ClassType}
an arrayint[]{@link ArrayType} whose + * an interfaceRunnable{@link InterfaceType}
an array(any){@link ArrayType}
int[]{@link ArrayType} whose * {@link ArrayType#componentType() componentType()} is * {@link IntegerType}
an arrayDate[]{@link ArrayType} whose + * + * Date[]{@link ArrayType} whose * {@link ArrayType#componentType() componentType()} is * {@link ClassType}
an arrayRunnable[]{@link ArrayType} whose + * + * Runnable[]{@link ArrayType} whose * {@link ArrayType#componentType() componentType()} is * {@link InterfaceType}
* * @see PrimitiveType Subinterface PrimitiveType diff --git a/jdk/src/jdk.jdi/share/classes/com/sun/jdi/Value.java b/jdk/src/jdk.jdi/share/classes/com/sun/jdi/Value.java index 99568fe60bc..42afbc2bfdf 100644 --- a/jdk/src/jdk.jdi/share/classes/com/sun/jdi/Value.java +++ b/jdk/src/jdk.jdi/share/classes/com/sun/jdi/Value.java @@ -33,7 +33,7 @@ import com.sun.jdi.event.ModificationWatchpointEvent; * value hierarchy encompassing primitive values and object values. *

* Some examples of where values may be accessed: - *

+ *
layout
* *
{@link ObjectReference#getValue(Field) * ObjectReference.getValue(Field)} @@ -52,117 +52,130 @@ import com.sun.jdi.event.ModificationWatchpointEvent; * - returned with an event *
*

- * The following table illustrates which subinterfaces of Value + * The following tables illustrate which subinterfaces of Value * are used to mirror values in the target VM -- - * - * - * - * - * - * - * - * - * + *
Maps each kind of value to a mirrored - * instance of a subinterface of Value
Subinterfaces of {@link PrimitiveValue}
Kind of valueFor example -
expression in target
Is mirrored as an
instance of
{@link Type} of value
{@link #type() Value.type()}
+ * + * * - * - * - * - * + * + * + * + * + * + * * - * - * - * - * + * + * + * + * * - * - * - * - * + * + * + * + * * - * - * - * - * + * + * + * + * * - * - * - * - * + * + * + * + * * - * - * - * - * + * + * + * + * * - * - * - * - * + * + * + * + * * - * - * - * - * + * + * + * + * * - * - * - * - * - * - * - * - * - * - * - * + * + * + * + * * - * - * - * - * + * + * + * + * + * + *
Subinterfaces of {@link PrimitiveValue}
a boolean {@code true} {@link BooleanValue} {@link BooleanType}Kind of valueFor example -
expression in target
Is mirrored as an
instance of
{@link Type} of value
{@link #type() Value.type()}
a byte {@code (byte)4} {@link ByteValue} {@link ByteType}a boolean{@code true}{@link BooleanValue}{@link BooleanType}
a char {@code 'a'} {@link CharValue} {@link CharType}a byte{@code (byte)4}{@link ByteValue}{@link ByteType}
a double {@code 3.1415926} {@link DoubleValue} {@link DoubleType}a char{@code 'a'}{@link CharValue}{@link CharType}
a float {@code 2.5f} {@link FloatValue} {@link FloatType}a double{@code 3.1415926}{@link DoubleValue}{@link DoubleType}
an int {@code 22} {@link IntegerValue} {@link IntegerType}a float{@code 2.5f}{@link FloatValue}{@link FloatType}
a long {@code 1024L} {@link LongValue} {@link LongType}an int{@code 22}{@link IntegerValue}{@link IntegerType}
a short {@code (short)12} {@link ShortValue} {@link ShortType}a long{@code 1024L}{@link LongValue}{@link LongType}
a void {@link VoidValue} {@link VoidType}
Subinterfaces of {@link ObjectReference}
Kind of valueFor example -
expression in target
Is mirrored as an
instance of
{@link Type} of value
{@link #type() Value.type()}
a short{@code (short)12}{@link ShortValue}{@link ShortType}
a class instance {@code this} {@link ObjectReference} {@link ClassType}a void{@link VoidValue}{@link VoidType}
+ * + * + * + * * - * - * - * - * + * + * + * + * + * + * * - * - * - * - * + * + * + * + * * - * - * - * - * + * + * + * + * * - * - * - * - * + * + * + * + * * - * - * - * - * + * + * + * + * * - * - * - * - * - * - * - * - * - * - * - * + * + * + * + * * - * - * - * - * + * + * + * + * + * + * + * + * + * + * + *
Subinterfaces of {@link ObjectReference}
an array {@code new int[5]} {@link ArrayReference} {@link ArrayType}Kind of valueFor example -
expression in target
Is mirrored as an
instance of
{@link Type} of value
{@link #type() Value.type()}
a string {@code "hello"} {@link StringReference} {@link ClassType}a class instance{@code this}{@link ObjectReference}{@link ClassType}
a thread {@code Thread.currentThread()} {@link ThreadReference} {@link ClassType}an array{@code new int[5]}{@link ArrayReference}{@link ArrayType}
a thread group {@code Thread.currentThread()}
  {@code .getThreadGroup()}
{@link ThreadGroupReference} {@link ClassType}a string{@code "hello"}{@link StringReference}{@link ClassType}
a {@code java.lang.Class}
instance
{@code this.getClass()} {@link ClassObjectReference} {@link ClassType}a thread{@code Thread.currentThread()}{@link ThreadReference}{@link ClassType}
a class loader {@code this.getClass()}
  {@code .getClassLoader()}
{@link ClassLoaderReference} {@link ClassType}
Other
Kind of valueFor example -
expression in target
Is mirrored as{@link Type} of valuea thread group{@code Thread.currentThread()}
  {@code .getThreadGroup()}
{@link ThreadGroupReference}{@link ClassType}
null {@code null} {@code null} n/aa {@code java.lang.Class}
instance
{@code this.getClass()}{@link ClassObjectReference}{@link ClassType}
a class loader{@code this.getClass()}
  {@code .getClassLoader()}
{@link ClassLoaderReference}{@link ClassType}
+ * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * *
Other values
Kind of valueFor example -
expression in target
Is mirrored as{@link Type} of value
null{@code null}{@code null}n/a
* * @author Robert Field diff --git a/jdk/src/jdk.jdi/share/classes/com/sun/jdi/VirtualMachineManager.java b/jdk/src/jdk.jdi/share/classes/com/sun/jdi/VirtualMachineManager.java index ae3c5ffd016..2431f6c02ed 100644 --- a/jdk/src/jdk.jdi/share/classes/com/sun/jdi/VirtualMachineManager.java +++ b/jdk/src/jdk.jdi/share/classes/com/sun/jdi/VirtualMachineManager.java @@ -59,13 +59,16 @@ import com.sun.jdi.event.VMStartEvent; * Some {@link Connector} implementations may require slightly * different handling than presented below. * - * + *
* + * * - * - * + * + * + * + * * - * + * * * * * - * + * * * * - * + * * * * - * + * * + *
Four scenarios for connecting a debugger to a virtual machine"
ScenarioDescriptionScenarioDescription
Debugger launches target VM (simplest, most-common scenario)Debugger launches target VM (simplest, most-common scenario)Debugger calls the {@link LaunchingConnector#launch(java.util.Map)} * method of the default connector, obtained with {@link #defaultConnector}. The @@ -86,7 +89,7 @@ import com.sun.jdi.event.VMStartEvent; *
Debugger attaches to previously-running VMDebugger attaches to previously-running VM *
    *
  • @@ -113,7 +116,7 @@ import com.sun.jdi.event.VMStartEvent; *
Target VM attaches to previously-running debuggerTarget VM attaches to previously-running debugger *
    *
  • @@ -146,7 +149,7 @@ import com.sun.jdi.event.VMStartEvent; *
Target VM launches debugger (sometimes called "Just-In-Time" debugging)Target VM launches debugger (sometimes called "Just-In-Time" debugging) *
    *
  • diff --git a/jdk/src/jdk.jdi/share/classes/com/sun/jdi/doc-files/signature.html b/jdk/src/jdk.jdi/share/classes/com/sun/jdi/doc-files/signature.html index 75bb46c1c32..8c7d4f95398 100644 --- a/jdk/src/jdk.jdi/share/classes/com/sun/jdi/doc-files/signature.html +++ b/jdk/src/jdk.jdi/share/classes/com/sun/jdi/doc-files/signature.html @@ -1,34 +1,42 @@ - + JDI Type Signatures + +
    - - + + + +
    JDI Type Signatures
    Type Signature -Java Type -
    Zboolean -
    Bbyte -
    Cchar -
    Sshort -
    Iint -
    Jlong -
    Ffloat -
    Ddouble -
    L fully-qualified-class +
    JDI Type Signatures
    Type Signature +Java Type +
    Zboolean +
    Bbyte +
    Cchar +
    Sshort +
    Iint +
    Jlong +
    Ffloat +
    Ddouble +
    L fully-qualified-class ; fully-qualified-class -
    [ type +
    [ type type[] -
    +
    ( arg-types ) ret-type method type (including constructors) +

    For example, the Java method: From 7be03f32008a9fa56fe907c42451e408d9c8dd08 Mon Sep 17 00:00:00 2001 From: Abhijit Saha Date: Tue, 8 Aug 2017 22:11:12 +0000 Subject: [PATCH 18/26] Added tag jdk-10+19 for changeset 22316369c9b0 --- jdk/.hgtags | 1 + 1 file changed, 1 insertion(+) diff --git a/jdk/.hgtags b/jdk/.hgtags index 012f8dd2e2a..23d7344f3c1 100644 --- a/jdk/.hgtags +++ b/jdk/.hgtags @@ -441,3 +441,4 @@ e069834e2c518a7bc2ffadc8c7e3cd7ec69fa8a0 jdk-10+15 06df1ce4b9b887d05ce6a13f4def3547e434dd1a jdk-9+179 d93f2fd542b7d7855c2cd49ae15ebcc3d441a83b jdk-10+17 c4b709bad6c5d29294124de5e74e1e2ac84fcf1f jdk-10+18 +b561eeca30decc6258b4aca8bb23beffbb6e2f7d jdk-10+19 From 880c64b6af69125d9a048354b34756a030c3c0d8 Mon Sep 17 00:00:00 2001 From: Jonathan Gibbons Date: Wed, 9 Aug 2017 15:39:50 -0700 Subject: [PATCH 19/26] 8185984: fix a11y and html issues in java.logging module Reviewed-by: dfuchs, mchung --- .../classes/java/util/logging/LogManager.java | 21 ++++++++++++------- .../classes/java/util/logging/Logger.java | 6 +++--- .../java/util/logging/SimpleFormatter.java | 2 +- 3 files changed, 17 insertions(+), 12 deletions(-) diff --git a/jdk/src/java.logging/share/classes/java/util/logging/LogManager.java b/jdk/src/java.logging/share/classes/java/util/logging/LogManager.java index 74bda0a928f..31c5e74c624 100644 --- a/jdk/src/java.logging/share/classes/java/util/logging/LogManager.java +++ b/jdk/src/java.logging/share/classes/java/util/logging/LogManager.java @@ -1887,13 +1887,17 @@ public class LogManager { * The registered {@linkplain #addConfigurationListener configuration * listeners} will be invoked after the configuration is successfully updated. *

    - * + *
    Updating configuration properties
    + * + * * - * - * + * + * * + * + * * - * + * * * - * + * * * * - * + * * * * - * + * * * * - * + * * * + * *
    Updating configuration properties
    PropertyResulting BehaviorPropertyResulting Behavior
    {@code .level}{@code .level} *
      *
    • If the resulting configuration defines a level for a logger and @@ -1914,7 +1918,7 @@ public class LogManager { *
    *
    {@code .useParentHandlers}{@code .useParentHandlers} *
      *
    • If either the resulting or the old value for the useParentHandlers @@ -1928,7 +1932,7 @@ public class LogManager { *
    {@code .handlers}{@code .handlers} *
      *
    • If the resulting configuration defines a list of handlers for a @@ -1952,7 +1956,7 @@ public class LogManager { *
    {@code .*}{@code .*} *
      *
    • Properties configured/changed on handler classes will only affect @@ -1964,7 +1968,7 @@ public class LogManager { *
    {@code config} and any other property{@code config} and any other property *
      *
    • The resulting value for these property will be stored in the @@ -1974,6 +1978,7 @@ public class LogManager { *
    *
    *

    * Example mapper functions: diff --git a/jdk/src/java.logging/share/classes/java/util/logging/Logger.java b/jdk/src/java.logging/share/classes/java/util/logging/Logger.java index dea269302d2..6a1d4b5bc30 100644 --- a/jdk/src/java.logging/share/classes/java/util/logging/Logger.java +++ b/jdk/src/java.logging/share/classes/java/util/logging/Logger.java @@ -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 @@ -1497,7 +1497,7 @@ public class Logger { * The {@code msg} string is localized using the given resource bundle. * If the resource bundle is {@code null}, then the {@code msg} string is not * localized. - *

    + * * @param level One of the message level identifiers, e.g., {@code SEVERE} * @param bundle Resource bundle to localize {@code msg}; * can be {@code null}. @@ -1614,7 +1614,7 @@ public class Logger { * processed specially by output {@code Formatter} objects and is not treated * as a formatting parameter to the {@code LogRecord} {@code message} * property. - *

    + * * @param level One of the message level identifiers, e.g., {@code SEVERE} * @param bundle Resource bundle to localize {@code msg}; * can be {@code null}. diff --git a/jdk/src/java.logging/share/classes/java/util/logging/SimpleFormatter.java b/jdk/src/java.logging/share/classes/java/util/logging/SimpleFormatter.java index fe81640654b..2324940502e 100644 --- a/jdk/src/java.logging/share/classes/java/util/logging/SimpleFormatter.java +++ b/jdk/src/java.logging/share/classes/java/util/logging/SimpleFormatter.java @@ -41,7 +41,7 @@ import jdk.internal.logger.SurrogateLogger; * The {@code SimpleFormatter} is initialized with the * format string * specified in the {@code java.util.logging.SimpleFormatter.format} - * property to {@linkplain #format format} the log messages. + * property to {@linkplain #format(LogRecord) format} the log messages. * This property can be defined * in the {@linkplain LogManager#getProperty logging properties} * configuration file From 9f28d43df598d07815a3b78a192a203607733168 Mon Sep 17 00:00:00 2001 From: Doug Lea Date: Wed, 9 Aug 2017 17:30:51 -0700 Subject: [PATCH 20/26] 8185830: ConcurrentSkipListSet.clone() fails with UnsupportedOperationException Reviewed-by: martin, psandoz, plevart --- .../concurrent/ConcurrentSkipListSet.java | 27 ++++++++++--------- .../tck/ConcurrentSkipListSetTest.java | 20 +++++++++++++- 2 files changed, 33 insertions(+), 14 deletions(-) diff --git a/jdk/src/java.base/share/classes/java/util/concurrent/ConcurrentSkipListSet.java b/jdk/src/java.base/share/classes/java/util/concurrent/ConcurrentSkipListSet.java index 8149d0877dd..82e4b987781 100644 --- a/jdk/src/java.base/share/classes/java/util/concurrent/ConcurrentSkipListSet.java +++ b/jdk/src/java.base/share/classes/java/util/concurrent/ConcurrentSkipListSet.java @@ -35,8 +35,7 @@ package java.util.concurrent; -import java.lang.invoke.MethodHandles; -import java.lang.invoke.VarHandle; +import java.lang.reflect.Field; import java.util.AbstractSet; import java.util.Collection; import java.util.Collections; @@ -506,19 +505,21 @@ public class ConcurrentSkipListSet : ((ConcurrentSkipListMap.SubMap)m).new SubMapKeyIterator(); } - // Support for resetting map in clone + /** Initializes map field; for use in clone. */ private void setMap(ConcurrentNavigableMap map) { - MAP.setVolatile(this, map); - } - - // VarHandle mechanics - private static final VarHandle MAP; - static { + Field mapField = java.security.AccessController.doPrivileged( + (java.security.PrivilegedAction) () -> { + try { + Field f = ConcurrentSkipListSet.class + .getDeclaredField("m"); + f.setAccessible(true); + return f; + } catch (ReflectiveOperationException e) { + throw new Error(e); + }}); try { - MethodHandles.Lookup l = MethodHandles.lookup(); - MAP = l.findVarHandle(ConcurrentSkipListSet.class, "m", - ConcurrentNavigableMap.class); - } catch (ReflectiveOperationException e) { + mapField.set(this, map); + } catch (IllegalAccessException e) { throw new Error(e); } } diff --git a/jdk/test/java/util/concurrent/tck/ConcurrentSkipListSetTest.java b/jdk/test/java/util/concurrent/tck/ConcurrentSkipListSetTest.java index cb28b6ae0e7..97331e63501 100644 --- a/jdk/test/java/util/concurrent/tck/ConcurrentSkipListSetTest.java +++ b/jdk/test/java/util/concurrent/tck/ConcurrentSkipListSetTest.java @@ -553,7 +553,25 @@ public class ConcurrentSkipListSetTest extends JSR166TestCase { } /** - * A deserialized serialized set has same elements + * A cloned set equals original + */ + public void testClone() { + ConcurrentSkipListSet x = populatedSet(SIZE); + ConcurrentSkipListSet y = x.clone(); + + assertNotSame(x, y); + assertEquals(x.size(), y.size()); + assertEquals(x, y); + assertEquals(y, x); + while (!x.isEmpty()) { + assertFalse(y.isEmpty()); + assertEquals(x.pollFirst(), y.pollFirst()); + } + assertTrue(y.isEmpty()); + } + + /** + * A deserialized/reserialized set equals original */ public void testSerialization() throws Exception { NavigableSet x = populatedSet(SIZE); From 2f31db126d5500e17ff2d79facb701ba5541e2ed Mon Sep 17 00:00:00 2001 From: Doug Lea Date: Wed, 9 Aug 2017 17:40:38 -0700 Subject: [PATCH 21/26] 8185099: Miscellaneous changes imported from jsr166 CVS 2017-08 Reviewed-by: martin, psandoz --- .../classes/java/util/concurrent/Flow.java | 4 +- .../util/concurrent/ThreadPoolExecutor.java | 8 ++-- .../tck/ArrayBlockingQueueTest.java | 2 +- .../util/concurrent/tck/ArrayDequeTest.java | 2 +- .../util/concurrent/tck/ArrayListTest.java | 24 ++++++++++ .../concurrent/tck/AtomicBooleanTest.java | 2 +- .../tck/AtomicIntegerArrayTest.java | 2 +- .../concurrent/tck/AtomicIntegerTest.java | 2 +- .../concurrent/tck/AtomicLongArrayTest.java | 2 +- .../util/concurrent/tck/AtomicLongTest.java | 2 +- .../tck/AtomicReferenceArrayTest.java | 2 +- .../concurrent/tck/AtomicReferenceTest.java | 2 +- .../tck/ConcurrentHashMap8Test.java | 2 +- .../concurrent/tck/ConcurrentHashMapTest.java | 2 +- .../tck/ConcurrentLinkedDequeTest.java | 2 +- .../tck/ConcurrentLinkedQueueTest.java | 2 +- .../tck/ConcurrentSkipListMapTest.java | 22 ++++++++- .../tck/ConcurrentSkipListSubMapTest.java | 4 +- .../tck/ConcurrentSkipListSubSetTest.java | 4 +- .../tck/CopyOnWriteArrayListTest.java | 2 +- .../tck/CopyOnWriteArraySetTest.java | 2 +- .../util/concurrent/tck/DoubleAdderTest.java | 2 +- .../util/concurrent/tck/JSR166TestCase.java | 47 ------------------- .../tck/LinkedBlockingDequeTest.java | 2 +- .../tck/LinkedBlockingQueueTest.java | 2 +- .../tck/LinkedTransferQueueTest.java | 2 +- .../util/concurrent/tck/LongAdderTest.java | 2 +- .../tck/PriorityBlockingQueueTest.java | 2 +- .../concurrent/tck/PriorityQueueTest.java | 2 +- .../concurrent/tck/SynchronousQueueTest.java | 2 +- .../tck/ThreadLocalRandom8Test.java | 4 +- .../tck/ThreadPoolExecutorSubclassTest.java | 4 +- .../util/concurrent/tck/TimeUnitTest.java | 2 +- .../java/util/concurrent/tck/TreeMapTest.java | 2 +- .../java/util/concurrent/tck/TreeSetTest.java | 2 +- .../util/concurrent/tck/TreeSubMapTest.java | 4 +- .../util/concurrent/tck/TreeSubSetTest.java | 4 +- 37 files changed, 89 insertions(+), 92 deletions(-) diff --git a/jdk/src/java.base/share/classes/java/util/concurrent/Flow.java b/jdk/src/java.base/share/classes/java/util/concurrent/Flow.java index 65e994350ce..1aefaea43b0 100644 --- a/jdk/src/java.base/share/classes/java/util/concurrent/Flow.java +++ b/jdk/src/java.base/share/classes/java/util/concurrent/Flow.java @@ -85,9 +85,9 @@ package java.util.concurrent; * this.executor = executor; * } * public synchronized void request(long n) { - * if (n != 0 && !completed) { + * if (!completed) { * completed = true; - * if (n < 0) { + * if (n <= 0) { * IllegalArgumentException ex = new IllegalArgumentException(); * executor.execute(() -> subscriber.onError(ex)); * } else { diff --git a/jdk/src/java.base/share/classes/java/util/concurrent/ThreadPoolExecutor.java b/jdk/src/java.base/share/classes/java/util/concurrent/ThreadPoolExecutor.java index 1b3b866b25c..21221005f52 100644 --- a/jdk/src/java.base/share/classes/java/util/concurrent/ThreadPoolExecutor.java +++ b/jdk/src/java.base/share/classes/java/util/concurrent/ThreadPoolExecutor.java @@ -576,7 +576,7 @@ public class ThreadPoolExecutor extends AbstractExecutorService { private static final RuntimePermission shutdownPerm = new RuntimePermission("modifyThread"); - /* The context to be used when executing the finalizer, or null. */ + /** The context to be used when executing the finalizer, or null. */ private final AccessControlContext acc; /** @@ -1314,9 +1314,9 @@ public class ThreadPoolExecutor extends AbstractExecutorService { throw new IllegalArgumentException(); if (workQueue == null || threadFactory == null || handler == null) throw new NullPointerException(); - this.acc = System.getSecurityManager() == null ? - null : - AccessController.getContext(); + this.acc = (System.getSecurityManager() == null) + ? null + : AccessController.getContext(); this.corePoolSize = corePoolSize; this.maximumPoolSize = maximumPoolSize; this.workQueue = workQueue; diff --git a/jdk/test/java/util/concurrent/tck/ArrayBlockingQueueTest.java b/jdk/test/java/util/concurrent/tck/ArrayBlockingQueueTest.java index 589037bd511..a2744c2646f 100644 --- a/jdk/test/java/util/concurrent/tck/ArrayBlockingQueueTest.java +++ b/jdk/test/java/util/concurrent/tck/ArrayBlockingQueueTest.java @@ -903,7 +903,7 @@ public class ArrayBlockingQueueTest extends JSR166TestCase { } /** - * A deserialized serialized queue has same elements in same order + * A deserialized/reserialized queue has same elements in same order */ public void testSerialization() throws Exception { Queue x = populatedQueue(SIZE); diff --git a/jdk/test/java/util/concurrent/tck/ArrayDequeTest.java b/jdk/test/java/util/concurrent/tck/ArrayDequeTest.java index 344b63c9b79..4ea7ee7a475 100644 --- a/jdk/test/java/util/concurrent/tck/ArrayDequeTest.java +++ b/jdk/test/java/util/concurrent/tck/ArrayDequeTest.java @@ -939,7 +939,7 @@ public class ArrayDequeTest extends JSR166TestCase { } /** - * A deserialized serialized deque has same elements in same order + * A deserialized/reserialized deque has same elements in same order */ public void testSerialization() throws Exception { Queue x = populatedDeque(SIZE); diff --git a/jdk/test/java/util/concurrent/tck/ArrayListTest.java b/jdk/test/java/util/concurrent/tck/ArrayListTest.java index 535f04d34b5..203c04c6ea9 100644 --- a/jdk/test/java/util/concurrent/tck/ArrayListTest.java +++ b/jdk/test/java/util/concurrent/tck/ArrayListTest.java @@ -33,6 +33,7 @@ */ import java.util.ArrayList; +import java.util.Arrays; import java.util.List; import junit.framework.Test; @@ -61,4 +62,27 @@ public class ArrayListTest extends JSR166TestCase { CollectionTest.testSuite(new SubListImplementation())); } + /** + * A cloned list equals original + */ + public void testClone() throws Exception { + ArrayList x = new ArrayList<>(); + x.add(1); + x.add(2); + x.add(3); + ArrayList y = (ArrayList) x.clone(); + + assertNotSame(y, x); + assertEquals(x, y); + assertEquals(y, x); + assertEquals(x.size(), y.size()); + assertEquals(x.toString(), y.toString()); + assertTrue(Arrays.equals(x.toArray(), y.toArray())); + while (!x.isEmpty()) { + assertFalse(y.isEmpty()); + assertEquals(x.remove(0), y.remove(0)); + } + assertTrue(y.isEmpty()); + } + } diff --git a/jdk/test/java/util/concurrent/tck/AtomicBooleanTest.java b/jdk/test/java/util/concurrent/tck/AtomicBooleanTest.java index be136357ff1..05a196ca724 100644 --- a/jdk/test/java/util/concurrent/tck/AtomicBooleanTest.java +++ b/jdk/test/java/util/concurrent/tck/AtomicBooleanTest.java @@ -147,7 +147,7 @@ public class AtomicBooleanTest extends JSR166TestCase { } /** - * a deserialized serialized atomic holds same value + * a deserialized/reserialized atomic holds same value */ public void testSerialization() throws Exception { AtomicBoolean x = new AtomicBoolean(); diff --git a/jdk/test/java/util/concurrent/tck/AtomicIntegerArrayTest.java b/jdk/test/java/util/concurrent/tck/AtomicIntegerArrayTest.java index e12284063f1..cdcf0061667 100644 --- a/jdk/test/java/util/concurrent/tck/AtomicIntegerArrayTest.java +++ b/jdk/test/java/util/concurrent/tck/AtomicIntegerArrayTest.java @@ -342,7 +342,7 @@ public class AtomicIntegerArrayTest extends JSR166TestCase { } /** - * a deserialized serialized array holds same values + * a deserialized/reserialized array holds same values in same order */ public void testSerialization() throws Exception { AtomicIntegerArray x = new AtomicIntegerArray(SIZE); diff --git a/jdk/test/java/util/concurrent/tck/AtomicIntegerTest.java b/jdk/test/java/util/concurrent/tck/AtomicIntegerTest.java index d148788d792..6f3546038bc 100644 --- a/jdk/test/java/util/concurrent/tck/AtomicIntegerTest.java +++ b/jdk/test/java/util/concurrent/tck/AtomicIntegerTest.java @@ -218,7 +218,7 @@ public class AtomicIntegerTest extends JSR166TestCase { } /** - * a deserialized serialized atomic holds same value + * a deserialized/reserialized atomic holds same value */ public void testSerialization() throws Exception { AtomicInteger x = new AtomicInteger(); diff --git a/jdk/test/java/util/concurrent/tck/AtomicLongArrayTest.java b/jdk/test/java/util/concurrent/tck/AtomicLongArrayTest.java index b312388dd6a..72d0e0677ab 100644 --- a/jdk/test/java/util/concurrent/tck/AtomicLongArrayTest.java +++ b/jdk/test/java/util/concurrent/tck/AtomicLongArrayTest.java @@ -341,7 +341,7 @@ public class AtomicLongArrayTest extends JSR166TestCase { } /** - * a deserialized serialized array holds same values + * a deserialized/reserialized array holds same values in same order */ public void testSerialization() throws Exception { AtomicLongArray x = new AtomicLongArray(SIZE); diff --git a/jdk/test/java/util/concurrent/tck/AtomicLongTest.java b/jdk/test/java/util/concurrent/tck/AtomicLongTest.java index f5191af99e6..c41a861ce09 100644 --- a/jdk/test/java/util/concurrent/tck/AtomicLongTest.java +++ b/jdk/test/java/util/concurrent/tck/AtomicLongTest.java @@ -220,7 +220,7 @@ public class AtomicLongTest extends JSR166TestCase { } /** - * a deserialized serialized atomic holds same value + * a deserialized/reserialized atomic holds same value */ public void testSerialization() throws Exception { AtomicLong x = new AtomicLong(); diff --git a/jdk/test/java/util/concurrent/tck/AtomicReferenceArrayTest.java b/jdk/test/java/util/concurrent/tck/AtomicReferenceArrayTest.java index 019446cc14d..8a9cf20a2ca 100644 --- a/jdk/test/java/util/concurrent/tck/AtomicReferenceArrayTest.java +++ b/jdk/test/java/util/concurrent/tck/AtomicReferenceArrayTest.java @@ -220,7 +220,7 @@ public class AtomicReferenceArrayTest extends JSR166TestCase { } /** - * a deserialized serialized array holds same values + * a deserialized/reserialized array holds same values in same order */ public void testSerialization() throws Exception { AtomicReferenceArray x = new AtomicReferenceArray(SIZE); diff --git a/jdk/test/java/util/concurrent/tck/AtomicReferenceTest.java b/jdk/test/java/util/concurrent/tck/AtomicReferenceTest.java index eb8c0b7b565..f46bd786c8f 100644 --- a/jdk/test/java/util/concurrent/tck/AtomicReferenceTest.java +++ b/jdk/test/java/util/concurrent/tck/AtomicReferenceTest.java @@ -143,7 +143,7 @@ public class AtomicReferenceTest extends JSR166TestCase { } /** - * a deserialized serialized atomic holds same value + * a deserialized/reserialized atomic holds same value */ public void testSerialization() throws Exception { AtomicReference x = new AtomicReference(); diff --git a/jdk/test/java/util/concurrent/tck/ConcurrentHashMap8Test.java b/jdk/test/java/util/concurrent/tck/ConcurrentHashMap8Test.java index e0d9f81a7f1..e5c75b13516 100644 --- a/jdk/test/java/util/concurrent/tck/ConcurrentHashMap8Test.java +++ b/jdk/test/java/util/concurrent/tck/ConcurrentHashMap8Test.java @@ -570,7 +570,7 @@ public class ConcurrentHashMap8Test extends JSR166TestCase { } /** - * A deserialized serialized set is equal + * A deserialized/reserialized set equals original */ public void testSerialization() throws Exception { int size = 20; diff --git a/jdk/test/java/util/concurrent/tck/ConcurrentHashMapTest.java b/jdk/test/java/util/concurrent/tck/ConcurrentHashMapTest.java index 729a6e3d146..007d3b6798d 100644 --- a/jdk/test/java/util/concurrent/tck/ConcurrentHashMapTest.java +++ b/jdk/test/java/util/concurrent/tck/ConcurrentHashMapTest.java @@ -811,7 +811,7 @@ public class ConcurrentHashMapTest extends JSR166TestCase { } /** - * A deserialized map equals original + * A deserialized/reserialized map equals original */ public void testSerialization() throws Exception { Map x = map5(); diff --git a/jdk/test/java/util/concurrent/tck/ConcurrentLinkedDequeTest.java b/jdk/test/java/util/concurrent/tck/ConcurrentLinkedDequeTest.java index 65a73621ef3..4ad7303b1f7 100644 --- a/jdk/test/java/util/concurrent/tck/ConcurrentLinkedDequeTest.java +++ b/jdk/test/java/util/concurrent/tck/ConcurrentLinkedDequeTest.java @@ -889,7 +889,7 @@ public class ConcurrentLinkedDequeTest extends JSR166TestCase { } /** - * A deserialized serialized deque has same elements in same order + * A deserialized/reserialized deque has same elements in same order */ public void testSerialization() throws Exception { Queue x = populatedDeque(SIZE); diff --git a/jdk/test/java/util/concurrent/tck/ConcurrentLinkedQueueTest.java b/jdk/test/java/util/concurrent/tck/ConcurrentLinkedQueueTest.java index f2cbc950ce1..e78ba3f20ca 100644 --- a/jdk/test/java/util/concurrent/tck/ConcurrentLinkedQueueTest.java +++ b/jdk/test/java/util/concurrent/tck/ConcurrentLinkedQueueTest.java @@ -538,7 +538,7 @@ public class ConcurrentLinkedQueueTest extends JSR166TestCase { } /** - * A deserialized serialized queue has same elements in same order + * A deserialized/reserialized queue has same elements in same order */ public void testSerialization() throws Exception { Queue x = populatedQueue(SIZE); diff --git a/jdk/test/java/util/concurrent/tck/ConcurrentSkipListMapTest.java b/jdk/test/java/util/concurrent/tck/ConcurrentSkipListMapTest.java index 0b1faad2824..fdd9892f09a 100644 --- a/jdk/test/java/util/concurrent/tck/ConcurrentSkipListMapTest.java +++ b/jdk/test/java/util/concurrent/tck/ConcurrentSkipListMapTest.java @@ -828,7 +828,24 @@ public class ConcurrentSkipListMapTest extends JSR166TestCase { } /** - * A deserialized map equals original + * A cloned map equals original + */ + public void testClone() { + ConcurrentSkipListMap x = map5(); + ConcurrentSkipListMap y = x.clone(); + + assertNotSame(x, y); + assertEquals(x.size(), y.size()); + assertEquals(x.toString(), y.toString()); + assertEquals(x, y); + assertEquals(y, x); + y.clear(); + assertTrue(y.isEmpty()); + assertFalse(x.equals(y)); + } + + /** + * A deserialized/reserialized map equals original */ public void testSerialization() throws Exception { NavigableMap x = map5(); @@ -839,6 +856,9 @@ public class ConcurrentSkipListMapTest extends JSR166TestCase { assertEquals(x.toString(), y.toString()); assertEquals(x, y); assertEquals(y, x); + y.clear(); + assertTrue(y.isEmpty()); + assertFalse(x.equals(y)); } /** diff --git a/jdk/test/java/util/concurrent/tck/ConcurrentSkipListSubMapTest.java b/jdk/test/java/util/concurrent/tck/ConcurrentSkipListSubMapTest.java index ddc82f78a56..e3f6c577cf2 100644 --- a/jdk/test/java/util/concurrent/tck/ConcurrentSkipListSubMapTest.java +++ b/jdk/test/java/util/concurrent/tck/ConcurrentSkipListSubMapTest.java @@ -625,7 +625,7 @@ public class ConcurrentSkipListSubMapTest extends JSR166TestCase { } /** - * A deserialized map equals original + * A deserialized/reserialized map equals original */ public void testSerialization() throws Exception { NavigableMap x = map5(); @@ -1299,7 +1299,7 @@ public class ConcurrentSkipListSubMapTest extends JSR166TestCase { } /** - * A deserialized map equals original + * A deserialized/reserialized map equals original */ public void testDescendingSerialization() throws Exception { NavigableMap x = dmap5(); diff --git a/jdk/test/java/util/concurrent/tck/ConcurrentSkipListSubSetTest.java b/jdk/test/java/util/concurrent/tck/ConcurrentSkipListSubSetTest.java index 19d34cc01e1..3cc968f4b1b 100644 --- a/jdk/test/java/util/concurrent/tck/ConcurrentSkipListSubSetTest.java +++ b/jdk/test/java/util/concurrent/tck/ConcurrentSkipListSubSetTest.java @@ -503,7 +503,7 @@ public class ConcurrentSkipListSubSetTest extends JSR166TestCase { } /** - * A deserialized serialized set has same elements + * A deserialized/reserialized set equals original */ public void testSerialization() throws Exception { NavigableSet x = populatedSet(SIZE); @@ -1002,7 +1002,7 @@ public class ConcurrentSkipListSubSetTest extends JSR166TestCase { } /** - * A deserialized serialized set has same elements + * A deserialized/reserialized set equals original */ public void testDescendingSerialization() throws Exception { NavigableSet x = dset5(); diff --git a/jdk/test/java/util/concurrent/tck/CopyOnWriteArrayListTest.java b/jdk/test/java/util/concurrent/tck/CopyOnWriteArrayListTest.java index 2b13e130701..5e04d4cc4dd 100644 --- a/jdk/test/java/util/concurrent/tck/CopyOnWriteArrayListTest.java +++ b/jdk/test/java/util/concurrent/tck/CopyOnWriteArrayListTest.java @@ -774,7 +774,7 @@ public class CopyOnWriteArrayListTest extends JSR166TestCase { } /** - * a deserialized serialized list is equal + * a deserialized/reserialized list equals original */ public void testSerialization() throws Exception { List x = populatedArray(SIZE); diff --git a/jdk/test/java/util/concurrent/tck/CopyOnWriteArraySetTest.java b/jdk/test/java/util/concurrent/tck/CopyOnWriteArraySetTest.java index 2595589cc78..c28051a9b68 100644 --- a/jdk/test/java/util/concurrent/tck/CopyOnWriteArraySetTest.java +++ b/jdk/test/java/util/concurrent/tck/CopyOnWriteArraySetTest.java @@ -403,7 +403,7 @@ public class CopyOnWriteArraySetTest extends JSR166TestCase { } /** - * A deserialized serialized set is equal + * A deserialized/reserialized set equals original */ public void testSerialization() throws Exception { Set x = populatedSet(SIZE); diff --git a/jdk/test/java/util/concurrent/tck/DoubleAdderTest.java b/jdk/test/java/util/concurrent/tck/DoubleAdderTest.java index fc7d1f47834..ba3fbc4a455 100644 --- a/jdk/test/java/util/concurrent/tck/DoubleAdderTest.java +++ b/jdk/test/java/util/concurrent/tck/DoubleAdderTest.java @@ -89,7 +89,7 @@ public class DoubleAdderTest extends JSR166TestCase { } /** - * a deserialized serialized adder holds same value + * a deserialized/reserialized adder holds same value */ public void testSerialization() throws Exception { DoubleAdder x = new DoubleAdder(); diff --git a/jdk/test/java/util/concurrent/tck/JSR166TestCase.java b/jdk/test/java/util/concurrent/tck/JSR166TestCase.java index f01acb4c6d7..2b25238201a 100644 --- a/jdk/test/java/util/concurrent/tck/JSR166TestCase.java +++ b/jdk/test/java/util/concurrent/tck/JSR166TestCase.java @@ -1142,53 +1142,6 @@ public class JSR166TestCase extends TestCase { fail("timed out waiting for thread to enter thread state " + expected); } - /** - * Checks that thread does not terminate within the default - * millisecond delay of {@code timeoutMillis()}. - * TODO: REMOVEME - */ - void assertThreadStaysAlive(Thread thread) { - assertThreadStaysAlive(thread, timeoutMillis()); - } - - /** - * Checks that thread does not terminate within the given millisecond delay. - * TODO: REMOVEME - */ - void assertThreadStaysAlive(Thread thread, long millis) { - try { - // No need to optimize the failing case via Thread.join. - delay(millis); - assertTrue(thread.isAlive()); - } catch (InterruptedException fail) { - threadFail("Unexpected InterruptedException"); - } - } - - /** - * Checks that the threads do not terminate within the default - * millisecond delay of {@code timeoutMillis()}. - * TODO: REMOVEME - */ - void assertThreadsStayAlive(Thread... threads) { - assertThreadsStayAlive(timeoutMillis(), threads); - } - - /** - * Checks that the threads do not terminate within the given millisecond delay. - * TODO: REMOVEME - */ - void assertThreadsStayAlive(long millis, Thread... threads) { - try { - // No need to optimize the failing case via Thread.join. - delay(millis); - for (Thread thread : threads) - assertTrue(thread.isAlive()); - } catch (InterruptedException fail) { - threadFail("Unexpected InterruptedException"); - } - } - /** * Checks that future.get times out, with the default timeout of * {@code timeoutMillis()}. diff --git a/jdk/test/java/util/concurrent/tck/LinkedBlockingDequeTest.java b/jdk/test/java/util/concurrent/tck/LinkedBlockingDequeTest.java index bc611770605..5388fbaa1a9 100644 --- a/jdk/test/java/util/concurrent/tck/LinkedBlockingDequeTest.java +++ b/jdk/test/java/util/concurrent/tck/LinkedBlockingDequeTest.java @@ -1800,7 +1800,7 @@ public class LinkedBlockingDequeTest extends JSR166TestCase { } /** - * A deserialized serialized deque has same elements in same order + * A deserialized/reserialized deque has same elements in same order */ public void testSerialization() throws Exception { Queue x = populatedDeque(SIZE); diff --git a/jdk/test/java/util/concurrent/tck/LinkedBlockingQueueTest.java b/jdk/test/java/util/concurrent/tck/LinkedBlockingQueueTest.java index 596f30dad2f..b880ea28724 100644 --- a/jdk/test/java/util/concurrent/tck/LinkedBlockingQueueTest.java +++ b/jdk/test/java/util/concurrent/tck/LinkedBlockingQueueTest.java @@ -823,7 +823,7 @@ public class LinkedBlockingQueueTest extends JSR166TestCase { } /** - * A deserialized serialized queue has same elements in same order + * A deserialized/reserialized queue has same elements in same order */ public void testSerialization() throws Exception { Queue x = populatedQueue(SIZE); diff --git a/jdk/test/java/util/concurrent/tck/LinkedTransferQueueTest.java b/jdk/test/java/util/concurrent/tck/LinkedTransferQueueTest.java index 401b0da9025..4e972676bfb 100644 --- a/jdk/test/java/util/concurrent/tck/LinkedTransferQueueTest.java +++ b/jdk/test/java/util/concurrent/tck/LinkedTransferQueueTest.java @@ -674,7 +674,7 @@ public class LinkedTransferQueueTest extends JSR166TestCase { } /** - * A deserialized serialized queue has same elements in same order + * A deserialized/reserialized queue has same elements in same order */ public void testSerialization() throws Exception { Queue x = populatedQueue(SIZE); diff --git a/jdk/test/java/util/concurrent/tck/LongAdderTest.java b/jdk/test/java/util/concurrent/tck/LongAdderTest.java index 4f0d5e07f75..c4c16a81a3d 100644 --- a/jdk/test/java/util/concurrent/tck/LongAdderTest.java +++ b/jdk/test/java/util/concurrent/tck/LongAdderTest.java @@ -111,7 +111,7 @@ public class LongAdderTest extends JSR166TestCase { } /** - * a deserialized serialized adder holds same value + * a deserialized/reserialized adder holds same value */ public void testSerialization() throws Exception { LongAdder x = new LongAdder(); diff --git a/jdk/test/java/util/concurrent/tck/PriorityBlockingQueueTest.java b/jdk/test/java/util/concurrent/tck/PriorityBlockingQueueTest.java index 603a66ff4a4..0279a6f03b2 100644 --- a/jdk/test/java/util/concurrent/tck/PriorityBlockingQueueTest.java +++ b/jdk/test/java/util/concurrent/tck/PriorityBlockingQueueTest.java @@ -686,7 +686,7 @@ public class PriorityBlockingQueueTest extends JSR166TestCase { } /** - * A deserialized serialized queue has same elements + * A deserialized/reserialized queue has same elements */ public void testSerialization() throws Exception { Queue x = populatedQueue(SIZE); diff --git a/jdk/test/java/util/concurrent/tck/PriorityQueueTest.java b/jdk/test/java/util/concurrent/tck/PriorityQueueTest.java index 81e8d770e51..179e9cda0b0 100644 --- a/jdk/test/java/util/concurrent/tck/PriorityQueueTest.java +++ b/jdk/test/java/util/concurrent/tck/PriorityQueueTest.java @@ -522,7 +522,7 @@ public class PriorityQueueTest extends JSR166TestCase { } /** - * A deserialized serialized queue has same elements + * A deserialized/reserialized queue has same elements */ public void testSerialization() throws Exception { Queue x = populatedQueue(SIZE); diff --git a/jdk/test/java/util/concurrent/tck/SynchronousQueueTest.java b/jdk/test/java/util/concurrent/tck/SynchronousQueueTest.java index 521dd8950cb..0a431d286a8 100644 --- a/jdk/test/java/util/concurrent/tck/SynchronousQueueTest.java +++ b/jdk/test/java/util/concurrent/tck/SynchronousQueueTest.java @@ -557,7 +557,7 @@ public class SynchronousQueueTest extends JSR166TestCase { } /** - * a deserialized serialized queue is usable + * a deserialized/reserialized queue is usable */ public void testSerialization() { final SynchronousQueue x = new SynchronousQueue(); diff --git a/jdk/test/java/util/concurrent/tck/ThreadLocalRandom8Test.java b/jdk/test/java/util/concurrent/tck/ThreadLocalRandom8Test.java index eef34d34149..dcf83eeefeb 100644 --- a/jdk/test/java/util/concurrent/tck/ThreadLocalRandom8Test.java +++ b/jdk/test/java/util/concurrent/tck/ThreadLocalRandom8Test.java @@ -260,8 +260,8 @@ public class ThreadLocalRandom8Test extends JSR166TestCase { } /** - * A deserialized ThreadLocalRandom is always identical to - * ThreadLocalRandom.current() + * A deserialized/reserialized ThreadLocalRandom is always + * identical to ThreadLocalRandom.current() */ public void testSerialization() { assertSame( diff --git a/jdk/test/java/util/concurrent/tck/ThreadPoolExecutorSubclassTest.java b/jdk/test/java/util/concurrent/tck/ThreadPoolExecutorSubclassTest.java index cf877007875..74c8abdee4f 100644 --- a/jdk/test/java/util/concurrent/tck/ThreadPoolExecutorSubclassTest.java +++ b/jdk/test/java/util/concurrent/tck/ThreadPoolExecutorSubclassTest.java @@ -1319,8 +1319,8 @@ public class ThreadPoolExecutorSubclassTest extends JSR166TestCase { public void testMaximumPoolSizeIllegalArgumentException2() { final ThreadPoolExecutor p = new CustomTPE(2, 3, - LONG_DELAY_MS, - MILLISECONDS,new ArrayBlockingQueue(10)); + LONG_DELAY_MS, MILLISECONDS, + new ArrayBlockingQueue(10)); try (PoolCleaner cleaner = cleaner(p)) { try { p.setMaximumPoolSize(-1); diff --git a/jdk/test/java/util/concurrent/tck/TimeUnitTest.java b/jdk/test/java/util/concurrent/tck/TimeUnitTest.java index 6e9aaa8bf4b..df924e3151c 100644 --- a/jdk/test/java/util/concurrent/tck/TimeUnitTest.java +++ b/jdk/test/java/util/concurrent/tck/TimeUnitTest.java @@ -623,7 +623,7 @@ public class TimeUnitTest extends JSR166TestCase { } /** - * a deserialized serialized unit is the same instance + * a deserialized/reserialized unit is the same instance */ public void testSerialization() throws Exception { for (TimeUnit x : TimeUnit.values()) diff --git a/jdk/test/java/util/concurrent/tck/TreeMapTest.java b/jdk/test/java/util/concurrent/tck/TreeMapTest.java index ada561ea119..bd24e32e951 100644 --- a/jdk/test/java/util/concurrent/tck/TreeMapTest.java +++ b/jdk/test/java/util/concurrent/tck/TreeMapTest.java @@ -633,7 +633,7 @@ public class TreeMapTest extends JSR166TestCase { } /** - * A deserialized map equals original + * A deserialized/reserialized map equals original */ public void testSerialization() throws Exception { NavigableMap x = map5(); diff --git a/jdk/test/java/util/concurrent/tck/TreeSetTest.java b/jdk/test/java/util/concurrent/tck/TreeSetTest.java index 55b28d613d9..4d3fe24815a 100644 --- a/jdk/test/java/util/concurrent/tck/TreeSetTest.java +++ b/jdk/test/java/util/concurrent/tck/TreeSetTest.java @@ -549,7 +549,7 @@ public class TreeSetTest extends JSR166TestCase { } /** - * A deserialized serialized set has same elements + * A deserialized/reserialized set equals original */ public void testSerialization() throws Exception { NavigableSet x = populatedSet(SIZE); diff --git a/jdk/test/java/util/concurrent/tck/TreeSubMapTest.java b/jdk/test/java/util/concurrent/tck/TreeSubMapTest.java index 1b5fa424b1c..05e876292b8 100644 --- a/jdk/test/java/util/concurrent/tck/TreeSubMapTest.java +++ b/jdk/test/java/util/concurrent/tck/TreeSubMapTest.java @@ -460,7 +460,7 @@ public class TreeSubMapTest extends JSR166TestCase { } /** - * A deserialized map equals original + * A deserialized/reserialized map equals original */ public void testSerialization() throws Exception { NavigableMap x = map5(); @@ -987,7 +987,7 @@ public class TreeSubMapTest extends JSR166TestCase { } /** - * A deserialized map equals original + * A deserialized/reserialized map equals original */ public void testDescendingSerialization() throws Exception { NavigableMap x = dmap5(); diff --git a/jdk/test/java/util/concurrent/tck/TreeSubSetTest.java b/jdk/test/java/util/concurrent/tck/TreeSubSetTest.java index a0f2b96ee57..10e37e9f7b4 100644 --- a/jdk/test/java/util/concurrent/tck/TreeSubSetTest.java +++ b/jdk/test/java/util/concurrent/tck/TreeSubSetTest.java @@ -500,7 +500,7 @@ public class TreeSubSetTest extends JSR166TestCase { } /** - * A deserialized serialized set has same elements + * A deserialized/reserialized set equals original */ public void testSerialization() throws Exception { NavigableSet x = populatedSet(SIZE); @@ -988,7 +988,7 @@ public class TreeSubSetTest extends JSR166TestCase { } /** - * A deserialized serialized set has same elements + * A deserialized/reserialized set equals original */ public void testDescendingSerialization() throws Exception { NavigableSet x = dset5(); From 330008fbf2dc20c05c558227579081bd4db26b5f Mon Sep 17 00:00:00 2001 From: Jonathan Gibbons Date: Thu, 10 Aug 2017 15:21:17 -0700 Subject: [PATCH 22/26] 8185994: Fix a11y and HTML issues in the java.base/java.io and java.base/java.nio packages Reviewed-by: bpb, smarks --- .../share/classes/java/io/DataInput.java | 101 ++++++----- .../java/nio/channels/package-info.java | 166 ++++++++++-------- .../java/nio/charset/package-info.java | 29 +-- .../classes/java/nio/file/FileSystem.java | 24 +-- .../share/classes/java/nio/file/Files.java | 17 +- .../java/nio/file/attribute/package-info.java | 60 ++++--- .../share/classes/java/nio/package-info.java | 61 ++++--- 7 files changed, 253 insertions(+), 205 deletions(-) diff --git a/jdk/src/java.base/share/classes/java/io/DataInput.java b/jdk/src/java.base/share/classes/java/io/DataInput.java index 70f78a6a068..86d8d3eb9fd 100644 --- a/jdk/src/java.base/share/classes/java/io/DataInput.java +++ b/jdk/src/java.base/share/classes/java/io/DataInput.java @@ -54,83 +54,90 @@ package java.io; * Unicode strings in a format that is a slight modification of UTF-8. * (For information regarding the standard UTF-8 format, see section * 3.9 Unicode Encoding Forms of The Unicode Standard, Version - * 4.0). - * Note that in the following table, the most significant bit appears in the - * far left-hand column. + * 4.0) * - *

    - * - * + *
      + *
    • Characters in the range {@code '\u005Cu0001'} to + * {@code '\u005Cu007F'} are represented by a single byte. + *
    • The null character {@code '\u005Cu0000'} and characters + * in the range {@code '\u005Cu0080'} to {@code '\u005Cu07FF'} are + * represented by a pair of bytes. + *
    • Characters in the range {@code '\u005Cu0800'} + * to {@code '\u005CuFFFF'} are represented by three bytes. + *
    + * + *
    Bit values and bytes
    + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * * * - * - * - * - * - * - * - * - * + * + * * * - * - * - * - * - * - * - * - * + * + * * * - * + * + * * * - * - * - * - * - * - * - * - * + * + * * * - * + * + * * * - * + * + * * * *
    Encoding of UTF-8 values
    ValueByteBit Values
    7 6 5 4 3 2 1 0
    - * All characters in the range {@code '\u005Cu0001'} to - * {@code '\u005Cu007F'} are represented by a single byte:
    Bit Values
    Byte 1 + * {@code \u005Cu0001} to {@code \u005Cu007F} 1 0 - * bits 6-0 + * bits 6-0 *
    - * The null character {@code '\u005Cu0000'} and characters - * in the range {@code '\u005Cu0080'} to {@code '\u005Cu07FF'} are - * represented by a pair of bytes:
    Bit Values
    Byte 1 + * {@code \u005Cu0000},
    + * {@code \u005Cu0080} to {@code \u005Cu07FF}
    1 1 * 1 * 0 - * bits 10-6 + * bits 10-6 *
    Byte 2 2 1 * 0 - * bits 5-0 + * bits 5-0 *
    - * {@code char} values in the range {@code '\u005Cu0800'} - * to {@code '\u005CuFFFF'} are represented by three bytes:
    Bit Values
    Byte 1 + * {@code \u005Cu0800} to {@code \u005CuFFFF} 1 1 * 1 * 1 * 0 - * bits 15-12 + * bits 15-12 *
    Byte 2 2 1 * 0 - * bits 11-6 + * bits 11-6 *
    Byte 3 3 1 * 0 - * bits 5-0 + * bits 5-0 *
    - *
    + * *

    * The differences between this format and the * standard UTF-8 format are the following: diff --git a/jdk/src/java.base/share/classes/java/nio/channels/package-info.java b/jdk/src/java.base/share/classes/java/nio/channels/package-info.java index d29ae67590f..0dc410ddd76 100644 --- a/jdk/src/java.base/share/classes/java/nio/channels/package-info.java +++ b/jdk/src/java.base/share/classes/java/nio/channels/package-info.java @@ -30,46 +30,50 @@ * * * - *

    + *
    * - * - * - * + * + * + * + * + * + * * - * + * * - * - * - * + * + * + * * - * - * - * - * - * + * + * + * + * + * * - * + * * - * + * * - * + * * - * + * * - * + * * - *
    Lists channels and their descriptions
    ChannelsDescription
    {@link java.nio.channels.Channel}
    ChannelsDescription
    {@link java.nio.channels.Channel}A nexus for I/O operations
    - *   {@link java.nio.channels.ReadableByteChannel}
    + * {@link java.nio.channels.ReadableByteChannel}Can read into a buffer
    - *     {@link java.nio.channels.ScatteringByteChannel}  Can read into a sequence of buffers
    - *   {@link java.nio.channels.WritableByteChannel}
    + * {@link java.nio.channels.ScatteringByteChannel}Can read into a sequence of buffers
    + * {@link java.nio.channels.WritableByteChannel}Can write from a buffer
    - *     {@link java.nio.channels.GatheringByteChannel}Can write from a sequence of buffers
    - *   {@link java.nio.channels.ByteChannel}Can read/write to/from a buffer
    - *     {@link java.nio.channels.SeekableByteChannel}
    + * {@link java.nio.channels.GatheringByteChannel}Can write from a sequence of buffers
    + * {@link java.nio.channels.ByteChannel}Can read/write to/from a buffer
    + * {@link java.nio.channels.SeekableByteChannel}A {@code ByteChannel} connected to an entity that contains a variable-length * sequence of bytes
    - *   {@link java.nio.channels.AsynchronousChannel}
    + * {@link java.nio.channels.AsynchronousChannel}Supports asynchronous I/O operations.
    - *     {@link java.nio.channels.AsynchronousByteChannel}
    + * {@link java.nio.channels.AsynchronousByteChannel}Can read and write bytes asynchronously
    - *   {@link java.nio.channels.NetworkChannel}
    + * {@link java.nio.channels.NetworkChannel}A channel to a network socket
    - *     {@link java.nio.channels.MulticastChannel}
    + * {@link java.nio.channels.MulticastChannel}Can join Internet Protocol (IP) multicast groups
    {@link java.nio.channels.Channels}
    {@link java.nio.channels.Channels}Utility methods for channel/stream interoperation
    + *
* *

A channel represents an open connection to an entity such as a * hardware device, a file, a network socket, or a program component that is @@ -122,21 +126,25 @@ * be constructed that uses a given charset to encode characters into bytes and * write them to a given writable byte channel. * - *

+ *
* - * - * - * + * + * + * + * + * + * * - * + * * - * - * - *
* Lists file channels and their descriptions
File channelsDescription
- * {@link java.nio.channels.FileChannel}
File channelsDescription
+ * {@link java.nio.channels.FileChannel}Reads, writes, maps, and manipulates files
- * {@link java.nio.channels.FileLock}
+ * {@link java.nio.channels.FileLock}A lock on a (region of a) file
- * {@link java.nio.MappedByteBuffer}  A direct byte buffer mapped to a region of a file
+ * + * {@link java.nio.MappedByteBuffer} + * A direct byte buffer mapped to a region of a file + * + * * *

The {@link java.nio.channels.FileChannel} class supports the usual * operations of reading bytes from, and writing bytes to, a channel connected to @@ -156,36 +164,40 @@ * class. * * - *

+ *
* - * - * - * + * + * + * + * + * + * * - * + * * - * + * * - * + * * - * + * * - * + * * - * + * * - * - * - * - * - *
* Lists multiplexed, non-blocking channels and their descriptions
Multiplexed, non-blocking I/ODescription
{@link java.nio.channels.SelectableChannel}
Multiplexed, non-blocking I/ODescription
{@link java.nio.channels.SelectableChannel}A channel that can be multiplexed
- *   {@link java.nio.channels.DatagramChannel}
+ * {@link java.nio.channels.DatagramChannel}A channel to a datagram-oriented socket
- *   {@link java.nio.channels.Pipe.SinkChannel}
+ * {@link java.nio.channels.Pipe.SinkChannel}The write end of a pipe
- *   {@link java.nio.channels.Pipe.SourceChannel}
+ * {@link java.nio.channels.Pipe.SourceChannel}The read end of a pipe
- *   {@link java.nio.channels.ServerSocketChannel}  
+ * {@link java.nio.channels.ServerSocketChannel}A channel to a stream-oriented listening socket
- *   {@link java.nio.channels.SocketChannel}
+ * {@link java.nio.channels.SocketChannel}A channel for a stream-oriented connecting socket
{@link java.nio.channels.Selector}
{@link java.nio.channels.Selector}A multiplexor of selectable channels
{@link java.nio.channels.SelectionKey}A token representing the registration
of a channel - * with a selector
{@link java.nio.channels.Pipe}Two channels that form a unidirectional pipe
+ * {@link java.nio.channels.SelectionKey} + * A token representing the registration of a channel + * with a selector + * {@link java.nio.channels.Pipe} + * Two channels that form a unidirectional pipe + * + * * *

Multiplexed, non-blocking I/O, which is much more scalable than * thread-oriented, blocking I/O, is provided by selectors, selectable @@ -251,27 +263,31 @@ * * * - *

+ *
* - * - * + * + * + * + * + * + * * - * + * * - * + * * - * + * * - * + * * - *
* Lists asynchronous channels and their descriptions
- * Asynchronous I/ODescription
- * {@link java.nio.channels.AsynchronousFileChannel}
Asynchronous I/ODescription
+ * {@link java.nio.channels.AsynchronousFileChannel}An asynchronous channel for reading, writing, and manipulating a file
- * {@link java.nio.channels.AsynchronousSocketChannel}
+ * {@link java.nio.channels.AsynchronousSocketChannel}An asynchronous channel to a stream-oriented connecting socket
- * {@link java.nio.channels.AsynchronousServerSocketChannel}  
+ * {@link java.nio.channels.AsynchronousServerSocketChannel}An asynchronous channel to a stream-oriented listening socket
- * {@link java.nio.channels.CompletionHandler}
+ * {@link java.nio.channels.CompletionHandler}A handler for consuming the result of an asynchronous operation
- * {@link java.nio.channels.AsynchronousChannelGroup}
+ * {@link java.nio.channels.AsynchronousChannelGroup}A grouping of asynchronous channels for the purpose of resource sharing
+ * + * * *

{@link java.nio.channels.AsynchronousChannel Asynchronous channels} are a * special type of channel capable of asynchronous I/O operations. Asynchronous diff --git a/jdk/src/java.base/share/classes/java/nio/charset/package-info.java b/jdk/src/java.base/share/classes/java/nio/charset/package-info.java index 80141dc8b6a..046606a57db 100644 --- a/jdk/src/java.base/share/classes/java/nio/charset/package-info.java +++ b/jdk/src/java.base/share/classes/java/nio/charset/package-info.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2010, 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 @@ -27,22 +27,25 @@ * Defines charsets, decoders, and encoders, for translating between * bytes and Unicode characters. * - *

+ *
* - * - * - * - * + * + * + * + * + * + * + * * - * + * * - * + * * - * - * - * - *
Summary of charsets, decoders, and encoders in this package
Class nameDescriptiPath - *
{@link java.nio.charset.Charset}A named mapping between characters
and bytes
{@link java.nio.charset.CharsetDecoder}
Class nameDescription + *
{@link java.nio.charset.Charset}A named mapping between characters and bytes
{@link java.nio.charset.CharsetDecoder}Decodes bytes into characters
{@link java.nio.charset.CharsetEncoder}
{@link java.nio.charset.CharsetEncoder}Encodes characters into bytes
{@link java.nio.charset.CoderResult}
{@link java.nio.charset.CoderResult}Describes coder results
{@link java.nio.charset.CodingErrorAction}Describes actions to take when
coding errors are detected
+ * {@link java.nio.charset.CodingErrorAction} + * Describes actions to take when coding errors are detected + * + * * *

A charset is named mapping between sequences of * sixteen-bit Unicode characters and sequences of bytes, in the sense diff --git a/jdk/src/java.base/share/classes/java/nio/file/FileSystem.java b/jdk/src/java.base/share/classes/java/nio/file/FileSystem.java index 0fd5be4fcf0..27bca11922e 100644 --- a/jdk/src/java.base/share/classes/java/nio/file/FileSystem.java +++ b/jdk/src/java.base/share/classes/java/nio/file/FileSystem.java @@ -314,45 +314,49 @@ public abstract class FileSystem * representation of the path is matched using a limited pattern language * that resembles regular expressions but with a simpler syntax. For example: * - *

- * + *
* + * + * + * + * * * - * + * * * * - * + * * * * - * + * * * * - * + * * * * - * * * - * * * - * * * *
Pattern Language
Example + * Description + *
{@code *.java}{@code *.java}Matches a path that represents a file name ending in {@code .java}
{@code *.*}{@code *.*}Matches file names containing a dot
{@code *.{java,class}}{@code *.{java,class}}Matches file names ending with {@code .java} or {@code .class}
{@code foo.?}{@code foo.?}Matches file names starting with {@code foo.} and a single * character extension
/home/*/* + * /home/*/* * Matches /home/gus/data on UNIX platforms
/home/** + * /home/** * Matches /home/gus and * /home/gus/data on UNIX platforms
C:\\* + * C:\\* * Matches C:\foo and C:\bar on the Windows * platform (note that the backslash is escaped; as a string literal in the * Java Language the pattern would be "C:\\\\*")
- *
* *

The following rules are used to interpret glob patterns: * diff --git a/jdk/src/java.base/share/classes/java/nio/file/Files.java b/jdk/src/java.base/share/classes/java/nio/file/Files.java index 09bce16a844..f5dbba9c358 100644 --- a/jdk/src/java.base/share/classes/java/nio/file/Files.java +++ b/jdk/src/java.base/share/classes/java/nio/file/Files.java @@ -1923,30 +1923,33 @@ public final class Files { *

The following examples demonstrate possible values for the {@code * attributes} parameter: * - *

- * + *
* + * + * + * * * - * + * * * * - * + * * * * - * + * * * * - * + * * * * *
Possible values
Example + * Description + *
{@code "*"} {@code "*"} Read all {@link BasicFileAttributes basic-file-attributes}.
{@code "size,lastModifiedTime,lastAccessTime"} {@code "size,lastModifiedTime,lastAccessTime"} Reads the file size, last modified time, and last access time * attributes.
{@code "posix:*"} {@code "posix:*"} Read all {@link PosixFileAttributes POSIX-file-attributes}.
{@code "posix:permissions,owner,size"} {@code "posix:permissions,owner,size"} Reads the POSIX file permissions, owner, and file size.
- *
* *

The {@code options} array may be used to indicate how symbolic links * are handled for the case that the file is a symbolic link. By default, diff --git a/jdk/src/java.base/share/classes/java/nio/file/attribute/package-info.java b/jdk/src/java.base/share/classes/java/nio/file/attribute/package-info.java index 11f5d6e2720..911d38a9bea 100644 --- a/jdk/src/java.base/share/classes/java/nio/file/attribute/package-info.java +++ b/jdk/src/java.base/share/classes/java/nio/file/attribute/package-info.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 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,43 +26,47 @@ /** * Interfaces and classes providing access to file and file system attributes. * - *

+ *
* - * - * - * + * + * + * + * + * + * * - * + * * - * + * * - * + * * - * + * * - * + * * - * + * * - * + * * - * + * * - *
Attribute views
Attribute viewsDescription
{@link java.nio.file.attribute.AttributeView}
Attribute viewsDescription
{@link java.nio.file.attribute.AttributeView}Can read or update non-opaque values associated with objects in a file system
- *   {@link java.nio.file.attribute.FileAttributeView}
+ * {@link java.nio.file.attribute.FileAttributeView}Can read or update file attributes
- *      - * {@link java.nio.file.attribute.BasicFileAttributeView}  
+ * + * {@link java.nio.file.attribute.BasicFileAttributeView}Can read or update a basic set of file attributes
- *        - * {@link java.nio.file.attribute.PosixFileAttributeView}  
+ * + * {@link java.nio.file.attribute.PosixFileAttributeView}Can read or update POSIX defined file attributes
- *        - * {@link java.nio.file.attribute.DosFileAttributeView}  
+ * + * {@link java.nio.file.attribute.DosFileAttributeView}Can read or update FAT file attributes
- *      - * {@link java.nio.file.attribute.FileOwnerAttributeView}  
+ * + * {@link java.nio.file.attribute.FileOwnerAttributeView}Can read or update the owner of a file
- *       - * {@link java.nio.file.attribute.AclFileAttributeView}  
+ * + * {@link java.nio.file.attribute.AclFileAttributeView}Can read or update Access Control Lists
- *      - * {@link java.nio.file.attribute.UserDefinedFileAttributeView}  
+ * + * {@link java.nio.file.attribute.UserDefinedFileAttributeView}Can read or update user-defined file attributes
- *   {@link java.nio.file.attribute.FileStoreAttributeView}
+ * {@link java.nio.file.attribute.FileStoreAttributeView}Can read or update file system attributes
+ * + * * *

An attribute view provides a read-only or updatable view of the non-opaque * values, or metadata, associated with objects in a file system. diff --git a/jdk/src/java.base/share/classes/java/nio/package-info.java b/jdk/src/java.base/share/classes/java/nio/package-info.java index 9fa17c945e0..c743a058fc7 100644 --- a/jdk/src/java.base/share/classes/java/nio/package-info.java +++ b/jdk/src/java.base/share/classes/java/nio/package-info.java @@ -48,7 +48,7 @@ *

  • Selectors and selection keys, which * together with
    selectable channels define a multiplexed, - * non-blocking
    I/O
     facility.

  • + * non-blocking
    I/O facility.

    * * * @@ -62,33 +62,44 @@ * * * - *
    + *
    * - * - * - * + * + * + * + * + * + * * - * - * - * + * clear, flip, rewind, and mark/reset + * + * + * * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *
    Description of the various buffers
    BuffersDescription
    {@link java.nio.Buffer}
    BuffersDescription
    {@link java.nio.Buffer}Position, limit, and capacity; - *
    clear, flip, rewind, and mark/reset
      {@link java.nio.ByteBuffer}Get/put, compact, views; allocate, wrap
    - *     {@link java.nio.MappedByteBuffer}  
    + * {@link java.nio.ByteBuffer}Get/put, compact, views; allocate, wrap
    + * {@link java.nio.MappedByteBuffer}A byte buffer mapped to a file
      {@link java.nio.CharBuffer}Get/put, compact; allocate, wrap
      {@link java.nio.DoubleBuffer}    ' '
      {@link java.nio.FloatBuffer}    ' '
      {@link java.nio.IntBuffer}    ' '
      {@link java.nio.LongBuffer}    ' '
      {@link java.nio.ShortBuffer}    ' '
    {@link java.nio.ByteOrder}Typesafe enumeration for byte orders
    + * + * {@link java.nio.CharBuffer} + * Get/put, compact; allocate, wrap + * + * {@link java.nio.DoubleBuffer} + * Get/put, compact; allocate, wrap + * + * {@link java.nio.FloatBuffer} + * Get/put, compact; allocate, wrap + * + * {@link java.nio.IntBuffer} + * Get/put, compact; allocate, wrap + * + * {@link java.nio.LongBuffer} + * Get/put, compact; allocate, wrap + * + * {@link java.nio.ShortBuffer} + * Get/put, compact; allocate, wrap + * {@link java.nio.ByteOrder} + * Typesafe enumeration for byte orders + * + * * *

    A buffer is a container for a fixed amount of data of a * specific primitive type. In addition to its content a buffer has a From c79d52b1030de135b2d7afcba57db6c0f76c854b Mon Sep 17 00:00:00 2001 From: Jonathan Gibbons Date: Thu, 10 Aug 2017 15:23:03 -0700 Subject: [PATCH 23/26] 8186052: Fix a11y and HTML issues in the java.base/java.lang[.*] packages Reviewed-by: smarks --- .../share/classes/java/lang/Character.java | 17 +++-- .../share/classes/java/lang/Class.java | 26 +++---- .../share/classes/java/lang/Double.java | 26 +++---- .../share/classes/java/lang/Float.java | 24 +++--- .../share/classes/java/lang/String.java | 73 ++++++++++--------- .../share/classes/java/lang/System.java | 42 ++++++----- .../share/classes/java/lang/Thread.java | 6 +- .../java/lang/invoke/LambdaMetafactory.java | 12 +-- .../java/lang/invoke/MethodHandle.java | 6 +- .../java/lang/invoke/MethodHandles.java | 31 ++++---- .../java/lang/invoke/package-info.java | 45 +++++++----- .../java/lang/reflect/AnnotatedElement.java | 40 ++++++---- 12 files changed, 186 insertions(+), 162 deletions(-) diff --git a/jdk/src/java.base/share/classes/java/lang/Character.java b/jdk/src/java.base/share/classes/java/lang/Character.java index fd6682e6196..e2c65b1567f 100644 --- a/jdk/src/java.base/share/classes/java/lang/Character.java +++ b/jdk/src/java.base/share/classes/java/lang/Character.java @@ -9566,18 +9566,23 @@ class Character implements java.io.Serializable, Comparable { * Determines if the specified character is ISO-LATIN-1 white space. * This method returns {@code true} for the following five * characters only: - * + *
    * + * + * * - * + * * - * + * * - * + * * - * + * * - * + * * * *
    truechars
    Character + * Code + * Name + *
    {@code '\t'} {@code U+0009}
    {@code '\t'} {@code U+0009}{@code HORIZONTAL TABULATION}
    {@code '\n'} {@code U+000A}
    {@code '\n'} {@code U+000A}{@code NEW LINE}
    {@code '\f'} {@code U+000C}
    {@code '\f'} {@code U+000C}{@code FORM FEED}
    {@code '\r'} {@code U+000D}
    {@code '\r'} {@code U+000D}{@code CARRIAGE RETURN}
    {@code ' '} {@code U+0020}
    {@code ' '} {@code U+0020}{@code SPACE}
    diff --git a/jdk/src/java.base/share/classes/java/lang/Class.java b/jdk/src/java.base/share/classes/java/lang/Class.java index 81dd846c26a..54415e990f2 100644 --- a/jdk/src/java.base/share/classes/java/lang/Class.java +++ b/jdk/src/java.base/share/classes/java/lang/Class.java @@ -728,22 +728,22 @@ public final class Class implements java.io.Serializable, * one or more '{@code [}' characters representing the depth of the array * nesting. The encoding of element type names is as follows: * - *

    + *
    * * - * - * - * + * *
    Element types and encodings
    Element Type Encoding + *
    Element Type Encoding *
    boolean Z - *
    byte B - *
    char C - *
    class or interface - * Lclassname; - *
    double D - *
    float F - *
    int I - *
    long J - *
    short S + *
    boolean Z + *
    byte B + *
    char C + *
    class or interface + * Lclassname; + *
    double D + *
    float F + *
    int I + *
    long J + *
    short S *
    * diff --git a/jdk/src/java.base/share/classes/java/lang/Double.java b/jdk/src/java.base/share/classes/java/lang/Double.java index a7aa0a0f626..52bf32c8153 100644 --- a/jdk/src/java.base/share/classes/java/lang/Double.java +++ b/jdk/src/java.base/share/classes/java/lang/Double.java @@ -255,25 +255,25 @@ public final class Double extends Number implements Comparable { * * * - * + *
    * * - * + * * - * - * - * - * - * - * - * - * + * + * + * + * + * + * + * + * * - * + * * - * + * * - * + * * * *
    Examples
    Floating-point ValueHexadecimal String
    Floating-point ValueHexadecimal String
    {@code 1.0} {@code 0x1.0p0}
    {@code -1.0} {@code -0x1.0p0}
    {@code 2.0} {@code 0x1.0p1}
    {@code 3.0} {@code 0x1.8p1}
    {@code 0.5} {@code 0x1.0p-1}
    {@code 0.25} {@code 0x1.0p-2}
    {@code Double.MAX_VALUE}
    {@code 1.0} {@code 0x1.0p0}
    {@code -1.0} {@code -0x1.0p0}
    {@code 2.0} {@code 0x1.0p1}
    {@code 3.0} {@code 0x1.8p1}
    {@code 0.5} {@code 0x1.0p-1}
    {@code 0.25} {@code 0x1.0p-2}
    {@code Double.MAX_VALUE}{@code 0x1.fffffffffffffp1023}
    {@code Minimum Normal Value}
    {@code Minimum Normal Value}{@code 0x1.0p-1022}
    {@code Maximum Subnormal Value}
    {@code Maximum Subnormal Value}{@code 0x0.fffffffffffffp-1022}
    {@code Double.MIN_VALUE}
    {@code Double.MIN_VALUE}{@code 0x0.0000000000001p-1022}
    diff --git a/jdk/src/java.base/share/classes/java/lang/Float.java b/jdk/src/java.base/share/classes/java/lang/Float.java index 77c1d1671d5..52cb2c09b79 100644 --- a/jdk/src/java.base/share/classes/java/lang/Float.java +++ b/jdk/src/java.base/share/classes/java/lang/Float.java @@ -256,25 +256,25 @@ public final class Float extends Number implements Comparable { * * * - * + *
    * * - * + * * * - * - * - * - * - * - * - * + * + * + * + * + * + * + * * - * + * * - * + * * - * + * * * *
    Examples
    Floating-point ValueHexadecimal String
    Floating-point ValueHexadecimal String
    {@code 1.0} {@code 0x1.0p0}
    {@code -1.0} {@code -0x1.0p0}
    {@code 2.0} {@code 0x1.0p1}
    {@code 3.0} {@code 0x1.8p1}
    {@code 0.5} {@code 0x1.0p-1}
    {@code 0.25} {@code 0x1.0p-2}
    {@code Float.MAX_VALUE}
    {@code 1.0} {@code 0x1.0p0}
    {@code -1.0} {@code -0x1.0p0}
    {@code 2.0} {@code 0x1.0p1}
    {@code 3.0} {@code 0x1.8p1}
    {@code 0.5} {@code 0x1.0p-1}
    {@code 0.25} {@code 0x1.0p-2}
    {@code Float.MAX_VALUE}{@code 0x1.fffffep127}
    {@code Minimum Normal Value}
    {@code Minimum Normal Value}{@code 0x1.0p-126}
    {@code Maximum Subnormal Value}
    {@code Maximum Subnormal Value}{@code 0x0.fffffep-126}
    {@code Float.MIN_VALUE}
    {@code Float.MIN_VALUE}{@code 0x0.000002p-126}
    diff --git a/jdk/src/java.base/share/classes/java/lang/String.java b/jdk/src/java.base/share/classes/java/lang/String.java index 6d06764c1b4..a41a4200b39 100644 --- a/jdk/src/java.base/share/classes/java/lang/String.java +++ b/jdk/src/java.base/share/classes/java/lang/String.java @@ -2208,29 +2208,29 @@ public final class String * Split example showing regex, limit, and result * * - * Regex - * Limit - * Result + * Regex + * Limit + * Result * * * - * : - * 2 + * : + * 2 * {@code { "boo", "and:foo" }} - * : - * 5 + * + * 5 * {@code { "boo", "and", "foo" }} - * : - * -2 + * + * -2 * {@code { "boo", "and", "foo" }} - * o - * 5 + * o + * 5 * {@code { "b", "", ":and:f", "", "" }} - * o - * -2 + * + * -2 * {@code { "b", "", ":and:f", "", "" }} - * o - * 0 + * + * 0 * {@code { "b", "", ":and:f" }} * * @@ -2336,14 +2336,14 @@ public final class String * Split examples showing regex and result * * - * Regex - * Result + * Regex + * Result * * * - * : + * : * {@code { "boo", "and", "foo" }} - * o + * o * {@code { "b", "", ":and:f" }} * * @@ -2460,36 +2460,37 @@ public final class String * Lowercase mapping examples showing language code of locale, upper case, lower case, and description * * - * Language Code of Locale - * Upper Case - * Lower Case - * Description + * Language Code of Locale + * Upper Case + * Lower Case + * Description * * * * * tr (Turkish) - * \u0130 + * \u0130 * \u0069 * capital letter I with dot above -> small letter i * * * tr (Turkish) - * \u0049 + * \u0049 * \u0131 * capital letter I -> small letter dotless i * * * (all) - * French Fries + * French Fries * french fries * lowercased all chars in String * * * (all) - * capiotacapchi + * + * capiotacapchi * capthetacapupsil - * capsigma + * capsigma * iotachi * thetaupsilon * sigma @@ -2546,34 +2547,34 @@ public final class String * Examples of locale-sensitive and 1:M case mappings. Shows Language code of locale, lower case, upper case, and description. * * - * Language Code of Locale - * Lower Case - * Upper Case - * Description + * Language Code of Locale + * Lower Case + * Upper Case + * Description * * * * * tr (Turkish) - * \u0069 + * \u0069 * \u0130 * small letter i -> capital letter I with dot above * * * tr (Turkish) - * \u0131 + * \u0131 * \u0049 * small letter dotless i -> capital letter I * * * (all) - * \u00df + * \u00df * \u0053 \u0053 * small letter sharp s -> two letters: SS * * * (all) - * Fahrvergnügen + * Fahrvergnügen * FAHRVERGNÜGEN * * diff --git a/jdk/src/java.base/share/classes/java/lang/System.java b/jdk/src/java.base/share/classes/java/lang/System.java index 995b2c4e90f..8388dce7562 100644 --- a/jdk/src/java.base/share/classes/java/lang/System.java +++ b/jdk/src/java.base/share/classes/java/lang/System.java @@ -583,7 +583,7 @@ public final class System { * system properties, a set of system properties is first created and * initialized. This set of system properties always includes values * for the following keys: - * + *
    * * * @@ -1049,26 +1049,28 @@ public final class System { * of corresponding severity. *
    The mapping is as follows: *

    - *
    Shows property keys and associated values
    Key
    + *
    * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * *
    System.Logger Severity Level Mapping
    System.Logger Levels{@link Logger.Level#ALL ALL}{@link Logger.Level#TRACE TRACE}{@link Logger.Level#DEBUG DEBUG}{@link Logger.Level#INFO INFO}{@link Logger.Level#WARNING WARNING}{@link Logger.Level#ERROR ERROR}{@link Logger.Level#OFF OFF}
    java.util.logging Levels{@link java.util.logging.Level#ALL ALL}{@link java.util.logging.Level#FINER FINER}{@link java.util.logging.Level#FINE FINE}{@link java.util.logging.Level#INFO INFO}{@link java.util.logging.Level#WARNING WARNING}{@link java.util.logging.Level#SEVERE SEVERE}{@link java.util.logging.Level#OFF OFF}
    System.Logger Levelsjava.util.logging Levels
    {@link Logger.Level#ALL ALL}{@link java.util.logging.Level#ALL ALL}
    {@link Logger.Level#TRACE TRACE}{@link java.util.logging.Level#FINER FINER}
    {@link Logger.Level#DEBUG DEBUG}{@link java.util.logging.Level#FINE FINE}
    {@link Logger.Level#INFO INFO}{@link java.util.logging.Level#INFO INFO}
    {@link Logger.Level#WARNING WARNING}{@link java.util.logging.Level#WARNING WARNING}
    {@link Logger.Level#ERROR ERROR}{@link java.util.logging.Level#SEVERE SEVERE}
    {@link Logger.Level#OFF OFF}{@link java.util.logging.Level#OFF OFF}
    * * @since 9 diff --git a/jdk/src/java.base/share/classes/java/lang/Thread.java b/jdk/src/java.base/share/classes/java/lang/Thread.java index 8ecc90dd964..5d25df81906 100644 --- a/jdk/src/java.base/share/classes/java/lang/Thread.java +++ b/jdk/src/java.base/share/classes/java/lang/Thread.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1994, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1994, 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 @@ -347,7 +347,7 @@ class Thread implements Runnable { * the calling thread indicates to the runtime that it is busy-waiting. * The runtime may take action to improve the performance of invoking * spin-wait loop constructions. - *

    + * * @apiNote * As an example consider a method in a class that spins in a loop until * some flag is set outside of that method. A call to the {@code onSpinWait} @@ -373,7 +373,7 @@ class Thread implements Runnable { * method was not called at all. However on some architectures the Java * Virtual Machine may issue the processor instructions to address such * code patterns in a more beneficial way. - *

    + * * @since 9 */ @HotSpotIntrinsicCandidate diff --git a/jdk/src/java.base/share/classes/java/lang/invoke/LambdaMetafactory.java b/jdk/src/java.base/share/classes/java/lang/invoke/LambdaMetafactory.java index 95719763b0f..b9bfd64432c 100644 --- a/jdk/src/java.base/share/classes/java/lang/invoke/LambdaMetafactory.java +++ b/jdk/src/java.base/share/classes/java/lang/invoke/LambdaMetafactory.java @@ -149,24 +149,24 @@ import java.util.Arrays; * capture argument (corresponding to the receiver) must be non-null. * *

    A type Q is considered adaptable to S as follows: - * + *
    * * - * + * * * * - * + * * * * * - * + * * * * * - * + * * * * - * + * * * diff --git a/jdk/src/java.base/share/classes/java/lang/invoke/MethodHandle.java b/jdk/src/java.base/share/classes/java/lang/invoke/MethodHandle.java index 6e913a84fd9..1c8eb5a1a9e 100644 --- a/jdk/src/java.base/share/classes/java/lang/invoke/MethodHandle.java +++ b/jdk/src/java.base/share/classes/java/lang/invoke/MethodHandle.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2008, 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 @@ -889,7 +889,7 @@ assertEquals("[A, B, C]", (String) caToString2.invokeExact('A', "BC".toCharArray *

    * This method behaves very much like {@link #asSpreader(Class, int)}, but accepts an additional {@code spreadArgPos} * argument to indicate at which position in the parameter list the spreading should take place. - *

    + * * @apiNote Example: *

    {@code
         MethodHandle compare = LOOKUP.findStatic(Objects.class, "compare", methodType(int.class, Object.class, Object.class, Comparator.class));
    @@ -1094,7 +1094,7 @@ assertEquals("[123]", (String) longsToString.invokeExact((long)123));
          * This method behaves very much like {@link #asCollector(Class, int)}, but differs in that its {@code
          * collectArgPos} argument indicates at which position in the parameter list arguments should be collected. This
          * index is zero-based.
    -     * 

    + * * @apiNote Examples: *

    {@code
         StringWriter swr = new StringWriter();
    diff --git a/jdk/src/java.base/share/classes/java/lang/invoke/MethodHandles.java b/jdk/src/java.base/share/classes/java/lang/invoke/MethodHandles.java
    index 45ccb909490..3671ab11833 100644
    --- a/jdk/src/java.base/share/classes/java/lang/invoke/MethodHandles.java
    +++ b/jdk/src/java.base/share/classes/java/lang/invoke/MethodHandles.java
    @@ -3353,7 +3353,7 @@ assert((int)twice.invokeExact(21) == 42);
          * That is, it returns a zero primitive value, a {@code null}, or {@code void}.
          * 

    The returned method handle is equivalent to * {@code dropArguments(zero(type.returnType()), 0, type.parameterList())}. - *

    + * * @apiNote Given a predicate and target, a useful "if-then" construct can be produced as * {@code guardWithTest(pred, target, empty(target.type())}. * @param type the type of the desired method handle @@ -3676,7 +3676,7 @@ assertEquals("xz", (String) d12.invokeExact("x", 12, true, "z")); * Given these assumptions, the result of an invocation of {@code dropArgumentsToMatch} will have the parameter type * list {@code S..., P..., M..., A...}, with the {@code P} and {@code A} types inserted as if by * {@link #dropArguments(MethodHandle, int, Class[])}. - *

    + * * @apiNote * Two method handles whose argument lists are "effectively identical" (i.e., identical in a common prefix) may be * mutually converted to a common type by two calls to {@code dropArgumentsToMatch}, as follows: @@ -4169,7 +4169,7 @@ assertEquals("boojum", (String) catTrace.invokeExact("boo", "jum")); * position in the parameter list at which folding takes place. The argument controlling this, {@code pos}, is a * zero-based index. The aforementioned method {@link #foldArguments(MethodHandle, MethodHandle)} assumes position * 0. - *

    + * * @apiNote Example: *

    {@code
         import static java.lang.invoke.MethodHandles.*;
    @@ -4698,7 +4698,7 @@ assertEquals("boojum", (String) catTrace.invokeExact("boo", "jum"));
          * Note that the parameter type lists {@code (V...)} and {@code (A...)} have been expanded
          * to their full length, even though individual clause functions may neglect to take them all.
          * As noted above, missing parameters are filled in as if by {@link #dropArgumentsToMatch}.
    -     * 

    + * * @apiNote Example: *

    {@code
          * // iterative implementation of the factorial function as a loop handle
    @@ -4991,7 +4991,7 @@ assertEquals("boojum", (String) catTrace.invokeExact("boo", "jum"));
          *   return v;
          * }
          * }
    - *

    + * * @apiNote Example: *

    {@code
          * // implement the zip function for lists as a loop handle
    @@ -5010,7 +5010,7 @@ assertEquals("boojum", (String) catTrace.invokeExact("boo", "jum"));
          * assertEquals(zipped, (List) loop.invoke(a.iterator(), b.iterator()));
          * }
    * - *

    + * * @apiNote The implementation of this method can be expressed as follows: *

    {@code
          * MethodHandle whileLoop(MethodHandle init, MethodHandle pred, MethodHandle body) {
    @@ -5104,7 +5104,7 @@ assertEquals("boojum", (String) catTrace.invokeExact("boo", "jum"));
          *   return v;
          * }
          * }
    - *

    + * * @apiNote Example: *

    {@code
          * // int i = 0; while (i < limit) { ++i; } return i; => limit
    @@ -5116,7 +5116,7 @@ assertEquals("boojum", (String) catTrace.invokeExact("boo", "jum"));
          * assertEquals(23, loop.invoke(23));
          * }
    * - *

    + * * @apiNote The implementation of this method can be expressed as follows: *

    {@code
          * MethodHandle doWhileLoop(MethodHandle init, MethodHandle body, MethodHandle pred) {
    @@ -5248,7 +5248,7 @@ assertEquals("boojum", (String) catTrace.invokeExact("boo", "jum"));
          *   return v;
          * }
          * }
    - *

    + * * @apiNote Example with a fully conformant body method: *

    {@code
          * // String s = "Lambdaman!"; for (int i = 0; i < 13; ++i) { s = "na " + s; } return s;
    @@ -5260,7 +5260,7 @@ assertEquals("boojum", (String) catTrace.invokeExact("boo", "jum"));
          * MethodHandle loop = MethodHandles.countedLoop(fit13, start, MH_step);
          * assertEquals("na na na na na na na na na na na na na Lambdaman!", loop.invoke("Lambdaman!"));
          * }
    - *

    + * * @apiNote Example with the simplest possible body method type, * and passing the number of iterations to the loop invocation: *

    {@code
    @@ -5273,7 +5273,7 @@ assertEquals("boojum", (String) catTrace.invokeExact("boo", "jum"));
          * MethodHandle loop = MethodHandles.countedLoop(count, start, MH_step);  // (v, i) -> "na " + v
          * assertEquals("na na na na na na na na na na na na na Lambdaman!", loop.invoke(13, "Lambdaman!"));
          * }
    - *

    + * * @apiNote Example that treats the number of iterations, string to append to, and string to append * as loop parameters: *

    {@code
    @@ -5286,7 +5286,7 @@ assertEquals("boojum", (String) catTrace.invokeExact("boo", "jum"));
          * MethodHandle loop = MethodHandles.countedLoop(count, start, MH_step);  // (v, i, _, pre, _) -> pre + " " + v
          * assertEquals("na na na na na na na na na na na na na Lambdaman!", loop.invoke(13, "na", "Lambdaman!"));
          * }
    - *

    + * * @apiNote Example that illustrates the usage of {@link #dropArgumentsToMatch(MethodHandle, int, List, int)} * to enforce a loop type: *

    {@code
    @@ -5301,7 +5301,7 @@ assertEquals("boojum", (String) catTrace.invokeExact("boo", "jum"));
          * MethodHandle loop = MethodHandles.countedLoop(count, start, body);  // (v, i, pre, _, _) -> pre + " " + v
          * assertEquals("na na na na na na na na na na na na na Lambdaman!", loop.invoke("na", 13, "Lambdaman!"));
          * }
    - *

    + * * @apiNote The implementation of this method can be expressed as follows: *

    {@code
          * MethodHandle countedLoop(MethodHandle iterations, MethodHandle init, MethodHandle body) {
    @@ -5406,7 +5406,6 @@ assertEquals("boojum", (String) catTrace.invokeExact("boo", "jum"));
          * }
          * }
    * - *

    * @apiNote The implementation of this method can be expressed as follows: *

    {@code
          * MethodHandle countedLoop(MethodHandle start, MethodHandle end, MethodHandle init, MethodHandle body) {
    @@ -5607,7 +5606,7 @@ assertEquals("boojum", (String) catTrace.invokeExact("boo", "jum"));
          *   return v;
          * }
          * }
    - *

    + * * @apiNote Example: *

    {@code
          * // get an iterator from a list
    @@ -5622,7 +5621,7 @@ assertEquals("boojum", (String) catTrace.invokeExact("boo", "jum"));
          * List reversedList = Arrays.asList("e", "d", "c", "b", "a");
          * assertEquals(reversedList, (List) loop.invoke(list));
          * }
    - *

    + * * @apiNote The implementation of this method can be expressed approximately as follows: *

    {@code
          * MethodHandle iteratedLoop(MethodHandle iterator, MethodHandle init, MethodHandle body) {
    diff --git a/jdk/src/java.base/share/classes/java/lang/invoke/package-info.java b/jdk/src/java.base/share/classes/java/lang/invoke/package-info.java
    index 7e4ce134ec0..e59b5ec9f43 100644
    --- a/jdk/src/java.base/share/classes/java/lang/invoke/package-info.java
    +++ b/jdk/src/java.base/share/classes/java/lang/invoke/package-info.java
    @@ -165,28 +165,33 @@
      * 

    * Given these rules, here are examples of legal bootstrap method declarations, * given various numbers {@code N} of extra arguments. - * The first rows (marked {@code *}) will work for any number of extra arguments. - *

    adaptable types
    QSLink-time checksInvocation-time checks
    QSLink-time checksInvocation-time checks
    PrimitivePrimitivePrimitivePrimitiveQ can be converted to S via a primitive widening conversionNone
    PrimitiveReferencePrimitiveReferenceS is a supertype of the Wrapper(Q)Cast from Wrapper(Q) to S
    ReferencePrimitiveReferencePrimitivefor parameter types: Q is a primitive wrapper and Primitive(Q) * can be widened to S *
    for return types: If Q is a primitive wrapper, check that @@ -175,7 +175,7 @@ import java.util.Arrays; * for example Number for numeric types
    ReferenceReferenceReferenceReferencefor parameter types: S is a supertype of Q *
    for return types: none
    Cast from Q to S
    + * The first row (marked {@code *}) will work for any number of extra arguments. + *
    * - * - * - * - * - * - * - * - * + * + * + * + * + * + * - * - * - * - * + * + * *
    Static argument types
    NSample bootstrap method
    *CallSite bootstrap(Lookup caller, String name, MethodType type, Object... args)
    * - * CallSite bootstrap(Object... args)
    * - * CallSite bootstrap(Object caller, Object... nameAndTypeWithArgs)
    0 - * CallSite bootstrap(Lookup caller, String name, MethodType type)
    0 - * CallSite bootstrap(Lookup caller, Object... nameAndType)
    1 + *
    NSample bootstrap method
    * + *
      + *
    • CallSite bootstrap(Lookup caller, String name, MethodType type, Object... args) + *
    • CallSite bootstrap(Object... args) + *
    • CallSite bootstrap(Object caller, Object... nameAndTypeWithArgs) + *
    0 + *
      + *
    • CallSite bootstrap(Lookup caller, String name, MethodType type) + *
    • CallSite bootstrap(Lookup caller, Object... nameAndType) + *
    1 * CallSite bootstrap(Lookup caller, String name, MethodType type, Object arg)
    2 - * CallSite bootstrap(Lookup caller, String name, MethodType type, Object... args)
    2 - * CallSite bootstrap(Lookup caller, String name, MethodType type, String... args)
    2CallSite bootstrap(Lookup caller, String name, MethodType type, String x, int y)
    2 + *
      + *
    • CallSite bootstrap(Lookup caller, String name, MethodType type, Object... args) + *
    • CallSite bootstrap(Lookup caller, String name, MethodType type, String... args) + *
    • CallSite bootstrap(Lookup caller, String name, MethodType type, String x, int y) + *
    * The last example assumes that the extra arguments are of type * {@code CONSTANT_String} and {@code CONSTANT_Integer}, respectively. diff --git a/jdk/src/java.base/share/classes/java/lang/reflect/AnnotatedElement.java b/jdk/src/java.base/share/classes/java/lang/reflect/AnnotatedElement.java index fd15669931b..c466c82f90c 100644 --- a/jdk/src/java.base/share/classes/java/lang/reflect/AnnotatedElement.java +++ b/jdk/src/java.base/share/classes/java/lang/reflect/AnnotatedElement.java @@ -108,27 +108,39 @@ import sun.reflect.annotation.AnnotationType; * * * - * - * + * + * + * + * + * + * + * + * * * - * + * + * * - * + * + * * - * + * + * * - * + * + * * - * + * + * * - * + * + * * * *
    Overview of kind of presence detected by different AnnotatedElement methods
    Kind of Presence
    MethodDirectly PresentIndirectly PresentPresentAssociated
    MethodKind of Presence
    Return TypeSignatureDirectly PresentIndirectly PresentPresentAssociated
    {@code T}{@link #getAnnotation(Class) getAnnotation(Class<T>)} - * X
    {@code T}{@link #getAnnotation(Class) getAnnotation(Class<T>)} + * X
    {@code Annotation[]}{@link #getAnnotations getAnnotations()} - * X
    {@code Annotation[]}{@link #getAnnotations getAnnotations()} + * X
    {@code T[]}{@link #getAnnotationsByType(Class) getAnnotationsByType(Class<T>)} - * X
    {@code T[]}{@link #getAnnotationsByType(Class) getAnnotationsByType(Class<T>)} + * X
    {@code T}{@link #getDeclaredAnnotation(Class) getDeclaredAnnotation(Class<T>)} - * X
    {@code T}{@link #getDeclaredAnnotation(Class) getDeclaredAnnotation(Class<T>)} + * X
    {@code Annotation[]}{@link #getDeclaredAnnotations getDeclaredAnnotations()} - * X
    {@code Annotation[]}{@link #getDeclaredAnnotations getDeclaredAnnotations()} + * X
    {@code T[]}{@link #getDeclaredAnnotationsByType(Class) getDeclaredAnnotationsByType(Class<T>)} - * XX
    {@code T[]}{@link #getDeclaredAnnotationsByType(Class) getDeclaredAnnotationsByType(Class<T>)} + * XX
    From 1b9cc2f7a257f09e4ed2192a0653e28b6a097d25 Mon Sep 17 00:00:00 2001 From: Jonathan Gibbons Date: Fri, 11 Aug 2017 14:07:14 -0700 Subject: [PATCH 24/26] 8186153: Fix a11y and HTML issues in the java.math, java.text and java.time packages Reviewed-by: lancea, bpb --- .../share/classes/java/math/BigDecimal.java | 18 +- .../share/classes/java/math/RoundingMode.java | 264 +++++++++--------- .../classes/java/text/MessageFormat.java | 126 ++++----- .../java/time/chrono/HijrahChronology.java | 30 +- .../classes/java/time/chrono/IsoEra.java | 16 +- .../classes/java/time/chrono/MinguoEra.java | 18 +- .../java/time/chrono/ThaiBuddhistEra.java | 18 +- .../java/time/format/DateTimeFormatter.java | 100 +++---- .../classes/java/time/temporal/IsoFields.java | 16 +- .../java/time/temporal/WeekFields.java | 24 +- 10 files changed, 315 insertions(+), 315 deletions(-) diff --git a/jdk/src/java.base/share/classes/java/math/BigDecimal.java b/jdk/src/java.base/share/classes/java/math/BigDecimal.java index f4e1f4985d6..cffed200b4e 100644 --- a/jdk/src/java.base/share/classes/java/math/BigDecimal.java +++ b/jdk/src/java.base/share/classes/java/math/BigDecimal.java @@ -120,18 +120,18 @@ import java.util.Arrays; * preferred scale for representing a result. The preferred * scale for each operation is listed in the table below. * - * - * + *
    Preferred Scales for Results of Arithmetic Operations - *
    + * * - * + * * * - * - * - * - * - * + * + * + * + * + * * *
    Preferred Scales for Results of Arithmetic Operations + *
    OperationPreferred Scale of Result
    OperationPreferred Scale of Result
    Addmax(addend.scale(), augend.scale())
    Subtractmax(minuend.scale(), subtrahend.scale())
    Multiplymultiplier.scale() + multiplicand.scale()
    Dividedividend.scale() - divisor.scale()
    Square rootradicand.scale()/2
    Addmax(addend.scale(), augend.scale())
    Subtractmax(minuend.scale(), subtrahend.scale())
    Multiplymultiplier.scale() + multiplicand.scale()
    Dividedividend.scale() - divisor.scale()
    Square rootradicand.scale()/2
    * diff --git a/jdk/src/java.base/share/classes/java/math/RoundingMode.java b/jdk/src/java.base/share/classes/java/math/RoundingMode.java index 79ecce36e7f..b4c37f66ed8 100644 --- a/jdk/src/java.base/share/classes/java/math/RoundingMode.java +++ b/jdk/src/java.base/share/classes/java/math/RoundingMode.java @@ -51,13 +51,13 @@ package java.math; * proper {@code MathContext}. A summary table showing the results * of these rounding operations for all rounding modes appears below. * - * + *
    * * - * * - * + * * * * @@ -66,18 +66,18 @@ package java.math; * * * - * + * * - * - * - * - * - * - * - * - * - * - * + * + * + * + * + * + * + * + * + * + * * *
    Summary of Rounding Operations Under Different Rounding Modes
    Result of rounding input to one digit with the given + *
    Input NumberResult of rounding input to one digit with the given * rounding mode
    Input Number {@code UP}{@code UP}{@code DOWN}{@code CEILING}{@code FLOOR}{@code HALF_EVEN}{@code UNNECESSARY}
    5.5 6 5 6 5 6 5 6 throw {@code ArithmeticException}
    2.5 3 2 3 2 3 2 2 throw {@code ArithmeticException}
    1.6 2 1 2 1 2 2 2 throw {@code ArithmeticException}
    1.1 2 1 2 1 1 1 1 throw {@code ArithmeticException}
    1.0 1 1 1 1 1 1 1 1
    -1.0 -1 -1 -1 -1 -1 -1 -1 -1
    -1.1 -2 -1 -1 -2 -1 -1 -1 throw {@code ArithmeticException}
    -1.6 -2 -1 -1 -2 -2 -2 -2 throw {@code ArithmeticException}
    -2.5 -3 -2 -2 -3 -3 -2 -2 throw {@code ArithmeticException}
    -5.5 -6 -5 -5 -6 -6 -5 -6 throw {@code ArithmeticException}
    5.5 6 5 6 5 6 5 6 throw {@code ArithmeticException}
    2.5 3 2 3 2 3 2 2 throw {@code ArithmeticException}
    1.6 2 1 2 1 2 2 2 throw {@code ArithmeticException}
    1.1 2 1 2 1 1 1 1 throw {@code ArithmeticException}
    1.0 1 1 1 1 1 1 1 1
    -1.0 -1 -1 -1 -1 -1 -1 -1 -1
    -1.1 -2 -1 -1 -2 -1 -1 -1 throw {@code ArithmeticException}
    -1.6 -2 -1 -1 -2 -2 -2 -2 throw {@code ArithmeticException}
    -2.5 -3 -2 -2 -3 -3 -2 -2 throw {@code ArithmeticException}
    -5.5 -6 -5 -5 -6 -6 -5 -6 throw {@code ArithmeticException}
    * @@ -104,23 +104,23 @@ public enum RoundingMode { * value. * *

    Example: - * - * + *
    Rounding mode UP Examples
    + * * - * - * + * - * - * - * - * - * - * - * - * - * - * - * + * + * + * + * + * + * + * + * + * + * + * * *
    Rounding mode UP Examples
    Input NumberInput rounded to one digit
    with {@code UP} rounding + *
    Input NumberInput rounded to one digit
    with {@code UP} rounding *
    5.5 6
    2.5 3
    1.6 2
    1.1 2
    1.0 1
    -1.0 -1
    -1.1 -2
    -1.6 -2
    -2.5 -3
    -5.5 -6
    5.5 6
    2.5 3
    1.6 2
    1.1 2
    1.0 1
    -1.0 -1
    -1.1 -2
    -1.6 -2
    -2.5 -3
    -5.5 -6
    */ @@ -132,23 +132,23 @@ public enum RoundingMode { * rounding mode never increases the magnitude of the calculated value. * *

    Example: - * - * + *
    Rounding mode DOWN Examples
    + * * - * - * + * - * - * - * - * - * - * - * - * - * - * - * + * + * + * + * + * + * + * + * + * + * + * * *
    Rounding mode DOWN Examples
    Input NumberInput rounded to one digit
    with {@code DOWN} rounding + *
    Input NumberInput rounded to one digit
    with {@code DOWN} rounding *
    5.5 5
    2.5 2
    1.6 1
    1.1 1
    1.0 1
    -1.0 -1
    -1.1 -1
    -1.6 -1
    -2.5 -2
    -5.5 -5
    5.5 5
    2.5 2
    1.6 1
    1.1 1
    1.0 1
    -1.0 -1
    -1.1 -1
    -1.6 -1
    -2.5 -2
    -5.5 -5
    */ @@ -161,23 +161,23 @@ public enum RoundingMode { * that this rounding mode never decreases the calculated value. * *

    Example: - * - * + *
    Rounding mode CEILING Examples
    + * * * * - * - * - * - * - * - * - * - * - * - * - * + * + * + * + * + * + * + * + * + * + * + * * *
    Rounding mode CEILING Examples
    Input NumberInput rounded to one digit
    with {@code CEILING} rounding *
    5.5 6
    2.5 3
    1.6 2
    1.1 2
    1.0 1
    -1.0 -1
    -1.1 -1
    -1.6 -1
    -2.5 -2
    -5.5 -5
    5.5 6
    2.5 3
    1.6 2
    1.1 2
    1.0 1
    -1.0 -1
    -1.1 -1
    -1.6 -1
    -2.5 -2
    -5.5 -5
    */ @@ -190,23 +190,23 @@ public enum RoundingMode { * this rounding mode never increases the calculated value. * *

    Example: - * - * + *
    Rounding mode FLOOR Examples
    + * * - * - * + * - * - * - * - * - * - * - * - * - * - * - * + * + * + * + * + * + * + * + * + * + * + * * *
    Rounding mode FLOOR Examples
    Input NumberInput rounded to one digit
    with {@code FLOOR} rounding + *
    Input NumberInput rounded to one digit
    with {@code FLOOR} rounding *
    5.5 5
    2.5 2
    1.6 1
    1.1 1
    1.0 1
    -1.0 -1
    -1.1 -2
    -1.6 -2
    -2.5 -3
    -5.5 -6
    5.5 5
    2.5 2
    1.6 1
    1.1 1
    1.0 1
    -1.0 -1
    -1.1 -2
    -1.6 -2
    -2.5 -3
    -5.5 -6
    */ @@ -221,23 +221,23 @@ public enum RoundingMode { * mode commonly taught at school. * *

    Example: - * - * + *
    Rounding mode HALF_UP Examples
    + * * - * - * + * - * - * - * - * - * - * - * - * - * - * - * + * + * + * + * + * + * + * + * + * + * + * * *
    Rounding mode HALF_UP Examples
    Input NumberInput rounded to one digit
    with {@code HALF_UP} rounding + *
    Input NumberInput rounded to one digit
    with {@code HALF_UP} rounding *
    5.5 6
    2.5 3
    1.6 2
    1.1 1
    1.0 1
    -1.0 -1
    -1.1 -1
    -1.6 -2
    -2.5 -3
    -5.5 -6
    5.5 6
    2.5 3
    1.6 2
    1.1 1
    1.0 1
    -1.0 -1
    -1.1 -1
    -1.6 -2
    -2.5 -3
    -5.5 -6
    */ @@ -251,23 +251,23 @@ public enum RoundingMode { * {@code RoundingMode.DOWN}. * *

    Example: - * - * + *
    Rounding mode HALF_DOWN Examples
    + * * - * - * + * - * - * - * - * - * - * - * - * - * - * - * + * + * + * + * + * + * + * + * + * + * + * * *
    Rounding mode HALF_DOWN Examples
    Input NumberInput rounded to one digit
    with {@code HALF_DOWN} rounding + *
    Input NumberInput rounded to one digit
    with {@code HALF_DOWN} rounding *
    5.5 5
    2.5 2
    1.6 2
    1.1 1
    1.0 1
    -1.0 -1
    -1.1 -1
    -1.6 -2
    -2.5 -2
    -5.5 -5
    5.5 5
    2.5 2
    1.6 2
    1.1 1
    1.0 1
    -1.0 -1
    -1.1 -1
    -1.6 -2
    -2.5 -2
    -5.5 -5
    */ @@ -288,23 +288,23 @@ public enum RoundingMode { * arithmetic in Java. * *

    Example: - * - * + *
    Rounding mode HALF_EVEN Examples
    + * * - * - * + * - * - * - * - * - * - * - * - * - * - * - * + * + * + * + * + * + * + * + * + * + * + * * *
    Rounding mode HALF_EVEN Examples
    Input NumberInput rounded to one digit
    with {@code HALF_EVEN} rounding + *
    Input NumberInput rounded to one digit
    with {@code HALF_EVEN} rounding *
    5.5 6
    2.5 2
    1.6 2
    1.1 1
    1.0 1
    -1.0 -1
    -1.1 -1
    -1.6 -2
    -2.5 -2
    -5.5 -6
    5.5 6
    2.5 2
    1.6 2
    1.1 1
    1.0 1
    -1.0 -1
    -1.1 -1
    -1.6 -2
    -2.5 -2
    -5.5 -6
    */ @@ -316,23 +316,23 @@ public enum RoundingMode { * specified on an operation that yields an inexact result, an * {@code ArithmeticException} is thrown. *

    Example: - * - * + *
    Rounding mode UNNECESSARY Examples
    + * * - * - * + * - * - * - * - * - * - * - * - * - * - * - * + * + * + * + * + * + * + * + * + * + * + * * *
    Rounding mode UNNECESSARY Examples
    Input NumberInput rounded to one digit
    with {@code UNNECESSARY} rounding + *
    Input NumberInput rounded to one digit
    with {@code UNNECESSARY} rounding *
    5.5 throw {@code ArithmeticException}
    2.5 throw {@code ArithmeticException}
    1.6 throw {@code ArithmeticException}
    1.1 throw {@code ArithmeticException}
    1.0 1
    -1.0 -1
    -1.1 throw {@code ArithmeticException}
    -1.6 throw {@code ArithmeticException}
    -2.5 throw {@code ArithmeticException}
    -5.5 throw {@code ArithmeticException}
    5.5 throw {@code ArithmeticException}
    2.5 throw {@code ArithmeticException}
    1.6 throw {@code ArithmeticException}
    1.1 throw {@code ArithmeticException}
    1.0 1
    -1.0 -1
    -1.1 throw {@code ArithmeticException}
    -1.6 throw {@code ArithmeticException}
    -2.5 throw {@code ArithmeticException}
    -5.5 throw {@code ArithmeticException}
    */ diff --git a/jdk/src/java.base/share/classes/java/text/MessageFormat.java b/jdk/src/java.base/share/classes/java/text/MessageFormat.java index b80eb054f51..dfed999a5df 100644 --- a/jdk/src/java.base/share/classes/java/text/MessageFormat.java +++ b/jdk/src/java.base/share/classes/java/text/MessageFormat.java @@ -150,73 +150,73 @@ import java.util.Locale; * Shows how FormatType and FormatStyle values map to Format instances * * - * FormatType - * FormatStyle - * Subformat Created + * FormatType + * FormatStyle + * Subformat Created * * * - * (none) - * (none) - * null + * (none) + * (none) + * {@code null} * - * number - * (none) - * {@link NumberFormat#getInstance(Locale) NumberFormat.getInstance}{@code (getLocale())} + * {@code number} + * (none) + * {@link NumberFormat#getInstance(Locale) NumberFormat.getInstance}{@code (getLocale())} * - * integer - * {@link NumberFormat#getIntegerInstance(Locale) NumberFormat.getIntegerInstance}{@code (getLocale())} + * {@code integer} + * {@link NumberFormat#getIntegerInstance(Locale) NumberFormat.getIntegerInstance}{@code (getLocale())} * - * currency - * {@link NumberFormat#getCurrencyInstance(Locale) NumberFormat.getCurrencyInstance}{@code (getLocale())} + * {@code currency} + * {@link NumberFormat#getCurrencyInstance(Locale) NumberFormat.getCurrencyInstance}{@code (getLocale())} * - * percent - * {@link NumberFormat#getPercentInstance(Locale) NumberFormat.getPercentInstance}{@code (getLocale())} + * {@code percent} + * {@link NumberFormat#getPercentInstance(Locale) NumberFormat.getPercentInstance}{@code (getLocale())} * - * SubformatPattern - * {@code new} {@link DecimalFormat#DecimalFormat(String,DecimalFormatSymbols) DecimalFormat}{@code (subformatPattern,} {@link DecimalFormatSymbols#getInstance(Locale) DecimalFormatSymbols.getInstance}{@code (getLocale()))} + * SubformatPattern + * {@code new} {@link DecimalFormat#DecimalFormat(String,DecimalFormatSymbols) DecimalFormat}{@code (subformatPattern,} {@link DecimalFormatSymbols#getInstance(Locale) DecimalFormatSymbols.getInstance}{@code (getLocale()))} * - * date - * (none) - * {@link DateFormat#getDateInstance(int,Locale) DateFormat.getDateInstance}{@code (}{@link DateFormat#DEFAULT}{@code , getLocale())} + * {@code date} + * (none) + * {@link DateFormat#getDateInstance(int,Locale) DateFormat.getDateInstance}{@code (}{@link DateFormat#DEFAULT}{@code , getLocale())} * - * short - * {@link DateFormat#getDateInstance(int,Locale) DateFormat.getDateInstance}{@code (}{@link DateFormat#SHORT}{@code , getLocale())} + * {@code short} + * {@link DateFormat#getDateInstance(int,Locale) DateFormat.getDateInstance}{@code (}{@link DateFormat#SHORT}{@code , getLocale())} * - * medium - * {@link DateFormat#getDateInstance(int,Locale) DateFormat.getDateInstance}{@code (}{@link DateFormat#DEFAULT}{@code , getLocale())} + * {@code medium} + * {@link DateFormat#getDateInstance(int,Locale) DateFormat.getDateInstance}{@code (}{@link DateFormat#DEFAULT}{@code , getLocale())} * - * long - * {@link DateFormat#getDateInstance(int,Locale) DateFormat.getDateInstance}{@code (}{@link DateFormat#LONG}{@code , getLocale())} + * {@code long} + * {@link DateFormat#getDateInstance(int,Locale) DateFormat.getDateInstance}{@code (}{@link DateFormat#LONG}{@code , getLocale())} * - * full - * {@link DateFormat#getDateInstance(int,Locale) DateFormat.getDateInstance}{@code (}{@link DateFormat#FULL}{@code , getLocale())} + * {@code full} + * {@link DateFormat#getDateInstance(int,Locale) DateFormat.getDateInstance}{@code (}{@link DateFormat#FULL}{@code , getLocale())} * - * SubformatPattern - * {@code new} {@link SimpleDateFormat#SimpleDateFormat(String,Locale) SimpleDateFormat}{@code (subformatPattern, getLocale())} + * SubformatPattern + * {@code new} {@link SimpleDateFormat#SimpleDateFormat(String,Locale) SimpleDateFormat}{@code (subformatPattern, getLocale())} * - * time - * (none) - * {@link DateFormat#getTimeInstance(int,Locale) DateFormat.getTimeInstance}{@code (}{@link DateFormat#DEFAULT}{@code , getLocale())} + * {@code time} + * (none) + * {@link DateFormat#getTimeInstance(int,Locale) DateFormat.getTimeInstance}{@code (}{@link DateFormat#DEFAULT}{@code , getLocale())} * - * short - * {@link DateFormat#getTimeInstance(int,Locale) DateFormat.getTimeInstance}{@code (}{@link DateFormat#SHORT}{@code , getLocale())} + * {@code short} + * {@link DateFormat#getTimeInstance(int,Locale) DateFormat.getTimeInstance}{@code (}{@link DateFormat#SHORT}{@code , getLocale())} * - * medium - * {@link DateFormat#getTimeInstance(int,Locale) DateFormat.getTimeInstance}{@code (}{@link DateFormat#DEFAULT}{@code , getLocale())} + * {@code medium} + * {@link DateFormat#getTimeInstance(int,Locale) DateFormat.getTimeInstance}{@code (}{@link DateFormat#DEFAULT}{@code , getLocale())} * - * long - * {@link DateFormat#getTimeInstance(int,Locale) DateFormat.getTimeInstance}{@code (}{@link DateFormat#LONG}{@code , getLocale())} + * {@code long} + * {@link DateFormat#getTimeInstance(int,Locale) DateFormat.getTimeInstance}{@code (}{@link DateFormat#LONG}{@code , getLocale())} * - * full - * {@link DateFormat#getTimeInstance(int,Locale) DateFormat.getTimeInstance}{@code (}{@link DateFormat#FULL}{@code , getLocale())} + * {@code full} + * {@link DateFormat#getTimeInstance(int,Locale) DateFormat.getTimeInstance}{@code (}{@link DateFormat#FULL}{@code , getLocale())} * - * SubformatPattern - * {@code new} {@link SimpleDateFormat#SimpleDateFormat(String,Locale) SimpleDateFormat}{@code (subformatPattern, getLocale())} + * SubformatPattern + * {@code new} {@link SimpleDateFormat#SimpleDateFormat(String,Locale) SimpleDateFormat}{@code (subformatPattern, getLocale())} * - * choice - * SubformatPattern - * {@code new} {@link ChoiceFormat#ChoiceFormat(String) ChoiceFormat}{@code (subformatPattern)} + * {@code choice} + * SubformatPattern + * {@code new} {@link ChoiceFormat#ChoiceFormat(String) ChoiceFormat}{@code (subformatPattern)} * * * @@ -776,44 +776,40 @@ public class MessageFormat extends Format { * Examples of subformat,argument,and formatted text * * - * Subformat - * Argument - * Formatted Text + * Subformat + * Argument + * Formatted Text * * * - * any - * unavailable + * any + * unavailable * "{" + argumentIndex + "}" * - * any - * null + * null * "null" * - * instanceof ChoiceFormat - * any + * instanceof ChoiceFormat + * any * subformat.format(argument).indexOf('{') >= 0 ?
    * (new MessageFormat(subformat.format(argument), getLocale())).format(argument) : * subformat.format(argument)
    * - * != null - * any + * != null + * any * subformat.format(argument) * - * null - * instanceof Number + * null + * instanceof Number * NumberFormat.getInstance(getLocale()).format(argument) * - * null - * instanceof Date + * instanceof Date * DateFormat.getDateTimeInstance(DateFormat.SHORT, DateFormat.SHORT, getLocale()).format(argument) * - * null - * instanceof String + * instanceof String * argument * - * null - * any + * any * argument.toString() * * diff --git a/jdk/src/java.base/share/classes/java/time/chrono/HijrahChronology.java b/jdk/src/java.base/share/classes/java/time/chrono/HijrahChronology.java index 0ec1b591bc2..bc702a44d07 100644 --- a/jdk/src/java.base/share/classes/java/time/chrono/HijrahChronology.java +++ b/jdk/src/java.base/share/classes/java/time/chrono/HijrahChronology.java @@ -103,19 +103,19 @@ import sun.util.logging.PlatformLogger; * *

    * CLDR and LDML identify variants: - * + *
    * * * - * - * - * - * + * + * + * + * * * * * - * + * * * * @@ -148,38 +148,38 @@ import sun.util.logging.PlatformLogger; *

    * The Hijrah property resource is a set of properties that describe the calendar. * The syntax is defined by {@code java.util.Properties#load(Reader)}. - *

    Variants of Hijrah Calendars
    Chronology IDCalendar TypeLocale extension, see {@link java.util.Locale}DescriptionChronology IDCalendar TypeLocale extension, see {@link java.util.Locale}Description
    Hijrah-umalquraHijrah-umalquraislamic-umalquraca-islamic-umalquraIslamic - Umm Al-Qura calendar of Saudi Arabia
    + *
    * * * - * - * - * + * + * + * * * * * - * + * * * * * - * + * * * * * - * + * * * * * - * + * * * * * - * + * * *
    Configuration of Hijrah Calendar
    Property Name Property value Description Property NameProperty valueDescription
    ididChronology Id, for example, "Hijrah-umalqura"The Id of the calendar in common usage
    typetypeCalendar type, for example, "islamic-umalqura"LDML defines the calendar types
    versionversionVersion, for example: "1.8.0_1"The version of the Hijrah variant data
    iso-startiso-startISO start date, formatted as {@code yyyy-MM-dd}, for example: "1900-04-30"The ISO date of the first day of the minimum Hijrah year.
    yyyy - a numeric 4 digit year, for example "1434"yyyy - a numeric 4 digit year, for example "1434"The value is a sequence of 12 month lengths, * for example: "29 30 29 30 29 30 30 30 29 30 29 29"The lengths of the 12 months of the year separated by whitespace. diff --git a/jdk/src/java.base/share/classes/java/time/chrono/IsoEra.java b/jdk/src/java.base/share/classes/java/time/chrono/IsoEra.java index 702fabdf920..887d76f72b6 100644 --- a/jdk/src/java.base/share/classes/java/time/chrono/IsoEra.java +++ b/jdk/src/java.base/share/classes/java/time/chrono/IsoEra.java @@ -70,27 +70,27 @@ import java.time.DateTimeException; * A definition has therefore been created with two eras - 'Current era' (CE) for * years on or after 0001-01-01 (ISO), and 'Before current era' (BCE) for years before that. * - * + *
    * * * - * - * - * + * + * + * * * * * - * + * * * - * + * * * - * + * * * - * + * * * *
    ISO years and eras
    year-of-eraeraproleptic-yearyear-of-eraeraproleptic-year
    2CE22CE2
    1CE11CE1
    1BCE01BCE0
    2BCE-12BCE-1
    diff --git a/jdk/src/java.base/share/classes/java/time/chrono/MinguoEra.java b/jdk/src/java.base/share/classes/java/time/chrono/MinguoEra.java index edac0ec02e7..9c227884994 100644 --- a/jdk/src/java.base/share/classes/java/time/chrono/MinguoEra.java +++ b/jdk/src/java.base/share/classes/java/time/chrono/MinguoEra.java @@ -71,28 +71,28 @@ import java.time.DateTimeException; * All previous years, zero or earlier in the proleptic count or one and greater * in the year-of-era count, are part of the 'Before Republic of China' era. * - * + *
    * * * - * - * - * - * + * + * + * + * * * * * - * + * * * - * + * * * - * + * * * - * + * * * *
    Minguo years and eras
    year-of-eraeraproleptic-yearISO proleptic-yearyear-of-eraeraproleptic-yearISO proleptic-year
    2ROC219132ROC21913
    1ROC119121ROC11912
    1BEFORE_ROC019111BEFORE_ROC01911
    2BEFORE_ROC-119102BEFORE_ROC-11910
    diff --git a/jdk/src/java.base/share/classes/java/time/chrono/ThaiBuddhistEra.java b/jdk/src/java.base/share/classes/java/time/chrono/ThaiBuddhistEra.java index 53cb5d870be..46c0f112bd5 100644 --- a/jdk/src/java.base/share/classes/java/time/chrono/ThaiBuddhistEra.java +++ b/jdk/src/java.base/share/classes/java/time/chrono/ThaiBuddhistEra.java @@ -71,28 +71,28 @@ import java.time.DateTimeException; * All previous years, zero or earlier in the proleptic count or one and greater * in the year-of-era count, are part of the 'Before Buddhist' era. * - * + *
    * * * - * - * - * - * + * + * + * + * * * * * - * + * * * - * + * * * - * + * * * - * + * * * *
    Buddhist years and eras
    year-of-eraeraproleptic-yearISO proleptic-yearyear-of-eraeraproleptic-yearISO proleptic-year
    2BE2-5422BE2-542
    1BE1-5431BE1-543
    1BEFORE_BE0-5441BEFORE_BE0-544
    2BEFORE_BE-1-5452BEFORE_BE-1-545
    diff --git a/jdk/src/java.base/share/classes/java/time/format/DateTimeFormatter.java b/jdk/src/java.base/share/classes/java/time/format/DateTimeFormatter.java index 7315a9a3544..79d2f061508 100644 --- a/jdk/src/java.base/share/classes/java/time/format/DateTimeFormatter.java +++ b/jdk/src/java.base/share/classes/java/time/format/DateTimeFormatter.java @@ -150,13 +150,13 @@ import java.util.Set; * implementation of {@code java.text.Format}. * *

    Predefined Formatters

    - * + *
    * * * - * - * - * + * + * + * * * * @@ -276,56 +276,60 @@ import java.util.Set; *

    * All letters 'A' to 'Z' and 'a' to 'z' are reserved as pattern letters. The * following pattern letters are defined: - *

    - *  Symbol  Meaning                     Presentation      Examples
    - *  ------  -------                     ------------      -------
    - *   G       era                         text              AD; Anno Domini; A
    - *   u       year                        year              2004; 04
    - *   y       year-of-era                 year              2004; 04
    - *   D       day-of-year                 number            189
    - *   M/L     month-of-year               number/text       7; 07; Jul; July; J
    - *   d       day-of-month                number            10
    - *   g       modified-julian-day         number            2451334
    + * 
    Predefined Formatters
    FormatterDescriptionExampleFormatterDescriptionExample
    + * + * + * + * + * + * + * + * + * + * + * + * * - * Q/q quarter-of-year number/text 3; 03; Q3; 3rd quarter - * Y week-based-year year 1996; 96 - * w week-of-week-based-year number 27 - * W week-of-month number 4 - * E day-of-week text Tue; Tuesday; T - * e/c localized day-of-week number/text 2; 02; Tue; Tuesday; T - * F day-of-week-in-month number 3 + * + * + * + * + * + * + * * - * a am-pm-of-day text PM - * h clock-hour-of-am-pm (1-12) number 12 - * K hour-of-am-pm (0-11) number 0 - * k clock-hour-of-day (1-24) number 24 + * + * + * + * * - * H hour-of-day (0-23) number 0 - * m minute-of-hour number 30 - * s second-of-minute number 55 - * S fraction-of-second fraction 978 - * A milli-of-day number 1234 - * n nano-of-second number 987654321 - * N nano-of-day number 1234000000 + * + * + * + * + * + * + * * - * V time-zone ID zone-id America/Los_Angeles; Z; -08:30 - * v generic time-zone name zone-name Pacific Time; PT - * z time-zone name zone-name Pacific Standard Time; PST - * O localized zone-offset offset-O GMT+8; GMT+08:00; UTC-08:00 - * X zone-offset 'Z' for zero offset-X Z; -08; -0830; -08:30; -083015; -08:30:15 - * x zone-offset offset-x +0000; -08; -0830; -08:30; -083015; -08:30:15 - * Z zone-offset offset-Z +0000; -0800; -08:00 + * + * + * + * + * + * + * * - * p pad next pad modifier 1 + * * - * ' escape for text delimiter - * '' single quote literal ' - * [ optional section start - * ] optional section end - * # reserved for future use - * { reserved for future use - * } reserved for future use - * + * + * + * + * + * + * + * + * + *
    Pattern Letters and Symbols
    Symbol Meaning Presentation Examples
    G era text AD; Anno Domini; A
    u year year 2004; 04
    y year-of-era year 2004; 04
    D day-of-year number 189
    M/L month-of-year number/text 7; 07; Jul; July; J
    d day-of-month number 10
    g modified-julian-day number 2451334
    Q/q quarter-of-year number/text 3; 03; Q3; 3rd quarter
    Y week-based-year year 1996; 96
    w week-of-week-based-year number 27
    W week-of-month number 4
    E day-of-week text Tue; Tuesday; T
    e/c localized day-of-week number/text 2; 02; Tue; Tuesday; T
    F day-of-week-in-month number 3
    a am-pm-of-day text PM
    h clock-hour-of-am-pm (1-12) number 12
    K hour-of-am-pm (0-11) number 0
    k clock-hour-of-day (1-24) number 24
    H hour-of-day (0-23) number 0
    m minute-of-hour number 30
    s second-of-minute number 55
    S fraction-of-second fraction 978
    A milli-of-day number 1234
    n nano-of-second number 987654321
    N nano-of-day number 1234000000
    V time-zone ID zone-id America/Los_Angeles; Z; -08:30
    v generic time-zone name zone-name Pacific Time; PT
    z time-zone name zone-name Pacific Standard Time; PST
    O localized zone-offset offset-O GMT+8; GMT+08:00; UTC-08:00
    X zone-offset 'Z' for zero offset-X Z; -08; -0830; -08:30; -083015; -08:30:15
    x zone-offset offset-x +0000; -08; -0830; -08:30; -083015; -08:30:15
    Z zone-offset offset-Z +0000; -0800; -08:00
    p pad next pad modifier 1
    ' escape for text delimiter
    '' single quote literal '
    [ optional section start
    ] optional section end
    # reserved for future use
    { reserved for future use
    } reserved for future use
    *

    * The count of pattern letters determines the format. *

    diff --git a/jdk/src/java.base/share/classes/java/time/temporal/IsoFields.java b/jdk/src/java.base/share/classes/java/time/temporal/IsoFields.java index 9740a9defc0..0b910830126 100644 --- a/jdk/src/java.base/share/classes/java/time/temporal/IsoFields.java +++ b/jdk/src/java.base/share/classes/java/time/temporal/IsoFields.java @@ -136,18 +136,18 @@ import sun.util.locale.provider.LocaleResources; *

    * For example: * - * + *
    * * - * + * * * - * - * - * - * - * - * + * + * + * + * + * + * * *
    Examples of Week based Years
    DateDay-of-weekField values
    DateDay-of-weekField values
    2008-12-28SundayWeek 52 of week-based-year 2008
    2008-12-29MondayWeek 1 of week-based-year 2009
    2008-12-31WednesdayWeek 1 of week-based-year 2009
    2009-01-01ThursdayWeek 1 of week-based-year 2009
    2009-01-04SundayWeek 1 of week-based-year 2009
    2009-01-05MondayWeek 2 of week-based-year 2009
    2008-12-28SundayWeek 52 of week-based-year 2008
    2008-12-29MondayWeek 1 of week-based-year 2009
    2008-12-31WednesdayWeek 1 of week-based-year 2009
    2009-01-01ThursdayWeek 1 of week-based-year 2009
    2009-01-04SundayWeek 1 of week-based-year 2009
    2009-01-05MondayWeek 2 of week-based-year 2009
    * diff --git a/jdk/src/java.base/share/classes/java/time/temporal/WeekFields.java b/jdk/src/java.base/share/classes/java/time/temporal/WeekFields.java index 2f13368d28f..60478772d9f 100644 --- a/jdk/src/java.base/share/classes/java/time/temporal/WeekFields.java +++ b/jdk/src/java.base/share/classes/java/time/temporal/WeekFields.java @@ -130,17 +130,17 @@ import sun.util.locale.provider.LocaleResources; * * * - * - * + * + * * * - * + * * - * + * * - * + * * - * + * * * *
    Examples of WeekFields
    DateDay-of-weekFirst day: Monday
    Minimal days: 4
    First day: Monday
    Minimal days: 5
    DateDay-of-weekFirst day: Monday
    Minimal days: 4
    First day: Monday
    Minimal days: 5
    2008-12-31Wednesday
    2008-12-31WednesdayWeek 5 of December 2008Week 5 of December 2008
    2009-01-01Thursday
    2009-01-01ThursdayWeek 1 of January 2009Week 0 of January 2009
    2009-01-04Sunday
    2009-01-04SundayWeek 1 of January 2009Week 0 of January 2009
    2009-01-05Monday
    2009-01-05MondayWeek 2 of January 2009Week 1 of January 2009
    @@ -164,17 +164,17 @@ import sun.util.locale.provider.LocaleResources; * * * - * - * + * + * * * - * + * * - * + * * - * + * * - * + * * * *
    Examples of WeekFields for week-based-year
    DateDay-of-weekFirst day: Monday
    Minimal days: 4
    First day: Monday
    Minimal days: 5
    DateDay-of-weekFirst day: Monday
    Minimal days: 4
    First day: Monday
    Minimal days: 5
    2008-12-31Wednesday
    2008-12-31WednesdayWeek 1 of 2009Week 53 of 2008
    2009-01-01Thursday
    2009-01-01ThursdayWeek 1 of 2009Week 53 of 2008
    2009-01-04Sunday
    2009-01-04SundayWeek 1 of 2009Week 53 of 2008
    2009-01-05Monday
    2009-01-05MondayWeek 2 of 2009Week 1 of 2009
    From 577dc3fca285ea8086098d236b4159f0d4e9a739 Mon Sep 17 00:00:00 2001 From: Brian Burkhalter Date: Fri, 11 Aug 2017 15:44:44 -0700 Subject: [PATCH 25/26] 8186157: (scanner) Modify java/util/Scanner/ScanTest.java to fail if Engilsh Locale unavailable Fail if the English locale is not available on the system Reviewed-by: lancea --- jdk/test/java/util/Scanner/ScanTest.java | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/jdk/test/java/util/Scanner/ScanTest.java b/jdk/test/java/util/Scanner/ScanTest.java index 0f1abcbd8b5..44ee2b0b463 100644 --- a/jdk/test/java/util/Scanner/ScanTest.java +++ b/jdk/test/java/util/Scanner/ScanTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2016, 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 @@ -59,7 +59,14 @@ public class ScanTest { !"ja".equals(lang)) { //Before we have resource to improve the test to be ready for //arbitrary locale, force the default locale to be "English" - //for now. + //for now. First we check whether the "English" locale is + //available on the system as it could be absent due to varying + //configurations. + if (!Arrays.asList(Locale.getAvailableLocales()) + .contains(Locale.ENGLISH)) { + throw new RuntimeException + ("The \"English\" Locale is unavailable on this system"); + } Locale.setDefault(Locale.ENGLISH); } skipTest(); From 34afeced211cd7115e2529b043c1e57dfa1291fe Mon Sep 17 00:00:00 2001 From: Goetz Lindenmaier Date: Fri, 28 Jul 2017 14:06:28 +0200 Subject: [PATCH 26/26] 8185500: [TESTBUG] Add keywords headful/printer in java/awt and javax tests Add new keyword 'printer'. Some minor test fixes to show headless exception. Add some @requires windows. Reviewed-by: serb, mbaesken --- jdk/test/TEST.ROOT | 6 ++-- .../DefaultMenuBar/DefaultMenuBarTest.java | 5 ++-- .../ScreenMenu/ScreenMenuMemoryLeakTest.java | 7 +++-- .../awt/Choice/ChoiceHiDpi/ChoiceTest.java | 5 ++-- .../DesktopGtkLoadTest.java | 6 ++-- .../Dialog/CloseDialog/CloseDialogTest.java | 4 ++- .../Modal/NestedModalDialogTest.java | 24 ++++++++------- .../Modeless/NestedModelessDialogTest.java | 24 ++++++++------- .../DisplayChangedTest.java | 30 ++++++++----------- .../EmbeddedFrameGrabTest.java | 27 ++++++++--------- .../LoopRobustness/LoopRobustness.html | 3 +- .../awt/EventQueue/6980209/bug6980209.java | 14 +++++---- .../FileDialogIconTest.java | 10 ++++--- .../FocusEmbeddedFrameTest.java | 29 +++++++++--------- .../ButtonGroupLayoutTraversalTest.java | 16 +++++----- .../RequestFocusByCauseTest.java | 20 +++++++------ .../java/awt/FontClass/HelvLtOblTest.java | 5 ++-- .../FontClass/SurrogateTest/SuppCharTest.java | 5 ++-- .../awt/Frame/8158918/SetExtendedState.java | 6 ++-- .../DecoratedFrameInsetsTest.java | 5 ++-- .../ExceptionOnSetExtendedStateTest.java | 16 +++++----- .../MaximizedByPlatform.java | 10 ++++--- .../NormalToIconifiedTest.java | 5 ++-- .../MaximizedMovedWindow.java | 6 ++-- .../SetMaximizedBounds.java | 6 ++-- .../Frame/WindowDragTest/WindowDragTest.java | 21 ++++++------- .../CurrentDisplayModeTest.java | 3 +- .../DisplayModes/CompareToXrandrTest.java | 3 +- .../DefaultPolicyChange_Swing.java | 17 ++++++----- .../java/awt/MenuBar/8007006/bug8007006.java | 5 ++-- .../FullscreenEnterEventTest.java | 6 ++-- .../HiDPIMouseClick/HiDPIRobotMouseClick.java | 7 +++-- .../HiDPIRobotScreenCaptureTest.java | 7 +++-- .../ScrollbarMouseWheelTest.java | 4 ++- .../FullScreenAfterSplash.java | 4 ++- .../unix/UnixMultiResolutionSplashTest.java | 4 ++- .../AutoScrollOnSelectAndAppend.java | 15 +++++----- .../OverScrollTest/OverScrollTest.java | 15 +++++----- .../OverScrollTest/OverScrollTest.java | 15 +++++----- .../GetScreenLocationTest.java | 3 +- .../SetWindowLocationByPlatformTest.java | 7 +++-- .../IOExceptionIfEncodedURLTest.java | 21 ++++++------- .../IOExceptionIfEncodedURLTest.sh | 1 + .../MultiResolutionDragImageTest.java | 3 +- .../HTMLDataFlavors/HTMLDataFlavorTest.java | 26 ++++++++-------- .../event/KeyEvent/8020209/bug8020209.java | 5 ++-- .../DeadKey/DeadKeyMacOSXInputText.java | 6 ++-- .../event/KeyEvent/DeadKey/deadKeyMacOSX.java | 5 ++-- .../awt/font/TextLayout/TestSinhalaChar.java | 4 ++- .../HiDPIPropertiesWindowsTest.java | 6 ++-- .../java/awt/im/6396526/IMLookAndFeel.java | 11 +++---- jdk/test/java/awt/im/8041990/bug8041990.java | 17 ++++++----- .../awt/image/MultiResolutionImageTest.java | 4 ++- .../multiresolution/Corrupted2XImageTest.java | 5 ++-- .../MultiResolutionToolkitImageTest.java | 4 ++- .../awt/keyboard/AllKeyCode/AllKeyCode.java | 15 +++++----- .../AltPlusNumberKeyCombinationsTest.java | 19 ++++++------ .../awt/print/PrinterJob/CheckPrivilege.java | 3 +- .../awt/print/PrinterJob/ExceptionTest.java | 1 + .../ImagePrinting/NullClipARGB.java | 3 +- .../java/awt/print/PrinterJob/Margins.java | 3 +- .../java/awt/print/PrinterJob/PaintText.java | 3 +- .../awt/print/PrinterJob/PrintCrashTest.java | 3 +- .../awt/print/PrinterJob/PrintTextPane.java | 15 +++++----- .../awt/print/PrinterJob/PrtException.java | 16 +++++----- jdk/test/javax/print/CheckDupFlavor.java | 6 ++-- jdk/test/javax/print/PrintSE/PrintSE.sh | 7 +++-- .../javax/print/attribute/AttributeTest.java | 6 ++-- .../print/attribute/GetCopiesSupported.java | 16 +++++----- .../print/attribute/SidesPageRangesTest.java | 9 ++++-- .../attribute/SupportedPrintableAreas.java | 5 ++-- .../JButton/8151303/PressedIconTest.java | 4 ++- .../6567433/UpdateUIRecursionTest.java | 6 ++-- .../swing/JComboBox/8019180/Test8019180.java | 5 ++-- .../8041909/ActionListenerExceptionTest.java | 14 +++++---- .../WindowsComboBoxSizeTest.java | 3 +- .../swing/JComponent/4337267/bug4337267.java | 5 ++-- .../swing/JComponent/8043610/bug8043610.java | 19 ++++++------ .../swing/JDialog/6639507/bug6639507.java | 15 ++++++---- .../JFileChooser/6713352/bug6713352.java | 18 ++++++----- .../JFileChooser/6817933/Test6817933.java | 6 ++-- .../JFileChooser/8010718/bug8010718.java | 4 ++- .../JFileChooser/8013442/Test8013442.java | 5 ++-- .../8152677/SelectAllFilesFilterTest.java | 5 ++-- .../swing/JFrame/8016356/bug8016356.java | 21 +++++++------ .../NSTexturedJFrame/NSTexturedJFrame.java | 4 ++- .../6288609/TestJInternalFrameDispose.java | 6 ++-- .../JInternalFrame/8075314/bug8075314.java | 21 ++++++------- .../8145060/TestJInternalFrameMinimize.java | 4 ++- .../8160248/JInternalFrameDraggingTest.java | 4 ++- .../DockIconRepaint/DockIconRepaint.java | 4 ++- .../swing/JInternalFrame/Test6325652.java | 5 ++-- .../JList/6567433/UpdateUIRecursionTest.java | 6 ++-- .../javax/swing/JList/8161483/Bug8161483.java | 9 +++--- .../javax/swing/JMenu/6538132/bug6538132.java | 22 ++++++++------ .../javax/swing/JMenu/8067346/bug8067346.java | 15 ++++++---- .../8139169/ScreenMenuBarInputTwice.java | 7 +++-- .../JMenuItem/8152981/MenuItemIconTest.java | 6 ++-- .../CloseOnMouseClickPropertyTest.java | 9 ++++-- .../ActionListenerCalledTwiceTest.java | 4 ++- .../ClickMenuTestManual.java | 7 +++-- .../swing/JOptionPane/8081019/bug8081019.java | 3 +- .../swing/JPopupMenu/6217905/bug6217905.java | 23 +++++++------- .../swing/JPopupMenu/7154841/bug7154841.java | 19 ++++++------ .../swing/JTabbedPane/7170310/bug7170310.java | 6 ++-- .../JTable/6567433/UpdateUIRecursionTest.java | 6 ++-- .../6567433/UpdateUIRecursionTest.java | 6 ++-- .../swing/JTextArea/6940863/bug6940863.java | 7 +++-- .../ScrollbarFlicker/ScrollFlickerTest.java | 6 ++-- .../JTree/6567433/UpdateUIRecursionTest.java | 6 ++-- .../ProgressMonitorEscapeKeyPress.java | 6 ++-- .../swing/Security/6938813/bug6938813.java | 3 +- .../ToolTipManager/7123767/bug7123767.java | 5 ++-- .../UnninstallUIMemoryLeaks.java | 5 ++-- .../plaf/aqua/CustomComboBoxFocusTest.java | 20 +++++++------ .../swing/plaf/basic/6866751/bug6866751.java | 17 ++++++----- .../BasicComboPopup/8154069/Bug8154069.java | 5 ++-- .../basic/BasicHTML/4960629/bug4960629.java | 18 ++++++----- .../plaf/basic/BasicLabelUI/bug7172652.java | 21 +++++++------ .../8041642/ScrollBarThumbVisibleTest.java | 16 +++++----- .../plaf/windows/6921687/bug6921687.java | 8 +++-- .../WrongAltProcessing.java | 15 ++++++---- .../swing/system/6799345/TestShutdown.java | 20 +++++++------ .../javax/swing/text/FlowView/LayoutTest.java | 18 ++++++----- .../GlyphPainter2/6427244/bug6427244.java | 20 +++++++------ .../8142966/SwingFontMetricsTest.java | 3 +- .../swing/text/View/8015853/bug8015853.java | 5 ++-- .../javax/swing/text/html/Test4783068.java | 12 ++++---- .../ImageConsumerUnregisterTest.java | 6 ++-- .../IAEforEmptyFrameTest.java | 6 ++-- .../sun/java2d/xrender/HugeGradientTest.java | 4 ++- 131 files changed, 735 insertions(+), 521 deletions(-) diff --git a/jdk/test/TEST.ROOT b/jdk/test/TEST.ROOT index 41cb9e82c8d..ccf4c295d14 100644 --- a/jdk/test/TEST.ROOT +++ b/jdk/test/TEST.ROOT @@ -10,9 +10,11 @@ # randomness tests. # # A "headful" test requires a graphical environment to meaningfully -# run. Tests that are not headful are "headless." +# run. Tests that are not headful are "headless". +# A test flagged with key "printer" requires a printer to succeed, else +# throws a PrinterException or the like. -keys=2d dnd i18n intermittent randomness headful +keys=2d dnd headful i18n intermittent printer randomness # Tests that must run in othervm mode othervm.dirs=java/awt java/beans javax/accessibility javax/imageio javax/sound javax/print javax/management com/sun/awt sun/awt sun/java2d sun/pisces javax/xml/jaxp/testng/validation java/lang/ProcessHandle diff --git a/jdk/test/com/apple/eawt/DefaultMenuBar/DefaultMenuBarTest.java b/jdk/test/com/apple/eawt/DefaultMenuBar/DefaultMenuBarTest.java index b5257e60957..9f87d7c5572 100644 --- a/jdk/test/com/apple/eawt/DefaultMenuBar/DefaultMenuBarTest.java +++ b/jdk/test/com/apple/eawt/DefaultMenuBar/DefaultMenuBarTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2015, 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 @@ -21,8 +21,9 @@ * questions. */ -/* +/** * @test + * @key headful * @bug 8007267 * @summary [macosx] com.apple.eawt.Application.setDefaultMenuBar is not working * @requires (os.family == "mac") diff --git a/jdk/test/com/apple/laf/ScreenMenu/ScreenMenuMemoryLeakTest.java b/jdk/test/com/apple/laf/ScreenMenu/ScreenMenuMemoryLeakTest.java index 26071d4bb7b..9971967bbb6 100644 --- a/jdk/test/com/apple/laf/ScreenMenu/ScreenMenuMemoryLeakTest.java +++ b/jdk/test/com/apple/laf/ScreenMenu/ScreenMenuMemoryLeakTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 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 @@ -20,13 +20,16 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ -/* + +/** * @test + * @key headful * @bug 8158325 * @summary Memory leak in com.apple.laf.ScreenMenu: removed JMenuItems are still referenced * @requires (os.family == "mac") * @run main/timeout=300/othervm -Xmx16m ScreenMenuMemoryLeakTest */ + import java.awt.EventQueue; import java.lang.ref.WeakReference; import java.lang.reflect.InvocationTargetException; diff --git a/jdk/test/java/awt/Choice/ChoiceHiDpi/ChoiceTest.java b/jdk/test/java/awt/Choice/ChoiceHiDpi/ChoiceTest.java index fd23b478ca0..09e7e08dd8f 100644 --- a/jdk/test/java/awt/Choice/ChoiceHiDpi/ChoiceTest.java +++ b/jdk/test/java/awt/Choice/ChoiceHiDpi/ChoiceTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 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 @@ -21,8 +21,9 @@ * questions. */ -/* +/** * @test + * @key headful * @bug 8144594 * @summary HiDPI: awt.Choice looks improperly (Win 8) * @run main ChoiceTest diff --git a/jdk/test/java/awt/Desktop/DesktopGtkLoadTest/DesktopGtkLoadTest.java b/jdk/test/java/awt/Desktop/DesktopGtkLoadTest/DesktopGtkLoadTest.java index 5769f88938f..4b86476e7a0 100644 --- a/jdk/test/java/awt/Desktop/DesktopGtkLoadTest/DesktopGtkLoadTest.java +++ b/jdk/test/java/awt/Desktop/DesktopGtkLoadTest/DesktopGtkLoadTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 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 @@ -21,7 +21,9 @@ * questions. */ -/* @test +/** + * @test + * @key headful * @bug 8157827 * @summary AWT_Desktop/Automated/Exceptions/BasicTest loads incorrect GTK * version when jdk.gtk.version=3 diff --git a/jdk/test/java/awt/Dialog/CloseDialog/CloseDialogTest.java b/jdk/test/java/awt/Dialog/CloseDialog/CloseDialogTest.java index 3053d793043..4db2d52e4ea 100644 --- a/jdk/test/java/awt/Dialog/CloseDialog/CloseDialogTest.java +++ b/jdk/test/java/awt/Dialog/CloseDialog/CloseDialogTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 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 @@ -30,11 +30,13 @@ import java.util.concurrent.atomic.AtomicReference; /** * @test + * @key headful * @bug 8043705 * @summary Can't exit color chooser dialog when running as an applet * @modules java.desktop/sun.awt * @run main CloseDialogTest */ + public class CloseDialogTest { private static volatile Frame frame; diff --git a/jdk/test/java/awt/Dialog/NestedDialogs/Modal/NestedModalDialogTest.java b/jdk/test/java/awt/Dialog/NestedDialogs/Modal/NestedModalDialogTest.java index 80c0dbb2f6c..7d32c5dd3d3 100644 --- a/jdk/test/java/awt/Dialog/NestedDialogs/Modal/NestedModalDialogTest.java +++ b/jdk/test/java/awt/Dialog/NestedDialogs/Modal/NestedModalDialogTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 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 @@ -21,17 +21,19 @@ * questions. */ - /* - @test 8155740 - @summary See : Events: actionPerformed() method not - called when it is button is clicked (system load related) - @summary com.apple.junit.java.awt.Frame - @library ../../../regtesthelpers - @build VisibilityValidator - @build Util - @build Waypoint - @run main NestedModalDialogTest +/** + * @test 8155740 + * @key headful + * @summary See : Events: actionPerformed() method not + * called when it is button is clicked (system load related) + * @summary com.apple.junit.java.awt.Frame + * @library ../../../regtesthelpers + * @build VisibilityValidator + * @build Util + * @build Waypoint + * @run main NestedModalDialogTest */ + ////////////////////////////////////////////////////////////////////////////// // NestedModalDialogTest.java // The test launches a parent frame. From this parent frame it launches a modal diff --git a/jdk/test/java/awt/Dialog/NestedDialogs/Modeless/NestedModelessDialogTest.java b/jdk/test/java/awt/Dialog/NestedDialogs/Modeless/NestedModelessDialogTest.java index 853ff02e615..d41079d1f79 100644 --- a/jdk/test/java/awt/Dialog/NestedDialogs/Modeless/NestedModelessDialogTest.java +++ b/jdk/test/java/awt/Dialog/NestedDialogs/Modeless/NestedModelessDialogTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 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 @@ -21,17 +21,19 @@ * questions. */ - /* - @test 8155740 - @summary See : Events: actionPerformed() method not - called when it is button is clicked (system load related) - @summary com.apple.junit.java.awt.Frame - @library ../../../regtesthelpers - @build VisibilityValidator - @build Util - @build Waypoint - @run main NestedModelessDialogTest +/** + * @test 8155740 + * @key headful + * @summary See : Events: actionPerformed() method not + * called when it is button is clicked (system load related) + * @summary com.apple.junit.java.awt.Frame + * @library ../../../regtesthelpers + * @build VisibilityValidator + * @build Util + * @build Waypoint + * @run main NestedModelessDialogTest -Xlog:exception */ + ///////////////////////////////////////////////////////////////////////////// // NestedModelessDialogTest.java // The test launches a parent frame. From this parent frame it launches a modal diff --git a/jdk/test/java/awt/EmbeddedFrame/DisplayChangedTest/DisplayChangedTest.java b/jdk/test/java/awt/EmbeddedFrame/DisplayChangedTest/DisplayChangedTest.java index 082681bd69b..daf9d29fbb4 100644 --- a/jdk/test/java/awt/EmbeddedFrame/DisplayChangedTest/DisplayChangedTest.java +++ b/jdk/test/java/awt/EmbeddedFrame/DisplayChangedTest/DisplayChangedTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2015, 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 @@ -21,24 +21,20 @@ * questions. */ -/* - @test - @bug 4980592 8171363 - @summary switching user in XP causes an NPE in - sun.awt.windows.WWindowPeer.displayChanged - @requires (os.family == "windows") - @modules java.desktop/java.awt.peer - @modules java.desktop/sun.awt.windows:open - @modules java.desktop/sun.awt - @author son@sparc.spb.su: area=embedded - @run main DisplayChangedTest - */ /** - * DisplayChangedTest.java - * - * summary: switching user in XP causes an NPE in - * sun.awt.windows.WWindowPeer.displayChanged + * @test + * @key headful + * @bug 4980592 8171363 + * @summary switching user in XP causes an NPE in + * sun.awt.windows.WWindowPeer.displayChanged + * @requires (os.family == "windows") + * @modules java.desktop/java.awt.peer + * @modules java.desktop/sun.awt.windows:open + * @modules java.desktop/sun.awt + * @author son@sparc.spb.su: area=embedded + * @run main DisplayChangedTest */ + import java.awt.Frame; import java.awt.Dialog; import java.awt.TextArea; diff --git a/jdk/test/java/awt/EmbeddedFrame/EmbeddedFrameGrabTest/EmbeddedFrameGrabTest.java b/jdk/test/java/awt/EmbeddedFrame/EmbeddedFrameGrabTest/EmbeddedFrameGrabTest.java index 5249dca3b14..e7fb0b8c6a0 100644 --- a/jdk/test/java/awt/EmbeddedFrame/EmbeddedFrameGrabTest/EmbeddedFrameGrabTest.java +++ b/jdk/test/java/awt/EmbeddedFrame/EmbeddedFrameGrabTest/EmbeddedFrameGrabTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2015, 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 @@ -21,22 +21,19 @@ * questions. */ -/* - @test - @bug 6345003 8171363 - @summary grab problems with EmbeddedFrame - @requires (os.family == "windows") - @modules java.desktop/java.awt.peer - @modules java.desktop/sun.awt - @modules java.desktop/sun.awt.windows:open - @author Oleg.Semenov@sun.com area=EmbeddedFrame - @run main EmbeddedFrameGrabTest - */ /** - * EmbeddedFrameGrabTest.java - * - * summary: grab problems with EmbeddedFrame + * @test + * @key headful + * @bug 6345003 8171363 + * @summary grab problems with EmbeddedFrame + * @requires (os.family == "windows") + * @modules java.desktop/java.awt.peer + * @modules java.desktop/sun.awt + * @modules java.desktop/sun.awt.windows:open + * @author Oleg.Semenov@sun.com area=EmbeddedFrame + * @run main EmbeddedFrameGrabTest */ + import java.awt.Frame; import java.awt.peer.FramePeer; import javax.swing.JComboBox; diff --git a/jdk/test/java/awt/EventDispatchThread/LoopRobustness/LoopRobustness.html b/jdk/test/java/awt/EventDispatchThread/LoopRobustness/LoopRobustness.html index 8f5e722fb68..1a1808de681 100644 --- a/jdk/test/java/awt/EventDispatchThread/LoopRobustness/LoopRobustness.html +++ b/jdk/test/java/awt/EventDispatchThread/LoopRobustness/LoopRobustness.html @@ -1,5 +1,5 @@