diff --git a/.hgtags-top-repo b/.hgtags-top-repo index 9ed3c0b1f24..a5ae9ea7b47 100644 --- a/.hgtags-top-repo +++ b/.hgtags-top-repo @@ -441,3 +441,6 @@ ec4159ebe7050fcc5dcee8a2d150cf948ecc97db jdk-9+178 252475ccfd84cc249f8d6faf4b7806b5e2c384ce jdk-9+179 a133a7d1007b1456bc62824382fd8ac93b45d329 jdk-10+17 536b81db8075486ca0fe3225d8e59313df5b936c jdk-10+18 +b803e6cff41e72a1e6d8782e1ef7c25a6e3e5ee3 jdk-10+19 +d2982a786f53814367698e63efe6349c9128e1db jdk-9+180 +b656dea9398ef601f7fc08d1a5157a560e0ccbe0 jdk-9+181 diff --git a/corba/.hgtags b/corba/.hgtags index 96e4906862a..3955e7c2528 100644 --- a/corba/.hgtags +++ b/corba/.hgtags @@ -441,3 +441,6 @@ b82b62ed5debda2d98dda597506ef29cf947fbae jdk-10+16 24390da83c5ee9e23ceafbcaff4460a01e37bb3a jdk-9+179 50ff1fd66362f212a8db6de76089d9d0ffa4df0f jdk-10+17 a923b3f30e7bddb4f960059ddfc7978fc63e2e6e jdk-10+18 +28488561cfbcfa4d0d9c489e8afe0155f4231360 jdk-10+19 +6ce6cb8ff41c71c49f23b15e0f0468aca5d52b17 jdk-9+180 +ba71941ad9dba53b8fffb30602ef673eee88696c jdk-9+181 diff --git a/hotspot/.hgtags b/hotspot/.hgtags index bd997249d7d..282c0940830 100644 --- a/hotspot/.hgtags +++ b/hotspot/.hgtags @@ -601,3 +601,6 @@ c1f3649a3a42f124b418a5a916dbad13d059b757 jdk-10+15 d2661aa42bff322badbe6c1337fc638d2e0f5730 jdk-9+179 73e2cb8700bfa51304bd4b02f224620859a3f600 jdk-10+17 c9d3317623d48da3327232c81e3f8cfc0d29d888 jdk-10+18 +33b74e13c1457f36041addb8b850831f81ca6e9f jdk-10+19 +d7baadc223e790c08bc69bf7e553bce65b4e7e40 jdk-9+180 +4a443796f6f57842d6a0434ac27ca3d1033ccc20 jdk-9+181 diff --git a/hotspot/src/share/vm/gc/g1/g1CollectedHeap.cpp b/hotspot/src/share/vm/gc/g1/g1CollectedHeap.cpp index fce91a80ad3..c044e9a0181 100644 --- a/hotspot/src/share/vm/gc/g1/g1CollectedHeap.cpp +++ b/hotspot/src/share/vm/gc/g1/g1CollectedHeap.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2016, 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 @@ -4389,6 +4389,15 @@ void G1CollectedHeap::enqueue_discovered_references(G1ParScanThreadStateSet* per rp->verify_no_references_recorded(); assert(!rp->discovery_enabled(), "should have been disabled"); + // If during an initial mark pause we install a pending list head which is not otherwise reachable + // ensure that it is marked in the bitmap for concurrent marking to discover. + if (collector_state()->during_initial_mark_pause()) { + oop pll_head = Universe::reference_pending_list(); + if (pll_head != NULL) { + _cm->grayRoot(pll_head); + } + } + // FIXME // CM's reference processing also cleans up the string and symbol tables. // Should we do that here also? We could, but it is a serial operation diff --git a/hotspot/src/share/vm/memory/universe.cpp b/hotspot/src/share/vm/memory/universe.cpp index d56e8dd3226..2d9dded4872 100644 --- a/hotspot/src/share/vm/memory/universe.cpp +++ b/hotspot/src/share/vm/memory/universe.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -497,7 +497,11 @@ void Universe::fixup_mirrors(TRAPS) { #define assert_pll_ownership() assert_pll_locked(owned_by_self) oop Universe::reference_pending_list() { - assert_pll_ownership(); + if (Thread::current()->is_VM_thread()) { + assert_pll_locked(is_locked); + } else { + assert_pll_ownership(); + } return _reference_pending_list; } 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/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/io/ObjectInputFilter.java b/jdk/src/java.base/share/classes/java/io/ObjectInputFilter.java index 534e1b2b8de..a45b655f8e7 100644 --- a/jdk/src/java.base/share/classes/java/io/ObjectInputFilter.java +++ b/jdk/src/java.base/share/classes/java/io/ObjectInputFilter.java @@ -34,6 +34,7 @@ import java.util.Objects; import java.util.Optional; import java.util.function.Function; +import jdk.internal.misc.SharedSecrets; /** * Filter classes, array lengths, and graph metrics during deserialization. @@ -265,6 +266,9 @@ public interface ObjectInputFilter { return null; }); configLog = (configuredFilter != null) ? System.getLogger("java.io.serialization") : null; + + // Setup shared secrets for RegistryImpl to use. + SharedSecrets.setJavaObjectInputFilterAccess(Config::createFilter2); } /** @@ -370,7 +374,20 @@ public interface ObjectInputFilter { */ public static ObjectInputFilter createFilter(String pattern) { Objects.requireNonNull(pattern, "pattern"); - return Global.createFilter(pattern); + return Global.createFilter(pattern, true); + } + + /** + * Returns an ObjectInputFilter from a string of patterns that + * checks only the length for arrays, not the component type. + * + * @param pattern the pattern string to parse; not null + * @return a filter to check a class being deserialized; + * {@code null} if no patterns + */ + static ObjectInputFilter createFilter2(String pattern) { + Objects.requireNonNull(pattern, "pattern"); + return Global.createFilter(pattern, false); } /** @@ -404,20 +421,26 @@ public interface ObjectInputFilter { * Maximum length of any array. */ private long maxArrayLength; + /** + * True to check the component type for arrays. + */ + private final boolean checkComponentType; /** * Returns an ObjectInputFilter from a string of patterns. * * @param pattern the pattern string to parse + * @param checkComponentType true if the filter should check + * the component type of arrays * @return a filter to check a class being deserialized; * {@code null} if no patterns * @throws IllegalArgumentException if the parameter is malformed * if the pattern is missing the name, the long value * is not a number or is negative. */ - static ObjectInputFilter createFilter(String pattern) { + static ObjectInputFilter createFilter(String pattern, boolean checkComponentType) { try { - return new Global(pattern); + return new Global(pattern, checkComponentType); } catch (UnsupportedOperationException uoe) { // no non-empty patterns return null; @@ -428,12 +451,15 @@ public interface ObjectInputFilter { * Construct a new filter from the pattern String. * * @param pattern a pattern string of filters + * @param checkComponentType true if the filter should check + * the component type of arrays * @throws IllegalArgumentException if the pattern is malformed * @throws UnsupportedOperationException if there are no non-empty patterns */ - private Global(String pattern) { + private Global(String pattern, boolean checkComponentType) { boolean hasLimits = false; this.pattern = pattern; + this.checkComponentType = checkComponentType; maxArrayLength = Long.MAX_VALUE; // Default values are unlimited maxDepth = Long.MAX_VALUE; @@ -595,6 +621,10 @@ public interface ObjectInputFilter { // array length is too big return Status.REJECTED; } + if (!checkComponentType) { + // As revised; do not check the component type for arrays + return Status.UNDECIDED; + } do { // Arrays are decided based on the component type clazz = clazz.getComponentType(); 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/net/InetAddress.java b/jdk/src/java.base/share/classes/java/net/InetAddress.java index 95b38875d9c..d4815f486df 100644 --- a/jdk/src/java.base/share/classes/java/net/InetAddress.java +++ b/jdk/src/java.base/share/classes/java/net/InetAddress.java @@ -72,10 +72,13 @@ import sun.net.util.IPAddressUtil; * *

Address types

* - *
+ *
* + * + * + * * - * + * * - * + * * * - *
Description of unicast and multicast address types
Address TypeDescription
unicast
unicastAn identifier for a single interface. A packet sent to * a unicast address is delivered to the interface identified by * that address. @@ -94,12 +97,12 @@ import sun.net.util.IPAddressUtil; * IP address loops around and becomes IP input on the local * host. This address is often used when testing a * client.
multicast
multicastAn identifier for a set of interfaces (typically belonging * to different nodes). A packet sent to a multicast address is * delivered to all interfaces identified by that address.
+ * * *

IP address scope

* @@ -163,8 +166,7 @@ import sun.net.util.IPAddressUtil; *

Two Java security properties control the TTL values used for * positive and negative host name resolution caching: * - *

- *
+ *
*
networkaddress.cache.ttl
*
Indicates the caching policy for successful name lookups from * the name service. The value is specified as an integer to indicate @@ -183,7 +185,6 @@ import sun.net.util.IPAddressUtil; * A value of -1 indicates "cache forever". *
*
- *
* * @author Chris Warth * @see java.net.InetAddress#getByAddress(byte[]) diff --git a/jdk/src/java.base/share/classes/java/net/URI.java b/jdk/src/java.base/share/classes/java/net/URI.java index eab652cbbf5..5199a3dd2bb 100644 --- a/jdk/src/java.base/share/classes/java/net/URI.java +++ b/jdk/src/java.base/share/classes/java/net/URI.java @@ -132,23 +132,23 @@ import java.lang.NullPointerException; // for javadoc * *

All told, then, a URI instance has the following nine components: * - *

+ *
* * - * + * * - * - * - * - * - * - * - * - * - * - * + * + * + * + * + * + * + * + * + * + * * - *
Describes the components of a URI:scheme,scheme-specific-part,authority,user-info,host,port,path,query,fragment
ComponentType
ComponentType
scheme{@code String}
scheme-specific-part    {@code String}
authority{@code String}
user-info{@code String}
host{@code String}
port{@code int}
path{@code String}
query{@code String}
fragment{@code String}
scheme{@code String}
scheme-specific-part{@code String}
authority{@code String}
user-info{@code String}
host{@code String}
port{@code int}
path{@code String}
query{@code String}
fragment{@code String}
+ * * * In a given instance any particular component is either undefined or * defined with a distinct value. Undefined string components are @@ -253,32 +253,35 @@ import java.lang.NullPointerException; // for javadoc * which are taken from that specification, are used below to describe these * constraints: * - *
+ *
* - * - * + * + * + * + * + * * - * + * * - * + * * - * + * * - * + * * - * + * * - * + * * - * + * * * - *
Describes categories alpha,digit,alphanum,unreserved,punct,reserved,escaped,and other
alpha
CategoryDescription
alphaThe US-ASCII alphabetic characters, * {@code 'A'} through {@code 'Z'} * and {@code 'a'} through {@code 'z'}
digit
digitThe US-ASCII decimal digit characters, * {@code '0'} through {@code '9'}
alphanum
alphanumAll alpha and digit characters
unreserved    
unreservedAll alphanum characters together with those in the string * {@code "_-!.~'()*"}
punct
punctThe characters in the string {@code ",;:$&+="}
reserved
reservedAll punct characters together with those in the string * {@code "?/[]@"}
escaped
escapedEscaped octets, that is, triplets consisting of the percent * character ({@code '%'}) followed by two hexadecimal digits * ({@code '0'}-{@code '9'}, {@code 'A'}-{@code 'F'}, and * {@code 'a'}-{@code 'f'})
other
otherThe Unicode characters that are not in the US-ASCII character set, * are not control characters (according to the {@link * java.lang.Character#isISOControl(char) Character.isISOControl} @@ -287,7 +290,7 @@ import java.lang.NullPointerException; // for javadoc * method)  (Deviation from RFC 2396, which is * limited to US-ASCII)
+ * * *

The set of all legal URI characters consists of * the unreserved, reserved, escaped, and other diff --git a/jdk/src/java.base/share/classes/java/net/URLConnection.java b/jdk/src/java.base/share/classes/java/net/URLConnection.java index e54a0b1a126..a5c30df3d4b 100644 --- a/jdk/src/java.base/share/classes/java/net/URLConnection.java +++ b/jdk/src/java.base/share/classes/java/net/URLConnection.java @@ -51,31 +51,16 @@ import sun.security.action.GetPropertyAction; * The abstract class {@code URLConnection} is the superclass * of all classes that represent a communications link between the * application and a URL. Instances of this class can be used both to - * read from and to write to the resource referenced by the URL. In - * general, creating a connection to a URL is a multistep process: - * - *

- * - * - * - * - * - * - * - * - * - *
Describes the process of creating a connection to a URL: openConnection() and connect() over time.
{@code openConnection()}{@code connect()}
Manipulate parameters that affect the connection to the remote - * resource.Interact with the resource; query header fields and - * contents.
- * ----------------------------> - *
time
+ * read from and to write to the resource referenced by the URL. * + *

+ * In general, creating a connection to a URL is a multistep process: *

    *
  1. The connection object is created by invoking the - * {@code openConnection} method on a URL. + * {@link URL#openConnection() openConnection} method on a URL. *
  2. The setup parameters and general request properties are manipulated. *
  3. The actual connection to the remote object is made, using the - * {@code connect} method. + * {@link #connect() connect} method. *
  4. The remote object becomes available. The header fields and the contents * of the remote object can be accessed. *
diff --git a/jdk/src/java.base/share/classes/java/net/URLPermission.java b/jdk/src/java.base/share/classes/java/net/URLPermission.java index 43a8bd43066..31441749659 100644 --- a/jdk/src/java.base/share/classes/java/net/URLPermission.java +++ b/jdk/src/java.base/share/classes/java/net/URLPermission.java @@ -72,22 +72,22 @@ import java.security.Permission; * separated by '/' characters. path may also be empty. The path is specified * in a similar way to the path in {@link java.io.FilePermission}. There are * three different ways as the following examples show: - * + *
* * - * + * * - * - * + * + * * * - * + * * * - * + * * + *
URL Examples
Example urlDescription
Example urlDescription
http://www.oracle.com/a/b/c.html
http://www.oracle.com/a/b/c.htmlA url which identifies a specific (single) resource
http://www.oracle.com/a/b/*
http://www.oracle.com/a/b/*The '*' character refers to all resources in the same "directory" - in * other words all resources with the same number of path components, and * which only differ in the final path component, represented by the '*'. *
http://www.oracle.com/a/b/-
http://www.oracle.com/a/b/-The '-' character refers to all resources recursively below the * preceding path (eg. http://www.oracle.com/a/b/c/d/e.html matches this * example). @@ -114,11 +114,12 @@ import java.security.Permission; * methods and permitted request headers of the permission (respectively). The two lists * are separated by a colon ':' character and elements of each list are comma separated. * Some examples are: - *
- *         "POST,GET,DELETE"
- *         "GET:X-Foo-Request,X-Bar-Request"
- *         "POST,GET:Header1,Header2"
- * 
+ *
    + *
  • "POST,GET,DELETE" + *
  • "GET:X-Foo-Request,X-Bar-Request" + *
  • "POST,GET:Header1,Header2" + *
+ *

* The first example specifies the methods: POST, GET and DELETE, but no request headers. * The second example specifies one request method and two headers. The third * example specifies two request methods, and two headers. @@ -253,16 +254,16 @@ public final class URLPermission extends Permission { * * * - * + * * - * - * - * - * - * - * - * - * + * + * + * + * + * + * + * + * * *
Examples of Path Matching
this's pathp's pathmatch
this's pathp's pathmatch
/a/b/a/byes
/a/b/*/a/b/cyes
/a/b/*/a/b/c/dno
/a/b/-/a/b/c/dyes
/a/b/-/a/b/c/d/eyes
/a/b/-/a/b/c/*yes
/a/b/*/a/b/c/-no
/a/b/a/byes
/a/b/*/a/b/cyes
/a/b/c/dno
/a/b/c/-no
/a/b/-/a/b/c/dyes
/a/b/c/d/eyes
/a/b/c/*yes
*/ diff --git a/jdk/src/java.base/share/classes/java/net/doc-files/net-properties.html b/jdk/src/java.base/share/classes/java/net/doc-files/net-properties.html index 003749ba7f2..acf653ebaed 100644 --- a/jdk/src/java.base/share/classes/java/net/doc-files/net-properties.html +++ b/jdk/src/java.base/share/classes/java/net/doc-files/net-properties.html @@ -23,7 +23,7 @@ or visit www.oracle.com if you need additional information or have any questions. --> - + Networking Properties @@ -35,7 +35,7 @@ alter the mechanisms and behavior of the various classes of the java.net package. Some are checked only once at startup of the VM, and therefore are best set using the -D option of the java command, while others have a more dynamic nature and can also be changed using -the System.setProperty() API. +the System.setProperty() API. The purpose of this document is to list and detail all of these properties.

If there is no special note, a property value is checked every time it is used.

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/security/DrbgParameters.java b/jdk/src/java.base/share/classes/java/security/DrbgParameters.java index 05723baa916..4dba498faf1 100644 --- a/jdk/src/java.base/share/classes/java/security/DrbgParameters.java +++ b/jdk/src/java.base/share/classes/java/security/DrbgParameters.java @@ -263,18 +263,18 @@ public class DrbgParameters { * Capability effective = ((DrbgParametes.Initiate) s.getParameters()) * .getCapability(); * - * + *
    * * * - * - * + * + * * * - * - * - * - * + * + * + * + * * *
    requested and effective capabilities
    Requested ValuePossible Effective ValuesRequested ValuePossible Effective Values
    NONENONE, RESEED_ONLY, PR_AND_RESEED
    RESEED_ONLYRESEED_ONLY, PR_AND_RESEED
    PR_AND_RESEEDPR_AND_RESEED
    NONENONE, RESEED_ONLY, PR_AND_RESEED
    RESEED_ONLYRESEED_ONLY, PR_AND_RESEED
    PR_AND_RESEEDPR_AND_RESEED
    *

    diff --git a/jdk/src/java.base/share/classes/java/security/Provider.java b/jdk/src/java.base/share/classes/java/security/Provider.java index cf20bfec3ac..83ce4ff9aa2 100644 --- a/jdk/src/java.base/share/classes/java/security/Provider.java +++ b/jdk/src/java.base/share/classes/java/security/Provider.java @@ -61,19 +61,19 @@ import java.util.function.Function; * security framework. Services of this type cannot be added, removed, * or modified by applications. * The following attributes are automatically placed in each Provider object: - * + *
    * * - * + * * - * - * + * + * * - * + * * - * + * * - * + * * * *
    Attributes Automatically Placed in a Provider Object
    NameValue
    NameValue
    {@code Provider.id name}
    {@code Provider.id name}{@code String.valueOf(provider.getName())}
    {@code Provider.id version}
    {@code Provider.id version}{@code String.valueOf(provider.getVersionStr())}
    {@code Provider.id info}
    {@code Provider.id info}{@code String.valueOf(provider.getInfo())}
    {@code Provider.id className}
    {@code Provider.id className}{@code provider.getClass().getName()}
    diff --git a/jdk/src/java.base/share/classes/java/security/cert/X509Extension.java b/jdk/src/java.base/share/classes/java/security/cert/X509Extension.java index b7533a2c697..b8aa25fb9ca 100644 --- a/jdk/src/java.base/share/classes/java/security/cert/X509Extension.java +++ b/jdk/src/java.base/share/classes/java/security/cert/X509Extension.java @@ -153,33 +153,33 @@ public interface X509Extension { * by periods. * *

    For example:
    - * + *
    * * * - * - * + * + * * - * - * + * + * * - * + * * - * + * * - * + * * - * + * * - * + * * - * + * * - * + * * - * + * * - * + * * * *
    Examples of OIDs and extension names
    OID (Object Identifier)Extension Name
    OID (Object Identifier)Extension Name
    2.5.29.14
    2.5.29.14SubjectKeyIdentifier
    2.5.29.15
    2.5.29.15KeyUsage
    2.5.29.16
    2.5.29.16PrivateKeyUsage
    2.5.29.17
    2.5.29.17SubjectAlternativeName
    2.5.29.18
    2.5.29.18IssuerAlternativeName
    2.5.29.19
    2.5.29.19BasicConstraints
    2.5.29.30
    2.5.29.30NameConstraints
    2.5.29.33
    2.5.29.33PolicyMappings
    2.5.29.35
    2.5.29.35AuthorityKeyIdentifier
    2.5.29.36
    2.5.29.36PolicyConstraints
    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/java/util/zip/ZipUtils.java b/jdk/src/java.base/share/classes/java/util/zip/ZipUtils.java index 8c682a813b6..e618ef18a78 100644 --- a/jdk/src/java.base/share/classes/java/util/zip/ZipUtils.java +++ b/jdk/src/java.base/share/classes/java/util/zip/ZipUtils.java @@ -81,13 +81,24 @@ class ZipUtils { * Converts DOS time to Java time (number of milliseconds since epoch). */ public static long dosToJavaTime(long dtime) { - LocalDateTime ldt = LocalDateTime.of( - (int) (((dtime >> 25) & 0x7f) + 1980), - (int) ((dtime >> 21) & 0x0f), - (int) ((dtime >> 16) & 0x1f), - (int) ((dtime >> 11) & 0x1f), - (int) ((dtime >> 5) & 0x3f), - (int) ((dtime << 1) & 0x3e)); + int year; + int month; + int day; + int hour = (int) ((dtime >> 11) & 0x1f); + int minute = (int) ((dtime >> 5) & 0x3f); + int second = (int) ((dtime << 1) & 0x3e); + if ((dtime >> 16) == 0) { + // Interpret the 0 DOS date as 1979-11-30 for compatibility with + // other implementations. + year = 1979; + month = 11; + day = 30; + } else { + year = (int) (((dtime >> 25) & 0x7f) + 1980); + month = (int) ((dtime >> 21) & 0x0f); + day = (int) ((dtime >> 16) & 0x1f); + } + LocalDateTime ldt = LocalDateTime.of(year, month, day, hour, minute, second); return TimeUnit.MILLISECONDS.convert(ldt.toEpochSecond( ZoneId.systemDefault().getRules().getOffset(ldt)), TimeUnit.SECONDS); } diff --git a/jdk/src/java.base/share/classes/javax/net/ssl/SSLEngine.java b/jdk/src/java.base/share/classes/javax/net/ssl/SSLEngine.java index b765128cd85..3eec4282ba6 100644 --- a/jdk/src/java.base/share/classes/javax/net/ssl/SSLEngine.java +++ b/jdk/src/java.base/share/classes/javax/net/ssl/SSLEngine.java @@ -1292,7 +1292,7 @@ public abstract class SSLEngine { * href="http://www.ietf.org/rfc/rfc7301.txt"> RFC 7301 , the * Application-Layer Protocol Negotiation (ALPN), can negotiate * application-level values between peers. - *

    + * * @implSpec * The implementation in this class throws * {@code UnsupportedOperationException} and performs no other action. @@ -1317,7 +1317,7 @@ public abstract class SSLEngine { * Like {@link #getHandshakeSession()}, * a connection may be in the middle of a handshake. The * application protocol may or may not yet be available. - *

    + * * @implSpec * The implementation in this class throws * {@code UnsupportedOperationException} and performs no other action. diff --git a/jdk/src/java.base/share/classes/javax/net/ssl/SSLParameters.java b/jdk/src/java.base/share/classes/javax/net/ssl/SSLParameters.java index 19b05f9de8a..1c3c947035e 100644 --- a/jdk/src/java.base/share/classes/javax/net/ssl/SSLParameters.java +++ b/jdk/src/java.base/share/classes/javax/net/ssl/SSLParameters.java @@ -646,7 +646,7 @@ public class SSLParameters { * requested by the peer, the underlying protocol will determine what * action to take. (For example, ALPN will send a * {@code "no_application_protocol"} alert and terminate the connection.) - *

    + * * @implSpec * This method will make a copy of the {@code protocols} array. * diff --git a/jdk/src/java.base/share/classes/javax/net/ssl/SSLSocket.java b/jdk/src/java.base/share/classes/javax/net/ssl/SSLSocket.java index 6f8e20d9538..ccaea95b167 100644 --- a/jdk/src/java.base/share/classes/javax/net/ssl/SSLSocket.java +++ b/jdk/src/java.base/share/classes/javax/net/ssl/SSLSocket.java @@ -702,7 +702,7 @@ public abstract class SSLSocket extends Socket * href="http://www.ietf.org/rfc/rfc7301.txt"> RFC 7301 , the * Application-Layer Protocol Negotiation (ALPN), can negotiate * application-level values between peers. - *

    + * * @implSpec * The implementation in this class throws * {@code UnsupportedOperationException} and performs no other action. @@ -727,7 +727,7 @@ public abstract class SSLSocket extends Socket * Like {@link #getHandshakeSession()}, * a connection may be in the middle of a handshake. The * application protocol may or may not yet be available. - *

    + * * @implSpec * The implementation in this class throws * {@code UnsupportedOperationException} and performs no other action. diff --git a/jdk/src/java.base/share/classes/jdk/internal/misc/JavaObjectInputFilterAccess.java b/jdk/src/java.base/share/classes/jdk/internal/misc/JavaObjectInputFilterAccess.java new file mode 100644 index 00000000000..5edb4c778e4 --- /dev/null +++ b/jdk/src/java.base/share/classes/jdk/internal/misc/JavaObjectInputFilterAccess.java @@ -0,0 +1,38 @@ +/* + * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package jdk.internal.misc; + +import java.io.ObjectInputFilter; + +/** + * Access to the alternative ObjectInputFilter.Config.createFilter2 for RMI. + */ +public interface JavaObjectInputFilterAccess { + /** + * Creates a filter from the pattern. + */ + ObjectInputFilter createFilter2(String pattern); +} diff --git a/jdk/src/java.base/share/classes/jdk/internal/misc/SharedSecrets.java b/jdk/src/java.base/share/classes/jdk/internal/misc/SharedSecrets.java index cd54d422c21..0f60833ec78 100644 --- a/jdk/src/java.base/share/classes/jdk/internal/misc/SharedSecrets.java +++ b/jdk/src/java.base/share/classes/jdk/internal/misc/SharedSecrets.java @@ -25,6 +25,7 @@ package jdk.internal.misc; +import java.io.ObjectInputFilter; import java.lang.module.ModuleDescriptor; import java.util.ResourceBundle; import java.util.jar.JarFile; @@ -70,6 +71,7 @@ public class SharedSecrets { private static JavaAWTFontAccess javaAWTFontAccess; private static JavaBeansAccess javaBeansAccess; private static JavaObjectInputStreamAccess javaObjectInputStreamAccess; + private static JavaObjectInputFilterAccess javaObjectInputFilterAccess; private static JavaIORandomAccessFileAccess javaIORandomAccessFileAccess; public static JavaUtilJarAccess javaUtilJarAccess() { @@ -315,6 +317,17 @@ public class SharedSecrets { javaObjectInputStreamAccess = access; } + public static JavaObjectInputFilterAccess getJavaObjectInputFilterAccess() { + if (javaObjectInputFilterAccess == null) { + unsafe.ensureClassInitialized(ObjectInputFilter.Config.class); + } + return javaObjectInputFilterAccess; + } + + public static void setJavaObjectInputFilterAccess(JavaObjectInputFilterAccess access) { + javaObjectInputFilterAccess = access; + } + public static void setJavaIORandomAccessFileAccess(JavaIORandomAccessFileAccess jirafa) { javaIORandomAccessFileAccess = jirafa; } 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.base/share/conf/security/java.security b/jdk/src/java.base/share/conf/security/java.security index 5ddf6198819..2ea7c3616d3 100644 --- a/jdk/src/java.base/share/conf/security/java.security +++ b/jdk/src/java.base/share/conf/security/java.security @@ -951,12 +951,36 @@ jdk.xml.dsig.secureValidationPolicy=\ # # The filter pattern uses the same format as jdk.serialFilter. # This filter can override the builtin filter if additional types need to be -# allowed or rejected from the RMI Registry. +# allowed or rejected from the RMI Registry or to decrease limits but not +# to increase limits. +# If the limits (maxdepth, maxrefs, or maxbytes) are exceeded, the object is rejected. +# +# Each non-array type is allowed or rejected if it matches one of the patterns, +# evaluated from left to right, and is otherwise allowed. Arrays of any +# component type, including subarrays and arrays of primitives, are allowed. +# +# Array construction of any component type, including subarrays and arrays of +# primitives, are allowed unless the length is greater than the maxarray limit. +# The filter is applied to each array element. # # Note: This property is currently used by the JDK Reference implementation. # It is not guaranteed to be examined and used by other implementations. # -#sun.rmi.registry.registryFilter=pattern;pattern +# The built-in filter allows subclasses of allowed classes and +# can approximately be represented as the pattern: +# +#sun.rmi.registry.registryFilter=\ +# maxarray=1000000;\ +# maxdepth=20;\ +# java.lang.String;\ +# java.lang.Number;\ +# java.lang.reflect.Proxy;\ +# java.rmi.Remote;\ +# sun.rmi.server.UnicastRef;\ +# sun.rmi.server.RMIClientSocketFactory;\ +# sun.rmi.server.RMIServerSocketFactory;\ +# java.rmi.activation.ActivationID;\ +# java.rmi.server.UID # # RMI Distributed Garbage Collector (DGC) Serial Filter # 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/java.rmi/share/classes/sun/rmi/registry/RegistryImpl.java b/jdk/src/java.rmi/share/classes/sun/rmi/registry/RegistryImpl.java index af012faeb78..f6f486f80a5 100644 --- a/jdk/src/java.rmi/share/classes/sun/rmi/registry/RegistryImpl.java +++ b/jdk/src/java.rmi/share/classes/sun/rmi/registry/RegistryImpl.java @@ -28,7 +28,6 @@ package sun.rmi.registry; import java.io.ObjectInputFilter; import java.nio.file.Path; import java.nio.file.Paths; -import java.rmi.server.LogStream; import java.security.PrivilegedAction; import java.security.Security; import java.util.ArrayList; @@ -58,6 +57,7 @@ import java.security.Permissions; import java.security.ProtectionDomain; import java.text.MessageFormat; +import jdk.internal.misc.SharedSecrets; import sun.rmi.runtime.Log; import sun.rmi.server.UnicastRef; import sun.rmi.server.UnicastServerRef; @@ -109,7 +109,7 @@ public class RegistryImpl extends java.rmi.server.RemoteServer private static final int REGISTRY_MAX_DEPTH = 20; /** Registry maximum array size in remote invocations. **/ - private static final int REGISTRY_MAX_ARRAY_SIZE = 10000; + private static final int REGISTRY_MAX_ARRAY_SIZE = 1_000_000; /** * The registryFilter created from the value of the {@code "sun.rmi.registry.registryFilter"} @@ -130,7 +130,7 @@ public class RegistryImpl extends java.rmi.server.RemoteServer props = Security.getProperty(REGISTRY_FILTER_PROPNAME); } if (props != null) { - filter = ObjectInputFilter.Config.createFilter(props); + filter = SharedSecrets.getJavaObjectInputFilterAccess().createFilter2(props); Log regLog = Log.getLog("sun.rmi.registry", "registry", -1); if (regLog.isLoggable(Log.BRIEF)) { regLog.log(Log.BRIEF, "registryFilter = " + filter); @@ -451,17 +451,10 @@ public class RegistryImpl extends java.rmi.server.RemoteServer Class clazz = filterInfo.serialClass(); if (clazz != null) { if (clazz.isArray()) { - if (filterInfo.arrayLength() >= 0 && filterInfo.arrayLength() > REGISTRY_MAX_ARRAY_SIZE) { - return ObjectInputFilter.Status.REJECTED; - } - do { - // Arrays are allowed depending on the component type - clazz = clazz.getComponentType(); - } while (clazz.isArray()); - } - if (clazz.isPrimitive()) { - // Arrays of primitives are allowed - return ObjectInputFilter.Status.ALLOWED; + // Arrays are REJECTED only if they exceed the limit + return (filterInfo.arrayLength() >= 0 && filterInfo.arrayLength() > REGISTRY_MAX_ARRAY_SIZE) + ? ObjectInputFilter.Status.REJECTED + : ObjectInputFilter.Status.UNDECIDED; } if (String.class == clazz || java.lang.Number.class.isAssignableFrom(clazz) diff --git a/jdk/src/jdk.incubator.httpclient/share/classes/jdk/incubator/http/AbstractAsyncSSLConnection.java b/jdk/src/jdk.incubator.httpclient/share/classes/jdk/incubator/http/AbstractAsyncSSLConnection.java new file mode 100644 index 00000000000..07223e61f25 --- /dev/null +++ b/jdk/src/jdk.incubator.httpclient/share/classes/jdk/incubator/http/AbstractAsyncSSLConnection.java @@ -0,0 +1,85 @@ +/* + * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package jdk.incubator.http; + +import java.io.IOException; +import java.net.InetSocketAddress; +import java.nio.ByteBuffer; +import java.util.concurrent.CompletableFuture; +import javax.net.ssl.SSLEngine; +import jdk.incubator.http.internal.common.ExceptionallyCloseable; + + +/** + * Asynchronous version of SSLConnection. + * + * There are two concrete implementations of this class: AsyncSSLConnection + * and AsyncSSLTunnelConnection. + * This abstraction is useful when downgrading from HTTP/2 to HTTP/1.1 over + * an SSL connection. See ExchangeImpl::get in the case where an ALPNException + * is thrown. + * + * Note: An AsyncSSLConnection wraps a PlainHttpConnection, while an + * AsyncSSLTunnelConnection wraps a PlainTunnelingConnection. + * If both these wrapped classes where made to inherit from a + * common abstraction then it might be possible to merge + * AsyncSSLConnection and AsyncSSLTunnelConnection back into + * a single class - and simply use different factory methods to + * create different wrappees, but this is left up for further cleanup. + * + */ +abstract class AbstractAsyncSSLConnection extends HttpConnection + implements AsyncConnection, ExceptionallyCloseable { + + + AbstractAsyncSSLConnection(InetSocketAddress addr, HttpClientImpl client) { + super(addr, client); + } + + abstract SSLEngine getEngine(); + abstract AsyncSSLDelegate sslDelegate(); + abstract HttpConnection plainConnection(); + abstract HttpConnection downgrade(); + + @Override + final boolean isSecure() { + return true; + } + + // Blocking read functions not used here + @Override + protected final ByteBuffer readImpl() throws IOException { + throw new UnsupportedOperationException("Not supported."); + } + + // whenReceivedResponse only used in HTTP/1.1 (Http1Exchange) + // AbstractAsyncSSLConnection is only used with HTTP/2 + @Override + final CompletableFuture whenReceivingResponse() { + throw new UnsupportedOperationException("Not supported."); + } + +} diff --git a/jdk/src/jdk.incubator.httpclient/share/classes/jdk/incubator/http/AsyncSSLConnection.java b/jdk/src/jdk.incubator.httpclient/share/classes/jdk/incubator/http/AsyncSSLConnection.java index b1e6063951f..f6c095526ee 100644 --- a/jdk/src/jdk.incubator.httpclient/share/classes/jdk/incubator/http/AsyncSSLConnection.java +++ b/jdk/src/jdk.incubator.httpclient/share/classes/jdk/incubator/http/AsyncSSLConnection.java @@ -35,14 +35,12 @@ import java.util.function.Supplier; import javax.net.ssl.SSLEngine; import jdk.incubator.http.internal.common.ByteBufferReference; -import jdk.incubator.http.internal.common.ExceptionallyCloseable; import jdk.incubator.http.internal.common.Utils; /** * Asynchronous version of SSLConnection. */ -class AsyncSSLConnection extends HttpConnection - implements AsyncConnection, ExceptionallyCloseable { +class AsyncSSLConnection extends AbstractAsyncSSLConnection { final AsyncSSLDelegate sslDelegate; final PlainHttpConnection plainConnection; @@ -61,15 +59,14 @@ class AsyncSSLConnection extends HttpConnection plainConnection.configureMode(mode); } - private CompletableFuture configureModeAsync(Void ignore) { - CompletableFuture cf = new CompletableFuture<>(); - try { - configureMode(Mode.ASYNC); - cf.complete(null); - } catch (Throwable t) { - cf.completeExceptionally(t); - } - return cf; + @Override + PlainHttpConnection plainConnection() { + return plainConnection; + } + + @Override + AsyncSSLDelegate sslDelegate() { + return sslDelegate; } @Override @@ -91,11 +88,6 @@ class AsyncSSLConnection extends HttpConnection return plainConnection.connected() && sslDelegate.connected(); } - @Override - boolean isSecure() { - return true; - } - @Override boolean isProxied() { return false; @@ -172,6 +164,7 @@ class AsyncSSLConnection extends HttpConnection plainConnection.channel().shutdownOutput(); } + @Override SSLEngine getEngine() { return sslDelegate.getEngine(); } @@ -184,18 +177,6 @@ class AsyncSSLConnection extends HttpConnection plainConnection.setAsyncCallbacks(sslDelegate::asyncReceive, errorReceiver, sslDelegate::getNetBuffer); } - // Blocking read functions not used here - - @Override - protected ByteBuffer readImpl() throws IOException { - throw new UnsupportedOperationException("Not supported."); - } - - @Override - CompletableFuture whenReceivingResponse() { - throw new UnsupportedOperationException("Not supported."); - } - @Override public void startReading() { plainConnection.startReading(); @@ -206,4 +187,9 @@ class AsyncSSLConnection extends HttpConnection public void stopAsyncReading() { plainConnection.stopAsyncReading(); } + + @Override + SSLConnection downgrade() { + return new SSLConnection(this); + } } diff --git a/jdk/src/jdk.incubator.httpclient/share/classes/jdk/incubator/http/AsyncSSLTunnelConnection.java b/jdk/src/jdk.incubator.httpclient/share/classes/jdk/incubator/http/AsyncSSLTunnelConnection.java new file mode 100644 index 00000000000..7afb87f5191 --- /dev/null +++ b/jdk/src/jdk.incubator.httpclient/share/classes/jdk/incubator/http/AsyncSSLTunnelConnection.java @@ -0,0 +1,206 @@ +/* + * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package jdk.incubator.http; + +import java.io.IOException; +import java.net.InetSocketAddress; +import java.nio.ByteBuffer; +import java.nio.channels.SocketChannel; +import java.util.concurrent.CompletableFuture; +import java.util.function.Consumer; +import java.util.function.Supplier; +import javax.net.ssl.SSLEngine; +import javax.net.ssl.SSLParameters; +import jdk.incubator.http.internal.common.ByteBufferReference; +import jdk.incubator.http.internal.common.Utils; + +/** + * An SSL tunnel built on a Plain (CONNECT) TCP tunnel. + */ +class AsyncSSLTunnelConnection extends AbstractAsyncSSLConnection { + + final PlainTunnelingConnection plainConnection; + final AsyncSSLDelegate sslDelegate; + final String serverName; + + @Override + public void connect() throws IOException, InterruptedException { + plainConnection.connect(); + configureMode(Mode.ASYNC); + startReading(); + sslDelegate.connect(); + } + + @Override + boolean connected() { + return plainConnection.connected() && sslDelegate.connected(); + } + + @Override + public CompletableFuture connectAsync() { + throw new InternalError(); + } + + AsyncSSLTunnelConnection(InetSocketAddress addr, + HttpClientImpl client, + String[] alpn, + InetSocketAddress proxy) + { + super(addr, client); + this.serverName = Utils.getServerName(addr); + this.plainConnection = new PlainTunnelingConnection(addr, proxy, client); + this.sslDelegate = new AsyncSSLDelegate(plainConnection, client, alpn, serverName); + } + + @Override + synchronized void configureMode(Mode mode) throws IOException { + super.configureMode(mode); + plainConnection.configureMode(mode); + } + + @Override + SSLParameters sslParameters() { + return sslDelegate.getSSLParameters(); + } + + @Override + public String toString() { + return "AsyncSSLTunnelConnection: " + super.toString(); + } + + @Override + PlainTunnelingConnection plainConnection() { + return plainConnection; + } + + @Override + AsyncSSLDelegate sslDelegate() { + return sslDelegate; + } + + @Override + ConnectionPool.CacheKey cacheKey() { + return ConnectionPool.cacheKey(address, plainConnection.proxyAddr); + } + + @Override + long write(ByteBuffer[] buffers, int start, int number) throws IOException { + //debugPrint("Send", buffers, start, number); + ByteBuffer[] bufs = Utils.reduce(buffers, start, number); + long n = Utils.remaining(bufs); + sslDelegate.writeAsync(ByteBufferReference.toReferences(bufs)); + sslDelegate.flushAsync(); + return n; + } + + @Override + long write(ByteBuffer buffer) throws IOException { + //debugPrint("Send", buffer); + long n = buffer.remaining(); + sslDelegate.writeAsync(ByteBufferReference.toReferences(buffer)); + sslDelegate.flushAsync(); + return n; + } + + @Override + public void writeAsync(ByteBufferReference[] buffers) throws IOException { + sslDelegate.writeAsync(buffers); + } + + @Override + public void writeAsyncUnordered(ByteBufferReference[] buffers) throws IOException { + sslDelegate.writeAsyncUnordered(buffers); + } + + @Override + public void flushAsync() throws IOException { + sslDelegate.flushAsync(); + } + + @Override + public void close() { + Utils.close(sslDelegate, plainConnection.channel()); + } + + @Override + void shutdownInput() throws IOException { + plainConnection.channel().shutdownInput(); + } + + @Override + void shutdownOutput() throws IOException { + plainConnection.channel().shutdownOutput(); + } + + @Override + SocketChannel channel() { + return plainConnection.channel(); + } + + @Override + boolean isProxied() { + return true; + } + + @Override + public void setAsyncCallbacks(Consumer asyncReceiver, + Consumer errorReceiver, + Supplier readBufferSupplier) { + sslDelegate.setAsyncCallbacks(asyncReceiver, errorReceiver, readBufferSupplier); + plainConnection.setAsyncCallbacks(sslDelegate::asyncReceive, errorReceiver, sslDelegate::getNetBuffer); + } + + @Override + public void startReading() { + plainConnection.startReading(); + sslDelegate.startReading(); + } + + @Override + public void stopAsyncReading() { + plainConnection.stopAsyncReading(); + } + + @Override + public void enableCallback() { + sslDelegate.enableCallback(); + } + + @Override + public void closeExceptionally(Throwable cause) throws IOException { + Utils.close(cause, sslDelegate, plainConnection.channel()); + } + + @Override + SSLEngine getEngine() { + return sslDelegate.getEngine(); + } + + @Override + SSLTunnelConnection downgrade() { + return new SSLTunnelConnection(this); + } +} diff --git a/jdk/src/jdk.incubator.httpclient/share/classes/jdk/incubator/http/ExchangeImpl.java b/jdk/src/jdk.incubator.httpclient/share/classes/jdk/incubator/http/ExchangeImpl.java index 27b6c1964f4..3d41179d903 100644 --- a/jdk/src/jdk.incubator.httpclient/share/classes/jdk/incubator/http/ExchangeImpl.java +++ b/jdk/src/jdk.incubator.httpclient/share/classes/jdk/incubator/http/ExchangeImpl.java @@ -82,9 +82,9 @@ abstract class ExchangeImpl { c = c2.getConnectionFor(request); } catch (Http2Connection.ALPNException e) { // failed to negotiate "h2" - AsyncSSLConnection as = e.getConnection(); + AbstractAsyncSSLConnection as = e.getConnection(); as.stopAsyncReading(); - SSLConnection sslc = new SSLConnection(as); + HttpConnection sslc = as.downgrade(); ExchangeImpl ex = new Http1Exchange<>(exchange, sslc); return ex; } diff --git a/jdk/src/jdk.incubator.httpclient/share/classes/jdk/incubator/http/Http2Connection.java b/jdk/src/jdk.incubator.httpclient/share/classes/jdk/incubator/http/Http2Connection.java index 275325f8b29..8e42022c286 100644 --- a/jdk/src/jdk.incubator.httpclient/share/classes/jdk/incubator/http/Http2Connection.java +++ b/jdk/src/jdk.incubator.httpclient/share/classes/jdk/incubator/http/Http2Connection.java @@ -211,12 +211,13 @@ class Http2Connection { this.hpackIn = new Decoder(clientSettings.getParameter(HEADER_TABLE_SIZE)); this.windowUpdater = new ConnectionWindowUpdateSender(this, client.getReceiveBufferSize()); } - /** - * Case 1) Create from upgraded HTTP/1.1 connection. - * Is ready to use. Will not be SSL. exchange is the Exchange - * that initiated the connection, whose response will be delivered - * on a Stream. - */ + + /** + * Case 1) Create from upgraded HTTP/1.1 connection. + * Is ready to use. Will not be SSL. exchange is the Exchange + * that initiated the connection, whose response will be delivered + * on a Stream. + */ Http2Connection(HttpConnection connection, Http2ClientImpl client2, Exchange exchange, @@ -280,7 +281,7 @@ class Http2Connection { * Throws an IOException if h2 was not negotiated */ private void checkSSLConfig() throws IOException { - AsyncSSLConnection aconn = (AsyncSSLConnection)connection; + AbstractAsyncSSLConnection aconn = (AbstractAsyncSSLConnection)connection; SSLEngine engine = aconn.getEngine(); String alpn = engine.getApplicationProtocol(); if (alpn == null || !alpn.equals("h2")) { @@ -906,14 +907,14 @@ class Http2Connection { */ static final class ALPNException extends IOException { private static final long serialVersionUID = 23138275393635783L; - final AsyncSSLConnection connection; + final AbstractAsyncSSLConnection connection; - ALPNException(String msg, AsyncSSLConnection connection) { + ALPNException(String msg, AbstractAsyncSSLConnection connection) { super(msg); this.connection = connection; } - AsyncSSLConnection getConnection() { + AbstractAsyncSSLConnection getConnection() { return connection; } } 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..d81d3950374 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 @@ -34,7 +34,6 @@ import java.nio.channels.SocketChannel; import java.util.concurrent.CompletableFuture; import jdk.incubator.http.internal.common.ByteBufferReference; -import jdk.incubator.http.internal.common.Utils; /** * Wraps socket channel layer and takes care of SSL also. @@ -136,7 +135,11 @@ abstract class HttpConnection implements Closeable { String[] alpn, boolean isHttp2, HttpClientImpl client) { if (proxy != null) { - return new SSLTunnelConnection(addr, client, proxy); + if (!isHttp2) { + return new SSLTunnelConnection(addr, client, proxy); + } else { + return new AsyncSSLTunnelConnection(addr, client, alpn, proxy); + } } else if (!isHttp2) { return new SSLConnection(addr, client, alpn); } else { @@ -154,6 +157,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.incubator.httpclient/share/classes/jdk/incubator/http/PlainTunnelingConnection.java b/jdk/src/jdk.incubator.httpclient/share/classes/jdk/incubator/http/PlainTunnelingConnection.java index d133df1e250..c167c53f2b3 100644 --- a/jdk/src/jdk.incubator.httpclient/share/classes/jdk/incubator/http/PlainTunnelingConnection.java +++ b/jdk/src/jdk.incubator.httpclient/share/classes/jdk/incubator/http/PlainTunnelingConnection.java @@ -34,12 +34,15 @@ import java.net.InetSocketAddress; import java.nio.ByteBuffer; import java.nio.channels.SocketChannel; import java.util.concurrent.CompletableFuture; +import java.util.function.Consumer; +import java.util.function.Supplier; /** * A plain text socket tunnel through a proxy. Uses "CONNECT" but does not - * encrypt. Used by WebSocket. Subclassed in SSLTunnelConnection for encryption. + * encrypt. Used by WebSocket, as well as HTTP over SSL + Proxy. + * Wrapped in SSLTunnelConnection or AsyncSSLTunnelConnection for encryption. */ -class PlainTunnelingConnection extends HttpConnection { +class PlainTunnelingConnection extends HttpConnection implements AsyncConnection { final PlainHttpConnection delegate; protected final InetSocketAddress proxyAddr; @@ -116,17 +119,17 @@ class PlainTunnelingConnection extends HttpConnection { } @Override - void writeAsync(ByteBufferReference[] buffers) throws IOException { + public void writeAsync(ByteBufferReference[] buffers) throws IOException { delegate.writeAsync(buffers); } @Override - void writeAsyncUnordered(ByteBufferReference[] buffers) throws IOException { + public void writeAsyncUnordered(ByteBufferReference[] buffers) throws IOException { delegate.writeAsyncUnordered(buffers); } @Override - void flushAsync() throws IOException { + public void flushAsync() throws IOException { delegate.flushAsync(); } @@ -165,4 +168,32 @@ class PlainTunnelingConnection extends HttpConnection { boolean isProxied() { return true; } + + @Override + public void setAsyncCallbacks(Consumer asyncReceiver, + Consumer errorReceiver, + Supplier readBufferSupplier) { + delegate.setAsyncCallbacks(asyncReceiver, errorReceiver, readBufferSupplier); + } + + @Override + public void startReading() { + delegate.startReading(); + } + + @Override + public void stopAsyncReading() { + delegate.stopAsyncReading(); + } + + @Override + public void enableCallback() { + delegate.enableCallback(); + } + + @Override + synchronized void configureMode(Mode mode) throws IOException { + super.configureMode(mode); + delegate.configureMode(mode); + } } diff --git a/jdk/src/jdk.incubator.httpclient/share/classes/jdk/incubator/http/SSLConnection.java b/jdk/src/jdk.incubator.httpclient/share/classes/jdk/incubator/http/SSLConnection.java index 790d98b7fa0..9eb6a37e250 100644 --- a/jdk/src/jdk.incubator.httpclient/share/classes/jdk/incubator/http/SSLConnection.java +++ b/jdk/src/jdk.incubator.httpclient/share/classes/jdk/incubator/http/SSLConnection.java @@ -77,8 +77,8 @@ class SSLConnection extends HttpConnection { */ SSLConnection(AsyncSSLConnection c) { super(c.address, c.client); - this.delegate = c.plainConnection; - AsyncSSLDelegate adel = c.sslDelegate; + this.delegate = c.plainConnection(); + AsyncSSLDelegate adel = c.sslDelegate(); this.sslDelegate = new SSLDelegate(adel.engine, delegate.channel(), client, adel.serverName); this.alpn = adel.alpn; this.serverName = adel.serverName; diff --git a/jdk/src/jdk.incubator.httpclient/share/classes/jdk/incubator/http/SSLTunnelConnection.java b/jdk/src/jdk.incubator.httpclient/share/classes/jdk/incubator/http/SSLTunnelConnection.java index fcd71728b5b..d5cade109b7 100644 --- a/jdk/src/jdk.incubator.httpclient/share/classes/jdk/incubator/http/SSLTunnelConnection.java +++ b/jdk/src/jdk.incubator.httpclient/share/classes/jdk/incubator/http/SSLTunnelConnection.java @@ -85,6 +85,19 @@ class SSLTunnelConnection extends HttpConnection { delegate = new PlainTunnelingConnection(addr, proxy, client); } + /** + * Create an SSLTunnelConnection from an existing connected AsyncSSLTunnelConnection. + * Used when downgrading from HTTP/2 to HTTP/1.1 + */ + SSLTunnelConnection(AsyncSSLTunnelConnection c) { + super(c.address, c.client); + this.delegate = c.plainConnection(); + AsyncSSLDelegate adel = c.sslDelegate(); + this.sslDelegate = new SSLDelegate(adel.engine, delegate.channel(), client, adel.serverName); + this.serverName = adel.serverName; + connected = c.connected(); + } + @Override SSLParameters sslParameters() { return sslDelegate.getSSLParameters(); 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/src/jdk.zipfs/share/classes/jdk/nio/zipfs/ZipUtils.java b/jdk/src/jdk.zipfs/share/classes/jdk/nio/zipfs/ZipUtils.java index b87a63d87cb..3c45090dbe2 100644 --- a/jdk/src/jdk.zipfs/share/classes/jdk/nio/zipfs/ZipUtils.java +++ b/jdk/src/jdk.zipfs/share/classes/jdk/nio/zipfs/ZipUtils.java @@ -106,13 +106,24 @@ class ZipUtils { * Converts DOS time to Java time (number of milliseconds since epoch). */ public static long dosToJavaTime(long dtime) { - LocalDateTime ldt = LocalDateTime.of( - (int) (((dtime >> 25) & 0x7f) + 1980), - (int) ((dtime >> 21) & 0x0f), - (int) ((dtime >> 16) & 0x1f), - (int) ((dtime >> 11) & 0x1f), - (int) ((dtime >> 5) & 0x3f), - (int) ((dtime << 1) & 0x3e)); + int year; + int month; + int day; + int hour = (int) ((dtime >> 11) & 0x1f); + int minute = (int) ((dtime >> 5) & 0x3f); + int second = (int) ((dtime << 1) & 0x3e); + if ((dtime >> 16) == 0) { + // Interpret the 0 DOS date as 1979-11-30 for compatibility with + // other implementations. + year = 1979; + month = 11; + day = 30; + } else { + year = (int) (((dtime >> 25) & 0x7f) + 1980); + month = (int) ((dtime >> 21) & 0x0f); + day = (int) ((dtime >> 16) & 0x1f); + } + LocalDateTime ldt = LocalDateTime.of(year, month, day, hour, minute, second); return TimeUnit.MILLISECONDS.convert(ldt.toEpochSecond( ZoneId.systemDefault().getRules().getOffset(ldt)), TimeUnit.SECONDS); } diff --git a/jdk/test/TEST.ROOT b/jdk/test/TEST.ROOT index 41cb9e82c8d..ccf4c295d14 100644 --- a/jdk/test/TEST.ROOT +++ b/jdk/test/TEST.ROOT @@ -10,9 +10,11 @@ # randomness tests. # # A "headful" test requires a graphical environment to meaningfully -# run. Tests that are not headful are "headless." +# run. Tests that are not headful are "headless". +# A test flagged with key "printer" requires a printer to succeed, else +# throws a PrinterException or the like. -keys=2d dnd i18n intermittent randomness headful +keys=2d dnd headful i18n intermittent printer randomness # Tests that must run in othervm mode othervm.dirs=java/awt java/beans javax/accessibility javax/imageio javax/sound javax/print javax/management com/sun/awt sun/awt sun/java2d sun/pisces javax/xml/jaxp/testng/validation java/lang/ProcessHandle diff --git a/jdk/test/com/apple/eawt/DefaultMenuBar/DefaultMenuBarTest.java b/jdk/test/com/apple/eawt/DefaultMenuBar/DefaultMenuBarTest.java index b5257e60957..9f87d7c5572 100644 --- a/jdk/test/com/apple/eawt/DefaultMenuBar/DefaultMenuBarTest.java +++ b/jdk/test/com/apple/eawt/DefaultMenuBar/DefaultMenuBarTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -21,8 +21,9 @@ * questions. */ -/* +/** * @test + * @key headful * @bug 8007267 * @summary [macosx] com.apple.eawt.Application.setDefaultMenuBar is not working * @requires (os.family == "mac") diff --git a/jdk/test/com/apple/laf/ScreenMenu/ScreenMenuMemoryLeakTest.java b/jdk/test/com/apple/laf/ScreenMenu/ScreenMenuMemoryLeakTest.java index 26071d4bb7b..9971967bbb6 100644 --- a/jdk/test/com/apple/laf/ScreenMenu/ScreenMenuMemoryLeakTest.java +++ b/jdk/test/com/apple/laf/ScreenMenu/ScreenMenuMemoryLeakTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -20,13 +20,16 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ -/* + +/** * @test + * @key headful * @bug 8158325 * @summary Memory leak in com.apple.laf.ScreenMenu: removed JMenuItems are still referenced * @requires (os.family == "mac") * @run main/timeout=300/othervm -Xmx16m ScreenMenuMemoryLeakTest */ + import java.awt.EventQueue; import java.lang.ref.WeakReference; import java.lang.reflect.InvocationTargetException; diff --git a/jdk/test/java/awt/Choice/ChoiceHiDpi/ChoiceTest.java b/jdk/test/java/awt/Choice/ChoiceHiDpi/ChoiceTest.java index fd23b478ca0..09e7e08dd8f 100644 --- a/jdk/test/java/awt/Choice/ChoiceHiDpi/ChoiceTest.java +++ b/jdk/test/java/awt/Choice/ChoiceHiDpi/ChoiceTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -21,8 +21,9 @@ * questions. */ -/* +/** * @test + * @key headful * @bug 8144594 * @summary HiDPI: awt.Choice looks improperly (Win 8) * @run main ChoiceTest diff --git a/jdk/test/java/awt/Desktop/DesktopGtkLoadTest/DesktopGtkLoadTest.java b/jdk/test/java/awt/Desktop/DesktopGtkLoadTest/DesktopGtkLoadTest.java index 5769f88938f..4b86476e7a0 100644 --- a/jdk/test/java/awt/Desktop/DesktopGtkLoadTest/DesktopGtkLoadTest.java +++ b/jdk/test/java/awt/Desktop/DesktopGtkLoadTest/DesktopGtkLoadTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -21,7 +21,9 @@ * questions. */ -/* @test +/** + * @test + * @key headful * @bug 8157827 * @summary AWT_Desktop/Automated/Exceptions/BasicTest loads incorrect GTK * version when jdk.gtk.version=3 diff --git a/jdk/test/java/awt/Dialog/CloseDialog/CloseDialogTest.java b/jdk/test/java/awt/Dialog/CloseDialog/CloseDialogTest.java index 3053d793043..4db2d52e4ea 100644 --- a/jdk/test/java/awt/Dialog/CloseDialog/CloseDialogTest.java +++ b/jdk/test/java/awt/Dialog/CloseDialog/CloseDialogTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -30,11 +30,13 @@ import java.util.concurrent.atomic.AtomicReference; /** * @test + * @key headful * @bug 8043705 * @summary Can't exit color chooser dialog when running as an applet * @modules java.desktop/sun.awt * @run main CloseDialogTest */ + public class CloseDialogTest { private static volatile Frame frame; diff --git a/jdk/test/java/awt/Dialog/NestedDialogs/Modal/NestedModalDialogTest.java b/jdk/test/java/awt/Dialog/NestedDialogs/Modal/NestedModalDialogTest.java index 80c0dbb2f6c..7d32c5dd3d3 100644 --- a/jdk/test/java/awt/Dialog/NestedDialogs/Modal/NestedModalDialogTest.java +++ b/jdk/test/java/awt/Dialog/NestedDialogs/Modal/NestedModalDialogTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -21,17 +21,19 @@ * questions. */ - /* - @test 8155740 - @summary See : Events: actionPerformed() method not - called when it is button is clicked (system load related) - @summary com.apple.junit.java.awt.Frame - @library ../../../regtesthelpers - @build VisibilityValidator - @build Util - @build Waypoint - @run main NestedModalDialogTest +/** + * @test 8155740 + * @key headful + * @summary See : Events: actionPerformed() method not + * called when it is button is clicked (system load related) + * @summary com.apple.junit.java.awt.Frame + * @library ../../../regtesthelpers + * @build VisibilityValidator + * @build Util + * @build Waypoint + * @run main NestedModalDialogTest */ + ////////////////////////////////////////////////////////////////////////////// // NestedModalDialogTest.java // The test launches a parent frame. From this parent frame it launches a modal diff --git a/jdk/test/java/awt/Dialog/NestedDialogs/Modeless/NestedModelessDialogTest.java b/jdk/test/java/awt/Dialog/NestedDialogs/Modeless/NestedModelessDialogTest.java index 853ff02e615..d41079d1f79 100644 --- a/jdk/test/java/awt/Dialog/NestedDialogs/Modeless/NestedModelessDialogTest.java +++ b/jdk/test/java/awt/Dialog/NestedDialogs/Modeless/NestedModelessDialogTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -21,17 +21,19 @@ * questions. */ - /* - @test 8155740 - @summary See : Events: actionPerformed() method not - called when it is button is clicked (system load related) - @summary com.apple.junit.java.awt.Frame - @library ../../../regtesthelpers - @build VisibilityValidator - @build Util - @build Waypoint - @run main NestedModelessDialogTest +/** + * @test 8155740 + * @key headful + * @summary See : Events: actionPerformed() method not + * called when it is button is clicked (system load related) + * @summary com.apple.junit.java.awt.Frame + * @library ../../../regtesthelpers + * @build VisibilityValidator + * @build Util + * @build Waypoint + * @run main NestedModelessDialogTest -Xlog:exception */ + ///////////////////////////////////////////////////////////////////////////// // NestedModelessDialogTest.java // The test launches a parent frame. From this parent frame it launches a modal diff --git a/jdk/test/java/awt/EmbeddedFrame/DisplayChangedTest/DisplayChangedTest.java b/jdk/test/java/awt/EmbeddedFrame/DisplayChangedTest/DisplayChangedTest.java index 082681bd69b..daf9d29fbb4 100644 --- a/jdk/test/java/awt/EmbeddedFrame/DisplayChangedTest/DisplayChangedTest.java +++ b/jdk/test/java/awt/EmbeddedFrame/DisplayChangedTest/DisplayChangedTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -21,24 +21,20 @@ * questions. */ -/* - @test - @bug 4980592 8171363 - @summary switching user in XP causes an NPE in - sun.awt.windows.WWindowPeer.displayChanged - @requires (os.family == "windows") - @modules java.desktop/java.awt.peer - @modules java.desktop/sun.awt.windows:open - @modules java.desktop/sun.awt - @author son@sparc.spb.su: area=embedded - @run main DisplayChangedTest - */ /** - * DisplayChangedTest.java - * - * summary: switching user in XP causes an NPE in - * sun.awt.windows.WWindowPeer.displayChanged + * @test + * @key headful + * @bug 4980592 8171363 + * @summary switching user in XP causes an NPE in + * sun.awt.windows.WWindowPeer.displayChanged + * @requires (os.family == "windows") + * @modules java.desktop/java.awt.peer + * @modules java.desktop/sun.awt.windows:open + * @modules java.desktop/sun.awt + * @author son@sparc.spb.su: area=embedded + * @run main DisplayChangedTest */ + import java.awt.Frame; import java.awt.Dialog; import java.awt.TextArea; diff --git a/jdk/test/java/awt/EmbeddedFrame/EmbeddedFrameGrabTest/EmbeddedFrameGrabTest.java b/jdk/test/java/awt/EmbeddedFrame/EmbeddedFrameGrabTest/EmbeddedFrameGrabTest.java index 5249dca3b14..e7fb0b8c6a0 100644 --- a/jdk/test/java/awt/EmbeddedFrame/EmbeddedFrameGrabTest/EmbeddedFrameGrabTest.java +++ b/jdk/test/java/awt/EmbeddedFrame/EmbeddedFrameGrabTest/EmbeddedFrameGrabTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -21,22 +21,19 @@ * questions. */ -/* - @test - @bug 6345003 8171363 - @summary grab problems with EmbeddedFrame - @requires (os.family == "windows") - @modules java.desktop/java.awt.peer - @modules java.desktop/sun.awt - @modules java.desktop/sun.awt.windows:open - @author Oleg.Semenov@sun.com area=EmbeddedFrame - @run main EmbeddedFrameGrabTest - */ /** - * EmbeddedFrameGrabTest.java - * - * summary: grab problems with EmbeddedFrame + * @test + * @key headful + * @bug 6345003 8171363 + * @summary grab problems with EmbeddedFrame + * @requires (os.family == "windows") + * @modules java.desktop/java.awt.peer + * @modules java.desktop/sun.awt + * @modules java.desktop/sun.awt.windows:open + * @author Oleg.Semenov@sun.com area=EmbeddedFrame + * @run main EmbeddedFrameGrabTest */ + import java.awt.Frame; import java.awt.peer.FramePeer; import javax.swing.JComboBox; diff --git a/jdk/test/java/awt/EventDispatchThread/LoopRobustness/LoopRobustness.html b/jdk/test/java/awt/EventDispatchThread/LoopRobustness/LoopRobustness.html index 8f5e722fb68..1a1808de681 100644 --- a/jdk/test/java/awt/EventDispatchThread/LoopRobustness/LoopRobustness.html +++ b/jdk/test/java/awt/EventDispatchThread/LoopRobustness/LoopRobustness.html @@ -1,5 +1,5 @@