Mercurial > hg > icedtea8-forest > jdk
changeset 14024:bfaa5c6df4a8 icedtea-3.12.0
Merge jdk8u212-b04
line wrap: on
line diff
--- a/.hgtags Wed Apr 17 03:47:21 2019 +0100 +++ b/.hgtags Thu Apr 18 03:46:32 2019 +0100 @@ -1031,6 +1031,11 @@ f0611120a4b7deae2219f72c5919712f1662ad9b jdk8u201-b77 21ffcdd4d850dd240338c211bbeecb79c38e5403 jdk8u201-b08 34ade0cd2dd5fd9adb24afddd24e6958c1f492d1 icedtea-3.11.0 +72a1a252527bb1ef9a67b7318411e117e7814e3e jdk8u201-b09 +c44a78b5e3c5c8f49901a251c0626f0134833ea4 jdk8u201-b79 +91c1f8b2df32a70763018d69b745639b6b94b393 jdk8u201-b25 +7ce5e345e1d26b459c54ede2aedc99e5afe45a5d jdk8u201-b26 +72a1a252527bb1ef9a67b7318411e117e7814e3e jdk8u201-ga 9da3ff5cd435240bc4941bc1c2ca170c567e012f jdk8u202-b01 478a4add975beb90696a4ead5f8fcd9c17fc1a83 jdk8u202-b02 03719dd7706173821b51f42b20ac3cb040696a56 jdk8u202-b03 @@ -1040,3 +1045,13 @@ eab55c31ad236f6c601deb5620dc029e9f1b9a72 jdk8u202-b07 d4f84e96821f181ad3fa643b491c71cbb75f9c3d icedtea-3.12.0pre01 34ade0cd2dd5fd9adb24afddd24e6958c1f492d1 icedtea-3.12.0pre00 +d10b8de706c1ea867abc5518dbb1cf92f6965f6a jdk8u202-b08 +96f7a4d6224a4cbf14c7ac54e39b7e35fee00c0c jdk8u202-b25 +4d01af1665277b6f5f5a6c9107f01bb6c1e0942d jdk8u202-b26 +d10b8de706c1ea867abc5518dbb1cf92f6965f6a jdk8u202-ga +478a4add975beb90696a4ead5f8fcd9c17fc1a83 jdk8u212-b00 +fcf246aa327f6384be94464b2c8aa0ef03af473d jdk8u212-b01 +acab6dbdd0b55e524d50e9b1c4f12c90e2f424c5 jdk8u212-b02 +ac2ef877d3e8062c1ce72757538daae6cad1118f jdk8u212-b03 +01535393e060f2908b8733f2493344b636d1c515 jdk8u212-b04 +ac2ef877d3e8062c1ce72757538daae6cad1118f jdk8u212-ga
--- a/THIRD_PARTY_README Wed Apr 17 03:47:21 2019 +0100 +++ b/THIRD_PARTY_README Thu Apr 18 03:46:32 2019 +0100 @@ -1096,33 +1096,6 @@ OF SUCH DAMAGE. --- end of LICENSE --- -%% This notice is provided with respect to FontConfig 2.5, which may be -included with JRE 8, JDK 8, and OpenJDK 8 source distributions on -Linux and Solaris. - ---- begin of LICENSE --- - -Copyright ?? 2001,2003 Keith Packard - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that the -above copyright notice appear in all copies and that both that copyright -notice and this permission notice appear in supporting documentation, and that -the name of Keith Packard not be used in advertising or publicity pertaining -to distribution of the software without specific, written prior permission. -Keith Packard makes no representations about the suitability of this software -for any purpose. It is provided "as is" without express or implied warranty. - -KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING -ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL KEITH -PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY -DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN -CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - - ---- end of LICENSE --- - ------------------------------------------------------------------------------- %% This notice is provided with respect to freebXML Registry 3.0 & 3.1,
--- a/make/CompileLaunchers.gmk Wed Apr 17 03:47:21 2019 +0100 +++ b/make/CompileLaunchers.gmk Thu Apr 18 03:46:32 2019 +0100 @@ -336,6 +336,16 @@ -DAPP_CLASSPATH='{ "/lib/tools.jar"$(COMMA) "/lib/sa-jdi.jar"$(COMMA) "/classes" }' \ ,,,,,,,,,Info-privileged.plist)) +$(eval $(call SetupLauncher,hsdb, \ + -DJAVA_ARGS='{ "-J-ms8m"$(COMMA) "sun.jvm.hotspot.HSDB"$(COMMA) }' \ + -DAPP_CLASSPATH='{ "/lib/tools.jar"$(COMMA) "/lib/sa-jdi.jar"$(COMMA) "/classes" }' \ + ,,,,,,,,,Info-privileged.plist)) + +$(eval $(call SetupLauncher,clhsdb, \ + -DJAVA_ARGS='{ "-J-ms8m"$(COMMA) "sun.jvm.hotspot.CLHSDB"$(COMMA) }' \ + -DAPP_CLASSPATH='{ "/lib/tools.jar"$(COMMA) "/lib/sa-jdi.jar"$(COMMA) "/classes" }' \ + ,,,,,,,,,Info-privileged.plist)) + $(eval $(call SetupLauncher,jstack, \ -DJAVA_ARGS='{ "-J-ms8m"$(COMMA) \ "-J-Dsun.jvm.hotspot.debugger.useProcDebugger"$(COMMA) \
--- a/make/data/characterdata/CharacterData00.java.template Wed Apr 17 03:47:21 2019 +0100 +++ b/make/data/characterdata/CharacterData00.java.template Thu Apr 18 03:46:32 2019 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2019, 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 @@ -105,11 +105,21 @@ } boolean isJavaIdentifierStart(int ch) { + // isJavaIdentifierStart strictly conforms to code points assigned + // in Unicode 6.2. Since code points {32FF} and {20BB..20BF} are not + // from Unicode 6.2, return false. + if(ch == 0x32FF || (ch>= 0x20BB && ch<= 0x20BF)) + return false; int props = getProperties(ch); return ((props & $$maskIdentifierInfo) >= $$lowJavaStart); } boolean isJavaIdentifierPart(int ch) { + // isJavaIdentifierPart strictly conforms to code points assigned + // in Unicode 6.2. Since code points {32FF} and {20BB..20BF} are not + // from Unicode 6.2, return false. + if(ch == 0x32FF || (ch>= 0x20BB && ch<= 0x20BF)) + return false; int props = getProperties(ch); return ((props & $$nonzeroJavaPart) != 0); }
--- a/make/data/unicodedata/UnicodeData.txt Wed Apr 17 03:47:21 2019 +0100 +++ b/make/data/unicodedata/UnicodeData.txt Thu Apr 18 03:46:32 2019 +0100 @@ -7191,6 +7191,11 @@ 20B8;TENGE SIGN;Sc;0;ET;;;;;N;;;;; 20B9;INDIAN RUPEE SIGN;Sc;0;ET;;;;;N;;;;; 20BA;TURKISH LIRA SIGN;Sc;0;ET;;;;;N;;;;; +20BB;NORDIC MARK SIGN;Sc;0;ET;;;;;N;;;;; +20BC;MANAT SIGN;Sc;0;ET;;;;;N;;;;; +20BD;RUBLE SIGN;Sc;0;ET;;;;;N;;;;; +20BE;LARI SIGN;Sc;0;ET;;;;;N;;;;; +20BF;BITCOIN SIGN;Sc;0;ET;;;;;N;;;;; 20D0;COMBINING LEFT HARPOON ABOVE;Mn;230;NSM;;;;;N;NON-SPACING LEFT HARPOON ABOVE;;;; 20D1;COMBINING RIGHT HARPOON ABOVE;Mn;230;NSM;;;;;N;NON-SPACING RIGHT HARPOON ABOVE;;;; 20D2;COMBINING LONG VERTICAL LINE OVERLAY;Mn;1;NSM;;;;;N;NON-SPACING LONG VERTICAL BAR OVERLAY;;;; @@ -11403,6 +11408,7 @@ 32FC;CIRCLED KATAKANA WI;So;0;L;<circle> 30F0;;;;N;;;;; 32FD;CIRCLED KATAKANA WE;So;0;L;<circle> 30F1;;;;N;;;;; 32FE;CIRCLED KATAKANA WO;So;0;L;<circle> 30F2;;;;N;;;;; +32FF;SQUARE ERA NAME REIWA;So;0;L;<square> 4EE4 548C;;;;N;SQUARED TWO IDEOGRAPHS ERA NAME REIWA;;;; 3300;SQUARE APAATO;So;0;L;<square> 30A2 30D1 30FC 30C8;;;;N;SQUARED APAATO;;;; 3301;SQUARE ARUHUA;So;0;L;<square> 30A2 30EB 30D5 30A1;;;;N;SQUARED ARUHUA;;;; 3302;SQUARE ANPEA;So;0;L;<square> 30A2 30F3 30DA 30A2;;;;N;SQUARED ANPEA;;;;
--- a/make/lib/Awt2dLibraries.gmk Wed Apr 17 03:47:21 2019 +0100 +++ b/make/lib/Awt2dLibraries.gmk Thu Apr 18 03:46:32 2019 +0100 @@ -528,6 +528,7 @@ LIBAWT_XAWT_CFLAGS := -DXAWT -DXAWT_HACK \ -DPACKAGE_PATH=\"$(PACKAGE_PATH)\" \ + $(FONTCONFIG_CFLAGS) \ $(CUPS_CFLAGS) \ $(foreach dir, $(LIBAWT_XAWT_DIRS), -I$(dir)) \ -I$(JDK_TOPDIR)/src/share/native/sun/java2d \ @@ -805,6 +806,7 @@ LIBAWT_HEADLESS_CFLAGS := -DHEADLESS=true \ -DPACKAGE_PATH=\"$(PACKAGE_PATH)\" \ $(CUPS_CFLAGS) \ + $(FONTCONFIG_CFLAGS) \ $(X_CFLAGS) \ -I$(JDK_TOPDIR)/src/share/native/sun/java2d \ -I$(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/java2d \
--- a/make/lib/CoreLibraries.gmk Wed Apr 17 03:47:21 2019 +0100 +++ b/make/lib/CoreLibraries.gmk Thu Apr 18 03:46:32 2019 +0100 @@ -1,5 +1,5 @@ # -# Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2011, 2019, 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 @@ -176,7 +176,8 @@ LIBJAVA_CFLAGS += -DJDK_MAJOR_VERSION='"$(JDK_MAJOR_VERSION)"' \ -DJDK_MINOR_VERSION='"$(JDK_MINOR_VERSION)"' \ -DJDK_MICRO_VERSION='"$(JDK_MICRO_VERSION)"' \ - -DJDK_BUILD_NUMBER='"$(JDK_BUILD_NUMBER)"' + -DJDK_BUILD_NUMBER='"$(JDK_BUILD_NUMBER)"' \ + $(VERSION_CFLAGS) ifneq (, $(JDK_UPDATE_VERSION)) LIBJAVA_CFLAGS += -DJDK_UPDATE_VERSION='"$(JDK_UPDATE_VERSION)"'
--- a/make/src/classes/build/tools/cldrconverter/CalendarType.java Wed Apr 17 03:47:21 2019 +0100 +++ b/make/src/classes/build/tools/cldrconverter/CalendarType.java Thu Apr 18 03:46:32 2019 +0100 @@ -38,7 +38,7 @@ // start index, array length {0, 2}, // gregorian {0, 1}, // buddhist - {232, 4}, // japanese (eras from Meiji) + {232, 5}, // japanese (eras from Meiji) {0, 2}, // roc (Minguo) {0, 1}, // islamic (Hijrah) {0, 1}, // islamicc (same as islamic)
--- a/src/aix/porting/porting_aix.c Wed Apr 17 03:47:21 2019 +0100 +++ b/src/aix/porting/porting_aix.c Thu Apr 18 03:46:32 2019 +0100 @@ -1,10 +1,12 @@ /* - * Copyright 2012, 2013 SAP AG. All rights reserved. + * Copyright (c) 2012, 2018 SAP SE. 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. + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
--- a/src/aix/porting/porting_aix.h Wed Apr 17 03:47:21 2019 +0100 +++ b/src/aix/porting/porting_aix.h Thu Apr 18 03:46:32 2019 +0100 @@ -1,10 +1,12 @@ /* - * Copyright 2012, 2013 SAP AG. All rights reserved. + * Copyright (c) 2012, 2018 SAP SE. 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. + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
--- a/src/macosx/classes/sun/lwawt/macosx/CPlatformWindow.java Wed Apr 17 03:47:21 2019 +0100 +++ b/src/macosx/classes/sun/lwawt/macosx/CPlatformWindow.java Thu Apr 18 03:46:32 2019 +0100 @@ -1131,27 +1131,18 @@ } private void orderAboveSiblings() { + // Recursively pop up the windows from the very bottom, (i.e. root owner) so that + // the windows are ordered above their nearest owner; ancestors of the window, + // which is going to become 'main window', are placed above their siblings. CPlatformWindow rootOwner = getRootOwner(); + if (rootOwner.isVisible() && !rootOwner.isIconified() && !rootOwner.isActive()) { + rootOwner.execute(CWrapper.NSWindow::orderFront); + } // Do not order child windows of iconified owner. if (!rootOwner.isIconified()) { final WindowAccessor windowAccessor = AWTAccessor.getWindowAccessor(); - Window[] windows = windowAccessor.getOwnedWindows(rootOwner.target); - - // No need to order windows if it doesn't own other windows and hence return - if (windows.length == 0) { - return; - } - - // Recursively pop up the windows from the very bottom, (i.e. root owner) so that - // the windows are ordered above their nearest owner; ancestors of the window, - // which is going to become 'main window', are placed above their siblings. - if (rootOwner.isVisible()) { - rootOwner.execute(CWrapper.NSWindow::orderFront); - } - - // Order child windows. - orderAboveSiblingsImpl(windows); + orderAboveSiblingsImpl(windowAccessor.getOwnedWindows(rootOwner.target)); } }
--- a/src/share/back/debugInit.c Wed Apr 17 03:47:21 2019 +0100 +++ b/src/share/back/debugInit.c Thu Apr 18 03:46:32 2019 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2018, 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 @@ -665,7 +665,7 @@ (void)snprintf(buf, sizeof(buf), "JDWP %s, jvmtiError=%s(%d)", msg, jvmtiErrorText(error), error); } else { - (void)snprintf(buf, sizeof(buf), "JDWP %s", buf); + (void)snprintf(buf, sizeof(buf), "JDWP %s", msg); } if (env != NULL) { (*((*env)->FatalError))(env, buf);
--- a/src/share/classes/com/sun/jarsigner/package-info.java Wed Apr 17 03:47:21 2019 +0100 +++ b/src/share/classes/com/sun/jarsigner/package-info.java Thu Apr 18 03:46:32 2019 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2019, 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,9 +24,9 @@ */ /** * This package comprises the interfaces and classes used to define the - * signing mechanism used by the <tt>jarsigner</tt> tool. + * signing mechanism used by the {@code jarsigner} tool. * <p> - * Clients may override the default signing mechanism of the <tt>jarsigner</tt> + * Clients may override the default signing mechanism of the {@code jarsigner} * tool by supplying an alternative implementation of * {@link com.sun.jarsigner.ContentSigner}. */
--- a/src/share/classes/com/sun/org/apache/xml/internal/security/encryption/AgreementMethod.java Wed Apr 17 03:47:21 2019 +0100 +++ b/src/share/classes/com/sun/org/apache/xml/internal/security/encryption/AgreementMethod.java Thu Apr 18 03:46:32 2019 +0100 @@ -31,38 +31,38 @@ * based on a shared secret computed from certain types of compatible public * keys from both the sender and the recipient. Information from the originator * to determine the secret is indicated by an optional OriginatorKeyInfo - * parameter child of an <code>AgreementMethod</code> element while that + * parameter child of an {@code AgreementMethod} element while that * associated with the recipient is indicated by an optional RecipientKeyInfo. A * shared key is derived from this shared secret by a method determined by the * Key Agreement algorithm. * <p> * <b>Note:</b> XML Encryption does not provide an on-line key agreement - * negotiation protocol. The <code>AgreementMethod</code> element can be used by + * negotiation protocol. The {@code AgreementMethod} element can be used by * the originator to identify the keys and computational procedure that were * used to obtain a shared encryption key. The method used to obtain or select * the keys or algorithm used for the agreement computation is beyond the scope * of this specification. * <p> - * The <code>AgreementMethod</code> element appears as the content of a - * <code>ds:KeyInfo</code> since, like other <code>ds:KeyInfo</code> children, - * it yields a key. This <code>ds:KeyInfo</code> is in turn a child of an - * <code>EncryptedData</code> or <code>EncryptedKey</code> element. The - * Algorithm attribute and KeySize child of the <code>EncryptionMethod</code> - * element under this <code>EncryptedData</code> or <code>EncryptedKey</code> + * The {@code AgreementMethod} element appears as the content of a + * {@code ds:KeyInfo} since, like other {@code ds:KeyInfo} children, + * it yields a key. This {@code ds:KeyInfo} is in turn a child of an + * {@code EncryptedData} or {@code EncryptedKey} element. The + * Algorithm attribute and KeySize child of the {@code EncryptionMethod} + * element under this {@code EncryptedData} or {@code EncryptedKey} * element are implicit parameters to the key agreement computation. In cases - * where this <code>EncryptionMethod</code> algorithm <code>URI</code> is + * where this {@code EncryptionMethod} algorithm {@code URI} is * insufficient to determine the key length, a KeySize MUST have been included. * In addition, the sender may place a KA-Nonce element under - * <code>AgreementMethod</code> to assure that different keying material is + * {@code AgreementMethod} to assure that different keying material is * generated even for repeated agreements using the same sender and recipient * public keys. * <p> * If the agreed key is being used to wrap a key, then - * <code>AgreementMethod</code> would appear inside a <code>ds:KeyInfo</code> - * inside an <code>EncryptedKey</code> element. + * {@code AgreementMethod} would appear inside a {@code ds:KeyInfo} + * inside an {@code EncryptedKey} element. * <p> * The Schema for AgreementMethod is as follows: - * <xmp> + * <pre>{@code * <element name="AgreementMethod" type="xenc:AgreementMethodType"/> * <complexType name="AgreementMethodType" mixed="true"> * <sequence> @@ -74,15 +74,15 @@ * </sequence> * <attribute name="Algorithm" type="anyURI" use="required"/> * </complexType> - * </xmp> + * }</pre> * * @author Axl Mattheus */ public interface AgreementMethod { /** - * Returns a <code>byte</code> array. - * @return a <code>byte</code> array. + * Returns a {@code byte} array. + * @return a {@code byte} array. */ byte[] getKANonce(); @@ -93,30 +93,30 @@ void setKANonce(byte[] kanonce); /** - * Returns additional information regarding the <code>AgreementMethod</code>. - * @return additional information regarding the <code>AgreementMethod</code>. + * Returns additional information regarding the {@code AgreementMethod}. + * @return additional information regarding the {@code AgreementMethod}. */ Iterator<Element> getAgreementMethodInformation(); /** - * Adds additional <code>AgreementMethod</code> information. + * Adds additional {@code AgreementMethod} information. * - * @param info a <code>Element</code> that represents additional information + * @param info a {@code Element} that represents additional information * specified by - * <xmp> + * <pre>{@code * <any namespace="##other" minOccurs="0" maxOccurs="unbounded"/> - * </xmp> + * }</pre> */ void addAgreementMethodInformation(Element info); /** - * Removes additional <code>AgreementMethod</code> information. + * Removes additional {@code AgreementMethod} information. * - * @param info a <code>Element</code> that represents additional information + * @param info a {@code Element} that represents additional information * specified by - * <xmp> + * <pre>{@code * <any namespace="##other" minOccurs="0" maxOccurs="unbounded"/> - * </xmp> + * }</pre> */ void revoveAgreementMethodInformation(Element info); @@ -149,9 +149,9 @@ void setRecipientKeyInfo(KeyInfo keyInfo); /** - * Returns the algorithm URI of this <code>CryptographicMethod</code>. + * Returns the algorithm URI of this {@code CryptographicMethod}. * - * @return the algorithm URI of this <code>CryptographicMethod</code> + * @return the algorithm URI of this {@code CryptographicMethod} */ String getAlgorithm(); }
--- a/src/share/classes/com/sun/org/apache/xml/internal/security/encryption/CipherData.java Wed Apr 17 03:47:21 2019 +0100 +++ b/src/share/classes/com/sun/org/apache/xml/internal/security/encryption/CipherData.java Thu Apr 18 03:46:32 2019 +0100 @@ -23,14 +23,14 @@ package com.sun.org.apache.xml.internal.security.encryption; /** - * <code>CipherData</code> provides encrypted data. It must either contain the + * {@code CipherData} provides encrypted data. It must either contain the * encrypted octet sequence as base64 encoded text of the - * <code>CipherValue</code> element, or provide a reference to an external + * {@code CipherValue} element, or provide a reference to an external * location containing the encrypted octet sequence via the - * <code>CipherReference</code> element. + * {@code CipherReference} element. * <p> * The schema definition is as follows: - * <xmp> + * <pre>{@code * <element name='CipherData' type='xenc:CipherDataType'/> * <complexType name='CipherDataType'> * <choice> @@ -38,7 +38,7 @@ * <element ref='xenc:CipherReference'/> * </choice> * </complexType> - * </xmp> + * }</pre> * * @author Axl Mattheus */ @@ -52,32 +52,32 @@ /** * Returns the type of encrypted data contained in the - * <code>CipherData</code>. + * {@code CipherData}. * - * @return <code>VALUE_TYPE</code> if the encrypted data is contained as - * <code>CipherValue</code> or <code>REFERENCE_TYPE</code> if the - * encrypted data is contained as <code>CipherReference</code>. + * @return {@code VALUE_TYPE} if the encrypted data is contained as + * {@code CipherValue} or {@code REFERENCE_TYPE} if the + * encrypted data is contained as {@code CipherReference}. */ int getDataType(); /** - * Returns the cipher value as a base64 encoded <code>byte</code> array. + * Returns the cipher value as a base64 encoded {@code byte} array. * - * @return the <code>CipherData</code>'s value. + * @return the {@code CipherData}'s value. */ CipherValue getCipherValue(); /** - * Sets the <code>CipherData</code>'s value. + * Sets the {@code CipherData}'s value. * - * @param value the value of the <code>CipherData</code>. + * @param value the value of the {@code CipherData}. * @throws XMLEncryptionException */ void setCipherValue(CipherValue value) throws XMLEncryptionException; /** * Returns a reference to an external location containing the encrypted - * octet sequence (<code>byte</code> array). + * octet sequence ({@code byte} array). * * @return the reference to an external location containing the encrypted * octet sequence. @@ -85,7 +85,7 @@ CipherReference getCipherReference(); /** - * Sets the <code>CipherData</code>'s reference. + * Sets the {@code CipherData}'s reference. * * @param reference an external location containing the encrypted octet sequence. * @throws XMLEncryptionException
--- a/src/share/classes/com/sun/org/apache/xml/internal/security/encryption/CipherReference.java Wed Apr 17 03:47:21 2019 +0100 +++ b/src/share/classes/com/sun/org/apache/xml/internal/security/encryption/CipherReference.java Thu Apr 18 03:46:32 2019 +0100 @@ -25,18 +25,18 @@ import org.w3c.dom.Attr; /** - * <code>CipherReference</code> identifies a source which, when processed, + * {@code CipherReference} identifies a source which, when processed, * yields the encrypted octet sequence. * <p> - * The actual value is obtained as follows. The <code>CipherReference URI</code> + * The actual value is obtained as follows. The {@code CipherReference URI} * contains an identifier that is dereferenced. Should the - * Transforms, the data resulting from dereferencing the <code>URI</code> is + * Transforms, the data resulting from dereferencing the {@code URI} is * transformed as specified so as to yield the intended cipher value. For * example, if the value is base64 encoded within an XML document; the * transforms could specify an XPath expression followed by a base64 decoding so * as to extract the octets. * <p> - * The syntax of the <code>URI</code> and Transforms is similar to that of + * The syntax of the {@code URI} and Transforms is similar to that of * [XML-DSIG]. However, there is a difference between signature and encryption * processing. In [XML-DSIG] both generation and validation processing start * with the same source data and perform that transform in the same order. In @@ -46,7 +46,7 @@ * the &xenc; namespace. * <p> * The schema definition is as follows: - * <xmp> + * <pre>{@code * <element name='CipherReference' type='xenc:CipherReferenceType'/> * <complexType name='CipherReferenceType'> * <sequence> @@ -54,15 +54,15 @@ * </sequence> * <attribute name='URI' type='anyURI' use='required'/> * </complexType> - * </xmp> + * }<pre> * * @author Axl Mattheus */ public interface CipherReference { /** - * Returns an <code>URI</code> that contains an identifier that should be + * Returns an {@code URI} that contains an identifier that should be * dereferenced. - * @return an <code>URI</code> that contains an identifier that should be + * @return an {@code URI} that contains an identifier that should be * dereferenced. */ String getURI(); @@ -75,8 +75,8 @@ Attr getURIAsAttr(); /** - * Returns the <code>Transforms</code> that specifies how to transform the - * <code>URI</code> to yield the appropriate cipher value. + * Returns the {@code Transforms} that specifies how to transform the + * {@code URI} to yield the appropriate cipher value. * * @return the transform that specifies how to transform the reference to * yield the intended cipher value. @@ -84,10 +84,10 @@ Transforms getTransforms(); /** - * Sets the <code>Transforms</code> that specifies how to transform the - * <code>URI</code> to yield the appropriate cipher value. + * Sets the {@code Transforms} that specifies how to transform the + * {@code URI} to yield the appropriate cipher value. * - * @param transforms the set of <code>Transforms</code> that specifies how + * @param transforms the set of {@code Transforms} that specifies how * to transform the reference to yield the intended cipher value. */ void setTransforms(Transforms transforms);
--- a/src/share/classes/com/sun/org/apache/xml/internal/security/encryption/EncryptedData.java Wed Apr 17 03:47:21 2019 +0100 +++ b/src/share/classes/com/sun/org/apache/xml/internal/security/encryption/EncryptedData.java Thu Apr 18 03:46:32 2019 +0100 @@ -23,21 +23,21 @@ package com.sun.org.apache.xml.internal.security.encryption; /** - * The <code>EncryptedData</code> element is the core element in the syntax. Not - * only does its <code>CipherData</code> child contain the encrypted data, but + * The {@code EncryptedData} element is the core element in the syntax. Not + * only does its {@code CipherData} child contain the encrypted data, but * it's also the element that replaces the encrypted element, or serves as the * new document root. * <p> * It's schema definition is as follows: * <p> - * <xmp> + * <pre>{@code * <element name='EncryptedData' type='xenc:EncryptedDataType'/> * <complexType name='EncryptedDataType'> * <complexContent> * <extension base='xenc:EncryptedType'/> * </complexContent> * </complexType> - * </xmp> + * }</pre> * * @author Axl Mattheus */
--- a/src/share/classes/com/sun/org/apache/xml/internal/security/encryption/EncryptedKey.java Wed Apr 17 03:47:21 2019 +0100 +++ b/src/share/classes/com/sun/org/apache/xml/internal/security/encryption/EncryptedKey.java Thu Apr 18 03:46:32 2019 +0100 @@ -23,17 +23,17 @@ package com.sun.org.apache.xml.internal.security.encryption; /** - * The <code>EncryptedKey</code> element is used to transport encryption keys + * The {@code EncryptedKey} element is used to transport encryption keys * from the originator to a known recipient(s). It may be used as a stand-alone * XML document, be placed within an application document, or appear inside an - * <code>EncryptedData</code> element as a child of a <code>ds:KeyInfo</code> + * {@code EncryptedData} element as a child of a {@code ds:KeyInfo} * element. The key value is always encrypted to the recipient(s). When - * <code>EncryptedKey</code> is decrypted the resulting octets are made - * available to the <code>EncryptionMethod</code> algorithm without any + * {@code EncryptedKey} is decrypted the resulting octets are made + * available to the {@code EncryptionMethod} algorithm without any * additional processing. * <p> * Its schema definition is as follows: - * <xmp> + * <pre>{@code * <element name='EncryptedKey' type='xenc:EncryptedKeyType'/> * <complexType name='EncryptedKeyType'> * <complexContent> @@ -46,7 +46,7 @@ * </extension> * </complexContent> * </complexType> - * </xmp> + * }</pre> * * @author Axl Mattheus */ @@ -55,31 +55,31 @@ /** * Returns a hint as to which recipient this encrypted key value is intended for. * - * @return the recipient of the <code>EncryptedKey</code>. + * @return the recipient of the {@code EncryptedKey}. */ String getRecipient(); /** - * Sets the recipient for this <code>EncryptedKey</code>. + * Sets the recipient for this {@code EncryptedKey}. * - * @param recipient the recipient for this <code>EncryptedKey</code>. + * @param recipient the recipient for this {@code EncryptedKey}. */ void setRecipient(String recipient); /** * Returns pointers to data and keys encrypted using this key. The reference - * list may contain multiple references to <code>EncryptedKey</code> and - * <code>EncryptedData</code> elements. This is done using - * <code>KeyReference</code> and <code>DataReference</code> elements + * list may contain multiple references to {@code EncryptedKey} and + * {@code EncryptedData} elements. This is done using + * {@code KeyReference} and {@code DataReference} elements * respectively. * - * @return an <code>Iterator</code> over all the <code>ReferenceList</code>s - * contained in this <code>EncryptedKey</code>. + * @return an {@code Iterator} over all the {@code ReferenceList}s + * contained in this {@code EncryptedKey}. */ ReferenceList getReferenceList(); /** - * Sets the <code>ReferenceList</code> to the <code>EncryptedKey</code>. + * Sets the {@code ReferenceList} to the {@code EncryptedKey}. * * @param list a list of pointers to data elements encrypted using this key. */ @@ -87,19 +87,19 @@ /** * Returns a user readable name with the key value. This may then be used to - * reference the key using the <code>ds:KeyName</code> element within - * <code>ds:KeyInfo</code>. The same <code>CarriedKeyName</code> label, + * reference the key using the {@code ds:KeyName} element within + * {@code ds:KeyInfo}. The same {@code CarriedKeyName} label, * unlike an ID type, may occur multiple times within a single document. The - * value of the key is to be the same in all <code>EncryptedKey</code> - * elements identified with the same <code>CarriedKeyName</code> label + * value of the key is to be the same in all {@code EncryptedKey} + * elements identified with the same {@code CarriedKeyName} label * within a single XML document. * <br> * <b>Note</b> that because whitespace is significant in the value of - * the <code>ds:KeyName</code> element, whitespace is also significant in - * the value of the <code>CarriedKeyName</code> element. + * the {@code ds:KeyName} element, whitespace is also significant in + * the value of the {@code CarriedKeyName} element. * * @return over all the carried names contained in - * this <code>EncryptedKey</code>. + * this {@code EncryptedKey}. */ String getCarriedName();
--- a/src/share/classes/com/sun/org/apache/xml/internal/security/encryption/EncryptedType.java Wed Apr 17 03:47:21 2019 +0100 +++ b/src/share/classes/com/sun/org/apache/xml/internal/security/encryption/EncryptedType.java Thu Apr 18 03:46:32 2019 +0100 @@ -25,13 +25,13 @@ import com.sun.org.apache.xml.internal.security.keys.KeyInfo; /** - * EncryptedType is the abstract type from which <code>EncryptedData</code> and - * <code>EncryptedKey</code> are derived. While these two latter element types + * EncryptedType is the abstract type from which {@code EncryptedData} and + * {@code EncryptedKey} are derived. While these two latter element types * are very similar with respect to their content models, a syntactical * distinction is useful to processing. * <p> * Its schema definition is as follows: - * <xmp> + * <pre>{@code * <complexType name='EncryptedType' abstract='true'> * <sequence> * <element name='EncryptionMethod' type='xenc:EncryptionMethodType' @@ -45,17 +45,17 @@ * <attribute name='MimeType' type='string' use='optional'/> * <attribute name='Encoding' type='anyURI' use='optional'/> * </complexType> - * </xmp> + * }</pre> * * @author Axl Mattheus */ public interface EncryptedType { /** - * Returns a <code>String</code> providing for the standard method of + * Returns a {@code String} providing for the standard method of * assigning an id to the element within the document context. * - * @return the id for the <code>EncryptedType</code>. + * @return the id for the {@code EncryptedType}. */ String getId(); @@ -67,11 +67,11 @@ void setId(String id); /** - * Returns an <code>URI</code> identifying type information about the + * Returns an {@code URI} identifying type information about the * plaintext form of the encrypted content. While optional, this * specification takes advantage of it for mandatory processing described in * Processing Rules: Decryption (section 4.2). If the - * <code>EncryptedData</code> element contains data of Type 'element' or + * {@code EncryptedData} element contains data of Type 'element' or * element 'content', and replaces that data in an XML document context, it * is strongly recommended the Type attribute be provided. Without this * information, the decryptor will be unable to automatically restore the @@ -85,13 +85,13 @@ /** * Sets the type. * - * @param type an <code>URI</code> identifying type information about the + * @param type an {@code URI} identifying type information about the * plaintext form of the encrypted content. */ void setType(String type); /** - * Returns a <code>String</code> which describes the media type of the data + * Returns a {@code String} which describes the media type of the data * which has been encrypted. The value of this attribute has values defined * by [MIME]. For example, if the data that is encrypted is a base64 encoded * PNG, the transfer Encoding may be specified as @@ -112,29 +112,29 @@ /** * Sets the mime type. * - * @param type a <code>String</code> which describes the media type of the + * @param type a {@code String} which describes the media type of the * data which has been encrypted. */ void setMimeType(String type); /** - * Return an <code>URI</code> representing the encoding of the - * <code>EncryptedType</code>. + * Return an {@code URI} representing the encoding of the + * {@code EncryptedType}. * - * @return the encoding of this <code>EncryptedType</code>. + * @return the encoding of this {@code EncryptedType}. */ String getEncoding(); /** - * Sets the <code>URI</code> representing the encoding of the - * <code>EncryptedType</code>. + * Sets the {@code URI} representing the encoding of the + * {@code EncryptedType}. * * @param encoding */ void setEncoding(String encoding); /** - * Returns an <code>EncryptionMethod</code> that describes the encryption + * Returns an {@code EncryptionMethod} that describes the encryption * algorithm applied to the cipher data. If the element is absent, the * encryption algorithm must be known by the recipient or the decryption * will fail. @@ -144,17 +144,17 @@ EncryptionMethod getEncryptionMethod(); /** - * Sets the <code>EncryptionMethod</code> used to encrypt the cipher data. + * Sets the {@code EncryptionMethod} used to encrypt the cipher data. * - * @param method the <code>EncryptionMethod</code>. + * @param method the {@code EncryptionMethod}. */ void setEncryptionMethod(EncryptionMethod method); /** - * Returns the <code>ds:KeyInfo</code>, that carries information about the + * Returns the {@code ds:KeyInfo}, that carries information about the * key used to encrypt the data. Subsequent sections of this specification * define new elements that may appear as children of - * <code>ds:KeyInfo</code>. + * {@code ds:KeyInfo}. * * @return information about the key that encrypted the cipher data. */ @@ -163,14 +163,14 @@ /** * Sets the encryption key information. * - * @param info the <code>ds:KeyInfo</code>, that carries information about + * @param info the {@code ds:KeyInfo}, that carries information about * the key used to encrypt the data. */ void setKeyInfo(KeyInfo info); /** - * Returns the <code>CipherReference</code> that contains the - * <code>CipherValue</code> or <code>CipherReference</code> with the + * Returns the {@code CipherReference} that contains the + * {@code CipherValue} or {@code CipherReference} with the * encrypted data. * * @return the cipher data for the encrypted type. @@ -179,16 +179,16 @@ /** * Returns additional information concerning the generation of the - * <code>EncryptedType</code>. + * {@code EncryptedType}. * * @return information relating to the generation of the - * <code>EncryptedType</code>. + * {@code EncryptedType}. */ EncryptionProperties getEncryptionProperties(); /** - * Sets the <code>EncryptionProperties</code> that supplies additional - * information about the generation of the <code>EncryptedType</code>. + * Sets the {@code EncryptionProperties} that supplies additional + * information about the generation of the {@code EncryptedType}. * * @param properties */
--- a/src/share/classes/com/sun/org/apache/xml/internal/security/encryption/EncryptionMethod.java Wed Apr 17 03:47:21 2019 +0100 +++ b/src/share/classes/com/sun/org/apache/xml/internal/security/encryption/EncryptionMethod.java Thu Apr 18 03:46:32 2019 +0100 @@ -26,12 +26,12 @@ import org.w3c.dom.Element; /** - * <code>EncryptionMethod</code> describes the encryption algorithm applied to + * {@code EncryptionMethod} describes the encryption algorithm applied to * the cipher data. If the element is absent, the encryption algorithm must be * known by the recipient or the decryption will fail. * <p> * It is defined as follows: - * <xmp> + * <pre>{@code * <complexType name='EncryptionMethodType' mixed='true'> * <sequence> * <element name='KeySize' minOccurs='0' type='xenc:KeySizeType'/> @@ -40,7 +40,7 @@ * </sequence> * <attribute name='Algorithm' type='anyURI' use='required'/> * </complexType> - * </xmp> + * }</pre> * * @author Axl Mattheus */ @@ -108,10 +108,10 @@ /** * Returns an iterator over all the additional elements contained in the - * <code>EncryptionMethod</code>. + * {@code EncryptionMethod}. * - * @return an <code>Iterator</code> over all the additional information - * about the <code>EncryptionMethod</code>. + * @return an {@code Iterator} over all the additional information + * about the {@code EncryptionMethod}. */ Iterator<Element> getEncryptionMethodInformation(); @@ -126,7 +126,7 @@ * Removes encryption method information. * * @param information the information to remove from the - * <code>EncryptionMethod</code>. + * {@code EncryptionMethod}. */ void removeEncryptionMethodInformation(Element information); }
--- a/src/share/classes/com/sun/org/apache/xml/internal/security/encryption/EncryptionProperties.java Wed Apr 17 03:47:21 2019 +0100 +++ b/src/share/classes/com/sun/org/apache/xml/internal/security/encryption/EncryptionProperties.java Thu Apr 18 03:46:32 2019 +0100 @@ -25,15 +25,15 @@ import java.util.Iterator; /** - * <code>EncryptionProperties</code> can hold additional information concerning - * the generation of the <code>EncryptedData</code> or - * <code>EncryptedKey</code>. This information is wraped int an - * <code>EncryptionProperty</code> element. Examples of additional information + * {@code EncryptionProperties} can hold additional information concerning + * the generation of the {@code EncryptedData} or + * {@code EncryptedKey}. This information is wraped int an + * {@code EncryptionProperty} element. Examples of additional information * is e.g., a date/time stamp or the serial number of cryptographic hardware * used during encryption). * <p> * It is defined as follows: - * <xmp> + * <pre>{@code * <element name='EncryptionProperties' type='xenc:EncryptionPropertiesType'/> * <complexType name='EncryptionPropertiesType'> * <sequence> @@ -41,14 +41,14 @@ * </sequence> * <attribute name='Id' type='ID' use='optional'/> * </complexType> - * </xmp> + * }</pre> * * @author Axl Mattheus */ public interface EncryptionProperties { /** - * Returns the <code>EncryptionProperties</code>' id. + * Returns the {@code EncryptionProperties}' id. * * @return the id. */ @@ -62,23 +62,23 @@ void setId(String id); /** - * Returns an <code>Iterator</code> over all the - * <code>EncryptionPropterty</code> elements contained in this - * <code>EncryptionProperties</code>. + * Returns an {@code Iterator} over all the + * {@code EncryptionPropterty} elements contained in this + * {@code EncryptionProperties}. * - * @return an <code>Iterator</code> over all the encryption properties. + * @return an {@code Iterator} over all the encryption properties. */ Iterator<EncryptionProperty> getEncryptionProperties(); /** - * Adds an <code>EncryptionProperty</code>. + * Adds an {@code EncryptionProperty}. * * @param property */ void addEncryptionProperty(EncryptionProperty property); /** - * Removes the specified <code>EncryptionProperty</code>. + * Removes the specified {@code EncryptionProperty}. * * @param property */
--- a/src/share/classes/com/sun/org/apache/xml/internal/security/encryption/EncryptionProperty.java Wed Apr 17 03:47:21 2019 +0100 +++ b/src/share/classes/com/sun/org/apache/xml/internal/security/encryption/EncryptionProperty.java Thu Apr 18 03:46:32 2019 +0100 @@ -27,16 +27,16 @@ /** * Additional information items concerning the generation of the - * <code>EncryptedData</code> or <code>EncryptedKey</code> can be placed in an - * <code>EncryptionProperty</code> element (e.g., date/time stamp or the serial + * {@code EncryptedData} or {@code EncryptedKey} can be placed in an + * {@code EncryptionProperty} element (e.g., date/time stamp or the serial * number of cryptographic hardware used during encryption). The Target - * attribute identifies the <code>EncryptedType</code> structure being + * attribute identifies the {@code EncryptedType} structure being * described. anyAttribute permits the inclusion of attributes from the XML - * namespace to be included (i.e., <code>xml:space</code>, - * <code>xml:lang</code>, and <code>xml:base</code>). + * namespace to be included (i.e., {@code xml:space}, + * {@code xml:lang}, and {@code xml:base}). * <p> * It is defined as follows: - * <xmp> + * <pre>{@code * <element name='EncryptionProperty' type='xenc:EncryptionPropertyType'/> * <complexType name='EncryptionPropertyType' mixed='true'> * <choice maxOccurs='unbounded'> @@ -46,17 +46,17 @@ * <attribute name='Id' type='ID' use='optional'/> * <anyAttribute namespace="http://www.w3.org/XML/1998/namespace"/> * </complexType> - * </xmp> + * }</pre> * * @author Axl Mattheus */ public interface EncryptionProperty { /** - * Returns the <code>EncryptedType</code> being described. + * Returns the {@code EncryptedType} being described. * - * @return the <code>EncryptedType</code> being described by this - * <code>EncryptionProperty</code>. + * @return the {@code EncryptedType} being described by this + * {@code EncryptionProperty}. */ String getTarget(); @@ -68,7 +68,7 @@ void setTarget(String target); /** - * Returns the id of the <CODE>EncryptionProperty</CODE>. + * Returns the id of the {@CODE EncryptionProperty}. * * @return the id. */ @@ -82,7 +82,7 @@ void setId(String id); /** - * Returns the attribute's value in the <code>xml</code> namespace. + * Returns the attribute's value in the {@code xml} namespace. * * @param attribute * @return the attribute's value. @@ -98,9 +98,9 @@ void setAttribute(String attribute, String value); /** - * Returns the properties of the <CODE>EncryptionProperty</CODE>. + * Returns the properties of the {@CODE EncryptionProperty}. * - * @return an <code>Iterator</code> over all the additional encryption + * @return an {@code Iterator} over all the additional encryption * information contained in this class. */ Iterator<Element> getEncryptionInformation();
--- a/src/share/classes/com/sun/org/apache/xml/internal/security/encryption/Reference.java Wed Apr 17 03:47:21 2019 +0100 +++ b/src/share/classes/com/sun/org/apache/xml/internal/security/encryption/Reference.java Thu Apr 18 03:46:32 2019 +0100 @@ -26,55 +26,55 @@ import org.w3c.dom.Element; /** - * A wrapper for a pointer from a key value of an <code>EncryptedKey</code> to - * items encrypted by that key value (<code>EncryptedData</code> or - * <code>EncryptedKey</code> elements). + * A wrapper for a pointer from a key value of an {@code EncryptedKey} to + * items encrypted by that key value ({@code EncryptedData} or + * {@code EncryptedKey} elements). * <p> * It is defined as follows: - * <xmp> + * <pre>{@code * <complexType name='ReferenceType'> * <sequence> * <any namespace='##other' minOccurs='0' maxOccurs='unbounded'/> * </sequence> * <attribute name='URI' type='anyURI' use='required'/> * </complexType> - * </xmp> + * }</pre> * * @author Axl Mattheus * @see ReferenceList */ public interface Reference { /** - * Returns the <code>Element</code> tag name for this <code>Reference</code>. + * Returns the {@code Element} tag name for this {@code Reference}. * - * @return the tag name of this <code>Reference</code>. + * @return the tag name of this {@code Reference}. */ String getType(); /** - * Returns a <code>URI</code> that points to an <code>Element</code> that + * Returns a {@code URI} that points to an {@code Element} that * were encrypted using the key defined in the enclosing - * <code>EncryptedKey</code> element. + * {@code EncryptedKey} element. * * @return an Uniform Resource Identifier that qualifies an - * <code>EncryptedType</code>. + * {@code EncryptedType}. */ String getURI(); /** - * Sets a <code>URI</code> that points to an <code>Element</code> that + * Sets a {@code URI} that points to an {@code Element} that * were encrypted using the key defined in the enclosing - * <code>EncryptedKey</code> element. + * {@code EncryptedKey} element. * * @param uri the Uniform Resource Identifier that qualifies an - * <code>EncryptedType</code>. + * {@code EncryptedType}. */ void setURI(String uri); /** - * Returns an <code>Iterator</code> over all the child elements contained in - * this <code>Reference</code> that will aid the recipient in retrieving the - * <code>EncryptedKey</code> and/or <code>EncryptedData</code> elements. + * Returns an {@code Iterator} over all the child elements contained in + * this {@code Reference} that will aid the recipient in retrieving the + * {@code EncryptedKey} and/or {@code EncryptedData} elements. * These could include information such as XPath transforms, decompression * transforms, or information on how to retrieve the elements from a * document storage facility.
--- a/src/share/classes/com/sun/org/apache/xml/internal/security/encryption/ReferenceList.java Wed Apr 17 03:47:21 2019 +0100 +++ b/src/share/classes/com/sun/org/apache/xml/internal/security/encryption/ReferenceList.java Thu Apr 18 03:46:32 2019 +0100 @@ -25,12 +25,12 @@ import java.util.Iterator; /** - * <code>ReferenceList</code> is an element that contains pointers from a key - * value of an <code>EncryptedKey</code> to items encrypted by that key value - * (<code>EncryptedData</code> or <code>EncryptedKey</code> elements). + * {@code ReferenceList} is an element that contains pointers from a key + * value of an {@code EncryptedKey} to items encrypted by that key value + * ({@code EncryptedData} or {@code EncryptedKey} elements). * <p> * It is defined as follows: - * <xmp> + * <pre>{@code * <element name='ReferenceList'> * <complexType> * <choice minOccurs='1' maxOccurs='unbounded'> @@ -39,7 +39,7 @@ * </choice> * </complexType> * </element> - * </xmp> + * }</pre> * * @author Axl Mattheus * @see Reference @@ -56,54 +56,54 @@ * Adds a reference to this reference list. * * @param reference the reference to add. - * @throws IllegalAccessException if the <code>Reference</code> is not an - * instance of <code>DataReference</code> or <code>KeyReference</code>. + * @throws IllegalAccessException if the {@code Reference} is not an + * instance of {@code DataReference} or {@code KeyReference}. */ void add(Reference reference); /** - * Removes a reference from the <code>ReferenceList</code>. + * Removes a reference from the {@code ReferenceList}. * * @param reference the reference to remove. */ void remove(Reference reference); /** - * Returns the size of the <code>ReferenceList</code>. + * Returns the size of the {@code ReferenceList}. * - * @return the size of the <code>ReferenceList</code>. + * @return the size of the {@code ReferenceList}. */ int size(); /** - * Indicates if the <code>ReferenceList</code> is empty. + * Indicates if the {@code ReferenceList} is empty. * - * @return <code><b>true</b></code> if the <code>ReferenceList</code> is - * empty, else <code><b>false</b></code>. + * @return {@code <b>true</b>} if the {@code ReferenceList} is + * empty, else {@code <b>false</b>}. */ boolean isEmpty(); /** - * Returns an <code>Iterator</code> over all the <code>Reference</code>s - * contained in this <code>ReferenceList</code>. + * Returns an {@code Iterator} over all the {@code Reference}s + * contained in this {@code ReferenceList}. * * @return Iterator. */ Iterator<Reference> getReferences(); /** - * <code>DataReference</code> factory method. Returns a - * <code>DataReference</code>. + * {@code DataReference} factory method. Returns a + * {@code DataReference}. * @param uri - * @return a <code>DataReference</code>. + * @return a {@code DataReference}. */ Reference newDataReference(String uri); /** - * <code>KeyReference</code> factory method. Returns a - * <code>KeyReference</code>. + * {@code KeyReference} factory method. Returns a + * {@code KeyReference}. * @param uri - * @return a <code>KeyReference</code>. + * @return a {@code KeyReference}. */ Reference newKeyReference(String uri); }
--- a/src/share/classes/com/sun/org/apache/xml/internal/security/encryption/Transforms.java Wed Apr 17 03:47:21 2019 +0100 +++ b/src/share/classes/com/sun/org/apache/xml/internal/security/encryption/Transforms.java Thu Apr 18 03:46:32 2019 +0100 @@ -23,16 +23,16 @@ package com.sun.org.apache.xml.internal.security.encryption; /** - * A container for <code>ds:Transform</code>s. + * A container for {@code ds:Transform}s. * <p> * It is defined as follows: - * <xmp> + * <pre>{@code * <complexType name='TransformsType'> * <sequence> * <element ref='ds:Transform' maxOccurs='unbounded'/> * </sequence> * </complexType> - * </xmp> + * }</pre> * * @author Axl Mattheus * @see com.sun.org.apache.xml.internal.security.encryption.CipherReference
--- a/src/share/classes/com/sun/security/sasl/CramMD5Base.java Wed Apr 17 03:47:21 2019 +0100 +++ b/src/share/classes/com/sun/security/sasl/CramMD5Base.java Thu Apr 18 03:46:32 2019 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2019, 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 @@ -103,8 +103,8 @@ /** * Retrieves the negotiated property. * This method can be called only after the authentication exchange has - * completed (i.e., when <tt>isComplete()</tt> returns true); otherwise, a - * <tt>SaslException</tt> is thrown. + * completed (i.e., when {@codeisComplete()} returns true); otherwise, a + * {@codeSaslException} is thrown. * * @return value of property; only QOP is applicable to CRAM-MD5. * @exception IllegalStateException if this authentication exchange has not completed
--- a/src/share/classes/com/sun/security/sasl/ExternalClient.java Wed Apr 17 03:47:21 2019 +0100 +++ b/src/share/classes/com/sun/security/sasl/ExternalClient.java Thu Apr 18 03:46:32 2019 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2019, 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 @@ -141,8 +141,8 @@ /** * Retrieves the negotiated property. * This method can be called only after the authentication exchange has - * completed (i.e., when <tt>isComplete()</tt> returns true); otherwise, a - * <tt>IllegalStateException</tt> is thrown. + * completed (i.e., when {@code isComplete()} returns true); otherwise, a + * {@code IllegalStateException} is thrown. * * @return null No property is applicable to this mechanism. * @exception IllegalStateException if this authentication exchange
--- a/src/share/classes/com/sun/security/sasl/PlainClient.java Wed Apr 17 03:47:21 2019 +0100 +++ b/src/share/classes/com/sun/security/sasl/PlainClient.java Thu Apr 18 03:46:32 2019 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2019, 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 @@ /** * Retrieves the negotiated property. * This method can be called only after the authentication exchange has - * completed (i.e., when <tt>isComplete()</tt> returns true); otherwise, a - * <tt>SaslException</tt> is thrown. + * completed (i.e., when {@code isComplete()} returns true); otherwise, a + * {@code SaslException} is thrown. * * @return value of property; only QOP is applicable to PLAIN. * @exception IllegalStateException if this authentication exchange
--- a/src/share/classes/com/sun/security/sasl/digest/DigestMD5Client.java Wed Apr 17 03:47:21 2019 +0100 +++ b/src/share/classes/com/sun/security/sasl/digest/DigestMD5Client.java Thu Apr 18 03:46:32 2019 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2019, 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 @@ -567,7 +567,7 @@ * username-value * cnonce-value * authzid-value - * @returns <tt>digest-response</tt> in a byte array + * @returns {@code digest-response} in a byte array * @throws SaslException if there is an error generating the * response value or the cnonce value. */
--- a/src/share/classes/java/awt/DefaultKeyboardFocusManager.java Wed Apr 17 03:47:21 2019 +0100 +++ b/src/share/classes/java/awt/DefaultKeyboardFocusManager.java Thu Apr 18 03:46:32 2019 +0100 @@ -30,18 +30,17 @@ import java.awt.peer.ComponentPeer; import java.awt.peer.LightweightPeer; import java.lang.ref.WeakReference; +import java.util.Iterator; import java.util.LinkedList; -import java.util.Iterator; import java.util.ListIterator; import java.util.Set; -import sun.util.logging.PlatformLogger; - +import sun.awt.AWTAccessor; import sun.awt.AppContext; +import sun.awt.CausedFocusEvent; import sun.awt.SunToolkit; -import sun.awt.AWTAccessor; -import sun.awt.CausedFocusEvent; import sun.awt.TimedWindowEvent; +import sun.util.logging.PlatformLogger; /** * The default KeyboardFocusManager for AWT applications. Focus traversal is @@ -777,7 +776,7 @@ : NULL_WINDOW_WR; typeAheadAssertions(currentFocusedWindow, we); - if (oppositeWindow == null) { + if (oppositeWindow == null && activeWindow != null) { // Then we need to deactive the active Window as well. // No need to synthesize in other cases, because // WINDOW_ACTIVATED will handle it if necessary.
--- a/src/share/classes/java/awt/SequencedEvent.java Wed Apr 17 03:47:21 2019 +0100 +++ b/src/share/classes/java/awt/SequencedEvent.java Thu Apr 18 03:46:32 2019 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2019, 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,6 +25,7 @@ package java.awt; +import java.util.Iterator; import java.util.LinkedList; import sun.awt.AWTAccessor; import sun.awt.AppContext; @@ -54,6 +55,7 @@ private final AWTEvent nested; private AppContext appContext; private boolean disposed; + private final LinkedList<AWTEvent> pendingEvents = new LinkedList<>(); static { AWTAccessor.setSequencedEventAccessor(new AWTAccessor.SequencedEventAccessor() { @@ -66,6 +68,35 @@ }); } + private static final class SequencedEventsFilter implements EventFilter { + private final SequencedEvent currentSequencedEvent; + private SequencedEventsFilter(SequencedEvent currentSequencedEvent) { + this.currentSequencedEvent = currentSequencedEvent; + } + @Override + public FilterAction acceptEvent(AWTEvent ev) { + if (ev.getID() == ID) { + // Move forward dispatching only if the event is previous + // in SequencedEvent.list. Otherwise, hold it for reposting later. + synchronized (SequencedEvent.class) { + Iterator<SequencedEvent> it = list.iterator(); + while (it.hasNext()) { + SequencedEvent iev = it.next(); + if (iev.equals(currentSequencedEvent)) { + break; + } else if (iev.equals(ev)) { + return FilterAction.ACCEPT; + } + } + } + } else if (ev.getID() == SentEvent.ID) { + return FilterAction.ACCEPT; + } + currentSequencedEvent.pendingEvents.add(ev); + return FilterAction.REJECT; + } + } + /** * Constructs a new SequencedEvent which will dispatch the specified * nested event. @@ -104,11 +135,8 @@ if (EventQueue.isDispatchThread()) { EventDispatchThread edt = (EventDispatchThread) Thread.currentThread(); - edt.pumpEvents(SentEvent.ID, new Conditional() { - public boolean evaluate() { - return !SequencedEvent.this.isFirstOrDisposed(); - } - }); + edt.pumpEventsForFilter(() -> !SequencedEvent.this.isFirstOrDisposed(), + new SequencedEventsFilter(this)); } else { while(!isFirstOrDisposed()) { synchronized (SequencedEvent.class) { @@ -197,10 +225,6 @@ } disposed = true; } - // Wake myself up - if (appContext != null) { - SunToolkit.postEvent(appContext, new SentEvent()); - } SequencedEvent next = null; @@ -221,5 +245,9 @@ if (next != null && next.appContext != null) { SunToolkit.postEvent(next.appContext, new SentEvent()); } + + for(AWTEvent e : pendingEvents) { + SunToolkit.postEvent(appContext, e); + } } }
--- a/src/share/classes/java/lang/Character.java Wed Apr 17 03:47:21 2019 +0100 +++ b/src/share/classes/java/lang/Character.java Thu Apr 18 03:46:32 2019 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2019, 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 @@ -32,27 +32,41 @@ /** * The {@code Character} class wraps a value of the primitive - * type {@code char} in an object. An object of type + * type {@code char} in an object. An object of class * {@code Character} contains a single field whose type is * {@code char}. * <p> - * In addition, this class provides several methods for determining - * a character's category (lowercase letter, digit, etc.) and for converting - * characters from uppercase to lowercase and vice versa. + * In addition, this class provides a large number of static methods for + * determining a character's category (lowercase letter, digit, etc.) + * and for converting characters from uppercase to lowercase and vice + * versa. + * + * <h3><a id="conformance">Unicode Conformance</a></h3> * <p> - * Character information is based on the Unicode Standard, version 6.2.0. + * The fields and methods of class {@code Character} are defined in terms + * of character information from the Unicode Standard, specifically the + * <i>UnicodeData</i> file that is part of the Unicode Character Database. + * This file specifies properties including name and category for every + * assigned Unicode code point or character range. The file is available + * from the Unicode Consortium at + * <a href="http://www.unicode.org">http://www.unicode.org</a>. * <p> - * The methods and data of class {@code Character} are defined by - * the information in the <i>UnicodeData</i> file that is part of the - * Unicode Character Database maintained by the Unicode - * Consortium. This file specifies various properties including name - * and general category for every defined Unicode code point or - * character range. - * <p> - * The file and its description are available from the Unicode Consortium at: - * <ul> - * <li><a href="http://www.unicode.org">http://www.unicode.org</a> - * </ul> + * The Java SE 8 Platform uses character information from version 6.2 + * of the Unicode Standard, with two extensions. First, the Java SE 8 Platform + * allows an implementation of class {@code Character} to use the Japanese Era + * code point, {@code U+32FF}, from the first version of the Unicode Standard + * after 6.2 that assigns the code point. Second, in recognition of the fact + * that new currencies appear frequently, the Java SE 8 Platform allows an + * implementation of class {@code Character} to use the Currency Symbols + * block from version 10.0 of the Unicode Standard. Consequently, the + * behavior of fields and methods of class {@code Character} may vary across + * implementations of the Java SE 8 Platform when processing the aforementioned + * code points ( outside of version 6.2 ), except for the following methods + * that define Java identifiers: + * {@link #isJavaIdentifierStart(int)}, {@link #isJavaIdentifierStart(char)}, + * {@link #isJavaIdentifierPart(int)}, and {@link #isJavaIdentifierPart(char)}. + * Code points in Java identifiers must be drawn from version 6.2 of + * the Unicode Standard. * * <h3><a name="unicode">Unicode Character Representations</a></h3> * @@ -3914,7 +3928,9 @@ 0x3220, // 3220..325F; COMMON 0x3260, // 3260..327E; HANGUL 0x327F, // 327F..32CF; COMMON - 0x32D0, // 32D0..3357; KATAKANA + 0x32D0, // 32D0..32FE; KATAKANA + 0x32FF, // 32FF ; COMMON + 0x3300, // 3300..3357; KATAKANA 0x3358, // 3358..33FF; COMMON 0x3400, // 3400..4DBF; HAN 0x4DC0, // 4DC0..4DFF; COMMON @@ -4235,7 +4251,9 @@ COMMON, HANGUL, COMMON, - KATAKANA, + KATAKANA, // 32D0..32FE + COMMON, // 32FF + KATAKANA, // 3300..3357 COMMON, HAN, COMMON, @@ -5859,7 +5877,7 @@ * character in a Java identifier. * <p> * A character may start a Java identifier if and only if - * one of the following is true: + * one of the following conditions is true: * <ul> * <li> {@link #isLetter(char) isLetter(ch)} returns {@code true} * <li> {@link #getType(char) getType(ch)} returns {@code LETTER_NUMBER} @@ -5867,6 +5885,9 @@ * <li> {@code ch} is a connecting punctuation character (such as {@code '_'}). * </ul> * + * These conditions are tested against the character information from version + * 6.2 of the Unicode Standard. + * * @param ch the character to be tested. * @return {@code true} if the character may start a Java * identifier; {@code false} otherwise. @@ -5889,7 +5910,7 @@ * identifier as other than the first character. * <p> * A character may be part of a Java identifier if and only if any - * of the following are true: + * of the following conditions are true: * <ul> * <li> it is a letter * <li> it is a currency symbol (such as {@code '$'}) @@ -5902,6 +5923,9 @@ * {@code true} for the character. * </ul> * + * These conditions are tested against the character information from version + * 6.2 of the Unicode Standard. + * * @param ch the character to be tested. * @return {@code true} if the character may be part of a * Java identifier; {@code false} otherwise. @@ -5979,6 +6003,9 @@ * <li> {@code ch} is a connecting punctuation character (such as {@code '_'}). * </ul> * + * These conditions are tested against the character information from version + * 6.2 of the Unicode Standard. + * * <p><b>Note:</b> This method cannot handle <a * href="#supplementary"> supplementary characters</a>. To support * all Unicode characters, including supplementary characters, use @@ -6013,6 +6040,9 @@ * (such as {@code '_'}). * </ul> * + * These conditions are tested against the character information from version + * 6.2 of the Unicode Standard. + * * @param codePoint the character (Unicode code point) to be tested. * @return {@code true} if the character may start a Java identifier; * {@code false} otherwise. @@ -6031,7 +6061,7 @@ * identifier as other than the first character. * <p> * A character may be part of a Java identifier if any of the following - * are true: + * conditions are true: * <ul> * <li> it is a letter * <li> it is a currency symbol (such as {@code '$'}) @@ -6044,6 +6074,9 @@ * {@code true} for the character * </ul> * + * These conditions are tested against the character information from version + * 6.2 of the Unicode Standard. + * * <p><b>Note:</b> This method cannot handle <a * href="#supplementary"> supplementary characters</a>. To support * all Unicode characters, including supplementary characters, use @@ -6068,7 +6101,7 @@ * identifier as other than the first character. * <p> * A character may be part of a Java identifier if any of the following - * are true: + * conditions are true: * <ul> * <li> it is a letter * <li> it is a currency symbol (such as {@code '$'}) @@ -6079,9 +6112,12 @@ * <li> it is a non-spacing mark * <li> {@link #isIdentifierIgnorable(int) * isIdentifierIgnorable(codePoint)} returns {@code true} for - * the character + * the code point * </ul> * + * These conditions are tested against the character information from version + * 6.2 of the Unicode Standard. + * * @param codePoint the character (Unicode code point) to be tested. * @return {@code true} if the character may be part of a * Java identifier; {@code false} otherwise.
--- a/src/share/classes/java/math/BigDecimal.java Wed Apr 17 03:47:21 2019 +0100 +++ b/src/share/classes/java/math/BigDecimal.java Thu Apr 18 03:46:32 2019 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1996, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1996, 2019, 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 @@ -3060,9 +3060,32 @@ * @return this {@code BigDecimal} converted to a {@code long}. */ public long longValue(){ - return (intCompact != INFLATED && scale == 0) ? - intCompact: - toBigInteger().longValue(); + if (intCompact != INFLATED && scale == 0) { + return intCompact; + } else { + // Fastpath zero and small values + if (this.signum() == 0 || fractionOnly() || + // Fastpath very large-scale values that will result + // in a truncated value of zero. If the scale is -64 + // or less, there are at least 64 powers of 10 in the + // value of the numerical result. Since 10 = 2*5, in + // that case there would also be 64 powers of 2 in the + // result, meaning all 64 bits of a long will be zero. + scale <= -64) { + return 0; + } else { + return toBigInteger().longValue(); + } + } + } + + /** + * Return true if a nonzero BigDecimal has an absolute value less + * than one; i.e. only has fraction digits. + */ + private boolean fractionOnly() { + assert this.signum() != 0; + return (this.precision() - this.scale) <= 0; } /** @@ -3080,15 +3103,20 @@ public long longValueExact() { if (intCompact != INFLATED && scale == 0) return intCompact; + + // Fastpath zero + if (this.signum() == 0) + return 0; + + // Fastpath numbers less than 1.0 (the latter can be very slow + // to round if very small) + if (fractionOnly()) + throw new ArithmeticException("Rounding necessary"); + // If more than 19 digits in integer part it cannot possibly fit if ((precision() - scale) > 19) // [OK for negative scale too] throw new java.lang.ArithmeticException("Overflow"); - // Fastpath zero and < 1.0 numbers (the latter can be very slow - // to round if very small) - if (this.signum() == 0) - return 0; - if ((this.precision() - this.scale) <= 0) - throw new ArithmeticException("Rounding necessary"); + // round to an integer, with Exception if decimal part non-0 BigDecimal num = this.setScale(0, ROUND_UNNECESSARY); if (num.precision() >= 19) // need to check carefully @@ -3130,7 +3158,7 @@ public int intValue() { return (intCompact != INFLATED && scale == 0) ? (int)intCompact : - toBigInteger().intValue(); + (int)longValue(); } /**
--- a/src/share/classes/java/time/chrono/JapaneseEra.java Wed Apr 17 03:47:21 2019 +0100 +++ b/src/share/classes/java/time/chrono/JapaneseEra.java Thu Apr 18 03:46:32 2019 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2019, 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 @@ -88,10 +88,33 @@ /** * An era in the Japanese Imperial calendar system. * <p> - * This class defines the valid eras for the Japanese chronology. - * Japan introduced the Gregorian calendar starting with Meiji 6. - * Only Meiji and later eras are supported; - * dates before Meiji 6, January 1 are not supported. + * The Japanese government defines the official name and start date of + * each era. Eras are consecutive and their date ranges do not overlap, + * so the end date of one era is always the day before the start date + * of the next era. + * <p> + * The Java SE Platform supports all eras defined by the Japanese government, + * beginning with the Meiji era. Each era is identified in the Platform by an + * integer value and a name. The {@link #of(int)} and {@link #valueOf(String)} + * methods may be used to obtain a singleton instance of JapaneseEra for each + * era. The {@link #values()} method returns the singleton instances of all + * supported eras. + * <p> + * For convenience, this class declares a number of public static final fields + * that refer to singleton instances returned by the values() method. + * + * @apiNote + * The fields declared in this class may evolve over time, in line with the + * results of the {@link #values()} method. However, there is not necessarily + * a 1:1 correspondence between the fields and the singleton instances. + * + * @apiNote + * The Japanese government may announce a new era and define its start + * date but not its official name. In this scenario, the singleton instance + * that represents the new era may return a name that is not stable until + * the official name is defined. Developers should exercise caution when + * relying on the name returned by any singleton instance that does not + * correspond to a public static final field. * * @implSpec * This class is immutable and thread-safe. @@ -123,14 +146,19 @@ */ public static final JapaneseEra SHOWA = new JapaneseEra(1, LocalDate.of(1926, 12, 25)); /** - * The singleton instance for the 'Heisei' era (1989-01-08 - current) + * The singleton instance for the 'Heisei' era (1989-01-08 - 2019-04-30) * which has the value 2. */ public static final JapaneseEra HEISEI = new JapaneseEra(2, LocalDate.of(1989, 1, 8)); + /** + * The singleton instance for the 'Reiwa' era (2019-05-01 - ) + * which has the value 3. + */ + private static final JapaneseEra REIWA = new JapaneseEra(3, LocalDate.of(2019, 5, 1)); // The number of predefined JapaneseEra constants. // There may be a supplemental era defined by the property. - private static final int N_ERA_CONSTANTS = HEISEI.getValue() + ERA_OFFSET; + private static final int N_ERA_CONSTANTS = REIWA.getValue() + ERA_OFFSET; /** * Serialization version. @@ -148,6 +176,7 @@ KNOWN_ERAS[1] = TAISHO; KNOWN_ERAS[2] = SHOWA; KNOWN_ERAS[3] = HEISEI; + KNOWN_ERAS[4] = REIWA; for (int i = N_ERA_CONSTANTS; i < ERA_CONFIG.length; i++) { CalendarDate date = ERA_CONFIG[i].getSinceDate(); LocalDate isoDate = LocalDate.of(date.getYear(), date.getMonth(), date.getDayOfMonth()); @@ -188,10 +217,18 @@ //----------------------------------------------------------------------- /** * Obtains an instance of {@code JapaneseEra} from an {@code int} value. + * <ul> + * <li>The value {@code 1} is associated with the 'Showa' era, because + * it contains 1970-01-01 (ISO calendar system).</li> + * <li>The values {@code -1} and {@code 0} are associated with two earlier + * eras, Meiji and Taisho, respectively.</li> + * <li>A value greater than {@code 1} is associated with a later era, + * beginning with Heisei ({@code 2}).</li> + * </ul> * <p> - * The {@link #SHOWA} era that contains 1970-01-01 (ISO calendar system) has the value 1 - * Later era is numbered 2 ({@link #HEISEI}). Earlier eras are numbered 0 ({@link #TAISHO}), - * -1 ({@link #MEIJI}), only Meiji and later eras are supported. + * Every instance of {@code JapaneseEra} that is returned from the {@link values()} + * method has an int value (available via {@link Era#getValue()} which is + * accepted by this method. * * @param japaneseEra the era to represent * @return the {@code JapaneseEra} singleton, not null
--- a/src/share/classes/java/time/format/DateTimeFormatterBuilder.java Wed Apr 17 03:47:21 2019 +0100 +++ b/src/share/classes/java/time/format/DateTimeFormatterBuilder.java Thu Apr 18 03:46:32 2019 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2019, 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 @@ -772,11 +772,22 @@ final LocaleStore store = new LocaleStore(map); DateTimeTextProvider provider = new DateTimeTextProvider() { @Override + public String getText(Chronology chrono, TemporalField field, + long value, TextStyle style, Locale locale) { + return store.getText(value, style); + } + @Override public String getText(TemporalField field, long value, TextStyle style, Locale locale) { return store.getText(value, style); } @Override - public Iterator<Entry<String, Long>> getTextIterator(TemporalField field, TextStyle style, Locale locale) { + public Iterator<Entry<String, Long>> getTextIterator(Chronology chrono, + TemporalField field, TextStyle style, Locale locale) { + return store.getTextIterator(style); + } + @Override + public Iterator<Entry<String, Long>> getTextIterator(TemporalField field, + TextStyle style, Locale locale) { return store.getTextIterator(style); } };
--- a/src/share/classes/java/util/JapaneseImperialCalendar.java Wed Apr 17 03:47:21 2019 +0100 +++ b/src/share/classes/java/util/JapaneseImperialCalendar.java Thu Apr 18 03:46:32 2019 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2019, 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 @@ -50,6 +50,7 @@ * 2 Taisho 1912-07-30 midnight local time * 3 Showa 1926-12-25 midnight local time * 4 Heisei 1989-01-08 midnight local time + * 5 Reiwa 2019-05-01T00:00:00 local time * ------------------------------------------------------ * </tt></pre> * @@ -101,6 +102,11 @@ */ public static final int HEISEI = 4; + /** + * The ERA constant designating the Reiwa era. + */ + private static final int REIWA = 5; + private static final int EPOCH_OFFSET = 719163; // Fixed date of January 1, 1970 (Gregorian) private static final int EPOCH_YEAR = 1970; @@ -133,6 +139,9 @@ // Fixed date of the first date of each era. private static final long[] sinceFixedDates; + // The current era + private static final int currentEra; + /* * <pre> * Greatest Least @@ -228,13 +237,18 @@ // eras[BEFORE_MEIJI] and sinceFixedDate[BEFORE_MEIJI] are the // same as Gregorian. int index = BEFORE_MEIJI; + int current = index; sinceFixedDates[index] = gcal.getFixedDate(BEFORE_MEIJI_ERA.getSinceDate()); eras[index++] = BEFORE_MEIJI_ERA; for (Era e : es) { + if(e.getSince(TimeZone.NO_TIMEZONE) < System.currentTimeMillis()) { + current = index; + } CalendarDate d = e.getSinceDate(); sinceFixedDates[index] = gcal.getFixedDate(d); eras[index++] = e; } + currentEra = current; LEAST_MAX_VALUES[ERA] = MAX_VALUES[ERA] = eras.length - 1; @@ -978,9 +992,11 @@ String name = CalendarDataUtility.retrieveFieldValueName(getCalendarType(), field, fieldValue, style, locale); - // If the ERA value is null, then + // If the ERA value is null or empty, then // try to get its name or abbreviation from the Era instance. - if (name == null && field == ERA && fieldValue < eras.length) { + if ((name == null || name.isEmpty()) && + field == ERA && + fieldValue < eras.length) { Era era = eras[fieldValue]; name = (style == SHORT) ? era.getAbbreviation() : era.getName(); } @@ -1713,12 +1729,12 @@ } } else if (transitionYear) { if (jdate.getYear() == 1) { - // As of Heisei (since Meiji) there's no case + // As of Reiwa (since Meiji) there's no case // that there are multiple transitions in a // year. Historically there was such // case. There might be such case again in the // future. - if (era > HEISEI) { + if (era > REIWA) { CalendarDate pd = eras[era - 1].getSinceDate(); if (normalizedYear == pd.getYear()) { d.setMonth(pd.getMonth()).setDayOfMonth(pd.getDayOfMonth()); @@ -1853,7 +1869,7 @@ year = isSet(YEAR) ? internalGet(YEAR) : 1; } else { if (isSet(YEAR)) { - era = eras.length - 1; + era = currentEra; year = internalGet(YEAR); } else { // Equivalent to 1970 (Gregorian) @@ -2337,7 +2353,7 @@ * default ERA is the current era, but a zero (unset) ERA means before Meiji. */ private int internalGetEra() { - return isSet(ERA) ? internalGet(ERA) : eras.length - 1; + return isSet(ERA) ? internalGet(ERA) : currentEra; } /**
--- a/src/share/classes/java/util/stream/AbstractPipeline.java Wed Apr 17 03:47:21 2019 +0100 +++ b/src/share/classes/java/util/stream/AbstractPipeline.java Thu Apr 18 03:46:32 2019 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2014, 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 @@ -327,6 +327,7 @@ @Override @SuppressWarnings("unchecked") public S onClose(Runnable closeHandler) { + Objects.requireNonNull(closeHandler); Runnable existingHandler = sourceStage.sourceCloseAction; sourceStage.sourceCloseAction = (existingHandler == null)
--- a/src/share/classes/java/util/stream/BaseStream.java Wed Apr 17 03:47:21 2019 +0100 +++ b/src/share/classes/java/util/stream/BaseStream.java Thu Apr 18 03:46:32 2019 +0100 @@ -53,7 +53,7 @@ * parallelism, which governs the behavior of all stream types. * * @param <T> the type of the stream elements - * @param <S> the type of of the stream implementing {@code BaseStream} + * @param <S> the type of the stream implementing {@code BaseStream} * @since 1.8 * @see Stream * @see IntStream
--- a/src/share/classes/java/util/stream/DoublePipeline.java Wed Apr 17 03:47:21 2019 +0100 +++ b/src/share/classes/java/util/stream/DoublePipeline.java Thu Apr 18 03:46:32 2019 +0100 @@ -254,6 +254,7 @@ @Override public final DoubleStream flatMap(DoubleFunction<? extends DoubleStream> mapper) { + Objects.requireNonNull(mapper); return new StatelessOp<Double>(this, StreamShape.DOUBLE_VALUE, StreamOpFlag.NOT_SORTED | StreamOpFlag.NOT_DISTINCT | StreamOpFlag.NOT_SIZED) { @Override @@ -469,6 +470,7 @@ public final <R> R collect(Supplier<R> supplier, ObjDoubleConsumer<R> accumulator, BiConsumer<R, R> combiner) { + Objects.requireNonNull(combiner); BinaryOperator<R> operator = (left, right) -> { combiner.accept(left, right); return left;
--- a/src/share/classes/java/util/stream/DoubleStream.java Wed Apr 17 03:47:21 2019 +0100 +++ b/src/share/classes/java/util/stream/DoubleStream.java Thu Apr 18 03:46:32 2019 +0100 @@ -768,7 +768,7 @@ * to the element at position {@code n - 1}. * * @param seed the initial element - * @param f a function to be applied to to the previous element to produce + * @param f a function to be applied to the previous element to produce * a new element * @return a new sequential {@code DoubleStream} */
--- a/src/share/classes/java/util/stream/IntPipeline.java Wed Apr 17 03:47:21 2019 +0100 +++ b/src/share/classes/java/util/stream/IntPipeline.java Thu Apr 18 03:46:32 2019 +0100 @@ -290,6 +290,7 @@ @Override public final IntStream flatMap(IntFunction<? extends IntStream> mapper) { + Objects.requireNonNull(mapper); return new StatelessOp<Integer>(this, StreamShape.INT_VALUE, StreamOpFlag.NOT_SORTED | StreamOpFlag.NOT_DISTINCT | StreamOpFlag.NOT_SIZED) { @Override @@ -465,6 +466,7 @@ public final <R> R collect(Supplier<R> supplier, ObjIntConsumer<R> accumulator, BiConsumer<R, R> combiner) { + Objects.requireNonNull(combiner); BinaryOperator<R> operator = (left, right) -> { combiner.accept(left, right); return left;
--- a/src/share/classes/java/util/stream/IntStream.java Wed Apr 17 03:47:21 2019 +0100 +++ b/src/share/classes/java/util/stream/IntStream.java Thu Apr 18 03:46:32 2019 +0100 @@ -734,7 +734,7 @@ * element at position {@code n - 1}. * * @param seed the initial element - * @param f a function to be applied to to the previous element to produce + * @param f a function to be applied to the previous element to produce * a new element * @return A new sequential {@code IntStream} */
--- a/src/share/classes/java/util/stream/LongPipeline.java Wed Apr 17 03:47:21 2019 +0100 +++ b/src/share/classes/java/util/stream/LongPipeline.java Thu Apr 18 03:46:32 2019 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2014, 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 @@ -271,6 +271,7 @@ @Override public final LongStream flatMap(LongFunction<? extends LongStream> mapper) { + Objects.requireNonNull(mapper); return new StatelessOp<Long>(this, StreamShape.LONG_VALUE, StreamOpFlag.NOT_SORTED | StreamOpFlag.NOT_DISTINCT | StreamOpFlag.NOT_SIZED) { @Override @@ -447,6 +448,7 @@ public final <R> R collect(Supplier<R> supplier, ObjLongConsumer<R> accumulator, BiConsumer<R, R> combiner) { + Objects.requireNonNull(combiner); BinaryOperator<R> operator = (left, right) -> { combiner.accept(left, right); return left;
--- a/src/share/classes/java/util/stream/LongStream.java Wed Apr 17 03:47:21 2019 +0100 +++ b/src/share/classes/java/util/stream/LongStream.java Thu Apr 18 03:46:32 2019 +0100 @@ -727,7 +727,7 @@ * element at position {@code n - 1}. * * @param seed the initial element - * @param f a function to be applied to to the previous element to produce + * @param f a function to be applied to the previous element to produce * a new element * @return a new sequential {@code LongStream} */
--- a/src/share/classes/java/util/stream/PipelineHelper.java Wed Apr 17 03:47:21 2019 +0100 +++ b/src/share/classes/java/util/stream/PipelineHelper.java Thu Apr 18 03:46:32 2019 +0100 @@ -74,7 +74,7 @@ /** * Returns the exact output size of the portion of the output resulting from * applying the pipeline stages described by this {@code PipelineHelper} to - * the the portion of the input described by the provided + * the portion of the input described by the provided * {@code Spliterator}, if known. If not known or known infinite, will * return {@code -1}. *
--- a/src/share/classes/java/util/stream/SliceOps.java Wed Apr 17 03:47:21 2019 +0100 +++ b/src/share/classes/java/util/stream/SliceOps.java Thu Apr 18 03:46:32 2019 +0100 @@ -693,7 +693,7 @@ * size. * * @param target the target size - * @return return the number of completed elements + * @return the number of completed elements */ private long completedSize(long target) { if (completed)
--- a/src/share/classes/java/util/stream/Stream.java Wed Apr 17 03:47:21 2019 +0100 +++ b/src/share/classes/java/util/stream/Stream.java Thu Apr 18 03:46:32 2019 +0100 @@ -1013,7 +1013,7 @@ * * @param <T> the type of stream elements * @param seed the initial element - * @param f a function to be applied to to the previous element to produce + * @param f a function to be applied to the previous element to produce * a new element * @return a new sequential {@code Stream} */
--- a/src/share/classes/java/util/stream/StreamOpFlag.java Wed Apr 17 03:47:21 2019 +0100 +++ b/src/share/classes/java/util/stream/StreamOpFlag.java Thu Apr 18 03:46:32 2019 +0100 @@ -115,7 +115,7 @@ * characteristics that stream has; when describing a stream operation, one need * describe whether the operation preserves, injects, or clears that * characteristic. Accordingly, two bits are used for each flag, so as to allow - * representing not only the presence of of a characteristic, but how an + * representing not only the presence of a characteristic, but how an * operation modifies that characteristic. There are two common forms in which * flag bits are combined into an {@code int} bit set. <em>Stream flags</em> * are a unioned bit set constructed by ORing the enum characteristic values of
--- a/src/share/classes/javax/crypto/Cipher.java Wed Apr 17 03:47:21 2019 +0100 +++ b/src/share/classes/javax/crypto/Cipher.java Thu Apr 18 03:46:32 2019 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2019, 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 @@ -52,7 +52,7 @@ * Extension (JCE) framework. * * <p>In order to create a Cipher object, the application calls the - * Cipher's <code>getInstance</code> method, and passes the name of the + * Cipher's {@code getInstance} method, and passes the name of the * requested <i>transformation</i> to it. Optionally, the name of a provider * may be specified. * @@ -78,7 +78,7 @@ * Cipher c = Cipher.getInstance("<i>AES/CBC/PKCS5Padding</i>"); * </pre> * - * Using modes such as <code>CFB</code> and <code>OFB</code>, block + * Using modes such as {@code CFB} and {@code OFB}, block * ciphers can encrypt data in units smaller than the cipher's actual * block size. When requesting such a mode, you may optionally specify * the number of bits to be processed at a time by appending this number @@ -129,24 +129,24 @@ * * </pre> * Every implementation of the Java platform is required to support - * the following standard <code>Cipher</code> transformations with the keysizes + * the following standard {@code Cipher} transformations with the keysizes * in parentheses: * <ul> - * <li><tt>AES/CBC/NoPadding</tt> (128)</li> - * <li><tt>AES/CBC/PKCS5Padding</tt> (128)</li> - * <li><tt>AES/ECB/NoPadding</tt> (128)</li> - * <li><tt>AES/ECB/PKCS5Padding</tt> (128)</li> - * <li><tt>DES/CBC/NoPadding</tt> (56)</li> - * <li><tt>DES/CBC/PKCS5Padding</tt> (56)</li> - * <li><tt>DES/ECB/NoPadding</tt> (56)</li> - * <li><tt>DES/ECB/PKCS5Padding</tt> (56)</li> - * <li><tt>DESede/CBC/NoPadding</tt> (168)</li> - * <li><tt>DESede/CBC/PKCS5Padding</tt> (168)</li> - * <li><tt>DESede/ECB/NoPadding</tt> (168)</li> - * <li><tt>DESede/ECB/PKCS5Padding</tt> (168)</li> - * <li><tt>RSA/ECB/PKCS1Padding</tt> (1024, 2048)</li> - * <li><tt>RSA/ECB/OAEPWithSHA-1AndMGF1Padding</tt> (1024, 2048)</li> - * <li><tt>RSA/ECB/OAEPWithSHA-256AndMGF1Padding</tt> (1024, 2048)</li> + * <li>{@code AES/CBC/NoPadding} (128)</li> + * <li>{@code AES/CBC/PKCS5Padding} (128)</li> + * <li>{@code AES/ECB/NoPadding} (128)</li> + * <li>{@code AES/ECB/PKCS5Padding} (128)</li> + * <li>{@code DES/CBC/NoPadding} (56)</li> + * <li>{@code DES/CBC/PKCS5Padding} (56)</li> + * <li>{@code DES/ECB/NoPadding} (56)</li> + * <li>{@code DES/ECB/PKCS5Padding} (56)</li> + * <li>{@code DESede/CBC/NoPadding} (168)</li> + * <li>{@code DESede/CBC/PKCS5Padding} (168)</li> + * <li>{@code DESede/ECB/NoPadding} (168)</li> + * <li>{@code DESede/ECB/PKCS5Padding} (168)</li> + * <li>{@code RSA/ECB/PKCS1Padding} (1024, 2048)</li> + * <li>{@code RSA/ECB/OAEPWithSHA-1AndMGF1Padding} (1024, 2048)</li> + * <li>{@code RSA/ECB/OAEPWithSHA-256AndMGF1Padding} (1024, 2048)</li> * </ul> * These transformations are described in the * <a href="{@docRoot}/../technotes/guides/security/StandardNames.html#Cipher"> @@ -465,7 +465,7 @@ } /** - * Returns a <code>Cipher</code> object that implements the specified + * Returns a {@code Cipher} object that implements the specified * transformation. * * <p> This method traverses the list of registered security Providers, @@ -486,12 +486,12 @@ * * @return a cipher that implements the requested transformation. * - * @exception NoSuchAlgorithmException if <code>transformation</code> + * @exception NoSuchAlgorithmException if {@code transformation} * is null, empty, in an invalid format, * or if no Provider supports a CipherSpi implementation for the * specified algorithm. * - * @exception NoSuchPaddingException if <code>transformation</code> + * @exception NoSuchPaddingException if {@code transformation} * contains a padding scheme that is not available. * * @see java.security.Provider @@ -541,7 +541,7 @@ } /** - * Returns a <code>Cipher</code> object that implements the specified + * Returns a {@code Cipher} object that implements the specified * transformation. * * <p> A new Cipher object encapsulating the @@ -563,7 +563,7 @@ * * @return a cipher that implements the requested transformation. * - * @exception NoSuchAlgorithmException if <code>transformation</code> + * @exception NoSuchAlgorithmException if {@code transformation} * is null, empty, in an invalid format, * or if a CipherSpi implementation for the specified algorithm * is not available from the specified provider. @@ -571,10 +571,10 @@ * @exception NoSuchProviderException if the specified provider is not * registered in the security provider list. * - * @exception NoSuchPaddingException if <code>transformation</code> + * @exception NoSuchPaddingException if {@code transformation} * contains a padding scheme that is not available. * - * @exception IllegalArgumentException if the <code>provider</code> + * @exception IllegalArgumentException if the {@code provider} * is null or empty. * * @see java.security.Provider @@ -596,7 +596,7 @@ } /** - * Returns a <code>Cipher</code> object that implements the specified + * Returns a {@code Cipher} object that implements the specified * transformation. * * <p> A new Cipher object encapsulating the @@ -615,15 +615,15 @@ * * @return a cipher that implements the requested transformation. * - * @exception NoSuchAlgorithmException if <code>transformation</code> + * @exception NoSuchAlgorithmException if {@code transformation} * is null, empty, in an invalid format, * or if a CipherSpi implementation for the specified algorithm * is not available from the specified Provider object. * - * @exception NoSuchPaddingException if <code>transformation</code> + * @exception NoSuchPaddingException if {@code transformation} * contains a padding scheme that is not available. * - * @exception IllegalArgumentException if the <code>provider</code> + * @exception IllegalArgumentException if the {@code provider} * is null. * * @see java.security.Provider @@ -896,9 +896,9 @@ } /** - * Returns the provider of this <code>Cipher</code> object. + * Returns the provider of this {@code Cipher} object. * - * @return the provider of this <code>Cipher</code> object + * @return the provider of this {@code Cipher} object */ public final Provider getProvider() { chooseFirstProvider(); @@ -906,13 +906,13 @@ } /** - * Returns the algorithm name of this <code>Cipher</code> object. + * Returns the algorithm name of this {@code Cipher} object. * * <p>This is the same name that was specified in one of the - * <code>getInstance</code> calls that created this <code>Cipher</code> + * {@code getInstance} calls that created this {@code Cipher} * object.. * - * @return the algorithm name of this <code>Cipher</code> object. + * @return the algorithm name of this {@code Cipher} object. */ public final String getAlgorithm() { return this.transformation; @@ -931,15 +931,15 @@ /** * Returns the length in bytes that an output buffer would need to be in - * order to hold the result of the next <code>update</code> or - * <code>doFinal</code> operation, given the input length - * <code>inputLen</code> (in bytes). + * order to hold the result of the next {@code update} or + * {@code doFinal} operation, given the input length + * {@code inputLen} (in bytes). * * <p>This call takes into account any unprocessed (buffered) data from a - * previous <code>update</code> call, padding, and AEAD tagging. + * previous {@code update} call, padding, and AEAD tagging. * - * <p>The actual output length of the next <code>update</code> or - * <code>doFinal</code> call may be smaller than the length returned by + * <p>The actual output length of the next {@code update} or + * {@code doFinal} call may be smaller than the length returned by * this method. * * @param inputLen the input length (in bytes) @@ -1134,14 +1134,14 @@ * * <p>The cipher is initialized for one of the following four operations: * encryption, decryption, key wrapping or key unwrapping, depending - * on the value of <code>opmode</code>. + * on the value of {@code opmode}. * * <p>If this cipher requires any algorithm parameters that cannot be - * derived from the given <code>key</code>, the underlying cipher + * derived from the given {@code key}, the underlying cipher * implementation is supposed to generate the required parameters itself * (using provider-specific default or random values) if it is being * initialized for encryption or key wrapping, and raise an - * <code>InvalidKeyException</code> if it is being + * {@code InvalidKeyException} if it is being * initialized for decryption or key unwrapping. * The generated parameters can be retrieved using * {@link #getParameters() getParameters} or @@ -1167,8 +1167,8 @@ * * @param opmode the operation mode of this cipher (this is one of * the following: - * <code>ENCRYPT_MODE</code>, <code>DECRYPT_MODE</code>, - * <code>WRAP_MODE</code> or <code>UNWRAP_MODE</code>) + * {@code ENCRYPT_MODE}, {@code DECRYPT_MODE}, + * {@code WRAP_MODE} or {@code UNWRAP_MODE}) * @param key the key * * @exception InvalidKeyException if the given key is inappropriate for @@ -1190,14 +1190,14 @@ * * <p>The cipher is initialized for one of the following four operations: * encryption, decryption, key wrapping or key unwrapping, depending - * on the value of <code>opmode</code>. + * on the value of {@code opmode}. * * <p>If this cipher requires any algorithm parameters that cannot be - * derived from the given <code>key</code>, the underlying cipher + * derived from the given {@code key}, the underlying cipher * implementation is supposed to generate the required parameters itself * (using provider-specific default or random values) if it is being * initialized for encryption or key wrapping, and raise an - * <code>InvalidKeyException</code> if it is being + * {@code InvalidKeyException} if it is being * initialized for decryption or key unwrapping. * The generated parameters can be retrieved using * {@link #getParameters() getParameters} or @@ -1210,7 +1210,7 @@ * * <p>If this cipher (including its underlying feedback or padding scheme) * requires any random bytes (e.g., for parameter generation), it will get - * them from <code>random</code>. + * them from {@code random}. * * <p>Note that when a Cipher object is initialized, it loses all * previously-acquired state. In other words, initializing a Cipher is @@ -1219,8 +1219,8 @@ * * @param opmode the operation mode of this cipher (this is one of the * following: - * <code>ENCRYPT_MODE</code>, <code>DECRYPT_MODE</code>, - * <code>WRAP_MODE</code> or <code>UNWRAP_MODE</code>) + * {@code ENCRYPT_MODE}, {@code DECRYPT_MODE}, + * {@code WRAP_MODE} or {@code UNWRAP_MODE}) * @param key the encryption key * @param random the source of randomness * @@ -1268,14 +1268,14 @@ * * <p>The cipher is initialized for one of the following four operations: * encryption, decryption, key wrapping or key unwrapping, depending - * on the value of <code>opmode</code>. + * on the value of {@code opmode}. * * <p>If this cipher requires any algorithm parameters and - * <code>params</code> is null, the underlying cipher implementation is + * {@code params} is null, the underlying cipher implementation is * supposed to generate the required parameters itself (using * provider-specific default or random values) if it is being * initialized for encryption or key wrapping, and raise an - * <code>InvalidAlgorithmParameterException</code> if it is being + * {@code InvalidAlgorithmParameterException} if it is being * initialized for decryption or key unwrapping. * The generated parameters can be retrieved using * {@link #getParameters() getParameters} or @@ -1301,8 +1301,8 @@ * * @param opmode the operation mode of this cipher (this is one of the * following: - * <code>ENCRYPT_MODE</code>, <code>DECRYPT_MODE</code>, - * <code>WRAP_MODE</code> or <code>UNWRAP_MODE</code>) + * {@code ENCRYPT_MODE}, {@code DECRYPT_MODE}, + * {@code WRAP_MODE} or {@code UNWRAP_MODE}) * @param key the encryption key * @param params the algorithm parameters * @@ -1312,7 +1312,7 @@ * @exception InvalidAlgorithmParameterException if the given algorithm * parameters are inappropriate for this cipher, * or this cipher requires - * algorithm parameters and <code>params</code> is null, or the given + * algorithm parameters and {@code params} is null, or the given * algorithm parameters imply a cryptographic strength that would exceed * the legal limits (as determined from the configured jurisdiction * policy files). @@ -1332,14 +1332,14 @@ * * <p>The cipher is initialized for one of the following four operations: * encryption, decryption, key wrapping or key unwrapping, depending - * on the value of <code>opmode</code>. + * on the value of {@code opmode}. * * <p>If this cipher requires any algorithm parameters and - * <code>params</code> is null, the underlying cipher implementation is + * {@code params} is null, the underlying cipher implementation is * supposed to generate the required parameters itself (using * provider-specific default or random values) if it is being * initialized for encryption or key wrapping, and raise an - * <code>InvalidAlgorithmParameterException</code> if it is being + * {@code InvalidAlgorithmParameterException} if it is being * initialized for decryption or key unwrapping. * The generated parameters can be retrieved using * {@link #getParameters() getParameters} or @@ -1352,7 +1352,7 @@ * * <p>If this cipher (including its underlying feedback or padding scheme) * requires any random bytes (e.g., for parameter generation), it will get - * them from <code>random</code>. + * them from {@code random}. * * <p>Note that when a Cipher object is initialized, it loses all * previously-acquired state. In other words, initializing a Cipher is @@ -1361,8 +1361,8 @@ * * @param opmode the operation mode of this cipher (this is one of the * following: - * <code>ENCRYPT_MODE</code>, <code>DECRYPT_MODE</code>, - * <code>WRAP_MODE</code> or <code>UNWRAP_MODE</code>) + * {@code ENCRYPT_MODE}, {@code DECRYPT_MODE}, + * {@code WRAP_MODE} or {@code UNWRAP_MODE}) * @param key the encryption key * @param params the algorithm parameters * @param random the source of randomness @@ -1373,7 +1373,7 @@ * @exception InvalidAlgorithmParameterException if the given algorithm * parameters are inappropriate for this cipher, * or this cipher requires - * algorithm parameters and <code>params</code> is null, or the given + * algorithm parameters and {@code params} is null, or the given * algorithm parameters imply a cryptographic strength that would exceed * the legal limits (as determined from the configured jurisdiction * policy files). @@ -1411,14 +1411,14 @@ * * <p>The cipher is initialized for one of the following four operations: * encryption, decryption, key wrapping or key unwrapping, depending - * on the value of <code>opmode</code>. + * on the value of {@code opmode}. * * <p>If this cipher requires any algorithm parameters and - * <code>params</code> is null, the underlying cipher implementation is + * {@code params} is null, the underlying cipher implementation is * supposed to generate the required parameters itself (using * provider-specific default or random values) if it is being * initialized for encryption or key wrapping, and raise an - * <code>InvalidAlgorithmParameterException</code> if it is being + * {@code InvalidAlgorithmParameterException} if it is being * initialized for decryption or key unwrapping. * The generated parameters can be retrieved using * {@link #getParameters() getParameters} or @@ -1443,9 +1443,9 @@ * it. * * @param opmode the operation mode of this cipher (this is one of the - * following: <code>ENCRYPT_MODE</code>, - * <code>DECRYPT_MODE</code>, <code>WRAP_MODE</code> - * or <code>UNWRAP_MODE</code>) + * following: {@code ENCRYPT_MODE}, + * {@code DECRYPT_MODE}, {@code WRAP_MODE} + * or {@code UNWRAP_MODE}) * @param key the encryption key * @param params the algorithm parameters * @@ -1455,7 +1455,7 @@ * @exception InvalidAlgorithmParameterException if the given algorithm * parameters are inappropriate for this cipher, * or this cipher requires - * algorithm parameters and <code>params</code> is null, or the given + * algorithm parameters and {@code params} is null, or the given * algorithm parameters imply a cryptographic strength that would exceed * the legal limits (as determined from the configured jurisdiction * policy files). @@ -1475,14 +1475,14 @@ * * <p>The cipher is initialized for one of the following four operations: * encryption, decryption, key wrapping or key unwrapping, depending - * on the value of <code>opmode</code>. + * on the value of {@code opmode}. * * <p>If this cipher requires any algorithm parameters and - * <code>params</code> is null, the underlying cipher implementation is + * {@code params} is null, the underlying cipher implementation is * supposed to generate the required parameters itself (using * provider-specific default or random values) if it is being * initialized for encryption or key wrapping, and raise an - * <code>InvalidAlgorithmParameterException</code> if it is being + * {@code InvalidAlgorithmParameterException} if it is being * initialized for decryption or key unwrapping. * The generated parameters can be retrieved using * {@link #getParameters() getParameters} or @@ -1495,7 +1495,7 @@ * * <p>If this cipher (including its underlying feedback or padding scheme) * requires any random bytes (e.g., for parameter generation), it will get - * them from <code>random</code>. + * them from {@code random}. * * <p>Note that when a Cipher object is initialized, it loses all * previously-acquired state. In other words, initializing a Cipher is @@ -1503,9 +1503,9 @@ * it. * * @param opmode the operation mode of this cipher (this is one of the - * following: <code>ENCRYPT_MODE</code>, - * <code>DECRYPT_MODE</code>, <code>WRAP_MODE</code> - * or <code>UNWRAP_MODE</code>) + * following: {@code ENCRYPT_MODE}, + * {@code DECRYPT_MODE}, {@code WRAP_MODE} + * or {@code UNWRAP_MODE}) * @param key the encryption key * @param params the algorithm parameters * @param random the source of randomness @@ -1516,7 +1516,7 @@ * @exception InvalidAlgorithmParameterException if the given algorithm * parameters are inappropriate for this cipher, * or this cipher requires - * algorithm parameters and <code>params</code> is null, or the given + * algorithm parameters and {@code params} is null, or the given * algorithm parameters imply a cryptographic strength that would exceed * the legal limits (as determined from the configured jurisdiction * policy files). @@ -1552,15 +1552,15 @@ * Initializes this cipher with the public key from the given certificate. * <p> The cipher is initialized for one of the following four operations: * encryption, decryption, key wrapping or key unwrapping, depending - * on the value of <code>opmode</code>. + * on the value of {@code opmode}. * * <p>If the certificate is of type X.509 and has a <i>key usage</i> * extension field marked as critical, and the value of the <i>key usage</i> * extension field implies that the public key in * the certificate and its corresponding private key are not * supposed to be used for the operation represented by the value - * of <code>opmode</code>, - * an <code>InvalidKeyException</code> + * of {@code opmode}, + * an {@code InvalidKeyException} * is thrown. * * <p> If this cipher requires any algorithm parameters that cannot be @@ -1568,8 +1568,8 @@ * cipher * implementation is supposed to generate the required parameters itself * (using provider-specific default or random values) if it is being - * initialized for encryption or key wrapping, and raise an <code> - * InvalidKeyException</code> if it is being initialized for decryption or + * initialized for encryption or key wrapping, and raise an {@code + * InvalidKeyException} if it is being initialized for decryption or * key unwrapping. * The generated parameters can be retrieved using * {@link #getParameters() getParameters} or @@ -1583,7 +1583,7 @@ * <p>If this cipher (including its underlying feedback or padding scheme) * requires any random bytes (e.g., for parameter generation), it will get * them using the - * <code>SecureRandom</code> + * {@code SecureRandom} * implementation of the highest-priority * installed provider as the source of randomness. * (If none of the installed providers supply an implementation of @@ -1596,8 +1596,8 @@ * * @param opmode the operation mode of this cipher (this is one of the * following: - * <code>ENCRYPT_MODE</code>, <code>DECRYPT_MODE</code>, - * <code>WRAP_MODE</code> or <code>UNWRAP_MODE</code>) + * {@code ENCRYPT_MODE}, {@code DECRYPT_MODE}, + * {@code WRAP_MODE} or {@code UNWRAP_MODE}) * @param certificate the certificate * * @exception InvalidKeyException if the public key in the given @@ -1625,24 +1625,24 @@ * <p>The cipher is initialized for one of the following four operations: * encryption, decryption, key wrapping * or key unwrapping, depending on - * the value of <code>opmode</code>. + * the value of {@code opmode}. * * <p>If the certificate is of type X.509 and has a <i>key usage</i> * extension field marked as critical, and the value of the <i>key usage</i> * extension field implies that the public key in * the certificate and its corresponding private key are not * supposed to be used for the operation represented by the value of - * <code>opmode</code>, - * an <code>InvalidKeyException</code> + * {@code opmode}, + * an {@code InvalidKeyException} * is thrown. * * <p>If this cipher requires any algorithm parameters that cannot be - * derived from the public key in the given <code>certificate</code>, + * derived from the public key in the given {@code certificate}, * the underlying cipher * implementation is supposed to generate the required parameters itself * (using provider-specific default or random values) if it is being * initialized for encryption or key wrapping, and raise an - * <code>InvalidKeyException</code> if it is being + * {@code InvalidKeyException} if it is being * initialized for decryption or key unwrapping. * The generated parameters can be retrieved using * {@link #getParameters() getParameters} or @@ -1655,7 +1655,7 @@ * * <p>If this cipher (including its underlying feedback or padding scheme) * requires any random bytes (e.g., for parameter generation), it will get - * them from <code>random</code>. + * them from {@code random}. * * <p>Note that when a Cipher object is initialized, it loses all * previously-acquired state. In other words, initializing a Cipher is @@ -1664,8 +1664,8 @@ * * @param opmode the operation mode of this cipher (this is one of the * following: - * <code>ENCRYPT_MODE</code>, <code>DECRYPT_MODE</code>, - * <code>WRAP_MODE</code> or <code>UNWRAP_MODE</code>) + * {@code ENCRYPT_MODE}, {@code DECRYPT_MODE}, + * {@code WRAP_MODE} or {@code UNWRAP_MODE}) * @param certificate the certificate * @param random the source of randomness * @@ -1761,11 +1761,11 @@ * (depending on how this cipher was initialized), processing another data * part. * - * <p>The bytes in the <code>input</code> buffer are processed, and the + * <p>The bytes in the {@code input} buffer are processed, and the * result is stored in a new buffer. * - * <p>If <code>input</code> has a length of zero, this method returns - * <code>null</code>. + * <p>If {@code input} has a length of zero, this method returns + * {@code null}. * * @param input the input buffer * @@ -1796,15 +1796,15 @@ * (depending on how this cipher was initialized), processing another data * part. * - * <p>The first <code>inputLen</code> bytes in the <code>input</code> - * buffer, starting at <code>inputOffset</code> inclusive, are processed, + * <p>The first {@code inputLen} bytes in the {@code input} + * buffer, starting at {@code inputOffset} inclusive, are processed, * and the result is stored in a new buffer. * - * <p>If <code>inputLen</code> is zero, this method returns - * <code>null</code>. + * <p>If {@code inputLen} is zero, this method returns + * {@code null}. * * @param input the input buffer - * @param inputOffset the offset in <code>input</code> where the input + * @param inputOffset the offset in {@code input} where the input * starts * @param inputLen the input length * @@ -1836,31 +1836,31 @@ * (depending on how this cipher was initialized), processing another data * part. * - * <p>The first <code>inputLen</code> bytes in the <code>input</code> - * buffer, starting at <code>inputOffset</code> inclusive, are processed, - * and the result is stored in the <code>output</code> buffer. + * <p>The first {@code inputLen} bytes in the {@code input} + * buffer, starting at {@code inputOffset} inclusive, are processed, + * and the result is stored in the {@code output} buffer. * - * <p>If the <code>output</code> buffer is too small to hold the result, - * a <code>ShortBufferException</code> is thrown. In this case, repeat this + * <p>If the {@code output} buffer is too small to hold the result, + * a {@code ShortBufferException} is thrown. In this case, repeat this * call with a larger output buffer. Use * {@link #getOutputSize(int) getOutputSize} to determine how big * the output buffer should be. * - * <p>If <code>inputLen</code> is zero, this method returns + * <p>If {@code inputLen} is zero, this method returns * a length of zero. * * <p>Note: this method should be copy-safe, which means the - * <code>input</code> and <code>output</code> buffers can reference + * {@code input} and {@code output} buffers can reference * the same byte array and no unprocessed input data is overwritten * when the result is copied into the output buffer. * * @param input the input buffer - * @param inputOffset the offset in <code>input</code> where the input + * @param inputOffset the offset in {@code input} where the input * starts * @param inputLen the input length * @param output the buffer for the result * - * @return the number of bytes stored in <code>output</code> + * @return the number of bytes stored in {@code output} * * @exception IllegalStateException if this cipher is in a wrong state * (e.g., has not been initialized) @@ -1891,34 +1891,34 @@ * (depending on how this cipher was initialized), processing another data * part. * - * <p>The first <code>inputLen</code> bytes in the <code>input</code> - * buffer, starting at <code>inputOffset</code> inclusive, are processed, - * and the result is stored in the <code>output</code> buffer, starting at - * <code>outputOffset</code> inclusive. + * <p>The first {@code inputLen} bytes in the {@code input} + * buffer, starting at {@code inputOffset} inclusive, are processed, + * and the result is stored in the {@code output} buffer, starting at + * {@code outputOffset} inclusive. * - * <p>If the <code>output</code> buffer is too small to hold the result, - * a <code>ShortBufferException</code> is thrown. In this case, repeat this + * <p>If the {@code output} buffer is too small to hold the result, + * a {@code ShortBufferException} is thrown. In this case, repeat this * call with a larger output buffer. Use * {@link #getOutputSize(int) getOutputSize} to determine how big * the output buffer should be. * - * <p>If <code>inputLen</code> is zero, this method returns + * <p>If {@code inputLen} is zero, this method returns * a length of zero. * * <p>Note: this method should be copy-safe, which means the - * <code>input</code> and <code>output</code> buffers can reference + * {@code input} and {@code output} buffers can reference * the same byte array and no unprocessed input data is overwritten * when the result is copied into the output buffer. * * @param input the input buffer - * @param inputOffset the offset in <code>input</code> where the input + * @param inputOffset the offset in {@code input} where the input * starts * @param inputLen the input length * @param output the buffer for the result - * @param outputOffset the offset in <code>output</code> where the result + * @param outputOffset the offset in {@code output} where the result * is stored * - * @return the number of bytes stored in <code>output</code> + * @return the number of bytes stored in {@code output} * * @exception IllegalStateException if this cipher is in a wrong state * (e.g., has not been initialized) @@ -1950,29 +1950,29 @@ * (depending on how this cipher was initialized), processing another data * part. * - * <p>All <code>input.remaining()</code> bytes starting at - * <code>input.position()</code> are processed. The result is stored + * <p>All {@code input.remaining()} bytes starting at + * {@code input.position()} are processed. The result is stored * in the output buffer. * Upon return, the input buffer's position will be equal * to its limit; its limit will not have changed. The output buffer's * position will have advanced by n, where n is the value returned * by this method; the output buffer's limit will not have changed. * - * <p>If <code>output.remaining()</code> bytes are insufficient to - * hold the result, a <code>ShortBufferException</code> is thrown. + * <p>If {@code output.remaining()} bytes are insufficient to + * hold the result, a {@code ShortBufferException} is thrown. * In this case, repeat this call with a larger output buffer. Use * {@link #getOutputSize(int) getOutputSize} to determine how big * the output buffer should be. * * <p>Note: this method should be copy-safe, which means the - * <code>input</code> and <code>output</code> buffers can reference + * {@code input} and {@code output} buffers can reference * the same block of memory and no unprocessed input data is overwritten * when the result is copied into the output buffer. * * @param input the input ByteBuffer * @param output the output ByteByffer * - * @return the number of bytes stored in <code>output</code> + * @return the number of bytes stored in {@code output} * * @exception IllegalStateException if this cipher is in a wrong state * (e.g., has not been initialized) @@ -2007,7 +2007,7 @@ * on how this cipher was initialized. * * <p>Input data that may have been buffered during a previous - * <code>update</code> operation is processed, with padding (if requested) + * {@code update} operation is processed, with padding (if requested) * being applied. * If an AEAD mode such as GCM/CCM is being used, the authentication * tag is appended in the case of encryption, or verified in the @@ -2015,10 +2015,10 @@ * The result is stored in a new buffer. * * <p>Upon finishing, this method resets this cipher object to the state - * it was in when previously initialized via a call to <code>init</code>. + * it was in when previously initialized via a call to {@code init}. * That is, the object is reset and available to encrypt or decrypt * (depending on the operation mode that was specified in the call to - * <code>init</code>) more data. + * {@code init}) more data. * * <p>Note: if any exception is thrown, this cipher object may need to * be reset before it can be used again. @@ -2052,34 +2052,34 @@ * on how this cipher was initialized. * * <p>Input data that may have been buffered during a previous - * <code>update</code> operation is processed, with padding (if requested) + * {@code update} operation is processed, with padding (if requested) * being applied. * If an AEAD mode such as GCM/CCM is being used, the authentication * tag is appended in the case of encryption, or verified in the * case of decryption. - * The result is stored in the <code>output</code> buffer, starting at - * <code>outputOffset</code> inclusive. + * The result is stored in the {@code output} buffer, starting at + * {@code outputOffset} inclusive. * - * <p>If the <code>output</code> buffer is too small to hold the result, - * a <code>ShortBufferException</code> is thrown. In this case, repeat this + * <p>If the {@code output} buffer is too small to hold the result, + * a {@code ShortBufferException} is thrown. In this case, repeat this * call with a larger output buffer. Use * {@link #getOutputSize(int) getOutputSize} to determine how big * the output buffer should be. * * <p>Upon finishing, this method resets this cipher object to the state - * it was in when previously initialized via a call to <code>init</code>. + * it was in when previously initialized via a call to {@code init}. * That is, the object is reset and available to encrypt or decrypt * (depending on the operation mode that was specified in the call to - * <code>init</code>) more data. + * {@code init}) more data. * * <p>Note: if any exception is thrown, this cipher object may need to * be reset before it can be used again. * * @param output the buffer for the result - * @param outputOffset the offset in <code>output</code> where the result + * @param outputOffset the offset in {@code output} where the result * is stored * - * @return the number of bytes stored in <code>output</code> + * @return the number of bytes stored in {@code output} * * @exception IllegalStateException if this cipher is in a wrong state * (e.g., has not been initialized) @@ -2116,8 +2116,8 @@ * multiple-part operation. The data is encrypted or decrypted, * depending on how this cipher was initialized. * - * <p>The bytes in the <code>input</code> buffer, and any input bytes that - * may have been buffered during a previous <code>update</code> operation, + * <p>The bytes in the {@code input} buffer, and any input bytes that + * may have been buffered during a previous {@code update} operation, * are processed, with padding (if requested) being applied. * If an AEAD mode such as GCM/CCM is being used, the authentication * tag is appended in the case of encryption, or verified in the @@ -2125,10 +2125,10 @@ * The result is stored in a new buffer. * * <p>Upon finishing, this method resets this cipher object to the state - * it was in when previously initialized via a call to <code>init</code>. + * it was in when previously initialized via a call to {@code init}. * That is, the object is reset and available to encrypt or decrypt * (depending on the operation mode that was specified in the call to - * <code>init</code>) more data. + * {@code init}) more data. * * <p>Note: if any exception is thrown, this cipher object may need to * be reset before it can be used again. @@ -2169,9 +2169,9 @@ * multiple-part operation. The data is encrypted or decrypted, * depending on how this cipher was initialized. * - * <p>The first <code>inputLen</code> bytes in the <code>input</code> - * buffer, starting at <code>inputOffset</code> inclusive, and any input - * bytes that may have been buffered during a previous <code>update</code> + * <p>The first {@code inputLen} bytes in the {@code input} + * buffer, starting at {@code inputOffset} inclusive, and any input + * bytes that may have been buffered during a previous {@code update} * operation, are processed, with padding (if requested) being applied. * If an AEAD mode such as GCM/CCM is being used, the authentication * tag is appended in the case of encryption, or verified in the @@ -2179,16 +2179,16 @@ * The result is stored in a new buffer. * * <p>Upon finishing, this method resets this cipher object to the state - * it was in when previously initialized via a call to <code>init</code>. + * it was in when previously initialized via a call to {@code init}. * That is, the object is reset and available to encrypt or decrypt * (depending on the operation mode that was specified in the call to - * <code>init</code>) more data. + * {@code init}) more data. * * <p>Note: if any exception is thrown, this cipher object may need to * be reset before it can be used again. * * @param input the input buffer - * @param inputOffset the offset in <code>input</code> where the input + * @param inputOffset the offset in {@code input} where the input * starts * @param inputLen the input length * @@ -2227,42 +2227,42 @@ * multiple-part operation. The data is encrypted or decrypted, * depending on how this cipher was initialized. * - * <p>The first <code>inputLen</code> bytes in the <code>input</code> - * buffer, starting at <code>inputOffset</code> inclusive, and any input - * bytes that may have been buffered during a previous <code>update</code> + * <p>The first {@code inputLen} bytes in the {@code input} + * buffer, starting at {@code inputOffset} inclusive, and any input + * bytes that may have been buffered during a previous {@code update} * operation, are processed, with padding (if requested) being applied. * If an AEAD mode such as GCM/CCM is being used, the authentication * tag is appended in the case of encryption, or verified in the * case of decryption. - * The result is stored in the <code>output</code> buffer. + * The result is stored in the {@code output} buffer. * - * <p>If the <code>output</code> buffer is too small to hold the result, - * a <code>ShortBufferException</code> is thrown. In this case, repeat this + * <p>If the {@code output} buffer is too small to hold the result, + * a {@code ShortBufferException} is thrown. In this case, repeat this * call with a larger output buffer. Use * {@link #getOutputSize(int) getOutputSize} to determine how big * the output buffer should be. * * <p>Upon finishing, this method resets this cipher object to the state - * it was in when previously initialized via a call to <code>init</code>. + * it was in when previously initialized via a call to {@code init}. * That is, the object is reset and available to encrypt or decrypt * (depending on the operation mode that was specified in the call to - * <code>init</code>) more data. + * {@code init}) more data. * * <p>Note: if any exception is thrown, this cipher object may need to * be reset before it can be used again. * * <p>Note: this method should be copy-safe, which means the - * <code>input</code> and <code>output</code> buffers can reference + * {@code input} and {@code output} buffers can reference * the same byte array and no unprocessed input data is overwritten * when the result is copied into the output buffer. * * @param input the input buffer - * @param inputOffset the offset in <code>input</code> where the input + * @param inputOffset the offset in {@code input} where the input * starts * @param inputLen the input length * @param output the buffer for the result * - * @return the number of bytes stored in <code>output</code> + * @return the number of bytes stored in {@code output} * * @exception IllegalStateException if this cipher is in a wrong state * (e.g., has not been initialized) @@ -2302,46 +2302,46 @@ * multiple-part operation. The data is encrypted or decrypted, * depending on how this cipher was initialized. * - * <p>The first <code>inputLen</code> bytes in the <code>input</code> - * buffer, starting at <code>inputOffset</code> inclusive, and any input + * <p>The first {@code inputLen} bytes in the {@code input} + * buffer, starting at {@code inputOffset} inclusive, and any input * bytes that may have been buffered during a previous - * <code>update</code> operation, are processed, with padding + * {@code update} operation, are processed, with padding * (if requested) being applied. * If an AEAD mode such as GCM/CCM is being used, the authentication * tag is appended in the case of encryption, or verified in the * case of decryption. - * The result is stored in the <code>output</code> buffer, starting at - * <code>outputOffset</code> inclusive. + * The result is stored in the {@code output} buffer, starting at + * {@code outputOffset} inclusive. * - * <p>If the <code>output</code> buffer is too small to hold the result, - * a <code>ShortBufferException</code> is thrown. In this case, repeat this + * <p>If the {@code output} buffer is too small to hold the result, + * a {@code ShortBufferException} is thrown. In this case, repeat this * call with a larger output buffer. Use * {@link #getOutputSize(int) getOutputSize} to determine how big * the output buffer should be. * * <p>Upon finishing, this method resets this cipher object to the state - * it was in when previously initialized via a call to <code>init</code>. + * it was in when previously initialized via a call to {@code init}. * That is, the object is reset and available to encrypt or decrypt * (depending on the operation mode that was specified in the call to - * <code>init</code>) more data. + * {@code init}) more data. * * <p>Note: if any exception is thrown, this cipher object may need to * be reset before it can be used again. * * <p>Note: this method should be copy-safe, which means the - * <code>input</code> and <code>output</code> buffers can reference + * {@code input} and {@code output} buffers can reference * the same byte array and no unprocessed input data is overwritten * when the result is copied into the output buffer. * * @param input the input buffer - * @param inputOffset the offset in <code>input</code> where the input + * @param inputOffset the offset in {@code input} where the input * starts * @param inputLen the input length * @param output the buffer for the result - * @param outputOffset the offset in <code>output</code> where the result + * @param outputOffset the offset in {@code output} where the result * is stored * - * @return the number of bytes stored in <code>output</code> + * @return the number of bytes stored in {@code output} * * @exception IllegalStateException if this cipher is in a wrong state * (e.g., has not been initialized) @@ -2382,8 +2382,8 @@ * multiple-part operation. The data is encrypted or decrypted, * depending on how this cipher was initialized. * - * <p>All <code>input.remaining()</code> bytes starting at - * <code>input.position()</code> are processed. + * <p>All {@code input.remaining()} bytes starting at + * {@code input.position()} are processed. * If an AEAD mode such as GCM/CCM is being used, the authentication * tag is appended in the case of encryption, or verified in the * case of decryption. @@ -2393,30 +2393,30 @@ * position will have advanced by n, where n is the value returned * by this method; the output buffer's limit will not have changed. * - * <p>If <code>output.remaining()</code> bytes are insufficient to - * hold the result, a <code>ShortBufferException</code> is thrown. + * <p>If {@code output.remaining()} bytes are insufficient to + * hold the result, a {@code ShortBufferException} is thrown. * In this case, repeat this call with a larger output buffer. Use * {@link #getOutputSize(int) getOutputSize} to determine how big * the output buffer should be. * * <p>Upon finishing, this method resets this cipher object to the state - * it was in when previously initialized via a call to <code>init</code>. + * it was in when previously initialized via a call to {@code init}. * That is, the object is reset and available to encrypt or decrypt * (depending on the operation mode that was specified in the call to - * <code>init</code>) more data. + * {@code init}) more data. * * <p>Note: if any exception is thrown, this cipher object may need to * be reset before it can be used again. * * <p>Note: this method should be copy-safe, which means the - * <code>input</code> and <code>output</code> buffers can reference + * {@code input} and {@code output} buffers can reference * the same byte array and no unprocessed input data is overwritten * when the result is copied into the output buffer. * * @param input the input ByteBuffer * @param output the output ByteBuffer * - * @return the number of bytes stored in <code>output</code> + * @return the number of bytes stored in {@code output} * * @exception IllegalStateException if this cipher is in a wrong state * (e.g., has not been initialized) @@ -2506,8 +2506,8 @@ * key. * * @param wrappedKeyType the type of the wrapped key. This must be one of - * <code>SECRET_KEY</code>, <code>PRIVATE_KEY</code>, or - * <code>PUBLIC_KEY</code>. + * {@code SECRET_KEY}, {@code PRIVATE_KEY}, or + * {@code PUBLIC_KEY}. * * @return the unwrapped key. * @@ -2515,12 +2515,12 @@ * (e.g., has not been initialized). * * @exception NoSuchAlgorithmException if no installed providers - * can create keys of type <code>wrappedKeyType</code> for the - * <code>wrappedKeyAlgorithm</code>. + * can create keys of type {@code wrappedKeyType} for the + * {@code wrappedKeyAlgorithm}. * - * @exception InvalidKeyException if <code>wrappedKey</code> does not - * represent a wrapped key of type <code>wrappedKeyType</code> for - * the <code>wrappedKeyAlgorithm</code>. + * @exception InvalidKeyException if {@code wrappedKey} does not + * represent a wrapped key of type {@code wrappedKeyType} for + * the {@code wrappedKeyAlgorithm}. * * @throws UnsupportedOperationException if the corresponding method in the * {@code CipherSpi} is not supported. @@ -2599,8 +2599,8 @@ * * @param transformation the cipher transformation. * @return the maximum key length in bits or Integer.MAX_VALUE. - * @exception NullPointerException if <code>transformation</code> is null. - * @exception NoSuchAlgorithmException if <code>transformation</code> + * @exception NullPointerException if {@code transformation} is null. + * @exception NoSuchAlgorithmException if {@code transformation} * is not a valid transformation, i.e. in the form of "algorithm" or * "algorithm/mode/padding". * @since 1.5 @@ -2622,9 +2622,9 @@ * @param transformation the cipher transformation. * @return an AlgorithmParameterSpec which holds the maximum * value or null. - * @exception NullPointerException if <code>transformation</code> + * @exception NullPointerException if {@code transformation} * is null. - * @exception NoSuchAlgorithmException if <code>transformation</code> + * @exception NoSuchAlgorithmException if {@code transformation} * is not a valid transformation, i.e. in the form of "algorithm" or * "algorithm/mode/padding". * @since 1.5
--- a/src/share/classes/javax/crypto/KeyAgreement.java Wed Apr 17 03:47:21 2019 +0100 +++ b/src/share/classes/javax/crypto/KeyAgreement.java Thu Apr 18 03:46:32 2019 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2019, 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 @@ -40,24 +40,24 @@ * exchange) protocol. * <p> * The keys involved in establishing a shared secret are created by one of the - * key generators (<code>KeyPairGenerator</code> or - * <code>KeyGenerator</code>), a <code>KeyFactory</code>, or as a result from + * key generators ({@code KeyPairGenerator} or + * {@code KeyGenerator}), a {@code KeyFactory}, or as a result from * an intermediate phase of the key agreement protocol. * - * <p> For each of the correspondents in the key exchange, <code>doPhase</code> + * <p> For each of the correspondents in the key exchange, {@code doPhase} * needs to be called. For example, if this key exchange is with one other - * party, <code>doPhase</code> needs to be called once, with the - * <code>lastPhase</code> flag set to <code>true</code>. + * party, {@code doPhase} needs to be called once, with the + * {@code lastPhase} flag set to {@code true}. * If this key exchange is - * with two other parties, <code>doPhase</code> needs to be called twice, - * the first time setting the <code>lastPhase</code> flag to - * <code>false</code>, and the second time setting it to <code>true</code>. + * with two other parties, {@code doPhase} needs to be called twice, + * the first time setting the {@code lastPhase} flag to + * {@code false}, and the second time setting it to {@code true}. * There may be any number of parties involved in a key exchange. * * <p> Every implementation of the Java platform is required to support the - * following standard <code>KeyAgreement</code> algorithm: + * following standard {@code KeyAgreement} algorithm: * <ul> - * <li><tt>DiffieHellman</tt></li> + * <li>{@code DiffieHellman}</li> * </ul> * This algorithm is described in the <a href= * "{@docRoot}/../technotes/guides/security/StandardNames.html#KeyAgreement"> @@ -125,20 +125,20 @@ } /** - * Returns the algorithm name of this <code>KeyAgreement</code> object. + * Returns the algorithm name of this {@code KeyAgreement} object. * * <p>This is the same name that was specified in one of the - * <code>getInstance</code> calls that created this - * <code>KeyAgreement</code> object. + * {@code getInstance} calls that created this + * {@code KeyAgreement} object. * - * @return the algorithm name of this <code>KeyAgreement</code> object. + * @return the algorithm name of this {@code KeyAgreement} object. */ public final String getAlgorithm() { return this.algorithm; } /** - * Returns a <code>KeyAgreement</code> object that implements the + * Returns a {@code KeyAgreement} object that implements the * specified key agreement algorithm. * * <p> This method traverses the list of registered security Providers, @@ -157,7 +157,7 @@ * Java Cryptography Architecture Standard Algorithm Name Documentation</a> * for information about standard algorithm names. * - * @return the new <code>KeyAgreement</code> object. + * @return the new {@code KeyAgreement} object. * * @exception NullPointerException if the specified algorithm * is null. @@ -186,7 +186,7 @@ } /** - * Returns a <code>KeyAgreement</code> object that implements the + * Returns a {@code KeyAgreement} object that implements the * specified key agreement algorithm. * * <p> A new KeyAgreement object encapsulating the @@ -206,7 +206,7 @@ * * @param provider the name of the provider. * - * @return the new <code>KeyAgreement</code> object. + * @return the new {@code KeyAgreement} object. * * @exception NullPointerException if the specified algorithm * is null. @@ -218,7 +218,7 @@ * @exception NoSuchProviderException if the specified provider is not * registered in the security provider list. * - * @exception IllegalArgumentException if the <code>provider</code> + * @exception IllegalArgumentException if the {@code provider} * is null or empty. * * @see java.security.Provider @@ -233,7 +233,7 @@ } /** - * Returns a <code>KeyAgreement</code> object that implements the + * Returns a {@code KeyAgreement} object that implements the * specified key agreement algorithm. * * <p> A new KeyAgreement object encapsulating the @@ -250,7 +250,7 @@ * * @param provider the provider. * - * @return the new <code>KeyAgreement</code> object. + * @return the new {@code KeyAgreement} object. * * @exception NullPointerException if the specified algorithm * is null. @@ -259,7 +259,7 @@ * implementation for the specified algorithm is not available * from the specified Provider object. * - * @exception IllegalArgumentException if the <code>provider</code> + * @exception IllegalArgumentException if the {@code provider} * is null. * * @see java.security.Provider @@ -408,9 +408,9 @@ } /** - * Returns the provider of this <code>KeyAgreement</code> object. + * Returns the provider of this {@code KeyAgreement} object. * - * @return the provider of this <code>KeyAgreement</code> object + * @return the provider of this {@code KeyAgreement} object */ public final Provider getProvider() { chooseFirstProvider(); @@ -447,10 +447,10 @@ * parameters required for this key agreement. * * <p> If the key agreement algorithm requires random bytes, it gets them - * from the given source of randomness, <code>random</code>. + * from the given source of randomness, {@code random}. * However, if the underlying * algorithm implementation does not require any random bytes, - * <code>random</code> is ignored. + * {@code random} is ignored. * * @param key the party's private information. For example, in the case * of the Diffie-Hellman key agreement, this would be the party's own @@ -570,9 +570,9 @@ /** * Generates the shared secret and returns it in a new buffer. * - * <p>This method resets this <code>KeyAgreement</code> object, so that it + * <p>This method resets this {@code KeyAgreement} object, so that it * can be reused for further key agreements. Unless this key agreement is - * reinitialized with one of the <code>init</code> methods, the same + * reinitialized with one of the {@code init} methods, the same * private information and algorithm parameters will be used for * subsequent key agreements. * @@ -588,23 +588,23 @@ /** * Generates the shared secret, and places it into the buffer - * <code>sharedSecret</code>, beginning at <code>offset</code> inclusive. + * {@code sharedSecret}, beginning at {@code offset} inclusive. * - * <p>If the <code>sharedSecret</code> buffer is too small to hold the - * result, a <code>ShortBufferException</code> is thrown. + * <p>If the {@code sharedSecret} buffer is too small to hold the + * result, a {@code ShortBufferException} is thrown. * In this case, this call should be repeated with a larger output buffer. * - * <p>This method resets this <code>KeyAgreement</code> object, so that it + * <p>This method resets this {@code KeyAgreement} object, so that it * can be reused for further key agreements. Unless this key agreement is - * reinitialized with one of the <code>init</code> methods, the same + * reinitialized with one of the {@code init} methods, the same * private information and algorithm parameters will be used for * subsequent key agreements. * * @param sharedSecret the buffer for the shared secret - * @param offset the offset in <code>sharedSecret</code> where the + * @param offset the offset in {@code sharedSecret} where the * shared secret will be stored * - * @return the number of bytes placed into <code>sharedSecret</code> + * @return the number of bytes placed into {@code sharedSecret} * * @exception IllegalStateException if this key agreement has not been * completed yet @@ -619,12 +619,12 @@ } /** - * Creates the shared secret and returns it as a <code>SecretKey</code> + * Creates the shared secret and returns it as a {@code SecretKey} * object of the specified algorithm. * - * <p>This method resets this <code>KeyAgreement</code> object, so that it + * <p>This method resets this {@code KeyAgreement} object, so that it * can be reused for further key agreements. Unless this key agreement is - * reinitialized with one of the <code>init</code> methods, the same + * reinitialized with one of the {@code init} methods, the same * private information and algorithm parameters will be used for * subsequent key agreements. *
--- a/src/share/classes/javax/crypto/KeyGenerator.java Wed Apr 17 03:47:21 2019 +0100 +++ b/src/share/classes/javax/crypto/KeyGenerator.java Thu Apr 18 03:46:32 2019 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2019, 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 @@ /** * This class provides the functionality of a secret (symmetric) key generator. * - * <p>Key generators are constructed using one of the <code>getInstance</code> + * <p>Key generators are constructed using one of the {@code getInstance} * class methods of this class. * * <p>KeyGenerator objects are reusable, i.e., after a key has been @@ -57,14 +57,14 @@ * {@link #init(int, java.security.SecureRandom) init} * method in this KeyGenerator class that takes these two universally * shared types of arguments. There is also one that takes just a - * <code>keysize</code> argument, and uses the SecureRandom implementation + * {@code keysize} argument, and uses the SecureRandom implementation * of the highest-priority installed provider as the source of randomness * (or a system-provided source of randomness if none of the installed * providers supply a SecureRandom implementation), and one that takes just a * source of randomness. * * <p>Since no other parameters are specified when you call the above - * algorithm-independent <code>init</code> methods, it is up to the + * algorithm-independent {@code init} methods, it is up to the * provider what to do about the algorithm-specific parameters (if any) to be * associated with each of the keys. * @@ -72,8 +72,8 @@ * <p>For situations where a set of algorithm-specific parameters already * exists, there are two * {@link #init(java.security.spec.AlgorithmParameterSpec) init} - * methods that have an <code>AlgorithmParameterSpec</code> - * argument. One also has a <code>SecureRandom</code> argument, while the + * methods that have an {@code AlgorithmParameterSpec} + * argument. One also has a {@code SecureRandom} argument, while the * other uses the SecureRandom implementation * of the highest-priority installed provider as the source of randomness * (or a system-provided source of randomness if none of the installed @@ -81,18 +81,18 @@ * </ul> * * <p>In case the client does not explicitly initialize the KeyGenerator - * (via a call to an <code>init</code> method), each provider must + * (via a call to an {@code init} method), each provider must * supply (and document) a default initialization. * * <p> Every implementation of the Java platform is required to support the - * following standard <code>KeyGenerator</code> algorithms with the keysizes in + * following standard {@code KeyGenerator} algorithms with the keysizes in * parentheses: * <ul> - * <li><tt>AES</tt> (128)</li> - * <li><tt>DES</tt> (56)</li> - * <li><tt>DESede</tt> (168)</li> - * <li><tt>HmacSHA1</tt></li> - * <li><tt>HmacSHA256</tt></li> + * <li>{@code AES} (128)</li> + * <li>{@code DES} (56)</li> + * <li>{@code DESede} (168)</li> + * <li>{@code HmacSHA1}</li> + * <li>{@code HmacSHA256}</li> * </ul> * These algorithms are described in the <a href= * "{@docRoot}/../technotes/guides/security/StandardNames.html#KeyGenerator"> @@ -177,20 +177,20 @@ } /** - * Returns the algorithm name of this <code>KeyGenerator</code> object. + * Returns the algorithm name of this {@code KeyGenerator} object. * * <p>This is the same name that was specified in one of the - * <code>getInstance</code> calls that created this - * <code>KeyGenerator</code> object. + * {@code getInstance} calls that created this + * {@code KeyGenerator} object. * - * @return the algorithm name of this <code>KeyGenerator</code> object. + * @return the algorithm name of this {@code KeyGenerator} object. */ public final String getAlgorithm() { return this.algorithm; } /** - * Returns a <code>KeyGenerator</code> object that generates secret keys + * Returns a {@code KeyGenerator} object that generates secret keys * for the specified algorithm. * * <p> This method traverses the list of registered security Providers, @@ -208,7 +208,7 @@ * Java Cryptography Architecture Standard Algorithm Name Documentation</a> * for information about standard algorithm names. * - * @return the new <code>KeyGenerator</code> object. + * @return the new {@code KeyGenerator} object. * * @exception NullPointerException if the specified algorithm is null. * @@ -224,7 +224,7 @@ } /** - * Returns a <code>KeyGenerator</code> object that generates secret keys + * Returns a {@code KeyGenerator} object that generates secret keys * for the specified algorithm. * * <p> A new KeyGenerator object encapsulating the @@ -243,7 +243,7 @@ * * @param provider the name of the provider. * - * @return the new <code>KeyGenerator</code> object. + * @return the new {@code KeyGenerator} object. * * @exception NullPointerException if the specified algorithm is null. * @@ -254,7 +254,7 @@ * @exception NoSuchProviderException if the specified provider is not * registered in the security provider list. * - * @exception IllegalArgumentException if the <code>provider</code> + * @exception IllegalArgumentException if the {@code provider} * is null or empty. * * @see java.security.Provider @@ -269,7 +269,7 @@ } /** - * Returns a <code>KeyGenerator</code> object that generates secret keys + * Returns a {@code KeyGenerator} object that generates secret keys * for the specified algorithm. * * <p> A new KeyGenerator object encapsulating the @@ -285,7 +285,7 @@ * * @param provider the provider. * - * @return the new <code>KeyGenerator</code> object. + * @return the new {@code KeyGenerator} object. * * @exception NullPointerException if the specified algorithm is null. * @@ -293,7 +293,7 @@ * implementation for the specified algorithm is not available * from the specified Provider object. * - * @exception IllegalArgumentException if the <code>provider</code> + * @exception IllegalArgumentException if the {@code provider} * is null. * * @see java.security.Provider @@ -307,9 +307,9 @@ } /** - * Returns the provider of this <code>KeyGenerator</code> object. + * Returns the provider of this {@code KeyGenerator} object. * - * @return the provider of this <code>KeyGenerator</code> object + * @return the provider of this {@code KeyGenerator} object */ public final Provider getProvider() { synchronized (lock) { @@ -437,7 +437,7 @@ * @param params the key generation parameters * @param random the source of randomness for this key generator * - * @exception InvalidAlgorithmParameterException if <code>params</code> is + * @exception InvalidAlgorithmParameterException if {@code params} is * inappropriate for this key generator */ public final void init(AlgorithmParameterSpec params, SecureRandom random)
--- a/src/share/classes/javax/crypto/Mac.java Wed Apr 17 03:47:21 2019 +0100 +++ b/src/share/classes/javax/crypto/Mac.java Thu Apr 18 03:46:32 2019 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2019, 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 @@ -54,11 +54,11 @@ * specified in RFC 2104. * * <p> Every implementation of the Java platform is required to support - * the following standard <code>Mac</code> algorithms: + * the following standard {@code Mac} algorithms: * <ul> - * <li><tt>HmacMD5</tt></li> - * <li><tt>HmacSHA1</tt></li> - * <li><tt>HmacSHA256</tt></li> + * <li>{@code HmacMD5}</li> + * <li>{@code HmacSHA1}</li> + * <li>{@code HmacSHA256}</li> * </ul> * These algorithms are described in the * <a href="{@docRoot}/../technotes/guides/security/StandardNames.html#Mac"> @@ -127,20 +127,20 @@ } /** - * Returns the algorithm name of this <code>Mac</code> object. + * Returns the algorithm name of this {@code Mac} object. * * <p>This is the same name that was specified in one of the - * <code>getInstance</code> calls that created this - * <code>Mac</code> object. + * {@code getInstance} calls that created this + * {@code Mac} object. * - * @return the algorithm name of this <code>Mac</code> object. + * @return the algorithm name of this {@code Mac} object. */ public final String getAlgorithm() { return this.algorithm; } /** - * Returns a <code>Mac</code> object that implements the + * Returns a {@code Mac} object that implements the * specified MAC algorithm. * * <p> This method traverses the list of registered security Providers, @@ -158,7 +158,7 @@ * Java Cryptography Architecture Standard Algorithm Name Documentation</a> * for information about standard algorithm names. * - * @return the new <code>Mac</code> object. + * @return the new {@code Mac} object. * * @exception NoSuchAlgorithmException if no Provider supports a * MacSpi implementation for the @@ -183,7 +183,7 @@ } /** - * Returns a <code>Mac</code> object that implements the + * Returns a {@code Mac} object that implements the * specified MAC algorithm. * * <p> A new Mac object encapsulating the @@ -202,7 +202,7 @@ * * @param provider the name of the provider. * - * @return the new <code>Mac</code> object. + * @return the new {@code Mac} object. * * @exception NoSuchAlgorithmException if a MacSpi * implementation for the specified algorithm is not @@ -211,7 +211,7 @@ * @exception NoSuchProviderException if the specified provider is not * registered in the security provider list. * - * @exception IllegalArgumentException if the <code>provider</code> + * @exception IllegalArgumentException if the {@code provider} * is null or empty. * * @see java.security.Provider @@ -224,7 +224,7 @@ } /** - * Returns a <code>Mac</code> object that implements the + * Returns a {@code Mac} object that implements the * specified MAC algorithm. * * <p> A new Mac object encapsulating the @@ -240,13 +240,13 @@ * * @param provider the provider. * - * @return the new <code>Mac</code> object. + * @return the new {@code Mac} object. * * @exception NoSuchAlgorithmException if a MacSpi * implementation for the specified algorithm is not available * from the specified Provider object. * - * @exception IllegalArgumentException if the <code>provider</code> + * @exception IllegalArgumentException if the {@code provider} * is null. * * @see java.security.Provider @@ -380,9 +380,9 @@ } /** - * Returns the provider of this <code>Mac</code> object. + * Returns the provider of this {@code Mac} object. * - * @return the provider of this <code>Mac</code> object. + * @return the provider of this {@code Mac} object. */ public final Provider getProvider() { chooseFirstProvider(); @@ -400,7 +400,7 @@ } /** - * Initializes this <code>Mac</code> object with the given key. + * Initializes this {@code Mac} object with the given key. * * @param key the key. * @@ -426,7 +426,7 @@ } /** - * Initializes this <code>Mac</code> object with the given key and + * Initializes this {@code Mac} object with the given key and * algorithm parameters. * * @param key the key. @@ -457,7 +457,7 @@ * * @param input the input byte to be processed. * - * @exception IllegalStateException if this <code>Mac</code> has not been + * @exception IllegalStateException if this {@code Mac} has not been * initialized. */ public final void update(byte input) throws IllegalStateException { @@ -473,7 +473,7 @@ * * @param input the array of bytes to be processed. * - * @exception IllegalStateException if this <code>Mac</code> has not been + * @exception IllegalStateException if this {@code Mac} has not been * initialized. */ public final void update(byte[] input) throws IllegalStateException { @@ -487,14 +487,14 @@ } /** - * Processes the first <code>len</code> bytes in <code>input</code>, - * starting at <code>offset</code> inclusive. + * Processes the first {@code len} bytes in {@code input}, + * starting at {@code offset} inclusive. * * @param input the input buffer. - * @param offset the offset in <code>input</code> where the input starts. + * @param offset the offset in {@code input} where the input starts. * @param len the number of bytes to process. * - * @exception IllegalStateException if this <code>Mac</code> has not been + * @exception IllegalStateException if this {@code Mac} has not been * initialized. */ public final void update(byte[] input, int offset, int len) @@ -512,14 +512,14 @@ } /** - * Processes <code>input.remaining()</code> bytes in the ByteBuffer - * <code>input</code>, starting at <code>input.position()</code>. + * Processes {@code input.remaining()} bytes in the ByteBuffer + * {@code input}, starting at {@code input.position()}. * Upon return, the buffer's position will be equal to its limit; * its limit will not have changed. * * @param input the ByteBuffer * - * @exception IllegalStateException if this <code>Mac</code> has not been + * @exception IllegalStateException if this {@code Mac} has not been * initialized. * @since 1.5 */ @@ -537,20 +537,20 @@ /** * Finishes the MAC operation. * - * <p>A call to this method resets this <code>Mac</code> object to the + * <p>A call to this method resets this {@code Mac} object to the * state it was in when previously initialized via a call to - * <code>init(Key)</code> or - * <code>init(Key, AlgorithmParameterSpec)</code>. + * {@code init(Key)} or + * {@code init(Key, AlgorithmParameterSpec)}. * That is, the object is reset and available to generate another MAC from - * the same key, if desired, via new calls to <code>update</code> and - * <code>doFinal</code>. - * (In order to reuse this <code>Mac</code> object with a different key, - * it must be reinitialized via a call to <code>init(Key)</code> or - * <code>init(Key, AlgorithmParameterSpec)</code>. + * the same key, if desired, via new calls to {@code update} and + * {@code doFinal}. + * (In order to reuse this {@code Mac} object with a different key, + * it must be reinitialized via a call to {@code init(Key)} or + * {@code init(Key, AlgorithmParameterSpec)}. * * @return the MAC result. * - * @exception IllegalStateException if this <code>Mac</code> has not been + * @exception IllegalStateException if this {@code Mac} has not been * initialized. */ public final byte[] doFinal() throws IllegalStateException { @@ -566,27 +566,27 @@ /** * Finishes the MAC operation. * - * <p>A call to this method resets this <code>Mac</code> object to the + * <p>A call to this method resets this {@code Mac} object to the * state it was in when previously initialized via a call to - * <code>init(Key)</code> or - * <code>init(Key, AlgorithmParameterSpec)</code>. + * {@code init(Key)} or + * {@code init(Key, AlgorithmParameterSpec)}. * That is, the object is reset and available to generate another MAC from - * the same key, if desired, via new calls to <code>update</code> and - * <code>doFinal</code>. - * (In order to reuse this <code>Mac</code> object with a different key, - * it must be reinitialized via a call to <code>init(Key)</code> or - * <code>init(Key, AlgorithmParameterSpec)</code>. + * the same key, if desired, via new calls to {@code update} and + * {@code doFinal}. + * (In order to reuse this {@code Mac} object with a different key, + * it must be reinitialized via a call to {@code init(Key)} or + * {@code init(Key, AlgorithmParameterSpec)}. * - * <p>The MAC result is stored in <code>output</code>, starting at - * <code>outOffset</code> inclusive. + * <p>The MAC result is stored in {@code output}, starting at + * {@code outOffset} inclusive. * * @param output the buffer where the MAC result is stored - * @param outOffset the offset in <code>output</code> where the MAC is + * @param outOffset the offset in {@code output} where the MAC is * stored * * @exception ShortBufferException if the given output buffer is too small * to hold the result - * @exception IllegalStateException if this <code>Mac</code> has not been + * @exception IllegalStateException if this {@code Mac} has not been * initialized. */ public final void doFinal(byte[] output, int outOffset) @@ -609,21 +609,21 @@ /** * Processes the given array of bytes and finishes the MAC operation. * - * <p>A call to this method resets this <code>Mac</code> object to the + * <p>A call to this method resets this {@code Mac} object to the * state it was in when previously initialized via a call to - * <code>init(Key)</code> or - * <code>init(Key, AlgorithmParameterSpec)</code>. + * {@code init(Key)} or + * {@code init(Key, AlgorithmParameterSpec)}. * That is, the object is reset and available to generate another MAC from - * the same key, if desired, via new calls to <code>update</code> and - * <code>doFinal</code>. - * (In order to reuse this <code>Mac</code> object with a different key, - * it must be reinitialized via a call to <code>init(Key)</code> or - * <code>init(Key, AlgorithmParameterSpec)</code>. + * the same key, if desired, via new calls to {@code update} and + * {@code doFinal}. + * (In order to reuse this {@code Mac} object with a different key, + * it must be reinitialized via a call to {@code init(Key)} or + * {@code init(Key, AlgorithmParameterSpec)}. * * @param input data in bytes * @return the MAC result. * - * @exception IllegalStateException if this <code>Mac</code> has not been + * @exception IllegalStateException if this {@code Mac} has not been * initialized. */ public final byte[] doFinal(byte[] input) throws IllegalStateException @@ -637,18 +637,18 @@ } /** - * Resets this <code>Mac</code> object. + * Resets this {@code Mac} object. * - * <p>A call to this method resets this <code>Mac</code> object to the + * <p>A call to this method resets this {@code Mac} object to the * state it was in when previously initialized via a call to - * <code>init(Key)</code> or - * <code>init(Key, AlgorithmParameterSpec)</code>. + * {@code init(Key)} or + * {@code init(Key, AlgorithmParameterSpec)}. * That is, the object is reset and available to generate another MAC from - * the same key, if desired, via new calls to <code>update</code> and - * <code>doFinal</code>. - * (In order to reuse this <code>Mac</code> object with a different key, - * it must be reinitialized via a call to <code>init(Key)</code> or - * <code>init(Key, AlgorithmParameterSpec)</code>. + * the same key, if desired, via new calls to {@code update} and + * {@code doFinal}. + * (In order to reuse this {@code Mac} object with a different key, + * it must be reinitialized via a call to {@code init(Key)} or + * {@code init(Key, AlgorithmParameterSpec)}. */ public final void reset() { chooseFirstProvider(); @@ -661,7 +661,7 @@ * @return a clone if the provider implementation is cloneable. * * @exception CloneNotSupportedException if this is called on a - * delegate that does not support <code>Cloneable</code>. + * delegate that does not support {@code Cloneable}. */ public final Object clone() throws CloneNotSupportedException { chooseFirstProvider();
--- a/src/share/classes/javax/crypto/SecretKeyFactory.java Wed Apr 17 03:47:21 2019 +0100 +++ b/src/share/classes/javax/crypto/SecretKeyFactory.java Thu Apr 18 03:46:32 2019 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2019, 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 @@ * This class represents a factory for secret keys. * * <P> Key factories are used to convert <I>keys</I> (opaque - * cryptographic keys of type <code>Key</code>) into <I>key specifications</I> + * cryptographic keys of type {@code Key}) into <I>key specifications</I> * (transparent representations of the underlying key material), and vice * versa. * Secret key factories operate only on secret (symmetric) keys. @@ -53,16 +53,16 @@ * {@link #getKeySpec(javax.crypto.SecretKey, java.lang.Class) getKeySpec} * methods. * For example, the DES secret-key factory supplied by the "SunJCE" provider - * supports <code>DESKeySpec</code> as a transparent representation of DES + * supports {@code DESKeySpec} as a transparent representation of DES * keys, and that provider's secret-key factory for Triple DES keys supports - * <code>DESedeKeySpec</code> as a transparent representation of Triple DES + * {@code DESedeKeySpec} as a transparent representation of Triple DES * keys. * * <p> Every implementation of the Java platform is required to support the - * following standard <code>SecretKeyFactory</code> algorithms: + * following standard {@code SecretKeyFactory} algorithms: * <ul> - * <li><tt>DES</tt></li> - * <li><tt>DESede</tt></li> + * <li>{@code DES}</li> + * <li>{@code DESede}</li> * </ul> * These algorithms are described in the <a href= * "{@docRoot}/../technotes/guides/security/StandardNames.html#SecretKeyFactory"> @@ -125,7 +125,7 @@ } /** - * Returns a <code>SecretKeyFactory</code> object that converts + * Returns a {@code SecretKeyFactory} object that converts * secret keys of the specified algorithm. * * <p> This method traverses the list of registered security Providers, @@ -144,7 +144,7 @@ * Java Cryptography Architecture Standard Algorithm Name Documentation</a> * for information about standard algorithm names. * - * @return the new <code>SecretKeyFactory</code> object. + * @return the new {@code SecretKeyFactory} object. * * @exception NullPointerException if the specified algorithm * is null. @@ -161,7 +161,7 @@ } /** - * Returns a <code>SecretKeyFactory</code> object that converts + * Returns a {@code SecretKeyFactory} object that converts * secret keys of the specified algorithm. * * <p> A new SecretKeyFactory object encapsulating the @@ -181,7 +181,7 @@ * * @param provider the name of the provider. * - * @return the new <code>SecretKeyFactory</code> object. + * @return the new {@code SecretKeyFactory} object. * * @exception NoSuchAlgorithmException if a SecretKeyFactorySpi * implementation for the specified algorithm is not @@ -193,7 +193,7 @@ * @throws NoSuchProviderException if the specified provider is not * registered in the security provider list. * - * @exception IllegalArgumentException if the <code>provider</code> + * @exception IllegalArgumentException if the {@code provider} * is null or empty. * * @see java.security.Provider @@ -208,7 +208,7 @@ } /** - * Returns a <code>SecretKeyFactory</code> object that converts + * Returns a {@code SecretKeyFactory} object that converts * secret keys of the specified algorithm. * * <p> A new SecretKeyFactory object encapsulating the @@ -225,7 +225,7 @@ * * @param provider the provider. * - * @return the new <code>SecretKeyFactory</code> object. + * @return the new {@code SecretKeyFactory} object. * * @exception NullPointerException if the specified algorithm * is null. @@ -234,7 +234,7 @@ * implementation for the specified algorithm is not available * from the specified Provider object. * - * @exception IllegalArgumentException if the <code>provider</code> + * @exception IllegalArgumentException if the {@code provider} * is null. * * @see java.security.Provider @@ -248,9 +248,9 @@ } /** - * Returns the provider of this <code>SecretKeyFactory</code> object. + * Returns the provider of this {@code SecretKeyFactory} object. * - * @return the provider of this <code>SecretKeyFactory</code> object + * @return the provider of this {@code SecretKeyFactory} object */ public final Provider getProvider() { synchronized (lock) { @@ -261,13 +261,13 @@ } /** - * Returns the algorithm name of this <code>SecretKeyFactory</code> object. + * Returns the algorithm name of this {@code SecretKeyFactory} object. * * <p>This is the same name that was specified in one of the - * <code>getInstance</code> calls that created this - * <code>SecretKeyFactory</code> object. + * {@code getInstance} calls that created this + * {@code SecretKeyFactory} object. * - * @return the algorithm name of this <code>SecretKeyFactory</code> + * @return the algorithm name of this {@code SecretKeyFactory} * object. */ public final String getAlgorithm() { @@ -314,7 +314,7 @@ } /** - * Generates a <code>SecretKey</code> object from the provided key + * Generates a {@code SecretKey} object from the provided key * specification (key material). * * @param keySpec the specification (key material) of the secret key @@ -361,9 +361,9 @@ * * @exception InvalidKeySpecException if the requested key specification is * inappropriate for the given key (e.g., the algorithms associated with - * <code>key</code> and <code>keySpec</code> do not match, or - * <code>key</code> references a key on a cryptographic hardware device - * whereas <code>keySpec</code> is the specification of a software-based + * {@code key} and {@code keySpec} do not match, or + * {@code key} references a key on a cryptographic hardware device + * whereas {@code keySpec} is the specification of a software-based * key), or the given key cannot be dealt with * (e.g., the given key has an algorithm or format not supported by this * secret-key factory).
--- a/src/share/classes/javax/crypto/spec/RC2ParameterSpec.java Wed Apr 17 03:47:21 2019 +0100 +++ b/src/share/classes/javax/crypto/spec/RC2ParameterSpec.java Thu Apr 18 03:46:32 2019 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2019, 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 @@ -35,7 +35,7 @@ * <p> The parameters consist of an effective key size and optionally * an 8-byte initialization vector (IV) (only in feedback mode). * - * <p> This class can be used to initialize a <code>Cipher</code> object that + * <p> This class can be used to initialize a {@code Cipher} object that * implements the <i>RC2</i> algorithm. * * @author Jan Luehe @@ -62,12 +62,12 @@ * (in bits) and an 8-byte IV. * * <p> The bytes that constitute the IV are those between - * <code>iv[0]</code> and <code>iv[7]</code> inclusive. + * {@code iv[0]} and {@code iv[7]} inclusive. * * @param effectiveKeyBits the effective key size in bits. * @param iv the buffer with the 8-byte IV. The first 8 bytes of * the buffer are copied to protect against subsequent modification. - * @exception IllegalArgumentException if <code>iv</code> is null. + * @exception IllegalArgumentException if {@code iv} is null. */ public RC2ParameterSpec(int effectiveKeyBits, byte[] iv) { this(effectiveKeyBits, iv, 0); @@ -77,18 +77,18 @@ * Constructs a parameter set for RC2 from the given effective key size * (in bits) and IV. * - * <p> The IV is taken from <code>iv</code>, starting at - * <code>offset</code> inclusive. + * <p> The IV is taken from {@code iv}, starting at + * {@code offset} inclusive. * The bytes that constitute the IV are those between - * <code>iv[offset]</code> and <code>iv[offset+7]</code> inclusive. + * {@code iv[offset]} and {@code iv[offset+7]} inclusive. * * @param effectiveKeyBits the effective key size in bits. * @param iv the buffer with the IV. The first 8 bytes - * of the buffer beginning at <code>offset</code> inclusive + * of the buffer beginning at {@code offset} inclusive * are copied to protect against subsequent modification. - * @param offset the offset in <code>iv</code> where the 8-byte IV + * @param offset the offset in {@code iv} where the 8-byte IV * starts. - * @exception IllegalArgumentException if <code>iv</code> is null. + * @exception IllegalArgumentException if {@code iv} is null. */ public RC2ParameterSpec(int effectiveKeyBits, byte[] iv, int offset) { this.effectiveKeyBits = effectiveKeyBits; @@ -124,12 +124,12 @@ * Tests for equality between the specified object and this * object. Two RC2ParameterSpec objects are considered equal if their * effective key sizes and IVs are equal. - * (Two IV references are considered equal if both are <tt>null</tt>.) + * (Two IV references are considered equal if both are {@code null}.) * * @param obj the object to test for equality with this object. * * @return true if the objects are considered equal, false if - * <code>obj</code> is null or otherwise. + * {@code obj} is null or otherwise. */ public boolean equals(Object obj) { if (obj == this) {
--- a/src/share/classes/javax/crypto/spec/RC5ParameterSpec.java Wed Apr 17 03:47:21 2019 +0100 +++ b/src/share/classes/javax/crypto/spec/RC5ParameterSpec.java Thu Apr 18 03:46:32 2019 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2019, 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 @@ -35,7 +35,7 @@ * <p> The parameters consist of a version number, a rounds count, a word * size, and optionally an initialization vector (IV) (only in feedback mode). * - * <p> This class can be used to initialize a <code>Cipher</code> object that + * <p> This class can be used to initialize a {@code Cipher} object that * implements the <i>RC5</i> algorithm as supplied by * <a href="http://www.rsasecurity.com">RSA Security Inc.</a>, * or any parties authorized by RSA Security. @@ -71,16 +71,16 @@ * * <p> Note that the size of the IV (block size) must be twice the word * size. The bytes that constitute the IV are those between - * <code>iv[0]</code> and <code>iv[2*(wordSize/8)-1]</code> inclusive. + * {@code iv[0]} and {@code iv[2*(wordSize/8)-1]} inclusive. * * @param version the version. * @param rounds the number of rounds. * @param wordSize the word size in bits. - * @param iv the buffer with the IV. The first <code>2*(wordSize/8) - * </code> bytes of the buffer are copied to protect against subsequent + * @param iv the buffer with the IV. The first {@code 2*(wordSize/8) + * } bytes of the buffer are copied to protect against subsequent * modification. - * @exception IllegalArgumentException if <code>iv</code> is - * <code>null</code> or {@code (iv.length < 2 * (wordSize / 8))} + * @exception IllegalArgumentException if {@code iv} is + * {@code null} or {@code (iv.length < 2 * (wordSize / 8))} */ public RC5ParameterSpec(int version, int rounds, int wordSize, byte[] iv) { this(version, rounds, wordSize, iv, 0); @@ -90,23 +90,23 @@ * Constructs a parameter set for RC5 from the given version, number of * rounds, word size (in bits), and IV. * - * <p> The IV is taken from <code>iv</code>, starting at - * <code>offset</code> inclusive. + * <p> The IV is taken from {@code iv}, starting at + * {@code offset} inclusive. * Note that the size of the IV (block size), starting at - * <code>offset</code> inclusive, must be twice the word size. + * {@code offset} inclusive, must be twice the word size. * The bytes that constitute the IV are those between - * <code>iv[offset]</code> and <code>iv[offset+2*(wordSize/8)-1]</code> + * {@code iv[offset]} and {@code iv[offset+2*(wordSize/8)-1]} * inclusive. * * @param version the version. * @param rounds the number of rounds. * @param wordSize the word size in bits. - * @param iv the buffer with the IV. The first <code>2*(wordSize/8) - * </code> bytes of the buffer beginning at <code>offset</code> + * @param iv the buffer with the IV. The first {@code 2*(wordSize/8) + * } bytes of the buffer beginning at {@code offset} * inclusive are copied to protect against subsequent modification. - * @param offset the offset in <code>iv</code> where the IV starts. - * @exception IllegalArgumentException if <code>iv</code> is - * <code>null</code> or + * @param offset the offset in {@code iv} where the IV starts. + * @exception IllegalArgumentException if {@code iv} is + * {@code null} or * {@code (iv.length - offset < 2 * (wordSize / 8))} */ public RC5ParameterSpec(int version, int rounds, int wordSize, @@ -164,12 +164,12 @@ * Tests for equality between the specified object and this * object. Two RC5ParameterSpec objects are considered equal if their * version numbers, number of rounds, word sizes, and IVs are equal. - * (Two IV references are considered equal if both are <tt>null</tt>.) + * (Two IV references are considered equal if both are {@code null}.) * * @param obj the object to test for equality with this object. * * @return true if the objects are considered equal, false if - * <code>obj</code> is null or otherwise. + * {@code obj} is null or otherwise. */ public boolean equals(Object obj) { if (obj == this) {
--- a/src/share/classes/javax/swing/plaf/basic/BasicTextFieldUI.java Wed Apr 17 03:47:21 2019 +0100 +++ b/src/share/classes/javax/swing/plaf/basic/BasicTextFieldUI.java Thu Apr 18 03:46:32 2019 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2019, 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 @@ -96,7 +96,13 @@ String kind = elem.getName(); if (kind != null) { if (kind.equals(AbstractDocument.ContentElementName)) { - return new GlyphView(elem); + return new GlyphView(elem){ + @Override + public float getMinimumSpan(int axis) { + // no wrap + return getPreferredSpan(axis); + } + }; } else if (kind.equals(AbstractDocument.ParagraphElementName)) { return new I18nFieldView(elem); }
--- a/src/share/classes/javax/swing/text/DefaultEditorKit.java Wed Apr 17 03:47:21 2019 +0100 +++ b/src/share/classes/javax/swing/text/DefaultEditorKit.java Thu Apr 18 03:46:32 2019 +0100 @@ -878,11 +878,10 @@ isPrintableMask = ((SunToolkit)tk).isPrintableCharacterModifiersMask(mod); } - if (isPrintableMask) { - char c = content.charAt(0); - if ((c >= 0x20) && (c != 0x7F)) { - target.replaceSelection(content); - } + char c = content.charAt(0); + if ((isPrintableMask && (c >= 0x20) && (c != 0x7F)) || + (!isPrintableMask && (c >= 0x200C) && (c <= 0x200D))) { + target.replaceSelection(content); } } }
--- a/src/share/classes/javax/swing/text/GlyphView.java Wed Apr 17 03:47:21 2019 +0100 +++ b/src/share/classes/javax/swing/text/GlyphView.java Thu Apr 18 03:46:32 2019 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2019, 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
--- a/src/share/classes/javax/xml/crypto/KeySelectorException.java Wed Apr 17 03:47:21 2019 +0100 +++ b/src/share/classes/javax/xml/crypto/KeySelectorException.java Thu Apr 18 03:46:32 2019 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2019, 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,8 +33,8 @@ /** * Indicates an exceptional condition thrown by a {@link KeySelector}. * - * <p>A <code>KeySelectorException</code> can contain a cause: another - * throwable that caused this <code>KeySelectorException</code> to get thrown. + * <p>A {@code KeySelectorException} can contain a cause: another + * throwable that caused this {@code KeySelectorException} to get thrown. * * @author Sean Mullan * @author JSR 105 Expert Group @@ -46,7 +46,7 @@ /** * The throwable that caused this exception to get thrown, or - * <code>null</code> if this exception was not caused by another throwable + * {@code null} if this exception was not caused by another throwable * or if the causative throwable is unknown. * * @serial @@ -54,15 +54,15 @@ private Throwable cause; /** - * Constructs a new <code>KeySelectorException</code> with - * <code>null</code> as its detail message. + * Constructs a new {@code KeySelectorException} with + * {@code null} as its detail message. */ public KeySelectorException() { super(); } /** - * Constructs a new <code>KeySelectorException</code> with the specified + * Constructs a new {@code KeySelectorException} with the specified * detail message. * * @param message the detail message @@ -72,14 +72,14 @@ } /** - * Constructs a new <code>KeySelectorException</code> with the + * Constructs a new {@code KeySelectorException} with the * specified detail message and cause. * <p>Note that the detail message associated with - * <code>cause</code> is <i>not</i> automatically incorporated in + * {@code cause} is <i>not</i> automatically incorporated in * this exception's detail message. * * @param message the detail message - * @param cause the cause (A <tt>null</tt> value is permitted, and + * @param cause the cause (A {@code null} value is permitted, and * indicates that the cause is nonexistent or unknown.) */ public KeySelectorException(String message, Throwable cause) { @@ -88,13 +88,13 @@ } /** - * Constructs a new <code>KeySelectorException</code> with the specified + * Constructs a new {@code KeySelectorException} with the specified * cause and a detail message of - * <code>(cause==null ? null : cause.toString())</code> + * {@code (cause==null ? null : cause.toString())} * (which typically contains the class and detail message of - * <code>cause</code>). + * {@code cause}). * - * @param cause the cause (A <tt>null</tt> value is permitted, and + * @param cause the cause (A {@code null} value is permitted, and * indicates that the cause is nonexistent or unknown.) */ public KeySelectorException(Throwable cause) { @@ -103,20 +103,20 @@ } /** - * Returns the cause of this <code>KeySelectorException</code> or - * <code>null</code> if the cause is nonexistent or unknown. (The + * Returns the cause of this {@code KeySelectorException} or + * {@code null} if the cause is nonexistent or unknown. (The * cause is the throwable that caused this - * <code>KeySelectorException</code> to get thrown.) + * {@code KeySelectorException} to get thrown.) * - * @return the cause of this <code>KeySelectorException</code> or - * <code>null</code> if the cause is nonexistent or unknown. + * @return the cause of this {@code KeySelectorException} or + * {@code null} if the cause is nonexistent or unknown. */ public Throwable getCause() { return cause; } /** - * Prints this <code>KeySelectorException</code>, its backtrace and + * Prints this {@code KeySelectorException}, its backtrace and * the cause's backtrace to the standard error stream. */ public void printStackTrace() { @@ -125,10 +125,10 @@ } /** - * Prints this <code>KeySelectorException</code>, its backtrace and + * Prints this {@code KeySelectorException}, its backtrace and * the cause's backtrace to the specified print stream. * - * @param s <code>PrintStream</code> to use for output + * @param s {@code PrintStream} to use for output */ public void printStackTrace(PrintStream s) { super.printStackTrace(s); @@ -136,10 +136,10 @@ } /** - * Prints this <code>KeySelectorException</code>, its backtrace and + * Prints this {@code KeySelectorException}, its backtrace and * the cause's backtrace to the specified print writer. * - * @param s <code>PrintWriter</code> to use for output + * @param s {@code PrintWriter} to use for output */ public void printStackTrace(PrintWriter s) { super.printStackTrace(s);
--- a/src/share/classes/javax/xml/crypto/MarshalException.java Wed Apr 17 03:47:21 2019 +0100 +++ b/src/share/classes/javax/xml/crypto/MarshalException.java Thu Apr 18 03:46:32 2019 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2019, 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 @@ -39,8 +39,8 @@ * Indicates an exceptional condition that occurred during the XML * marshalling or unmarshalling process. * - * <p>A <code>MarshalException</code> can contain a cause: another - * throwable that caused this <code>MarshalException</code> to get thrown. + * <p>A {@code MarshalException} can contain a cause: another + * throwable that caused this {@code MarshalException} to get thrown. * * @author Sean Mullan * @author JSR 105 Expert Group @@ -62,15 +62,15 @@ private Throwable cause; /** - * Constructs a new <code>MarshalException</code> with - * <code>null</code> as its detail message. + * Constructs a new {@code MarshalException} with + * {@code null} as its detail message. */ public MarshalException() { super(); } /** - * Constructs a new <code>MarshalException</code> with the specified + * Constructs a new {@code MarshalException} with the specified * detail message. * * @param message the detail message @@ -80,14 +80,14 @@ } /** - * Constructs a new <code>MarshalException</code> with the + * Constructs a new {@code MarshalException} with the * specified detail message and cause. * <p>Note that the detail message associated with - * <code>cause</code> is <i>not</i> automatically incorporated in + * {@code cause} is <i>not</i> automatically incorporated in * this exception's detail message. * * @param message the detail message - * @param cause the cause (A <tt>null</tt> value is permitted, and + * @param cause the cause (A {@code null} value is permitted, and * indicates that the cause is nonexistent or unknown.) */ public MarshalException(String message, Throwable cause) { @@ -96,12 +96,12 @@ } /** - * Constructs a new <code>MarshalException</code> with the specified cause - * and a detail message of <code>(cause==null ? null : cause.toString()) - * </code> (which typically contains the class and detail message of - * <code>cause</code>). + * Constructs a new {@code MarshalException} with the specified cause + * and a detail message of {@code (cause==null ? null : cause.toString()) + * } (which typically contains the class and detail message of + * {@code cause}). * - * @param cause the cause (A <tt>null</tt> value is permitted, and + * @param cause the cause (A {@code null} value is permitted, and * indicates that the cause is nonexistent or unknown.) */ public MarshalException(Throwable cause) { @@ -110,20 +110,20 @@ } /** - * Returns the cause of this <code>MarshalException</code> or - * <code>null</code> if the cause is nonexistent or unknown. (The + * Returns the cause of this {@code MarshalException} or + * {@code null} if the cause is nonexistent or unknown. (The * cause is the throwable that caused this - * <code>MarshalException</code> to get thrown.) + * {@code MarshalException} to get thrown.) * - * @return the cause of this <code>MarshalException</code> or - * <code>null</code> if the cause is nonexistent or unknown. + * @return the cause of this {@code MarshalException} or + * {@code null} if the cause is nonexistent or unknown. */ public Throwable getCause() { return cause; } /** - * Prints this <code>MarshalException</code>, its backtrace and + * Prints this {@code MarshalException}, its backtrace and * the cause's backtrace to the standard error stream. */ public void printStackTrace() { @@ -132,10 +132,10 @@ } /** - * Prints this <code>MarshalException</code>, its backtrace and + * Prints this {@code MarshalException}, its backtrace and * the cause's backtrace to the specified print stream. * - * @param s <code>PrintStream</code> to use for output + * @param s {@code PrintStream} to use for output */ public void printStackTrace(PrintStream s) { super.printStackTrace(s); @@ -143,10 +143,10 @@ } /** - * Prints this <code>MarshalException</code>, its backtrace and + * Prints this {@code MarshalException}, its backtrace and * the cause's backtrace to the specified print writer. * - * @param s <code>PrintWriter</code> to use for output + * @param s {@code PrintWriter} to use for output */ public void printStackTrace(PrintWriter s) { super.printStackTrace(s);
--- a/src/share/classes/javax/xml/crypto/NoSuchMechanismException.java Wed Apr 17 03:47:21 2019 +0100 +++ b/src/share/classes/javax/xml/crypto/NoSuchMechanismException.java Thu Apr 18 03:46:32 2019 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2019, 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 @@ -39,8 +39,8 @@ * This exception is thrown when a particular XML mechanism is requested but * is not available in the environment. * - * <p>A <code>NoSuchMechanismException</code> can contain a cause: another - * throwable that caused this <code>NoSuchMechanismException</code> to get + * <p>A {@code NoSuchMechanismException} can contain a cause: another + * throwable that caused this {@code NoSuchMechanismException} to get * thrown. * * @author Sean Mullan @@ -63,15 +63,15 @@ private Throwable cause; /** - * Constructs a new <code>NoSuchMechanismException</code> with - * <code>null</code> as its detail message. + * Constructs a new {@code NoSuchMechanismException} with + * {@code null} as its detail message. */ public NoSuchMechanismException() { super(); } /** - * Constructs a new <code>NoSuchMechanismException</code> with the + * Constructs a new {@code NoSuchMechanismException} with the * specified detail message. * * @param message the detail message @@ -81,14 +81,14 @@ } /** - * Constructs a new <code>NoSuchMechanismException</code> with the + * Constructs a new {@code NoSuchMechanismException} with the * specified detail message and cause. * <p>Note that the detail message associated with - * <code>cause</code> is <i>not</i> automatically incorporated in + * {@code cause} is <i>not</i> automatically incorporated in * this exception's detail message. * * @param message the detail message - * @param cause the cause (A <tt>null</tt> value is permitted, and + * @param cause the cause (A {@code null} value is permitted, and * indicates that the cause is nonexistent or unknown.) */ public NoSuchMechanismException(String message, Throwable cause) { @@ -97,12 +97,12 @@ } /** - * Constructs a new <code>NoSuchMechanismException</code> with the + * Constructs a new {@code NoSuchMechanismException} with the * specified cause and a detail message of - * <code>(cause==null ? null : cause.toString())</code> (which typically - * contains the class and detail message of <code>cause</code>). + * {@code (cause==null ? null : cause.toString())} (which typically + * contains the class and detail message of {@code cause}). * - * @param cause the cause (A <tt>null</tt> value is permitted, and + * @param cause the cause (A {@code null} value is permitted, and * indicates that the cause is nonexistent or unknown.) */ public NoSuchMechanismException(Throwable cause) { @@ -111,20 +111,20 @@ } /** - * Returns the cause of this <code>NoSuchMechanismException</code> or - * <code>null</code> if the cause is nonexistent or unknown. (The + * Returns the cause of this {@code NoSuchMechanismException} or + * {@code null} if the cause is nonexistent or unknown. (The * cause is the throwable that caused this - * <code>NoSuchMechanismException</code> to get thrown.) + * {@code NoSuchMechanismException} to get thrown.) * - * @return the cause of this <code>NoSuchMechanismException</code> or - * <code>null</code> if the cause is nonexistent or unknown. + * @return the cause of this {@code NoSuchMechanismException} or + * {@code null} if the cause is nonexistent or unknown. */ public Throwable getCause() { return cause; } /** - * Prints this <code>NoSuchMechanismException</code>, its backtrace and + * Prints this {@code NoSuchMechanismException}, its backtrace and * the cause's backtrace to the standard error stream. */ public void printStackTrace() { @@ -133,10 +133,10 @@ } /** - * Prints this <code>NoSuchMechanismException</code>, its backtrace and + * Prints this {@code NoSuchMechanismException}, its backtrace and * the cause's backtrace to the specified print stream. * - * @param s <code>PrintStream</code> to use for output + * @param s {@code PrintStream} to use for output */ public void printStackTrace(PrintStream s) { super.printStackTrace(s); @@ -144,10 +144,10 @@ } /** - * Prints this <code>NoSuchMechanismException</code>, its backtrace and + * Prints this {@code NoSuchMechanismException}, its backtrace and * the cause's backtrace to the specified print writer. * - * @param s <code>PrintWriter</code> to use for output + * @param s {@code PrintWriter} to use for output */ public void printStackTrace(PrintWriter s) { super.printStackTrace(s);
--- a/src/share/classes/javax/xml/crypto/URIReferenceException.java Wed Apr 17 03:47:21 2019 +0100 +++ b/src/share/classes/javax/xml/crypto/URIReferenceException.java Thu Apr 18 03:46:32 2019 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2019, 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 @@ -35,8 +35,8 @@ * Indicates an exceptional condition thrown while dereferencing a * {@link URIReference}. * - * <p>A <code>URIReferenceException</code> can contain a cause: another - * throwable that caused this <code>URIReferenceException</code> to get thrown. + * <p>A {@code URIReferenceException} can contain a cause: another + * throwable that caused this {@code URIReferenceException} to get thrown. * * @author Sean Mullan * @author JSR 105 Expert Group @@ -60,15 +60,15 @@ private URIReference uriReference; /** - * Constructs a new <code>URIReferenceException</code> with - * <code>null</code> as its detail message. + * Constructs a new {@code URIReferenceException} with + * {@code null} as its detail message. */ public URIReferenceException() { super(); } /** - * Constructs a new <code>URIReferenceException</code> with the specified + * Constructs a new {@code URIReferenceException} with the specified * detail message. * * @param message the detail message @@ -78,14 +78,14 @@ } /** - * Constructs a new <code>URIReferenceException</code> with the + * Constructs a new {@code URIReferenceException} with the * specified detail message and cause. * <p>Note that the detail message associated with - * <code>cause</code> is <i>not</i> automatically incorporated in + * {@code cause} is <i>not</i> automatically incorporated in * this exception's detail message. * * @param message the detail message - * @param cause the cause (A <tt>null</tt> value is permitted, and + * @param cause the cause (A {@code null} value is permitted, and * indicates that the cause is nonexistent or unknown.) */ public URIReferenceException(String message, Throwable cause) { @@ -94,19 +94,19 @@ } /** - * Constructs a new <code>URIReferenceException</code> with the - * specified detail message, cause and <code>URIReference</code>. + * Constructs a new {@code URIReferenceException} with the + * specified detail message, cause and {@code URIReference}. * <p>Note that the detail message associated with - * <code>cause</code> is <i>not</i> automatically incorporated in + * {@code cause} is <i>not</i> automatically incorporated in * this exception's detail message. * * @param message the detail message - * @param cause the cause (A <tt>null</tt> value is permitted, and + * @param cause the cause (A {@code null} value is permitted, and * indicates that the cause is nonexistent or unknown.) - * @param uriReference the <code>URIReference</code> that was being + * @param uriReference the {@code URIReference} that was being * dereferenced when the error was encountered - * @throws NullPointerException if <code>uriReference</code> is - * <code>null</code> + * @throws NullPointerException if {@code uriReference} is + * {@code null} */ public URIReferenceException(String message, Throwable cause, URIReference uriReference) { @@ -118,12 +118,12 @@ } /** - * Constructs a new <code>URIReferenceException</code> with the specified - * cause and a detail message of <code>(cause==null ? null : - * cause.toString())</code> (which typically contains the class and detail - * message of <code>cause</code>). + * Constructs a new {@code URIReferenceException} with the specified + * cause and a detail message of {@code (cause==null ? null : + * cause.toString())} (which typically contains the class and detail + * message of {@code cause}). * - * @param cause the cause (A <tt>null</tt> value is permitted, and + * @param cause the cause (A {@code null} value is permitted, and * indicates that the cause is nonexistent or unknown.) */ public URIReferenceException(Throwable cause) { @@ -132,31 +132,31 @@ } /** - * Returns the <code>URIReference</code> that was being dereferenced + * Returns the {@code URIReference} that was being dereferenced * when the exception was thrown. * - * @return the <code>URIReference</code> that was being dereferenced - * when the exception was thrown, or <code>null</code> if not specified + * @return the {@code URIReference} that was being dereferenced + * when the exception was thrown, or {@code null} if not specified */ public URIReference getURIReference() { return uriReference; } /** - * Returns the cause of this <code>URIReferenceException</code> or - * <code>null</code> if the cause is nonexistent or unknown. (The + * Returns the cause of this {@code URIReferenceException} or + * {@code null} if the cause is nonexistent or unknown. (The * cause is the throwable that caused this - * <code>URIReferenceException</code> to get thrown.) + * {@code URIReferenceException} to get thrown.) * - * @return the cause of this <code>URIReferenceException</code> or - * <code>null</code> if the cause is nonexistent or unknown. + * @return the cause of this {@code URIReferenceException} or + * {@code null} if the cause is nonexistent or unknown. */ public Throwable getCause() { return cause; } /** - * Prints this <code>URIReferenceException</code>, its backtrace and + * Prints this {@code URIReferenceException}, its backtrace and * the cause's backtrace to the standard error stream. */ public void printStackTrace() { @@ -165,10 +165,10 @@ } /** - * Prints this <code>URIReferenceException</code>, its backtrace and + * Prints this {@code URIReferenceException}, its backtrace and * the cause's backtrace to the specified print stream. * - * @param s <code>PrintStream</code> to use for output + * @param s {@code PrintStream} to use for output */ public void printStackTrace(PrintStream s) { super.printStackTrace(s); @@ -176,10 +176,10 @@ } /** - * Prints this <code>URIReferenceException</code>, its backtrace and + * Prints this {@code URIReferenceException}, its backtrace and * the cause's backtrace to the specified print writer. * - * @param s <code>PrintWriter</code> to use for output + * @param s {@code PrintWriter} to use for output */ public void printStackTrace(PrintWriter s) { super.printStackTrace(s);
--- a/src/share/classes/javax/xml/crypto/dsig/TransformException.java Wed Apr 17 03:47:21 2019 +0100 +++ b/src/share/classes/javax/xml/crypto/dsig/TransformException.java Thu Apr 18 03:46:32 2019 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2019, 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 @@ -34,8 +34,8 @@ * Indicates an exceptional condition that occurred while executing a * transform algorithm. * - * <p>A <code>TransformException</code> can contain a cause: another - * throwable that caused this <code>TransformException</code> to get thrown. + * <p>A {@code TransformException} can contain a cause: another + * throwable that caused this {@code TransformException} to get thrown. * * @see Transform#transform * @author Sean Mullan @@ -56,15 +56,15 @@ private Throwable cause; /** - * Constructs a new <code>TransformException</code> with - * <code>null</code> as its detail message. + * Constructs a new {@code TransformException} with + * {@code null} as its detail message. */ public TransformException() { super(); } /** - * Constructs a new <code>TransformException</code> with the specified + * Constructs a new {@code TransformException} with the specified * detail message. * * @param message the detail message @@ -74,14 +74,14 @@ } /** - * Constructs a new <code>TransformException</code> with the + * Constructs a new {@code TransformException} with the * specified detail message and cause. * <p>Note that the detail message associated with - * <code>cause</code> is <i>not</i> automatically incorporated in + * {@code cause} is <i>not</i> automatically incorporated in * this exception's detail message. * * @param message the detail message - * @param cause the cause (A <tt>null</tt> value is permitted, and + * @param cause the cause (A {@code null} value is permitted, and * indicates that the cause is nonexistent or unknown.) */ public TransformException(String message, Throwable cause) { @@ -90,13 +90,13 @@ } /** - * Constructs a new <code>TransformException</code> with the specified + * Constructs a new {@code TransformException} with the specified * cause and a detail message of - * <code>(cause==null ? null : cause.toString())</code> + * {@code (cause==null ? null : cause.toString())} * (which typically contains the class and detail message of - * <code>cause</code>). + * {@code cause}). * - * @param cause the cause (A <tt>null</tt> value is permitted, and + * @param cause the cause (A {@code null} value is permitted, and * indicates that the cause is nonexistent or unknown.) */ public TransformException(Throwable cause) { @@ -105,20 +105,20 @@ } /** - * Returns the cause of this <code>TransformException</code> or - * <code>null</code> if the cause is nonexistent or unknown. (The + * Returns the cause of this {@code TransformException} or + * {@code null} if the cause is nonexistent or unknown. (The * cause is the throwable that caused this - * <code>TransformException</code> to get thrown.) + * {@code TransformException} to get thrown.) * - * @return the cause of this <code>TransformException</code> or - * <code>null</code> if the cause is nonexistent or unknown. + * @return the cause of this {@code TransformException} or + * {@code null} if the cause is nonexistent or unknown. */ public Throwable getCause() { return cause; } /** - * Prints this <code>TransformException</code>, its backtrace and + * Prints this {@code TransformException}, its backtrace and * the cause's backtrace to the standard error stream. */ public void printStackTrace() { @@ -129,10 +129,10 @@ } /** - * Prints this <code>TransformException</code>, its backtrace and + * Prints this {@code TransformException}, its backtrace and * the cause's backtrace to the specified print stream. * - * @param s <code>PrintStream</code> to use for output + * @param s {@code PrintStream} to use for output */ public void printStackTrace(PrintStream s) { super.printStackTrace(s); @@ -142,10 +142,10 @@ } /** - * Prints this <code>TransformException</code>, its backtrace and + * Prints this {@code TransformException}, its backtrace and * the cause's backtrace to the specified print writer. * - * @param s <code>PrintWriter</code> to use for output + * @param s {@code PrintWriter} to use for output */ public void printStackTrace(PrintWriter s) { super.printStackTrace(s);
--- a/src/share/classes/javax/xml/crypto/dsig/XMLSignatureException.java Wed Apr 17 03:47:21 2019 +0100 +++ b/src/share/classes/javax/xml/crypto/dsig/XMLSignatureException.java Thu Apr 18 03:46:32 2019 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2019, 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 @@ -34,8 +34,8 @@ * Indicates an exceptional condition that occurred during the XML * signature generation or validation process. * - * <p>An <code>XMLSignatureException</code> can contain a cause: another - * throwable that caused this <code>XMLSignatureException</code> to get thrown. + * <p>An {@code XMLSignatureException} can contain a cause: another + * throwable that caused this {@code XMLSignatureException} to get thrown. * * @since 1.6 */ @@ -53,15 +53,15 @@ private Throwable cause; /** - * Constructs a new <code>XMLSignatureException</code> with - * <code>null</code> as its detail message. + * Constructs a new {@code XMLSignatureException} with + * {@code null} as its detail message. */ public XMLSignatureException() { super(); } /** - * Constructs a new <code>XMLSignatureException</code> with the specified + * Constructs a new {@code XMLSignatureException} with the specified * detail message. * * @param message the detail message @@ -71,14 +71,14 @@ } /** - * Constructs a new <code>XMLSignatureException</code> with the + * Constructs a new {@code XMLSignatureException} with the * specified detail message and cause. * <p>Note that the detail message associated with - * <code>cause</code> is <i>not</i> automatically incorporated in + * {@code cause} is <i>not</i> automatically incorporated in * this exception's detail message. * * @param message the detail message - * @param cause the cause (A <tt>null</tt> value is permitted, and + * @param cause the cause (A {@code null} value is permitted, and * indicates that the cause is nonexistent or unknown.) */ public XMLSignatureException(String message, Throwable cause) { @@ -87,13 +87,13 @@ } /** - * Constructs a new <code>XMLSignatureException</code> with the specified + * Constructs a new {@code XMLSignatureException} with the specified * cause and a detail message of - * <code>(cause==null ? null : cause.toString())</code> + * {@code (cause==null ? null : cause.toString())} * (which typically contains the class and detail message of - * <code>cause</code>). + * {@code cause}). * - * @param cause the cause (A <tt>null</tt> value is permitted, and + * @param cause the cause (A {@code null} value is permitted, and * indicates that the cause is nonexistent or unknown.) */ public XMLSignatureException(Throwable cause) { @@ -102,20 +102,20 @@ } /** - * Returns the cause of this <code>XMLSignatureException</code> or - * <code>null</code> if the cause is nonexistent or unknown. (The + * Returns the cause of this {@code XMLSignatureException} or + * {@code null} if the cause is nonexistent or unknown. (The * cause is the throwable that caused this - * <code>XMLSignatureException</code> to get thrown.) + * {@code XMLSignatureException} to get thrown.) * - * @return the cause of this <code>XMLSignatureException</code> or - * <code>null</code> if the cause is nonexistent or unknown. + * @return the cause of this {@code XMLSignatureException} or + * {@code null} if the cause is nonexistent or unknown. */ public Throwable getCause() { return cause; } /** - * Prints this <code>XMLSignatureException</code>, its backtrace and + * Prints this {@code XMLSignatureException}, its backtrace and * the cause's backtrace to the standard error stream. */ public void printStackTrace() { @@ -126,10 +126,10 @@ } /** - * Prints this <code>XMLSignatureException</code>, its backtrace and + * Prints this {@code XMLSignatureException}, its backtrace and * the cause's backtrace to the specified print stream. * - * @param s <code>PrintStream</code> to use for output + * @param s {@code PrintStream} to use for output */ public void printStackTrace(PrintStream s) { super.printStackTrace(s); @@ -139,10 +139,10 @@ } /** - * Prints this <code>XMLSignatureException</code>, its backtrace and + * Prints this {@code XMLSignatureException}, its backtrace and * the cause's backtrace to the specified print writer. * - * @param s <code>PrintWriter</code> to use for output + * @param s {@code PrintWriter} to use for output */ public void printStackTrace(PrintWriter s) { super.printStackTrace(s);
--- a/src/share/classes/sun/nio/cs/ext/GB18030.java Wed Apr 17 03:47:21 2019 +0100 +++ b/src/share/classes/sun/nio/cs/ext/GB18030.java Thu Apr 18 03:46:32 2019 +0100 @@ -12518,7 +12518,7 @@ dst.put(getChar(offset)); else if (offset >= 0x830D && offset <= 0x93A8) dst.put((char)(offset + 0x6557)); - else if (offset >= 0x93A9 && offset <= 0x99F9) + else if (offset >= 0x93A9 && offset <= 0x99FB) dst.put(getChar(offset)); // Supplemental UCS planes handled via surrogates else if (offset >= 0x2E248 && offset < 0x12E248) {
--- a/src/share/classes/sun/nio/cs/ext/ISO2022_JP.java Wed Apr 17 03:47:21 2019 +0100 +++ b/src/share/classes/sun/nio/cs/ext/ISO2022_JP.java Thu Apr 18 03:46:32 2019 +0100 @@ -309,7 +309,7 @@ break; case JISX0201_1976_KANA: case SHIFTOUT: - if (b1 > 0x60) { + if (b1 > 0x5f) { return CoderResult.malformedForLength(inputSize); } da[dp++] = (char)(b1 + 0xff40); @@ -430,7 +430,7 @@ break; case JISX0201_1976_KANA: case SHIFTOUT: - if (b1 > 0x60) { + if (b1 > 0x5f) { return CoderResult.malformedForLength(inputSize); } dst.put((char)(b1 + 0xff40));
--- a/src/share/classes/sun/rmi/registry/RegistryImpl_Skel.java Wed Apr 17 03:47:21 2019 +0100 +++ b/src/share/classes/sun/rmi/registry/RegistryImpl_Skel.java Thu Apr 18 03:46:32 2019 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2017, 2019, 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 @@ -58,8 +58,24 @@ public void dispatch(java.rmi.Remote obj, java.rmi.server.RemoteCall call, int opnum, long hash) throws java.lang.Exception { - if (hash != interfaceHash) - throw new java.rmi.server.SkeletonMismatchException("interface hash mismatch"); + if (opnum < 0) { + if (hash == 7583982177005850366L) { + opnum = 0; + } else if (hash == 2571371476350237748L) { + opnum = 1; + } else if (hash == -7538657168040752697L) { + opnum = 2; + } else if (hash == -8381844669958460146L) { + opnum = 3; + } else if (hash == 7305022919901907578L) { + opnum = 4; + } else { + throw new java.rmi.UnmarshalException("invalid method hash"); + } + } else { + if (hash != interfaceHash) + throw new java.rmi.server.SkeletonMismatchException("interface hash mismatch"); + } sun.rmi.registry.RegistryImpl server = (sun.rmi.registry.RegistryImpl) obj; switch (opnum) {
--- a/src/share/classes/sun/rmi/server/UnicastServerRef.java Wed Apr 17 03:47:21 2019 +0100 +++ b/src/share/classes/sun/rmi/server/UnicastServerRef.java Thu Apr 18 03:46:32 2019 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1996, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1996, 2019, 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 @@ -40,6 +40,7 @@ import java.rmi.ServerException; import java.rmi.UnmarshalException; import java.rmi.server.ExportException; +import java.rmi.server.Operation; import java.rmi.server.RemoteCall; import java.rmi.server.RemoteRef; import java.rmi.server.RemoteStub; @@ -295,15 +296,14 @@ throw new UnmarshalException("error unmarshalling call header", readEx); } - if (num >= 0) { - if (skel != null) { + if (skel != null) { + // If there is a skeleton, use it oldDispatch(obj, call, num); return; - } else { - throw new UnmarshalException( - "skeleton class not found but required " + - "for client version"); - } + + } else if (num >= 0){ + throw new UnmarshalException( + "skeleton class not found but required for client version"); } try { op = in.readLong(); @@ -429,8 +429,8 @@ /** * Handle server-side dispatch using the RMI 1.1 stub/skeleton - * protocol, given a non-negative operation number that has - * already been read from the call stream. + * protocol, given a non-negative operation number or negative method hash + * that has already been read from the call stream. * Exceptions are handled by the caller to be sent to the remote client. * * @param obj the target remote object for the call @@ -462,7 +462,8 @@ } // if calls are being logged, write out object id and operation - logCall(obj, skel.getOperations()[op]); + Operation[] operations = skel.getOperations(); + logCall(obj, op >= 0 && op < operations.length ? operations[op] : "op: " + op); unmarshalCustomCallData(in); // dispatch to skeleton for remote object skel.dispatch(obj, call, op, hash);
--- a/src/share/classes/sun/security/krb5/KdcComm.java Wed Apr 17 03:47:21 2019 +0100 +++ b/src/share/classes/sun/security/krb5/KdcComm.java Thu Apr 18 03:46:32 2019 +0100 @@ -390,35 +390,27 @@ for (int i=1; i <= retries; i++) { String proto = useTCP?"TCP":"UDP"; - try (NetClient kdcClient = NetClient.getInstance( - proto, kdc, port, timeout)) { - if (DEBUG) { - System.out.println(">>> KDCCommunication: kdc=" + kdc + if (DEBUG) { + System.out.println(">>> KDCCommunication: kdc=" + kdc + " " + proto + ":" + port + ", timeout=" + timeout + ",Attempt =" + i + ", #bytes=" + obuf.length); + } + try (NetClient kdcClient = NetClient.getInstance( + proto, kdc, port, timeout)) { + kdcClient.send(obuf); + ibuf = kdcClient.receive(); + break; + } catch (SocketTimeoutException se) { + if (DEBUG) { + System.out.println ("SocketTimeOutException with " + + "attempt: " + i); } - try { - /* - * Send the data to the kdc. - */ - kdcClient.send(obuf); - /* - * And get a response. - */ - ibuf = kdcClient.receive(); - break; - } catch (SocketTimeoutException se) { - if (DEBUG) { - System.out.println ("SocketTimeOutException with " + - "attempt: " + i); - } - if (i == retries) { - ibuf = null; - throw se; - } + if (i == retries) { + ibuf = null; + throw se; } } }
--- a/src/share/classes/sun/security/krb5/Realm.java Wed Apr 17 03:47:21 2019 +0100 +++ b/src/share/classes/sun/security/krb5/Realm.java Thu Apr 18 03:46:32 2019 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2019, 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 @@ -250,7 +250,7 @@ * * @param cRealm the initiating realm, not null * @param sRealm the target realm, not null, not equals to cRealm - * @returns array of realms including at least cRealm as the first + * @return array of realms including at least cRealm as the first * element */ public static String[] getRealmsList(String cRealm, String sRealm) { @@ -354,7 +354,7 @@ * for a service in the target realm sRealm. * @param cRealm the initiating realm * @param sRealm the target realm, not the same as cRealm - * @returns array of realms including cRealm as the first element + * @return array of realms including cRealm as the first element */ private static String[] parseHierarchy(String cRealm, String sRealm) {
--- a/src/share/classes/sun/security/pkcs/PKCS7.java Wed Apr 17 03:47:21 2019 +0100 +++ b/src/share/classes/sun/security/pkcs/PKCS7.java Thu Apr 18 03:46:32 2019 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1996, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1996, 2019, 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 @@ -46,9 +46,9 @@ /** * PKCS7 as defined in RSA Laboratories PKCS7 Technical Note. Profile - * Supports only <tt>SignedData</tt> ContentInfo + * Supports only {@code SignedData} ContentInfo * type, where to the type of data signed is plain Data. - * For signedData, <tt>crls</tt>, <tt>attributes</tt> and + * For signedData, {@code crls}, {@code attributes} and * PKCS#6 Extended Certificates are not supported. * * @author Benjamin Renaud
--- a/src/share/classes/sun/security/pkcs10/PKCS10Attributes.java Wed Apr 17 03:47:21 2019 +0100 +++ b/src/share/classes/sun/security/pkcs10/PKCS10Attributes.java Thu Apr 18 03:46:32 2019 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2019, 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 @@ -98,7 +98,7 @@ /** * Encode the attributes in DER form to the stream. - * Implements the <code>DerEncoder</code> interface. + * Implements the {@code DerEncoder} interface. * * @param out the OutputStream to marshal the contents to. * @exception IOException on encoding errors. @@ -157,8 +157,8 @@ /** * Compares this PKCS10Attributes for equality with the specified - * object. If the <code>other</code> object is an - * <code>instanceof</code> <code>PKCS10Attributes</code>, then + * object. If the {@code other} object is an + * {@code instanceof} {@code PKCS10Attributes}, then * all the entries are compared with the entries from this. * * @param other the object to test for equality with this PKCS10Attributes. @@ -205,10 +205,10 @@ } /** - * Returns a string representation of this <tt>PKCS10Attributes</tt> object + * Returns a string representation of this {@code PKCS10Attributes} object * in the form of a set of entries, enclosed in braces and separated - * by the ASCII characters "<tt>, </tt>" (comma and space). - * <p>Overrides the <tt>toString</tt> method of <tt>Object</tt>. + * by the ASCII characters "{@code , }" (comma and space). + * <p>Overrides the {@code toString} method of {@code Object}. * * @return a string representation of this PKCS10Attributes. */
--- a/src/share/classes/sun/security/ssl/ExtendedMasterSecretExtension.java Wed Apr 17 03:47:21 2019 +0100 +++ b/src/share/classes/sun/security/ssl/ExtendedMasterSecretExtension.java Thu Apr 18 03:46:32 2019 +0100 @@ -1,11 +1,12 @@ /* - * Copyright (c) 2017, Red Hat, Inc. and/or its affiliates. - * + * Copyright (c) 2017, Red Hat, Inc. * 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. + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
--- a/src/share/classes/sun/security/ssl/SSLAlgorithmDecomposer.java Wed Apr 17 03:47:21 2019 +0100 +++ b/src/share/classes/sun/security/ssl/SSLAlgorithmDecomposer.java Thu Apr 18 03:46:32 2019 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2019, 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 @@ -239,7 +239,8 @@ // ignore: unknown or unsupported ciphersuite } - if (cipherSuite != null) { + if (cipherSuite != null && + cipherSuite != CipherSuite.C_SCSV /* TLS_EMPTY_RENEGOTIATION_INFO_SCSV */) { return decompose(cipherSuite.keyExchange, cipherSuite.cipher, cipherSuite.macAlg); }
--- a/src/share/classes/sun/security/tools/jarsigner/TimestampedSigner.java Wed Apr 17 03:47:21 2019 +0100 +++ b/src/share/classes/sun/security/tools/jarsigner/TimestampedSigner.java Thu Apr 18 03:46:32 2019 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2019, 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 @@ -145,9 +145,9 @@ /** * Examine the certificate for a Subject Information Access extension * (<a href="http://www.ietf.org/rfc/rfc3280.txt">RFC 3280</a>). - * The extension's <tt>accessMethod</tt> field should contain the object + * The extension's {@code accessMethod} field should contain the object * identifier defined for timestamping: 1.3.6.1.5.5.7.48.3 and its - * <tt>accessLocation</tt> field should contain an HTTP or HTTPS URL. + * {@code accessLocation} field should contain an HTTP or HTTPS URL. * * @param tsaCertificate An X.509 certificate for the TSA. * @return An HTTP or HTTPS URI or null if none was found.
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/share/classes/sun/security/validator/CADistrustPolicy.java Thu Apr 18 03:46:32 2019 +0100 @@ -0,0 +1,105 @@ +/* + * Copyright (c) 2019, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ +package sun.security.validator; + +import java.security.AccessController; +import java.security.PrivilegedAction; +import java.security.Security; +import java.security.cert.X509Certificate; +import java.util.EnumSet; + +import sun.security.util.Debug; + +/** + * Policies for distrusting a certificate authority (CA). See the + * jdk.security.caDistrustPolicies security property for more information. + */ +enum CADistrustPolicy { + /** + * Distrust TLS Server certificates anchored by a Symantec root CA and + * issued after April 16, 2019 (with exceptions for a couple of subordinate + * CAs, see the jdk.security.caDistrustPolicies definition in the + * java.security file for more details). If enabled, this policy is + * currently enforced by the PKIX and SunX509 TrustManager implementations + * of the SunJSSE provider implementation. + */ + SYMANTEC_TLS { + void checkDistrust(String variant, X509Certificate[] chain) + throws ValidatorException { + if (!variant.equals(Validator.VAR_TLS_SERVER)) { + return; + } + SymantecTLSPolicy.checkDistrust(chain); + } + }; + + /** + * Checks if the end-entity certificate is distrusted. + * + * @param variant the type of certificate being checked + * @param chain the end-entity's certificate chain. The end entity cert + * is at index 0, the trust anchor at index n-1. + * @throws ValidatorException if the end-entity certificate is distrusted + */ + abstract void checkDistrust(String variant, + X509Certificate[] chain) + throws ValidatorException; + + // The policies set in the jdk.security.caDistrustPolicies property. + static final EnumSet<CADistrustPolicy> POLICIES = parseProperty(); + private static EnumSet<CADistrustPolicy> parseProperty() { + String property = AccessController.doPrivileged( + new PrivilegedAction<String>() { + @Override + public String run() { + return Security.getProperty( + "jdk.security.caDistrustPolicies"); + } + }); + EnumSet<CADistrustPolicy> set = EnumSet.noneOf(CADistrustPolicy.class); + // if property is null or empty, the restrictions are not enforced + if (property == null || property.isEmpty()) { + return set; + } + String[] policies = property.split(","); + for (String policy : policies) { + policy = policy.trim(); + try { + CADistrustPolicy caPolicy = + Enum.valueOf(CADistrustPolicy.class, policy); + set.add(caPolicy); + } catch (IllegalArgumentException iae) { + // ignore unknown values but log it + Debug debug = Debug.getInstance("certpath"); + if (debug != null) { + debug.println("Unknown value for the " + + "jdk.security.caDistrustPolicies property: " + + policy); + } + } + } + return set; + } +}
--- a/src/share/classes/sun/security/validator/EndEntityChecker.java Wed Apr 17 03:47:21 2019 +0100 +++ b/src/share/classes/sun/security/validator/EndEntityChecker.java Thu Apr 18 03:46:32 2019 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2019, 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 @@ -132,25 +132,26 @@ return new EndEntityChecker(type, variant); } - void check(X509Certificate cert, Object parameter, - boolean checkUnresolvedCritExts) throws CertificateException { + void check(X509Certificate[] chain, Object parameter, + boolean checkUnresolvedCritExts) + throws CertificateException { if (variant.equals(Validator.VAR_GENERIC)) { return; // no checks } - Set<String> exts = getCriticalExtensions(cert); + Set<String> exts = getCriticalExtensions(chain[0]); if (variant.equals(Validator.VAR_TLS_SERVER)) { - checkTLSServer(cert, (String)parameter, exts); + checkTLSServer(chain[0], (String)parameter, exts); } else if (variant.equals(Validator.VAR_TLS_CLIENT)) { - checkTLSClient(cert, exts); + checkTLSClient(chain[0], exts); } else if (variant.equals(Validator.VAR_CODE_SIGNING)) { - checkCodeSigning(cert, exts); + checkCodeSigning(chain[0], exts); } else if (variant.equals(Validator.VAR_JCE_SIGNING)) { - checkCodeSigning(cert, exts); + checkCodeSigning(chain[0], exts); } else if (variant.equals(Validator.VAR_PLUGIN_CODE_SIGNING)) { - checkCodeSigning(cert, exts); + checkCodeSigning(chain[0], exts); } else if (variant.equals(Validator.VAR_TSA_SERVER)) { - checkTSAServer(cert, exts); + checkTSAServer(chain[0], exts); } else { throw new CertificateException("Unknown variant: " + variant); } @@ -159,6 +160,12 @@ if (checkUnresolvedCritExts) { checkRemainingExtensions(exts); } + + // check if certificate should be distrusted according to policies + // set in the jdk.security.caDistrustPolicies security property + for (CADistrustPolicy policy : CADistrustPolicy.POLICIES) { + policy.checkDistrust(variant, chain); + } } /**
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/share/classes/sun/security/validator/SymantecTLSPolicy.java Thu Apr 18 03:46:32 2019 +0100 @@ -0,0 +1,199 @@ +/* + * Copyright (c) 2018, 2019, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ +package sun.security.validator; + +import java.security.cert.X509Certificate; +import java.time.LocalDate; +import java.time.Month; +import java.time.ZoneOffset; +import java.util.Arrays; +import java.util.Date; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Set; + +import sun.security.x509.X509CertImpl; + +/** + * This class checks if Symantec issued TLS Server certificates should be + * restricted. + */ +final class SymantecTLSPolicy { + private static final LocalDate DECEMBER_31_2019 = + LocalDate.of(2019, Month.DECEMBER, 31); + // SHA-256 certificate fingerprints of subCAs with later distrust dates + private static final Map<String, LocalDate> EXEMPT_SUBCAS = new HashMap(); + static { + // Subject DN: C=US, O=Apple Inc., OU=Certification Authority, + // CN=Apple IST CA 2 - G1 + // Issuer DN: CN=GeoTrust Global CA, O=GeoTrust Inc., C=US + EXEMPT_SUBCAS.put("AC2B922ECFD5E01711772FEA8ED372DE9D1E2245FCE3F57A9CDBEC77296A424B", + DECEMBER_31_2019); + + + // Subject DN: C=US, O=Apple Inc., OU=Certification Authority, + // CN=Apple IST CA 8 - G1 + // Issuer DN: CN=GeoTrust Primary Certification Authority - G2, + // OU=(c) 2007 GeoTrust Inc. - For authorized use only, + // O=GeoTrust Inc., C=US + EXEMPT_SUBCAS.put("A4FE7C7F15155F3F0AEF7AAA83CF6E06DEB97CA3F909DF920AC1490882D488ED", + DECEMBER_31_2019); + } + + // SHA-256 certificate fingerprints of distrusted roots + private static final Set<String> FINGERPRINTS = new HashSet<>(Arrays.asList( + // cacerts alias: geotrustglobalca + // DN: CN=GeoTrust Global CA, O=GeoTrust Inc., C=US + "FF856A2D251DCD88D36656F450126798CFABAADE40799C722DE4D2B5DB36A73A", + // cacerts alias: geotrustprimaryca + // DN: CN=GeoTrust Primary Certification Authority, + // O=GeoTrust Inc., C=US + "37D51006C512EAAB626421F1EC8C92013FC5F82AE98EE533EB4619B8DEB4D06C", + // cacerts alias: geotrustprimarycag2 + // DN: CN=GeoTrust Primary Certification Authority - G2, + // OU=(c) 2007 GeoTrust Inc. - For authorized use only, + // O=GeoTrust Inc., C=US + "5EDB7AC43B82A06A8761E8D7BE4979EBF2611F7DD79BF91C1C6B566A219ED766", + // cacerts alias: geotrustprimarycag3 + // DN: CN=GeoTrust Primary Certification Authority - G3, + // OU=(c) 2008 GeoTrust Inc. - For authorized use only, + // O=GeoTrust Inc., C=US + "B478B812250DF878635C2AA7EC7D155EAA625EE82916E2CD294361886CD1FBD4", + // cacerts alias: geotrustuniversalca + // DN: CN=GeoTrust Universal CA, O=GeoTrust Inc., C=US + "A0459B9F63B22559F5FA5D4C6DB3F9F72FF19342033578F073BF1D1B46CBB912", + // cacerts alias: thawteprimaryrootca + // DN: CN=thawte Primary Root CA, + // OU="(c) 2006 thawte, Inc. - For authorized use only", + // OU=Certification Services Division, O="thawte, Inc.", C=US + "8D722F81A9C113C0791DF136A2966DB26C950A971DB46B4199F4EA54B78BFB9F", + // cacerts alias: thawteprimaryrootcag2 + // DN: CN=thawte Primary Root CA - G2, + // OU="(c) 2007 thawte, Inc. - For authorized use only", + // O="thawte, Inc.", C=US + "A4310D50AF18A6447190372A86AFAF8B951FFB431D837F1E5688B45971ED1557", + // cacerts alias: thawteprimaryrootcag3 + // DN: CN=thawte Primary Root CA - G3, + // OU="(c) 2008 thawte, Inc. - For authorized use only", + // OU=Certification Services Division, O="thawte, Inc.", C=US + "4B03F45807AD70F21BFC2CAE71C9FDE4604C064CF5FFB686BAE5DBAAD7FDD34C", + // cacerts alias: thawtepremiumserverca + // DN: EMAILADDRESS=premium-server@thawte.com, + // CN=Thawte Premium Server CA, OU=Certification Services Division, + // O=Thawte Consulting cc, L=Cape Town, ST=Western Cape, C=ZA + "3F9F27D583204B9E09C8A3D2066C4B57D3A2479C3693650880505698105DBCE9", + // cacerts alias: verisignclass2g2ca + // DN: OU=VeriSign Trust Network, + // OU="(c) 1998 VeriSign, Inc. - For authorized use only", + // OU=Class 2 Public Primary Certification Authority - G2, + // O="VeriSign, Inc.", C=US + "3A43E220FE7F3EA9653D1E21742EAC2B75C20FD8980305BC502CAF8C2D9B41A1", + // cacerts alias: verisignclass3ca + // DN: OU=Class 3 Public Primary Certification Authority, + // O="VeriSign, Inc.", C=US + "A4B6B3996FC2F306B3FD8681BD63413D8C5009CC4FA329C2CCF0E2FA1B140305", + // cacerts alias: verisignclass3g2ca + // DN: OU=VeriSign Trust Network, + // OU="(c) 1998 VeriSign, Inc. - For authorized use only", + // OU=Class 3 Public Primary Certification Authority - G2, + // O="VeriSign, Inc.", C=US + "83CE3C1229688A593D485F81973C0F9195431EDA37CC5E36430E79C7A888638B", + // cacerts alias: verisignclass3g3ca + // DN: CN=VeriSign Class 3 Public Primary Certification Authority - G3, + // OU="(c) 1999 VeriSign, Inc. - For authorized use only", + // OU=VeriSign Trust Network, O="VeriSign, Inc.", C=US + "EB04CF5EB1F39AFA762F2BB120F296CBA520C1B97DB1589565B81CB9A17B7244", + // cacerts alias: verisignclass3g4ca + // DN: CN=VeriSign Class 3 Public Primary Certification Authority - G4, + // OU="(c) 2007 VeriSign, Inc. - For authorized use only", + // OU=VeriSign Trust Network, O="VeriSign, Inc.", C=US + "69DDD7EA90BB57C93E135DC85EA6FCD5480B603239BDC454FC758B2A26CF7F79", + // cacerts alias: verisignclass3g5ca + // DN: CN=VeriSign Class 3 Public Primary Certification Authority - G5, + // OU="(c) 2006 VeriSign, Inc. - For authorized use only", + // OU=VeriSign Trust Network, O="VeriSign, Inc.", C=US + "9ACFAB7E43C8D880D06B262A94DEEEE4B4659989C3D0CAF19BAF6405E41AB7DF", + // cacerts alias: verisignuniversalrootca + // DN: CN=VeriSign Universal Root Certification Authority, + // OU="(c) 2008 VeriSign, Inc. - For authorized use only", + // OU=VeriSign Trust Network, O="VeriSign, Inc.", C=US + "2399561127A57125DE8CEFEA610DDF2FA078B5C8067F4E828290BFB860E84B3C" + )); + + // Any TLS Server certificate that is anchored by one of the Symantec + // roots above and is issued after this date will be distrusted. + private static final LocalDate APRIL_16_2019 = + LocalDate.of(2019, Month.APRIL, 16); + + /** + * This method assumes the eeCert is a TLS Server Cert and chains back to + * the anchor. + * + * @param chain the end-entity's certificate chain. The end entity cert + * is at index 0, the trust anchor at index n-1. + * @throws ValidatorException if the certificate is distrusted + */ + static void checkDistrust(X509Certificate[] chain) + throws ValidatorException { + X509Certificate anchor = chain[chain.length-1]; + if (FINGERPRINTS.contains(fingerprint(anchor))) { + Date notBefore = chain[0].getNotBefore(); + LocalDate ldNotBefore = notBefore.toInstant().atZone(ZoneOffset.UTC).toLocalDate(); + + // check if chain goes through one of the subCAs + if (chain.length > 2) { + X509Certificate subCA = chain[chain.length - 2]; + LocalDate distrustDate = EXEMPT_SUBCAS.get(fingerprint(subCA)); + if (distrustDate != null) { + // reject if certificate is issued after specified date + checkNotBefore(ldNotBefore, distrustDate, anchor); + return; // success + } + } + // reject if certificate is issued after April 16, 2019 + checkNotBefore(ldNotBefore, APRIL_16_2019, anchor); + } + } + + private static String fingerprint(X509Certificate cert) { + return (cert instanceof X509CertImpl) + ? ((X509CertImpl)cert).getFingerprint("SHA-256") + : X509CertImpl.getFingerprint("SHA-256", cert); + } + + private static void checkNotBefore(LocalDate notBeforeDate, + LocalDate distrustDate, X509Certificate anchor) + throws ValidatorException { + if (notBeforeDate.isAfter(distrustDate)) { + throw new ValidatorException + ("TLS Server certificate issued after " + distrustDate + + " and anchored by a distrusted legacy Symantec root CA: " + + anchor.getSubjectX500Principal(), + ValidatorException.T_UNTRUSTED_CERT, anchor); + } + } + private SymantecTLSPolicy() {} +}
--- a/src/share/classes/sun/security/validator/Validator.java Wed Apr 17 03:47:21 2019 +0100 +++ b/src/share/classes/sun/security/validator/Validator.java Thu Apr 18 03:46:32 2019 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2019, 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 @@ -271,7 +271,7 @@ // redundant. boolean checkUnresolvedCritExts = (type == TYPE_PKIX) ? false : true; - endEntityChecker.check(chain[0], parameter, + endEntityChecker.check(chain, parameter, checkUnresolvedCritExts); }
--- a/src/share/classes/sun/security/x509/CRLExtensions.java Wed Apr 17 03:47:21 2019 +0100 +++ b/src/share/classes/sun/security/x509/CRLExtensions.java Thu Apr 18 03:46:32 2019 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2019, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -238,8 +238,8 @@ /** * Compares this CRLExtensions for equality with the specified - * object. If the <code>other</code> object is an - * <code>instanceof</code> <code>CRLExtensions</code>, then + * object. If the {@code other} object is an + * {@code instanceof} {@code CRLExtensions}, then * all the entries are compared with the entries from this. * * @param other the object to test for equality with this CRLExtensions. @@ -286,10 +286,10 @@ } /** - * Returns a string representation of this <tt>CRLExtensions</tt> object + * Returns a string representation of this {@code CRLExtensions} object * in the form of a set of entries, enclosed in braces and separated - * by the ASCII characters "<tt>, </tt>" (comma and space). - * <p>Overrides to <tt>toString</tt> method of <tt>Object</tt>. + * by the ASCII characters "{@code , }" (comma and space). + * <p>Overrides to {@code toString} method of {@code Object}. * * @return a string representation of this CRLExtensions. */
--- a/src/share/classes/sun/security/x509/CertificateExtensions.java Wed Apr 17 03:47:21 2019 +0100 +++ b/src/share/classes/sun/security/x509/CertificateExtensions.java Thu Apr 18 03:46:32 2019 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2019, 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 @@ -290,8 +290,8 @@ /** * Compares this CertificateExtensions for equality with the specified - * object. If the <code>other</code> object is an - * <code>instanceof</code> <code>CertificateExtensions</code>, then + * object. If the {@code other} object is an + * {@code instanceof} {@code CertificateExtensions}, then * all the entries are compared with the entries from this. * * @param other the object to test for equality with this @@ -340,10 +340,10 @@ } /** - * Returns a string representation of this <tt>CertificateExtensions</tt> + * Returns a string representation of this {@code CertificateExtensions} * object in the form of a set of entries, enclosed in braces and separated - * by the ASCII characters "<tt>, </tt>" (comma and space). - * <p>Overrides to <tt>toString</tt> method of <tt>Object</tt>. + * by the ASCII characters "{@code , }" (comma and space). + * <p>Overrides to {@code toString} method of {@code Object}. * * @return a string representation of this CertificateExtensions. */
--- a/src/share/classes/sun/security/x509/DNSName.java Wed Apr 17 03:47:21 2019 +0100 +++ b/src/share/classes/sun/security/x509/DNSName.java Thu Apr 18 03:46:32 2019 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2018, 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 @@ -34,16 +34,17 @@ * This class implements the DNSName as required by the GeneralNames * ASN.1 object. * <p> - * [RFC2459] When the subjectAltName extension contains a domain name service + * [RFC5280] When the subjectAltName extension contains a domain name system * label, the domain name MUST be stored in the dNSName (an IA5String). - * The name MUST be in the "preferred name syntax," as specified by RFC - * 1034 [RFC 1034]. Note that while upper and lower case letters are - * allowed in domain names, no signifigance is attached to the case. In + * The name MUST be in the "preferred name syntax", as specified by + * Section 3.5 of [RFC1034] and as modified by Section 2.1 of + * [RFC1123]. Note that while uppercase and lowercase letters are + * allowed in domain names, no significance is attached to the case. In * addition, while the string " " is a legal domain name, subjectAltName - * extensions with a dNSName " " are not permitted. Finally, the use of - * the DNS representation for Internet mail addresses (wpolk.nist.gov - * instead of wpolk@nist.gov) is not permitted; such identities are to - * be encoded as rfc822Name. + * extensions with a dNSName of " " MUST NOT be used. Finally, the use + * of the DNS representation for Internet mail addresses + * (subscriber.example.com instead of subscriber@example.com) MUST NOT + * be used; such identities are to be encoded as rfc822Name. * <p> * @author Amit Kapoor * @author Hemma Prafullchandra @@ -51,9 +52,8 @@ public class DNSName implements GeneralNameInterface { private String name; - private static final String alpha = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"; - private static final String digitsAndHyphen = "0123456789-"; - private static final String alphaDigitsAndHyphen = alpha + digitsAndHyphen; + private static final String alphaDigits = + "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"; /** * Create the DNSName object from the passed encoded Der value. @@ -73,35 +73,38 @@ */ public DNSName(String name) throws IOException { if (name == null || name.length() == 0) - throw new IOException("DNS name must not be null"); - if (name.indexOf(' ') != -1) - throw new IOException("DNS names or NameConstraints with blank components are not permitted"); - if (name.charAt(0) == '.' || name.charAt(name.length() -1) == '.') - throw new IOException("DNS names or NameConstraints may not begin or end with a ."); - //Name will consist of label components separated by "." - //startIndex is the index of the first character of a component - //endIndex is the index of the last character of a component plus 1 - for (int endIndex,startIndex=0; startIndex < name.length(); startIndex = endIndex+1) { + throw new IOException("DNSName must not be null or empty"); + if (name.contains(" ")) + throw new IOException("DNSName with blank components is not permitted"); + if (name.startsWith(".") || name.endsWith(".")) + throw new IOException("DNSName may not begin or end with a ."); + /* + * Name will consist of label components separated by "." + * startIndex is the index of the first character of a component + * endIndex is the index of the last character of a component plus 1 + */ + for (int endIndex,startIndex = 0; startIndex < name.length(); startIndex = endIndex+1) { endIndex = name.indexOf('.', startIndex); if (endIndex < 0) { endIndex = name.length(); } - if ((endIndex-startIndex) < 1) - throw new IOException("DNSName SubjectAltNames with empty components are not permitted"); + if (endIndex - startIndex < 1) + throw new IOException("DNSName with empty components are not permitted"); - //DNSName components must begin with a letter A-Z or a-z - if (alpha.indexOf(name.charAt(startIndex)) < 0) - throw new IOException("DNSName components must begin with a letter"); + // RFC 1123: DNSName components must begin with a letter or digit + if (alphaDigits.indexOf(name.charAt(startIndex)) < 0) + throw new IOException("DNSName components must begin with a letter or digit"); //nonStartIndex: index for characters in the component beyond the first one for (int nonStartIndex=startIndex+1; nonStartIndex < endIndex; nonStartIndex++) { char x = name.charAt(nonStartIndex); - if ((alphaDigitsAndHyphen).indexOf(x) < 0) + if ((alphaDigits).indexOf(x) < 0 && x != '-') throw new IOException("DNSName components must consist of letters, digits, and hyphens"); } } this.name = name; } + /** * Return the type of the GeneralName. */ @@ -117,7 +120,7 @@ } /** - * Encode the DNS name into the DerOutputStream. + * Encode the DNSName into the DerOutputStream. * * @param out the DER stream to encode the DNSName to. * @exception IOException on encoding errors. @@ -137,7 +140,7 @@ * Compares this name with another, for equality. * * @return true iff the names are equivalent - * according to RFC2459. + * according to RFC5280. */ public boolean equals(Object obj) { if (this == obj) @@ -148,7 +151,7 @@ DNSName other = (DNSName)obj; - // RFC2459 mandates that these names are + // RFC5280 mandates that these names are // not case-sensitive return name.equalsIgnoreCase(other.name); } @@ -172,12 +175,14 @@ * </ul>. These results are used in checking NameConstraints during * certification path verification. * <p> - * RFC2459: DNS name restrictions are expressed as foo.bar.com. Any subdomain - * satisfies the name constraint. For example, www.foo.bar.com would - * satisfy the constraint but bigfoo.bar.com would not. + * RFC5280: DNS name restrictions are expressed as host.example.com. + * Any DNS name that can be constructed by simply adding zero or more + * labels to the left-hand side of the name satisfies the name constraint. + * For example, www.host.example.com would satisfy the constraint but + * host1.example.com would not. * <p> - * draft-ietf-pkix-new-part1-00.txt: DNS name restrictions are expressed as foo.bar.com. - * Any DNS name that + * draft-ietf-pkix-new-part1-00.txt: DNSName restrictions are expressed as foo.bar.com. + * Any DNSName that * can be constructed by simply adding to the left hand side of the name * satisfies the name constraint. For example, www.foo.bar.com would * satisfy the constraint but foo1.bar.com would not.
--- a/src/share/classes/sun/security/x509/GeneralName.java Wed Apr 17 03:47:21 2019 +0100 +++ b/src/share/classes/sun/security/x509/GeneralName.java Thu Apr 18 03:46:32 2019 +0100 @@ -112,7 +112,7 @@ encName.resetTag(DerValue.tag_IA5String); name = new DNSName(encName); } else { - throw new IOException("Invalid encoding of DNS name"); + throw new IOException("Invalid encoding of DNSName"); } break;
--- a/src/share/classes/sun/security/x509/RFC822Name.java Wed Apr 17 03:47:21 2019 +0100 +++ b/src/share/classes/sun/security/x509/RFC822Name.java Thu Apr 18 03:46:32 2019 +0100 @@ -246,7 +246,7 @@ subtree=subtree.substring(atNdx+1); } - /* count dots in dnsname, adding one if dnsname preceded by @ */ + /* count dots in DNSName, adding one if DNSName preceded by @ */ for (; subtree.lastIndexOf('.') >= 0; i++) { subtree=subtree.substring(0,subtree.lastIndexOf('.')); }
--- a/src/share/classes/sun/security/x509/URIName.java Wed Apr 17 03:47:21 2019 +0100 +++ b/src/share/classes/sun/security/x509/URIName.java Thu Apr 18 03:46:32 2019 +0100 @@ -131,13 +131,13 @@ try { hostDNS = new DNSName(host); } catch (IOException ioe) { - // Not a valid DNS Name; see if it is a valid IPv4 + // Not a valid DNSName; see if it is a valid IPv4 // IPAddressName try { hostIP = new IPAddressName(host); } catch (Exception ioe2) { throw new IOException("invalid URI name (host " + - "portion is not a valid DNS name, IPv4 address," + + "portion is not a valid DNSName, IPv4 address," + " or IPv6 address):" + name); } } @@ -339,7 +339,7 @@ // If one (or both) is an IP address, only same type constraintType = NAME_SAME_TYPE; } else { - // Both host portions are DNS names. Are they domains? + // Both host portions are DNSNames. Are they domains? boolean thisDomain = (host.charAt(0) == '.'); boolean otherDomain = (otherHost.charAt(0) == '.'); DNSName otherDNS = (DNSName) otherHostObject;
--- a/src/share/classes/sun/security/x509/X500Name.java Wed Apr 17 03:47:21 2019 +0100 +++ b/src/share/classes/sun/security/x509/X500Name.java Thu Apr 18 03:46:32 2019 +0100 @@ -1219,7 +1219,7 @@ */ /* - * OID for "DC=" domain component attributes, used with DNS names in DN + * OID for "DC=" domain component attributes, used with DNSNames in DN * format */ DOMAIN_COMPONENT_OID =
--- a/src/share/classes/sun/text/resources/FormatData.java Wed Apr 17 03:47:21 2019 +0100 +++ b/src/share/classes/sun/text/resources/FormatData.java Thu Apr 18 03:46:32 2019 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1996, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1996, 2019, 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 @@ -106,6 +106,7 @@ "T", "S", "H", + "R", }; // Japanese imperial calendar era strings @@ -115,6 +116,7 @@ "Taisho", "Showa", "Heisei", + "Reiwa", }; return new Object[][] {
--- a/src/share/classes/sun/text/resources/JavaTimeSupplementary.java Wed Apr 17 03:47:21 2019 +0100 +++ b/src/share/classes/sun/text/resources/JavaTimeSupplementary.java Thu Apr 18 03:46:32 2019 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2019, 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 @@ -237,6 +237,7 @@ "Taisho", "Showa", "Heisei", + "Reiwa", } }, { "java.time.japanese.short.Eras", @@ -246,6 +247,7 @@ "Taisho", "Showa", "Heisei", + "Reiwa", } }, { "java.time.roc.DatePatterns",
--- a/src/share/classes/sun/text/resources/ja/FormatData_ja.java Wed Apr 17 03:47:21 2019 +0100 +++ b/src/share/classes/sun/text/resources/ja/FormatData_ja.java Thu Apr 18 03:46:32 2019 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1996, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1996, 2019, 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 @@ "\u5927\u6b63", // Taisho "\u662d\u548c", // Showa "\u5e73\u6210", // Heisei + "\u4ee4\u548c", // Reiwa }; final String[] rocEras = { "\u6c11\u56fd\u524d",
--- a/src/share/classes/sun/text/resources/ja/JavaTimeSupplementary_ja.java Wed Apr 17 03:47:21 2019 +0100 +++ b/src/share/classes/sun/text/resources/ja/JavaTimeSupplementary_ja.java Thu Apr 18 03:46:32 2019 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2019, 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 @@ -198,6 +198,7 @@ "\u5927\u6b63", "\u662d\u548c", "\u5e73\u6210", + "\u4ee4\u548c", } }, { "java.time.japanese.short.Eras", @@ -207,6 +208,7 @@ "\u5927\u6b63", "\u662d\u548c", "\u5e73\u6210", + "\u4ee4\u548c", } }, { "java.time.long.Eras",
--- a/src/share/classes/sun/util/calendar/Era.java Wed Apr 17 03:47:21 2019 +0100 +++ b/src/share/classes/sun/util/calendar/Era.java Thu Apr 18 03:46:32 2019 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2005, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2019, 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 @@ -49,6 +49,7 @@ * Taisho 1912-07-30 midnight local time * Showa 1926-12-26 midnight local time * Heisei 1989-01-08 midnight local time + * Reiwa 2019-05-01T00:00:00 local time * Julian calendar BeforeCommonEra -292275055-05-16T16:47:04.192Z * CommonEra 0000-12-30 midnight local time * Taiwanese calendar MinGuo 1911-01-01 midnight local time
--- a/src/share/classes/sun/util/cldr/resources/21_0_1/common/main/ja.xml Wed Apr 17 03:47:21 2019 +0100 +++ b/src/share/classes/sun/util/cldr/resources/21_0_1/common/main/ja.xml Thu Apr 18 03:46:32 2019 +0100 @@ -2410,6 +2410,7 @@ <era type="233">大正</era> <era type="234">昭和</era> <era type="235">平成</era> + <era type="236">令和</era> </eraAbbr> </eras> <dateFormats>
--- a/src/share/classes/sun/util/cldr/resources/21_0_1/common/main/root.xml Wed Apr 17 03:47:21 2019 +0100 +++ b/src/share/classes/sun/util/cldr/resources/21_0_1/common/main/root.xml Thu Apr 18 03:46:32 2019 +0100 @@ -1657,12 +1657,14 @@ <era type="233">Taishō</era> <era type="234">Shōwa</era> <era type="235">Heisei</era> + <era type="236">Reiwa</era> </eraAbbr> <eraNarrow> <era type="232">M</era> <era type="233">T</era> <era type="234">S</era> <era type="235">H</era> + <era type="236">R</era> </eraNarrow> </eras> <dateFormats>
--- a/src/share/classes/sun/util/locale/provider/CalendarNameProviderImpl.java Wed Apr 17 03:47:21 2019 +0100 +++ b/src/share/classes/sun/util/locale/provider/CalendarNameProviderImpl.java Thu Apr 18 03:46:32 2019 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2019, 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 @@ -35,8 +35,8 @@ import sun.util.calendar.Era; /** - * Concrete implementation of the {@link java.util.spi.CalendarDataProvider - * CalendarDataProvider} class for the JRE LocaleProviderAdapter. + * Concrete implementation of the {@link java.util.spi.CalendarNameProvider + * CalendarNameProvider} class for the JRE LocaleProviderAdapter. * * @author Masayoshi Okutsu * @author Naoto Sato @@ -69,23 +69,44 @@ if (field == DAY_OF_WEEK || field == YEAR) { --value; } - if (value < 0 || value > strings.length) { + if (value < 0) { return null; - } else if (value == strings.length) { + } else if (value >= strings.length) { if (field == ERA && "japanese".equals(calendarType)) { - // get the supplemental era, if any, specified through - // the property "jdk.calendar.japanese.supplemental.era" - // which is always the last element. Era[] jeras = CalendarSystem.forName("japanese").getEras(); - if (jeras.length == value) { + if (value <= jeras.length) { + // Localized era name could not be retrieved from this provider. + // This can occur either for Reiwa or SupEra. + // + // If it's CLDR provider, try COMPAT first, which is guaranteed to have + // the name for Reiwa. + if (type == LocaleProviderAdapter.Type.CLDR) { + lr = LocaleProviderAdapter.forJRE().getLocaleResources(locale); + key = getResourceKeyFor(LocaleProviderAdapter.Type.JRE, + calendarType, field, style, javatime); + strings = + javatime ? lr.getJavaTimeNames(key) : lr.getCalendarNames(key); + } + if (strings == null || value >= strings.length) { + // Get the default name for SupEra Era supEra = jeras[value - 1]; // 0-based index - return style == LONG ? + if (javatime) { + return getBaseStyle(style) == NARROW_FORMAT ? + supEra.getAbbreviation() : + supEra.getName(); + } else { + return (style & LONG) != 0 ? supEra.getName() : supEra.getAbbreviation(); } } + } else { return null; } + } else { + return null; + } + } name = strings[value]; // If name is empty in standalone, try its `format' style. if (name.length() == 0 @@ -158,7 +179,7 @@ return map; } - private int getBaseStyle(int style) { + private static int getBaseStyle(int style) { return style & ~(SHORT_STANDALONE - SHORT_FORMAT); } @@ -239,6 +260,11 @@ } private String getResourceKey(String type, int field, int style, boolean javatime) { + return getResourceKeyFor(this.type, type, field, style, javatime); + } + + private static String getResourceKeyFor(LocaleProviderAdapter.Type adapterType, + String type, int field, int style, boolean javatime) { int baseStyle = getBaseStyle(style); boolean isStandalone = (style != baseStyle); @@ -262,7 +288,7 @@ // JRE and CLDR use different resource key conventions // due to historical reasons. (JRE DateFormatSymbols.getEras returns // abbreviations while other getShort*() return abbreviations.) - if (this.type == LocaleProviderAdapter.Type.JRE) { + if (adapterType == LocaleProviderAdapter.Type.JRE) { if (javatime) { if (baseStyle == LONG) { key.append("long."); @@ -314,7 +340,7 @@ return key.length() > 0 ? key.toString() : null; } - private String toStyleName(int baseStyle) { + private static String toStyleName(int baseStyle) { switch (baseStyle) { case SHORT: return "Abbreviations";
--- a/src/share/lib/calendars.properties Wed Apr 17 03:47:21 2019 +0100 +++ b/src/share/lib/calendars.properties Thu Apr 18 03:46:32 2019 +0100 @@ -29,12 +29,14 @@ # Taisho since 1912-07-30 00:00:00 local time (Gregorian) # Showa since 1926-12-25 00:00:00 local time (Gregorian) # Heisei since 1989-01-08 00:00:00 local time (Gregorian) +# Reiwa since 2019-05-01 00:00:00 local time (Gregorian) calendar.japanese.type: LocalGregorianCalendar calendar.japanese.eras: \ name=Meiji,abbr=M,since=-3218832000000; \ name=Taisho,abbr=T,since=-1812153600000; \ name=Showa,abbr=S,since=-1357603200000; \ - name=Heisei,abbr=H,since=600220800000 + name=Heisei,abbr=H,since=600220800000; \ + name=Reiwa,abbr=R,since=1556668800000 # # Taiwanese calendar
--- a/src/share/lib/security/java.security-aix Wed Apr 17 03:47:21 2019 +0100 +++ b/src/share/lib/security/java.security-aix Thu Apr 18 03:46:32 2019 +0100 @@ -982,3 +982,33 @@ # and javax.crypto.spec.SecretKeySpec and rejects all the others. jceks.key.serialFilter = java.lang.Enum;java.security.KeyRep;\ java.security.KeyRep$Type;javax.crypto.spec.SecretKeySpec;!* + +# +# Policies for distrusting Certificate Authorities (CAs). +# +# This is a comma separated value of one or more case-sensitive strings, each +# of which represents a policy for determining if a CA should be distrusted. +# The supported values are: +# +# +# SYMANTEC_TLS : Distrust TLS Server certificates anchored by a Symantec +# root CA and issued after April 16, 2019 unless issued by one of the +# following subordinate CAs which have a later distrust date: +# 1. Apple IST CA 2 - G1, SHA-256 fingerprint: +# AC2B922ECFD5E01711772FEA8ED372DE9D1E2245FCE3F57A9CDBEC77296A424B +# Distrust after December 31, 2019. +# 2. Apple IST CA 8 - G1, SHA-256 fingerprint: +# A4FE7C7F15155F3F0AEF7AAA83CF6E06DEB97CA3F909DF920AC1490882D488ED +# Distrust after December 31, 2019. +# Leading and trailing whitespace surrounding each value are ignored. +# Unknown values are ignored. If the property is commented out or set to the +# empty String, no policies are enforced. +# +# Note: This property is currently used by the JDK Reference implementation. +# It is not guaranteed to be supported by other SE implementations. Also, this +# property does not override other security properties which can restrict +# certificates such as jdk.tls.disabledAlgorithms or +# jdk.certpath.disabledAlgorithms; those restrictions are still enforced even +# if this property is not enabled. +# +jdk.security.caDistrustPolicies=SYMANTEC_TLS
--- a/src/share/lib/security/java.security-linux Wed Apr 17 03:47:21 2019 +0100 +++ b/src/share/lib/security/java.security-linux Thu Apr 18 03:46:32 2019 +0100 @@ -988,3 +988,33 @@ # and javax.crypto.spec.SecretKeySpec and rejects all the others. jceks.key.serialFilter = java.lang.Enum;java.security.KeyRep;\ java.security.KeyRep$Type;javax.crypto.spec.SecretKeySpec;!* + +# +# Policies for distrusting Certificate Authorities (CAs). +# +# This is a comma separated value of one or more case-sensitive strings, each +# of which represents a policy for determining if a CA should be distrusted. +# The supported values are: +# +# +# SYMANTEC_TLS : Distrust TLS Server certificates anchored by a Symantec +# root CA and issued after April 16, 2019 unless issued by one of the +# following subordinate CAs which have a later distrust date: +# 1. Apple IST CA 2 - G1, SHA-256 fingerprint: +# AC2B922ECFD5E01711772FEA8ED372DE9D1E2245FCE3F57A9CDBEC77296A424B +# Distrust after December 31, 2019. +# 2. Apple IST CA 8 - G1, SHA-256 fingerprint: +# A4FE7C7F15155F3F0AEF7AAA83CF6E06DEB97CA3F909DF920AC1490882D488ED +# Distrust after December 31, 2019. +# Leading and trailing whitespace surrounding each value are ignored. +# Unknown values are ignored. If the property is commented out or set to the +# empty String, no policies are enforced. +# +# Note: This property is currently used by the JDK Reference implementation. +# It is not guaranteed to be supported by other SE implementations. Also, this +# property does not override other security properties which can restrict +# certificates such as jdk.tls.disabledAlgorithms or +# jdk.certpath.disabledAlgorithms; those restrictions are still enforced even +# if this property is not enabled. +# +jdk.security.caDistrustPolicies=SYMANTEC_TLS
--- a/src/share/lib/security/java.security-macosx Wed Apr 17 03:47:21 2019 +0100 +++ b/src/share/lib/security/java.security-macosx Thu Apr 18 03:46:32 2019 +0100 @@ -986,3 +986,33 @@ # and javax.crypto.spec.SecretKeySpec and rejects all the others. jceks.key.serialFilter = java.lang.Enum;java.security.KeyRep;\ java.security.KeyRep$Type;javax.crypto.spec.SecretKeySpec;!* + +# +# Policies for distrusting Certificate Authorities (CAs). +# +# This is a comma separated value of one or more case-sensitive strings, each +# of which represents a policy for determining if a CA should be distrusted. +# The supported values are: +# +# +# SYMANTEC_TLS : Distrust TLS Server certificates anchored by a Symantec +# root CA and issued after April 16, 2019 unless issued by one of the +# following subordinate CAs which have a later distrust date: +# 1. Apple IST CA 2 - G1, SHA-256 fingerprint: +# AC2B922ECFD5E01711772FEA8ED372DE9D1E2245FCE3F57A9CDBEC77296A424B +# Distrust after December 31, 2019. +# 2. Apple IST CA 8 - G1, SHA-256 fingerprint: +# A4FE7C7F15155F3F0AEF7AAA83CF6E06DEB97CA3F909DF920AC1490882D488ED +# Distrust after December 31, 2019. +# Leading and trailing whitespace surrounding each value are ignored. +# Unknown values are ignored. If the property is commented out or set to the +# empty String, no policies are enforced. +# +# Note: This property is currently used by the JDK Reference implementation. +# It is not guaranteed to be supported by other SE implementations. Also, this +# property does not override other security properties which can restrict +# certificates such as jdk.tls.disabledAlgorithms or +# jdk.certpath.disabledAlgorithms; those restrictions are still enforced even +# if this property is not enabled. +# +jdk.security.caDistrustPolicies=SYMANTEC_TLS
--- a/src/share/lib/security/java.security-solaris Wed Apr 17 03:47:21 2019 +0100 +++ b/src/share/lib/security/java.security-solaris Thu Apr 18 03:46:32 2019 +0100 @@ -985,3 +985,33 @@ # and javax.crypto.spec.SecretKeySpec and rejects all the others. jceks.key.serialFilter = java.lang.Enum;java.security.KeyRep;\ java.security.KeyRep$Type;javax.crypto.spec.SecretKeySpec;!* + +# +# Policies for distrusting Certificate Authorities (CAs). +# +# This is a comma separated value of one or more case-sensitive strings, each +# of which represents a policy for determining if a CA should be distrusted. +# The supported values are: +# +# +# SYMANTEC_TLS : Distrust TLS Server certificates anchored by a Symantec +# root CA and issued after April 16, 2019 unless issued by one of the +# following subordinate CAs which have a later distrust date: +# 1. Apple IST CA 2 - G1, SHA-256 fingerprint: +# AC2B922ECFD5E01711772FEA8ED372DE9D1E2245FCE3F57A9CDBEC77296A424B +# Distrust after December 31, 2019. +# 2. Apple IST CA 8 - G1, SHA-256 fingerprint: +# A4FE7C7F15155F3F0AEF7AAA83CF6E06DEB97CA3F909DF920AC1490882D488ED +# Distrust after December 31, 2019. +# Leading and trailing whitespace surrounding each value are ignored. +# Unknown values are ignored. If the property is commented out or set to the +# empty String, no policies are enforced. +# +# Note: This property is currently used by the JDK Reference implementation. +# It is not guaranteed to be supported by other SE implementations. Also, this +# property does not override other security properties which can restrict +# certificates such as jdk.tls.disabledAlgorithms or +# jdk.certpath.disabledAlgorithms; those restrictions are still enforced even +# if this property is not enabled. +# +jdk.security.caDistrustPolicies=SYMANTEC_TLS
--- a/src/share/lib/security/java.security-windows Wed Apr 17 03:47:21 2019 +0100 +++ b/src/share/lib/security/java.security-windows Thu Apr 18 03:46:32 2019 +0100 @@ -986,3 +986,33 @@ # and javax.crypto.spec.SecretKeySpec and rejects all the others. jceks.key.serialFilter = java.lang.Enum;java.security.KeyRep;\ java.security.KeyRep$Type;javax.crypto.spec.SecretKeySpec;!* + +# +# Policies for distrusting Certificate Authorities (CAs). +# +# This is a comma separated value of one or more case-sensitive strings, each +# of which represents a policy for determining if a CA should be distrusted. +# The supported values are: +# +# +# SYMANTEC_TLS : Distrust TLS Server certificates anchored by a Symantec +# root CA and issued after April 16, 2019 unless issued by one of the +# following subordinate CAs which have a later distrust date: +# 1. Apple IST CA 2 - G1, SHA-256 fingerprint: +# AC2B922ECFD5E01711772FEA8ED372DE9D1E2245FCE3F57A9CDBEC77296A424B +# Distrust after December 31, 2019. +# 2. Apple IST CA 8 - G1, SHA-256 fingerprint: +# A4FE7C7F15155F3F0AEF7AAA83CF6E06DEB97CA3F909DF920AC1490882D488ED +# Distrust after December 31, 2019. +# Leading and trailing whitespace surrounding each value are ignored. +# Unknown values are ignored. If the property is commented out or set to the +# empty String, no policies are enforced. +# +# Note: This property is currently used by the JDK Reference implementation. +# It is not guaranteed to be supported by other SE implementations. Also, this +# property does not override other security properties which can restrict +# certificates such as jdk.tls.disabledAlgorithms or +# jdk.certpath.disabledAlgorithms; those restrictions are still enforced even +# if this property is not enabled. +# +jdk.security.caDistrustPolicies=SYMANTEC_TLS
--- a/src/share/native/com/sun/java/util/jar/pack/zip.cpp Wed Apr 17 03:47:21 2019 +0100 +++ b/src/share/native/com/sun/java/util/jar/pack/zip.cpp Thu Apr 18 03:46:32 2019 +0100 @@ -415,9 +415,11 @@ ((uLong)h << 11) | ((uLong)m << 5) | ((uLong)s >> 1); } -#ifdef _REENTRANT // solaris -extern "C" struct tm *gmtime_r(const time_t *, struct tm *); -#else +/* + * For thread-safe reasons, non-Windows platforms need gmtime_r + * while Windows can directly use gmtime that is already thread-safe. + */ +#ifdef _MSC_VER #define gmtime_r(t, s) gmtime(t) #endif /*
--- a/src/share/native/java/lang/System.c Wed Apr 17 03:47:21 2019 +0100 +++ b/src/share/native/java/lang/System.c Thu Apr 18 03:46:32 2019 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1994, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1994, 2019, 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 @@ -108,9 +108,14 @@ (*env)->DeleteLocalRef(env, jkey); \ } else ((void) 0) -#ifndef VENDOR /* Third party may overwrite this. */ +/* Third party may overwrite these values. */ +#ifndef VENDOR #define VENDOR "Oracle Corporation" +#endif +#ifndef VENDOR_URL #define VENDOR_URL "http://java.oracle.com/" +#endif +#ifndef VENDOR_URL_BUG #define VENDOR_URL_BUG "http://bugreport.sun.com/bugreport/" #endif
--- a/src/share/native/sun/font/freetypeScaler.c Wed Apr 17 03:47:21 2019 +0100 +++ b/src/share/native/sun/font/freetypeScaler.c Thu Apr 18 03:46:32 2019 +0100 @@ -64,6 +64,7 @@ JNIEnv* env; FT_Library library; FT_Face face; + FT_Stream faceStream; jobject font2D; jobject directBuffer; @@ -106,21 +107,14 @@ } static void freeNativeResources(JNIEnv *env, FTScalerInfo* scalerInfo) { - void *stream; if (scalerInfo == NULL) return; - //apparently Done_Face will only close the stream - // but will not relase the memory of stream structure. - // We need to free it explicitly to avoid leak. - //Direct access to the stream field might be not ideal solution as - // it is considred to be "private". - //Alternatively we could have stored pointer to the structure - // in the scalerInfo but this will increase size of the structure - // for no good reason - stream = scalerInfo->face->stream; - + // FT_Done_Face always closes the stream, but only frees the memory + // of the data structure if it was internally allocated by FT. + // We hold on to a pointer to the stream structure if we provide it + // ourselves, so that we can free it here. FT_Done_Face(scalerInfo->face); FT_Done_FreeType(scalerInfo->library); @@ -132,10 +126,9 @@ free(scalerInfo->fontData); } - if (stream != NULL) { - free(stream); - } - + if (scalerInfo->faceStream != NULL) { + free(scalerInfo->faceStream); + } free(scalerInfo); } @@ -306,6 +299,9 @@ &ft_open_args, indexInCollection, &scalerInfo->face); + if (!error) { + scalerInfo->faceStream = ftstream; + } } if (error || scalerInfo->directBuffer == NULL) { free(ftstream);
--- a/src/share/native/sun/font/layout/ContextualSubstSubtables.cpp Wed Apr 17 03:47:21 2019 +0100 +++ b/src/share/native/sun/font/layout/ContextualSubstSubtables.cpp Thu Apr 18 03:46:32 2019 +0100 @@ -67,7 +67,10 @@ le_uint16 lookupListIndex = SWAPW(substLookupRecordArrayPtr[subst].lookupListIndex); tempIterator.setCurrStreamPosition(position); - tempIterator.next(sequenceIndex); + if (!tempIterator.next(sequenceIndex)) { + success = LE_INTERNAL_ERROR; + return; + } lookupProcessor->applySingleLookup(lookupListIndex, &tempIterator, fontInstance, success); }
--- a/src/share/native/sun/font/layout/GlyphIterator.cpp Wed Apr 17 03:47:21 2019 +0100 +++ b/src/share/native/sun/font/layout/GlyphIterator.cpp Thu Apr 18 03:46:32 2019 +0100 @@ -224,6 +224,16 @@ void GlyphIterator::setCurrGlyphID(TTGlyphID glyphID) { + if (direction < 0) { + if (position <= nextLimit || position >= prevLimit) { + return; + } + } else { + if (position <= prevLimit || position >= nextLimit) { + return; + } + } + LEGlyphID glyph = glyphStorage[position]; glyphStorage[position] = LE_SET_GLYPH(glyph, glyphID);
--- a/src/share/native/sun/font/layout/SubstitutionLookups.cpp Wed Apr 17 03:47:21 2019 +0100 +++ b/src/share/native/sun/font/layout/SubstitutionLookups.cpp Thu Apr 18 03:46:32 2019 +0100 @@ -67,7 +67,10 @@ le_uint16 lookupListIndex = SWAPW(substLookupRecordArray[subst].lookupListIndex); tempIterator.setCurrStreamPosition(position); - tempIterator.next(sequenceIndex); + if (!tempIterator.next(sequenceIndex)) { + success = LE_INTERNAL_ERROR; + return; + } lookupProcessor->applySingleLookup(lookupListIndex, &tempIterator, fontInstance, success); }
--- a/src/solaris/native/sun/awt/fontconfig.h Wed Apr 17 03:47:21 2019 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,941 +0,0 @@ -/* - * $RCSId: xc/lib/fontconfig/fontconfig/fontconfig.h,v 1.30 2002/09/26 00:17:27 keithp Exp $ - * - * Copyright © 2001 Keith Packard - * - * Permission to use, copy, modify, distribute, and sell this software and its - * documentation for any purpose is hereby granted without fee, provided that - * the above copyright notice appear in all copies and that both that - * copyright notice and this permission notice appear in supporting - * documentation, and that the name of Keith Packard not be used in - * advertising or publicity pertaining to distribution of the software without - * specific, written prior permission. Keith Packard makes no - * representations about the suitability of this software for any purpose. It - * is provided "as is" without express or implied warranty. - * - * KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, - * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO - * EVENT SHALL KEITH PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR - * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, - * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER - * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ - -#ifndef _FONTCONFIG_H_ -#define _FONTCONFIG_H_ - -#include <sys/types.h> -#include <sys/stat.h> -#include <unistd.h> -#include <stdarg.h> - -#if defined(__GNUC__) && (__GNUC__ >= 4) -#define FC_ATTRIBUTE_SENTINEL(x) __attribute__((__sentinel__(0))) -#else -#define FC_ATTRIBUTE_SENTINEL(x) -#endif - -#ifndef FcPublic -#define FcPublic -#endif - -typedef unsigned char FcChar8; -typedef unsigned short FcChar16; -typedef unsigned int FcChar32; -typedef int FcBool; - -/* - * Current Fontconfig version number. This same number - * must appear in the fontconfig configure.in file. Yes, - * it'a a pain to synchronize version numbers like this. - */ - -#define FC_MAJOR 2 -#define FC_MINOR 5 -#define FC_REVISION 0 - -#define FC_VERSION ((FC_MAJOR * 10000) + (FC_MINOR * 100) + (FC_REVISION)) - -/* - * Current font cache file format version - * This is appended to the cache files so that multiple - * versions of the library will peacefully coexist - * - * Change this value whenever the disk format for the cache file - * changes in any non-compatible way. Try to avoid such changes as - * it means multiple copies of the font information. - */ - -#define FC_CACHE_VERSION "2" - -#define FcTrue 1 -#define FcFalse 0 - -#define FC_FAMILY "family" /* String */ -#define FC_STYLE "style" /* String */ -#define FC_SLANT "slant" /* Int */ -#define FC_WEIGHT "weight" /* Int */ -#define FC_SIZE "size" /* Double */ -#define FC_ASPECT "aspect" /* Double */ -#define FC_PIXEL_SIZE "pixelsize" /* Double */ -#define FC_SPACING "spacing" /* Int */ -#define FC_FOUNDRY "foundry" /* String */ -#define FC_ANTIALIAS "antialias" /* Bool (depends) */ -#define FC_HINTING "hinting" /* Bool (true) */ -#define FC_HINT_STYLE "hintstyle" /* Int */ -#define FC_VERTICAL_LAYOUT "verticallayout" /* Bool (false) */ -#define FC_AUTOHINT "autohint" /* Bool (false) */ -#define FC_GLOBAL_ADVANCE "globaladvance" /* Bool (true) */ -#define FC_WIDTH "width" /* Int */ -#define FC_FILE "file" /* String */ -#define FC_INDEX "index" /* Int */ -#define FC_FT_FACE "ftface" /* FT_Face */ -#define FC_RASTERIZER "rasterizer" /* String */ -#define FC_OUTLINE "outline" /* Bool */ -#define FC_SCALABLE "scalable" /* Bool */ -#define FC_SCALE "scale" /* double */ -#define FC_DPI "dpi" /* double */ -#define FC_RGBA "rgba" /* Int */ -#define FC_MINSPACE "minspace" /* Bool use minimum line spacing */ -#define FC_SOURCE "source" /* String (deprecated) */ -#define FC_CHARSET "charset" /* CharSet */ -#define FC_LANG "lang" /* String RFC 3066 langs */ -#define FC_FONTVERSION "fontversion" /* Int from 'head' table */ -#define FC_FULLNAME "fullname" /* String */ -#define FC_FAMILYLANG "familylang" /* String RFC 3066 langs */ -#define FC_STYLELANG "stylelang" /* String RFC 3066 langs */ -#define FC_FULLNAMELANG "fullnamelang" /* String RFC 3066 langs */ -#define FC_CAPABILITY "capability" /* String */ -#define FC_FONTFORMAT "fontformat" /* String */ -#define FC_EMBOLDEN "embolden" /* Bool - true if emboldening needed*/ -#define FC_EMBEDDED_BITMAP "embeddedbitmap" /* Bool - true to enable embedded bitmaps */ -#define FC_DECORATIVE "decorative" /* Bool - true if style is a decorative variant */ - -#define FC_CACHE_SUFFIX ".cache-"FC_CACHE_VERSION -#define FC_DIR_CACHE_FILE "fonts.cache-"FC_CACHE_VERSION -#define FC_USER_CACHE_FILE ".fonts.cache-"FC_CACHE_VERSION - -/* Adjust outline rasterizer */ -#define FC_CHAR_WIDTH "charwidth" /* Int */ -#define FC_CHAR_HEIGHT "charheight"/* Int */ -#define FC_MATRIX "matrix" /* FcMatrix */ - -#define FC_WEIGHT_THIN 0 -#define FC_WEIGHT_EXTRALIGHT 40 -#define FC_WEIGHT_ULTRALIGHT FC_WEIGHT_EXTRALIGHT -#define FC_WEIGHT_LIGHT 50 -#define FC_WEIGHT_BOOK 75 -#define FC_WEIGHT_REGULAR 80 -#define FC_WEIGHT_NORMAL FC_WEIGHT_REGULAR -#define FC_WEIGHT_MEDIUM 100 -#define FC_WEIGHT_DEMIBOLD 180 -#define FC_WEIGHT_SEMIBOLD FC_WEIGHT_DEMIBOLD -#define FC_WEIGHT_BOLD 200 -#define FC_WEIGHT_EXTRABOLD 205 -#define FC_WEIGHT_ULTRABOLD FC_WEIGHT_EXTRABOLD -#define FC_WEIGHT_BLACK 210 -#define FC_WEIGHT_HEAVY FC_WEIGHT_BLACK -#define FC_WEIGHT_EXTRABLACK 215 -#define FC_WEIGHT_ULTRABLACK FC_WEIGHT_EXTRABLACK - -#define FC_SLANT_ROMAN 0 -#define FC_SLANT_ITALIC 100 -#define FC_SLANT_OBLIQUE 110 - -#define FC_WIDTH_ULTRACONDENSED 50 -#define FC_WIDTH_EXTRACONDENSED 63 -#define FC_WIDTH_CONDENSED 75 -#define FC_WIDTH_SEMICONDENSED 87 -#define FC_WIDTH_NORMAL 100 -#define FC_WIDTH_SEMIEXPANDED 113 -#define FC_WIDTH_EXPANDED 125 -#define FC_WIDTH_EXTRAEXPANDED 150 -#define FC_WIDTH_ULTRAEXPANDED 200 - -#define FC_PROPORTIONAL 0 -#define FC_DUAL 90 -#define FC_MONO 100 -#define FC_CHARCELL 110 - -/* sub-pixel order */ -#define FC_RGBA_UNKNOWN 0 -#define FC_RGBA_RGB 1 -#define FC_RGBA_BGR 2 -#define FC_RGBA_VRGB 3 -#define FC_RGBA_VBGR 4 -#define FC_RGBA_NONE 5 - -/* hinting style */ -#define FC_HINT_NONE 0 -#define FC_HINT_SLIGHT 1 -#define FC_HINT_MEDIUM 2 -#define FC_HINT_FULL 3 - -typedef enum _FcType { - FcTypeVoid, - FcTypeInteger, - FcTypeDouble, - FcTypeString, - FcTypeBool, - FcTypeMatrix, - FcTypeCharSet, - FcTypeFTFace, - FcTypeLangSet -} FcType; - -typedef struct _FcMatrix { - double xx, xy, yx, yy; -} FcMatrix; - -#define FcMatrixInit(m) ((m)->xx = (m)->yy = 1, \ - (m)->xy = (m)->yx = 0) - -/* - * A data structure to represent the available glyphs in a font. - * This is represented as a sparse boolean btree. - */ - -typedef struct _FcCharSet FcCharSet; - -typedef struct _FcObjectType { - const char *object; - FcType type; -} FcObjectType; - -typedef struct _FcConstant { - const FcChar8 *name; - const char *object; - int value; -} FcConstant; - -typedef enum _FcResult { - FcResultMatch, FcResultNoMatch, FcResultTypeMismatch, FcResultNoId, - FcResultOutOfMemory -} FcResult; - -typedef struct _FcPattern FcPattern; - -typedef struct _FcLangSet FcLangSet; - -typedef struct _FcValue { - FcType type; - union { - const FcChar8 *s; - int i; - FcBool b; - double d; - const FcMatrix *m; - const FcCharSet *c; - void *f; - const FcLangSet *l; - } u; -} FcValue; - -typedef struct _FcFontSet { - int nfont; - int sfont; - FcPattern **fonts; -} FcFontSet; - -typedef struct _FcObjectSet { - int nobject; - int sobject; - const char **objects; -} FcObjectSet; - -typedef enum _FcMatchKind { - FcMatchPattern, FcMatchFont, FcMatchScan -} FcMatchKind; - -typedef enum _FcLangResult { - FcLangEqual = 0, - FcLangDifferentCountry = 1, - FcLangDifferentTerritory = 1, - FcLangDifferentLang = 2 -} FcLangResult; - -typedef enum _FcSetName { - FcSetSystem = 0, - FcSetApplication = 1 -} FcSetName; - -typedef struct _FcAtomic FcAtomic; - -#if defined(__cplusplus) || defined(c_plusplus) /* for C++ V2.0 */ -#define _FCFUNCPROTOBEGIN extern "C" { /* do not leave open across includes */ -#define _FCFUNCPROTOEND } -#else -#define _FCFUNCPROTOBEGIN -#define _FCFUNCPROTOEND -#endif - -typedef enum { FcEndianBig, FcEndianLittle } FcEndian; - -typedef struct _FcConfig FcConfig; - -typedef struct _FcGlobalCache FcFileCache; - -typedef struct _FcBlanks FcBlanks; - -typedef struct _FcStrList FcStrList; - -typedef struct _FcStrSet FcStrSet; - -typedef struct _FcCache FcCache; - -_FCFUNCPROTOBEGIN - -/* fcblanks.c */ -FcPublic FcBlanks * -FcBlanksCreate (void); - -FcPublic void -FcBlanksDestroy (FcBlanks *b); - -FcPublic FcBool -FcBlanksAdd (FcBlanks *b, FcChar32 ucs4); - -FcPublic FcBool -FcBlanksIsMember (FcBlanks *b, FcChar32 ucs4); - -/* fccache.c */ - -FcPublic const FcChar8 * -FcCacheDir(const FcCache *c); - -FcPublic FcFontSet * -FcCacheCopySet(const FcCache *c); - -FcPublic const FcChar8 * -FcCacheSubdir (const FcCache *c, int i); - -FcPublic int -FcCacheNumSubdir (const FcCache *c); - -FcPublic int -FcCacheNumFont (const FcCache *c); - -FcPublic FcBool -FcDirCacheUnlink (const FcChar8 *dir, FcConfig *config); - -FcPublic FcBool -FcDirCacheValid (const FcChar8 *cache_file); - -/* fccfg.c */ -FcPublic FcChar8 * -FcConfigHome (void); - -FcPublic FcBool -FcConfigEnableHome (FcBool enable); - -FcPublic FcChar8 * -FcConfigFilename (const FcChar8 *url); - -FcPublic FcConfig * -FcConfigCreate (void); - -FcPublic void -FcConfigDestroy (FcConfig *config); - -FcPublic FcBool -FcConfigSetCurrent (FcConfig *config); - -FcPublic FcConfig * -FcConfigGetCurrent (void); - -FcPublic FcBool -FcConfigUptoDate (FcConfig *config); - -FcPublic FcBool -FcConfigBuildFonts (FcConfig *config); - -FcPublic FcStrList * -FcConfigGetFontDirs (FcConfig *config); - -FcPublic FcStrList * -FcConfigGetConfigDirs (FcConfig *config); - -FcPublic FcStrList * -FcConfigGetConfigFiles (FcConfig *config); - -FcPublic FcChar8 * -FcConfigGetCache (FcConfig *config); - -FcPublic FcBlanks * -FcConfigGetBlanks (FcConfig *config); - -FcPublic FcStrList * -FcConfigGetCacheDirs (FcConfig *config); - -FcPublic int -FcConfigGetRescanInterval (FcConfig *config); - -FcPublic FcBool -FcConfigSetRescanInterval (FcConfig *config, int rescanInterval); - -FcPublic FcFontSet * -FcConfigGetFonts (FcConfig *config, - FcSetName set); - -FcPublic FcBool -FcConfigAppFontAddFile (FcConfig *config, - const FcChar8 *file); - -FcPublic FcBool -FcConfigAppFontAddDir (FcConfig *config, - const FcChar8 *dir); - -FcPublic void -FcConfigAppFontClear (FcConfig *config); - -FcPublic FcBool -FcConfigSubstituteWithPat (FcConfig *config, - FcPattern *p, - FcPattern *p_pat, - FcMatchKind kind); - -FcPublic FcBool -FcConfigSubstitute (FcConfig *config, - FcPattern *p, - FcMatchKind kind); - -/* fccharset.c */ -FcPublic FcCharSet* -FcCharSetCreate (void); - -/* deprecated alias for FcCharSetCreate */ -FcPublic FcCharSet * -FcCharSetNew (void); - -FcPublic void -FcCharSetDestroy (FcCharSet *fcs); - -FcPublic FcBool -FcCharSetAddChar (FcCharSet *fcs, FcChar32 ucs4); - -FcPublic FcCharSet* -FcCharSetCopy (FcCharSet *src); - -FcPublic FcBool -FcCharSetEqual (const FcCharSet *a, const FcCharSet *b); - -FcPublic FcCharSet* -FcCharSetIntersect (const FcCharSet *a, const FcCharSet *b); - -FcPublic FcCharSet* -FcCharSetUnion (const FcCharSet *a, const FcCharSet *b); - -FcPublic FcCharSet* -FcCharSetSubtract (const FcCharSet *a, const FcCharSet *b); - -FcPublic FcBool -FcCharSetHasChar (const FcCharSet *fcs, FcChar32 ucs4); - -FcPublic FcChar32 -FcCharSetCount (const FcCharSet *a); - -FcPublic FcChar32 -FcCharSetIntersectCount (const FcCharSet *a, const FcCharSet *b); - -FcPublic FcChar32 -FcCharSetSubtractCount (const FcCharSet *a, const FcCharSet *b); - -FcPublic FcBool -FcCharSetIsSubset (const FcCharSet *a, const FcCharSet *b); - -#define FC_CHARSET_MAP_SIZE (256/32) -#define FC_CHARSET_DONE ((FcChar32) -1) - -FcPublic FcChar32 -FcCharSetFirstPage (const FcCharSet *a, - FcChar32 map[FC_CHARSET_MAP_SIZE], - FcChar32 *next); - -FcPublic FcChar32 -FcCharSetNextPage (const FcCharSet *a, - FcChar32 map[FC_CHARSET_MAP_SIZE], - FcChar32 *next); - -/* - * old coverage API, rather hard to use correctly - */ - -FcPublic FcChar32 -FcCharSetCoverage (const FcCharSet *a, FcChar32 page, FcChar32 *result); - -/* fcdbg.c */ -FcPublic void -FcValuePrint (const FcValue v); - -FcPublic void -FcPatternPrint (const FcPattern *p); - -FcPublic void -FcFontSetPrint (const FcFontSet *s); - -/* fcdefault.c */ -FcPublic void -FcDefaultSubstitute (FcPattern *pattern); - -/* fcdir.c */ -FcPublic FcBool -FcFileIsDir (const FcChar8 *file); - -FcPublic FcBool -FcFileScan (FcFontSet *set, - FcStrSet *dirs, - FcFileCache *cache, - FcBlanks *blanks, - const FcChar8 *file, - FcBool force); - -FcPublic FcBool -FcDirScan (FcFontSet *set, - FcStrSet *dirs, - FcFileCache *cache, - FcBlanks *blanks, - const FcChar8 *dir, - FcBool force); - -FcPublic FcBool -FcDirSave (FcFontSet *set, FcStrSet *dirs, const FcChar8 *dir); - -FcPublic FcCache * -FcDirCacheLoad (const FcChar8 *dir, FcConfig *config, FcChar8 **cache_file); - -FcPublic FcCache * -FcDirCacheRead (const FcChar8 *dir, FcBool force, FcConfig *config); - -FcPublic FcCache * -FcDirCacheLoadFile (const FcChar8 *cache_file, struct stat *file_stat); - -FcPublic void -FcDirCacheUnload (FcCache *cache); - -/* fcfreetype.c */ -FcPublic FcPattern * -FcFreeTypeQuery (const FcChar8 *file, int id, FcBlanks *blanks, int *count); - -/* fcfs.c */ - -FcPublic FcFontSet * -FcFontSetCreate (void); - -FcPublic void -FcFontSetDestroy (FcFontSet *s); - -FcPublic FcBool -FcFontSetAdd (FcFontSet *s, FcPattern *font); - -/* fcinit.c */ -FcPublic FcConfig * -FcInitLoadConfig (void); - -FcPublic FcConfig * -FcInitLoadConfigAndFonts (void); - -FcPublic FcBool -FcInit (void); - -FcPublic void -FcFini (void); - -FcPublic int -FcGetVersion (void); - -FcPublic FcBool -FcInitReinitialize (void); - -FcPublic FcBool -FcInitBringUptoDate (void); - -/* fclang.c */ -FcPublic FcStrSet * -FcGetLangs (void); - -FcPublic const FcCharSet * -FcLangGetCharSet (const FcChar8 *lang); - -FcPublic FcLangSet* -FcLangSetCreate (void); - -FcPublic void -FcLangSetDestroy (FcLangSet *ls); - -FcPublic FcLangSet* -FcLangSetCopy (const FcLangSet *ls); - -FcPublic FcBool -FcLangSetAdd (FcLangSet *ls, const FcChar8 *lang); - -FcPublic FcLangResult -FcLangSetHasLang (const FcLangSet *ls, const FcChar8 *lang); - -FcPublic FcLangResult -FcLangSetCompare (const FcLangSet *lsa, const FcLangSet *lsb); - -FcPublic FcBool -FcLangSetContains (const FcLangSet *lsa, const FcLangSet *lsb); - -FcPublic FcBool -FcLangSetEqual (const FcLangSet *lsa, const FcLangSet *lsb); - -FcPublic FcChar32 -FcLangSetHash (const FcLangSet *ls); - -/* fclist.c */ -FcPublic FcObjectSet * -FcObjectSetCreate (void); - -FcPublic FcBool -FcObjectSetAdd (FcObjectSet *os, const char *object); - -FcPublic void -FcObjectSetDestroy (FcObjectSet *os); - -FcPublic FcObjectSet * -FcObjectSetVaBuild (const char *first, va_list va); - -FcPublic FcObjectSet * -FcObjectSetBuild (const char *first, ...) FC_ATTRIBUTE_SENTINEL(0); - -FcPublic FcFontSet * -FcFontSetList (FcConfig *config, - FcFontSet **sets, - int nsets, - FcPattern *p, - FcObjectSet *os); - -FcPublic FcFontSet * -FcFontList (FcConfig *config, - FcPattern *p, - FcObjectSet *os); - -/* fcatomic.c */ - -FcPublic FcAtomic * -FcAtomicCreate (const FcChar8 *file); - -FcPublic FcBool -FcAtomicLock (FcAtomic *atomic); - -FcPublic FcChar8 * -FcAtomicNewFile (FcAtomic *atomic); - -FcPublic FcChar8 * -FcAtomicOrigFile (FcAtomic *atomic); - -FcPublic FcBool -FcAtomicReplaceOrig (FcAtomic *atomic); - -FcPublic void -FcAtomicDeleteNew (FcAtomic *atomic); - -FcPublic void -FcAtomicUnlock (FcAtomic *atomic); - -FcPublic void -FcAtomicDestroy (FcAtomic *atomic); - -/* fcmatch.c */ -FcPublic FcPattern * -FcFontSetMatch (FcConfig *config, - FcFontSet **sets, - int nsets, - FcPattern *p, - FcResult *result); - -FcPublic FcPattern * -FcFontMatch (FcConfig *config, - FcPattern *p, - FcResult *result); - -FcPublic FcPattern * -FcFontRenderPrepare (FcConfig *config, - FcPattern *pat, - FcPattern *font); - -FcPublic FcFontSet * -FcFontSetSort (FcConfig *config, - FcFontSet **sets, - int nsets, - FcPattern *p, - FcBool trim, - FcCharSet **csp, - FcResult *result); - -FcPublic FcFontSet * -FcFontSort (FcConfig *config, - FcPattern *p, - FcBool trim, - FcCharSet **csp, - FcResult *result); - -FcPublic void -FcFontSetSortDestroy (FcFontSet *fs); - -/* fcmatrix.c */ -FcPublic FcMatrix * -FcMatrixCopy (const FcMatrix *mat); - -FcPublic FcBool -FcMatrixEqual (const FcMatrix *mat1, const FcMatrix *mat2); - -FcPublic void -FcMatrixMultiply (FcMatrix *result, const FcMatrix *a, const FcMatrix *b); - -FcPublic void -FcMatrixRotate (FcMatrix *m, double c, double s); - -FcPublic void -FcMatrixScale (FcMatrix *m, double sx, double sy); - -FcPublic void -FcMatrixShear (FcMatrix *m, double sh, double sv); - -/* fcname.c */ - -FcPublic FcBool -FcNameRegisterObjectTypes (const FcObjectType *types, int ntype); - -FcPublic FcBool -FcNameUnregisterObjectTypes (const FcObjectType *types, int ntype); - -FcPublic const FcObjectType * -FcNameGetObjectType (const char *object); - -FcPublic FcBool -FcNameRegisterConstants (const FcConstant *consts, int nconsts); - -FcPublic FcBool -FcNameUnregisterConstants (const FcConstant *consts, int nconsts); - -FcPublic const FcConstant * -FcNameGetConstant (FcChar8 *string); - -FcPublic FcBool -FcNameConstant (FcChar8 *string, int *result); - -FcPublic FcPattern * -FcNameParse (const FcChar8 *name); - -FcPublic FcChar8 * -FcNameUnparse (FcPattern *pat); - -/* fcpat.c */ -FcPublic FcPattern * -FcPatternCreate (void); - -FcPublic FcPattern * -FcPatternDuplicate (const FcPattern *p); - -FcPublic void -FcPatternReference (FcPattern *p); - -FcPublic void -FcValueDestroy (FcValue v); - -FcPublic FcBool -FcValueEqual (FcValue va, FcValue vb); - -FcPublic FcValue -FcValueSave (FcValue v); - -FcPublic void -FcPatternDestroy (FcPattern *p); - -FcPublic FcBool -FcPatternEqual (const FcPattern *pa, const FcPattern *pb); - -FcPublic FcBool -FcPatternEqualSubset (const FcPattern *pa, const FcPattern *pb, const FcObjectSet *os); - -FcPublic FcChar32 -FcPatternHash (const FcPattern *p); - -FcPublic FcBool -FcPatternAdd (FcPattern *p, const char *object, FcValue value, FcBool append); - -FcPublic FcBool -FcPatternAddWeak (FcPattern *p, const char *object, FcValue value, FcBool append); - -FcPublic FcResult -FcPatternGet (const FcPattern *p, const char *object, int id, FcValue *v); - -FcPublic FcBool -FcPatternDel (FcPattern *p, const char *object); - -FcPublic FcBool -FcPatternRemove (FcPattern *p, const char *object, int id); - -FcPublic FcBool -FcPatternAddInteger (FcPattern *p, const char *object, int i); - -FcPublic FcBool -FcPatternAddDouble (FcPattern *p, const char *object, double d); - -FcPublic FcBool -FcPatternAddString (FcPattern *p, const char *object, const FcChar8 *s); - -FcPublic FcBool -FcPatternAddMatrix (FcPattern *p, const char *object, const FcMatrix *s); - -FcPublic FcBool -FcPatternAddCharSet (FcPattern *p, const char *object, const FcCharSet *c); - -FcPublic FcBool -FcPatternAddBool (FcPattern *p, const char *object, FcBool b); - -FcPublic FcBool -FcPatternAddLangSet (FcPattern *p, const char *object, const FcLangSet *ls); - -FcPublic FcResult -FcPatternGetInteger (const FcPattern *p, const char *object, int n, int *i); - -FcPublic FcResult -FcPatternGetDouble (const FcPattern *p, const char *object, int n, double *d); - -FcPublic FcResult -FcPatternGetString (const FcPattern *p, const char *object, int n, FcChar8 ** s); - -FcPublic FcResult -FcPatternGetMatrix (const FcPattern *p, const char *object, int n, FcMatrix **s); - -FcPublic FcResult -FcPatternGetCharSet (const FcPattern *p, const char *object, int n, FcCharSet **c); - -FcPublic FcResult -FcPatternGetBool (const FcPattern *p, const char *object, int n, FcBool *b); - -FcPublic FcResult -FcPatternGetLangSet (const FcPattern *p, const char *object, int n, FcLangSet **ls); - -FcPublic FcPattern * -FcPatternVaBuild (FcPattern *orig, va_list va); - -FcPublic FcPattern * -FcPatternBuild (FcPattern *orig, ...) FC_ATTRIBUTE_SENTINEL(0); - -/* fcstr.c */ - -FcPublic FcChar8 * -FcStrCopy (const FcChar8 *s); - -FcPublic FcChar8 * -FcStrCopyFilename (const FcChar8 *s); - -FcPublic FcChar8 * -FcStrPlus (const FcChar8 *s1, const FcChar8 *s2); - -FcPublic void -FcStrFree (FcChar8 *s); - -/* These are ASCII only, suitable only for pattern element names */ -#define FcIsUpper(c) ((0101 <= (c) && (c) <= 0132)) -#define FcIsLower(c) ((0141 <= (c) && (c) <= 0172)) -#define FcToLower(c) (FcIsUpper(c) ? (c) - 0101 + 0141 : (c)) - -FcPublic FcChar8 * -FcStrDowncase (const FcChar8 *s); - -FcPublic int -FcStrCmpIgnoreCase (const FcChar8 *s1, const FcChar8 *s2); - -FcPublic int -FcStrCmp (const FcChar8 *s1, const FcChar8 *s2); - -FcPublic const FcChar8 * -FcStrStrIgnoreCase (const FcChar8 *s1, const FcChar8 *s2); - -FcPublic const FcChar8 * -FcStrStr (const FcChar8 *s1, const FcChar8 *s2); - -FcPublic int -FcUtf8ToUcs4 (const FcChar8 *src_orig, - FcChar32 *dst, - int len); - -FcPublic FcBool -FcUtf8Len (const FcChar8 *string, - int len, - int *nchar, - int *wchar); - -#define FC_UTF8_MAX_LEN 6 - -FcPublic int -FcUcs4ToUtf8 (FcChar32 ucs4, - FcChar8 dest[FC_UTF8_MAX_LEN]); - -FcPublic int -FcUtf16ToUcs4 (const FcChar8 *src_orig, - FcEndian endian, - FcChar32 *dst, - int len); /* in bytes */ - -FcPublic FcBool -FcUtf16Len (const FcChar8 *string, - FcEndian endian, - int len, /* in bytes */ - int *nchar, - int *wchar); - -FcPublic FcChar8 * -FcStrDirname (const FcChar8 *file); - -FcPublic FcChar8 * -FcStrBasename (const FcChar8 *file); - -FcPublic FcStrSet * -FcStrSetCreate (void); - -FcPublic FcBool -FcStrSetMember (FcStrSet *set, const FcChar8 *s); - -FcPublic FcBool -FcStrSetEqual (FcStrSet *sa, FcStrSet *sb); - -FcPublic FcBool -FcStrSetAdd (FcStrSet *set, const FcChar8 *s); - -FcPublic FcBool -FcStrSetAddFilename (FcStrSet *set, const FcChar8 *s); - -FcPublic FcBool -FcStrSetDel (FcStrSet *set, const FcChar8 *s); - -FcPublic void -FcStrSetDestroy (FcStrSet *set); - -FcPublic FcStrList * -FcStrListCreate (FcStrSet *set); - -FcPublic FcChar8 * -FcStrListNext (FcStrList *list); - -FcPublic void -FcStrListDone (FcStrList *list); - -/* fcxml.c */ -FcPublic FcBool -FcConfigParseAndLoad (FcConfig *config, const FcChar8 *file, FcBool complain); - -_FCFUNCPROTOEND - -#undef FC_ATTRIBUTE_SENTINEL - - -#ifndef _FCINT_H_ - -/* - * Deprecated functions are placed here to help users fix their code without - * digging through documentation - */ - -#define FcConfigGetRescanInverval FcConfigGetRescanInverval_REPLACE_BY_FcConfigGetRescanInterval -#define FcConfigSetRescanInverval FcConfigSetRescanInverval_REPLACE_BY_FcConfigSetRescanInterval - -#endif - -#endif /* _FONTCONFIG_H_ */
--- a/src/solaris/native/sun/awt/fontpath.c Wed Apr 17 03:47:21 2019 +0100 +++ b/src/solaris/native/sun/awt/fontpath.c Thu Apr 18 03:46:32 2019 +0100 @@ -571,7 +571,7 @@ #include <dlfcn.h> -#include "fontconfig.h" +#include <fontconfig/fontconfig.h> static void* openFontConfig() {
--- a/src/solaris/native/sun/xawt/XToolkit.c Wed Apr 17 03:47:21 2019 +0100 +++ b/src/solaris/native/sun/xawt/XToolkit.c Thu Apr 18 03:46:32 2019 +0100 @@ -154,6 +154,10 @@ JNI_OnLoad(JavaVM *vm, void *reserved) { jvm = vm; + + //Set the gtk backend to x11 on all the systems + putenv("GDK_BACKEND=x11"); + return JNI_VERSION_1_2; }
--- a/src/windows/classes/sun/awt/windows/WToolkit.java Wed Apr 17 03:47:21 2019 +0100 +++ b/src/windows/classes/sun/awt/windows/WToolkit.java Thu Apr 18 03:46:32 2019 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1996, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1996, 2019, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -45,6 +45,7 @@ import sun.awt.AppContext; import sun.awt.AWTAccessor; import sun.awt.AWTAutoShutdown; +import sun.awt.DisplayChangedListener; import sun.awt.LightweightFrame; import sun.awt.SunToolkit; import sun.misc.ThreadGroupUtils; @@ -68,6 +69,8 @@ import java.util.Locale; import java.util.Map; import java.util.Properties; +import java.util.concurrent.ExecutorService; +import java.util.concurrent.Executors; import sun.font.FontManager; import sun.font.FontManagerFactory; @@ -828,20 +831,34 @@ .paletteChanged(); } + private static ExecutorService displayChangeExecutor; + /* * Called from Toolkit native code when a WM_DISPLAYCHANGE occurs. * Have Win32GraphicsEnvironment execute the display change code on the * Event thread. */ static public void displayChanged() { - EventQueue.invokeLater(new Runnable() { - @Override - public void run() { - ((Win32GraphicsEnvironment)GraphicsEnvironment - .getLocalGraphicsEnvironment()) - .displayChanged(); + final Runnable runnable = () -> { + Object lge = GraphicsEnvironment.getLocalGraphicsEnvironment(); + if (lge instanceof DisplayChangedListener) { + ((DisplayChangedListener) lge).displayChanged(); } - }); + }; + if (AppContext.getAppContext() != null) { + // Common case, standalone application + EventQueue.invokeLater(runnable); + } else { + if (displayChangeExecutor == null) { + // No synchronization, called on the Toolkit thread only + displayChangeExecutor = Executors.newFixedThreadPool(1, r -> { + Thread t = Executors.defaultThreadFactory().newThread(r); + t.setDaemon(true); + return t; + }); + } + displayChangeExecutor.submit(runnable); + } } /**
--- a/src/windows/classes/sun/awt/windows/WWindowPeer.java Wed Apr 17 03:47:21 2019 +0100 +++ b/src/windows/classes/sun/awt/windows/WWindowPeer.java Thu Apr 18 03:46:32 2019 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1996, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1996, 2019, 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 @@ -480,13 +480,7 @@ * Called from native code when we have been dragged onto another screen. */ void draggedToNewScreen() { - SunToolkit.executeOnEventHandlerThread((Component)target,new Runnable() - { - @Override - public void run() { - displayChanged(); - } - }); + displayChanged(); } public void updateGC() { @@ -544,7 +538,7 @@ */ @Override public void displayChanged() { - updateGC(); + SunToolkit.executeOnEventHandlerThread(target, this::updateGC); } /**
--- a/src/windows/native/java/lang/java_props_md.c Wed Apr 17 03:47:21 2019 +0100 +++ b/src/windows/native/java/lang/java_props_md.c Thu Apr 18 03:46:32 2019 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2018, 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 @@ -351,6 +351,7 @@ static java_props_t sprops = {0}; int majorVersion; int minorVersion; + int buildNumber = 0; if (sprops.line_separator) { return &sprops; @@ -390,6 +391,8 @@ GetVersionEx((OSVERSIONINFO *) &ver); majorVersion = ver.dwMajorVersion; minorVersion = ver.dwMinorVersion; + /* distinguish Windows Server 2016 and 2019 by build number */ + buildNumber = ver.dwBuildNumber; is_workstation = (ver.wProductType == VER_NT_WORKSTATION); platformId = ver.dwPlatformId; sprops.patch_level = _strdup(ver.szCSDVersion); @@ -440,6 +443,7 @@ } majorVersion = HIWORD(file_info->dwProductVersionMS); minorVersion = LOWORD(file_info->dwProductVersionMS); + buildNumber = HIWORD(file_info->dwProductVersionLS); free(version_info); } while (0); @@ -470,6 +474,8 @@ * Windows Server 2012 R2 6 3 (!VER_NT_WORKSTATION) * Windows 10 10 0 (VER_NT_WORKSTATION) * Windows Server 2016 10 0 (!VER_NT_WORKSTATION) + * Windows Server 2019 10 0 (!VER_NT_WORKSTATION) + * where (buildNumber > 17762) * * This mapping will presumably be augmented as new Windows * versions are released. @@ -543,7 +549,14 @@ } } else { switch (minorVersion) { - case 0: sprops.os_name = "Windows Server 2016"; break; + case 0: + /* Windows server 2019 GA 10/2018 build number is 17763 */ + if (buildNumber > 17762) { + sprops.os_name = "Windows Server 2019"; + } else { + sprops.os_name = "Windows Server 2016"; + } + break; default: sprops.os_name = "Windows NT (unknown)"; } }
--- a/src/windows/native/sun/windows/ShellFolder2.cpp Wed Apr 17 03:47:21 2019 +0100 +++ b/src/windows/native/sun/windows/ShellFolder2.cpp Thu Apr 18 03:46:32 2019 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2019, 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 @@ -692,7 +692,7 @@ hres = ppf->Load(wstr, STGM_READ); if (SUCCEEDED(hres)) { if (resolve) { - hres = psl->Resolve(NULL, 0); + hres = psl->Resolve(NULL, SLR_NO_UI); // Ignore failure } pidl = (LPITEMIDLIST)NULL;
--- a/test/TEST.ROOT Wed Apr 17 03:47:21 2019 +0100 +++ b/test/TEST.ROOT Thu Apr 18 03:46:32 2019 +0100 @@ -11,8 +11,11 @@ # would not count as "randomness" by this definition.) Extra care # should be taken to handle test failures of intermittent or # randomness tests. +# +# A "headful" test requires a graphical environment to meaningfully +# run. Tests that are not headful are "headless." -keys=2d dnd i18n headful intermittent randomness +keys=2d dnd i18n intermittent randomness headful # Tests that must run in othervm mode othervm.dirs=java/awt java/beans java/rmi javax/accessibility javax/imageio javax/sound javax/print javax/management com/sun/awt sun/awt sun/java2d sun/pisces sun/rmi
--- a/test/java/awt/BasicStroke/DashStrokeTest.java Wed Apr 17 03:47:21 2019 +0100 +++ b/test/java/awt/BasicStroke/DashStrokeTest.java Thu Apr 18 03:46:32 2019 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2019, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -21,10 +21,10 @@ * questions. * * @test - * @bug 8075942 + * @bug 8075942 8080932 * @summary test there is no exception rendering a dashed stroke - * @run DashStrokeTest - * @run -Dsun.java2d.renderer=sun.java2d.pisces.PiscesRenderingEngine + * @run main DashStrokeTest + * @run main/othervm -Dsun.java2d.renderer=sun.java2d.pisces.PiscesRenderingEngine DashStrokeTest */ import java.awt.BasicStroke;
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/java/awt/Focus/NullActiveWindowOnFocusLost/NullActiveWindowOnFocusLost.java Thu Apr 18 03:46:32 2019 +0100 @@ -0,0 +1,82 @@ +/* + * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +import java.awt.Button; +import java.awt.Frame; +import java.util.concurrent.TimeUnit; + +import sun.awt.SunToolkit; + +/** + * @test + * @bug 8211435 + * @modules java.desktop/sun.awt + */ +public final class NullActiveWindowOnFocusLost { + + private static volatile long endtime; + private static Throwable failed; + + public static void main(final String[] args) throws Exception { + // Will run the test no more than 30 seconds + endtime = System.nanoTime() + TimeUnit.SECONDS.toNanos(30); + Thread.setDefaultUncaughtExceptionHandler((t, e) -> failed = e); + + final Thread[] threads = new Thread[20]; + for (int i = 0; i < threads.length; i++) { + threads[i] = testThread(i); + } + for (final Thread thread : threads) { + thread.start(); + } + for (final Thread thread : threads) { + thread.join(); + } + if (failed != null) { + failed.printStackTrace(); + throw new RuntimeException(failed); + } + } + + private static Thread testThread(int index) { + return new Thread(new ThreadGroup("TG " + index), () -> { + SunToolkit.createNewAppContext(); + while (!isComplete()) { + final Frame frame = new Frame(); + frame.setSize(300, 300); + frame.add(new Button("Button")); + frame.setLocationRelativeTo(null); + frame.setVisible(true); + try { + Thread.sleep(index); // increase probability of the failure + } catch (InterruptedException ignored) { + } + frame.dispose(); + } + }); + } + + private static boolean isComplete() { + return endtime - System.nanoTime() < 0 || failed != null; + } +}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/java/awt/FontClass/FontDisposer/FontDisposeTest.java Thu Apr 18 03:46:32 2019 +0100 @@ -0,0 +1,84 @@ +/* + * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ +import java.awt.Font; +import java.awt.Graphics2D; +import java.awt.font.FontRenderContext; +import java.awt.image.BufferedImage; +import java.io.FileInputStream; +import java.io.ByteArrayInputStream; +import java.io.InputStream; +import java.lang.reflect.Field; +import java.lang.reflect.Method; + +import sun.font.Font2DHandle; +import sun.font.Font2D; +import sun.font.FontScaler; +import sun.font.Type1Font; + +/** + * @bug 8132985 + * @summary Tests to verify Type1 Font scaler dispose crashes + * @modules java.desktop/sun.font + */ +public class FontDisposeTest +{ + public static void main(String[] args) throws Exception + { + // The bug only happens with Type 1 fonts. The Ghostscript font files + // should be commonly available. From distro pacakge or + // ftp://ftp.gnu.org/gnu/ghostscript/gnu-gs-fonts-other-6.0.tar.gz + // Pass pfa/pfb font file as argument + String path = args[0]; + + // Load + InputStream stream = new FileInputStream(path); + Font font = Font.createFont(Font.TYPE1_FONT,stream); + + // Ensure native bits have been generated + BufferedImage img = new BufferedImage(100,100, + BufferedImage.TYPE_INT_ARGB); + Graphics2D g2d = img.createGraphics(); + FontRenderContext frc = g2d.getFontRenderContext(); + + font.getLineMetrics("derp",frc); + + // Force disposal - + // System.gc() is not sufficient. + Field font2DHandleField = Font.class.getDeclaredField("font2DHandle"); + font2DHandleField.setAccessible(true); + sun.font.Font2DHandle font2DHandle = + (sun.font.Font2DHandle)font2DHandleField.get(font); + + sun.font.Font2D font2D = font2DHandle.font2D; + sun.font.Type1Font type1Font = (sun.font.Type1Font)font2D; + + Method getScalerMethod = + sun.font.Type1Font.class.getDeclaredMethod("getScaler"); + getScalerMethod.setAccessible(true); + sun.font.FontScaler scaler = + (sun.font.FontScaler)getScalerMethod.invoke(type1Font); + + // dispose should not crash due to double free + scaler.dispose(); + } +}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/java/awt/Toolkit/DisplayChangesException/DisplayChangesException.java Thu Apr 18 03:46:32 2019 +0100 @@ -0,0 +1,131 @@ +/* + * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +import java.awt.EventQueue; +import java.awt.GraphicsEnvironment; +import java.awt.Toolkit; +import java.lang.reflect.Method; +import java.util.concurrent.CountDownLatch; + +import javax.swing.JButton; +import javax.swing.JFrame; + +import sun.awt.DisplayChangedListener; +import sun.awt.SunToolkit; + +/** + * @test + * @key headful + * @bug 8207070 + * @modules java.desktop/sun.java2d + * java.desktop/sun.awt + */ +public final class DisplayChangesException { + + private static boolean fail; + private static CountDownLatch go = new CountDownLatch(1); + + static final class TestThread extends Thread { + + private JFrame frame; + + private TestThread(ThreadGroup tg, String threadName) { + super(tg, threadName); + } + + public void run() { + try { + test(); + } catch (final Exception e) { + throw new RuntimeException(e); + } + } + + private void test() throws Exception { + SunToolkit.createNewAppContext(); + EventQueue.invokeAndWait(() -> { + frame = new JFrame(); + final JButton b = new JButton(); + b.addPropertyChangeListener(evt -> { + if (!SunToolkit.isDispatchThreadForAppContext(b)) { + System.err.println("Wrong thread:" + currentThread()); + fail = true; + } + }); + frame.add(b); + frame.setSize(100, 100); + frame.setLocationRelativeTo(null); + frame.pack(); + }); + go.await(); + EventQueue.invokeAndWait(() -> { + frame.dispose(); + }); + } + } + + public static void main(final String[] args) throws Exception { + ThreadGroup tg0 = new ThreadGroup("ThreadGroup0"); + ThreadGroup tg1 = new ThreadGroup("ThreadGroup1"); + + TestThread t0 = new TestThread(tg0, "TestThread 0"); + TestThread t1 = new TestThread(tg1, "TestThread 1"); + + t0.start(); + t1.start(); + Thread.sleep(1500); // Cannot use Robot.waitForIdle + testToolkit(); + Thread.sleep(1500); + testGE(); + Thread.sleep(1500); + go.countDown(); + + if (fail) { + throw new RuntimeException(); + } + } + + private static void testGE() { + Object ge = GraphicsEnvironment.getLocalGraphicsEnvironment(); + if (!(ge instanceof DisplayChangedListener)) { + return; + } + ((DisplayChangedListener) ge).displayChanged(); + } + + private static void testToolkit() { + final Class toolkit; + try { + toolkit = Class.forName("sun.awt.windows.WToolkit"); + } catch (final ClassNotFoundException ignored) { + return; + } + try { + final Method displayChanged = toolkit.getMethod("displayChanged"); + displayChanged.invoke(Toolkit.getDefaultToolkit()); + } catch (final Exception e) { + e.printStackTrace(); + fail = true; + } + } +}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/java/awt/event/SequencedEvent/MultipleContextsFunctionalTest.java Thu Apr 18 03:46:32 2019 +0100 @@ -0,0 +1,174 @@ +/* + * Copyright (c) 2019, 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 8204142 + * @summary Deadlock when queueing SequencedEvent of different AppContexts + * @author Laurent Bourges + * @modules java.desktop/sun.awt + * @run main/othervm/timeout=30 MultipleContextsFunctionalTest + */ + +import java.awt.BorderLayout; +import java.awt.Dimension; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; +import java.util.ArrayList; +import java.util.List; +import java.util.concurrent.atomic.AtomicReference; +import javax.swing.JButton; +import javax.swing.JFrame; +import javax.swing.JLabel; +import javax.swing.SwingUtilities; +import javax.swing.Timer; + +public final class MultipleContextsFunctionalTest { + + private static final long serialVersionUID = 1L; + + private static final int NUM_WINDOW = 2; + private static final int INTERVAL = 50; + private static final int MAX_TIME = 10000; // 10s + private static final int TOLERANCE = 10000;// 10s + private static final int CHECK_LAPSE = 100; + private static final int MAX_COUNT = MAX_TIME / INTERVAL; + private static final int EXPECTED = MAX_COUNT * NUM_WINDOW; + private static final List<TestWindow> WINDOWS = new ArrayList<TestWindow>(); + + public static void main(String[] args) { + for (int i = 0; i < NUM_WINDOW; i++) { + createWin(i); + } + + int total = 0; + int waitingTime = MAX_TIME + TOLERANCE; + while (waitingTime > 0 && total != EXPECTED) { + try { + Thread.sleep(CHECK_LAPSE); + } catch (InterruptedException e) { + e.printStackTrace(); + } + waitingTime -= CHECK_LAPSE; + + total = 0; + for (TestWindow window : WINDOWS) { + total += window.getCounter(); + } + } + + // Failure if AWT hanging: assert + System.out.println("Total [" + total + "] - Expected [" + EXPECTED + "]"); + if (total == EXPECTED) { + System.out.println("Test PASSED"); + return; + } + System.out.println("Test FAILED"); + Runtime.getRuntime().halt(-1); + } + + private static void createWin(int tgNum) { + new Thread(new ThreadGroup("TG " + tgNum), + new Runnable() { + @Override + public void run() { + sun.awt.SunToolkit.createNewAppContext(); + + final AtomicReference<TestWindow> ref = + new AtomicReference<TestWindow>(); + + SwingUtilities.invokeLater(new Runnable() { + @Override + public void run() { + final TestWindow window = new TestWindow(tgNum); + window.setVisible(true); + ref.set(window); + WINDOWS.add(window); + } + }); + + // Wait for window to show + TestWindow window = ref.get(); + while (window == null) { + try { + Thread.sleep(100); + } catch (InterruptedException ie) { + ie.printStackTrace(); + } + window = ref.get(); + } + window.enableTimer(true); + } + }).start(); + } + + private static final class TestWindow extends JFrame implements ActionListener { + + private final JButton btn; + private int counter = 0; + private final Timer t; + + TestWindow(final int num) { + super("Test Window [" + num + "]"); + setMinimumSize(new Dimension(300, 200)); + setLocation(100 + 400 * (num - 1), 100); + + setLayout(new BorderLayout()); + JLabel textBlock = new JLabel("Lorem ipsum dolor sit amet..."); + add(textBlock); + + btn = new JButton("TEST"); + add(btn, BorderLayout.SOUTH); + + setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); + pack(); + + t = new Timer(INTERVAL, this); + t.setRepeats(false); + } + + @Override + public void actionPerformed(ActionEvent e) { + this.toFront(); + btn.setText("TEST " + (++counter)); + this.toBack(); + if (counter < MAX_COUNT) { + enableTimer(true); + } else { + dispose(); + } + } + + void enableTimer(boolean enable) { + if (enable) { + t.start(); + } else { + t.stop(); + } + } + + int getCounter() { + return counter; + } + } +}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/java/awt/event/SequencedEvent/MultipleContextsUnitTest.java Thu Apr 18 03:46:32 2019 +0100 @@ -0,0 +1,166 @@ +/* + * Copyright (c) 2019, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +import java.awt.AWTEvent; +import java.awt.event.InvocationEvent; +import java.lang.reflect.Constructor; +import java.util.concurrent.CountDownLatch; +import java.util.concurrent.atomic.AtomicReference; + +import sun.awt.AppContext; +import sun.awt.SunToolkit; + +/** + * @test + * @bug 8204142 + * @author Sergey Bylokhov + * @modules java.desktop/sun.awt + * @run main/othervm/timeout=30 MultipleContextsUnitTest + */ +public final class MultipleContextsUnitTest { + + private static final int COUNT = 20; + private static final AppContext[] apps = new AppContext[COUNT]; + private static final CountDownLatch go = new CountDownLatch(1); + private static final CountDownLatch end = new CountDownLatch(COUNT); + + private static volatile int createSENumber = 0; + private static volatile int dispatchSENumber = 0; + + public static void main(final String[] args) throws Exception { + for (int i = 0; i < COUNT; i++) { + Thread t = testThread(i); + t.start(); + t.join(); + } + + for (AppContext app : apps) { + SunToolkit.postEvent(app, new InvocationEvent(new Object(), () -> { + try { + go.await(); + } catch (InterruptedException e) { + throw new RuntimeException(e); + } + })); + } + + // eventOne - created first, but posted last + AWTEvent eventOne = getSequencedEvent(); + { + // eventTwo and eventThree - posted in the reverse order + AppContext app = apps[1]; + AWTEvent eventTwo = getSequencedEvent(); + AWTEvent eventThree = getSequencedEvent(); + SunToolkit.postEvent(app, eventThree); + SunToolkit.postEvent(app, eventTwo); + SunToolkit.postEvent(app, new InvocationEvent(new Object(), () -> { + System.err.println(AppContext.getAppContext()); + end.countDown(); + })); + } + + for (int i = 2; i < apps.length; i++) { + // eventTwo and eventThree - posted in the correct order + AppContext app = apps[i]; + + AWTEvent eventTwo = getSequencedEvent(); + SunToolkit.postEvent(app, eventTwo); + + AtomicReference<Boolean> called1 = new AtomicReference(false); + AtomicReference<Boolean> called2 = new AtomicReference(false); + int num1 = createSENumber; + SunToolkit.postEvent(app, new InvocationEvent(new Object(), () -> { + if (dispatchSENumber < num1) { + throw new RuntimeException("Dispatched too early"); + } + called1.set(true); + if (called2.get()) { + throw new RuntimeException("Second event is called before first"); + } + })); + AWTEvent eventThree = getSequencedEvent(); + SunToolkit.postEvent(app, eventThree); + int num2 = createSENumber; + SunToolkit.postEvent(app, new InvocationEvent(new Object(), () -> { + if (dispatchSENumber < num2) { + throw new RuntimeException("Dispatched too early"); + } + called2.set(true); + if (!called1.get()) { + throw new RuntimeException("First event is not called before second"); + } + System.err.println(AppContext.getAppContext()); + end.countDown(); + })); + } + + + + // eventOne should flush all EDT + SunToolkit.postEvent(apps[0], eventOne); + SunToolkit.postEvent(apps[0], new InvocationEvent(new Object(), () -> { + System.err.println(AppContext.getAppContext()); + end.countDown(); + })); + + go.countDown(); + + System.err.println("Start to wait"); + end.await(); + System.err.println("End to wait"); + } + + private static Thread testThread(int index) { + final ThreadGroup group = new ThreadGroup("TG " + index); + return new Thread(group, () -> { + apps[index] = SunToolkit.createNewAppContext(); + }); + } + + private static AWTEvent getSequencedEvent() + { + int num = createSENumber++; + + InvocationEvent wrapMe = new InvocationEvent(new Object(), () -> { + if (num != dispatchSENumber++) { + System.err.println("num: " + num); + System.err.println("dispatchSENumber: " + dispatchSENumber); + throw new RuntimeException("Wrong order"); + } + }); + + try { + /* + * SequencedEvent is a package private class, which cannot be instantiated + * by importing. So use reflection to create an instance. + */ + Class<? extends AWTEvent> seqClass = (Class<? extends AWTEvent>) Class.forName("java.awt.SequencedEvent"); + Constructor<? extends AWTEvent> + seqConst = seqClass.getConstructor(AWTEvent.class); + seqConst.setAccessible(true); + return seqConst.newInstance(wrapMe); + } catch (Throwable err) { + throw new RuntimeException("Unable to instantiate SequencedEvent",err); + } + } +}
--- a/test/java/lang/Character/Scripts.txt Wed Apr 17 03:47:21 2019 +0100 +++ b/test/java/lang/Character/Scripts.txt Thu Apr 18 03:46:32 2019 +0100 @@ -147,6 +147,7 @@ 208D ; Common # Ps SUBSCRIPT LEFT PARENTHESIS 208E ; Common # Pe SUBSCRIPT RIGHT PARENTHESIS 20A0..20BA ; Common # Sc [27] EURO-CURRENCY SIGN..TURKISH LIRA SIGN +20BB..20BF ; Common # Sc [5] NORDIC MARK SIGN..BITCOIN SIGN 2100..2101 ; Common # So [2] ACCOUNT OF..ADDRESSED TO THE SUBJECT 2102 ; Common # L& DOUBLE-STRUCK CAPITAL C 2103..2106 ; Common # So [4] DEGREE CELSIUS..CADA UNA @@ -381,6 +382,7 @@ 328A..32B0 ; Common # So [39] CIRCLED IDEOGRAPH MOON..CIRCLED IDEOGRAPH NIGHT 32B1..32BF ; Common # No [15] CIRCLED NUMBER THIRTY SIX..CIRCLED NUMBER FIFTY 32C0..32CF ; Common # So [16] IDEOGRAPHIC TELEGRAPH SYMBOL FOR JANUARY..LIMITED LIABILITY SIGN +32FF ; Common # So SQUARE ERA NAME NEWERA 3358..33FF ; Common # So [168] IDEOGRAPHIC TELEGRAPH SYMBOL FOR HOUR ZERO..SQUARE GAL 4DC0..4DFF ; Common # So [64] HEXAGRAM FOR THE CREATIVE HEAVEN..HEXAGRAM FOR BEFORE COMPLETION A700..A716 ; Common # Sk [23] MODIFIER LETTER CHINESE TONE YIN PING..MODIFIER LETTER EXTRA-LOW LEFT-STEM TONE BAR
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/java/lang/Character/TestIsJavaIdentifierMethods.java Thu Apr 18 03:46:32 2019 +0100 @@ -0,0 +1,309 @@ +/* + * Copyright (c) 2019, 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 + * @summary Test behavior of isJavaIdentifierXX, testIsJavaLetter, and + * testIsJavaLetterOrDigit methods for all code points. + * @bug 8218915 + */ + +import java.util.List; +import java.util.ArrayList; + +public class TestIsJavaIdentifierMethods { + + // List of new code points are not present in Unicode 6.2. + private static final List<Integer> UNASSIGNED_CODEPOINTS_IN_6_2 + = new ArrayList<Integer>() + {{ + add(0x20BB); // NORDIC MARK SIGN + add(0x20BC); // MANAT SIGN + add(0x20BD); // RUBLE SIGN + add(0x20BE); // LARI SIGN + add(0x20BF); // BITCOIN SIGN + add(0x32FF); // SQUARE ERA NAME NEWERA + }}; + + public static void main(String[] args) { + testIsJavaIdentifierPart_int(); + testIsJavaIdentifierPart_char(); + testIsJavaIdentifierStart_int(); + testIsJavaIdentifierStart_char(); + testIsJavaLetter(); + testIsJavaLetterOrDigit(); + } + + /** + * Assertion testing for public static boolean isJavaIdentifierPart(int + * codePoint), A character may be part of a Java identifier if any of the + * following are true: + * <ul> + * <li>it is a letter</li> + * <li>it is a currency symbol (such as <code>'$'</code>)</li> + * <li>it is a connecting punctuation character (such as <code>'_'</code>) + * </li> + * <li>it is a digit</li> + * <li>it is a numeric letter (such as a Roman numeral character)</li> + * <li>it is a combining mark</li> + * <li>it is a non-spacing mark</li> + * <li><code>isIdentifierIgnorable</code> returns <code>true</code> for the + * character</li> + * </ul> + * All code points from (0x0000..0x10FFFF) are tested. + */ + public static void testIsJavaIdentifierPart_int() { + for (int cp = 0; cp <= Character.MAX_CODE_POINT; cp++) { + boolean expected = false; + + // Since Character.isJavaIdentifierPart(int) strictly conforms to + // character information from version 6.2 of the Unicode Standard, + // check if code point is in "UNASSIGNED_CODEPOINTS_IN_6_2" + // list. If the code point is found in list + // "UNASSIGNED_CODEPOINTS_IN_6_2", value of variable + // "expected" is considered false. + if (!UNASSIGNED_CODEPOINTS_IN_6_2.contains(cp)) { + byte type = (byte) Character.getType(cp); + expected = Character.isLetter(cp) + || type == Character.CURRENCY_SYMBOL + || type == Character.CONNECTOR_PUNCTUATION + || Character.isDigit(cp) + || type == Character.LETTER_NUMBER + || type == Character.COMBINING_SPACING_MARK + || type == Character.NON_SPACING_MARK + || Character.isIdentifierIgnorable(cp); + } + + if (Character.isJavaIdentifierPart(cp) != expected) { + throw new RuntimeException( + "Character.isJavaIdentifierPart(int) failed for codepoint " + + Integer.toHexString(cp)); + } + } + } + + /** + * Assertion testing for public static boolean isJavaIdentifierPart(char + * ch), A character may be part of a Java identifier if any of the + * following are true: + * <ul> + * <li>it is a letter; + * <li>it is a currency symbol (such as "$"); + * <li>it is a connecting punctuation character (such as "_"); + * <li>it is a digit; + * <li>it is a numeric letter (such as a Roman numeral character); + * <li>it is a combining mark; + * <li>it is a non-spacing mark; + * <li>isIdentifierIgnorable returns true for the character. + * </ul> + * All Unicode code points in the BMP (0x0000..0xFFFF) are tested. + */ + public static void testIsJavaIdentifierPart_char() { + for (int i = 0; i <= Character.MAX_VALUE; ++i) { + char ch = (char) i; + boolean expected = false; + // Since Character.isJavaIdentifierPart(char) strictly conforms to + // character information from version 6.2 of the Unicode Standard, + // check if code point is in "UNASSIGNED_CODEPOINTS_IN_6_2" + // list. If the code point is found in list + // "UNASSIGNED_CODEPOINTS_IN_6_2", value of variable + // "expected" is considered false. + if (!UNASSIGNED_CODEPOINTS_IN_6_2.contains(i)) { + byte type = (byte) Character.getType(ch); + expected = Character.isLetter(ch) + || type == Character.CURRENCY_SYMBOL + || type == Character.CONNECTOR_PUNCTUATION + || Character.isDigit(ch) + || type == Character.LETTER_NUMBER + || type == Character.COMBINING_SPACING_MARK + || type == Character.NON_SPACING_MARK + || Character.isIdentifierIgnorable(ch); + } + + if (Character.isJavaIdentifierPart((char) i) != expected) { + throw new RuntimeException( + "Character.isJavaIdentifierPart(char) failed for codepoint " + + Integer.toHexString(i)); + } + } + } + + /** + * Assertion testing for public static boolean isJavaIdentifierStart(int + * codePoint), A character may start a Java identifier if and only if it is + * one of the following: + * <ul> + * <li>it is a letter;</li> + * <li>getType(ch) returns LETTER_NUMBER;</li> + * <li>it is a currency symbol (such as "$");</li> + * <li>it is a connecting punctuation character (such as "_");</li> + * </ul> + * All Code points from (0x0000..0x10FFFF) are tested. + */ + public static void testIsJavaIdentifierStart_int() { + for (int cp = 0; cp <= Character.MAX_CODE_POINT; cp++) { + boolean expected = false; + // Since Character.isJavaIdentifierStart(int) strictly conforms to + // character information from version 6.2 of the Unicode Standard, + // check if code point is in "UNASSIGNED_CODEPOINTS_IN_6_2" + // list. If the code point is found in list + // "UNASSIGNED_CODEPOINTS_IN_6_2", value of variable + // "expected" is considered false. + if (!UNASSIGNED_CODEPOINTS_IN_6_2.contains(cp)) { + byte type = (byte) Character.getType(cp); + expected = Character.isLetter(cp) + || type == Character.LETTER_NUMBER + || type == Character.CURRENCY_SYMBOL + || type == Character.CONNECTOR_PUNCTUATION; + } + + if (Character.isJavaIdentifierStart(cp) != expected) { + throw new RuntimeException( + "Character.isJavaIdentifierStart(int) failed for codepoint " + + Integer.toHexString(cp)); + } + } + } + + /** + * Assertion testing for public static boolean isJavaIdentifierStart(char), + * A character may start a Java identifier if and only if it is + * one of the following: + * <ul> + * <li>it is a letter;</li> + * <li>getType(ch) returns LETTER_NUMBER;</li> + * <li>it is a currency symbol (such as "$");</li> + * <li>it is a connecting punctuation character (such as "_");</li> + * </ul> + * All Unicode code points in the BMP (0x0000..0xFFFF) are tested. + */ + public static void testIsJavaIdentifierStart_char() { + for (int i = 0; i <= Character.MAX_VALUE; i++) { + char ch = (char) i; + boolean expected = false; + // Since Character.isJavaIdentifierStart(char) strictly conforms to + // character information from version 6.2 of the Unicode Standard, + // check if code point is in "UNASSIGNED_CODEPOINTS_IN_6_2" + // list. If the code point is found in list + // "UNASSIGNED_CODEPOINTS_IN_6_2", value of variable + // "expected" is considered false. + if (!UNASSIGNED_CODEPOINTS_IN_6_2.contains(i)) { + byte type = (byte) Character.getType(ch); + expected = Character.isLetter(ch) + || type == Character.LETTER_NUMBER + || type == Character.CURRENCY_SYMBOL + || type == Character.CONNECTOR_PUNCTUATION; + } + + if (Character.isJavaIdentifierStart(ch) != expected) { + throw new RuntimeException( + "Character.isJavaIdentifierStart(char) failed for codepoint " + + Integer.toHexString(i)); + } + } + } + + /** + * Assertion testing for public static boolean isJavaLetter(char ch), A + * character may start a Java identifier if and only if one of the + * following is true: + * <ul> + * <li>isLetter(ch) returns true + * <li>getType(ch) returns LETTER_NUMBER + * <li>ch is a currency symbol (such as "$") + * <li>ch is a connecting punctuation character (such as "_"). + * </ul> + * All Unicode code points in the BMP (0x0000..0xFFFF) are tested. + */ + public static void testIsJavaLetter() { + for (int i = 0; i <= Character.MAX_VALUE; ++i) { + char ch = (char) i; + boolean expected = false; + // Since Character.isJavaLetter(char) strictly conforms to + // character information from version 6.2 of the Unicode Standard, + // check if code point is in "UNASSIGNED_CODEPOINTS_IN_6_2" + // list. If the code point is found in list + // "UNASSIGNED_CODEPOINTS_IN_6_2", value of variable + // "expected" is considered false. + if (!UNASSIGNED_CODEPOINTS_IN_6_2.contains(i)) { + byte type = (byte) Character.getType(ch); + expected = Character.isLetter(ch) + || type == Character.LETTER_NUMBER + || type == Character.CURRENCY_SYMBOL + || type == Character.CONNECTOR_PUNCTUATION; + } + + if (Character.isJavaLetter(ch) != expected) { + throw new RuntimeException( + "Character.isJavaLetter(ch) failed for codepoint " + + Integer.toHexString(i)); + } + } + } + + /** + * Assertion testing for public static boolean isJavaLetterOrDigit(char + * ch), A character may be part of a Java identifier if and only if any + * of the following are true: + * <ul> + * <li>it is a letter + * <li>it is a currency symbol (such as '$') + * <li>it is a connecting punctuation character (such as '_') + * <li>it is a digit + * <li>it is a numeric letter (such as a Roman numeral character) + * <li>it is a combining mark + * <li>it is a non-spacing mark + * <li>isIdentifierIgnorable returns true for the character. + * </ul> + * All Unicode code points in the BMP (0x0000..0xFFFF) are tested. + */ + public static void testIsJavaLetterOrDigit() { + for (int i = 0; i <= Character.MAX_VALUE; ++i) { + char ch = (char) i; + boolean expected = false; + // Since Character.isJavaLetterOrDigit(char) strictly conforms to + // character information from version 6.2 of the Unicode Standard, + // check if code point is in "UNASSIGNED_CODEPOINTS_IN_6_2" + // list. If the code point is found in list + // "UNASSIGNED_CODEPOINTS_IN_6_2", value of variable + // "expected" is considered false. + if (!UNASSIGNED_CODEPOINTS_IN_6_2.contains(i)) { + byte type = (byte) Character.getType(ch); + expected = Character.isLetter(ch) + || type == Character.CURRENCY_SYMBOL + || type == Character.CONNECTOR_PUNCTUATION + || Character.isDigit(ch) + || type == Character.LETTER_NUMBER + || type == Character.COMBINING_SPACING_MARK + || type == Character.NON_SPACING_MARK + || Character.isIdentifierIgnorable(ch); + } + + if (Character.isJavaLetterOrDigit(ch) != expected) { + throw new RuntimeException( + "Character.isJavaLetterOrDigit(ch) failed for codepoint " + + Integer.toHexString(i)); + } + } + } +}
--- a/test/java/text/Format/DateFormat/WeekDateTest.java Wed Apr 17 03:47:21 2019 +0100 +++ b/test/java/text/Format/DateFormat/WeekDateTest.java Thu Apr 18 03:46:32 2019 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2010, 2019, 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 @@ -137,20 +137,28 @@ Calendar jcal = Calendar.getInstance(TimeZone.getTimeZone("GMT"), new Locale("ja", "JP", "JP")); + String format = "2-W01-2"; // 2019-12-31 == R1-12-31 + int expectedYear = 2019; + // Check the current era, Heisei or Reiwa + if (System.currentTimeMillis() < 1556668800000L) { + format = "21-W01-3"; // 2008-12-31 == H20-12-31 + expectedYear = 2008; + } jcal.setFirstDayOfWeek(MONDAY); jcal.setMinimalDaysInFirstWeek(4); SimpleDateFormat sdf = new SimpleDateFormat("Y-'W'ww-u"); sdf.setCalendar(jcal); - Date d = sdf.parse("21-W01-3"); // 2008-12-31 == H20-12-31 + Date d = sdf.parse(format); GregorianCalendar gcal = newCalendar(); gcal.setTime(d); - if (gcal.get(YEAR) != 2008 + if (gcal.get(YEAR) != expectedYear || gcal.get(MONTH) != DECEMBER || gcal.get(DAY_OF_MONTH) != 31) { - String s = String.format("noWeekDateSupport: got %04d-%02d-%02d, expected 2008-12-31%n", + String s = String.format("noWeekDateSupport: got %04d-%02d-%02d, expected %4d-12-31%n", gcal.get(YEAR), gcal.get(MONTH)+1, - gcal.get(DAY_OF_MONTH)); + gcal.get(DAY_OF_MONTH), + expectedYear); throw new RuntimeException(s); } }
--- a/test/java/time/tck/java/time/chrono/TCKJapaneseChronology.java Wed Apr 17 03:47:21 2019 +0100 +++ b/test/java/time/tck/java/time/chrono/TCKJapaneseChronology.java Thu Apr 18 03:46:32 2019 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2019, 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 @@ -111,6 +111,9 @@ */ @Test public class TCKJapaneseChronology { + + // Year differences from Gregorian years. + private static final int YDIFF_REIWA = 2018; private static final int YDIFF_HEISEI = 1988; private static final int YDIFF_MEIJI = 1867; private static final int YDIFF_SHOWA = 1925; @@ -173,6 +176,7 @@ @DataProvider(name="createByEra") Object[][] data_createByEra() { return new Object[][] { + {JapaneseEra.of(3), 2020 - YDIFF_REIWA, 2, 29, 60, LocalDate.of(2020, 2, 29)}, {JapaneseEra.HEISEI, 1996 - YDIFF_HEISEI, 2, 29, 60, LocalDate.of(1996, 2, 29)}, {JapaneseEra.HEISEI, 2000 - YDIFF_HEISEI, 2, 29, 60, LocalDate.of(2000, 2, 29)}, {JapaneseEra.MEIJI, 1874 - YDIFF_MEIJI, 2, 28, 59, LocalDate.of(1874, 2, 28)}, @@ -365,8 +369,11 @@ @DataProvider(name="prolepticYear") Object[][] data_prolepticYear() { return new Object[][] { + {3, JapaneseEra.of(3), 1, 1 + YDIFF_REIWA, false}, + {3, JapaneseEra.of(3), 102, 102 + YDIFF_REIWA, true}, + {2, JapaneseEra.HEISEI, 1, 1 + YDIFF_HEISEI, false}, - {2, JapaneseEra.HEISEI, 100, 100 + YDIFF_HEISEI, true}, + {2, JapaneseEra.HEISEI, 4, 4 + YDIFF_HEISEI, true}, {-1, JapaneseEra.MEIJI, 9, 9 + YDIFF_MEIJI, true}, {-1, JapaneseEra.MEIJI, 10, 10 + YDIFF_MEIJI, false}, @@ -548,6 +555,7 @@ { JapaneseEra.TAISHO, 0, "Taisho"}, { JapaneseEra.SHOWA, 1, "Showa"}, { JapaneseEra.HEISEI, 2, "Heisei"}, + { JapaneseEra.of(3), 3, "Reiwa"}, }; } @@ -562,7 +570,7 @@ @Test public void test_Japanese_badEras() { - int badEras[] = {-1000, -998, -997, -2, 3, 4, 1000}; + int badEras[] = {-1000, -998, -997, -2, 4, 5, 1000}; for (int badEra : badEras) { try { Era era = JapaneseChronology.INSTANCE.eraOf(badEra); @@ -683,6 +691,7 @@ {JapaneseChronology.INSTANCE.date(1989, 1, 7), "Japanese Showa 64-01-07"}, {JapaneseChronology.INSTANCE.date(1989, 1, 8), "Japanese Heisei 1-01-08"}, {JapaneseChronology.INSTANCE.date(2012, 12, 6), "Japanese Heisei 24-12-06"}, + {JapaneseChronology.INSTANCE.date(2020, 1, 6), "Japanese Reiwa 2-01-06"}, }; }
--- a/test/java/time/tck/java/time/chrono/TCKJapaneseEra.java Wed Apr 17 03:47:21 2019 +0100 +++ b/test/java/time/tck/java/time/chrono/TCKJapaneseEra.java Thu Apr 18 03:46:32 2019 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2019, 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 @@ -77,6 +77,7 @@ @DataProvider(name = "JapaneseEras") Object[][] data_of_eras() { return new Object[][] { + {JapaneseEra.of(3), "Reiwa", 3}, {JapaneseEra.HEISEI, "Heisei", 2}, {JapaneseEra.SHOWA, "Showa", 1}, {JapaneseEra.TAISHO, "Taisho", 0},
--- a/test/java/time/test/java/time/chrono/TestJapaneseChronology.java Wed Apr 17 03:47:21 2019 +0100 +++ b/test/java/time/test/java/time/chrono/TestJapaneseChronology.java Thu Apr 18 03:46:32 2019 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2019, 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 @@ -34,6 +34,7 @@ import org.testng.annotations.DataProvider; import org.testng.annotations.Test; import static org.testng.Assert.assertEquals; +import static org.testng.Assert.assertTrue; /** * Tests for the Japanese chronology @@ -58,6 +59,8 @@ { JapaneseEra.SHOWA, 1, 12, 25, 1926 }, { JapaneseEra.SHOWA, 64, 1, 7, 1989 }, { JapaneseEra.HEISEI, 1, 1, 8, 1989 }, + { JapaneseEra.HEISEI, 31, 4, 30, 2019 }, + { JapaneseEra.of(3), 1, 5, 1, 2019 }, }; } @@ -74,6 +77,8 @@ { JapaneseEra.SHOWA, 64, 7, 1, 7 }, { JapaneseEra.HEISEI, 1, 1, 1, 8 }, { JapaneseEra.HEISEI, 2, 8, 1, 8 }, + { JapaneseEra.HEISEI, 31, 120, 4, 30 }, + { JapaneseEra.of(3), 1, 1, 5, 1 }, }; } @@ -81,8 +86,8 @@ Object[][] rangeData() { return new Object[][] { // field, minSmallest, minLargest, maxSmallest, maxLargest - { ChronoField.ERA, -1, -1, 2, 2}, - { ChronoField.YEAR_OF_ERA, 1, 1, 15, 999999999-1989 }, // depends on the current era + { ChronoField.ERA, -1, -1, 3, 3}, + { ChronoField.YEAR_OF_ERA, 1, 1, 15, 999999999-2019}, // depends on the current era { ChronoField.DAY_OF_YEAR, 1, 1, 7, 366}, { ChronoField.YEAR, 1873, 1873, 999999999, 999999999}, }; @@ -105,7 +110,9 @@ { JapaneseEra.SHOWA, 65, 1, 1 }, { JapaneseEra.HEISEI, 1, 1, 7 }, { JapaneseEra.HEISEI, 1, 2, 29 }, - { JapaneseEra.HEISEI, Year.MAX_VALUE, 12, 31 }, + { JapaneseEra.HEISEI, 31, 5, 1 }, + { JapaneseEra.of(3), 1, 4, 30 }, + { JapaneseEra.of(3), Year.MAX_VALUE, 12, 31 }, }; } @@ -124,7 +131,10 @@ { JapaneseEra.SHOWA, 65 }, { JapaneseEra.HEISEI, -1 }, { JapaneseEra.HEISEI, 0 }, - { JapaneseEra.HEISEI, Year.MAX_VALUE }, + { JapaneseEra.HEISEI, 32 }, + { JapaneseEra.of(3), -1 }, + { JapaneseEra.of(3), 0 }, + { JapaneseEra.of(3), Year.MAX_VALUE }, }; } @@ -141,6 +151,22 @@ { JapaneseEra.SHOWA, 64, 8 }, { JapaneseEra.HEISEI, 1, 360 }, { JapaneseEra.HEISEI, 2, 366 }, + { JapaneseEra.HEISEI, 31, 121 }, + { JapaneseEra.of(3), 1, 246 }, + { JapaneseEra.of(3), 2, 367 }, + }; + } + + @DataProvider + Object[][] eraNameData() { + return new Object[][] { + // Japanese era, name, exception + { "Meiji", JapaneseEra.MEIJI, null }, + { "Taisho", JapaneseEra.TAISHO, null }, + { "Showa", JapaneseEra.SHOWA, null }, + { "Heisei", JapaneseEra.HEISEI, null }, + { "Reiwa", JapaneseEra.of(3), null }, + { "NewEra", null, IllegalArgumentException.class}, }; } @@ -192,4 +218,13 @@ JapaneseDate date = JAPANESE.dateYearDay(era, yearOfEra, dayOfYear); System.out.printf("No DateTimeException with era=%s, year=%d, dayOfYear=%d%n", era, yearOfEra, dayOfYear); } + + @Test(dataProvider="eraNameData") + public void test_eraName(String eraName, JapaneseEra era, Class expectedEx) { + try { + assertEquals(JapaneseEra.valueOf(eraName), era); + } catch (Exception ex) { + assertTrue(expectedEx.isInstance(ex)); + } + } }
--- a/test/java/time/test/java/time/chrono/TestUmmAlQuraChronology.java Wed Apr 17 03:47:21 2019 +0100 +++ b/test/java/time/test/java/time/chrono/TestUmmAlQuraChronology.java Thu Apr 18 03:46:32 2019 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2019, 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 @@ -775,8 +775,10 @@ {HijrahDate.of(1350,5,15), "Japanese Showa 6-09-28"}, {HijrahDate.of(1434,5,1), "Japanese Heisei 25-03-13"}, {HijrahDate.of(1436,1,1), "Japanese Heisei 26-10-25"}, - {HijrahDate.of(1500,6,12), "Japanese Heisei 89-05-05"}, - {HijrahDate.of(1550,3,11), "Japanese Heisei 137-08-11"}, + {HijrahDate.of(1440,8,25), "Japanese Heisei 31-04-30"}, + {HijrahDate.of(1440,8,26), "Japanese Reiwa 1-05-01"}, + {HijrahDate.of(1500,6,12), "Japanese Reiwa 59-05-05"}, + {HijrahDate.of(1550,3,11), "Japanese Reiwa 107-08-11"}, }; }
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/java/time/test/java/time/format/TestDateTimeFormatterBuilderWithLocale.java Thu Apr 18 03:46:32 2019 +0100 @@ -0,0 +1,137 @@ +/* + * Copyright (c) 2019, 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. + */ + +/* + * This file is available under and governed by the GNU General Public + * License version 2 only, as published by the Free Software Foundation. + * However, the following notice accompanied the original version of this + * file: + * + * Copyright (c) 2009-2012, Stephen Colebourne & Michael Nascimento Santos + * + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * * Neither the name of JSR-310 nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +/* + * + * @test + * @bug 8042131 8210633 + */ + +package test.java.time.format; + +import java.time.chrono.ChronoLocalDate; +import java.time.chrono.IsoChronology; +import java.time.chrono.JapaneseChronology; +import java.time.chrono.JapaneseEra; +import java.time.chrono.MinguoChronology; +import java.time.chrono.ThaiBuddhistChronology; +import java.time.format.DateTimeFormatter; +import java.time.format.DateTimeFormatterBuilder; +import java.time.format.ResolverStyle; +import java.time.temporal.ChronoField; +import java.time.temporal.TemporalAccessor; +import java.util.HashMap; +import java.util.Locale; +import java.util.Map; + +import static org.testng.Assert.assertEquals; +import org.testng.annotations.BeforeMethod; +import org.testng.annotations.DataProvider; +import org.testng.annotations.Test; + +/** + * Test TestDateTimeFormatterBuilderWithLocale. + */ +@Test +public class TestDateTimeFormatterBuilderWithLocale { + + private DateTimeFormatterBuilder builder; + + @BeforeMethod + public void setUp() { + builder = new DateTimeFormatterBuilder(); + } + + @DataProvider(name="mapTextLookup") + Object[][] data_mapTextLookup() { + return new Object[][] { + {IsoChronology.INSTANCE.date(1, 1, 1), Locale.ENGLISH}, + {JapaneseChronology.INSTANCE.date(JapaneseEra.HEISEI, 1, 1, 8), Locale.ENGLISH}, + {MinguoChronology.INSTANCE.date(1, 1, 1), Locale.ENGLISH}, + {ThaiBuddhistChronology.INSTANCE.date(1, 1, 1), Locale.ENGLISH}, + }; + } + + @Test(dataProvider="mapTextLookup") + public void test_appendText_mapTextLookup(ChronoLocalDate date, Locale locale) { + final String firstYear = "firstYear"; + final String firstMonth = "firstMonth"; + final String firstYearMonth = firstYear + firstMonth; + final long first = 1L; + + Map<Long, String> yearMap = new HashMap<Long, String>(); + yearMap.put(first, firstYear); + + Map<Long, String> monthMap = new HashMap<Long, String>(); + monthMap.put(first, firstMonth); + + DateTimeFormatter formatter = builder + .appendText(ChronoField.YEAR_OF_ERA, yearMap) + .appendText(ChronoField.MONTH_OF_YEAR, monthMap) + .toFormatter(locale) + .withResolverStyle(ResolverStyle.STRICT); + + assertEquals(date.format(formatter), firstYearMonth); + + TemporalAccessor ta = formatter.parse(firstYearMonth); + assertEquals(ta.getLong(ChronoField.YEAR_OF_ERA), first); + assertEquals(ta.getLong(ChronoField.MONTH_OF_YEAR), first); + } +}
--- a/test/java/time/test/java/time/format/TestNonIsoFormatter.java Wed Apr 17 03:47:21 2019 +0100 +++ b/test/java/time/test/java/time/format/TestNonIsoFormatter.java Thu Apr 18 03:46:32 2019 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2019, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -20,6 +20,13 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + +/* + * + * @test + * @bug 8206120 + */ + package test.java.time.format; import static org.testng.Assert.assertEquals; @@ -37,6 +44,7 @@ import java.time.format.DateTimeFormatterBuilder; import java.time.format.DateTimeParseException; import java.time.format.FormatStyle; +import java.time.format.ResolverStyle; import java.time.format.TextStyle; import java.time.temporal.TemporalAccessor; import java.time.temporal.TemporalQueries; @@ -128,6 +136,16 @@ }; } + @DataProvider(name="lenient_eraYear") + Object[][] lenientEraYear() { + return new Object[][] { + // Chronology, lenient era/year, strict era/year + { JAPANESE, "Meiji 123", "Heisei 2" }, + { JAPANESE, "Showa 65", "Heisei 2" }, + { JAPANESE, "Heisei 32", "Reiwa 2" }, + }; + } + @Test(dataProvider="format_data") public void test_formatLocalizedDate(Chronology chrono, Locale formatLocale, Locale numberingLocale, ChronoLocalDate date, String expected) { @@ -166,4 +184,15 @@ Chronology cal = ta.query(TemporalQueries.chronology()); assertEquals(cal, chrono); } + + @Test(dataProvider="lenient_eraYear") + public void test_lenientEraYear(Chronology chrono, String lenient, String strict) { + String mdStr = "-01-01"; + DateTimeFormatter dtf = new DateTimeFormatterBuilder() + .appendPattern("GGGG y-M-d") + .toFormatter() + .withChronology(chrono); + DateTimeFormatter dtfLenient = dtf.withResolverStyle(ResolverStyle.LENIENT); + assertEquals(LocalDate.parse(lenient+mdStr, dtfLenient), LocalDate.parse(strict+mdStr, dtf)); } +}
--- a/test/java/time/test/java/util/TestFormatter.java Wed Apr 17 03:47:21 2019 +0100 +++ b/test/java/time/test/java/util/TestFormatter.java Thu Apr 18 03:46:32 2019 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2019, 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 @@ -46,7 +46,7 @@ /* @test * @summary Unit test for j.u.Formatter threeten date/time support - * @bug 8003680 8012638 + * @bug 8003680 8043387 8012638 */ @Test public class TestFormatter { @@ -196,10 +196,6 @@ } } - private String toZoneIdStr(String expected) { - return expected.replaceAll("(?:GMT|UTC)(?<off>[+\\-]?[0-9]{2}:[0-9]{2})", "${off}"); - } - private String toZoneOffsetStr(String expected) { return expected.replaceAll("(?:GMT|UTC)(?<off>[+\\-]?[0-9]{2}:[0-9]{2})", "${off}") .replaceAll("GMT|UTC|UT", "Z"); @@ -208,7 +204,7 @@ private void testZoneId(Locale locale, ChronoZonedDateTime<?> zdt, Calendar cal) { String fmtStr = "z:[%tz] z:[%1$Tz] Z:[%1$tZ] Z:[%1$TZ]"; printFmtStr(locale, fmtStr); - String expected = toZoneIdStr(test(fmtStr, locale, null, cal)); + String expected = test(fmtStr, locale, null, cal); test(fmtStr, locale, expected, zdt); // get a new cal with fixed tz Calendar cal0 = Calendar.getInstance(); @@ -224,7 +220,7 @@ // datetime + zid fmtStr = "c:[%tc] c:[%1$Tc]"; printFmtStr(locale, fmtStr); - expected = toZoneIdStr(test(fmtStr, locale, null, cal)); + expected = test(fmtStr, locale, null, cal); test(fmtStr, locale, expected, zdt); }
--- a/test/java/util/Calendar/Bug8007038.java Wed Apr 17 03:47:21 2019 +0100 +++ b/test/java/util/Calendar/Bug8007038.java Thu Apr 18 03:46:32 2019 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2019, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -45,7 +45,7 @@ private final static int[][] eraMinMax = { {GregorianCalendar.BC, GregorianCalendar.AD}, {0, 1}, - {0, 4}, + {0, 5}, {0, 1}, {0, 1}, {0, 1},
--- a/test/java/util/Calendar/Builder/BuilderTest.java Wed Apr 17 03:47:21 2019 +0100 +++ b/test/java/util/Calendar/Builder/BuilderTest.java Thu Apr 18 03:46:32 2019 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2019, 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 @@ * @summary Unit test for Calendar.Builder. */ +import java.time.LocalDateTime; import java.util.*; import static java.util.Calendar.*; @@ -132,7 +133,11 @@ .setFields(YEAR, 1, DAY_OF_YEAR, 1).build(); expected = Calendar.getInstance(jaJPJP); expected.clear(); + if (LocalDateTime.now().isBefore(LocalDateTime.of(2019, 5, 1, 0, 0))) { expected.set(1, JANUARY, 8); + } else { + expected.set(1, MAY, 1); + } check(cal, expected); // setLocale calb = builder();
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/java/util/Calendar/CalendarTestScripts/CalendarAdapter.java Thu Apr 18 03:46:32 2019 +0100 @@ -0,0 +1,437 @@ +/* + * Copyright (c) 2007, 2019, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + + +import java.util.Calendar; +import sun.util.calendar.CalendarUtils; + +public class CalendarAdapter extends Calendar { + public static enum Type { + GREGORIAN, BUDDHIST, JAPANESE; + } + + static final String[] FIELD_NAMES = { + "ERA", "YEAR", "MONTH", "WEEK_OF_YEAR", "WEEK_OF_MONTH", "DAY_OF_MONTH", + "DAY_OF_YEAR", "DAY_OF_WEEK", "DAY_OF_WEEK_IN_MONTH", "AM_PM", "HOUR", + "HOUR_OF_DAY", "MINUTE", "SECOND", "MILLISECOND", "ZONE_OFFSET", + "DST_OFFSET" + }; + + Calendar cal; + GregorianAdapter gcal; + private Type type; + + public CalendarAdapter(Calendar cal) { + if (cal == null) + throw new NullPointerException(); + + this.cal = cal; + if (cal instanceof sun.util.BuddhistCalendar) { + type = Type.BUDDHIST; + } else if (cal instanceof GregorianAdapter) { + type = Type.GREGORIAN; + gcal = (GregorianAdapter) cal; + } else { + type = Type.JAPANESE; + } + } + + public void setFirstDayOfWeek(int w) { + cal.setFirstDayOfWeek(w); + } + + public int getFirstDayOfWeek() { + return cal.getFirstDayOfWeek(); + } + + public void setMinimalDaysInFirstWeek(int value) { + cal.setMinimalDaysInFirstWeek(value); + } + + public int getMinimalDaysInFirstWeek() { + return getMinimalDaysInFirstWeek(); + } + + public long getTimeInMillis() { + return cal.getTimeInMillis(); + } + + public void setTimeInMillis(long millis) { + cal.setTimeInMillis(millis); + } + + public int get(int field) { + return cal.get(field); + } + + public void set(int field, int value) { + cal.set(field, value); + } + + public void add(int field, int amount) { + cal.add(field, amount); + } + + public void roll(int field, boolean dir) { + cal.roll(field, dir); + } + + public void roll(int field, int amount) { + cal.roll(field, amount); + } + + public void setDate(int year, int month, int date) + { + cal.set(year, month, date); + } + + public void setDate(int era, int year, int month, int date) { + cal.set(ERA, era); + cal.set(year, month, date); + } + + public void setDateTime(int year, int month, int date, int hourOfDay, int minute, int second) + { + cal.set(year, month, date, hourOfDay, minute, second); + } + + public void clearAll() { + cal.clear(); + } + + public void clearField(int field) + { + cal.clear(field); + } + + public boolean isSetField(int field) + { + return cal.isSet(field); + } + + public int getMaximum(int field) { + return cal.getMaximum(field); + } + + public int getLeastMaximum(int field) { + return cal.getLeastMaximum(field); + } + + public int getActualMaximum(int field) { + return cal.getActualMaximum(field); + } + + public int getMinimum(int field) { + return cal.getMinimum(field); + } + + public int getGreatestMinimum(int field) { + return cal.getGreatestMinimum(field); + } + + public int getActualMinimum(int field) { + return cal.getActualMinimum(field); + } + + public void setLenient(boolean lenient) { + cal.setLenient(lenient); + } + + public String toString() { + return cal.toString(); + } + + protected void computeFields() { + } + + protected void computeTime() { + } + + void setTimeOfDay(int hourOfDay, int minute, int second, int ms) { + cal.set(HOUR_OF_DAY, hourOfDay); + cal.set(MINUTE, minute); + cal.set(SECOND, second); + cal.set(MILLISECOND, ms); + } + + // GregorianAdapter specific methods + + // When gcal is null, the methods throw a NPE. + + int getSetStateFields() { + return gcal.getSetStateFields(); + } + + int[] getFields() { + return gcal.getFields(); + } + + boolean checkInternalDate(int year, int month, int dayOfMonth) { + return gcal.checkInternalDate(year, month, dayOfMonth); + } + + boolean checkInternalDate(int year, int month, int dayOfMonth, int dayOfWeek) { + return gcal.checkInternalDate(year, month, dayOfMonth, dayOfWeek); + } + + boolean checkInternalField(int field, int expectedValue) { + return checkInternalField(field, expectedValue); + } + + // check methods + + boolean checkAllSet() { + initTest(); + for (int i = 0; i < FIELD_COUNT; i++) { + checkFieldState(i, true); + } + return getStatus(); + } + + boolean checkMaximum(int field, int expectedValue) { + int val; + if ((val = getMaximum(field)) != expectedValue) { + appendMessage("getMaximum("+FIELD_NAMES[field]+"): got " + val + + " expected " + expectedValue); + } + return getStatus(); + } + + boolean checkActualMaximum(int field, int expectedValue) { + int val; + if ((val = getActualMaximum(field)) != expectedValue) { + appendMessage("getActualMaximum("+FIELD_NAMES[field]+"): got " + val + + " expected " + expectedValue); + } + return getStatus(); + } + + boolean checkLeastMaximum(int field, int expectedValue) { + int val; + if ((val = getLeastMaximum(field)) != expectedValue) { + appendMessage("getLeastMaximum("+FIELD_NAMES[field]+"): got " + val + + " expected " + expectedValue); + } + return getStatus(); + } + + boolean checkMinimum(int field, int expectedValue) { + int val; + if ((val = getMinimum(field)) != expectedValue) { + appendMessage("getMinimum("+FIELD_NAMES[field]+"): got " + val + + " expected " + expectedValue); + } + return getStatus(); + } + + boolean checkActualMinimum(int field, int expectedValue) { + int val; + if ((val = getActualMinimum(field)) != expectedValue) { + appendMessage("getActualMinimum("+FIELD_NAMES[field]+"): got " + val + + " expected " + expectedValue); + } + return getStatus(); + } + + boolean checkGreatestMinimum(int field, int expectedValue) { + int val; + if ((val = getGreatestMinimum(field)) != expectedValue) { + appendMessage("getGreatestMinimum("+FIELD_NAMES[field]+"): got " + val + + " expected " + expectedValue); + } + return getStatus(); + } + + boolean checkDate(int year, int month, int dayOfMonth) { + initTest(); + checkField(YEAR, year); + checkField(MONTH, month); + checkField(DAY_OF_MONTH, dayOfMonth); + return getStatus(); + } + + boolean checkDate(int era, int year, int month, int dayOfMonth) { + initTest(); + checkField(ERA, era); + checkField(YEAR, year); + checkField(MONTH, month); + checkField(DAY_OF_MONTH, dayOfMonth); + return getStatus(); + } + + boolean checkDateTime(int year, int month, int dayOfMonth, + int hourOfDay, int minute, int second) { + initTest(); + checkField(YEAR, year); + checkField(MONTH, month); + checkField(DAY_OF_MONTH, dayOfMonth); + checkField(HOUR_OF_DAY, hourOfDay); + checkField(MINUTE, minute); + checkField(SECOND, second); + return getStatus(); + } + + boolean checkDateTime(int year, int month, int dayOfMonth, + int hourOfDay, int minute, int second, int ms) { + initTest(); + checkField(YEAR, year); + checkField(MONTH, month); + checkField(DAY_OF_MONTH, dayOfMonth); + checkField(HOUR_OF_DAY, hourOfDay); + checkField(MINUTE, minute); + checkField(SECOND, second); + checkField(MILLISECOND, ms); + return getStatus(); + } + + boolean checkTimeOfDay(int hourOfDay, int minute, int second, int ms) { + initTest(); + checkField(HOUR_OF_DAY, hourOfDay); + checkField(MINUTE, minute); + checkField(SECOND, second); + checkField(MILLISECOND, ms); + return getStatus(); + } + + boolean checkMillis(long millis) { + initTest(); + long t = cal.getTimeInMillis(); + if (t != millis) { + appendMessage("wrong millis: got " + t + ", expected " + millis); + return false; + } + return true; + } + + boolean checkFieldState(int field, boolean expectedState) { + if (isSet(field) != expectedState) { + appendMessage(FIELD_NAMES[field] + " state is not " + expectedState + "; "); + return false; + } + return true; + } + + boolean checkField(int field, int expectedValue) { + int val; + if ((val = get(field)) != expectedValue) { + appendMessage("get(" + FIELD_NAMES[field] + "): got " + val + + ", expected " + expectedValue + "; "); + return false; + } + return true; + } + + static final String fieldName(int field) { + return FIELD_NAMES[field]; + } + + String toDateString() { + StringBuffer sb = new StringBuffer(); + String[] eraNames = null; + switch (type) { + case GREGORIAN: + eraNames = new String[] { "BCE", "" }; + break; + + case BUDDHIST: + eraNames = new String[] { "Before BE", "BE"}; + break; + + case JAPANESE: + eraNames = new String[] { + "BeforeMeiji", + "Meiji", + "Taisho", + "Showa", + "Heisei", + "Reiwa" + }; + break; + } + + sb.append(eraNames[cal.get(ERA)]); + if (sb.length() > 0) + sb.append(' '); + CalendarUtils.sprintf0d(sb, cal.get(YEAR), 4).append('-'); + CalendarUtils.sprintf0d(sb, cal.get(MONTH)+1, 2).append('-'); + CalendarUtils.sprintf0d(sb, cal.get(DAY_OF_MONTH), 2); + return sb.toString(); + } + + String toTimeString() { + StringBuffer sb = new StringBuffer(); + CalendarUtils.sprintf0d(sb, cal.get(HOUR_OF_DAY), 2).append(':'); + CalendarUtils.sprintf0d(sb, cal.get(MINUTE), 2).append(':'); + CalendarUtils.sprintf0d(sb, cal.get(SECOND),2 ).append('.'); + CalendarUtils.sprintf0d(sb, cal.get(MILLISECOND), 3); + int zoneOffset = cal.get(ZONE_OFFSET) + cal.get(DST_OFFSET); + if (zoneOffset == 0) { + sb.append('Z'); + } else { + int offset; + char sign; + if (zoneOffset > 0) { + offset = zoneOffset; + sign = '+'; + } else { + offset = -zoneOffset; + sign = '-'; + } + offset /= 60000; + sb.append(sign); + CalendarUtils.sprintf0d(sb, offset / 60, 2); + CalendarUtils.sprintf0d(sb, offset % 60, 2); + } + return sb.toString(); + } + + String toDateTimeString() { + return toDateString() + "T" + toTimeString(); + } + + // Message handling + + StringBuffer msg = new StringBuffer(); + + private void initTest() { + msg = new StringBuffer(); + } + + String getMessage() { + String s = msg.toString(); + msg = new StringBuffer(); + return " " + s; + } + + private void setMessage(String msg) { + this.msg = new StringBuffer(msg); + } + + private void appendMessage(String msg) { + this.msg.append(msg); + } + + boolean getStatus() { + return msg.length() == 0; + } +}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/java/util/Calendar/CalendarTestScripts/CalendarTestEngine.java Thu Apr 18 03:46:32 2019 +0100 @@ -0,0 +1,782 @@ +/* + * Copyright (c) 2007, 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + + +import java.io.BufferedReader; +import java.io.File; +import java.io.FileInputStream; +import java.io.InputStreamReader; +import java.util.*; + +public class CalendarTestEngine { + private static File file; + private static BufferedReader in; + private static int testCount; + private static int lineno; + private static Locale locale; + private static TimeZone timezone; + private static boolean leniency = true; + + public static void main(String[] args) throws Exception { + Locale loc = Locale.getDefault(); + TimeZone tz = TimeZone.getDefault(); + locale = loc; + timezone = tz; + try { + for (String arg : args) { + file = new File(arg); + FileInputStream fis = new FileInputStream(file); + System.out.println("Starting " + file.getName() + "..."); + in = new BufferedReader(new InputStreamReader(fis)); + testCount = lineno = 0; + run(); + System.out.println("Completed " + file.getName()); + } + } finally { + Locale.setDefault(loc); + TimeZone.setDefault(tz); + } + } + + private static void run() throws Exception { + String line; + int section = 0; + Map<String, CalendarAdapter> cals = new HashMap<String, CalendarAdapter>(); + CalendarAdapter calendar = null; + Result result = new Result(); + + while ((line = in.readLine()) != null) { + lineno++; + line = line.trim(); + // Skip blank and comment lines + if (line.length() == 0 || line.charAt(0) == '#') { + continue; + } + int comment = line.indexOf('#'); + if (comment != -1) { + line = line.substring(0, comment).trim(); + } + Scanner sc = new Scanner(line); + String token = sc.next(); + Symbol operation = symbol(token); + if (operation == null) { + throw new RuntimeException(lineno() + "wrong op? " + token); + } + + + if (operation.type == Symbol.Type.EXCEPTION) { + String className = sc.next(); + Class clazz = Exceptions.get(className); + Exception e = result.getException(); + if (!clazz.isInstance(e)) { + throw new RuntimeException(lineno() + "unexpected exception: got: " + e + + ", expected=" + clazz); + } + } + + Exception x = result.getException(); + if (x != null) { + throw new RuntimeException(lineno(result.getLineno()) + "Unexpected exception", x); + } + + try { + switch (operation.type) { + case LOCALE: + { + String lang = sc.next(); + String country = "", var = ""; + if (sc.hasNext()) { + country = sc.next(); + if (sc.hasNext()) { + var = sc.next(); + } + } + locale = new Locale(lang, country, var); + } + break; + + case TIMEZONE: + { + if (sc.hasNext()) { + String id = sc.next(); + timezone = TimeZone.getTimeZone(id); + if (!timezone.getID().equals(id)) { + System.err.printf("Warning: line %d: may get wrong time zone? " + +"(specified: %s vs. actual: %s)%n", + lineno, id, timezone.getID()); + } + } + } + break; + + case NEW: + { + Symbol op = symbol(sc.next()); + Calendar cal = null; + switch (op.type) { + case INSTANCE: + cal = Calendar.getInstance(timezone, locale); + break; + case GREGORIAN: + cal = new GregorianAdapter(timezone, locale); + break; + default: + symbolError(op); + break; + } + cal.setLenient(leniency); + calendar = new CalendarAdapter(cal); + if (sc.hasNext()) { + String name = sc.next(); + cals.put(name.toLowerCase(Locale.ROOT), calendar); + if (!leniency) { + System.out.printf("%s%s is non-lenient%n", lineno(), name); + } + } else { + throw new RuntimeException(lineno() + "Missing associated name"); + } + } + break; + + case TEST: + testCount++; + if (sc.hasNext()) { + System.out.printf("Test#%d:%s%n", testCount, sc.findInLine(".+")); + } else { + System.out.printf("Test#%d:%n", testCount); + } + break; + + case USE: + { + String name = sc.next().toLowerCase(Locale.ROOT); + CalendarAdapter c = cals.get(name); + if (c == null) { + throw new CalendarTestException(lineno() + "calendar " + name + + " not found."); + } + calendar = c; + } + break; + + case ASSIGN: + { + long v = getLong(sc); + String to = sc.next().toLowerCase(Locale.ROOT); + boolean assign = true; + if (sc.hasNext()) { + Symbol condition = symbol(sc.next()); + if (condition.type == Symbol.Type.IF) { + long v1 = getLong(sc); + Symbol op = symbol(sc.next()); + long v2 = getLong(sc); + assign = relation(v1, op, v2); + } else { + symbolError(condition); + } + } + if (assign) + Variable.newVar(to, v); + } + break; + + case EVAL: + { + long v1 = getLong(sc); + String op = sc.next(); + Symbol operator = symbol(op); + if (operator == null) { + throw new RuntimeException("op " + op + " invalid"); + } + long v2 = getLong(sc); + if (operator.isArithmetic()) { + long value = 0; + switch (operator.type) { + case PLUS: + value = v1 + v2; + break; + + case MINUS: + value = v1 - v2; + break; + + case MULTIPLY: + value = v1 * v2; + break; + + case DIVIDE: + value = v1 / v2; + break; + + case MOD: + value = v1 % v2; + break; + + default: + symbolError(operator); + break; + } + result.setValue(value); + } else { + if (!relation(v1, operator, v2)) { + throw new RuntimeException("not " + v1 + " " + op + " " + v2); + } + } + } + break; + + case CLEAR: + { + Symbol sym = symbol(sc.next()); + if (sym.type == Symbol.Type.ALL) { + calendar.clearAll(); + } else if (sym.type == Symbol.Type.FIELD) { + int f = sym.value(); + calendar.clearField(f); + } else { + symbolError(sym); + } + } + break; + + case GET: + { + Symbol sym = symbol(sc.next()); + switch (sym.type) { + case FIELD: + { + int f = sym.value(); + int v = calendar.get(f); + result.setValue(v); + } + break; + + case MILLIS: + { + long v = calendar.getTimeInMillis(); + result.setValue(v); + } + break; + + case MINIMUM: + { + int f = getInt(sc); + int v = calendar.getMinimum(f); + result.setValue(v); + } + break; + + case GREATESTMINIMUM: + { + int f = getInt(sc); + int v = calendar.getGreatestMinimum(f); + result.setValue(v); + } + break; + + case ACTUALMINIMUM: + { + int f = getInt(sc); + int v = calendar.getActualMinimum(f); + result.setValue(v); + } + break; + + case MAXIMUM: + { + int f = getInt(sc); + int v = calendar.getMaximum(f); + result.setValue(v); + } + break; + + case LEASTMAXIMUM: + { + int f = getInt(sc); + int v = calendar.getLeastMaximum(f); + result.setValue(v); + } + break; + + case ACTUALMAXIMUM: + { + int f = getInt(sc); + int v = calendar.getActualMaximum(f); + result.setValue(v); + } + break; + + case FIRSTDAYOFWEEK: + { + result.setValue(calendar.getFirstDayOfWeek()); + } + break; + + case MINIMALDAYSINFIRSTWEEK: + { + int v = calendar.getMinimalDaysInFirstWeek(); + result.setValue(v); + } + break; + + default: + symbolError(sym); + break; + } + } + break; + + case ADD: + case ROLL: + { + Symbol sym = symbol(sc.next()); + if (sym.type == Symbol.Type.FIELD) { + int f = sym.value(); + int v = sc.nextInt(); + switch (operation.type) { + case ADD: + calendar.add(f, v); + break; + + case ROLL: + calendar.roll(f, v); + break; + } + } else { + symbolError(sym); + } + } + break; + + case SET: + { + Symbol sym = symbol(sc.next()); + switch (sym.type) { + case FIELD: + { + int f = sym.value(); + int v = getInt(sc); + calendar.set(f, v); + } + break; + + case MILLIS: + { + long v = getLong(sc); + calendar.setTimeInMillis(v); + } + break; + + case DATE: + { + int a = getInt(sc); + int b = getInt(sc); + int c = getInt(sc); + if (sc.hasNext()) { + int d = getInt(sc); + // era, year, month, dayOfMonth + calendar.setDate(a, b, c, d); + } else { + // year, month, dayOfMonth + calendar.setDate(a, b, c); + } + } + break; + + case DATETIME: + { + int y = getInt(sc); + int m = getInt(sc); + int d = getInt(sc); + int hh = getInt(sc); + int mm = getInt(sc); + int ss = getInt(sc); + calendar.setDateTime(y, m, d, hh, mm, ss); + } + break; + + case TIMEOFDAY: + { + int hh = getInt(sc); + int mm = getInt(sc); + int ss = getInt(sc); + int ms = getInt(sc); + calendar.setTimeOfDay(hh, mm, ss, ms); + } + break; + + case FIRSTDAYOFWEEK: + { + int v = getInt(sc); + calendar.setFirstDayOfWeek(v); + } + break; + + case MINIMALDAYSINFIRSTWEEK: + { + int v = getInt(sc); + calendar.setMinimalDaysInFirstWeek(v); + } + break; + + case LENIENT: + if (calendar != null) { + calendar.setLenient(true); + } + leniency = true; + break; + + case NONLENIENT: + if (calendar != null) { + calendar.setLenient(false); + } + leniency = false; + break; + + default: + symbolError(sym); + } + if (sc.hasNext()) { + throw new RuntimeException(lineno() + "extra param(s) " + + sc.findInLine(".+")); + } + } + break; + + case CHECK: + { + Symbol sym = symbol(sc.next()); + boolean stat = false; + switch (sym.type) { + case MILLIS: + { + long millis = getLong(sc); + stat = calendar.checkMillis(millis); + } + break; + + case FIELD: + { + int f = sym.value(); + int v = getInt(sc); + stat = calendar.checkField(f, v); + } + break; + + case DATE: + { + int a = getInt(sc); + int b = getInt(sc); + int c = getInt(sc); + if (sc.hasNext()) { + int d = getInt(sc); + // era year month dayOfMonth + stat = calendar.checkDate(a, b, c, d); + } else { + // year month dayOfMonth + stat = calendar.checkDate(a, b, c); + } + } + break; + + case DATETIME: + { + int y = getInt(sc); + int m = getInt(sc); + int d = getInt(sc); + int hh = getInt(sc); + int mm = getInt(sc); + int ss = getInt(sc); + if (sc.hasNext()) { + int ms = getInt(sc); + stat = calendar.checkDateTime(y, m, d, hh, mm, ss, ms); + } else { + stat = calendar.checkDateTime(y, m, d, hh, mm, ss); + } + } + break; + + case TIMEOFDAY: + { + int hh = sc.nextInt(); + int mm = sc.nextInt(); + int ss = sc.nextInt(); + int millis = sc.nextInt(); + stat = calendar.checkTimeOfDay(hh, mm, ss, millis); + } + break; + + case MINIMUM: + { + int f = getInt(sc); + int v = getInt(sc); + stat = calendar.checkMinimum(f, v); + } + break; + + case GREATESTMINIMUM: + { + int f = getInt(sc); + int v = getInt(sc); + stat = calendar.checkGreatestMinimum(f, v); + } + break; + + case ACTUALMINIMUM: + { + int f = getInt(sc); + int v = getInt(sc); + stat = calendar.checkActualMinimum(f, v); + } + break; + + case MAXIMUM: + { + int f = getInt(sc); + int v = getInt(sc); + stat = calendar.checkMaximum(f, v); + } + break; + + case LEASTMAXIMUM: + { + int f = getInt(sc); + int v = getInt(sc); + stat = calendar.checkLeastMaximum(f, v); + } + break; + + case ACTUALMAXIMUM: + { + int f = getInt(sc); + int v = getInt(sc); + stat = calendar.checkActualMaximum(f, v); + } + break; + + default: + throw new RuntimeException(lineno() + "Unknown operand"); + } + if (!stat) { + throw new RuntimeException(lineno() + calendar.getMessage()); + } + } + break; + + case PRINT: + { + String s = sc.next(); + if (s.charAt(0) == '$') { + Variable var = variable(s); + if (var == null) + throw new RuntimeException(lineno() + "Unknown token: " + s); + System.out.printf("%s%s=%d%n", lineno(), s, var.longValue()); + break; + } + + Symbol sym = symbol(s); + switch (sym.type) { + case INSTANCE: + { + Calendar cal = calendar; + String name = "current"; + if (sc.hasNext()) { + name = sc.next(); + cal = cals.get(name.toLowerCase(Locale.ROOT)); + } + System.out.printf("%s%s=%s%n", lineno(), name, cal); + } + break; + + case FIELD: + { + int f = sym.value(); + String remark = ""; + if (sc.hasNext()) { + remark = sc.findInLine(".+"); + } + System.out.printf("%s%s=%d %s%n", lineno(), calendar.fieldName(f), + calendar.get(f), remark); + } + break; + + case MILLIS: + { + String remark = ""; + if (sc.hasNext()) { + remark = sc.findInLine(".+"); + } + System.out.printf("%sMillis=%d %s%n", lineno(), + calendar.getTimeInMillis(), remark); + } + break; + + case MINIMUM: + System.out.printf("%s%s=%d%n", lineno(), + s, calendar.getMinimum(getInt(sc))); + break; + + case GREATESTMINIMUM: + System.out.printf("%s%s=%d%n", lineno(), + s, calendar.getGreatestMinimum(getInt(sc))); + break; + + case ACTUALMINIMUM: + System.out.printf("%s%s=%d%n", lineno(), + s, calendar.getActualMinimum(getInt(sc))); + break; + + case MAXIMUM: + System.out.printf("%s%s=%d%n", lineno(), + s, calendar.getMaximum(getInt(sc))); + break; + + case LEASTMAXIMUM: + System.out.printf("%s%s=%d%n", lineno(), + s, calendar.getLeastMaximum(getInt(sc))); + break; + + case ACTUALMAXIMUM: + System.out.printf("%s%s=%d%n", lineno(), + s, calendar.getActualMaximum(getInt(sc))); + break; + + case DATE: + System.out.println(lineno() + calendar.toDateString()); + break; + + case DATETIME: + System.out.println(lineno() + calendar.toDateTimeString()); + break; + + case TIMEZONE: + System.out.println(lineno() + "timezone=" + timezone); + break; + + case LOCALE: + System.out.println(lineno() + "locale=" + locale); + break; + } + } + } + } catch (CalendarTestException cte) { + throw cte; + } catch (NoSuchElementException nsee) { + throw new NoSuchElementException(lineno() + "syntax error"); + } catch (Exception e) { + result.setException(e); + result.setLineno(lineno); + } + } + Exception x = result.getException(); + if (x != null) { + throw new RuntimeException(lineno(result.getLineno()) + "Unexpected exception", x); + } + } + + private static Symbol symbol(String s) { + return Symbol.get(s.toLowerCase(Locale.ROOT)); + } + + private static Variable variable(String s) { + return Variable.get(s.toLowerCase(Locale.ROOT)); + } + + private static int getInt(Scanner sc) { + if (sc.hasNextInt()) { + return sc.nextInt(); + } + + String s = sc.next(); + if (s.charAt(0) == '$') { + Variable var = variable(s); + if (var == null) + throw new RuntimeException(lineno() + "Unknown token: " + s); + return var.intValue(); + } + Symbol sym = symbol(s); + if (sym == null) + throw new RuntimeException(lineno() + "Unknown token: " + s); + return sym.value(); + } + + private static long getLong(Scanner sc) { + if (sc.hasNextLong()) { + return sc.nextLong(); + } + + String s = sc.next(); + if (s.charAt(0) == '$') { + Variable var = variable(s); + if (var == null) + throw new RuntimeException(lineno() + "Unknown token: " + s); + return var.longValue(); + } + Symbol sym = symbol(s); + if (sym == null) + throw new RuntimeException(lineno() + "Unknown token: " + s); + return sym.value(); + } + + private static boolean relation(long v1, Symbol relop, long v2) { + boolean result = false; + switch (relop.type) { + case GT: + result = v1 > v2; + break; + + case GE: + result = v1 >= v2; + break; + + case EQ: + result = v1 == v2; + break; + + case NEQ: + result = v1 != v2; + break; + + case LE: + result = v1 <= v2; + break; + + case LT: + result = v1 < v2; + break; + } + return result; + } + + private static String lineno() { + return lineno(lineno); + } + + private static String lineno(int ln) { + return file.getName() + ":" + ln + ": "; + } + + private static void symbolError(Symbol sym) { + throw new RuntimeException(lineno + ": unexpected symbol: " + sym); + } +}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/java/util/Calendar/CalendarTestScripts/CalendarTestException.java Thu Apr 18 03:46:32 2019 +0100 @@ -0,0 +1,36 @@ +/* + * Copyright (c) 2007, 2018, 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. + */ + +public class CalendarTestException extends RuntimeException { + public CalendarTestException() { + super(); + } + + public CalendarTestException(String msg) { + super(msg); + } + + public CalendarTestException(String msg, Throwable t) { + super(msg, t); + } +}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/java/util/Calendar/CalendarTestScripts/Exceptions.java Thu Apr 18 03:46:32 2019 +0100 @@ -0,0 +1,46 @@ +/* + * Copyright (c) 2007, 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +import java.util.HashMap; +import java.util.Locale; +import java.util.Map; + +public class Exceptions { + private static Map<String, Class> exceptions = new HashMap<String, Class>(); + + static { + put("nullpointerexception", NullPointerException.class); + put("illegalargumentexception", IllegalArgumentException.class); + } + + private static void put(String key, Class clazz) { + Class c = exceptions.put(key, clazz); + if (c != null) { + throw new RuntimeException(key + " already exisits"); + } + } + + public static Class get(String key) { + return exceptions.get(key.toLowerCase(Locale.ROOT)); + } +}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/java/util/Calendar/CalendarTestScripts/GregorianAdapter.java Thu Apr 18 03:46:32 2019 +0100 @@ -0,0 +1,125 @@ +/* + * Copyright (c) 2007, 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +import java.util.GregorianCalendar; +import java.util.Locale; +import java.util.TimeZone; + +public class GregorianAdapter extends GregorianCalendar { + static final int ALL_FIELDS = (1 << FIELD_COUNT) - 1; + + public GregorianAdapter() { + super(); + } + + public GregorianAdapter(TimeZone tz) { + super(tz); + } + + public GregorianAdapter(Locale loc) { + super(loc); + } + + public GregorianAdapter(TimeZone tz, Locale loc) { + super(tz, loc); + } + + public void computeTime() { + super.computeTime(); + } + + public void computeFields() { + super.computeFields(); + } + + public void complete() { + super.complete(); + } + + StringBuffer msg = new StringBuffer(); + + void initTest() { + msg = new StringBuffer(); + } + + String getMessage() { + String s = msg.toString(); + msg = new StringBuffer(); + return " " + s; + } + + void setMessage(String msg) { + this.msg = new StringBuffer(msg); + } + + void appendMessage(String msg) { + this.msg.append(msg); + } + + boolean getStatus() { + return msg.length() == 0; + } + + int getSetStateFields() { + int mask = 0; + for (int i = 0; i < FIELD_COUNT; i++) { + if (isSet(i)) { + mask |= 1 << i; + } + } + return mask; + } + + int[] getFields() { + int[] fds = new int[fields.length]; + System.arraycopy(fields, 0, fds, 0, fds.length); + return fds; + } + + boolean checkInternalDate(int year, int month, int dayOfMonth) { + initTest(); + checkInternalField(YEAR, year); + checkInternalField(MONTH, month); + checkInternalField(DAY_OF_MONTH, dayOfMonth); + return getStatus(); + } + + boolean checkInternalDate(int year, int month, int dayOfMonth, int dayOfWeek) { + initTest(); + checkInternalField(YEAR, year); + checkInternalField(MONTH, month); + checkInternalField(DAY_OF_MONTH, dayOfMonth); + checkInternalField(DAY_OF_WEEK, dayOfWeek); + return getStatus(); + } + + boolean checkInternalField(int field, int expectedValue) { + int val; + if ((val = internalGet(field)) != expectedValue) { + appendMessage("internalGet(" + CalendarAdapter.FIELD_NAMES[field] + "): got " + val + + ", expected " + expectedValue + "; "); + return false; + } + return true; + } +}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/java/util/Calendar/CalendarTestScripts/JapaneseRollDayOfWeekTestGenerator.java Thu Apr 18 03:46:32 2019 +0100 @@ -0,0 +1,131 @@ +/* + * Copyright (c) 2007, 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +import java.io.PrintWriter; +import java.nio.file.Path; +import java.nio.file.Paths; +import java.util.GregorianCalendar; +import java.util.Locale; +import static java.util.Calendar.*; + + +public class JapaneseRollDayOfWeekTestGenerator { + private static final String[] ERAS = { + "BeforeMeiji", "Meiji", "Taisho", "Showa", "Heisei" + }; + + private static final String[] DAYOFWEEK = { + null, "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat" + }; + + private static final int[] DAYOFMONTH = { + 25, 26, 27, 28, 29, 30, 31, + 1, 2, 3, 4, 5, 6, 7 + }; + + private static final int DOM_BASE = 7; + + //Usage: JapaneseRollDayOfWeekTestGenerator will generate test script into + // file rolldow.cts. + public static void generateTestScript(String[] args) throws Exception{ + Locale.setDefault(Locale.ROOT); + + //This test generator assumes that Heisei has (nYears - 1) or more years. + int nYears = (args.length == 1) ? + Math.max(3, Math.min(Integer.parseInt(args[0]), 40)) : 28; + + // Start from Showa 63 + int era = 3; + int year = 63; + Path testPath = Paths.get(System.getProperty("test.classes")); + String scFileName = testPath + "/rolldow.cts"; + + try (PrintWriter out = new PrintWriter(scFileName)){ + out.println("locale ja JP JP\n" + "new instance jcal\n" + "use jcal"); + for (int y = 0; y < nYears; y++) { + out.printf("\nTest %s %d\n", ERAS[era], year); + for (int fdw = SUNDAY; fdw <= SATURDAY; fdw++) { + int endFdw = fdw + 6; + if (endFdw > SATURDAY) { + endFdw -= 7; + } + for (int mdifw = 1; mdifw <= 7; mdifw++) { + int domIndex = DOM_BASE; + out.println(" clear all"); + out.printf(" set FirstDayOfWeek %s\n", DAYOFWEEK[fdw]); + out.printf(" set MinimalDaysInFirstWeek %d\n", mdifw); + out.printf(" set date %s %d Jan 1\n", ERAS[era], year); + out.println(" get week_of_year\n" + " assign $result $woy"); + out.println(" get day_of_week\n" + " assign $result $doy"); + + int gyear = year + (year >= 60 ? 1925 : 1988); + int next = new GregorianCalendar(gyear, JANUARY, 1).get(DAY_OF_WEEK); + for (int i = 0; i < 10; i++) { + + out.println(" roll day_of_week 1"); + next = nextFdw(next, fdw, endFdw); + if (next == fdw) { + domIndex -= 6; + } else { + domIndex++; + } + int dom = DAYOFMONTH[domIndex]; + out.printf("\tcheck date %d %s %d%n", (dom >= 25) ? year - 1 : year, + (dom >= 25) ? "Dec" : "Jan", dom); + out.println("\teval $doy + 1"); + out.println("\tassign $result $doy"); + out.println("\tassign Sun $doy if $doy > Sat"); + out.println("\tcheck day_of_week $doy"); + out.println("\tcheck week_of_year $woy"); + } + + for (int i = 0; i < 10; i++) { + out.println("\troll day_of_week -1"); + out.println("\teval $doy - 1"); + out.println("\tassign $result $doy"); + out.println("\tassign Sat $doy if $doy < Sun"); + out.println("\tcheck day_of_week $doy"); + out.println("\tcheck week_of_year $woy"); + } + } + } + + if (year == 64 && era == 3) { + era++; + year = 2; + } else { + year++; + } + } + } + } + + private static int nextFdw(int x, int start, int end) { + if (x == end) + return start; + x++; + if (x > SATURDAY) + x = SUNDAY; + return x; + } +}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/java/util/Calendar/CalendarTestScripts/JapaneseRollTests.java Thu Apr 18 03:46:32 2019 +0100 @@ -0,0 +1,88 @@ +/* + * Copyright (c) 2018, 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 + * @summary tests Japanese Calendar. + * @bug 4609228 + * @modules java.base/sun.util + * java.base/sun.util.calendar + * @compile + * CalendarAdapter.java + * CalendarTestEngine.java + * CalendarTestException.java + * Exceptions.java + * GregorianAdapter.java + * Result.java + * Symbol.java + * Variable.java + * JapaneseRollDayOfWeekTestGenerator.java + * @run main/timeout=120/othervm JapaneseRollTests + */ + +import java.io.File; +import java.io.FilenameFilter; +import java.nio.file.Path; +import java.nio.file.Paths; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +public class JapaneseRollTests { + private static List<String> TZ_TEST_LIST = Arrays.asList( + "tz_japan.cts", "tz_pst.cts"); + private static Path srcPath = Paths.get(System.getProperty("test.src")); + private static Path testPath = Paths.get(System.getProperty("test.classes")); + + public static void main(String[] args) throws Throwable { + List<String> modeList = getFileNameList("params"); + //Test only 3 years by default + String[] jpyear ={"3"}; + JapaneseRollDayOfWeekTestGenerator.generateTestScript(jpyear); + + for (String tz : TZ_TEST_LIST) { + for(String mode:modeList){ + String[] ts = { srcPath + "/timezones/" + tz, + srcPath + "/params/" + mode, + testPath + "/rolldow.cts"}; + + CalendarTestEngine.main(ts); + } + } + } + + private static List<String> getFileNameList(String type ){ + List<String> fileList = new ArrayList<>(); + File dir = new File(srcPath + "/"+ type); + File[] testFiles = dir.listFiles(new FilenameFilter() { + public boolean accept(File dir, String name) { + return name.toLowerCase().endsWith(".cts"); + } + }); + for (File f:testFiles) { + fileList.add(f.getName()); + } + + return fileList; + } +}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/java/util/Calendar/CalendarTestScripts/JapaneseTests.java Thu Apr 18 03:46:32 2019 +0100 @@ -0,0 +1,100 @@ +/* + * Copyright (c) 2018, 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 + * @summary tests Japanese Calendar. + * @bug 4609228 + * @modules java.base/sun.util + * java.base/sun.util.calendar + * @compile + * CalendarAdapter.java + * CalendarTestEngine.java + * CalendarTestException.java + * Exceptions.java + * GregorianAdapter.java + * Result.java + * Symbol.java + * Variable.java + * @run main/othervm/timeout=120 JapaneseTests + */ + +import java.io.File; +import java.io.FilenameFilter; +import java.nio.file.Path; +import java.nio.file.Paths; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +public class JapaneseTests { + + private static List<String> SET_LENIENT = Arrays.asList( + "japanese_minmax.cts", + "japanese_add.cts", + "japanese_roll.cts", + "japanese_exceptions.cts"); + private static List<String> DEFAULT_LENIENT = Arrays.asList( + "japanese.cts", + "japanese_normalization.cts"); + + private static Path srcPath = Paths.get(System.getProperty("test.src")); + + public static void main(String[] args) throws Throwable { + List<String> tzList = getFileNameList("timezones"); + List<String> modeList = getFileNameList("params"); + + for (String jaTest: DEFAULT_LENIENT) { + for (String tz : tzList) { + String[] ts = { srcPath + "/timezones/" + tz, + srcPath + "/japanese/" + jaTest}; + CalendarTestEngine.main(ts); + } + } + + for (String jaTest: SET_LENIENT) { + for (String tz : tzList) { + for (String mode : modeList) { + String[] ts = { srcPath + "/timezones/" + tz, + srcPath + "/params/" + mode, + srcPath + "/japanese/" + jaTest }; + CalendarTestEngine.main(ts); + } + } + } + } + + private static List<String> getFileNameList(String type ){ + List<String> fileList = new ArrayList<>(); + File dir = new File(srcPath + "/"+ type); + File[] testFiles = dir.listFiles(new FilenameFilter() { + public boolean accept(File dir, String name) { + return name.toLowerCase().endsWith(".cts"); + } + }); + for (File f:testFiles) { + fileList.add(f.getName()); + } + return fileList; + } +}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/java/util/Calendar/CalendarTestScripts/README Thu Apr 18 03:46:32 2019 +0100 @@ -0,0 +1,566 @@ +Copyright (c) 2005, 2018, 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. + + CALENDAR TEST SCRIPT + + Masayoshi Okutsu + 2005-03-18 + +Introduction +------------ + +Calendar Test Script is a simple scripting language to describe test cases +for java.util.Calendar and its subclasses. It should be much more +productive to use this script language than writing test programs in Java. + +A script looks like below. + +1 locale ja JP JP +2 timezone Asia/Tokyo +3 new instance jcal +4 test day of week on Heisei 1 Jan 8 +5 use jcal +6 clear all +7 set date Heisei 1 Jan 8 +8 check day_of_week Sun + +The first line defines a Locale to be used for creating Calendar +instances. Line 2 defines the current TimeZone to be Asia/Tokyo that is +used creating Calendar instances. Line 3 creates a Calendar instance with +the Locale and TimeZone instances. Its reference name is `jcal'. Line 4 +indicates a start point for a test case with a short test case +description. Line 5 designates `jcal' as the current Calendar +instance. All calendar operation commands are applied to the current +Calendar instance. Line 6 clears all of the calendar fields (e.g., ERA, +YEAR, MONTH, etc.). Line 7 sets the ERA, YEAR, MONTH and DAY_OF_MONTH +fields to Heisei, 1, JANUARY and 8, respectively. Line 8 checks if the +DAY_OF_WEEK value is SUNDAY. If it's not, then a RuntimeException is +thrown. + +Script Grammar +-------------- + +A line is a comment, blank or command line. Any text after '#' is always +treated as a comment and ignored, like a shell script. + + # This is a comment line. + +A command line consists of a command and its parameters, optionally +followed by a comment. For example, + + set date Heisei 1 Jan 8 # The first day of Heisei + +`set' is a command to set `date' to Heisei year 1 January 8th. `Heisei' is +a constant for the Japanese Heisei era value which is consistent with the +Japanese imperial calendar implementation. `Jan' is a constant for +Calendar.SUNDAY. The text after '#' is ignored. + +Keywords are case-insensitive. + + set DAY_OF_WEEK MON + SET day_of_week Mon + +are the same thing. + +Lexical analysis is very simple. A command must be complete in a single +line. Keywords and symbols must be separated by white space. For example, +"$result+1" is parsed as one token. It must be written as "$result + 1". + +Variables +--------- + +Variables can be used in any context to store an integer value and are +referenced in any contexts where an integer value is required. A variable +name must start with a '$', such as `$maxyear'. The integer value is +handled as a long. + +`$result' is reserved for storing a result of a get commend operation. For +example, executing the following command: + + get day_of_month + +sets $result to the get(Calendar.DAY_OF_MONTH) value of the current +Calendar instance. (See NEW and USE commands for the current Calendar +instance.) + +Commands +-------- + +The following defines each command and its syntax. Keywords are described +in upper case below. + +LOCALE language [country [variant]] + + Creates a Locale instance by calling new Locale(language, country, + variant). country and variant are optional. Defining LOCALE overrides + the previously defined Locale value if any. The initial Locale value + is Locale.getDefault(). + +TIMEZONE tzid + + Creates a TimeZone instance by calling + TimeZone.getTimeZone(tzid). Defining TIMEZONE overrides the previously + defined Locale value if any. The initial TimeZone value is + TimeZone.getDefault(). + +NEW INSTANCE calendarname + + Creates a Calendar instance by calling Calendar.getInstance(TimeZone, + Locale). TimeZone and Locale are those defined by TIMEZONE and LOCALE + commands (or their initial values), respectively. The instance is + associated with `calendarname' and becomes the current Calendar + instance to be used for testing. + +NEW GREGORIAN calendarname + + Creates a Calendar instance by calling new GregorianCalendar(TimeZone, + Locale). TimeZone and Locale are those defined by TIMEZONE and LOCALE + commands (or their initial values), respectively. The instance is + associated with `calendarname' and becomes the current Calendar + instance to be used for testing. + +TEST [comments...] + + Declares the beginning of a test case. `comments...' gives a short + description of a test case. (Multiple lines are not supported.) The + test system displays `comments...' to System.out. For example, the + following command: + + test A test case for non-lenient mode + + will output: + + Test #n: A test case for non-lenient mode + + where `n' is a sequence number of TEST command lines appeared in a + test script file. + +USE calendarname + + Specifies the current Calendar instance to use for testing by + `calendarname'. If you need to use more than one Calendar instances, + then you have to switch those Calendar instances by the USE command. + +ASSIGN value variable + + Assigns `value' to `variable'. `value' can be an integer literal, a + variable name or a constant. Examples are: + + assign 2005 $year + assign $result $temp + assign Sun $Microsystems + +ASSIGN value variable IF condition + + Assigns `value' to `variable' if `condition' is true. `condition' is a + relational expression as: + + value1 relOp value2 + + `relOp' must be one of >, >=, ==, !=, <=, <. + +EVAL expression + + Evaluates the given *simple* expression and assigns the expression + value to $result if `op' is one of the arithmetic operators (+, -, *, + /, %). If `op' is one of the relational operators (>, >=, ==, !=, <=, + <), then EVAL throws an exception if the expression value is false, or + does nothing if the value is true. Note that an operator and values + must be separated by white space. + + The following is an example of the ASSIGN and EVAL commands usage to + get the next day of week value. Then, it's used to check the + roll(DAY_OF_WEEK) result. + + get day_of_week + eval $result + 1 + assign $result $nextDayOfWeek + assign Sun $nextDayOfWeek if $nextDayOfWeek > Sat + roll day_of_week 1 + check day_of_week $nextDayOfWeek + +CLEAR ALL + + Clears all the calendar fields of the current Calendar instance by + calling Calendar.clear(). + +CLEAR field + + Clears the specified calendar `field' of the current Calendar instance + by calling Calendar.clear(field).`field' must be one of the Calendar + field indices, ERA, YEAR, MONTH, DAY_OF_MONTH, WEEK_OF_YEAR, etc. + +GET MILLIS + + Gets the millisecond value of the current Calendar instance by calling + Calendar.getTimeInMillis(). The value is assigned to $result. + +GET field + + Gets the `field' value specified of the current Calendar instance by + calling Calendar.get(field). The value is assigned to $result. + +GET MIN field + + Gets the minimum value of the specified `field' of the current + Calendar instance by calling Calendar.getMinimum(field). The value is + assigned to $result. + +GET GREATESTMIN field + + Gets the greatest minimum value of the specified `field' of the + current Calendar instance by calling + Calendar.getGreatestMinimum(field). The value is assigned to $result. + +GET ACTUALMIN field + + Gets the actual minimum value of the specified `field' of the current + Calendar instance by calling Calendar.getActualMinimum(field). The + value is assigned to $result. + +GET MAX field + + Gets the maximum value of the specified `field' of the current + Calendar instance by calling Calendar.getMaximum(field). The value is + assigned to $result. + +GET LEASTMAX field + + Gets the least maximum value of the specified `field' of the current + Calendar instance by calling Calendar.getLeastMaximum(field). The + value is assigned to $result. + +GET ACTUALMAX field + + Gets the actual maximum value of the specified `field' of the current + Calendar instance by calling Calendar.getActualMaximum(field). The + value is assigned to $result. + +GET FIRSTDAYOFWEEK + + Gets the first day of week value of the current Calendar instance by + calling Calendar.getFirstDayOfWeek(). The value is assigned to + $result. + +GET MINIMALDAYSINFIRSTWEEK + + Gets the minimal days in first week value of the current Calendar + instance by calling Calendar.getMinimalDaysInFirstWeek(). The value is + assigned to $result. + +ADD field amount + + Adds `amount' to the specified `field' of the current Calendar + instance by calling Calendar.add(field, amount). + +ROLL field amount + + Rolls `amount' of the specified `field' of the current Calendar + instance by calling Calendar.roll(field, amount). + +SET MILLIS value + + Sets the millisecond value of the current Calendar instance to `value' + by calling Calendar.setTimeInMillis(value). + +SET field value + + Sets the `field' value of the current Calendar instance to `value' by + calling Calendar.set(field, value). + +SET DATE era year month dayOfMonth + + Sets the date of the current Calendar instance to the date specified + by `era', `year', `month' and `dayOfMonth' by calling + Calendar.set(ERA, era) and Calendar.set(year, month, + dayOfMonth). Please note that `month' follows the Calendar convention + and is 0-based. (e.g., JANUARY is 0) + +SET DATE year month dayOfMonth + + Sets the date of the current Calendar instance to the date specified + by `year', `month' and `dayOfMonth' by calling + Calendar.set(year, month, dayOfMont). Please note that `month' + follows the Calendar convention and is 0-based. (e.g., JANUARY is 0) + +SET DATETIME year month dayOfMonth hourOfDay minute second + + Sets the date and time of the current Calendar instance to the date + and time specified by `year', `month', `dayOfMonth', `hourOfDay', + `minute', and `second' by calling Calendar.set(year, month, + dayOfMonth, hourOfDay, minute, second). Please note that `hourOfDay' + is the 24-hour clock. + +SET TIMEOFDAY hourOfDay minute second millisecond + + Sets the date and time of the current Calendar instance to the date + and time specified by `year', `month', `dayOfMonth', `hourOfDay', + `minute', and `second' by calling Calendar.set(HOUR_OF_DAY, + hourOfDay), Calendar.set(MINUTE, minute), and Calendar.set(SECOND, + second). + +SET FIRSTDAYOFWEEK value + + Sets the first day of week value of the current Calendar instance to + `value' by calling Calendar.setFirstDayOfWeek(value). + +SET MINIMALDAYSINFIRSTWEEK value + + Sets the minimal days in the first week value of the current Calendar + instance to `value' by calling Calendar.setMinimalDaysInFirstWeek(value). + +SET LENIENT + + Sets the lenient mode in the current Calendar instance by calling + Calendar.setLenient(true). + +SET NON-LENIENT + + Sets the non-lenient mode in the current Calendar instance by calling + Calendar.setLenient(false). + +CHECK MILLIS value + + Checks if the specified `value' is the same as the millisecond value + of the current Calendar instance given by calling + Calendar.getTimeInMillis(). If the values are different, an exception + is thrown. + +CHECK DATE era year month dayOfMonth + + Checks if the date specified by `era', `year', `month' and + `dayOfMonth' is the same date of the current Calendar instance. The + calendar date is given by calling Calendar.get(ERA), + Calendar.get(YEAR), Calendar.get(MONTH), and + Calendar.get(DAY_OF_MONTH). If the dates are different, an exception + is thrown. + +CHECK DATE year month dayOfMonth + + Checks if the date specified by `year', `month' and `dayOfMonth' is + the same date of the current Calendar instance. The calendar date is + given by calling Calendar.get(YEAR), Calendar.get(MONTH), and + Calendar.get(DAY_OF_MONTH). If the dates are different, an exception + is thrown. + +CHECK DATETIME year month dayOfMonth hourOfDay minute second + + Checks if the date and time specified by `year', `month', + `dayOfMonth', `hourOfDay', `minute', and `second' are the same ones of + the current Calendar instance. The calendar date and time are given by + calling Calendar.get(YEAR), Calendar.get(MONTH), + Calendar.get(DAY_OF_MONTH), Calendar.get(HOUR_OF_DAY), + Calendar.get(MINUTE) and Calendar.get(SECOND). If the dates or times + are different, an exception is thrown. + +CHECK DATETIME year month dayOfMonth hourOfDay minute second millisecond + + Checks if the date and time specified by `year', `month', + `dayOfMonth', `hourOfDay', `minute', `second' and `millisecond' are + the same ones of the current Calendar instance. The calendar date and + time are given by calling Calendar.get(YEAR), Calendar.get(MONTH), + Calendar.get(DAY_OF_MONTH), Calendar.get(HOUR_OF_DAY), + Calendar.get(MINUTE), Calendar.get(SECOND) and + Calendar.get(MILLISECOND). If the dates or times are different, an + exception is thrown. + +CHECK TIMEOFDAY hourOfDay minute second millisecond + + Checks if the time of day specified by `hourOfDay', `minute', `second' + and `millisecond' are the same ones of the current Calendar + instance. The calendar date and time are given by calling + Calendar.get(HOUR_OF_DAY), Calendar.get(MINUTE), Calendar.get(SECOND) + and Calendar.get(MILLISECOND). If the times are different, an + exception is thrown. + +CHECK field value + + Checks if the value of the given `field' of the current Calendar + instance is equal to the given `value'. If it doesn't, an exception is + thrown. + +CHECK MIN field value + + Checks if the minimum value of the specified `field' of the current + Calendar instance is equal to the specified `value'. If not, an + exception is thrown. + +CHECK GREATESTMIN field value + + Checks if the greatest minimum value of the specified `field' of the + current Calendar instance is equal to the specified `value'. If not, + an exception is thrown. + +CHECK ACTUALMIN field value + + Checks if the actual minimum value of the specified `field' of the + current Calendar instance is equal to the specified `value'. If not, + an exception is thrown. + +CHECK MAX field value + + Checks if the maximum value of the specified `field' of the current + Calendar instance is equal to the specified `value'. If not, an + exception is thrown. + +CHECK LEASTMAX field value + + Checks if the least maximum value of the specified `field' of the + current Calendar instance is equal to the specified `value'. If not, + an exception is thrown. + +CHECK ACTUALMAX field value + + Checks if the actual maximum value of the specified `field' of the + current Calendar instance is equal to the specified `value'. If not, + an exception is thrown. + +EXCEPTION exceptionname + + Checks if the previous command threw the specified exception by + `exceptionname'. For example, the following tests invalid date + detection in non-lenient. + + set non-lenient + set date 2005 Feb 29 # 2005 isn't a leap year. + get millis + exception IllegalArgumentException + +PRINT variable + + Prints the value of `variable'. + +PRINT INSTANCE [calendarname] + + Prints the Calendar.toString() value of the current Calendar instance + or the instance given by `calendarname'. + +PRINT field + + Prints the value of the specified `field' of the current Calendar + instance. The value is obtained by calling Calendar.get(field). + +PRINT MILLIS + + Prints the millisecond value of the current Calendar instance. The + value is obtained by calling Calendar.getTimeInMillis(). + +PRINT MIN field + + Prints the minimum value of the specified field by `field' of the + current Calendar instance. The value is obtained by calling + Calendar.getMinimum(field). + +PRINT GREATESTMIN field + + Prints the greatest minimum value of the specified field by `field' of + the current Calendar instance. The value is obtained by calling + Calendar.getGreatestMinimum(field). + +PRINT ACTUALMIN field + + Prints the actual minimum value of the specified field by `field' of + the current Calendar instance by calling + Calendar.getActualMinimum(field). + +PRINT MAX field + + Prints the maximum value of the specified field by `field' of the + current Calendar instance. The value is obtained by calling + Calendar.getMaximum(field). + +PRINT LEASTMAX field + + Prints the least maximum value of the specified field by `field' of + the current Calendar instance. The value is obtained by calling + Calendar.getLeastMaximum(field). + +PRINT ACTUALMAX field + + Prints the actual maximum value of the specified field by `field' of + the current Calendar instance. The value is obtained by calling + Calendar.getActualMaximum(field). + +PRINT DATE + + Prints the date of the current Calendar instance in format + "[ERA] yyyy-MM-dd". The date is obtained by calling Calendar.get(ERA), + Calendar.get(YEAR), Calendar.get(MONTH), and + Calendar.get(DAY_OF_MONTH). + +PRINT DATETIME + + Prints the date and time of the current Calendar instance in an ISO + 8601-style format "[ERA] yyyy-MM-ddTHH:mm:ss.SSS{Z|{+|-}hhmm}". The + date and time are obtained by calling Calendar.get(ERA), + Calendar.get(YEAR), Calendar.get(MONTH), Calendar.get(DAY_OF_MONTH), + Calendar.get(HOUR_OF_DAY), Calendar.get(MINUTE), Calendar.get(SECOND), + Calendar.get(MILLISECOND), Calendar.get(ZONE_OFFSET), and + Calendar.get(DST_OFFSET). + +PRINT TIMEZONE + + Prints the toString() value of the current TimeZone. + +PRINT LOCALE + + Prints the toString() value of the current Locale. + +Usage +----- + +The usage of the test script system at this directory is: + + $ javac -d classes --add-exports java.base/sun.util=ALL-UNNAMED --add-exports java.base/sun.util.calendar=ALL-UNNAMED *.java + $ java -cp classes CalendarTestEngine scriptfiles... + +A script file has suffix ".cts" by convention. If multiple script files +are specified. Those files are sequentially executed as if those are a +single test script. For example, if we have the following script files: + + file1.cts: + locale ja JP JP + timezone Asia/Tokyo + file2.cts: + new instance jcal + new gregorian gcal + test example + use jcal + print datetime + get millis + print $result + use gcal + set millis $result + print datetime + +running CalendarTestEngine with those files will produce: + + $ java -cp classes CalendarTestEngine file1.cts file2.cts + Starting file1.cts... + Completed file1.cts + Starting file2.cts... + Test #1: example + file2.cts:5: Heisei 0017-03-18T20:00:25.402+0900 + file2.cts:7: $result=1111143625402 + file2.cts:10: 2005-03-18T20:00:25.402+0900 + Completed file2.cts + +[end of README]
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/java/util/Calendar/CalendarTestScripts/Result.java Thu Apr 18 03:46:32 2019 +0100 @@ -0,0 +1,53 @@ +/* + * Copyright (c) 2007, 2018, 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. + */ + +public class Result extends Variable { + private Exception e; + private int lineno; + + public Result() { + super("$result", 0); + put("$result", this); + } + + public void setLineno(int lineno) { + this.lineno = lineno; + } + + public int getLineno() { + return lineno; + } + + public void setException(Exception e) { + if (this.e != null) { + throw new RuntimeException("existing exception: " + e, e); + } + this.e = e; + } + + public Exception getException() { + Exception e = this.e; + this.e = null; + return e; + } +}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/java/util/Calendar/CalendarTestScripts/Symbol.java Thu Apr 18 03:46:32 2019 +0100 @@ -0,0 +1,328 @@ +/* + * Copyright (c) 2007, 2019, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + + +import java.util.HashMap; +import java.util.Locale; +import java.util.Map; + +import static java.util.Calendar.*; +import static java.util.GregorianCalendar.*; + +public class Symbol { + + private static Map<String, Symbol> symbols; + + String name; + Type type; + int value; + boolean isArithmetic; + + private Symbol(Type type, Integer value) { + this(type, value, false); + } + + private Symbol(Type type) { + this(type, null, false); + } + + private Symbol(Type type, boolean isArithmetic) { + this(type, null, isArithmetic); + } + + private Symbol(Type type, Integer value, boolean isArithmetic) { + this.name = type.toString().toLowerCase(Locale.ROOT); + this.type = type; + if (value != null) + this.value = value; + this.isArithmetic = isArithmetic; + } + + public int value() { + return value; + } + + public String toString() { + return type.name(); + } + + public boolean isArithmetic() { + return isArithmetic; + } + + public static Symbol get(String s) { + return symbols.get(s); + } + + public static enum Type { + // Directives + TEST, + // Commands + LOCALE, TIMEZONE, NEW, USE, ASSIGN, EVAL, + CLEAR, SET, GET, ADD, ROLL, CHECK, PRINT, EXCEPTION, + IF, + // Operands + INSTANCE, GREGORIAN, ALL, MILLIS, DATE, DATETIME, TIMEOFDAY, + LENIENT, NONLENIENT, + MINIMUM, GREATESTMINIMUM, ACTUALMINIMUM, + MAXIMUM, LEASTMAXIMUM, ACTUALMAXIMUM, + FIRSTDAYOFWEEK, MINIMALDAYSINFIRSTWEEK, + // Arithmetic operators + PLUS, MINUS, MULTIPLY, DIVIDE, MOD, + // Relational operators + GT, GE, EQ, NEQ, LE, LT, + // Calendar field indices + FIELD, + // Day of week + DAYOFWEEK, + // Month + MONTH, + // AM/PM + AMPM, + // Era values + ERA; + } + + private static final void put(String key, Symbol sym) { + Symbol s = symbols.put(key, sym); + if (s != null) { + throw new RuntimeException("duplicated key: " + key); + } + } + + static { + symbols = new HashMap<String, Symbol>(); + Symbol sym; + // Directives + put("test", new Symbol(Type.TEST)); + + // Commands + put("locale", new Symbol(Type.LOCALE)); + sym = new Symbol(Type.TIMEZONE); + put("tz", sym); + put("timezone", sym); + put("new", new Symbol(Type.NEW)); + put("use", new Symbol(Type.USE)); + put("assign", new Symbol(Type.ASSIGN)); + put("eval", new Symbol(Type.EVAL)); + put("clear", new Symbol(Type.CLEAR)); + put("set", new Symbol(Type.SET)); + put("get", new Symbol(Type.GET)); + put("add", new Symbol(Type.ADD)); + put("roll", new Symbol(Type.ROLL)); + put("check", new Symbol(Type.CHECK)); + put("print", new Symbol(Type.PRINT)); + put("exception", new Symbol(Type.EXCEPTION)); + put("throw", get("exception")); + put("if", new Symbol(Type.IF)); + + // Operands + put("instance", new Symbol(Type.INSTANCE)); + put("gregorian", new Symbol(Type.GREGORIAN)); + put("all", new Symbol(Type.ALL)); + put("millis", new Symbol(Type.MILLIS)); + put("date", new Symbol(Type.DATE)); + put("datetime", new Symbol(Type.DATETIME)); + put("timeofday", new Symbol(Type.TIMEOFDAY)); + put("lenient", new Symbol(Type.LENIENT)); + sym = new Symbol(Type.NONLENIENT); + put("non-lenient", sym); + put("nonlenient", sym); + put("firstdayofweek", new Symbol(Type.FIRSTDAYOFWEEK)); + put("minimaldaysinfirstweek", new Symbol(Type.MINIMALDAYSINFIRSTWEEK)); + + sym = new Symbol(Type.MINIMUM); + put("minimum", sym); + put("min", sym); + sym = new Symbol(Type.GREATESTMINIMUM); + put("greatestminimum", sym); + put("greatestmin", sym); + sym = new Symbol(Type.ACTUALMINIMUM); + put("actualminimum", sym); + put("actualmin", sym); + sym = new Symbol(Type.MAXIMUM); + put("maximum", sym); + put("max", sym); + sym = new Symbol(Type.LEASTMAXIMUM); + put("leastmaximum", sym); + put("leastmax", sym); + sym = new Symbol(Type.ACTUALMAXIMUM); + put("actualmaximum", sym); + put("actualmax", sym); + + // Arithmetic operators + put("+", new Symbol(Type.PLUS, true)); + put("-", new Symbol(Type.MINUS, true)); + put("*", new Symbol(Type.MULTIPLY, true)); + put("/", new Symbol(Type.DIVIDE, true)); + put("%", new Symbol(Type.MOD, true)); + + // Relational operators + put(">", new Symbol(Type.GT, false)); + put(">=", new Symbol(Type.GE, false)); + put("==", new Symbol(Type.EQ, false)); + put("!=", new Symbol(Type.NEQ, false)); + put("<=", new Symbol(Type.LE, false)); + put("<", new Symbol(Type.LT, false)); + + // Calendar Fields + put("era", new Symbol(Type.FIELD, ERA)); + put("year", new Symbol(Type.FIELD, YEAR)); + put("month", new Symbol(Type.FIELD, MONTH)); + sym = new Symbol(Type.FIELD, WEEK_OF_YEAR); + put("week_of_year", sym); + put("weekofyear", sym); + put("woy", sym); + sym = new Symbol(Type.FIELD, WEEK_OF_MONTH); + put("week_of_month", sym); + put("weekofmonth", sym); + put("wom", sym); + sym = new Symbol(Type.FIELD, DAY_OF_MONTH); + put("day_of_month", sym); + put("dayofmonth", sym); + put("dom", sym); + sym = new Symbol(Type.FIELD, DAY_OF_YEAR); + put("day_of_year", sym); + put("dayofyear", sym); + put("doy", sym); + + sym = new Symbol(Type.FIELD, DAY_OF_WEEK); + put("day_of_week", sym); + put("dayofweek", sym); + put("dow", sym); + sym = new Symbol(Type.FIELD, DAY_OF_WEEK_IN_MONTH); + put("day_of_week_in_month", sym); + put("dayofweekinmonth", sym); + put("dowim", sym); + sym = new Symbol(Type.FIELD, AM_PM); + put("am_pm", sym); + put("ampm", sym); + put("hour", new Symbol(Type.FIELD, HOUR)); + sym = new Symbol(Type.FIELD, HOUR_OF_DAY); + put("hour_of_day", sym); + put("hourofday", sym); + put("hod", sym); + put("minute", new Symbol(Type.FIELD, MINUTE)); + put("second", new Symbol(Type.FIELD, SECOND)); + put("millisecond", new Symbol(Type.FIELD, MILLISECOND)); + sym = new Symbol(Type.FIELD, ZONE_OFFSET); + put("zone_offset", sym); + put("zoneoffset", sym); + put("zo", sym); + sym = new Symbol(Type.FIELD, DST_OFFSET); + put("dst_offset", sym); + put("dstoffset", sym); + put("do", sym); + + // Day of week + sym = new Symbol(Type.DAYOFWEEK, SUNDAY); + put("sunday", sym); + put("sun", sym); + sym = new Symbol(Type.DAYOFWEEK, MONDAY); + put("monday", sym); + put("mon", sym); + sym = new Symbol(Type.DAYOFWEEK, TUESDAY); + put("tuesday", sym); + put("tue", sym); + sym = new Symbol(Type.DAYOFWEEK, WEDNESDAY); + put("wednesday", sym); + put("wed", sym); + sym = new Symbol(Type.DAYOFWEEK, THURSDAY); + put("thursday", sym); + put("thu", sym); + sym = new Symbol(Type.DAYOFWEEK, FRIDAY); + put("friday", sym); + put("fri", sym); + sym = new Symbol(Type.DAYOFWEEK, SATURDAY); + put("saturday", sym); + put("sat", sym); + + + // Month + sym = new Symbol(Type.MONTH, JANUARY); + put("january", sym); + put("jan", sym); + sym = new Symbol(Type.MONTH, FEBRUARY); + put("february", sym); + put("feb", sym); + sym = new Symbol(Type.MONTH, MARCH); + put("march", sym); + put("mar", sym); + sym = new Symbol(Type.MONTH, APRIL); + put("april", sym); + put("apr", sym); + sym = new Symbol(Type.MONTH, MAY); + put("may", sym); + sym = new Symbol(Type.MONTH, JUNE); + put("june", sym); + put("jun", sym); + sym = new Symbol(Type.MONTH, JULY); + put("july", sym); + put("jul", sym); + sym = new Symbol(Type.MONTH, AUGUST); + put("august", sym); + put("aug", sym); + sym = new Symbol(Type.MONTH, SEPTEMBER); + put("september", sym); + put("sep", sym); + sym = new Symbol(Type.MONTH, OCTOBER); + put("octobwe", sym); + put("oct", sym); + sym = new Symbol(Type.MONTH, NOVEMBER); + put("november", sym); + put("nov", sym); + sym = new Symbol(Type.MONTH, DECEMBER); + put("december", sym); + put("dec", sym); + sym = new Symbol(Type.MONTH, UNDECIMBER); + put("undecimber", sym); + + // AM/PM + put("am", new Symbol(Type.AMPM, AM)); + put("pm", new Symbol(Type.AMPM, PM)); + + // Eras + + // Julian eras + sym = new Symbol(Type.ERA, BC); + put("bc", sym); + put("bce", sym); + sym = new Symbol(Type.ERA, AD); + put("ad", sym); + put("ce", sym); + + // Buddhist era + put("be", new Symbol(Type.ERA, 1)); + + // Japanese imperial eras + sym = new Symbol(Type.ERA, 0); + put("before_meiji", sym); + put("beforemeiji", sym); + put("meiji", new Symbol(Type.ERA, 1)); + put("taisho", new Symbol(Type.ERA, 2)); + put("showa", new Symbol(Type.ERA, 3)); + put("heisei", new Symbol(Type.ERA, 4)); + put("reiwa", new Symbol(Type.ERA, 5)); + + } +}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/java/util/Calendar/CalendarTestScripts/Variable.java Thu Apr 18 03:46:32 2019 +0100 @@ -0,0 +1,76 @@ +/* + * Copyright (c) 2007, 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +import java.util.HashMap; +import java.util.Locale; +import java.util.Map; + +public class Variable { + private static Map<String,Variable> vars = new HashMap<String,Variable>(); + + private String name; + private long value; + + Variable(String name, long value) { + this.name = name; + this.value = value; + } + + public String getName() { + return name; + } + + public int intValue() { + if (value > Integer.MAX_VALUE || value < Integer.MIN_VALUE) { + throw new RuntimeException("Overflow/Underflow: " + value); + } + return (int) value; + } + + public long longValue() { + return value; + } + + public void setValue(int v) { value = v; } + public void setValue(long v) { value = v; } + + // static methods + + public static Variable newVar(String name, long value) { + if (name.charAt(0) != '$') { + throw new RuntimeException("wrong var name: " + name); + } + String s = name.toLowerCase(Locale.ROOT); + Variable v = new Variable(name, value); + put(name, v); + return v; + } + + static void put(String s, Variable var) { + vars.put(s, var); + } + + public static Variable get(String name) { + return vars.get(name); + } +}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/java/util/Calendar/CalendarTestScripts/japanese/japanese.cts Thu Apr 18 03:46:32 2019 +0100 @@ -0,0 +1,331 @@ +# +# +# + +locale ja JP JP +new instance jcal +new gregorian gcal + +test Default dates + # Default for all unset fields + # 1970-01-01T00:00:00.000 local time (Gregorian) + # which is equivalent to Showa 45. + use gcal + clear all + get millis + # get the default milliseconds from the Epoch. It's time zone + # dependent. + assign $result $defmillis + use jcal + clear all + get millis + eval $result == $defmillis + check era Showa + check datetime 45 Jan 1 0 0 0 + check millisecond 0 + + # If each era is set, then January 1 of each Gan-nen is the + # default. + clear all + set era BeforeMeiji + check era BeforeMeiji + check datetime 1 Jan 1 0 0 0 + check millisecond 0 + + clear all + set era Meiji + check era Meiji + check datetime 1 Jan 1 0 0 0 + check millisecond 0 + + clear all + set era Taisho + check era Meiji + check datetime 45 Jan 1 0 0 0 + check millisecond 0 + + clear all + set era Showa + check era Taisho + check datetime 15 Jan 1 0 0 0 + check millisecond 0 + + clear all + set era Heisei + check era Showa + check datetime 64 Jan 1 0 0 0 + check millisecond 0 + + clear all + set era Reiwa + check era Heisei + check datetime 31 Jan 1 0 0 0 + check millisecond 0 + +# +# Field resolution tests +# + clear all + get firstdayofweek + # The test cases below assume that the first day of week is + # Sunday. So we should make sure it is. + eval $result == Sun + assign $result $fdow + +test Field resolution: YEAR + MONTH + WEEK_OF_MONTH + DAY_OF_WEEK + set era Showa + set year 64 + set week_of_month 1 + check day_of_week $fdow + check date 64 Jan 1 + + clear all + set era Showa + set year 64 + set week_of_month 1 + set day_of_week Thu + check era Showa + check day_of_week Thu + check date 64 Jan 5 + + clear all + # Heise 1 January and Showa 64 January are the same month. Its + # first week should be the same week. (January is the default + # month.) + set era Heisei + set year 1 + set week_of_month 1 + check day_of_week $fdow + check era Showa + check date 64 Jan 1 + + # Test aggregation + clear all + set date Heisei 17 Mar 16 + set week_of_month 1 + set day_of_week Tue + check date Heisei 17 Mar 1 + + clear all + set week_of_month 1 + set date Heisei 17 Mar 16 + set day_of_week Tue + check date Heisei 17 Mar 1 + + clear all + set day_of_week Tue + set date Heisei 17 Mar 16 + set week_of_month 1 + check date Heisei 17 Mar 1 + + clear all + set day_of_week Tue + set date Heisei 17 Mar 16 + set week_of_year 10 + set week_of_month 1 + check date Heisei 17 Mar 1 + + clear all + set day_of_week Tue + set date Heisei 17 Mar 16 + set day_of_year 300 + set week_of_month 1 + check date Heisei 17 Mar 1 + +test Field resolution: YEAR + MONTH + DAY_OF_WEEK_IN_MONTH + DAY_OF_WEEK + clear all + set era Meiji + set year 45 + set month Jul + set day_of_week_in_month 5 + set day_of_week Mon + check date Meiji 45 Jul 29 + + clear all + set era Meiji + set year 45 + set month Jul + set day_of_week_in_month 4 + check date Meiji 45 Jul 28 + + clear all + set era Meiji + set year 45 + set month Jul + set day_of_week_in_month 5 + set day_of_week Tue + check date Taisho 1 Jul 30 + + clear all + set era Taisho + set year 1 + set month Jul + set day_of_week_in_month 1 + set day_of_week Tue + check date Meiji 45 Jul 2 + + # Test aggregation + clear all + set date Heisei 17 Mar 16 + set day_of_week_in_month 1 + set day_of_week Wed + check date Heisei 17 Mar 2 + + clear all + set day_of_week_in_month 1 + set date Heisei 17 Mar 16 + set day_of_week Wed + check date Heisei 17 Mar 2 + + clear all + set day_of_week Wed + set date Heisei 17 Mar 16 + set day_of_week_in_month 1 + check date Heisei 17 Mar 2 + + clear all + set day_of_week Wed + set date Heisei 17 Mar 16 + set week_of_month 4 + set day_of_week_in_month 1 + check date Heisei 17 Mar 2 + + clear all + set day_of_week Wed + set date Heisei 17 Mar 16 + set day_of_year 365 + set day_of_week_in_month 1 + check date Heisei 17 Mar 2 + + clear all + set day_of_week Wed + set date Heisei 17 Mar 16 + set week_of_year 50 + set day_of_week_in_month 1 + check date Heisei 17 Mar 2 + +test Field resolution: YEAR + DAY_OF_YEAR + clear all + set era Showa + set year 64 + set day_of_year 7 + check date Showa 64 Jan 7 + + clear all + set era Showa + set year 64 + set day_of_year 10 + check date Heisei 1 Jan 10 + + clear all + set era Showa + set year 64 + check date Showa 64 Jan 1 + check day_of_year 1 + + clear all + set era Heisei + set year 1 + set day_of_year 10 + check date Heisei 1 Jan 17 + + clear all + set era Heisei + set year 1 + set day_of_year 1 + check date Heisei 1 Jan 8 + + clear all + set era Heisei + set year 1 + set day_of_year -1 + check date Showa 64 Jan 6 + + clear all + set date Heisei 17 Mar 16 + set day_of_year 31 + check date Heisei 17 Jan 31 + + clear all + set date Heisei 17 Mar 16 + set week_of_year 50 + set day_of_week Wed + set day_of_year 31 + check date Heisei 17 Jan 31 + + clear all + set date Heisei 17 Mar 16 + set week_of_month 5 + set day_of_week Wed + set day_of_year 31 + check date Heisei 17 Jan 31 + +test Field resolution: YEAR + DAY_OF_WEEK + WEEK_OF_YEAR + clear all + set era Showa + set year 64 + set week_of_year 1 + check day_of_week $fdow + check date 64 Jan 1 + + clear all + set era Showa + set year 64 + set week_of_year 1 + set day_of_week Wed + check date Showa 64 Jan 4 + + clear all + set era Heisei + set year 1 + set week_of_year 1 + check day_of_week $fdow + check date 1 Jan 8 + + clear all + set date Heisei 17 Mar 16 + set week_of_year 2 + set day_of_week Thu + check date Heisei 17 Jan 6 + + clear all + set week_of_year 2 + set date Heisei 17 Mar 16 + set day_of_week Thu + check date Heisei 17 Jan 6 + + clear all + set day_of_week Thu + set date Heisei 17 Mar 16 + set week_of_year 2 + check date Heisei 17 Jan 6 + +test zone offsets + # Tests here depend on the GMT offset. + timezone GMT+09:00 + new instance cal0900 + use cal0900 + clear all + set date Heisei 17 Mar 12 + get millis + assign $result $H17Mar12 + clear all + set date Heisei 17 Mar 12 + set zone_offset 0 + get millis + eval $result - 32400000 # -9 hours + eval $result == $H17Mar12 + + clear all + set date Heisei 17 Mar 12 + set zone_offset 28800000 # 8 hours + set dst_offset 3600000 # 1 hour + get millis + eval $result == $H17Mar12 + + clear all + set date Heisei 17 Mar 12 + set zone_offset 18000000 # 5 hours + set dst_offset 14400000 # 4 hours + get millis + eval $result == $H17Mar12
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/java/util/Calendar/CalendarTestScripts/japanese/japanese_add.cts Thu Apr 18 03:46:32 2019 +0100 @@ -0,0 +1,521 @@ +# +# %i% +# + +# The test cases in this file assume the first day of week is Sunday +# and the minimal days in the first week is 1. + +locale ja JP JP +new instance jcal + +timezone Asia/Tokyo +new instance tokyocal + +set non-lenient + +test add ERA + use jcal + clear all + set date Reiwa 17 Mar 8 + add era 10 + # as of Reiwa 17 March 8 + check era Reiwa + add era -100 + check era BeforeMeiji + +test add HOUR_OF_DAY + use jcal + clear all + set era Heisei + set datetime 1 Jan 8 23 59 59 + add hour_of_day 1 + check datetime 1 Jan 9 0 59 59 + check ampm AM + check hour 0 + add hour_of_day -1 + check datetime 1 Jan 8 23 59 59 + add hour_of_day 24 + check datetime 1 Jan 9 23 59 59 + add hour_of_day -24 + check datetime 1 Jan 8 23 59 59 + +test add HOUR + use jcal + clear all + set era Showa + set datetime 64 Jan 7 11 59 59 + check era Showa + check hour 11 + check ampm AM + add hour 1 + check hour 0 + check ampm PM + check datetime 64 Jan 7 12 59 59 + add hour -1 + check datetime 64 Jan 7 11 59 59 + add hour 240 + check era Heisei + check datetime 1 Jan 17 11 59 59 + add hour -240 + check era Showa + check datetime 64 Jan 7 11 59 59 + + clear all + set era Showa + set datetime 64 Jan 7 23 59 59 + check era Showa + check hour 11 + check ampm PM + add hour 1 + check hour 0 + check ampm AM + check era Heisei + check datetime 1 Jan 8 0 59 59 + add hour -1 + check datetime 64 Jan 7 23 59 59 + add hour 240 + check era Heisei + check datetime 1 Jan 17 23 59 59 + add hour -240 + check era Showa + check datetime 64 Jan 7 23 59 59 + + clear all + set era Heisei + set datetime 1 Jan 8 23 59 59 + check date Heisei 1 Jan 8 + check hour 11 + check ampm PM + add hour 1 + check hour 0 + check ampm AM + check era Heisei + check datetime 1 Jan 9 0 59 59 + add hour -1 + check datetime 1 Jan 8 23 59 59 + add hour 240 + check datetime 1 Jan 18 23 59 59 + add hour -240 + check datetime 1 Jan 8 23 59 59 + +test add YEAR + use jcal + clear all + # check if pinDayOfMonth works correctly. + # Heisei 12 (Y2K) is a leap year. + set date Heisei 12 Feb 29 + add year 5 + check date Heisei 17 Feb 28 + add year -5 + check date Heisei 12 Feb 28 # not 29! + + clear all + set date BeforeMeiji 1867 Jan 1 + add year 1 + check date Meiji 1 Jan 1 + add year -1 + check date BeforeMeiji 1867 Jan 1 + + clear all + set date Meiji 45 Jul 29 + add year 1 + check date Taisho 2 Jul 29 + add year -1 + check date Meiji 45 Jul 29 + + clear all + set date Meiji 44 Jul 30 + add year 1 + check date Taisho 1 Jul 30 + add year -1 + check date Meiji 44 Jul 30 + + clear all + set date Taisho 15 Aug 1 + add year 1 + check date Showa 2 Aug 1 + add year -1 + check date Taisho 15 Aug 1 + + clear all + set date Taisho 14 Dec 31 + add year 1 + check date Showa 1 Dec 31 + add year -1 + check date Taisho 14 Dec 31 + + clear all + set date Showa 63 Feb 1 + add year 1 + check date Heisei 1 Feb 1 + add year -1 + check date Showa 63 Feb 1 + + set date Showa 63 Dec 30 + add year 1 + check date Heisei 1 Dec 30 + add year -1 + check date Showa 63 Dec 30 + + set date Showa 64 Jan 7 + add year 1 + check date Heisei 2 Jan 7 + add year -1 + check date Showa 64 Jan 7 + + set date Heisei 2 Jan 7 + add year -1 + check date Showa 64 Jan 7 + add year 1 + check date Heisei 2 Jan 7 + +test add MONTH + clear all + # Check pinDayOfMonth works correctly. + # Heisei 12 is a leap year. + set date Heisei 12 Jan 31 + add month 1 + check date Heisei 12 Feb 29 + add month -1 + check date Heisei 12 Jan 29 + + # Another leap year + set date Showa 63 Jan 31 + add month 1 + check date Showa 63 Feb 29 + add month -1 + check date Showa 63 Jan 29 + + # Non leap year + set date Heisei 15 Jan 31 + add month 1 + check date Heisei 15 Feb 28 + add month -1 + check date Heisei 15 Jan 28 + + set date Heisei 15 Mar 31 + add month 1 + check date Heisei 15 Apr 30 + add month -1 + check date Heisei 15 Mar 30 + + set date Heisei 15 May 31 + add month 1 + check date Heisei 15 Jun 30 + add month -1 + check date Heisei 15 May 30 + + set date Heisei 15 Aug 31 + add month 1 + check date Heisei 15 Sep 30 + add month -1 + check date Heisei 15 Aug 30 + + set date Heisei 15 Oct 31 + add month 1 + check date Heisei 15 Nov 30 + add month -1 + check date Heisei 15 Oct 30 + + set date Heisei 15 Dec 31 + add month -1 + check date Heisei 15 Nov 30 + add month 1 + check date Heisei 15 Dec 30 + + set date Heisei 15 Dec 31 + add month 2 + check date Heisei 16 Feb 29 + add month -1 + check date Heisei 16 Jan 29 + + # end of pinDayOfMonth tests + + set date BeforeMeiji 1867 Dec 1 + add month 1 + check date Meiji 1 Jan 1 + add month -1 + check date BeforeMeiji 1867 Dec 1 + add month 14 + check date Meiji 2 Feb 1 + add month -14 + check date BeforeMeiji 1867 Dec 1 + + set date Meiji 1 Dec 1 + add month 1 + check date Meiji 2 Jan 1 + add month -1 + check date Meiji 1 Dec 1 + add month 13 + check date Meiji 3 Jan 1 + add month -13 + check date Meiji 1 Dec 1 + + set date Meiji 45 Jun 30 + add month 1 + check date Taisho 1 Jul 30 + add month -1 + check date Meiji 45 Jun 30 + + set date Meiji 45 Jun 30 + add month 14 + check date Taisho 2 Aug 30 + add month -14 + check date Meiji 45 Jun 30 + + # Taisho Gan-nen (year 1) has only 6 months. + set date Taisho 1 Jul 30 + add month -1 + check date Meiji 45 Jun 30 + add month 1 + check date Taisho 1 Jul 30 + add month -18 + check date Meiji 44 Jan 30 + add month 18 + check date Taisho 1 Jul 30 + + set date Taisho 15 Jan 20 + add month 11 + check date Taisho 15 Dec 20 + + set date Taisho 15 Jan 25 + add month 11 + check date Showa 1 Dec 25 + + set date Showa 1 Dec 25 + add month 1 + check date Showa 2 Jan 25 + add month -1 + check date Showa 1 Dec 25 + add month 17 + check date Showa 3 May 25 + add month -17 + check date Showa 1 Dec 25 + + set date Showa 64 Jan 7 + add month 1 + check date Heisei 1 Feb 7 + + set date Heisei 1 Feb 1 + add month -1 + # Heisei starts from Jan 8. + check date Showa 64 Jan 1 + add month 1 + check date Heisei 1 Feb 1 + + set date Heisei 1 Feb 8 + add month -1 + check date Heisei 1 Jan 8 + + set date Heisei 1 Dec 1 + add month 1 + check date Heisei 2 Jan 1 + add month -1 + check date Heisei 1 Dec 1 + + set date Heisei 1 Dec 8 + add month 1 + check date Heisei 2 Jan 8 + add month -1 + check date Heisei 1 Dec 8 + + # time zone dependent tests + use tokyocal + clear all + + set date BeforeMeiji 1 Jan 1 + get min year + assign $result $minyear + # actual min date: -292275055.05.17T01:47:04.192+0900 + + set date BeforeMeiji $minyear Dec 17 + set timeofday 1 47 4 192 + add month -7 + check date BeforeMeiji $minyear May 17 + check timeofday 1 47 4 192 + add month 7 + check date BeforeMeiji $minyear Dec 17 + check timeofday 1 47 4 192 + set date BeforeMeiji $minyear Dec 17 + set timeofday 1 47 4 191 + add month -7 + check date BeforeMeiji $minyear May 18 + check timeofday 1 47 4 191 + + set date Reiwa 17 Jan 1 + get max year + assign $result $max + set date Reiwa $max Jul 17 + add month 1 + check date Reiwa $max Aug 17 +# set date Heisei $max Jul 28 +# set timeofday 23 59 59 999 +# add month 1 +# check date Heisei $max Aug 16 +# check timeofday 23 59 59 999 + +test add WEEK_OF_YEAR + use jcal + clear all + # 1867 Dec 23 is Monday. + set date BeforeMeiji 1867 Dec 23 + add week_of_year 2 + check day_of_week Mon + check date Meiji 1 Jan 6 + add week_of_year -2 + check day_of_week Mon + check date BeforeMeiji 1867 Dec 23 + + # 1867 Dec 23 is Wednesday. + set date Meiji 1 Dec 23 + add week_of_year 2 + check day_of_week Wed + check date Meiji 2 Jan 6 + add week_of_year -2 + check day_of_week Wed + check date Meiji 1 Dec 23 + + # Meiji 45 July 23 is Tuesday. + set date Meiji 45 Jul 23 + add week_of_year 1 + check day_of_week Tue + check date Taisho 1 Jul 30 + add week_of_year -1 + check day_of_week Tue + check date Meiji 45 Jul 23 + + # Taisho 15 December 23 is Thursday. + set date Taisho 15 Dec 23 + add week_of_year 1 + check day_of_week Thu + check date Showa 1 Dec 30 + add week_of_year -1 + check day_of_week Thu + check date Taisho 15 Dec 23 + + # Showa Gan-nen December 30 is Thursday. Showa Gan-nen has + # only one week. Rolling any number of weeks brings to the + # same date. + set date Showa 1 Dec 30 + add week_of_year 1 + check day_of_week Thu + check date Showa 2 Jan 6 + add week_of_year -1 + check day_of_week Thu + check date Showa 1 Dec 30 + + # Showa 64 January 7 is Saturday. The year has only one week. + set date Showa 64 Jan 7 + add week_of_year 1 + check day_of_week Sat + check date Heisei 1 Jan 14 + add week_of_year -1 + check day_of_week Sat + check date Showa 64 Jan 7 + + use tokyocal + clear all + + set date BeforeMeiji $minyear Dec 25 + check day_of_week Sat + eval $minyear + 1 + assign $result $minyear_plus_1 + add week_of_year 1 + check day_of_week Sat + check date BeforeMeiji $minyear_plus_1 Jan 1 + add week_of_year -1 + check day_of_week Sat + check date BeforeMeiji $minyear Dec 25 + +test WEEK_OF_MONTH + use jcal + clear all + +test DAY_OF_MONTH + use jcal + clear all + +test DAY_OF_YEAR + use jcal + clear all + + # 1867 is a regular Gregorian year. + set date BeforeMeiji 1867 Dec 31 + add day_of_year 1 + check date Meiji 1 Jan 1 + add day_of_year -1 + check date BeforeMeiji 1867 Dec 31 + add day_of_year 26 + check date Meiji 1 Jan 26 + add day_of_year -26 + check date BeforeMeiji 1867 Dec 31 + + # Meiji 1 starts from Jan 1. It's a regular year as well. + set date Meiji 1 Dec 31 + add day_of_year 1 + check date Meiji 2 Jan 1 + add day_of_year -1 + check date Meiji 1 Dec 31 + add day_of_year 26 + check date Meiji 2 Jan 26 + add day_of_year -26 + check date Meiji 1 Dec 31 + + # The last year of Meiji (45) has an irregularity. Meiji 45 + # July 30 is actually Taisho 1 July 30. + set date Meiji 45 Jul 29 + add day_of_year 1 + check date Taisho 1 Jul 30 + add day_of_year -1 + check date Meiji 45 Jul 29 + + # The first day of Taisho, July 30. + set date Taisho 1 Jul 30 + add day_of_year -1 + check date Meiji 45 Jul 29 + add day_of_year 1 + check date Taisho 1 Jul 30 + + set date Taisho 15 Dec 24 + add day_of_year 1 + check date Showa 1 Dec 25 + add day_of_year -1 + check date Taisho 15 Dec 24 + + set date Showa 1 Dec 31 + add day_of_year 1 + check date Showa 2 Jan 1 + add day_of_year -1 + check date Showa 1 Dec 31 + add day_of_year 25 + check date Showa 2 Jan 25 + add day_of_year -25 + check date Showa 1 Dec 31 + + set date Showa 64 Jan 7 + add day_of_year 1 + check date Heisei 1 Jan 8 + add day_of_year -1 + check date Showa 64 Jan 7 + + set date Heisei 1 Dec 31 + add day_of_year 5 + check date Heisei 2 Jan 5 + add day_of_year -5 + check date Heisei 1 Dec 31 + + use tokyocal + clear all + + set date BeforeMeiji $minyear Dec 31 + set timeofday 1 47 4 192 + add day_of_year 1 + check date BeforeMeiji $minyear_plus_1 Jan 1 + check timeofday 1 47 4 192 + add day_of_year -1 + check date BeforeMeiji $minyear Dec 31 + check timeofday 1 47 4 192 + +test DAY_OF_WEEK_IN_MONTH + use jcal + clear all
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/java/util/Calendar/CalendarTestScripts/japanese/japanese_exceptions.cts Thu Apr 18 03:46:32 2019 +0100 @@ -0,0 +1,204 @@ +# +# +# + +locale ja JP JP + +# Use jcal in non-lenient mode for all test cases. +set non-lenient +new instance jcal + +use jcal +clear all + +test Invalid BeforeMeiji dates + set date BeforeMeiji 1868 Jan 1 + get millis + exception IllegalArgumentException + set date BeforeMeiji 1868 Jan 32 + get millis + exception IllegalArgumentException + set date BeforeMeiji 2005 Mar 9 + get millis + exception IllegalArgumentException + +test Invalid Meiji dates + set date Meiji -1 Jan 1 + get millis + exception IllegalArgumentException + set date Meiji 1 Feb 30 + get millis + exception IllegalArgumentException + set date Meiji 45 Jul 30 + get millis + exception IllegalArgumentException + set date Meiji 46 Jan 1 + get millis + exception IllegalArgumentException + +test Invalid Taisho dates + set date Taisho -1 Jan 1 + get millis + exception IllegalArgumentException + set date Taisho 1 Jan 1 + get millis + exception IllegalArgumentException + set date Taisho 1 Apr 1 + get millis + exception IllegalArgumentException + set date Taisho 15 Dec 30 + get millis + exception IllegalArgumentException + set date Taisho 15 Feb 29 + get millis + exception IllegalArgumentException + +test Invalid Showa dates + set date Showa -11 Jan 1 + get millis + exception IllegalArgumentException + set date Showa 1 Jan 1 + get millis + exception IllegalArgumentException + set date Showa 1 Jun 1 + get millis + exception IllegalArgumentException + set date Showa 1 Jul 29 + get millis + exception IllegalArgumentException + set date Showa 64 Jan 8 + get millis + exception IllegalArgumentException + set date Showa 64 Dec 8 + get millis + exception IllegalArgumentException + set date Showa 65 Jan 1 + get millis + exception IllegalArgumentException + +test Invalid Heisei dates + clear all + set date Heisei -1 Jan 1 + get millis + exception IllegalArgumentException + set date Heisei 1 Jan 1 + get millis + exception IllegalArgumentException + set date Heisei 1 Jan 7 + get millis + exception IllegalArgumentException + set date Heisei 1 Jan 8 + get max year + eval $result + 1 + set date Heisei $result Jan 1 + get millis + exception IllegalArgumentException + +test Invalid ERA + get max era + eval $result + 1 + set era $result # max era + 1 + get era + exception IllegalArgumentException + set era 100 + get era + exception IllegalArgumentException + set era -100 + get era + exception IllegalArgumentException + +test Invalid HOUR_OF_DAY + clear all + set date Heisei 17 Mar 14 + set hour_of_day 25 + get millis + exception IllegalArgumentException + set hour_of_day -9 + get millis + exception IllegalArgumentException + +test Invalid AMPM + clear all + set date Heisei 17 Mar 14 + set ampm -1 + set hour 1 + get millis + exception IllegalArgumentException + set ampm 5 + set hour 1 + get millis + exception IllegalArgumentException + +test Invalid HOUR + clear all + set date Heisei 17 Mar 14 + set ampm AM + set hour 13 + get millis + exception IllegalArgumentException + set ampm PM + set hour -1 + get millis + exception IllegalArgumentException + +test Invalid MINUTE + clear all + set date Heisei 17 Mar 14 + set minute 61 + get millis + exception IllegalArgumentException + set minute -2 + get millis + exception IllegalArgumentException + +test Invalid SECOND + clear all + set date Heisei 17 Mar 14 + set second 61 + get millis + exception IllegalArgumentException + set second -2 + get millis + exception IllegalArgumentException + +test Invalid MILLISECOND + clear all + set date Heisei 17 Mar 14 + set millisecond 1000 + get millis + exception IllegalArgumentException + set millisecond -2 + get millis + exception IllegalArgumentException + +test Invalid ZONE_OFFSET + clear all + set date Heisei 17 Mar 14 + set zone_offset -360000000 + get millis + exception IllegalArgumentException + set zone_offset -360000000 + get year + exception IllegalArgumentException + set zone_offset 360000000 + get millis + exception IllegalArgumentException + set zone_offset 360000000 + get year + exception IllegalArgumentException + +test Invalid DST_OFFSET + clear all + set date Heisei 17 Mar 14 + set dst_offset -360000000 + get millis + exception IllegalArgumentException + set dst_offset -360000000 + get year + exception IllegalArgumentException + set dst_offset 360000000 + get millis + exception IllegalArgumentException + set dst_offset 360000000 + get year + exception IllegalArgumentException
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/java/util/Calendar/CalendarTestScripts/japanese/japanese_minmax.cts Thu Apr 18 03:46:32 2019 +0100 @@ -0,0 +1,336 @@ +# +# +# + +locale ja JP JP +new instance jcal +new gregorian gcal + +# Use GMT+09:00 for max day of year test which depends on time zone +# offsets. + +timezone GMT+09:00 +new instance tokyocal + +test Make sure that the maximum year value doesn't depent on era + use jcal + # Note: the max year value is as of Reiwa + assign 292276976 $max + clear all + set date Reiwa 1 May 1 + get millis + check max year $max + assign $max $maxyear + + clear all + set date Heisei 20 May 5 + get millis + check max year $maxyear + + clear all + set date Showa 35 May 5 + get millis + check max year $maxyear + + clear all + set date BeforeMeiji 1 Jun 1 + get millis + check max year $max + +test Max of ERA + use jcal + # Assumption: Reiwa is the current era + check maximum era Reiwa + check leastmax era Reiwa + +test Actual max MONTH + use jcal + clear all + set date BeforeMeiji 1867 Jan 31 + check actualmax month Dec + # Make sure that the same value is returned after + # normalization. + get millis + check actualmax month Dec + + clear all + set date Meiji 45 Mar 31 + check actualmax month Jul + get millis + check actualmax month Jul + + clear all + set date Taisho 15 June 1 + check actualmax month Dec + get millis + check actualmax month Dec + + clear all + set date Showa 64 Jan 4 + check actualmax month Jan + get millis + check actualmax month Jan + + clear all + set date Heisei 31 Jan 4 + check actualmax month Apr + get millis + check actualmax month Apr + + clear all + set date Reiwa 2 Jan 1 + set year $maxyear + check actualmax month Aug + get millis + check actualmax month Aug + + clear all + set date 17 Mar 1 + check actualmax month Dec + get millis + check actualmax month Dec + +test Actual max DAY_OF_YEAR + use jcal + clear all + set date Meiji 1 Dec 31 + # Meiji Gan-nen is a leap year. + check actualmax day_of_year 366 + check day_of_year 366 + + clear all + set date Meiji 45 Jan 1 + # Meiji 45 or Taishi Gan-nen is also a leap year. + check actualmax day_of_year 211 # 31+29+31+30+31+30+29 + set date Meiji 45 Jul 29 + check day_of_year 211 + set date Taisho 1 Jul 31 + get millis + check actualmax day_of_year 155 # 366 - 211 + set date Taisho 1 Dec 31 + check day_of_year 155 + + clear all + set date Taisho 15 Sep 23 + check actualmax day_of_year 358 # 365 - 7 + set date Taisho 15 Dec 24 + check day_of_year 358 + set date Showa 1 Dec 25 + check actualmax day_of_year 7 + set date Showa 1 Dec 31 + check day_of_year 7 + + clear all + set date Showa 64 Jan 3 + check actualmax day_of_year 7 + set date Showa 64 Jan 7 + check day_of_year 7 + set date Heisei 1 Aug 9 + check actualmax day_of_year 358 # 365 - 7 + set date Heisei 1 Dec 31 + check day_of_year 358 + + # time zone dependent + use tokyocal + clear all + set date Reiwa $maxyear Jan 1 + # the last date of Reiwa is R292276976.08.17T16:12:55.807+0900 + check actualmax day_of_year 229 # 31+28+31+30+31+30+31+17 + +test Actual max WEEK_OF_YEAR + use jcal + clear all + set date Meiji 1 Jan 1 + # Meiji gan-nen is a leap year. + check actualmax week_of_year 52 + + clear all + set date Meiji 45 Jan 1 + check actualmax week_of_year 30 + set date Taisho 1 July 31 + check actualmax week_of_year 22 + + clear all + set date Taisho 15 Sep 23 + check actualmax week_of_year 51 + set date Showa 1 Dec 25 + check actualmax week_of_year 1 + + clear all + set date Showa 64 Jan 3 + check actualmax week_of_year 1 + set date Heisei 1 Aug 9 + check actualmax week_of_year 51 + + clear all + set date Heisei 31 Apr 28 + check actualmax week_of_year 17 + set date Reiwa 1 Aug 9 + check actualmax week_of_year 35 + + use tokyocal + set date Reiwa $maxyear Jan 1 + # the last date of Reiwa is R292276976.08.17T16:12:55.807+0900 (Sunday) + # The year is equivalent to 2003 (Gregorian). + check actualmax week_of_year 34 + +test Actual max WEEK_OF_MONTH + use jcal + clear all + set date Meiji 45 Jul 1 + check actualmax week_of_month 5 + set date Taisho 1 Jul 31 + check actualmax week_of_month 5 + + clear all + set date Taisho 15 Dec 1 + check actualmax week_of_month 5 + set date Showa 1 Dec 25 + check actualmax week_of_month 5 + + clear all + set date Showa 64 Jan 1 + check actualmax week_of_month 5 + set date Heisei 1 Jan 8 + check actualmax week_of_month 5 + + clear all + set date Heisei 31 Apr 30 + check actualmax week_of_month 5 + set date Reiwa 1 May 1 + check actualmax week_of_month 5 + + use tokyocal + set date Reiwa $maxyear Jan 1 + # the last date of Reiwa is R292276976.08.17T16:12:55.807+0900 (Sunday) + # The year is equivalent to 2003 (Gregorian). + check actualmax week_of_month 4 + +test Actual max DAY_OF_WEEK_IN_MONTH + use jcal + clear all + set date Meiji 45 Jul 1 + check actualmax week_of_month 5 + set date Taisho 1 Jul 31 + check actualmax week_of_month 5 + + clear all + set date Taisho 15 Dec 1 + check actualmax week_of_month 5 + set date Showa 1 Dec 25 + check actualmax week_of_month 5 + + clear all + set date Showa 64 Jan 1 + check actualmax week_of_month 5 + set date Heisei 1 Jan 8 + check actualmax week_of_month 5 + + clear all + set date Heisei 31 Apr 30 + check actualmax week_of_month 5 + set date Reiwa 1 May 1 + check actualmax week_of_month 5 + + use tokyocal + clear all + set date Reiwa $maxyear Jan 1 + # the last date of Reiwa is R292276976.08.17T16:12:55.807+0900 (Sunday) + # The year is equivalent to 2003 (Gregorian). + check actualmax week_of_month 4 + +test Actual max YEAR + use jcal + clear all + set date BeforeMeiji 1 Jan 1 + check actualmax year 1867 + + set date Meiji 1 Jan 1 + check actualmax year 45 + + set date Meiji 1 Jul 30 + check actualmax year 44 + + set date Taisho 1 Jul 30 + check actualmax year 15 + + set date Taisho 1 Dec 25 + check actualmax year 14 + + set date Showa 2 Jan 1 + check actualmax year 64 + + set date Showa 1 Dec 25 + check actualmax year 63 + + set date Heisei 1 Jan 7 + check actualmax year 64 + + set date Heisei 1 Aug 18 + check actualmax year 30 + + set date Reiwa 1 Apr 30 + check actualmax year 31 + + # Date/time beyond the last date in the max year. + set date Reiwa 1 Aug 18 + check actualmax year 292276975 + +test Least max YEAR + set date Heisei 17 Mar 1 + # Taisho is the shortest era, 14 years. + # (See above actual max YEAR case.) + check leastmax year 14 + +test Acutual min YEAR + # Get minimum values for comparison + clear all + set era BeforeMeiji + get min year + assign $result $minyear + set date $minyear Dec 31 + eval $minyear + 1 + assign $result $minyear_plus_one + + # BeforeMeiji 1 Dec 31 should exist in the minimum year which + # should be the same value as the getMinimum() value. + set date BeforeMeiji 1 Dec 31 + check actualmin year $minyear + + # Jan 1 shouldn't exist in the same year. So the actual minimum is + # $minyear + 1. + set date 1 Jan 1 + check actualmin year $minyear_plus_one + + # 1 should be returned if it's on a date of the last + # year which also exists in the first year of each era. + clear all + set date Meiji 45 Jan 1 + check actualmin year 1 + + clear all + set date Taisho 14 Jul 30 + check actualmin year 1 + + clear all + set date Showa 60 Dec 25 + check actualmin year 1 + + clear all + set date Heisei 17 Jan 8 + check actualmin year 1 + + # 2 should be returned if it's on a date of the last year which + # doesn't exist in the first year of each era. (Meiji is an + # exception.) + clear all + set date Taisho 14 Jul 29 + check actualmin year 2 + + clear all + set date Showa 60 Dec 23 + check actualmin year 2 + + clear all + set date Heisei 17 Jan 7 + check actualmin year 2
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/java/util/Calendar/CalendarTestScripts/japanese/japanese_normalization.cts Thu Apr 18 03:46:32 2019 +0100 @@ -0,0 +1,97 @@ +# +# +# + +locale ja JP JP +tz Asia/Tokyo +new instance jcal +new gregorian gcal + +test Normalize year 0 and -1 (Showa) + use jcal + clear all + set date Showa 1 Jan 1 + check date Taisho 15 Jan 1 + + clear all + set date Showa 0 Jan 1 + check era Taisho + check date 14 Jan 1 + + clear all + set date Showa -1 Jan 1 + check era Taisho + check date 13 Jan 1 + +test Normalize year max and max+1 (Showa) + clear all + set date Showa 64 Aug 9 + check date Heisei 1 Aug 9 + + clear all + set date Showa 65 Aug 9 + check date Heisei 2 Aug 9 + +test Normalize year 0 and -1 (Heisei) + use jcal + clear all + set date Heisei 1 Jan 1 + check date Showa 64 Jan 1 + + clear all + set date Heisei 0 Jan 1 + check date Showa 63 Jan 1 + + clear all + set date Heisei -1 Jan 1 + check date Showa 62 Jan 1 + +test Normalize year max and max+1 (Taisho) + clear all + set date Taisho 15 Dec 25 + check date Showa 1 Dec 25 + + clear all + set date Taisho 16 Dec 25 + check date Showa 2 Dec 25 + +test Normalize day of month 0 and -1 (Heisei) + use jcal + clear all + set date Heisei 1 Jan 1 + check date Showa 64 Jan 1 + + clear all + set date Heisei 1 Jan 0 + check date Showa 63 Dec 31 + + clear all + set date Heisei 1 Jan -1 + check date Showa 63 Dec 30 + +test Normalize hour of day -1:00 (Heisei) + clear all + set era Heisei + set datetime 1 Jan 1 0 0 0 + check era Showa + check datetime 64 Jan 1 0 0 0 + + clear all + set era Heisei + set datetime 1 Jan 1 -1 0 0 + check era Showa + check datetime 63 Dec 31 23 0 0 + +test Normalize hour of day 25:00 (Taisho) + clear all + set era Taisho + set datetime 15 Dec 25 25 0 0 + check era Showa + check datetime 1 Dec 26 1 0 0 + +test Normalize hour of day 25:00 (Showa) + clear all + set era Showa + set datetime 64 Jan 7 25 0 0 + check era Heisei + check datetime 1 Jan 8 1 0 0
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/java/util/Calendar/CalendarTestScripts/japanese/japanese_roll.cts Thu Apr 18 03:46:32 2019 +0100 @@ -0,0 +1,556 @@ +# +# +# + +# The test cases in this file assume that the first day of week is Sunday +# and the minimal days in the first week is 1. + +locale ja JP JP +new instance jcal + +timezone Asia/Tokyo +new instance tokyocal + +test roll HOUR_OF_DAY + use jcal + clear all + set era Heisei + set datetime 1 Jan 8 23 59 59 + roll hour_of_day 1 + check datetime 1 Jan 8 0 59 59 + check ampm AM + check hour 0 + roll hour_of_day -1 + check datetime 1 Jan 8 23 59 59 + roll hour_of_day 240 + check datetime 1 Jan 8 23 59 59 + roll hour_of_day -240 + check datetime 1 Jan 8 23 59 59 + +test roll HOUR + use jcal + clear all + set era Showa + set datetime 64 Jan 7 11 59 59 + get ampm + check era Showa + check hour 11 + check ampm AM + roll hour 1 + check hour 0 + check ampm AM + check datetime 64 Jan 7 0 59 59 + roll hour -1 + check datetime 64 Jan 7 11 59 59 + roll hour 240 + check datetime 64 Jan 7 11 59 59 + roll hour -240 + check datetime 64 Jan 7 11 59 59 + + clear all + set era Showa + set datetime 64 Jan 7 23 59 59 + get ampm + check era Showa + check hour 11 + check ampm PM + roll hour 1 + check hour 0 + check ampm PM + check datetime 64 Jan 7 12 59 59 + roll hour -1 + check datetime 64 Jan 7 23 59 59 + roll hour 240 + check datetime 64 Jan 7 23 59 59 + roll hour -240 + check datetime 64 Jan 7 23 59 59 + + clear all + set era Heisei + set datetime 1 Jan 8 23 59 59 + get ampm + check hour 11 + check ampm PM + roll hour 1 + check hour 0 + check ampm PM + check datetime 1 Jan 8 12 59 59 + roll hour -1 + check datetime 1 Jan 8 23 59 59 + roll hour 240 + check datetime 1 Jan 8 23 59 59 + roll hour -240 + check datetime 1 Jan 8 23 59 59 + +test roll YEAR + clear all + set date BeforeMeiji 1867 Jan 1 + get actualmin year + # roll to the min year value of Gregorian (not Julian) + roll year 1 + check date BeforeMeiji $result Jan 1 + roll year -1 + check date BeforeMeiji 1867 Jan 1 + + clear all + set date Meiji 45 Jul 29 + roll year 1 + check date Meiji 1 Jul 29 + roll year -1 + check date Meiji 45 Jul 29 + + clear all + set date Meiji 44 Jul 30 + roll year 1 + check date Meiji 1 Jul 30 + roll year -1 + check date Meiji 44 Jul 30 + + clear all + set date Taisho 15 Aug 1 + roll year 1 + check date Taisho 1 Aug 1 + roll year -1 + check date Taisho 15 Aug 1 + + clear all + set date Taisho 14 Dec 31 + roll year 1 + check date Taisho 1 Dec 31 + roll year -1 + check date Taisho 14 Dec 31 + + clear all + set date Showa 63 Feb 1 + # Neither 64 Feb 1 nor 1 Feb 1 exists in Showa. + roll year 1 + check date Showa 2 Feb 1 + roll year -1 + check date Showa 63 Feb 1 + + set date Showa 63 Dec 30 + roll year 1 + # Showa 1 Dec 30 exists. + check date Showa 1 Dec 30 + roll year -1 + check date Showa 63 Dec 30 + + set date Showa 64 Jan 7 + roll year 1 + check date Showa 2 Jan 7 + roll year -1 + check date Showa 64 Jan 7 + + set date Heisei 31 Apr 30 + roll year 1 + check date Heisei 1 Apr 30 + roll year -1 + check date Heisei 31 Apr 30 + + set date Reiwa 2 Apr 30 + get max year + assign $result $hmax + roll year -1 + check date Reiwa $hmax Apr 30 + roll year 1 + check date Reiwa 2 Apr 30 + +test roll MONTH + set date BeforeMeiji 1867 Dec 1 + roll month 1 + check date BeforeMeiji 1867 Jan 1 + roll month -1 + check date BeforeMeiji 1867 Dec 1 + roll month 14 + check date BeforeMeiji 1867 Feb 1 + roll month -14 + check date BeforeMeiji 1867 Dec 1 + + set date Meiji 1 Dec 1 + roll month 1 + check date Meiji 1 Jan 1 + roll month -1 + check date Meiji 1 Dec 1 + roll month 13 + check date Meiji 1 Jan 1 + roll month -13 + check date Meiji 1 Dec 1 + + set date Meiji 45 Jun 30 + roll month 1 + # Meiji 45 Jun 30 is actually Taisho 1 Jun 30. By the rule of + # roll() that year can't be changed, the day of month value + # has to be changed ("pin date to month"). + check date Meiji 45 Jul 29 + roll month -1 + # doesn't roll back to Jun 30, but to Jun 29. + check date Meiji 45 Jun 29 + + set date Meiji 45 Jun 30 + # Meiji 45 (year) has only 7 months. rolling 14 months must + # bring the given date to the same date. + roll month 14 + check date Meiji 45 Jun 30 + roll month -14 + check date Meiji 45 Jun 30 + + # Taisho Gan-nen (year 1) has only 6 months. + set date Taisho 1 Jul 30 + roll month -1 + check date Taisho 1 Dec 30 + roll month 1 + check date Taisho 1 Jul 30 + roll month -18 + check date Taisho 1 Jul 30 + roll month 18 + check date Taisho 1 Jul 30 + + set date Taisho 15 Jan 20 + roll month 11 + check date Taisho 15 Dec 20 + + set date Taisho 15 Jan 25 + roll month 11 + # Taisho 15 Dec 25 is actually Showa 1 Dec 25. Day of month is + # adjusted to the last day of month. ("pin date to month") + check date Taisho 15 Dec 24 + + set date Showa 1 Dec 25 + roll month 1 + check date Showa 1 Dec 25 + roll month -1 + check date Showa 1 Dec 25 + roll month 17 + check date Showa 1 Dec 25 + roll month -17 + check date Showa 1 Dec 25 + + set date Showa 64 Jan 7 + roll month 1 + check date Showa 64 Jan 7 + + set date Heisei 1 Feb 1 + roll month -1 + # Heisei starts from Jan 8. + check date Heisei 1 Jan 8 + roll month 1 + check date Heisei 1 Feb 8 + + set date Heisei 1 Feb 8 + roll month -1 + check date Heisei 1 Jan 8 + + set date Heisei 1 Dec 1 + roll month 1 + check date Heisei 1 Jan 8 + roll month -1 + check date Heisei 1 Dec 8 + + set date Heisei 1 Dec 8 + roll month 1 + check date Heisei 1 Jan 8 + roll month -1 + check date Heisei 1 Dec 8 + + # time zone dependent tests + use tokyocal + clear all + + set date BeforeMeiji 1 Jan 1 + get min year + assign $result $minyear + # actual min date: -292275055.05.17T01:47:04.192+0900 + set date BeforeMeiji $minyear Dec 31 + roll month 1 + check date BeforeMeiji $minyear May 31 + + set date BeforeMeiji $minyear Dec 1 + set timeofday 1 47 4 192 + roll month 1 + check date BeforeMeiji $minyear May 17 + check timeofday 1 47 4 192 + + set date BeforeMeiji $minyear Dec 1 + set timeofday 1 47 4 191 + roll month 1 + check date BeforeMeiji $minyear May 18 + check timeofday 1 47 4 191 + + set date Reiwa 17 Jan 1 + get max year + assign $result $max + set date Reiwa $max Jul 28 + roll month 1 + check date Reiwa $max Aug 17 + set date Reiwa $max Jul 28 + set timeofday 23 59 59 999 + roll month 1 + check date Reiwa $max Aug 16 + check timeofday 23 59 59 999 + +test roll WEEK_OF_YEAR + use jcal + clear all + # 1867 Dec 23 is Monday. + set date BeforeMeiji 1867 Dec 23 + roll week_of_year 1 + check day_of_week Mon + check date BeforeMeiji 1867 Jan 7 + roll week_of_year -1 + check day_of_week Mon + check date BeforeMeiji 1867 Dec 23 + roll week_of_year 26 + check day_of_week Mon + check date BeforeMeiji 1867 Jul 1 + roll week_of_year -26 + check day_of_week Mon + check date BeforeMeiji 1867 Dec 23 + + # 1867 Dec 23 is Wednesday. + set date Meiji 1 Dec 23 + roll week_of_year 1 + check day_of_week Wed + check date Meiji 1 Jan 1 + roll week_of_year -1 + check day_of_week Wed + check date Meiji 1 Dec 23 + roll week_of_year 26 + check day_of_week Wed + check date Meiji 1 Jun 24 + roll week_of_year -26 + check day_of_week Wed + check date Meiji 1 Dec 23 + + # Meiji 45 July 22 is Monday. + set date Meiji 45 Jul 22 + # the next week if the first week of Taisho 1 + roll week_of_year 1 + check day_of_week Mon + check date Meiji 45 Jan 1 + roll week_of_year -1 + check day_of_week Mon + check date Meiji 45 Jul 22 + roll week_of_year 26 + check day_of_week Mon + check date Meiji 45 Jun 24 + + # Taisho Gan-nen (year 1) July 30 is Tuesday. + set date Taisho 1 Jul 30 + roll week_of_year -1 + # Taisho Gen-nen December 31 is the first week of the next year. + check day_of_week Tue + check date Taisho 1 Dec 24 + roll week_of_year 1 + check day_of_week Tue + check date Taisho 1 Jul 30 + roll week_of_year 26 + check day_of_week Tue + check date Taisho 1 Aug 27 + roll week_of_year -26 + check day_of_week Tue + check date Taisho 1 Jul 30 + + # Taisho 15 January 7 is Thursday. + set date Taisho 15 Jan 7 + roll week_of_year -1 + check day_of_week Thu + check date Taisho 15 Dec 16 + roll week_of_year 1 + check day_of_week Thu + check date Taisho 15 Jan 7 + + roll week_of_year 51 + check day_of_week Thu + check date Taisho 15 Jan 14 + + # Showa Gan-nen December 30 is Thursday. Showa Gan-nen has + # only one week. Rolling any number of weeks brings to the + # same date. + set date Showa 1 Dec 30 + roll week_of_year 1 + check day_of_week Thu + check date Showa 1 Dec 30 + roll week_of_year -1 + check day_of_week Thu + check date Showa 1 Dec 30 + roll week_of_year 26 + check day_of_week Thu + check date Showa 1 Dec 30 + roll week_of_year -26 + check day_of_week Thu + check date Showa 1 Dec 30 + + # Showa 64 January 7 is Saturday. The year has only one week. + set date Showa 64 Jan 7 + roll week_of_year 1 + check day_of_week Sat + check date Showa 64 Jan 7 + roll week_of_year -1 + check day_of_week Sat + check date Showa 64 Jan 7 + roll week_of_year 26 + check day_of_week Sat + check date Showa 64 Jan 7 + roll week_of_year -26 + check day_of_week Sat + check date Showa 64 Jan 7 + + # Heisei Gan-nen January 14 is Saturday. + set date Heisei 1 Jan 14 + roll week_of_year -1 + check day_of_week Sat + check date Heisei 1 Dec 30 + roll week_of_year 1 + check day_of_week Sat + check date Heisei 1 Jan 14 + roll week_of_year -26 + check day_of_week Sat + check date Heisei 1 Jul 8 + roll week_of_year 26 + check day_of_week Sat + check date Heisei 1 Jan 14 + + # Heisei Gan-nen December 1 is Friday. + set date Heisei 1 Dec 1 + roll week_of_year 5 + check day_of_week Fri + check date Heisei 1 Jan 13 + roll week_of_year -5 + check day_of_week Fri + check date Heisei 1 Dec 1 + roll week_of_year 55 + check day_of_week Fri + check date Heisei 1 Dec 29 + + use tokyocal + clear all + + set date BeforeMeiji $minyear Dec 25 + check day_of_week Sat + roll week_of_year 1 + check day_of_week Sat + check date BeforeMeiji $minyear May 22 + roll week_of_year -1 + check day_of_week Sat + check date BeforeMeiji $minyear Dec 25 + +test WEEK_OF_MONTH + # Needs to wait for 6191841 fix. (WEEK_OF_MONTH needs to change + # ERA and YEAR in a transition month.) + +test DAY_OF_MONTH + # Needs to wait for 6191841 fix. (DAY_OF_MONTH needs to change + # ERA and YEAR in a transition month.) + +test DAY_OF_YEAR + use jcal + clear all + + # 1867 is a regular Gregorian year. + set date BeforeMeiji 1867 Dec 31 + roll day_of_year 1 + check date BeforeMeiji 1867 Jan 1 + roll day_of_year -1 + check date BeforeMeiji 1867 Dec 31 + roll day_of_year 26 + check date BeforeMeiji 1867 Jan 26 + roll day_of_year -26 + check date BeforeMeiji 1867 Dec 31 + + # Meiji 1 starts from Jan 1. It's a regular year as well. + set date Meiji 1 Dec 31 + roll day_of_year 1 + check date Meiji 1 Jan 1 + roll day_of_year -1 + check date Meiji 1 Dec 31 + roll day_of_year 26 + check date Meiji 1 Jan 26 + roll day_of_year -26 + check date Meiji 1 Dec 31 + + # The last year of Meiji (45) has an irregularity. Meiji 45 + # July 30 is actually Taisho 1 July 30. + set date Meiji 45 Jul 29 + roll day_of_year 1 + check date Meiji 45 Jan 1 + roll day_of_year -1 + check date Meiji 45 Jul 29 + roll day_of_year 26 + check date Meiji 45 Jan 26 + roll day_of_year -26 + check date Meiji 45 Jul 29 + + # The first day of Taisho, July 30. + set date Taisho 1 Jul 30 + roll day_of_year -1 + check date Taisho 1 Dec 31 + roll day_of_year 1 + check date Taisho 1 Jul 30 + roll day_of_year 26 + check date Taisho 1 Aug 25 + roll day_of_year -26 + check date Taisho 1 Jul 30 + + set date Taisho 15 Jan 1 + roll day_of_year -1 + check date Taisho 15 Dec 24 + roll day_of_year 1 + check date Taisho 15 Jan 1 + + set date Showa 1 Dec 31 + roll day_of_year 1 + check date Showa 1 Dec 25 + roll day_of_year -1 + check date Showa 1 Dec 31 + roll day_of_year 26 + # 26 % 7 = 5 + check date Showa 1 Dec 29 + roll day_of_year -26 + check date Showa 1 Dec 31 + + set date Showa 64 Jan 7 + roll day_of_year 1 + check date Showa 64 Jan 1 + roll day_of_year -1 + check date Showa 64 Jan 7 + roll day_of_year 26 + # 26 % 7 = 5 + check date Showa 64 Jan 5 + roll day_of_year -26 + check date Showa 64 Jan 7 + + set date Heisei 1 Jan 8 + roll day_of_year -1 + check date Heisei 1 Dec 31 + roll day_of_year 1 + check date Heisei 1 Jan 8 + roll day_of_year -26 + check date Heisei 1 Dec 6 + roll day_of_year 26 + check date Heisei 1 Jan 8 + + set date Heisei 1 Dec 31 + roll day_of_year 5 + check date Heisei 1 Jan 12 + roll day_of_year -5 + check date Heisei 1 Dec 31 + roll day_of_year 55 + check date Heisei 1 Mar 3 + roll day_of_year -55 + check date Heisei 1 Dec 31 + + use tokyocal + clear all + + set date BeforeMeiji $minyear Dec 31 + set timeofday 1 47 4 192 + roll day_of_year 1 + check date BeforeMeiji $minyear May 17 + check timeofday 1 47 4 192 + roll day_of_year -1 + check date BeforeMeiji $minyear Dec 31 + check timeofday 1 47 4 192 + +test DAY_OF_WEEK_IN_MONTH + use jcal + clear all
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/java/util/Calendar/CalendarTestScripts/params/lenient.cts Thu Apr 18 03:46:32 2019 +0100 @@ -0,0 +1,5 @@ +# +# +# + +set lenient
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/java/util/Calendar/CalendarTestScripts/params/non-lenient.cts Thu Apr 18 03:46:32 2019 +0100 @@ -0,0 +1,5 @@ +# +# +# + +set non-lenient
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/java/util/Calendar/CalendarTestScripts/timezones/tz_japan.cts Thu Apr 18 03:46:32 2019 +0100 @@ -0,0 +1,5 @@ +# +# +# + +timezone Asia/Tokyo
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/java/util/Calendar/CalendarTestScripts/timezones/tz_novosibirsk.cts Thu Apr 18 03:46:32 2019 +0100 @@ -0,0 +1,5 @@ +# +# +# + +timezone Asia/Novosibirsk
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/java/util/Calendar/CalendarTestScripts/timezones/tz_pst.cts Thu Apr 18 03:46:32 2019 +0100 @@ -0,0 +1,5 @@ +# +# +# + +timezone America/Los_Angeles
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/java/util/Calendar/CalendarTestScripts/timezones/tz_sydney.cts Thu Apr 18 03:46:32 2019 +0100 @@ -0,0 +1,5 @@ +# +# +# + +timezone Australia/Sydney
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/java/util/Calendar/JapaneseEraNameTest.java Thu Apr 18 03:46:32 2019 +0100 @@ -0,0 +1,67 @@ +/* + * Copyright (c) 2019, 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 8202088 8207152 8217609 8219890 + * @summary Test the localized Japanese new era name (May 1st. 2019-) + * is retrieved no matter CLDR provider contains the name or not. + * @run main/othervm -Djava.locale.providers=CLDR JapaneseEraNameTest + * + */ + +import static java.util.Calendar.*; +import static java.util.Locale.*; +import java.util.Calendar; +import java.util.Locale; + + +public class JapaneseEraNameTest { + static final Calendar c = new Calendar.Builder() + .setCalendarType("japanese") + .setFields(ERA, 5, YEAR, 1, MONTH, MAY, DAY_OF_MONTH, 1) + .build(); + + + static final Object[][] names = { + // Since the test fails for below particular data + // on prior 8u versions for all eras, commenting it + // temporarily. Will be fixed as part of JDK-8220020. + // { LONG, JAPAN, "\u4ee4\u548c" }, + { LONG, US, "Reiwa" }, + { LONG, CHINA, "Reiwa" }, + { SHORT, JAPAN, "\u4ee4\u548c" }, + { SHORT, US, "Reiwa" }, + { SHORT, CHINA, "R" }, + }; + + public static void main(String[] args) { + for (Object[] data : names) { + if(!c.getDisplayName(ERA, (int)data[0], (Locale)data[1]) + .equals(data[2])) { + throw new RuntimeException("JapaneseEraNameTest failed for " + + String.format("%1$s %2$s %3$s", data[0], data[1], data[2])); + } + } + } +}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/java/util/Calendar/JapaneseLenientEraTest.java Thu Apr 18 03:46:32 2019 +0100 @@ -0,0 +1,66 @@ +/* + * Copyright (c) 2019, 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 8206120 + * @summary Test whether lenient era is accepted in JapaneseImperialCalendar + * @run testng/othervm JapaneseLenientEraTest + */ + +import java.text.DateFormat; +import java.text.SimpleDateFormat; +import java.util.Calendar; +import java.util.Date; +import java.util.Locale; + +import org.testng.annotations.DataProvider; +import org.testng.annotations.Test; +import static org.testng.Assert.assertEquals; + +@Test +public class JapaneseLenientEraTest { + + @DataProvider(name="lenientEra") + Object[][] names() { + return new Object[][] { + // lenient era/year, strict era/year + { "Meiji 123", "Heisei 2" }, + { "Showa 65", "Heisei 2" }, + { "Heisei 32", "Reiwa 2" }, + }; + } + + @Test(dataProvider="lenientEra") + public void testLenientEra(String lenient, String strict) throws Exception { + Calendar c = new Calendar.Builder() + .setCalendarType("japanese") + .build(); + DateFormat df = new SimpleDateFormat("GGGG y-M-d", Locale.ROOT); + df.setCalendar(c); + Date lenDate = df.parse(lenient + "-01-01"); + df.setLenient(false); + Date strDate = df.parse(strict + "-01-01"); + assertEquals(lenDate, strDate); + } +}
--- a/test/java/util/Calendar/NarrowNamesTest.java Wed Apr 17 03:47:21 2019 +0100 +++ b/test/java/util/Calendar/NarrowNamesTest.java Thu Apr 18 03:46:32 2019 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2019, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -21,6 +21,7 @@ * questions. */ +import java.time.LocalDateTime; import java.util.*; import static java.util.GregorianCalendar.*; @@ -45,7 +46,9 @@ HOUR_OF_DAY, 10); test(US, AM_PM, "p", HOUR_OF_DAY, 23); - test(JAJPJP, DAY_OF_WEEK, "\u65e5", + test(JAJPJP, DAY_OF_WEEK, + LocalDateTime.now().isBefore(LocalDateTime.of(2019, 5, 1, 0, 0)) ? + "\u65e5" : "\u706b", // "Sun" for HEISEI, "Tue" for REIWA YEAR, 24, MONTH, DECEMBER, DAY_OF_MONTH, 23); test(THTH, MONTH, NARROW_STANDALONE, "\u0e18.\u0e04.", YEAR, 2555, MONTH, DECEMBER, DAY_OF_MONTH, 5);
--- a/test/java/util/Calendar/SupplementalJapaneseEraTest.java Wed Apr 17 03:47:21 2019 +0100 +++ b/test/java/util/Calendar/SupplementalJapaneseEraTest.java Thu Apr 18 03:46:32 2019 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2017, 2019, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -60,8 +60,8 @@ public class SupplementalJapaneseEraTest { private static final Locale WAREKI_LOCALE = Locale.forLanguageTag("ja-JP-u-ca-japanese"); - private static final String NEW_ERA_NAME = "NewEra"; - private static final String NEW_ERA_ABBR = "N.E."; + private static final String SUP_ERA_NAME = "SupEra"; + private static final String SUP_ERA_ABBR = "S.E."; private static final int NEW_ERA_YEAR = 200; private static final int NEW_ERA_MONTH = FEBRUARY; private static final int NEW_ERA_DAY = 11; @@ -96,7 +96,7 @@ private static void testProperty() { Calendar jcal = new Calendar.Builder() .setCalendarType("japanese") - .setFields(YEAR, 1, DAY_OF_YEAR, 1) + .setFields(ERA, 6, YEAR, 1, DAY_OF_YEAR, 1) .build(); Date firstDayOfEra = jcal.getTime(); @@ -114,7 +114,7 @@ // test long era name sdf = new SimpleDateFormat("GGGG y-MM-dd", WAREKI_LOCALE); got = sdf.format(firstDayOfEra); - expected = NEW_ERA_NAME + " 1-02-11"; + expected = SUP_ERA_NAME + " 1-02-11"; if (!expected.equals(got)) { System.err.printf("GGGG y-MM-dd: got=\"%s\", expected=\"%s\"%n", got, expected); errors++; @@ -123,7 +123,7 @@ // test era abbreviation sdf = new SimpleDateFormat("G y-MM-dd", WAREKI_LOCALE); got = sdf.format(firstDayOfEra); - expected = NEW_ERA_ABBR+" 1-02-11"; + expected = SUP_ERA_ABBR+" 1-02-11"; if (!expected.equals(got)) { System.err.printf("G y-MM-dd: got=\"%s\", expected=\"%s\"%n", got, expected); errors++; @@ -140,30 +140,30 @@ // test java.time.chrono.JapaneseEra JapaneseDate jdate = JapaneseDate.of(year, 2, 11); got = jdate.toString(); - expected = "Japanese " + NEW_ERA_NAME + " 1-02-11"; + expected = "Japanese " + SUP_ERA_NAME + " 1-02-11"; if (!expected.equals(got)) { System.err.printf("JapaneseDate: got=\"%s\", expected=\"%s\"%n", got, expected); errors++; } JapaneseEra jera = jdate.getEra(); got = jera.getDisplayName(TextStyle.FULL, Locale.US); - if (!NEW_ERA_NAME.equals(got)) { - System.err.printf("JapaneseEra (FULL): got=\"%s\", expected=\"%s\"%n", got, NEW_ERA_NAME); + if (!SUP_ERA_NAME.equals(got)) { + System.err.printf("JapaneseEra (FULL): got=\"%s\", expected=\"%s\"%n", got, SUP_ERA_NAME); errors++; } got = jera.getDisplayName(TextStyle.SHORT, Locale.US); - if (!NEW_ERA_NAME.equals(got)) { - System.err.printf("JapaneseEra (SHORT): got=\"%s\", expected=\"%s\"%n", got, NEW_ERA_NAME); + if (!SUP_ERA_NAME.equals(got)) { + System.err.printf("JapaneseEra (SHORT): got=\"%s\", expected=\"%s\"%n", got, SUP_ERA_NAME); errors++; } got = jera.getDisplayName(TextStyle.NARROW, Locale.US); - if (!NEW_ERA_ABBR.equals(got)) { - System.err.printf("JapaneseEra (NARROW): got=\"%s\", expected=\"%s\"%n", got, NEW_ERA_ABBR); + if (!SUP_ERA_ABBR.equals(got)) { + System.err.printf("JapaneseEra (NARROW): got=\"%s\", expected=\"%s\"%n", got, SUP_ERA_ABBR); errors++; } got = jera.getDisplayName(TextStyle.NARROW_STANDALONE, Locale.US); - if (!NEW_ERA_ABBR.equals(got)) { - System.err.printf("JapaneseEra (NARROW_STANDALONE): got=\"%s\", expected=\"%s\"%n", got, NEW_ERA_ABBR); + if (!SUP_ERA_ABBR.equals(got)) { + System.err.printf("JapaneseEra (NARROW_STANDALONE): got=\"%s\", expected=\"%s\"%n", got, SUP_ERA_ABBR); errors++; } @@ -172,10 +172,12 @@ .appendPattern("GGGG") .appendLiteral(" ") .appendPattern("G") + .appendLiteral(" ") + .appendPattern("GGGGG") .toFormatter(Locale.US) .withChronology(JapaneseChronology.INSTANCE) .format(jdate); - expected = NEW_ERA_NAME + " " + NEW_ERA_ABBR; + expected = SUP_ERA_NAME + " " + SUP_ERA_NAME + " " + SUP_ERA_ABBR; if (!expected.equals(got)) { System.err.printf("java.time formatter long/abbr names: got=\"%s\", expected=\"%s\"%n", got, expected); errors++; @@ -230,8 +232,8 @@ if (eras != null) { p.setProperty(JA_CAL_KEY, eras + - "; name=" + SupplementalJapaneseEraTest.NEW_ERA_NAME + - ",abbr=" + SupplementalJapaneseEraTest.NEW_ERA_ABBR + + "; name=" + SupplementalJapaneseEraTest.SUP_ERA_NAME + + ",abbr=" + SupplementalJapaneseEraTest.SUP_ERA_ABBR + ",since=" + since()); } try (BufferedWriter bw = Files.newBufferedWriter(dst)) { @@ -243,6 +245,7 @@ return new Calendar.Builder() .setCalendarType("japanese") .setTimeZone(TimeZone.getTimeZone("GMT")) + .setFields(ERA, 5) .setDate(SupplementalJapaneseEraTest.NEW_ERA_YEAR, SupplementalJapaneseEraTest.NEW_ERA_MONTH, SupplementalJapaneseEraTest.NEW_ERA_DAY)
--- a/test/java/util/stream/bootlib/java/util/stream/DoubleStreamTestDataProvider.java Wed Apr 17 03:47:21 2019 +0100 +++ b/test/java/util/stream/bootlib/java/util/stream/DoubleStreamTestDataProvider.java Thu Apr 18 03:46:32 2019 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2016, 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 @@ -41,6 +41,7 @@ private static final double[] pseudoRandom; private static final Object[][] testData; + private static final Object[][] testSmallData; private static final Object[][] spliteratorTestData; static { @@ -78,11 +79,15 @@ static { { - List<Object[]> list = new ArrayList<>(); + List<Object[]> listSmall = new ArrayList<>(); + List<Object[]> list1000 = new ArrayList<>(); + List<Object[]> list = null; for (Object[] data : arrays) { final Object name = data[0]; final double[] doubles = (double[]) data[1]; + list = doubles.length >= 1000 ? list1000 : listSmall; + list.add(new Object[]{"array:" + name, TestData.Factory.ofArray("array:" + name, doubles)}); @@ -93,7 +98,9 @@ list.add(new Object[]{"SpinedList:" + name, TestData.Factory.ofSpinedBuffer("SpinedList:" + name, isl)}); } - testData = list.toArray(new Object[0][]); + testSmallData = listSmall.toArray(new Object[0][]); + list1000.addAll(listSmall); + testData = list1000.toArray(new Object[0][]); } { @@ -136,6 +143,11 @@ return testData; } + @DataProvider(name = "DoubleStreamTestData.small") + public static Object[][] makeSmallDoubleStreamTestData() { + return testSmallData; + } + // returns an array of (String name, Supplier<PrimitiveSpliterator<Double>>) @DataProvider(name = "DoubleSpliterator") public static Object[][] spliteratorProvider() {
--- a/test/java/util/stream/bootlib/java/util/stream/IntStreamTestDataProvider.java Wed Apr 17 03:47:21 2019 +0100 +++ b/test/java/util/stream/bootlib/java/util/stream/IntStreamTestDataProvider.java Thu Apr 18 03:46:32 2019 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2016, 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 @@ -41,6 +41,7 @@ private static final int[] pseudoRandom; private static final Object[][] testData; + private static final Object[][] testSmallData; private static final Object[][] spliteratorTestData; static { @@ -78,11 +79,15 @@ static { { - List<Object[]> list = new ArrayList<>(); + List<Object[]> listSmall = new ArrayList<>(); + List<Object[]> list1000 = new ArrayList<>(); + List<Object[]> list = null; for (Object[] data : arrays) { final Object name = data[0]; final int[] ints = (int[]) data[1]; + list = ints.length >= 1000 ? list1000 : listSmall; + list.add(new Object[]{"array:" + name, TestData.Factory.ofArray("array:" + name, ints)}); @@ -98,7 +103,9 @@ list.add(streamDataDescr("IntStream.rangeClosed(0,l): " + ints.length, () -> IntStream.rangeClosed(0, ints.length))); } - testData = list.toArray(new Object[0][]); + testSmallData = listSmall.toArray(new Object[0][]); + list1000.addAll(listSmall); + testData = list1000.toArray(new Object[0][]); } { @@ -150,6 +157,11 @@ return testData; } + @DataProvider(name = "IntStreamTestData.small") + public static Object[][] makeSmallIntStreamTestData() { + return testSmallData; + } + // returns an array of (String name, Supplier<PrimitiveSpliterator<Integer>>) @DataProvider(name = "IntSpliterator") public static Object[][] spliteratorProvider() {
--- a/test/java/util/stream/bootlib/java/util/stream/LongStreamTestDataProvider.java Wed Apr 17 03:47:21 2019 +0100 +++ b/test/java/util/stream/bootlib/java/util/stream/LongStreamTestDataProvider.java Thu Apr 18 03:46:32 2019 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2016, 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 @@ -41,6 +41,7 @@ private static final long[] pseudoRandom; private static final Object[][] testData; + private static final Object[][] testSmallData; private static final Object[][] spliteratorTestData; static { @@ -78,11 +79,15 @@ static { { - List<Object[]> list = new ArrayList<>(); + List<Object[]> listSmall = new ArrayList<>(); + List<Object[]> list1000 = new ArrayList<>(); + List<Object[]> list = null; for (Object[] data : arrays) { final Object name = data[0]; final long[] longs = (long[]) data[1]; + list = longs.length >= 1000 ? list1000 : listSmall; + list.add(new Object[]{"array:" + name, TestData.Factory.ofArray("array:" + name, longs)}); @@ -98,7 +103,9 @@ list.add(streamDataDescr("LongStream.longRangeClosed(0,l): " + longs.length, () -> LongStream.rangeClosed(0, longs.length))); } - testData = list.toArray(new Object[0][]); + testSmallData = listSmall.toArray(new Object[0][]); + list1000.addAll(listSmall); + testData = list1000.toArray(new Object[0][]); } { @@ -150,6 +157,11 @@ return testData; } + @DataProvider(name = "LongStreamTestData.small") + public static Object[][] makeSmallLongStreamTestData() { + return testSmallData; + } + // returns an array of (String name, Supplier<PrimitiveSpliterator<Long>>) @DataProvider(name = "LongSpliterator") public static Object[][] spliteratorProvider() {
--- a/test/java/util/stream/bootlib/java/util/stream/StreamTestDataProvider.java Wed Apr 17 03:47:21 2019 +0100 +++ b/test/java/util/stream/bootlib/java/util/stream/StreamTestDataProvider.java Thu Apr 18 03:46:32 2019 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2016, 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 @@ -46,6 +46,8 @@ private static final Integer[] pseudoRandom; private static final Object[][] testData; + private static final Object[][] testSmallData; + private static final Object[][] testMiniData; private static final Object[][] withNullTestData; private static final Object[][] spliteratorTestData; @@ -84,12 +86,17 @@ static { { - List<Object[]> list = new ArrayList<>(); + List<Object[]> listMini = new ArrayList<>(); + List<Object[]> listSmall = new ArrayList<>(); + List<Object[]> list1000 = new ArrayList<>(); + List<Object[]> list = null; for (Object[] data : arrays) { final Object name = data[0]; final Integer[] ints = (Integer[])data[1]; final List<Integer> intsAsList = Arrays.asList(ints); + list = ints.length >= 1000 ? list1000 : (ints.length >= 100 ? listSmall : listMini); + list.add(arrayDataDescr("array:" + name, ints)); list.add(collectionDataDescr("ArrayList.asList:" + name, intsAsList)); list.add(collectionDataDescr("ArrayList:" + name, new ArrayList<>(intsAsList))); @@ -114,7 +121,11 @@ // @@@ Add more } - testData = list.toArray(new Object[0][]); + testMiniData = listMini.toArray(new Object[0][]); + listSmall.addAll(listMini); + testSmallData = listSmall.toArray(new Object[0][]); + list1000.addAll(listSmall); + testData = list1000.toArray(new Object[0][]); } // Simple combination of numbers and null values, probably excessive but may catch @@ -192,6 +203,16 @@ return testData; } + @DataProvider(name = "StreamTestData<Integer>.small") + public static Object[][] makeSmallStreamTestData() { + return testSmallData; + } + + @DataProvider(name = "StreamTestData<Integer>.mini") + public static Object[][] makeMiniStreamTestData() { + return testMiniData; + } + @DataProvider(name = "withNull:StreamTestData<Integer>") public static Object[][] makeStreamWithNullTestData() { return withNullTestData;
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/java/util/stream/bootlib/java/util/stream/ThowableHelper.java Thu Apr 18 03:46:32 2019 +0100 @@ -0,0 +1,49 @@ +/* + * Copyright (c) 2014, 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 java.util.stream; + +import static org.testng.Assert.assertNotNull; +import static org.testng.Assert.assertTrue; + +public final class ThowableHelper { + + public static void checkException(Class<? extends Exception> ce, Runnable r) { + Exception caught = null; + try { + r.run(); + } catch (Exception e) { + caught = e; + } + + assertNotNull(caught); + assertTrue(ce.isInstance(caught)); + } + + public static void checkNPE(Runnable r) { + checkException(NullPointerException.class, r); + } + + public static void checkISE(Runnable r) { + checkException(IllegalStateException.class, r); + } +}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/java/util/stream/test/org/openjdk/tests/java/util/stream/CollectAndSummaryStatisticsTest.java Thu Apr 18 03:46:32 2019 +0100 @@ -0,0 +1,153 @@ +/* + * Copyright (c) 2012, 2014, 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 + * @summary primtive stream collection with summary statistics + * @bug 8044047 + */ + +package org.openjdk.tests.java.util.stream; + +import org.testng.annotations.Test; + +import java.util.ArrayList; +import java.util.DoubleSummaryStatistics; +import java.util.IntSummaryStatistics; +import java.util.List; +import java.util.LongSummaryStatistics; +import java.util.stream.Collectors; +import java.util.stream.DoubleStream; +import java.util.stream.IntStream; +import java.util.stream.LongStream; +import java.util.stream.OpTestCase; + +import static java.util.stream.LambdaTestHelpers.countTo; +import static java.util.stream.ThowableHelper.checkNPE; + +@Test +public class CollectAndSummaryStatisticsTest extends OpTestCase { + + public void testIntCollectNull() { + checkNPE(() -> IntStream.of(1).collect(null, + IntSummaryStatistics::accept, + IntSummaryStatistics::combine)); + checkNPE(() -> IntStream.of(1).collect(IntSummaryStatistics::new, + null, + IntSummaryStatistics::combine)); + checkNPE(() -> IntStream.of(1).collect(IntSummaryStatistics::new, + IntSummaryStatistics::accept, + null)); + } + + public void testLongCollectNull() { + checkNPE(() -> LongStream.of(1).collect(null, + LongSummaryStatistics::accept, + LongSummaryStatistics::combine)); + checkNPE(() -> LongStream.of(1).collect(LongSummaryStatistics::new, + null, + LongSummaryStatistics::combine)); + checkNPE(() -> LongStream.of(1).collect(LongSummaryStatistics::new, + LongSummaryStatistics::accept, + null)); + } + + public void testDoubleCollectNull() { + checkNPE(() -> DoubleStream.of(1).collect(null, + DoubleSummaryStatistics::accept, + DoubleSummaryStatistics::combine)); + checkNPE(() -> DoubleStream.of(1).collect(DoubleSummaryStatistics::new, + null, + DoubleSummaryStatistics::combine)); + checkNPE(() -> DoubleStream.of(1).collect(DoubleSummaryStatistics::new, + DoubleSummaryStatistics::accept, + null)); + } + + public void testIntStatistics() { + List<IntSummaryStatistics> instances = new ArrayList<>(); + instances.add(countTo(1000).stream().collect(Collectors.summarizingInt(i -> i))); + instances.add(countTo(1000).stream().mapToInt(i -> i).summaryStatistics()); + instances.add(countTo(1000).stream().mapToInt(i -> i).collect(IntSummaryStatistics::new, + IntSummaryStatistics::accept, + IntSummaryStatistics::combine)); + instances.add(countTo(1000).parallelStream().collect(Collectors.summarizingInt(i -> i))); + instances.add(countTo(1000).parallelStream().mapToInt(i -> i).summaryStatistics()); + instances.add(countTo(1000).parallelStream().mapToInt(i -> i).collect(IntSummaryStatistics::new, + IntSummaryStatistics::accept, + IntSummaryStatistics::combine)); + + for (IntSummaryStatistics stats : instances) { + assertEquals(stats.getCount(), 1000); + assertEquals(stats.getSum(), countTo(1000).stream().mapToInt(i -> i).sum()); + assertEquals(stats.getAverage(), (double) stats.getSum() / stats.getCount()); + assertEquals(stats.getMax(), 1000); + assertEquals(stats.getMin(), 1); + } + } + + + public void testLongStatistics() { + List<LongSummaryStatistics> instances = new ArrayList<>(); + instances.add(countTo(1000).stream().collect(Collectors.summarizingLong(i -> i))); + instances.add(countTo(1000).stream().mapToLong(i -> i).summaryStatistics()); + instances.add(countTo(1000).stream().mapToLong(i -> i).collect(LongSummaryStatistics::new, + LongSummaryStatistics::accept, + LongSummaryStatistics::combine)); + instances.add(countTo(1000).parallelStream().collect(Collectors.summarizingLong(i -> i))); + instances.add(countTo(1000).parallelStream().mapToLong(i -> i).summaryStatistics()); + instances.add(countTo(1000).parallelStream().mapToLong(i -> i).collect(LongSummaryStatistics::new, + LongSummaryStatistics::accept, + LongSummaryStatistics::combine)); + + for (LongSummaryStatistics stats : instances) { + assertEquals(stats.getCount(), 1000); + assertEquals(stats.getSum(), (long) countTo(1000).stream().mapToInt(i -> i).sum()); + assertEquals(stats.getAverage(), (double) stats.getSum() / stats.getCount()); + assertEquals(stats.getMax(), 1000L); + assertEquals(stats.getMin(), 1L); + } + } + + public void testDoubleStatistics() { + List<DoubleSummaryStatistics> instances = new ArrayList<>(); + instances.add(countTo(1000).stream().collect(Collectors.summarizingDouble(i -> i))); + instances.add(countTo(1000).stream().mapToDouble(i -> i).summaryStatistics()); + instances.add(countTo(1000).stream().mapToDouble(i -> i).collect(DoubleSummaryStatistics::new, + DoubleSummaryStatistics::accept, + DoubleSummaryStatistics::combine)); + instances.add(countTo(1000).parallelStream().collect(Collectors.summarizingDouble(i -> i))); + instances.add(countTo(1000).parallelStream().mapToDouble(i -> i).summaryStatistics()); + instances.add(countTo(1000).parallelStream().mapToDouble(i -> i).collect(DoubleSummaryStatistics::new, + DoubleSummaryStatistics::accept, + DoubleSummaryStatistics::combine)); + + for (DoubleSummaryStatistics stats : instances) { + assertEquals(stats.getCount(), 1000); + assertEquals(stats.getSum(), (double) countTo(1000).stream().mapToInt(i -> i).sum()); + assertEquals(stats.getAverage(), stats.getSum() / stats.getCount()); + assertEquals(stats.getMax(), 1000.0); + assertEquals(stats.getMin(), 1.0); + } + } +}
--- a/test/java/util/stream/test/org/openjdk/tests/java/util/stream/ExplodeOpTest.java Wed Apr 17 03:47:21 2019 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,119 +0,0 @@ -/* - * Copyright (c) 2012, 2013, 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 org.openjdk.tests.java.util.stream; - -import org.testng.annotations.Test; - -import java.util.Arrays; -import java.util.Collection; -import java.util.Collections; -import java.util.function.Function; -import java.util.stream.*; - -import static java.util.stream.LambdaTestHelpers.*; - -/** - * ExplodeOpTest - * - * @author Brian Goetz - */ -@Test -public class ExplodeOpTest extends OpTestCase { - - static final Function<Integer, Stream<Integer>> integerRangeMapper - = e -> IntStream.range(0, e).boxed(); - - public void testFlatMap() { - String[] stringsArray = {"hello", "there", "", "yada"}; - Stream<String> strings = Arrays.asList(stringsArray).stream(); - assertConcat(strings.flatMap(flattenChars).iterator(), "hellothereyada"); - - assertCountSum(countTo(10).stream().flatMap(mfId), 10, 55); - assertCountSum(countTo(10).stream().flatMap(mfNull), 0, 0); - assertCountSum(countTo(3).stream().flatMap(mfLt), 6, 4); - - exerciseOps(TestData.Factory.ofArray("stringsArray", stringsArray), s -> s.flatMap(flattenChars)); - exerciseOps(TestData.Factory.ofArray("LONG_STRING", new String[] {LONG_STRING}), s -> s.flatMap(flattenChars)); - } - - @Test(dataProvider = "StreamTestData<Integer>", dataProviderClass = StreamTestDataProvider.class) - public void testOps(String name, TestData.OfRef<Integer> data) { - Collection<Integer> result = exerciseOps(data, s -> s.flatMap(mfId)); - assertEquals(data.size(), result.size()); - - result = exerciseOps(data, s -> s.flatMap(mfNull)); - assertEquals(0, result.size()); - - result = exerciseOps(data, s-> s.flatMap(e -> Stream.empty())); - assertEquals(0, result.size()); - - exerciseOps(data, s -> s.flatMap(mfLt)); - exerciseOps(data, s -> s.flatMap(integerRangeMapper)); - exerciseOps(data, s -> s.flatMap((Integer e) -> IntStream.range(0, e).boxed().limit(10))); - } - - // - - @Test(dataProvider = "IntStreamTestData", dataProviderClass = IntStreamTestDataProvider.class) - public void testIntOps(String name, TestData.OfInt data) { - Collection<Integer> result = exerciseOps(data, s -> s.flatMap(i -> Collections.singleton(i).stream().mapToInt(j -> j))); - assertEquals(data.size(), result.size()); - assertContents(data, result); - - result = exerciseOps(data, s -> s.flatMap(i -> IntStream.empty())); - assertEquals(0, result.size()); - - exerciseOps(data, s -> s.flatMap(e -> IntStream.range(0, e))); - exerciseOps(data, s -> s.flatMap(e -> IntStream.range(0, e).limit(10))); - } - - // - - @Test(dataProvider = "LongStreamTestData", dataProviderClass = LongStreamTestDataProvider.class) - public void testLongOps(String name, TestData.OfLong data) { - Collection<Long> result = exerciseOps(data, s -> s.flatMap(i -> Collections.singleton(i).stream().mapToLong(j -> j))); - assertEquals(data.size(), result.size()); - assertContents(data, result); - - result = exerciseOps(data, s -> LongStream.empty()); - assertEquals(0, result.size()); - - exerciseOps(data, s -> s.flatMap(e -> LongStream.range(0, e))); - exerciseOps(data, s -> s.flatMap(e -> LongStream.range(0, e).limit(10))); - } - - // - - @Test(dataProvider = "DoubleStreamTestData", dataProviderClass = DoubleStreamTestDataProvider.class) - public void testDoubleOps(String name, TestData.OfDouble data) { - Collection<Double> result = exerciseOps(data, s -> s.flatMap(i -> Collections.singleton(i).stream().mapToDouble(j -> j))); - assertEquals(data.size(), result.size()); - assertContents(data, result); - - result = exerciseOps(data, s -> DoubleStream.empty()); - assertEquals(0, result.size()); - - exerciseOps(data, s -> s.flatMap(e -> IntStream.range(0, (int) e).asDoubleStream())); - exerciseOps(data, s -> s.flatMap(e -> IntStream.range(0, (int) e).limit(10).asDoubleStream())); - } -}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/java/util/stream/test/org/openjdk/tests/java/util/stream/FlatMapOpTest.java Thu Apr 18 03:46:32 2019 +0100 @@ -0,0 +1,141 @@ +/* + * Copyright (c) 2012, 2016, 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 + * @summary flat-map operations + * @bug 8044047 8076458 + */ + +package org.openjdk.tests.java.util.stream; + +import org.testng.annotations.Test; + +import java.util.Arrays; +import java.util.Collection; +import java.util.Collections; +import java.util.function.Function; +import java.util.stream.*; + +import static java.util.stream.LambdaTestHelpers.*; +import static java.util.stream.ThowableHelper.checkNPE; + +@Test +public class FlatMapOpTest extends OpTestCase { + + public void testNullMapper() { + checkNPE(() -> Stream.of(1).flatMap(null)); + checkNPE(() -> IntStream.of(1).flatMap(null)); + checkNPE(() -> LongStream.of(1).flatMap(null)); + checkNPE(() -> DoubleStream.of(1).flatMap(null)); + } + + static final Function<Integer, Stream<Integer>> integerRangeMapper + = e -> IntStream.range(0, e).boxed(); + + public void testFlatMap() { + String[] stringsArray = {"hello", "there", "", "yada"}; + Stream<String> strings = Arrays.asList(stringsArray).stream(); + assertConcat(strings.flatMap(flattenChars).iterator(), "hellothereyada"); + + assertCountSum(countTo(10).stream().flatMap(mfId), 10, 55); + assertCountSum(countTo(10).stream().flatMap(mfNull), 0, 0); + assertCountSum(countTo(3).stream().flatMap(mfLt), 6, 4); + + exerciseOps(TestData.Factory.ofArray("stringsArray", stringsArray), s -> s.flatMap(flattenChars)); + exerciseOps(TestData.Factory.ofArray("LONG_STRING", new String[] {LONG_STRING}), s -> s.flatMap(flattenChars)); + } + + @Test(dataProvider = "StreamTestData<Integer>", dataProviderClass = StreamTestDataProvider.class) + public void testOps(String name, TestData.OfRef<Integer> data) { + Collection<Integer> result = exerciseOps(data, s -> s.flatMap(mfId)); + assertEquals(data.size(), result.size()); + + result = exerciseOps(data, s -> s.flatMap(mfNull)); + assertEquals(0, result.size()); + + result = exerciseOps(data, s-> s.flatMap(e -> Stream.empty())); + assertEquals(0, result.size()); + } + + @Test(dataProvider = "StreamTestData<Integer>.small", dataProviderClass = StreamTestDataProvider.class) + public void testOpsX(String name, TestData.OfRef<Integer> data) { + exerciseOps(data, s -> s.flatMap(mfLt)); + exerciseOps(data, s -> s.flatMap(integerRangeMapper)); + exerciseOps(data, s -> s.flatMap((Integer e) -> IntStream.range(0, e).boxed().limit(10))); + } + + // + + @Test(dataProvider = "IntStreamTestData", dataProviderClass = IntStreamTestDataProvider.class) + public void testIntOps(String name, TestData.OfInt data) { + Collection<Integer> result = exerciseOps(data, s -> s.flatMap(i -> Collections.singleton(i).stream().mapToInt(j -> j))); + assertEquals(data.size(), result.size()); + assertContents(data, result); + + result = exerciseOps(data, s -> s.flatMap(i -> IntStream.empty())); + assertEquals(0, result.size()); + } + + @Test(dataProvider = "IntStreamTestData.small", dataProviderClass = IntStreamTestDataProvider.class) + public void testIntOpsX(String name, TestData.OfInt data) { + exerciseOps(data, s -> s.flatMap(e -> IntStream.range(0, e))); + exerciseOps(data, s -> s.flatMap(e -> IntStream.range(0, e).limit(10))); + } + + // + + @Test(dataProvider = "LongStreamTestData", dataProviderClass = LongStreamTestDataProvider.class) + public void testLongOps(String name, TestData.OfLong data) { + Collection<Long> result = exerciseOps(data, s -> s.flatMap(i -> Collections.singleton(i).stream().mapToLong(j -> j))); + assertEquals(data.size(), result.size()); + assertContents(data, result); + + result = exerciseOps(data, s -> LongStream.empty()); + assertEquals(0, result.size()); + } + + @Test(dataProvider = "LongStreamTestData.small", dataProviderClass = LongStreamTestDataProvider.class) + public void testLongOpsX(String name, TestData.OfLong data) { + exerciseOps(data, s -> s.flatMap(e -> LongStream.range(0, e))); + exerciseOps(data, s -> s.flatMap(e -> LongStream.range(0, e).limit(10))); + } + + // + + @Test(dataProvider = "DoubleStreamTestData", dataProviderClass = DoubleStreamTestDataProvider.class) + public void testDoubleOps(String name, TestData.OfDouble data) { + Collection<Double> result = exerciseOps(data, s -> s.flatMap(i -> Collections.singleton(i).stream().mapToDouble(j -> j))); + assertEquals(data.size(), result.size()); + assertContents(data, result); + + result = exerciseOps(data, s -> DoubleStream.empty()); + assertEquals(0, result.size()); + } + + @Test(dataProvider = "DoubleStreamTestData.small", dataProviderClass = DoubleStreamTestDataProvider.class) + public void testDoubleOpsX(String name, TestData.OfDouble data) { + exerciseOps(data, s -> s.flatMap(e -> IntStream.range(0, (int) e).asDoubleStream())); + exerciseOps(data, s -> s.flatMap(e -> IntStream.range(0, (int) e).limit(10).asDoubleStream())); + } +}
--- a/test/java/util/stream/test/org/openjdk/tests/java/util/stream/SequentialOpTest.java Wed Apr 17 03:47:21 2019 +0100 +++ b/test/java/util/stream/test/org/openjdk/tests/java/util/stream/SequentialOpTest.java Thu Apr 18 03:46:32 2019 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2016, 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 @@ -94,7 +94,7 @@ } @SuppressWarnings({"rawtypes", "unchecked"}) - @Test(dataProvider = "StreamTestData<Integer>", dataProviderClass = StreamTestDataProvider.class) + @Test(dataProvider = "StreamTestData<Integer>.mini", dataProviderClass = StreamTestDataProvider.class) public void testMixedSeqPar(String name, TestData.OfRef<Integer> data) { Function<Integer, Integer> id = LambdaTestHelpers.identity(); UnaryOperator<Stream<Integer>>[] changers
--- a/test/java/util/stream/test/org/openjdk/tests/java/util/stream/StreamBuilderTest.java Wed Apr 17 03:47:21 2019 +0100 +++ b/test/java/util/stream/test/org/openjdk/tests/java/util/stream/StreamBuilderTest.java Thu Apr 18 03:46:32 2019 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2014, 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,6 +38,7 @@ import java.util.stream.TestData; import static java.util.stream.Collectors.toList; +import static java.util.stream.ThowableHelper.checkISE; @Test public class StreamBuilderTest extends OpTestCase { @@ -52,23 +53,6 @@ return sizes.stream().map(i -> new Object[] { i }).toArray(Object[][]::new); } - private void checkException(Class<? extends Exception> ce, Runnable r) { - Exception caught = null; - try { - r.run(); - } catch (Exception e) { - caught = e; - } - - assertNotNull(caught); - assertTrue(ce.isInstance(caught)); - } - - private void checkISE(Runnable r) { - checkException(IllegalStateException.class, r); - } - - // @Test public void testSingleton() {
--- a/test/java/util/stream/test/org/openjdk/tests/java/util/stream/StreamCloseTest.java Wed Apr 17 03:47:21 2019 +0100 +++ b/test/java/util/stream/test/org/openjdk/tests/java/util/stream/StreamCloseTest.java Thu Apr 18 03:46:32 2019 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -20,6 +20,13 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + +/* + * @test + * @summary close handlers and closing streams + * @bug 8044047 + */ + package org.openjdk.tests.java.util.stream; import java.util.Arrays; @@ -29,14 +36,14 @@ import org.testng.annotations.Test; import static java.util.stream.LambdaTestHelpers.countTo; +import static java.util.stream.ThowableHelper.checkNPE; -/** - * StreamCloseTest - * - * @author Brian Goetz - */ @Test(groups = { "serialization-hostile" }) public class StreamCloseTest extends OpTestCase { + public void testNullCloseHandler() { + checkNPE(() -> Stream.of(1).onClose(null)); + } + public void testEmptyCloseHandler() { try (Stream<Integer> ints = countTo(100).stream()) { ints.forEach(i -> {});
--- a/test/java/util/stream/test/org/openjdk/tests/java/util/stream/SummaryStatisticsTest.java Wed Apr 17 03:47:21 2019 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,88 +0,0 @@ -/* - * Copyright (c) 2012, 2013, 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 org.openjdk.tests.java.util.stream; - -import java.util.ArrayList; -import java.util.DoubleSummaryStatistics; -import java.util.IntSummaryStatistics; -import java.util.List; -import java.util.LongSummaryStatistics; -import java.util.stream.Collectors; -import java.util.stream.OpTestCase; - -import org.testng.annotations.Test; - -import static java.util.stream.LambdaTestHelpers.countTo; - -/** - * TestSummaryStatistics - * - * @author Brian Goetz - */ -@Test -public class SummaryStatisticsTest extends OpTestCase { - public void testIntStatistics() { - List<IntSummaryStatistics> instances = new ArrayList<>(); - instances.add(countTo(1000).stream().collect(Collectors.summarizingInt(i -> i))); - instances.add(countTo(1000).stream().mapToInt(i -> i).summaryStatistics()); - instances.add(countTo(1000).parallelStream().collect(Collectors.summarizingInt(i -> i))); - instances.add(countTo(1000).parallelStream().mapToInt(i -> i).summaryStatistics()); - - for (IntSummaryStatistics stats : instances) { - assertEquals(stats.getCount(), 1000); - assertEquals(stats.getSum(), countTo(1000).stream().mapToInt(i -> i).sum()); - assertEquals(stats.getMax(), 1000); - assertEquals(stats.getMin(), 1); - } - } - - public void testLongStatistics() { - List<LongSummaryStatistics> instances = new ArrayList<>(); - instances.add(countTo(1000).stream().collect(Collectors.summarizingLong(i -> i))); - instances.add(countTo(1000).stream().mapToLong(i -> i).summaryStatistics()); - instances.add(countTo(1000).parallelStream().collect(Collectors.summarizingLong(i -> i))); - instances.add(countTo(1000).parallelStream().mapToLong(i -> i).summaryStatistics()); - - for (LongSummaryStatistics stats : instances) { - assertEquals(stats.getCount(), 1000); - assertEquals(stats.getSum(), (long) countTo(1000).stream().mapToInt(i -> i).sum()); - assertEquals(stats.getMax(), 1000L); - assertEquals(stats.getMin(), 1L); - } - } - - public void testDoubleStatistics() { - List<DoubleSummaryStatistics> instances = new ArrayList<>(); - instances.add(countTo(1000).stream().collect(Collectors.summarizingDouble(i -> i))); - instances.add(countTo(1000).stream().mapToDouble(i -> i).summaryStatistics()); - instances.add(countTo(1000).parallelStream().collect(Collectors.summarizingDouble(i -> i))); - instances.add(countTo(1000).parallelStream().mapToDouble(i -> i).summaryStatistics()); - - for (DoubleSummaryStatistics stats : instances) { - assertEquals(stats.getCount(), 1000); - assertEquals(stats.getSum(), (double) countTo(1000).stream().mapToInt(i -> i).sum()); - assertEquals(stats.getMax(), 1000.0); - assertEquals(stats.getMin(), 1.0); - } - } -}
--- a/test/javax/imageio/plugins/bmp/BMP8BPPLoadTest.java Wed Apr 17 03:47:21 2019 +0100 +++ b/test/javax/imageio/plugins/bmp/BMP8BPPLoadTest.java Thu Apr 18 03:46:32 2019 +0100 @@ -23,26 +23,23 @@ /** * @test - * @bug 8182461 + * @bug 8182461 8212914 * @summary Test verifies that the 8BPP indexed color BMP image file is read properly - * @requires BMP8BPPLoadTest.PNG * @run main BMP8BPPLoadTest - * @author fairoz.matte */ import java.awt.image.BufferedImage; import java.io.File; import java.io.IOException; +import java.io.ByteArrayInputStream; import javax.imageio.ImageIO; - public class BMP8BPPLoadTest { public BMP8BPPLoadTest() throws IOException { try { - BufferedImage image = ImageIO.read(new File("BMP8BPPLoadTest.bmp")); - System.out.println("Test Passed ImageIO.read able to read the file"); + ImageIO.read(ImageIO.createImageInputStream(new ByteArrayInputStream(BMP8BPPIMAGE))); } catch (IndexOutOfBoundsException iobe) { - System.out.println("Test Failed with ImageIO.read throwing IndexOutOfBoundsException"); + throw new RuntimeException("Test failed: ImageIO.read throwing IndexOutOfBoundsException"); } } @@ -50,4 +47,44 @@ public static void main(String args[]) throws IOException{ BMP8BPPLoadTest test = new BMP8BPPLoadTest(); } + + public static byte[] BMP8BPPIMAGE = { + (byte)0x42, (byte)0x4d, (byte)0x1a, (byte)0x01, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, + (byte)0x00, (byte)0x00, (byte)0xca, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x7c, (byte)0x00, + (byte)0x00, (byte)0x00, (byte)0x0f, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x0a, (byte)0x00, + (byte)0x00, (byte)0x00, (byte)0x01, (byte)0x00, (byte)0x04, (byte)0x00, (byte)0x00, (byte)0x00, + (byte)0x00, (byte)0x00, (byte)0x50, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x13, (byte)0x0b, + (byte)0x00, (byte)0x00, (byte)0x13, (byte)0x0b, (byte)0x00, (byte)0x00, (byte)0x10, (byte)0x00, + (byte)0x00, (byte)0x00, (byte)0x10, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, + (byte)0xff, (byte)0x00, (byte)0x00, (byte)0xff, (byte)0x00, (byte)0x00, (byte)0xff, (byte)0x00, + (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0xff, (byte)0x42, (byte)0x47, + (byte)0x52, (byte)0x73, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, + (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, + (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, + (byte)0xc0, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0xff, (byte)0x00, (byte)0x00, (byte)0xff, + (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, + (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x40, (byte)0x00, (byte)0x00, + (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, + (byte)0x00, (byte)0x00, (byte)0x04, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, + (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, + (byte)0x00, (byte)0x00, (byte)0xff, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, + (byte)0xff, (byte)0x00, (byte)0xff, (byte)0x00, (byte)0xfc, (byte)0x00, (byte)0x00, (byte)0xff, + (byte)0x00, (byte)0x00, (byte)0xff, (byte)0xff, (byte)0xff, (byte)0x00, (byte)0x00, (byte)0x00, + (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, + (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, + (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, + (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, + (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, + (byte)0x00, (byte)0x00, (byte)0x11, (byte)0x11, (byte)0x11, (byte)0x11, (byte)0x11, (byte)0x11, + (byte)0x11, (byte)0x10, (byte)0x11, (byte)0x11, (byte)0x11, (byte)0x11, (byte)0x11, (byte)0x11, + (byte)0x11, (byte)0x10, (byte)0x11, (byte)0x11, (byte)0x11, (byte)0x11, (byte)0x11, (byte)0x11, + (byte)0x11, (byte)0x10, (byte)0x11, (byte)0x11, (byte)0x11, (byte)0x11, (byte)0x11, (byte)0x11, + (byte)0x11, (byte)0x10, (byte)0x11, (byte)0x11, (byte)0x11, (byte)0x11, (byte)0x11, (byte)0x11, + (byte)0x11, (byte)0x10, (byte)0x11, (byte)0x11, (byte)0x11, (byte)0x11, (byte)0x11, (byte)0x11, + (byte)0x11, (byte)0x10, (byte)0x11, (byte)0x11, (byte)0x11, (byte)0x11, (byte)0x11, (byte)0x11, + (byte)0x11, (byte)0x10, (byte)0x11, (byte)0x11, (byte)0x11, (byte)0x11, (byte)0x11, (byte)0x11, + (byte)0x11, (byte)0x10, (byte)0x11, (byte)0x11, (byte)0x11, (byte)0x11, (byte)0x11, (byte)0x11, + (byte)0x11, (byte)0x10, (byte)0x11, (byte)0x11, (byte)0x11, (byte)0x11, (byte)0x11, (byte)0x11, + (byte)0x11, (byte)0x10 + }; }
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/javax/swing/JTextField/I18NViewNoWrapMinSpan/I18NViewNoWrapMinSpan.java Thu Apr 18 03:46:32 2019 +0100 @@ -0,0 +1,56 @@ +/* + * Copyright (c) 2015, 2019, 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 8076164 + @summary [JTextField] When input too long Thai character, cursor's behavior + is odd + @author Semyon Sadetsky +*/ + +import javax.swing.JTextField; +import javax.swing.SwingUtilities; +import javax.swing.text.BadLocationException; + +public class I18NViewNoWrapMinSpan { + + public static void main(String[] args) throws Exception { + SwingUtilities.invokeAndWait(() -> { + try { + JTextField textField = new JTextField(15); + textField.setText("\u0E2112345"); + float noSpaceMin = textField.getUI().getRootView(textField) + .getMinimumSpan(0); + textField.getDocument().insertString(3, " ", null); + if (noSpaceMin > textField.getUI().getRootView(textField) + .getMinimumSpan(0)) { + throw new RuntimeException( + "Minimum span is calculated for wrapped text"); + } + } catch (BadLocationException e) { + throw new RuntimeException(e); + } + }); + System.out.println("ok"); + } +}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/javax/swing/JTextPane/JTextPaneDocumentAlignment.java Thu Apr 18 03:46:32 2019 +0100 @@ -0,0 +1,99 @@ +/* + * Copyright (c) 2015, 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 8132136 + @summary [PIT] RTL orientation in JEditorPane is broken + @author Semyon Sadetsky + */ + +import javax.swing.*; +import javax.swing.text.BadLocationException; +import javax.swing.text.SimpleAttributeSet; +import javax.swing.text.StyleConstants; +import java.awt.*; + +public class JTextPaneDocumentAlignment { + + private static JFrame frame; + private static JTextPane jTextPane; + private static int position; + + public static void main(String[] args) throws Exception{ + SwingUtilities.invokeAndWait(new Runnable() { + @Override + public void run() { + frame = new JFrame(); + frame.setUndecorated(true); + frame.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE); + frame.setSize(200, 200); + jTextPane = new JTextPane(); + jTextPane.setContentType("text/html"); + jTextPane.setText( + "<html><body><b id='test'>Test</b></body></html>"); + SimpleAttributeSet right = new SimpleAttributeSet(); + StyleConstants.setAlignment(right, StyleConstants.ALIGN_RIGHT); + jTextPane.getStyledDocument() + .setParagraphAttributes(0, 10, right, true); + frame.getContentPane().add(jTextPane); + frame.setVisible(true); + } + }); + Robot robot = new Robot(); + robot.waitForIdle(); + robot.delay(200); + SwingUtilities.invokeAndWait(new Runnable() { + @Override + public void run() { + try { + position = jTextPane.modelToView(1).x; + SimpleAttributeSet center = new SimpleAttributeSet(); + StyleConstants.setAlignment(center, + StyleConstants.ALIGN_CENTER); + jTextPane.getStyledDocument() + .setParagraphAttributes(0, 10, center, true); + } catch (BadLocationException e) { + e.printStackTrace(); + } + } + }); + if(position < 100) { + throw new RuntimeException("Text is not right aligned " + position); + } + SwingUtilities.invokeAndWait(new Runnable() { + @Override + public void run() { + try { + position = jTextPane.modelToView(1).x; + } catch (BadLocationException e) { + e.printStackTrace(); + } + frame.dispose(); + } + }); + if(position < 20) { + throw new RuntimeException("Text is not center aligned " + position); + } + System.out.println("ok"); + } +}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/javax/swing/JTextPane/JTextPaneDocumentWrapping.java Thu Apr 18 03:46:32 2019 +0100 @@ -0,0 +1,101 @@ +/* + * Copyright (c) 2015, 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 8133108 + @summary [PIT] Container size is wrong in JEditorPane + @author Semyon Sadetsky + */ + +import javax.swing.*; +import javax.swing.text.BadLocationException; +import javax.swing.text.SimpleAttributeSet; +import javax.swing.text.html.CSS; +import java.awt.*; + +public class JTextPaneDocumentWrapping { + + private static JFrame frame; + private static JTextPane jTextPane; + private static int position; + + public static void main(String[] args) throws Exception{ + SwingUtilities.invokeAndWait(new Runnable() { + @Override + public void run() { + frame = new JFrame(); + frame.setUndecorated(true); + frame.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE); + frame.setSize(200, 200); + jTextPane = new JTextPane(); + jTextPane.setContentType("text/html"); + jTextPane.setText( + "<html><body><b id='test'>Test Test Test Test Test Test " + + "Test Test Test Test Test Test Test Test Test Test " + + "Test Test Test Test Test Test Test Test Test Test" + + "</b></body></html>"); + frame.getContentPane().add(jTextPane); + frame.setVisible(true); + } + }); + Robot robot = new Robot(); + robot.waitForIdle(); + robot.delay(200); + + SwingUtilities.invokeAndWait(new Runnable() { + @Override + public void run() { + try { + position = jTextPane.modelToView(100).y; + SimpleAttributeSet wrap = new SimpleAttributeSet(); + wrap.addAttribute(CSS.Attribute.WHITE_SPACE, "nowrap"); + jTextPane.getStyledDocument() + .setParagraphAttributes(0, 10, wrap, true); + } catch (BadLocationException e) { + e.printStackTrace(); + } + } + }); + if(position < 40) { + throw new RuntimeException("Text is not wrapped " + position); + } + robot.waitForIdle(); + robot.delay(200); + SwingUtilities.invokeAndWait(new Runnable() { + @Override + public void run() { + try { + position = jTextPane.modelToView(100).y; + } catch (BadLocationException e) { + e.printStackTrace(); + } + frame.dispose(); + } + }); + if(position > 20) { + throw new RuntimeException("Text is wrapped " + position); + } + System.out.println("ok"); + + } +}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/lib/security/SecurityUtils.java Thu Apr 18 03:46:32 2019 +0100 @@ -0,0 +1,56 @@ +/* + * Copyright (c) 2019, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +import java.io.File; +import java.io.FileInputStream; +import java.security.KeyStore; + +/** + * Common library for various security test helper functions. + */ +public final class SecurityUtils { + + private static String getCacerts() { + String sep = File.separator; + return System.getProperty("java.home") + sep + + "lib" + sep + "security" + sep + "cacerts"; + } + + /** + * Returns the cacerts keystore with the configured CA certificates. + */ + public static KeyStore getCacertsKeyStore() throws Exception { + File file = new File(getCacerts()); + if (!file.exists()) { + return null; + } + + KeyStore ks = KeyStore.getInstance(KeyStore.getDefaultType()); + try (FileInputStream fis = new FileInputStream(file)) { + ks.load(fis, null); + } + return ks; + } + + private SecurityUtils() {} +}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/sun/nio/cs/TestGB18030.java Thu Apr 18 03:46:32 2019 +0100 @@ -0,0 +1,82 @@ +/* + * Copyright (c) 2018, 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 8211382 + * @summary Check GB18030 + * @modules jdk.charsets + */ + +import java.io.*; +import java.nio.*; +import java.nio.charset.*; + +public class TestGB18030 { + public static void gb18030_1(boolean useDirect) throws Exception { + for(char ch : new char[]{'\uFFFE', '\uFFFF'}) { + char[] ca = new char[]{ch}; + Charset cs = Charset.forName("GB18030"); + CharsetEncoder ce = cs.newEncoder(); + CharsetDecoder cd = cs.newDecoder(); + CharBuffer cb = CharBuffer.wrap(ca); + ByteBuffer bb; + if (useDirect) { + bb = ByteBuffer.allocateDirect( + (int)Math.ceil(ce.maxBytesPerChar())); + } else { + bb = ByteBuffer.allocate( + (int)Math.ceil(ce.maxBytesPerChar())); + } + CoderResult cr = ce.encode(cb, bb, true); + if (!cr.isUnderflow()) { + throw new RuntimeException( + String.format("Encoder Error: \\u%04X: direct=%b: %s", + (int)ch, + useDirect, + cr.toString())); + } + bb.position(0); + cb = CharBuffer.allocate((int)Math.ceil( + cd.maxCharsPerByte()*bb.limit())); + cr = cd.decode(bb, cb, true); + if (!cr.isUnderflow()) { + throw new RuntimeException( + String.format("Decoder Error: \\u%04X: direct=%b: %s", + (int)ch, + useDirect, + cr.toString())); + } + if (ca[0] != cb.get(0)) { + throw new RuntimeException( + String.format("direct=%b: \\u%04X <> \\u%04X", + useDirect, + (int)ca[0], + (int)cb.get(0))); + } + } + } + public static void main(String args[]) throws Exception { + gb18030_1(false); + gb18030_1(true); + } +}
--- a/test/sun/nio/cs/TestISO2022JP.java Wed Apr 17 03:47:21 2019 +0100 +++ b/test/sun/nio/cs/TestISO2022JP.java Thu Apr 18 03:46:32 2019 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2008, 2018, 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,7 +22,7 @@ */ /* @test - @bug 4626545 4879522 4913711 4119445 + @bug 4626545 4879522 4913711 4119445 8211382 @summary Check full coverage encode/decode for ISO-2022-JP */ @@ -608,5 +608,18 @@ if (encoded[i] != expected[i]) throw new Exception("ISO-2022-JP Decoder error"); } + + // Test for 11 iso2022jp decoder + encoded = new byte[] { + (byte)0x1B, (byte)0x28, (byte)0x49, (byte)0x60, + (byte)0x1B, (byte)0x28, (byte)0x42, + }; + String unexpectedStr = "\uffa0"; + String expectedStr = "\ufffd"; + if (new String(encoded, "ISO2022JP").equals(unexpectedStr)) { + throw new Exception("ISO2022JP Decoder error: \\uFFA0"); + } else if (!new String(encoded, "ISO2022JP").equals(expectedStr)) { + throw new Exception("ISO2022JP Decoder error: \\uFFFD"); + } } }
--- a/test/sun/security/krb5/auto/BadKdc.java Wed Apr 17 03:47:21 2019 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,221 +0,0 @@ -/* - * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -import java.io.*; -import java.net.BindException; -import java.net.DatagramPacket; -import java.net.DatagramSocket; -import java.net.InetAddress; -import java.util.regex.Matcher; -import java.util.regex.Pattern; -import javax.security.auth.login.LoginException; -import sun.security.krb5.Asn1Exception; -import sun.security.krb5.Config; - -public class BadKdc { - - // Matches the krb5 debug output: - // >>> KDCCommunication: kdc=kdc.rabbit.hole UDP:14319, timeout=2000,... - // ^ kdc# ^ timeout - static final Pattern re = Pattern.compile( - ">>> KDCCommunication: kdc=kdc.rabbit.hole UDP:(\\d)...., " + - "timeout=(\\d+),"); - - // Ratio for timeout values of all timeout tests. Not final so that - // each test can choose their own. - static float ratio = 2f; - - static void setRatio(float ratio) { - BadKdc.ratio = ratio; - } - - static float getRatio() { - return ratio; - } - - // Gets real timeout value. This method is called when writing krb5.conf - static int toReal(int from) { - return (int)(from * ratio + .5); - } - - // De-ratio a millisecond value to second - static int toSymbolicSec(int from) { - return (int)(from / ratio / 1000f + 0.5); - } - - /* - * There are several cases this test fails: - * - * 1. The random selected port is used by another process. No good way to - * prevent this happening, coz krb5.conf must be written before KDC starts. - * There are two different outcomes: - * - * a. Cannot start the KDC. A BindException thrown. - * b. When trying to access a non-existing KDC, a response is received! - * Most likely a Asn1Exception thrown - * - * 2. Even if a KDC is started, and more than 20 seconds pass by, a timeout - * can still happens for the first UDP request. In fact, the KDC did not - * received it at all. This happens on almost all platforms, especially - * solaris-i586 and solaris-x64. - * - * To avoid them: - * - * 1. Catch those exceptions and ignore - * - * 2. a. Make the timeout longer? useless - * b. Read the output carefully, if there is a timeout, it's OK. - * Just make sure the retries times and KDCs are correct. - * This is tough. - * c. Feed the KDC a UDP packet first. The current "solution". - */ - public static void go(String... expected) - throws Exception { - try { - go0(expected); - } catch (BindException be) { - System.out.println("The random port is used by another process"); - } catch (LoginException le) { - Throwable cause = le.getCause(); - if (cause instanceof Asn1Exception) { - System.out.println("Bad packet possibly from another process"); - return; - } - throw le; - } - } - - public static void go0(String... expected) - throws Exception { - System.setProperty("sun.security.krb5.debug", "true"); - - // Idle UDP sockets will trigger a SocketTimeoutException, without it, - // a PortUnreachableException will be thrown. - DatagramSocket d1 = null, d2 = null, d3 = null; - - // Make sure KDCs' ports starts with 1 and 2 and 3, - // useful for checking debug output. - int p1 = 10000 + new java.util.Random().nextInt(10000); - int p2 = 20000 + new java.util.Random().nextInt(10000); - int p3 = 30000 + new java.util.Random().nextInt(10000); - - FileWriter fw = new FileWriter("alternative-krb5.conf"); - - fw.write("[libdefaults]\n" + - "default_realm = " + OneKDC.REALM + "\n" + - "kdc_timeout = " + toReal(2000) + "\n"); - fw.write("[realms]\n" + OneKDC.REALM + " = {\n" + - "kdc = " + OneKDC.KDCHOST + ":" + p1 + "\n" + - "kdc = " + OneKDC.KDCHOST + ":" + p2 + "\n" + - "kdc = " + OneKDC.KDCHOST + ":" + p3 + "\n" + - "}\n"); - - fw.close(); - System.setProperty("java.security.krb5.conf", "alternative-krb5.conf"); - Config.refresh(); - - // Turn on k3 only - d1 = new DatagramSocket(p1); - d2 = new DatagramSocket(p2); - KDC k3 = on(p3); - - test(expected[0]); - test(expected[1]); - Config.refresh(); - test(expected[2]); - - k3.terminate(); // shutdown k3 - d3 = new DatagramSocket(p3); - - d2.close(); - on(p2); // k2 is on - - test(expected[3]); - d1.close(); - on(p1); // k1 and k2 is on - test(expected[4]); - - d3.close(); - } - - private static KDC on(int p) throws Exception { - KDC k = new KDC(OneKDC.REALM, OneKDC.KDCHOST, p, true); - k.addPrincipal(OneKDC.USER, OneKDC.PASS); - k.addPrincipalRandKey("krbtgt/" + OneKDC.REALM); - // Feed a packet to newly started KDC to warm it up - System.err.println("-------- IGNORE THIS ERROR MESSAGE --------"); - new DatagramSocket().send( - new DatagramPacket("Hello".getBytes(), 5, - InetAddress.getByName(OneKDC.KDCHOST), p)); - return k; - } - - private static void test(String expected) throws Exception { - ByteArrayOutputStream bo = new ByteArrayOutputStream(); - System.out.println("----------------- TEST -----------------"); - try { - test0(bo, expected); - } catch (Exception e) { - System.out.println("----------------- ERROR -----------------"); - System.out.println(new String(bo.toByteArray())); - System.out.println("--------------- ERROR END ---------------"); - throw e; - } - } - - /** - * One round of test for max_retries and timeout. - * @param expected the expected kdc# timeout kdc# timeout... - */ - private static void test0(ByteArrayOutputStream bo, String expected) - throws Exception { - PrintStream oldout = System.out; - boolean failed = false; - System.setOut(new PrintStream(bo)); - try { - Context.fromUserPass(OneKDC.USER, OneKDC.PASS, false); - } catch (Exception e) { - failed = true; - } finally { - System.setOut(oldout); - } - - String[] lines = new String(bo.toByteArray()).split("\n"); - StringBuilder sb = new StringBuilder(); - for (String line: lines) { - Matcher m = re.matcher(line); - if (m.find()) { - System.out.println(line); - sb.append(m.group(1)) - .append(toSymbolicSec(Integer.parseInt(m.group(2)))); - } - } - if (failed) sb.append('-'); - - String output = sb.toString(); - System.out.println("Expected: " + expected + ", actual " + output); - if (!output.matches(expected)) { - throw new Exception("Does not match"); - } - } -}
--- a/test/sun/security/krb5/auto/BadKdc1.java Wed Apr 17 03:47:21 2019 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,60 +0,0 @@ -/* - * Copyright (c) 2009, 2012, 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 6843127 - * @run main/othervm/timeout=300 -Dsun.net.spi.nameservice.provider.1=ns,mock BadKdc1 - * @summary krb5 should not try to access unavailable kdc too often - */ - -import java.security.Security; - -public class BadKdc1 { - - public static void main(String[] args) - throws Exception { - - // 5 sec is default timeout for tryLess - if (BadKdc.getRatio() > 2.5) { - Security.setProperty("krb5.kdc.bad.policy", - "tryLess:1," + BadKdc.toReal(2000)); - } else { - Security.setProperty("krb5.kdc.bad.policy", "tryLess"); - } - - BadKdc.go( - "121212222222(32){1,2}1222(32){1,2}", // 1 2 - // The above line means try kdc1 for 2 seconds then kdc1 - // for 2 seconds... finally kdc3 for 2 seconds. - "1222(32){1,2}1222(32){1,2}", // 1 2 - // refresh - "121212222222(32){1,2}1222(32){1,2}", // 1 2 - // k3 off k2 on - "(122212(22){1,2}|1222323232-)", // 1 - // k1 on - "(12(12){1,2}|122232-)" // empty - ); - } -} -
--- a/test/sun/security/krb5/auto/BadKdc2.java Wed Apr 17 03:47:21 2019 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,55 +0,0 @@ -/* - * Copyright (c) 2009, 2012, 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 6843127 - * @run main/othervm/timeout=300 -Dsun.net.spi.nameservice.provider.1=ns,mock BadKdc2 - * @summary krb5 should not try to access unavailable kdc too often - */ - -import java.io.*; -import java.security.Security; - -public class BadKdc2 { - - public static void main(String[] args) - throws Exception { - - // 1 sec is too short. - BadKdc.setRatio(3.0f); - - Security.setProperty( - "krb5.kdc.bad.policy", "tryLess:2," + BadKdc.toReal(1000)); - BadKdc.go( - "121212222222(32){1,2}11112121(32){1,2}", // 1 2 - "11112121(32){1,2}11112121(32){1,2}", // 1 2 - // refresh - "121212222222(32){1,2}11112121(32){1,2}", // 1 2 - // k3 off k2 on - "1111(21){1,2}1111(22){1,2}", // 1 - // k1 on - "(11){1,2}(12){1,2}" // empty - ); - } -}
--- a/test/sun/security/krb5/auto/BadKdc3.java Wed Apr 17 03:47:21 2019 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,50 +0,0 @@ -/* - * Copyright (c) 2009, 2012, 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 6843127 - * @run main/othervm/timeout=300 -Dsun.net.spi.nameservice.provider.1=ns,mock BadKdc3 - * @summary krb5 should not try to access unavailable kdc too often - */ - -import java.io.*; -import java.security.Security; - -public class BadKdc3 { - - public static void main(String[] args) - throws Exception { - Security.setProperty("krb5.kdc.bad.policy", "tryLast"); - BadKdc.go( - "121212222222(32){2,4}", // 1 2 - "(32){2,4}", // 1 2 - // refresh - "121212222222(32){2,4}", // 1 2 - // k3 off k2 on - "323232121212(22){2,4}", // 1 3 - // k1 on - "(22){2,4}" // 1 3 - ); - } -}
--- a/test/sun/security/krb5/auto/BadKdc4.java Wed Apr 17 03:47:21 2019 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,50 +0,0 @@ -/* - * Copyright (c) 2009, 2012, 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 6843127 - * @run main/othervm/timeout=300 -Dsun.net.spi.nameservice.provider.1=ns,mock BadKdc4 - * @summary krb5 should not try to access unavailable kdc too often - */ - -import java.io.*; -import java.security.Security; - -public class BadKdc4 { - - public static void main(String[] args) - throws Exception { - Security.setProperty("krb5.kdc.bad.policy", ""); - BadKdc.go( - "121212222222(32){1,2}121212222222(32){1,2}", - "121212222222(32){1,2}121212222222(32){1,2}", - // refresh - "121212222222(32){1,2}121212222222(32){1,2}", - // k3 off k2 on - "121212(22){1,2}121212(22){1,2}", - // k1 on - "(12){2,4}" - ); - } -}
--- a/test/sun/security/krb5/auto/CommMatcher.java Wed Apr 17 03:47:21 2019 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,86 +0,0 @@ -/* - * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -import java.util.ArrayList; -import java.util.List; -import java.util.regex.Matcher; -import java.util.regex.Pattern; - -/** - * Matches the krb5 debug output: - * >>> KDCCommunication: kdc=host UDP:11555, timeout=100,Attempt =1, #bytes=138 - * - * Example: - * CommMatcher cm = new CommMatcher(); - * cm.addPort(12345).addPort(23456); - * for (String line : debugOutput) { - * if (cm.match(line)) { - * println("KDC: %c, %s, Timeout: %d\n", - * cm.kdc(), cm.protocol(), cm.timeout()); - * } - * } - */ -public class CommMatcher { - - static final Pattern re = Pattern.compile( - ">>> KDCCommunication: kdc=\\S+ (TCP|UDP):(\\d+), " + - "timeout=(\\d+),Attempt\\s*=(\\d+)"); - - List<Integer> kdcPorts = new ArrayList<>(); - Matcher matcher; - - /** - * Add KDC ports one by one. The 1st KDC will be 'a' in {@link #kdc()}, - * 2nd is 'b', etc, etc. - */ - public CommMatcher addPort(int port) { - if (port > 0) { - kdcPorts.add(port); - } else { - kdcPorts.clear(); - } - return this; - } - - public boolean match(String line) { - matcher = re.matcher(line); - return matcher.find(); - } - - public String protocol() { - return matcher.group(1); - } - - public char kdc() { - int port = Integer.parseInt(matcher.group(2)); - return (char)(kdcPorts.indexOf(port) + 'a'); - } - - public int timeout() { - return BadKdc.toSymbolicSec(Integer.parseInt(matcher.group(3))); - } - - public int attempt() { - return Integer.parseInt(matcher.group(4)); - } -}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/sun/security/krb5/auto/KdcPolicy.java Thu Apr 18 03:46:32 2019 +0100 @@ -0,0 +1,366 @@ +/* + * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +import java.io.*; +import java.net.DatagramSocket; +import java.net.ServerSocket; +import java.nio.file.Files; +import java.nio.file.Paths; +import java.security.Security; +import java.util.ArrayList; +import java.util.List; +import java.util.Random; +import java.util.regex.Matcher; +import java.util.regex.Pattern; +import javax.security.auth.login.LoginException; +import sun.security.krb5.Asn1Exception; +import sun.security.krb5.Config; + +/* + * @test + * @bug 8164656 + * @run main/othervm -Dsun.net.spi.nameservice.provider.1=ns,mock KdcPolicy udp + * @run main/othervm -Dsun.net.spi.nameservice.provider.1=ns,mock KdcPolicy tcp + * @summary krb5.kdc.bad.policy test + */ +public class KdcPolicy { + + // Is this test on UDP? + static boolean udp; + + public static void main(String[] args) throws Exception { + + udp = args[0].equals("udp"); + + try { + main0(); + } catch (LoginException le) { + Throwable cause = le.getCause(); + if (cause instanceof Asn1Exception) { + System.out.println("Another process sends a packet to " + + "this server. Ignored."); + return; + } + throw le; + } + } + + static DebugMatcher cm = new DebugMatcher(); + + static void main0() throws Exception { + + System.setProperty("sun.security.krb5.debug", "true"); + + // One real KDC. Must be created before fake KDCs + // to read the TestHosts file. + OneKDC kdc = new OneKDC(null); + + // Two fake KDCs, d1 and d2 only listen but do not respond. + + if (udp) { + try (DatagramSocket d1 = new DatagramSocket(); + DatagramSocket d2 = new DatagramSocket()) { + run(d1.getLocalPort(), d2.getLocalPort(), kdc.getPort()); + } + } else { + try (ServerSocket d1 = new ServerSocket(0); + ServerSocket d2 = new ServerSocket(0)) { + run(d1.getLocalPort(), d2.getLocalPort(), kdc.getPort()); + } + } + } + + static void run(int p1, int p2, int p3) throws Exception { + + // cm.kdc() will return a and b for fake KDCs, and c for real KDC. + cm.addPort(-1).addPort(p1).addPort(p2).addPort(p3); + + System.setProperty("java.security.krb5.conf", "alternative-krb5.conf"); + + // Check default timeout is 30s. Use real KDC only, otherwise too + // slow to wait for timeout. + writeConf(-1, -1, p3); + test("c30000c30000"); + + // 1. Default policy is tryLast + //Security.setProperty("krb5.kdc.bad.policy", "tryLast"); + + // Need a real KDC, otherwise there is no last good. + // This test waste 3 seconds waiting for d1 to timeout. + // It is possible the real KDC cannot fulfil the request + // in 3s, so it might fail (either 1st time or 2nd time). + writeConf(1, 3000, p1, p3); + test("a3000c3000c3000|a3000c3000-|a3000c3000c3000-"); + + // If a test case won't use a real KDC, it can be sped up. + writeConf(3, 5, p1, p2); + test("a5a5a5b5b5b5-"); // default max_retries == 3 + test("a5a5a5b5b5b5-"); // all bad means no bad + + // 2. No policy. + Security.setProperty("krb5.kdc.bad.policy", ""); + Config.refresh(); + + // This case needs a real KDC, otherwise, all bad means no + // bad and we cannot tell the difference. This case waste 3 + // seconds on d1 to timeout twice. It is possible the real KDC + // cannot fulfil the request within 3s, so it might fail + // (either 1st time or 2nd time). + writeConf(1, 3000, p1, p3); + test("a3000c3000a3000c3000|a3000c3000-|a3000c3000a3000c3000-"); + + // 3. tryLess with no argument means tryLess:1,5000 + Security.setProperty("krb5.kdc.bad.policy", "tryLess"); + + // This case will waste 11s. We are checking that the default + // value of 5000 in tryLess is only used if it's less than timeout + // in krb5.conf + writeConf(1, 6000, p1); + test("a6000-"); // timeout in krb5.conf is 6s + test("a5000-"); // tryLess to 5s. This line can be made faster if + // d1 is a read KDC, but we have no existing method + // to start KDC on an existing ServerSocket (port). + + writeConf(-1, 4, p1, p2); + test("a4a4a4b4b4b4-"); // default max_retries == 3 + test("a4b4-"); // tryLess to 1. And since 4 < 5000, use 4. + Config.refresh(); + test("a4a4a4b4b4b4-"); + + writeConf(5, 4, p1, p2); + test("a4a4a4a4a4b4b4b4b4b4-"); // user-provided max_retries == 5 + test("a4b4-"); + Config.refresh(); + test("a4a4a4a4a4b4b4b4b4b4-"); + + // 3. tryLess with arguments + Security.setProperty("krb5.kdc.bad.policy", + "tryLess:2,5"); + + writeConf(-1, 6, p1, p2); + test("a6a6a6b6b6b6-"); // default max_retries == 3 + test("a5a5b5b5-"); // tryLess to 2 + Config.refresh(); + test("a6a6a6b6b6b6-"); + + writeConf(5, 4, p1, p2); + test("a4a4a4a4a4b4b4b4b4b4-"); // user-provided max_retries == 5 + test("a4a4b4b4-"); // tryLess to 2 + Config.refresh(); + test("a4a4a4a4a4b4b4b4b4b4-"); + } + + /** + * Writes a krb5.conf file. + * @param max max_retries, -1 if not set + * @param to kdc_timeout, -1 if not set + * @param ports where KDCs listen on + */ + static void writeConf(int max, int to, int... ports) throws Exception { + + // content of krb5.conf + String conf = ""; + + // Extra settings in [libdefaults] + String inDefaults = ""; + + // Extra settings in [realms] + String inRealm = ""; + + // We will randomly put extra settings only in [libdefaults], + // or in [realms] but with different values in [libdefaults], + // to prove that settings in [realms] override those in [libdefaults]. + Random r = new Random(); + + if (max > 0) { + if (r.nextBoolean()) { + inDefaults += "max_retries = " + max + "\n"; + } else { + inRealm += " max_retries = " + max + "\n"; + inDefaults += "max_retries = " + (max + 1) + "\n"; + } + } + + if (to > 0) { + if (r.nextBoolean()) { + inDefaults += "kdc_timeout = " + to + "\n"; + } else { + inRealm += " kdc_timeout = " + to + "\n"; + inDefaults += "kdc_timeout = " + (to + 1) + "\n"; + } + } + + if (udp) { + if (r.nextBoolean()) { + inDefaults += "udp_preference_limit = 10000\n"; + } else if (r.nextBoolean()) { + inRealm += " udp_preference_limit = 10000\n"; + inDefaults += "udp_preference_limit = 1\n"; + } // else no settings means UDP + } else { + if (r.nextBoolean()) { + inDefaults += "udp_preference_limit = 1\n"; + } else { + inRealm += " udp_preference_limit = 1\n"; + inDefaults += "udp_preference_limit = 10000\n"; + } + } + + conf = "[libdefaults]\n" + + "default_realm = " + OneKDC.REALM + "\n" + + inDefaults + + "\n" + + "[realms]\n" + + OneKDC.REALM + " = {\n"; + + for (int port : ports) { + conf += " kdc = " + OneKDC.KDCHOST + ":" + port + "\n" + + inRealm; + } + + conf += "}\n"; + + Files.write(Paths.get("alternative-krb5.conf"), conf.getBytes()); + Config.refresh(); + } + + /** + * One call of krb5 login. As long as the result matches one of expected, + * the test is considered as success. The grammar of expected is + * + * kdc#, timeout, kdc#, timeout, ..., optional "-" for failure + */ + static void test(String... expected) throws Exception { + + System.out.println("------------------TEST----------------------"); + PrintStream oldOut = System.out; + boolean failed = false; + ByteArrayOutputStream bo = new ByteArrayOutputStream(); + System.setOut(new PrintStream(bo)); + try { + Context.fromUserPass(OneKDC.USER, OneKDC.PASS, false); + } catch (Exception e) { + failed = true; + } finally { + System.setOut(oldOut); + } + + String[] lines = new String(bo.toByteArray()).split("\n"); + StringBuilder sb = new StringBuilder(); + for (String line: lines) { + if (cm.match(line)) { + if (udp != cm.isUDP()) { + sb.append("x"); + } + sb.append(cm.kdc()).append(cm.timeout()); + } + } + if (failed) sb.append('-'); + + String output = sb.toString(); + + boolean found = false; + for (String ex : expected) { + if (output.matches(ex)) { + System.out.println("Expected: " + ex + ", actual " + output); + found = true; + break; + } + } + + if (!found) { + System.out.println("--------------- ERROR START -------------"); + System.out.println(new String(bo.toByteArray())); + System.out.println("--------------- ERROR END ---------------"); + throw new Exception("Does not match. Output is " + output); + } + } + + /** + * A helper class to match the krb5 debug output: + * >>> KDCCommunication: kdc=host UDP:11555, timeout=200,Attempt =1, #bytes=138 + * + * Example: + * DebugMatcher cm = new DebugMatcher(); + * cm.addPort(12345).addPort(11555); + * for (String line : debugOutput) { + * if (cm.match(line)) { + * System.out.printf("%c%d\n", cm.kdc(), cm.timeout()); + * // shows b200 for the example above + * } + * } + */ + static class DebugMatcher { + + static final Pattern re = Pattern.compile( + ">>> KDCCommunication: kdc=\\S+ (TCP|UDP):(\\d+), " + + "timeout=(\\d+),Attempt\\s*=(\\d+)"); + + List<Integer> kdcPorts = new ArrayList<>(); + Matcher matcher; + + /** + * Add KDC ports one by one. See {@link #kdc()}. + */ + DebugMatcher addPort(int port) { + if (port > 0) { + kdcPorts.add(port); + } else { + kdcPorts.clear(); + } + return this; + } + + /** + * When a line matches the ">>> KDCCommunication:" pattern. After a + * match, the getters below can be called on this match. + */ + boolean match(String line) { + matcher = re.matcher(line); + return matcher.find(); + } + + /** + * Protocol of this match, "UDP" or "TCP". + */ + boolean isUDP() { + return matcher.group(1).equals("UDP"); + } + + /** + * KDC for this match, "a" for the one 1st added bt addPort(), "b" + * for second, etc. Undefined for not added. + */ + char kdc() { + int port = Integer.parseInt(matcher.group(2)); + return (char) (kdcPorts.indexOf(port) + 'a'); + } + + /** + * Timeout value for this match. + */ + int timeout() { + return Integer.parseInt(matcher.group(3)); + } + } +}
--- a/test/sun/security/krb5/auto/MaxRetries.java Wed Apr 17 03:47:21 2019 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,278 +0,0 @@ -/* - * Copyright (c) 2010, 2012, 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 6844193 - * @compile -XDignore.symbol.file MaxRetries.java - * @run main/othervm/timeout=300 -Dsun.net.spi.nameservice.provider.1=ns,mock MaxRetries - * @summary support max_retries in krb5.conf - */ - -import javax.security.auth.login.LoginException; -import java.io.*; -import java.net.DatagramSocket; -import java.security.Security; - -public class MaxRetries { - - static int idlePort = -1; - static CommMatcher cm = new CommMatcher(); - - public static void main(String[] args) - throws Exception { - - System.setProperty("sun.security.krb5.debug", "true"); - OneKDC kdc = new OneKDC(null).writeJAASConf(); - - // An idle UDP socket to prevent PortUnreachableException - DatagramSocket ds = new DatagramSocket(); - idlePort = ds.getLocalPort(); - - cm.addPort(idlePort); - cm.addPort(kdc.getPort()); - - System.setProperty("java.security.krb5.conf", "alternative-krb5.conf"); - - Security.setProperty("krb5.kdc.bad.policy", "trylast"); - - // We always make the real timeout to be 1 second - BadKdc.setRatio(0.25f); - rewriteMaxRetries(4); - - // Explanation: In this case, max_retries=4 and timeout=4s. - // For AS-REQ without preauth, we will see 4 4s timeout on kdc#1 - // ("a4" repeat 4 times), and one 4s timeout on kdc#2 ("b4"). For - // AS-REQ with preauth, one 4s timeout on kdc#2 (second "b4"). - // we tolerate 4 real timeout on kdc#2, so make it "(b4){2,6}". - test1("a4a4a4a4b4b4", "a4a4a4a4(b4){2,6}"); - test1("b4b4", "(b4){2,6}"); - - BadKdc.setRatio(1f); - rewriteMaxRetries(1); - // Explanation: Since max_retries=1 only, we could fail in 1st or 2nd - // AS-REQ to kdc#2. - String actual = test1("a1b1b1", "(a1b1b1|a1b1x|a1b1b1x)"); - if (actual.endsWith("x")) { - // If 1st attempt fails, all bads are back available - test1("a1b1b1", "(a1b1b1|a1b1x|a1b1b1x)"); - } else { - test1("b1b1", "(b1b1|b1x|b1b1x)"); - } - - BadKdc.setRatio(0.2f); - rewriteMaxRetries(-1); - test1("a5a5a5b5b5", "a5a5a5(b5){2,4}"); - test1("b5b5", "(b5){2,4}"); - - BadKdc.setRatio(0.25f); - Security.setProperty("krb5.kdc.bad.policy", - "tryless:1,1000"); - rewriteMaxRetries(4); - test1("a4a4a4a4b4a4b4", "a4a4a4a4(b4){1,3}a4(b4){1,3}"); - test1("a4b4a4b4", "a4(b4){1,3}a4(b4){1,3}"); - - BadKdc.setRatio(1f); - rewriteMaxRetries(1); - actual = test1("a1b1a1b1", "(a1b1|a1b1x|a1b1a1b1|a1b1a1b1x)"); - if (actual.endsWith("x")) { - test1("a1b1a1b1", "(a1b1|a1b1x|a1b1a1b1|a1b1a1b1x)"); - } else { - test1("a1b1a1b1", "(a1b1|a1b1x|a1b1a1b1|a1b1a1b1x)"); - } - - BadKdc.setRatio(.2f); - rewriteMaxRetries(-1); - test1("a5a5a5b5a5b5", "a5a5a5(b5){1,2}a5(b5){1,2}"); - test1("a5b5a5b5", "a5(b5){1,2}a5(b5){1,2}"); - - BadKdc.setRatio(1f); - rewriteMaxRetries(2); - if (BadKdc.toReal(2000) > 1000) { - // Explanation: if timeout is longer than 1s in tryLess, - // we will see "a1" at 2nd kdc#1 access - test1("a2a2b2a1b2", "a2a2(b2){1,2}a1(b2){1,2}"); - } else { - test1("a2a2b2a2b2", "a2a2(b2){1,2}a2(b2){1,2}"); - } - - BadKdc.setRatio(1f); - - rewriteUdpPrefLimit(-1, -1); // default, no limit - test2("UDP"); - - rewriteUdpPrefLimit(10, -1); // global rules - test2("TCP"); - - rewriteUdpPrefLimit(10, 10000); // realm rules - test2("UDP"); - - rewriteUdpPrefLimit(10000, 10); // realm rules - test2("TCP"); - - ds.close(); - } - - /** - * One round of test for max_retries and timeout. - * - * @param exact the expected exact match, where no timeout - * happens for real KDCs - * @param relaxed the expected relaxed match, where some timeout - * could happen for real KDCs - * @return the actual result - */ - private static String test1(String exact, String relaxed) throws Exception { - ByteArrayOutputStream bo = new ByteArrayOutputStream(); - PrintStream oldout = System.out; - System.setOut(new PrintStream(bo)); - boolean failed = false; - long start = System.nanoTime(); - try { - Context c = Context.fromJAAS("client"); - } catch (LoginException e) { - failed = true; - } - System.setOut(oldout); - - String[] lines = new String(bo.toByteArray()).split("\n"); - System.out.println("----------------- TEST (" + exact - + ") -----------------"); - - // Result, a series of timeout + kdc# - StringBuilder sb = new StringBuilder(); - for (String line: lines) { - if (cm.match(line)) { - System.out.println(line); - sb.append(cm.kdc()).append(cm.timeout()); - } - } - if (failed) { - sb.append("x"); - } - System.out.println("Time: " + (System.nanoTime() - start) / 1000000000d); - String actual = sb.toString(); - System.out.println("Actual: " + actual); - if (actual.equals(exact)) { - System.out.println("Exact match: " + exact); - } else if (actual.matches(relaxed)) { - System.out.println("!!!! Tolerant match: " + relaxed); - } else { - throw new Exception("Match neither " + exact + " nor " + relaxed); - } - return actual; - } - - /** - * One round of test for udp_preference_limit. - * @param proto the expected protocol used - */ - private static void test2(String proto) throws Exception { - ByteArrayOutputStream bo = new ByteArrayOutputStream(); - PrintStream oldout = System.out; - System.setOut(new PrintStream(bo)); - Context c = Context.fromJAAS("client"); - System.setOut(oldout); - - int count = 2; - String[] lines = new String(bo.toByteArray()).split("\n"); - System.out.println("----------------- TEST -----------------"); - for (String line: lines) { - if (cm.match(line)) { - System.out.println(line); - count--; - if (!cm.protocol().equals(proto)) { - throw new Exception("Wrong protocol value"); - } - } - } - if (count != 0) { - throw new Exception("Retry count is " + count + " less"); - } - } - - /** - * Set udp_preference_limit for global and realm - */ - private static void rewriteUdpPrefLimit(int global, int realm) - throws Exception { - BufferedReader fr = new BufferedReader(new FileReader(OneKDC.KRB5_CONF)); - FileWriter fw = new FileWriter("alternative-krb5.conf"); - while (true) { - String s = fr.readLine(); - if (s == null) { - break; - } - if (s.startsWith("[realms]")) { - // Reconfig global setting - fw.write("kdc_timeout = 5000\n"); - if (global != -1) { - fw.write("udp_preference_limit = " + global + "\n"); - } - } else if (s.trim().startsWith("kdc = ")) { - if (realm != -1) { - // Reconfig for realm - fw.write(" udp_preference_limit = " + realm + "\n"); - } - } - fw.write(s + "\n"); - } - fr.close(); - fw.close(); - sun.security.krb5.Config.refresh(); - } - - /** - * Set max_retries and timeout value for realm. The global value is always - * 3 and 5000. - * - * @param value max_retries and timeout/1000 for a realm, -1 means none. - */ - private static void rewriteMaxRetries(int value) throws Exception { - BufferedReader fr = new BufferedReader(new FileReader(OneKDC.KRB5_CONF)); - FileWriter fw = new FileWriter("alternative-krb5.conf"); - while (true) { - String s = fr.readLine(); - if (s == null) { - break; - } - if (s.startsWith("[realms]")) { - // Reconfig global setting - fw.write("max_retries = 3\n"); - fw.write("kdc_timeout = " + BadKdc.toReal(5000) + "\n"); - } else if (s.trim().startsWith("kdc = ")) { - if (value != -1) { - // Reconfig for realm - fw.write(" max_retries = " + value + "\n"); - fw.write(" kdc_timeout = " + BadKdc.toReal(value*1000) + "\n"); - } - // Add a bad KDC as the first candidate - fw.write(" kdc = localhost:" + idlePort + "\n"); - } - fw.write(s + "\n"); - } - fr.close(); - fw.close(); - sun.security.krb5.Config.refresh(); - } -}
--- a/test/sun/security/krb5/auto/TcpTimeout.java Wed Apr 17 03:47:21 2019 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,107 +0,0 @@ -/* - * Copyright (c) 2010, 2012, 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 6952519 - * @compile -XDignore.symbol.file TcpTimeout.java - * @run main/othervm -Dsun.net.spi.nameservice.provider.1=ns,mock TcpTimeout - * @summary kdc_timeout is not being honoured when using TCP - */ - -import java.io.*; -import java.net.ServerSocket; -import sun.security.krb5.Config; - -public class TcpTimeout { - public static void main(String[] args) - throws Exception { - - // Set debug to grab debug output like ">>> KDCCommunication" - System.setProperty("sun.security.krb5.debug", "true"); - - // Called before new ServerSocket on p1 and p2 to make sure - // customized nameservice is used - KDC k = new KDC(OneKDC.REALM, OneKDC.KDCHOST, 0, true); - int p3 = k.getPort(); - k.addPrincipal(OneKDC.USER, OneKDC.PASS); - k.addPrincipalRandKey("krbtgt/" + OneKDC.REALM); - - // Start two listener that does not communicate, simulate timeout - ServerSocket ss1 = null; - ServerSocket ss2 = null; - - try { - ss1 = new ServerSocket(0); - ss2 = new ServerSocket(0); - int p1 = ss1.getLocalPort(); - int p2 = ss2.getLocalPort(); - - FileWriter fw = new FileWriter("alternative-krb5.conf"); - - fw.write("[libdefaults]\n" + - "udp_preference_limit = 1\n" + - "max_retries = 2\n" + - "default_realm = " + OneKDC.REALM + "\n" + - "kdc_timeout = " + BadKdc.toReal(5000) + "\n"); - fw.write("[realms]\n" + OneKDC.REALM + " = {\n" + - "kdc = " + OneKDC.KDCHOST + ":" + p1 + "\n" + - "kdc = " + OneKDC.KDCHOST + ":" + p2 + "\n" + - "kdc = " + OneKDC.KDCHOST + ":" + p3 + "\n" + - "}\n"); - - fw.close(); - System.setProperty("java.security.krb5.conf", - "alternative-krb5.conf"); - Config.refresh(); - - System.out.println("Ports opened on " + p1 + ", " + p2 + ", " + p3); - - // The correct behavior should be: - // 5 sec on p1, 5 sec on p1, fail - // 5 sec on p2, 5 sec on p2, fail - // p3 ok, p3 ok again for preauth. - int count = 6; - - ByteArrayOutputStream bo = new ByteArrayOutputStream(); - PrintStream oldout = System.out; - System.setOut(new PrintStream(bo)); - Context c = Context.fromUserPass(OneKDC.USER, OneKDC.PASS, false); - System.setOut(oldout); - - String[] lines = new String(bo.toByteArray()).split("\n"); - for (String line: lines) { - if (line.startsWith(">>> KDCCommunication")) { - System.out.println(line); - count--; - } - } - if (count != 0) { - throw new Exception("Retry count is " + count + " less"); - } - } finally { - if (ss1 != null) ss1.close(); - if (ss2 != null) ss2.close(); - } - } -}
--- a/test/sun/security/krb5/auto/UdpTcp.java Wed Apr 17 03:47:21 2019 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,71 +0,0 @@ -/* - * Copyright (c) 2014, 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 4966382 8039132 - * @run main/othervm -Dsun.net.spi.nameservice.provider.1=ns,mock UdpTcp UDP - * @run main/othervm -Dsun.net.spi.nameservice.provider.1=ns,mock UdpTcp TCP - * @summary udp or tcp - */ - -import java.io.ByteArrayOutputStream; -import java.io.PrintStream; -import sun.security.krb5.Config; - -public class UdpTcp { - - public static void main(String[] args) - throws Exception { - - System.setProperty("sun.security.krb5.debug", "true"); - - OneKDC kdc = new OneKDC(null); - kdc.writeJAASConf(); - - // Two styles of kdc_timeout setting. One global, one realm-specific. - if (args[0].equals("UDP")) { - KDC.saveConfig(OneKDC.KRB5_CONF, kdc, - "kdc_timeout = 10s"); - } else { - kdc.addConf("kdc_timeout = 10s"); - KDC.saveConfig(OneKDC.KRB5_CONF, kdc, - "udp_preference_limit = 1"); - } - Config.refresh(); - - ByteArrayOutputStream bo = new ByteArrayOutputStream(); - PrintStream oldout = System.out; - System.setOut(new PrintStream(bo)); - Context.fromUserPass(OneKDC.USER, OneKDC.PASS, false); - System.setOut(oldout); - - for (String line: new String(bo.toByteArray()).split("\n")) { - if (line.contains(">>> KDCCommunication")) { - if (!line.contains(args[0]) || !line.contains("timeout=10000")) { - throw new Exception("No " + args[0] + " in: " + line); - } - } - } - } -}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/sun/security/ssl/com/sun/net/ssl/internal/ssl/X509TrustManagerImpl/Symantec/Distrust.java Thu Apr 18 03:46:32 2019 +0100 @@ -0,0 +1,273 @@ +/* + * Copyright (c) 2019, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +import java.io.*; +import java.math.BigInteger; +import java.security.*; +import java.security.cert.*; +import java.time.*; +import java.util.*; +import javax.net.ssl.*; +import sun.security.validator.Validator; +import sun.security.validator.ValidatorException; + + +/** + * @test + * @bug 8207258 8216280 + * @summary Check that TLS Server certificates chaining back to distrusted + * Symantec roots are invalid + * @library /lib/security + * @run main/othervm Distrust after policyOn invalid + * @run main/othervm Distrust after policyOff valid + * @run main/othervm Distrust before policyOn valid + * @run main/othervm Distrust before policyOff valid + */ + +public class Distrust { + + private static final String TEST_SRC = System.getProperty("test.src", "."); + private static CertificateFactory cf; + + // Each of the roots have a test certificate chain stored in a file + // named "<root>-chain.pem". + private static String[] rootsToTest = new String[] { + "geotrustglobalca", "geotrustprimarycag2", "geotrustprimarycag3", + "geotrustuniversalca", "thawteprimaryrootca", "thawteprimaryrootcag2", + "thawteprimaryrootcag3", "verisignclass3g3ca", "verisignclass3g4ca", + "verisignclass3g5ca", "verisignuniversalrootca" }; + + // Each of the subCAs with a delayed distrust date have a test certificate + // chain stored in a file named "<subCA>-chain.pem". + private static String[] subCAsToTest = new String[] { + "appleistca2g1", "appleistca8g1" }; + + + // A date that is after the restrictions take affect + private static final Date APRIL_17_2019 = + Date.from(LocalDate.of(2019, 4, 17) + .atStartOfDay(ZoneOffset.UTC) + .toInstant()); + + // A date that is a second before the restrictions take affect + private static final Date BEFORE_APRIL_17_2019 = + Date.from(LocalDate.of(2019, 4, 17) + .atStartOfDay(ZoneOffset.UTC) + .minusSeconds(1) + .toInstant()); + + // A date that is after the subCA restrictions take affect + private static final Date JANUARY_1_2020 = + Date.from(LocalDate.of(2020, 1, 1) + .atStartOfDay(ZoneOffset.UTC) + .toInstant()); + + // A date that is a second before the subCA restrictions take affect + private static final Date BEFORE_JANUARY_1_2020 = + Date.from(LocalDate.of(2020, 1, 1) + .atStartOfDay(ZoneOffset.UTC) + .minusSeconds(1) + .toInstant()); + + public static void main(String[] args) throws Exception { + + cf = CertificateFactory.getInstance("X.509"); + boolean distrust = args[0].equals("true"); + + boolean before = args[0].equals("before"); + boolean policyOn = args[1].equals("policyOn"); + boolean isValid = args[2].equals("valid"); + + if (!policyOn) { + // disable policy (default is on) + Security.setProperty("jdk.security.caDistrustPolicies", ""); + } + + Date notBefore = before ? BEFORE_APRIL_17_2019 : APRIL_17_2019; + + X509TrustManager pkixTM = getTMF("PKIX", null); + X509TrustManager sunX509TM = getTMF("SunX509", null); + for (String test : rootsToTest) { + System.err.println("Testing " + test); + X509Certificate[] chain = loadCertificateChain(test); + + testTM(sunX509TM, chain, notBefore, isValid); + testTM(pkixTM, chain, notBefore, isValid); + + } + + // test chain if params are passed to TrustManager + System.err.println("Testing verisignuniversalrootca with params"); + testTM(getTMF("PKIX", getParams()), + loadCertificateChain("verisignuniversalrootca"), + notBefore, isValid); + + // test code-signing chain (should be valid as restrictions don't apply) + System.err.println("Testing verisignclass3g5ca code-signing chain"); + Validator v = Validator.getInstance(Validator.TYPE_PKIX, + Validator.VAR_CODE_SIGNING, + getParams()); + // set validation date so this will still pass when cert expires + v.setValidationDate(new Date(1544197375493l)); + v.validate(loadCertificateChain("verisignclass3g5ca-codesigning")); + + // test chains issued through subCAs + notBefore = before ? BEFORE_JANUARY_1_2020 : JANUARY_1_2020; + for (String test : subCAsToTest) { + System.err.println("Testing " + test); + X509Certificate[] chain = loadCertificateChain(test); + + testTM(sunX509TM, chain, notBefore, isValid); + testTM(pkixTM, chain, notBefore, isValid); + } + } + + private static X509TrustManager getTMF(String type, + PKIXBuilderParameters params) throws Exception { + TrustManagerFactory tmf = TrustManagerFactory.getInstance(type); + if (params == null) { + tmf.init((KeyStore)null); + } else { + tmf.init(new CertPathTrustManagerParameters(params)); + } + TrustManager[] tms = tmf.getTrustManagers(); + for (TrustManager tm : tms) { + X509TrustManager xtm = (X509TrustManager)tm; + return xtm; + } + throw new Exception("No TrustManager for " + type); + } + + private static PKIXBuilderParameters getParams() throws Exception { + PKIXBuilderParameters pbp = + new PKIXBuilderParameters(SecurityUtils.getCacertsKeyStore(), + new X509CertSelector()); + pbp.setRevocationEnabled(false); + return pbp; + } + + private static void testTM(X509TrustManager xtm, X509Certificate[] chain, + Date notBefore, boolean valid) throws Exception { + // Check if TLS Server certificate (the first element of the chain) + // is issued after the specified notBefore date (should be rejected + // unless distrust property is false). To do this, we need to + // fake the notBefore date since none of the test certs are issued + // after then. + chain[0] = new DistrustedTLSServerCert(chain[0], notBefore); + + try { + xtm.checkServerTrusted(chain, "ECDHE_RSA"); + if (!valid) { + throw new Exception("chain should be invalid"); + } + } catch (CertificateException ce) { + if (valid) { + throw new Exception("Unexpected exception, chain " + + "should be valid", ce); + } + if (ce instanceof ValidatorException) { + ValidatorException ve = (ValidatorException)ce; + if (ve.getErrorType() != ValidatorException.T_UNTRUSTED_CERT) { + throw new Exception("Unexpected exception: " + ce); + } + } else { + throw new Exception("Unexpected exception: " + ce); + } + } + } + + private static X509Certificate[] loadCertificateChain(String name) + throws Exception { + try (InputStream in = new FileInputStream(TEST_SRC + File.separator + + name + "-chain.pem")) { + Collection<X509Certificate> certs = + (Collection<X509Certificate>)cf.generateCertificates(in); + return certs.toArray(new X509Certificate[0]); + } + } + + private static class DistrustedTLSServerCert extends X509Certificate { + private final X509Certificate cert; + private final Date notBefore; + DistrustedTLSServerCert(X509Certificate cert, Date notBefore) { + this.cert = cert; + this.notBefore = notBefore; + } + public Set<String> getCriticalExtensionOIDs() { + return cert.getCriticalExtensionOIDs(); + } + public byte[] getExtensionValue(String oid) { + return cert.getExtensionValue(oid); + } + public Set<String> getNonCriticalExtensionOIDs() { + return cert.getNonCriticalExtensionOIDs(); + } + public boolean hasUnsupportedCriticalExtension() { + return cert.hasUnsupportedCriticalExtension(); + } + public void checkValidity() throws CertificateExpiredException, + CertificateNotYetValidException { + // always pass + } + public void checkValidity(Date date) throws CertificateExpiredException, + CertificateNotYetValidException { + // always pass + } + public int getVersion() { return cert.getVersion(); } + public BigInteger getSerialNumber() { return cert.getSerialNumber(); } + public Principal getIssuerDN() { return cert.getIssuerDN(); } + public Principal getSubjectDN() { return cert.getSubjectDN(); } + public Date getNotBefore() { return notBefore; } + public Date getNotAfter() { return cert.getNotAfter(); } + public byte[] getTBSCertificate() throws CertificateEncodingException { + return cert.getTBSCertificate(); + } + public byte[] getSignature() { return cert.getSignature(); } + public String getSigAlgName() { return cert.getSigAlgName(); } + public String getSigAlgOID() { return cert.getSigAlgOID(); } + public byte[] getSigAlgParams() { return cert.getSigAlgParams(); } + public boolean[] getIssuerUniqueID() { + return cert.getIssuerUniqueID(); + } + public boolean[] getSubjectUniqueID() { + return cert.getSubjectUniqueID(); + } + public boolean[] getKeyUsage() { return cert.getKeyUsage(); } + public int getBasicConstraints() { return cert.getBasicConstraints(); } + public byte[] getEncoded() throws CertificateEncodingException { + return cert.getEncoded(); + } + public void verify(PublicKey key) throws CertificateException, + InvalidKeyException, NoSuchAlgorithmException, + NoSuchProviderException, SignatureException { + cert.verify(key); + } + public void verify(PublicKey key, String sigProvider) throws + CertificateException, InvalidKeyException, NoSuchAlgorithmException, + NoSuchProviderException, SignatureException { + cert.verify(key, sigProvider); + } + public PublicKey getPublicKey() { return cert.getPublicKey(); } + public String toString() { return cert.toString(); } + } +}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/sun/security/ssl/com/sun/net/ssl/internal/ssl/X509TrustManagerImpl/Symantec/appleistca2g1-chain.pem Thu Apr 18 03:46:32 2019 +0100 @@ -0,0 +1,80 @@ +-----BEGIN CERTIFICATE----- +MIIGGzCCBQOgAwIBAgIITJltLCqcD0gwDQYJKoZIhvcNAQELBQAwYjEcMBoGA1UE +AxMTQXBwbGUgSVNUIENBIDIgLSBHMTEgMB4GA1UECxMXQ2VydGlmaWNhdGlvbiBB +dXRob3JpdHkxEzARBgNVBAoTCkFwcGxlIEluYy4xCzAJBgNVBAYTAlVTMB4XDTE5 +MDEwODIxMTcxNFoXDTIwMDgwODIxMjcwMFowgaoxSjBIBgNVBAMMQWFjdGl2ZS5n +ZW90cnVzdC1nbG9iYWwtY2EudGVzdC1wYWdlcy5jZXJ0aWZpY2F0ZW1hbmFnZXIu +YXBwbGUuY29tMSUwIwYDVQQLDBxtYW5hZ2VtZW50OmlkbXMuZ3JvdXAuODY0ODU5 +MRMwEQYDVQQKDApBcHBsZSBJbmMuMRMwEQYDVQQIDApDYWxpZm9ybmlhMQswCQYD +VQQGEwJVUzCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMCjFUrVHTEX +0aVU6x9LiGa6oVr9blaCsMFrLicPQguc43Vs/pN+g4jzRXsTSMe9XefezBQb6tzZ +SMRXVB4kWMr4K1BVgQDkXeyoh4KrXRkdEF9ZIJPNxwTmmYUOc5M6NOYwkLelYz+t +7n1iNIGylbjwU4qwauElk2alFVqYTEPDLzwvqVDb9jMAJ8MPSDjfUlXW0XD9oXZM +hC+8LU9JBgJ3YBdzRHa4WnrudUbWjspqaNfAYpVIX0cfCJKnMsKqaSKjS4pIRtWm +L6NlCTCoIMyOh+wmbWPPX24H2D3+ump5FA35fRYbVznmosl5n1AK34S9tD4XZ7lO +WZKfaFi1liMCAwEAAaOCAoowggKGMAwGA1UdEwEB/wQCMAAwHwY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Bbdq +fnGk5sRgprDvgOSJKA+eJdbtg/OtppHHmMlCGDUUna2YRpIuT8rxh0PBFpVXLVDv +iS2Aelet8u5fa9IAjbkU+BQVNdnARqN7csiRv8lVK83Qlz6cJmTM386DGXHKTubU +1XupGc1V3sjs0l44U+VcT4wt/lAjNvxm5suOpDkZALeVAjmRCw7+OC7RHQWa9k0+ +bw8HHa8sHo9gOeL6NlMTOdReJivbPagUvTLrGAMoUgRx5aszPeE4uwc2hGKceeoW +MPRfwCvocWvk+QIDAQABo1MwUTAPBgNVHRMBAf8EBTADAQH/MB0GA1UdDgQWBBTA +ephojYn7qwVkDBF9qn1luMrMTjAfBgNVHSMEGDAWgBTAephojYn7qwVkDBF9qn1l +uMrMTjANBgkqhkiG9w0BAQUFAAOCAQEANeMpauUvXVSOKVCUn5kaFOSPeCpilKIn +Z57QzxpeR+nBsqTP3UEaBU6bS+5Kb1VSsyShNwrrZHYqLizz/Tt1kL/6cdjHPTfS +tQWVYrmm3ok9Nns4d0iXrKYgjy6myQzCsplFAMfOEVEiIuCl6rYVSAlk6l5PdPcF +PseKUgzbFbS9bZvlxrFUaKnjaZC2mqUPuLk/IH2uSrW4nOQdtqvmlKXBx4Ot2/Un +hw4EbNX/3aBd7YdStysVAq45pmp06drE57xNNB6pXE0zX5IJL4hmXXeXxx12E6nV +5fEWCRE11azbJHFwLJhWC9kXtNHjUStedejV0NxPNO3CBWaAocvmMw== +-----END CERTIFICATE-----
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/sun/security/ssl/com/sun/net/ssl/internal/ssl/X509TrustManagerImpl/Symantec/appleistca8g1-chain.pem Thu Apr 18 03:46:32 2019 +0100 @@ -0,0 +1,64 @@ +-----BEGIN CERTIFICATE----- +MIIElDCCBDqgAwIBAgIIWax3IY1ByGIwCgYIKoZIzj0EAwIwYjEcMBoGA1UEAwwT +QXBwbGUgSVNUIENBIDggLSBHMTEgMB4GA1UECwwXQ2VydGlmaWNhdGlvbiBBdXRo +b3Jp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kgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkgLSBH +MjB2MBAGByqGSM49AgEGBSuBBAAiA2IABBWx6P0DFUPlrOuHNxFi79KDNlJ9RVcL +So17VDs6bl8VAsBQps8lL33KSLjHUGMcKiEIfJo22Av+0SbFWDEwKCXzXV2juLal +tJLtbCyf691DiaI8S0iRHVDsJt/WYC69IaNCMEAwDwYDVR0TAQH/BAUwAwEB/zAO +BgNVHQ8BAf8EBAMCAQYwHQYDVR0OBBYEFBVfNVdRVfslsq0DafwBo/q+EVXVMAoG +CCqGSM49BAMDA2cAMGQCMGSWWaboCd6LuvpaiIjwH5HTRqjySkwCY/tsXzjbLkGT +qQ7mndwxHLKgpxgceeHHNgIwOlavmnRs9vuD4DPTCF+hnMJbn0bWtsuRBmOiBucz +rD6ogRLQy7rQkgu2npaqBA+K +-----END CERTIFICATE-----
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/sun/security/ssl/com/sun/net/ssl/internal/ssl/X509TrustManagerImpl/Symantec/geotrustglobalca-chain.pem Thu Apr 18 03:46:32 2019 +0100 @@ -0,0 +1,66 @@ +-----BEGIN CERTIFICATE----- +MIIHBjCCBe6gAwIBAgIQanINWwJAuap0V7lFjnfUwTANBgkqhkiG9w0BAQsFADBE +MQswCQYDVQQGEwJVUzEWMBQGA1UEChMNR2VvVHJ1c3QgSW5jLjEdMBsGA1UEAxMU +R2VvVHJ1c3QgU1NMIENBIC0gRzMwHhcNMTcwNTAzMDAwMDAwWhcNMjAwNTAyMjM1 +OTU5WjCBkTELMAkGA1UEBhMCVVMxEzARBgNVBAgMCkNhbGlmb3JuaWExFjAUBgNV +BAcMDU1vdW50YWluIFZpZXcxFzAVBgNVBAoMDkdlb1RydXN0LCBJbmMuMRgwFgYD +VQQLDA9Sb290IDEwIC0gVkFMSUQxIjAgBgNVBAMMGXZhbGlkLXJvb3QxMC5nZW90 +cnVzdC5jb20wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIB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4IBAQCg1Pcs+3QLf2TxzUNq +n2JTHAJ8mJCi7k9o1CAacxI+d7NQ63K87oi+fxfqd4+DYZVPhKHLMk9sIb7SaZZ9 +Y73cK6gf0BOEcP72NZWJ+aZ3sEbIu7cT9clgadZM/tKO79NgwYCA4ef7i28heUrg +3Kkbwbf7w0lZXLV3B0TUl/xJAIlvBk4BcBmsLxHA4uYPL4ZLjXvDuacu9PGsFj45 +SVGeF0tPEDpbpaiSb/361gsDTUdWVxnzy2v189bPsPX1oxHSIFMTNDcFLENaY9+N +QNaFHlHpURceA1bJ8TCt55sRornQMYGbaLHZ6PPmlH7HrhMvh+3QJbBo+d4IWvMp +zNSS +-----END CERTIFICATE-----
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/sun/security/ssl/com/sun/net/ssl/internal/ssl/X509TrustManagerImpl/Symantec/geotrustprimarycag2-chain.pem Thu Apr 18 03:46:32 2019 +0100 @@ -0,0 +1,55 @@ +-----BEGIN CERTIFICATE----- +MIIFcDCCBRegAwIBAgIQHw+Lyn4UTWqRF8/JM7DH+zAKBggqhkjOPQQDAjBHMQsw +CQYDVQQGEwJVUzEXMBUGA1UEChMOR2VvVHJ1c3QsIEluYy4xHzAdBgNVBAMTFkdl +b1RydXN0IEVDQyBFViBTU0wgQ0EwHhcNMTcwNTExMDAwMDAwWhcNMTkwNTAzMjM1 +OTU5WjCB8jETMBEGCysGAQQBgjc8AgEDEwJVUzEZMBcGCysGAQQBgjc8AgECDAhE +ZWxhd2FyZTELMAkGA1UEBhMCVVMxEzARBgNVBAgMCkNhbGlmb3JuaWExFjAUBgNV +BAcMDU1vdW50YWluIFZpZXcxHTAbBgNVBA8TFFByaXZhdGUgT3JnYW5pemF0aW9u +MRAwDgYDVQQFEwczNDc5NzUwMRcwFQYDVQQKDA5HZW9UcnVzdCwgSW5jLjEYMBYG +A1UECwwPUm9vdCAxMiAtIFZBTElEMSIwIAYDVQQDDBl2YWxpZC1yb290MTIuZ2Vv +dHJ1c3Q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IGh +MIGeMAcGBWeBDAEBMIGSBgkrBgEEAfAiAQYwgYQwPwYIKwYBBQUHAgEWM2h0dHBz +Oi8vd3d3Lmdlb3RydXN0LmNvbS9yZXNvdXJjZXMvcmVwb3NpdG9yeS9sZWdhbDBB +BggrBgEFBQcCAjA1GjNodHRwczovL3d3dy5nZW90cnVzdC5jb20vcmVzb3VyY2Vz +L3JlcG9zaXRvcnkvbGVnYWwwNgYDVR0fBC8wLTAroCmgJ4YlaHR0cDovL2cuc3lt +Y2IuY29tL0dlb1RydXN0UENBLUcyLmNybDArBgNVHREEJDAipCAwHjEcMBoGA1UE +AxMTU1lNQy1FQ0MtQ0EtcDI1Ni0zMjAdBgNVHQ4EFgQUAEsfkYEOC0POBHO7lpuC +HWZjrTwwHwYDVR0jBBgwFoAUFV81V1FV+yWyrQNp/AGj+r4RVdUwCgYIKoZIzj0E +AwMDaAAwZQIweZGj+Ar54cOBtC1I6rkfdNOtxSg77WBAvvsEv1+knWbbu8Acroz1 +Q9xqHnHLXpgRAjEAxNA5KzWxutl/kVj/7bUCYtvSWLfmb2ZTTsvof7VjjWlRnPje +wLtx+yN5EV7LPWDi +-----END CERTIFICATE-----
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/sun/security/ssl/com/sun/net/ssl/internal/ssl/X509TrustManagerImpl/Symantec/geotrustprimarycag3-chain.pem Thu Apr 18 03:46:32 2019 +0100 @@ -0,0 +1,67 @@ +-----BEGIN CERTIFICATE----- +MIIG6jCCBdKgAwIBAgIQZfxPPcDd0zSbl2UQK6dtRzANBgkqhkiG9w0BAQsFADBG +MQswCQYDVQQGEwJVUzEWMBQGA1UEChMNR2VvVHJ1c3QgSW5jLjEfMB0GA1UEAxMW +R2VvVHJ1c3QgU0hBMjU2IFNTTCBDQTAeFw0xNzAyMDEwMDAwMDBaFw0yMDAzMDIy +MzU5NTlaMHgxCzAJBgNVBAYTAlVTMRMwEQYDVQQIDApDYWxpZm9ybmlhMRYwFAYD +VQQHDA1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L2NwczA7 +BgNVHR8ENDAyMDCgLqAshipodHRwOi8vY3JsLmdlb3RydXN0LmNvbS9HZW9UcnVz +dFBDQS1HMy5jcmwwDgYDVR0PAQH/BAQDAgEGMCoGA1UdEQQjMCGkHzAdMRswGQYD +VQQDExJWZXJpU2lnbk1QS0ktMi00MTYwHQYDVR0OBBYEFBRnju2DT9YenUAEDARG +oXA0sg9yMB8GA1UdIwQYMBaAFMR5yo6hTgMdHNxr2zFblD4/MH8tMA0GCSqGSIb3 +DQEBCwUAA4IBAQAQEOryENYIRuLBjz42WcgrD/5N7OP4tlYxeCXUdvII3e8/zYsc +fqp//AuoI2RRs4fWCfoi+scKUejOuPYDcOAbWrmxspMREPmXBQcpbG1XJVTo+Wab +Dvvbn+6Wb2XLH9hVzjH6zwL00H9QZv8veZulwt/Wz8gVg5aEmLJG1F8TqD6nNJwF +ONrP1mmVqSaHdgHXslEPgWlGJhyZtoNY4ztYj9y0ccC5v0KcHAOe5Eao6rnBzfZb +qTyW+3mkM3Onnni5cNxydMQyyAAbye9I0/s6m/r+eppAaRzI2ig3C9OjuX6WzCso +w1Zsb+nbUrH6mvvnr7WXpiLDxaiTsQDJB7J9 +-----END CERTIFICATE-----
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/sun/security/ssl/com/sun/net/ssl/internal/ssl/X509TrustManagerImpl/Symantec/geotrustuniversalca-chain.pem Thu Apr 18 03:46:32 2019 +0100 @@ -0,0 +1,71 @@ +-----BEGIN CERTIFICATE----- +MIIHATCCBemgAwIBAgIQJmVwMHBfVctB6q6UbCC4eDANBgkqhkiG9w0BAQsFADBH +MQswCQYDVQQGEwJVUzEWMBQGA1UEChMNR2VvVHJ1c3QgSW5jLjEgMB4GA1UEAxMX +R2VvVHJ1c3QgRVYgU1NMIENBIC0gRzYwHhcNMTcwNTA5MDAwMDAwWhcNMTkwNTAz +MjM1OTU5WjCB8jETMBEGCysGAQQBgjc8AgEDEwJVUzEZMBcGCysGAQQBgjc8AgEC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0dHA6Ly9nLnN5bWNiLmNvbS9jcmxzL2d0dW5pY2ExLmNybDAdBgNVHSUE +FjAUBggrBgEFBQcDAQYIKwYBBQUHAwIwKQYDVR0RBCIwIKQeMBwxGjAYBgNVBAMT +EVN5bWFudGVjUEtJLTItNzU3MA0GCSqGSIb3DQEBCwUAA4ICAQA8iM9XJ01hEzSM +iATIdK/z+F1Vtm9hHjp0FzkOvVYkp7v6LIkazg299fyAy2+A/tpSzKyMIzy5B2R/ +sjbWykIK+3vtOlgUNilP7EoudiCjR/692THUtJ/QjPNzFYhO9apU2Wpc33ZYMH0Q +YKUPmAd7eBmsdVKHNLENcMjjCjnkjXnYtxq/jv2R4QhD83tbFnvBoKjxi2vAfDXG +xN8aItVg/FSdScZCMhe0w/HLzcN6N3NCGDBn2PjF0o3QLJa9yVSrvJ9Nh3my6rUb +gMhlfFEQXTmLxucqL5/n5lXyUWd0kTxFv++TalTeqYf3G/oeu5kcpfjUJREp/9ed +gQqhDEGIuJFrMm4qi+sNDrq0OkLBHCqefFArTz2ApiI9zd9pcKfjS3f/EB87AVmW +3m1lfqPeS+w+vBg7VCGNY9gGNUe+w4juTEBiwIjnp7I+aBVnIwxV9PdJoj1ZaLCx +U8AEN6tXD8IcCquLxs3fBsF85svvUfK8qh3ufKB3I3RHGq5Asmtvc5URcyeuA+d2 +zPQ1qAXH5m3DLkb0KdAvJ5E6mQ2S2aqwJPXtpqx2J40C1Qx+uUsHG2vDoT3ZTazt +LPBIIqF2YJr1hr760yXM3Jf14eyc+RXPrjA1mc/CKNbv6SvU5MvlYj+Vvx70y+k8 +U5ev+YdiYoYu0wQtDJQCJjM+eavqxQ== +-----END CERTIFICATE-----
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/sun/security/ssl/com/sun/net/ssl/internal/ssl/X509TrustManagerImpl/Symantec/thawteprimaryrootca-chain.pem Thu Apr 18 03:46:32 2019 +0100 @@ -0,0 +1,66 @@ +-----BEGIN CERTIFICATE----- +MIIG/TC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wggE/MBIGA1UdEwEB/wQIMAYBAf8CAQAwDgYDVR0PAQH/BAQD +AgEGMC8GCCsGAQUFBwEBBCMwITAfBggrBgEFBQcwAYYTaHR0cDovL2cyLnN5bWNi +LmNvbTBHBgNVHSAEQDA+MDwGBFUdIAAwNDAyBggrBgEFBQcCARYmaHR0cHM6Ly93 +d3cuZ2VvdHJ1c3QuY29tL3Jlc291cmNlcy9jcHMwNAYDVR0fBC0wKzApoCegJYYj +aHR0cDovL2cxLnN5bWNiLmNvbS9HZW9UcnVzdFBDQS5jcmwwKQYDVR0RBCIwIKQe +MBwxGjAYBgNVBAMTEVN5bWFudGVjUEtJLTEtNTM4MB0GA1UdDgQWBBTez1xQt64C +HxUXqhboDbUonWpa8zAfBgNVHSMEGDAWgBQs1VBBlxWL8I82YVtK+2vZmckzkjAN +BgkqhkiG9w0BAQsFAAOCAQEAtI69B7mahew7Z70HYGHmhNHU7+sbuguCS5VktmZT +I723hN3ke40J2s+y9fHDv4eEvk6mqMLnEjkoNOCkVkRADJ+IoxXT6NNe4xwEYPtp +Nk9qfgwqKMHzqlgObM4dB8NKwJyNw3SxroLwGuH5Tim9Rt63Hfl929kPhMuSRcwc +sxj2oM9xbwwum9Its5mTg0SsFaqbLmfsT4hpBVZ7i7JDqTpsHBMzJRv9qMhXAvsc +4NG9O1ZEZcNj9Rvv7DDZ424uE+k5CCoMcvOazPYnKYTT70zHhBFlH8bjgQPbh8x4 +97Wdlj5qf7wRhXp15kF9Dc/55YVpJY/HjQct+GkPy0FTAA== +-----END CERTIFICATE-----
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/sun/security/ssl/com/sun/net/ssl/internal/ssl/X509TrustManagerImpl/Symantec/thawteprimaryrootcag2-chain.pem Thu Apr 18 03:46:32 2019 +0100 @@ -0,0 +1,51 @@ +-----BEGIN CERTIFICATE----- +MIIFNjCCBN2gAwIBAgIQWCw1fnWLWedosJcJlxQbhDAKBggqhkjOPQQDAjBDMQsw +CQYDVQQG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luYy4xHTAbBgNVBAMTFHRoYXd0ZSBFQ0MgRVYgU1NMIENBMFkwEwYHKoZI +zj0CAQYIKoZIzj0DAQcDQgAEmcXM1zsNS0E2+7pcpYHdwqumr+KIIt3jEJA6jBBm +1SoBGgZESt6OKROJBt2sZJhUl4oU0q5kINTS/bG+eYTTlqOCAZgwggGUMA4GA1Ud +DwEB/wQEAwIBBjAuBggrBgEFBQcBAQQiMCAwHgYIKwYBBQUHMAGGEmh0dHA6Ly90 +LnN5bWNkLmNvbTASBgNVHRMBAf8ECDAGAQH/AgEAMHwGA1UdIAR1MHMwBwYFZ4EM +AQEwaAYLYIZIAYb4RQEHMAEwWTAmBggrBgEFBQcCARYaaHR0cHM6Ly93d3cudGhh +d3RlLmNvbS9jcHMwLwYIKwYBBQUHAgIwIxohaHR0cHM6Ly93d3cudGhhd3RlLmNv +bS9yZXBvc2l0b3J5MDQGA1UdHwQtMCswKaAnoCWGI2h0dHA6Ly90LnN5bWNiLmNv +bS9UaGF3dGVQQ0EtRzIuY3JsMB0GA1UdJQQWMBQGCCsGAQUFBwMBBggrBgEFBQcD +AjArBgNVHREEJDAipCAwHjEcMBoGA1UEAxMTU1lNQy1FQ0MtQ0EtcDI1Ni0zMTAd +BgNVHQ4EFgQUWzOvNaAaGTdCDVfmvL1rYyDClgEwHwYDVR0jBBgwFoAUmtgAMADn +a3+FGO6Lts6KDPgR4bswCgYIKoZIzj0EAwMDaAAwZQIwMMf+C0NMBVt58Of4YvVO +mVS0OYfzEiB4AOz8QF9pmEyaCAelGeOmq2pOLDEsQbKzAjEA2WTDVMhnnJI3NSnD +itmCtBQnW6NEAohvLUsB4iVehDAJK3mNY8FbYafl4LjFzA4V +-----END CERTIFICATE-----
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/sun/security/ssl/com/sun/net/ssl/internal/ssl/X509TrustManagerImpl/Symantec/thawteprimaryrootcag3-chain.pem Thu Apr 18 03:46:32 2019 +0100 @@ -0,0 +1,67 @@ +-----B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5czTSwXx4GByoaxbn +5+CdKa/Y5Gk5eZVpuXtcXQGc1PfzSEUTZJXXCm5y2kMiJG8+WnDcwJLgLeVX+OQr +J+71/xuzAYN6 +-----END CERTIFICATE-----
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/sun/security/ssl/com/sun/net/ssl/internal/ssl/X509TrustManagerImpl/Symantec/verisignclass3g4ca-chain.pem Thu Apr 18 03:46:32 2019 +0100 @@ -0,0 +1,56 @@ +-----BEGIN CERTIFICATE----- +MIIFxDCCBWmgAwIBAgIQZMjAlhAdRd/Im/aYbmgO8DAKBggqhkjOPQQDAjCBizEL +MAkGA1UEBhMCVVMxHTAbBgNVBAoTFFN5bWFudGVjIENvcnBvcmF0aW9uMR8wHQYD +VQQLExZTeW1hbnRlYyBUcnVzdCBOZXR3b3JrMTwwOgYDVQQDEzNTeW1hbnRlYyBD +bGFzcyAzIEVDQyAyNTYgYml0IEV4dGVuZGVkIFZhbGlkYXRpb24gQ0EwHhcNMTcw +NTAxMDAwMDAwWhcNMTkwNTAxMjM1OTU5WjCCAS0xEzARBgsrBgEEAYI3PAIBAxMC +VVMxGTAXBgsrBgEEAYI3PAIBAgwIRGVsYXdhcmUxHTAbBgNVBA8TFFByaXZhdGUg +T3JnYW5pemF0aW9uMRAwDgYDVQQFEwcyMTU4MTEzMQswCQYDVQQGEwJVUzEOMAwG +A1UEEQwFOTQwNDMxEzARBgNVBAgMCkNhbGlmb3JuaWExFjAUBgNVBAcMDU1vdW50 +YWluIFZpZXcxGTAXBgNVBAkMEDM1MCBFbGxpcyBTdHJlZXQxHTAbBgNVBAoMFFN5 +bWFudGVjIENvcnBvcmF0aW9uMRcwFQYDVQQLDA5Sb290IDMgLSBWQUxJRDEtMCsG +A1UEAwwkdmFsaWQtcm9vdDMud2Vic2VjdXJpdHkuc3ltYW50ZWMuY29tMFkwEwYH +KoZIzj0CAQYIKoZIzj0DAQcDQgAERAIBieoafYh/yFaVSP+vyzoxzZ/zKy4tx7o0 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Oi8vb2NzcC53cy5zeW1hbnRlYy5jb20w +ZQYDVR0gBF4wXDBaBgRVHSAAMFIwJgYIKwYBBQUHAgEWGmh0dHA6Ly93d3cuc3lt +YXV0aC5jb20vY3BzMCgGCCsGAQUFBwICMBwaGmh0dHA6Ly93d3cuc3ltYXV0aC5j +b20vcnBhMCoGA1UdEQQjMCGkHzAdMRswGQYDVQQDExJTWU1DLUVDQy1DQS1wMjU2 +LTMwHQYDVR0OBBYEFEgTZReU7J4WKip0XOhTLbT7g+uOMB8GA1UdIwQYMBaAFLMW +kf3upm7ktS5Jj4d4gYDs5bG1MAoGCCqGSM49BAMDA2cAMGQCMFyb7oOjdk2MLQVM +gjS6s77Oj+jDNIH7QHfoNGxbFys7rdWno9LzZsJPsrDIdpiPvwIwT8IvzpLFqb3O +fU7UGztmJOpOzYKvVEqI7+O/OpNjVCF9EjDSMs2ryYGwpxFDe0Vm +-----END CERTIFICATE-----
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/sun/security/ssl/com/sun/net/ssl/internal/ssl/X509TrustManagerImpl/Symantec/verisignclass3g5ca-chain.pem Thu Apr 18 03:46:32 2019 +0100 @@ -0,0 +1,71 @@ +-----BEGIN CERTIFICATE----- +MIIHOTCCBiGgAwIBAgIQCBmps2cB8a6CGTXUyg9ZzjANBgkqhkiG9w0BAQsFADB3 +MQswCQYDVQQGEwJVUzEdMBsGA1UEChMUU3ltYW50ZWMgQ29ycG9yYXRpb24xHzAd +BgNVBAsTFlN5bWFudGVjIFRydXN0IE5ldHdvcmsxKDAmBgNVBAMTH1N5bWFudGVj +IENsYXNzIDMgRVYgU1NMIENBIC0gRzMwHhcNMTcwNDI4MDAwMDAwWhcNMTkwNDI4 +MjM1OTU5WjCCAS0xEzARBgsrBgEEAYI3PAIBAxMCVVMxGTAXBgsrBgEEAYI3PAIB +AgwIRGVsYXdhcmUxHTAbBgNVBA8TFFByaXZhdGUgT3JnYW5pemF0aW9uMRAwDgYD +VQQFEwcyMTU4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BADBlBgNVHSAEXjBcMFoGBFUdIAAwUjAmBggrBgEFBQcCARYaaHR0cDov +L3d3dy5zeW1hdXRoLmNvbS9jcHMwKAYIKwYBBQUHAgIwHBoaaHR0cDovL3d3dy5z +eW1hdXRoLmNvbS9ycGEwMAYDVR0fBCkwJzAloCOgIYYfaHR0cDovL3MxLnN5bWNi +LmNvbS9wY2EzLWc1LmNybDAOBgNVHQ8BAf8EBAMCAQYwKQYDVR0RBCIwIKQeMBwx +GjAYBgNVBAMTEVN5bWFudGVjUEtJLTEtNTMzMB0GA1UdDgQWBBQBWavn3ToLWaZk +Y9bPIAdX1ZHnajAfBgNVHSMEGDAWgBR/02Wnwt3su/AwCfNDOfoCrzMxMzANBgkq +hkiG9w0BAQsFAAOCAQEAQgFVe9AWGl1Y6LubqE3X89frE5SG1n8hC0e8V5uSXU8F +nzikEHzPg74GQ0aNCLxq1xCm+quvL2GoY/Jl339MiBKIT7Np2f8nwAqXkY9W+4nE +qLuSLRtzsMarNvSWbCAI7woeZiRFT2cAQMgHVHQzO6atuyOfZu2iRHA0+w7qAf3P +eHTfp61Vt19N9tY/4IbOJMdCqRMURDVLtt/JYKwMf9mTIUvunORJApjTYHtcvNUw +LwfORELEC5n+5p/8sHiGUW3RLJ3GlvuFgrsEL/digO9i2n/2DqyQuFa9eT/ygG6j +2bkPXToHHZGThkspTOHcteHgM52zyzaRS/6htO7w+Q== +-----END CERTIFICATE-----
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/sun/security/ssl/com/sun/net/ssl/internal/ssl/X509TrustManagerImpl/Symantec/verisignclass3g5ca-codesigning-chain.pem Thu Apr 18 03:46:32 2019 +0100 @@ -0,0 +1,170 @@ +Signer #1: + +Signature: + +Certificate owner: CN="Oracle America, Inc.", OU=Software Engineering, O="Oracle America, Inc.", L=Redwood City, ST=California, C=US + +-----BEGIN CERTIFICATE----- +MIIE4DCCA8igAwIBAgIQMJBKmqOhTgIuAsUw5l33hTANBgkqhkiG9w0BAQ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8Hkzl699g+8uK8zKt4YecmYwKwYDVR0fBCQwIjAgoB6gHIYaaHR0 +cDovL3N2LnN5bWNiLmNvbS9zdi5jcmwwVwYIKwYBBQUHAQEESzBJMB8GCCsGAQUF +BzABhhNodHRwOi8vc3Yuc3ltY2QuY29tMCYGCCsGAQUFBzAChhpodHRwOi8vc3Yu +c3ltY2IuY29tL3N2LmNydDANBgkqhkiG9w0BAQsFAAOCAQEAQcZqmjMAuBgnaQZ5 +JsP3+Rzaa5FrukVVk2brqrJFnqt/79khvfCf95pBafHHCqdndB0T4xuzBL4fk2ZW +Z48ACgq3U6oNP9Ci4pcDuTqU/vZHwh7ICkSWLhGzpErfwby7zZV9ZeIK0AB5vJCK +qgL4DetXgqGOm29gAjTKcXa67jP9lX6tAdh9TcQDbBbGny3NHGAiCderJxTOYhid +9+4v+p+lt2OPxlxmZMPnT/9U2Yp3OzH//OYgQysnwy/UkSVCa2DuMPbL4LTxwV65 +nwEU3jT0Iq7io+oEcjW5FTZDgVC2A7lDVVrNlbAW/f5QoKcmyw8hDLo7TH6tDv8n +hhKFDg== +-----END CERTIFICATE----- + +Certificate owner: CN=Symantec Class 3 SHA256 Code Signing CA, OU=Symantec Trust Network, O=Symantec Corporation, C=US + +-----BEGIN CERTIFICATE----- +MIIFWTCCBEGgAwIBAgIQPXjX+XZJYLJhffTwHsqGKjANBgkqhkiG9w0BAQsFADCB +yjELMAkGA1UEBhMCVVMxFzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMR8wHQYDVQQL +ExZWZXJpU2lnbiBUcnVzdCBOZXR3b3JrMTowOAYDVQQLEzEoYykgMjAwNiBWZXJp +U2lnbiwgSW5jLiAtIEZvciBhdXRob3JpemVkIHVzZSBvbmx5MUUwQwYDVQQDEzxW +ZXJpU2lnbiBDbGFzcyAzIFB1YmxpYyBQcmltYXJ5IENlcnRpZmljYXRpb24gQXV0 +aG9yaXR5IC0gRzUwHhcNMTMxMjEwMDAwMDAwWhcNMjMxMjA5MjM1OTU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BgwFoAUf9Nlp8Ld7LvwMAnzQzn6Aq8zMTMwDQYJKoZI +hvcNAQELBQADggEBABOFGh5pqTf3oL2kr34dYVP+nYxeDKZ1HngXI9397BoDVTn7 +cZXHZVqnjjDSRFph23Bv2iEFwi5zuknx0ZP+XcnNXgPgiZ4/dB7X9ziLqdbPuzUv +M1ioklbRyE07guZ5hBb8KLCxR/Mdoj7uh9mmf6RWpT+thC4p3ny8qKqjPQQB6rqT +og5QIikXTIfkOhFf1qQliZsFay+0yQFMJ3sLrBkFIqBgFT/ayftNTI/7cmd3/SeU +x7o1DohJ/o39KK9KEr0Ns5cF3kQMFfo2KwPcwVAB8aERXRTl4r0nS1S+K4ReD6bD +dAUK75fDiSKxH3fzvc1D1PFMqT+1i4SvZPLQFCE= +-----END CERTIFICATE----- + +Certificate owner: CN=VeriSign Class 3 Public Primary Certification Authority - G5, OU="(c) 2006 VeriSign, Inc. - For authorized use only", OU=VeriSign Trust Network, O="VeriSign, Inc.", C=US + +-----BEGIN CERTIFICATE----- +MIIE0zCCA7ugAwIBAgIQGNrRniZ96LtKIVjNzGs7SjANBgkqhkiG9w0BAQUFADCB +yjELMAkGA1UEBhMCVVMxFzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMR8wHQYDVQQL +ExZWZXJpU2lnbiBUcnVzdCBOZXR3b3JrMTowOAYDVQQLEzEoYykgMjAwNiBWZXJp +U2lnbiwgSW5jLiAtIEZvciBhdXRob3JpemVkIHVzZSBvbmx5MUUwQwYDVQQDEzxW +ZXJpU2lnbiBDbGFzcyAzIFB1YmxpYyBQcmltYXJ5IENlcnRpZmljYXRpb24gQXV0 +aG9yaXR5IC0gRzUwHhcNMDYxMTA4MDAwMDAwWhcNMzYwNzE2MjM1OTU5WjCByjEL +MAkGA1UEBhMCVVMxFzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMR8wHQYDVQQLExZW +ZXJpU2lnbiBUcnVzdCBOZXR3b3JrMTowOAYDVQQLEzEoYykgMjAwNiBWZ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fznQgUy286dUV4otp6F01vvpX1FQHKOtw5rDgb7MzVIcbidJ4vEZV8N +hnacRHr2lVz2XTIIM6RUthg/aFzyQkqFOFSDX9HoLPKsEdao7WNq +-----END CERTIFICATE----- + +Timestamp: + +Certificate owner: CN=Symantec SHA256 TimeStamping Signer - G2, OU=Symantec Trust Network, O=Symantec Corporation, C=US + +-----BEGIN CERTIFICATE----- +MIIFSzCCBDOgAwIBAgIQVFjyqtdB1kS8hKl7oJZS5jANBgkqhkiG9w0BAQsFADB3 +MQswCQYDVQQGEwJVUzEdMBsGA1UEChMUU3ltYW50ZWMgQ29ycG9yYXRpb24xHzAd +BgNVBAsTFlN5bWFudGVjIFRydXN0IE5ldHdvcmsxKDAmBgNVBAMTH1N5bWFudGVj +IFNIQTI1NiBUaW1lU3RhbXBpbmcgQ0EwHhcNMTcwMTAyMDAwMDAwWhcNMjgwNDAx +MjM1OTU5WjCBgDELMAkGA1UEBhMCVVMxHTAbBgNVBAoTFFN5bWFudGVjIENvcnBv +cmF0aW9uMR8wHQYDVQQLExZTeW1hbnRlYyBUcnVzdCBOZXR3b3JrMTEwLwYDVQQD +EyhTeW1hbnRlYyBTSEEyNTYgVGltZVN0YW1waW5nIFNpZ25lciAtIEcyMIIBIjAN +BgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAmfP82AQJA4b511ymk8BCfOp8Y89d +AOKO88CQ348p9RjqlLeS5dewoHOB6OkKm0p8Af+dj6Q5pw7qRfQiDDpw7TlFi+TF +G1zwRWhGJAVjdpsc/J5sKrFW5Yp/UnGu8jXVRiMGHM9ILR20zbjZdiOOHP8+v7sG +XGkHpmUO+F6ufS7tTa4178nXAEL9KJUOn11yQgm8w9pE0u3MR4Tk/MotrFi+rveu +2UQNCLfCd9YaQ3DRbgPeUpLEEAhx2boiVfIfvO2bnTviXh1Mg/+XD3sL51WDTtIN +677X7K5uR7mf36XWUbwEVe3/J3BMye0qSxPhsblMD8kB7lVlX2kCeGbLPwIDAQAB +o4I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C +ARYXaHR0cHM6Ly9kLnN5bWNiLmNvbS9jcHMwJQYIKwYBBQUHAgIwGRoXaHR0cHM6 +Ly9kLnN5bWNiLmNvbS9ycGEwLgYIKwYBBQUHAQEEIjAgMB4GCCsGAQUFBzABhhJo +dHRwOi8vcy5zeW1jZC5jb20wNgYDVR0fBC8wLTAroCmgJ4YlaHR0cDovL3Muc3lt +Y2IuY29tL3VuaXZlcnNhbC1yb290LmNybDATBgNVHSUEDDAKBggrBgEFBQcDCDAo +BgNVHREEITAfpB0wGzEZMBcGA1UEAxMQVGltZVN0YW1wLTIwNDgtMzAdBgNVHQ4E +FgQUr2PWyqNOhXLgp7xB8ymiOH+AdWIwHwYDVR0jBBgwFoAUtnf6aUhHn1MS1cLq +BzJ2B9GXBxkwDQYJKoZIhvcNAQELBQADggEBAHXqsC3VNBlcMkX+DuHUT6Z4wW/X +6t3cT/OhyIGI96ePFeZAKa3mXfSi2VZkhHEwKt0eYRdmIFYGmBmNXXHy+Je8Cf0c +kUfJ4uiNA/vMkC/WCmxOM+zWtJPITJBjSDlAIcTd1m6JmDy1mJfoqQa3CcmPU1dB +kC/hHk1O3MoQeGxCbvC2xfhhXFL1TvZrjfdKer7zzf0D19n2A6gP41P3CnXsxnUu +qmaFBJm3+AZX4cYO9uiv2uybGB+queM6AL/OipTLAduexzi7D1Kr0eOUA2AKTaD+ +J20UMvw/l0Dhv5mJ2+Q5FL3a5NPD6itas5VYVQR9x5rsIwONhSrS/66pYYE= +-----END CERTIFICATE----- +
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/sun/security/ssl/com/sun/net/ssl/internal/ssl/X509TrustManagerImpl/Symantec/verisignuniversalrootca-chain.pem Thu Apr 18 03:46:32 2019 +0100 @@ -0,0 +1,73 @@ +-----BEGIN CERTIFICATE----- +MIIHTzCCBjegAwIBAgIQPYH1xfKSpwYMrTEqOxG4OzANBgkqhkiG9w0BAQsFADCB +ijELMAkGA1UEBhMCVVMxHTAbBgNVBAoTFF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Y371fbh5FTWa8ySae7kOY6dNM4Us/CAauNW7mW0 +zB9UpGiJBN2YLL3Pow== +-----END CERTIFICATE-----
--- a/test/sun/security/ssl/sanity/ciphersuites/CheckCipherSuites.java Wed Apr 17 03:47:21 2019 +0100 +++ b/test/sun/security/ssl/sanity/ciphersuites/CheckCipherSuites.java Thu Apr 18 03:46:32 2019 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2019, 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 @@ -23,221 +23,166 @@ /* * @test - * @bug 4750141 4895631 + * @bug 4750141 4895631 8217579 * @summary Check enabled and supported ciphersuites are correct - * @ignore JSSE supported cipher suites are changed with CR 6916074, - * need to update this test case in JDK 7 soon + * @run main CheckCipherSuites default + * @run main/othervm CheckCipherSuites limited */ import java.util.*; - +import java.security.Security; import javax.net.ssl.*; -import javax.crypto.Cipher; -import javax.crypto.spec.*; - public class CheckCipherSuites { + // List of enabled cipher suites when the "crypto.policy" security + // property is set to "unlimited" (the default value). private final static String[] ENABLED_DEFAULT = { - "SSL_RSA_WITH_RC4_128_MD5", - "SSL_RSA_WITH_RC4_128_SHA", + "TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384", + "TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384", + "TLS_RSA_WITH_AES_256_CBC_SHA256", + "TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA384", + "TLS_ECDH_RSA_WITH_AES_256_CBC_SHA384", + "TLS_DHE_RSA_WITH_AES_256_CBC_SHA256", + "TLS_DHE_DSS_WITH_AES_256_CBC_SHA256", + "TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA", + "TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA", + "TLS_RSA_WITH_AES_256_CBC_SHA", + "TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA", + "TLS_ECDH_RSA_WITH_AES_256_CBC_SHA", + "TLS_DHE_RSA_WITH_AES_256_CBC_SHA", + "TLS_DHE_DSS_WITH_AES_256_CBC_SHA", + "TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256", + "TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256", + "TLS_RSA_WITH_AES_128_CBC_SHA256", + "TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA256", + "TLS_ECDH_RSA_WITH_AES_128_CBC_SHA256", + "TLS_DHE_RSA_WITH_AES_128_CBC_SHA256", + "TLS_DHE_DSS_WITH_AES_128_CBC_SHA256", + "TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA", + "TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA", "TLS_RSA_WITH_AES_128_CBC_SHA", - "TLS_ECDH_ECDSA_WITH_RC4_128_SHA", "TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA", - "TLS_ECDH_RSA_WITH_RC4_128_SHA", "TLS_ECDH_RSA_WITH_AES_128_CBC_SHA", - "TLS_ECDHE_ECDSA_WITH_RC4_128_SHA", - "TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA", - "TLS_ECDHE_RSA_WITH_RC4_128_SHA", - "TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA", "TLS_DHE_RSA_WITH_AES_128_CBC_SHA", "TLS_DHE_DSS_WITH_AES_128_CBC_SHA", - "SSL_RSA_WITH_3DES_EDE_CBC_SHA", - "TLS_ECDH_ECDSA_WITH_3DES_EDE_CBC_SHA", - "TLS_ECDH_RSA_WITH_3DES_EDE_CBC_SHA", - "TLS_ECDHE_ECDSA_WITH_3DES_EDE_CBC_SHA", - "TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA", - "SSL_DHE_RSA_WITH_3DES_EDE_CBC_SHA", - "SSL_DHE_DSS_WITH_3DES_EDE_CBC_SHA", - "SSL_RSA_WITH_DES_CBC_SHA", - "SSL_DHE_RSA_WITH_DES_CBC_SHA", - "SSL_DHE_DSS_WITH_DES_CBC_SHA", - "SSL_RSA_EXPORT_WITH_RC4_40_MD5", - "SSL_RSA_EXPORT_WITH_DES40_CBC_SHA", - "SSL_DHE_RSA_EXPORT_WITH_DES40_CBC_SHA", - "SSL_DHE_DSS_EXPORT_WITH_DES40_CBC_SHA", - "TLS_EMPTY_RENEGOTIATION_INFO_SCSV", - + "TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384", + "TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256", + "TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384", + "TLS_RSA_WITH_AES_256_GCM_SHA384", + "TLS_ECDH_ECDSA_WITH_AES_256_GCM_SHA384", + "TLS_ECDH_RSA_WITH_AES_256_GCM_SHA384", + "TLS_DHE_RSA_WITH_AES_256_GCM_SHA384", + "TLS_DHE_DSS_WITH_AES_256_GCM_SHA384", + "TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256", + "TLS_RSA_WITH_AES_128_GCM_SHA256", + "TLS_ECDH_ECDSA_WITH_AES_128_GCM_SHA256", + "TLS_ECDH_RSA_WITH_AES_128_GCM_SHA256", + "TLS_DHE_RSA_WITH_AES_128_GCM_SHA256", + "TLS_DHE_DSS_WITH_AES_128_GCM_SHA256", + "TLS_EMPTY_RENEGOTIATION_INFO_SCSV" }; - private final static String[] ENABLED_UNLIMITED = { - "SSL_RSA_WITH_RC4_128_MD5", - "SSL_RSA_WITH_RC4_128_SHA", - "TLS_RSA_WITH_AES_128_CBC_SHA", - "TLS_RSA_WITH_AES_256_CBC_SHA", - "TLS_ECDH_ECDSA_WITH_RC4_128_SHA", - "TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA", - "TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA", - "TLS_ECDH_RSA_WITH_RC4_128_SHA", - "TLS_ECDH_RSA_WITH_AES_128_CBC_SHA", - "TLS_ECDH_RSA_WITH_AES_256_CBC_SHA", - "TLS_ECDHE_ECDSA_WITH_RC4_128_SHA", + // List of enabled cipher suites when the "crypto.policy" security + // property is set to "limited". + private final static String[] ENABLED_LIMITED = { + "TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256", + "TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256", + "TLS_RSA_WITH_AES_128_CBC_SHA256", + "TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA256", + "TLS_ECDH_RSA_WITH_AES_128_CBC_SHA256", + "TLS_DHE_RSA_WITH_AES_128_CBC_SHA256", + "TLS_DHE_DSS_WITH_AES_128_CBC_SHA256", "TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA", - "TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA", - "TLS_ECDHE_RSA_WITH_RC4_128_SHA", "TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA", - "TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA", - "TLS_DHE_RSA_WITH_AES_128_CBC_SHA", - "TLS_DHE_RSA_WITH_AES_256_CBC_SHA", - "TLS_DHE_DSS_WITH_AES_128_CBC_SHA", - "TLS_DHE_DSS_WITH_AES_256_CBC_SHA", - "SSL_RSA_WITH_3DES_EDE_CBC_SHA", - "TLS_ECDH_ECDSA_WITH_3DES_EDE_CBC_SHA", - "TLS_ECDH_RSA_WITH_3DES_EDE_CBC_SHA", - "TLS_ECDHE_ECDSA_WITH_3DES_EDE_CBC_SHA", - "TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA", - "SSL_DHE_RSA_WITH_3DES_EDE_CBC_SHA", - "SSL_DHE_DSS_WITH_3DES_EDE_CBC_SHA", - "SSL_RSA_WITH_DES_CBC_SHA", - "SSL_DHE_RSA_WITH_DES_CBC_SHA", - "SSL_DHE_DSS_WITH_DES_CBC_SHA", - "SSL_RSA_EXPORT_WITH_RC4_40_MD5", - "SSL_RSA_EXPORT_WITH_DES40_CBC_SHA", - "SSL_DHE_RSA_EXPORT_WITH_DES40_CBC_SHA", - "SSL_DHE_DSS_EXPORT_WITH_DES40_CBC_SHA", - "TLS_EMPTY_RENEGOTIATION_INFO_SCSV", - - }; - - // supported ciphersuites using default JCE policy jurisdiction files - // AES/256 unavailable - private final static String[] SUPPORTED_DEFAULT = { - "SSL_RSA_WITH_RC4_128_MD5", - "SSL_RSA_WITH_RC4_128_SHA", "TLS_RSA_WITH_AES_128_CBC_SHA", - "TLS_ECDH_ECDSA_WITH_RC4_128_SHA", "TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA", - "TLS_ECDH_RSA_WITH_RC4_128_SHA", "TLS_ECDH_RSA_WITH_AES_128_CBC_SHA", - "TLS_ECDHE_ECDSA_WITH_RC4_128_SHA", - "TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA", - "TLS_ECDHE_RSA_WITH_RC4_128_SHA", - "TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA", "TLS_DHE_RSA_WITH_AES_128_CBC_SHA", "TLS_DHE_DSS_WITH_AES_128_CBC_SHA", - "SSL_RSA_WITH_3DES_EDE_CBC_SHA", - "TLS_ECDH_ECDSA_WITH_3DES_EDE_CBC_SHA", - "TLS_ECDH_RSA_WITH_3DES_EDE_CBC_SHA", - "TLS_ECDHE_ECDSA_WITH_3DES_EDE_CBC_SHA", - "TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA", - "SSL_DHE_RSA_WITH_3DES_EDE_CBC_SHA", - "SSL_DHE_DSS_WITH_3DES_EDE_CBC_SHA", - "SSL_RSA_WITH_DES_CBC_SHA", - "SSL_DHE_RSA_WITH_DES_CBC_SHA", - "SSL_DHE_DSS_WITH_DES_CBC_SHA", - "SSL_RSA_EXPORT_WITH_RC4_40_MD5", - "SSL_RSA_EXPORT_WITH_DES40_CBC_SHA", - "SSL_DHE_RSA_EXPORT_WITH_DES40_CBC_SHA", - "SSL_DHE_DSS_EXPORT_WITH_DES40_CBC_SHA", - "TLS_EMPTY_RENEGOTIATION_INFO_SCSV", - - "SSL_RSA_WITH_NULL_MD5", - "SSL_RSA_WITH_NULL_SHA", - "TLS_ECDH_ECDSA_WITH_NULL_SHA", - "TLS_ECDH_RSA_WITH_NULL_SHA", - "TLS_ECDHE_ECDSA_WITH_NULL_SHA", - "TLS_ECDHE_RSA_WITH_NULL_SHA", - "SSL_DH_anon_WITH_RC4_128_MD5", - "TLS_DH_anon_WITH_AES_128_CBC_SHA", - "SSL_DH_anon_WITH_3DES_EDE_CBC_SHA", - "SSL_DH_anon_WITH_DES_CBC_SHA", - "TLS_ECDH_anon_WITH_RC4_128_SHA", - "TLS_ECDH_anon_WITH_AES_128_CBC_SHA", - "TLS_ECDH_anon_WITH_3DES_EDE_CBC_SHA", - "SSL_DH_anon_EXPORT_WITH_RC4_40_MD5", - "SSL_DH_anon_EXPORT_WITH_DES40_CBC_SHA", - "TLS_ECDH_anon_WITH_NULL_SHA", - "TLS_KRB5_WITH_RC4_128_SHA", - "TLS_KRB5_WITH_RC4_128_MD5", - "TLS_KRB5_WITH_3DES_EDE_CBC_SHA", - "TLS_KRB5_WITH_3DES_EDE_CBC_MD5", - "TLS_KRB5_WITH_DES_CBC_SHA", - "TLS_KRB5_WITH_DES_CBC_MD5", - "TLS_KRB5_EXPORT_WITH_RC4_40_SHA", - "TLS_KRB5_EXPORT_WITH_RC4_40_MD5", - "TLS_KRB5_EXPORT_WITH_DES_CBC_40_SHA", - "TLS_KRB5_EXPORT_WITH_DES_CBC_40_MD5", - + "TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256", + "TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256", + "TLS_RSA_WITH_AES_128_GCM_SHA256", + "TLS_ECDH_ECDSA_WITH_AES_128_GCM_SHA256", + "TLS_ECDH_RSA_WITH_AES_128_GCM_SHA256", + "TLS_DHE_RSA_WITH_AES_128_GCM_SHA256", + "TLS_DHE_DSS_WITH_AES_128_GCM_SHA256", + "TLS_EMPTY_RENEGOTIATION_INFO_SCSV" }; - // supported ciphersuites using unlimited JCE policy jurisdiction files - // AES/256 available - private final static String[] SUPPORTED_UNLIMITED = { - "SSL_RSA_WITH_RC4_128_MD5", - "SSL_RSA_WITH_RC4_128_SHA", - "TLS_RSA_WITH_AES_128_CBC_SHA", + // List of supported cipher suites when the "crypto.policy" security + // property is set to "unlimited" (the default value). + private final static String[] SUPPORTED_DEFAULT = { + "TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384", + "TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384", + "TLS_RSA_WITH_AES_256_CBC_SHA256", + "TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA384", + "TLS_ECDH_RSA_WITH_AES_256_CBC_SHA384", + "TLS_DHE_RSA_WITH_AES_256_CBC_SHA256", + "TLS_DHE_DSS_WITH_AES_256_CBC_SHA256", + "TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA", + "TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA", "TLS_RSA_WITH_AES_256_CBC_SHA", - "TLS_ECDH_ECDSA_WITH_RC4_128_SHA", - "TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA", "TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA", - "TLS_ECDH_RSA_WITH_RC4_128_SHA", - "TLS_ECDH_RSA_WITH_AES_128_CBC_SHA", "TLS_ECDH_RSA_WITH_AES_256_CBC_SHA", - "TLS_ECDHE_ECDSA_WITH_RC4_128_SHA", - "TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA", - "TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA", - "TLS_ECDHE_RSA_WITH_RC4_128_SHA", - "TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA", - "TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA", - "TLS_DHE_RSA_WITH_AES_128_CBC_SHA", "TLS_DHE_RSA_WITH_AES_256_CBC_SHA", - "TLS_DHE_DSS_WITH_AES_128_CBC_SHA", "TLS_DHE_DSS_WITH_AES_256_CBC_SHA", - "SSL_RSA_WITH_3DES_EDE_CBC_SHA", - "TLS_ECDH_ECDSA_WITH_3DES_EDE_CBC_SHA", - "TLS_ECDH_RSA_WITH_3DES_EDE_CBC_SHA", - "TLS_ECDHE_ECDSA_WITH_3DES_EDE_CBC_SHA", - "TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA", - "SSL_DHE_RSA_WITH_3DES_EDE_CBC_SHA", - "SSL_DHE_DSS_WITH_3DES_EDE_CBC_SHA", - "SSL_RSA_WITH_DES_CBC_SHA", - "SSL_DHE_RSA_WITH_DES_CBC_SHA", - "SSL_DHE_DSS_WITH_DES_CBC_SHA", - "SSL_RSA_EXPORT_WITH_RC4_40_MD5", - "SSL_RSA_EXPORT_WITH_DES40_CBC_SHA", - "SSL_DHE_RSA_EXPORT_WITH_DES40_CBC_SHA", - "SSL_DHE_DSS_EXPORT_WITH_DES40_CBC_SHA", - "TLS_EMPTY_RENEGOTIATION_INFO_SCSV", + "TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256", + "TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256", + "TLS_RSA_WITH_AES_128_CBC_SHA256", + "TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA256", + "TLS_ECDH_RSA_WITH_AES_128_CBC_SHA256", + "TLS_DHE_RSA_WITH_AES_128_CBC_SHA256", + "TLS_DHE_DSS_WITH_AES_128_CBC_SHA256", + "TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA", + "TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA", + "TLS_RSA_WITH_AES_128_CBC_SHA", + "TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA", + "TLS_ECDH_RSA_WITH_AES_128_CBC_SHA", + "TLS_DHE_RSA_WITH_AES_128_CBC_SHA", + "TLS_DHE_DSS_WITH_AES_128_CBC_SHA", + "TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384", + "TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256", + "TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384", + "TLS_RSA_WITH_AES_256_GCM_SHA384", + "TLS_ECDH_ECDSA_WITH_AES_256_GCM_SHA384", + "TLS_ECDH_RSA_WITH_AES_256_GCM_SHA384", + "TLS_DHE_RSA_WITH_AES_256_GCM_SHA384", + "TLS_DHE_DSS_WITH_AES_256_GCM_SHA384", + "TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256", + "TLS_RSA_WITH_AES_128_GCM_SHA256", + "TLS_ECDH_ECDSA_WITH_AES_128_GCM_SHA256", + "TLS_ECDH_RSA_WITH_AES_128_GCM_SHA256", + "TLS_DHE_RSA_WITH_AES_128_GCM_SHA256", + "TLS_DHE_DSS_WITH_AES_128_GCM_SHA256", + "TLS_EMPTY_RENEGOTIATION_INFO_SCSV" + }; - "SSL_RSA_WITH_NULL_MD5", - "SSL_RSA_WITH_NULL_SHA", - "TLS_ECDH_ECDSA_WITH_NULL_SHA", - "TLS_ECDH_RSA_WITH_NULL_SHA", - "TLS_ECDHE_ECDSA_WITH_NULL_SHA", - "TLS_ECDHE_RSA_WITH_NULL_SHA", - "SSL_DH_anon_WITH_RC4_128_MD5", - "TLS_DH_anon_WITH_AES_128_CBC_SHA", - "TLS_DH_anon_WITH_AES_256_CBC_SHA", - "SSL_DH_anon_WITH_3DES_EDE_CBC_SHA", - "SSL_DH_anon_WITH_DES_CBC_SHA", - "TLS_ECDH_anon_WITH_RC4_128_SHA", - "TLS_ECDH_anon_WITH_AES_128_CBC_SHA", - "TLS_ECDH_anon_WITH_AES_256_CBC_SHA", - "TLS_ECDH_anon_WITH_3DES_EDE_CBC_SHA", - "SSL_DH_anon_EXPORT_WITH_RC4_40_MD5", - "SSL_DH_anon_EXPORT_WITH_DES40_CBC_SHA", - "TLS_ECDH_anon_WITH_NULL_SHA", - "TLS_KRB5_WITH_RC4_128_SHA", - "TLS_KRB5_WITH_RC4_128_MD5", - "TLS_KRB5_WITH_3DES_EDE_CBC_SHA", - "TLS_KRB5_WITH_3DES_EDE_CBC_MD5", - "TLS_KRB5_WITH_DES_CBC_SHA", - "TLS_KRB5_WITH_DES_CBC_MD5", - "TLS_KRB5_EXPORT_WITH_RC4_40_SHA", - "TLS_KRB5_EXPORT_WITH_RC4_40_MD5", - "TLS_KRB5_EXPORT_WITH_DES_CBC_40_SHA", - "TLS_KRB5_EXPORT_WITH_DES_CBC_40_MD5", - + // List of supported cipher suites when the "crypto.policy" security + // property is set to "limited". + private final static String[] SUPPORTED_LIMITED = { + "TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256", + "TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256", + "TLS_RSA_WITH_AES_128_CBC_SHA256", + "TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA256", + "TLS_ECDH_RSA_WITH_AES_128_CBC_SHA256", + "TLS_DHE_RSA_WITH_AES_128_CBC_SHA256", + "TLS_DHE_DSS_WITH_AES_128_CBC_SHA256", + "TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA", + "TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA", + "TLS_RSA_WITH_AES_128_CBC_SHA", + "TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA", + "TLS_ECDH_RSA_WITH_AES_128_CBC_SHA", + "TLS_DHE_RSA_WITH_AES_128_CBC_SHA", + "TLS_DHE_DSS_WITH_AES_128_CBC_SHA", + "TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256", + "TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256", + "TLS_RSA_WITH_AES_128_GCM_SHA256", + "TLS_ECDH_ECDSA_WITH_AES_128_GCM_SHA256", + "TLS_ECDH_RSA_WITH_AES_128_GCM_SHA256", + "TLS_DHE_RSA_WITH_AES_128_GCM_SHA256", + "TLS_DHE_DSS_WITH_AES_128_GCM_SHA256", + "TLS_EMPTY_RENEGOTIATION_INFO_SCSV" }; private static void showSuites(String[] suites) { @@ -252,19 +197,21 @@ public static void main(String[] args) throws Exception { long start = System.currentTimeMillis(); + if (args.length != 1) { + throw new Exception("One arg required"); + } + String[] ENABLED; String[] SUPPORTED; - try { - Cipher c = Cipher.getInstance("AES/CBC/NoPadding"); - SecretKeySpec key = new SecretKeySpec(new byte[32], "AES"); - c.init(Cipher.ENCRYPT_MODE, key); - System.out.println("AES/256 is available"); - ENABLED = ENABLED_UNLIMITED; - SUPPORTED = SUPPORTED_UNLIMITED; - } catch (Exception e) { - System.out.println("AES/256 is NOT available (" + e + ")"); + if (args[0].equals("default")) { ENABLED = ENABLED_DEFAULT; SUPPORTED = SUPPORTED_DEFAULT; + } else if (args[0].equals("limited")) { + Security.setProperty("crypto.policy", "limited"); + ENABLED = ENABLED_LIMITED; + SUPPORTED = SUPPORTED_LIMITED; + } else { + throw new Exception("Illegal argument"); } SSLSocketFactory factory = (SSLSocketFactory)SSLSocketFactory.getDefault();
--- a/test/sun/security/tools/keytool/KeyToolTest.java Wed Apr 17 03:47:21 2019 +0100 +++ b/test/sun/security/tools/keytool/KeyToolTest.java Thu Apr 18 03:46:32 2019 +0100 @@ -1028,6 +1028,7 @@ testOK("", pre+"san3 -ext san=dns:me.org"); testOK("", pre+"san4 -ext san=ip:192.168.0.1"); testOK("", pre+"san5 -ext san=oid:1.2.3.4"); + testOK("", pre+"san6 -ext san=dns:1abc.com"); //begin with digit testOK("", pre+"san235 -ext san=uri:http://me.org,dns:me.org,oid:1.2.3.4"); ks = loadStore("x.jks", "changeit", "JKS");
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/sun/security/x509/GeneralName/DNSNameTest.java Thu Apr 18 03:46:32 2019 +0100 @@ -0,0 +1,91 @@ +/* + * Copyright (c) 2018, 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 + * @summary DNSName parsing tests + * @bug 8213952 + * @modules java.base/sun.security.x509 + * @run testng DNSNameTest + */ + +import java.io.IOException; +import sun.security.x509.DNSName; + +import org.testng.annotations.DataProvider; +import org.testng.annotations.Test; + +import static org.testng.Assert.*; + +public class DNSNameTest { + @DataProvider(name = "goodNames") + public Object[][] goodNames() { + Object[][] data = { + {"abc.com"}, + {"ABC.COM"}, + {"a12.com"}, + {"a1b2c3.com"}, + {"1abc.com"}, + {"123.com"}, + {"abc.com-"}, // end with hyphen + {"a-b-c.com"}, // hyphens + }; + return data; + } + + @DataProvider(name = "badNames") + public Object[][] badNames() { + Object[][] data = { + {" 1abc.com"}, // begin with space + {"1abc.com "}, // end with space + {"1a bc.com "}, // no space allowed + {"-abc.com"}, // begin with hyphen + {"a..b"}, // .. + {".a"}, // begin with . + {"a."}, // end with . + {""}, // empty + {" "}, // space only + }; + return data; + } + + @Test(dataProvider = "goodNames") + public void testGoodDNSName(String dnsNameString) { + try { + DNSName dn = new DNSName(dnsNameString); + } catch (IOException e) { + fail("Unexpected IOException"); + } + } + + @Test(dataProvider = "badNames") + public void testBadDNSName(String dnsNameString) { + try { + DNSName dn = new DNSName(dnsNameString); + fail("IOException expected"); + } catch (IOException e) { + if (!e.getMessage().contains("DNSName")) + fail("Unexpeceted message: " + e); + } + } +}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/sun/tools/clhsdb/Basic.sh Thu Apr 18 03:46:32 2019 +0100 @@ -0,0 +1,68 @@ +#!/bin/sh + +# +# Copyright (c) 2018, Red Hat, Inc. 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 8059038 +# @summary Unit test for clhsdb utility +# +# @library ../common +# @build SimpleApplication ShutdownSimpleApplication +# @run shell Basic.sh + +. ${TESTSRC}/../common/CommonSetup.sh +. ${TESTSRC}/../common/ApplicationSetup.sh + +# Start application and use PORTFILE for coordination +PORTFILE="${TESTCLASSES}"/shutdown.port +startApplication SimpleApplication "${PORTFILE}" + +# all return statuses are checked in this test +set +e + +failed=0 + +# cli help +INPUT_QUIT=${TESTCLASSES}/input-quit +echo quit > ${INPUT_QUIT} +$CLHSDB -help < ${INPUT_QUIT} > help_out.log 2>&1 +if [ $? != 0 ]; then failed=1; fi +grep 'Usage: clhsdb' help_out.log || failed=1 +$CLHSDB "help" < ${INPUT_QUIT} > help_out.log 2>&1 +if [ $? != 0 ]; then failed=1; fi +grep 'Usage: clhsdb' help_out.log || failed=1 + +DUMP_STRUCTS_INPUT_QUIT=${TESTCLASSES}/structs-dump-quit-input +echo vmstructsdump > ${DUMP_STRUCTS_INPUT_QUIT} +echo quit >> ${DUMP_STRUCTS_INPUT_QUIT} +$CLHSDB $appJavaPid < ${DUMP_STRUCTS_INPUT_QUIT} 2>&1 +if [ $? != 0 ]; then failed=1; fi + +set -e + +stopApplication "${PORTFILE}" +waitForApplication + +exit $failed
--- a/test/sun/tools/common/CommonSetup.sh Wed Apr 17 03:47:21 2019 +0100 +++ b/test/sun/tools/common/CommonSetup.sh Thu Apr 18 03:46:32 2019 +0100 @@ -35,6 +35,8 @@ # JPS - jps utility # JSTACK - jstack utility # JCMD - jcmd utility +# HSDB - hsdb utility (gui) +# CLHSDB - clhsdb utility (cli) # OS - operating system name # PATTERN_EOL - grep or sed end-of-line pattern # PATTERN_WS - grep or sed whitespace pattern @@ -76,6 +78,8 @@ JPS="${TESTJAVA}/bin/jps" JSTACK="${TESTJAVA}/bin/jstack" JCMD="${TESTJAVA}/bin/jcmd" +HSDB="${TESTJAVA}/bin/hsdb" +CLHSDB="${TESTJAVA}/bin/clhsdb" isCygwin=false isMKS=false
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/sun/tools/hsdb/Basic.sh Thu Apr 18 03:46:32 2019 +0100 @@ -0,0 +1,61 @@ +#!/bin/sh + +# +# Copyright (c) 2018, Red Hat, Inc. 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 8059038 +# @summary Unit test for hsdb utility +# +# @library ../common +# @build SimpleApplication ShutdownSimpleApplication +# @run shell Basic.sh + +. ${TESTSRC}/../common/CommonSetup.sh +. ${TESTSRC}/../common/ApplicationSetup.sh + +# Start application and use PORTFILE for coordination +PORTFILE="${TESTCLASSES}"/shutdown.port +startApplication SimpleApplication "${PORTFILE}" + +# all return statuses are checked in this test +set +e + +failed=0 + +# gui help +$HSDB -help > help_out.log 2>&1 +if [ $? != 0 ]; then failed=1; fi +grep 'Usage: hsdb' help_out.log || failed=1 + +$HSDB "help" > help_out.log 2>&1 +if [ $? != 0 ]; then failed=1; fi +grep 'Usage: hsdb' help_out.log || failed=1 + +set -e + +stopApplication "${PORTFILE}" +waitForApplication + +exit $failed
--- a/test/tools/launcher/VersionCheck.java Wed Apr 17 03:47:21 2019 +0100 +++ b/test/tools/launcher/VersionCheck.java Thu Apr 18 03:46:32 2019 +0100 @@ -61,7 +61,9 @@ static final String[] BLACKLIST_VERSION = { "appletviewer", "controlpanel", + "clhsdb", "extcheck", + "hsdb", "jar", "jarsigner", "java-rmi",