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 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 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 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 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 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 diff --git a/jdk/.hgtags b/jdk/.hgtags index 012f8dd2e2a..c6ed4fccf26 100644 --- a/jdk/.hgtags +++ b/jdk/.hgtags @@ -441,3 +441,6 @@ e069834e2c518a7bc2ffadc8c7e3cd7ec69fa8a0 jdk-10+15 06df1ce4b9b887d05ce6a13f4def3547e434dd1a jdk-9+179 d93f2fd542b7d7855c2cd49ae15ebcc3d441a83b jdk-10+17 c4b709bad6c5d29294124de5e74e1e2ac84fcf1f jdk-10+18 +b561eeca30decc6258b4aca8bb23beffbb6e2f7d jdk-10+19 +4feab1acec6a9c3620a19ff379a65ab8618d0e2a jdk-9+180 +bd66ea2fdde3d60a73b5272263a7b8b0ca926a33 jdk-9+181 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/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) * - *
- * - * + * + * + *
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/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
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/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 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
    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/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/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/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/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 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/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.", 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: 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/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 + } +} + + + 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 @@