# HG changeset patch # User prr # Date 1500568693 25200 # Node ID d2d3c06dde939aa447b48d80214c661df66d1ca1 # Parent 3e7ed3a7da38a3f2fb67070e6604dd4bdf4ef892# Parent 4bbea012e5676e8025ade2bcfab4d6581e6e9f4b Merge diff -r 3e7ed3a7da38 -r d2d3c06dde93 .hgtags --- a/.hgtags Mon Jul 17 09:13:49 2017 -0700 +++ b/.hgtags Thu Jul 20 09:38:13 2017 -0700 @@ -436,3 +436,4 @@ e6d70017f5b9adbb2ec82d826973d0251800a3c3 jdk-10+12 9927a9f16738e240ab7014f0118f41e314ef8f99 jdk-10+13 9ef5029b247b4d940080417a287440bbdbab995b jdk-10+14 +878e216039322cb3f0ecbd0944642a2b4e2593f3 jdk-10+15 diff -r 3e7ed3a7da38 -r d2d3c06dde93 common/autoconf/flags.m4 --- a/common/autoconf/flags.m4 Mon Jul 17 09:13:49 2017 -0700 +++ b/common/autoconf/flags.m4 Thu Jul 20 09:38:13 2017 -0700 @@ -999,10 +999,15 @@ -fno-omit-frame-pointer" elif test "x$OPENJDK_$1_OS" = xaix; then $2JVM_CFLAGS="[$]$2JVM_CFLAGS -DAIX" - # We may need '-qminimaltoc' or '-qpic=large -bbigtoc' if the TOC overflows. $2JVM_CFLAGS="[$]$2JVM_CFLAGS -qtune=balanced \ -qalias=noansi -qstrict -qtls=default -qlanglvl=c99vla \ -qlanglvl=noredefmac -qnortti -qnoeh -qignerrno" + # We need '-qminimaltoc' or '-qpic=large -bbigtoc' if the TOC overflows. + # Hotspot now overflows its 64K TOC (currently only for slowdebug), + # so for slowdebug we build with '-qpic=large -bbigtoc'. + if test "x$DEBUG_LEVEL" = xslowdebug; then + $2JVM_CFLAGS="[$]$2JVM_CFLAGS -qpic=large" + fi elif test "x$OPENJDK_$1_OS" = xbsd; then $2COMMON_CCXXFLAGS_JDK="[$]$2COMMON_CCXXFLAGS_JDK -D_ALLBSD_SOURCE" elif test "x$OPENJDK_$1_OS" = xwindows; then @@ -1249,6 +1254,12 @@ LDFLAGS_XLC="-b64 -brtl -bnolibpath -bexpall -bernotok" $2LDFLAGS_JDK="${$2LDFLAGS_JDK} $LDFLAGS_XLC" $2JVM_LDFLAGS="[$]$2JVM_LDFLAGS $LDFLAGS_XLC" + # We need '-qminimaltoc' or '-qpic=large -bbigtoc' if the TOC overflows. + # Hotspot now overflows its 64K TOC (currently only for slowdebug), + # so for slowdebug we build with '-qpic=large -bbigtoc'. + if test "x$DEBUG_LEVEL" = xslowdebug; then + $2JVM_LDFLAGS="[$]$2JVM_LDFLAGS -bbigtoc" + fi fi # Customize LDFLAGS for executables diff -r 3e7ed3a7da38 -r d2d3c06dde93 common/autoconf/generated-configure.sh --- a/common/autoconf/generated-configure.sh Mon Jul 17 09:13:49 2017 -0700 +++ b/common/autoconf/generated-configure.sh Thu Jul 20 09:38:13 2017 -0700 @@ -5014,7 +5014,7 @@ # Minimum supported versions, empty means unspecified TOOLCHAIN_MINIMUM_VERSION_clang="3.2" -TOOLCHAIN_MINIMUM_VERSION_gcc="4.3" +TOOLCHAIN_MINIMUM_VERSION_gcc="4.7" TOOLCHAIN_MINIMUM_VERSION_microsoft="16.00.30319.01" # VS2010 TOOLCHAIN_MINIMUM_VERSION_solstudio="5.13" TOOLCHAIN_MINIMUM_VERSION_xlc="" @@ -5193,7 +5193,7 @@ #CUSTOM_AUTOCONF_INCLUDE # Do not change or remove the following line, it is needed for consistency checks: -DATE_WHEN_GENERATED=1500048914 +DATE_WHEN_GENERATED=1500423205 ############################################################################### # @@ -51468,10 +51468,15 @@ -fno-omit-frame-pointer" elif test "x$OPENJDK_TARGET_OS" = xaix; then JVM_CFLAGS="$JVM_CFLAGS -DAIX" - # We may need '-qminimaltoc' or '-qpic=large -bbigtoc' if the TOC overflows. JVM_CFLAGS="$JVM_CFLAGS -qtune=balanced \ -qalias=noansi -qstrict -qtls=default -qlanglvl=c99vla \ -qlanglvl=noredefmac -qnortti -qnoeh -qignerrno" + # We need '-qminimaltoc' or '-qpic=large -bbigtoc' if the TOC overflows. + # Hotspot now overflows its 64K TOC (currently only for slowdebug), + # so for slowdebug we build with '-qpic=large -bbigtoc'. + if test "x$DEBUG_LEVEL" = xslowdebug; then + JVM_CFLAGS="$JVM_CFLAGS -qpic=large" + fi elif test "x$OPENJDK_TARGET_OS" = xbsd; then COMMON_CCXXFLAGS_JDK="$COMMON_CCXXFLAGS_JDK -D_ALLBSD_SOURCE" elif test "x$OPENJDK_TARGET_OS" = xwindows; then @@ -51811,6 +51816,12 @@ LDFLAGS_XLC="-b64 -brtl -bnolibpath -bexpall -bernotok" LDFLAGS_JDK="${LDFLAGS_JDK} $LDFLAGS_XLC" JVM_LDFLAGS="$JVM_LDFLAGS $LDFLAGS_XLC" + # We need '-qminimaltoc' or '-qpic=large -bbigtoc' if the TOC overflows. + # Hotspot now overflows its 64K TOC (currently only for slowdebug), + # so for slowdebug we build with '-qpic=large -bbigtoc'. + if test "x$DEBUG_LEVEL" = xslowdebug; then + JVM_LDFLAGS="$JVM_LDFLAGS -bbigtoc" + fi fi # Customize LDFLAGS for executables @@ -52321,10 +52332,15 @@ -fno-omit-frame-pointer" elif test "x$OPENJDK_BUILD_OS" = xaix; then OPENJDK_BUILD_JVM_CFLAGS="$OPENJDK_BUILD_JVM_CFLAGS -DAIX" - # We may need '-qminimaltoc' or '-qpic=large -bbigtoc' if the TOC overflows. OPENJDK_BUILD_JVM_CFLAGS="$OPENJDK_BUILD_JVM_CFLAGS -qtune=balanced \ -qalias=noansi -qstrict -qtls=default -qlanglvl=c99vla \ -qlanglvl=noredefmac -qnortti -qnoeh -qignerrno" + # We need '-qminimaltoc' or '-qpic=large -bbigtoc' if the TOC overflows. + # Hotspot now overflows its 64K TOC (currently only for slowdebug), + # so for slowdebug we build with '-qpic=large -bbigtoc'. + if test "x$DEBUG_LEVEL" = xslowdebug; then + OPENJDK_BUILD_JVM_CFLAGS="$OPENJDK_BUILD_JVM_CFLAGS -qpic=large" + fi elif test "x$OPENJDK_BUILD_OS" = xbsd; then OPENJDK_BUILD_COMMON_CCXXFLAGS_JDK="$OPENJDK_BUILD_COMMON_CCXXFLAGS_JDK -D_ALLBSD_SOURCE" elif test "x$OPENJDK_BUILD_OS" = xwindows; then @@ -52664,6 +52680,12 @@ LDFLAGS_XLC="-b64 -brtl -bnolibpath -bexpall -bernotok" OPENJDK_BUILD_LDFLAGS_JDK="${OPENJDK_BUILD_LDFLAGS_JDK} $LDFLAGS_XLC" OPENJDK_BUILD_JVM_LDFLAGS="$OPENJDK_BUILD_JVM_LDFLAGS $LDFLAGS_XLC" + # We need '-qminimaltoc' or '-qpic=large -bbigtoc' if the TOC overflows. + # Hotspot now overflows its 64K TOC (currently only for slowdebug), + # so for slowdebug we build with '-qpic=large -bbigtoc'. + if test "x$DEBUG_LEVEL" = xslowdebug; then + OPENJDK_BUILD_JVM_LDFLAGS="$OPENJDK_BUILD_JVM_LDFLAGS -bbigtoc" + fi fi # Customize LDFLAGS for executables diff -r 3e7ed3a7da38 -r d2d3c06dde93 common/autoconf/toolchain.m4 --- a/common/autoconf/toolchain.m4 Mon Jul 17 09:13:49 2017 -0700 +++ b/common/autoconf/toolchain.m4 Thu Jul 20 09:38:13 2017 -0700 @@ -52,7 +52,7 @@ # Minimum supported versions, empty means unspecified TOOLCHAIN_MINIMUM_VERSION_clang="3.2" -TOOLCHAIN_MINIMUM_VERSION_gcc="4.3" +TOOLCHAIN_MINIMUM_VERSION_gcc="4.7" TOOLCHAIN_MINIMUM_VERSION_microsoft="16.00.30319.01" # VS2010 TOOLCHAIN_MINIMUM_VERSION_solstudio="5.13" TOOLCHAIN_MINIMUM_VERSION_xlc="" diff -r 3e7ed3a7da38 -r d2d3c06dde93 common/doc/building.md --- a/common/doc/building.md Mon Jul 17 09:13:49 2017 -0700 +++ b/common/doc/building.md Thu Jul 20 09:38:13 2017 -0700 @@ -392,11 +392,8 @@ ### gcc -The minimum accepted version of gcc is 4.3. Older versions will not be accepted -by `configure`. - -However, gcc 4.3 is quite old and OpenJDK is not regularly tested on this -version, so it is recommended to use a more modern gcc. +The minimum accepted version of gcc is 4.7. Older versions will generate a warning +by `configure` and are unlikely to work. OpenJDK 9 includes patches that should allow gcc 6 to compile, but this should be considered experimental. diff -r 3e7ed3a7da38 -r d2d3c06dde93 corba/.hgtags --- a/corba/.hgtags Mon Jul 17 09:13:49 2017 -0700 +++ b/corba/.hgtags Thu Jul 20 09:38:13 2017 -0700 @@ -435,3 +435,4 @@ 25d991a67cba240eeaf15c19c5857b40fdd71561 jdk-10+14 40fb9f229471ef357d493813d34b15afcce9f32b jdk-9+176 c72e9d3823f04cb3ef3166646dfea9e4c2769133 jdk-9+177 +15f59cfc6fbe9387423fb173e962265c7b5d357e jdk-10+15 diff -r 3e7ed3a7da38 -r d2d3c06dde93 hotspot/.hgtags --- a/hotspot/.hgtags Mon Jul 17 09:13:49 2017 -0700 +++ b/hotspot/.hgtags Thu Jul 20 09:38:13 2017 -0700 @@ -595,3 +595,4 @@ e920b4d008d914f3414bd4630b58837cf0b7f08d jdk-10+14 2ab74e5dbdc2b6a962c865500cafd23cf387dc60 jdk-9+176 1ca8f038fceb88c640badf9bd18905205bc63b43 jdk-9+177 +c1f3649a3a42f124b418a5a916dbad13d059b757 jdk-10+15 diff -r 3e7ed3a7da38 -r d2d3c06dde93 jaxp/.hgtags --- a/jaxp/.hgtags Mon Jul 17 09:13:49 2017 -0700 +++ b/jaxp/.hgtags Thu Jul 20 09:38:13 2017 -0700 @@ -435,3 +435,4 @@ 4d05f673cf773f1c20e8f5a879d64115d2f741d9 jdk-10+14 38cf34e2328070cc691c4f136e6dde1a44c04171 jdk-9+176 332ad9f92632f56f337b8c40edef9a95a42b26bc jdk-9+177 +02a876781a3a6193140591d92db7b95ca743eac2 jdk-10+15 diff -r 3e7ed3a7da38 -r d2d3c06dde93 jaxp/src/java.xml/share/classes/javax/xml/stream/XMLEventFactory.java --- a/jaxp/src/java.xml/share/classes/javax/xml/stream/XMLEventFactory.java Mon Jul 17 09:13:49 2017 -0700 +++ b/jaxp/src/java.xml/share/classes/javax/xml/stream/XMLEventFactory.java Thu Jul 20 09:38:13 2017 -0700 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2009, 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 @@ -125,10 +125,6 @@ *

* Once an application has obtained a reference to a XMLEventFactory it * can use the factory to configure and obtain stream instances. - *

- * Note that this is a new method that replaces the deprecated newInstance() method. - * No changes in behavior are defined by this replacement method relative to - * the deprecated method. * * @throws FactoryConfigurationError in case of {@linkplain * java.util.ServiceConfigurationError service configuration error} or if diff -r 3e7ed3a7da38 -r d2d3c06dde93 jaxp/src/java.xml/share/classes/javax/xml/stream/XMLInputFactory.java --- a/jaxp/src/java.xml/share/classes/javax/xml/stream/XMLInputFactory.java Mon Jul 17 09:13:49 2017 -0700 +++ b/jaxp/src/java.xml/share/classes/javax/xml/stream/XMLInputFactory.java Thu Jul 20 09:38:13 2017 -0700 @@ -209,16 +209,11 @@ *

* Once an application has obtained a reference to a XMLInputFactory it * can use the factory to configure and obtain stream instances. - *

