diff -Nru openjdk-13-13.0.3+3/debian/changelog openjdk-13-13.0.4+8/debian/changelog --- openjdk-13-13.0.3+3/debian/changelog 2020-04-18 12:23:20.000000000 +0000 +++ openjdk-13-13.0.4+8/debian/changelog 2020-07-21 11:36:52.000000000 +0000 @@ -1,15 +1,15 @@ -openjdk-13 (13.0.3+3-1ubuntu2) focal; urgency=medium +openjdk-13 (13.0.4+8-1~20.04) focal-proposed; urgency=medium - * SRU: LP: #1871161, upload to the proposed/updates pocket, package was - removed in the release pocket. + * SRU: LP: #1888386. July 2020 security updates. - -- Matthias Klose Sat, 18 Apr 2020 14:23:20 +0200 + -- Matthias Klose Tue, 21 Jul 2020 13:36:52 +0200 -openjdk-13 (13.0.3+3-1ubuntu1) focal; urgency=medium +openjdk-13 (13.0.4+8-1) unstable; urgency=medium + * OpenJDK 13.0.4 release, build 8. * Build again with -march=zEC12 on Ubuntu/s390x. - -- Matthias Klose Thu, 16 Apr 2020 09:15:12 +0200 + -- Matthias Klose Fri, 17 Jul 2020 20:24:46 +0200 openjdk-13 (13.0.3+3-1) unstable; urgency=medium diff -Nru openjdk-13-13.0.3+3/debian/JB-demo.overrides.in openjdk-13-13.0.4+8/debian/JB-demo.overrides.in --- openjdk-13-13.0.3+3/debian/JB-demo.overrides.in 2015-06-16 09:38:27.000000000 +0000 +++ openjdk-13-13.0.4+8/debian/JB-demo.overrides.in 2020-07-17 16:23:16.000000000 +0000 @@ -6,3 +6,6 @@ # example jar file with sources and documentation @basename@-demo binary: codeless-jar + +# example jar file with sources +@basename@-demo binary: jar-contains-source diff -Nru openjdk-13-13.0.3+3/debian/patches/default-jvm-cfg.diff openjdk-13-13.0.4+8/debian/patches/default-jvm-cfg.diff --- openjdk-13-13.0.3+3/debian/patches/default-jvm-cfg.diff 2019-05-31 10:43:53.000000000 +0000 +++ openjdk-13-13.0.4+8/debian/patches/default-jvm-cfg.diff 2020-07-17 14:12:29.000000000 +0000 @@ -8,7 +8,7 @@ + char line[MAXPATHLEN+30]; int cnt = 0; int lineno = 0; - jlong start, end; + jlong start = 0, end = 0; @@ -2094,6 +2094,11 @@ ReadKnownVMs(const char *jvmCfgName, jbo jvmCfg = fopen(jvmCfgName, "r"); diff -Nru openjdk-13-13.0.3+3/debian/patches/generated-headers.patch openjdk-13-13.0.4+8/debian/patches/generated-headers.patch --- openjdk-13-13.0.3+3/debian/patches/generated-headers.patch 2019-05-31 08:14:53.000000000 +0000 +++ openjdk-13-13.0.4+8/debian/patches/generated-headers.patch 2020-07-17 14:12:59.000000000 +0000 @@ -1,6 +1,6 @@ --- a/make/lib/Awt2dLibraries.gmk +++ b/make/lib/Awt2dLibraries.gmk -@@ -377,7 +377,7 @@ $(eval $(call SetupJdkLibrary, BUILD_LIB +@@ -384,7 +384,7 @@ $(eval $(call SetupJdkLibrary, BUILD_LIB INCLUDE_FILES := $(BUILD_LIBLCMS_INCLUDE_FILES), \ OPTIMIZATION := HIGHEST, \ CFLAGS := $(CFLAGS_JDKLIB) \ @@ -9,7 +9,7 @@ CFLAGS_windows := -DCMS_IS_WINDOWS_, \ EXTRA_HEADER_DIRS := \ common/awt/debug \ -@@ -426,7 +426,7 @@ $(eval $(call SetupJdkLibrary, BUILD_LIB +@@ -433,7 +433,7 @@ $(eval $(call SetupJdkLibrary, BUILD_LIB NAME := javajpeg, \ INCLUDE_FILES := $(BUILD_LIBJAVAJPEG_INCLUDE_FILES), \ OPTIMIZATION := HIGHEST, \ diff -Nru openjdk-13-13.0.3+3/debian/patches/icc_loading_with_symlink.diff openjdk-13-13.0.4+8/debian/patches/icc_loading_with_symlink.diff --- openjdk-13-13.0.3+3/debian/patches/icc_loading_with_symlink.diff 2020-04-15 06:34:49.000000000 +0000 +++ openjdk-13-13.0.4+8/debian/patches/icc_loading_with_symlink.diff 2020-07-17 14:12:20.000000000 +0000 @@ -1,6 +1,6 @@ --- a/src/java.desktop/share/classes/java/awt/color/ICC_Profile.java +++ b/src/java.desktop/share/classes/java/awt/color/ICC_Profile.java -@@ -1795,9 +1795,6 @@ public class ICC_Profile implements Seri +@@ -1790,9 +1790,6 @@ public class ICC_Profile implements Seri dir = st.nextToken(); fullPath = dir + File.separatorChar + fileName; f = new File(fullPath); @@ -10,7 +10,7 @@ } } -@@ -1836,26 +1833,6 @@ public class ICC_Profile implements Seri +@@ -1831,26 +1828,6 @@ public class ICC_Profile implements Seri } /** diff -Nru openjdk-13-13.0.3+3/debian/patches/jdk8211105-aarch64-disable_cos_sin_and_log_intrinsics.patch openjdk-13-13.0.4+8/debian/patches/jdk8211105-aarch64-disable_cos_sin_and_log_intrinsics.patch --- openjdk-13-13.0.3+3/debian/patches/jdk8211105-aarch64-disable_cos_sin_and_log_intrinsics.patch 2020-04-15 06:35:32.000000000 +0000 +++ openjdk-13-13.0.4+8/debian/patches/jdk8211105-aarch64-disable_cos_sin_and_log_intrinsics.patch 2020-07-17 14:13:10.000000000 +0000 @@ -10,7 +10,7 @@ --- a/src/hotspot/cpu/aarch64/stubGenerator_aarch64.cpp +++ b/src/hotspot/cpu/aarch64/stubGenerator_aarch64.cpp -@@ -5693,7 +5693,8 @@ class StubGenerator: public StubCodeGene +@@ -5649,7 +5649,8 @@ class StubGenerator: public StubCodeGene // } if (vmIntrinsics::is_intrinsic_available(vmIntrinsics::_dsin)) { diff -Nru openjdk-13-13.0.3+3/debian/patches/jdk-getAccessibleValue.diff openjdk-13-13.0.4+8/debian/patches/jdk-getAccessibleValue.diff --- openjdk-13-13.0.3+3/debian/patches/jdk-getAccessibleValue.diff 2020-04-15 06:35:04.000000000 +0000 +++ openjdk-13-13.0.4+8/debian/patches/jdk-getAccessibleValue.diff 2020-07-17 14:12:41.000000000 +0000 @@ -193,7 +193,7 @@ --- a/src/jdk.accessibility/windows/classes/com/sun/java/accessibility/internal/AccessBridge.java +++ b/src/jdk.accessibility/windows/classes/com/sun/java/accessibility/internal/AccessBridge.java -@@ -6550,7 +6550,7 @@ final public class AccessBridge { +@@ -6626,7 +6626,7 @@ final public class AccessBridge { public AccessibleSelection getAccessibleSelection() { AccessibleContext ac = getCurrentAccessibleContext(); if (ac != null && isLeaf) { @@ -202,7 +202,7 @@ } else { return this; } -@@ -6565,7 +6565,7 @@ final public class AccessBridge { +@@ -6641,7 +6641,7 @@ final public class AccessBridge { public AccessibleText getAccessibleText() { AccessibleContext ac = getCurrentAccessibleContext(); if (ac != null) { @@ -211,7 +211,7 @@ } else { return null; } -@@ -6580,7 +6580,7 @@ final public class AccessBridge { +@@ -6656,7 +6656,7 @@ final public class AccessBridge { public AccessibleValue getAccessibleValue() { AccessibleContext ac = getCurrentAccessibleContext(); if (ac != null) { diff -Nru openjdk-13-13.0.3+3/debian/patches/jexec.diff openjdk-13-13.0.4+8/debian/patches/jexec.diff --- openjdk-13-13.0.3+3/debian/patches/jexec.diff 2019-04-18 04:34:49.000000000 +0000 +++ openjdk-13-13.0.4+8/debian/patches/jexec.diff 2020-07-17 14:12:25.000000000 +0000 @@ -14,7 +14,7 @@ errorExit(errno, BAD_ARG_MSG); --- a/make/launcher/Launcher-java.base.gmk +++ b/make/launcher/Launcher-java.base.gmk -@@ -67,6 +67,9 @@ $(eval $(call SetupBuildLauncher, keytoo +@@ -56,6 +56,9 @@ $(eval $(call SetupBuildLauncher, keytoo ################################################################################ ifeq ($(call isTargetOs, linux), true) @@ -24,7 +24,7 @@ $(eval $(call SetupJdkExecutable, BUILD_JEXEC, \ NAME := jexec, \ SRC := $(TOPDIR)/src/$(MODULE)/unix/native/launcher, \ -@@ -74,7 +77,7 @@ ifeq ($(call isTargetOs, linux), true) +@@ -63,7 +66,7 @@ ifeq ($(call isTargetOs, linux), true) OPTIMIZATION := LOW, \ CFLAGS := $(CFLAGS_JDKEXE) \ -I$(TOPDIR)/src/$(MODULE)/share/native/libjli, \ diff -Nru openjdk-13-13.0.3+3/debian/patches/jtreg-location.diff openjdk-13-13.0.4+8/debian/patches/jtreg-location.diff --- openjdk-13-13.0.3+3/debian/patches/jtreg-location.diff 2020-04-15 06:35:07.000000000 +0000 +++ openjdk-13-13.0.4+8/debian/patches/jtreg-location.diff 2020-07-17 14:12:45.000000000 +0000 @@ -1,6 +1,6 @@ --- a/make/autoconf/toolchain.m4 +++ b/make/autoconf/toolchain.m4 -@@ -1092,7 +1092,7 @@ AC_DEFUN_ONCE([TOOLCHAIN_SETUP_JTREG], +@@ -1093,7 +1093,7 @@ AC_DEFUN_ONCE([TOOLCHAIN_SETUP_JTREG], AC_MSG_ERROR([jtreg home directory from --with-jtreg=$with_jtreg does not exist]) fi @@ -9,7 +9,7 @@ AC_MSG_ERROR([jtreg home directory from --with-jtreg=$with_jtreg is not a valid jtreg home]) fi -@@ -1111,7 +1111,7 @@ AC_DEFUN_ONCE([TOOLCHAIN_SETUP_JTREG], +@@ -1112,7 +1112,7 @@ AC_DEFUN_ONCE([TOOLCHAIN_SETUP_JTREG], AC_MSG_WARN([Ignoring JT_HOME pointing to invalid directory: $JT_HOME]) JT_HOME= else @@ -18,7 +18,7 @@ AC_MSG_WARN([Ignoring JT_HOME which is not a valid jtreg home: $JT_HOME]) JT_HOME= elif test ! -x "$JT_HOME/bin/jtreg"; then -@@ -1131,7 +1131,7 @@ AC_DEFUN_ONCE([TOOLCHAIN_SETUP_JTREG], +@@ -1132,7 +1132,7 @@ AC_DEFUN_ONCE([TOOLCHAIN_SETUP_JTREG], if test "x$JTREGEXE" != x; then # That's good, now try to derive JT_HOME JT_HOME=`(cd $($DIRNAME $JTREGEXE)/.. && pwd)` @@ -29,8 +29,8 @@ JTREGEXE= --- a/make/RunTests.gmk +++ b/make/RunTests.gmk -@@ -927,7 +927,7 @@ define SetupRunJtregTestBody - $$(call ExecuteWithLog, $$($1_TEST_SUPPORT_DIR)/jtreg, \ +@@ -928,7 +928,7 @@ define SetupRunJtregTestBody + $$(call ExecuteWithLog, $$($1_TEST_SUPPORT_DIR)/jtreg, ( \ $$(COV_ENVIRONMENT) \ $$(JAVA) $$($1_JTREG_LAUNCHER_OPTIONS) \ - -Dprogram=jtreg -jar $$(JT_HOME)/lib/jtreg.jar \ diff -Nru openjdk-13-13.0.3+3/debian/patches/m68k-support.diff openjdk-13-13.0.4+8/debian/patches/m68k-support.diff --- openjdk-13-13.0.3+3/debian/patches/m68k-support.diff 2019-05-28 14:45:00.000000000 +0000 +++ openjdk-13-13.0.4+8/debian/patches/m68k-support.diff 2020-07-17 14:13:03.000000000 +0000 @@ -1042,7 +1042,7 @@ $(eval $(call SetupExecute, gen_x11wrappers, \ --- a/src/hotspot/share/memory/allocation.hpp +++ b/src/hotspot/share/memory/allocation.hpp -@@ -221,7 +221,7 @@ template class CHeapObj ALL +@@ -222,7 +222,7 @@ template class CHeapObj ALL void operator delete(void* p) { FreeHeap(p); } void operator delete [] (void* p) { FreeHeap(p); } @@ -1051,7 +1051,7 @@ // Base class for objects allocated on the stack only. // Calling new or delete will result in fatal error. -@@ -235,7 +235,7 @@ class StackObj ALLOCATION_SUPER_CLASS_SP +@@ -236,7 +236,7 @@ class StackObj ALLOCATION_SUPER_CLASS_SP #endif void operator delete(void* p); void operator delete [](void* p); @@ -1060,7 +1060,7 @@ // Base class for objects stored in Metaspace. // Calling delete will result in fatal error. -@@ -343,7 +343,7 @@ class MetaspaceObj { +@@ -344,7 +344,7 @@ class MetaspaceObj { // that should be read-only by default. See symbol.hpp for an example. This function // is used by the templates in metaspaceClosure.hpp static bool is_read_only_by_default() { return false; } @@ -1069,7 +1069,7 @@ // Base class for classes that constitute name spaces. -@@ -435,7 +435,7 @@ protected: +@@ -436,7 +436,7 @@ protected: void operator delete(void* p); void operator delete [](void* p); diff -Nru openjdk-13-13.0.3+3/debian/patches/machine-flag.diff openjdk-13-13.0.4+8/debian/patches/machine-flag.diff --- openjdk-13-13.0.3+3/debian/patches/machine-flag.diff 2019-03-16 15:05:17.000000000 +0000 +++ openjdk-13-13.0.4+8/debian/patches/machine-flag.diff 2020-07-17 14:12:52.000000000 +0000 @@ -1,6 +1,6 @@ --- a/make/autoconf/flags.m4 +++ b/make/autoconf/flags.m4 -@@ -261,6 +261,7 @@ AC_DEFUN_ONCE([FLAGS_PRE_TOOLCHAIN], +@@ -269,6 +269,7 @@ AC_DEFUN_ONCE([FLAGS_PRE_TOOLCHAIN], test "x$OPENJDK_TARGET_CPU_ARCH" = xppc; then MACHINE_FLAG="-m${OPENJDK_TARGET_CPU_BITS}" fi @@ -8,7 +8,7 @@ fi # FIXME: global flags are not used yet... -@@ -333,11 +334,8 @@ AC_DEFUN([FLAGS_SETUP_TOOLCHAIN_CONTROL] +@@ -343,11 +344,8 @@ AC_DEFUN([FLAGS_SETUP_TOOLCHAIN_CONTROL] AC_SUBST(COMPILER_COMMAND_FILE_FLAG) AC_SUBST(COMPILER_BINDCMD_FILE_FLAG) diff -Nru openjdk-13-13.0.3+3/debian/patches/make-debig-print.diff openjdk-13-13.0.4+8/debian/patches/make-debig-print.diff --- openjdk-13-13.0.3+3/debian/patches/make-debig-print.diff 2020-04-15 06:35:35.000000000 +0000 +++ openjdk-13-13.0.4+8/debian/patches/make-debig-print.diff 2020-07-17 14:13:12.000000000 +0000 @@ -1,6 +1,6 @@ --- a/make/Main.gmk +++ b/make/Main.gmk -@@ -1114,6 +1114,7 @@ ALL_TARGETS += default jdk images docs b +@@ -1146,6 +1146,7 @@ ALL_TARGETS += default jdk images docs b # Aliases used for running tests. diff -Nru openjdk-13-13.0.3+3/debian/patches/multiple-pkcs11-library-init.diff openjdk-13-13.0.4+8/debian/patches/multiple-pkcs11-library-init.diff --- openjdk-13-13.0.3+3/debian/patches/multiple-pkcs11-library-init.diff 2017-11-19 14:17:25.000000000 +0000 +++ openjdk-13-13.0.4+8/debian/patches/multiple-pkcs11-library-init.diff 2020-07-17 14:12:35.000000000 +0000 @@ -5,8 +5,6 @@ # Parent 1406789608b76d0906881979335d685855f44190 Allow multiple PKCS11 library initialisation to be a non-critical error. -Index: b/src/jdk.crypto.cryptoki/share/classes/sun/security/pkcs11/Config.java -=================================================================== --- a/src/jdk.crypto.cryptoki/share/classes/sun/security/pkcs11/Config.java +++ b/src/jdk.crypto.cryptoki/share/classes/sun/security/pkcs11/Config.java @@ -52,6 +52,7 @@ final class Config { @@ -26,11 +24,9 @@ } else { throw excToken("Invalid value for handleStartupErrors:"); } -Index: b/src/jdk.crypto.cryptoki/share/classes/sun/security/pkcs11/SunPKCS11.java -=================================================================== --- a/src/jdk.crypto.cryptoki/share/classes/sun/security/pkcs11/SunPKCS11.java +++ b/src/jdk.crypto.cryptoki/share/classes/sun/security/pkcs11/SunPKCS11.java -@@ -174,26 +174,37 @@ public final class SunPKCS11 extends Aut +@@ -173,26 +173,37 @@ public final class SunPKCS11 extends Aut String nssLibraryDirectory = config.getNssLibraryDirectory(); String nssSecmodDirectory = config.getNssSecmodDirectory(); boolean nssOptimizeSpace = config.getNssOptimizeSpace(); diff -Nru openjdk-13-13.0.3+3/debian/patches/riscv64.diff openjdk-13-13.0.4+8/debian/patches/riscv64.diff --- openjdk-13-13.0.3+3/debian/patches/riscv64.diff 2020-04-15 06:35:44.000000000 +0000 +++ openjdk-13-13.0.4+8/debian/patches/riscv64.diff 2020-07-17 14:13:20.000000000 +0000 @@ -82,7 +82,7 @@ elif test "x$OPENJDK_$1_CPU" = xs390x; then --- a/src/hotspot/os/linux/os_linux.cpp +++ b/src/hotspot/os/linux/os_linux.cpp -@@ -1762,6 +1762,9 @@ void * os::dll_load(const char *filename +@@ -1764,6 +1764,9 @@ void * os::dll_load(const char *filename #ifndef EM_AARCH64 #define EM_AARCH64 183 /* ARM AARCH64 */ #endif @@ -92,7 +92,7 @@ static const arch_t arch_array[]={ {EM_386, EM_386, ELFCLASS32, ELFDATA2LSB, (char*)"IA 32"}, -@@ -1787,6 +1790,7 @@ void * os::dll_load(const char *filename +@@ -1789,6 +1792,7 @@ void * os::dll_load(const char *filename {EM_PARISC, EM_PARISC, ELFCLASS32, ELFDATA2MSB, (char*)"PARISC"}, {EM_68K, EM_68K, ELFCLASS32, ELFDATA2MSB, (char*)"M68k"}, {EM_AARCH64, EM_AARCH64, ELFCLASS64, ELFDATA2LSB, (char*)"AARCH64"}, @@ -100,7 +100,7 @@ }; #if (defined IA32) -@@ -1803,6 +1807,8 @@ void * os::dll_load(const char *filename +@@ -1805,6 +1809,8 @@ void * os::dll_load(const char *filename static Elf32_Half running_arch_code=EM_PPC64; #elif (defined __powerpc__) static Elf32_Half running_arch_code=EM_PPC; @@ -109,7 +109,7 @@ #elif (defined AARCH64) static Elf32_Half running_arch_code=EM_AARCH64; #elif (defined ARM) -@@ -1823,7 +1829,7 @@ void * os::dll_load(const char *filename +@@ -1825,7 +1831,7 @@ void * os::dll_load(const char *filename static Elf32_Half running_arch_code=EM_SH; #else #error Method os::dll_load requires that one of following is defined:\ @@ -118,7 +118,7 @@ #endif // Identify compatability class for VM's architecture and library's architecture -@@ -2443,6 +2449,8 @@ void os::get_summary_cpu_info(char* cpui +@@ -2474,6 +2480,8 @@ void os::get_summary_cpu_info(char* cpui strncpy(cpuinfo, "IA64", length); #elif defined(PPC) strncpy(cpuinfo, "PPC64", length); diff -Nru openjdk-13-13.0.3+3/debian/patches/s390x-opt.diff openjdk-13-13.0.4+8/debian/patches/s390x-opt.diff --- openjdk-13-13.0.3+3/debian/patches/s390x-opt.diff 2020-04-15 06:44:01.000000000 +0000 +++ openjdk-13-13.0.4+8/debian/patches/s390x-opt.diff 2020-07-17 14:12:38.000000000 +0000 @@ -1,6 +1,6 @@ --- a/make/autoconf/flags-cflags.m4 +++ b/make/autoconf/flags-cflags.m4 -@@ -789,6 +789,9 @@ AC_DEFUN([FLAGS_SETUP_CFLAGS_CPU_DEP], +@@ -803,6 +803,9 @@ AC_DEFUN([FLAGS_SETUP_CFLAGS_CPU_DEP], fi elif test "x$FLAGS_CPU" = xs390x; then $1_CFLAGS_CPU="-mbackchain -march=z10" diff -Nru openjdk-13-13.0.3+3/debian/patches/system-pcsclite.diff openjdk-13-13.0.4+8/debian/patches/system-pcsclite.diff --- openjdk-13-13.0.3+3/debian/patches/system-pcsclite.diff 2020-04-15 06:34:45.000000000 +0000 +++ openjdk-13-13.0.4+8/debian/patches/system-pcsclite.diff 2020-07-17 14:12:16.000000000 +0000 @@ -52,7 +52,7 @@ +]) --- a/make/autoconf/spec.gmk.in +++ b/make/autoconf/spec.gmk.in -@@ -775,6 +775,7 @@ ENABLE_AOT:=@ENABLE_AOT@ +@@ -784,6 +784,7 @@ ENABLE_AOT:=@ENABLE_AOT@ ENABLE_INTREE_EC:=@ENABLE_INTREE_EC@ USE_EXTERNAL_LIBJPEG:=@USE_EXTERNAL_LIBJPEG@ USE_EXTERNAL_LIBGIF:=@USE_EXTERNAL_LIBGIF@ diff -Nru openjdk-13-13.0.3+3/debian/patches/workaround_expand_exec_shield_cs_limit.diff openjdk-13-13.0.4+8/debian/patches/workaround_expand_exec_shield_cs_limit.diff --- openjdk-13-13.0.3+3/debian/patches/workaround_expand_exec_shield_cs_limit.diff 2020-04-15 06:34:56.000000000 +0000 +++ openjdk-13-13.0.4+8/debian/patches/workaround_expand_exec_shield_cs_limit.diff 2020-07-17 14:12:32.000000000 +0000 @@ -11,7 +11,7 @@ --- a/src/hotspot/os/linux/os_linux.cpp +++ b/src/hotspot/os/linux/os_linux.cpp -@@ -5127,7 +5127,7 @@ jint os::init_2(void) { +@@ -5158,7 +5158,7 @@ jint os::init_2(void) { return JNI_ERR; } diff -Nru openjdk-13-13.0.3+3/debian/rules openjdk-13-13.0.4+8/debian/rules --- openjdk-13-13.0.3+3/debian/rules 2020-04-16 07:15:02.000000000 +0000 +++ openjdk-13-13.0.4+8/debian/rules 2020-07-21 11:36:52.000000000 +0000 @@ -1828,7 +1828,7 @@ is_release = yes #is_release = hg_project = jdk13u -hg_tag = jdk-13.0.3+3 +hg_tag = jdk-13.0.4+8 package_version = $(subst jdk-,,$(hg_tag)) ifneq ($(is_release),yes) package_version := $(subst +,~,$(package_version)) diff -Nru openjdk-13-13.0.3+3/doc/building.html openjdk-13-13.0.4+8/doc/building.html --- openjdk-13-13.0.3+3/doc/building.html 2020-02-20 22:05:38.000000000 +0000 +++ openjdk-13-13.0.4+8/doc/building.html 2020-07-07 16:55:29.000000000 +0000 @@ -385,10 +385,10 @@

On Linux you can also get a JDK from the Linux distribution. On apt-based distros (like Debian and Ubuntu), sudo apt-get install openjdk-<VERSION>-jdk is typically enough to install a JDK <VERSION>. On rpm-based distros (like Fedora and Red Hat), try sudo yum install java-<VERSION>-openjdk-devel.

External Library Requirements

Different platforms require different external libraries. In general, libraries are not optional - that is, they are either required or not used.

-

If a required library is not detected by configure, you need to provide the path to it. There are two forms of the configure arguments to point to an external library: --with-<LIB>=<path> or --with-<LIB>-include=<path to include> --with-<LIB>-lib=<path to lib>. The first variant is more concise, but require the include files an library files to reside in a default hierarchy under this directory. In most cases, it works fine.

+

If a required library is not detected by configure, you need to provide the path to it. There are two forms of the configure arguments to point to an external library: --with-<LIB>=<path> or --with-<LIB>-include=<path to include> --with-<LIB>-lib=<path to lib>. The first variant is more concise, but require the include files and library files to reside in a default hierarchy under this directory. In most cases, it works fine.

As a fallback, the second version allows you to point to the include directory and the lib directory separately.

FreeType

-

FreeType2 from The FreeType Project is not required on any platform. The exception is on Unix-based platforms when configuring such that the build artifacts will reference a system installed library, rather than bundling the JDK’s own copy.

+

FreeType2 from The FreeType Project is not required on any platform. The exception is on Unix-based platforms when configuring such that the build artifacts will reference a system installed library, rather than bundling the JDK's own copy.

  • To install on an apt-based Linux, try running sudo apt-get install libfreetype6-dev.
  • To install on an rpm-based Linux, try running sudo yum install freetype-devel.
  • @@ -449,7 +449,7 @@

    To build the JDK, you need a "configuration", which consists of a directory where to store the build output, coupled with information about the platform, the specific build machine, and choices that affect how the JDK is built.

    The configuration is created by the configure script. The basic invocation of the configure script looks like this:

    bash configure [options]
    -

    This will create an output directory containing the configuration and setup an area for the build result. This directory typically looks like build/linux-x64-normal-server-release, but the actual name depends on your specific configuration. (It can also be set directly, see Using Multiple Configurations). This directory is referred to as $BUILD in this documentation.

    +

    This will create an output directory containing the configuration and setup an area for the build result. This directory typically looks like build/linux-x64-server-release, but the actual name depends on your specific configuration. (It can also be set directly, see Using Multiple Configurations). This directory is referred to as $BUILD in this documentation.

    configure will try to figure out what system you are running on and where all necessary build components are. If you have all prerequisites for building installed, it should find everything. If it fails to detect any component automatically, it will exit and inform you about the problem.

    Some command line examples:

      @@ -572,6 +572,7 @@
    • CONF_CHECK
    • COMPARE_BUILD
    • JDK_FILTER
    • +
    • SPEC_FILTER

    Running Tests

    Most of the JDK tests are using the JTReg test framework. Make sure that your configuration knows where to find your installation of JTReg. If this is not picked up automatically, use the --with-jtreg=<path to jtreg home> option to point to the JTReg framework. Note that this option should point to the JTReg home, i.e. the top directory, containing lib/jtreg.jar etc.

    diff -Nru openjdk-13-13.0.3+3/doc/building.md openjdk-13-13.0.4+8/doc/building.md --- openjdk-13-13.0.3+3/doc/building.md 2020-02-20 22:05:38.000000000 +0000 +++ openjdk-13-13.0.4+8/doc/building.md 2020-07-07 16:55:29.000000000 +0000 @@ -473,8 +473,8 @@ path to it. There are two forms of the `configure` arguments to point to an external library: `--with-=` or `--with--include= --with--lib=`. The first variant is more concise, -but require the include files an library files to reside in a default hierarchy -under this directory. In most cases, it works fine. +but require the include files and library files to reside in a default +hierarchy under this directory. In most cases, it works fine. As a fallback, the second version allows you to point to the include directory and the lib directory separately. @@ -484,7 +484,7 @@ FreeType2 from [The FreeType Project](http://www.freetype.org/) is not required on any platform. The exception is on Unix-based platforms when configuring such that the build artifacts will reference a system installed library, -rather than bundling the JDK’s own copy. +rather than bundling the JDK's own copy. * To install on an apt-based Linux, try running `sudo apt-get install libfreetype6-dev`. @@ -623,8 +623,8 @@ This will create an output directory containing the configuration and setup an area for the build result. This directory typically looks like -`build/linux-x64-normal-server-release`, but the actual name depends on your -specific configuration. (It can also be set directly, see [Using Multiple +`build/linux-x64-server-release`, but the actual name depends on your specific +configuration. (It can also be set directly, see [Using Multiple Configurations](#using-multiple-configurations)). This directory is referred to as `$BUILD` in this documentation. diff -Nru openjdk-13-13.0.3+3/doc/testing.html openjdk-13-13.0.4+8/doc/testing.html --- openjdk-13-13.0.3+3/doc/testing.html 2020-02-20 22:05:38.000000000 +0000 +++ openjdk-13-13.0.4+8/doc/testing.html 2020-07-07 16:55:29.000000000 +0000 @@ -5,7 +5,7 @@ Testing the JDK - " + + "bold italic em mark del " + + "small big sup sub ins " + + "strong code strike" + + ""; + + for (Class aClass : testClass) { + try { + Constructor constructor = aClass.getDeclaredConstructor(ctorArg); + JComponent comp = (JComponent) constructor.newInstance(inputText); + if (!expectedText.equals(comp.getAccessibleContext().getAccessibleName())) { + throw new RuntimeException("AccessibleName of " + aClass.getName() + " is incorrect." + + " Expected: " + expectedText + + " Actual: " + comp.getAccessibleContext().getAccessibleName()); + } + } catch (NoSuchMethodException e) { + throw new RuntimeException(aClass.getName() + " does not have a constructor accepting" + + "String parameter.", e.getCause()); + } catch (InstantiationException e) { + throw new RuntimeException(aClass.getName() + " could not be instantiated.", + e.getCause()); + } catch (IllegalAccessException e) { + throw new RuntimeException(aClass.getName() + " constructor cannot be accessed.", + e.getCause()); + } catch (InvocationTargetException e) { + throw new RuntimeException(aClass.getName() + " constructor cannot be invoked.", + e.getCause()); + } + } + } + + private static void testSetText() { + String text = "html text"; + JLabel testLabel = new JLabel("" + text + ""); + if (!text.equals(testLabel.getAccessibleContext().getAccessibleName())) { + throw new RuntimeException("Incorrect AccessibleName," + + " Expected: " + text + + " Actual: " + testLabel.getAccessibleContext().getAccessibleName()); + } + + text = "Non html text"; + testLabel.setText(text); + if (!text.equals(testLabel.getAccessibleContext().getAccessibleName())) { + throw new RuntimeException("Incorrect AccessibleName," + + " Expected: " + text + + " Actual: " + testLabel.getAccessibleContext().getAccessibleName()); + } + } + + private static void testAccessibleProperty() { + String text = "html text"; + JLabel testLabel = new JLabel("" + text + ""); + if (!text.equals(testLabel.getClientProperty(AccessibleContext.ACCESSIBLE_NAME_PROPERTY))) { + throw new RuntimeException("Incorrect ACCESSIBLE_NAME_PROPERTY," + + " Expected: " + text + + " Actual: " + testLabel.getClientProperty(AccessibleContext.ACCESSIBLE_NAME_PROPERTY)); + } + + String namePropertyText = "name property"; + testLabel.putClientProperty(AccessibleContext.ACCESSIBLE_NAME_PROPERTY, namePropertyText); + if (!namePropertyText.equals(testLabel.getClientProperty(AccessibleContext.ACCESSIBLE_NAME_PROPERTY))) { + throw new RuntimeException("Incorrect ACCESSIBLE_NAME_PROPERTY," + + " Expected: " + namePropertyText + + " Actual: " + testLabel.getClientProperty(AccessibleContext.ACCESSIBLE_NAME_PROPERTY)); + } + + text = "different html text"; + testLabel.setText("" + text + ""); + if (!namePropertyText.equals(testLabel.getClientProperty(AccessibleContext.ACCESSIBLE_NAME_PROPERTY))) { + throw new RuntimeException("Incorrect ACCESSIBLE_NAME_PROPERTY," + + " Expected: " + namePropertyText + + " Actual: " + testLabel.getClientProperty(AccessibleContext.ACCESSIBLE_NAME_PROPERTY)); + } + } +} diff -Nru openjdk-13-13.0.3+3/test/jdk/javax/imageio/plugins/gif/GIFCodeSizeTest.java openjdk-13-13.0.4+8/test/jdk/javax/imageio/plugins/gif/GIFCodeSizeTest.java --- openjdk-13-13.0.3+3/test/jdk/javax/imageio/plugins/gif/GIFCodeSizeTest.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-13-13.0.4+8/test/jdk/javax/imageio/plugins/gif/GIFCodeSizeTest.java 2020-07-07 16:55:29.000000000 +0000 @@ -0,0 +1,52 @@ +/* + * Copyright (c) 2020, 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 8238842 + * @summary Test incorrect code size results in IOException + */ + +import java.io.ByteArrayInputStream; +import java.io.IOException; +import javax.imageio.ImageIO; + +public class GIFCodeSizeTest { + + static final byte[] DATA = { + (byte)0x47, (byte)0x49, (byte)0x46, (byte)0x38, (byte)0x37, + (byte)0x61, (byte)0x02, (byte)0x00, (byte)0x02, (byte)0x00, + (byte)0x80, (byte)0x00, (byte)0x80, (byte)0x00, (byte)0xff, + (byte)0xff, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x2c, + (byte)0x00, (byte)0x00, (byte)0x01, (byte)0x00, (byte)0x02, + (byte)0x00, (byte)0x02, (byte)0x00, (byte)0x00, (byte)0x12, + (byte)0x02, (byte)0x84, (byte)0x51, (byte)0x00, (byte)0x3b + }; + + public static void main(String[] args) /*throws Exception */{ + try { + ImageIO.read(new ByteArrayInputStream(DATA)); + } catch (IOException e) { + } + } +} diff -Nru openjdk-13-13.0.3+3/test/jdk/javax/management/loading/MletParserLocaleTest.java openjdk-13-13.0.4+8/test/jdk/javax/management/loading/MletParserLocaleTest.java --- openjdk-13-13.0.3+3/test/jdk/javax/management/loading/MletParserLocaleTest.java 2020-02-20 22:05:38.000000000 +0000 +++ openjdk-13-13.0.4+8/test/jdk/javax/management/loading/MletParserLocaleTest.java 2020-07-07 16:55:29.000000000 +0000 @@ -29,7 +29,7 @@ * * @run clean MletParserLocaleTest * @run build MletParserLocaleTest - * @run main/othervm/timeout=5 MletParserLocaleTest mlet4.html + * @run main/othervm MletParserLocaleTest mlet4.html */ import java.io.File; diff -Nru openjdk-13-13.0.3+3/test/jdk/javax/management/loading/ParserInfiniteLoopTest.java openjdk-13-13.0.4+8/test/jdk/javax/management/loading/ParserInfiniteLoopTest.java --- openjdk-13-13.0.3+3/test/jdk/javax/management/loading/ParserInfiniteLoopTest.java 2020-02-20 22:05:38.000000000 +0000 +++ openjdk-13-13.0.4+8/test/jdk/javax/management/loading/ParserInfiniteLoopTest.java 2020-07-07 16:55:29.000000000 +0000 @@ -32,9 +32,9 @@ * * @run clean ParserInfiniteLoopTest * @run build ParserInfiniteLoopTest - * @run main/othervm/timeout=5 ParserInfiniteLoopTest mlet1.html - * @run main/othervm/timeout=5 ParserInfiniteLoopTest mlet2.html - * @run main/othervm/timeout=5 ParserInfiniteLoopTest mlet3.html + * @run main/othervm ParserInfiniteLoopTest mlet1.html + * @run main/othervm ParserInfiniteLoopTest mlet2.html + * @run main/othervm ParserInfiniteLoopTest mlet3.html */ import java.io.File; diff -Nru openjdk-13-13.0.3+3/test/jdk/javax/naming/spi/DummyContextFactory2.java openjdk-13-13.0.4+8/test/jdk/javax/naming/spi/DummyContextFactory2.java --- openjdk-13-13.0.3+3/test/jdk/javax/naming/spi/DummyContextFactory2.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-13-13.0.4+8/test/jdk/javax/naming/spi/DummyContextFactory2.java 2020-07-07 16:55:29.000000000 +0000 @@ -0,0 +1,55 @@ +/* + * Copyright (c) 2020, 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 javax.naming.Context; +import javax.naming.InitialContext; +import javax.naming.NamingException; +import javax.naming.spi.InitialContextFactory; +import java.util.Hashtable; + +public class DummyContextFactory2 implements InitialContextFactory { + static int counter = 0; + + public DummyContextFactory2() { + System.out.println("New DummyContextFactory2 " + (++counter)); + //new Throwable().printStackTrace(System.out); + } + + @Override + public Context getInitialContext(Hashtable environment) throws NamingException { + return new DummyContext(environment); + } + + public class DummyContext extends InitialContext { + + private Hashtable env; + + DummyContext(Hashtable env) throws NamingException { + this.env = env; + } + + public Hashtable getEnvironment() { + return env; + } + } +} \ No newline at end of file diff -Nru openjdk-13-13.0.3+3/test/jdk/javax/naming/spi/DummyContextFactory.java openjdk-13-13.0.4+8/test/jdk/javax/naming/spi/DummyContextFactory.java --- openjdk-13-13.0.3+3/test/jdk/javax/naming/spi/DummyContextFactory.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-13-13.0.4+8/test/jdk/javax/naming/spi/DummyContextFactory.java 2020-07-07 16:55:29.000000000 +0000 @@ -0,0 +1,139 @@ +/* + * Copyright (c) 2020, 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.lang.ref.WeakReference; +import java.net.URL; +import java.net.URLClassLoader; +import javax.naming.Context; +import javax.naming.InitialContext; +import javax.naming.NamingException; +import javax.naming.NoInitialContextException; +import javax.naming.spi.InitialContextFactory; +import javax.naming.spi.NamingManager; +import java.util.Hashtable; + +public class DummyContextFactory implements InitialContextFactory { + static final String DUMMY_FACTORY = "DummyContextFactory"; + static final String DUMMY_FACTORY2 = "DummyContextFactory2"; + static final String MISSING_FACTORY = "NonExistant"; + static int counter = 0; + ClassLoader origContextLoader = Thread.currentThread().getContextClassLoader(); + + public static void main(String[] s) throws Exception { + DummyContextFactory dcf = new DummyContextFactory(); + dcf.runTest(); + } + + private void runTest() throws Exception { + final String classes = System.getProperty("url.dir", "."); + final URL curl = new File(classes).toURI().toURL(); + URLClassLoader testLoader = new URLClassLoader(new URL[] {curl}, null); + WeakReference weakRef = new WeakReference<>(testLoader); + Thread.currentThread().setContextClassLoader(testLoader); + Hashtable env = new Hashtable<>(); + env.put(Context.INITIAL_CONTEXT_FACTORY, DUMMY_FACTORY); + testContextCalls(env); + + // now test with another factory + Thread.currentThread().setContextClassLoader(testLoader); + env.put(Context.INITIAL_CONTEXT_FACTORY, DUMMY_FACTORY2); + testContextCalls(env); + + // one count is derived from a default constructor call (ignored for test) + // class associated with this ClassLoader should have 2 counts + if (counter != 2) { + throw new RuntimeException("wrong count: " + counter); + } + + // a test for handling non-existent classes + env.put(Context.INITIAL_CONTEXT_FACTORY, MISSING_FACTORY); + testBadContextCall(env); + + // test that loader gets GC'ed + testLoader = null; + System.gc(); + while (weakRef.get() != null) { + Thread.sleep(100); + System.gc(); + } + } + + private void testContextCalls(Hashtable env) throws Exception { + // the context is returned here but it's the ContextFactory that + // we're mainly interested in. Hence the counter test. + + // 1st call populates the WeakHashMap + // Uses URLClassLoader + Context cxt = NamingManager.getInitialContext(env); + + // 2nd call uses cached factory + cxt = NamingManager.getInitialContext(env); + + Thread.currentThread().setContextClassLoader(origContextLoader); + + // 3rd call uses new factory + // AppClassLoader + cxt = NamingManager.getInitialContext(env); + + // test with null TCCL + // this shouldn't increase the count since a null TCCL + // means we default to System ClassLoader in this case (AppClassLoader) + Thread.currentThread().setContextClassLoader(null); + cxt = NamingManager.getInitialContext(env); + } + + private void testBadContextCall(Hashtable env) throws Exception { + try { + Context cxt = NamingManager.getInitialContext(env); + throw new RuntimeException("Expected NoInitialContextException"); + } catch (NoInitialContextException e) { + if (!(e.getCause() instanceof ClassNotFoundException)) { + throw new RuntimeException("unexpected cause", e.getCause()); + } + } + } + + public DummyContextFactory() { + System.out.println("New DummyContextFactory " + (++counter)); + //new Throwable().printStackTrace(System.out); + } + + @Override + public Context getInitialContext(Hashtable environment) throws NamingException { + return new DummyContext(environment); + } + + public class DummyContext extends InitialContext { + + private Hashtable env; + + DummyContext(Hashtable env) throws NamingException { + this.env = env; + } + + public Hashtable getEnvironment() { + return env; + } + } +} diff -Nru openjdk-13-13.0.3+3/test/jdk/javax/naming/spi/FactoryCacheTest.java openjdk-13-13.0.4+8/test/jdk/javax/naming/spi/FactoryCacheTest.java --- openjdk-13-13.0.3+3/test/jdk/javax/naming/spi/FactoryCacheTest.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-13-13.0.4+8/test/jdk/javax/naming/spi/FactoryCacheTest.java 2020-07-07 16:55:29.000000000 +0000 @@ -0,0 +1,91 @@ +/* + * Copyright (c) 2020, 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 8223260 + * @summary NamingManager should cache InitialContextFactory + * @library /test/lib + * @build jdk.test.lib.util.JarUtils jdk.test.lib.process.* + * FactoryCacheTest + * DummyContextFactory + * DummyContextFactory2 + * @run main FactoryCacheTest + */ + +import java.nio.file.Files; +import java.nio.file.Path; +import java.util.ArrayList; +import java.util.List; + +import jdk.test.lib.JDKToolFinder; +import jdk.test.lib.Utils; +import jdk.test.lib.process.ProcessTools; +import jdk.test.lib.util.JarUtils; + +import static java.nio.file.StandardOpenOption.CREATE; +import static java.util.Arrays.asList; + +import static jdk.test.lib.Utils.TEST_CLASSES; + +public class FactoryCacheTest { + + private static final Path SPIJAR = Path.of("testDir", "ContextFactory.jar"); + private static final String SPIJAR_CP = SPIJAR.toAbsolutePath().toString(); + + public static void main(String[] args) throws Throwable { + List argLine = new ArrayList<>(); + argLine.add(JDKToolFinder.getJDKTool("java")); + argLine.addAll(asList(Utils.getTestJavaOpts())); + argLine.addAll(List.of("-cp", TEST_CLASSES)); + argLine.addAll(List.of("-Durl.dir=" + TEST_CLASSES)); + argLine.add("DummyContextFactory"); + + ProcessTools.executeCommand(argLine.stream() + .filter(t -> !t.isEmpty()) + .toArray(String[]::new)) + .shouldHaveExitValue(0); + + // now test the ServiceLoader approach + setupService(); + argLine = new ArrayList<>(); + argLine.add(JDKToolFinder.getJDKTool("java")); + argLine.addAll(asList(Utils.getTestJavaOpts())); + argLine.addAll(List.of("-cp", SPIJAR_CP)); + argLine.addAll(List.of("-Durl.dir=" + TEST_CLASSES)); + argLine.add("DummyContextFactory"); + + ProcessTools.executeCommand(argLine.stream() + .filter(t -> !t.isEmpty()) + .toArray(String[]::new)) + .shouldHaveExitValue(0); + } + + private static void setupService() throws Exception { + Path xdir = Path.of(TEST_CLASSES); + Path config = xdir.resolve(Path.of(TEST_CLASSES,"META-INF/services/javax.naming.spi.InitialContextFactory")); + Files.createDirectories(config.getParent()); + Files.write(config, "DummyContextFactory".getBytes(), CREATE); + JarUtils.createJarFile(SPIJAR, xdir); + } +} diff -Nru openjdk-13-13.0.3+3/test/jdk/javax/net/ssl/sanity/ciphersuites/CipherSuitesInOrder.java openjdk-13-13.0.4+8/test/jdk/javax/net/ssl/sanity/ciphersuites/CipherSuitesInOrder.java --- openjdk-13-13.0.3+3/test/jdk/javax/net/ssl/sanity/ciphersuites/CipherSuitesInOrder.java 2020-02-20 22:05:38.000000000 +0000 +++ openjdk-13-13.0.4+8/test/jdk/javax/net/ssl/sanity/ciphersuites/CipherSuitesInOrder.java 2020-07-07 16:55:29.000000000 +0000 @@ -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 @@ -28,143 +28,179 @@ /* * @test - * @bug 7174244 - * @summary NPE in Krb5ProxyImpl.getServerKeys() - * @ignore the dependent implementation details are changed + * @bug 7174244 8234728 + * @summary Test for ciphersuites order * @run main/othervm CipherSuitesInOrder */ - import java.util.*; import javax.net.ssl.*; -import java.security.Security; public class CipherSuitesInOrder { - // supported ciphersuites - private final static List supportedCipherSuites = - Arrays.asList( - "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_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_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_3DES_EDE_CBC_SHA", - "TLS_ECDHE_RSA_WITH_3DES_EDE_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", - "SSL_DHE_RSA_WITH_3DES_EDE_CBC_SHA", - "SSL_DHE_DSS_WITH_3DES_EDE_CBC_SHA", - - "TLS_EMPTY_RENEGOTIATION_INFO_SCSV", - - "TLS_DH_anon_WITH_AES_256_GCM_SHA384", - "TLS_DH_anon_WITH_AES_128_GCM_SHA256", - - "TLS_DH_anon_WITH_AES_256_CBC_SHA256", - "TLS_ECDH_anon_WITH_AES_256_CBC_SHA", - "TLS_DH_anon_WITH_AES_256_CBC_SHA", - "TLS_DH_anon_WITH_AES_128_CBC_SHA256", - "TLS_ECDH_anon_WITH_AES_128_CBC_SHA", - "TLS_DH_anon_WITH_AES_128_CBC_SHA", - "TLS_ECDH_anon_WITH_3DES_EDE_CBC_SHA", - "SSL_DH_anon_WITH_3DES_EDE_CBC_SHA", - - "TLS_ECDHE_ECDSA_WITH_RC4_128_SHA", - "TLS_ECDHE_RSA_WITH_RC4_128_SHA", - "SSL_RSA_WITH_RC4_128_SHA", - "TLS_ECDH_ECDSA_WITH_RC4_128_SHA", - "TLS_ECDH_RSA_WITH_RC4_128_SHA", - "SSL_RSA_WITH_RC4_128_MD5", - "TLS_ECDH_anon_WITH_RC4_128_SHA", - "SSL_DH_anon_WITH_RC4_128_MD5", - - "SSL_RSA_WITH_DES_CBC_SHA", - "SSL_DHE_RSA_WITH_DES_CBC_SHA", - "SSL_DHE_DSS_WITH_DES_CBC_SHA", - "SSL_DH_anon_WITH_DES_CBC_SHA", - "SSL_RSA_EXPORT_WITH_DES40_CBC_SHA", - "SSL_DHE_RSA_EXPORT_WITH_DES40_CBC_SHA", - "SSL_DHE_DSS_EXPORT_WITH_DES40_CBC_SHA", - "SSL_DH_anon_EXPORT_WITH_DES40_CBC_SHA", - - "SSL_RSA_EXPORT_WITH_RC4_40_MD5", - "SSL_DH_anon_EXPORT_WITH_RC4_40_MD5", - - "TLS_RSA_WITH_NULL_SHA256", - "TLS_ECDHE_ECDSA_WITH_NULL_SHA", - "TLS_ECDHE_RSA_WITH_NULL_SHA", - "SSL_RSA_WITH_NULL_SHA", - "TLS_ECDH_ECDSA_WITH_NULL_SHA", - "TLS_ECDH_RSA_WITH_NULL_SHA", - "TLS_ECDH_anon_WITH_NULL_SHA", - "SSL_RSA_WITH_NULL_MD5", - - "TLS_KRB5_WITH_3DES_EDE_CBC_SHA", - "TLS_KRB5_WITH_3DES_EDE_CBC_MD5", - "TLS_KRB5_WITH_RC4_128_SHA", - "TLS_KRB5_WITH_RC4_128_MD5", - "TLS_KRB5_WITH_DES_CBC_SHA", - "TLS_KRB5_WITH_DES_CBC_MD5", - "TLS_KRB5_EXPORT_WITH_DES_CBC_40_SHA", - "TLS_KRB5_EXPORT_WITH_DES_CBC_40_MD5", - "TLS_KRB5_EXPORT_WITH_RC4_40_SHA", - "TLS_KRB5_EXPORT_WITH_RC4_40_MD5" - ); + // Supported ciphersuites + private final static List supportedCipherSuites + = Arrays.asList( + // TLS 1.3 cipher suites. + "TLS_AES_256_GCM_SHA384", + "TLS_AES_128_GCM_SHA256", + "TLS_CHACHA20_POLY1305_SHA256", + // Suite B compliant cipher suites, see RFC 6460. + "TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384", + "TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256", + // Not suite B, but we want it to position the suite early + //in the list of 1.2 suites. + "TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305_SHA256", + // + // Forward secrecy cipher suites. + // + // AES_256(GCM) - ECDHE + "TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384", + "TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256", + // AES_128(GCM) - ECDHE + "TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256", + // AES_256(GCM) - DHE + "TLS_DHE_RSA_WITH_AES_256_GCM_SHA384", + "TLS_DHE_RSA_WITH_CHACHA20_POLY1305_SHA256", + "TLS_DHE_DSS_WITH_AES_256_GCM_SHA384", + // AES_128(GCM) - DHE + "TLS_DHE_RSA_WITH_AES_128_GCM_SHA256", + "TLS_DHE_DSS_WITH_AES_128_GCM_SHA256", + // AES_256(CBC) - ECDHE + "TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384", + "TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384", + // AES_128(CBC) - ECDHE + "TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256", + "TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256", + // AES_256(CBC) - DHE + "TLS_DHE_RSA_WITH_AES_256_CBC_SHA256", + "TLS_DHE_DSS_WITH_AES_256_CBC_SHA256", + // AES_128(CBC) - DHE + "TLS_DHE_RSA_WITH_AES_128_CBC_SHA256", + "TLS_DHE_DSS_WITH_AES_128_CBC_SHA256", + // + // Not forward secret cipher suites. + // + // AES_256(GCM) + "TLS_ECDH_ECDSA_WITH_AES_256_GCM_SHA384", + "TLS_ECDH_RSA_WITH_AES_256_GCM_SHA384", + // AES_128(GCM) + "TLS_ECDH_ECDSA_WITH_AES_128_GCM_SHA256", + "TLS_ECDH_RSA_WITH_AES_128_GCM_SHA256", + // AES_256(CBC) + "TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA384", + "TLS_ECDH_RSA_WITH_AES_256_CBC_SHA384", + // AES_128(CBC) + "TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA256", + "TLS_ECDH_RSA_WITH_AES_128_CBC_SHA256", + // + // Legacy, used for compatibility + // + // AES_256(CBC) - ECDHE - Using SHA + "TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA", + "TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA", + // AES_128(CBC) - ECDHE - using SHA + "TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA", + "TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA", + // AES_256(CBC) - DHE - Using SHA + "TLS_DHE_RSA_WITH_AES_256_CBC_SHA", + "TLS_DHE_DSS_WITH_AES_256_CBC_SHA", + // AES_128(CBC) - DHE - using SHA + "TLS_DHE_RSA_WITH_AES_128_CBC_SHA", + "TLS_DHE_DSS_WITH_AES_128_CBC_SHA", + // AES_256(CBC) - using SHA, not forward secrecy + "TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA", + "TLS_ECDH_RSA_WITH_AES_256_CBC_SHA", + // AES_128(CBC) - using SHA, not forward secrecy + "TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA", + "TLS_ECDH_RSA_WITH_AES_128_CBC_SHA", + // + // Deprecated, used for compatibility + // + // RSA, AES_256(GCM) + "TLS_RSA_WITH_AES_256_GCM_SHA384", + // RSA, AES_128(GCM) + "TLS_RSA_WITH_AES_128_GCM_SHA256", + // RSA, AES_256(CBC) + "TLS_RSA_WITH_AES_256_CBC_SHA256", + // RSA, AES_128(CBC) + "TLS_RSA_WITH_AES_128_CBC_SHA256", + // RSA, AES_256(CBC) - using SHA, not forward secrecy + "TLS_RSA_WITH_AES_256_CBC_SHA", + // RSA, AES_128(CBC) - using SHA, not forward secrecy + "TLS_RSA_WITH_AES_128_CBC_SHA", + // 3DES_EDE, forward secrecy. + "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", + // 3DES_EDE, not forward secrecy. + "TLS_ECDH_ECDSA_WITH_3DES_EDE_CBC_SHA", + "TLS_ECDH_RSA_WITH_3DES_EDE_CBC_SHA", + "SSL_RSA_WITH_3DES_EDE_CBC_SHA", + // Renegotiation protection request Signalling + // Cipher Suite Value (SCSV). + "TLS_EMPTY_RENEGOTIATION_INFO_SCSV", + // Definition of the Cipher Suites that are supported but not + // enabled by default. + "TLS_DH_anon_WITH_AES_256_GCM_SHA384", + "TLS_DH_anon_WITH_AES_128_GCM_SHA256", + "TLS_DH_anon_WITH_AES_256_CBC_SHA256", + "TLS_ECDH_anon_WITH_AES_256_CBC_SHA", + "TLS_DH_anon_WITH_AES_256_CBC_SHA", + "TLS_DH_anon_WITH_AES_128_CBC_SHA256", + "TLS_ECDH_anon_WITH_AES_128_CBC_SHA", + "TLS_DH_anon_WITH_AES_128_CBC_SHA", + "TLS_ECDH_anon_WITH_3DES_EDE_CBC_SHA", + "SSL_DH_anon_WITH_3DES_EDE_CBC_SHA", + // RC4 + "TLS_ECDHE_ECDSA_WITH_RC4_128_SHA", + "TLS_ECDHE_RSA_WITH_RC4_128_SHA", + "SSL_RSA_WITH_RC4_128_SHA", + "TLS_ECDH_ECDSA_WITH_RC4_128_SHA", + "TLS_ECDH_RSA_WITH_RC4_128_SHA", + "SSL_RSA_WITH_RC4_128_MD5", + "TLS_ECDH_anon_WITH_RC4_128_SHA", + "SSL_DH_anon_WITH_RC4_128_MD5", + // Weak cipher suites obsoleted in TLS 1.2 [RFC 5246] + "SSL_RSA_WITH_DES_CBC_SHA", + "SSL_DHE_RSA_WITH_DES_CBC_SHA", + "SSL_DHE_DSS_WITH_DES_CBC_SHA", + "SSL_DH_anon_WITH_DES_CBC_SHA", + // Weak cipher suites obsoleted in TLS 1.1 [RFC 4346] + "SSL_RSA_EXPORT_WITH_DES40_CBC_SHA", + "SSL_DHE_RSA_EXPORT_WITH_DES40_CBC_SHA", + "SSL_DHE_DSS_EXPORT_WITH_DES40_CBC_SHA", + "SSL_DH_anon_EXPORT_WITH_DES40_CBC_SHA", + "SSL_RSA_EXPORT_WITH_RC4_40_MD5", + "SSL_DH_anon_EXPORT_WITH_RC4_40_MD5", + // No traffic encryption cipher suites + "TLS_RSA_WITH_NULL_SHA256", + "TLS_ECDHE_ECDSA_WITH_NULL_SHA", + "TLS_ECDHE_RSA_WITH_NULL_SHA", + "SSL_RSA_WITH_NULL_SHA", + "TLS_ECDH_ECDSA_WITH_NULL_SHA", + "TLS_ECDH_RSA_WITH_NULL_SHA", + "TLS_ECDH_anon_WITH_NULL_SHA", + "SSL_RSA_WITH_NULL_MD5", + // Definition of the cipher suites that are not supported but the names + // are known. + "TLS_AES_128_CCM_SHA256", + "TLS_AES_128_CCM_8_SHA256" + ); private final static String[] protocols = { - "", "SSL", "TLS", "SSLv3", "TLSv1", "TLSv1.1", "TLSv1.2" + "", "SSL", "TLS", "SSLv3", "TLSv1", "TLSv1.1", "TLSv1.2", "TLSv1.3" }; - public static void main(String[] args) throws Exception { // show all of the supported cipher suites showSuites(supportedCipherSuites.toArray(new String[0]), - "All supported cipher suites"); + "All supported cipher suites"); for (String protocol : protocols) { System.out.println("//"); - System.out.println("// " + - "Testing for SSLContext of " + protocol); + System.out.println("// " + + "Testing for SSLContext of " + protocol); System.out.println("//"); checkForProtocols(protocol); } @@ -189,7 +225,6 @@ checkSuites(parameters.getCipherSuites(), "Supported cipher suites in SSLContext"); - // // Check the cipher suites order of SSLEngine // @@ -209,34 +244,34 @@ // Check the cipher suites order of SSLSocket // SSLSocketFactory factory = context.getSocketFactory(); - try (SSLSocket socket = (SSLSocket)factory.createSocket()) { + try (SSLSocket socket = (SSLSocket) factory.createSocket()) { // check the order of endabled cipher suites ciphers = socket.getEnabledCipherSuites(); checkSuites(ciphers, - "Enabled cipher suites in SSLSocket"); + "Enabled cipher suites in SSLSocket"); // check the order of supported cipher suites ciphers = socket.getSupportedCipherSuites(); checkSuites(ciphers, - "Supported cipher suites in SSLSocket"); + "Supported cipher suites in SSLSocket"); } // // Check the cipher suites order of SSLServerSocket // SSLServerSocketFactory serverFactory = context.getServerSocketFactory(); - try (SSLServerSocket serverSocket = - (SSLServerSocket)serverFactory.createServerSocket()) { + try (SSLServerSocket serverSocket + = (SSLServerSocket) serverFactory.createServerSocket()) { // check the order of endabled cipher suites ciphers = serverSocket.getEnabledCipherSuites(); checkSuites(ciphers, - "Enabled cipher suites in SSLServerSocket"); + "Enabled cipher suites in SSLServerSocket"); // check the order of supported cipher suites ciphers = serverSocket.getSupportedCipherSuites(); checkSuites(ciphers, - "Supported cipher suites in SSLServerSocket"); + "Supported cipher suites in SSLServerSocket"); } } @@ -250,7 +285,6 @@ if (index <= loc) { throw new RuntimeException(suite + " is not in order"); } - loc = index; } } diff -Nru openjdk-13-13.0.3+3/test/jdk/javax/net/ssl/sanity/ciphersuites/SystemPropCipherSuitesOrder.java openjdk-13-13.0.4+8/test/jdk/javax/net/ssl/sanity/ciphersuites/SystemPropCipherSuitesOrder.java --- openjdk-13-13.0.3+3/test/jdk/javax/net/ssl/sanity/ciphersuites/SystemPropCipherSuitesOrder.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-13-13.0.4+8/test/jdk/javax/net/ssl/sanity/ciphersuites/SystemPropCipherSuitesOrder.java 2020-07-07 16:55:29.000000000 +0000 @@ -0,0 +1,142 @@ +/* + * 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.util.Arrays; +import javax.net.ssl.SSLServerSocket; +import javax.net.ssl.SSLSocket; + +/* + * @test + * @bug 8234728 + * @library /javax/net/ssl/templates + * /javax/net/ssl/TLSCommon + * @summary Test TLS ciphersuites order set through System properties + * @run main/othervm + * -Djdk.tls.client.cipherSuites=TLS_CHACHA20_POLY1305_SHA256,TLS_AES_128_GCM_SHA256,TLS_AES_256_GCM_SHA384 + * -Djdk.tls.server.cipherSuites=TLS_AES_256_GCM_SHA384,TLS_CHACHA20_POLY1305_SHA256,TLS_AES_128_GCM_SHA256 + * SystemPropCipherSuitesOrder TLSv1.3 + * @run main/othervm + * -Djdk.tls.client.cipherSuites=TLS_CHACHA20_POLY1305_SHA256,TLS_AES_128_GCM_SHA256,TLS_AES_256_GCM_SHA384 + * SystemPropCipherSuitesOrder TLSv1.3 + * @run main/othervm + * -Djdk.tls.server.cipherSuites=TLS_AES_128_GCM_SHA256,TLS_CHACHA20_POLY1305_SHA256,TLS_AES_256_GCM_SHA384 + * SystemPropCipherSuitesOrder TLSv1.3 + * @run main/othervm + * -Djdk.tls.client.cipherSuites=TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384 + * -Djdk.tls.server.cipherSuites=TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384 + * SystemPropCipherSuitesOrder TLSv1.2 + * @run main/othervm + * -Djdk.tls.client.cipherSuites=TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384 + * SystemPropCipherSuitesOrder TLSv1.2 + * @run main/othervm + * -Djdk.tls.server.cipherSuites=TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384 + * SystemPropCipherSuitesOrder TLSv1.2 + * @run main/othervm + * -Djdk.tls.client.cipherSuites=TLS_RSA_WITH_AES_128_CBC_SHA,TLS_RSA_WITH_AES_256_CBC_SHA + * -Djdk.tls.server.cipherSuites=TLS_RSA_WITH_AES_128_CBC_SHA,TLS_RSA_WITH_AES_256_CBC_SHA + * SystemPropCipherSuitesOrder TLSv1.1 + * @run main/othervm + * -Djdk.tls.client.cipherSuites=TLS_RSA_WITH_AES_128_CBC_SHA,TLS_RSA_WITH_AES_256_CBC_SHA + * SystemPropCipherSuitesOrder TLSv1.1 + * @run main/othervm + * -Djdk.tls.server.cipherSuites=TLS_RSA_WITH_AES_128_CBC_SHA,TLS_RSA_WITH_AES_256_CBC_SHA + * SystemPropCipherSuitesOrder TLSv1.1 + * @run main/othervm + * -Djdk.tls.client.cipherSuites=TLS_RSA_WITH_AES_128_CBC_SHA,TLS_RSA_WITH_AES_256_CBC_SHA + * -Djdk.tls.server.cipherSuites=TLS_RSA_WITH_AES_128_CBC_SHA,TLS_RSA_WITH_AES_256_CBC_SHA + * SystemPropCipherSuitesOrder TLSv1 + * @run main/othervm + * -Djdk.tls.client.cipherSuites=TLS_RSA_WITH_AES_128_CBC_SHA,TLS_RSA_WITH_AES_256_CBC_SHA + * SystemPropCipherSuitesOrder TLSv1 + * @run main/othervm + * -Djdk.tls.server.cipherSuites=TLS_RSA_WITH_AES_128_CBC_SHA,TLS_RSA_WITH_AES_256_CBC_SHA + * SystemPropCipherSuitesOrder TLSv1 + */ +public class SystemPropCipherSuitesOrder extends SSLSocketTemplate { + + private final String protocol; + private static String[] servercipherSuites; + private static String[] clientcipherSuites; + + public static void main(String[] args) { + servercipherSuites + = toArray(System.getProperty("jdk.tls.server.cipherSuites")); + clientcipherSuites + = toArray(System.getProperty("jdk.tls.client.cipherSuites")); + System.out.printf("SYSTEM PROPERTIES: ServerProp:%s - ClientProp:%s%n", + Arrays.deepToString(servercipherSuites), + Arrays.deepToString(clientcipherSuites)); + + try { + new SystemPropCipherSuitesOrder(args[0]).run(); + } catch (Exception e) { + throw new RuntimeException(e); + } + } + + private SystemPropCipherSuitesOrder(String protocol) { + this.protocol = protocol; + } + + // Servers are configured before clients, increment test case after. + @Override + protected void configureClientSocket(SSLSocket socket) { + socket.setEnabledProtocols(new String[]{protocol}); + } + + @Override + protected void configureServerSocket(SSLServerSocket serverSocket) { + serverSocket.setEnabledProtocols(new String[]{protocol}); + } + + protected void runServerApplication(SSLSocket socket) throws Exception { + if (servercipherSuites != null) { + System.out.printf("SERVER: SystemProperty:%s - " + + "getEnabledCipherSuites:%s%n", + Arrays.deepToString(servercipherSuites), + Arrays.deepToString(socket.getEnabledCipherSuites())); + } + if (servercipherSuites != null && !Arrays.equals( + servercipherSuites, socket.getEnabledCipherSuites())) { + throw new RuntimeException("Unmatched server side CipherSuite order"); + } + super.runServerApplication(socket); + } + + protected void runClientApplication(SSLSocket socket) throws Exception { + if (clientcipherSuites != null) { + System.out.printf("CLIENT: SystemProperty:%s - " + + "getEnabledCipherSuites:%s%n", + Arrays.deepToString(clientcipherSuites), + Arrays.deepToString(socket.getEnabledCipherSuites())); + } + if (clientcipherSuites != null && !Arrays.equals(clientcipherSuites, + socket.getEnabledCipherSuites())) { + throw new RuntimeException("Unmatched client side CipherSuite order"); + } + super.runClientApplication(socket); + } + + private static String[] toArray(String prop) { + return (prop != null) ? prop.split(",") : null; + } +} diff -Nru openjdk-13-13.0.3+3/test/jdk/javax/net/ssl/sanity/ciphersuites/TLSCipherSuitesOrder.java openjdk-13-13.0.4+8/test/jdk/javax/net/ssl/sanity/ciphersuites/TLSCipherSuitesOrder.java --- openjdk-13-13.0.3+3/test/jdk/javax/net/ssl/sanity/ciphersuites/TLSCipherSuitesOrder.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-13-13.0.4+8/test/jdk/javax/net/ssl/sanity/ciphersuites/TLSCipherSuitesOrder.java 2020-07-07 16:55:29.000000000 +0000 @@ -0,0 +1,185 @@ +/* + * 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.util.Arrays; +import javax.net.ssl.SSLServerSocket; +import javax.net.ssl.SSLSocket; + +/* + * @test + * @bug 8234728 + * @library /javax/net/ssl/templates + * /javax/net/ssl/TLSCommon + * @summary Test TLS ciphersuites order. + * Parameter order: + * @run main/othervm TLSCipherSuitesOrder TLSv13 ORDERED default + * @run main/othervm TLSCipherSuitesOrder TLSv13 UNORDERED default + * @run main/othervm TLSCipherSuitesOrder TLSv13 UNORDERED UNORDERED + * @run main/othervm TLSCipherSuitesOrder TLSv13 ORDERED ORDERED + * @run main/othervm TLSCipherSuitesOrder TLSv12 ORDERED default + * @run main/othervm TLSCipherSuitesOrder TLSv12 UNORDERED default + * @run main/othervm TLSCipherSuitesOrder TLSv12 UNORDERED UNORDERED + * @run main/othervm TLSCipherSuitesOrder TLSv12 ORDERED ORDERED + * @run main/othervm TLSCipherSuitesOrder TLSv11 ORDERED default + * @run main/othervm TLSCipherSuitesOrder TLSv11 UNORDERED default + * @run main/othervm TLSCipherSuitesOrder TLSv11 UNORDERED UNORDERED + * @run main/othervm TLSCipherSuitesOrder TLSv11 ORDERED ORDERED + * @run main/othervm TLSCipherSuitesOrder TLSv1 ORDERED default + * @run main/othervm TLSCipherSuitesOrder TLSv1 UNORDERED default + * @run main/othervm TLSCipherSuitesOrder TLSv1 UNORDERED UNORDERED + * @run main/othervm TLSCipherSuitesOrder TLSv1 ORDERED ORDERED + */ +public class TLSCipherSuitesOrder extends SSLSocketTemplate { + + private final String protocol; + private final String[] servercipherSuites; + private final String[] clientcipherSuites; + + public static void main(String[] args) { + PROTOCOL protocol = PROTOCOL.valueOf(args[0]); + try { + new TLSCipherSuitesOrder(protocol.getProtocol(), + protocol.getCipherSuite(args[1]), + protocol.getCipherSuite(args[2])).run(); + } catch (Exception e) { + throw new RuntimeException(e); + } + } + + private TLSCipherSuitesOrder(String protocol, String[] clientcipherSuites, + String[] servercipherSuites) { + this.protocol = protocol; + this.clientcipherSuites = clientcipherSuites; + this.servercipherSuites = servercipherSuites; + } + + // Servers are configured before clients, increment test case after. + @Override + protected void configureClientSocket(SSLSocket socket) { + socket.setEnabledProtocols(new String[]{protocol}); + if (clientcipherSuites != null) { + socket.setEnabledCipherSuites(clientcipherSuites); + } + } + + @Override + protected void configureServerSocket(SSLServerSocket serverSocket) { + serverSocket.setEnabledProtocols(new String[]{protocol}); + if (servercipherSuites != null) { + serverSocket.setEnabledCipherSuites(servercipherSuites); + } + } + + protected void runServerApplication(SSLSocket socket) throws Exception { + if (servercipherSuites != null) { + System.out.printf("SERVER: setEnabledCipherSuites:%s - " + + "getEnabledCipherSuites:%s%n", + Arrays.deepToString(servercipherSuites), + Arrays.deepToString(socket.getEnabledCipherSuites())); + } + if (servercipherSuites != null && !Arrays.equals(servercipherSuites, + socket.getEnabledCipherSuites())) { + throw new RuntimeException("Unmatched server side CipherSuite order"); + } + super.runServerApplication(socket); + } + + protected void runClientApplication(SSLSocket socket) throws Exception { + if (clientcipherSuites != null) { + System.out.printf("CLIENT: setEnabledCipherSuites:%s - " + + "getEnabledCipherSuites:%s%n", + Arrays.deepToString(clientcipherSuites), + Arrays.deepToString(socket.getEnabledCipherSuites())); + } + if (clientcipherSuites != null && !Arrays.equals( + clientcipherSuites, socket.getEnabledCipherSuites())) { + throw new RuntimeException("Unmatched client side CipherSuite order"); + } + super.runClientApplication(socket); + } + + enum PROTOCOL { + TLSv13("TLSv1.3", + new String[]{ + "TLS_AES_256_GCM_SHA384", + "TLS_AES_128_GCM_SHA256", + "TLS_CHACHA20_POLY1305_SHA256"}, + new String[]{"TLS_CHACHA20_POLY1305_SHA256", + "TLS_AES_128_GCM_SHA256", + "TLS_AES_256_GCM_SHA384"}), + TLSv12("TLSv1.2", + new String[]{ + "TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384", + "TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256"}, + new String[]{ + "TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256", + "TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384"}), + TLSv11("TLSv1.1", + new String[]{ + "TLS_RSA_WITH_AES_256_CBC_SHA", + "TLS_RSA_WITH_AES_128_CBC_SHA"}, + new String[]{ + "TLS_RSA_WITH_AES_128_CBC_SHA", + "TLS_RSA_WITH_AES_256_CBC_SHA"}), + TLSv1("TLSv1", + new String[]{ + "TLS_RSA_WITH_AES_256_CBC_SHA", + "TLS_RSA_WITH_AES_128_CBC_SHA"}, + new String[]{ + "TLS_RSA_WITH_AES_128_CBC_SHA", + "TLS_RSA_WITH_AES_256_CBC_SHA"}); + + String protocol; + String[] orderedCiphers; + String[] unOrderedCiphers; + + private PROTOCOL(String protocol, String[] orderedCiphers, + String[] unOrderedCiphers) { + this.protocol = protocol; + this.orderedCiphers = orderedCiphers; + this.unOrderedCiphers = unOrderedCiphers; + } + + public String getProtocol() { + return protocol; + } + + public String[] getOrderedCiphers() { + return orderedCiphers; + } + + public String[] getUnOrderedCiphers() { + return unOrderedCiphers; + } + + public String[] getCipherSuite(String order) { + switch (order) { + case "ORDERED": + return getOrderedCiphers(); + case "UNORDERED": + return getUnOrderedCiphers(); + default: + return null; + } + } + } +} diff -Nru openjdk-13-13.0.3+3/test/jdk/javax/net/ssl/SSLSocket/ClientExcOnAlert.java openjdk-13-13.0.4+8/test/jdk/javax/net/ssl/SSLSocket/ClientExcOnAlert.java --- openjdk-13-13.0.3+3/test/jdk/javax/net/ssl/SSLSocket/ClientExcOnAlert.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-13-13.0.4+8/test/jdk/javax/net/ssl/SSLSocket/ClientExcOnAlert.java 2020-07-07 16:55:29.000000000 +0000 @@ -0,0 +1,250 @@ +/* + * Copyright (c) 2020, 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. + */ + +// +// Please run in othervm mode. SunJSSE does not support dynamic system +// properties, no way to re-use system properties in samevm/agentvm mode. +// + +/* + * @test + * @bug 8242294 + * @summary JSSE Client does not throw SSLException when an alert occurs during + * handshaking. + * @run main/othervm ClientExcOnAlert TLSv1.2 + * @run main/othervm ClientExcOnAlert TLSv1.3 + */ + +import java.io.BufferedReader; +import java.io.ByteArrayInputStream; +import java.io.IOException; +import java.io.InputStreamReader; +import java.io.PrintWriter; +import java.net.InetAddress; +import java.security.GeneralSecurityException; +import java.security.KeyStore; +import java.util.Base64; +import java.util.concurrent.locks.Condition; +import java.util.concurrent.locks.Lock; +import java.util.concurrent.locks.ReentrantLock; +import javax.net.ssl.KeyManagerFactory; +import javax.net.ssl.SSLContext; +import javax.net.ssl.SSLException; +import javax.net.ssl.SSLServerSocket; +import javax.net.ssl.SSLServerSocketFactory; +import javax.net.ssl.SSLSocket; +import javax.net.ssl.SSLSocketFactory; + +public class ClientExcOnAlert { + // This is a PKCS#12 keystore created with the following command: + // keytool -genkeypair -alias testcert -keyalg rsa -keysize 2048 + // -sigalg SHA256withRSA + // -dname "CN=Test TLS Self-Signed Cert, O=Test" -validity 365 + // -storetype pkcs12 -keystore p12ks.p12 + // + // The resulting keystore was then converted to PEM for inclusion in this + // file. + private static int serverPort = -1; + private static final String KEYSTORE_PASS = "password"; + private static final String KEYSTORE_PEM = + "MIIJrwIBAzCCCWgGCSqGSIb3DQEHAaCCCVkEgglVMIIJUTCCBW0GCSqGSIb3DQEH\n" + + "AaCCBV4EggVaMIIFVjCCBVIGCyqGSIb3DQEMCgECoIIE+zCCBPcwKQYKKoZIhvcN\n" + + "AQwBAzAbBBRvyuWzvSCS62cWMeKOcF0JnaYRPgIDAMNQBIIEyMrZGW/sgjhW20Gz\n" + + "fdj/NkWYORRTPCopS/y0NvZpmQgcu5uSbJWsadClnFBMQ2aZDJ5jaa5G2ipcrVSo\n" + + "c7RYSi2vAh2fqGtm25spSKyV/t1q7Z07FBIQWVNMR9IczWmM5fQyeY7V9o2M3DtN\n" + + "3co0RjXEpVQbvxXc5UI3Tbv8q3WKoxadicvm3uMTQCV1/swObYZqHUAMrvwgkXSy\n" + + "omTsCr8JwKvI2ndPA1tD+63h9v+zHK7U6n24DBNJNxZOSmUO7L+WxgQ4COkTXhZj\n" + + "24sYJcBJcGb74p9rv7QQn5WmkJBh+lfCQU+cS0bL6VwRZOyAesniMBpytaR5/SQW\n" + + "UwAk230oy64x0WegG/q4uAIeczBlu2L1HDGJp3KbGwsu5Zwqs3psHjUZJEforWzR\n" + + "RGTU+eBGi0U/BSeyeyY3HRimRrXytmXGcGFy6KcgAGeDwu6tG4hblyK+Fd4+8vw0\n" + + "T3sYOsOPR3NjOFshtcnsTa/Q9lPCAAA3WNieJyWmnh+Zg0EU26GOEeagfZ8JLvfh\n" + + "U1tE6e2j7L4xTt03IR2Z0U1bq+dY9eqfZb4PAqW7Zgv16m586QIjeSUecjlDRrN4\n" + + "OYtOKAbO2qFjevgv/5e8ja4d5rM+xl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5d/d5TpXtI5GBGOzXjUSbz3KmoYM3MlLHGNUciZufif2lhWVwzgE+P1XLqmo1Z\n" + + "sY3b7CGiRKOwFMvsYfFisen6xiIJdpurE2SypLA1UBmc9QoDGp5mxFG550pRCLGI\n" + + "Zpsrvg16VDqU+WXbzIIu2LaJNWrM3jHnFde1cn2MJEdXchbq5FiajoZ27COUcdp9\n" + + "sxvssAx7Ov9lfYqacWm+bZFOX2NdYUjz3VGk2YehCN7KnegV0a9f9L3eiY8hdfE6\n" + + "4uDw4vIML5wDED6sIPdmywWbWm1PxRHiusWuL8PbApJ5r8cfCAfCqhYJos5TL9VD\n" + + "IaI7jhWPHkiarlMzrpb8XwaY5/0lzYqUNj1/gZUQA2S4PLaQTBZZ8o3HQy91SvJr\n" + + "kVug/6q06Xzyrxm467Q/8xIeIXym26DMp03xHatFSTvpJDxfl14cnbr2vNbPSlEy\n" + + "fp6NbaSzKadTU3yqva1TrEdPlDA+MCEwCQYFKw4DAhoFAAQUtSDOH+RGJI6TAjl1\n" + + "R2HMhteRVSMEFKmTNz/98xQ6XxJiJF5P+7rli4x5AgMBhqA="; + + static final Lock lock = new ReentrantLock(); + static final Condition serverReady = lock.newCondition(); + + public static void main(String[] args) throws Exception { + Thread serverThread = new Thread(() -> { + try { + doServerSide(); + } + catch (Exception exc) { + log("Caught exception: %s", exc); + } + } + ); + serverThread.start(); + + try { + doClientSide((args == null || args.length < 1) ? null : args[0]); + throw new RuntimeException("Expected SSLException did not occur!"); + } catch (SSLException ssle) { + log("Caught expected exception on client: " + ssle); + } finally { + serverThread.join(); + } + + } + + static void doServerSide() throws Exception { + Thread.currentThread().setName("ServerThread"); + SSLContext sslc = SSLContext.getInstance("TLS"); + log("doServerSide start"); + KeyManagerFactory kmf = createKeyManagerFactory(KEYSTORE_PEM, + KEYSTORE_PASS); + sslc.init(kmf.getKeyManagers(), null, null); + SSLServerSocketFactory ssf = + (SSLServerSocketFactory)sslc.getServerSocketFactory(); + + try (SSLServerSocket sslServerSocket = + (SSLServerSocket)ssf.createServerSocket(0)) { + sslServerSocket.setReuseAddress(true); + // Set the server port and wake up the client thread who is waiting + // for the port to be set. + lock.lock(); + try { + serverPort = sslServerSocket.getLocalPort(); + log("Server listening on port %d", serverPort); + serverReady.signalAll(); + log("Server ready"); + } finally { + lock.unlock(); + } + + // Go into the accept wait state until the client initiates the + // TLS handshake. + try (SSLSocket sslSocket = (SSLSocket)sslServerSocket.accept(); + PrintWriter pw = + new PrintWriter(sslSocket.getOutputStream()); + BufferedReader br = new BufferedReader( + new InputStreamReader(sslSocket.getInputStream()))) { + log("Incoming connection from %s", + sslSocket.getRemoteSocketAddress()); + String data = br.readLine(); + log("Got mesage from client: ", data); + pw.write("I am server\n"); + pw.close(); + } + } + } + + private static KeyManagerFactory createKeyManagerFactory( + String ksPem, String ksAuth) throws IOException, + GeneralSecurityException { + KeyManagerFactory kmf = null; + if (ksPem != null && ksAuth != null) { + Base64.Decoder b64dec = Base64.getMimeDecoder(); + ByteArrayInputStream bais = + new ByteArrayInputStream(b64dec.decode(ksPem)); + KeyStore ks = KeyStore.getInstance("PKCS12"); + char[] ksPass = ksAuth.toCharArray(); + ks.load(bais, ksPass); + + kmf = KeyManagerFactory.getInstance("PKIX"); + kmf.init(ks, ksAuth.toCharArray()); + } + + return kmf; + } + + static void doClientSide(String proto) throws Exception { + Thread.currentThread().setName("ClientThread"); + log("doClientSide start"); + + // Wait for the server to be ready and wake up this thread + // so the client knows which port to communicate with + lock.lock(); + try { + serverReady.await(); + log("Client ready to contact port %d", serverPort); + } finally { + lock.unlock(); + } + + SSLSocketFactory sslsf = + (SSLSocketFactory)SSLSocketFactory.getDefault(); + try (SSLSocket sslSocket = (SSLSocket)sslsf.createSocket( + InetAddress.getLocalHost(), serverPort); + BufferedReader br = new BufferedReader( + new InputStreamReader(sslSocket.getInputStream())); + PrintWriter pw = new PrintWriter(sslSocket.getOutputStream())) { + + if (proto != null) { + sslSocket.setEnabledProtocols(new String[] { proto }); + } + pw.write("I am client\n"); + pw.flush(); + + String response = br.readLine(); + System.out.println("response is: " + response); + } + } + + private static void log(String msgFmt, Object ... args) { + StringBuilder sb = new StringBuilder(); + sb.append(String.format("%d | %s | ", + System.currentTimeMillis(), Thread.currentThread().getName())); + sb.append(String.format(msgFmt, args)); + System.out.println(sb.toString()); + } +} diff -Nru openjdk-13-13.0.3+3/test/jdk/javax/net/ssl/templates/SSLSocketSSLEngineTemplate.java openjdk-13-13.0.4+8/test/jdk/javax/net/ssl/templates/SSLSocketSSLEngineTemplate.java --- openjdk-13-13.0.3+3/test/jdk/javax/net/ssl/templates/SSLSocketSSLEngineTemplate.java 2020-02-20 22:05:38.000000000 +0000 +++ openjdk-13-13.0.4+8/test/jdk/javax/net/ssl/templates/SSLSocketSSLEngineTemplate.java 2020-07-07 16:55:29.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2016, 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 @@ -30,7 +30,10 @@ * @test * @bug 7105780 * @summary Add SSLSocket client/SSLEngine server to templates directory. - * @run main/othervm SSLSocketSSLEngineTemplate + * @run main/othervm SSLSocketSSLEngineTemplate TLSv1 + * @run main/othervm SSLSocketSSLEngineTemplate TLSv1.1 + * @run main/othervm SSLSocketSSLEngineTemplate TLSv1.2 + * @run main/othervm SSLSocketSSLEngineTemplate TLSv1.3 */ /** @@ -100,11 +103,12 @@ private static final boolean debug = false; private final SSLContext sslc; private SSLEngine serverEngine; // server-side SSLEngine + private SSLSocket clientSocket; private final byte[] serverMsg = "Hi there Client, I'm a Server.".getBytes(); private final byte[] clientMsg = - "Hello Server, I'm a Client! Pleased to meet you!".getBytes(); + "Hello Server, I'm a Client! Pleased to meet you!".getBytes(); private ByteBuffer serverOut; // write side of serverEngine private ByteBuffer serverIn; // read side of serverEngine @@ -124,7 +128,6 @@ private static final String pathToStores = "../etc"; private static final String keyStoreFile = "keystore"; private static final String trustStoreFile = "truststore"; - private static final String passwd = "passphrase"; private static final String keyFilename = System.getProperty("test.src", ".") + "/" + pathToStores + "/" + keyStoreFile; @@ -136,6 +139,8 @@ * Main entry point for this test. */ public static void main(String args[]) throws Exception { + String protocol = args[0]; + // reset security properties to make sure that the algorithms // and keys used in this test are not disabled. Security.setProperty("jdk.tls.disabledAlgorithms", ""); @@ -145,26 +150,20 @@ System.setProperty("javax.net.debug", "all"); } - String [] protocols = new String [] { - "SSLv3", "TLSv1", "TLSv1.1", "TLSv1.2" }; - - for (String protocol : protocols) { - log("Testing " + protocol); - /* - * Run the tests with direct and indirect buffers. - */ - SSLSocketSSLEngineTemplate test = - new SSLSocketSSLEngineTemplate(protocol); - log("-------------------------------------"); - log("Testing " + protocol + " for direct buffers ..."); - test.runTest(true); - - log("---------------------------------------"); - log("Testing " + protocol + " for indirect buffers ..."); - test.runTest(false); - } + /* + * Run the tests with direct and indirect buffers. + */ + SSLSocketSSLEngineTemplate test = + new SSLSocketSSLEngineTemplate(protocol); + log("-------------------------------------"); + log("Testing " + protocol + " for direct buffers ..."); + test.runTest(true); + + log("---------------------------------------"); + log("Testing " + protocol + " for indirect buffers ..."); + test.runTest(false); - System.out.println("Test Passed."); + log("Test Passed."); } /* @@ -214,6 +213,7 @@ * sections of code. */ private void runTest(boolean direct) throws Exception { + clientSocket = null; boolean serverClose = direct; // generates the server-side Socket @@ -221,6 +221,7 @@ serverSocket.setReuseAddress(false); serverSocket.bind(null); int port = serverSocket.getLocalPort(); + log("Port: " + port); Thread thread = createClientThread(port, serverClose); createSSLEngine(); @@ -261,11 +262,18 @@ try { len = is.read(inbound); if (len == -1) { - throw new Exception("Unexpected EOF"); + logSocketStatus(clientSocket); + if (clientSocket.isClosed() + || clientSocket.isOutputShutdown()) { + log("Client socket was closed or shutdown output"); + break; + } else { + throw new Exception("Unexpected EOF"); + } } cTOs.put(inbound, 0, len); } catch (SocketTimeoutException ste) { - // swallow. Nothing yet, probably waiting on us. + // swallow. Nothing yet, probably waiting on us. } cTOs.flip(); @@ -368,6 +376,8 @@ // client-side socket try (SSLSocket sslSocket = (SSLSocket)sslc.getSocketFactory(). createSocket("localhost", port)) { + clientSocket = sslSocket; + OutputStream os = sslSocket.getOutputStream(); InputStream is = sslSocket.getInputStream(); @@ -476,6 +486,15 @@ return (engine.isOutboundDone() && engine.isInboundDone()); } + private static void logSocketStatus(Socket socket) { + log("##### " + socket + " #####"); + log("isBound: " + socket.isBound()); + log("isConnected: " + socket.isConnected()); + log("isClosed: " + socket.isClosed()); + log("isInputShutdown: " + socket.isInputShutdown()); + log("isOutputShutdown: " + socket.isOutputShutdown()); + } + /* * Logging code */ @@ -487,7 +506,7 @@ } if (resultOnce) { resultOnce = false; - System.out.println("The format of the SSLEngineResult is: \n" + log("The format of the SSLEngineResult is: \n" + "\t\"getStatus() / getHandshakeStatus()\" +\n" + "\t\"bytesConsumed() / bytesProduced()\"\n"); } @@ -503,7 +522,11 @@ private static void log(String str) { if (logging) { - System.out.println(str); + if (debug) { + System.err.println(str); + } else { + System.out.println(str); + } } } } diff -Nru openjdk-13-13.0.3+3/test/jdk/javax/net/ssl/TLS/TestJSSEClientDefaultProtocol.java openjdk-13-13.0.4+8/test/jdk/javax/net/ssl/TLS/TestJSSEClientDefaultProtocol.java --- openjdk-13-13.0.3+3/test/jdk/javax/net/ssl/TLS/TestJSSEClientDefaultProtocol.java 2020-02-20 22:05:38.000000000 +0000 +++ openjdk-13-13.0.4+8/test/jdk/javax/net/ssl/TLS/TestJSSEClientDefaultProtocol.java 2020-07-07 16:55:29.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 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,7 +23,7 @@ /* * @test - * @bug 8049429 + * @bug 8049429 8234723 * @modules java.management * jdk.crypto.ec/sun.security.ec * @summary Test that all cipher suites work in all versions and all client @@ -33,23 +33,35 @@ * @run main/othervm * -DSERVER_PROTOCOL=SSLv2Hello,SSLv3,TLSv1 * -DCLIENT_PROTOCOL=DEFAULT - * -DCIPHER=SSL_RSA_WITH_RC4_128_MD5 + * -DCIPHER=TLS_RSA_WITH_AES_128_CBC_SHA * TestJSSE * @run main/othervm * -DSERVER_PROTOCOL=SSLv2Hello,SSLv3,TLSv1,TLSv1.1,TLSv1.2 * -DCLIENT_PROTOCOL=DEFAULT - * -DCIPHER=SSL_RSA_WITH_RC4_128_MD5 + * -DCIPHER=TLS_RSA_WITH_AES_128_GCM_SHA256 * TestJSSE * @run main/othervm * -DSERVER_PROTOCOL=SSLv2Hello,SSLv3,TLSv1,TLSv1.1,TLSv1.2 * -DCLIENT_PROTOCOL=DEFAULT * -Djdk.tls.client.protocols=TLSv1 - * -DCIPHER=SSL_RSA_WITH_RC4_128_MD5 + * -DCIPHER=TLS_RSA_WITH_AES_128_CBC_SHA * TestJSSE * @run main/othervm * -DSERVER_PROTOCOL=SSLv2Hello,SSLv3,TLSv1 * -DCLIENT_PROTOCOL=DEFAULT * -Djdk.tls.client.protocols=TLSv1.2 - * -DCIPHER=SSL_RSA_WITH_RC4_128_MD5 + * -DCIPHER=TLS_RSA_WITH_AES_128_GCM_SHA256 + * TestJSSE javax.net.ssl.SSLHandshakeException + * @run main/othervm + * -DSERVER_PROTOCOL=SSLv2Hello,SSLv3,TLSv1,TLSv1.1,TLSv1.2,TLSv1.3 + * -DCLIENT_PROTOCOL=DEFAULT + * -Djdk.tls.client.protocols=TLSv1.3 + * -DCIPHER=TLS_AES_256_GCM_SHA384 + * TestJSSE + * @run main/othervm + * -DSERVER_PROTOCOL=SSLv2Hello,SSLv3,TLSv1 + * -DCLIENT_PROTOCOL=DEFAULT + * -Djdk.tls.client.protocols=TLSv1.3 + * -DCIPHER=TLS_AES_256_GCM_SHA384 * TestJSSE javax.net.ssl.SSLHandshakeException */ diff -Nru openjdk-13-13.0.3+3/test/jdk/javax/net/ssl/TLS/TestJSSEClientProtocol.java openjdk-13-13.0.4+8/test/jdk/javax/net/ssl/TLS/TestJSSEClientProtocol.java --- openjdk-13-13.0.3+3/test/jdk/javax/net/ssl/TLS/TestJSSEClientProtocol.java 2020-02-20 22:05:38.000000000 +0000 +++ openjdk-13-13.0.4+8/test/jdk/javax/net/ssl/TLS/TestJSSEClientProtocol.java 2020-07-07 16:55:29.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 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,7 +23,7 @@ /* * @test - * @bug 8049429 8172273 + * @bug 8049429 8172273 8234723 * @modules java.management * jdk.crypto.ec/sun.security.ec * @summary Test that all cipher suites work in all versions and all client @@ -31,21 +31,26 @@ * and all checking is done on the client side. * @compile CipherTestUtils.java JSSEClient.java JSSEServer.java * @run main/othervm - * -DSERVER_PROTOCOL=SSLv2Hello,SSLv3,TLSv1,TLSv1.1,TLSv1.2 - * -DCLIENT_PROTOCOL=SSLv2Hello,SSLv3,TLSv1,TLSv1.1,TLSv1.2 + * -DSERVER_PROTOCOL=SSLv2Hello,SSLv3,TLSv1,TLSv1.1,TLSv1.2,TLSv1.3 + * -DCLIENT_PROTOCOL=SSLv2Hello,SSLv3,TLSv1,TLSv1.1,TLSv1.2,TLSv1.3 * -DCIPHER=SSL_RSA_WITH_RC4_128_MD5 * TestJSSE * @run main/othervm - * -DSERVER_PROTOCOL=SSLv2Hello,SSLv3,TLSv1,TLSv1.1,TLSv1.2 - * -DCLIENT_PROTOCOL=SSLv2Hello,SSLv3,TLSv1,TLSv1.1,TLSv1.2 + * -DSERVER_PROTOCOL=SSLv2Hello,SSLv3,TLSv1,TLSv1.1,TLSv1.2,TLSv1.3 + * -DCLIENT_PROTOCOL=SSLv2Hello,SSLv3,TLSv1,TLSv1.1,TLSv1.2,TLSv1.3 * -DCIPHER=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256 * TestJSSE * @run main/othervm - * -DSERVER_PROTOCOL=SSLv2Hello,SSLv3,TLSv1,TLSv1.1,TLSv1.2 - * -DCLIENT_PROTOCOL=SSLv2Hello,SSLv3,TLSv1,TLSv1.1,TLSv1.2 + * -DSERVER_PROTOCOL=SSLv2Hello,SSLv3,TLSv1,TLSv1.1,TLSv1.2,TLSv1.3 + * -DCLIENT_PROTOCOL=SSLv2Hello,SSLv3,TLSv1,TLSv1.1,TLSv1.2,TLSv1.3 * -DCIPHER=TLS_DHE_RSA_WITH_AES_128_CBC_SHA * TestJSSE * @run main/othervm + * -DSERVER_PROTOCOL=SSLv2Hello,SSLv3,TLSv1,TLSv1.1,TLSv1.2,TLSv1.3 + * -DCLIENT_PROTOCOL=SSLv2Hello,SSLv3,TLSv1,TLSv1.1,TLSv1.2,TLSv1.3 + * -DCIPHER=TLS_AES_256_GCM_SHA384 + * TestJSSE + * @run main/othervm * -DSERVER_PROTOCOL=SSLv3 * -DCLIENT_PROTOCOL=SSLv3 * -DCIPHER=SSL_RSA_WITH_RC4_128_MD5 @@ -53,16 +58,21 @@ * @run main/othervm * -DSERVER_PROTOCOL=SSLv3,TLSv1 * -DCLIENT_PROTOCOL=TLSv1 - * -DCIPHER=SSL_RSA_WITH_RC4_128_MD5 + * -DCIPHER=TLS_RSA_WITH_AES_128_CBC_SHA * TestJSSE * @run main/othervm * -DSERVER_PROTOCOL=SSLv3,TLSv1,TLSv1.1 * -DCLIENT_PROTOCOL=TLSv1.1 - * -DCIPHER=SSL_RSA_WITH_RC4_128_MD5 + * -DCIPHER=TLS_RSA_WITH_AES_256_CBC_SHA * TestJSSE * @run main/othervm - * -DSERVER_PROTOCOL=SSLv3,TLSv1,TLSv1.1,TLSv1.2 + * -DSERVER_PROTOCOL=SSLv3,TLSv1,TLSv1.1,TLSv1.2,TLSv1.3 * -DCLIENT_PROTOCOL=TLSv1.2 - * -DCIPHER=SSL_RSA_WITH_RC4_128_MD5 + * -DCIPHER=TLS_RSA_WITH_AES_128_GCM_SHA256 + * TestJSSE + * @run main/othervm + * -DSERVER_PROTOCOL=SSLv3,TLSv1,TLSv1.1,TLSv1.2,TLSv1.3 + * -DCLIENT_PROTOCOL=TLSv1.3 + * -DCIPHER=TLS_AES_256_GCM_SHA384 * TestJSSE */ diff -Nru openjdk-13-13.0.3+3/test/jdk/javax/net/ssl/TLS/TestJSSEServerProtocol.java openjdk-13-13.0.4+8/test/jdk/javax/net/ssl/TLS/TestJSSEServerProtocol.java --- openjdk-13-13.0.3+3/test/jdk/javax/net/ssl/TLS/TestJSSEServerProtocol.java 2020-02-20 22:05:38.000000000 +0000 +++ openjdk-13-13.0.4+8/test/jdk/javax/net/ssl/TLS/TestJSSEServerProtocol.java 2020-07-07 16:55:29.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 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,7 +23,7 @@ /* * @test - * @bug 8049429 + * @bug 8049429 8234723 * @modules java.management * jdk.crypto.ec/sun.security.ec * @summary Test that all cipher suites work in all versions and all client @@ -38,16 +38,26 @@ * @run main/othervm * -DSERVER_PROTOCOL=TLSv1 * -DCLIENT_PROTOCOL=SSLv3,TLSv1,TLSv1.1,TLSv1.2 - * -DCIPHER=SSL_RSA_WITH_RC4_128_MD5 + * -DCIPHER=TLS_RSA_WITH_AES_128_CBC_SHA * TestJSSE * @run main/othervm * -DSERVER_PROTOCOL=TLSv1.1 * -DCLIENT_PROTOCOL=SSLv3,TLSv1,TLSv1.1,TLSv1.2 - * -DCIPHER=SSL_RSA_WITH_RC4_128_MD5 + * -DCIPHER=TLS_RSA_WITH_AES_256_CBC_SHA * TestJSSE * @run main/othervm * -DSERVER_PROTOCOL=TLSv1.2 * -DCLIENT_PROTOCOL=SSLv3,TLSv1,TLSv1.1,TLSv1.2 - * -DCIPHER=SSL_RSA_WITH_RC4_128_MD5 + * -DCIPHER=TLS_RSA_WITH_AES_128_GCM_SHA256 + * TestJSSE + * @run main/othervm + * -DSERVER_PROTOCOL=TLSv1.3 + * -DCLIENT_PROTOCOL=SSLv3,TLSv1,TLSv1.1,TLSv1.2,TLSv1.3 + * -DCIPHER=TLS_AES_256_GCM_SHA384 * TestJSSE + * @run main/othervm + * -DSERVER_PROTOCOL=TLSv1.2 + * -DCLIENT_PROTOCOL=TLSv1.3 + * -DCIPHER=TLS_AES_256_GCM_SHA384 + * TestJSSE javax.net.ssl.SSLHandshakeException */ diff -Nru openjdk-13-13.0.3+3/test/jdk/javax/net/ssl/TLS/TLSClientPropertyTest.java openjdk-13-13.0.4+8/test/jdk/javax/net/ssl/TLS/TLSClientPropertyTest.java --- openjdk-13-13.0.3+3/test/jdk/javax/net/ssl/TLS/TLSClientPropertyTest.java 2020-02-20 22:05:38.000000000 +0000 +++ openjdk-13-13.0.4+8/test/jdk/javax/net/ssl/TLS/TLSClientPropertyTest.java 2020-07-07 16:55:29.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2016, 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 @@ -23,7 +23,7 @@ /* * @test - * @bug 8049432 8069038 + * @bug 8049432 8069038 8234723 * @summary New tests for TLS property jdk.tls.client.protocols * @summary javax/net/ssl/TLS/TLSClientPropertyTest.java needs to be * updated for JDK-8061210 @@ -40,6 +40,8 @@ * @run main/othervm TLSClientPropertyTest TLSv1 * @run main/othervm TLSClientPropertyTest TLSv11 * @run main/othervm TLSClientPropertyTest TLSv12 + * @run main/othervm TLSClientPropertyTest TLSv13 + * @run main/othervm TLSClientPropertyTest TLS * @run main/othervm TLSClientPropertyTest WrongProperty */ @@ -57,7 +59,7 @@ */ public class TLSClientPropertyTest { private final String[] expectedSupportedProtos = new String[] { - "SSLv2Hello", "SSLv3", "TLSv1", "TLSv1.1", "TLSv1.2" + "SSLv2Hello", "SSLv3", "TLSv1", "TLSv1.1", "TLSv1.2", "TLSv1.3" }; public static void main(String[] args) throws Exception { @@ -77,7 +79,7 @@ } contextProtocol = null; expectedDefaultProtos = new String[] { - "TLSv1", "TLSv1.1", "TLSv1.2" + "TLSv1", "TLSv1.1", "TLSv1.2", "TLSv1.3" }; break; case "SSLv3": @@ -103,6 +105,13 @@ "TLSv1", "TLSv1.1", "TLSv1.2" }; break; + case "TLSv13": + case "TLS": + contextProtocol = "TLSv1.3"; + expectedDefaultProtos = new String[] { + "TLSv1", "TLSv1.1", "TLSv1.2", "TLSv1.3" + }; + break; case "WrongProperty": expectedDefaultProtos = new String[] {}; contextProtocol = "TLSV"; diff -Nru openjdk-13-13.0.3+3/test/jdk/javax/swing/JButton/PressedButtonRightClickTest.java openjdk-13-13.0.4+8/test/jdk/javax/swing/JButton/PressedButtonRightClickTest.java --- openjdk-13-13.0.3+3/test/jdk/javax/swing/JButton/PressedButtonRightClickTest.java 2020-02-20 22:05:38.000000000 +0000 +++ openjdk-13-13.0.4+8/test/jdk/javax/swing/JButton/PressedButtonRightClickTest.java 2020-07-07 16:55:29.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2020, 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 @@ -89,7 +89,9 @@ testRobot.delay(1000); // Test whether the button is still pressed - if (myButton.getModel().isPressed() == false) { + boolean pressed = myButton.getModel().isPressed(); + testRobot.mouseRelease(InputEvent.BUTTON1_DOWN_MASK); + if (!pressed) { disposeTestUI(); throw new RuntimeException("Test Failed!"); } @@ -107,6 +109,7 @@ myFrame.add(myButton, BorderLayout.CENTER); myFrame.setSize(400, 300); myFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); + myFrame.setLocationRelativeTo(null); myFrame.setVisible(true); } } diff -Nru openjdk-13-13.0.3+3/test/jdk/javax/swing/JFileChooser/8041694/bug8041694.java openjdk-13-13.0.4+8/test/jdk/javax/swing/JFileChooser/8041694/bug8041694.java --- openjdk-13-13.0.3+3/test/jdk/javax/swing/JFileChooser/8041694/bug8041694.java 2020-02-20 22:05:38.000000000 +0000 +++ openjdk-13-13.0.4+8/test/jdk/javax/swing/JFileChooser/8041694/bug8041694.java 2020-07-07 16:55:29.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 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 @@ -101,9 +101,11 @@ "The selected directory is '%s'.", selectedDir.getAbsolutePath())); if (selectedDir.getName().equals("d")) { throw new RuntimeException( - "JFileChooser removed trailing spaces in the selected directory name."); + "JFileChooser removed trailing spaces in the selected directory name. " + + "Expected 'd ' got '" + selectedDir.getName() + "'."); } else if (!selectedDir.getName().equals("d ")) { - throw new RuntimeException("The selected directory name is not the expected 'd '."); + throw new RuntimeException("The selected directory name is not " + + "the expected 'd ' but '" + selectedDir.getName() + "'."); } } catch (UnsupportedLookAndFeelException | AWTException | IOException | InterruptedException e) { throw new RuntimeException(e); diff -Nru openjdk-13-13.0.3+3/test/jdk/javax/swing/JInternalFrame/8145896/TestJInternalFrameMaximize.java openjdk-13-13.0.4+8/test/jdk/javax/swing/JInternalFrame/8145896/TestJInternalFrameMaximize.java --- openjdk-13-13.0.3+3/test/jdk/javax/swing/JInternalFrame/8145896/TestJInternalFrameMaximize.java 2020-02-20 22:05:38.000000000 +0000 +++ openjdk-13-13.0.4+8/test/jdk/javax/swing/JInternalFrame/8145896/TestJInternalFrameMaximize.java 2020-07-07 16:55:29.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 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,12 +24,13 @@ /* * @test * @key headful - * @bug 8145896 + * @bug 8145896 8194944 * @summary JInternalFrame setMaximum before adding to desktop throws null pointer exception * @library ../../regtesthelpers * @build Util * @run main TestJInternalFrameMaximize */ + import java.awt.Point; import java.awt.Robot; import java.awt.event.ActionEvent; @@ -55,18 +56,27 @@ private static JMenuItem menuItem; private static Robot robot; private static volatile String errorMessage = ""; + private static volatile boolean isFrameShowing; public static void main(String[] args) throws Exception { robot = new Robot(); + robot.setAutoDelay(100); UIManager.LookAndFeelInfo[] lookAndFeelArray = UIManager.getInstalledLookAndFeels(); for (UIManager.LookAndFeelInfo lookAndFeelItem : lookAndFeelArray) { - String lookAndFeelString = lookAndFeelItem.getClassName(); - if (tryLookAndFeel(lookAndFeelString)) { - createUI(); + try { + String lookAndFeelString = lookAndFeelItem.getClassName(); + if (tryLookAndFeel(lookAndFeelString)) { + createUI(); + robot.waitForIdle(); + blockTillDisplayed(frame); + executeTest(); + robot.delay(1000); + } + } finally { + frame.dispose(); + isFrameShowing = false; robot.waitForIdle(); - executeTest(); - robot.delay(1000); } } if (!"".equals(errorMessage)) { @@ -113,8 +123,6 @@ } catch (PropertyVetoException ex) { } catch (RuntimeException ex) { errorMessage = "Test Failed"; - } finally { - frame.dispose(); } }); menu.add(menuItem); @@ -124,8 +132,21 @@ }); } - private static void executeTest() throws Exception { + private static void blockTillDisplayed(JFrame frame) throws Exception { + while (!isFrameShowing) { + try { + SwingUtilities.invokeAndWait(()-> isFrameShowing = frame.isShowing()); + if (!isFrameShowing) { + Thread.sleep(1000); + } + } catch (InterruptedException ex) { + } catch (Exception ex) { + throw new RuntimeException(ex); + } + } + } + private static void executeTest() throws Exception { Point point = Util.getCenterPoint(menu); performMouseOperations(point); point = Util.getCenterPoint(menuItem); diff -Nru openjdk-13-13.0.3+3/test/jdk/javax/swing/JInternalFrame/Test6325652.java openjdk-13-13.0.4+8/test/jdk/javax/swing/JInternalFrame/Test6325652.java --- openjdk-13-13.0.3+3/test/jdk/javax/swing/JInternalFrame/Test6325652.java 2020-02-20 22:05:38.000000000 +0000 +++ openjdk-13-13.0.4+8/test/jdk/javax/swing/JInternalFrame/Test6325652.java 2020-07-07 16:55:29.000000000 +0000 @@ -63,6 +63,7 @@ public static void stepFirst() throws AWTException { robot = new Robot(); // initialize shared static field first time + robot.setAutoDelay(50); click(KeyEvent.VK_CONTROL, KeyEvent.VK_F9); // iconify internal frame } diff -Nru openjdk-13-13.0.3+3/test/jdk/javax/swing/JLightweightFrame/ResizedMovedEvents.java openjdk-13-13.0.4+8/test/jdk/javax/swing/JLightweightFrame/ResizedMovedEvents.java --- openjdk-13-13.0.3+3/test/jdk/javax/swing/JLightweightFrame/ResizedMovedEvents.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-13-13.0.4+8/test/jdk/javax/swing/JLightweightFrame/ResizedMovedEvents.java 2020-07-07 16:55:29.000000000 +0000 @@ -0,0 +1,175 @@ +/* + * Copyright (c) 2020, 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 + * @key headful + * @bug 8236953 + * @summary JavaFX SwingNode is not rendered on macOS + * @modules java.desktop/sun.swing + */ + +import java.awt.EventQueue; +import java.awt.event.ComponentAdapter; +import java.awt.event.ComponentEvent; +import java.util.concurrent.atomic.AtomicInteger; + +import javax.swing.JComponent; +import javax.swing.JPanel; + +import sun.swing.JLightweightFrame; +import sun.swing.LightweightContent; + +public final class ResizedMovedEvents { + + private static final AtomicInteger resized = new AtomicInteger(); + private static final AtomicInteger moved = new AtomicInteger(); + private static JLightweightFrame jLightweightFrame; + + public static void main(String[] args) throws Exception { + emulateSwingNode(true); // emulate visible node + emulateSwingNode(false); // emulate invisible node + } + + private static void emulateSwingNode(boolean visible) throws Exception { + try { + EventQueue.invokeAndWait(() -> { + jLightweightFrame = new JLightweightFrame(); + jLightweightFrame.setContent(new XLightweightContent()); + jLightweightFrame.addComponentListener(new ComponentAdapter() { + @Override + public void componentResized(ComponentEvent e) { + resized.incrementAndGet(); + } + + @Override + public void componentMoved(ComponentEvent e) { + moved.incrementAndGet(); + } + }); + jLightweightFrame.setVisible(visible); + }); + + // Some dummy initial location + setBounds(10, 10, 10, 10); + + // resize and move + resetFlags(); + setBounds(100, 100, 100, 100); + checkFlags(1, 1); + + // resize only + resetFlags(); + setBounds(100, 100, 200, 200); + checkFlags(1, 0); + + // move only + resetFlags(); + setBounds(200, 200, 200, 200); + checkFlags(0, 1); + } finally { + if (jLightweightFrame != null) jLightweightFrame.dispose(); + } + } + + private static void setBounds(int x, int y, int w, int h) throws Exception { + EventQueue.invokeAndWait(() -> { + jLightweightFrame.setBounds(x, y, w, h); + }); + EventQueue.invokeAndWait(() -> { + // dummy event to flush the EventQueue + }); + } + + private static void resetFlags() { + resized.set(0); + moved.set(0); + } + + private static void checkFlags(int expectedR, int expectedM) { + int actualR = resized.get(); + int actualM = moved.get(); + // + if (actualR < expectedR) { + System.err.println("Expected: " + expectedR); + System.err.println("Actual: " + actualR); + throw new RuntimeException("Wrong number of COMPONENT_RESIZED"); + } + if (actualM < expectedM) { + System.err.println("Expected: " + expectedM); + System.err.println("Actual: " + actualM); + throw new RuntimeException("Wrong number of COMPONENT_MOVED"); + } + } + + static final class XLightweightContent implements LightweightContent { + @Override + public JComponent getComponent() { + return new JPanel(); + } + + @Override + public void paintLock() { + } + + @Override + public void paintUnlock() { + } + + @Override + public void imageBufferReset(int[] data, int x, int y, int width, + int height, int linestride, + double scaleX, + double scaleY) { + } + + @Override + public void imageReshaped(int x, int y, int width, int height) { + } + + @Override + public void imageUpdated(int dirtyX, int dirtyY, int dirtyWidth, + int dirtyHeight) { + } + + @Override + public void focusGrabbed() { + } + + @Override + public void focusUngrabbed() { + } + + @Override + public void preferredSizeChanged(int width, int height) { + } + + @Override + public void maximumSizeChanged(int width, int height) { + } + + @Override + public void minimumSizeChanged(int width, int height) { + } + } +} diff -Nru openjdk-13-13.0.3+3/test/jdk/javax/swing/JRadioButton/8033699/bug8033699.java openjdk-13-13.0.4+8/test/jdk/javax/swing/JRadioButton/8033699/bug8033699.java --- openjdk-13-13.0.3+3/test/jdk/javax/swing/JRadioButton/8033699/bug8033699.java 2020-02-20 22:05:38.000000000 +0000 +++ openjdk-13-13.0.4+8/test/jdk/javax/swing/JRadioButton/8033699/bug8033699.java 2020-07-07 16:55:29.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2018, 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 @@ -26,12 +26,13 @@ * @key headful * @library ../../regtesthelpers * @build Util - * @bug 8033699 8154043 8167160 8208640 + * @bug 8033699 8154043 8167160 8208640 8226892 * @summary Incorrect radio button behavior when pressing tab key * @run main bug8033699 */ import java.awt.KeyboardFocusManager; import java.awt.Robot; +import java.awt.event.ActionListener; import java.awt.event.KeyEvent; import java.util.logging.Level; import java.util.logging.Logger; @@ -93,6 +94,9 @@ // down key circle back to first button in grouped radio button runTest8(); + // Verify that ActionListener is called when a RadioButton is selected using arrow key. + runTest9(); + SwingUtilities.invokeAndWait(() -> mainFrame.dispose()); } @@ -245,6 +249,45 @@ }); } + private static Boolean actRB1 = false; + private static Boolean actRB2 = false; + private static Boolean actRB3 = false; + + // JDK-8226892: Verify that ActionListener is called when a RadioButton is selected using arrow key. + private static void runTest9() throws Exception { + SwingUtilities.invokeAndWait(() -> { + radioBtn1.setSelected(true); + radioBtn1.requestFocusInWindow(); + }); + + ActionListener actLrRB1 = e -> actRB1 = true; + ActionListener actLrRB2 = e -> actRB2 = true; + ActionListener actLrRB3 = e -> actRB3 = true; + + radioBtn1.addActionListener(actLrRB1); + radioBtn2.addActionListener(actLrRB2); + radioBtn3.addActionListener(actLrRB3); + + hitKey(robot, KeyEvent.VK_DOWN); + hitKey(robot, KeyEvent.VK_DOWN); + hitKey(robot, KeyEvent.VK_DOWN); + + String failMessage = "ActionListener not invoked when selected using arrow key."; + if (!actRB2) { + throw new RuntimeException("RadioButton 2: " + failMessage); + } + if (!actRB3) { + throw new RuntimeException("RadioButton 3: " + failMessage); + } + if (!actRB1) { + throw new RuntimeException("RadioButton 1: " + failMessage); + } + + radioBtn1.removeActionListener(actLrRB1); + radioBtn2.removeActionListener(actLrRB2); + radioBtn3.removeActionListener(actLrRB3); + } + private static void hitKey(Robot robot, int keycode) { robot.keyPress(keycode); robot.keyRelease(keycode); diff -Nru openjdk-13-13.0.3+3/test/jdk/javax/swing/JSpinner/4788637/bug4788637.java openjdk-13-13.0.4+8/test/jdk/javax/swing/JSpinner/4788637/bug4788637.java --- openjdk-13-13.0.3+3/test/jdk/javax/swing/JSpinner/4788637/bug4788637.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-13-13.0.4+8/test/jdk/javax/swing/JSpinner/4788637/bug4788637.java 2020-07-07 16:55:29.000000000 +0000 @@ -0,0 +1,162 @@ +/* + * 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 + * 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.GridBagConstraints; +import java.awt.GridBagLayout; +import java.awt.Point; +import java.awt.Rectangle; +import java.awt.Robot; +import java.awt.event.InputEvent; + +import javax.swing.JFrame; +import javax.swing.JSpinner; +import javax.swing.SpinnerModel; +import javax.swing.SpinnerNumberModel; +import javax.swing.SwingUtilities; +import javax.swing.UIManager; +import javax.swing.UnsupportedLookAndFeelException; +import javax.swing.event.ChangeEvent; +import javax.swing.event.ChangeListener; + +import static javax.swing.UIManager.getInstalledLookAndFeels; + +/** + * @test + * @bug 4788637 7124307 + * @key headful + * @summary JSpinner buttons don't conform to most platform conventions + */ +public final class bug4788637 { + + private static JSpinner spinner; + private static JFrame fr; + + private static Robot robot; + private int step; + private boolean spinnerValueChanged[] = {false, false, false}; + + private static Point p; + private static Rectangle rect; + + public static void main(final String[] args) throws Exception { + robot = new Robot(); + robot.setAutoDelay(50); + robot.setAutoWaitForIdle(true); + for (final UIManager.LookAndFeelInfo laf : getInstalledLookAndFeels()) { + SwingUtilities.invokeAndWait(() -> setLookAndFeel(laf)); + bug4788637 app = new bug4788637(); + try { + SwingUtilities.invokeAndWait(app::createAndShowGUI); + robot.waitForIdle(); + SwingUtilities.invokeAndWait(()-> { + spinner.requestFocus(); + p = spinner.getLocationOnScreen(); + rect = spinner.getBounds(); + }); + app.start(); + } finally { + SwingUtilities.invokeAndWait(app::destroy); + } + } + } + + public void createAndShowGUI() { + fr = new JFrame("Test"); + fr.setLayout( new GridBagLayout() ); + + SpinnerModel model = new SpinnerNumberModel(50, 1, 100, 1); + spinner = new JSpinner(model); + fr.add(spinner,new GridBagConstraints()); + + spinner.addChangeListener(new ChangeListener() { + public void stateChanged(ChangeEvent e) { + synchronized (bug4788637.this) { + spinnerValueChanged[step] = true; + bug4788637.this.notifyAll(); + } + } + }); + + fr.setSize(200, 200); + fr.setLocationRelativeTo(null); + fr.setVisible(true); + fr.toFront(); + } + + public void start() { + try { + Thread.sleep(1000); + // Move mouse to the up arrow button + robot.mouseMove(p.x+rect.width-3, p.y+3); + robot.mousePress(InputEvent.BUTTON1_MASK); + synchronized (bug4788637.this) { + if (!spinnerValueChanged[step]) { + bug4788637.this.wait(3000); + } + } + + // Move mouse out of JSpinner + robot.mouseMove(p.x+rect.width-3, p.y-3); + synchronized (bug4788637.this) { + step++; + if (!spinnerValueChanged[step]) { + bug4788637.this.wait(3000); + } + } + + // Move mouse to the up arrow button + robot.mouseMove(p.x+rect.width-3, p.y+3); + synchronized (bug4788637.this) { + step++; + if (!spinnerValueChanged[step]) { + bug4788637.this.wait(3000); + } + } + + robot.mouseRelease(InputEvent.BUTTON1_MASK); + } catch(Throwable t) { + throw new RuntimeException(t); + } + } + + public void destroy() { + fr.dispose(); + synchronized (bug4788637.this) { + if (!spinnerValueChanged[0] || + spinnerValueChanged[1] || + !spinnerValueChanged[2]) { + throw new Error("JSpinner buttons don't conform to most platform conventions"); + } + } + } + + private static void setLookAndFeel(final UIManager.LookAndFeelInfo laf) { + try { + UIManager.setLookAndFeel(laf.getClassName()); + System.out.println("LookAndFeel: " + laf.getClassName()); + } catch (ClassNotFoundException | InstantiationException | + UnsupportedLookAndFeelException | IllegalAccessException e) { + throw new RuntimeException(e); + } + } +} Binary files /tmp/tmpTIf_au/TAOb8GJ6Mq/openjdk-13-13.0.3+3/test/jdk/javax/swing/JTextPane/arrow.png and /tmp/tmpTIf_au/_2bjIG1E6T/openjdk-13-13.0.4+8/test/jdk/javax/swing/JTextPane/arrow.png differ diff -Nru openjdk-13-13.0.3+3/test/jdk/javax/swing/JTextPane/TestJTextPaneHTMLRendering.java openjdk-13-13.0.4+8/test/jdk/javax/swing/JTextPane/TestJTextPaneHTMLRendering.java --- openjdk-13-13.0.3+3/test/jdk/javax/swing/JTextPane/TestJTextPaneHTMLRendering.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-13-13.0.4+8/test/jdk/javax/swing/JTextPane/TestJTextPaneHTMLRendering.java 2020-07-07 16:55:29.000000000 +0000 @@ -0,0 +1,173 @@ +/* + * Copyright (c) 2019, 2020, 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 8224475 8238985 + * @summary Verify that JTextPane renders images properly for HTML text + * @run main/manual TestJTextPaneHTMLRendering + */ + +import java.awt.BorderLayout; +import java.awt.Color; +import java.awt.GridBagConstraints; +import java.awt.GridBagLayout; +import java.awt.event.ActionEvent; +import java.awt.event.WindowAdapter; +import java.awt.event.WindowEvent; +import java.awt.Image; +import java.net.URL; +import java.util.Dictionary; +import java.util.Hashtable; +import javax.swing.JButton; +import javax.swing.JTextArea; +import javax.swing.ImageIcon; +import javax.swing.JFrame; +import javax.swing.JPanel; +import javax.swing.JTextPane; +import javax.swing.text.EditorKit; +import javax.swing.SwingUtilities; +import java.util.concurrent.CountDownLatch; +import java.util.concurrent.TimeUnit; + + +public class TestJTextPaneHTMLRendering { + private static JFrame mainFrame = new JFrame(); + private static Dictionary cache; + private static JTextPane textPane; + private static URL urlArrow; + + private static volatile boolean testResult = false; + private static volatile CountDownLatch countDownLatch; + private static final String INSTRUCTIONS = "INSTRUCTIONS:\n\n" + + "Verify that the JTextPane is filled with blue arrow images.\n" + + "There should be 200 images (10 rows of 20 images each).\n" + + "This test will run for 10 iterations and the current iteration\n" + + "is being displayed at top of JTextPane. JTextpane will be\n" + + "repainted each time and should have same output\n"+ + "If yes, Press Pass, Otherwise, Press Fail.\n"; + + public static void main(String args[]) throws Exception { + urlArrow = new URL("http:\\arrow.png"); + countDownLatch = new CountDownLatch(1); + + SwingUtilities.invokeLater(TestJTextPaneHTMLRendering::createUI); + countDownLatch.await(15, TimeUnit.MINUTES); + SwingUtilities.invokeLater(mainFrame::dispose); + + if (!testResult) { + throw new RuntimeException("Test failed!"); + } + } + + private static void createUI() { + JPanel mainControlPanel = new JPanel(new BorderLayout(20, 20)); + JPanel resultButtonPanel = new JPanel(new GridBagLayout()); + + createTestUI(mainControlPanel); + + JTextArea instructionTextArea = new JTextArea(); + instructionTextArea.setText(INSTRUCTIONS); + instructionTextArea.setEditable(false); + instructionTextArea.setBackground(Color.white); + mainControlPanel.add(instructionTextArea, BorderLayout.NORTH); + + JButton passButton = new JButton("Pass"); + passButton.setActionCommand("Pass"); + passButton.addActionListener((ActionEvent e) -> { + testResult = true; + countDownLatch.countDown(); + + }); + + JButton failButton = new JButton("Fail"); + failButton.setActionCommand("Fail"); + failButton.addActionListener(e -> { + countDownLatch.countDown(); + }); + + GridBagConstraints gbc = new GridBagConstraints(); + gbc.gridx = 0; + gbc.gridy = 0; + + resultButtonPanel.add(passButton, gbc); + + gbc.gridx = 1; + gbc.gridy = 0; + resultButtonPanel.add(failButton, gbc); + + mainControlPanel.add(resultButtonPanel, BorderLayout.SOUTH); + + mainFrame.add(mainControlPanel); + mainFrame.pack(); + + mainFrame.addWindowListener(new WindowAdapter() { + @Override + public void windowClosing(WindowEvent e) { + mainFrame.dispose(); + countDownLatch.countDown(); + } + }); + mainFrame.setVisible(true); + } + + static void createTestUI(JPanel panel) { + textPane = new JTextPane(); + panel.add(textPane, BorderLayout.CENTER); + + final EditorKit l_kit = textPane.getEditorKitForContentType("text/html"); + textPane.setEditable(false); + textPane.setEditorKit(l_kit); + cache = (Dictionary)textPane.getDocument().getProperty("imageCache"); + if (cache==null) { + cache=new Hashtable(); + textPane.getDocument().putProperty("imageCache",cache); + } + + URL arrowLocationUrl = TestJTextPaneHTMLRendering.class.getResource("arrow.png"); + ImageIcon imageIcon = new ImageIcon(arrowLocationUrl); + Image image = imageIcon.getImage(); + Image scaledImage = image.getScaledInstance(24, 24, java.awt.Image.SCALE_SMOOTH); + cache.put(urlArrow, scaledImage); + new Thread(TestJTextPaneHTMLRendering::runTest).start(); + } + + static void runTest() { + for (int i=0; i < 10; i++) + { + StringBuffer sb = new StringBuffer(); + sb.append("
    Iteration " + (i+1) + " -> " + "
    "); + for (int j=1;j<201;j++) + { + sb.append(""); + if (j%20 == 0) sb.append("
    "); + } + textPane.setText(sb.toString()); + textPane.validate(); + textPane.repaint(); + try { + Thread.currentThread().sleep(1000); + } catch (InterruptedException e) { System.err.println(e); } + } + } +} diff -Nru openjdk-13-13.0.3+3/test/jdk/javax/swing/plaf/basic/BasicMenuUI/4983388/bug4983388.java openjdk-13-13.0.4+8/test/jdk/javax/swing/plaf/basic/BasicMenuUI/4983388/bug4983388.java --- openjdk-13-13.0.3+3/test/jdk/javax/swing/plaf/basic/BasicMenuUI/4983388/bug4983388.java 2020-02-20 22:05:38.000000000 +0000 +++ openjdk-13-13.0.4+8/test/jdk/javax/swing/plaf/basic/BasicMenuUI/4983388/bug4983388.java 2020-07-07 16:55:29.000000000 +0000 @@ -78,10 +78,11 @@ }); Robot robot = new Robot(); + robot.setAutoDelay(50); robot.waitForIdle(); Util.hitMnemonics(robot, KeyEvent.VK_F); robot.waitForIdle(); - robot.delay(1000); + robot.delay(200); if (!bMenuSelected) { throw new RuntimeException("shortcuts on menus do not work"); diff -Nru openjdk-13-13.0.3+3/test/jdk/javax/swing/text/html/TestJLabelWithHTMLText.java openjdk-13-13.0.4+8/test/jdk/javax/swing/text/html/TestJLabelWithHTMLText.java --- openjdk-13-13.0.3+3/test/jdk/javax/swing/text/html/TestJLabelWithHTMLText.java 2020-02-20 22:05:38.000000000 +0000 +++ openjdk-13-13.0.4+8/test/jdk/javax/swing/text/html/TestJLabelWithHTMLText.java 2020-07-07 16:55:29.000000000 +0000 @@ -23,7 +23,7 @@ /** * @test - * @bug 8230235 + * @bug 8230235 8235744 * @summary Tests if JLabel with HTML text having empty img tag and * documentBaseKey set renders properly without NPE * @run main TestJLabelWithHTMLText @@ -41,7 +41,7 @@ JLabel label = new JLabel(); try { label.putClientProperty(BasicHTML.documentBaseKey, - new URL("https://www.google.com")); + new URL("http://localhost")); } catch (MalformedURLException e) { e.printStackTrace(); } diff -Nru openjdk-13-13.0.3+3/test/jdk/javax/xml/crypto/dsig/Versions.java openjdk-13-13.0.4+8/test/jdk/javax/xml/crypto/dsig/Versions.java --- openjdk-13-13.0.3+3/test/jdk/javax/xml/crypto/dsig/Versions.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-13-13.0.4+8/test/jdk/javax/xml/crypto/dsig/Versions.java 2020-07-07 16:55:29.000000000 +0000 @@ -0,0 +1,82 @@ +/* + * 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 8232357 + * @library /test/lib + * @summary Compare version info of Santuario to legal notice + */ + +import jdk.test.lib.Asserts; + +import java.nio.file.Files; +import java.nio.file.Path; + +public class Versions { + + public static void main(String[] args) throws Exception { + + Path src = Path.of(System.getProperty("test.root"), + "../../src/java.xml.crypto"); + Path legal = Path.of(System.getProperty("test.jdk"), "legal"); + + Path provider = src.resolve( + "share/classes/org/jcp/xml/dsig/internal/dom/XMLDSigRI.java"); + + Path mdInSrc = src.resolve( + "share/legal/santuario.md"); + Path mdInImage = legal.resolve( + "java.xml.crypto/santuario.md"); + + // Files in src should either both exist or not + if (!Files.exists(provider) && !Files.exists(mdInSrc)) { + System.out.println("Source not available. Cannot proceed."); + return; + } + + // The line containing the version number looks like + // // Apache Santuario XML Security for Java, version n.n.n + String s1 = Files.lines(provider) + .filter(s -> s.contains( + "// Apache Santuario XML Security for Java, version ")) + .findFirst() + .get() + .replaceFirst(".* ", ""); // keep chars after the last space + + // The first line of this file should look like + // ## Apache Santuario v2.1.3 + String s2 = Files.lines(mdInSrc) + .findFirst() + .get() + .replace("## Apache Santuario v", ""); + + Asserts.assertEQ(s1, s2); + + if (Files.exists(legal)) { + Asserts.assertTrue(Files.mismatch(mdInSrc, mdInImage) == -1); + } else { + System.out.println("Warning: skip image compare. Exploded build?"); + } + } +} diff -Nru openjdk-13-13.0.3+3/test/jdk/jdk/internal/jimage/JImageOpenTest.java openjdk-13-13.0.4+8/test/jdk/jdk/internal/jimage/JImageOpenTest.java --- openjdk-13-13.0.3+3/test/jdk/jdk/internal/jimage/JImageOpenTest.java 2020-02-20 22:05:38.000000000 +0000 +++ openjdk-13-13.0.4+8/test/jdk/jdk/internal/jimage/JImageOpenTest.java 2020-07-07 16:55:29.000000000 +0000 @@ -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 @@ -31,10 +31,8 @@ import java.util.stream.Stream; /* - * jimage shared open testing. * @test * @summary Test to see if thread interrupt handling interferes with other threads. - * @build JImageOpenTest.java * @run main/othervm -Djdk.image.map.all=false JImageOpenTest */ public class JImageOpenTest { diff -Nru openjdk-13-13.0.3+3/test/jdk/jdk/internal/jimage/JImageReadTest.java openjdk-13-13.0.4+8/test/jdk/jdk/internal/jimage/JImageReadTest.java --- openjdk-13-13.0.3+3/test/jdk/jdk/internal/jimage/JImageReadTest.java 2020-02-20 22:05:38.000000000 +0000 +++ openjdk-13-13.0.4+8/test/jdk/jdk/internal/jimage/JImageReadTest.java 2020-07-07 16:55:29.000000000 +0000 @@ -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 @@ -25,6 +25,7 @@ * @test * @summary Unit test for libjimage JIMAGE_Open/Read/Close * @modules java.base/jdk.internal.jimage + * @run testng JImageReadTest */ import java.io.File; diff -Nru openjdk-13-13.0.3+3/test/jdk/jdk/internal/jimage/TEST.properties openjdk-13-13.0.4+8/test/jdk/jdk/internal/jimage/TEST.properties --- openjdk-13-13.0.3+3/test/jdk/jdk/internal/jimage/TEST.properties 2020-02-20 22:05:38.000000000 +0000 +++ openjdk-13-13.0.4+8/test/jdk/jdk/internal/jimage/TEST.properties 2020-07-07 16:55:29.000000000 +0000 @@ -1,7 +1 @@ -# This file identifies root(s) of the test-ng hierarchy. - -TestNG.dirs = . - -modules=java.base/jdk.internal.jimage - -javatest.maxOutputSize = 2500000 +maxOutputSize = 2500000 diff -Nru openjdk-13-13.0.3+3/test/jdk/jdk/jfr/event/compiler/TestCompilerStats.java openjdk-13-13.0.4+8/test/jdk/jdk/jfr/event/compiler/TestCompilerStats.java --- openjdk-13-13.0.3+3/test/jdk/jdk/jfr/event/compiler/TestCompilerStats.java 2020-02-20 22:05:38.000000000 +0000 +++ openjdk-13-13.0.4+8/test/jdk/jdk/jfr/event/compiler/TestCompilerStats.java 2020-07-07 16:55:29.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2018, 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 @@ -59,8 +59,8 @@ Events.assertField(event, "standardCompileCount").atLeast(0); Events.assertField(event, "osrBytesCompiled").atLeast(0L); Events.assertField(event, "standardBytesCompiled").atLeast(0L); - Events.assertField(event, "nmetodsSize").atLeast(0L); - Events.assertField(event, "nmetodCodeSize").atLeast(0L); + Events.assertField(event, "nmethodsSize").atLeast(0L); + Events.assertField(event, "nmethodCodeSize").atLeast(0L); Events.assertField(event, "peakTimeSpent").atLeast(0L); Events.assertField(event, "totalTimeSpent").atLeast(0L); } diff -Nru openjdk-13-13.0.3+3/test/jdk/jdk/jfr/javaagent/EventEmitterAgent.java openjdk-13-13.0.4+8/test/jdk/jdk/jfr/javaagent/EventEmitterAgent.java --- openjdk-13-13.0.3+3/test/jdk/jdk/jfr/javaagent/EventEmitterAgent.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-13-13.0.4+8/test/jdk/jdk/jfr/javaagent/EventEmitterAgent.java 2020-07-07 16:55:29.000000000 +0000 @@ -0,0 +1,106 @@ +/* + * 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. + */ + +package jdk.jfr.javaagent; + +import java.lang.instrument.Instrumentation; +import java.nio.file.Path; +import java.nio.file.Paths; + +import jdk.jfr.Configuration; +import jdk.jfr.Event; +import jdk.jfr.Name; +import jdk.jfr.Recording; +import jdk.jfr.consumer.RecordingFile; +import jdk.test.lib.Asserts; +import jdk.test.lib.jfr.EventNames; + +// Java agent that emits in multiple threads +public class EventEmitterAgent { + + private static final int THREADS = 5; + private static final int EVENTS_PER_THREAD = 150_000; + private static final int EXPECTED_COUNT = THREADS * EVENTS_PER_THREAD; + private static final Path DUMP_PATH = Paths.get("dump.jfr").toAbsolutePath(); + + // Called when agent is loaded from command line + public static void agentmain(String agentArgs, Instrumentation inst) throws Exception { + agentWork(); + } + + // Called when agent is dynamically loaded + public static void premain(String agentArgs, Instrumentation inst) throws Exception { + agentWork(); + } + + private static void agentWork() throws Exception { + try (Recording r = new Recording(Configuration.getConfiguration("default"))) { + r.enable(EventNames.JavaExceptionThrow); + r.setDestination(DUMP_PATH); + r.start(); + Thread[] threads = new Thread[THREADS]; + for (int i = 0; i < THREADS; i++) { + threads[i] = new Thread(EventEmitterAgent::emitEvents); + threads[i].start(); + } + for (int i = 0; i < THREADS; i++) { + threads[i].join(); + } + r.stop(); + } + } + + public static void emitEvents() { + for (int i = 0; i < EVENTS_PER_THREAD; i++) { + TestEvent e = new TestEvent(); + e.msg = "Long message that puts pressure on the string pool " + i % 100; + e.count = i; + e.thread = Thread.currentThread(); + e.clazz = String.class; + e.commit(); + if (i % 10000 == 0) { + try { + Thread.sleep(1); + } catch (InterruptedException ie) { + // ignore + } + } + } + } + + @Name("Test") + static class TestEvent extends Event { + String msg; + int count; + Thread thread; + Class clazz; + } + + public static void validateRecording() throws Exception { + long testEventCount = RecordingFile.readAllEvents(DUMP_PATH) + .stream() + .filter(e -> e.getEventType().getName().equals("Test")) + .count(); + Asserts.assertTrue(testEventCount == EXPECTED_COUNT, "Mismatch in TestEvent count"); + } +} diff -Nru openjdk-13-13.0.3+3/test/jdk/jdk/jfr/javaagent/JavaAgentBuilder.java openjdk-13-13.0.4+8/test/jdk/jdk/jfr/javaagent/JavaAgentBuilder.java --- openjdk-13-13.0.3+3/test/jdk/jdk/jfr/javaagent/JavaAgentBuilder.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-13-13.0.4+8/test/jdk/jdk/jfr/javaagent/JavaAgentBuilder.java 2020-07-07 16:55:29.000000000 +0000 @@ -0,0 +1,87 @@ +/* + * 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. + */ + +package jdk.test.lib.util; + +import java.io.File; +import java.io.IOException; +import java.nio.file.Path; +import java.nio.file.Paths; +import java.util.Arrays; +import java.util.jar.Attributes; +import java.util.jar.Manifest; + +import jdk.test.lib.Utils; +import jdk.test.lib.util.JarUtils; + +/** + * A builder for a common Java agent. + * Can be used directly from the jtreg test header to + * build a java agent before the test is executed. + * + * E.g.: + * @run driver jdk.test.lib.util.JavaAgentBuilder + * jdk.jfr.javaagent.EventEmitterAgent EventEmitterAgent.jar + * + */ +public class JavaAgentBuilder { + + /** + * Build a java agent jar file with a given agent class. + * + * @param args[0] fully qualified name of an agent class + * @param args[1] file name of the agent jar to be created + * @throws IOException + */ + public static void main(String... args) throws IOException { + String agentClass = args[0]; + String agentJar = args[1]; + System.out.println("Building " + agentJar + " with agent class " + agentClass); + build(agentClass, agentJar); + } + + /** + * Build a java agent jar file with a given agent class. + * The agent class will be added as both premain class and agent class. + * + * @param agentClass fully qualified name of an agent class + * @param agentJar file name of the agent jar to be created + * the file will be placed in a current work directory + * @throws IOException + */ + public static void build(String agentClass, String agentJar) throws IOException { + Manifest mf = new Manifest(); + Attributes attrs = mf.getMainAttributes(); + attrs.put(Attributes.Name.MANIFEST_VERSION, "1.0"); + attrs.putValue("Premain-Class", agentClass); + attrs.putValue("Agent-Class", agentClass); + + Path jarFile = Paths.get(".", agentJar); + String testClasses = Utils.TEST_CLASSES; + String agentPath = agentClass.replace(".", File.separator) + ".class"; + Path agentFile = Paths.get(testClasses, agentPath); + Path dir = Paths.get(testClasses); + JarUtils.createJarFile(jarFile, mf, dir, agentFile); + System.out.println("Agent built:" + jarFile.toAbsolutePath()); + } +} diff -Nru openjdk-13-13.0.3+3/test/jdk/jdk/jfr/javaagent/TestLoadedAgent.java openjdk-13-13.0.4+8/test/jdk/jdk/jfr/javaagent/TestLoadedAgent.java --- openjdk-13-13.0.3+3/test/jdk/jdk/jfr/javaagent/TestLoadedAgent.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-13-13.0.4+8/test/jdk/jdk/jfr/javaagent/TestLoadedAgent.java 2020-07-07 16:55:29.000000000 +0000 @@ -0,0 +1,58 @@ +/* + * 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 + * @key jfr + * @summary Tests emitting events in a dynamically loaded Java agent + * @requires vm.hasJFR + * + * @library /test/lib /test/jdk + * @modules java.instrument + * + * @build jdk.jfr.javaagent.EventEmitterAgent + * + * @run driver jdk.test.lib.util.JavaAgentBuilder + * jdk.jfr.javaagent.EventEmitterAgent EventEmitterAgent.jar + * + * @run main/othervm -Djdk.attach.allowAttachSelf=true jdk.jfr.javaagent.TestLoadedAgent + */ + +package jdk.jfr.javaagent; + +import com.sun.tools.attach.VirtualMachine; +import jdk.jfr.FlightRecorder; +import jdk.jfr.FlightRecorderListener; +import jdk.jfr.Recording; +import jdk.jfr.RecordingState; + + +public class TestLoadedAgent { + public static void main(String... arg) throws Exception { + long pid = ProcessHandle.current().pid(); + VirtualMachine vm = VirtualMachine.attach(Long.toString(pid)); + vm.loadAgent("EventEmitterAgent.jar"); + vm.detach(); + EventEmitterAgent.validateRecording(); + } +} diff -Nru openjdk-13-13.0.3+3/test/jdk/jdk/jfr/javaagent/TestPremainAgent.java openjdk-13-13.0.4+8/test/jdk/jdk/jfr/javaagent/TestPremainAgent.java --- openjdk-13-13.0.3+3/test/jdk/jdk/jfr/javaagent/TestPremainAgent.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-13-13.0.4+8/test/jdk/jdk/jfr/javaagent/TestPremainAgent.java 2020-07-07 16:55:29.000000000 +0000 @@ -0,0 +1,48 @@ +/* + * 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 + * @key jfr + * @summary Tests emitting event before main using a Java agent + * @requires vm.hasJFR + * + * @library /test/lib + * @modules java.instrument + * + * @build jdk.jfr.javaagent.EventEmitterAgent + * + * @run driver jdk.test.lib.util.JavaAgentBuilder + * jdk.jfr.javaagent.EventEmitterAgent EventEmitterAgent.jar + * + * @run main/othervm -javaagent:EventEmitterAgent.jar jdk.jfr.javaagent.TestPremainAgent + */ + +package jdk.jfr.javaagent; + + +public class TestPremainAgent { + public static void main(String... arg) throws Exception { + EventEmitterAgent.validateRecording(); + } +} diff -Nru openjdk-13-13.0.3+3/test/jdk/jdk/jfr/jmx/JmxHelper.java openjdk-13-13.0.4+8/test/jdk/jdk/jfr/jmx/JmxHelper.java --- openjdk-13-13.0.3+3/test/jdk/jdk/jfr/jmx/JmxHelper.java 2020-02-20 22:05:38.000000000 +0000 +++ openjdk-13-13.0.4+8/test/jdk/jdk/jfr/jmx/JmxHelper.java 2020-07-07 16:55:29.000000000 +0000 @@ -36,6 +36,7 @@ import java.util.List; import java.util.Map; +import com.sun.tools.attach.VirtualMachine; import jdk.jfr.EventType; import jdk.jfr.FlightRecorder; import jdk.jfr.Recording; @@ -52,7 +53,15 @@ import jdk.test.lib.jfr.CommonHelper; import jdk.test.lib.jfr.Events; +import javax.management.JMX; +import javax.management.MBeanServerConnection; +import javax.management.ObjectName; +import javax.management.remote.JMXConnector; +import javax.management.remote.JMXConnectorFactory; +import javax.management.remote.JMXServiceURL; + public class JmxHelper { + private static final String LOCAL_CONNECTION_ADDRESS = "com.sun.management.jmxremote.localConnectorAddress"; public static RecordingInfo getJmxRecording(long recId) { for (RecordingInfo r : getFlighteRecorderMXBean().getRecordings()) { @@ -279,4 +288,18 @@ return ManagementFactory.getPlatformMXBean(FlightRecorderMXBean.class); } + public static long getPID(){ + return ManagementFactory.getRuntimeMXBean().getPid(); + } + + public static FlightRecorderMXBean getFlighteRecorderMXBean(long pid) throws Exception { + VirtualMachine targetVM = VirtualMachine.attach("" + pid); + String jmxServiceUrl = targetVM.getAgentProperties().getProperty(LOCAL_CONNECTION_ADDRESS); + JMXServiceURL jmxURL = new JMXServiceURL(jmxServiceUrl); + JMXConnector connector = JMXConnectorFactory.connect(jmxURL); + MBeanServerConnection connection = connector.getMBeanServerConnection(); + + ObjectName objectName = new ObjectName("jdk.management.jfr:type=FlightRecorder"); + return JMX.newMXBeanProxy(connection, objectName, FlightRecorderMXBean.class); + } } diff -Nru openjdk-13-13.0.3+3/test/jdk/jdk/jfr/jmx/TestGetRecordings.java openjdk-13-13.0.4+8/test/jdk/jdk/jfr/jmx/TestGetRecordings.java --- openjdk-13-13.0.3+3/test/jdk/jdk/jfr/jmx/TestGetRecordings.java 2020-02-20 22:05:38.000000000 +0000 +++ openjdk-13-13.0.4+8/test/jdk/jdk/jfr/jmx/TestGetRecordings.java 2020-07-07 16:55:29.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2020, 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 @@ * @key jfr * @requires vm.hasJFR * @library /test/lib /test/jdk - * @run main/othervm jdk.jfr.jmx.TestGetRecordings + * @run main/othervm -Djdk.attach.allowAttachSelf=true -Dcom.sun.management.jmxremote jdk.jfr.jmx.TestGetRecordings */ public class TestGetRecordings { public static void main(String[] args) throws Throwable { @@ -46,5 +46,11 @@ JmxHelper.verifyNotExists(recId, preCreateRecordings); bean.closeRecording(recId); JmxHelper.verifyNotExists(recId, bean.getRecordings()); + + long selfPID = JmxHelper.getPID(); + FlightRecorderMXBean remoteBean = JmxHelper.getFlighteRecorderMXBean(selfPID); + long remoteRecId = remoteBean.newRecording(); + remoteBean.getRecordings(); + remoteBean.closeRecording(remoteRecId); } } diff -Nru openjdk-13-13.0.3+3/test/jdk/jdk/jfr/jmx/TestRecordingOptions.java openjdk-13-13.0.4+8/test/jdk/jdk/jfr/jmx/TestRecordingOptions.java --- openjdk-13-13.0.3+3/test/jdk/jdk/jfr/jmx/TestRecordingOptions.java 2020-02-20 22:05:38.000000000 +0000 +++ openjdk-13-13.0.4+8/test/jdk/jdk/jfr/jmx/TestRecordingOptions.java 2020-07-07 16:55:29.000000000 +0000 @@ -25,6 +25,7 @@ package jdk.jfr.jmx; +import java.io.File; import java.util.HashMap; import java.util.LinkedHashMap; import java.util.Map; @@ -49,7 +50,7 @@ options.put("dumpOnExit", "false"); options.put("disk", "false"); options.put("duration", "1 h"); // don't want recording to stop - + options.put("destination", "." + File.separator + "dump.jfr"); FlightRecorderMXBean bean = JmxHelper.getFlighteRecorderMXBean(); long recId = bean.newRecording(); Map defaults = bean.getRecordingOptions(recId); @@ -72,6 +73,7 @@ Asserts.assertEquals(outOptions.get("dumpOnExit"), "false", "Wrong dumpOnExit"); Asserts.assertEquals(outOptions.get("disk"), "false", "Wrong disk"); Asserts.assertEquals(outOptions.get("duration"), "1 h", "Wrong duration"); + Asserts.assertEquals(outOptions.get("destination"), "." + File.separator + "dump.jfr", "Wrong destination"); // try empty map bean.setRecordingOptions(recId, new HashMap<>()); @@ -116,6 +118,7 @@ nullMap.put("dumpOnExit", null); nullMap.put("disk", null); nullMap.put("duration", null); + nullMap.put("destination", null); bean.setRecordingOptions(recId, nullMap); Asserts.assertEquals(bean.getRecordingOptions(recId), defaults); diff -Nru openjdk-13-13.0.3+3/test/jdk/jdk/jfr/jvm/TestClearStaleConstants.java openjdk-13-13.0.4+8/test/jdk/jdk/jfr/jvm/TestClearStaleConstants.java --- openjdk-13-13.0.3+3/test/jdk/jdk/jfr/jvm/TestClearStaleConstants.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-13-13.0.4+8/test/jdk/jdk/jfr/jvm/TestClearStaleConstants.java 2020-07-07 16:55:29.000000000 +0000 @@ -0,0 +1,115 @@ +/* + * 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 jdk.jfr.jvm; + +import java.time.Duration; +import java.util.List; + +import jdk.jfr.consumer.RecordedClass; +import jdk.jfr.consumer.RecordedClassLoader; +import jdk.jfr.consumer.RecordedEvent; +import jdk.jfr.internal.JVM; +import jdk.jfr.Recording; +import jdk.test.lib.Asserts; +import jdk.test.lib.jfr.EventNames; +import jdk.test.lib.jfr.Events; +import jdk.test.lib.jfr.TestClassLoader; + +/** + * @test + * @bug 8231081 + * @key jfr + * @requires vm.hasJFR + * @modules jdk.jfr/jdk.jfr.internal + * @library /test/lib /test/jdk + * @run main/othervm -Xlog:class+unload -Xlog:gc -Xmx16m jdk.jfr.jvm.TestClearStaleConstants + */ + +/** + * System.gc() will trigger class unloading if -XX:+ExplicitGCInvokesConcurrent is NOT set. + * If this flag is set G1 will never unload classes on System.gc() and + * As far as the "jfr" key guarantees no VM flags are set from the outside + * it should be enough with System.gc(). + */ +public final class TestClearStaleConstants { + static class MyClass { + } + private final static String TEST_CLASS_NAME = "jdk.jfr.jvm.TestClearStaleConstants$MyClass"; + private final static String EVENT_NAME = EventNames.ClassDefine; + + // to prevent the compiler to optimize away all unread writes + public static TestClassLoader firstClassLoader; + public static TestClassLoader secondClassLoader; + + public static void main(String... args) throws Exception { + firstClassLoader = new TestClassLoader(); + // define a class using a class loader under a recording + Class clz = recordClassDefinition(firstClassLoader); + JVM jvm = JVM.getJVM(); + // we will now tag the defined and loaded clz as being in use (no recordings are running here) + jvm.getClassIdNonIntrinsic(clz); + // null out for unload to occur + firstClassLoader = null; + clz = null; + // provoke unload + System.gc(); + // try to define another class _with the same name_ using a different class loader + secondClassLoader = new TestClassLoader(); + // this will throw a NPE for 8231081 because it will reuse the same class name + // that symbol was marked as already serialized by the unload, but since no recordings were running + // it was not written to any chunk. This creates a reference to a non-existing symbol, leading to an NPE (no symbol at the expected location). + recordClassDefinition(secondClassLoader); + } + + private static Class recordClassDefinition(TestClassLoader classLoader) throws Exception { + try (Recording recording = new Recording()) { + recording.enable(EVENT_NAME); + recording.start(); + Class clz = classLoader.loadClass(TEST_CLASS_NAME); + recording.stop(); + assertClassDefineEvent(recording); + return clz; + } + } + + private static void assertClassDefineEvent(Recording recording) throws Exception { + boolean isAnyFound = false; + for (RecordedEvent event : Events.fromRecording(recording)) { + System.out.println(event); + RecordedClass definedClass = event.getValue("definedClass"); + if (TEST_CLASS_NAME.equals(definedClass.getName())) { + RecordedClassLoader definingClassLoader = definedClass.getClassLoader(); + String definingName = definingClassLoader.getType().getName(); + String testName = TestClassLoader.class.getName(); + String errorMsg = "Expected " + testName + ", got " + definingName; + Asserts.assertEquals(testName, definingName, errorMsg); + Asserts.assertFalse(isAnyFound, "Found more than 1 event"); + isAnyFound = true; + } + } + Asserts.assertTrue(isAnyFound, "No events found"); + } +} diff -Nru openjdk-13-13.0.3+3/test/jdk/jdk/nio/zipfs/ZipFSPermissionsTest.java openjdk-13-13.0.4+8/test/jdk/jdk/nio/zipfs/ZipFSPermissionsTest.java --- openjdk-13-13.0.3+3/test/jdk/jdk/nio/zipfs/ZipFSPermissionsTest.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-13-13.0.4+8/test/jdk/jdk/nio/zipfs/ZipFSPermissionsTest.java 2020-07-07 16:55:29.000000000 +0000 @@ -0,0 +1,229 @@ +/* + * 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 org.testng.SkipException; +import org.testng.annotations.*; + +import java.io.IOException; +import java.nio.file.FileSystem; +import java.nio.file.FileSystems; +import java.nio.file.Files; +import java.nio.file.Path; +import java.nio.file.attribute.PosixFileAttributeView; +import java.nio.file.attribute.PosixFileAttributes; +import java.nio.file.attribute.PosixFilePermission; +import java.nio.file.attribute.PosixFilePermissions; +import java.util.Map; +import java.util.Set; + +import static java.nio.file.attribute.PosixFilePermission.*; +import static org.testng.Assert.assertEquals; + +/** + * @test + * @bug 8229888 + * @summary Updating an existing zip file does not preserve original permissions + * @library /test/lib + * @modules jdk.zipfs + * @run testng/othervm ZipFSPermissionsTest + * @run testng/othervm/java.security.policy=ZipFSPermissionsTest.policy ZipFSPermissionsTest + */ +public class ZipFSPermissionsTest { + + // Files used for testing + private static final Path zipFile = Path.of("zipPermsTest.zip"); + private static final Path entry0 = Path.of("Entry-0.txt"); + // Path of 2nd file to add to the Zip file + private static final Path entry1 = Path.of("Entry-1.txt"); + + // Enable for permissions output + private static final boolean DEBUG = false; + + /** + * Create the files used by the test + */ + @BeforeSuite + public void setUp() throws Exception { + boolean supportsPosix = FileSystems.getDefault() + .supportedFileAttributeViews().contains("posix"); + + // Check to see if File System supports POSIX permissions + if (supportsPosix) { + System.out.println("File Store Supports Posix"); + } else { + // As there is no POSIX permission support, skip running the test + throw new SkipException("Cannot set permissions on this File Store"); + } + Files.writeString(entry0, "Tennis Pro"); + Files.writeString(entry1, "Tennis is a lifetime sport!"); + } + + /** + * Re-create the initial Zip file prior to each run. + */ + @BeforeMethod + public void before() throws Exception { + Files.deleteIfExists(zipFile); + zip(zipFile, Map.of("create", "true"), entry0); + } + + /** + * Remove Zip file used by test after each run. + */ + @AfterMethod + public void tearDown() throws Exception { + Files.deleteIfExists(zipFile); + } + + /** + * Remove files used by test as part of final test run clean-up + */ + @AfterSuite + public void suiteCleanUp() throws Exception { + Files.deleteIfExists(zipFile); + Files.deleteIfExists(entry0); + Files.deleteIfExists(entry1); + } + + /** + * Validate that the Zip file permissions are as expected after updating the + * Zip file + * @param newPerms The permissions to set on the Zip File before updating the + * file + * @throws Exception If an error occurs + */ + @Test(dataProvider = "posixPermissions") + public void testZipPerms(Set newPerms) throws Exception { + if (DEBUG) { + System.out.printf("Test Run with perms= %s%n", newPerms); + } + + PosixFileAttributes attrs = getPosixAttributes(zipFile); + + // Permissions used to verify the results of updating the Zip file + if (newPerms == null) { + // Use current Zip File permissions; + newPerms = attrs.permissions(); + } + displayPermissions("Original permissions", zipFile); + + // Now set the new permissions + Files.setPosixFilePermissions(zipFile, newPerms); + displayPermissions("Revised permissions", zipFile); + + // Update the Zip file + zip(zipFile, Map.of(), entry1); + + // Validate that the permissions are as expected after updating the + // Zip file + PosixFileAttributes afterAttrs = getPosixAttributes(zipFile); + displayPermissions("Permissions after updating the Zip File", zipFile); + assertEquals(afterAttrs.permissions(), newPerms, + "Permissions were not updated as expected!"); + } + + /** + * Display the permissions for the specified Zip file when {@code DEBUG} + * is set to {@code true} + * + * @param msg String to include in the message + * @param zipFile Path to the Zip File + * @throws IOException If an error occurs obtaining the permissions + */ + public void displayPermissions(String msg, Path zipFile) throws IOException { + if (DEBUG) { + PosixFileAttributeView view = Files.getFileAttributeView(zipFile, + PosixFileAttributeView.class); + if (view == null) { + System.out.println("Could not obtain a PosixFileAttributeView!"); + return; + } + PosixFileAttributes attrs = view.readAttributes(); + System.out.printf("%s: %s, Owner: %s, Group:%s, permissions: %s%n", msg, + zipFile.getFileName(), attrs.owner().getName(), + attrs.group().getName(), PosixFilePermissions.toString(attrs.permissions())); + } + } + + /** + * Create a Zip File System using the specified properties and a Zip file + * with the specified number of entries + * + * @param zipFile Path to the Zip File to create/update + * @param env Properties used for creating the Zip Filesystem + * @param source The path of the file to add to the Zip File + * @throws IOException If an error occurs while creating/updating the Zip file + */ + public void zip(Path zipFile, Map env, Path source) throws IOException { + if (DEBUG) { + System.out.printf("File:%s, adding:%s%n", zipFile.toAbsolutePath(), source); + } + try (FileSystem zipfs = + FileSystems.newFileSystem(zipFile, env)) { + Files.copy(source, zipfs.getPath(source.getFileName().toString())); + } + } + + /** + * Returns a file's POSIX file attributes. + * + * @param path The path to the Zip file + * @return The POSIX file attributes for the specified file or + * null if the POSIX attribute view is not available + * @throws IOException If an error occurs obtaining the POSIX attributes for + * the specified file + */ + public PosixFileAttributes getPosixAttributes(Path path) throws IOException { + PosixFileAttributes attrs = null; + PosixFileAttributeView view = + Files.getFileAttributeView(path, PosixFileAttributeView.class); + // Return if the attribute view is not supported + if (view == null) { + return null; + } + attrs = view.readAttributes(); + return attrs; + } + + /* + * DataProvider used to verify the permissions on a Zip file + * are as expected after updating the Zip file + */ + @DataProvider(name = "posixPermissions") + private Object[][] posixPermissions() { + return new Object[][]{ + {null}, + {Set.of(OWNER_READ, OWNER_WRITE, OTHERS_READ)}, + {Set.of(OWNER_READ, OWNER_WRITE, OWNER_EXECUTE)}, + {Set.of(OWNER_READ, OWNER_WRITE, OTHERS_READ, OTHERS_WRITE)}, + {Set.of(OWNER_READ, OWNER_WRITE, OWNER_EXECUTE, OTHERS_READ, + OTHERS_WRITE, OTHERS_EXECUTE)}, + {Set.of(OWNER_READ, OWNER_WRITE, OWNER_EXECUTE, + GROUP_READ, GROUP_WRITE,GROUP_EXECUTE, OTHERS_READ, + OTHERS_WRITE, OTHERS_EXECUTE)}, + {Set.of(OWNER_READ, OWNER_WRITE, GROUP_READ, GROUP_WRITE, + OTHERS_READ, OTHERS_WRITE)}, + }; + } +} diff -Nru openjdk-13-13.0.3+3/test/jdk/jdk/nio/zipfs/ZipFSPermissionsTest.policy openjdk-13-13.0.4+8/test/jdk/jdk/nio/zipfs/ZipFSPermissionsTest.policy --- openjdk-13-13.0.3+3/test/jdk/jdk/nio/zipfs/ZipFSPermissionsTest.policy 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-13-13.0.4+8/test/jdk/jdk/nio/zipfs/ZipFSPermissionsTest.policy 2020-07-07 16:55:29.000000000 +0000 @@ -0,0 +1,5 @@ +grant { + permission java.io.FilePermission "<>","read,write,delete"; + permission java.util.PropertyPermission "user.dir","read"; + permission java.lang.RuntimePermission "accessUserInformation"; +}; diff -Nru openjdk-13-13.0.3+3/test/jdk/ProblemList.txt openjdk-13-13.0.4+8/test/jdk/ProblemList.txt --- openjdk-13-13.0.3+3/test/jdk/ProblemList.txt 2020-02-20 22:05:38.000000000 +0000 +++ openjdk-13-13.0.4+8/test/jdk/ProblemList.txt 2020-07-07 16:55:29.000000000 +0000 @@ -1,6 +1,6 @@ ########################################################################### # -# Copyright (c) 2009, 2019, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2009, 2020, 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 @@ -127,6 +127,7 @@ java/awt/FileDialog/8003399/bug8003399.java 8198334 windows-all java/awt/event/MouseWheelEvent/InfiniteRecursion/InfiniteRecursion.java 8060176 windows-all,macosx-all java/awt/event/MouseWheelEvent/InfiniteRecursion/InfiniteRecursion_1.java 8060176 windows-all,macosx-all +java/awt/dnd/DropTargetEnterExitTest/MissedDragExitTest.java 8159694 linux-all java/awt/dnd/MissingEventsOnModalDialog/MissingEventsOnModalDialogTest.java 8164464 linux-all,macosx-all java/awt/dnd/URIListBetweenJVMsTest/URIListBetweenJVMsTest.java 8171510 macosx-all javax/swing/dnd/7171812/bug7171812.java 8041447 macosx-all @@ -154,7 +155,7 @@ java/awt/Mixing/AWT_Mixing/HierarchyBoundsListenerMixingTest.java 8049405 macosx-all java/awt/Mixing/AWT_Mixing/OpaqueOverlappingChoice.java 8048171 generic-all java/awt/Mixing/AWT_Mixing/JMenuBarOverlapping.java 8159451 linux-all,windows-all,macosx-all -java/awt/Mixing/AWT_Mixing/JSplitPaneOverlapping.java 8194765 generic-all +java/awt/Mixing/AWT_Mixing/JSplitPaneOverlapping.java 6986109 generic-all java/awt/Mixing/AWT_Mixing/JInternalFrameMoveOverlapping.java 6986109 windows-all java/awt/Mixing/AWT_Mixing/MixingPanelsResizing.java 8049405 generic-all java/awt/Mixing/AWT_Mixing/JComboBoxOverlapping.java 8049405 macosx-all @@ -185,13 +186,15 @@ java/awt/Mixing/AWT_Mixing/JTextFieldInGlassPaneOverlapping.java 8158801 windows-all java/awt/Mixing/AWT_Mixing/JTextFieldOverlapping.java 8158801 windows-all java/awt/Mixing/AWT_Mixing/JToggleButtonInGlassPaneOverlapping.java 8158801 windows-all -java/awt/Mixing/AWT_Mixing/JToggleButtonOverlapping.java 8158801 windows-all +java/awt/Mixing/AWT_Mixing/JToggleButtonOverlapping.java 8158801 windows-all +java/awt/Mixing/MixingOnDialog.java 8225777 linux-all java/awt/Mixing/NonOpaqueInternalFrame.java 7124549 macosx-all +java/awt/Mouse/GetMousePositionTest/GetMousePositionWithOverlay.java 8168388 linux-all java/awt/Focus/ActualFocusedWindowTest/ActualFocusedWindowRetaining.java 6829264 generic-all java/awt/datatransfer/DragImage/MultiResolutionDragImageTest.java 8080982 generic-all java/awt/datatransfer/SystemFlavorMap/AddFlavorTest.java 8079268 linux-all java/awt/Toolkit/ScreenInsetsTest/ScreenInsetsTest.java 6829250 windows-all -java/awt/Toolkit/RealSync/Test.java 6849383 macosx-all,linux-all +java/awt/Toolkit/RealSync/Test.java 6849383 linux-all java/awt/LightweightComponent/LightweightEventTest/LightweightEventTest.java 8159252 windows-all java/awt/EventDispatchThread/HandleExceptionOnEDT/HandleExceptionOnEDT.java 8203047 macosx-all java/awt/EventDispatchThread/LoopRobustness/LoopRobustness.java 8073636 macosx-all @@ -203,7 +206,7 @@ java/awt/Focus/8073453/AWTFocusTransitionTest.java 8136517 macosx-all java/awt/Focus/8073453/SwingFocusTransitionTest.java 8136517 macosx-all java/awt/Focus/6981400/Test3.java 8173264 generic-all -java/awt/event/KeyEvent/ExtendedKeyCode/ExtendedKeyCodeTest.java 8169476 windows-all +java/awt/event/KeyEvent/ExtendedKeyCode/ExtendedKeyCodeTest.java 8169476 windows-all,macosx-all java/awt/event/KeyEvent/KeyChar/KeyCharTest.java 8169474,8224055 macosx-all,windows-all java/awt/event/MouseEvent/SpuriousExitEnter/SpuriousExitEnter_3.java 6854300 generic-all java/awt/event/KeyEvent/ExtendedModifiersTest/ExtendedModifiersTest.java 8129778 generic-all @@ -211,7 +214,6 @@ java/awt/event/MouseEvent/MouseButtonsAndKeyMasksTest/MouseButtonsAndKeyMasksTest.java 8129778 generic-all java/awt/dnd/URIListToFileListBetweenJVMsTest/URIListToFileListBetweenJVMsTest.java 8194947 generic-all -java/awt/Frame/SetMaximizedBounds/SetMaximizedBounds.java 8196006 windows-all java/awt/Frame/FramesGC/FramesGC.java 8079069 macosx-all java/awt/FullScreen/AltTabCrashTest/AltTabCrashTest.java 8047218 generic-all java/awt/GridLayout/LayoutExtraGaps/LayoutExtraGaps.java 8000171 windows-all @@ -219,7 +221,7 @@ java/awt/Scrollbar/ScrollbarMouseWheelTest/ScrollbarMouseWheelTest.java 8196018 windows-all,linux-all java/awt/TrayIcon/ActionCommand/ActionCommand.java 8150540 windows-all java/awt/TrayIcon/ActionEventMask/ActionEventMask.java 8150540 windows-all -java/awt/TrayIcon/ActionEventTest/ActionEventTest.java 8150540 windows-all +java/awt/TrayIcon/ActionEventTest/ActionEventTest.java 8150540,8242801 windows-all,macosx-all java/awt/TrayIcon/ModalityTest/ModalityTest.java 8150540 windows-all,macosx-all java/awt/TrayIcon/MouseEventMask/MouseEventMaskTest.java 8150540 windows-all java/awt/TrayIcon/MouseMovedTest/MouseMovedTest.java 8150540 windows-all @@ -231,7 +233,6 @@ java/awt/TrayIcon/TrayIconPopup/TrayIconPopupClickTest.java 8150540 windows-all,macosx-all java/awt/TrayIcon/TrayIconPopup/TrayIconPopupTest.java 8150540 windows-all java/awt/TrayIcon/PopupMenuLeakTest/PopupMenuLeakTest.java 8196440 linux-all -java/awt/Window/Grab/GrabTest.java 8196019 windows-all java/awt/Window/ShapedAndTranslucentWindows/SetShapeAndClick.java 8197936 macosx-all java/awt/Window/ShapedAndTranslucentWindows/SetShapeDynamicallyAndClick.java 8013450 macosx-all java/awt/Window/ShapedAndTranslucentWindows/ShapedTranslucentWindowClick.java 8013450 macosx-all @@ -243,7 +244,7 @@ java/awt/Window/ShapedAndTranslucentWindows/ShapedTranslucent.java 8222328 windows-all,linux-all,macosx-all java/awt/Window/ShapedAndTranslucentWindows/StaticallyShaped.java 8165218,8222328 windows-all,macosx-all,linux-all java/awt/Window/ShapedAndTranslucentWindows/Translucent.java 8222328 windows-all,linux-all,macosx-all -java/awt/Window/AlwaysOnTop/AutoTestOnTop.java 6847593 macosx-all,windows-all,linux-all +java/awt/Window/AlwaysOnTop/AutoTestOnTop.java 6847593 linux-all java/awt/Window/GrabSequence/GrabSequence.java 6848409 macosx-all,linux-all java/awt/Window/LocationAtScreenCorner/LocationAtScreenCorner.java 8203371 linux-all,solaris-all java/awt/font/TextLayout/CombiningPerf.java 8192931 generic-all @@ -251,6 +252,7 @@ java/awt/font/StyledMetrics/BoldSpace.java 8198422 linux-all java/awt/FontMetrics/FontCrash.java 8198336 windows-all java/awt/FontMetrics/MaxAdvanceIsMax.java 8221305,8231495 solaris-all,macosx-all,linux-all +java/awt/image/BufferedImage/ICMColorDataTest/ICMColorDataTest.java 8233028 generic-all java/awt/image/DrawImage/IncorrectAlphaSurface2SW.java 8056077 generic-all java/awt/image/DrawImage/IncorrectClipXorModeSW2Surface.java 8196025 windows-all java/awt/image/DrawImage/IncorrectClipXorModeSurface2Surface.java 8196025 windows-all @@ -265,13 +267,13 @@ sun/java2d/DirectX/OnScreenRenderingResizeTest/OnScreenRenderingResizeTest.java 8022403 generic-all sun/java2d/DirectX/OverriddenInsetsTest/OverriddenInsetsTest.java 8196102 generic-all sun/java2d/DirectX/RenderingToCachedGraphicsTest/RenderingToCachedGraphicsTest.java 8196180 windows-all,macosx-all -sun/java2d/GdiRendering/InsetClipping.java 8196181 windows-all java/awt/Graphics2D/CopyAreaOOB.java 7001973 windows-all,macosx-all sun/java2d/SunGraphics2D/EmptyClipRenderingTest.java 8144029 macosx-all,linux-all sun/java2d/SunGraphics2D/DrawImageBilinear.java 8191406 generic-all sun/java2d/SunGraphics2D/PolyVertTest.java 6986565 generic-all sun/java2d/SunGraphics2D/SimplePrimQuality.java 6992007 generic-all sun/java2d/SunGraphics2D/SourceClippingBlitTest/SourceClippingBlitTest.java 8196185 generic-all +sun/java2d/loops/RenderToCustomBufferTest.java 8220150 macosx-all sun/java2d/pipe/InterpolationQualityTest.java 8171303 windows-all,linux-all,macosx-all sun/java2d/X11SurfaceData/SharedMemoryPixmapsTest/SharedMemoryPixmapsTest.sh 8221451 linux-all java/awt/FullScreen/DisplayChangeVITest/DisplayChangeVITest.java 8169469 windows-all @@ -283,7 +285,6 @@ java/awt/PrintJob/PrinterException.java 8196301 windows-all,macosx-all java/awt/Choice/PopupPosTest/PopupPosTest.java 8197811 windows-all java/awt/Choice/ChoiceMouseWheelTest/ChoiceMouseWheelTest.java 7100044 macosx-all,linux-all -java/awt/Choice/ChoiceKeyEventReaction/ChoiceKeyEventReaction.java 8214469 macosx-all java/awt/Component/CreateImage/CreateImage.java 8198334 windows-all java/awt/Component/GetScreenLocTest/GetScreenLocTest.java 4753654 generic-all java/awt/Component/SetEnabledPerformance/SetEnabledPerformance.java 8165863 macosx-all @@ -303,7 +304,7 @@ java/awt/Modal/FileDialog/FileDialogDocModal4Test.java 7186009 macosx-all java/awt/Modal/FileDialog/FileDialogDocModal5Test.java 7186009 macosx-all java/awt/Modal/FileDialog/FileDialogDocModal6Test.java 7186009 macosx-all -java/awt/Modal/FileDialog/FileDialogDocModal7Test.java 7186009 macosx-all +java/awt/Modal/FileDialog/FileDialogDocModal7Test.java 7186009 macosx-all,linux-all java/awt/Modal/FileDialog/FileDialogModal1Test.java 7186009 macosx-all java/awt/Modal/FileDialog/FileDialogModal2Test.java 7186009 macosx-all java/awt/Modal/FileDialog/FileDialogModal3Test.java 7186009 macosx-all @@ -518,7 +519,7 @@ java/awt/SplashScreen/MultiResolutionSplash/unix/UnixMultiResolutionSplashTest.java 8203004 linux-all java/awt/Robot/AcceptExtraMouseButtons/AcceptExtraMouseButtons.java 7107528 linux-all,macosx-all java/awt/Mouse/MouseDragEvent/MouseDraggedTest.java 8080676 linux-all -java/awt/Mouse/MouseModifiersUnitTest/MouseModifiersInKeyEvent.java 8157147 linux-all,solaris-all,windows-all +java/awt/Mouse/MouseModifiersUnitTest/MouseModifiersInKeyEvent.java 8157147 linux-all,solaris-all,windows-all,macosx-all java/awt/Mouse/TitleBarDoubleClick/TitleBarDoubleClick.java 8148041 linux-all java/awt/Toolkit/DesktopProperties/rfe4758438.java 8193547 linux-all java/awt/Toolkit/ToolkitPropertyTest/ToolkitPropertyTest_Enable.java 6847163 @@ -533,6 +534,32 @@ java/awt/TextArea/AutoScrollOnSelectAndAppend/AutoScrollOnSelectAndAppend.java 8213120 macosx-all java/awt/Window/MainKeyWindowTest/TestMainKeyWindow.java 8213126 macosx-all +java/awt/GraphicsDevice/DisplayModes/CycleDMImage.java 7099223 linux-all,solaris-all,windows-all +java/awt/Window/WindowResizing/DoubleClickTitleBarTest.java 8233557 macosx-all +java/awt/Window/WindowOwnedByEmbeddedFrameTest/WindowOwnedByEmbeddedFrameTest.java 8233558 macosx-all +java/awt/Mouse/MouseComboBoxTest/MouseComboBoxTest.java 8233564 macosx-all +java/awt/Modal/NullModalityDialogTest/NullModalityDialogTest.java 8233565 macosx-all +java/awt/keyboard/AllKeyCode/AllKeyCode.java 8242930 macosx-all +java/awt/KeyboardFocusmanager/TypeAhead/SubMenuShowTest/SubMenuShowTest.java 8233566 macosx-all +java/awt/KeyboardFocusmanager/TypeAhead/EnqueueWithDialogTest/EnqueueWithDialogTest.java 8233566 macosx-all +java/awt/FullScreen/8013581/bug8013581.java 8169471 macosx-all +java/awt/Focus/FocusSubRequestTest/FocusSubRequestTest.java 8233567 macosx-all +java/awt/event/MouseEvent/RobotLWTest/RobotLWTest.java 8233568 macosx-all +java/awt/event/MouseEvent/MultipleMouseButtonsTest/MultipleMouseButtonsTest.java 8233568 macosx-all +java/awt/event/MouseEvent/ClickDuringKeypress/ClickDuringKeypress.java 8233568 macosx-all +java/awt/event/KeyEvent/DeadKey/DeadKeyMacOSXInputText.java 8233568 macosx-all +java/awt/event/KeyEvent/DeadKey/deadKeyMacOSX.java 8233568 macosx-all +com/apple/eawt/DefaultMenuBar/DefaultMenuBarTest.java 8233648 macosx-all +java/awt/Choice/ChoiceKeyEventReaction/ChoiceKeyEventReaction.java 7185258 macosx-all +java/awt/TrayIcon/RightClickWhenBalloonDisplayed/RightClickWhenBalloonDisplayed.java 8238720 windows-all +java/awt/PopupMenu/PopupMenuLocation.java 8238720 windows-all +java/awt/Mixing/AWT_Mixing/MixingFrameResizing.java 8238720 windows-all +java/awt/Mixing/AWT_Mixing/HierarchyBoundsListenerMixingTest.java 8238720 windows-all +java/awt/GridLayout/ComponentPreferredSize/ComponentPreferredSize.java 8238720 windows-all +java/awt/GridLayout/ChangeGridSize/ChangeGridSize.java 8238720 windows-all +java/awt/event/MouseEvent/FrameMouseEventAbsoluteCoordsTest/FrameMouseEventAbsoluteCoordsTest.java + + ############################################################################ # jdk_beans @@ -674,6 +701,7 @@ sun/security/pkcs11/KeyStore/SecretKeysBasic.sh 8209398 generic-all security/infra/java/security/cert/CertPathValidator/certification/ActalisCA.java 8224768 generic-all +security/infra/java/security/cert/CertPathValidator/certification/LuxTrustCA.java 8237888 generic-all sun/security/smartcardio/TestChannel.java 8039280 generic-all sun/security/smartcardio/TestConnect.java 8039280 generic-all @@ -732,14 +760,15 @@ javax/swing/JWindow/ShapedAndTranslucentWindows/TranslucentJComboBox.java 8024627 macosx-all # The next test below is an intermittent failure javax/swing/JComboBox/8033069/bug8033069ScrollBar.java 8163367 generic-all +javax/swing/JColorChooser/Test6827032.java 8197825 windows-all javax/swing/JColorChooser/Test6541987.java 8143021 windows-all,linux-all,macosx-all javax/swing/JColorChooser/Test7194184.java 8194126 linux-all,macosx-all -javax/swing/JTable/7124218/SelectEditTableCell.java 8148958 linux-all +javax/swing/JTable/7124218/SelectEditTableCell.java 8148958 linux-all,macosx-all javax/swing/JTable/4235420/bug4235420.java 8079127 generic-all javax/swing/JSplitPane/4201995/bug4201995.java 8079127 generic-all javax/swing/JTree/DnD/LastNodeLowerHalfDrop.java 8159131 linux-all javax/swing/JTree/4633594/JTreeFocusTest.java 8173125 macosx-all -javax/swing/JFileChooser/8041694/bug8041694.java 8196302 windows-all +javax/swing/JFileChooser/8041694/bug8041694.java 8196302 windows-all,macosx-all javax/swing/AbstractButton/6711682/bug6711682.java 8060765 windows-all,macosx-all javax/swing/Action/8133039/bug8133039.java 8196089 windows-all,macosx-all javax/swing/JComboBox/6559152/bug6559152.java 8196090 windows-all,macosx-all @@ -748,7 +777,7 @@ javax/swing/JComboBox/8072767/bug8072767.java 8196093 windows-all,macosx-all javax/swing/JComponent/4337267/bug4337267.java 8146451 windows-all javax/swing/JFileChooser/4524490/bug4524490.java 8042380 generic-all -javax/swing/JFileChooser/8002077/bug8002077.java 8196094 windows-all +javax/swing/JFileChooser/8002077/bug8002077.java 8196094 windows-all,macosx-all javax/swing/JFileChooser/DeserializedJFileChooser/DeserializedJFileChooserTest.java 8196095 generic-all javax/swing/JFileChooser/6396844/TwentyThousandTest.java 8198003 generic-all javax/swing/JFrame/8175301/ScaledFrameBackgroundTest.java 8193942 generic-all @@ -771,11 +800,12 @@ javax/swing/JFileChooser/6738668/bug6738668.java 8194946 generic-all javax/swing/JFileChooser/8021253/bug8021253.java 8169954 windows-all,linux-all,macosx-all javax/swing/JFileChooser/8062561/bug8062561.java 8196466 linux-all,macosx-all -javax/swing/JInternalFrame/Test6325652.java 8196467 linux-all,macosx-all -javax/swing/JInternalFrame/8145896/TestJInternalFrameMaximize.java 8194944 macosx-all +javax/swing/JInternalFrame/Test6325652.java 8224977 macosx-all +javax/swing/JInternalFrame/8146321/JInternalFrameIconTest.java 8225045 linux-all javax/swing/JLabel/6596966/bug6596966.java 8040914 macosx-all javax/swing/JPopupMenu/4870644/bug4870644.java 8194130 macosx-all,linux-all javax/swing/JPopupMenu/4966112/bug4966112.java 8064915 macosx-all +javax/swing/JSpinner/8223788/JSpinnerButtonFocusTest.java 8238085 macosx-all javax/swing/MultiUIDefaults/Test6860438.java 8198391 generic-all javax/swing/MultiUIDefaults/4300666/bug4300666.java 7105119 macosx-all javax/swing/UITest/UITest.java 8198392 generic-all @@ -791,12 +821,12 @@ javax/swing/text/AbstractDocument/DocumentInsert/DocumentInsertAtWrongPositionTest.java 8198396 generic-all javax/swing/JFileChooser/6868611/bug6868611.java 7059834 windows-all javax/swing/SwingWorker/6493680/bug6493680.java 8198410 windows-all -javax/swing/plaf/basic/BasicMenuUI/4983388/bug4983388.java 8042383 macosx-all -javax/swing/PopupFactory/6276087/NonOpaquePopupMenuTest.java 8065099 macosx-all +javax/swing/PopupFactory/6276087/NonOpaquePopupMenuTest.java 8065099,8208565 macosx-all,linux-all javax/swing/DataTransfer/8059739/bug8059739.java 8199074 generic-all javax/swing/JCheckBox/8032667/bug8032667_image_diff.java 8199063 macosx-all javax/swing/JComboBox/7031551/bug7031551.java 8199056 generic-all javax/swing/JScrollBar/6924059/bug6924059.java 8199078 generic-all +javax/swing/JTabbedPane/TabProb.java 8236635 linux-all javax/swing/JTree/8003830/bug8003830.java 8199057 generic-all javax/swing/plaf/nimbus/ColorCustomizationTest.java 8199080 generic-all javax/swing/SwingWorker/6432565/bug6432565.java 8199077 generic-all @@ -823,10 +853,45 @@ javax/swing/JTree/6263446/bug6263446.java 8213125 macosx-all javax/swing/JTree/8003400/Test8003400.java 8197560 macosx-all,linux-all javax/swing/RepaintManager/IconifyTest/IconifyTest.java 8221903 linux-all -javax/swing/JRadioButton/FocusTraversal/FocusTraversal.java 8221902 linux-all +javax/swing/JRadioButton/FocusTraversal/FocusTraversal.java 8221902 linux-all,macosx-all +javax/swing/ToolTipManager/Test6256140.java 8233560 macosx-all +javax/swing/text/View/8014863/bug8014863.java 8233561 macosx-all +javax/swing/text/StyledEditorKit/4506788/bug4506788.java 8233561 macosx-all +javax/swing/text/JTextComponent/6361367/bug6361367.java 8233569 macosx-all +javax/swing/text/html/HTMLEditorKit/5043626/bug5043626.java 233570 macosx-all +javax/swing/text/GlyphPainter2/6427244/bug6427244.java 8208566 macosx-all +javax/swing/text/DefaultEditorKit/4278839/bug4278839.java 8233634 macosx-all +javax/swing/ProgressMonitor/ProgressMonitorEscapeKeyPress.java 8233635 macosx-all +javax/swing/plaf/nimbus/TestNimbusOverride.java 8233559 macosx-all +javax/swing/JTree/4927934/bug4927934.java 8233550 macosx-all +javax/swing/JTree/4908142/bug4908142.java 8233550 macosx-all +javax/swing/JTree/4330357/bug4330357.java 8233550 macosx-all +javax/swing/JTable/7124218/SelectEditTableCell.java 8233551 macosx-all +javax/swing/JTable/7068740/bug7068740.java 8233552 macosx-all +javax/swing/JSpinner/4973721/bug4973721.java 8233553 macosx-all +javax/swing/JRootPane/4670486/bug4670486.java 8042381 macosx-all +javax/swing/JRadioButton/ButtonGroupFocus/ButtonGroupFocusTest.java 8233555 macosx-all +javax/swing/JRadioButton/8075609/bug8075609.java 8233555 macosx-all +javax/swing/JRadioButton/8033699/bug8033699.java 8233555 macosx-all +javax/swing/JPopupMenu/6827786/bug6827786.java 8233556 macosx-all +javax/swing/JPopupMenu/6544309/bug6544309.java 8233556 macosx-all +javax/swing/JPopupMenu/4634626/bug4634626.java 8233556 macosx-all +javax/swing/JPopupMenu/4458079/bug4458079.java 8233556 macosx-all +javax/swing/JMenuItem/ActionListenerCalledTwice/ActionListenerCalledTwiceTest.java 8233637 macosx-all +javax/swing/JMenuItem/8139169/ScreenMenuBarInputTwice.java 8233638 macosx-all +javax/swing/JMenuItem/6249972/bug6249972.java 8233640 macosx-all +javax/swing/JMenuItem/4171437/bug4171437.java 8233641 macosx-all +javax/swing/JMenuBar/4750590/bug4750590.java 8233642 macosx-all +javax/swing/JMenu/4692443/bug4692443.java 8171998 macosx-all +javax/swing/JMenu/4515762/bug4515762.java 8233643 macosx-all +javax/swing/JInternalFrame/8020708/bug8020708.java 8233644 macosx-all +javax/swing/JColorChooser/Test8051548.java 8233647 macosx-all +javax/swing/plaf/synth/7158712/bug7158712.java 8238720 windows-all +javax/swing/plaf/basic/BasicComboPopup/JComboBoxPopupLocation/JComboBoxPopupLocation.java 8238720 windows-all +javax/swing/plaf/basic/BasicComboPopup/7072653/bug7072653.java 8238720 windows-all +javax/swing/JTable/6263446/bug6263446.java 8238720 windows-all -sanity/client/SwingSet/src/ColorChooserDemoTest.java 8221312 generic-all -sanity/client/SwingSet/src/ToolTipDemoTest.java 8225012 windows-all +sanity/client/SwingSet/src/ToolTipDemoTest.java 8225012 windows-all,macosx-all sanity/client/SwingSet/src/ScrollPaneDemoTest.java 8225013 linux-all ############################################################################ @@ -893,6 +958,7 @@ jdk/jfr/api/recording/event/TestPeriod.java 8215890 generic-all jdk/jfr/event/io/EvilInstrument.java 8221331 generic-all jdk/jfr/event/runtime/TestNetworkUtilizationEvent.java 8228990,8229370 generic-all +jdk/jfr/event/compiler/TestCodeSweeper.java 8225209 generic-all ############################################################################ diff -Nru openjdk-13-13.0.3+3/test/jdk/sanity/client/lib/SwingSet3/src/com/sun/swingset3/demos/colorchooser/BezierAnimationPanel.java openjdk-13-13.0.4+8/test/jdk/sanity/client/lib/SwingSet3/src/com/sun/swingset3/demos/colorchooser/BezierAnimationPanel.java --- openjdk-13-13.0.3+3/test/jdk/sanity/client/lib/SwingSet3/src/com/sun/swingset3/demos/colorchooser/BezierAnimationPanel.java 2020-02-20 22:05:38.000000000 +0000 +++ openjdk-13-13.0.4+8/test/jdk/sanity/client/lib/SwingSet3/src/com/sun/swingset3/demos/colorchooser/BezierAnimationPanel.java 2020-07-07 16:55:29.000000000 +0000 @@ -28,6 +28,7 @@ import java.awt.event.HierarchyListener; import java.awt.geom.GeneralPath; import java.awt.image.BufferedImage; +import java.lang.reflect.InvocationTargetException; import java.util.Hashtable; import java.util.Map; import javax.swing.*; @@ -35,220 +36,227 @@ import static com.sun.swingset3.demos.colorchooser.BezierAnimationPanel.BezierColor.*; /** -* BezierAnimationPanel -* -* @author Jim Graham -* @author Jeff Dinkins (removed dynamic setting changes, made swing friendly) -* @version 1.16 11/17/05 -*/ + * BezierAnimationPanel + * + * @author Jim Graham + * @author Jeff Dinkins (removed dynamic setting changes, made swing friendly) + * @version 1.16 11/17/05 + */ public class BezierAnimationPanel extends JPanel implements Runnable { -public static enum BezierColor { -BACKGROUND, OUTER, GRADIENT_A, GRADIENT_B + public static enum BezierColor { + BACKGROUND, OUTER, GRADIENT_A, GRADIENT_B + } + + private final Map colors = new Hashtable(); + + private GradientPaint gradient = null; + + private static final int NUMPTS = 6; + + private final float[] animpts = new float[NUMPTS * 2]; + + private final float[] deltas = new float[NUMPTS * 2]; + + private BufferedImage img; + + private Thread anim; + + private final Object lock = new Object(); + + /** + * BezierAnimationPanel Constructor + */ + public BezierAnimationPanel() { + setOpaque(true); + + colors.put(BACKGROUND, new Color(0, 0, 153)); + colors.put(OUTER, new Color(255, 255, 255)); + colors.put(GRADIENT_A, new Color(255, 0, 101)); + colors.put(GRADIENT_B, new Color(255, 255, 0)); + + addHierarchyListener(new HierarchyListener() { + public void hierarchyChanged(HierarchyEvent e) { + if (isShowing()) { + start(); + } else { + stop(); + } + } + }); + } + + public Color getBezierColor(BezierColor bezierColor) { + return colors.get(bezierColor); + } + + public void setBezierColor(BezierColor bezierColor, Color value) { + if (value != null) { + colors.put(bezierColor, value); + } + } + + public void start() { + Dimension size = getSize(); + for (int i = 0; i < animpts.length; i += 2) { + animpts[i] = (float) (Math.random() * size.width); + animpts[i + 1] = (float) (Math.random() * size.height); + deltas[i] = (float) (Math.random() * 4.0 + 2.0); + deltas[i + 1] = (float) (Math.random() * 4.0 + 2.0); + if (animpts[i] > size.width / 6.0f) { + deltas[i] = -deltas[i]; + } + if (animpts[i + 1] > size.height / 6.0f) { + deltas[i + 1] = -deltas[i + 1]; + } + } + anim = new Thread(this); + anim.setPriority(Thread.MIN_PRIORITY); + anim.start(); + } + + public synchronized void stop() { + anim = null; + notify(); + } + + private static void animate(float[] pts, float[] deltas, int index, int limit) { + float newpt = pts[index] + deltas[index]; + if (newpt <= 0) { + newpt = -newpt; + deltas[index] = (float) (Math.random() * 3.0 + 2.0); + } else if (newpt >= (float) limit) { + newpt = 2.0f * limit - newpt; + deltas[index] = -(float) (Math.random() * 3.0 + 2.0); + } + pts[index] = newpt; + } + + public void run() { + Thread me = Thread.currentThread(); + while (getSize().width <= 0) { + try { + Thread.sleep(500); + } catch (InterruptedException e) { + return; + } + } + + Graphics2D g2d = null; + Graphics2D bufferG2D = null; + BasicStroke solid = new BasicStroke(9.0f, BasicStroke.CAP_BUTT, BasicStroke.JOIN_ROUND, 9.0f); + GeneralPath gp = new GeneralPath(GeneralPath.WIND_NON_ZERO); + int rule = AlphaComposite.SRC_OVER; + AlphaComposite opaque = AlphaComposite.SrcOver; + AlphaComposite blend = AlphaComposite.getInstance(rule, 0.9f); + AlphaComposite set = AlphaComposite.Src; + Dimension oldSize = getSize(); + Shape clippath = null; + while (anim == me) { + Dimension size = getSize(); + if (size.width != oldSize.width || size.height != oldSize.height) { + img = null; + clippath = null; + if (bufferG2D != null) { + bufferG2D.dispose(); + bufferG2D = null; + } + } + oldSize = size; + + if (img == null) { + img = (BufferedImage) createImage(size.width, size.height); + } + + if (bufferG2D == null) { + bufferG2D = img.createGraphics(); + bufferG2D.setRenderingHint(RenderingHints.KEY_RENDERING, RenderingHints.VALUE_RENDER_DEFAULT); + bufferG2D.setClip(clippath); + } + g2d = bufferG2D; + + float[] ctrlpts; + for (int i = 0; i < animpts.length; i += 2) { + animate(animpts, deltas, i, size.width); + animate(animpts, deltas, i + 1, size.height); + } + ctrlpts = animpts; + int len = ctrlpts.length; + gp.reset(); + float prevx = ctrlpts[len - 2]; + float prevy = ctrlpts[len - 1]; + float curx = ctrlpts[0]; + float cury = ctrlpts[1]; + float midx = (curx + prevx) / 2.0f; + float midy = (cury + prevy) / 2.0f; + gp.moveTo(midx, midy); + for (int i = 2; i <= ctrlpts.length; i += 2) { + float x1 = (midx + curx) / 2.0f; + float y1 = (midy + cury) / 2.0f; + prevx = curx; + prevy = cury; + if (i < ctrlpts.length) { + curx = ctrlpts[i]; + cury = ctrlpts[i + 1]; + } else { + curx = ctrlpts[0]; + cury = ctrlpts[1]; + } + midx = (curx + prevx) / 2.0f; + midy = (cury + prevy) / 2.0f; + float x2 = (prevx + midx) / 2.0f; + float y2 = (prevy + midy) / 2.0f; + gp.curveTo(x1, y1, x2, y2, midx, midy); + } + gp.closePath(); + + synchronized (lock) { + g2d.setComposite(set); + g2d.setBackground(getBezierColor(BACKGROUND)); + g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_OFF); + + // g2d.clearRect(bounds.x-5, bounds.y-5, bounds.x + bounds.width + // + 5, bounds.y + bounds.height + 5); + g2d.clearRect(0, 0, getWidth(), getHeight()); + + g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); + g2d.setColor(getBezierColor(OUTER)); + g2d.setComposite(opaque); + g2d.setStroke(solid); + g2d.draw(gp); + g2d.setPaint(gradient); + + Rectangle bounds = gp.getBounds(); + + gradient = new GradientPaint(bounds.x, bounds.y, getBezierColor(GRADIENT_A), bounds.x + bounds.width, + bounds.y + bounds.height, getBezierColor(GRADIENT_B), true); + + g2d.setComposite(blend); + g2d.fill(gp); + } + + try { + SwingUtilities.invokeAndWait(new Runnable() { + @Override + public void run() { + repaint(); + } + }); + } catch (InvocationTargetException | InterruptedException e) { + e.printStackTrace(); + } + } + if (g2d != null) { + g2d.dispose(); + } + } + + public void paint(Graphics g) { + synchronized (lock) { + Graphics2D g2d = (Graphics2D) g; + if (img != null) { + g2d.setComposite(AlphaComposite.Src); + g2d.drawImage(img, null, 0, 0); + } + } + } } - -private final Map colors = new Hashtable(); - -private GradientPaint gradient = null; - -private static final int NUMPTS = 6; - -private final float[] animpts = new float[NUMPTS * 2]; - -private final float[] deltas = new float[NUMPTS * 2]; - -private BufferedImage img; - -private Thread anim; - -private final Object lock = new Object(); - -/** -* BezierAnimationPanel Constructor -*/ -public BezierAnimationPanel() { -setOpaque(true); - -colors.put(BACKGROUND, new Color(0, 0, 153)); -colors.put(OUTER, new Color(255, 255, 255)); -colors.put(GRADIENT_A, new Color(255, 0, 101)); -colors.put(GRADIENT_B, new Color(255, 255, 0)); - -addHierarchyListener(new HierarchyListener() { -public void hierarchyChanged(HierarchyEvent e) { -if (isShowing()) { -start(); -} else { -stop(); -} -} -}); -} - -public Color getBezierColor(BezierColor bezierColor) { -return colors.get(bezierColor); -} - -public void setBezierColor(BezierColor bezierColor, Color value) { -if (value != null) { -colors.put(bezierColor, value); -} -} - -public void start() { -Dimension size = getSize(); -for (int i = 0; i < animpts.length; i += 2) { -animpts[i] = (float) (Math.random() * size.width); -animpts[i + 1] = (float) (Math.random() * size.height); -deltas[i] = (float) (Math.random() * 4.0 + 2.0); -deltas[i + 1] = (float) (Math.random() * 4.0 + 2.0); -if (animpts[i] > size.width / 6.0f) { -deltas[i] = -deltas[i]; -} -if (animpts[i + 1] > size.height / 6.0f) { -deltas[i + 1] = -deltas[i + 1]; -} -} -anim = new Thread(this); -anim.setPriority(Thread.MIN_PRIORITY); -anim.start(); -} - -public synchronized void stop() { -anim = null; -notify(); -} - -private static void animate(float[] pts, float[] deltas, int index, int limit) { -float newpt = pts[index] + deltas[index]; -if (newpt <= 0) { -newpt = -newpt; -deltas[index] = (float) (Math.random() * 3.0 + 2.0); -} else if (newpt >= (float) limit) { -newpt = 2.0f * limit - newpt; -deltas[index] = -(float) (Math.random() * 3.0 + 2.0); -} -pts[index] = newpt; -} - -public void run() { -Thread me = Thread.currentThread(); -while (getSize().width <= 0) { -try { -Thread.sleep(500); -} catch (InterruptedException e) { -return; -} -} - -Graphics2D g2d = null; -Graphics2D bufferG2D = null; -BasicStroke solid = new BasicStroke(9.0f, BasicStroke.CAP_BUTT, BasicStroke.JOIN_ROUND, 9.0f); -GeneralPath gp = new GeneralPath(GeneralPath.WIND_NON_ZERO); -int rule = AlphaComposite.SRC_OVER; -AlphaComposite opaque = AlphaComposite.SrcOver; -AlphaComposite blend = AlphaComposite.getInstance(rule, 0.9f); -AlphaComposite set = AlphaComposite.Src; -Dimension oldSize = getSize(); -Shape clippath = null; -while (anim == me) { -Dimension size = getSize(); -if (size.width != oldSize.width || size.height != oldSize.height) { -img = null; -clippath = null; -if (bufferG2D != null) { -bufferG2D.dispose(); -bufferG2D = null; -} -} -oldSize = size; - -if (img == null) { -img = (BufferedImage) createImage(size.width, size.height); -} - -if (bufferG2D == null) { -bufferG2D = img.createGraphics(); -bufferG2D.setRenderingHint(RenderingHints.KEY_RENDERING, RenderingHints.VALUE_RENDER_DEFAULT); -bufferG2D.setClip(clippath); -} -g2d = bufferG2D; - -float[] ctrlpts; -for (int i = 0; i < animpts.length; i += 2) { -animate(animpts, deltas, i, size.width); -animate(animpts, deltas, i + 1, size.height); -} -ctrlpts = animpts; -int len = ctrlpts.length; -gp.reset(); -float prevx = ctrlpts[len - 2]; -float prevy = ctrlpts[len - 1]; -float curx = ctrlpts[0]; -float cury = ctrlpts[1]; -float midx = (curx + prevx) / 2.0f; -float midy = (cury + prevy) / 2.0f; -gp.moveTo(midx, midy); -for (int i = 2; i <= ctrlpts.length; i += 2) { -float x1 = (midx + curx) / 2.0f; -float y1 = (midy + cury) / 2.0f; -prevx = curx; -prevy = cury; -if (i < ctrlpts.length) { -curx = ctrlpts[i]; -cury = ctrlpts[i + 1]; -} else { -curx = ctrlpts[0]; -cury = ctrlpts[1]; -} -midx = (curx + prevx) / 2.0f; -midy = (cury + prevy) / 2.0f; -float x2 = (prevx + midx) / 2.0f; -float y2 = (prevy + midy) / 2.0f; -gp.curveTo(x1, y1, x2, y2, midx, midy); -} -gp.closePath(); - -synchronized (lock) { -g2d.setComposite(set); -g2d.setBackground(getBezierColor(BACKGROUND)); -g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_OFF); - -// g2d.clearRect(bounds.x-5, bounds.y-5, bounds.x + bounds.width -// + 5, bounds.y + bounds.height + 5); -g2d.clearRect(0, 0, getWidth(), getHeight()); - -g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); -g2d.setColor(getBezierColor(OUTER)); -g2d.setComposite(opaque); -g2d.setStroke(solid); -g2d.draw(gp); -g2d.setPaint(gradient); - -Rectangle bounds = gp.getBounds(); - -gradient = new GradientPaint(bounds.x, bounds.y, getBezierColor(GRADIENT_A), bounds.x + bounds.width, -bounds.y + bounds.height, getBezierColor(GRADIENT_B), true); - -g2d.setComposite(blend); -g2d.fill(gp); -} - -repaint(); - -Thread.yield(); -} -if (g2d != null) { -g2d.dispose(); -} -} - -public void paint(Graphics g) { -synchronized (lock) { -Graphics2D g2d = (Graphics2D) g; -if (img != null) { -g2d.setComposite(AlphaComposite.Src); -g2d.drawImage(img, null, 0, 0); -} -} -} -} \ No newline at end of file diff -Nru openjdk-13-13.0.3+3/test/jdk/sanity/client/SwingSet/src/ColorChooserDemoTest.java openjdk-13-13.0.4+8/test/jdk/sanity/client/SwingSet/src/ColorChooserDemoTest.java --- openjdk-13-13.0.3+3/test/jdk/sanity/client/SwingSet/src/ColorChooserDemoTest.java 2020-02-20 22:05:38.000000000 +0000 +++ openjdk-13-13.0.4+8/test/jdk/sanity/client/SwingSet/src/ColorChooserDemoTest.java 2020-07-07 16:55:29.000000000 +0000 @@ -68,261 +68,262 @@ @Listeners(GuiTestListener.class) public class ColorChooserDemoTest { -private static final String OK_BUTTON_TITLE = "OK"; -private static final String CANCEL_BUTTON_TITLE = "Cancel"; -private static final String RESET_BUTTON_TITLE = "Reset"; -private static final String HSV = "HSV"; -private static final String RGB = "RGB"; -private static final String HSL = "HSL"; -private static final String CMYK = "CMYK"; -private static final int HSV_NUMBER_OF_SLIDERS_AND_SPINNERS = 4; -private static final int RGB_NUMBER_OF_SLIDERS_AND_SPINNERS = 4; -private static final int HSL_NUMBER_OF_SLIDERS_AND_SPINNERS = 4; -private static final int CMYK_NUMBER_OF_SLIDERS_AND_SPINNERS = 5; -private static final int HSV_HUE_INDEX = 0; -private static final int HSV_SATURATION_INDEX = 1; -private static final int HSV_VALUE_INDEX = 2; -private static final int HSV_TRANSPARENCY_INDEX = 3; -private static final int HSL_HUE_INDEX = 0; -private static final int HSL_SATURATION_INDEX = 1; -private static final int HSL_LIGHTNESS_INDEX = 2; -private static final int HSL_TRANSPARENCY_INDEX = 3; -private static final int RGB_RED_INDEX = 0; -private static final int RGB_GREEN_INDEX = 1; -private static final int RGB_BLUE_INDEX = 2; -private static final int RGB_ALPHA_INDEX = 3; -private static final int RGB_COLORCODE_TEXT_FIELD_INDEX = 4; -private static final int CMYK_CYAN_INDEX = 0; -private static final int CMYK_MAGENTA_INDEX = 1; -private static final int CMYK_YELLOW_INDEX = 2; -private static final int CMYK_BLACK_INDEX = 3; -private static final int CMYK_ALPHA_INDEX = 4; - -private final Color resetColor = new Color(125, 125, 125); - -private JDialogOperator colorChooserDialog; -private JButtonOperator okButton; -private JButtonOperator cancelButton; -private JButtonOperator resetButton; -private JColorChooserOperator colorChooser; -private JButtonOperator backgroundButton; -private JButtonOperator gradient1Button; -private JButtonOperator gradient2Button; -private JButtonOperator perimeterButton; -private JTabbedPaneOperator tabOperator; -private JComponentOperator bezierAnimationPanel; -private JSliderOperator[] sliders = new JSliderOperator[5]; -private JSpinnerOperator[] spinners = new JSpinnerOperator[5]; -private JButtonOperator lastFocusedButton; - -@Test -public void test() throws Exception { -new ClassReference(ColorChooserDemo.class.getCanonicalName()).startApplication(); -JFrameOperator frame = new JFrameOperator(DEMO_TITLE); -bezierAnimationPanel = new JComponentOperator(frame, new ByClassChooser(BezierAnimationPanel.class)); -initializePanelButtons(frame); -checkBackgroundColorChooser(); -checkGradient1ColorChooser(); -checkGradient2ColorChooser(); -checkPerimeterColorChooser(); + private static final String OK_BUTTON_TITLE = "OK"; + private static final String CANCEL_BUTTON_TITLE = "Cancel"; + private static final String RESET_BUTTON_TITLE = "Reset"; + private static final String HSV = "HSV"; + private static final String RGB = "RGB"; + private static final String HSL = "HSL"; + private static final String CMYK = "CMYK"; + private static final int HSV_NUMBER_OF_SLIDERS_AND_SPINNERS = 4; + private static final int RGB_NUMBER_OF_SLIDERS_AND_SPINNERS = 4; + private static final int HSL_NUMBER_OF_SLIDERS_AND_SPINNERS = 4; + private static final int CMYK_NUMBER_OF_SLIDERS_AND_SPINNERS = 5; + private static final int HSV_HUE_INDEX = 0; + private static final int HSV_SATURATION_INDEX = 1; + private static final int HSV_VALUE_INDEX = 2; + private static final int HSV_TRANSPARENCY_INDEX = 3; + private static final int HSL_HUE_INDEX = 0; + private static final int HSL_SATURATION_INDEX = 1; + private static final int HSL_LIGHTNESS_INDEX = 2; + private static final int HSL_TRANSPARENCY_INDEX = 3; + private static final int RGB_RED_INDEX = 0; + private static final int RGB_GREEN_INDEX = 1; + private static final int RGB_BLUE_INDEX = 2; + private static final int RGB_ALPHA_INDEX = 3; + private static final int RGB_COLORCODE_TEXT_FIELD_INDEX = 4; + private static final int CMYK_CYAN_INDEX = 0; + private static final int CMYK_MAGENTA_INDEX = 1; + private static final int CMYK_YELLOW_INDEX = 2; + private static final int CMYK_BLACK_INDEX = 3; + private static final int CMYK_ALPHA_INDEX = 4; + + private final Color resetColor = new Color(125, 125, 125); + + private JDialogOperator colorChooserDialog; + private JButtonOperator okButton; + private JButtonOperator cancelButton; + private JButtonOperator resetButton; + private JColorChooserOperator colorChooser; + private JButtonOperator backgroundButton; + private JButtonOperator gradient1Button; + private JButtonOperator gradient2Button; + private JButtonOperator perimeterButton; + private JTabbedPaneOperator tabOperator; + private JComponentOperator bezierAnimationPanel; + private JSliderOperator[] sliders = new JSliderOperator[5]; + private JSpinnerOperator[] spinners = new JSpinnerOperator[5]; + private JButtonOperator lastFocusedButton; + + @Test + public void test() throws Exception { + new ClassReference(ColorChooserDemo.class.getCanonicalName()).startApplication(); + JFrameOperator frame = new JFrameOperator(DEMO_TITLE); + bezierAnimationPanel = new JComponentOperator(frame, new ByClassChooser(BezierAnimationPanel.class)); + initializePanelButtons(frame); + checkBackgroundColorChooser(); + checkGradient1ColorChooser(); + checkGradient2ColorChooser(); + checkPerimeterColorChooser(); + } + + private void checkBackgroundColorChooser() throws Exception { + basicCheck(backgroundButton, BezierColor.BACKGROUND); + checkAllColorChoosers(backgroundButton); + } + + private void checkGradient1ColorChooser() throws Exception { + basicCheck(gradient1Button, BezierColor.GRADIENT_A); + } + + private void checkGradient2ColorChooser() throws Exception { + basicCheck(gradient2Button, BezierColor.GRADIENT_B); + } + + private void checkPerimeterColorChooser() throws Exception { + basicCheck(perimeterButton, BezierColor.OUTER); + } + + private void pushButtonAndInitialize(JButtonOperator jbo) throws InterruptedException { + // Wait for focus to return to last focused button + lastFocusedButton.waitHasFocus(); + jbo.pushNoBlock(); + lastFocusedButton = jbo; + // Wait till the ColorChooserDemo Dialog Opens + new DialogWaiter().waitDialog(CHOOSER_TITLE, false, false); + initializeDialog(); + } + + private void initializePanelButtons(JFrameOperator frame) { + backgroundButton = new JButtonOperator(frame, BACKGROUND); + gradient1Button = new JButtonOperator(frame, GRADIENT_1); + gradient2Button = new JButtonOperator(frame, GRADIENT_2); + perimeterButton = new JButtonOperator(frame, PERIMETER); + lastFocusedButton = backgroundButton; + } + + private void initializeDialog() { + colorChooserDialog = new JDialogOperator(CHOOSER_TITLE); + tabOperator = new JTabbedPaneOperator(colorChooserDialog); + colorChooser = new JColorChooserOperator(colorChooserDialog); + okButton = new JButtonOperator(colorChooserDialog, OK_BUTTON_TITLE); + cancelButton = new JButtonOperator(colorChooserDialog, CANCEL_BUTTON_TITLE); + resetButton = new JButtonOperator(colorChooserDialog, RESET_BUTTON_TITLE); + } + + private void basicCheck(JButtonOperator jbo, BezierColor bezierColor) throws Exception { + Color testColor = new Color(100, 26, 155); + Color testColor2 = new Color(10, 40, 50); + checkDefaultColorChooser(jbo, testColor, bezierColor); + checkCancelButton(jbo, testColor2); + checkResetButton(jbo, testColor2); + } + + private void checkDefaultColorChooser(JButtonOperator jbo, Color testColor, BezierColor bezierColor) + throws Exception { + BezierAnimationPanel bezierPanel; + pushButtonAndInitialize(jbo); + // Check ColorChooser color is being set and used accordingly + // in the animation panel + setAndWaitColor(testColor); + pushButtonAndWaitDialogClosed(okButton); + bezierPanel = (BezierAnimationPanel) bezierAnimationPanel.getSource(); + colorChooser.waitStateOnQueue(jColorChooser -> (bezierPanel.getBezierColor(bezierColor).equals(testColor))); + } + + private void checkCancelButton(JButtonOperator jbo, Color testColor) throws Exception { + pushButtonAndInitialize(jbo); + setAndWaitColor(testColor); + pushButtonAndWaitDialogClosed(cancelButton); + } + + private void checkResetButton(JButtonOperator jbo, Color testColor) throws Exception { + pushButtonAndInitialize(jbo); + Color initialColor = colorChooser.getColor(); + setAndWaitColor(testColor); + resetButton.push(); + waitJColorChooserColor(initialColor); + pushButtonAndWaitDialogClosed(okButton); + } + + private void checkAllColorChoosers(JButtonOperator jbo) throws Exception { + pushButtonAndInitialize(jbo); + checkHSV(); + checkHSL(); + checkRGB(); + checkCMYK(); + pushButtonAndWaitDialogClosed(okButton); + } + + private void waitJColorChooserColor(Color expectedColor) { + colorChooser.waitStateOnQueue(jColorChooser -> colorChooser.getColor().equals(expectedColor)); + } + + private void setAndWaitColor(Color color) { + colorChooser.setColor(color); + // Wait for the Color to be set + waitJColorChooserColor(color); + } + + private void resetColor() { + colorChooser.setColor(resetColor); + // Wait for the Color to be reset + waitJColorChooserColor(resetColor); + } + + private void checkHSV() { + tabOperator.selectPage(HSV); + initializeSliderAndSpinner(HSV_NUMBER_OF_SLIDERS_AND_SPINNERS); + resetColor(); + setAndCheckSlider(sliders[HSV_SATURATION_INDEX], 50, new Color(125, 62, 62)); + setAndCheckSlider(sliders[HSV_VALUE_INDEX], 80, new Color(204, 102, 102)); + setAndCheckSlider(sliders[HSV_HUE_INDEX], 50, new Color(204, 187, 102)); + setAndCheckSlider(sliders[HSV_TRANSPARENCY_INDEX], 50, new Color(204, 187, 102, 127)); + setAndCheckSpinner(spinners[HSV_SATURATION_INDEX], 25, new Color(204, 195, 153, 127)); + setAndCheckSpinner(spinners[HSV_VALUE_INDEX], 40, new Color(102, 97, 76, 127)); + setAndCheckSpinner(spinners[HSV_HUE_INDEX], 25, new Color(102, 87, 76, 127)); + setAndCheckSpinner(spinners[HSV_TRANSPARENCY_INDEX], 100, new Color(102, 87, 76, 0)); + } + + private void checkHSL() { + tabOperator.selectPage(HSL); + initializeSliderAndSpinner(HSL_NUMBER_OF_SLIDERS_AND_SPINNERS); + resetColor(); + setAndCheckSlider(sliders[HSL_SATURATION_INDEX], 50, new Color(187, 62, 62)); + setAndCheckSlider(sliders[HSL_LIGHTNESS_INDEX], 80, new Color(229, 178, 178)); + setAndCheckSlider(sliders[HSL_HUE_INDEX], 180, new Color(178, 229, 229)); + setAndCheckSlider(sliders[HSL_TRANSPARENCY_INDEX], 50, new Color(178, 229, 229, 127)); + setAndCheckSpinner(spinners[HSL_SATURATION_INDEX], 25, new Color(191, 216, 216, 127)); + setAndCheckSpinner(spinners[HSL_LIGHTNESS_INDEX], 40, new Color(76, 127, 127, 127)); + setAndCheckSpinner(spinners[HSL_HUE_INDEX], 25, new Color(127, 97, 76, 127)); + setAndCheckSpinner(spinners[HSL_TRANSPARENCY_INDEX], 50, new Color(127, 97, 76, 127)); + } + + private void checkRGB() { + String sampleColor = "111111"; + tabOperator.selectPage(RGB); + initializeSliderAndSpinner(RGB_NUMBER_OF_SLIDERS_AND_SPINNERS); + JTextFieldOperator colorCode = new JTextFieldOperator(colorChooserDialog, RGB_COLORCODE_TEXT_FIELD_INDEX); + resetColor(); + setAndCheckSlider(sliders[RGB_GREEN_INDEX], 50, new Color(125, 50, 125, 255)); + setAndCheckSlider(sliders[RGB_BLUE_INDEX], 80, new Color(125, 50, 80, 255)); + setAndCheckSlider(sliders[RGB_RED_INDEX], 50, new Color(50, 50, 80, 255)); + setAndCheckSlider(sliders[RGB_ALPHA_INDEX], 125, new Color(50, 50, 80, 125)); + setAndCheckSpinner(spinners[RGB_GREEN_INDEX], 25, new Color(50, 25, 80, 125)); + setAndCheckSpinner(spinners[RGB_BLUE_INDEX], 40, new Color(50, 25, 40, 125)); + setAndCheckSpinner(spinners[RGB_RED_INDEX], 25, new Color(25, 25, 40, 125)); + setAndCheckSpinner(spinners[RGB_ALPHA_INDEX], 255, new Color(25, 25, 40, 255)); + + colorCode.setText(sampleColor); + // Wait for the sampleColor to be set in the color code text field. + colorCode.waitText(sampleColor); + colorCode.getFocus(); + colorCode.pressKey(KeyEvent.VK_TAB); + // Wait for the color to be set + waitJColorChooserColor(new Color(17, 17, 17, 255)); + } + + private void checkCMYK() { + tabOperator.selectPage(CMYK); + initializeSliderAndSpinner(CMYK_NUMBER_OF_SLIDERS_AND_SPINNERS); + resetColor(); + setAndCheckSlider(sliders[CMYK_MAGENTA_INDEX], 50, new Color(125, 100, 125, 255)); + setAndCheckSlider(sliders[CMYK_YELLOW_INDEX], 80, new Color(125, 100, 85, 255)); + setAndCheckSlider(sliders[CMYK_CYAN_INDEX], 50, new Color(100, 100, 85, 255)); + setAndCheckSlider(sliders[CMYK_BLACK_INDEX], 50, new Color(164, 164, 140, 255)); + setAndCheckSlider(sliders[CMYK_ALPHA_INDEX], 125, new Color(164, 164, 140, 125)); + setAndCheckSpinner(spinners[CMYK_MAGENTA_INDEX], 25, new Color(164, 184, 140, 125)); + setAndCheckSpinner(spinners[CMYK_YELLOW_INDEX], 40, new Color(164, 184, 172, 125)); + setAndCheckSpinner(spinners[CMYK_CYAN_INDEX], 25, new Color(184, 184, 172, 125)); + setAndCheckSpinner(spinners[CMYK_BLACK_INDEX], 100, new Color(139, 139, 130, 125)); + setAndCheckSpinner(spinners[CMYK_ALPHA_INDEX], 255, new Color(139, 139, 130, 255)); + } + + private void setAndCheckSlider(JSliderOperator slider, int sliderValue, Color expectedColor) { + slider.setValue(sliderValue); + // Wait for slider to attain the specified value + slider.waitStateOnQueue(jSlider -> slider.getValue() == sliderValue); + colorChooser.waitStateOnQueue(jColorChooser -> (colorChooser.getColor().equals(expectedColor))); + } + + private void setAndCheckSpinner(JSpinnerOperator spinner, int spinnerValue, Color expectedColor) { + spinner.setValue(spinnerValue); + // Wait for spinner to attain the specified value + spinner.waitStateOnQueue(jSpinner -> (int) spinner.getValue() == spinnerValue); + colorChooser.waitStateOnQueue(jColorChooser -> (colorChooser.getColor().equals(expectedColor))); + } + + private void initializeSliderAndSpinner(int numberOfSlidersAndSpinners) { + for (int i = 0; i < numberOfSlidersAndSpinners; i++) { + sliders[i] = new JSliderOperator(colorChooserDialog, i); + spinners[i] = new JSpinnerOperator(colorChooserDialog, i); + } + } + + private void pushButtonAndWaitDialogClosed(JButtonOperator button) { + button.push(); + // Wait for the color chooser dialog to close. + colorChooserDialog.waitClosed(); + } } -private void checkBackgroundColorChooser() throws Exception { -basicCheck(backgroundButton, BezierColor.BACKGROUND); -checkAllColorChoosers(backgroundButton); -} - -private void checkGradient1ColorChooser() throws Exception { -basicCheck(gradient1Button, BezierColor.GRADIENT_A); -} - -private void checkGradient2ColorChooser() throws Exception { -basicCheck(gradient2Button, BezierColor.GRADIENT_B); -} - -private void checkPerimeterColorChooser() throws Exception { -basicCheck(perimeterButton, BezierColor.OUTER); -} - -private void pushButtonAndInitialize(JButtonOperator jbo) throws InterruptedException { -// Wait for focus to return to last focused button -lastFocusedButton.waitHasFocus(); -jbo.pushNoBlock(); -lastFocusedButton = jbo; -// Wait till the ColorChooserDemo Dialog Opens -new DialogWaiter().waitDialog(CHOOSER_TITLE, false, false); -initializeDialog(); -} - -private void initializePanelButtons(JFrameOperator frame) { -backgroundButton = new JButtonOperator(frame, BACKGROUND); -gradient1Button = new JButtonOperator(frame, GRADIENT_1); -gradient2Button = new JButtonOperator(frame, GRADIENT_2); -perimeterButton = new JButtonOperator(frame, PERIMETER); -lastFocusedButton = backgroundButton; -} - -private void initializeDialog() { -colorChooserDialog = new JDialogOperator(CHOOSER_TITLE); -tabOperator = new JTabbedPaneOperator(colorChooserDialog); -colorChooser = new JColorChooserOperator(colorChooserDialog); -okButton = new JButtonOperator(colorChooserDialog, OK_BUTTON_TITLE); -cancelButton = new JButtonOperator(colorChooserDialog, CANCEL_BUTTON_TITLE); -resetButton = new JButtonOperator(colorChooserDialog, RESET_BUTTON_TITLE); -} - -private void basicCheck(JButtonOperator jbo, BezierColor bezierColor) throws Exception { -Color testColor = new Color(100, 26, 155); -Color testColor2 = new Color(10, 40, 50); -checkDefaultColorChooser(jbo, testColor, bezierColor); -checkCancelButton(jbo, testColor2); -checkResetButton(jbo, testColor2); -} - -private void checkDefaultColorChooser(JButtonOperator jbo, Color testColor, BezierColor bezierColor) -throws Exception { -BezierAnimationPanel bezierPanel; -pushButtonAndInitialize(jbo); -// Check ColorChooser color is being set and used accordingly -// in the animation panel -setAndWaitColor(testColor); -pushButtonAndWaitDialogClosed(okButton); -bezierPanel = (BezierAnimationPanel) bezierAnimationPanel.getSource(); -colorChooser.waitStateOnQueue(jColorChooser -> (bezierPanel.getBezierColor(bezierColor).equals(testColor))); -} - -private void checkCancelButton(JButtonOperator jbo, Color testColor) throws Exception { -pushButtonAndInitialize(jbo); -setAndWaitColor(testColor); -pushButtonAndWaitDialogClosed(cancelButton); -} - -private void checkResetButton(JButtonOperator jbo, Color testColor) throws Exception { -pushButtonAndInitialize(jbo); -Color initialColor = colorChooser.getColor(); -setAndWaitColor(testColor); -resetButton.push(); -waitJColorChooserColor(initialColor); -pushButtonAndWaitDialogClosed(okButton); -} - -private void checkAllColorChoosers(JButtonOperator jbo) throws Exception { -pushButtonAndInitialize(jbo); -checkHSV(); -checkHSL(); -checkRGB(); -checkCMYK(); -pushButtonAndWaitDialogClosed(okButton); -} - -private void waitJColorChooserColor(Color expectedColor) { -colorChooser.waitStateOnQueue(jColorChooser -> colorChooser.getColor().equals(expectedColor)); -} - -private void setAndWaitColor(Color color) { -colorChooser.setColor(color); -// Wait for the Color to be set -waitJColorChooserColor(color); -} - -private void resetColor() { -colorChooser.setColor(resetColor); -// Wait for the Color to be reset -waitJColorChooserColor(resetColor); -} - -private void checkHSV() { -tabOperator.selectPage(HSV); -initializeSliderAndSpinner(HSV_NUMBER_OF_SLIDERS_AND_SPINNERS); -resetColor(); -setAndCheckSlider(sliders[HSV_SATURATION_INDEX], 50, new Color(125, 62, 62)); -setAndCheckSlider(sliders[HSV_VALUE_INDEX], 80, new Color(204, 102, 102)); -setAndCheckSlider(sliders[HSV_HUE_INDEX], 50, new Color(204, 187, 102)); -setAndCheckSlider(sliders[HSV_TRANSPARENCY_INDEX], 50, new Color(204, 187, 102, 127)); -setAndCheckSpinner(spinners[HSV_SATURATION_INDEX], 25, new Color(204, 195, 153, 127)); -setAndCheckSpinner(spinners[HSV_VALUE_INDEX], 40, new Color(102, 97, 76, 127)); -setAndCheckSpinner(spinners[HSV_HUE_INDEX], 25, new Color(102, 87, 76, 127)); -setAndCheckSpinner(spinners[HSV_TRANSPARENCY_INDEX], 100, new Color(102, 87, 76, 0)); -} - -private void checkHSL() { -tabOperator.selectPage(HSL); -initializeSliderAndSpinner(HSL_NUMBER_OF_SLIDERS_AND_SPINNERS); -resetColor(); -setAndCheckSlider(sliders[HSL_SATURATION_INDEX], 50, new Color(187, 62, 62)); -setAndCheckSlider(sliders[HSL_LIGHTNESS_INDEX], 80, new Color(229, 178, 178)); -setAndCheckSlider(sliders[HSL_HUE_INDEX], 180, new Color(178, 229, 229)); -setAndCheckSlider(sliders[HSL_TRANSPARENCY_INDEX], 50, new Color(178, 229, 229, 127)); -setAndCheckSpinner(spinners[HSL_SATURATION_INDEX], 25, new Color(191, 216, 216, 127)); -setAndCheckSpinner(spinners[HSL_LIGHTNESS_INDEX], 40, new Color(76, 127, 127, 127)); -setAndCheckSpinner(spinners[HSL_HUE_INDEX], 25, new Color(127, 97, 76, 127)); -setAndCheckSpinner(spinners[HSL_TRANSPARENCY_INDEX], 50, new Color(127, 97, 76, 127)); -} - -private void checkRGB() { -String sampleColor = "111111"; -tabOperator.selectPage(RGB); -initializeSliderAndSpinner(RGB_NUMBER_OF_SLIDERS_AND_SPINNERS); -JTextFieldOperator colorCode = new JTextFieldOperator(colorChooserDialog, RGB_COLORCODE_TEXT_FIELD_INDEX); -resetColor(); -setAndCheckSlider(sliders[RGB_GREEN_INDEX], 50, new Color(125, 50, 125, 255)); -setAndCheckSlider(sliders[RGB_BLUE_INDEX], 80, new Color(125, 50, 80, 255)); -setAndCheckSlider(sliders[RGB_RED_INDEX], 50, new Color(50, 50, 80, 255)); -setAndCheckSlider(sliders[RGB_ALPHA_INDEX], 125, new Color(50, 50, 80, 125)); -setAndCheckSpinner(spinners[RGB_GREEN_INDEX], 25, new Color(50, 25, 80, 125)); -setAndCheckSpinner(spinners[RGB_BLUE_INDEX], 40, new Color(50, 25, 40, 125)); -setAndCheckSpinner(spinners[RGB_RED_INDEX], 25, new Color(25, 25, 40, 125)); -setAndCheckSpinner(spinners[RGB_ALPHA_INDEX], 255, new Color(25, 25, 40, 255)); - -colorCode.setText(sampleColor); -// Wait for the sampleColor to be set in the color code text field. -colorCode.waitText(sampleColor); -colorCode.getFocus(); -colorCode.pressKey(KeyEvent.VK_TAB); -// Wait for the color to be set -waitJColorChooserColor(new Color(17, 17, 17, 255)); -} - -private void checkCMYK() { -tabOperator.selectPage(CMYK); -initializeSliderAndSpinner(CMYK_NUMBER_OF_SLIDERS_AND_SPINNERS); -resetColor(); -setAndCheckSlider(sliders[CMYK_MAGENTA_INDEX], 50, new Color(125, 100, 125, 255)); -setAndCheckSlider(sliders[CMYK_YELLOW_INDEX], 80, new Color(125, 100, 85, 255)); -setAndCheckSlider(sliders[CMYK_CYAN_INDEX], 50, new Color(100, 100, 85, 255)); -setAndCheckSlider(sliders[CMYK_BLACK_INDEX], 50, new Color(164, 164, 140, 255)); -setAndCheckSlider(sliders[CMYK_ALPHA_INDEX], 125, new Color(164, 164, 140, 125)); -setAndCheckSpinner(spinners[CMYK_MAGENTA_INDEX], 25, new Color(164, 184, 140, 125)); -setAndCheckSpinner(spinners[CMYK_YELLOW_INDEX], 40, new Color(164, 184, 172, 125)); -setAndCheckSpinner(spinners[CMYK_CYAN_INDEX], 25, new Color(184, 184, 172, 125)); -setAndCheckSpinner(spinners[CMYK_BLACK_INDEX], 100, new Color(139, 139, 130, 125)); -setAndCheckSpinner(spinners[CMYK_ALPHA_INDEX], 255, new Color(139, 139, 130, 255)); -} - -private void setAndCheckSlider(JSliderOperator slider, int sliderValue, Color expectedColor) { -slider.setValue(sliderValue); -// Wait for slider to attain the specified value -slider.waitStateOnQueue(jSlider -> slider.getValue() == sliderValue); -colorChooser.waitStateOnQueue(jColorChooser -> (colorChooser.getColor().equals(expectedColor))); -} - -private void setAndCheckSpinner(JSpinnerOperator spinner, int spinnerValue, Color expectedColor) { -spinner.setValue(spinnerValue); -// Wait for spinner to attain the specified value -spinner.waitStateOnQueue(jSpinner -> (int) spinner.getValue() == spinnerValue); -colorChooser.waitStateOnQueue(jColorChooser -> (colorChooser.getColor().equals(expectedColor))); -} - -private void initializeSliderAndSpinner(int numberOfSlidersAndSpinners) { -for (int i = 0; i < numberOfSlidersAndSpinners; i++) { -sliders[i] = new JSliderOperator(colorChooserDialog, i); -spinners[i] = new JSpinnerOperator(colorChooserDialog, i); -} -} - -private void pushButtonAndWaitDialogClosed(JButtonOperator button) { -button.push(); -// Wait for the color chooser dialog to close. -colorChooserDialog.waitClosed(); -} -} diff -Nru openjdk-13-13.0.3+3/test/jdk/security/infra/java/security/cert/CertPathValidator/certification/ValidatePathWithParams.java openjdk-13-13.0.4+8/test/jdk/security/infra/java/security/cert/CertPathValidator/certification/ValidatePathWithParams.java --- openjdk-13-13.0.3+3/test/jdk/security/infra/java/security/cert/CertPathValidator/certification/ValidatePathWithParams.java 2020-02-20 22:05:38.000000000 +0000 +++ openjdk-13-13.0.4+8/test/jdk/security/infra/java/security/cert/CertPathValidator/certification/ValidatePathWithParams.java 2020-07-07 16:55:29.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2017, 2020, 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 @@ -175,7 +175,7 @@ certStatus = Status.EXPIRED; } else { throw new RuntimeException( - "TEST FAILED: couldn't determine EE certificate status"); + "TEST FAILED: couldn't determine EE certificate status", cpve); } } diff -Nru openjdk-13-13.0.3+3/test/jdk/sun/awt/dnd/8024061/bug8024061.java openjdk-13-13.0.4+8/test/jdk/sun/awt/dnd/8024061/bug8024061.java --- openjdk-13-13.0.3+3/test/jdk/sun/awt/dnd/8024061/bug8024061.java 2020-02-20 22:05:38.000000000 +0000 +++ openjdk-13-13.0.4+8/test/jdk/sun/awt/dnd/8024061/bug8024061.java 2020-07-07 16:55:29.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2020, 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,11 +27,17 @@ * @bug 8024061 * @summary Checks that no exception is thrown if dragGestureRecognized * takes a while to complete. - * @library /test/lib - * @build jdk.test.lib.Platform - * @run main bug8024061 */ -import java.awt.*; + +import java.awt.AWTException; +import java.awt.Color; +import java.awt.Container; +import java.awt.Dimension; +import java.awt.Graphics; +import java.awt.Graphics2D; +import java.awt.GridLayout; +import java.awt.Point; +import java.awt.Robot; import java.awt.datatransfer.DataFlavor; import java.awt.datatransfer.Transferable; import java.awt.datatransfer.UnsupportedFlavorException; @@ -49,15 +55,15 @@ import java.awt.dnd.DropTargetEvent; import java.awt.dnd.DropTargetListener; import java.awt.event.InputEvent; - import java.io.IOException; import java.lang.reflect.InvocationTargetException; import java.util.concurrent.CountDownLatch; import java.util.concurrent.TimeUnit; -import javax.swing.*; - -import jdk.test.lib.Platform; +import javax.swing.JFrame; +import javax.swing.JPanel; +import javax.swing.SwingUtilities; +import javax.swing.WindowConstants; /** * If dragGestureRecognized() takes a while to complete and if user performs a drag quickly, @@ -107,19 +113,13 @@ content.add(panel2); frame.pack(); - + frame.setLocationRelativeTo(null); DropObject drop = new DropObject(); drop.place(panel1, new Point(10, 10)); frame.setVisible(true); } public static void main(String[] args) throws AWTException, InvocationTargetException, InterruptedException { - if (!Platform.isLinux() && !Platform.isSolaris()) { - System.out.println("This test is for Linux and Solaris only... " + - "skipping!"); - return; - } - final bug8024061[] dnd = {null}; SwingUtilities.invokeAndWait(new Runnable() { @Override @@ -166,7 +166,7 @@ throw new RuntimeException("Timed out waiting for dragEnter()"); } } finally { - SwingUtilities.invokeLater(frame::dispose); + SwingUtilities.invokeAndWait(frame::dispose); } } diff -Nru openjdk-13-13.0.3+3/test/jdk/sun/java2d/GdiRendering/InsetClipping.java openjdk-13-13.0.4+8/test/jdk/sun/java2d/GdiRendering/InsetClipping.java --- openjdk-13-13.0.3+3/test/jdk/sun/java2d/GdiRendering/InsetClipping.java 2020-02-20 22:05:38.000000000 +0000 +++ openjdk-13-13.0.4+8/test/jdk/sun/java2d/GdiRendering/InsetClipping.java 2020-07-07 16:55:29.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2020, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -30,7 +30,7 @@ * clip shape. This was a problem with our GDI renderer on Windows, where * we would ignore the window insets. * @run main InsetClipping -*/ + */ /** * This test works by setting up a clip area that equals the visible area @@ -43,10 +43,15 @@ * test fails. */ -import java.awt.*; -import java.awt.geom.*; -import java.awt.image.*; - +import java.awt.Color; +import java.awt.Frame; +import java.awt.Graphics; +import java.awt.Insets; +import java.awt.Point; +import java.awt.Rectangle; +import java.awt.Robot; +import java.awt.geom.Area; +import java.awt.image.BufferedImage; public class InsetClipping extends Frame { BufferedImage image; @@ -79,6 +84,7 @@ public static void main(String args[]) { InsetClipping clipTest = new InsetClipping(); clipTest.setSize(300, 300); + clipTest.setLocationRelativeTo(null); clipTest.setVisible(true); while (!painted) { try { @@ -102,12 +108,12 @@ try { Thread.sleep(2000); } catch (Exception e) {} - int pixelVal = clientPixels.getRGB(0, 0); + int pixelVal = clientPixels.getRGB(2, 2); clipTest.dispose(); if ((new Color(pixelVal)).equals(fillColor)) { System.out.println("Passed"); } else { - throw new Error("Failed: incorrect color in pixel (0, 0)"); + throw new Error("Failed: incorrect color in pixel (2, 2)"); } } catch (Exception e) { System.out.println("Problems creating Robot"); diff -Nru openjdk-13-13.0.3+3/test/jdk/sun/misc/SunMiscSignalTest.java openjdk-13-13.0.4+8/test/jdk/sun/misc/SunMiscSignalTest.java --- openjdk-13-13.0.3+3/test/jdk/sun/misc/SunMiscSignalTest.java 2020-02-20 22:05:38.000000000 +0000 +++ openjdk-13-13.0.4+8/test/jdk/sun/misc/SunMiscSignalTest.java 2020-07-07 16:55:29.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 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 @@ -133,10 +133,12 @@ Object[][] posixNonOSXSignals = { {"BUS", IsSupported.YES, CanRegister.YES, CanRaise.YES, invokedXrs}, + {"INFO", IsSupported.NO, CanRegister.NO, CanRaise.NO, Invoked.NO}, }; Object[][] posixOSXSignals = { {"BUS", IsSupported.YES, CanRegister.NO, CanRaise.NO, Invoked.NO}, + {"INFO", IsSupported.YES, CanRegister.YES, CanRaise.YES, invokedXrs}, }; Object[][] windowsSignals = { diff -Nru openjdk-13-13.0.3+3/test/jdk/sun/net/www/ftptest/FtpCommandHandler.java openjdk-13-13.0.4+8/test/jdk/sun/net/www/ftptest/FtpCommandHandler.java --- openjdk-13-13.0.3+3/test/jdk/sun/net/www/ftptest/FtpCommandHandler.java 2020-02-20 22:05:38.000000000 +0000 +++ openjdk-13-13.0.4+8/test/jdk/sun/net/www/ftptest/FtpCommandHandler.java 2020-07-07 16:55:29.000000000 +0000 @@ -466,6 +466,10 @@ try { str = in.readLine(); System.out.println("line: " + str); + if (str == null) { + System.out.println("EOF read from input"); + break; + } buf = new StringBuffer(str); res = parseCmd(buf); switch (res) { diff -Nru openjdk-13-13.0.3+3/test/jdk/sun/nio/cs/CheckHistoricalNames.java openjdk-13-13.0.4+8/test/jdk/sun/nio/cs/CheckHistoricalNames.java --- openjdk-13-13.0.3+3/test/jdk/sun/nio/cs/CheckHistoricalNames.java 2020-02-20 22:05:38.000000000 +0000 +++ openjdk-13-13.0.4+8/test/jdk/sun/nio/cs/CheckHistoricalNames.java 2020-07-07 16:55:29.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2008, 2020, 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,12 +22,14 @@ */ /* @test - * @bug 4513767 4961027 6217210 + * @bug 4513767 4961027 6217210 8242541 * @summary Checks canonical names match between old and (NIO) core charsets * @modules jdk.charsets */ import java.io.InputStreamReader; import java.io.IOException; +import java.nio.charset.Charset; +import java.nio.charset.UnsupportedCharsetException; public class CheckHistoricalNames { static int failed = 0; @@ -294,6 +296,7 @@ checkMappedName("x-MacThai", "MacThai"); checkMappedName("x-MacTurkish", "MacTurkish"); checkMappedName("x-MacUkraine", "MacUkraine"); + checkCharsetAndHistoricalName(); if (failed != 0) throw new Exception("Test Failed: " + failed); @@ -315,4 +318,24 @@ failed++; } } + + private static void checkCharsetAndHistoricalName() { + for (Charset cs : Charset.availableCharsets().values()) { + InputStreamReader isr = new InputStreamReader(System.in, cs); + String encoding = isr.getEncoding(); + try { + Charset csHist = Charset.forName(encoding); + if (!cs.equals(csHist)) { + System.out.println("Failed charset name" + + " - expected " + cs.name() + + ", got " + csHist.name()); + failed++; + } + } catch (UnsupportedCharsetException uce) { + System.out.println("Failed : charset - " + cs.name() + + ", missing alias entry - " + encoding); + failed++; + } + } + } } diff -Nru openjdk-13-13.0.3+3/test/jdk/sun/nio/cs/TestIBMBugs.java openjdk-13-13.0.4+8/test/jdk/sun/nio/cs/TestIBMBugs.java --- openjdk-13-13.0.3+3/test/jdk/sun/nio/cs/TestIBMBugs.java 2020-02-20 22:05:38.000000000 +0000 +++ openjdk-13-13.0.4+8/test/jdk/sun/nio/cs/TestIBMBugs.java 2020-07-07 16:55:29.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2008, 2020, 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,8 @@ */ /* @test - * @bug 6371437 6371422 6371416 6371619 5058184 6371431 6639450 6569191 6577466 8212794 8220281 + * @bug 6371437 6371422 6371416 6371619 5058184 6371431 6639450 6569191 6577466 + * 8212794 8220281 8235834 * @summary Check if the problems reported in above bugs have been fixed * @modules jdk.charsets */ @@ -323,6 +324,64 @@ } } + // Following test data is for 8235834 + private static final byte[] byteIBM943c2b = new byte[] { + (byte)0x81, (byte)0x5C, (byte)0x81, (byte)0x60, + (byte)0x81, (byte)0x61, (byte)0x81, (byte)0x7C, + (byte)0x88, (byte)0xA0, (byte)0x89, (byte)0x8B, + (byte)0x89, (byte)0xA8, (byte)0x8A, (byte)0x9A, + (byte)0x8B, (byte)0xA0, (byte)0x8B, (byte)0xEB, + (byte)0x8C, (byte)0x71, (byte)0x8C, (byte)0x74, + (byte)0x8C, (byte)0xB2, (byte)0x8D, (byte)0x8D, + (byte)0x8D, (byte)0xF2, (byte)0x8E, (byte)0xC6, + (byte)0x8F, (byte)0x4A, (byte)0x8F, (byte)0xD3, + (byte)0x8F, (byte)0xDD, (byte)0x90, (byte)0xE4, + (byte)0x91, (byte)0x7E, (byte)0x91, (byte)0x89, + (byte)0x91, (byte)0xCB, (byte)0x92, (byte)0x5C, + (byte)0x92, (byte)0xCD, (byte)0x93, (byte)0x55, + (byte)0x93, (byte)0x5E, (byte)0x93, (byte)0x98, + (byte)0x93, (byte)0xC0, (byte)0x94, (byte)0x58, + (byte)0x94, (byte)0x8D, (byte)0x94, (byte)0xAC, + (byte)0x94, (byte)0xAE, (byte)0x96, (byte)0x6A, + (byte)0x96, (byte)0xCB, (byte)0x97, (byte)0x89, + (byte)0x98, (byte)0x58, (byte)0x9B, (byte)0xA0, + (byte)0x9D, (byte)0xB7, (byte)0x9E, (byte)0x94, + (byte)0xE3, (byte)0x79, (byte)0xE4, (byte)0x45, + (byte)0xE8, (byte)0xF6, (byte)0xFA, (byte)0x55, + (byte)0xFA, (byte)0x59, + }; + + private static final String strIBM943c2b1 = + "\u2015\uFF5E\u2225\uFF0D\u555E\u7130\u9DD7\u5699" + + "\u4FE0\u8EC0\u7E6B\u8346\u9E7C\u9EB4\u6805\u5C62" + + "\u7E61\u8523\u91AC\u87EC\u6414\u7626\u9A52\u7C1E" + + "\u6451\u5861\u985A\u79B1\u7006\u56CA\u525D\u6F51" + + "\u91B1\u9830\u9EB5\u840A\u881F\u5C5B\u6522\u688E" + + "\u7E48\u8141\u9839\uFFE4\uF86F"; + + private static final String strIBM943c2b2 = + "\u2014\u301C\u2016\u2212\u5516\u7114\u9D0E\u565B" + + "\u4FA0\u8EAF\u7E4B\u834A\u9E78\u9EB9\u67F5\u5C61" + + "\u7E4D\u848B\u91A4\u8749\u63BB\u75E9\u9A28\u7BAA" + + "\u63B4\u586B\u985B\u7977\u6D9C\u56A2\u5265\u6E8C" + + "\u9197\u982C\u9EBA\u83B1\u874B\u5C4F\u6505\u688D" + + "\u7E66\u80FC\u983D\u00A6\u2116"; + + private static void bug8235834 () throws Exception { + // 8235834 affects IBM-943 and IBM-943C encoder. + // The decoded results of the corresponding characters of IBM-943 + // and IBM-943C is the same. + for (String csName : new String[] {"x-IBM943", "x-IBM943C"}) { + Charset cs = Charset.forName(csName); + if (!Arrays.equals(byteIBM943c2b, strIBM943c2b1.getBytes(cs))) { + throw new Exception(csName+" failed to encode"); + } + if (!strIBM943c2b2.equals(new String(byteIBM943c2b, cs))) { + throw new Exception(csName+" failed to round-trip conversion"); + } + } + } + public static void main (String[] args) throws Exception { bug6577466(); // need to be tested before any other IBM949C test case @@ -337,5 +396,6 @@ bug8212794(); bug8213618(); bug8220281(); + bug8235834(); } } diff -Nru openjdk-13-13.0.3+3/test/jdk/sun/security/lib/cacerts/VerifyCACerts.java openjdk-13-13.0.4+8/test/jdk/sun/security/lib/cacerts/VerifyCACerts.java --- openjdk-13-13.0.3+3/test/jdk/sun/security/lib/cacerts/VerifyCACerts.java 2020-02-20 22:05:38.000000000 +0000 +++ openjdk-13-13.0.4+8/test/jdk/sun/security/lib/cacerts/VerifyCACerts.java 2020-07-07 16:55:29.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2017, 2020, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -26,7 +26,7 @@ * @test * @bug 8189131 8198240 8191844 8189949 8191031 8196141 8204923 8195774 8199779 * 8209452 8209506 8210432 8195793 8216577 8222089 8222133 8222137 8222136 - * 8223499 8225392 8232019 8234245 8233223 + * 8223499 8225392 8232019 8234245 8233223 8225068 8225069 * @summary Check root CA entries in cacerts file */ import java.io.ByteArrayInputStream; @@ -52,12 +52,12 @@ + File.separator + "security" + File.separator + "cacerts"; // The numbers of certs now. - private static final int COUNT = 93; + private static final int COUNT = 91; // SHA-256 of cacerts, can be generated with // shasum -a 256 cacerts | sed -e 's/../&:/g' | tr '[:lower:]' '[:upper:]' | cut -c1-95 private static final String CHECKSUM - = "22:AA:EB:89:4E:A4:EA:25:CA:3E:DA:0F:F1:2B:FA:05:4B:68:C5:E1:3A:F9:03:40:BF:EF:F5:13:7C:CE:BC:60"; + = "60:EF:3A:F8:44:CF:79:6F:A3:55:AD:3A:80:61:A7:EE:69:2A:B4:E4:F4:01:C4:47:FF:F8:25:1E:AB:87:31:F2"; // map of cert alias to SHA-256 fingerprint @SuppressWarnings("serial") @@ -93,8 +93,6 @@ "4F:F4:60:D5:4B:9C:86:DA:BF:BC:FC:57:12:E0:40:0D:2B:ED:3F:BC:4D:4F:BD:AA:86:E0:6A:DC:D2:A9:AD:7A"); put("utnuserfirstobjectca [jdk]", "6F:FF:78:E4:00:A7:0C:11:01:1C:D8:59:77:C4:59:FB:5A:F9:6A:3D:F0:54:08:20:D0:F4:B8:60:78:75:E5:8F"); - put("addtrustclass1ca [jdk]", - "8C:72:09:27:9A:C0:4E:27:5E:16:D0:7F:D3:B7:75:E8:01:54:B5:96:80:46:E3:1F:52:DD:25:76:63:24:E9:A7"); put("addtrustexternalca [jdk]", "68:7F:A4:51:38:22:78:FF:F0:C8:B1:1F:8D:43:D5:76:67:1C:6E:B2:BC:EA:B4:13:FB:83:D9:65:D0:6D:2F:F2"); put("addtrustqualifiedca [jdk]", @@ -151,8 +149,6 @@ "69:DD:D7:EA:90:BB:57:C9:3E:13:5D:C8:5E:A6:FC:D5:48:0B:60:32:39:BD:C4:54:FC:75:8B:2A:26:CF:7F:79"); put("verisignclass3g5ca [jdk]", "9A:CF:AB:7E:43:C8:D8:80:D0:6B:26:2A:94:DE:EE:E4:B4:65:99:89:C3:D0:CA:F1:9B:AF:64:05:E4:1A:B7:DF"); - put("keynectisrootca [jdk]", - "42:10:F1:99:49:9A:9A:C3:3C:8D:E0:2B:A6:DB:AA:14:40:8B:DD:8A:6E:32:46:89:C1:92:2D:06:97:15:A3:32"); put("dtrustclass3ca2 [jdk]", "49:E7:A4:42:AC:F0:EA:62:87:05:00:54:B5:25:64:B6:50:E4:F4:9E:42:E3:48:D6:AA:38:E0:39:E9:57:B1:C1"); put("dtrustclass3ca2ev [jdk]", @@ -259,6 +255,10 @@ { // Valid until: Tue Jul 09 14:40:36 EDT 2019 add("utnuserfirstobjectca [jdk]"); + // Valid until: Sat May 30 10:38:31 GMT 2020 + add("addtrustexternalca [jdk]"); + // Valid until: Sat May 30 10:44:50 GMT 2020 + add("addtrustqualifiedca [jdk]"); } }; diff -Nru openjdk-13-13.0.3+3/test/jdk/sun/security/pkcs11/PKCS11Test.java openjdk-13-13.0.4+8/test/jdk/sun/security/pkcs11/PKCS11Test.java --- openjdk-13-13.0.3+3/test/jdk/sun/security/pkcs11/PKCS11Test.java 2020-02-20 22:05:38.000000000 +0000 +++ openjdk-13-13.0.4+8/test/jdk/sun/security/pkcs11/PKCS11Test.java 2020-07-07 16:55:29.000000000 +0000 @@ -82,11 +82,11 @@ static { // hack String absBase = new File(BASE).getAbsolutePath(); - int k = absBase.indexOf(SEP + "test" + SEP + "sun" + SEP); + int k = absBase.indexOf(SEP + "test" + SEP + "jdk" + SEP); if (k < 0) k = 0; - String p1 = absBase.substring(0, k + 6); - String p2 = absBase.substring(k + 5); - CLOSED_BASE = p1 + "closed" + p2; + String p1 = absBase.substring(0, k); + String p2 = absBase.substring(k); + CLOSED_BASE = p1 + "/../closed" + p2; // set it as a system property to make it available in policy file System.setProperty("closed.base", CLOSED_BASE); diff -Nru openjdk-13-13.0.3+3/test/jdk/sun/security/ssl/HandshakeHash/HandshakeHashCloneExhaustion.java openjdk-13-13.0.4+8/test/jdk/sun/security/ssl/HandshakeHash/HandshakeHashCloneExhaustion.java --- openjdk-13-13.0.3+3/test/jdk/sun/security/ssl/HandshakeHash/HandshakeHashCloneExhaustion.java 2020-02-20 22:05:38.000000000 +0000 +++ openjdk-13-13.0.4+8/test/jdk/sun/security/ssl/HandshakeHash/HandshakeHashCloneExhaustion.java 2020-07-07 16:55:29.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 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 @@ -28,13 +28,15 @@ /* * @test - * @bug 8148421 8193683 + * @bug 8148421 8193683 8234728 * @summary Transport Layer Security (TLS) Session Hash and Extended * Master Secret Extension * @summary Increase the number of clones in the CloneableDigest * @library /javax/net/ssl/templates * @compile DigestBase.java * @run main/othervm HandshakeHashCloneExhaustion + * TLSv1.3 TLS_AES_128_GCM_SHA256 + * @run main/othervm HandshakeHashCloneExhaustion * TLSv1.2 TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256 * @run main/othervm HandshakeHashCloneExhaustion * TLSv1.1 TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA diff -Nru openjdk-13-13.0.3+3/test/jdk/sun/security/ssl/SignatureScheme/CustomizedClientSchemes.java openjdk-13-13.0.4+8/test/jdk/sun/security/ssl/SignatureScheme/CustomizedClientSchemes.java --- openjdk-13-13.0.3+3/test/jdk/sun/security/ssl/SignatureScheme/CustomizedClientSchemes.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-13-13.0.4+8/test/jdk/sun/security/ssl/SignatureScheme/CustomizedClientSchemes.java 2020-07-07 16:55:29.000000000 +0000 @@ -0,0 +1,55 @@ +/* + * Copyright (c) 2020, 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. + */ + +// +// SunJSSE does not support dynamic system properties, no way to re-use +// system properties in samevm/agentvm mode. +// + +/* + * @test + * @bug 8242141 + * @summary New System Properties to configure the default signature schemes + * @library /javax/net/ssl/templates + * @run main/othervm CustomizedClientSchemes + */ + +import javax.net.ssl.SSLException; + +public class CustomizedClientSchemes extends SSLSocketTemplate { + + public static void main(String[] args) throws Exception { + System.setProperty("jdk.tls.client.SignatureSchemes", "rsa_pkcs1_sha1"); + + try { + new CustomizedClientSchemes().run(); + throw new Exception( + "The jdk.tls.client.SignatureSchemes System Property " + + "does not work"); + } catch (SSLException e) { + // Got the expected exception. + } + } +} diff -Nru openjdk-13-13.0.3+3/test/jdk/sun/security/ssl/SignatureScheme/CustomizedServerSchemes.java openjdk-13-13.0.4+8/test/jdk/sun/security/ssl/SignatureScheme/CustomizedServerSchemes.java --- openjdk-13-13.0.3+3/test/jdk/sun/security/ssl/SignatureScheme/CustomizedServerSchemes.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-13-13.0.4+8/test/jdk/sun/security/ssl/SignatureScheme/CustomizedServerSchemes.java 2020-07-07 16:55:29.000000000 +0000 @@ -0,0 +1,55 @@ +/* + * Copyright (c) 2020, 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. + */ + +// +// SunJSSE does not support dynamic system properties, no way to re-use +// system properties in samevm/agentvm mode. +// + +/* + * @test + * @bug 8242141 + * @summary New System Properties to configure the default signature schemes + * @library /javax/net/ssl/templates + * @run main/othervm CustomizedServerSchemes + */ + +import javax.net.ssl.SSLException; + +public class CustomizedServerSchemes extends SSLSocketTemplate { + + public static void main(String[] args) throws Exception { + System.setProperty("jdk.tls.server.SignatureSchemes", "rsa_pkcs1_sha1"); + + try { + new CustomizedServerSchemes().run(); + throw new Exception( + "The jdk.tls.server.SignatureSchemes System Property " + + "does not work"); + } catch (SSLException e) { + // Got the expected exception. + } + } +} diff -Nru openjdk-13-13.0.3+3/test/jdk/sun/security/ssl/SSLContextImpl/CustomizedDTLSDefaultProtocols.java openjdk-13-13.0.4+8/test/jdk/sun/security/ssl/SSLContextImpl/CustomizedDTLSDefaultProtocols.java --- openjdk-13-13.0.3+3/test/jdk/sun/security/ssl/SSLContextImpl/CustomizedDTLSDefaultProtocols.java 2020-02-20 22:05:38.000000000 +0000 +++ openjdk-13-13.0.4+8/test/jdk/sun/security/ssl/SSLContextImpl/CustomizedDTLSDefaultProtocols.java 2020-07-07 16:55:29.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2020, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -26,6 +26,7 @@ /* * @test + * @bug 8237474 * @summary Test jdk.tls.client.protocols with DTLS * @run main/othervm -Djdk.tls.client.protocols="DTLSv1.0" * CustomizedDTLSDefaultProtocols diff -Nru openjdk-13-13.0.3+3/test/jdk/sun/security/ssl/SSLContextImpl/CustomizedDTLSServerDefaultProtocols.java openjdk-13-13.0.4+8/test/jdk/sun/security/ssl/SSLContextImpl/CustomizedDTLSServerDefaultProtocols.java --- openjdk-13-13.0.3+3/test/jdk/sun/security/ssl/SSLContextImpl/CustomizedDTLSServerDefaultProtocols.java 2020-02-20 22:05:38.000000000 +0000 +++ openjdk-13-13.0.4+8/test/jdk/sun/security/ssl/SSLContextImpl/CustomizedDTLSServerDefaultProtocols.java 2020-07-07 16:55:29.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2020, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -26,6 +26,7 @@ /* * @test + * @bug 8237474 * @summary Test jdk.tls.server.protocols with DTLS * @run main/othervm -Djdk.tls.server.protocols="DTLSv1.0" * CustomizedDTLSServerDefaultProtocols diff -Nru openjdk-13-13.0.3+3/test/jdk/sun/security/ssl/SSLContextImpl/DefaultDTLSEnabledProtocols.java openjdk-13-13.0.4+8/test/jdk/sun/security/ssl/SSLContextImpl/DefaultDTLSEnabledProtocols.java --- openjdk-13-13.0.3+3/test/jdk/sun/security/ssl/SSLContextImpl/DefaultDTLSEnabledProtocols.java 2020-02-20 22:05:38.000000000 +0000 +++ openjdk-13-13.0.4+8/test/jdk/sun/security/ssl/SSLContextImpl/DefaultDTLSEnabledProtocols.java 2020-07-07 16:55:29.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2020, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -26,6 +26,7 @@ /* * @test + * @bug 8237474 * @summary Test jdk.tls.client.protocols with DTLS * @run main/othervm DefaultDTLSEnabledProtocols */ diff -Nru openjdk-13-13.0.3+3/test/jdk/sun/security/ssl/SSLEngineImpl/EngineEnforceUseClientMode.java openjdk-13-13.0.4+8/test/jdk/sun/security/ssl/SSLEngineImpl/EngineEnforceUseClientMode.java --- openjdk-13-13.0.3+3/test/jdk/sun/security/ssl/SSLEngineImpl/EngineEnforceUseClientMode.java 2020-02-20 22:05:38.000000000 +0000 +++ openjdk-13-13.0.4+8/test/jdk/sun/security/ssl/SSLEngineImpl/EngineEnforceUseClientMode.java 2020-07-07 16:55:29.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2004, 2020, 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 @@ -28,7 +28,7 @@ /* * @test - * @bug 4980882 8207250 + * @bug 4980882 8207250 8237474 * @summary SSLEngine should enforce setUseClientMode * @run main/othervm EngineEnforceUseClientMode * @author Brad R. Wetmore @@ -89,6 +89,11 @@ ssle3 = sslc.createSSLEngine(); ssle4 = sslc.createSSLEngine(); ssle5 = sslc.createSSLEngine(); + //Check default SSLEngine role. + if (ssle5.getUseClientMode()) { + throw new RuntimeException("Expected default role to be server"); + } + } private void runTest() throws Exception { diff -Nru openjdk-13-13.0.3+3/test/jdk/sun/security/ssl/SSLSocketImpl/ClientTimeout.java openjdk-13-13.0.4+8/test/jdk/sun/security/ssl/SSLSocketImpl/ClientTimeout.java --- openjdk-13-13.0.3+3/test/jdk/sun/security/ssl/SSLSocketImpl/ClientTimeout.java 2020-02-20 22:05:38.000000000 +0000 +++ openjdk-13-13.0.4+8/test/jdk/sun/security/ssl/SSLSocketImpl/ClientTimeout.java 2020-07-07 16:55:29.000000000 +0000 @@ -26,8 +26,7 @@ /* * @test - * @bug 4836493 - * @ignore need further evaluation + * @bug 4836493 8239798 * @summary Socket timeouts for SSLSockets causes data corruption. * @run main/othervm ClientTimeout */ diff -Nru openjdk-13-13.0.3+3/test/jdk/sun/security/ssl/SSLSocketImpl/SetSoTimeout.java openjdk-13-13.0.4+8/test/jdk/sun/security/ssl/SSLSocketImpl/SetSoTimeout.java --- openjdk-13-13.0.3+3/test/jdk/sun/security/ssl/SSLSocketImpl/SetSoTimeout.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-13-13.0.4+8/test/jdk/sun/security/ssl/SSLSocketImpl/SetSoTimeout.java 2020-07-07 16:55:29.000000000 +0000 @@ -0,0 +1,252 @@ +/* + * Copyright (c) 2020, 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. + */ + +// SunJSSE does not support dynamic system properties, no way to re-use +// system properties in samevm/agentvm mode. + +/* + * @test + * @bug 8246031 + * @summary Socket timeouts for getSession. + * @run main/othervm SetSoTimeout + */ + +import java.io.*; +import java.net.*; +import java.util.*; +import java.security.*; +import javax.net.ssl.*; + +public class SetSoTimeout { + + /* + * ============================================================= + * Set the various variables needed for the tests, then + * specify what tests to run on each side. + */ + + /* + * Should we run the client or server in a separate thread? + * Both sides can throw exceptions, but do you have a preference + * as to which side should be the main thread. + */ + static boolean separateServerThread = true; + + /* + * Where do we find the keystores? + */ + static String pathToStores = "../../../../javax/net/ssl/etc"; + static String keyStoreFile = "keystore"; + static String trustStoreFile = "truststore"; + static String passwd = "passphrase"; + + /* + * Is the server ready to serve? + */ + volatile static boolean serverReady = false; + + /* + * Turn on SSL debugging? + */ + static boolean debug = false; + + + /* + * Define the server side of the test. + * + * If the server prematurely exits, serverReady will be set to true + * to avoid infinite hangs. + */ + void doServerSide() throws Exception { + SSLServerSocketFactory sslssf = + (SSLServerSocketFactory) SSLServerSocketFactory.getDefault(); + SSLServerSocket sslServerSocket = + (SSLServerSocket) sslssf.createServerSocket(serverPort); + + serverPort = sslServerSocket.getLocalPort(); + + /* + * Signal Client, we're ready for his connect. + */ + serverReady = true; + + SSLSocket sslSocket = (SSLSocket) sslServerSocket.accept(); + + //Make server busy. + Thread.sleep(500); + + sslSocket.close(); + } + + /* + * Define the client side of the test. + * + * If the server prematurely exits, serverReady will be set to true + * to avoid infinite hangs. + */ + void doClientSide() throws Exception { + boolean caught = false; + + /* + * Wait for server to get started. + */ + while (!serverReady) { + Thread.sleep(50); + } + + SSLSocketFactory sslsf = (SSLSocketFactory)SSLSocketFactory.getDefault(); + SSLSocket sslSocket = (SSLSocket)sslsf.createSocket( + InetAddress.getLocalHost(), + serverPort ); + + sslSocket.setSoTimeout(100); // The stall timeout. + + sslSocket.getSession(); + //Check connection state. + if (!sslSocket.isClosed()) { + throw new RuntimeException("Expected connection to be closed"); + } + + sslSocket.close(); + + } + + + // use any free port by default + volatile int serverPort = 0; + + volatile Exception serverException = null; + volatile Exception clientException = null; + + + public static void main(String[] args) throws Exception { + String keyFilename = + System.getProperty("test.src", "./") + "/" + pathToStores + + "/" + keyStoreFile; + String trustFilename = + System.getProperty("test.src", "./") + "/" + pathToStores + + "/" + trustStoreFile; + + System.setProperty("javax.net.ssl.keyStore", keyFilename); + System.setProperty("javax.net.ssl.keyStorePassword", passwd); + System.setProperty("javax.net.ssl.trustStore", trustFilename); + System.setProperty("javax.net.ssl.trustStorePassword", passwd); + + if (debug) + System.setProperty("javax.net.debug", "all"); + + /* + * Start the tests. + */ + new SetSoTimeout(); + } + + Thread clientThread = null; + Thread serverThread = null; + + /* + * Primary constructor, used to drive remainder of the test. + * + * Fork off the other side, then do your work. + */ + SetSoTimeout() throws Exception { + if (separateServerThread) { + startServer(true); + startClient(false); + } else { + startClient(true); + startServer(false); + } + + /* + * Wait for other side to close down. + */ + if (separateServerThread) { + serverThread.join(); + } else { + clientThread.join(); + } + + /* + * When we get here, the test is pretty much over. + * + * If the main thread excepted, that propagates back + * immediately. If the other thread threw an exception, we + * should report back. + */ + if (serverException != null) { + System.out.print("Server Exception:"); + throw serverException; + } + if (clientException != null) { + System.out.print("Client Exception:"); + throw clientException; + } + } + + void startServer(boolean newThread) throws Exception { + if (newThread) { + serverThread = new Thread() { + public void run() { + try { + doServerSide(); + } catch (Exception e) { + /* + * Our server thread just died. + * + * Release the client, if not active already... + */ + System.err.println("Server died..."); + System.err.println(e); + serverReady = true; + serverException = e; + } + } + }; + serverThread.start(); + } else { + doServerSide(); + } + } + + void startClient(boolean newThread) throws Exception { + if (newThread) { + clientThread = new Thread() { + public void run() { + try { + doClientSide(); + } catch (Exception e) { + /* + * Our client thread just died. + */ + System.err.println("Client died..."); + clientException = e; + } + } + }; + clientThread.start(); + } else { + doClientSide(); + } + } +} diff -Nru openjdk-13-13.0.3+3/test/jdk/sun/security/ssl/SSLSocketImpl/SSLExceptionForIOIssue.java openjdk-13-13.0.4+8/test/jdk/sun/security/ssl/SSLSocketImpl/SSLExceptionForIOIssue.java --- openjdk-13-13.0.3+3/test/jdk/sun/security/ssl/SSLSocketImpl/SSLExceptionForIOIssue.java 2020-02-20 22:05:38.000000000 +0000 +++ openjdk-13-13.0.4+8/test/jdk/sun/security/ssl/SSLSocketImpl/SSLExceptionForIOIssue.java 2020-07-07 16:55:29.000000000 +0000 @@ -36,7 +36,7 @@ import javax.net.ssl.*; import java.io.*; -import java.net.InetAddress; +import java.net.*; public class SSLExceptionForIOIssue implements SSLContextTemplate { @@ -139,7 +139,7 @@ } catch (SSLProtocolException | SSLHandshakeException sslhe) { clientException = sslhe; System.err.println("unexpected client exception: " + sslhe); - } catch (SSLException ssle) { + } catch (SSLException | SocketTimeoutException ssle) { // the expected exception, ignore it System.err.println("expected client exception: " + ssle); } catch (Exception e) { diff -Nru openjdk-13-13.0.3+3/test/jdk/sun/security/ssl/X509TrustManagerImpl/BasicConstraints.java openjdk-13-13.0.4+8/test/jdk/sun/security/ssl/X509TrustManagerImpl/BasicConstraints.java --- openjdk-13-13.0.3+3/test/jdk/sun/security/ssl/X509TrustManagerImpl/BasicConstraints.java 2020-02-20 22:05:38.000000000 +0000 +++ openjdk-13-13.0.4+8/test/jdk/sun/security/ssl/X509TrustManagerImpl/BasicConstraints.java 2020-07-07 16:55:29.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2018, 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,17 +35,14 @@ * @run main/othervm BasicConstraints SunX509 */ -import java.net.*; import java.util.*; import java.io.*; import javax.net.ssl.*; -import java.security.Security; import java.security.KeyStore; import java.security.KeyFactory; import java.security.cert.*; import java.security.spec.*; import java.security.interfaces.*; -import java.math.BigInteger; import java.util.Base64; @@ -70,93 +67,122 @@ // Certificate information: // Issuer: C=US, O=Java, OU=SunJSSE Test Serivce // Validity - // Not Before: May 5 02:40:50 2012 GMT - // Not After : Apr 15 02:40:50 2033 GMT + // Not Before: Dec 20 13:13:44 2019 GMT + // Not After : Dec 17 13:13:44 2029 GMT // Subject: C=US, O=Java, OU=SunJSSE Test Serivce // X509v3 Subject Key Identifier: - // DD:4E:8D:2A:11:C0:83:03:F0:AC:EB:A2:BF:F9:F2:7D:C8:69:1F:9B + // 88:A7:8D:A1:4F:85:3C:9B:32:47:88:E8:74:81:65:45:00:DE:DD:45 // X509v3 Authority Key Identifier: - // keyid:DD:4E:8D:2A:11:C0:83:03:F0:AC:EB:A2:BF:F9:F2:7D:C8:69:1F:9B - // DirName:/C=US/O=Java/OU=SunJSSE Test Serivce - // serial:00 + // keyid:88:A7:8D:A1:4F:85:3C:9B:32:47:88:E8:74:81:65:45:00:DE:DD:45 static String trusedCertStr = "-----BEGIN CERTIFICATE-----\n" + - "MIICkjCCAfugAwIBAgIBADANBgkqhkiG9w0BAQIFADA7MQswCQYDVQQGEwJVUzEN\n" + - "MAsGA1UEChMESmF2YTEdMBsGA1UECxMUU3VuSlNTRSBUZXN0IFNlcml2Y2UwHhcN\n" + - "MTIwNTA1MDI0MDUwWhcNMzMwNDE1MDI0MDUwWjA7MQswCQYDVQQGEwJVUzENMAsG\n" + - "A1UEChMESmF2YTEdMBs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IBCgKCAQEA1Cd4\n" + + "U//Y2P4vIu9BBGi+pm64YXYP2LNRNK/e5/nWWmNKJapCAYYda/FJClrbzpI/FgRU\n" + + "NLM9B4Uo065FRIrBi1vu8zyYgwT7UK0WsLwg6Z81KH50PfM0ClEx44tTqocYDc7C\n" + + "gsvbyIeTIbV9AnRlEnBA15WFJAJMTCglaNleXUZ9+A/tazRhHlsRp0Ob8j4tCMJa\n" + + "RDpGMYTy1XbG+WqC8wXP63a63cwjPrL5uzt/C4W1bgNBfTRwIHSUShNhfdc7ZJNS\n" + + "r2NFPcwodd7uVle5JePNag7oyhjOFFEaBGq21dl6/ozVRkqSWWAi1P7MRay9eYj3\n" + + "mLZiZaL6NlWxXnfzVwIDAQABo2AwXjAdBgNVHQ4EFgQUiKeNoU+FPJsyR4jodIFl\n" + + "RQDe3UUwHwYDVR0jBBgwFoAUiKeNoU+FPJsyR4jodIFlRQDe3UUwDwYDVR0TAQH/\n" + + "BAUwAwEB/zALBgNVHQ8EBAMCAQYwDQYJKoZIhvcNAQELBQADggEBAI1Lgf1Sd/iR\n" + + "pXBW6OKE9Oa6WkZx/hKrtm3tw+m5OTU4veQijMPIIgnXw0QYXFMieWSjSz+OGq+v\n" + + "t5NJWj7afCOADrhswrfAY3q3XY9+HnoXv1OvANFhokos25w6fB9t0lrm5KR+3d8l\n" + + "RwQbxhr8I6tDn2pDExVXRe8k2PYqkabgG6IqPnLzt4iLhPx4ivzo4Zc+zfQZc672\n" + + "oyNJw2/iNufHRsoRa8QqHJM9vziYfChZqdSSlTiqaoyijT0Br6/2yyIKfjjt5Abt\n" + + "cwIDUWqQda62xV7ChkTh7ia3uvBXob2iiB0aI3gVTTqDfK9F5XXtW4BXfqx0hvwB\n" + + "6JzgmNyDQos=\n" + "-----END CERTIFICATE-----"; static String trustedPrivateKey = // Private key in the format of PKCS#8 - "MIICeAIBADANBgkqhkiG9w0BAQEFAASCAmIwggJeAgEAAoGBANtiq0AIJK+iVRwF\n" + - "rqcD7fYXT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ZYuzH50/FQHwxPTPUBi\n" + + "DRzeyncXJWiAA/8vErWM8hDgfOh5w5Fsl4EEfdcmyNm7gWA4Qyknr1ysRwKBgQDC\n" + + "JSPepUy09VHUTxA59nT5HRmoEeoTFRizxTfi2LkZrphuwCotxoRXiRUu+3f1lyJU\n" + + "Qb5qCCFTQ5bE8squgTwGcVxhajC66V3ePePlAuPatkWN2ek28X1DoLaDR+Rk3h69\n" + + "Wb2EQbNMl4grkUUoMA8jaVhBb4vhyQSK+qjyAUFerQKBgQDXZPuflfsjH/d/O2yw\n" + + "qZbssKe9AKORjv795teblAc3vmsSlNwwVnPdS2aq1LHyoNbetc/OaZV151hTQ/9z\n" + + "bsA48oOojgrDD07Ovg3uDcNEIufxR0aGeSSvqhElp1r7wAYj8bAr6W/RH6MS16WW\n" + + "dRd+PH6hsap8BD2RlVCnrT3vIQ=="; // Certificate information: // Issuer: C=US, O=Java, OU=SunJSSE Test Serivce // Validity - // Not Before: May 5 02:40:53 2012 GMT - // Not After : Jan 21 02:40:53 2032 GMT + // Not Before: Dec 20 13:13:44 2019 GMT + // Not After : Dec 17 13:13:44 2029 GMT // Subject: C=US, O=Java, OU=SunJSSE Test Serivce, CN=casigner // X509v3 Subject Key Identifier: - // 13:07:E0:11:07:DB:EB:33:23:87:31:D0:DB:7E:16:56:BE:11:90:0A + // 4B:6D:B0:B0:E6:EF:45:15:35:B5:FC:6B:E2:C7:FC:A6:E6:C4:EC:95 // X509v3 Authority Key Identifier: - // keyid:DD:4E:8D:2A:11:C0:83:03:F0:AC:EB:A2:BF:F9:F2:7D:C8:69:1F:9B - // DirName:/C=US/O=Java/OU=SunJSSE Test Serivce - // serial:00 + // keyid:88:A7:8D:A1:4F:85:3C:9B:32:47:88:E8:74:81:65:45:00:DE:DD:45 static String caSignerStr = "-----BEGIN CERTIFICATE-----\n" + - "MIICqDCCAhGgAwIBAgIBAjANBgkqhkiG9w0BAQQFADA7MQswCQYDVQQGEwJVUzEN\n" + - "MAsGA1UEChMES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+xJIY+sRrzdckxSfS9AOOrJk2VXY8qEoxCN4wCvHJWuHEAF/Lm65d/hq3\n" + + "2Uh8P+QHLeuEwF8RoTpjiGM9dXvaqcQz7w5G\n" + "-----END CERTIFICATE-----"; static String caSignerPrivateKey = // Private key in the format of PKCS#8 - "MIICdgIBADANBgkqhkiG9w0BAQEFAASCAmAwggJcAgEAAoGBAL7Hz6jugzRy38tm\n" + - "ZktcEvgJDyOtQsPk/s20RbSGD/PEEVl8Ed/7jg6jZ4w9hmP7vFpEQ4fkGZUpFiXN\n" + - "G040BoLk2DgyublQo09wwghSNQ6+bu9YzihJMxJ+gRxJf6+n325QCTDfDtn5+tgO\n" + - "bUzgC3+PRv6UuKPvUYU3Yvx2umA9AgMBAAECgYBYvu30cW8LONyt62Zua9hPFTe7\n" + - "qt9B7QYyfkdmoG5PQMepTrOp84SzfoOukvgvDm0huFuJnSvhXQl2cCDhkgXskvFj\n" + - "Hh7KBCFViVXokGdq5YoS0/KYMyQV0TZfJUvILBl51uc4/siQ2tClC/N4sa+1JhgW\n" + - "a6dFGfRjiUKSSlmMwQJBAPWpIz3Q/c+DYMvoQr5OD8EaYwYIevlTdXb97RnJJh2b\n" + - "UnhB9jrqesJiHYVzPmP0ukyPOXOwlp2T5Am4Kw0LFOkCQQDGz150NoHOp28Mvyc4\n" + - "CTqz/zYzUhy2eCJESl196uyP4N65Y01VYQ3JDww4DlsXiU17tVSbgA9TCcfTYOzy\n" + - "vyw1AkARUky+1hafZCcWGZljK8PmnMKwsTZikCTvL/Zg5BMA8Wu+OQBwpQnk3OAy\n" + - "Aa87gw0DyvGFG8Vy9POWT9sRP1/JAkBqP0hrMvYMSs6+MSn0eHo2151PsAJIQcuO\n" + - "U2/Da1khSzu8N6WMi2GiobgV/RYRbf9KrY2ZzMZjykZQYOxAjopBAkEAghCu38cN\n" + - "aOsW6ueo24uzsWI1FTdE+qWNVEi3RSP120xXBCyhaBjIq4WVSlJK9K2aBaJpit3j\n" + - "iQ5tl6zrLl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N8FmadmIGzHhe9xml6b5EfAZphAUF4vZJhQXloT5Wm+NNIAf6X6dRjvzyw7N9B\n" + + "d48EFJF4ChqNGBocsQRNr2wPRzQ+k2caw9YyYMIjbhktDzO1U/FJGYW6/Vgr2v4K\n" + + "siROnXfLWQKBgBOVAZQP5z2opC8z7NbhZuPPrnG7xRpEw+jupUyqoxnwEWqD7bjF\n" + + "M5jQBFqhRLBQ5buTi9GSuQoIRxJLuuu8IH2TyH1YvX9M5YBLRXL2vVCJ/HcZeURT\n" + + "gECcfs92wNtQw6d+y3N8ZnB4tSNIm/Th8RJGKUZkp91lWECvxeWDDP3XAoGASfNq\n" + + "NRAJYlAPfGFAtTDu2i8+r79X9XUGiXg6gVp4umpbqkxY75eFkq9lWzZgFRVEkUwr\n" + + "eGIubyquluDSEw2uKg5yMMzNSqZYVY3IsOKXqbUpFvtn5jOWTU90tNNdEdD100sI\n" + + "Y0f6Ly4amNKH3rZFOERQNtJn6zCTsbh3xMgR7QECgYBhQTqxLU5eIu38MKobzRue\n" + + "RoUkMcoY3DePkKPSYjilFhkUDozIXf/xUGnB8kERZKO+44wUkuPGljiFL1/P/RO9\n" + + "zhHAV94Kw2ddtfxy05GVtUZ99miBmsMb2m8vumGJqfR8h2xpfc1Ra0zfrsPgLNru\n" + + "xDTDW+bNbM7XyPvg9mOf7Q=="; // Certificate information: // Issuer: C=US, O=Java, OU=SunJSSE Test Serivce, CN=casigner @@ -165,129 +191,178 @@ // Not After : Jan 21 02:40:57 2032 GMT // Subject: C=US, O=Java, OU=SunJSSE Test Serivce, CN=certissuer // X509v3 Subject Key Identifier: - // 39:0E:C6:33:B1:50:BC:73:07:31:E5:D8:04:F7:BB:97:55:CF:9B:C8 + // B4:E8:EA:80:A9:2B:F5:62:B5:2C:A6:F8:FF:65:BC:CF:51:40:9C:15 // X509v3 Authority Key Identifier: - // keyid:13:07:E0:11:07:DB:EB:33:23:87:31:D0:DB:7E:16:56:BE:11:90:0A - // DirName:/C=US/O=Java/OU=SunJSSE Test Serivce - // serial:02 + // keyid:4B:6D:B0:B0:E6:EF:45:15:35:B5:FC:6B:E2:C7:FC:A6:E6:C4:EC:95 static String certIssuerStr = "-----BEGIN CERTIFICATE-----\n" + - "MIICvjCCAiegAwIBAgIBAzANBgkqhkiG9w0BAQQFADBOMQswCQYDVQQGEwJVUzEN\n" + - "MAsGA1UEChMESmF2YTEdMBsGA1UECxMUU3VuSlNTRSBUZXN0IFNlcml2Y2UxETAP\n" + - "BgNVBAMTCGNhc2lnbmVyMB4XDTEyMDUwNTAyNDA1N1oXDTMyMDEyMTAyNDA1N1ow\n" + - "UDELMAkGA1UEBhMCVVMxDTALBgNVBAoTBEphdmExHTAbBgNVBAsTFFN1bkpTU0Ug\n" + - "VGVzdCBTZXJpdmNlMRMwEQYDVQQDEwpjZXJ0aXNzdWVyMIGfMA0GCSqGSIb3DQEB\n" + - "AQUAA4GNADCBiQKBgQCyz55zinU6kNL/LeiTNiBI0QWYmDG0YTotuC4D75liBNqs\n" + - "7Mmladsh2mTtQUAwmuGaGzaZV25a+cUax0DXZoyBwdbTI09u1bUYsZcaUUKbPoCC\n" + - "HH26e4jLFL4olW13Sv4ZAd57tIYevMw+Fp5f4fLPFGegCJTFlv2Qjpmic/cuvQID\n" + - "AQABo4GpMIGmMB0GA1UdDgQWBBQ5DsYzsVC8cwcx5dgE97uXVc+byDBjBgNVHSME\n" + - "XDBagBQTB+ARB9vrMyOHMdDbfhZWvhGQCqE/pD0wOzELMAkGA1UEBhMCVVMxDTAL\n" + - "BgNVBAoTBEphdmExHTAbBgNVBAsTFFN1bkpTU0UgVGVzdCBTZXJpdmNlggECMBMG\n" + - "A1UdEwEB/wQJMAcBAf8CAgQAMAsGA1UdDwQEAwIBBjANBgkqhkiG9w0BAQQFAAOB\n" + - "gQCQTagenCdClT98C+oTJGJrw/dUBD9K3tE6ZJKPMc/2bUia8G5ei1C0eXj4mWG2\n" + - "lu9umR6C90/A6qB050QB2h50qtqxSrkpu+ym1yypauZpg7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n" + + "OAT5k9uyPCcLxFPM+Hon5WI6DACxpj7mu2ekN0fswu6B7beQVygpnNSQFVqLrJw1\n" + + "daYdhTMzkNCkPk6q0cUmj5k94jfCHBl4jw+qoZiIehuR9qFHhpLkT4zMTkFof+P+\n" + + "Lfc92QJppUAOh3jTvHK01YwP2sxK3KXhcbofQnxGS4WHrqmmZC2YO/LQRoYDZdUY\n" + + "zr4da2aIg9CKrH2QWoMkDfRKkJvrU3/VhVfVWpNbXFE2xZXftQl3hpFCJ3FkpciA\n" + + "l3hKeq4byY3LXxhAClHpk1KkXJkMnQdOfA5aGekj/Cjuaz1/iKYAG2vRq7YcuM/o\n" + "-----END CERTIFICATE-----"; static String certIssuerPrivateKey = // Private key in the format of PKCS#8 - "MIICeQIBADANBgkqhkiG9w0BAQEFAASCAmMwggJfAgEAAoGBALLPnnOKdTqQ0v8t\n" + - "6JM2IEjRBZiYMbRhOi24LgPvmWIE2qzsyaVp2yHaZO1BQDCa4ZobNplXblr5xRrH\n" + - "QNdmjIHB1tMjT27VtRixlxpRQps+gIIcfbp7iMsUviiVbXdK/hkB3nu0hh68zD4W\n" + - "nl/h8s8UZ6AIlMWW/ZCOmaJz9y69AgMBAAECgYEAjtew2tgm4gxDojqIauF4VPM1\n" + - "pzsdqd1p3pAdomNLgrQiBLZ8N7oiph6TNb1EjA+OXc+ThFgF/oM9ZDD8qZZwcvjN\n" + - "qDZlpTkFs2TaGcyEZfUaMB45NHVs6Nn+pSkagSNwwy3xeyAct7sQEzGNTDlEwVv5\n" + - "7V9LQutQtBd6xT48KzkCQQDpNRfv2OFNG/6GtzJoO68oJhpnpl2MsYNi4ntRkre/\n" + - "6uXpiCYaDskcrPMRwOOs0m7mxG+Ev+uKnLnSoEMm1GCbAkEAxEmDtiD0Psb8Z9BL\n" + - "ZRb83Jqho3xe2MCAh3xUfz9b/Mhae9dZ44o4OCgQZuwvW1mczF0NtpgZl93BmYa2\n" + - "hTwHhwJBAKHrEj6ep/fA6x0gD2idoATRR94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Nbs99KWQECgYEA7IKNL0ME7FuIrKYu\n" + + "FCQ/Duz1N3oQXLzrTGKUSU1qSbrU2Jwk4SfJ8ZYCW1TP6vZkaQsTXmXun3yyCAqZ\n" + + "hcOtDBhI+b7Wpmmyf6nb83oYJtzHMRQZ5qS+9vOBfV9Uf1za8XI4p90EqkFHByCF\n" + + "tHfjVbjK39zN4CvaO3tqpOaYtL0CgYEAxIrTAhGWy9nBsxf8QeqDou0rV5Cw50Kl\n" + + "kQsE7KLmjvrMaFFpUc5lgWoC+pm/69VpNBUuN/38YozwxVjVi/nMJuuK150mhdWI\n" + + "B28FI7ORnFmVeSvTrP4mBX1ct2Tny9zpchXn3rpHR5NZUs7oBhjudHSfRMrHxeBs\n" + + "Kv2pr2s6uzkCgYAtrEh3iAm7WzHZpX3ghd9nknsIa5odTp5h8eeRAFI2Ss4vxneY\n" + + "w4ZMERwDZy1/wnVBk9H5uNWMFxiKVQGww0j3vPjawe/R0zeVT8gaDMn9N0WARNF7\n" + + "qPT3265196LptZTSa6xlPllYR6LfzXgEkeJk+3qyIIHheJZ8RikiDyYOQQKBgQC/\n" + + "rxlegiMNC4KDldf7vanGxAKqcz5lPbXWQOX7mGC+f9HNx+Cs3VxYHDltiXgJnOju\n" + + "191s1HRK9WR5REt5KhY2uzB9WxJQItJ5VYiwqhhQYXqLY/gdVv1kC0DayDndtMWk\n" + + "88JhklGkeAv83DikgbpGr9sJr6+oyFkWkLDmmfD82QKBgQCMgkZJzrdSNNlB0n5x\n" + + "xC3MzlsQ5aBJuUctnMfuyDi+11yLAuP1oLzGEJ7qEfFoGRO0V8zJWmHAfNhmVYEX\n" + + "ow5g0WbPT16GoRCiOAzq+ewH+TEELMF6HWqnDuTnCg28Jg0dw2kdVTqeyzKOQlLG\n" + + "ua9c2DY3PUTXQPNqLVhz+XxZKA=="; // Certificate information: // Issuer: C=US, O=Java, OU=SunJSSE Test Serivce, CN=certissuer // Validity - // Not Before: May 5 02:41:01 2012 GMT - // Not After : Jan 21 02:41:01 2032 GMT + // Not Before: Dec 20 13:13:45 2019 GMT + // Not After : Dec 17 13:13:45 2029 GMT // Subject: C=US, O=Java, OU=SunJSSE Test Serivce, CN=localhost // X509v3 Subject Key Identifier: - // AD:C0:2C:4C:E4:C2:2E:A1:BB:5D:92:BE:66:E0:4E:E0:0D:2F:11:EF + // 46:FC:94:7A:61:6D:BF:5F:AE:D7:20:EC:BF:6A:74:2A:26:F1:D4:4C // X509v3 Authority Key Identifier: - // keyid:39:0E:C6:33:B1:50:BC:73:07:31:E5:D8:04:F7:BB:97:55:CF:9B:C8 + // keyid:B4:E8:EA:80:A9:2B:F5:62:B5:2C:A6:F8:FF:65:BC:CF:51:40:9C:15 static String serverCertStr = "-----BEGIN CERTIFICATE-----\n" + - "MIICjTCCAfagAwIBAgIBBDANBgkqhkiG9w0BAQQFADBQMQswCQYDVQQGEwJVUzEN\n" + - "MAsGA1UEChMESmF2YTEdMBsGA1UECxMUU3VuSlNTRSBUZXN0IFNlcml2Y2UxEzAR\n" + - "BgNVBAMTCmNlcnRpc3N1ZXIwHhcNMTIwNTA1MDI0MTAxWhcNMzIwMTIxMDI0MTAx\n" + - "WjBPMQswCQYDVQQGEwJVUzENMAsGA1UEChMESmF2YTEdMBsGA1UECxMUU3VuSlNT\n" + - "RSBUZXN0IFNlcml2Y2UxEjAQBgNVBAMTCWxvY2FsaG9zdDCBnzANBgkqhkiG9w0B\n" + - "AQEFAAOBjQAwgYkCgYEAvwaUd7wmBSKqycEstYLWD26vkU08DM39EtaT8wL9HnQ0\n" + - "fgPblwBFI4zdLa2cuYXRZcFUb04N8nrkcpR0D6kkE+AlFAoRWrrZF80B7JTbtEK4\n" + - "1PIeurihXvUT+4MpzGLOojIihMfvM4ufelblD56SInso4WFHm7t4qCln88J1gjkC\n" + - "AwEAAaN4MHYwCwYDVR0PBAQDAgPoMB0GA1UdDgQWBBStwCxM5MIuobtdkr5m4E7g\n" + - "DS8R7zAfBgNVHSMEGDAWgBQ5DsYzsVC8c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6eM\n" + + "kzxZwRrlAgMBAAGjTzBNMB0GA1UdDgQWBBRG/JR6YW2/X67XIOy/anQqJvHUTDAf\n" + + "BgNVHSMEGDAWgBS06OqAqSv1YrUspvj/ZbzPUUCcFTALBgNVHQ8EBAMCA+gwDQYJ\n" + + "KoZIhvcNAQELBQADggEBAGXHGefA1j136yenwK+j9K5VnG2kYGXCadi9bKtTXf/X\n" + + "6Xasb7QE2QWEIlq+78AaV9Dwc7qk1TuBsN05LbQUSe7h5UAfS4AZ5l/XSay2cxrZ\n" + + "TKoyuzh9kj38QkEBxZlrClyBzU8Mct0L9F8yEm4V7AqQOshn9gEQl9lzJUb2KHeZ\n" + + "AxblrQhPQDrWhmQjQkl/xaiOiU31sHKTnB/L2CKvJtmsKIyBdrQCQTlIOcRu4/PQ\n" + + "4z/sjecKP08Xkf5+p4RzPL+OZHkJoejSEjBndLC8BK9IZD94kHZYDz8ulWrQJ5Nr\n" + + "u/inkyf8NcG7zLBJJyuKfUXO/OzGPD5QMviVc+PCGTY=\n" + "-----END CERTIFICATE-----"; static String serverPrivateKey = // Private key in the format of PKCS#8 - "MIICdAIBADANBgkqhkiG9w0BAQEFAASCAl4wggJaAgEAAoGBAL8GlHe8JgUiqsnB\n" + - "LLWC1g9ur5FNPAzN/RLWk/MC/R50NH4D25cARSOM3S2tnLmF0WXBVG9ODfJ65HKU\n" + - "dA+pJBPgJRQKEVq62RfNAeyU27RCuNTyHrq4oV71E/uDKcxizqIyIoTH7zOLn3pW\n" + - "5Q+ekiJ7KOFhR5u7eKgpZ/PCdYI5AgMBAAECf3CscOYvFD3zNMnMJ5LomVqA7w3F\n" + - "gKYM2jlCWAH+wU41PMEXhW6Lujw92jgXL1o+lERwxFzirVdZJWZwKgUSvzP1G0h3\n" + - "fkucq1/UWnToK+8NSXNM/yS8hXbBgSEoJo5f7LKcIi1Ev6doBVofMxs+njzyWKbM\n" + - "Nb7rOLHadghoon0CQQDgQzbzzSN8Dc1YmmylhI5v+0sQRHH0DL7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+ "LhYunmcCEj+yb3of33loQb/FM2OLW9UoQakB7ewio9vtw+BAnWxnHFkEaqdxMXpy\n" + + "TiSXLpQ1Q9GvDpzngDzJzzY="; // Certificate information: // Issuer: C=US, O=Java, OU=SunJSSE Test Serivce, CN=certissuer // Validity - // Not Before: May 5 02:41:02 2012 GMT - // Not After : Jan 21 02:41:02 2032 GMT + // Not Before: Dec 20 14:21:29 2019 GMT + // Not After : Dec 17 14:21:29 2029 GMT // Subject: C=US, O=Java, OU=SunJSSE Test Serivce, CN=InterOp Tester // X509v3 Subject Key Identifier: - // 57:7D:E2:33:33:60:DF:DD:5E:ED:81:3F:EB:F2:1B:59:7F:50:9C:99 + // 1F:E4:C0:F5:B8:68:DB:D2:EB:9E:6F:BB:B5:9E:92:6D:BA:7D:97:3A // X509v3 Authority Key Identifier: - // keyid:39:0E:C6:33:B1:50:BC:73:07:31:E5:D8:04:F7:BB:97:55:CF:9B:C8 + // keyid:B4:E8:EA:80:A9:2B:F5:62:B5:2C:A6:F8:FF:65:BC:CF:51:40:9C:15 static String clientCertStr = "-----BEGIN CERTIFICATE-----\n" + - "MIICaTCCAdKgAwIBAgIBBTANBgkqhkiG9w0BAQQFADBQMQswCQYDVQQGEwJVUzEN\n" + - "MAsGA1UEChMESmF2YTEdMBsGA1UECxMUU3VuSlNTRSBUZXN0IFNlcml2Y2UxEzAR\n" + - "BgNVBAMTCmNlcnRpc3N1ZXIwHhcNMTIwNTA1MDI0MTAyWhcNMzIwMTIxMDI0MTAy\n" + - "WjBUMQswCQYDVQQGEwJVUzENMAsGA1UEChMESmF2YTEdMBsGA1UECxMUU3VuSlNT\n" + - "RSBUZXN0IFNlcml2Y2UxFzAVBgNVBAMTDkludGVyT3AgVGVzdGVyMIGfMA0GCSqG\n" + - "SIb3DQEBAQUAA4GNADCBiQKBgQC1pA71nDg1KhhnHjRdi/eVDUa7uFZAtN8R9huu\n" + - "pTwFoyqSX8lDMz8jDawOMmaI9dVZLjTh3hnf4KBEqQOearFVz45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XW5ZZ+jwVGi1WubjxqLpbQo9VwdTgozBfxwzjQQWDOlUIics3RRaV4Yz0\n" + + "F3Sr4xZiq09O4x8ZT8jrQgduzVZhWjc7rHHbBeMmVBhOveSCvu54onZ2Y+G7+xU/\n" + + "Zc1Z6s2Wb5N2I40CAwEAAaNPME0wHQYDVR0OBBYEFB/kwPW4aNvS655vu7Wekm26\n" + + "fZc6MB8GA1UdIwQYMBaAFLTo6oCpK/VitSym+P9lvM9RQJwVMAsGA1UdDwQEAwID\n" + + "6DANBgkqhkiG9w0BAQsFAAOCAQEAdgWs2wVkPoOrShdYTJM2/v7sDYENCsj3VGEq\n" + + "NvTeL98FCjRZhRmozVi0mli6z2LjDM/858vZoJWDJ08O0XvhXT4yJWWHCJz4xTY1\n" + + "GBern25Y8VjZGUwAIzK3EDjYzJCZpbhBREF8XZx46OxHt04BKtQwJKBtpJ1/6bRS\n" + + "wvia3wGspFLW78P2Y5rFXzqptaqBD06Dcc4xBgvFLSocSKUzLc8BdNsixtPBQZNs\n" + + "l3X3TUNYoYW677E7EWO8NHUJg+2Qbpo11tkb0AyScSxOu2aHuPfYIchRZXnDdq20\n" + + "tL85OZz8ov7d2jVet/w7FD4M5XfcogsNtpX4kaMsctyvQbDYRA==\n" + "-----END CERTIFICATE-----"; static String clientPrivateKey = // Private key in the format of PKCS#8 - "MIICeAIBADANBgkqhkiG9w0BAQEFAASCAmIwggJeAgEAAoGBALWkDvWcODUqGGce\n" + - "NF2L95UNRru4VkC03xH2G66lPAWjKpJfyUMzPyMNrA4yZoj11VkuNOHeGd/goESp\n" + - "A55qsVXPjnIE6OWA8sG4jgUP85GGCYNoi7Y0r5zXKPphCXKI7QM/CHnka08tUbeK\n" + - "4Sl6NTuBDJoy5Np12hes7uzHDNqdAgMBAAECgYEAjLwygwapXjfhdHQoqpp6F9iT\n" + - "h3sKCVSaybXgOO75lHyZzZO9wv1/288KEm3mmBOxXEm6245UievnAYvaq/GKt93O\n" + - "pj2zRefBzZjGbz0v84f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BgEJuq4RzecgiGx8srWDb\n" + + "pQKpxrdEt82Y7OXLVj+W9vixcW/xUYhDYGsfdUigZoOjo4nV8KVmMbuI48PIYwnw\n" + + "haLwWrBWlki4x9MRwuZUdewOYoo7hDZToZmIDescdiwv8CA/Dg9kOX3YYLPW+cWl\n" + + "i1pnyMPaloBOhz3Y07sWXxCz"; static char passphrase[] = "passphrase".toCharArray(); @@ -312,7 +387,7 @@ SSLServerSocketFactory sslssf = context.getServerSocketFactory(); SSLServerSocket sslServerSocket = - (SSLServerSocket)sslssf.createServerSocket(serverPort); + (SSLServerSocket) sslssf.createServerSocket(serverPort); serverPort = sslServerSocket.getLocalPort(); SSLSocket sslSocket = null; try { @@ -356,8 +431,7 @@ SSLSocketFactory sslsf = context.getSocketFactory(); SSLSocket sslSocket = - (SSLSocket)sslsf.createSocket("localhost", serverPort); - sslSocket.setEnabledProtocols(new String[] { "TLSv1", "TLSv1.1", "TLSv1.2" }); + (SSLSocket) sslsf.createSocket("localhost", serverPort); try { InputStream sslIS = sslSocket.getInputStream(); OutputStream sslOS = sslSocket.getOutputStream(); @@ -458,16 +532,9 @@ volatile Exception clientException = null; public static void main(String args[]) throws Exception { - // MD5 is used in this test case, don't disable MD5 algorithm. - Security.setProperty("jdk.certpath.disabledAlgorithms", - "MD2, RSA keySize < 1024"); - Security.setProperty("jdk.tls.disabledAlgorithms", - "SSLv3, RC4, DH keySize < 768"); - if (debug) System.setProperty("javax.net.debug", "all"); - /* * Get the customized arguments. */ @@ -561,5 +628,4 @@ doClientSide(); } } - } diff -Nru openjdk-13-13.0.3+3/test/jdk/sun/security/ssl/X509TrustManagerImpl/SelfIssuedCert.java openjdk-13-13.0.4+8/test/jdk/sun/security/ssl/X509TrustManagerImpl/SelfIssuedCert.java --- openjdk-13-13.0.3+3/test/jdk/sun/security/ssl/X509TrustManagerImpl/SelfIssuedCert.java 2020-02-20 22:05:38.000000000 +0000 +++ openjdk-13-13.0.4+8/test/jdk/sun/security/ssl/X509TrustManagerImpl/SelfIssuedCert.java 2020-07-07 16:55:29.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2009, 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,18 +35,14 @@ * @author Xuelei Fan */ -import java.net.*; -import java.util.*; import java.io.*; import javax.net.ssl.*; -import java.security.Security; import java.security.KeyStore; import java.security.KeyFactory; import java.security.cert.Certificate; import java.security.cert.CertificateFactory; import java.security.spec.*; import java.security.interfaces.*; -import java.math.BigInteger; import java.util.Base64; @@ -71,78 +67,95 @@ // Certificate information: // Issuer: C=US, O=Example, CN=localhost // Validity - // Not Before: May 25 00:35:58 2009 GMT - // Not After : May 5 00:35:58 2030 GMT + // Not Before: Dec 19 06:11:58 2019 GMT + // Not After : Dec 16 06:11:58 2029 GMT // Subject: C=US, O=Example, CN=localhost // X509v3 Subject Key Identifier: - // 56:AB:FE:15:4C:9C:4A:70:90:DC:0B:9B:EB:BE:DC:03:CC:7F:CE:CF + // 80:67:BA:EE:10:6A:E3:8E:3E:8E:F7:2D:90:B6:FD:F9:54:87:47:B1 // X509v3 Authority Key Identifier: - // keyid:56:AB:FE:15:4C:9C:4A:70:90:DC:0B:9B:EB:BE:DC:03:CC:7F:CE:CF - // DirName:/C=US/O=Example/CN=localhost - // serial:00 + // keyid:80:67:BA:EE:10:6A:E3:8E:3E:8E:F7:2D:90:B6:FD:F9:54:87:47:B1 static String trusedCertStr = "-----BEGIN CERTIFICATE-----\n" + - "MIICejCCAeOgAwIBAgIBADANBgkqhkiG9w0BAQQFADAzMQswCQYDVQQGEwJVUzEQ\n" + - "MA4GA1UEChMHRXhhbXBsZTESMBAGA1UEAxMJbG9jYWxob3N0MB4XDTA5MDUyNTAw\n" + - "MDQ0M1oXDTMwMDUwNTAwMDQ0M1owMzELMAkGA1UEBh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DwAwggEKAoIBAQCy57BG8Dt+a4ZwWGM07f0z/mzK\n" + + "T/myXM4W//3pkZxO0+4oyYM7G8ks9O64NPpA0CpTPCpfY6dI1Y/kwBUdSoqx2D8t\n" + + "OEfHOat2/AQvvWmEChFH4ZmmQFkLXBy0ueDq0TJbEd94+WhL3q9bA4uqvBsuuaTt\n" + + "bX/GyOC52bpjg0TWY4BRdRVhveISZvqOCoqqJ1aPOnfxqySaZIC34q9gdUCUNxZD\n" + + "qjhuQF3Q0xYsNGZSUmnKj3/0GS600BwQPqSHy287Vda88NvqJGFS4DKrw3HV3Wsk\n" + + "IHGN+tzB5THBy70XrE+XIdXJ/I86q+FvNcTnJygn2nVNG4+vUhW8S3BzTiKPAgMB\n" + + "AAGjUzBRMB0GA1UdDgQWBBSAZ7ruEGrjjj6O9y2Qtv35VIdHsTAfBgNVHSMEGDAW\n" + + "gBSAZ7ruEGrjjj6O9y2Qtv35VIdHsTAPBgNVHRMBAf8EBTADAQH/MA0GCSqGSIb3\n" + + "DQEBCwUAA4IBAQBX7icKmR/iUPJhfnvNHiqsyTIcowY3JSAJAyJFrViKx2tdo+qq\n" + + "yA+EUsZlZsCwhiiG4/SjFxgaAp0Z3BBmsO/njWUEx3/fSufTHcs0+fPNkFLru5Lr\n" + + "das4wW9Cv/wO4rz2L6qK/x7+r/wkPccaqxTpdZvXqDid2va5Lv3F7jOW5ns13piZ\n" + + "z571RCpmhGSytYKFrAOGoI4ZBWXrkCiYQZ8KvhdBQP/MNJM+e6ajtF27rK08XTao\n" + + "mW3FXfK6SjKQDGVwtNJ7M1qGutIpe0pNBGwvDpQuY2mk0Le46OXdaQ7AAzE+OnRJ\n" + + "1uRDV+p95MzhtolPgB3I8Rzyd23nfrx6uxMA\n" + "-----END CERTIFICATE-----"; // Certificate information: // Issuer: C=US, O=Example, CN=localhost // Validity - // Not Before: May 25 00:35:58 2009 GMT - // Not After : May 5 00:35:58 2030 GMT + // Not Before: Dec 19 06:12:04 2019 GMT + // Not After : Dec 16 06:12:04 2029 GMT // Subject: C=US, O=Example, CN=localhost // X509v3 Subject Key Identifier: - // 0D:30:76:22:D6:9D:75:EF:FD:83:50:31:18:08:83:CD:01:4E:6A:C4 + // 73:79:B7:73:F5:41:BB:3A:90:07:87:F2:CA:A5:B3:C3:45:E0:18:E0 // X509v3 Authority Key Identifier: - // keyid:56:AB:FE:15:4C:9C:4A:70:90:DC:0B:9B:EB:BE:DC:03:CC:7F:CE:CF - // DirName:/C=US/O=Example/CN=localhost - // serial:00 + // keyid:80:67:BA:EE:10:6A:E3:8E:3E:8E:F7:2D:90:B6:FD:F9:54:87:47:B1 static String targetCertStr = "-----BEGIN CERTIFICATE-----\n" + - "MIICaTCCAdKgAwIBAgIBAjANBgkqhkiG9w0BAQQFADAzMQswCQYDVQQGEwJVUzEQ\n" + - "MA4GA1UEChMHRXhhbXBsZTESMBAGA1UEAxMJbG9jYWxob3N0MB4XDTA5MDUyNTAw\n" + - "MDQ0M1oXDTI5MDIwOTAwMDQ0M1owMzELMAkGA1UEBhMCVVMxEDAOBgNVBAoTB0V4\n" + - "YW1wbGUxEjAQBgNVBAMTCWxvY2FsaG9zdDCBnzANBgkqhkiG9w0BAQEFAAOBjQAw\n" + - "gYkCgYEAzmPahrH9LTQv3HEWsua+hIpzyU1ACooSd5BtDjc7XnVzSdGW8QD9R8EA\n" + - "xko7TvfJo6IH6wwgHBspySwsl+6xvHhbwQjgtWlT71ksrUbqcUzmvSvcycQYA8RC\n" + - "yk9HK5pEJQgSxldpR3Kmy0V6CHC4dCm15trnJYWisTuezY3fjXECAwEAAaOBjDCB\n" + - "iTAdBgNVHQ4EFgQUQkiWFRkjKsfwFo7UMQfGEzNNW60wWwYDVR0jBFQwUoAUq3q5\n" + - "fYEibdvLpab+JY4pmifj2vahN6Q1MDMxCzAJBgNVBAYTAlVTMRAwDgYDVQQKEwdF\n" + - "eGFtcGxlMRIwEAYDVQQDEwlsb2NhbGhvc3SCAQAwCwYDVR0PBAQDAgPoMA0GC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ijlics\n" + + "YGCw9k4he3ZkNfqCPFTJKgkbTuM1Cy+aCXzhhdGKCZ2R0Xyi3ma3snwPtqHy5Aru\n" + + "WwoGssxL6S8+Pb/BPZ9OelU7lEmS69AeBKOHHIEs+wEi2oco8J+WU1O4zekP8Clv\n" + + "hHuwPhoL6g0aAUXAISaqYpHYC15oXGOJcC539kgv4VrL9UZJekxtDERUXKyzW+UC\n" + + "ZBPalts1zM5wD43+9PuoeLiPdvMg1kH4obJYnj23zej41iwqPOWhgm0NuGoJVjSg\n" + + "4YqtS1ePD/I2oRV0bu4P7Q72cMYdcFHfPDoe3vCcEMxUTgGBaoPHw9GwEeRoWn/L\n" + + "whBwzXBsD0aZqQ==\n" + "-----END CERTIFICATE-----"; // Private key in the format of PKCS#8 static String targetPrivateKey = - "MIICeQIBADANBgkqhkiG9w0BAQEFAASCAmMwggJfAgEAAoGBAM5j2oax/S00L9xx\n" + - "FrLmvoSKc8lNQAqKEneQbQ43O151c0nRlvEA/UfBAMZKO073yaOiB+sMIBwbKcks\n" + - "LJfusbx4W8EI4LVpU+9ZLK1G6nFM5r0r3MnEGAPEQspPRyuaRCUIEsZXaUdypstF\n" + - "eghwuHQpteba5yWForE7ns2N341xAgMBAAECgYEAgZ8k98OBhopoJMLBxso0jXmH\n" + - "Dr59oiDlSEJku7DkkIajSZFggyxj5lTI78BfT1FASozQ/EY5RG2q6LXdq+41oU/U\n" + - "JVEQWhdIE1mQDwE0vgaYdjzMaVIsC3cZYOCOmCYvNxCiTt7e/z8yBMmAE5udqJMB\n" + - "pim4WXDfpy0ssK81oCECQQDwMC4xu+kn0yD/Qyi9Zn26gIRDv4bjzDQoJfSvMhrY\n" + - "a4duxLzh9u4gCDd0+wHxpPQvNxGCk0c1JUxBJ2rb4G3HAkEA2/oVRV6+xiRXUnoo\n" + - "bdPEO27zEJmdpE42yU/JLIy6DPu2IUhEqY45fU2ZERmwMdhpiK/vsf/CZKJ2j/ZU\n" + - "PdMLBwJBAJIYTFDWAqjFp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7NA8gnnCzUc6uX6I/tm62gQKBgQDniWuFjSzhaAhj04+N\n" + + "vG8sQjfVmTbON6SfFfujR/Z57qamJ8zcS/REHfc5swdn9uUTJ2xoRRNCwKZyuMXo\n" + + "4B2/O9+sKfEPYGyjAyGo6E4rGLRNcw6Tb8hx/EFvfTOunwapynOJDDs2Z6FzWNIx\n" + + "x4+FHs9hStwL/OTdXF/OY2vGsQKBgQDAIR93LrCC6OpGi89/UDIwpT9pFLa8cvpr\n" + + "1MUNlHhcxQusPUgWT4pTucF/SQpPf77g3YNb5pt3DG0GELM8YAB0Uv9oZIWfJoFY\n" + + "ebYy6tMVxhHhT0OuryMj48BMHnQG78hq8+c0NnjK7jXV6t0iKjN8ANnFqAovm+U9\n" + + "VMobar5CwwKBgFCKN9GsCxmZg5meBQiLrKxbmGp/slXHe0cvcWoZ5T4C6wtPOu7C\n" + + "qQRs3AvBH+llM8gW5ZnbtVh6BSxQ498e3pof7K1JpaXwp7mIpFPKAy7wl/9872wP\n" + + "7UzhL63lgm3SuZGkb84TaCGDqOCj2/Ie9eibkA3K6YJuBPqPYHA9m0bxAoGARdcE\n" + + "iB9pvHyMRM6nw8DULciz7y+/aWtmSnJSmyggRKDAKIEyRiHtx5eblfhoDhQCv9zl\n" + + "1i9SzgivTOgfL1A6eg59l2YLCJpHpHDB4WppBt40O7HDialSXcZ5bXIYfTkGopI8\n" + + "tkciy6mh2jwA3F14z5fDkc0OvtWtlAjRWvwHY18CgYAPONVJtVFiMogBU5Iyv1LB\n" + + "oygn6AFvTI8Pjy2g5GsJBbRnKFjAJrP7HpgUxLdW+Mlnv3Xgtr/L6ep+VKoXTEwv\n" + + "Y83gliDwG2YRjaUbkMfQqcm20/Pi4XPwhy5pwTVsXVBfzKzqJjKAFk97BD9xCUIH\n" + + "FOGe+jaEsWvaEQrH5y17FQ=="; static char passphrase[] = "passphrase".toCharArray(); @@ -209,7 +222,6 @@ SSLSocket sslSocket = (SSLSocket)sslsf.createSocket("localhost", serverPort); - sslSocket.setEnabledProtocols(new String[] { "TLSv1", "TLSv1.1", "TLSv1.2" }); InputStream sslIS = sslSocket.getInputStream(); OutputStream sslOS = sslSocket.getOutputStream(); @@ -306,16 +318,9 @@ volatile Exception clientException = null; public static void main(String args[]) throws Exception { - // MD5 is used in this test case, don't disable MD5 algorithm. - Security.setProperty("jdk.certpath.disabledAlgorithms", - "MD2, RSA keySize < 1024"); - Security.setProperty("jdk.tls.disabledAlgorithms", - "SSLv3, RC4, DH keySize < 768"); - if (debug) System.setProperty("javax.net.debug", "all"); - /* * Get the customized arguments. */ diff -Nru openjdk-13-13.0.3+3/test/jdk/sun/security/util/HostnameMatcher/NullHostnameCheck.java openjdk-13-13.0.4+8/test/jdk/sun/security/util/HostnameMatcher/NullHostnameCheck.java --- openjdk-13-13.0.3+3/test/jdk/sun/security/util/HostnameMatcher/NullHostnameCheck.java 2020-02-20 22:05:38.000000000 +0000 +++ openjdk-13-13.0.4+8/test/jdk/sun/security/util/HostnameMatcher/NullHostnameCheck.java 2020-07-07 16:55:29.000000000 +0000 @@ -39,16 +39,20 @@ /* * @test - * @bug 8211339 + * @bug 8211339 8234728 * @summary Verify hostname returns an exception instead of null pointer when * creating a new engine - * @run main NullHostnameCheck + * @run main NullHostnameCheck TLSv1 + * @run main NullHostnameCheck TLSv1.1 + * @run main NullHostnameCheck TLSv1.2 + * @run main NullHostnameCheck TLSv1.3 */ public final class NullHostnameCheck { public static void main(String[] args) throws Exception { + String protocol = args[0]; KeyStore keyStore = KeyStore.getInstance(KeyStore.getDefaultType()); keyStore.load( new ByteArrayInputStream(Base64.getDecoder(). @@ -57,12 +61,12 @@ KeyManagerFactory kmf = KeyManagerFactory.getInstance( KeyManagerFactory.getDefaultAlgorithm()); kmf.init(keyStore, "123456".toCharArray()); - SSLContext serverCtx = SSLContext.getInstance("TLSv1.2"); + SSLContext serverCtx = SSLContext.getInstance(protocol); serverCtx.init(kmf.getKeyManagers(), null, null); SSLEngine serverEngine = serverCtx.createSSLEngine("localhost", -1); serverEngine.setUseClientMode(false); - SSLContext clientCtx = SSLContext.getInstance("TLSv1.2"); + SSLContext clientCtx = SSLContext.getInstance(protocol); clientCtx.init(null, new TrustManager[] { new X509TrustManager() { @Override @@ -189,94 +193,102 @@ } } -// Base64 of PKCS12 Keystore -static final String keystoreB64 = - "MIIQ6wIBAzCCEKQGCSqGSIb3DQEHAaCCEJUEghCRMIIQjTCCBgEGCSqGSIb3DQEHAa" + - "CCBfIEggXuMIIF6jCCAuwGCyqGSIb3DQEMCgECoIICmzCCApcwKQYKKoZIhvcNAQwB" + - "AzAbBBS7qnTOxJYV5At3migAiNAdPvKd7AIDAMNQBIICaMo0roH1TuZE1ARZtwCOXy" + - "F2sk4DmI6m1/CRdh6NeQzszJZH2701cEm0CES971IwobCNFo0+Er9tk1c+iXmMPJgM" + - "s1l/+7OpQCc/GRl2Nc7lQSj1Yvrq1CIQxC51hSrwNs0N9aCTavjKfJ7jk3k1+MNItU" + - "dMdwuIFK663NEH8Wm0D4njvIA9p3ehOLJWDi0ziFTcySyCbbWAL6HmJhzRlpakPpbp" + - "Ox68wfI2YgDpQwTq580TMEWz+9P1U07VmtfYlu9xjXQT/Ks1xzNrhbOyv+HLoE54qL" + - "RyhL36/fwCzlpCXCYokPUG2uziu8JiQyITYRpVhVcgR5m/rSMhVsj8HwUmIdlK2Irm" + - "kOqG2m6YPKRiq7eeCPskcf2Hh0H3pb6lxagSVQMb+qndIUhCvZoXL/oS2+1ngtMlXh" + - "ezjIEa5s2K+Kk8eV48Ydms5bW8Plqy20+0fgEClABF6QL4We4NaFJdl6DB0+KsxgUd" + - "ZHo4U7f3R6o971mAd/OACs4jzpA0/C3AKCbhBEh/nxnSPoxM0Ty3bLaK8LQnv+B2uo" + - "6TeypsxmGg4/kd6fymzrhWUJAFz7DjkO/32pDUXnUDa6CB+dZdUldPoOpviGl9ITfG" + - "apdnq8+B4y7lg/87OZbr99vyVBWtbATaNof3Y5PuNY5TTQ5y1u4gU+zO9qhRnjx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VLLtfS/pe3m0EmaU6nRkmfLxMfYtnDUgdghMy0Cltc3TKn" + - "9qFrBtY41qf8D5LGSrrmLVC1tnQv+hJC7hwiIQZ/2a5b5Bv67tcdzlEGRNT7uv0ID0" + - "Ig5MyPjvJtppNQfxhPbNbJvxWtmI1NvH4359d0vR/4yzxYq+BpCLpOXw3BreGE55J7" + - "xIvxeRb+Pws7A0xdbKHAwSUsEyPglxAkZCzftZin+MoEw8UnhXYWOPKf+k49TVAq7S" + - "Yi1mJxxzwkSkSw9AdhbalYi1Y17VVfHHcb9Ioh1Jdtq8iNqtO2GG+Gd4yGKaRjnQ03" + - "6YRWyffrMx6Lv/aEecMR1DASDuX0vVjfafKHAp+13VKVGsB6zPbzR4njAXhJxTC9qj" + - "RbG2ISl4xrgAy/gBCKqN+UaVGVYe5DdA22XOOfNkgRrfoqcdgajzp4v6hqr3kPh997" + - "89Ayxcov6OopEUBuy6wuPO2ezXRMw8snABq6YDlf36l2jugHbqUUOiiQ4jIPgZAp/S" + - "r+4i6wyH+wOIjn1pBn9GgqypWCjyj/uTIMiXiMe5TDzp7U9pJ7e/hWUGzm6wWuDQWB" + - "zLwAJNRtaaGV0UraI4ubOJVsvGym0PJ8elxCUgKo6cePkhwrVPcNKA19HgVj/3g0pa" + - "ZwYt5Yw2Gdydm0zadva7K/oVgVKRDmkQbwlavySW0xqU8Pul/V/HUSd32/4cpOmmol" + - "OjMo1vyn/iSMylG0s2SzTjZ4LlcwhaxjoIVpXo6MwPMh/vdlgQyZ/bjO9PMr9TYW6J" + - "aF2PnIKsRkzYfcn6xcQwPjAhMAkGBSsOAwIaBQAEFLddLgmJBuufBBi+JoHCaLDeTK" + - "RvBBTQP0GN26PaNdjOaE/AzK7bbhZGNAIDAYag"; + // Base64 of PKCS12 Keystore + /* + * Certificate + * "signature algorithm": "SHA384withRSA", + * "issuer" : "CN=test, OU=test, O=test, L=test, ST=test, C=test", + * "not before" : "2019-12-05 12:43:23.000 IST", + * "not after" : "2049-11-27 12:43:23.000 IST", + * "subject" : "CN=test, OU=test, O=test, L=test, ST=test, C=test", + * "subject public key" : "RSA", + */ + static final String keystoreB64 = + "MIIQZwIBAzCCECAGCSqGSIb3DQEHAaCCEBEEghANMIIQCTCCCeUGCSqGSIb3DQEHA" + + "aCCCdYEggnSMIIJzjCCCcoGCyqGSIb3DQEMCgECoIIJezCCCXcwKQYKKoZIhvcNAQ" + + "wBAzAbBBSaZBiYmowTxFT4KJxZhMHTVOC9OQIDAMNQBIIJSBnoVGtJKPsoiSU095y" + + "50x27NJQd727oJwMXqA8kdxCcE1tBowtO8P44ctSEvwJQlB7dR9PxHB6LcfCdMfpa" + + "GObVCH1/6jHzhRolI9JMAfXlvliAHKZSjuQd2USw1Y65/+0VYvKslXGU4hWhGQWh2" + + "ksUCBIIcC2A3sA3afF/JPrlfLCEbzYpcfAsv+Z7wEEr6YD11HIHfbOgu2/HU6phL2" + + "RMJDK9iLgP9mu6FzRFk+93BSguWXfbeJyPlzA8dcTzkXDyfVDx4Wd+UExWq0fx179" + + "b74MWkwEk76TowEkcGkrnugwOKnqBmyvmBkbl1827+ChZprZ3zGw69IkuRsdDSYGb" + + "IWVAB/psB0zX3TvsKHcraZm34oNJdSNpYrS0OWA8lSm5NdcfTzi6WLxWwxz55PvZg" + + "OP3pVyXmtAalyBujs6AOsLkJIMLGvWAYeD+72ook8fqpW7s5e/HA7MshXrlMMflpD" + + "m708kK5VnfdgzQsAGr6YfOYOKnyhoqskmzDYccuSz59owKiuGMgHpum0zVE8yyVwb" + + "esXfP3v7eiPuGvsxzq5DE6jaY4F+GoxdLbL4jDWocnWiZewnuYxQwd1vKIKTww/TG" + + "8RObPUEB38+/LNpgb7+5Oap45rujygiPFWD9+mTzKkLGkM6ItRo4qOwtKAqbjPIVk" + + "MDCovcr2TCrZfE8ZbQnU/q2LR5eC6ZpOMFNRZggm92n0+FmDuEKjR7lu2mQF4IDan" + + "SiYgS1+nBhfG9pcNP3yCpwoBHIImtZX5GObKqgvMqQ746K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nBqPnggKSLWucVKFcjsvXKasMvRl99f4Y7qRAjgM6EHa7rNyWIflRe6ZLNBlj" + + "16mW293a4FL1jTosNlZoCN8xb1zDdb/NCISqkX6/sq7wDOn4t+m+78ckof4GNmTOM" + + "WSaRDJIuLM9c1stLHpcyif37oZum86FnB9Zw9qlQGdgLYnRPeZXV1rZuC1L9fugCN" + + "M4WcUQ20fmPOgyO4RGLsxCbZZJBJj0y7CAMthepMnzaEO9Z2O9BFaM4zpL2ng7GvO" + + "a26DQiHO5RFVjUpslUdmPuX7U5xkRfjJ025pqTvHVLfzWmsU53ZbkgiJ/0xxa1Emd" + + "5y0X2keTVfm7q5duNVVN1A6r50++RANI7NJaSLFTMm8Y5P79g4o7UmtCLSesUdTsF" + + "8swVR5slE3O7ErNr3drLfYVEF9FaB7vcuMDqxCNuahX8TCMJg0vqpO8+EXRNkieb9" + + "KSgcLD5WRjzGm7e/B5uACxWc50iY6lYvIVW5Itot95OHWZ5xdq3a3fIIb4MDQ2/nx" + + "lozhRHaHTBI9GAwy1/XcDJWMr+tI9rLGCB7hX8dVqNtYO93/oF3gvBiiNSw5qmUQ2" + + "qxepZEih5KfhHAVq44RbQMiBA5E2bVBisuNTPUAaA/Fzzsvky8vBq/M5usy8+RXj6" + + "m+mSZCUPpSTTunIUnu0bRLb2inccthEielCThk1FLKQCLSpsAo1h7kzuNJIeeJSCM" + + "cWXpZEURziXwE5KCl3jcY+dOLLMEI05F/UyRwZ/k1a2qW78Bc3DivIh2w/4ZBAS9q" + + "hERIY52y8VcnJ/+/7u45bnpIjkJShZTM1qmzgDCHQa/G5OpnqtI2nDPSNzOpTWA47" + + "6+AH0ZQoUKxHt6MJP3QLpnrw6xPSE2gR19KRvFZr0NtGJ+SPy418eFYMtJgPvOyI4" + + "XwYYCLrmMCkSGrqfbhwKK6rgYMVDg0fsBT1OAZGKD8QM51hXFt8p0HQS0UuddwCTA" + + "/KwyIt6Iw7Leb70yoTEJz3CVU4X4faohXV48gNtZhquawRDvqyB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XhP2YqEJ7yLOaIKCk" + + "AdjOwCtb01L83/LhounfQLxIG8S2SQwMyxYua6k9BpQLJA36y2uu4+3OZIO4JRura" + + "drfjN6hGkGam8EvxM8UwrC//TDOHJUEy3IgNV4B4EJWs9lFTL9PO+kBlRFSeL5Son" + + "jLB/qZC+i8ssJ8oFkIrl+X7rRcooosbVaNvFIR2FpGCdx8bGoFV6pkfwpJ0hO4dOP" + + "nzFm24vBa6UrftojK/z234/h3W0yZScR5CvoSoU+tn1+3G3Q6a4+hdMwF6WjyO3Ne" + + "xfMRSvMkAqOqHiptdnz7QDQ7LgGIF6igtGEIpKo4urPAg+RnwqKG6NIYOA32QmU35" + + "B4+EJhhYZNINZm0NR5ZM0t9BpUiv6DGl8yZiRX1x4Nu35CLlAT8hWSqgMpb8mw5SQ" + + "rQ4dNggVaJ9lO1j1G4hV6umuyX6L1wtOyeQ9aNg3hIZGLPe4pkzahqI2KKlPWpksm" + + "MJVIi5WmlvEmFC/UkkUUICjo3KzKPHq7bYmdmDDNLwf9jOeAfq/UNxu4nO8wPjAhM" + + "AkGBSsOAwIaBQAEFJrJtKCo0WZ7ewFOiudk30HHA6e0BBRXe6IQoFcDFIzKAyXokh" + + "y3daZV4AIDAYag"; } diff -Nru openjdk-13-13.0.3+3/test/jdk/sun/security/x509/X509CertImpl/CertificateValidation.java openjdk-13-13.0.4+8/test/jdk/sun/security/x509/X509CertImpl/CertificateValidation.java --- openjdk-13-13.0.3+3/test/jdk/sun/security/x509/X509CertImpl/CertificateValidation.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-13-13.0.4+8/test/jdk/sun/security/x509/X509CertImpl/CertificateValidation.java 2020-07-07 16:55:29.000000000 +0000 @@ -0,0 +1,60 @@ +/* + * Copyright (c) 2020 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 8238452 + * @modules java.base/sun.security.x509 + * java.base/sun.security.tools.keytool + * @summary This test generates V3 certificate with certain validity period + * and checks whether the validity has expired or not. + */ + +import sun.security.tools.keytool.CertAndKeyGen; +import java.security.cert.X509Certificate; +import java.util.Calendar; +import java.util.Date; +import java.util.TimeZone; +import sun.security.x509.X509CertImpl; +import sun.security.x509.X500Name; + + +public class CertificateValidation { + + public static void main(String[] args) throws Exception { + + Calendar cal = Calendar.getInstance(TimeZone.getTimeZone("GMT")); + cal.set(2050, 00, 01, 01, 00, 00); + Date lastDate = cal.getTime(); + // Seconds till lastDate plus one hour + long validity = (lastDate.getTime() - System.currentTimeMillis())/1000L + 3600; + Date firstDate = new Date(lastDate.getTime() - validity * 1000L); + CertAndKeyGen ckg = new CertAndKeyGen("RSA", "SHA256withRSA"); + ckg.generate(2048); + X509Certificate crt = ckg.getSelfCertificate( + new X500Name("CN=Me"), firstDate, validity); + byte[] encoded = crt.getEncoded(); + X509CertImpl certImpl = new X509CertImpl(encoded); + certImpl.checkValidity(); + } +} diff -Nru openjdk-13-13.0.3+3/test/jdk/sun/text/resources/LocaleData openjdk-13-13.0.4+8/test/jdk/sun/text/resources/LocaleData --- openjdk-13-13.0.3+3/test/jdk/sun/text/resources/LocaleData 2020-02-20 22:05:38.000000000 +0000 +++ openjdk-13-13.0.4+8/test/jdk/sun/text/resources/LocaleData 2020-07-07 16:55:29.000000000 +0000 @@ -8334,3 +8334,17 @@ FormatData/zh/short.Eras/1=\u516c\u5143 FormatData/zh_TW/short.Eras/0=\u897f\u5143\u524d FormatData/zh_TW/short.Eras/1=\u897f\u5143 + +# bug 8234288 +TimeZoneNames/en/Asia\/Istanbul/1=Turkey Time +TimeZoneNames/en/Asia\/Istanbul/2=TRT +TimeZoneNames/en/Asia\/Istanbul/3=Turkey Summer Time +TimeZoneNames/en/Asia\/Istanbul/4=TRST +TimeZoneNames/en/Europe\/Istanbul/1=Turkey Time +TimeZoneNames/en/Europe\/Istanbul/2=TRT +TimeZoneNames/en/Europe\/Istanbul/3=Turkey Summer Time +TimeZoneNames/en/Europe\/Istanbul/4=TRST +TimeZoneNames/en/Turkey/1=Turkey Time +TimeZoneNames/en/Turkey/2=TRT +TimeZoneNames/en/Turkey/3=Turkey Summer Time +TimeZoneNames/en/Turkey/4=TRST diff -Nru openjdk-13-13.0.3+3/test/jdk/sun/text/resources/LocaleDataTest.java openjdk-13-13.0.4+8/test/jdk/sun/text/resources/LocaleDataTest.java --- openjdk-13-13.0.3+3/test/jdk/sun/text/resources/LocaleDataTest.java 2020-02-20 22:05:38.000000000 +0000 +++ openjdk-13-13.0.4+8/test/jdk/sun/text/resources/LocaleDataTest.java 2020-07-07 16:55:29.000000000 +0000 @@ -39,7 +39,7 @@ * 8017142 8037343 8055222 8042126 8074791 8075173 8080774 8129361 8134916 * 8145136 8145952 8164784 8037111 8081643 7037368 8178872 8185841 8190918 * 8187946 8195478 8181157 8179071 8193552 8202026 8204269 8202537 8208746 - * 8209775 8221432 8227127 + * 8209775 8221432 8227127 8234288 * @summary Verify locale data * @modules java.base/sun.util.resources * @modules jdk.localedata diff -Nru openjdk-13-13.0.3+3/test/jdk/sun/tools/jconsole/WorkerDeadlockTest.java openjdk-13-13.0.4+8/test/jdk/sun/tools/jconsole/WorkerDeadlockTest.java --- openjdk-13-13.0.3+3/test/jdk/sun/tools/jconsole/WorkerDeadlockTest.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-13-13.0.4+8/test/jdk/sun/tools/jconsole/WorkerDeadlockTest.java 2020-07-07 16:55:29.000000000 +0000 @@ -0,0 +1,49 @@ +/* + * Copyright (c) 2020, 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 8236872 + * @summary The test tries to catch a deadlock by creating a new worker, + * starting it, adding an empty job and immediately stopping it. + * @modules jdk.jconsole/sun.tools.jconsole + * @run main WorkerDeadlockTest + */ + +import sun.tools.jconsole.Worker; + + +public class WorkerDeadlockTest { + private static final int REPEAT_NUMBER = 1000; + + public static void main(String[] args) { + + for (int i = 1; i < REPEAT_NUMBER; i++) { + Worker worker = new Worker("worker-" + i); + worker.start(); + worker.add(() -> { }); + worker.stopWorker(); + System.out.println("Worker " + i + " was successfully stopped"); + } + } +} diff -Nru openjdk-13-13.0.3+3/test/jdk/sun/tools/jhsdb/JShellHeapDumpTest.java openjdk-13-13.0.4+8/test/jdk/sun/tools/jhsdb/JShellHeapDumpTest.java --- openjdk-13-13.0.3+3/test/jdk/sun/tools/jhsdb/JShellHeapDumpTest.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-13-13.0.4+8/test/jdk/sun/tools/jhsdb/JShellHeapDumpTest.java 2020-07-07 16:55:29.000000000 +0000 @@ -0,0 +1,159 @@ +/* + * 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 8225715 + * @requires vm.hasSAandCanAttach + * @library /test/lib + * @compile JShellHeapDumpTest.java + * @run main/timeout=240 JShellHeapDumpTest + */ + +import static jdk.test.lib.Asserts.assertTrue; + +import java.io.IOException; +import java.io.File; +import java.util.List; +import java.util.Arrays; +import java.util.Map; + +import jdk.test.lib.JDKToolLauncher; +import jdk.test.lib.JDKToolFinder; +import jdk.test.lib.process.OutputAnalyzer; +import jdk.test.lib.process.ProcessTools; +import jdk.test.lib.hprof.parser.HprofReader; + +import jdk.jshell.JShell; + +public class JShellHeapDumpTest { + + protected static Process jShellProcess; + + public static void launch(String expectedMessage, List toolArgs) + throws IOException { + + try { + launchJshell(); + long jShellPID = jShellProcess.pid(); + + System.out.println("Starting " + toolArgs.get(0) + " against " + jShellPID); + JDKToolLauncher launcher = JDKToolLauncher.createUsingTestJDK("jhsdb"); + + for (String cmd : toolArgs) { + launcher.addToolArg(cmd); + } + + launcher.addToolArg("--pid=" + Long.toString(jShellPID)); + + ProcessBuilder processBuilder = new ProcessBuilder(launcher.getCommand()); + OutputAnalyzer output = ProcessTools.executeProcess(processBuilder); + System.out.println("jhsdb jmap stdout:"); + System.out.println(output.getStdout()); + System.out.println("jhsdb jmap stderr:"); + System.out.println(output.getStderr()); + System.out.println("###### End of all output:"); + output.shouldNotContain("null"); + output.shouldHaveExitValue(0); + } catch (Exception ex) { + throw new RuntimeException("Test ERROR " + ex, ex); + } finally { + if (jShellProcess.isAlive()) { + System.out.println("Destroying jshell"); + jShellProcess.destroy(); + System.out.println("Jshell destroyed"); + } else { + System.out.println("Jshell not alive"); + } + } + } + + public static void launch(String expectedMessage, String... toolArgs) + throws IOException { + + launch(expectedMessage, Arrays.asList(toolArgs)); + } + + public static void printStackTraces(String file) throws IOException { + try { + String output = HprofReader.getStack(file, 0); + if (!output.contains("JShellToolProvider")) { + throw new RuntimeException("'JShellToolProvider' missing from stdout/stderr"); + } + } catch (Exception ex) { + throw new RuntimeException("Test ERROR " + ex, ex); + } + } + + public static void testHeapDump() throws IOException { + File hprofFile = new File("jhsdb.jmap.heap." + + System.currentTimeMillis() + ".hprof"); + if (hprofFile.exists()) { + hprofFile.delete(); + } + + launch("heap written to", "jmap", + "--binaryheap", "--dumpfile=" + hprofFile.getAbsolutePath()); + + assertTrue(hprofFile.exists() && hprofFile.isFile(), + "Could not create dump file " + hprofFile.getAbsolutePath()); + + printStackTraces(hprofFile.getAbsolutePath()); + + System.out.println("hprof file size: " + hprofFile.length()); + hprofFile.delete(); + } + + public static void launchJshell() throws IOException { + System.out.println("Starting Jshell"); + long startTime = System.currentTimeMillis(); + try { + ProcessBuilder pb = new ProcessBuilder(JDKToolFinder.getTestJDKTool("jshell")); + jShellProcess = ProcessTools.startProcess("JShell", pb, + s -> { // warm-up predicate + return s.contains("Welcome to JShell"); + }); + } catch (Exception ex) { + throw new RuntimeException("Test ERROR " + ex, ex); + } + + long elapsedTime = System.currentTimeMillis() - startTime; + System.out.println("Jshell Started in " + elapsedTime + "ms"); + + // Give jshell a chance to fully start up. This makes SA more stable for the jmap dump. + try { + Thread.sleep(2000); + } catch (Exception e) { + } + } + + public static void main(String[] args) throws Exception { + + testHeapDump(); + + // The test throws RuntimeException on error. + // IOException is thrown if Jshell can't start because of some bad + // environment condition + System.out.println("Test PASSED"); + } +} diff -Nru openjdk-13-13.0.3+3/test/jdk/tools/jlink/plugins/AddOptionsPluginTest.java openjdk-13-13.0.4+8/test/jdk/tools/jlink/plugins/AddOptionsPluginTest.java --- openjdk-13-13.0.3+3/test/jdk/tools/jlink/plugins/AddOptionsPluginTest.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-13-13.0.4+8/test/jdk/tools/jlink/plugins/AddOptionsPluginTest.java 2020-07-07 16:55:29.000000000 +0000 @@ -0,0 +1,73 @@ +/* + * 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 jdk.test.lib.process.*; + +import tests.Helper; + +/* @test + * @bug 8232080 + * @summary Test the --add-options plugin + * @library ../../lib + * @library /test/lib + * @modules java.base/jdk.internal.jimage + * jdk.jdeps/com.sun.tools.classfile + * jdk.jlink/jdk.tools.jlink.internal + * jdk.jlink/jdk.tools.jmod + * jdk.jlink/jdk.tools.jimage + * jdk.compiler + * @build tests.* + * @run main AddOptionsPluginTest + */ + +public class AddOptionsPluginTest { + + private static final String PROP = "add.options.plugin.test"; + private static final String VALUE = "xyzzy"; + private static final String OPTS = "-D" + PROP + "=" + VALUE; + + public static void main(String[] args) throws Throwable { + + Helper helper = Helper.newHelper(); + if (helper == null) { + System.err.println("Test not run"); + return; + } + + var module = "addoptions"; + helper.generateDefaultJModule(module); + var image = helper.generateDefaultImage(new String[] { "--add-options", OPTS }, + module) + .assertSuccess(); + helper.checkImage(image, module, null, null); + + var launcher = image.resolve("bin/java" + + (System.getProperty("os.name").startsWith("Windows") + ? ".exe" : "")); + var oa = ProcessTools.executeProcess(launcher.toString(), + "-XshowSettings:properties", "--version"); + oa.stderrShouldMatch("^ +" + PROP + " = " + VALUE + "$"); + + } + +} diff -Nru openjdk-13-13.0.3+3/test/jdk/tools/jlink/plugins/VendorInfoPluginsTest.java openjdk-13-13.0.4+8/test/jdk/tools/jlink/plugins/VendorInfoPluginsTest.java --- openjdk-13-13.0.3+3/test/jdk/tools/jlink/plugins/VendorInfoPluginsTest.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-13-13.0.4+8/test/jdk/tools/jlink/plugins/VendorInfoPluginsTest.java 2020-07-07 16:55:29.000000000 +0000 @@ -0,0 +1,107 @@ +/* + * 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 jdk.test.lib.process.*; + +import tests.Helper; + +/* @test + * @bug 8232080 + * @summary Test the --vendor-version --vendor-url-bug plugins + * @library ../../lib + * @library /test/lib + * @modules java.base/jdk.internal.jimage + * jdk.jdeps/com.sun.tools.classfile + * jdk.jlink/jdk.tools.jlink.internal + * jdk.jlink/jdk.tools.jmod + * jdk.jlink/jdk.tools.jimage + * jdk.compiler + * @build tests.* + * @run main VendorInfoPluginsTest + */ + +public class VendorInfoPluginsTest { + + public static class Crasher { + + public static void main(String ... args) throws Exception { + var uc = Class.forName("sun.misc.Unsafe"); + var f = uc.getDeclaredField("theUnsafe"); + f.setAccessible(true); + var u = (sun.misc.Unsafe)f.get(null); + for (long a = 0; a < Long.MAX_VALUE; a += 8) + u.putLong(a, -1L); + } + + } + + private static final String VERSION = "XyzzyVM 3.14.15"; + private static final String BUG_URL = "https://bugs.xyzzy.com/"; + private static final String VM_BUG_URL = "https://bugs.xyzzy.com/crash/"; + + public static void main(String[] args) throws Throwable { + + Helper helper = Helper.newHelper(); + if (helper == null) { + System.err.println("Test not run"); + return; + } + + var module = "vendorinfo"; + helper.generateDefaultJModule(module); + var image = helper.generateDefaultImage(new String[] { + "--add-modules", "jdk.unsupported", + "--vendor-version", VERSION, + "--vendor-bug-url", BUG_URL, + "--vendor-vm-bug-url", VM_BUG_URL }, + module).assertSuccess(); + helper.checkImage(image, module, null, null); + + // Properties and --version + var launcher + = image.resolve("bin/java" + + (System.getProperty("os.name").startsWith("Windows") + ? ".exe" : "")).toString(); + var oa = ProcessTools.executeProcess(launcher, + "-Xmx64m", + "-XshowSettings:properties", + "--version"); + oa.stderrShouldMatch("^ +java.vendor.url.bug = " + BUG_URL + "$"); + oa.stderrShouldMatch("^ +java.vendor.version = " + VERSION + "$"); + oa.stdoutShouldMatch("^.*Runtime Environment " + VERSION + " \\(.*build.*$"); + oa.stdoutShouldMatch("^.*VM " + VERSION + " \\(.*build.*$"); + + // VM error log + oa = ProcessTools.executeProcess(launcher, + "-Xmx64m", + "-XX:-CreateCoredumpOnCrash", + "--class-path", + System.getProperty("test.classes"), + "VendorInfoPluginsTest$Crasher"); + oa.stdoutShouldMatch("^# +" + VM_BUG_URL + "$"); + oa.stdoutShouldMatch("^.*Runtime Environment " + VERSION + " \\(.*$"); + oa.stdoutShouldMatch("^.*VM " + VERSION + " \\(.*$"); + + } + +} diff -Nru openjdk-13-13.0.3+3/test/jdk/tools/launcher/ArgFileSyntax.java openjdk-13-13.0.4+8/test/jdk/tools/launcher/ArgFileSyntax.java --- openjdk-13-13.0.3+3/test/jdk/tools/launcher/ArgFileSyntax.java 2020-02-20 22:05:38.000000000 +0000 +++ openjdk-13-13.0.4+8/test/jdk/tools/launcher/ArgFileSyntax.java 2020-07-07 16:55:29.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2020, 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,7 +23,7 @@ /** * @test - * @bug 8027634 8210810 + * @bug 8027634 8210810 8240629 * @summary Verify syntax of argument file * @build TestHelper * @run main ArgFileSyntax @@ -36,7 +36,6 @@ import java.util.HashMap; import java.util.List; import java.util.Map; -import java.util.regex.Matcher; import java.util.regex.Pattern; public class ArgFileSyntax extends TestHelper { @@ -213,10 +212,28 @@ scratch.add(bag + "'" + filling + "\\\\aaa\\\\'"); scratch.add(ver); rv.add(List.of(scratch, List.of(bag + filling + "\\aaa\\", ver))); - return rv; } + // 8240629: end or start comment at boundary + @Test + public void test8240629() throws IOException { + char[] data = new char[ARG_FILE_PARSER_BUF_SIZE]; + data[0] = '#'; + Arrays.fill(data, 1, data.length, '0'); + + int need = ARG_FILE_PARSER_BUF_SIZE - System.lineSeparator().length(); + // Comment end before, at, after boundary + for (int count = need - 1; count <= need + 1 ; count++) { + String commentAtBoundary = String.valueOf(data, 0, count); + List content = new ArrayList<>(); + content.add(commentAtBoundary); + content.add("# start a new comment at boundary"); + content.add("-Dfoo=bar"); + verifyParsing(content, List.of("-Dfoo=bar")); + } + } + // ensure the arguments in the file are read in correctly private void verifyParsing(List lines, List args) throws IOException { File argFile = createArgFile(lines); diff -Nru openjdk-13-13.0.3+3/test/jdk/tools/launcher/ArgsFileTest.java openjdk-13-13.0.4+8/test/jdk/tools/launcher/ArgsFileTest.java --- openjdk-13-13.0.3+3/test/jdk/tools/launcher/ArgsFileTest.java 2020-02-20 22:05:38.000000000 +0000 +++ openjdk-13-13.0.4+8/test/jdk/tools/launcher/ArgsFileTest.java 2020-07-07 16:55:29.000000000 +0000 @@ -23,7 +23,7 @@ /** * @test - * @bug 8027634 + * @bug 8027634 8231863 * @summary Argument parsing from file * @modules jdk.compiler * jdk.zipfs @@ -61,13 +61,17 @@ env.put(JLDEBUG_KEY, "true"); } - private File createArgFile(String fname, List lines) throws IOException { + private File createArgFile(String fname, List lines, boolean endWithNewline) throws IOException { File argFile = new File(fname); argFile.delete(); - createAFile(argFile, lines); + createAFile(argFile, lines, endWithNewline); return argFile; } + private File createArgFile(String fname, List lines) throws IOException { + return createArgFile(fname, lines, true); + } + private void verifyOptions(List args, TestResult tr) { if (args.isEmpty()) { return; @@ -266,6 +270,23 @@ userArgs.delete(); } + @Test + public void userApplicationWithoutEmptyLastLine() throws IOException { + File cpOpt = createArgFile("cpOpt", Arrays.asList("-classpath ."), false); + File vmArgs = createArgFile("vmArgs", Arrays.asList("-Xint"), false); + + TestResult tr = doExec(env, javaCmd, "-cp", "test.jar", "@cpOpt", "Foo", "-test"); + verifyOptions(Arrays.asList("-cp", "test.jar", "-classpath", ".", "Foo", "-test"), tr); + verifyUserArgs(Arrays.asList("-test"), tr, 6); + + tr = doExec(env, javaCmd, "-cp", "test.jar", "@vmArgs", "Foo", "-test"); + verifyOptions(Arrays.asList("-cp", "test.jar", "-Xint", "Foo", "-test"), tr); + verifyUserArgs(Arrays.asList("-test"), tr, 5); + + cpOpt.delete(); + vmArgs.delete(); + } + // test with missing file @Test public void missingFileNegativeTest() throws IOException { diff -Nru openjdk-13-13.0.3+3/test/jdk/tools/launcher/HelpFlagsTest.java openjdk-13-13.0.4+8/test/jdk/tools/launcher/HelpFlagsTest.java --- openjdk-13-13.0.3+3/test/jdk/tools/launcher/HelpFlagsTest.java 2020-02-20 22:05:38.000000000 +0000 +++ openjdk-13-13.0.4+8/test/jdk/tools/launcher/HelpFlagsTest.java 2020-07-07 16:55:29.000000000 +0000 @@ -1,6 +1,6 @@ /* - * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2018 SAP SE. All rights reserved. + * Copyright (c) 2018, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2020 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 @@ -40,14 +40,6 @@ */ import java.io.File; -import java.io.FileFilter; -import java.util.Map; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.HashSet; -import java.util.Set; - public class HelpFlagsTest extends TestHelper { @@ -165,23 +157,6 @@ new ToolHelpSpec("javapackager",0, 0, 0, 0, 1, 0, 255), // -help accepted but not documented. }; - // Returns true if the file is not a tool. - static boolean notATool(String file) { - if (isWindows && !file.endsWith(EXE_FILE_EXT)) - return true; - return false; - } - - // Returns true if tool is listed in TOOLS_NOT_TO_TEST. - static boolean dontTestTool(String tool) { - tool = tool.toLowerCase(); - for (String x : TOOLS_NOT_TO_TEST) { - if (tool.toLowerCase().startsWith(x)) - return true; - } - return false; - } - // Returns corresponding object from jdkTools array. static ToolHelpSpec getToolHelpSpec(String tool) { for (ToolHelpSpec x : jdkTools) { @@ -356,18 +331,9 @@ // help messages. Thus it only works with english locale. if (!isEnglishLocale()) { return; } - for (File f : new File(JAVA_BIN).listFiles()) { + for (File f : new File(JAVA_BIN).listFiles(new ToolFilter(TOOLS_NOT_TO_TEST))) { String toolName = f.getName(); - if (notATool(toolName)) { - continue; - } - if (dontTestTool(toolName)) { - System.out.println("Skipping test of tool " + toolName + - ". Tool has no help message."); - continue; - } - ToolHelpSpec tool = getToolHelpSpec(toolName); if (tool == null) { errorMessage += "Tool " + toolName + " not covered by this test. " + diff -Nru openjdk-13-13.0.3+3/test/jdk/tools/launcher/TestHelper.java openjdk-13-13.0.4+8/test/jdk/tools/launcher/TestHelper.java --- openjdk-13-13.0.3+3/test/jdk/tools/launcher/TestHelper.java 2020-02-20 22:05:38.000000000 +0000 +++ openjdk-13-13.0.4+8/test/jdk/tools/launcher/TestHelper.java 2020-07-07 16:55:29.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2008, 2020, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -100,10 +100,12 @@ // make a note of the golden default locale static final Locale DefaultLocale = Locale.getDefault(); - static final String JAVA_FILE_EXT = ".java"; - static final String CLASS_FILE_EXT = ".class"; - static final String JAR_FILE_EXT = ".jar"; - static final String EXE_FILE_EXT = ".exe"; + static final String JAVA_FILE_EXT = ".java"; + static final String CLASS_FILE_EXT = ".class"; + static final String JAR_FILE_EXT = ".jar"; + static final String EXE_FILE_EXT = ".exe"; + static final String MAC_DSYM_EXT = ".dsym"; + static final String NIX_DBGINFO_EXT = ".debuginfo"; static final String JLDEBUG_KEY = "_JAVA_LAUNCHER_DEBUG"; static final String EXPECTED_MARKER = "TRACER_MARKER:About to EXEC"; static final String TEST_PREFIX = "###TestError###: "; @@ -349,12 +351,23 @@ * occurs then back off for a moment and try again. When a number of * attempts fail, give up and throw an exception. */ - void createAFile(File aFile, List contents) throws IOException { + void createAFile(File aFile, List lines) throws IOException { + createAFile(aFile, lines, true); + } + + void createAFile(File aFile, List lines, boolean endWithNewline) throws IOException { IOException cause = null; for (int attempts = 0; attempts < 10; attempts++) { try { - Files.write(aFile.getAbsoluteFile().toPath(), contents, - Charset.defaultCharset(), CREATE, TRUNCATE_EXISTING, WRITE); + if (endWithNewline) { + Files.write(aFile.getAbsoluteFile().toPath(), + lines, Charset.defaultCharset(), + CREATE, TRUNCATE_EXISTING, WRITE); + } else { + Files.write(aFile.getAbsoluteFile().toPath(), + String.join(System.lineSeparator(), lines).getBytes(Charset.defaultCharset()), + CREATE, TRUNCATE_EXISTING, WRITE); + } if (cause != null) { /* * report attempts and errors that were encountered @@ -489,6 +502,43 @@ return Locale.getDefault().getLanguage().equals("en"); } + static class ToolFilter implements FileFilter { + final List exclude = new ArrayList<>(); + protected ToolFilter(String... exclude) { + for (String x : exclude) { + String str = x + ((isWindows) ? EXE_FILE_EXT : ""); + this.exclude.add(str.toLowerCase()); + } + } + + @Override + public boolean accept(File pathname) { + if (!pathname.isFile() || !pathname.canExecute()) { + return false; + } + String name = pathname.getName().toLowerCase(); + if (isWindows) { + if (!name.endsWith(EXE_FILE_EXT)) { + return false; + } + } else if (isMacOSX) { + if (name.endsWith(MAC_DSYM_EXT)) { + return false; + } + } else { + if (name.endsWith(NIX_DBGINFO_EXT)) { + return false; + } + } + for (String x : exclude) { + if (name.endsWith(x)) { + return false; + } + } + return true; + } + } + /* * A class to encapsulate the test results and stuff, with some ease * of use methods to check the test results. diff -Nru openjdk-13-13.0.3+3/test/jdk/tools/launcher/VersionCheck.java openjdk-13-13.0.4+8/test/jdk/tools/launcher/VersionCheck.java --- openjdk-13-13.0.3+3/test/jdk/tools/launcher/VersionCheck.java 2020-02-20 22:05:38.000000000 +0000 +++ openjdk-13-13.0.4+8/test/jdk/tools/launcher/VersionCheck.java 2020-07-07 16:55:29.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2020, 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,12 +33,11 @@ */ import java.io.File; -import java.io.FileFilter; -import java.util.Map; import java.util.ArrayList; import java.util.HashMap; -import java.util.List; import java.util.HashSet; +import java.util.List; +import java.util.Map; import java.util.Set; public class VersionCheck extends TestHelper { @@ -281,32 +280,4 @@ throw new AssertionError("VersionCheck failed: " + errorMessage); } } - - static class ToolFilter implements FileFilter { - final Iterable exclude; - protected ToolFilter(String... exclude) { - List tlist = new ArrayList<>(); - this.exclude = tlist; - for (String x : exclude) { - String str = x + ((isWindows) ? EXE_FILE_EXT : ""); - tlist.add(str.toLowerCase()); - } - } - @Override - public boolean accept(File pathname) { - if (!pathname.isFile() || !pathname.canExecute()) { - return false; - } - String name = pathname.getName().toLowerCase(); - if (isWindows && !name.endsWith(EXE_FILE_EXT)) { - return false; - } - for (String x : exclude) { - if (name.endsWith(x)) { - return false; - } - } - return true; - } - } } diff -Nru openjdk-13-13.0.3+3/test/jtreg-ext/requires/VMProps.java openjdk-13-13.0.4+8/test/jtreg-ext/requires/VMProps.java --- openjdk-13-13.0.3+3/test/jtreg-ext/requires/VMProps.java 2020-02-20 22:05:38.000000000 +0000 +++ openjdk-13-13.0.4+8/test/jtreg-ext/requires/VMProps.java 2020-07-07 16:55:29.000000000 +0000 @@ -235,7 +235,22 @@ */ protected String vmJvmci() { // builds with jvmci have this flag - return "" + (WB.getBooleanVMFlag("EnableJVMCI") != null); + if (WB.getBooleanVMFlag("EnableJVMCI") == null) { + return "false"; + } + + switch (GC.selected()) { + case Serial: + case Parallel: + case G1: + // These GCs are supported with JVMCI + return "true"; + default: + break; + } + + // Every other GC is not supported + return "false"; } /** @@ -356,7 +371,24 @@ } else { jaotc = bin.resolve("jaotc"); } - return "" + Files.exists(jaotc); + + if (!Files.exists(jaotc)) { + // No jaotc => no AOT + return "false"; + } + + switch (GC.selected()) { + case Serial: + case Parallel: + case G1: + // These GCs are supported with AOT + return "true"; + default: + break; + } + + // Every other GC is not supported + return "false"; } /* diff -Nru openjdk-13-13.0.3+3/test/langtools/tools/javac/file/FSInfoTest.java openjdk-13-13.0.4+8/test/langtools/tools/javac/file/FSInfoTest.java --- openjdk-13-13.0.3+3/test/langtools/tools/javac/file/FSInfoTest.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-13-13.0.4+8/test/langtools/tools/javac/file/FSInfoTest.java 2020-07-07 16:55:29.000000000 +0000 @@ -0,0 +1,78 @@ +/* + * 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 com.sun.tools.javac.file.FSInfo; +import com.sun.tools.javac.util.Context; +import org.testng.annotations.Test; + +import java.io.IOException; +import java.nio.file.Files; +import java.nio.file.Path; +import java.util.Locale; +import java.util.jar.JarOutputStream; +import java.util.jar.Manifest; + +/* + * @test + * @bug 8232170 + * @summary Test com.sun.tools.javac.file.FSInfo + * @modules jdk.compiler/com.sun.tools.javac.util + * jdk.compiler/com.sun.tools.javac.file + * @run testng FSInfoTest + */ +public class FSInfoTest { + + /** + * Tests that if a jar file has a manifest with a invalid path value for {@code Class-Path} attribute, + * then parsing such a jar file through {@link FSInfo#getJarClassPath(Path)} doesn't throw any other + * exception other than {@link IOException} + * + * @throws Exception + */ + @Test + public void testInvalidClassPath() throws Exception { + final String invalidOSPath = System.getProperty("os.name").toLowerCase(Locale.ENGLISH).contains("windows") + ? "C:\\*" : "foo\u0000bar"; + final Path jarFile = Files.createTempFile(null, ".jar"); + jarFile.toFile().deleteOnExit(); + final Manifest mf = new Manifest(); + mf.getMainAttributes().putValue("Manifest-Version", "1.0"); + // add Class-Path which points to an invalid path + System.out.println("Intentionally using an invalid Class-Path entry " + invalidOSPath + " in manifest"); + mf.getMainAttributes().putValue("Class-Path", invalidOSPath + " " + "/some/other-random/path"); + + // create a jar file with the manifest + try (final JarOutputStream jar = new JarOutputStream(Files.newOutputStream(jarFile), mf)) { + } + final FSInfo fsInfo = FSInfo.instance(new Context()); + try { + fsInfo.getJarClassPath(jarFile); + // we don't rely on fsInfo.getJarClassPath to throw an exception for invalid + // paths. Hence no Assert.fail(...) call here. But if it does throw some exception, + // then that exception should always be a IOException. + } catch (IOException ioe) { + // expected + System.out.println("(As expected) FSInfo.getJarClassPath threw an IOException - " + ioe.getMessage()); + } + } +} diff -Nru openjdk-13-13.0.3+3/test/langtools/tools/javac/lambda/lambdaExpression/LambdaTest6.java openjdk-13-13.0.4+8/test/langtools/tools/javac/lambda/lambdaExpression/LambdaTest6.java --- openjdk-13-13.0.3+3/test/langtools/tools/javac/lambda/lambdaExpression/LambdaTest6.java 2020-02-20 22:05:38.000000000 +0000 +++ openjdk-13-13.0.4+8/test/langtools/tools/javac/lambda/lambdaExpression/LambdaTest6.java 2020-07-07 16:55:29.000000000 +0000 @@ -26,8 +26,11 @@ * @bug 8003280 * @summary Add lambda tests * Test bridge methods for certain SAM conversions + * Tests that jdk.internal.lambda.disableEagerInitialization=true creates a + * get$Lambda method for non-capturing lambdas * @compile LambdaTest6.java * @run main LambdaTest6 + * @run main/othervm -Djdk.internal.lambda.disableEagerInitialization=true LambdaTest6 */ import java.lang.reflect.Method; @@ -60,18 +63,37 @@ return s; } + private static Set allowedMethods() { + Set s = new HashSet<>(); + s.add("m"); + if (Boolean.getBoolean("jdk.internal.lambda.disableEagerInitialization")) { + s.add("get$Lambda"); + } + return s; + } + + private static boolean matchingMethodNames(Method[] methods) { + Set methodNames = new HashSet<>(); + for (Method m : methods) { + methodNames.add(m.getName()); + } + return methodNames.equals(allowedMethods()); + } + private void test1() { L la = s -> { }; la.m("hi"); Class c1 = la.getClass(); Method[] methods = c1.getDeclaredMethods(); + assertTrue(matchingMethodNames(methods)); Set types = setOfStringObject(); for(Method m : methods) { - assertTrue(m.getName().equals("m")); - Class[] parameterTypes = m.getParameterTypes(); - assertTrue(parameterTypes.length == 1); - assertTrue(types.remove(parameterTypes[0].getName())); + if ("m".equals(m.getName())) { + Class[] parameterTypes = m.getParameterTypes(); + assertTrue(parameterTypes.length == 1); + assertTrue(types.remove(parameterTypes[0].getName())); + } } assertTrue(types.isEmpty() || (types.size() == 1 && types.contains("java.lang.String"))); } @@ -82,12 +104,14 @@ //km.m("hi"); Class c2 = km.getClass(); Method[] methods = c2.getDeclaredMethods(); + assertTrue(matchingMethodNames(methods)); Set types = setOfStringObject(); for(Method m : methods) { - assertTrue(m.getName().equals("m")); - Class[] parameterTypes = m.getParameterTypes(); - assertTrue(parameterTypes.length == 1); - assertTrue(types.remove(parameterTypes[0].getName())); + if ("m".equals(m.getName())) { + Class[] parameterTypes = m.getParameterTypes(); + assertTrue(parameterTypes.length == 1); + assertTrue(types.remove(parameterTypes[0].getName())); + } } assertTrue(types.isEmpty()); } @@ -99,11 +123,13 @@ assertTrue( ((H)na).m().equals("hi") ); Class c3 = na.getClass(); Method[] methods = c3.getDeclaredMethods(); + assertTrue(matchingMethodNames(methods)); Set types = setOfStringObject(); for(Method m : methods) { - assertTrue(m.getName().equals("m")); - Class returnType = m.getReturnType(); - assertTrue(types.remove(returnType.getName())); + if ("m".equals(m.getName())) { + Class returnType = m.getReturnType(); + assertTrue(types.remove(returnType.getName())); + } } assertTrue(types.size() == 1); //there's a bridge } diff -Nru openjdk-13-13.0.3+3/test/langtools/tools/javac/lambda/methodReference/BridgeMethod.java openjdk-13-13.0.4+8/test/langtools/tools/javac/lambda/methodReference/BridgeMethod.java --- openjdk-13-13.0.3+3/test/langtools/tools/javac/lambda/methodReference/BridgeMethod.java 2020-02-20 22:05:38.000000000 +0000 +++ openjdk-13-13.0.4+8/test/langtools/tools/javac/lambda/methodReference/BridgeMethod.java 2020-07-07 16:55:29.000000000 +0000 @@ -26,11 +26,15 @@ * @bug 8003280 * @summary Add lambda tests * Test bridge methods in certain SAM conversion + * Tests that jdk.internal.lambda.disableEagerInitialization=true creates a + * get$Lambda method for non-capturing lambdas * @compile BridgeMethod.java * @run main BridgeMethod + * @run main/othervm -Djdk.internal.lambda.disableEagerInitialization=true BridgeMethod */ import java.lang.reflect.Method; +import java.util.Arrays; import java.util.HashSet; import java.util.Set; @@ -68,19 +72,38 @@ return s; } + private static Set allowedMethods() { + Set s = new HashSet<>(); + s.add("m"); + if (Boolean.getBoolean("jdk.internal.lambda.disableEagerInitialization")) { + s.add("get$Lambda"); + } + return s; + } + + private static boolean matchingMethodNames(Method[] methods) { + Set methodNames = new HashSet<>(); + for (Method m : methods) { + methodNames.add(m.getName()); + } + return methodNames.equals(allowedMethods()); + } + public static void main(String[] args) { L la = BridgeMethod::bar; //static reference la.m("hi"); Class c1 = la.getClass(); Method[] methods = c1.getDeclaredMethods(); + assertTrue(matchingMethodNames(methods)); Set types = setOfStringObject(); System.out.println("methods in SAM conversion of L:"); for(Method m : methods) { - System.out.println(m.toGenericString()); - assertTrue(m.getName().equals("m")); - Class[] parameterTypes = m.getParameterTypes(); - assertTrue(parameterTypes.length == 1); - assertTrue(types.remove(parameterTypes[0].getName())); + if (m.getName().equals("m")) { + System.out.println(m.toGenericString()); + Class[] parameterTypes = m.getParameterTypes(); + assertTrue(parameterTypes.length == 1); + assertTrue(types.remove(parameterTypes[0].getName())); + } } assertTrue(types.isEmpty() || (types.size() == 1 && types.contains("java.lang.String"))); @@ -88,14 +111,16 @@ //km.m("hi"); //will be uncommented when CR7028808 fixed Class c2 = km.getClass(); methods = c2.getDeclaredMethods(); + assertTrue(matchingMethodNames(methods)); types = setOfStringObject(); System.out.println("methods in SAM conversion of KM:"); for(Method m : methods) { - System.out.println(m.toGenericString()); - assertTrue(m.getName().equals("m")); - Class[] parameterTypes = m.getParameterTypes(); - assertTrue(parameterTypes.length == 1); - assertTrue(types.remove(parameterTypes[0].getName())); + if (m.getName().equals("m")) { + System.out.println(m.toGenericString()); + Class[] parameterTypes = m.getParameterTypes(); + assertTrue(parameterTypes.length == 1); + assertTrue(types.remove(parameterTypes[0].getName())); + } } assertTrue(types.isEmpty()); diff -Nru openjdk-13-13.0.3+3/test/lib/jdk/test/lib/cds/CDSTestUtils.java openjdk-13-13.0.4+8/test/lib/jdk/test/lib/cds/CDSTestUtils.java --- openjdk-13-13.0.3+3/test/lib/jdk/test/lib/cds/CDSTestUtils.java 2020-02-20 22:05:38.000000000 +0000 +++ openjdk-13-13.0.4+8/test/lib/jdk/test/lib/cds/CDSTestUtils.java 2020-07-07 16:55:29.000000000 +0000 @@ -309,7 +309,7 @@ // exceptions match. Pass null if you wish not to re-throw any exception. public static void checkCommonExecExceptions(OutputAnalyzer output, Exception e) throws Exception { - if (output.getStdout().contains("http://bugreport.java.com/bugreport/crash.jsp")) { + if (output.getStdout().contains("https://bugreport.java.com/bugreport/crash.jsp")) { throw new RuntimeException("Hotspot crashed"); } if (output.getStdout().contains("TEST FAILED")) { diff -Nru openjdk-13-13.0.3+3/test/lib/sun/hotspot/WhiteBox.java openjdk-13-13.0.4+8/test/lib/sun/hotspot/WhiteBox.java --- openjdk-13-13.0.3+3/test/lib/sun/hotspot/WhiteBox.java 2020-02-20 22:05:38.000000000 +0000 +++ openjdk-13-13.0.4+8/test/lib/sun/hotspot/WhiteBox.java 2020-07-07 16:55:29.000000000 +0000 @@ -219,6 +219,9 @@ public native long NMTMallocWithPseudoStackAndType(long size, int index, int type); public native boolean NMTChangeTrackingLevel(); public native int NMTGetHashSize(); + public native long NMTNewArena(long initSize); + public native void NMTFreeArena(long arena); + public native void NMTArenaMalloc(long arena, long size); // Compiler public native int matchesMethod(Executable method, String pattern); diff -Nru openjdk-13-13.0.3+3/test/micro/org/openjdk/bench/java/math/FpRoundingBenchmark.java openjdk-13-13.0.4+8/test/micro/org/openjdk/bench/java/math/FpRoundingBenchmark.java --- openjdk-13-13.0.3+3/test/micro/org/openjdk/bench/java/math/FpRoundingBenchmark.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-13-13.0.4+8/test/micro/org/openjdk/bench/java/math/FpRoundingBenchmark.java 2020-07-07 16:55:29.000000000 +0000 @@ -0,0 +1,78 @@ +// +// 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 +// 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.bench.java.math; + +import java.util.Random; +import java.util.concurrent.TimeUnit; +import org.openjdk.jmh.annotations.*; +import org.openjdk.jmh.infra.Blackhole; + +@OutputTimeUnit(TimeUnit.MILLISECONDS) +@State(Scope.Thread) +public class FpRoundingBenchmark { + + @Param({"1024"}) + public int TESTSIZE; + + public double[] DargV1; + + public double[] Res; + + public final double[] DspecialVals = { + 0.0, -0.0, Double.NaN, Double.NEGATIVE_INFINITY, Double.POSITIVE_INFINITY}; + + @Setup(Level.Trial) + public void BmSetup() { + int i = 0; + Random r = new Random(1024); + DargV1 = new double[TESTSIZE]; + Res = new double[TESTSIZE]; + + for (; i < DspecialVals.length; i++) { + DargV1[i] = DspecialVals[i]; + } + + for (; i < TESTSIZE; i++) { + DargV1[i] = r.nextDouble()*TESTSIZE; + } + } + + @Benchmark + public void testceil(Blackhole bh) { + for (int i = 0; i < TESTSIZE; i++) + Res[i] = Math.ceil(DargV1[i]); + } + + @Benchmark + public void testfloor(Blackhole bh) { + for (int i = 0; i < TESTSIZE; i++) + Res[i] = Math.floor(DargV1[i]); + } + + @Benchmark + public void testrint(Blackhole bh) { + for (int i = 0; i < TESTSIZE; i++) + Res[i] = Math.rint(DargV1[i]); + } +} diff -Nru openjdk-13-13.0.3+3/test/micro/org/openjdk/bench/java/text/DefFormatterBench.java openjdk-13-13.0.4+8/test/micro/org/openjdk/bench/java/text/DefFormatterBench.java --- openjdk-13-13.0.3+3/test/micro/org/openjdk/bench/java/text/DefFormatterBench.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-13-13.0.4+8/test/micro/org/openjdk/bench/java/text/DefFormatterBench.java 2020-07-07 16:55:29.000000000 +0000 @@ -0,0 +1,82 @@ +/* + * Copyright (c) 2020, 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.bench.java.text; + +import java.text.NumberFormat; +import java.util.Locale; +import java.util.concurrent.TimeUnit; + +import org.openjdk.jmh.annotations.Benchmark; +import org.openjdk.jmh.annotations.BenchmarkMode; +import org.openjdk.jmh.annotations.Fork; +import org.openjdk.jmh.annotations.Measurement; +import org.openjdk.jmh.annotations.Mode; +import org.openjdk.jmh.annotations.OutputTimeUnit; +import org.openjdk.jmh.annotations.Param; +import org.openjdk.jmh.annotations.Scope; +import org.openjdk.jmh.annotations.State; +import org.openjdk.jmh.annotations.Warmup; +import org.openjdk.jmh.infra.Blackhole; +import org.openjdk.jmh.runner.Runner; +import org.openjdk.jmh.runner.options.Options; +import org.openjdk.jmh.runner.options.OptionsBuilder; + +@BenchmarkMode(Mode.Throughput) +@OutputTimeUnit(TimeUnit.MILLISECONDS) +@Warmup(iterations = 5, time = 5, timeUnit = TimeUnit.SECONDS) +@Measurement(iterations = 5, time = 10, timeUnit = TimeUnit.SECONDS) +@Fork(1) +@State(Scope.Benchmark) +public class DefFormatterBench { + + @Param({"1.23", "1.49", "1.80", "1.7", "0.0", "-1.49", "-1.50", "9999.9123", "1.494", "1.495", "1.03", "25.996", "-25.996"}) + public double value; + + private DefNumerFormat dnf = new DefNumerFormat(); + + @Benchmark + public void testDefNumberFormatter(final Blackhole blackhole) { + blackhole.consume(this.dnf.format(this.value)); + } + + public static void main(String... args) throws Exception { + Options opts = new OptionsBuilder().include(DefFormatterBench.class.getSimpleName()).shouldDoGC(true).build(); + new Runner(opts).run(); + } + + private static class DefNumerFormat { + + private final NumberFormat n; + + public DefNumerFormat() { + this.n = NumberFormat.getInstance(Locale.ENGLISH); + this.n.setMaximumFractionDigits(2); + this.n.setMinimumFractionDigits(2); + this.n.setGroupingUsed(false); + } + + public String format(final double d) { + return this.n.format(d); + } + } +}