- * Note that this is a new method that replaces the deprecated newInstance() method. - * No changes in behavior are defined by this replacement method relative to - * the deprecated method. * * @throws FactoryConfigurationError in case of {@linkplain * java.util.ServiceConfigurationError service configuration error} or if * the implementation is not available or cannot be instantiated. */ - @Deprecated(since="1.7") public static XMLInputFactory newFactory() throws FactoryConfigurationError { diff -r 3e7ed3a7da38 -r d2d3c06dde93 jaxp/src/java.xml/share/classes/javax/xml/stream/XMLOutputFactory.java --- a/jaxp/src/java.xml/share/classes/javax/xml/stream/XMLOutputFactory.java Mon Jul 17 09:13:49 2017 -0700 +++ b/jaxp/src/java.xml/share/classes/javax/xml/stream/XMLOutputFactory.java Thu Jul 20 09:38:13 2017 -0700 @@ -189,10 +189,6 @@ *

* Once an application has obtained a reference to a XMLOutputFactory it * can use the factory to configure and obtain stream instances. - *

- * Note that this is a new method that replaces the deprecated newInstance() method. - * No changes in behavior are defined by this replacement method relative to the - * deprecated method. * * @throws FactoryConfigurationError in case of {@linkplain * java.util.ServiceConfigurationError service configuration error} or if diff -r 3e7ed3a7da38 -r d2d3c06dde93 jaxp/src/java.xml/share/classes/javax/xml/validation/Validator.java --- a/jaxp/src/java.xml/share/classes/javax/xml/validation/Validator.java Mon Jul 17 09:13:49 2017 -0700 +++ b/jaxp/src/java.xml/share/classes/javax/xml/validation/Validator.java Thu Jul 20 09:38:13 2017 -0700 @@ -135,7 +135,7 @@ * {@code Source} / {@code Result} Accepted * * - * > + * * {@link javax.xml.transform.stream.StreamSource} * {@link javax.xml.transform.sax.SAXSource} * {@link javax.xml.transform.dom.DOMSource} diff -r 3e7ed3a7da38 -r d2d3c06dde93 jaxws/.hgtags --- a/jaxws/.hgtags Mon Jul 17 09:13:49 2017 -0700 +++ b/jaxws/.hgtags Thu Jul 20 09:38:13 2017 -0700 @@ -438,3 +438,4 @@ bddeaa49ffd55567ad232548c38aa270e1a1420a jdk-10+14 ea819b6009d33a72e6672bab6c101d51db0cfb4c jdk-9+176 b44a721aee3d3b2537754e559fe9ecccadea548b jdk-9+177 +6d17fd0a5133a0dd916c77a9a24ae7f0ca402876 jdk-10+15 diff -r 3e7ed3a7da38 -r d2d3c06dde93 jdk/.hgtags --- a/jdk/.hgtags Mon Jul 17 09:13:49 2017 -0700 +++ b/jdk/.hgtags Thu Jul 20 09:38:13 2017 -0700 @@ -435,3 +435,4 @@ 7a2bc0a80087b63c909df2af6ec7d9ef44e6d7f7 jdk-10+14 9f27d513658d5375b0e26846857d92563f279073 jdk-9+176 80acf577b7d0b886fb555c9916552844f6cc72af jdk-9+177 +e069834e2c518a7bc2ffadc8c7e3cd7ec69fa8a0 jdk-10+15 diff -r 3e7ed3a7da38 -r d2d3c06dde93 jdk/make/mapfiles/libsunec/mapfile-vers --- a/jdk/make/mapfiles/libsunec/mapfile-vers Mon Jul 17 09:13:49 2017 -0700 +++ b/jdk/make/mapfiles/libsunec/mapfile-vers Thu Jul 20 09:38:13 2017 -0700 @@ -1,5 +1,5 @@ # -# Copyright (c) 2009, 2013, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2009, 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,6 +27,7 @@ SUNWprivate_1.1 { global: + Java_sun_security_ec_ECKeyPairGenerator_isCurveSupported; Java_sun_security_ec_ECKeyPairGenerator_generateECKeyPair; Java_sun_security_ec_ECDSASignature_signDigest; Java_sun_security_ec_ECDSASignature_verifySignedDigest; diff -r 3e7ed3a7da38 -r d2d3c06dde93 jdk/src/java.base/share/classes/java/io/ObjectStreamField.java --- a/jdk/src/java.base/share/classes/java/io/ObjectStreamField.java Mon Jul 17 09:13:49 2017 -0700 +++ b/jdk/src/java.base/share/classes/java/io/ObjectStreamField.java Thu Jul 20 09:38:13 2017 -0700 @@ -45,16 +45,18 @@ /** field name */ private final String name; - /** canonical JVM signature of field type */ + /** canonical JVM signature of field type, if given */ private final String signature; /** field type (Object.class if unknown non-primitive type) */ private final Class type; + /** lazily constructed signature for the type, if no explicit signature */ + private String typeSignature; /** whether or not to (de)serialize field values as unshared */ private final boolean unshared; /** corresponding reflective field object, if any */ private final Field field; /** offset of field value in enclosing field group */ - private int offset = 0; + private int offset; /** * Create a Serializable field with the specified type. This field should @@ -91,8 +93,8 @@ this.name = name; this.type = type; this.unshared = unshared; - signature = getClassSignature(type).intern(); - field = null; + this.field = null; + this.signature = null; } /** @@ -106,7 +108,7 @@ this.name = name; this.signature = signature.intern(); this.unshared = unshared; - field = null; + this.field = null; switch (signature.charAt(0)) { case 'Z': type = Boolean.TYPE; break; @@ -242,7 +244,7 @@ */ // REMIND: deprecate? public char getTypeCode() { - return signature.charAt(0); + return getSignature().charAt(0); } /** @@ -252,7 +254,7 @@ */ // REMIND: deprecate? public String getTypeString() { - return isPrimitive() ? null : signature; + return isPrimitive() ? null : getSignature(); } /** @@ -284,7 +286,7 @@ */ // REMIND: deprecate? public boolean isPrimitive() { - char tcode = signature.charAt(0); + char tcode = getTypeCode(); return ((tcode != 'L') && (tcode != '[')); } @@ -320,7 +322,7 @@ * Return a string that describes this field. */ public String toString() { - return signature + ' ' + name; + return getSignature() + ' ' + name; } /** @@ -336,6 +338,17 @@ * that signature strings are returned for primitive fields as well). */ String getSignature() { - return signature; + if (signature != null) { + return signature; + } + + String sig = typeSignature; + // This lazy calculation is safe since signature can be null iff one + // of the public constructors are used, in which case type is always + // initialized to the exact type we want the signature to represent. + if (sig == null) { + typeSignature = sig = getClassSignature(type).intern(); + } + return sig; } } diff -r 3e7ed3a7da38 -r d2d3c06dde93 jdk/src/java.base/share/classes/java/io/RandomAccessFile.java --- a/jdk/src/java.base/share/classes/java/io/RandomAccessFile.java Mon Jul 17 09:13:49 2017 -0700 +++ b/jdk/src/java.base/share/classes/java/io/RandomAccessFile.java Thu Jul 20 09:38:13 2017 -0700 @@ -139,21 +139,21 @@ * * * - * + * * * - * + * * - * + * * - * + * * - * + * * diff -r 3e7ed3a7da38 -r d2d3c06dde93 jdk/src/java.base/share/classes/java/io/SerializablePermission.java --- a/jdk/src/java.base/share/classes/java/io/SerializablePermission.java Mon Jul 17 09:13:49 2017 -0700 +++ b/jdk/src/java.base/share/classes/java/io/SerializablePermission.java Thu Jul 20 09:38:13 2017 -0700 @@ -48,15 +48,15 @@ * * * - * - * - * + * + * + * * * * * * - * + * * @@ -69,7 +69,7 @@ * * * - * + * * * * * - * + * * * diff -r 3e7ed3a7da38 -r d2d3c06dde93 jdk/src/java.base/share/classes/java/lang/RuntimePermission.java --- a/jdk/src/java.base/share/classes/java/lang/RuntimePermission.java Mon Jul 17 09:13:49 2017 -0700 +++ b/jdk/src/java.base/share/classes/java/lang/RuntimePermission.java Thu Jul 20 09:38:13 2017 -0700 @@ -48,15 +48,15 @@ * what the target allows, and associated risks * * - * - * - * + * + * + * * * * * * - * + * * * * * - * + * * * * * - * + * * * * * - * + * * * * * - * + * * * * * * - * + * * * * * - * + * * * * * * - * + * * * * * - * + * * * * * - * + * * * * * * - * + * * * * * - * + * * * * * - * + * * * * - * + * * * * * - * + * * * * - * + * * * * * - * + * * * * * - * + * * * * * - * + * * * * * - * + * * * * * - * + * * @@ -255,7 +255,7 @@ * * * - * + * * @@ -267,7 +267,7 @@ * * * - * + * * @@ -277,7 +277,7 @@ * * * - * + * * * * * - * + * * * * * * - * + * * * * * - * + * * * * * - * + * * * * * - * + * * * * - * + * * * * * * - * + * * * * - * + * * * * - * + * * * diff -r 3e7ed3a7da38 -r d2d3c06dde93 jdk/src/java.base/share/classes/java/lang/System.java --- a/jdk/src/java.base/share/classes/java/lang/System.java Mon Jul 17 09:13:49 2017 -0700 +++ b/jdk/src/java.base/share/classes/java/lang/System.java Thu Jul 20 09:38:13 2017 -0700 @@ -582,67 +582,67 @@ *
Access mode permitted values and meanings
ValueMeaning
ValueMeaning
{@code "r"}
{@code "r"} Open for reading only. Invoking any of the {@code write} * methods of the resulting object will cause an * {@link java.io.IOException} to be thrown.
{@code "rw"}
{@code "rw"} Open for reading and writing. If the file does not already * exist then an attempt will be made to create it.
{@code "rws"}
{@code "rws"} Open for reading and writing, as with {@code "rw"}, and also * require that every update to the file's content or metadata be * written synchronously to the underlying storage device.
{@code "rwd"}
{@code "rwd"} Open for reading and writing, as with {@code "rw"}, and also * require that every update to the file's content be written * synchronously to the underlying storage device.
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
enableSubclassImplementationenableSubclassImplementationSubclass implementation of ObjectOutputStream or ObjectInputStream * to override the default serialization or deserialization, respectively, * of objects
enableSubstitutionenableSubstitutionSubstitution of one object for another during * serialization or deserializationThis is dangerous because malicious code @@ -78,7 +78,7 @@ *
serialFilterserialFilterSetting a filter for ObjectInputStreams.Code could remove a configured filter and remove protections * already established.
Permission Target NameWhat the Permission AllowsRisks of Allowing this PermissionPermission Target NameWhat the Permission AllowsRisks of Allowing this Permission
createClassLoadercreateClassLoaderCreation of a class loaderThis is an extremely dangerous permission to grant. * Malicious applications that can instantiate their own class @@ -67,7 +67,7 @@ *
getClassLoadergetClassLoaderRetrieval of a class loader (e.g., the class loader for the calling * class)This would grant an attacker permission to get the @@ -78,7 +78,7 @@ *
setContextClassLoadersetContextClassLoaderSetting of the context class loader used by a threadThe context class loader is used by system code and extensions * when they need to lookup resources that might not exist in the system @@ -88,7 +88,7 @@ *
enableContextClassLoaderOverrideenableContextClassLoaderOverrideSubclass implementation of the thread context class loader methodsThe context class loader is used by system code and extensions * when they need to lookup resources that might not exist in the system @@ -98,14 +98,14 @@ *
closeClassLoadercloseClassLoaderClosing of a ClassLoaderGranting this permission allows code to close any URLClassLoader * that it has a reference to.
setSecurityManagersetSecurityManagerSetting of the security manager (possibly replacing an existing one) * The security manager is a class that allows @@ -117,14 +117,14 @@ *
createSecurityManagercreateSecurityManagerCreation of a new security managerThis gives code access to protected, sensitive methods that may * disclose information about other classes or the execution stack.
getenv.{variable name}getenv.{variable name}Reading of the value of the specified environment variableThis would allow code to read the value, or determine the * existence, of a particular environment variable. This is @@ -132,7 +132,7 @@ *
exitVM.{exit status}exitVM.{exit status}Halting of the Java Virtual Machine with the specified exit statusThis allows an attacker to mount a denial-of-service attack * by automatically forcing the virtual machine to halt. @@ -143,14 +143,14 @@ *
shutdownHooksshutdownHooksRegistration and cancellation of virtual-machine shutdown hooksThis allows an attacker to register a malicious shutdown * hook that interferes with the clean shutdown of the virtual machine.
setFactorysetFactorySetting of the socket factory used by ServerSocket or Socket, * or of the stream handler factory used by URLThis allows code to set the actual implementation @@ -160,7 +160,7 @@ *
setIOsetIOSetting of System.out, System.in, and System.errThis allows changing the value of the standard system streams. * An attacker may change System.in to monitor and @@ -169,7 +169,7 @@ *
modifyThreadmodifyThreadModification of threads, e.g., via calls to Thread * {@code interrupt, stop, suspend, resume, setDaemon, setPriority, * setName} and {@code setUncaughtExceptionHandler} @@ -179,7 +179,7 @@ *
stopThreadstopThreadStopping of threads via calls to the Thread stop * methodThis allows code to stop any thread in the system provided that it is @@ -189,7 +189,7 @@ *
modifyThreadGroupmodifyThreadGroupmodification of thread groups, e.g., via calls to ThreadGroup * destroy, getParent, resume, * setDaemon, setMaxPriority, stop, @@ -199,7 +199,7 @@ *
getProtectionDomaingetProtectionDomainRetrieval of the ProtectionDomain for a classThis allows code to obtain policy information * for a particular code source. While obtaining policy information @@ -209,7 +209,7 @@ *
getFileSystemAttributesgetFileSystemAttributesRetrieval of file system attributesThis allows code to obtain file system information such as disk usage * or disk space available to the caller. This is potentially dangerous @@ -219,7 +219,7 @@ *
readFileDescriptorreadFileDescriptorReading of file descriptorsThis would allow code to read the particular file associated * with the file descriptor read. This is dangerous if the file @@ -227,7 +227,7 @@ *
writeFileDescriptorwriteFileDescriptorWriting to file descriptorsThis allows code to write to a particular file associated * with the descriptor. This is dangerous because it may allow @@ -236,7 +236,7 @@ *
loadLibrary.{library name}loadLibrary.{library name}Dynamic linking of the specified libraryIt is dangerous to allow an applet permission to load native code * libraries, because the Java security architecture is not designed to and @@ -244,7 +244,7 @@ *
accessClassInPackage.{package name}accessClassInPackage.{package name}Access to the specified package via a class loader's * loadClass method when that class loader calls * the SecurityManager checkPackageAccess method
defineClassInPackage.{package name}defineClassInPackage.{package name}Definition of classes in the specified package, via a class * loader's defineClass method when that class loader calls * the SecurityManager checkPackageDefinition method.
defineClassdefineClassDefine a class with * {@link java.lang.invoke.MethodHandles.Lookup#defineClass(byte[]) * Lookup.defineClass}.
accessDeclaredMembersaccessDeclaredMembersAccess to the declared members of a classThis grants code permission to query a class for its public, * protected, default (package) access, and private fields and/or @@ -295,14 +295,14 @@
queuePrintJobqueuePrintJobInitiation of a print job requestThis could print sensitive information to a printer, * or simply waste paper.
getStackTracegetStackTraceRetrieval of the stack trace information of another thread.This allows retrieval of the stack trace information of * another thread. This might allow malicious code to monitor the @@ -310,7 +310,7 @@ *
getStackWalkerWithClassReferencegetStackWalkerWithClassReferenceGet a stack walker that can retrieve stack frames with class reference.This allows retrieval of Class objects from stack walking. * This might allow malicious code to access Class objects on the stack @@ -318,7 +318,7 @@ *
setDefaultUncaughtExceptionHandlersetDefaultUncaughtExceptionHandlerSetting the default handler to be used when a thread * terminates abruptly due to an uncaught exceptionThis allows an attacker to register a malicious @@ -327,7 +327,7 @@ *
preferencespreferencesRepresents the permission required to get access to the * java.util.prefs.Preferences implementations user or system root * which in turn allows retrieval or update operations within the @@ -340,14 +340,14 @@ *
manageProcessmanageProcessNative process termination and information about processes * {@link ProcessHandle}.Allows code to identify and terminate processes that it did not create.
localeServiceProviderlocaleServiceProviderThis {@code RuntimePermission} is required to be granted to * classes which subclass and implement * {@code java.util.spi.LocaleServiceProvider}. The permission is @@ -360,7 +360,7 @@ *
loggerFinderloggerFinderThis {@code RuntimePermission} is required to be granted to * classes which subclass or call methods on * {@code java.lang.System.LoggerFinder}. The permission is @@ -373,7 +373,7 @@ *
accessSystemModulesaccessSystemModulesAccess system modules in the runtime image.This grants the permission to access resources in the * {@linkplain ModuleFinder#ofSystem system modules} in the runtime image.
* * - * - * + * + * * * - * + * * - * + * * - * + * * - * + * * - * + * * - * + * * - * + * * - * + * * - * + * * - * + * * - * + * * - * + * * - * + * * - * + * * - * + * * - * + * * - * + * * - * + * * - * + * * - * + * * - * + * * - * + * * - * + * * - * + * * - * + * * - * + * * - * + * * * *
Shows property keys and associated values
KeyDescription of Associated Value
KeyDescription of Associated Value
java.version
java.versionJava Runtime Environment version which may be interpreted * as a {@link Runtime.Version}
java.vendor
java.vendorJava Runtime Environment vendor
java.vendor.url
java.vendor.urlJava vendor URL
java.home
java.homeJava installation directory
java.vm.specification.version
java.vm.specification.versionJava Virtual Machine specification version which may be * interpreted as a {@link Runtime.Version}
java.vm.specification.vendor
java.vm.specification.vendorJava Virtual Machine specification vendor
java.vm.specification.name
java.vm.specification.nameJava Virtual Machine specification name
java.vm.version
java.vm.versionJava Virtual Machine implementation version which may be * interpreted as a {@link Runtime.Version}
java.vm.vendor
java.vm.vendorJava Virtual Machine implementation vendor
java.vm.name
java.vm.nameJava Virtual Machine implementation name
java.specification.version
java.specification.versionJava Runtime Environment specification version which may be * interpreted as a {@link Runtime.Version}
java.specification.vendor
java.specification.vendorJava Runtime Environment specification vendor
java.specification.name
java.specification.nameJava Runtime Environment specification name
java.class.version
java.class.versionJava class format version number
java.class.path
java.class.pathJava class path
java.library.path
java.library.pathList of paths to search when loading libraries
java.io.tmpdir
java.io.tmpdirDefault temp file path
java.compiler
java.compilerName of JIT compiler to use
os.name
os.nameOperating system name
os.arch
os.archOperating system architecture
os.version
os.versionOperating system version
file.separator
file.separatorFile separator ("/" on UNIX)
path.separator
path.separatorPath separator (":" on UNIX)
line.separator
line.separatorLine separator ("\n" on UNIX)
user.name
user.nameUser's account name
user.home
user.homeUser's home directory
user.dir
user.dirUser's current working directory
@@ -659,17 +659,17 @@ * * * - * - * + * + * * * - * + * * - * + * * - * + * * - * + * * * *
Shows property keys and associated values
KeyDescription of Associated Value
KeyDescription of Associated Value
{@code jdk.module.path}
{@code jdk.module.path}The application module path
{@code jdk.module.upgrade.path}
{@code jdk.module.upgrade.path}The upgrade module path
{@code jdk.module.main}
{@code jdk.module.main}The module name of the initial/main module
{@code jdk.module.main.class}
{@code jdk.module.main.class}The main class name of the initial module
diff -r 3e7ed3a7da38 -r d2d3c06dde93 jdk/src/java.base/share/classes/java/lang/invoke/MethodHandleInfo.java --- a/jdk/src/java.base/share/classes/java/lang/invoke/MethodHandleInfo.java Mon Jul 17 09:13:49 2017 -0700 +++ b/jdk/src/java.base/share/classes/java/lang/invoke/MethodHandleInfo.java Thu Jul 20 09:38:13 2017 -0700 @@ -84,43 +84,43 @@ * * * - * + * * * * - * + * * * * - * + * * * * - * + * * * * - * + * * * * - * + * * * * - * + * * * * - * + * * * * - * + * * * * - * + * * * * diff -r 3e7ed3a7da38 -r d2d3c06dde93 jdk/src/java.base/share/classes/java/lang/invoke/MethodHandles.java --- a/jdk/src/java.base/share/classes/java/lang/invoke/MethodHandles.java Mon Jul 17 09:13:49 2017 -0700 +++ b/jdk/src/java.base/share/classes/java/lang/invoke/MethodHandles.java Thu Jul 20 09:38:13 2017 -0700 @@ -282,66 +282,66 @@ * * * - * - * - * + * + * + * * * * * - * + * * * * - * + * * * * - * + * * * * - * + * * * * - * + * * * * - * + * * * * - * + * * * * - * + * * * * - * + * * * * - * + * * * * - * + * * * * - * + * * * * - * + * * * * - * + * * * * diff -r 3e7ed3a7da38 -r d2d3c06dde93 jdk/src/java.base/share/classes/java/lang/reflect/ReflectPermission.java --- a/jdk/src/java.base/share/classes/java/lang/reflect/ReflectPermission.java Mon Jul 17 09:13:49 2017 -0700 +++ b/jdk/src/java.base/share/classes/java/lang/reflect/ReflectPermission.java Thu Jul 20 09:38:13 2017 -0700 @@ -36,15 +36,15 @@ * * * - * - * - * + * + * + * * * * * * - * + * * * * - * + * * * * * - * - * - * + * + * + * * * * * - * + * * * * * - * + * * * * * - * + * * * * * * - * + * * * * * - * + * * * * * - * + * * @@ -108,7 +108,7 @@ * * * - * + * * * * * - * + * * @@ -128,7 +128,7 @@ * * * - * + * * * * * - * + * * * * * - * + * * * * * - * - * + * + * * * * * - * + * * * * - * + * *
reference kinds
reference kinddescriptive namescopememberbehavior
reference kinddescriptive namescopememberbehavior
{@code 1}{@code REF_getField}{@code class}{@code 1}{@code REF_getField}{@code class}{@code FT f;}{@code (T) this.f;}
{@code 2}{@code REF_getStatic}{@code class} or {@code interface}{@code 2}{@code REF_getStatic}{@code class} or {@code interface}{@code static}
{@code FT f;}
{@code (T) C.f;}
{@code 3}{@code REF_putField}{@code class}{@code 3}{@code REF_putField}{@code class}{@code FT f;}{@code this.f = x;}
{@code 4}{@code REF_putStatic}{@code class}{@code 4}{@code REF_putStatic}{@code class}{@code static}
{@code FT f;}
{@code C.f = arg;}
{@code 5}{@code REF_invokeVirtual}{@code class}{@code 5}{@code REF_invokeVirtual}{@code class}{@code T m(A*);}{@code (T) this.m(arg*);}
{@code 6}{@code REF_invokeStatic}{@code class} or {@code interface}{@code 6}{@code REF_invokeStatic}{@code class} or {@code interface}{@code static}
{@code T m(A*);}
{@code (T) C.m(arg*);}
{@code 7}{@code REF_invokeSpecial}{@code class} or {@code interface}{@code 7}{@code REF_invokeSpecial}{@code class} or {@code interface}{@code T m(A*);}{@code (T) super.m(arg*);}
{@code 8}{@code REF_newInvokeSpecial}{@code class}{@code 8}{@code REF_newInvokeSpecial}{@code class}{@code C(A*);}{@code new C(arg*);}
{@code 9}{@code REF_invokeInterface}{@code interface}{@code 9}{@code REF_invokeInterface}{@code interface}{@code T m(A*);}{@code (T) this.m(arg*);}
lookup method behaviors
lookup expressionmemberbytecode behaviorlookup expressionmemberbytecode behavior
{@link java.lang.invoke.MethodHandles.Lookup#findGetter lookup.findGetter(C.class,"f",FT.class)}{@link java.lang.invoke.MethodHandles.Lookup#findGetter lookup.findGetter(C.class,"f",FT.class)}{@code FT f;}{@code (T) this.f;}
{@link java.lang.invoke.MethodHandles.Lookup#findStaticGetter lookup.findStaticGetter(C.class,"f",FT.class)}{@link java.lang.invoke.MethodHandles.Lookup#findStaticGetter lookup.findStaticGetter(C.class,"f",FT.class)}{@code static}
{@code FT f;}
{@code (T) C.f;}
{@link java.lang.invoke.MethodHandles.Lookup#findSetter lookup.findSetter(C.class,"f",FT.class)}{@link java.lang.invoke.MethodHandles.Lookup#findSetter lookup.findSetter(C.class,"f",FT.class)}{@code FT f;}{@code this.f = x;}
{@link java.lang.invoke.MethodHandles.Lookup#findStaticSetter lookup.findStaticSetter(C.class,"f",FT.class)}{@link java.lang.invoke.MethodHandles.Lookup#findStaticSetter lookup.findStaticSetter(C.class,"f",FT.class)}{@code static}
{@code FT f;}
{@code C.f = arg;}
{@link java.lang.invoke.MethodHandles.Lookup#findVirtual lookup.findVirtual(C.class,"m",MT)}{@link java.lang.invoke.MethodHandles.Lookup#findVirtual lookup.findVirtual(C.class,"m",MT)}{@code T m(A*);}{@code (T) this.m(arg*);}
{@link java.lang.invoke.MethodHandles.Lookup#findStatic lookup.findStatic(C.class,"m",MT)}{@link java.lang.invoke.MethodHandles.Lookup#findStatic lookup.findStatic(C.class,"m",MT)}{@code static}
{@code T m(A*);}
{@code (T) C.m(arg*);}
{@link java.lang.invoke.MethodHandles.Lookup#findSpecial lookup.findSpecial(C.class,"m",MT,this.class)}{@link java.lang.invoke.MethodHandles.Lookup#findSpecial lookup.findSpecial(C.class,"m",MT,this.class)}{@code T m(A*);}{@code (T) super.m(arg*);}
{@link java.lang.invoke.MethodHandles.Lookup#findConstructor lookup.findConstructor(C.class,MT)}{@link java.lang.invoke.MethodHandles.Lookup#findConstructor lookup.findConstructor(C.class,MT)}{@code C(A*);}{@code new C(arg*);}
{@link java.lang.invoke.MethodHandles.Lookup#unreflectGetter lookup.unreflectGetter(aField)}{@link java.lang.invoke.MethodHandles.Lookup#unreflectGetter lookup.unreflectGetter(aField)}({@code static})?
{@code FT f;}
{@code (FT) aField.get(thisOrNull);}
{@link java.lang.invoke.MethodHandles.Lookup#unreflectSetter lookup.unreflectSetter(aField)}{@link java.lang.invoke.MethodHandles.Lookup#unreflectSetter lookup.unreflectSetter(aField)}({@code static})?
{@code FT f;}
{@code aField.set(thisOrNull, arg);}
{@link java.lang.invoke.MethodHandles.Lookup#unreflect lookup.unreflect(aMethod)}{@link java.lang.invoke.MethodHandles.Lookup#unreflect lookup.unreflect(aMethod)}({@code static})?
{@code T m(A*);}
{@code (T) aMethod.invoke(thisOrNull, arg*);}
{@link java.lang.invoke.MethodHandles.Lookup#unreflectConstructor lookup.unreflectConstructor(aConstructor)}{@link java.lang.invoke.MethodHandles.Lookup#unreflectConstructor lookup.unreflectConstructor(aConstructor)}{@code C(A*);}{@code (C) aConstructor.newInstance(arg*);}
{@link java.lang.invoke.MethodHandles.Lookup#unreflect lookup.unreflect(aMethod)}{@link java.lang.invoke.MethodHandles.Lookup#unreflect lookup.unreflect(aMethod)}({@code static})?
{@code T m(A*);}
{@code (T) aMethod.invoke(thisOrNull, arg*);}
{@link java.lang.invoke.MethodHandles.Lookup#findClass lookup.findClass("C")}{@link java.lang.invoke.MethodHandles.Lookup#findClass lookup.findClass("C")}{@code class C { ... }}{@code C.class;}
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
suppressAccessCheckssuppressAccessChecksability to suppress the standard Java language access checks * on fields and methods in a class; allow access not only public members * but also allow access to default (package) access, protected, @@ -53,7 +53,7 @@ * methods normally unavailable would be accessible to malicious code.
newProxyInPackage.{package name}newProxyInPackage.{package name}ability to create a proxy instance in the specified package of which * the non-public interface that the proxy class implements.This gives code access to classes in packages to which it normally diff -r 3e7ed3a7da38 -r d2d3c06dde93 jdk/src/java.base/share/classes/java/net/NetPermission.java --- a/jdk/src/java.base/share/classes/java/net/NetPermission.java Mon Jul 17 09:13:49 2017 -0700 +++ b/jdk/src/java.base/share/classes/java/net/NetPermission.java Thu Jul 20 09:38:13 2017 -0700 @@ -51,14 +51,14 @@ *
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
allowHttpTraceallowHttpTraceThe ability to use the HTTP TRACE method in HttpURLConnection.Malicious code using HTTP TRACE could get access to security sensitive * information in the HTTP headers (such as cookies) that it might not @@ -66,7 +66,7 @@ *
getCookieHandlergetCookieHandlerThe ability to get the cookie handler that processes highly * security sensitive cookie information for an Http session.Malicious code can get a cookie handler to obtain access to @@ -76,14 +76,14 @@ *
getNetworkInformationgetNetworkInformationThe ability to retrieve all information about local network interfaces.Malicious code can read information about network hardware such as * MAC addresses, which could be used to construct local IPv6 addresses.
getProxySelectorgetProxySelectorThe ability to get the proxy selector used to make decisions * on which proxies to use when making network connections.Malicious code can get a ProxySelector to discover proxy @@ -92,7 +92,7 @@ *
getResponseCachegetResponseCacheThe ability to get the response cache that provides * access to a local response cache.Malicious code getting access to the local response cache @@ -100,7 +100,7 @@ *
requestPasswordAuthenticationrequestPasswordAuthenticationThe ability * to ask the authenticator registered with the system for * a password
setCookieHandlersetCookieHandlerThe ability to set the cookie handler that processes highly * security sensitive cookie information for an Http session.Malicious code can set a cookie handler to obtain access to @@ -118,7 +118,7 @@ *
setDefaultAuthenticatorsetDefaultAuthenticatorThe ability to set the * way authentication information is retrieved when * a proxy or HTTP server asks for authentication
setProxySelectorsetProxySelectorThe ability to set the proxy selector used to make decisions * on which proxies to use when making network connections.Malicious code can set a ProxySelector that directs network @@ -136,7 +136,7 @@ *
setResponseCachesetResponseCacheThe ability to set the response cache that provides access to * a local response cache.Malicious code getting access to the local response cache @@ -145,7 +145,7 @@ *
specifyStreamHandlerspecifyStreamHandlerThe ability * to specify a stream handler when constructing a URLMalicious code may create a URL with resources that it would diff -r 3e7ed3a7da38 -r d2d3c06dde93 jdk/src/java.base/share/classes/java/nio/channels/AsynchronousChannelGroup.java --- a/jdk/src/java.base/share/classes/java/nio/channels/AsynchronousChannelGroup.java Mon Jul 17 09:13:49 2017 -0700 +++ b/jdk/src/java.base/share/classes/java/nio/channels/AsynchronousChannelGroup.java Thu Jul 20 09:38:13 2017 -0700 @@ -64,13 +64,13 @@ *
System properties
System propertyDescriptionSystem propertyDescription
{@code java.nio.channels.DefaultThreadPool.threadFactory} {@code java.nio.channels.DefaultThreadPool.threadFactory} The value of this property is taken to be the fully-qualified name * of a concrete {@link java.util.concurrent.ThreadFactory ThreadFactory} * class. The class is loaded using the system class loader and instantiated. @@ -81,7 +81,7 @@ * construction of the default group.
{@code java.nio.channels.DefaultThreadPool.initialSize} {@code java.nio.channels.DefaultThreadPool.initialSize} The value of the {@code initialSize} parameter for the default * group (see {@link #withCachedThreadPool withCachedThreadPool}). * The value of the property is taken to be the {@code String} diff -r 3e7ed3a7da38 -r d2d3c06dde93 jdk/src/java.base/share/classes/java/nio/channels/AsynchronousFileChannel.java --- a/jdk/src/java.base/share/classes/java/nio/channels/AsynchronousFileChannel.java Mon Jul 17 09:13:49 2017 -0700 +++ b/jdk/src/java.base/share/classes/java/nio/channels/AsynchronousFileChannel.java Thu Jul 20 09:38:13 2017 -0700 @@ -136,17 +136,17 @@ * * * - * + * * * * - * + * * * * - * + * * * * - * + * * * * - * + * * * * - * + * * * * - * + * * * * - * + * * * * - * - * + * + * * * * * - * + * * * * - * + * * * * diff -r 3e7ed3a7da38 -r d2d3c06dde93 jdk/src/java.base/share/classes/java/nio/channels/AsynchronousSocketChannel.java --- a/jdk/src/java.base/share/classes/java/nio/channels/AsynchronousSocketChannel.java Mon Jul 17 09:13:49 2017 -0700 +++ b/jdk/src/java.base/share/classes/java/nio/channels/AsynchronousSocketChannel.java Thu Jul 20 09:38:13 2017 -0700 @@ -66,29 +66,29 @@ * * * - * - * + * + * * * * * - * + * * * * - * + * * * * - * + * * * * - * + * * * * - * + * * * * diff -r 3e7ed3a7da38 -r d2d3c06dde93 jdk/src/java.base/share/classes/java/nio/channels/DatagramChannel.java --- a/jdk/src/java.base/share/classes/java/nio/channels/DatagramChannel.java Mon Jul 17 09:13:49 2017 -0700 +++ b/jdk/src/java.base/share/classes/java/nio/channels/DatagramChannel.java Thu Jul 20 09:38:13 2017 -0700 @@ -61,44 +61,44 @@ * * * - * - * + * + * * * * * - * + * * * * - * + * * * * - * + * * * * - * + * * * * - * + * * * * - * + * * * * - * + * * * * - * + * * * * diff -r 3e7ed3a7da38 -r d2d3c06dde93 jdk/src/java.base/share/classes/java/nio/channels/FileChannel.java --- a/jdk/src/java.base/share/classes/java/nio/channels/FileChannel.java Mon Jul 17 09:13:49 2017 -0700 +++ b/jdk/src/java.base/share/classes/java/nio/channels/FileChannel.java Thu Jul 20 09:38:13 2017 -0700 @@ -177,11 +177,11 @@ *
additional options
Option Description
Option Description
{@link StandardOpenOption#TRUNCATE_EXISTING TRUNCATE_EXISTING} {@link StandardOpenOption#TRUNCATE_EXISTING TRUNCATE_EXISTING} When opening an existing file, the file is first truncated to a * size of 0 bytes. This option is ignored when the file is opened only * for reading.
{@link StandardOpenOption#CREATE_NEW CREATE_NEW} {@link StandardOpenOption#CREATE_NEW CREATE_NEW} If this option is present then a new file is created, failing if * the file already exists. When creating a file the check for the * existence of the file and the creation of the file if it does not exist @@ -154,7 +154,7 @@ * ignored when the file is opened only for reading.
{@link StandardOpenOption#CREATE CREATE} {@link StandardOpenOption#CREATE CREATE} If this option is present then an existing file is opened if it * exists, otherwise a new file is created. When creating a file the check * for the existence of the file and the creation of the file if it does @@ -163,7 +163,7 @@ * the file is opened only for reading.
{@link StandardOpenOption#DELETE_ON_CLOSE DELETE_ON_CLOSE} {@link StandardOpenOption#DELETE_ON_CLOSE DELETE_ON_CLOSE} When this option is present then the implementation makes a * best effort attempt to delete the file when closed by the * the {@link #close close} method. If the {@code close} method is not @@ -171,20 +171,20 @@ * when the Java virtual machine terminates.
{@link StandardOpenOption#SPARSE SPARSE} {@link StandardOpenOption#SPARSE SPARSE} When creating a new file this option is a hint that the * new file will be sparse. This option is ignored when not creating * a new file.
{@link StandardOpenOption#SYNC SYNC} {@link StandardOpenOption#SYNC SYNC} Requires that every update to the file's content or metadata be * written synchronously to the underlying storage device. (see Synchronized I/O file * integrity).
{@link StandardOpenOption#DSYNC DSYNC} {@link StandardOpenOption#DSYNC DSYNC} Requires that every update to the file's content be written * synchronously to the underlying storage device. (see Synchronized I/O file diff -r 3e7ed3a7da38 -r d2d3c06dde93 jdk/src/java.base/share/classes/java/nio/channels/AsynchronousServerSocketChannel.java --- a/jdk/src/java.base/share/classes/java/nio/channels/AsynchronousServerSocketChannel.java Mon Jul 17 09:13:49 2017 -0700 +++ b/jdk/src/java.base/share/classes/java/nio/channels/AsynchronousServerSocketChannel.java Thu Jul 20 09:38:13 2017 -0700 @@ -56,17 +56,17 @@ *
Socket options
Option NameDescriptionOption NameDescription
{@link java.net.StandardSocketOptions#SO_RCVBUF SO_RCVBUF} {@link java.net.StandardSocketOptions#SO_RCVBUF SO_RCVBUF} The size of the socket receive buffer
{@link java.net.StandardSocketOptions#SO_REUSEADDR SO_REUSEADDR} {@link java.net.StandardSocketOptions#SO_REUSEADDR SO_REUSEADDR} Re-use address
Socket options
Option NameDescriptionOption NameDescription
{@link java.net.StandardSocketOptions#SO_SNDBUF SO_SNDBUF} {@link java.net.StandardSocketOptions#SO_SNDBUF SO_SNDBUF} The size of the socket send buffer
{@link java.net.StandardSocketOptions#SO_RCVBUF SO_RCVBUF} {@link java.net.StandardSocketOptions#SO_RCVBUF SO_RCVBUF} The size of the socket receive buffer
{@link java.net.StandardSocketOptions#SO_KEEPALIVE SO_KEEPALIVE} {@link java.net.StandardSocketOptions#SO_KEEPALIVE SO_KEEPALIVE} Keep connection alive
{@link java.net.StandardSocketOptions#SO_REUSEADDR SO_REUSEADDR} {@link java.net.StandardSocketOptions#SO_REUSEADDR SO_REUSEADDR} Re-use address
{@link java.net.StandardSocketOptions#TCP_NODELAY TCP_NODELAY} {@link java.net.StandardSocketOptions#TCP_NODELAY TCP_NODELAY} Disable the Nagle algorithm
Socket options
Option NameDescriptionOption NameDescription
{@link java.net.StandardSocketOptions#SO_SNDBUF SO_SNDBUF} {@link java.net.StandardSocketOptions#SO_SNDBUF SO_SNDBUF} The size of the socket send buffer
{@link java.net.StandardSocketOptions#SO_RCVBUF SO_RCVBUF} {@link java.net.StandardSocketOptions#SO_RCVBUF SO_RCVBUF} The size of the socket receive buffer
{@link java.net.StandardSocketOptions#SO_REUSEADDR SO_REUSEADDR} {@link java.net.StandardSocketOptions#SO_REUSEADDR SO_REUSEADDR} Re-use address
{@link java.net.StandardSocketOptions#SO_BROADCAST SO_BROADCAST} {@link java.net.StandardSocketOptions#SO_BROADCAST SO_BROADCAST} Allow transmission of broadcast datagrams
{@link java.net.StandardSocketOptions#IP_TOS IP_TOS} {@link java.net.StandardSocketOptions#IP_TOS IP_TOS} The Type of Service (ToS) octet in the Internet Protocol (IP) header
{@link java.net.StandardSocketOptions#IP_MULTICAST_IF IP_MULTICAST_IF} {@link java.net.StandardSocketOptions#IP_MULTICAST_IF IP_MULTICAST_IF} The network interface for Internet Protocol (IP) multicast datagrams
{@link java.net.StandardSocketOptions#IP_MULTICAST_TTL - * IP_MULTICAST_TTL} {@link java.net.StandardSocketOptions#IP_MULTICAST_TTL + * IP_MULTICAST_TTL} The time-to-live for Internet Protocol (IP) multicast * datagrams
{@link java.net.StandardSocketOptions#IP_MULTICAST_LOOP - * IP_MULTICAST_LOOP} {@link java.net.StandardSocketOptions#IP_MULTICAST_LOOP + * IP_MULTICAST_LOOP} Loopback for Internet Protocol (IP) multicast datagrams
* * - * + * * * * - * + * * * * - * + * * * * - * + * * * * - * + * * * * - * + * * * * - * + * * * * - * + * * * * - * + * * * * - * - * + * + * * * * * - * + * * * * - * + * * * * diff -r 3e7ed3a7da38 -r d2d3c06dde93 jdk/src/java.base/share/classes/java/nio/channels/SocketChannel.java --- a/jdk/src/java.base/share/classes/java/nio/channels/SocketChannel.java Mon Jul 17 09:13:49 2017 -0700 +++ b/jdk/src/java.base/share/classes/java/nio/channels/SocketChannel.java Thu Jul 20 09:38:13 2017 -0700 @@ -70,34 +70,34 @@ * * * - * - * + * + * * * * * - * + * * * * - * + * * * * - * + * * * * - * + * * * * - * + * * * * - * + * * * * diff -r 3e7ed3a7da38 -r d2d3c06dde93 jdk/src/java.base/share/classes/java/nio/charset/Charset.java --- a/jdk/src/java.base/share/classes/java/nio/charset/Charset.java Mon Jul 17 09:13:49 2017 -0700 +++ b/jdk/src/java.base/share/classes/java/nio/charset/Charset.java Thu Jul 20 09:38:13 2017 -0700 @@ -25,6 +25,11 @@ package java.nio.charset; +import jdk.internal.misc.VM; +import sun.nio.cs.StandardCharsets; +import sun.nio.cs.ThreadLocalCoders; +import sun.security.action.GetPropertyAction; + import java.nio.ByteBuffer; import java.nio.CharBuffer; import java.nio.charset.spi.CharsetProvider; @@ -38,15 +43,11 @@ import java.util.Map; import java.util.NoSuchElementException; import java.util.Objects; -import java.util.Set; +import java.util.ServiceConfigurationError; import java.util.ServiceLoader; -import java.util.ServiceConfigurationError; +import java.util.Set; import java.util.SortedMap; import java.util.TreeMap; -import jdk.internal.misc.VM; -import sun.nio.cs.StandardCharsets; -import sun.nio.cs.ThreadLocalCoders; -import sun.security.action.GetPropertyAction; /** @@ -150,23 +151,23 @@ *
additional options
Option Description
Option Description
{@link StandardOpenOption#APPEND APPEND} {@link StandardOpenOption#APPEND APPEND} If this option is present then the file is opened for writing and * each invocation of the channel's {@code write} method first advances * the position to the end of the file and then writes the requested @@ -191,13 +191,13 @@ * with the {@code READ} or {@code TRUNCATE_EXISTING} options.
{@link StandardOpenOption#TRUNCATE_EXISTING TRUNCATE_EXISTING} {@link StandardOpenOption#TRUNCATE_EXISTING TRUNCATE_EXISTING} If this option is present then the existing file is truncated to * a size of 0 bytes. This option is ignored when the file is opened only * for reading.
{@link StandardOpenOption#CREATE_NEW CREATE_NEW} {@link StandardOpenOption#CREATE_NEW CREATE_NEW} If this option is present then a new file is created, failing if * the file already exists. When creating a file the check for the * existence of the file and the creation of the file if it does not exist @@ -205,7 +205,7 @@ * ignored when the file is opened only for reading.
{@link StandardOpenOption#CREATE CREATE} {@link StandardOpenOption#CREATE CREATE} If this option is present then an existing file is opened if it * exists, otherwise a new file is created. When creating a file the check * for the existence of the file and the creation of the file if it does @@ -214,7 +214,7 @@ * the file is opened only for reading.
{@link StandardOpenOption#DELETE_ON_CLOSE DELETE_ON_CLOSE} {@link StandardOpenOption#DELETE_ON_CLOSE DELETE_ON_CLOSE} When this option is present then the implementation makes a * best effort attempt to delete the file when closed by the * the {@link #close close} method. If the {@code close} method is not @@ -222,20 +222,20 @@ * when the Java virtual machine terminates.
{@link StandardOpenOption#SPARSE SPARSE} {@link StandardOpenOption#SPARSE SPARSE} When creating a new file this option is a hint that the * new file will be sparse. This option is ignored when not creating * a new file.
{@link StandardOpenOption#SYNC SYNC} {@link StandardOpenOption#SYNC SYNC} Requires that every update to the file's content or metadata be * written synchronously to the underlying storage device. (see Synchronized I/O file * integrity).
{@link StandardOpenOption#DSYNC DSYNC} {@link StandardOpenOption#DSYNC DSYNC} Requires that every update to the file's content be written * synchronously to the underlying storage device. (see Synchronized I/O file diff -r 3e7ed3a7da38 -r d2d3c06dde93 jdk/src/java.base/share/classes/java/nio/channels/ServerSocketChannel.java --- a/jdk/src/java.base/share/classes/java/nio/channels/ServerSocketChannel.java Mon Jul 17 09:13:49 2017 -0700 +++ b/jdk/src/java.base/share/classes/java/nio/channels/ServerSocketChannel.java Thu Jul 20 09:38:13 2017 -0700 @@ -50,17 +50,17 @@ *
Socket options
Option NameDescriptionOption NameDescription
{@link java.net.StandardSocketOptions#SO_RCVBUF SO_RCVBUF} {@link java.net.StandardSocketOptions#SO_RCVBUF SO_RCVBUF} The size of the socket receive buffer
{@link java.net.StandardSocketOptions#SO_REUSEADDR SO_REUSEADDR} {@link java.net.StandardSocketOptions#SO_REUSEADDR SO_REUSEADDR} Re-use address
Socket options
Option NameDescriptionOption NameDescription
{@link java.net.StandardSocketOptions#SO_SNDBUF SO_SNDBUF} {@link java.net.StandardSocketOptions#SO_SNDBUF SO_SNDBUF} The size of the socket send buffer
{@link java.net.StandardSocketOptions#SO_RCVBUF SO_RCVBUF} {@link java.net.StandardSocketOptions#SO_RCVBUF SO_RCVBUF} The size of the socket receive buffer
{@link java.net.StandardSocketOptions#SO_KEEPALIVE SO_KEEPALIVE} {@link java.net.StandardSocketOptions#SO_KEEPALIVE SO_KEEPALIVE} Keep connection alive
{@link java.net.StandardSocketOptions#SO_REUSEADDR SO_REUSEADDR} {@link java.net.StandardSocketOptions#SO_REUSEADDR SO_REUSEADDR} Re-use address
{@link java.net.StandardSocketOptions#SO_LINGER SO_LINGER} {@link java.net.StandardSocketOptions#SO_LINGER SO_LINGER} Linger on close if data is present (when configured in blocking mode * only)
{@link java.net.StandardSocketOptions#TCP_NODELAY TCP_NODELAY} {@link java.net.StandardSocketOptions#TCP_NODELAY TCP_NODELAY} Disable the Nagle algorithm
* * - * + * * * - * + * * - * + * * - * + * * - * + * * - * + * * - * + * * * @@ -635,10 +636,19 @@ * If the canonical name or any of the aliases are illegal */ protected Charset(String canonicalName, String[] aliases) { - checkName(canonicalName); String[] as = Objects.requireNonNullElse(aliases, zeroAliases); - for (int i = 0; i < as.length; i++) - checkName(as[i]); + + // Skip checks for the standard, built-in Charsets we always load + // during initialization. Use of identity is intentional to be + // consistent with sun.nio.cs.StandardCharsets + if (canonicalName != StandardCharsets.ISO_8859_1 + && canonicalName != StandardCharsets.US_ASCII + && canonicalName != StandardCharsets.UTF_8) { + checkName(canonicalName); + for (int i = 0; i < as.length; i++) { + checkName(as[i]); + } + } this.name = canonicalName; this.aliases = as; } diff -r 3e7ed3a7da38 -r d2d3c06dde93 jdk/src/java.base/share/classes/java/nio/file/Files.java --- a/jdk/src/java.base/share/classes/java/nio/file/Files.java Mon Jul 17 09:13:49 2017 -0700 +++ b/jdk/src/java.base/share/classes/java/nio/file/Files.java Thu Jul 20 09:38:13 2017 -0700 @@ -236,11 +236,11 @@ *
Description of standard charsets
CharsetDescription
CharsetDescription
{@code US-ASCII}
{@code US-ASCII}Seven-bit ASCII, a.k.a. {@code ISO646-US}, * a.k.a. the Basic Latin block of the Unicode character set
ISO-8859-1  
ISO-8859-1  ISO Latin Alphabet No. 1, a.k.a. {@code ISO-LATIN-1}
{@code UTF-8}
{@code UTF-8}Eight-bit UCS Transformation Format
{@code UTF-16BE}
{@code UTF-16BE}Sixteen-bit UCS Transformation Format, * big-endian byte order
{@code UTF-16LE}
{@code UTF-16LE}Sixteen-bit UCS Transformation Format, * little-endian byte order
{@code UTF-16}
{@code UTF-16}Sixteen-bit UCS Transformation Format, * byte order identified by an optional byte-order mark
* * - * + * * * * - * + * * * * - * + * * * * - * + * * * * - * + * * * * - * + * * * * - * + * * * * - * + * * * * - * + * *
Options
Option Description
Option Description
{@link StandardOpenOption#APPEND APPEND} {@link StandardOpenOption#APPEND APPEND} If this option is present then the file is opened for writing and * each invocation of the channel's {@code write} method first advances * the position to the end of the file and then writes the requested @@ -250,13 +250,13 @@ * with the {@code READ} or {@code TRUNCATE_EXISTING} options.
{@link StandardOpenOption#TRUNCATE_EXISTING TRUNCATE_EXISTING} {@link StandardOpenOption#TRUNCATE_EXISTING TRUNCATE_EXISTING} If this option is present then the existing file is truncated to * a size of 0 bytes. This option is ignored when the file is opened only * for reading.
{@link StandardOpenOption#CREATE_NEW CREATE_NEW} {@link StandardOpenOption#CREATE_NEW CREATE_NEW} If this option is present then a new file is created, failing if * the file already exists or is a symbolic link. When creating a file the * check for the existence of the file and the creation of the file if it @@ -264,14 +264,14 @@ * This option is ignored when the file is opened only for reading.
{@link StandardOpenOption#CREATE CREATE} {@link StandardOpenOption#CREATE CREATE} If this option is present then an existing file is opened if it * exists, otherwise a new file is created. This option is ignored if the * {@code CREATE_NEW} option is also present or the file is opened only * for reading.
{@link StandardOpenOption#DELETE_ON_CLOSE DELETE_ON_CLOSE} {@link StandardOpenOption#DELETE_ON_CLOSE DELETE_ON_CLOSE} When this option is present then the implementation makes a * best effort attempt to delete the file when closed by the * {@link SeekableByteChannel#close close} method. If the {@code close} @@ -279,20 +279,20 @@ * delete the file when the Java virtual machine terminates.
{@link StandardOpenOption#SPARSE SPARSE} {@link StandardOpenOption#SPARSE SPARSE} When creating a new file this option is a hint that the * new file will be sparse. This option is ignored when not creating * a new file.
{@link StandardOpenOption#SYNC SYNC} {@link StandardOpenOption#SYNC SYNC} Requires that every update to the file's content or metadata be * written synchronously to the underlying storage device. (see Synchronized I/O file * integrity).
{@link StandardOpenOption#DSYNC DSYNC} {@link StandardOpenOption#DSYNC DSYNC} Requires that every update to the file's content be written * synchronously to the underlying storage device. (see Synchronized I/O file @@ -1196,18 +1196,18 @@ * * * - * + * * * * - * + * * * * - * + * * * * - * + * * * * - * - * - * + * + * + * * * * * - * + * * * * * - * + * * * * * - * + * * * * * - * + * * * * * - * + * * * * - * + * * * * * - * + * * * * * - * + * * * * * - * + * * * * * - * + * * * * * - * + * * * * * - * + * * * * * - * + * * * * - * + * * * * * - * + * * * * * - * + * * * * * - * + * * * * - * + * * * * * - * + * * * * diff -r 3e7ed3a7da38 -r d2d3c06dde93 jdk/src/java.base/share/classes/java/util/Formatter.java --- a/jdk/src/java.base/share/classes/java/util/Formatter.java Mon Jul 17 09:13:49 2017 -0700 +++ b/jdk/src/java.base/share/classes/java/util/Formatter.java Thu Jul 20 09:38:13 2017 -0700 @@ -293,12 +293,12 @@ *
Options
Option Description
Option Description
{@link StandardCopyOption#REPLACE_EXISTING REPLACE_EXISTING} {@link StandardCopyOption#REPLACE_EXISTING REPLACE_EXISTING} If the target file exists, then the target file is replaced if it * is not a non-empty directory. If the target file exists and is a * symbolic link, then the symbolic link itself, not the target of * the link, is replaced.
{@link StandardCopyOption#COPY_ATTRIBUTES COPY_ATTRIBUTES} {@link StandardCopyOption#COPY_ATTRIBUTES COPY_ATTRIBUTES} Attempts to copy the file attributes associated with this file to * the target file. The exact file attributes that are copied is platform * and file system dependent and therefore unspecified. Minimally, the @@ -1217,7 +1217,7 @@ * loss.
{@link LinkOption#NOFOLLOW_LINKS NOFOLLOW_LINKS} {@link LinkOption#NOFOLLOW_LINKS NOFOLLOW_LINKS} Symbolic links are not followed. If the file is a symbolic link, * then the symbolic link itself, not the target of the link, is copied. * It is implementation specific if file attributes can be copied to the @@ -1319,18 +1319,18 @@ * * * - * + * * * * - * + * * * * - * + * * * * - * - * - * + * + * + * * * * * - * + * * * * * - * + * * * * * - * - * + * + * * * * * - * + * * * * - * + * * * * diff -r 3e7ed3a7da38 -r d2d3c06dde93 jdk/src/java.base/share/classes/java/nio/file/attribute/BasicFileAttributeView.java --- a/jdk/src/java.base/share/classes/java/nio/file/attribute/BasicFileAttributeView.java Mon Jul 17 09:13:49 2017 -0700 +++ b/jdk/src/java.base/share/classes/java/nio/file/attribute/BasicFileAttributeView.java Thu Jul 20 09:38:13 2017 -0700 @@ -45,45 +45,45 @@ * * * - * - * + * + * * * * * - * + * * * * - * + * * * * - * + * * * * - * + * * * * - * + * * * * - * + * * * * - * + * * * * - * + * * * * - * + * * * * diff -r 3e7ed3a7da38 -r d2d3c06dde93 jdk/src/java.base/share/classes/java/nio/file/attribute/DosFileAttributeView.java --- a/jdk/src/java.base/share/classes/java/nio/file/attribute/DosFileAttributeView.java Mon Jul 17 09:13:49 2017 -0700 +++ b/jdk/src/java.base/share/classes/java/nio/file/attribute/DosFileAttributeView.java Thu Jul 20 09:38:13 2017 -0700 @@ -45,25 +45,25 @@ * * * - * - * + * + * * * * * - * + * * * * - * + * * * * - * + * * * * - * + * * * * diff -r 3e7ed3a7da38 -r d2d3c06dde93 jdk/src/java.base/share/classes/java/nio/file/attribute/PosixFileAttributeView.java --- a/jdk/src/java.base/share/classes/java/nio/file/attribute/PosixFileAttributeView.java Mon Jul 17 09:13:49 2017 -0700 +++ b/jdk/src/java.base/share/classes/java/nio/file/attribute/PosixFileAttributeView.java Thu Jul 20 09:38:13 2017 -0700 @@ -78,17 +78,17 @@ * * * - * - * + * + * * * * * - * + * * * * - * + * * * * diff -r 3e7ed3a7da38 -r d2d3c06dde93 jdk/src/java.base/share/classes/java/nio/file/spi/FileSystemProvider.java --- a/jdk/src/java.base/share/classes/java/nio/file/spi/FileSystemProvider.java Mon Jul 17 09:13:49 2017 -0700 +++ b/jdk/src/java.base/share/classes/java/nio/file/spi/FileSystemProvider.java Thu Jul 20 09:38:13 2017 -0700 @@ -922,21 +922,21 @@ *
Options
Option Description
Option Description
{@link StandardCopyOption#REPLACE_EXISTING REPLACE_EXISTING} {@link StandardCopyOption#REPLACE_EXISTING REPLACE_EXISTING} If the target file exists, then the target file is replaced if it * is not a non-empty directory. If the target file exists and is a * symbolic link, then the symbolic link itself, not the target of * the link, is replaced.
{@link StandardCopyOption#ATOMIC_MOVE ATOMIC_MOVE} {@link StandardCopyOption#ATOMIC_MOVE ATOMIC_MOVE} The move is performed as an atomic file system operation and all * other options are ignored. If the target file exists then it is * implementation specific if the existing file is replaced or this method diff -r 3e7ed3a7da38 -r d2d3c06dde93 jdk/src/java.base/share/classes/java/nio/file/LinkPermission.java --- a/jdk/src/java.base/share/classes/java/nio/file/LinkPermission.java Mon Jul 17 09:13:49 2017 -0700 +++ b/jdk/src/java.base/share/classes/java/nio/file/LinkPermission.java Thu Jul 20 09:38:13 2017 -0700 @@ -37,14 +37,14 @@ *
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
hardhard Ability to add an existing file to a directory. This is sometimes * known as creating a link, or hard link. Extreme care should be taken when granting this permission. It allows @@ -52,7 +52,7 @@ * attacker access to all files.
symbolicsymbolic Ability to create symbolic links. Extreme care should be taken when granting this permission. It allows * linking to any file or directory in the file system thus allowing the diff -r 3e7ed3a7da38 -r d2d3c06dde93 jdk/src/java.base/share/classes/java/nio/file/attribute/AclFileAttributeView.java --- a/jdk/src/java.base/share/classes/java/nio/file/attribute/AclFileAttributeView.java Mon Jul 17 09:13:49 2017 -0700 +++ b/jdk/src/java.base/share/classes/java/nio/file/attribute/AclFileAttributeView.java Thu Jul 20 09:38:13 2017 -0700 @@ -98,17 +98,17 @@ *
Supported attributes
Name Type Name Type
"acl" "acl" {@link List}<{@link AclEntry}>
"owner" "owner" {@link UserPrincipal}
Supported attributes
Name Type Name Type
"lastModifiedTime" "lastModifiedTime" {@link FileTime}
"lastAccessTime" "lastAccessTime" {@link FileTime}
"creationTime" "creationTime" {@link FileTime}
"size" "size" {@link Long}
"isRegularFile" "isRegularFile" {@link Boolean}
"isDirectory" "isDirectory" {@link Boolean}
"isSymbolicLink" "isSymbolicLink" {@link Boolean}
"isOther" "isOther" {@link Boolean}
"fileKey" "fileKey" {@link Object}
Supported attributes
Name Type Name Type
readonly readonly {@link Boolean}
hidden hidden {@link Boolean}
system system {@link Boolean}
archive archive {@link Boolean}
Supported attributes
Name Type Name Type
"permissions" "permissions" {@link Set}<{@link PosixFilePermission}>
"group" "group" {@link GroupPrincipal}
* * - * + * * * * - * + * * * * - * + * * * * - * + * * * * - * - * - * + * + * + * * * * * * - * + * * * * * - * + * * * * * - * + * * * * * - * + * * * * * - * + * * * * * - * + * * * * * - * + * * * * * - * + * * * * * - * + * * * * * - * + * * * * * - * + * * * * * - * + * * * * * - * + * * * * * - * - * - * + * + * + * * * * * * - * + * * * * * - * + * * * * * - * + * * * * * - * + * * * * * - * + * * * * * - * + * * * * * - * + * * @@ -296,7 +296,7 @@ * * * - * + * * * * * - * + * * * * * - * * * - * - * - * - * - * - * - * - * - * - * - * * * - * * * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * * * - * * * - * - * - * - * - * - * - * - * - * - * - * *
Access Modes
Value Description
Value Description
{@link AccessMode#READ READ} {@link AccessMode#READ READ} Checks that the file exists and that the Java virtual machine has * permission to read the file.
{@link AccessMode#WRITE WRITE} {@link AccessMode#WRITE WRITE} Checks that the file exists and that the Java virtual machine has * permission to write to the file,
{@link AccessMode#EXECUTE EXECUTE} {@link AccessMode#EXECUTE EXECUTE} Checks that the file exists and that the Java virtual machine has * permission to {@link Runtime#exec execute} the file. The semantics * may differ when checking access to a directory. For example, on UNIX diff -r 3e7ed3a7da38 -r d2d3c06dde93 jdk/src/java.base/share/classes/java/security/SecurityPermission.java --- a/jdk/src/java.base/share/classes/java/security/SecurityPermission.java Mon Jul 17 09:13:49 2017 -0700 +++ b/jdk/src/java.base/share/classes/java/security/SecurityPermission.java Thu Jul 20 09:38:13 2017 -0700 @@ -49,15 +49,15 @@ *
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
authProvider.{provider name}authProvider.{provider name}Allow the named provider to be an AuthProvider for login and * logout operations. This allows the named provider to perform login and logout @@ -68,7 +68,7 @@ *
createAccessControlContextcreateAccessControlContextCreation of an AccessControlContextThis allows someone to instantiate an AccessControlContext * with a {@code DomainCombiner}. Extreme care must be taken when @@ -78,7 +78,7 @@ *
getDomainCombinergetDomainCombinerRetrieval of an AccessControlContext's DomainCombinerThis allows someone to retrieve an AccessControlContext's * {@code DomainCombiner}. Since DomainCombiners may contain @@ -86,7 +86,7 @@ *
getPolicygetPolicyRetrieval of the system-wide security policy (specifically, of the * currently-installed Policy object)This allows someone to query the policy via the @@ -99,7 +99,7 @@ *
setPolicysetPolicySetting of the system-wide security policy (specifically, * the Policy object)Granting this permission is extremely dangerous, as malicious @@ -108,7 +108,7 @@ *
createPolicy.{policy type}createPolicy.{policy type}Getting an instance of a Policy implementation from a providerGranting this permission enables code to obtain a Policy object. * Malicious code may query the Policy object to determine what permissions @@ -116,7 +116,7 @@ *
getProperty.{key}getProperty.{key}Retrieval of the security property with the specified keyDepending on the particular key for which access has * been granted, the code may have access to the list of security @@ -129,7 +129,7 @@ *
setProperty.{key}setProperty.{key}Setting of the security property with the specified keyThis could include setting a security provider or defining * the location of the system-wide security policy. Malicious @@ -144,7 +144,7 @@ *
insertProviderinsertProviderAddition of a new providerThis would allow somebody to introduce a possibly * malicious provider (e.g., one that discloses the private keys passed @@ -158,7 +158,7 @@ *
removeProvider.{provider name}removeProvider.{provider name}Removal of the specified providerThis may change the behavior or disable execution of other * parts of the program. If a provider subsequently requested by the @@ -171,7 +171,7 @@ *
clearProviderProperties.{provider name}clearProviderProperties.{provider name}"Clearing" of a Provider so that it no longer contains the properties * used to look up services implemented by the providerThis disables the lookup of services implemented by the provider. @@ -181,7 +181,7 @@ *
putProviderProperty.{provider name}putProviderProperty.{provider name}Setting of properties for the specified ProviderThe provider properties each specify the name and location * of a particular service implemented by the provider. By granting @@ -190,7 +190,7 @@ *
removeProviderProperty.{provider name}removeProviderProperty.{provider name}Removal of properties from the specified ProviderThis disables the lookup of services implemented by the * provider. They are no longer accessible due to removal of the properties @@ -213,15 +213,15 @@ *
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
insertProvider.{provider name}insertProvider.{provider name}Addition of a new provider, with the specified nameUse of this permission is discouraged from further use because it is * possible to circumvent the name restrictions by overriding the @@ -238,7 +238,7 @@ *
setSystemScopesetSystemScopeSetting of the system identity scopeThis would allow an attacker to configure the system identity scope with * certificates that should not be trusted, thereby granting applet or @@ -247,7 +247,7 @@ *
setIdentityPublicKeysetIdentityPublicKeySetting of the public key for an IdentityIf the identity is marked as "trusted", this allows an attacker to * introduce a different public key (e.g., its own) that is not trusted @@ -257,7 +257,7 @@ *
setIdentityInfosetIdentityInfoSetting of a general information string for an IdentityThis allows attackers to set the general description for * an identity. This may trick applications into using a different @@ -266,7 +266,7 @@ *
addIdentityCertificateaddIdentityCertificateAddition of a certificate for an IdentityThis allows attackers to set a certificate for * an identity's public key. This is dangerous because it affects @@ -275,7 +275,7 @@ *
removeIdentityCertificateremoveIdentityCertificateRemoval of a certificate for an IdentityThis allows attackers to remove a certificate for * an identity's public key. This is dangerous because it affects @@ -284,7 +284,7 @@ *
printIdentityprintIdentityViewing the name of a principal * and optionally the scope in which it is used, and whether * or not it is considered "trusted" in that scope
getSignerPrivateKeygetSignerPrivateKeyRetrieval of a Signer's private keyIt is very dangerous to allow access to a private key; private * keys are supposed to be kept secret. Otherwise, code can use the @@ -305,7 +305,7 @@ *
setSignerKeyPairsetSignerKeyPairSetting of the key pair (public key and private key) for a SignerThis would allow an attacker to replace somebody else's (the "target's") * keypair with a possibly weaker keypair (e.g., a keypair of a smaller diff -r 3e7ed3a7da38 -r d2d3c06dde93 jdk/src/java.base/share/classes/java/text/DecimalFormat.java --- a/jdk/src/java.base/share/classes/java/text/DecimalFormat.java Mon Jul 17 09:13:49 2017 -0700 +++ b/jdk/src/java.base/share/classes/java/text/DecimalFormat.java Thu Jul 20 09:38:13 2017 -0700 @@ -176,60 +176,60 @@ *
Chart showing symbol, location, localized, and meaning.
Symbol - * Location - * Localized? - * Meaning + * Symbol + * Location + * Localized? + * Meaning *
0 + * 0 * Number * Yes * Digit *
# + * # * Number * Yes * Digit, zero shows as absent *
. + * . * Number * Yes * Decimal separator or monetary decimal separator *
- + * - * Number * Yes * Minus sign *
, + * , * Number * Yes * Grouping separator *
E + * E * Number * Yes * Separates mantissa and exponent in scientific notation. * Need not be quoted in prefix or suffix. *
; + * ; * Subpattern boundary * Yes * Separates positive and negative subpatterns *
% + * % * Prefix or suffix * Yes * Multiply by 100 and show as percentage *
\u2030 + * \u2030 * Prefix or suffix * Yes * Multiply by 1000 and show as per mille value *
¤ (\u00A4) + * ¤ (\u00A4) * Prefix or suffix * No * Currency sign, replaced by currency symbol. If @@ -237,7 +237,7 @@ * If present in a pattern, the monetary decimal separator * is used instead of the decimal separator. *
' + * ' * Prefix or suffix * No * Used to quote special characters in a prefix or suffix, diff -r 3e7ed3a7da38 -r d2d3c06dde93 jdk/src/java.base/share/classes/java/text/SimpleDateFormat.java --- a/jdk/src/java.base/share/classes/java/text/SimpleDateFormat.java Mon Jul 17 09:13:49 2017 -0700 +++ b/jdk/src/java.base/share/classes/java/text/SimpleDateFormat.java Thu Jul 20 09:38:13 2017 -0700 @@ -96,124 +96,124 @@ *
Chart shows pattern letters, date/time component, presentation, and examples.
Letter - * Date or Time Component - * Presentation - * Examples + * Letter + * Date or Time Component + * Presentation + * Examples *
G + * G * Era designator * Text * AD *
y + * y * Year * Year * 1996; 96 *
Y + * Y * Week year * Year * 2009; 09 *
M + * M * Month in year (context sensitive) * Month * July; Jul; 07 *
L + * L * Month in year (standalone form) * Month * July; Jul; 07 *
w + * w * Week in year * Number * 27 *
W + * W * Week in month * Number * 2 *
D + * D * Day in year * Number * 189 *
d + * d * Day in month * Number * 10 *
F + * F * Day of week in month * Number * 2 *
E + * E * Day name in week * Text * Tuesday; Tue *
u + * u * Day number of week (1 = Monday, ..., 7 = Sunday) * Number * 1 *
a + * a * Am/pm marker * Text * PM *
H + * H * Hour in day (0-23) * Number * 0 *
k + * k * Hour in day (1-24) * Number * 24 *
K + * K * Hour in am/pm (0-11) * Number * 0 *
h + * h * Hour in am/pm (1-12) * Number * 12 *
m + * m * Minute in hour * Number * 30 *
s + * s * Second in minute * Number * 55 *
S + * S * Millisecond * Number * 978 *
z + * z * Time zone * General time zone * Pacific Standard Time; PST; GMT-08:00 *
Z + * Z * Time zone * RFC 822 time zone * -0800 *
X + * X * Time zone * ISO 8601 time zone * -08; -0800; -08:00 @@ -379,42 +379,42 @@ *
Examples of date and time patterns interpreted in the U.S. locale
Date and Time Pattern - * Result + * Date and Time Pattern + * Result *
"yyyy.MM.dd G 'at' HH:mm:ss z" + * "yyyy.MM.dd G 'at' HH:mm:ss z" * 2001.07.04 AD at 12:08:56 PDT *
"EEE, MMM d, ''yy" + * "EEE, MMM d, ''yy" * Wed, Jul 4, '01 *
"h:mm a" + * "h:mm a" * 12:08 PM *
"hh 'o''clock' a, zzzz" + * "hh 'o''clock' a, zzzz" * 12 o'clock PM, Pacific Daylight Time *
"K:mm a, z" + * "K:mm a, z" * 0:08 PM, PDT *
"yyyyy.MMMMM.dd GGG hh:mm aaa" + * "yyyyy.MMMMM.dd GGG hh:mm aaa" * 02001.July.04 AD 12:08 PM *
"EEE, d MMM yyyy HH:mm:ss Z" + * "EEE, d MMM yyyy HH:mm:ss Z" * Wed, 4 Jul 2001 12:08:56 -0700 *
"yyMMddHHmmssZ" + * "yyMMddHHmmssZ" * 010704120856-0700 *
"yyyy-MM-dd'T'HH:mm:ss.SSSZ" + * "yyyy-MM-dd'T'HH:mm:ss.SSSZ" * 2001-07-04T12:08:56.235-0700 *
"yyyy-MM-dd'T'HH:mm:ss.SSSXXX" + * "yyyy-MM-dd'T'HH:mm:ss.SSSXXX" * 2001-07-04T12:08:56.235-07:00 *
"YYYY-'W'ww-u" + * "YYYY-'W'ww-u" * 2001-W27-3 *
diff -r 3e7ed3a7da38 -r d2d3c06dde93 jdk/src/java.base/share/classes/java/time/OffsetDateTime.java --- a/jdk/src/java.base/share/classes/java/time/OffsetDateTime.java Mon Jul 17 09:13:49 2017 -0700 +++ b/jdk/src/java.base/share/classes/java/time/OffsetDateTime.java Thu Jul 20 09:38:13 2017 -0700 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 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 @@ -100,7 +100,7 @@ * {@code OffsetDateTime} is an immutable representation of a date-time with an offset. * This class stores all date and time fields, to a precision of nanoseconds, * as well as the offset from UTC/Greenwich. For example, the value - * "2nd October 2007 at 13:45.30.123456789 +02:00" can be stored in an {@code OffsetDateTime}. + * "2nd October 2007 at 13:45:30.123456789 +02:00" can be stored in an {@code OffsetDateTime}. *

* {@code OffsetDateTime}, {@link java.time.ZonedDateTime} and {@link java.time.Instant} all store an instant * on the time-line to nanosecond precision. diff -r 3e7ed3a7da38 -r d2d3c06dde93 jdk/src/java.base/share/classes/java/time/OffsetTime.java --- a/jdk/src/java.base/share/classes/java/time/OffsetTime.java Mon Jul 17 09:13:49 2017 -0700 +++ b/jdk/src/java.base/share/classes/java/time/OffsetTime.java Thu Jul 20 09:38:13 2017 -0700 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 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 @@ -100,7 +100,7 @@ * viewed as hour-minute-second-offset. * This class stores all time fields, to a precision of nanoseconds, * as well as a zone offset. - * For example, the value "13:45.30.123456789+02:00" can be stored + * For example, the value "13:45:30.123456789+02:00" can be stored * in an {@code OffsetTime}. * *

diff -r 3e7ed3a7da38 -r d2d3c06dde93 jdk/src/java.base/share/classes/java/time/format/DateTimeFormatter.java --- a/jdk/src/java.base/share/classes/java/time/format/DateTimeFormatter.java Mon Jul 17 09:13:49 2017 -0700 +++ b/jdk/src/java.base/share/classes/java/time/format/DateTimeFormatter.java Thu Jul 20 09:38:13 2017 -0700 @@ -154,103 +154,103 @@ *

Predefined Formatters
FormatterDescriptionExampleFormatterDescriptionExample
{@link #ofLocalizedDate ofLocalizedDate(dateStyle)} {@link #ofLocalizedDate ofLocalizedDate(dateStyle)} Formatter with date style from the locale '2011-12-03'
{@link #ofLocalizedTime ofLocalizedTime(timeStyle)} {@link #ofLocalizedTime ofLocalizedTime(timeStyle)} Formatter with time style from the locale '10:15:30'
{@link #ofLocalizedDateTime ofLocalizedDateTime(dateTimeStyle)} {@link #ofLocalizedDateTime ofLocalizedDateTime(dateTimeStyle)} Formatter with a style for date and time from the locale '3 Jun 2008 11:05:30'
{@link #ofLocalizedDateTime ofLocalizedDateTime(dateStyle,timeStyle)} - * {@link #ofLocalizedDateTime ofLocalizedDateTime(dateStyle,timeStyle)} + * Formatter with date and time styles from the locale '3 Jun 2008 11:05'
{@link #BASIC_ISO_DATE} {@link #BASIC_ISO_DATE}Basic ISO date '20111203'
{@link #ISO_LOCAL_DATE} {@link #ISO_LOCAL_DATE} ISO Local Date '2011-12-03'
{@link #ISO_OFFSET_DATE} {@link #ISO_OFFSET_DATE} ISO Date with offset '2011-12-03+01:00'
{@link #ISO_DATE} {@link #ISO_DATE} ISO Date with or without offset '2011-12-03+01:00'; '2011-12-03'
{@link #ISO_LOCAL_TIME} {@link #ISO_LOCAL_TIME} Time without offset '10:15:30'
{@link #ISO_OFFSET_TIME} {@link #ISO_OFFSET_TIME} Time with offset '10:15:30+01:00'
{@link #ISO_TIME} {@link #ISO_TIME} Time with or without offset '10:15:30+01:00'; '10:15:30'
{@link #ISO_LOCAL_DATE_TIME} {@link #ISO_LOCAL_DATE_TIME} ISO Local Date and Time '2011-12-03T10:15:30'
{@link #ISO_OFFSET_DATE_TIME} {@link #ISO_OFFSET_DATE_TIME} Date Time with Offset * 2011-12-03T10:15:30+01:00'
{@link #ISO_ZONED_DATE_TIME} {@link #ISO_ZONED_DATE_TIME} Zoned Date Time '2011-12-03T10:15:30+01:00[Europe/Paris]'
{@link #ISO_DATE_TIME} {@link #ISO_DATE_TIME} Date and time with ZoneId '2011-12-03T10:15:30+01:00[Europe/Paris]'
{@link #ISO_ORDINAL_DATE} {@link #ISO_ORDINAL_DATE} Year and day of year '2012-337'
{@link #ISO_WEEK_DATE} {@link #ISO_WEEK_DATE} Year and Week 2012-W48-6'
{@link #ISO_INSTANT} {@link #ISO_INSTANT} Date and Time of an Instant '2011-12-03T10:15:30Z'
{@link #RFC_1123_DATE_TIME} {@link #RFC_1123_DATE_TIME} RFC 1123 / RFC 822 'Tue, 3 Jun 2008 11:05:30 GMT'
* * - * * - *
genConv
Conversion - * Argument Category - * Description + *
Conversion + * Argument Category + * Description *
{@code 'b'}, {@code 'B'} + *
{@code 'b'}, {@code 'B'} * general * If the argument arg is {@code null}, then the result is * "{@code false}". If arg is a {@code boolean} or {@link @@ -306,64 +306,64 @@ * String#valueOf(boolean) String.valueOf(arg)}. Otherwise, the result is * "true". * - *
{@code 'h'}, {@code 'H'} + *
{@code 'h'}, {@code 'H'} * general * The result is obtained by invoking * {@code Integer.toHexString(arg.hashCode())}. * - *
{@code 's'}, {@code 'S'} + *
{@code 's'}, {@code 'S'} * general * If arg implements {@link Formattable}, then * {@link Formattable#formatTo arg.formatTo} is invoked. Otherwise, the * result is obtained by invoking {@code arg.toString()}. * - *
{@code 'c'}, {@code 'C'} + *
{@code 'c'}, {@code 'C'} * character * The result is a Unicode character * - *
{@code 'd'} + *
{@code 'd'} * integral * The result is formatted as a decimal integer * - *
{@code 'o'} + *
{@code 'o'} * integral * The result is formatted as an octal integer * - *
{@code 'x'}, {@code 'X'} + *
{@code 'x'}, {@code 'X'} * integral * The result is formatted as a hexadecimal integer * - *
{@code 'e'}, {@code 'E'} + *
{@code 'e'}, {@code 'E'} * floating point * The result is formatted as a decimal number in computerized * scientific notation * - *
{@code 'f'} + *
{@code 'f'} * floating point * The result is formatted as a decimal number * - *
{@code 'g'}, {@code 'G'} + *
{@code 'g'}, {@code 'G'} * floating point * The result is formatted using computerized scientific notation or * decimal format, depending on the precision and the value after rounding. * - *
{@code 'a'}, {@code 'A'} + *
{@code 'a'}, {@code 'A'} * floating point * The result is formatted as a hexadecimal floating-point number with * a significand and an exponent. This conversion is not supported * for the {@code BigDecimal} type despite the latter's being in the * floating point argument category. * - *
{@code 't'}, {@code 'T'} + *
{@code 't'}, {@code 'T'} * date/time * Prefix for date and time conversion characters. See Date/Time Conversions. * - *
{@code '%'} + *
{@code '%'} * percent * The result is a literal {@code '%'} ('\u0025') * - *
{@code 'n'} + *
{@code 'n'} * line separator * The result is the platform-specific line separator * @@ -387,44 +387,44 @@ * * * - * * * - * @@ -519,25 +519,25 @@ * * * - * * * - * - * - * + * + * + * * * * * - * * * * - * * * * - * * * * - * * * * * - * * * * * - * - * - * + * + * + * * * * * * - * + * * * * - * + * * * * * - * + * * * - - + + - + - + - + - + diff -r 3e7ed3a7da38 -r d2d3c06dde93 jdk/src/java.sql/share/classes/java/sql/Connection.java --- a/jdk/src/java.sql/share/classes/java/sql/Connection.java Mon Jul 17 09:13:49 2017 -0700 +++ b/jdk/src/java.sql/share/classes/java/sql/Connection.java Thu Jul 20 09:38:13 2017 -0700 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1996, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1996, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -1523,7 +1523,7 @@ * * @implSpec * The default implementation is a no-op. - *

+ * * @apiNote * This method is to be used by Connection pooling managers. *

diff -r 3e7ed3a7da38 -r d2d3c06dde93 jdk/src/java.sql/share/classes/java/sql/DriverManager.java --- a/jdk/src/java.sql/share/classes/java/sql/DriverManager.java Mon Jul 17 09:13:49 2017 -0700 +++ b/jdk/src/java.sql/share/classes/java/sql/DriverManager.java Thu Jul 20 09:38:13 2017 -0700 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1996, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1996, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -63,7 +63,6 @@ * via the {@linkplain ServiceLoader#load service-provider loading} mechanism. * * - *

* @implNote * {@code DriverManager} initialization is done lazily and looks up service * providers using the thread context class loader. The drivers loaded and diff -r 3e7ed3a7da38 -r d2d3c06dde93 jdk/src/java.sql/share/classes/java/sql/SQLPermission.java --- a/jdk/src/java.sql/share/classes/java/sql/SQLPermission.java Mon Jul 17 09:13:49 2017 -0700 +++ b/jdk/src/java.sql/share/classes/java/sql/SQLPermission.java Thu Jul 20 09:38:13 2017 -0700 @@ -62,29 +62,29 @@ *

* * - * - * - * + * + * + * * * * * * - * + * * * * * - * + * * * * * - * + * * * * * - * + * * * * - * + * * *
time
{@code 'H'} + *
{@code 'H'} * Hour of the day for the 24-hour clock, formatted as two digits with * a leading zero as necessary i.e. {@code 00 - 23}. * - *
{@code 'I'} + *
{@code 'I'} * Hour for the 12-hour clock, formatted as two digits with a leading * zero as necessary, i.e. {@code 01 - 12}. * - *
{@code 'k'} + *
{@code 'k'} * Hour of the day for the 24-hour clock, i.e. {@code 0 - 23}. * - *
{@code 'l'} + *
{@code 'l'} * Hour for the 12-hour clock, i.e. {@code 1 - 12}. * - *
{@code 'M'} + *
{@code 'M'} * Minute within the hour formatted as two digits with a leading zero * as necessary, i.e. {@code 00 - 59}. * - *
{@code 'S'} + *
{@code 'S'} * Seconds within the minute, formatted as two digits with a leading * zero as necessary, i.e. {@code 00 - 60} ("{@code 60}" is a special * value required to support leap seconds). * - *
{@code 'L'} + *
{@code 'L'} * Millisecond within the second formatted as three digits with * leading zeros as necessary, i.e. {@code 000 - 999}. * - *
{@code 'N'} + *
{@code 'N'} * Nanosecond within the second, formatted as nine digits with leading * zeros as necessary, i.e. {@code 000000000 - 999999999}. * - *
{@code 'p'} + *
{@code 'p'} * Locale-specific {@linkplain * java.text.DateFormatSymbols#getAmPmStrings morning or afternoon} marker * in lower case, e.g."{@code am}" or "{@code pm}". Use of the conversion * prefix {@code 'T'} forces this output to upper case. * - *
{@code 'z'} + *
{@code 'z'} * RFC 822 * style numeric time zone offset from GMT, e.g. {@code -0800}. This * value will be adjusted as necessary for Daylight Saving Time. For @@ -432,7 +432,7 @@ * the {@linkplain TimeZone#getDefault() default time zone} for this * instance of the Java virtual machine. * - *
{@code 'Z'} + *
{@code 'Z'} * A string representing the abbreviation for the time zone. This * value will be adjusted as necessary for Daylight Saving Time. For * {@code long}, {@link Long}, and {@link Date} the time zone used is @@ -440,12 +440,12 @@ * instance of the Java virtual machine. The Formatter's locale will * supersede the locale of the argument (if any). * - *
{@code 's'} + *
{@code 's'} * Seconds since the beginning of the epoch starting at 1 January 1970 * {@code 00:00:00} UTC, i.e. {@code Long.MIN_VALUE/1000} to * {@code Long.MAX_VALUE/1000}. * - *
{@code 'Q'} + *
{@code 'Q'} * Milliseconds since the beginning of the epoch starting at 1 January * 1970 {@code 00:00:00} UTC, i.e. {@code Long.MIN_VALUE} to * {@code Long.MAX_VALUE}. @@ -459,54 +459,54 @@ *
date
{@code 'B'} + *
{@code 'B'} * Locale-specific {@linkplain java.text.DateFormatSymbols#getMonths * full month name}, e.g. {@code "January"}, {@code "February"}. * - *
{@code 'b'} + *
{@code 'b'} * Locale-specific {@linkplain * java.text.DateFormatSymbols#getShortMonths abbreviated month name}, * e.g. {@code "Jan"}, {@code "Feb"}. * - *
{@code 'h'} + *
{@code 'h'} * Same as {@code 'b'}. * - *
{@code 'A'} + *
{@code 'A'} * Locale-specific full name of the {@linkplain * java.text.DateFormatSymbols#getWeekdays day of the week}, * e.g. {@code "Sunday"}, {@code "Monday"} * - *
{@code 'a'} + *
{@code 'a'} * Locale-specific short name of the {@linkplain * java.text.DateFormatSymbols#getShortWeekdays day of the week}, * e.g. {@code "Sun"}, {@code "Mon"} * - *
{@code 'C'} + *
{@code 'C'} * Four-digit year divided by {@code 100}, formatted as two digits * with leading zero as necessary, i.e. {@code 00 - 99} * - *
{@code 'Y'} + *
{@code 'Y'} * Year, formatted as at least four digits with leading zeros as * necessary, e.g. {@code 0092} equals {@code 92} CE for the Gregorian * calendar. * - *
{@code 'y'} + *
{@code 'y'} * Last two digits of the year, formatted with leading zeros as * necessary, i.e. {@code 00 - 99}. * - *
{@code 'j'} + *
{@code 'j'} * Day of year, formatted as three digits with leading zeros as * necessary, e.g. {@code 001 - 366} for the Gregorian calendar. * - *
{@code 'm'} + *
{@code 'm'} * Month, formatted as two digits with leading zeros as necessary, * i.e. {@code 01 - 13}. * - *
{@code 'd'} + *
{@code 'd'} * Day of month, formatted as two digits with leading zeros as * necessary, i.e. {@code 01 - 31} * - *
{@code 'e'} + *
{@code 'e'} * Day of month, formatted as two digits, i.e. {@code 1 - 31}. * *
composites
{@code 'R'} + *
{@code 'R'} * Time formatted for the 24-hour clock as {@code "%tH:%tM"} * - *
{@code 'T'} + *
{@code 'T'} * Time formatted for the 24-hour clock as {@code "%tH:%tM:%tS"}. * - *
{@code 'r'} + *
{@code 'r'} * Time formatted for the 12-hour clock as {@code "%tI:%tM:%tS %Tp"}. * The location of the morning or afternoon marker ({@code '%Tp'}) may be * locale-dependent. * - *
{@code 'D'} + *
{@code 'D'} * Date formatted as {@code "%tm/%td/%ty"}. * - *
{@code 'F'} + *
{@code 'F'} * ISO 8601 * complete date formatted as {@code "%tY-%tm-%td"}. * - *
{@code 'c'} + *
{@code 'c'} * Date and time formatted as {@code "%ta %tb %td %tT %tZ %tY"}, * e.g. {@code "Sun Jul 20 16:17:00 EDT 1969"}. * @@ -555,49 +555,49 @@ * * * - * * - * * * - * * * - * * * - * * * - * * * - * * * - * * * - * * * - * * * - * * * - * * * - * * * - * * * - * * * - * * * - * - * * * * * - * * * * - * * * * - * * * * - * * * * - * * * * - * * * * - * * * * - * * * * - * * diff -r 3e7ed3a7da38 -r d2d3c06dde93 jdk/src/java.base/share/classes/java/util/Locale.java --- a/jdk/src/java.base/share/classes/java/util/Locale.java Mon Jul 17 09:13:49 2017 -0700 +++ b/jdk/src/java.base/share/classes/java/util/Locale.java Thu Jul 20 09:38:13 2017 -0700 @@ -1590,29 +1590,29 @@ *
genConv
Flag General - * Character Integral - * Floating Point - * Date/Time - * Description + *
Flag General + * Character Integral + * Floating Point + * Date/Time + * Description *
'-' y + *
'-' y * y * y * y * y * The result will be left-justified. * - *
'#' y1 + *
'#' y1 * - * y3 * y * - * The result should use a conversion-dependent alternate form * - *
'+' - + *
'+' - * - * y4 * y * - * The result will always include a sign * - *
'  ' - + *
'  ' - * - * y4 * y * - * The result will include a leading space for positive values * - *
'0' - + *
'0' - * - * y * y * - * The result will be zero-padded * - *
',' - + *
',' - * - * y2 * y5 @@ -605,7 +605,7 @@ * The result will include locale-specific {@linkplain * java.text.DecimalFormatSymbols#getGroupingSeparator grouping separators} * - *
'(' - + *
'(' - * - * y4 * y5 @@ -723,7 +723,7 @@ *
dgConv
{@code 'b'} + *
{@code 'b'} * '\u0062' * Produces either "{@code true}" or "{@code false}" as returned by * {@link Boolean#toString(boolean)}. @@ -737,11 +737,11 @@ *

If the {@code '#'} flag is given, then a {@link * FormatFlagsConversionMismatchException} will be thrown. * - *

{@code 'B'} + *
{@code 'B'} * '\u0042' * The upper-case variant of {@code 'b'}. * - *
{@code 'h'} + *
{@code 'h'} * '\u0068' * Produces a string representing the hash code value of the object. * @@ -751,11 +751,11 @@ *

If the {@code '#'} flag is given, then a {@link * FormatFlagsConversionMismatchException} will be thrown. * - *

{@code 'H'} + *
{@code 'H'} * '\u0048' * The upper-case variant of {@code 'h'}. * - *
{@code 's'} + *
{@code 's'} * '\u0073' * Produces a string. * @@ -768,7 +768,7 @@ * Formattable} , then a {@link FormatFlagsConversionMismatchException} * will be thrown. * - *
{@code 'S'} + *
{@code 'S'} * '\u0053' * The upper-case variant of {@code 's'}. * @@ -781,7 +781,7 @@ *
dFlags
{@code '-'} + *
{@code '-'} * '\u002d' * Left justifies the output. Spaces ('\u0020') will be * added at the end of the converted value as required to fill the minimum @@ -789,7 +789,7 @@ * MissingFormatWidthException} will be thrown. If this flag is not given * then the output will be right-justified. * - *
{@code '#'} + *
{@code '#'} * '\u0023' * Requires the output use an alternate form. The definition of the * form is specified by the conversion. @@ -825,7 +825,7 @@ *
charConv
{@code 'c'} + *
{@code 'c'} * '\u0063' * Formats the argument as a Unicode character as described in Unicode Character @@ -835,7 +835,7 @@ *

If the {@code '#'} flag is given, then a {@link * FormatFlagsConversionMismatchException} will be thrown. * - *

{@code 'C'} + *
{@code 'C'} * '\u0043' * The upper-case variant of {@code 'c'}. * @@ -929,7 +929,7 @@ *
IntConv
{@code 'd'} + *
{@code 'd'} * '\u0064' * Formats the argument as a decimal integer. The localization algorithm is applied. @@ -940,7 +940,7 @@ *

If the {@code '#'} flag is given then a {@link * FormatFlagsConversionMismatchException} will be thrown. * - *

{@code 'o'} + *
{@code 'o'} * '\u006f' * Formats the argument as an integer in base eight. No localization * is applied. @@ -962,7 +962,7 @@ * are given then a {@link FormatFlagsConversionMismatchException} will be * thrown. * - *
{@code 'x'} + *
{@code 'x'} * '\u0078' * Formats the argument as an integer in base sixteen. No * localization is applied. @@ -985,7 +985,7 @@ * {@code ','} flags are given then a {@link * FormatFlagsConversionMismatchException} will be thrown. * - *
{@code 'X'} + *
{@code 'X'} * '\u0058' * The upper-case variant of {@code 'x'}. The entire string * representing the number will be converted to {@linkplain @@ -1012,7 +1012,7 @@ *
intFlags
{@code '+'} + *
{@code '+'} * '\u002b' * Requires the output to include a positive sign for all positive * numbers. If this flag is not given then only negative values will @@ -1021,7 +1021,7 @@ *

If both the {@code '+'} and '  ' flags are given * then an {@link IllegalFormatFlagsException} will be thrown. * - *

'  ' + *
'  ' * '\u0020' * Requires the output to include a single extra space * ('\u0020') for non-negative values. @@ -1029,7 +1029,7 @@ *

If both the {@code '+'} and '  ' flags are given * then an {@link IllegalFormatFlagsException} will be thrown. * - *

{@code '0'} + *
{@code '0'} * '\u0030' * Requires the output to be padded with leading {@linkplain * java.text.DecimalFormatSymbols#getZeroDigit zeros} to the minimum field @@ -1040,14 +1040,14 @@ *

If both the {@code '-'} and {@code '0'} flags are given then an * {@link IllegalFormatFlagsException} will be thrown. * - *

{@code ','} + *
{@code ','} * '\u002c' * Requires the output to include the locale-specific {@linkplain * java.text.DecimalFormatSymbols#getGroupingSeparator group separators} as * described in the "group" section of the * localization algorithm. * - *
{@code '('} + *
{@code '('} * '\u0028' * Requires the output to prepend a {@code '('} * ('\u0028') and append a {@code ')'} @@ -1093,7 +1093,7 @@ *
bIntConv
{@code 'd'} + *
{@code 'd'} * '\u0064' * Requires the output to be formatted as a decimal integer. The localization algorithm is applied. @@ -1101,7 +1101,7 @@ *

If the {@code '#'} flag is given {@link * FormatFlagsConversionMismatchException} will be thrown. * - *

{@code 'o'} + *
{@code 'o'} * '\u006f' * Requires the output to be formatted as an integer in base eight. * No localization is applied. @@ -1124,7 +1124,7 @@ *

If the {@code ','} flag is given then a {@link * FormatFlagsConversionMismatchException} will be thrown. * - *

{@code 'x'} + *
{@code 'x'} * '\u0078' * Requires the output to be formatted as an integer in base * sixteen. No localization is applied. @@ -1148,7 +1148,7 @@ *

If the {@code ','} flag is given then a {@link * FormatFlagsConversionMismatchException} will be thrown. * - *

{@code 'X'} + *
{@code 'X'} * '\u0058' * The upper-case variant of {@code 'x'}. The entire string * representing the number will be converted to {@linkplain @@ -1190,7 +1190,7 @@ *
floatConv
{@code 'e'} + *
{@code 'e'} * '\u0065' * Requires the output to be formatted using computerized scientific notation. The If the {@code ','} flag is given, then an {@link * FormatFlagsConversionMismatchException} will be thrown. * - *
{@code 'E'} + *
{@code 'E'} * '\u0045' * The upper-case variant of {@code 'e'}. The exponent symbol * will be {@code 'E'} ('\u0045'). * - *
{@code 'g'} + *
{@code 'g'} * '\u0067' * Requires the output to be formatted in general scientific notation * as described below. The localization @@ -1268,11 +1268,11 @@ *

If the {@code '#'} flag is given then an {@link * FormatFlagsConversionMismatchException} will be thrown. * - *

{@code 'G'} + *
{@code 'G'} * '\u0047' * The upper-case variant of {@code 'g'}. * - *
{@code 'f'} + *
{@code 'f'} * '\u0066' * Requires the output to be formatted using decimal * format. The localization algorithm is @@ -1304,7 +1304,7 @@ * Float#toString(float)} or {@link Double#toString(double)} as * appropriate. * - *
{@code 'a'} + *
{@code 'a'} * '\u0061' * Requires the output to be formatted in hexadecimal exponential * form. No localization is applied. @@ -1357,7 +1357,7 @@ *

If the {@code '('} or {@code ','} flags are given, then a {@link * FormatFlagsConversionMismatchException} will be thrown. * - *

{@code 'A'} + *
{@code 'A'} * '\u0041' * The upper-case variant of {@code 'a'}. The entire string * representing the number will be converted to upper case including the @@ -1427,7 +1427,7 @@ *
floatConv
{@code 'e'} + *
{@code 'e'} * '\u0065' * Requires the output to be formatted using computerized scientific notation. The If the {@code ','} flag is given, then an {@link * FormatFlagsConversionMismatchException} will be thrown. * - *
{@code 'E'} + *
{@code 'E'} * '\u0045' * The upper-case variant of {@code 'e'}. The exponent symbol * will be {@code 'E'} ('\u0045'). * - *
{@code 'g'} + *
{@code 'g'} * '\u0067' * Requires the output to be formatted in general scientific notation * as described below. The localization @@ -1499,11 +1499,11 @@ *

If the {@code '#'} flag is given then an {@link * FormatFlagsConversionMismatchException} will be thrown. * - *

{@code 'G'} + *
{@code 'G'} * '\u0047' * The upper-case variant of {@code 'g'}. * - *
{@code 'f'} + *
{@code 'f'} * '\u0066' * Requires the output to be formatted using decimal * format. The localization algorithm is @@ -1554,10 +1554,10 @@ *
DTConv
{@code 't'} + *
{@code 't'} * '\u0074' * Prefix for date and time conversion characters. - *
{@code 'T'} + *
{@code 'T'} * '\u0054' * The upper-case variant of {@code 't'}. * @@ -1577,52 +1577,52 @@ *
time
{@code 'H'} + *
{@code 'H'} * '\u0048' * Hour of the day for the 24-hour clock, formatted as two digits with * a leading zero as necessary i.e. {@code 00 - 23}. {@code 00} * corresponds to midnight. * - *
{@code 'I'} + *
{@code 'I'} * '\u0049' * Hour for the 12-hour clock, formatted as two digits with a leading * zero as necessary, i.e. {@code 01 - 12}. {@code 01} corresponds to * one o'clock (either morning or afternoon). * - *
{@code 'k'} + *
{@code 'k'} * '\u006b' * Hour of the day for the 24-hour clock, i.e. {@code 0 - 23}. * {@code 0} corresponds to midnight. * - *
{@code 'l'} + *
{@code 'l'} * '\u006c' * Hour for the 12-hour clock, i.e. {@code 1 - 12}. {@code 1} * corresponds to one o'clock (either morning or afternoon). * - *
{@code 'M'} + *
{@code 'M'} * '\u004d' * Minute within the hour formatted as two digits with a leading zero * as necessary, i.e. {@code 00 - 59}. * - *
{@code 'S'} + *
{@code 'S'} * '\u0053' * Seconds within the minute, formatted as two digits with a leading * zero as necessary, i.e. {@code 00 - 60} ("{@code 60}" is a special * value required to support leap seconds). * - *
{@code 'L'} + *
{@code 'L'} * '\u004c' * Millisecond within the second formatted as three digits with * leading zeros as necessary, i.e. {@code 000 - 999}. * - *
{@code 'N'} + *
{@code 'N'} * '\u004e' * Nanosecond within the second, formatted as nine digits with leading * zeros as necessary, i.e. {@code 000000000 - 999999999}. The precision * of this value is limited by the resolution of the underlying operating * system or hardware. * - *
{@code 'p'} + *
{@code 'p'} * '\u0070' * Locale-specific {@linkplain * java.text.DateFormatSymbols#getAmPmStrings morning or afternoon} marker @@ -1632,7 +1632,7 @@ * GNU {@code date} and POSIX {@code strftime(3c)} which produce * upper-case output.) * - *
{@code 'z'} + *
{@code 'z'} * '\u007a' * RFC 822 * style numeric time zone offset from GMT, e.g. {@code -0800}. This @@ -1641,7 +1641,7 @@ * the {@linkplain TimeZone#getDefault() default time zone} for this * instance of the Java virtual machine. * - *
{@code 'Z'} + *
{@code 'Z'} * '\u005a' * A string representing the abbreviation for the time zone. This * value will be adjusted as necessary for Daylight Saving Time. For @@ -1650,13 +1650,13 @@ * instance of the Java virtual machine. The Formatter's locale will * supersede the locale of the argument (if any). * - *
{@code 's'} + *
{@code 's'} * '\u0073' * Seconds since the beginning of the epoch starting at 1 January 1970 * {@code 00:00:00} UTC, i.e. {@code Long.MIN_VALUE/1000} to * {@code Long.MAX_VALUE/1000}. * - *
{@code 'Q'} + *
{@code 'Q'} * '\u004f' * Milliseconds since the beginning of the epoch starting at 1 January * 1970 {@code 00:00:00} UTC, i.e. {@code Long.MIN_VALUE} to @@ -1672,68 +1672,68 @@ *
date
{@code 'B'} + *
{@code 'B'} * '\u0042' * Locale-specific {@linkplain java.text.DateFormatSymbols#getMonths * full month name}, e.g. {@code "January"}, {@code "February"}. * - *
{@code 'b'} + *
{@code 'b'} * '\u0062' * Locale-specific {@linkplain * java.text.DateFormatSymbols#getShortMonths abbreviated month name}, * e.g. {@code "Jan"}, {@code "Feb"}. * - *
{@code 'h'} + *
{@code 'h'} * '\u0068' * Same as {@code 'b'}. * - *
{@code 'A'} + *
{@code 'A'} * '\u0041' * Locale-specific full name of the {@linkplain * java.text.DateFormatSymbols#getWeekdays day of the week}, * e.g. {@code "Sunday"}, {@code "Monday"} * - *
{@code 'a'} + *
{@code 'a'} * '\u0061' * Locale-specific short name of the {@linkplain * java.text.DateFormatSymbols#getShortWeekdays day of the week}, * e.g. {@code "Sun"}, {@code "Mon"} * - *
{@code 'C'} + *
{@code 'C'} * '\u0043' * Four-digit year divided by {@code 100}, formatted as two digits * with leading zero as necessary, i.e. {@code 00 - 99} * - *
{@code 'Y'} + *
{@code 'Y'} * '\u0059' Year, formatted to at least * four digits with leading zeros as necessary, e.g. {@code 0092} equals * {@code 92} CE for the Gregorian calendar. * - *
{@code 'y'} + *
{@code 'y'} * '\u0079' * Last two digits of the year, formatted with leading zeros as * necessary, i.e. {@code 00 - 99}. * - *
{@code 'j'} + *
{@code 'j'} * '\u006a' * Day of year, formatted as three digits with leading zeros as * necessary, e.g. {@code 001 - 366} for the Gregorian calendar. * {@code 001} corresponds to the first day of the year. * - *
{@code 'm'} + *
{@code 'm'} * '\u006d' * Month, formatted as two digits with leading zeros as necessary, * i.e. {@code 01 - 13}, where "{@code 01}" is the first month of the * year and ("{@code 13}" is a special value required to support lunar * calendars). * - *
{@code 'd'} + *
{@code 'd'} * '\u0064' * Day of month, formatted as two digits with leading zeros as * necessary, i.e. {@code 01 - 31}, where "{@code 01}" is the first day * of the month. * - *
{@code 'e'} + *
{@code 'e'} * '\u0065' * Day of month, formatted as two digits, i.e. {@code 1 - 31} where * "{@code 1}" is the first day of the month. @@ -1748,30 +1748,30 @@ *
composites
{@code 'R'} + *
{@code 'R'} * '\u0052' * Time formatted for the 24-hour clock as {@code "%tH:%tM"} * - *
{@code 'T'} + *
{@code 'T'} * '\u0054' * Time formatted for the 24-hour clock as {@code "%tH:%tM:%tS"}. * - *
{@code 'r'} + *
{@code 'r'} * '\u0072' * Time formatted for the 12-hour clock as {@code "%tI:%tM:%tS * %Tp"}. The location of the morning or afternoon marker * ({@code '%Tp'}) may be locale-dependent. * - *
{@code 'D'} + *
{@code 'D'} * '\u0044' * Date formatted as {@code "%tm/%td/%ty"}. * - *
{@code 'F'} + *
{@code 'F'} * '\u0046' * ISO 8601 * complete date formatted as {@code "%tY-%tm-%td"}. * - *
{@code 'c'} + *
{@code 'c'} * '\u0063' * Date and time formatted as {@code "%ta %tb %td %tT %tZ %tY"}, * e.g. {@code "Sun Jul 20 16:17:00 EDT 1969"}. @@ -1802,7 +1802,7 @@ *
DTConv
{@code '%'} + *
{@code '%'} * The result is a literal {@code '%'} ('\u0025') * *

The width is the minimum number of characters to @@ -1830,7 +1830,7 @@ *

DTConv
{@code 'n'} + *
{@code 'n'} * the platform-specific line separator as returned by {@link * System#lineSeparator()}. * diff -r 3e7ed3a7da38 -r d2d3c06dde93 jdk/src/java.base/share/classes/java/util/GregorianCalendar.java --- a/jdk/src/java.base/share/classes/java/util/GregorianCalendar.java Mon Jul 17 09:13:49 2017 -0700 +++ b/jdk/src/java.base/share/classes/java/util/GregorianCalendar.java Thu Jul 20 09:38:13 2017 -0700 @@ -163,83 +163,83 @@ *
GregorianCalendar default field values
+ * * Field * + * Default Value *
+ * * ERA - * + * * AD *
+ * * YEAR - * + * * 1970 *
+ * * MONTH - * + * * JANUARY *
+ * * DAY_OF_MONTH - * + * * 1 *
+ * * DAY_OF_WEEK - * + * * the first day of week *
+ * * WEEK_OF_MONTH - * + * * 0 *
+ * * DAY_OF_WEEK_IN_MONTH - * + * * 1 *
+ * * AM_PM - * + * * AM *
+ * * HOUR, HOUR_OF_DAY, MINUTE, SECOND, MILLISECOND - * + * * 0 *
* * - * + * * * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * * *
Grandfathered tags with canonical replacements
grandfathered tagmodern replacement
grandfathered tagmodern replacement
art-lojbanjbo
i-amiami
i-bnnbnn
i-hakhak
i-klingontlh
i-luxlb
i-navajonv
i-pwnpwn
i-taotao
i-taytay
i-tsutsu
no-boknb
no-nynnn
sgn-BE-FRsfb
sgn-BE-NLvgt
sgn-CH-DEsgg
zh-guoyucmn
zh-hakkahak
zh-min-nannan
zh-xianghsn
art-lojbanjbo
i-amiami
i-bnnbnn
i-hakhak
i-klingontlh
i-luxlb
i-navajonv
i-pwnpwn
i-taotao
i-taytay
i-tsutsu
no-boknb
no-nynnn
sgn-BE-FRsfb
sgn-BE-NLvgt
sgn-CH-DEsgg
zh-guoyucmn
zh-hakkahak
zh-min-nannan
zh-xianghsn
* @@ -1622,15 +1622,15 @@ * * * - * + * * * - * - * - * - * - * - * + * + * + * + * + * + * * *
Grandfathered tags with no modern replacement
grandfathered tagconverts to
grandfathered tagconverts to
cel-gaulishxtg-x-cel-gaulish
en-GB-oeden-GB-x-oed
i-defaulten-x-i-default
i-enochianund-x-i-enochian
i-mingosee-x-i-mingo
zh-minnan-x-zh-min
cel-gaulishxtg-x-cel-gaulish
en-GB-oeden-GB-x-oed
i-defaulten-x-i-default
i-enochianund-x-i-enochian
i-mingosee-x-i-mingo
zh-minnan-x-zh-min
* @@ -2778,16 +2778,16 @@ *
Filtering method behavior
Filtering ModeLanguage Priority List: {@code "de-DE"}Language Priority List: {@code "de-*-DE"}Filtering ModeLanguage Priority List: {@code "de-DE"}Language Priority List: {@code "de-*-DE"}
+ * * {@link FilteringMode#AUTOSELECT_FILTERING AUTOSELECT_FILTERING} - * + * * Performs basic filtering and returns {@code "de-DE"} and * {@code "de-DE-1996"}. @@ -2799,9 +2799,9 @@ *
+ * * {@link FilteringMode#EXTENDED_FILTERING EXTENDED_FILTERING} - * + * * Performs extended filtering and returns {@code "de-DE"}, * {@code "de-Deva-DE"}, {@code "de-DE-1996"}, {@code "de-Latn-DE"}, and @@ -2810,9 +2810,9 @@ * Same as above.
+ * * {@link FilteringMode#IGNORE_EXTENDED_RANGES IGNORE_EXTENDED_RANGES} - * + * * Performs basic filtering and returns {@code "de-DE"} and * {@code "de-DE-1996"}. @@ -2823,9 +2823,9 @@ *
+ * * {@link FilteringMode#MAP_EXTENDED_RANGES MAP_EXTENDED_RANGES} - * + * Same as above. * Performs basic filtering and returns {@code "de-DE"} and @@ -2834,9 +2834,9 @@ *
+ * * {@link FilteringMode#REJECT_EXTENDED_RANGES REJECT_EXTENDED_RANGES} - * + * Same as above. * Throws {@link IllegalArgumentException} because {@code "de-*-DE"} is diff -r 3e7ed3a7da38 -r d2d3c06dde93 jdk/src/java.base/share/classes/java/util/regex/Pattern.java --- a/jdk/src/java.base/share/classes/java/util/regex/Pattern.java Mon Jul 17 09:13:49 2017 -0700 +++ b/jdk/src/java.base/share/classes/java/util/regex/Pattern.java Thu Jul 20 09:38:13 2017 -0700 @@ -3887,9 +3887,13 @@ return next.match(matcher, i + 1, seq); if (ch == 0x0D) { i++; - if (i < matcher.to && seq.charAt(i) == 0x0A && - next.match(matcher, i + 1, seq)) { - return true; + if (i < matcher.to) { + if (seq.charAt(i) == 0x0A && + next.match(matcher, i + 1, seq)) { + return true; + } + } else { + matcher.hitEnd = true; } return next.match(matcher, i, seq); } diff -r 3e7ed3a7da38 -r d2d3c06dde93 jdk/src/java.base/share/classes/javax/net/ssl/SSLPermission.java --- a/jdk/src/java.base/share/classes/javax/net/ssl/SSLPermission.java Mon Jul 17 09:13:49 2017 -0700 +++ b/jdk/src/java.base/share/classes/javax/net/ssl/SSLPermission.java Thu Jul 20 09:38:13 2017 -0700 @@ -48,15 +48,15 @@ *
permission name, what it allows, and associated risks
Permission Target NameWhat the Permission AllowsRisks of Allowing this PermissionPermission Target NameWhat the Permission AllowsRisks of Allowing this Permission
setHostnameVerifiersetHostnameVerifierThe ability to set a callback which can decide whether to * allow a mismatch between the host being connected to by * an HttpsURLConnection and the common name field in @@ -70,7 +70,7 @@ *
getSSLSessionContextgetSSLSessionContextThe ability to get the SSLSessionContext of an SSLSession. * Malicious code may monitor sessions which have been established @@ -79,7 +79,7 @@ *
setDefaultSSLContextsetDefaultSSLContextThe ability to set the default SSL context * Malicious code can set a context that monitors the opening of diff -r 3e7ed3a7da38 -r d2d3c06dde93 jdk/src/java.base/share/classes/sun/nio/cs/ISO_8859_1.java --- a/jdk/src/java.base/share/classes/sun/nio/cs/ISO_8859_1.java Mon Jul 17 09:13:49 2017 -0700 +++ b/jdk/src/java.base/share/classes/sun/nio/cs/ISO_8859_1.java Thu Jul 20 09:38:13 2017 -0700 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -42,7 +42,7 @@ { public ISO_8859_1() { - super("ISO-8859-1", StandardCharsets.aliases_ISO_8859_1); + super(StandardCharsets.ISO_8859_1, StandardCharsets.aliases_ISO_8859_1); } public String historicalName() { diff -r 3e7ed3a7da38 -r d2d3c06dde93 jdk/src/java.base/share/classes/sun/nio/cs/StandardCharsets.java.template --- a/jdk/src/java.base/share/classes/sun/nio/cs/StandardCharsets.java.template Mon Jul 17 09:13:49 2017 -0700 +++ b/jdk/src/java.base/share/classes/sun/nio/cs/StandardCharsets.java.template Thu Jul 20 09:38:13 2017 -0700 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved. * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * @@ -51,6 +51,12 @@ private static final String packagePrefix = "sun.nio.cs"; + public static final String US_ASCII = "US-ASCII"; + + public static final String ISO_8859_1 = "ISO-8859-1"; + + public static final String UTF_8 = "UTF-8"; + public StandardCharsets() { this.aliasMap = new Aliases(); this.classMap = new Classes(); @@ -103,13 +109,13 @@ // As all charset class names added to classMap are string literals we // can check identity here as an optimization - if (cln == "US_ASCII") { + if (cln == US_ASCII) { return cache(csn, new US_ASCII()); } - if (cln == "ISO_8859_1") { + if (cln == ISO_8859_1) { return cache(csn, new ISO_8859_1()); } - if (cln == "UTF_8") { + if (cln == UTF_8) { return cache(csn, new UTF_8()); } diff -r 3e7ed3a7da38 -r d2d3c06dde93 jdk/src/java.base/share/classes/sun/nio/cs/US_ASCII.java --- a/jdk/src/java.base/share/classes/sun/nio/cs/US_ASCII.java Mon Jul 17 09:13:49 2017 -0700 +++ b/jdk/src/java.base/share/classes/sun/nio/cs/US_ASCII.java Thu Jul 20 09:38:13 2017 -0700 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2004, 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 @@ -38,7 +38,7 @@ { public US_ASCII() { - super("US-ASCII", StandardCharsets.aliases_US_ASCII); + super(StandardCharsets.US_ASCII, StandardCharsets.aliases_US_ASCII); } public String historicalName() { diff -r 3e7ed3a7da38 -r d2d3c06dde93 jdk/src/java.base/share/classes/sun/nio/cs/UTF_8.java --- a/jdk/src/java.base/share/classes/sun/nio/cs/UTF_8.java Mon Jul 17 09:13:49 2017 -0700 +++ b/jdk/src/java.base/share/classes/sun/nio/cs/UTF_8.java Thu Jul 20 09:38:13 2017 -0700 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -57,7 +57,7 @@ class UTF_8 extends Unicode { public UTF_8() { - super("UTF-8", StandardCharsets.aliases_UTF_8); + super(StandardCharsets.UTF_8, StandardCharsets.aliases_UTF_8); } public String historicalName() { diff -r 3e7ed3a7da38 -r d2d3c06dde93 jdk/src/java.base/share/classes/sun/security/provider/certpath/AlgorithmChecker.java --- a/jdk/src/java.base/share/classes/sun/security/provider/certpath/AlgorithmChecker.java Mon Jul 17 09:13:49 2017 -0700 +++ b/jdk/src/java.base/share/classes/sun/security/provider/certpath/AlgorithmChecker.java Thu Jul 20 09:38:13 2017 -0700 @@ -270,7 +270,7 @@ AlgorithmParameters currSigAlgParams = algorithmId.getParameters(); PublicKey currPubKey = cert.getPublicKey(); - String currSigAlg = ((X509Certificate)cert).getSigAlgName(); + String currSigAlg = x509Cert.getSigAlgName(); // Check the signature algorithm and parameters against constraints. if (!constraints.permits(SIGNATURE_PRIMITIVE_SET, currSigAlg, diff -r 3e7ed3a7da38 -r d2d3c06dde93 jdk/src/java.base/share/classes/sun/security/util/ECUtil.java --- a/jdk/src/java.base/share/classes/sun/security/util/ECUtil.java Mon Jul 17 09:13:49 2017 -0700 +++ b/jdk/src/java.base/share/classes/sun/security/util/ECUtil.java Thu Jul 20 09:38:13 2017 -0700 @@ -130,7 +130,7 @@ return (ECPrivateKey)keyFactory.generatePrivate(keySpec); } - private static AlgorithmParameters getECParameters(Provider p) { + public static AlgorithmParameters getECParameters(Provider p) { try { if (p != null) { return AlgorithmParameters.getInstance("EC", p); diff -r 3e7ed3a7da38 -r d2d3c06dde93 jdk/src/java.base/windows/native/libnio/ch/FileChannelImpl.c --- a/jdk/src/java.base/windows/native/libnio/ch/FileChannelImpl.c Mon Jul 17 09:13:49 2017 -0700 +++ b/jdk/src/java.base/windows/native/libnio/ch/FileChannelImpl.c Thu Jul 20 09:38:13 2017 -0700 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2009, 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 @@ -170,8 +170,8 @@ { HANDLE h = (HANDLE)(handleval(env, fdo)); if (h != INVALID_HANDLE_VALUE) { - jint result = CloseHandle(h); - if (result < 0) { + BOOL result = CloseHandle(h); + if (result == 0) { JNU_ThrowIOExceptionWithLastError(env, "Close failed"); } } diff -r 3e7ed3a7da38 -r d2d3c06dde93 jdk/src/java.base/windows/native/libnio/ch/FileDispatcherImpl.c --- a/jdk/src/java.base/windows/native/libnio/ch/FileDispatcherImpl.c Mon Jul 17 09:13:49 2017 -0700 +++ b/jdk/src/java.base/windows/native/libnio/ch/FileDispatcherImpl.c Thu Jul 20 09:38:13 2017 -0700 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2010, 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 @@ -334,7 +334,7 @@ FileEndOfFileInfo, &eofInfo, sizeof(eofInfo)); - if (result == FALSE) { + if (result == 0) { JNU_ThrowIOExceptionWithLastError(env, "Truncation failed"); return IOS_THROWN; } @@ -411,7 +411,7 @@ long highPos = (long)(pos >> 32); DWORD lowNumBytes = (DWORD)size; DWORD highNumBytes = (DWORD)(size >> 32); - jint result = 0; + BOOL result = 0; OVERLAPPED o; o.hEvent = 0; o.Offset = lowPos; @@ -422,7 +422,7 @@ if (error == ERROR_IO_PENDING) { DWORD dwBytes; result = GetOverlappedResult(h, &o, &dwBytes, TRUE); - if (result == 0) { + if (result != 0) { return; } error = GetLastError(); @@ -437,7 +437,7 @@ HANDLE h = (HANDLE)fd; if (h != INVALID_HANDLE_VALUE) { int result = CloseHandle(h); - if (result < 0) + if (result == 0) JNU_ThrowIOExceptionWithLastError(env, "Close failed"); } } diff -r 3e7ed3a7da38 -r d2d3c06dde93 jdk/src/java.base/windows/native/libnio/ch/WindowsAsynchronousFileChannelImpl.c --- a/jdk/src/java.base/windows/native/libnio/ch/WindowsAsynchronousFileChannelImpl.c Mon Jul 17 09:13:49 2017 -0700 +++ b/jdk/src/java.base/windows/native/libnio/ch/WindowsAsynchronousFileChannelImpl.c Thu Jul 20 09:38:13 2017 -0700 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, 2010, 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 @@ -126,5 +126,8 @@ jlong handle) { HANDLE h = (HANDLE)jlong_to_ptr(handle); - CloseHandle(h); + BOOL result = CloseHandle(h); + if (result == 0) { + JNU_ThrowIOExceptionWithLastError(env, "Close failed"); + } } diff -r 3e7ed3a7da38 -r d2d3c06dde93 jdk/src/java.sql.rowset/share/classes/javax/sql/rowset/package.html --- a/jdk/src/java.sql.rowset/share/classes/javax/sql/rowset/package.html Mon Jul 17 09:13:49 2017 -0700 +++ b/jdk/src/java.sql.rowset/share/classes/javax/sql/rowset/package.html Thu Jul 20 09:38:13 2017 -0700 @@ -177,13 +177,13 @@
Features in BaseRowSet
FeatureDetailsFeatureDetails
PropertiesProperties Provides standard JavaBeans property manipulation mechanisms to allow applications to get and set RowSet command and property values. Refer to the documentation of the javax.sql.RowSet @@ -191,7 +191,7 @@ the standard RowSet properties.
Event notificationEvent notification Provides standard JavaBeans event notifications to registered event listeners. Refer to the documentation of javax.sql.RowSetEvent interface (available in the JDBC 3.0 specification) for @@ -199,12 +199,12 @@ by compliant implementations.
Setters for a RowSet object's commandSetters for a RowSet object's command Provides a complete set of setter methods for setting RowSet command parameters.
StreamsStreams Provides fields for storing of stream instances in addition to providing a set of constants for stream type designation.
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
setLogsetLogSetting of the logging streamThis is a dangerous permission to grant. * The contents of the log may contain usernames and passwords, * SQL statements, and SQL data.
callAbortcallAbortAllows the invocation of the {@code Connection} method * {@code abort}Permits an application to terminate a physical connection to a * database.
setSyncFactorysetSyncFactoryAllows the invocation of the {@code SyncFactory} methods * {@code setJNDIContext} and {@code setLogger}Permits an application to specify the JNDI context from which the @@ -93,7 +93,7 @@ *
setNetworkTimeoutsetNetworkTimeoutAllows the invocation of the {@code Connection} method * {@code setNetworkTimeout}Permits an application to specify the maximum period a @@ -101,7 +101,7 @@ * objects created from the Connection * will wait for the database to reply to any one request.
deregisterDriverderegisterDriverAllows the invocation of the {@code DriverManager} * method {@code deregisterDriver}Permits an application to remove a JDBC driver from the list of diff -r 3e7ed3a7da38 -r d2d3c06dde93 jdk/src/java.sql/share/classes/java/sql/Statement.java --- a/jdk/src/java.sql/share/classes/java/sql/Statement.java Mon Jul 17 09:13:49 2017 -0700 +++ b/jdk/src/java.sql/share/classes/java/sql/Statement.java Thu Jul 20 09:38:13 2017 -0700 @@ -1379,17 +1379,17 @@ * single quote within the string will be replaced by two single quotes. * *
- * + *
* * - * + * * * - * - * - * + * + * + * * - * + * * * * @@ -1454,48 +1454,48 @@ * * * - * - * - * + * + * + * * * * - * + * * * * * - * + * * * * * - * + * * * * * - * + * * * * * - * + * * * * * - * + * * * * * - * + * * * * * - * + * * * * @@ -1554,33 +1554,33 @@ * * * - * - * + * + * * * * * - * + * * * * - * + * * * * - * + * * * * - * + * * * * - * + * * * * - * + * * * * @@ -1613,17 +1613,17 @@ * * * - * - * + * + * * * * - * - * - * + * + * + * * - * - * + * + * * * *
Examples of the conversion:
ValueResult
ValueResult
Hello 'Hello'
G'Day 'G''Day'
'G''Day'
Hello 'Hello'
G'Day 'G''Day'
'G''Day''''G''''Day'''
I'''M 'I''''''M'
I'''M 'I''''''M'
Examples of the conversion:
identifieralwaysQuoteResult
identifieralwaysQuoteResult
HelloHellofalseHello
HelloHellotrue"Hello"
G'DayG'Dayfalse"G'Day"
"Bruce Wayne""Bruce Wayne"false"Bruce Wayne"
"Bruce Wayne""Bruce Wayne"true"Bruce Wayne"
GoodDay$GoodDay$false"GoodDay$"
Hello"WorldHello"WorldfalseSQLException
"Hello"World""Hello"World"falseSQLException
Examples of the conversion:
identifierSimple IdentifieridentifierSimple Identifier
HelloHellotrue
G'DayG'Dayfalse
"Bruce Wayne""Bruce Wayne"false
GoodDay$GoodDay$false
Hello"WorldHello"Worldfalse
"Hello"World""Hello"World"false
Examples of the conversion:
ValueResultValueResult
Hello N'Hello'
G'Day N'G''Day'
'G''Day'
Hello N'Hello'
G'Day N'G''Day'
'G''Day'N'''G''''Day'''
I'''M N'I''''''M'
N'Hello' N'N''Hello'''
I'''M N'I''''''M'
N'Hello' N'N''Hello'''
diff -r 3e7ed3a7da38 -r d2d3c06dde93 jdk/src/java.sql/share/classes/javax/sql/package.html --- a/jdk/src/java.sql/share/classes/javax/sql/package.html Mon Jul 17 09:13:49 2017 -0700 +++ b/jdk/src/java.sql/share/classes/javax/sql/package.html Thu Jul 20 09:38:13 2017 -0700 @@ -280,7 +280,6 @@ The RowSet interface may be implemented in any number of ways, and anyone may write an implementation. Developers are encouraged to use their imaginations in coming up with new ways to use rowsets. -

Package Specification

diff -r 3e7ed3a7da38 -r d2d3c06dde93 jdk/src/jdk.crypto.ec/share/classes/sun/security/ec/ECKeyPairGenerator.java --- a/jdk/src/jdk.crypto.ec/share/classes/sun/security/ec/ECKeyPairGenerator.java Mon Jul 17 09:13:49 2017 -0700 +++ b/jdk/src/jdk.crypto.ec/share/classes/sun/security/ec/ECKeyPairGenerator.java Thu Jul 20 09:38:13 2017 -0700 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2009, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -25,12 +25,14 @@ package sun.security.ec; +import java.io.IOException; import java.math.BigInteger; import java.security.*; import java.security.spec.AlgorithmParameterSpec; import java.security.spec.ECGenParameterSpec; import java.security.spec.ECParameterSpec; import java.security.spec.ECPoint; +import java.security.spec.InvalidParameterSpecException; import sun.security.ec.ECPrivateKeyImpl; import sun.security.ec.ECPublicKeyImpl; @@ -85,17 +87,19 @@ public void initialize(AlgorithmParameterSpec params, SecureRandom random) throws InvalidAlgorithmParameterException { + ECParameterSpec ecSpec = null; + if (params instanceof ECParameterSpec) { - this.params = ECUtil.getECParameterSpec(null, + ecSpec = ECUtil.getECParameterSpec(null, (ECParameterSpec)params); - if (this.params == null) { + if (ecSpec == null) { throw new InvalidAlgorithmParameterException( "Unsupported curve: " + params); } } else if (params instanceof ECGenParameterSpec) { String name = ((ECGenParameterSpec)params).getName(); - this.params = ECUtil.getECParameterSpec(null, name); - if (this.params == null) { + ecSpec = ECUtil.getECParameterSpec(null, name); + if (ecSpec == null) { throw new InvalidAlgorithmParameterException( "Unknown curve name: " + name); } @@ -103,11 +107,36 @@ throw new InvalidAlgorithmParameterException( "ECParameterSpec or ECGenParameterSpec required for EC"); } + + // Not all known curves are supported by the native implementation + ensureCurveIsSupported(ecSpec); + this.params = ecSpec; + this.keySize = ((ECParameterSpec)this.params).getCurve().getField().getFieldSize(); this.random = random; } + private static void ensureCurveIsSupported(ECParameterSpec ecSpec) + throws InvalidAlgorithmParameterException { + + AlgorithmParameters ecParams = ECUtil.getECParameters(null); + byte[] encodedParams; + try { + ecParams.init(ecSpec); + encodedParams = ecParams.getEncoded(); + } catch (InvalidParameterSpecException ex) { + throw new InvalidAlgorithmParameterException( + "Unsupported curve: " + ecSpec.toString()); + } catch (IOException ex) { + throw new RuntimeException(ex); + } + if (!isCurveSupported(encodedParams)) { + throw new InvalidAlgorithmParameterException( + "Unsupported curve: " + ecParams.toString()); + } + } + // generate the keypair. See JCA doc @Override public KeyPair generateKeyPair() { @@ -159,6 +188,17 @@ this.keySize = keySize; } + /** + * Checks whether the curve in the encoded parameters is supported by the + * native implementation. + * + * @param encodedParams encoded parameters in the same form accepted + * by generateECKeyPair + * @return true if and only if generateECKeyPair will succeed for + * the supplied parameters + */ + private static native boolean isCurveSupported(byte[] encodedParams); + /* * Generates the keypair and returns a 2-element array of encoding bytes. * The first one is for the private key, the second for the public key. diff -r 3e7ed3a7da38 -r d2d3c06dde93 jdk/src/jdk.crypto.ec/share/native/libsunec/ECC_JNI.cpp --- a/jdk/src/jdk.crypto.ec/share/native/libsunec/ECC_JNI.cpp Mon Jul 17 09:13:49 2017 -0700 +++ b/jdk/src/jdk.crypto.ec/share/native/libsunec/ECC_JNI.cpp Thu Jul 20 09:38:13 2017 -0700 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2009, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -90,6 +90,50 @@ /* * Class: sun_security_ec_ECKeyPairGenerator + * Method: isCurveSupported + * Signature: ([B)Z + */ +JNIEXPORT jboolean +JNICALL Java_sun_security_ec_ECKeyPairGenerator_isCurveSupported + (JNIEnv *env, jclass clazz, jbyteArray encodedParams) +{ + SECKEYECParams params_item; + ECParams *ecparams = NULL; + jboolean result = JNI_FALSE; + + // The curve is supported if we can get parameters for it + params_item.len = env->GetArrayLength(encodedParams); + params_item.data = + (unsigned char *) env->GetByteArrayElements(encodedParams, 0); + if (params_item.data == NULL) { + goto cleanup; + } + + // Fill a new ECParams using the supplied OID + if (EC_DecodeParams(¶ms_item, &ecparams, 0) != SECSuccess) { + /* bad curve OID */ + goto cleanup; + } + + // If we make it to here, then the curve is supported + result = JNI_TRUE; + +cleanup: + { + if (params_item.data) { + env->ReleaseByteArrayElements(encodedParams, + (jbyte *) params_item.data, JNI_ABORT); + } + if (ecparams) { + FreeECParams(ecparams, true); + } + } + + return result; +} + +/* + * Class: sun_security_ec_ECKeyPairGenerator * Method: generateECKeyPair * Signature: (I[B[B)[[B */ diff -r 3e7ed3a7da38 -r d2d3c06dde93 jdk/src/jdk.management.agent/share/classes/sun/management/jdp/JdpController.java --- a/jdk/src/jdk.management.agent/share/classes/sun/management/jdp/JdpController.java Mon Jul 17 09:13:49 2017 -0700 +++ b/jdk/src/jdk.management.agent/share/classes/sun/management/jdp/JdpController.java Thu Jul 20 09:38:13 2017 -0700 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 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 @@ -33,6 +33,7 @@ import java.lang.management.RuntimeMXBean; import java.lang.reflect.Field; import java.lang.reflect.Method; +import java.lang.UnsupportedOperationException; import sun.management.VMManagement; /** @@ -132,19 +133,11 @@ } // Get the process id of the current running Java process - private static Integer getProcessId() { + private static Long getProcessId() { try { - // Get the current process id using a reflection hack - RuntimeMXBean runtime = ManagementFactory.getRuntimeMXBean(); - Field jvm = runtime.getClass().getDeclaredField("jvm"); - jvm.setAccessible(true); - - VMManagement mgmt = (sun.management.VMManagement) jvm.get(runtime); - Method pid_method = mgmt.getClass().getDeclaredMethod("getProcessId"); - pid_method.setAccessible(true); - Integer pid = (Integer) pid_method.invoke(mgmt); - return pid; - } catch(Exception ex) { + // Get the current process id + return ProcessHandle.current().pid(); + } catch(UnsupportedOperationException ex) { return null; } } @@ -206,7 +199,7 @@ packet.setBroadcastInterval(Integer.toString(pause)); // Set process id - Integer pid = getProcessId(); + Long pid = getProcessId(); if (pid != null) { packet.setProcessId(pid.toString()); } diff -r 3e7ed3a7da38 -r d2d3c06dde93 jdk/src/jdk.sctp/share/classes/com/sun/nio/sctp/SctpChannel.java --- a/jdk/src/jdk.sctp/share/classes/com/sun/nio/sctp/SctpChannel.java Mon Jul 17 09:13:49 2017 -0700 +++ b/jdk/src/jdk.sctp/share/classes/com/sun/nio/sctp/SctpChannel.java Thu Jul 20 09:38:13 2017 -0700 @@ -59,65 +59,70 @@ * {@link #setOption(SctpSocketOption,Object) setOption} method. An SCTP * channel support the following options: *
- * + *
Socket options
+ * + * * - * - * + * + * * + * + * * - * + * * * * - * + * * * * - * + * * * * - * + * * * * - * + * * * * - * + * * * * - * + * * * * - * + * * * * - * + * * * * - * + * * * + * *
Socket options
Option NameDescriptionOption NameDescription
{@link SctpStandardSocketOptions#SCTP_DISABLE_FRAGMENTS - * SCTP_DISABLE_FRAGMENTS} {@link SctpStandardSocketOptions#SCTP_DISABLE_FRAGMENTS + * SCTP_DISABLE_FRAGMENTS} Enables or disables message fragmentation
{@link SctpStandardSocketOptions#SCTP_EXPLICIT_COMPLETE - * SCTP_EXPLICIT_COMPLETE} {@link SctpStandardSocketOptions#SCTP_EXPLICIT_COMPLETE + * SCTP_EXPLICIT_COMPLETE} Enables or disables explicit message completion
{@link SctpStandardSocketOptions#SCTP_FRAGMENT_INTERLEAVE - * SCTP_FRAGMENT_INTERLEAVE} {@link SctpStandardSocketOptions#SCTP_FRAGMENT_INTERLEAVE + * SCTP_FRAGMENT_INTERLEAVE} Controls how the presentation of messages occur for the message * receiver
{@link SctpStandardSocketOptions#SCTP_INIT_MAXSTREAMS - * SCTP_INIT_MAXSTREAMS} {@link SctpStandardSocketOptions#SCTP_INIT_MAXSTREAMS + * SCTP_INIT_MAXSTREAMS} The maximum number of streams requested by the local endpoint during * association initialization
{@link SctpStandardSocketOptions#SCTP_NODELAY SCTP_NODELAY} {@link SctpStandardSocketOptions#SCTP_NODELAY SCTP_NODELAY} Enables or disable a Nagle-like algorithm
{@link SctpStandardSocketOptions#SCTP_PRIMARY_ADDR - * SCTP_PRIMARY_ADDR} {@link SctpStandardSocketOptions#SCTP_PRIMARY_ADDR + * SCTP_PRIMARY_ADDR} Requests that the local SCTP stack use the given peer address as the * association primary
{@link SctpStandardSocketOptions#SCTP_SET_PEER_PRIMARY_ADDR - * SCTP_SET_PEER_PRIMARY_ADDR} {@link SctpStandardSocketOptions#SCTP_SET_PEER_PRIMARY_ADDR + * SCTP_SET_PEER_PRIMARY_ADDR} Requests that the peer mark the enclosed address as the association * primary
{@link SctpStandardSocketOptions#SO_SNDBUF - * SO_SNDBUF} {@link SctpStandardSocketOptions#SO_SNDBUF + * SO_SNDBUF} The size of the socket send buffer
{@link SctpStandardSocketOptions#SO_RCVBUF - * SO_RCVBUF} {@link SctpStandardSocketOptions#SO_RCVBUF + * SO_RCVBUF} The size of the socket receive buffer
{@link SctpStandardSocketOptions#SO_LINGER - * SO_LINGER} {@link SctpStandardSocketOptions#SO_LINGER + * SO_LINGER} Linger on close if data is present (when configured in blocking mode * only)
*
* Additional (implementation specific) options may also be supported. The list diff -r 3e7ed3a7da38 -r d2d3c06dde93 jdk/src/jdk.sctp/share/classes/com/sun/nio/sctp/SctpMultiChannel.java --- a/jdk/src/jdk.sctp/share/classes/com/sun/nio/sctp/SctpMultiChannel.java Mon Jul 17 09:13:49 2017 -0700 +++ b/jdk/src/jdk.sctp/share/classes/com/sun/nio/sctp/SctpMultiChannel.java Thu Jul 20 09:38:13 2017 -0700 @@ -63,65 +63,70 @@ * {@link #setOption(SctpSocketOption,Object,Association) setOption} method. An * {@code SctpMultiChannel} supports the following options: *
- * + *
Socket options
+ * + * * - * - * + * + * * + * + * * - * + * * * * - * + * * * * - * + * * * * - * + * * * * - * + * * * * - * + * * * * - * + * * * * - * + * * * * - * + * * * * - * + * * * + * *
Socket options
Option NameDescriptionOption NameDescription
{@link SctpStandardSocketOptions#SCTP_DISABLE_FRAGMENTS - * SCTP_DISABLE_FRAGMENTS} {@link SctpStandardSocketOptions#SCTP_DISABLE_FRAGMENTS + * SCTP_DISABLE_FRAGMENTS} Enables or disables message fragmentation
{@link SctpStandardSocketOptions#SCTP_EXPLICIT_COMPLETE - * SCTP_EXPLICIT_COMPLETE} {@link SctpStandardSocketOptions#SCTP_EXPLICIT_COMPLETE + * SCTP_EXPLICIT_COMPLETE} Enables or disables explicit message completion
{@link SctpStandardSocketOptions#SCTP_FRAGMENT_INTERLEAVE - * SCTP_FRAGMENT_INTERLEAVE} {@link SctpStandardSocketOptions#SCTP_FRAGMENT_INTERLEAVE + * SCTP_FRAGMENT_INTERLEAVE} Controls how the presentation of messages occur for the message * receiver
{@link SctpStandardSocketOptions#SCTP_INIT_MAXSTREAMS - * SCTP_INIT_MAXSTREAMS} {@link SctpStandardSocketOptions#SCTP_INIT_MAXSTREAMS + * SCTP_INIT_MAXSTREAMS} The maximum number of streams requested by the local endpoint during * association initialization
{@link SctpStandardSocketOptions#SCTP_NODELAY SCTP_NODELAY} {@link SctpStandardSocketOptions#SCTP_NODELAY SCTP_NODELAY} Enables or disable a Nagle-like algorithm
{@link SctpStandardSocketOptions#SCTP_PRIMARY_ADDR - * SCTP_PRIMARY_ADDR} {@link SctpStandardSocketOptions#SCTP_PRIMARY_ADDR + * SCTP_PRIMARY_ADDR} Requests that the local SCTP stack use the given peer address as the * association primary
{@link SctpStandardSocketOptions#SCTP_SET_PEER_PRIMARY_ADDR - * SCTP_SET_PEER_PRIMARY_ADDR} {@link SctpStandardSocketOptions#SCTP_SET_PEER_PRIMARY_ADDR + * SCTP_SET_PEER_PRIMARY_ADDR} Requests that the peer mark the enclosed address as the association * primary
{@link SctpStandardSocketOptions#SO_SNDBUF - * SO_SNDBUF} {@link SctpStandardSocketOptions#SO_SNDBUF + * SO_SNDBUF} The size of the socket send buffer
{@link SctpStandardSocketOptions#SO_RCVBUF - * SO_RCVBUF} {@link SctpStandardSocketOptions#SO_RCVBUF + * SO_RCVBUF} The size of the socket receive buffer
{@link SctpStandardSocketOptions#SO_LINGER - * SO_LINGER} {@link SctpStandardSocketOptions#SO_LINGER + * SO_LINGER} Linger on close if data is present (when configured in blocking mode * only)
*
* Additional (implementation specific) options may also be supported. The list diff -r 3e7ed3a7da38 -r d2d3c06dde93 jdk/src/jdk.sctp/share/classes/com/sun/nio/sctp/SctpServerChannel.java --- a/jdk/src/jdk.sctp/share/classes/com/sun/nio/sctp/SctpServerChannel.java Mon Jul 17 09:13:49 2017 -0700 +++ b/jdk/src/jdk.sctp/share/classes/com/sun/nio/sctp/SctpServerChannel.java Thu Jul 20 09:38:13 2017 -0700 @@ -47,17 +47,22 @@ * {@link #setOption(SctpSocketOption,Object) setOption} method. SCTP server socket * channels support the following options: *
- * + *
Socket options
+ * + * * - * - * + * + * * + * + * * - * + * * * + * *
Socket options
Option NameDescriptionOption NameDescription
{@link SctpStandardSocketOptions#SCTP_INIT_MAXSTREAMS - * SCTP_INIT_MAXSTREAMS} {@link SctpStandardSocketOptions#SCTP_INIT_MAXSTREAMS + * SCTP_INIT_MAXSTREAMS} The maximum number of streams requested by the local endpoint during * association initialization
*
* Additional (implementation specific) options may also be supported. The list diff -r 3e7ed3a7da38 -r d2d3c06dde93 jdk/test/ProblemList.txt --- a/jdk/test/ProblemList.txt Mon Jul 17 09:13:49 2017 -0700 +++ b/jdk/test/ProblemList.txt Thu Jul 20 09:38:13 2017 -0700 @@ -264,9 +264,6 @@ tools/jimage/JImageListTest.java 8170120 generic-all tools/jimage/JImageVerifyTest.java 8170120 generic-all -tools/schemagen/MultiReleaseJarTest.java 8174692 generic-all -tools/wsgen/MultiReleaseJarTest.java 8174692 generic-all - ############################################################################ # jdk_jdi diff -r 3e7ed3a7da38 -r d2d3c06dde93 jdk/test/com/oracle/security/ucrypto/TestAES.java --- a/jdk/test/com/oracle/security/ucrypto/TestAES.java Mon Jul 17 09:13:49 2017 -0700 +++ b/jdk/test/com/oracle/security/ucrypto/TestAES.java Thu Jul 20 09:38:13 2017 -0700 @@ -26,17 +26,22 @@ * @bug 7088989 8014374 8167512 8173708 * @summary Ensure the AES ciphers of OracleUcrypto provider works correctly * @key randomness + * @library /test/lib + * @build jdk.test.lib.Platform + * jdk.test.lib.Utils * @run main TestAES - * @run main/othervm/java.security.policy==empty.policy TestAES + * @run main/othervm -Dpolicy=empty.policy TestAES */ -import java.io.*; import java.security.*; import java.security.spec.*; import java.util.*; import javax.crypto.*; import javax.crypto.spec.*; +import jdk.test.lib.Platform; +import jdk.test.lib.Utils; + public class TestAES extends UcryptoTest { private static final String[] PADDEDCIPHER_ALGOS = { @@ -55,10 +60,29 @@ private static final SecretKey CIPHER_KEY = new SecretKeySpec(new byte[16], "AES"); + private static final boolean IS_BAD_SOLARIS = isBadSolaris(); + public static void main(String[] args) throws Exception { + // It has to determine Solaris version before enabling security manager. + // Because that needs some permissions, like java.io.FilePermission. + String policy = System.getProperty("policy"); + if (policy != null) { + enableSecurityManager(policy); + } + main(new TestAES(), null); } + // Enables security manager and uses the specified policy file to override + // the default one. + private static void enableSecurityManager(String policy) { + String policyURL = "file://" + System.getProperty("test.src", ".") + "/" + + policy; + System.out.println("policyURL: " + policyURL); + Security.setProperty("policy.url.1", policyURL); + System.setSecurityManager(new SecurityManager()); + } + public void doTest(Provider prov) throws Exception { // Provider for testing Interoperability Provider sunJCEProv = Security.getProvider("SunJCE"); @@ -136,11 +160,18 @@ boolean testPassed = true; byte[] in = new byte[16]; (new SecureRandom()).nextBytes(in); - int blockSize = 16; - for (int j = 1; j < (in.length - 1); j++) { - System.out.println("Input offset size: " + j); - for (int i = 0; i < algos.length; i++) { + for (int i = 0; i < algos.length; i++) { + if (IS_BAD_SOLARIS + && algos[i].indexOf("CFB128") != -1 + && p.getName().equals("OracleUcrypto")) { + System.out.println("Ignore cases on CFB128 due to a pre-S11.3 bug"); + continue; + } + + for (int j = 1; j < (in.length - 1); j++) { + System.out.println("Input offset size: " + j); + try { // check ENC Cipher c; @@ -177,12 +208,6 @@ k += c.doFinal(eout, firstPartLen+1, eout.length - firstPartLen - 1, dout, k); if (!checkArrays(in, in.length, dout, k)) testPassed = false; } catch(Exception ex) { - if (ex instanceof BadPaddingException && - algos[i].indexOf("CFB128") != -1 && - p.getName().equals("OracleUcrypto")) { - System.out.println("Ignore due to a pre-S11.3 bug: " + ex); - continue; - } System.out.println("Unexpected Exception: " + algos[i]); ex.printStackTrace(); testPassed = false; @@ -261,7 +286,6 @@ } } - private static void testCipherGCM(SecretKey key, Provider p) { boolean testPassed = true; @@ -349,4 +373,12 @@ } return equal; } + + // The cases on CFB128 mode have to be skipped on pre-S11.3. + private static boolean isBadSolaris() { + return Platform.isSolaris() + && Platform.getOsVersionMajor() <= 5 + && Platform.getOsVersionMinor() <= 11 + && Utils.distro().compareTo("11.3") < 0; + } } diff -r 3e7ed3a7da38 -r d2d3c06dde93 jdk/test/java/nio/charset/Charset/IllegalCharsetName.java --- a/jdk/test/java/nio/charset/Charset/IllegalCharsetName.java Mon Jul 17 09:13:49 2017 -0700 +++ b/jdk/test/java/nio/charset/Charset/IllegalCharsetName.java Thu Jul 20 09:38:13 2017 -0700 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2010, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -22,15 +22,12 @@ */ /* @test - * @bug 6330020 + * @bug 6330020 8184665 * @summary Ensure Charset.forName/isSupport throws the correct exception * if the charset names passed in are illegal. */ -import java.io.*; -import java.nio.*; import java.nio.charset.*; -import java.util.*; public class IllegalCharsetName { public static void main(String[] args) throws Exception { @@ -59,5 +56,18 @@ } catch (IllegalCharsetNameException x) { //expected } } + + // Standard charsets may bypass alias checking during startup, test that + // they're all well-behaved as a sanity test + checkAliases(StandardCharsets.ISO_8859_1); + checkAliases(StandardCharsets.US_ASCII); + checkAliases(StandardCharsets.UTF_8); + } + + private static void checkAliases(Charset cs) { + for (String alias : cs.aliases()) { + Charset.forName(alias); + Charset.isSupported(alias); + } } } diff -r 3e7ed3a7da38 -r d2d3c06dde93 jdk/test/java/util/regex/RegExTest.java --- a/jdk/test/java/util/regex/RegExTest.java Mon Jul 17 09:13:49 2017 -0700 +++ b/jdk/test/java/util/regex/RegExTest.java Thu Jul 20 09:38:13 2017 -0700 @@ -33,9 +33,8 @@ * 6350801 6676425 6878475 6919132 6931676 6948903 6990617 7014645 7039066 * 7067045 7014640 7189363 8007395 8013252 8013254 8012646 8023647 6559590 * 8027645 8035076 8039124 8035975 8074678 6854417 8143854 8147531 7071819 - * 8151481 4867170 7080302 6728861 6995635 6736245 4916384 - * 6328855 6192895 6345469 6988218 6693451 7006761 8140212 8143282 8158482 - * 8176029 + * 8151481 4867170 7080302 6728861 6995635 6736245 4916384 6328855 6192895 + * 6345469 6988218 6693451 7006761 8140212 8143282 8158482 8176029 8184706 * * @library /test/lib * @build jdk.test.lib.RandomFactory @@ -470,7 +469,25 @@ m.find(); if (!m.hitEnd()) failCount++; - report("hitEnd from a Slice"); + + // 8184706: Matching u+0d at EOL against \R should hit-end + p = Pattern.compile("...\\R"); + m = p.matcher("cat" + (char)0x0a); + m.find(); + if (m.hitEnd()) + failCount++; + + m = p.matcher("cat" + (char)0x0d); + m.find(); + if (!m.hitEnd()) + failCount++; + + m = p.matcher("cat" + (char)0x0d + (char)0x0a); + m.find(); + if (m.hitEnd()) + failCount++; + + report("hitEnd"); } // This is for bug 4997476 diff -r 3e7ed3a7da38 -r d2d3c06dde93 jdk/test/sun/management/jdp/JdpOnTestCase.java --- a/jdk/test/sun/management/jdp/JdpOnTestCase.java Mon Jul 17 09:13:49 2017 -0700 +++ b/jdk/test/sun/management/jdp/JdpOnTestCase.java Thu Jul 20 09:38:13 2017 -0700 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 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 @@ -31,6 +31,7 @@ import java.net.SocketTimeoutException; import java.util.Map; +import static jdk.testlibrary.Asserts.assertNotEquals; public class JdpOnTestCase extends JdpTestCase { @@ -58,6 +59,7 @@ final String jdpName = payload.get("INSTANCE_NAME"); log.fine("Received correct JDP packet #" + String.valueOf(receivedJDPpackets) + ", jdp.name=" + jdpName); + assertNotEquals(null, payload.get("PROCESS_ID"), "Expected payload.get(\"PROCESS_ID\") to be not null."); } /** diff -r 3e7ed3a7da38 -r d2d3c06dde93 jdk/test/sun/security/ec/InvalidCurve.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jdk/test/sun/security/ec/InvalidCurve.java Thu Jul 20 09:38:13 2017 -0700 @@ -0,0 +1,61 @@ +/* + * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 8182999 + * @summary Ensure that SunEC behaves correctly for unsupported curves. + * @run main InvalidCurve + */ + +import java.security.*; +import java.security.spec.*; +import java.math.*; + +public class InvalidCurve { + + public static void main(String[] args) { + + KeyPairGenerator keyGen; + try { + keyGen = KeyPairGenerator.getInstance("EC", "SunEC"); + ECGenParameterSpec brainpoolSpec = + new ECGenParameterSpec("brainpoolP256r1"); + keyGen.initialize(brainpoolSpec); + } catch (InvalidAlgorithmParameterException ex) { + System.out.println(ex.getMessage()); + // this is expected + return; + } catch (NoSuchAlgorithmException | NoSuchProviderException ex) { + throw new RuntimeException(ex); + } + + keyGen.generateKeyPair(); + + // If we make it to here, then the test is not working correctly. + throw new RuntimeException("The expected exception was not thrown."); + + } + +} + diff -r 3e7ed3a7da38 -r d2d3c06dde93 jdk/test/tools/schemagen/MultiReleaseJarTest.java --- a/jdk/test/tools/schemagen/MultiReleaseJarTest.java Mon Jul 17 09:13:49 2017 -0700 +++ b/jdk/test/tools/schemagen/MultiReleaseJarTest.java Thu Jul 20 09:38:13 2017 -0700 @@ -56,7 +56,7 @@ @DataProvider(name = "jarFiles") public Object[][] jarFiles() { - return new Object[][]{{"MV_BOTH.jar", 9}, + return new Object[][]{{"MV_BOTH.jar", Math.min(10, Runtime.version().major())}, {"MV_ONLY_9.jar", 9}, {"NON_MV.jar", 8}}; } diff -r 3e7ed3a7da38 -r d2d3c06dde93 jdk/test/tools/wsgen/MultiReleaseJarTest.java --- a/jdk/test/tools/wsgen/MultiReleaseJarTest.java Mon Jul 17 09:13:49 2017 -0700 +++ b/jdk/test/tools/wsgen/MultiReleaseJarTest.java Thu Jul 20 09:38:13 2017 -0700 @@ -56,7 +56,7 @@ @DataProvider(name = "jarFiles") public Object[][] jarFiles() { - return new Object[][]{{"MV_BOTH.jar", 9}, + return new Object[][]{{"MV_BOTH.jar", Math.min(10, Runtime.version().major())}, {"MV_ONLY_9.jar", 9}, {"NON_MV.jar", 8}}; } diff -r 3e7ed3a7da38 -r d2d3c06dde93 langtools/.hgtags --- a/langtools/.hgtags Mon Jul 17 09:13:49 2017 -0700 +++ b/langtools/.hgtags Thu Jul 20 09:38:13 2017 -0700 @@ -435,3 +435,4 @@ add6717b655efa3aa9350e917175f3965cfc0729 jdk-10+14 0d0ac75b0f6cbe218362e3fac4bb443496e7258f jdk-9+176 2f01728210c1405ef459e69d9c7247b5df6abb78 jdk-9+177 +2b9273266ea629ca686239c416a7ff8a592d822a jdk-10+15 diff -r 3e7ed3a7da38 -r d2d3c06dde93 langtools/make/gendata/Gendata-jdk.compiler.gmk --- a/langtools/make/gendata/Gendata-jdk.compiler.gmk Mon Jul 17 09:13:49 2017 -0700 +++ b/langtools/make/gendata/Gendata-jdk.compiler.gmk Thu Jul 20 09:38:13 2017 -0700 @@ -60,7 +60,8 @@ $(SUPPORT_OUTPUTDIR)/symbols/ct.sym-files/_the.symbols: \ $(COMPILE_CREATE_SYMBOLS) \ - $(wildcard $(LANGTOOLS_TOPDIR)/make/data/symbols/*) + $(wildcard $(LANGTOOLS_TOPDIR)/make/data/symbols/*) \ + $(MODULE_INFOS) $(RM) -r $(@D) $(MKDIR) -p $(@D) $(ECHO) Creating ct.sym classes diff -r 3e7ed3a7da38 -r d2d3c06dde93 langtools/make/src/classes/build/tools/symbolgenerator/TransitiveDependencies.java --- a/langtools/make/src/classes/build/tools/symbolgenerator/TransitiveDependencies.java Mon Jul 17 09:13:49 2017 -0700 +++ b/langtools/make/src/classes/build/tools/symbolgenerator/TransitiveDependencies.java Thu Jul 20 09:38:13 2017 -0700 @@ -59,13 +59,14 @@ JavaCompiler compiler = ToolProvider.getSystemJavaCompiler(); List options = Arrays.asList("-source", "9", "-target", "9", + "-proc:only", "--system", "none", "--module-source-path", args[0], "--add-modules", Arrays.stream(args) .skip(1) .collect(Collectors.joining(","))); List jlObjectList = Arrays.asList("java.lang.Object"); - JavacTaskImpl task = (JavacTaskImpl) compiler.getTask(null, null, d -> {}, options, jlObjectList, null); + JavacTaskImpl task = (JavacTaskImpl) compiler.getTask(null, null, null, options, jlObjectList, null); task.enter(); Elements elements = task.getElements(); List todo = new LinkedList<>(); diff -r 3e7ed3a7da38 -r d2d3c06dde93 langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/code/ClassFinder.java --- a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/code/ClassFinder.java Mon Jul 17 09:13:49 2017 -0700 +++ b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/code/ClassFinder.java Thu Jul 20 09:38:13 2017 -0700 @@ -340,6 +340,8 @@ JavaFileObject classfile = c.classfile; if (classfile != null) { JavaFileObject previousClassFile = currentClassFile; + Symbol prevOwner = c.owner; + Name prevName = c.fullname; try { if (reader.filling) { Assert.error("Filling " + classfile.toUri() + " during " + previousClassFile); @@ -360,6 +362,21 @@ + classfile.toUri()); } } + } catch (BadClassFile cf) { + //the symbol may be partially initialized, purge it: + c.owner = prevOwner; + c.members_field.getSymbols(sym -> sym.kind == TYP).forEach(sym -> { + ClassSymbol csym = (ClassSymbol) sym; + csym.owner = sym.packge(); + csym.owner.members().enter(sym); + csym.fullname = sym.flatName(); + csym.name = Convert.shortName(sym.flatName()); + csym.reset(); + }); + c.fullname = prevName; + c.name = Convert.shortName(prevName); + c.reset(); + throw cf; } finally { currentClassFile = previousClassFile; } diff -r 3e7ed3a7da38 -r d2d3c06dde93 langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Check.java --- a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Check.java Mon Jul 17 09:13:49 2017 -0700 +++ b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Check.java Thu Jul 20 09:38:13 2017 -0700 @@ -290,8 +290,7 @@ */ public Type completionError(DiagnosticPosition pos, CompletionFailure ex) { log.error(JCDiagnostic.DiagnosticFlag.NON_DEFERRABLE, pos, Errors.CantAccess(ex.sym, ex.getDetailValue())); - if (ex instanceof ClassFinder.BadClassFile) throw new Abort(); - else return syms.errType; + return syms.errType; } /** Report an error that wrong type tag was found. diff -r 3e7ed3a7da38 -r d2d3c06dde93 langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Modules.java --- a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Modules.java Mon Jul 17 09:13:49 2017 -0700 +++ b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Modules.java Thu Jul 20 09:38:13 2017 -0700 @@ -94,10 +94,8 @@ import com.sun.tools.javac.tree.JCTree.JCUses; import com.sun.tools.javac.tree.JCTree.Tag; import com.sun.tools.javac.tree.TreeInfo; -import com.sun.tools.javac.util.Abort; import com.sun.tools.javac.util.Assert; import com.sun.tools.javac.util.Context; -import com.sun.tools.javac.util.JCDiagnostic; import com.sun.tools.javac.util.JCDiagnostic.DiagnosticPosition; import com.sun.tools.javac.util.List; import com.sun.tools.javac.util.ListBuffer; @@ -105,7 +103,6 @@ import com.sun.tools.javac.util.Name; import com.sun.tools.javac.util.Names; import com.sun.tools.javac.util.Options; -import com.sun.tools.javac.util.Position; import static com.sun.tools.javac.code.Flags.ABSTRACT; import static com.sun.tools.javac.code.Flags.ENUM; @@ -266,8 +263,7 @@ msym.complete(); } } catch (CompletionFailure ex) { - log.error(JCDiagnostic.DiagnosticFlag.NON_DEFERRABLE, Position.NOPOS, Errors.CantAccess(ex.sym, ex.getDetailValue())); - if (ex instanceof ClassFinder.BadClassFile) throw new Abort(); + chk.completionError(null, ex); } finally { depth--; } @@ -1220,10 +1216,6 @@ Predicate observablePred = sym -> (observable == null) ? (moduleFinder.findModule(sym).kind != ERR) : observable.contains(sym); Predicate systemModulePred = sym -> (sym.flags() & Flags.SYSTEM_MODULE) != 0; - Predicate noIncubatorPred = sym -> { - sym.complete(); - return !sym.resolutionFlags.contains(ModuleResolutionFlags.DO_NOT_RESOLVE_BY_DEFAULT); - }; Set enabledRoot = new LinkedHashSet<>(); if (rootModules.contains(syms.unnamedModule)) { @@ -1241,9 +1233,18 @@ jdkModulePred = sym -> true; } + Predicate noIncubatorPred = sym -> { + sym.complete(); + return !sym.resolutionFlags.contains(ModuleResolutionFlags.DO_NOT_RESOLVE_BY_DEFAULT); + }; + for (ModuleSymbol sym : new HashSet<>(syms.getAllModules())) { - if (systemModulePred.test(sym) && observablePred.test(sym) && jdkModulePred.test(sym) && noIncubatorPred.test(sym)) { - enabledRoot.add(sym); + try { + if (systemModulePred.test(sym) && observablePred.test(sym) && jdkModulePred.test(sym) && noIncubatorPred.test(sym)) { + enabledRoot.add(sym); + } + } catch (CompletionFailure ex) { + chk.completionError(null, ex); } } } @@ -1341,32 +1342,36 @@ result.add(syms.java_base); while (primaryTodo.nonEmpty() || secondaryTodo.nonEmpty()) { - ModuleSymbol current; - boolean isPrimaryTodo; - if (primaryTodo.nonEmpty()) { - current = primaryTodo.head; - primaryTodo = primaryTodo.tail; - isPrimaryTodo = true; - } else { - current = secondaryTodo.head; - secondaryTodo = secondaryTodo.tail; - isPrimaryTodo = false; - } - if (observable != null && !observable.contains(current)) - continue; - if (!result.add(current) || current == syms.unnamedModule || ((current.flags_field & Flags.AUTOMATIC_MODULE) != 0)) - continue; - current.complete(); - if (current.kind == ERR && (isPrimaryTodo || base.contains(current)) && warnedMissing.add(current)) { - log.error(Errors.ModuleNotFound(current)); - } - for (RequiresDirective rd : current.requires) { - if (rd.module == syms.java_base) continue; - if ((rd.isTransitive() && isPrimaryTodo) || rootModules.contains(current)) { - primaryTodo = primaryTodo.prepend(rd.module); + try { + ModuleSymbol current; + boolean isPrimaryTodo; + if (primaryTodo.nonEmpty()) { + current = primaryTodo.head; + primaryTodo = primaryTodo.tail; + isPrimaryTodo = true; } else { - secondaryTodo = secondaryTodo.prepend(rd.module); + current = secondaryTodo.head; + secondaryTodo = secondaryTodo.tail; + isPrimaryTodo = false; } + if (observable != null && !observable.contains(current)) + continue; + if (!result.add(current) || current == syms.unnamedModule || ((current.flags_field & Flags.AUTOMATIC_MODULE) != 0)) + continue; + current.complete(); + if (current.kind == ERR && (isPrimaryTodo || base.contains(current)) && warnedMissing.add(current)) { + log.error(Errors.ModuleNotFound(current)); + } + for (RequiresDirective rd : current.requires) { + if (rd.module == syms.java_base) continue; + if ((rd.isTransitive() && isPrimaryTodo) || rootModules.contains(current)) { + primaryTodo = primaryTodo.prepend(rd.module); + } else { + secondaryTodo = secondaryTodo.prepend(rd.module); + } + } + } catch (CompletionFailure ex) { + chk.completionError(null, ex); } } diff -r 3e7ed3a7da38 -r d2d3c06dde93 langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/jvm/ClassReader.java --- a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/jvm/ClassReader.java Mon Jul 17 09:13:49 2017 -0700 +++ b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/jvm/ClassReader.java Thu Jul 20 09:38:13 2017 -0700 @@ -1425,7 +1425,7 @@ ClassSymbol c = readClassSymbol(nextChar()); NameAndType nt = readNameAndType(nextChar()); - if (c.members_field == null) + if (c.members_field == null || c.kind != TYP) throw badClassFile("bad.enclosing.class", self, c); MethodSymbol m = findMethod(nt, c.members_field, self.flags()); diff -r 3e7ed3a7da38 -r d2d3c06dde93 langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/main/JavaCompiler.java --- a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/main/JavaCompiler.java Mon Jul 17 09:13:49 2017 -0700 +++ b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/main/JavaCompiler.java Thu Jul 20 09:38:13 2017 -0700 @@ -400,8 +400,6 @@ } catch (CompletionFailure ex) { // inlined Check.completionError as it is not initialized yet log.error(Errors.CantAccess(ex.sym, ex.getDetailValue())); - if (ex instanceof ClassFinder.BadClassFile) - throw new Abort(); } source = Source.instance(context); attr = Attr.instance(context); diff -r 3e7ed3a7da38 -r d2d3c06dde93 langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/parser/JavacParser.java --- a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/parser/JavacParser.java Mon Jul 17 09:13:49 2017 -0700 +++ b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/parser/JavacParser.java Thu Jul 20 09:38:13 2017 -0700 @@ -2243,8 +2243,20 @@ } } - JCNewArray na = toP(F.at(newpos).NewArray(elemtype, dims.toList(), null)); + List elems = null; + int errpos = token.pos; + + if (token.kind == LBRACE) { + elems = arrayInitializerElements(newpos, elemtype); + } + + JCNewArray na = toP(F.at(newpos).NewArray(elemtype, dims.toList(), elems)); na.dimAnnotations = dimAnnotations.toList(); + + if (elems != null) { + return syntaxError(errpos, List.of(na), "illegal.array.creation.both.dimension.and.initialization"); + } + return na; } } @@ -2270,6 +2282,11 @@ /** ArrayInitializer = "{" [VariableInitializer {"," VariableInitializer}] [","] "}" */ JCExpression arrayInitializer(int newpos, JCExpression t) { + List elems = arrayInitializerElements(newpos, t); + return toP(F.at(newpos).NewArray(t, List.nil(), elems)); + } + + List arrayInitializerElements(int newpos, JCExpression t) { accept(LBRACE); ListBuffer elems = new ListBuffer<>(); if (token.kind == COMMA) { @@ -2283,7 +2300,7 @@ } } accept(RBRACE); - return toP(F.at(newpos).NewArray(t, List.nil(), elems.toList())); + return elems.toList(); } /** VariableInitializer = ArrayInitializer | Expression diff -r 3e7ed3a7da38 -r d2d3c06dde93 langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/resources/compiler.properties --- a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/resources/compiler.properties Mon Jul 17 09:13:49 2017 -0700 +++ b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/resources/compiler.properties Thu Jul 20 09:38:13 2017 -0700 @@ -165,6 +165,9 @@ compiler.err.array.dimension.missing=\ array dimension missing +compiler.err.illegal.array.creation.both.dimension.and.initialization=\ + array creation with both dimension expression and initialization is illegal + # 0: type compiler.err.array.req.but.found=\ array required, but {0} found diff -r 3e7ed3a7da38 -r d2d3c06dde93 langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AbstractIndexWriter.java --- a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AbstractIndexWriter.java Mon Jul 17 09:13:49 2017 -0700 +++ b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AbstractIndexWriter.java Thu Jul 20 09:38:13 2017 -0700 @@ -455,7 +455,7 @@ * @throws DocFileIOException if there is a problem creating the search index file */ protected void createSearchIndexFile(DocPath searchIndexFile, DocPath searchIndexZip, - DocPath searchIndexJS, List searchIndex, String varName) throws DocFileIOException { + DocPath searchIndexJS, Collection searchIndex, String varName) throws DocFileIOException { if (!searchIndex.isEmpty()) { StringBuilder searchVar = new StringBuilder("["); boolean first = true; diff -r 3e7ed3a7da38 -r d2d3c06dde93 langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AbstractMemberWriter.java --- a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AbstractMemberWriter.java Mon Jul 17 09:13:49 2017 -0700 +++ b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AbstractMemberWriter.java Thu Jul 20 09:38:13 2017 -0700 @@ -532,7 +532,7 @@ tdDesc.addStyle(HtmlStyle.colLast); writer.addSummaryLinkComment(this, member, firstSentenceTags, tdDesc); tr.addContent(tdDesc); - if (utils.isMethod(member) && !utils.isAnnotationType(member)) { + if (utils.isMethod(member) && !utils.isAnnotationType(member) && !utils.isProperty(name(member))) { int methodType = utils.isStatic(member) ? MethodTypes.STATIC.tableTabs().value() : MethodTypes.INSTANCE.tableTabs().value(); if (utils.isInterface(member.getEnclosingElement())) { diff -r 3e7ed3a7da38 -r d2d3c06dde93 langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/HtmlConfiguration.java --- a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/HtmlConfiguration.java Mon Jul 17 09:13:49 2017 -0700 +++ b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/HtmlConfiguration.java Thu Jul 20 09:38:13 2017 -0700 @@ -224,7 +224,7 @@ protected List packageSearchIndex = new ArrayList<>(); - protected List tagSearchIndex = new ArrayList<>(); + protected SortedSet tagSearchIndex = new TreeSet<>(makeSearchTagComparator()); protected List typeSearchIndex = new ArrayList<>(); @@ -348,6 +348,16 @@ return htmlTag.allowTag(this.htmlVersion); } + public Comparator makeSearchTagComparator() { + return (SearchIndexItem sii1, SearchIndexItem sii2) -> { + int result = (sii1.getLabel()).compareTo(sii2.getLabel()); + if (result == 0) { + result = (sii1.getHolder()).compareTo(sii2.getHolder()); + } + return result; + }; + } + /** * Decide the page which will appear first in the right-hand frame. It will * be "overview-summary.html" if "-overview" option is used or no diff -r 3e7ed3a7da38 -r d2d3c06dde93 langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/SplitIndexWriter.java --- a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/SplitIndexWriter.java Mon Jul 17 09:13:49 2017 -0700 +++ b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/SplitIndexWriter.java Thu Jul 20 09:38:13 2017 -0700 @@ -107,12 +107,16 @@ Set keys = new TreeSet<>(indexbuilder.getIndexMap().keySet()); keys.addAll(configuration.tagSearchIndexKeys); ListIterator li = new ArrayList<>(keys).listIterator(); + int prev; + int next; while (li.hasNext()) { + prev = (li.hasPrevious()) ? li.previousIndex() + 1 : -1; Object ch = li.next(); + next = (li.hasNext()) ? li.nextIndex() + 1 : -1; DocPath filename = DocPaths.indexN(li.nextIndex()); SplitIndexWriter indexgen = new SplitIndexWriter(configuration, path.resolve(filename), - indexbuilder, keys, li.previousIndex(), li.nextIndex()); + indexbuilder, keys, prev, next); indexgen.generateIndexFile((Character) ch); if (!li.hasNext()) { indexgen.createSearchIndexFiles(); diff -r 3e7ed3a7da38 -r d2d3c06dde93 langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/resources/stylesheet.css --- a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/resources/stylesheet.css Mon Jul 17 09:13:49 2017 -0700 +++ b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/resources/stylesheet.css Thu Jul 20 09:38:13 2017 -0700 @@ -434,21 +434,21 @@ } .overviewSummary caption a:link, .memberSummary caption a:link, .typeSummary caption a:link, .useSummary caption a:link, .constantsSummary caption a:link, .deprecatedSummary caption a:link, -.requiresSummary caption a:link, .packagesSummary caption a:link, providesSummary caption a:link, +.requiresSummary caption a:link, .packagesSummary caption a:link, .providesSummary caption a:link, .usesSummary caption a:link, .overviewSummary caption a:hover, .memberSummary caption a:hover, .typeSummary caption a:hover, .useSummary caption a:hover, .constantsSummary caption a:hover, .deprecatedSummary caption a:hover, -.requiresSummary caption a:hover, .packagesSummary caption a:hover, providesSummary caption a:hover, +.requiresSummary caption a:hover, .packagesSummary caption a:hover, .providesSummary caption a:hover, .usesSummary caption a:hover, .overviewSummary caption a:active, .memberSummary caption a:active, .typeSummary caption a:active, .useSummary caption a:active, .constantsSummary caption a:active, .deprecatedSummary caption a:active, -.requiresSummary caption a:active, .packagesSummary caption a:active, providesSummary caption a:active, +.requiresSummary caption a:active, .packagesSummary caption a:active, .providesSummary caption a:active, .usesSummary caption a:active, .overviewSummary caption a:visited, .memberSummary caption a:visited, .typeSummary caption a:visited, -.useSummary caption a:visited, .constantsSummary caption a:visited, .deprecatedSummary caption a:visited -.requiresSummary caption a:visited, .packagesSummary caption a:visited, providesSummary caption a:visited, +.useSummary caption a:visited, .constantsSummary caption a:visited, .deprecatedSummary caption a:visited, +.requiresSummary caption a:visited, .packagesSummary caption a:visited, .providesSummary caption a:visited, .usesSummary caption a:visited { - color:#FFFFFF; + color:#1f389c; } .overviewSummary caption span, .memberSummary caption span, .typeSummary caption span, .useSummary caption span, .constantsSummary caption span, .deprecatedSummary caption span, diff -r 3e7ed3a7da38 -r d2d3c06dde93 langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/tool/Start.java --- a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/tool/Start.java Mon Jul 17 09:13:49 2017 -0700 +++ b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/tool/Start.java Thu Jul 20 09:38:13 2017 -0700 @@ -38,7 +38,9 @@ import java.util.Comparator; import java.util.List; import java.util.Locale; +import java.util.MissingResourceException; import java.util.Objects; +import java.util.ResourceBundle; import java.util.Set; import java.util.stream.Collectors; import java.util.stream.Stream; @@ -177,6 +179,16 @@ usage("main.Xusage", OptionKind.EXTENDED, "main.Xusage.foot"); } + @Override + void version() { + messager.notice("javadoc.version", messager.programName, version("release")); + } + + @Override + void fullVersion() { + messager.notice("javadoc.fullversion", messager.programName, version("full")); + } + private void usage(String headerKey, OptionKind kind, String footerKey) { messager.notice(headerKey); showToolOptions(kind); @@ -193,6 +205,24 @@ messager.notice(footerKey); } + private static final String versionRBName = "jdk.javadoc.internal.tool.resources.version"; + private static ResourceBundle versionRB; + + private static String version(String key) { + if (versionRB == null) { + try { + versionRB = ResourceBundle.getBundle(versionRBName); + } catch (MissingResourceException e) { + return Log.getLocalizedString("version.not.available"); + } + } + try { + return versionRB.getString(key); + } catch (MissingResourceException e) { + return Log.getLocalizedString("version.not.available"); + } + } + void showToolOptions(OptionKind kind) { Comparator comp = new Comparator() { final Collator collator = Collator.getInstance(Locale.US); diff -r 3e7ed3a7da38 -r d2d3c06dde93 langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/tool/ToolOption.java --- a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/tool/ToolOption.java Mon Jul 17 09:13:49 2017 -0700 +++ b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/tool/ToolOption.java Thu Jul 20 09:38:13 2017 -0700 @@ -359,6 +359,20 @@ public void process(Helper helper) { throw new AssertionError("the -J flag should be caught by the launcher."); } + }, + + VERSION("--version", STANDARD) { + @Override + public void process(Helper helper) throws OptionException { + throw new OptionException(OK, helper::version); + } + }, + + FULLVERSION("--full-version", HIDDEN) { + @Override + public void process(Helper helper) throws OptionException { + throw new OptionException(OK, helper::fullVersion); + } }; public final String primaryName; @@ -456,6 +470,9 @@ abstract void usage(); abstract void Xusage(); + abstract void version(); + abstract void fullVersion(); + abstract String getLocalizedMessage(String msg, Object... args); abstract OptionHelper getOptionHelper(); diff -r 3e7ed3a7da38 -r d2d3c06dde93 langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/tool/resources/javadoc.properties --- a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/tool/resources/javadoc.properties Mon Jul 17 09:13:49 2017 -0700 +++ b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/tool/resources/javadoc.properties Thu Jul 20 09:38:13 2017 -0700 @@ -200,6 +200,9 @@ main.opt.quiet.desc=\ Do not display status messages +main.opt.version.desc=\ + Print version information + main.opt.J.arg=\ main.opt.J.desc=\ @@ -306,3 +309,5 @@ javadoc.warning.msg={0}: warning - {1} javadoc.note.msg = {1} javadoc.note.pos.msg= {0}: {1} +javadoc.version={0} {1} +javadoc.fullversion={0} full version "{1}" diff -r 3e7ed3a7da38 -r d2d3c06dde93 langtools/test/jdk/javadoc/doclet/testIndexFiles/TestIndexFiles.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/langtools/test/jdk/javadoc/doclet/testIndexFiles/TestIndexFiles.java Thu Jul 20 09:38:13 2017 -0700 @@ -0,0 +1,64 @@ +/* + * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 8170825 + * @summary Perform tests on index files generated by javadoc. + * @author bpatel + * @library ../lib + * @modules jdk.javadoc/jdk.javadoc.internal.tool + * @build JavadocTester + * @run main TestIndexFiles + */ + +public class TestIndexFiles extends JavadocTester { + + public static void main(String... args) throws Exception { + TestIndexFiles tester = new TestIndexFiles(); + tester.runTests(); + } + + @Test + void testIndexFiles() { + javadoc("-d", "out", "-splitindex", "-Xdoclint:none", "-sourcepath", testSrc, + "-use", "pkg"); + checkExit(Exit.OK); + checkIndexFiles(true); + } + + void checkIndexFiles(boolean found) { + checkOutput("index-files/index-1.html", found, + "
  • Prev Letter
  • \n" + + "
  • Next Letter
  • "); + checkOutput("index-files/index-5.html", found, + "
  • Prev Letter
  • \n" + + "
  • Next Letter
  • "); + checkOutput("index-files/index-1.html", !found, + "
  • Prev Letter
  • \n" + + "
  • Next Letter
  • "); + checkOutput("index-files/index-5.html", !found, + "
  • Prev Letter
  • \n" + + "
  • Next Letter
  • "); + } +} diff -r 3e7ed3a7da38 -r d2d3c06dde93 langtools/test/jdk/javadoc/doclet/testIndexFiles/pkg/ClassForIndexFilesTest.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/langtools/test/jdk/javadoc/doclet/testIndexFiles/pkg/ClassForIndexFilesTest.java Thu Jul 20 09:38:13 2017 -0700 @@ -0,0 +1,45 @@ +/* + * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package pkg; + +public class ClassForIndexFilesTest { + + /** + * Test field. + */ + public int field1; + + /** + * Test method. + */ + public void testMethod() { + } + + /** + * Another test method. + */ + public void anotherTestMethod() { + } + +} diff -r 3e7ed3a7da38 -r d2d3c06dde93 langtools/test/jdk/javadoc/doclet/testIndexFiles/pkg/package-info.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/langtools/test/jdk/javadoc/doclet/testIndexFiles/pkg/package-info.java Thu Jul 20 09:38:13 2017 -0700 @@ -0,0 +1,27 @@ +/* + * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/** + * Test pkg used for testing index files. + */ +package pkg; diff -r 3e7ed3a7da38 -r d2d3c06dde93 langtools/test/jdk/javadoc/doclet/testJavaFX/TestJavaFX.java --- a/langtools/test/jdk/javadoc/doclet/testJavaFX/TestJavaFX.java Mon Jul 17 09:13:49 2017 -0700 +++ b/langtools/test/jdk/javadoc/doclet/testJavaFX/TestJavaFX.java Thu Jul 20 09:38:13 2017 -0700 @@ -24,7 +24,7 @@ /* * @test * @bug 7112427 8012295 8025633 8026567 8061305 8081854 8150130 8162363 - * 8167967 8172528 8175200 8178830 + * 8167967 8172528 8175200 8178830 8182257 * @summary Test of the JavaFX doclet features. * @author jvalenta * @library ../lib @@ -137,7 +137,10 @@ "

    Property Summary

    \n" + "\n" + "", - ""); + "\n" + + "\n", + "\n" + + "\n"); checkOutput("pkg1/C.html", false, "A()", @@ -147,7 +150,11 @@ + "Instance Methods" + " " + "Concrete Methods " - + ""); + + "", + "\n" + + "\n", + "\n" + + "\n"); checkOutput("index-all.html", true, "
    Gets the value of the property paused.
    ", diff -r 3e7ed3a7da38 -r d2d3c06dde93 langtools/test/jdk/javadoc/doclet/testModules/TestModules.java --- a/langtools/test/jdk/javadoc/doclet/testModules/TestModules.java Mon Jul 17 09:13:49 2017 -0700 +++ b/langtools/test/jdk/javadoc/doclet/testModules/TestModules.java Thu Jul 20 09:38:13 2017 -0700 @@ -25,7 +25,7 @@ * @test * @bug 8154119 8154262 8156077 8157987 8154261 8154817 8135291 8155995 8162363 * 8168766 8168688 8162674 8160196 8175799 8174974 8176778 8177562 8175218 8175823 8166306 - * 8178043 + * 8178043 8181622 * @summary Test modules support in javadoc. * @author bpatel * @library ../lib @@ -394,7 +394,7 @@ + "\n" + "\n" + "\n" - + "
    This is a test description for the moduleA module. Search " + + "
    This is a test description for the moduleA module with a Search " + "phrase search phrase.
    "); checkOutput("moduleB-summary.html", found, "\n" @@ -454,7 +454,7 @@ + "\n" + "\n" + "\n" - + "
    This is a test description for the moduleA module. Search " + + "
    This is a test description for the moduleA module with a Search " + "phrase search phrase.
    "); checkOutput("moduleB-summary.html", found, "
    \n" @@ -755,7 +755,8 @@ + "
    \n" + "\n" + "\n" + "\n" + "\n" @@ -839,7 +840,8 @@ "
    \n" + "
    moduleA - module moduleA
    \n" + "
    \n" - + "
    This is a test description for the moduleA module.
    \n" + + "
    This is a test description for the moduleA module with a Search " + + "phrase search phrase.
    \n" + "
    \n" + "
    moduleB - module moduleB
    \n" + "
    \n" @@ -854,13 +856,21 @@ + "search_word - Search tag in moduleB\n" + "
     
    \n" + "
    "); + checkOutput("index-all.html", false, + "
    " + + "search phrase - Search tag in moduleA
    \n" + + "
    with description
    \n" + + "
    " + + "search phrase - Search tag in moduleA
    \n" + + "
    with description
    "); } void checkModuleModeCommon() { checkOutput("overview-summary.html", true, "\n" + "", "\n" + "", "\n" + "\n" + "\n" + "", "
    Properties 
    C.BooleanProperty
    C.DoubleProperty
    C.BooleanProperty
    C.DoublePropertytransitivemoduleA\n" - + "
    This is a test description for the moduleA module.
    \n" + + "
    This is a test description for the moduleA module with a Search " + + "phrase search phrase.
    \n" + "
    moduleA\n" - + "
    This is a test description for the moduleA module.
    \n" + + "
    This is a test description for the moduleA module with a Search " + + "phrase search phrase.
    \n" + "
    moduleB\n" @@ -868,7 +878,7 @@ + "moduletags\n" - + "
    This is a test description for the moduleA module.
    \n" + + "
    This is a test description for the moduletags module.
    \n" + " Type Link: TestClassInModuleTags.
    \n" + " Member Link: testMethod(String).
    \n" + " Package Link: testpkgmdltags.
    \n" @@ -896,7 +906,8 @@ "
    transitive staticmoduleA\n" - + "
    This is a test description for the moduleA module.
    \n" + + "
    This is a test description for the moduleA module with a Search " + + "phrase search phrase.
    \n" + "
    \n" + "\n" diff -r 3e7ed3a7da38 -r d2d3c06dde93 langtools/test/jdk/javadoc/doclet/testModules/moduleA/module-info.java --- a/langtools/test/jdk/javadoc/doclet/testModules/moduleA/module-info.java Mon Jul 17 09:13:49 2017 -0700 +++ b/langtools/test/jdk/javadoc/doclet/testModules/moduleA/module-info.java Thu Jul 20 09:38:13 2017 -0700 @@ -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 @@ -24,7 +24,7 @@ */ /** - * This is a test description for the moduleA module. Search phrase {@index "search phrase" with description}. + * This is a test description for the moduleA module with a Search phrase {@index "search phrase" with description}. * * @deprecated This module is deprecated. */ diff -r 3e7ed3a7da38 -r d2d3c06dde93 langtools/test/jdk/javadoc/doclet/testModules/moduletags/module-info.java --- a/langtools/test/jdk/javadoc/doclet/testModules/moduletags/module-info.java Mon Jul 17 09:13:49 2017 -0700 +++ b/langtools/test/jdk/javadoc/doclet/testModules/moduletags/module-info.java Thu Jul 20 09:38:13 2017 -0700 @@ -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 @@ -24,7 +24,7 @@ */ /** - * This is a test description for the moduleA module.
    + * This is a test description for the moduletags module.
    * Type Link: {@link testpkgmdltags.TestClassInModuleTags}.
    * Member Link: {@link testpkgmdltags.TestClassInModuleTags#testMethod(String)}.
    * Package Link: {@link testpkgmdltags}.
    diff -r 3e7ed3a7da38 -r d2d3c06dde93 langtools/test/jdk/javadoc/doclet/testSearch/TestSearch.java --- a/langtools/test/jdk/javadoc/doclet/testSearch/TestSearch.java Mon Jul 17 09:13:49 2017 -0700 +++ b/langtools/test/jdk/javadoc/doclet/testSearch/TestSearch.java Thu Jul 20 09:38:13 2017 -0700 @@ -23,7 +23,7 @@ /* * @test - * @bug 8141492 8071982 8141636 8147890 8166175 8168965 8176794 8175218 8147881 + * @bug 8141492 8071982 8141636 8147890 8166175 8168965 8176794 8175218 8147881 8181622 * @summary Test the search feature of javadoc. * @author bpatel * @library ../lib @@ -65,6 +65,7 @@ checkInvalidUsageIndexTag(); checkSearchOutput(true); checkSingleIndex(true); + checkSingleIndexSearchTagDuplication(); checkJqueryAndImageFiles(true); checkSearchJS(); checkFiles(true, @@ -86,6 +87,7 @@ checkDocLintErrors(); checkSearchOutput(true); checkSingleIndex(true); + checkSingleIndexSearchTagDuplication(); checkJqueryAndImageFiles(true); checkSearchJS(); checkFiles(true, @@ -127,6 +129,7 @@ checkExit(Exit.OK); checkSearchOutput(true); checkSingleIndex(true); + checkSingleIndexSearchTagDuplication(); checkJqueryAndImageFiles(true); checkSearchJS(); checkFiles(true, @@ -210,6 +213,7 @@ checkInvalidUsageIndexTag(); checkSearchOutput(true); checkSplitIndex(); + checkSplitIndexSearchTagDuplication(); checkJqueryAndImageFiles(true); checkSearchJS(); checkFiles(true, @@ -498,4 +502,34 @@ + " }\n" + " });"); } + + void checkSingleIndexSearchTagDuplication() { + // Test for search tags duplication in index file. + checkOutput("index-all.html", true, + "
    " + + "SearchTagDeprecatedMethod - Search tag in pkg2.TestError
    \n" + + "
    with description
    "); + checkOutput("index-all.html", false, + "
    " + + "SearchTagDeprecatedMethod - Search tag in pkg2.TestError
    \n" + + "
    with description
    \n" + + "
    " + + "SearchTagDeprecatedMethod - Search tag in pkg2.TestError
    \n" + + "
    with description
    "); + } + + void checkSplitIndexSearchTagDuplication() { + // Test for search tags duplication in index file. + checkOutput("index-files/index-13.html", true, + "
    " + + "SearchTagDeprecatedMethod - Search tag in pkg2.TestError
    \n" + + "
    with description
    "); + checkOutput("index-files/index-13.html", false, + "
    " + + "SearchTagDeprecatedMethod - Search tag in pkg2.TestError
    \n" + + "
    with description
    \n" + + "
    " + + "SearchTagDeprecatedMethod - Search tag in pkg2.TestError
    \n" + + "
    with description
    "); + } } diff -r 3e7ed3a7da38 -r d2d3c06dde93 langtools/test/jdk/javadoc/doclet/testVersionOption/TestVersionOption.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/langtools/test/jdk/javadoc/doclet/testVersionOption/TestVersionOption.java Thu Jul 20 09:38:13 2017 -0700 @@ -0,0 +1,58 @@ +/* + * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 8177048 + * @summary javadoc should support --version and --full-version flags + * @library ../lib + * @modules jdk.javadoc/jdk.javadoc.internal.tool + * @build JavadocTester TestVersionOption + * @run main TestVersionOption + */ + +public class TestVersionOption extends JavadocTester { + + public static void main(String... args) throws Exception { + TestVersionOption tester = new TestVersionOption(); + tester.runTests(); + } + + @Test + void testFullVersionOption() { + javadoc("--full-version"); + checkExit(Exit.OK); + + checkOutput(Output.OUT, true, "javadoc full version \"" + System.getProperty("java.runtime.version") + "\""); + } + + + @Test + void testVersionOption() { + javadoc("--version"); + checkExit(Exit.OK); + + checkOutput(Output.OUT, true, "javadoc " + System.getProperty("java.version")); + } + +} diff -r 3e7ed3a7da38 -r d2d3c06dde93 langtools/test/tools/javac/ExtraneousEquals.java --- a/langtools/test/tools/javac/ExtraneousEquals.java Mon Jul 17 09:13:49 2017 -0700 +++ b/langtools/test/tools/javac/ExtraneousEquals.java Thu Jul 20 09:38:13 2017 -0700 @@ -1,6 +1,6 @@ /* * @test /nodynamiccopyright/ - * @bug 5019614 + * @bug 5019614 8057647 * @summary variance prototype syntax leftover * * @compile/fail/ref=ExtraneousEquals.out -XDrawDiagnostics ExtraneousEquals.java diff -r 3e7ed3a7da38 -r d2d3c06dde93 langtools/test/tools/javac/ExtraneousEquals.out --- a/langtools/test/tools/javac/ExtraneousEquals.out Mon Jul 17 09:13:49 2017 -0700 +++ b/langtools/test/tools/javac/ExtraneousEquals.out Thu Jul 20 09:38:13 2017 -0700 @@ -1,6 +1,4 @@ ExtraneousEquals.java:10:23: compiler.err.illegal.start.of.expr ExtraneousEquals.java:10:24: compiler.err.illegal.start.of.expr -ExtraneousEquals.java:10:25: compiler.err.expected: ';' -ExtraneousEquals.java:10:28: compiler.err.not.stmt -ExtraneousEquals.java:10:29: compiler.err.expected: ';' -5 errors +ExtraneousEquals.java:10:26: compiler.err.illegal.array.creation.both.dimension.and.initialization +3 errors diff -r 3e7ed3a7da38 -r d2d3c06dde93 langtools/test/tools/javac/T8003967/DetectMutableStaticFields.java --- a/langtools/test/tools/javac/T8003967/DetectMutableStaticFields.java Mon Jul 17 09:13:49 2017 -0700 +++ b/langtools/test/tools/javac/T8003967/DetectMutableStaticFields.java Thu Jul 20 09:38:13 2017 -0700 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2006, 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 @@ -91,6 +91,7 @@ static { ignore("javax/tools/ToolProvider", "instance"); + ignore("jdk/javadoc/internal/tool/Start", "versionRB"); ignore("com/sun/tools/javah/JavahTask", "versionRB"); ignore("com/sun/tools/classfile/Dependencies$DefaultFilter", "instance"); ignore("com/sun/tools/javap/JavapTask", "versionRB"); diff -r 3e7ed3a7da38 -r d2d3c06dde93 langtools/test/tools/javac/diags/examples/IllegalArrayCreation.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/langtools/test/tools/javac/diags/examples/IllegalArrayCreation.java Thu Jul 20 09:38:13 2017 -0700 @@ -0,0 +1,28 @@ +/* + * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +// key: compiler.err.illegal.array.creation.both.dimension.and.initialization + +class IllegalArrayCreation { + int[] foo = new int[10] { 1, 2, 3 }; +} diff -r 3e7ed3a7da38 -r d2d3c06dde93 langtools/test/tools/javac/modules/BrokenModulesTest.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/langtools/test/tools/javac/modules/BrokenModulesTest.java Thu Jul 20 09:38:13 2017 -0700 @@ -0,0 +1,110 @@ +/* + * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 8182450 + * @summary Test model behavior when a completing a broken module-info. + * @library /tools/lib + * @modules + * jdk.compiler/com.sun.tools.javac.api + * jdk.compiler/com.sun.tools.javac.code + * jdk.compiler/com.sun.tools.javac.main + * jdk.compiler/com.sun.tools.javac.processing + * @build toolbox.ToolBox toolbox.JavacTask toolbox.ModuleBuilder ModuleTestBase + * @run main BrokenModulesTest + */ + +import java.nio.file.Path; +import java.util.List; + +import javax.tools.JavaCompiler; +import javax.tools.ToolProvider; + +import com.sun.tools.javac.api.JavacTaskImpl; + +public class BrokenModulesTest extends ModuleTestBase { + + public static void main(String... args) throws Exception { + new BrokenModulesTest().runTests(); + } + + List jlObjectList = List.of("java.lang.Object"); + JavaCompiler compiler = ToolProvider.getSystemJavaCompiler(); + + @Test + public void testBrokenModuleInfoModuleSourcePath(Path base) throws Exception { + Path msp = base.resolve("msp"); + Path ma = msp.resolve("ma"); + tb.writeJavaFiles(ma, + "module ma { requires not.available; exports api1; }", + "package api1; public interface Api { }"); + Path out = base.resolve("out"); + tb.createDirectories(out); + + List opts = List.of("--module-source-path", msp.toString(), + "--add-modules", "ma"); + JavacTaskImpl task = (JavacTaskImpl) compiler.getTask(null, null, null, opts, jlObjectList, null); + + task.enter(); + + task.getElements().getModuleElement("java.base"); + } + + @Test + public void testSystem(Path base) throws Exception { + Path jdkCompiler = base.resolve("jdk.compiler"); + tb.writeJavaFiles(jdkCompiler, + "module jdk.compiler { requires not.available; }"); + Path out = base.resolve("out"); + tb.createDirectories(out); + + List opts = List.of("--patch-module", "jdk.compiler=" + jdkCompiler.toString(), + "--add-modules", "jdk.compiler"); + JavacTaskImpl task = (JavacTaskImpl) compiler.getTask(null, null, null, opts, jlObjectList, null); + + task.enter(); + + task.getElements().getModuleElement("java.base"); + } + + @Test + public void testParseError(Path base) throws Exception { + Path msp = base.resolve("msp"); + Path ma = msp.resolve("ma"); + tb.writeJavaFiles(ma, + "broken module ma { }", + "package api1; public interface Api { }"); + Path out = base.resolve("out"); + tb.createDirectories(out); + + List opts = List.of("--module-source-path", msp.toString(), + "--add-modules", "ma"); + JavacTaskImpl task = (JavacTaskImpl) compiler.getTask(null, null, null, opts, jlObjectList, null); + + task.analyze(); + + task.getElements().getModuleElement("java.base"); + } + +} diff -r 3e7ed3a7da38 -r d2d3c06dde93 langtools/test/tools/javac/modules/EdgeCases.java --- a/langtools/test/tools/javac/modules/EdgeCases.java Mon Jul 17 09:13:49 2017 -0700 +++ b/langtools/test/tools/javac/modules/EdgeCases.java Thu Jul 20 09:38:13 2017 -0700 @@ -467,7 +467,8 @@ List expected = Arrays.asList( "- compiler.err.cant.access: m1x.module-info, (compiler.misc.bad.class.file.header: module-info.class, (compiler.misc.module.name.mismatch: other, m1x))", - "1 error"); + "module-info.java:1:1: compiler.err.module.not.found: m1x", + "2 errors"); if (!expected.equals(log)) { throw new AssertionError("Unexpected output: " + log); diff -r 3e7ed3a7da38 -r d2d3c06dde93 langtools/test/tools/javac/processing/model/completionfailure/NoAbortForBadClassFile.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/langtools/test/tools/javac/processing/model/completionfailure/NoAbortForBadClassFile.java Thu Jul 20 09:38:13 2017 -0700 @@ -0,0 +1,248 @@ +/* + * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/** + * @test + * @bug 8182450 + * @summary Bad classfiles should not abort compilations + * @library /tools/lib + * @modules + * jdk.compiler/com.sun.tools.javac.api + * jdk.compiler/com.sun.tools.javac.code + * jdk.compiler/com.sun.tools.javac.comp + * jdk.compiler/com.sun.tools.javac.jvm + * jdk.compiler/com.sun.tools.javac.main + * jdk.compiler/com.sun.tools.javac.processing + * jdk.compiler/com.sun.tools.javac.util + * @build toolbox.ToolBox toolbox.JavacTask + * @run main NoAbortForBadClassFile + */ + +import java.nio.file.Files; +import java.nio.file.Path; +import java.nio.file.Paths; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collections; +import java.util.List; +import java.util.stream.Collectors; +import java.util.stream.Stream; + +import com.sun.tools.javac.api.JavacTaskImpl; +import com.sun.tools.javac.api.JavacTool; +import com.sun.tools.javac.code.Flags; +import com.sun.tools.javac.code.Symbol.ClassSymbol; +import com.sun.tools.javac.code.Symbol.CompletionFailure; +import com.sun.tools.javac.code.Symtab; +import com.sun.tools.javac.jvm.ClassReader; +import com.sun.tools.javac.util.Context; +import com.sun.tools.javac.util.Context.Factory; +import com.sun.tools.javac.util.Names; +import com.sun.tools.javac.util.Options; +import toolbox.Task; +import toolbox.Task.Expect; + +import toolbox.TestRunner; +import toolbox.ToolBox; + +public class NoAbortForBadClassFile extends TestRunner { + + private ToolBox tb = new ToolBox(); + + public NoAbortForBadClassFile() { + super(System.out); + } + + public static void main(String... args) throws Exception { + new NoAbortForBadClassFile().runTests(m -> new Object[] { Paths.get(m.getName()) }); + } + + @Test + public void testBrokenClassFile(Path base) throws Exception { + Path classes = base.resolve("classes"); + Path brokenClassFile = classes.resolve("test").resolve("Broken.class"); + + Files.createDirectories(brokenClassFile.getParent()); + Files.newOutputStream(brokenClassFile).close(); + + Path src = base.resolve("src"); + tb.writeJavaFiles(src, + "package test; public class Test { private void test() { Broken b; String.unknown(); } }"); + Path out = base.resolve("out"); + tb.createDirectories(out); + + List log = new toolbox.JavacTask(tb) + .options("-classpath", classes.toString(), + "-XDrawDiagnostics") + .outdir(out) + .files(tb.findJavaFiles(src)) + .run(Expect.FAIL) + .writeAll() + .getOutputLines(Task.OutputKind.DIRECT); + + List expectedOut = Arrays.asList( + "Test.java:1:57: compiler.err.cant.access: test.Broken, (compiler.misc.bad.class.file.header: Broken.class, (compiler.misc.class.file.wrong.class: java.lang.AutoCloseable))", + "Test.java:1:73: compiler.err.cant.resolve.location.args: kindname.method, unknown, , , (compiler.misc.location: kindname.class, java.lang.String, null)", + "2 errors" + ); + + if (!expectedOut.equals(log)) + throw new Exception("expected output not found: " + log); + } + + @Test + public void testLoading(Path base) throws Exception { + Path src = base.resolve("src"); + tb.writeJavaFiles(src, + "public class Test { static { new Object() {}; } public static class I { public static class II { } } }"); + Path out = base.resolve("out"); + tb.createDirectories(out); + + new toolbox.JavacTask(tb) + .outdir(out) + .files(tb.findJavaFiles(src)) + .run(Expect.SUCCESS) + .writeAll() + .getOutputLines(Task.OutputKind.DIRECT); + + List files; + try (Stream dir = Files.list(out)) { + files = dir.collect(Collectors.toList()); + } + + List> result = new ArrayList<>(); + + permutations(files, Collections.emptyList(), result); + + for (List order : result) { + for (Path missing : order) { + Path test = base.resolve("test"); + + if (Files.exists(test)) { + tb.cleanDirectory(test); + } else { + tb.createDirectories(test); + } + + for (Path p : order) { + Files.copy(p, test.resolve(p.getFileName())); + } + + List actual = complete(test, order, missing, true); + + Files.delete(test.resolve(missing.getFileName())); + + List expected = complete(test, order, missing, false); + + if (!actual.equals(expected)) { + throw new AssertionError("Unexpected state, actual=\n" + actual + "\nexpected=\n" + expected + "\norder=" + order + "\nmissing=" + missing); + } + } + } + } + + private static void permutations(List todo, List currentList, List> result) { + if (todo.isEmpty()) { + result.add(currentList); + return ; + } + + for (Path p : todo) { + List nextTODO = new ArrayList<>(todo); + + nextTODO.remove(p); + + List nextList = new ArrayList<>(currentList); + + nextList.add(p); + + permutations(nextTODO, nextList, result); + } + } + + private List complete(Path test, List order, Path missing, boolean badClassFile) { + Context context = new Context(); + if (badClassFile) { + TestClassReader.preRegister(context); + } + JavacTool tool = JavacTool.create(); + JavacTaskImpl task = (JavacTaskImpl) tool.getTask(null, null, null, List.of("-classpath", test.toString(), "-XDblockClass=" + flatName(missing)), null, null, context); + Symtab syms = Symtab.instance(context); + Names names = Names.instance(context); + + task.getElements().getTypeElement("java.lang.Object"); + + if (!badClassFile) { + //to ensure the same paths taken in ClassFinder.completeEnclosing in case the file is missing: + syms.enterClass(syms.unnamedModule, names.fromString(flatName(missing))); + } + + List result = new ArrayList<>(); + + for (Path toCheck : order) { + ClassSymbol sym = syms.enterClass(syms.unnamedModule, names.fromString(flatName(toCheck))); + + try { + sym.complete(); + } catch (CompletionFailure ignore) { + } + + long flags = sym.flags_field; + + flags &= ~(Flags.CLASS_SEEN | Flags.SOURCE_SEEN); + + result.add("sym: " + sym.flatname + ", " + sym.owner.flatName() + + ", " + sym.type + ", " + sym.members_field + ", " + flags); + } + + return result; + } + + private String flatName(Path p) { + return p.getFileName().toString().replace(".class", ""); + } + + private static class TestClassReader extends ClassReader { + public static void preRegister(Context ctx) { + ctx.put(classReaderKey, (Factory) c -> new TestClassReader(ctx)); + } + + private final String block; + + public TestClassReader(Context context) { + super(context); + block = Options.instance(context).get("blockClass"); + } + + @Override + public void readClassFile(ClassSymbol c) { + super.readClassFile(c); + + if (c.flatname.contentEquals(block)) { + throw badClassFile("blocked"); + } + } + + } + +} diff -r 3e7ed3a7da38 -r d2d3c06dde93 nashorn/.hgtags --- a/nashorn/.hgtags Mon Jul 17 09:13:49 2017 -0700 +++ b/nashorn/.hgtags Thu Jul 20 09:38:13 2017 -0700 @@ -426,3 +426,4 @@ fed3f329875710c74f3ec1a0c4714046a79af100 jdk-10+14 3c6fbdf6e785aaf18d35ce9c6684369952fd22ec jdk-9+176 aa7404e062b95f679018f25eaaf933dcf0cf3f2b jdk-9+177 +f8a0c4895b2abe64a8c55af6117ffda192e34d30 jdk-10+15 diff -r 3e7ed3a7da38 -r d2d3c06dde93 nashorn/samples/barchart_weather.js --- a/nashorn/samples/barchart_weather.js Mon Jul 17 09:13:49 2017 -0700 +++ b/nashorn/samples/barchart_weather.js Thu Jul 20 09:38:13 2017 -0700 @@ -60,7 +60,7 @@ } // change URL for your city here! -var url = "http://api.openweathermap.org/data/2.5/forecast?q=chennai,india&units=metric&mode=json"; +var url = "http://api.openweathermap.org/data/2.5/forecast?q=chennai,india&units=metric&mode=json&appid=9b2982987c080ae88d81f081dcb129e8"; // download JSON document and parse var json = readTextFromURL(url); diff -r 3e7ed3a7da38 -r d2d3c06dde93 nashorn/samples/datepick.js --- a/nashorn/samples/datepick.js Mon Jul 17 09:13:49 2017 -0700 +++ b/nashorn/samples/datepick.js Thu Jul 20 09:38:13 2017 -0700 @@ -37,6 +37,7 @@ } load("fx:controls.js"); +var Scene = Java.type("javafx.scene.Scene"); function start(stage) { var picker = new DatePicker(); diff -r 3e7ed3a7da38 -r d2d3c06dde93 nashorn/samples/jsonviewer.js --- a/nashorn/samples/jsonviewer.js Mon Jul 17 09:13:49 2017 -0700 +++ b/nashorn/samples/jsonviewer.js Thu Jul 20 09:38:13 2017 -0700 @@ -103,7 +103,7 @@ return item; } -var DEFAULT_URL = "http://api.openweathermap.org/data/2.5/forecast/daily?q=Chennai&mode=json&units=metric&cnt=7`"; +var DEFAULT_URL = "http://api.openweathermap.org/data/2.5/forecast?q=chennai,india&units=metric&mode=json&appid=9b2982987c080ae88d81f081dcb129e8"; var url = arguments.length == 0? DEFAULT_URL : arguments[0]; var obj = JSON.parse(readTextFromURL(url)); diff -r 3e7ed3a7da38 -r d2d3c06dde93 test/lib/jdk/test/lib/Utils.java --- a/test/lib/jdk/test/lib/Utils.java Mon Jul 17 09:13:49 2017 -0700 +++ b/test/lib/jdk/test/lib/Utils.java Thu Jul 20 09:38:13 2017 -0700 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -680,5 +680,26 @@ String.format("A mandatory property '%s' isn't set", propName)); return prop; } + + /* + * Run uname with specified arguments. + */ + public static OutputAnalyzer uname(String... args) throws Throwable { + String[] cmds = new String[args.length + 1]; + cmds[0] = "uname"; + System.arraycopy(args, 0, cmds, 1, args.length); + return ProcessTools.executeCommand(cmds); + } + + /* + * Returns the system distro. + */ + public static String distro() { + try { + return uname("-v").asLines().get(0); + } catch (Throwable t) { + throw new RuntimeException("Failed to determine distro.", t); + } + } }
    Requires